Skip to content

Commit

Permalink
Merge branch 'primefaces:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumujianguang authored Sep 24, 2024
2 parents 5c77c9f + 94a54fc commit 931158c
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Add Unit Test Fail Comment
if: always() && steps.unitTest.outcome == 'failure'
uses: thollander/actions-comment-pull-request@v1
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Thanks a lot for your contribution! But, Unit tests failed. You can check the unit tests with the command 'npm run test:unit' and commit the changes.
Expand Down
4 changes: 2 additions & 2 deletions apps/showcase/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -40671,7 +40671,7 @@
"optional": true,
"readonly": false,
"type": "string",
"default": "'{0} items selected'",
"default": "null",
"description": "Label to display after exceeding max selected labels."
},
{
Expand Down Expand Up @@ -40831,7 +40831,7 @@
"optional": true,
"readonly": false,
"type": "string",
"default": "'{0} items selected'",
"default": "null",
"description": "Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration."
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/scripts/components/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const MultiSelectProps = [
name: 'selectedItemsLabel',
type: 'string',
default: '{0} items selected',
description: 'Label to display after exceeding max selected labels.'
description: 'Label to display after exceeding max selected labels. Defaults to value from PrimeVue locale configuration.'
},
{
name: 'maxSelectedLabels',
Expand Down
3 changes: 1 addition & 2 deletions packages/primevue/src/datatable/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ import {
getOffset,
getOuterHeight,
getOuterWidth,
getWindowScrollTop,
isClickable,
removeClass,
setAttribute
Expand Down Expand Up @@ -1533,7 +1532,7 @@ export default {
if (this.rowDragging && this.draggedRowIndex !== index) {
let rowElement = event.currentTarget;
let rowY = getOffset(rowElement).top + getWindowScrollTop();
let rowY = getOffset(rowElement).top;
let pageY = event.pageY;
let rowMidY = rowY + getOuterHeight(rowElement) / 2;
let prevRowElement = rowElement.previousElementSibling;
Expand Down
20 changes: 20 additions & 0 deletions packages/primevue/src/datepicker/DatePicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,24 @@ describe('DatePicker.vue', () => {

expect(wrapper.find('.p-datepicker-other-month span').exists()).toBe(true);
});

it('should correctly set the year when view="year" and value is set via the input', async () => {
const dateOne = new Date();
const dateTwo = new Date();

dateTwo.setFullYear(1988, 5, 15);

await wrapper.setProps({ view: 'year', dateFormat: 'yy', modelValue: dateOne });

const input = wrapper.find('.p-datepicker-input');

await input.trigger('focus');

expect(wrapper.find('.p-datepicker-decade').exists()).toBe(true);
expect(wrapper.find('.p-datepicker-decade').text()).toBe('2020 - 2029');

await wrapper.setProps({ modelValue: dateTwo });

expect(wrapper.find('.p-datepicker-decade').text()).toBe('1980 - 1989');
});
});
5 changes: 5 additions & 0 deletions packages/primevue/src/datepicker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1911,6 +1911,11 @@ export default {
day = 1;
}
if (this.currentView === 'year') {
day = 1;
month = 1;
}
for (iFormat = 0; iFormat < format.length; iFormat++) {
if (literal) {
if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
Expand Down
4 changes: 4 additions & 0 deletions packages/primevue/src/inputotp/InputOtp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@blur="onBlur($event)"
@paste="onPaste($event)"
@keydown="onKeyDown($event)"
@click="onClick($event)"
:pt="ptm('pcInputText')"
/>
</slot>
Expand Down Expand Up @@ -128,6 +129,9 @@ export default {
onBlur(event) {
this.$emit('blur', event);
},
onClick(event) {
setTimeout(() => event.target.select(), 1);
},
onKeyDown(event) {
if (event.ctrlKey || event.metaKey) {
return;
Expand Down
2 changes: 1 addition & 1 deletion packages/primevue/src/multiselect/BaseMultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default {
},
selectedItemsLabel: {
type: String,
default: '{0} items selected'
default: null
},
maxSelectedLabels: {
type: Number,
Expand Down
4 changes: 2 additions & 2 deletions packages/primevue/src/multiselect/MultiSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export interface MultiSelectProps {
display?: 'comma' | 'chip' | undefined;
/**
* Label to display after exceeding max selected labels.
* @defaultValue '{0} items selected'
* @defaultValue null
*/
selectedItemsLabel?: string | undefined;
/**
Expand Down Expand Up @@ -520,7 +520,7 @@ export interface MultiSelectProps {
filterMessage?: string | undefined;
/**
* Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration.
* @defaultValue '{0} items selected'
* @defaultValue null
*/
selectionMessage?: string | undefined;
/**
Expand Down
31 changes: 18 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 931158c

Please sign in to comment.