primevue 3.24.0 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -176
- package/api/Api.d.ts +284 -292
- package/autocomplete/AutoComplete.d.ts +5 -5
- package/autocomplete/AutoComplete.vue +5 -5
- package/autocomplete/autocomplete.cjs.js +5 -5
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +5 -5
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +5 -5
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/BlockUI.d.ts +2 -0
- package/calendar/Calendar.d.ts +4 -4
- package/calendar/Calendar.vue +71 -17
- package/calendar/calendar.cjs.js +58 -20
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +58 -20
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +58 -20
- package/calendar/calendar.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +4 -4
- package/cascadeselect/CascadeSelect.vue +4 -4
- package/cascadeselect/cascadeselect.cjs.js +4 -4
- package/cascadeselect/cascadeselect.cjs.min.js +1 -1
- package/cascadeselect/cascadeselect.esm.js +4 -4
- package/cascadeselect/cascadeselect.esm.min.js +1 -1
- package/cascadeselect/cascadeselect.js +4 -4
- package/cascadeselect/cascadeselect.min.js +1 -1
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.vue +2 -2
- package/checkbox/checkbox.cjs.js +2 -2
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +2 -2
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +2 -2
- package/checkbox/checkbox.min.js +1 -1
- package/chips/Chips.d.ts +4 -3
- package/chips/Chips.vue +2 -2
- package/chips/chips.cjs.js +2 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +2 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +2 -2
- package/chips/chips.min.js +1 -1
- package/column/Column.d.ts +9 -0
- package/confirmationoptions/ConfirmationOptions.d.ts +1 -0
- package/confirmdialog/ConfirmDialog.d.ts +5 -0
- package/confirmdialog/ConfirmDialog.vue +17 -1
- package/confirmdialog/confirmdialog.cjs.js +7 -2
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +7 -2
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +7 -2
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.vue +3 -0
- package/confirmpopup/confirmpopup.cjs.js +3 -0
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +3 -0
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +3 -0
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/core/core.js +22 -15
- package/core/core.min.js +4 -4
- package/datatable/DataTable.d.ts +9 -9
- package/datatable/FooterCell.vue +2 -2
- package/datatable/TableBody.vue +6 -1
- package/datatable/datatable.cjs.js +8 -3
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +8 -3
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +8 -3
- package/datatable/datatable.min.js +1 -1
- package/dialog/Dialog.vue +24 -7
- package/dialog/dialog.cjs.js +14 -7
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +14 -7
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +14 -7
- package/dialog/dialog.min.js +1 -1
- package/dropdown/Dropdown.d.ts +10 -4
- package/dropdown/Dropdown.vue +5 -5
- package/dropdown/dropdown.cjs.js +5 -5
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +5 -5
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +5 -5
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.vue +1 -1
- package/dynamicdialog/dynamicdialog.cjs.js +1 -1
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +2 -2
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +1 -1
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/editor/Editor.d.ts +1 -0
- package/inplace/Inplace.vue +5 -1
- package/inplace/inplace.cjs.js +10 -2
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +10 -3
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +11 -4
- package/inplace/inplace.min.js +1 -1
- package/inputmask/InputMask.vue +59 -49
- package/inputmask/inputmask.cjs.js +59 -49
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.esm.js +59 -49
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +59 -49
- package/inputmask/inputmask.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +2 -2
- package/inputnumber/InputNumber.vue +2 -2
- package/inputnumber/inputnumber.cjs.js +2 -2
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +2 -2
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +2 -2
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.d.ts +3 -2
- package/inputswitch/InputSwitch.vue +2 -2
- package/inputswitch/inputswitch.cjs.js +2 -2
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +2 -2
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +2 -2
- package/inputswitch/inputswitch.min.js +1 -1
- package/menuitem/MenuItem.d.ts +1 -1
- package/organizationchart/OrganizationChart.d.ts +3 -2
- package/package.json +1 -1
- package/panel/Panel.d.ts +4 -2
- package/password/Password.d.ts +4 -4
- package/password/Password.vue +4 -4
- package/password/password.cjs.js +4 -4
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +4 -4
- package/password/password.esm.min.js +1 -1
- package/password/password.js +4 -4
- package/password/password.min.js +1 -1
- package/portal/Portal.d.ts +1 -0
- package/radiobutton/RadioButton.d.ts +3 -2
- package/radiobutton/RadioButton.vue +2 -2
- package/radiobutton/radiobutton.cjs.js +2 -2
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +2 -2
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +2 -2
- package/radiobutton/radiobutton.min.js +1 -1
- package/row/Row.d.ts +1 -1
- package/selectbutton/SelectButton.d.ts +1 -1
- package/selectbutton/SelectButton.vue +2 -2
- package/selectbutton/selectbutton.cjs.js +2 -2
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +2 -2
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +2 -2
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/Slider.vue +3 -14
- package/slider/slider.cjs.js +3 -14
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +3 -14
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +3 -14
- package/slider/slider.min.js +1 -1
- package/splitbutton/SplitButton.vue +4 -2
- package/splitbutton/splitbutton.cjs.js +6 -4
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +6 -4
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +6 -4
- package/splitbutton/splitbutton.min.js +1 -1
- package/textarea/Textarea.d.ts +1 -0
- package/tieredmenu/TieredMenu.d.ts +2 -0
- package/toast/Toast.d.ts +0 -1
- package/togglebutton/ToggleButton.d.ts +2 -2
- package/togglebutton/ToggleButton.vue +2 -2
- package/togglebutton/togglebutton.cjs.js +2 -2
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +2 -2
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +2 -2
- package/togglebutton/togglebutton.min.js +1 -1
- package/tooltip/tooltip.cjs.js +1 -1
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +1 -1
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +1 -1
- package/tooltip/tooltip.min.js +1 -1
- package/tree/Tree.d.ts +3 -0
- package/treeselect/TreeSelect.d.ts +2 -2
- package/treeselect/TreeSelect.vue +3 -3
- package/treeselect/treeselect.cjs.js +3 -3
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +3 -3
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +3 -3
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/TreeTable.d.ts +2 -0
- package/treetable/TreeTable.vue +3 -3
- package/treetable/treetable.cjs.js +3 -3
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +3 -3
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +3 -3
- package/treetable/treetable.min.js +1 -1
- package/tristatecheckbox/TriStateCheckbox.vue +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +1 -1
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/vetur-attributes.json +32 -28
- package/vetur-tags.json +2 -1
- package/web-types.json +40 -30
package/calendar/Calendar.d.ts
CHANGED
|
@@ -307,11 +307,11 @@ export interface CalendarProps {
|
|
|
307
307
|
/**
|
|
308
308
|
* Inline style of the input field.
|
|
309
309
|
*/
|
|
310
|
-
inputStyle?:
|
|
310
|
+
inputStyle?: object | undefined;
|
|
311
311
|
/**
|
|
312
312
|
* Style class of the input field.
|
|
313
313
|
*/
|
|
314
|
-
inputClass?:
|
|
314
|
+
inputClass?: string | object | undefined;
|
|
315
315
|
/**
|
|
316
316
|
* Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
|
|
317
317
|
*/
|
|
@@ -319,11 +319,11 @@ export interface CalendarProps {
|
|
|
319
319
|
/**
|
|
320
320
|
* Inline style of the overlay panel.
|
|
321
321
|
*/
|
|
322
|
-
panelStyle?:
|
|
322
|
+
panelStyle?: object | undefined;
|
|
323
323
|
/**
|
|
324
324
|
* Style class of the overlay panel.
|
|
325
325
|
*/
|
|
326
|
-
panelClass?:
|
|
326
|
+
panelClass?: string | object | undefined;
|
|
327
327
|
/**
|
|
328
328
|
* Uses to pass all properties of the HTMLDivElement to the overlay panel inside the component.
|
|
329
329
|
*/
|
package/calendar/Calendar.vue
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
{{ getYear(month) }}
|
|
97
97
|
</button>
|
|
98
98
|
<span v-if="currentView === 'year'" class="p-datepicker-decade">
|
|
99
|
-
<slot name="decade" :years="yearPickerValues"> {{ yearPickerValues[0] }} - {{ yearPickerValues[yearPickerValues.length - 1] }} </slot>
|
|
99
|
+
<slot name="decade" :years="yearPickerValues"> {{ yearPickerValues[0].value }} - {{ yearPickerValues[yearPickerValues.length - 1].value }} </slot>
|
|
100
100
|
</span>
|
|
101
101
|
</div>
|
|
102
102
|
<button
|
|
@@ -154,18 +154,34 @@
|
|
|
154
154
|
</div>
|
|
155
155
|
</div>
|
|
156
156
|
<div v-if="currentView === 'month'" class="p-monthpicker">
|
|
157
|
-
<span
|
|
158
|
-
|
|
157
|
+
<span
|
|
158
|
+
v-for="(m, i) of monthPickerValues"
|
|
159
|
+
:key="m"
|
|
160
|
+
v-ripple
|
|
161
|
+
@click="onMonthSelect($event, { month: m, index: i })"
|
|
162
|
+
@keydown="onMonthCellKeydown($event, { month: m, index: i })"
|
|
163
|
+
class="p-monthpicker-month"
|
|
164
|
+
:class="{ 'p-highlight': isMonthSelected(i), 'p-disabled': !m.selectable }"
|
|
165
|
+
>
|
|
166
|
+
{{ m.value }}
|
|
159
167
|
<div v-if="isMonthSelected(i)" class="p-hidden-accessible" aria-live="polite">
|
|
160
|
-
{{ m }}
|
|
168
|
+
{{ m.value }}
|
|
161
169
|
</div>
|
|
162
170
|
</span>
|
|
163
171
|
</div>
|
|
164
172
|
<div v-if="currentView === 'year'" class="p-yearpicker">
|
|
165
|
-
<span
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
<span
|
|
174
|
+
v-for="y of yearPickerValues"
|
|
175
|
+
:key="y.value"
|
|
176
|
+
v-ripple
|
|
177
|
+
@click="onYearSelect($event, y)"
|
|
178
|
+
@keydown="onYearCellKeydown($event, y)"
|
|
179
|
+
class="p-yearpicker-year"
|
|
180
|
+
:class="{ 'p-highlight': isYearSelected(y.value), 'p-disabled': !y.selectable }"
|
|
181
|
+
>
|
|
182
|
+
{{ y.value }}
|
|
183
|
+
<div v-if="isYearSelected(y.value)" class="p-hidden-accessible" aria-live="polite">
|
|
184
|
+
{{ y.value }}
|
|
169
185
|
</div>
|
|
170
186
|
</span>
|
|
171
187
|
</div>
|
|
@@ -504,11 +520,11 @@ export default {
|
|
|
504
520
|
default: null
|
|
505
521
|
},
|
|
506
522
|
inputClass: {
|
|
507
|
-
type: String,
|
|
523
|
+
type: [String, Object],
|
|
508
524
|
default: null
|
|
509
525
|
},
|
|
510
526
|
inputStyle: {
|
|
511
|
-
type:
|
|
527
|
+
type: Object,
|
|
512
528
|
default: null
|
|
513
529
|
},
|
|
514
530
|
inputProps: {
|
|
@@ -516,11 +532,11 @@ export default {
|
|
|
516
532
|
default: null
|
|
517
533
|
},
|
|
518
534
|
panelClass: {
|
|
519
|
-
type: String,
|
|
535
|
+
type: [String, Object],
|
|
520
536
|
default: null
|
|
521
537
|
},
|
|
522
538
|
panelStyle: {
|
|
523
|
-
type:
|
|
539
|
+
type: Object,
|
|
524
540
|
default: null
|
|
525
541
|
},
|
|
526
542
|
panelProps: {
|
|
@@ -1632,7 +1648,9 @@ export default {
|
|
|
1632
1648
|
clearInterval(this.timePickerTimer);
|
|
1633
1649
|
}
|
|
1634
1650
|
},
|
|
1635
|
-
onMonthSelect(event, index) {
|
|
1651
|
+
onMonthSelect(event, { month, index }) {
|
|
1652
|
+
// if (month.selectable) return;
|
|
1653
|
+
|
|
1636
1654
|
if (this.view === 'month') {
|
|
1637
1655
|
this.onDateSelect(event, { year: this.currentYear, month: index, day: 1, selectable: true });
|
|
1638
1656
|
} else {
|
|
@@ -1644,10 +1662,12 @@ export default {
|
|
|
1644
1662
|
setTimeout(this.updateFocus, 0);
|
|
1645
1663
|
},
|
|
1646
1664
|
onYearSelect(event, year) {
|
|
1665
|
+
// if (year.isSelectable) return;
|
|
1666
|
+
|
|
1647
1667
|
if (this.view === 'year') {
|
|
1648
|
-
this.onDateSelect(event, { year: year, month: 0, day: 1, selectable: true });
|
|
1668
|
+
this.onDateSelect(event, { year: year.value, month: 0, day: 1, selectable: true });
|
|
1649
1669
|
} else {
|
|
1650
|
-
this.currentYear = year;
|
|
1670
|
+
this.currentYear = year.value;
|
|
1651
1671
|
this.currentView = 'month';
|
|
1652
1672
|
this.$emit('year-change', { month: this.currentMonth + 1, year: this.currentYear });
|
|
1653
1673
|
}
|
|
@@ -2878,8 +2898,30 @@ export default {
|
|
|
2878
2898
|
monthPickerValues() {
|
|
2879
2899
|
let monthPickerValues = [];
|
|
2880
2900
|
|
|
2901
|
+
const isSelectableMonth = (baseMonth) => {
|
|
2902
|
+
if (this.minDate) {
|
|
2903
|
+
const minMonth = this.minDate.getMonth();
|
|
2904
|
+
const minYear = this.minDate.getFullYear();
|
|
2905
|
+
|
|
2906
|
+
if (this.currentYear < minYear || (this.currentYear === minYear && baseMonth < minMonth)) {
|
|
2907
|
+
return false;
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
if (this.maxDate) {
|
|
2912
|
+
const maxMonth = this.maxDate.getMonth();
|
|
2913
|
+
const maxYear = this.maxDate.getFullYear();
|
|
2914
|
+
|
|
2915
|
+
if (this.currentYear > maxYear || (this.currentYear === maxYear && baseMonth > maxMonth)) {
|
|
2916
|
+
return false;
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
return true;
|
|
2921
|
+
};
|
|
2922
|
+
|
|
2881
2923
|
for (let i = 0; i <= 11; i++) {
|
|
2882
|
-
monthPickerValues.push(this.$primevue.config.locale.monthNamesShort[i]);
|
|
2924
|
+
monthPickerValues.push({ value: this.$primevue.config.locale.monthNamesShort[i], selectable: isSelectableMonth(i) });
|
|
2883
2925
|
}
|
|
2884
2926
|
|
|
2885
2927
|
return monthPickerValues;
|
|
@@ -2888,8 +2930,20 @@ export default {
|
|
|
2888
2930
|
let yearPickerValues = [];
|
|
2889
2931
|
let base = this.currentYear - (this.currentYear % 10);
|
|
2890
2932
|
|
|
2933
|
+
const isSelectableYear = (baseYear) => {
|
|
2934
|
+
if (this.minDate) {
|
|
2935
|
+
if (this.minDate.getFullYear() > baseYear) return false;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
if (this.maxDate) {
|
|
2939
|
+
if (this.maxDate.getFullYear() < baseYear) return false;
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
return true;
|
|
2943
|
+
};
|
|
2944
|
+
|
|
2891
2945
|
for (let i = 0; i < 10; i++) {
|
|
2892
|
-
yearPickerValues.push(base + i);
|
|
2946
|
+
yearPickerValues.push({ value: base + i, selectable: isSelectableYear(base + i) });
|
|
2893
2947
|
}
|
|
2894
2948
|
|
|
2895
2949
|
return yearPickerValues;
|
package/calendar/calendar.cjs.js
CHANGED
|
@@ -201,11 +201,11 @@ var script = {
|
|
|
201
201
|
default: null
|
|
202
202
|
},
|
|
203
203
|
inputClass: {
|
|
204
|
-
type: String,
|
|
204
|
+
type: [String, Object],
|
|
205
205
|
default: null
|
|
206
206
|
},
|
|
207
207
|
inputStyle: {
|
|
208
|
-
type:
|
|
208
|
+
type: Object,
|
|
209
209
|
default: null
|
|
210
210
|
},
|
|
211
211
|
inputProps: {
|
|
@@ -213,11 +213,11 @@ var script = {
|
|
|
213
213
|
default: null
|
|
214
214
|
},
|
|
215
215
|
panelClass: {
|
|
216
|
-
type: String,
|
|
216
|
+
type: [String, Object],
|
|
217
217
|
default: null
|
|
218
218
|
},
|
|
219
219
|
panelStyle: {
|
|
220
|
-
type:
|
|
220
|
+
type: Object,
|
|
221
221
|
default: null
|
|
222
222
|
},
|
|
223
223
|
panelProps: {
|
|
@@ -1329,7 +1329,9 @@ var script = {
|
|
|
1329
1329
|
clearInterval(this.timePickerTimer);
|
|
1330
1330
|
}
|
|
1331
1331
|
},
|
|
1332
|
-
onMonthSelect(event, index) {
|
|
1332
|
+
onMonthSelect(event, { month, index }) {
|
|
1333
|
+
// if (month.selectable) return;
|
|
1334
|
+
|
|
1333
1335
|
if (this.view === 'month') {
|
|
1334
1336
|
this.onDateSelect(event, { year: this.currentYear, month: index, day: 1, selectable: true });
|
|
1335
1337
|
} else {
|
|
@@ -1341,10 +1343,12 @@ var script = {
|
|
|
1341
1343
|
setTimeout(this.updateFocus, 0);
|
|
1342
1344
|
},
|
|
1343
1345
|
onYearSelect(event, year) {
|
|
1346
|
+
// if (year.isSelectable) return;
|
|
1347
|
+
|
|
1344
1348
|
if (this.view === 'year') {
|
|
1345
|
-
this.onDateSelect(event, { year: year, month: 0, day: 1, selectable: true });
|
|
1349
|
+
this.onDateSelect(event, { year: year.value, month: 0, day: 1, selectable: true });
|
|
1346
1350
|
} else {
|
|
1347
|
-
this.currentYear = year;
|
|
1351
|
+
this.currentYear = year.value;
|
|
1348
1352
|
this.currentView = 'month';
|
|
1349
1353
|
this.$emit('year-change', { month: this.currentMonth + 1, year: this.currentYear });
|
|
1350
1354
|
}
|
|
@@ -2556,8 +2560,30 @@ var script = {
|
|
|
2556
2560
|
monthPickerValues() {
|
|
2557
2561
|
let monthPickerValues = [];
|
|
2558
2562
|
|
|
2563
|
+
const isSelectableMonth = (baseMonth) => {
|
|
2564
|
+
if (this.minDate) {
|
|
2565
|
+
const minMonth = this.minDate.getMonth();
|
|
2566
|
+
const minYear = this.minDate.getFullYear();
|
|
2567
|
+
|
|
2568
|
+
if (this.currentYear < minYear || (this.currentYear === minYear && baseMonth < minMonth)) {
|
|
2569
|
+
return false;
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
if (this.maxDate) {
|
|
2574
|
+
const maxMonth = this.maxDate.getMonth();
|
|
2575
|
+
const maxYear = this.maxDate.getFullYear();
|
|
2576
|
+
|
|
2577
|
+
if (this.currentYear > maxYear || (this.currentYear === maxYear && baseMonth > maxMonth)) {
|
|
2578
|
+
return false;
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
return true;
|
|
2583
|
+
};
|
|
2584
|
+
|
|
2559
2585
|
for (let i = 0; i <= 11; i++) {
|
|
2560
|
-
monthPickerValues.push(this.$primevue.config.locale.monthNamesShort[i]);
|
|
2586
|
+
monthPickerValues.push({ value: this.$primevue.config.locale.monthNamesShort[i], selectable: isSelectableMonth(i) });
|
|
2561
2587
|
}
|
|
2562
2588
|
|
|
2563
2589
|
return monthPickerValues;
|
|
@@ -2566,8 +2592,20 @@ var script = {
|
|
|
2566
2592
|
let yearPickerValues = [];
|
|
2567
2593
|
let base = this.currentYear - (this.currentYear % 10);
|
|
2568
2594
|
|
|
2595
|
+
const isSelectableYear = (baseYear) => {
|
|
2596
|
+
if (this.minDate) {
|
|
2597
|
+
if (this.minDate.getFullYear() > baseYear) return false;
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
if (this.maxDate) {
|
|
2601
|
+
if (this.maxDate.getFullYear() < baseYear) return false;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
return true;
|
|
2605
|
+
};
|
|
2606
|
+
|
|
2569
2607
|
for (let i = 0; i < 10; i++) {
|
|
2570
|
-
yearPickerValues.push(base + i);
|
|
2608
|
+
yearPickerValues.push({ value: base + i, selectable: isSelectableYear(base + i) });
|
|
2571
2609
|
}
|
|
2572
2610
|
|
|
2573
2611
|
return yearPickerValues;
|
|
@@ -2842,7 +2880,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2842
2880
|
($data.currentView === 'year')
|
|
2843
2881
|
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_10, [
|
|
2844
2882
|
vue.renderSlot(_ctx.$slots, "decade", { years: $options.yearPickerValues }, () => [
|
|
2845
|
-
vue.createTextVNode(vue.toDisplayString($options.yearPickerValues[0]) + " - " + vue.toDisplayString($options.yearPickerValues[$options.yearPickerValues.length - 1]), 1)
|
|
2883
|
+
vue.createTextVNode(vue.toDisplayString($options.yearPickerValues[0].value) + " - " + vue.toDisplayString($options.yearPickerValues[$options.yearPickerValues.length - 1].value), 1)
|
|
2846
2884
|
])
|
|
2847
2885
|
]))
|
|
2848
2886
|
: vue.createCommentVNode("", true)
|
|
@@ -2937,13 +2975,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2937
2975
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.monthPickerValues, (m, i) => {
|
|
2938
2976
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
|
|
2939
2977
|
key: m,
|
|
2940
|
-
onClick: $event => ($options.onMonthSelect($event, i)),
|
|
2941
|
-
onKeydown: $event => ($options.onMonthCellKeydown($event, i)),
|
|
2942
|
-
class: vue.normalizeClass(["p-monthpicker-month", { 'p-highlight': $options.isMonthSelected(i) }])
|
|
2978
|
+
onClick: $event => ($options.onMonthSelect($event, { month: m, index: i })),
|
|
2979
|
+
onKeydown: $event => ($options.onMonthCellKeydown($event, { month: m, index: i })),
|
|
2980
|
+
class: vue.normalizeClass(["p-monthpicker-month", { 'p-highlight': $options.isMonthSelected(i), 'p-disabled': !m.selectable }])
|
|
2943
2981
|
}, [
|
|
2944
|
-
vue.createTextVNode(vue.toDisplayString(m) + " ", 1),
|
|
2982
|
+
vue.createTextVNode(vue.toDisplayString(m.value) + " ", 1),
|
|
2945
2983
|
($options.isMonthSelected(i))
|
|
2946
|
-
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24, vue.toDisplayString(m), 1))
|
|
2984
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24, vue.toDisplayString(m.value), 1))
|
|
2947
2985
|
: vue.createCommentVNode("", true)
|
|
2948
2986
|
], 42, _hoisted_23)), [
|
|
2949
2987
|
[_directive_ripple]
|
|
@@ -2955,14 +2993,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2955
2993
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_25, [
|
|
2956
2994
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.yearPickerValues, (y) => {
|
|
2957
2995
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
|
|
2958
|
-
key: y,
|
|
2996
|
+
key: y.value,
|
|
2959
2997
|
onClick: $event => ($options.onYearSelect($event, y)),
|
|
2960
2998
|
onKeydown: $event => ($options.onYearCellKeydown($event, y)),
|
|
2961
|
-
class: vue.normalizeClass(["p-yearpicker-year", { 'p-highlight': $options.isYearSelected(y) }])
|
|
2999
|
+
class: vue.normalizeClass(["p-yearpicker-year", { 'p-highlight': $options.isYearSelected(y.value), 'p-disabled': !y.selectable }])
|
|
2962
3000
|
}, [
|
|
2963
|
-
vue.createTextVNode(vue.toDisplayString(y) + " ", 1),
|
|
2964
|
-
($options.isYearSelected(y))
|
|
2965
|
-
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_27, vue.toDisplayString(y), 1))
|
|
3001
|
+
vue.createTextVNode(vue.toDisplayString(y.value) + " ", 1),
|
|
3002
|
+
($options.isYearSelected(y.value))
|
|
3003
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_27, vue.toDisplayString(y.value), 1))
|
|
2966
3004
|
: vue.createCommentVNode("", true)
|
|
2967
3005
|
], 42, _hoisted_26)), [
|
|
2968
3006
|
[_directive_ripple]
|