primevue 4.3.8 → 4.4.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/autocomplete/AutoComplete.vue +18 -3
- package/autocomplete/BaseAutoComplete.vue +4 -0
- package/autocomplete/index.d.ts +20 -0
- package/autocomplete/index.mjs +34 -7
- package/autocomplete/index.mjs.map +1 -1
- package/autocomplete/style/index.d.ts +4 -0
- package/autocomplete/style/index.mjs +3 -1
- package/autocomplete/style/index.mjs.map +1 -1
- package/cascadeselect/CascadeSelect.vue +1 -1
- package/cascadeselect/index.mjs +1 -1
- package/cascadeselect/index.mjs.map +1 -1
- package/checkbox/Checkbox.vue +15 -2
- package/checkbox/index.mjs +14 -2
- package/checkbox/index.mjs.map +1 -1
- package/colorpicker/ColorPicker.vue +5 -6
- package/colorpicker/index.mjs +5 -5
- package/colorpicker/index.mjs.map +1 -1
- package/column/index.d.ts +2 -2
- package/confirmdialog/ConfirmDialog.vue +1 -1
- package/confirmdialog/index.d.ts +5 -0
- package/confirmdialog/index.mjs +3 -2
- package/confirmdialog/index.mjs.map +1 -1
- package/datatable/BodyCell.vue +1 -1
- package/datatable/ColumnFilter.vue +1 -1
- package/datatable/DataTable.vue +6 -3
- package/datatable/HeaderCheckbox.vue +3 -3
- package/datatable/index.mjs +19 -9
- package/datatable/index.mjs.map +1 -1
- package/datepicker/BaseDatePicker.vue +8 -0
- package/datepicker/DatePicker.vue +200 -82
- package/datepicker/index.d.ts +25 -0
- package/datepicker/index.mjs +263 -155
- package/datepicker/index.mjs.map +1 -1
- package/datepicker/style/index.d.ts +4 -0
- package/datepicker/style/index.mjs +5 -2
- package/datepicker/style/index.mjs.map +1 -1
- package/dialog/Dialog.vue +1 -1
- package/dialog/index.d.ts +5 -0
- package/dialog/index.mjs +2 -1
- package/dialog/index.mjs.map +1 -1
- package/drawer/BaseDrawer.vue +4 -0
- package/drawer/Drawer.vue +4 -4
- package/drawer/index.d.ts +5 -0
- package/drawer/index.mjs +8 -4
- package/drawer/index.mjs.map +1 -1
- package/editor/Editor.vue +5 -1
- package/editor/index.mjs +5 -0
- package/editor/index.mjs.map +1 -1
- package/fileupload/FileUpload.vue +2 -2
- package/fileupload/index.mjs +2 -2
- package/fileupload/index.mjs.map +1 -1
- package/image/index.d.ts +5 -11
- package/inputmask/InputMask.vue +1 -2
- package/inputmask/index.mjs +1 -1
- package/inputmask/index.mjs.map +1 -1
- package/inputnumber/BaseInputNumber.vue +4 -0
- package/inputnumber/InputNumber.vue +33 -5
- package/inputnumber/index.d.ts +20 -0
- package/inputnumber/index.mjs +48 -7
- package/inputnumber/index.mjs.map +1 -1
- package/inputnumber/style/index.mjs +1 -0
- package/inputnumber/style/index.mjs.map +1 -1
- package/inputotp/InputOtp.vue +7 -3
- package/inputotp/index.mjs +6 -3
- package/inputotp/index.mjs.map +1 -1
- package/keyfilter/index.mjs +14 -1
- package/keyfilter/index.mjs.map +1 -1
- package/listbox/Listbox.vue +8 -14
- package/listbox/index.mjs +13 -19
- package/listbox/index.mjs.map +1 -1
- package/multiselect/MultiSelect.vue +15 -12
- package/multiselect/index.mjs +21 -18
- package/multiselect/index.mjs.map +1 -1
- package/package.json +5 -5
- package/panel/Panel.vue +1 -1
- package/panel/index.d.ts +4 -0
- package/panel/index.mjs +2 -1
- package/panel/index.mjs.map +1 -1
- package/password/BasePassword.vue +4 -0
- package/password/Password.vue +12 -1
- package/password/index.d.ts +20 -0
- package/password/index.mjs +23 -1
- package/password/index.mjs.map +1 -1
- package/password/style/index.d.ts +4 -0
- package/password/style/index.mjs +1 -0
- package/password/style/index.mjs.map +1 -1
- package/select/Select.vue +5 -4
- package/select/index.mjs +6 -5
- package/select/index.mjs.map +1 -1
- package/tab/Tab.vue +0 -1
- package/tab/index.mjs +0 -1
- package/tab/index.mjs.map +1 -1
- package/togglebutton/BaseToggleButton.vue +0 -4
- package/togglebutton/index.d.ts +0 -5
- package/togglebutton/index.mjs +0 -4
- package/togglebutton/index.mjs.map +1 -1
- package/tooltip/index.mjs +5 -1
- package/tooltip/index.mjs.map +1 -1
- package/tree/BaseTree.vue +16 -0
- package/tree/Tree.vue +179 -4
- package/tree/TreeNode.vue +225 -3
- package/tree/index.d.ts +65 -0
- package/tree/index.mjs +499 -22
- package/tree/index.mjs.map +1 -1
- package/tree/style/index.mjs +9 -4
- package/tree/style/index.mjs.map +1 -1
- package/treenode/index.d.ts +12 -0
- package/treeselect/TreeSelect.vue +2 -2
- package/treeselect/index.mjs +2 -2
- package/treeselect/index.mjs.map +1 -1
- package/treetable/TreeTable.vue +15 -1
- package/treetable/index.d.ts +58 -4
- package/treetable/index.mjs +19 -6
- package/treetable/index.mjs.map +1 -1
- package/umd/primevue.min.js +1 -1
- package/vetur-attributes.json +0 -4
- package/vetur-tags.json +0 -1
- package/web-types.json +1 -11
package/datepicker/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from '@primeuix/utils';
|
|
2
2
|
import { setAttribute, getFocusableElements, find, findSingle, getIndex, getAttribute, relativePosition, getOuterWidth, absolutePosition, isTouchDevice, addStyle } from '@primeuix/utils/dom';
|
|
3
|
-
import { localeComparator } from '@primeuix/utils/object';
|
|
3
|
+
import { localeComparator, isEmpty, isDate, isNotEmpty } from '@primeuix/utils/object';
|
|
4
4
|
import { ZIndex } from '@primeuix/utils/zindex';
|
|
5
5
|
import { ConnectedOverlayScrollHandler } from '@primevue/core/utils';
|
|
6
6
|
import CalendarIcon from '@primevue/icons/calendar';
|
|
@@ -8,6 +8,7 @@ import ChevronDownIcon from '@primevue/icons/chevrondown';
|
|
|
8
8
|
import ChevronLeftIcon from '@primevue/icons/chevronleft';
|
|
9
9
|
import ChevronRightIcon from '@primevue/icons/chevronright';
|
|
10
10
|
import ChevronUpIcon from '@primevue/icons/chevronup';
|
|
11
|
+
import TimesIcon from '@primevue/icons/times';
|
|
11
12
|
import Button from 'primevue/button';
|
|
12
13
|
import InputText from 'primevue/inputtext';
|
|
13
14
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
@@ -29,6 +30,10 @@ var script$1 = {
|
|
|
29
30
|
type: String,
|
|
30
31
|
"default": null
|
|
31
32
|
},
|
|
33
|
+
updateModelType: {
|
|
34
|
+
type: String,
|
|
35
|
+
"default": 'date'
|
|
36
|
+
},
|
|
32
37
|
inline: {
|
|
33
38
|
type: Boolean,
|
|
34
39
|
"default": false
|
|
@@ -170,6 +175,10 @@ var script$1 = {
|
|
|
170
175
|
type: Boolean,
|
|
171
176
|
"default": true
|
|
172
177
|
},
|
|
178
|
+
showClear: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
"default": false
|
|
181
|
+
},
|
|
173
182
|
appendTo: {
|
|
174
183
|
type: [String, Object],
|
|
175
184
|
"default": 'body'
|
|
@@ -313,16 +322,25 @@ var script = {
|
|
|
313
322
|
query: null,
|
|
314
323
|
queryMatches: false,
|
|
315
324
|
queryOrientation: null,
|
|
316
|
-
focusedDateIndex: 0
|
|
325
|
+
focusedDateIndex: 0,
|
|
326
|
+
rawValue: null
|
|
317
327
|
};
|
|
318
328
|
},
|
|
319
329
|
watch: {
|
|
320
|
-
modelValue:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
330
|
+
modelValue: {
|
|
331
|
+
immediate: true,
|
|
332
|
+
handler: function handler(newValue) {
|
|
333
|
+
var _this$$refs$clearIcon;
|
|
334
|
+
this.updateCurrentMetaData();
|
|
335
|
+
this.rawValue = typeof newValue === 'string' ? this.parseValue(newValue) : newValue;
|
|
336
|
+
if (!this.typeUpdate && !this.inline && this.input) {
|
|
337
|
+
this.input.value = this.formatValue(this.rawValue);
|
|
338
|
+
}
|
|
339
|
+
this.typeUpdate = false;
|
|
340
|
+
if ((_this$$refs$clearIcon = this.$refs.clearIcon) !== null && _this$$refs$clearIcon !== void 0 && (_this$$refs$clearIcon = _this$$refs$clearIcon.$el) !== null && _this$$refs$clearIcon !== void 0 && _this$$refs$clearIcon.style) {
|
|
341
|
+
this.$refs.clearIcon.$el.style.display = isEmpty(newValue) ? 'none' : 'block';
|
|
342
|
+
}
|
|
324
343
|
}
|
|
325
|
-
this.typeUpdate = false;
|
|
326
344
|
},
|
|
327
345
|
showTime: function showTime() {
|
|
328
346
|
this.updateCurrentMetaData();
|
|
@@ -374,7 +392,11 @@ var script = {
|
|
|
374
392
|
this.initFocusableCell();
|
|
375
393
|
}
|
|
376
394
|
} else {
|
|
395
|
+
var _this$$refs$clearIcon2;
|
|
377
396
|
this.input.value = this.inputFieldValue;
|
|
397
|
+
if ((_this$$refs$clearIcon2 = this.$refs.clearIcon) !== null && _this$$refs$clearIcon2 !== void 0 && (_this$$refs$clearIcon2 = _this$$refs$clearIcon2.$el) !== null && _this$$refs$clearIcon2 !== void 0 && _this$$refs$clearIcon2.style) {
|
|
398
|
+
this.$refs.clearIcon.$el.style.display = !this.$filled ? 'none' : 'block';
|
|
399
|
+
}
|
|
378
400
|
}
|
|
379
401
|
},
|
|
380
402
|
updated: function updated() {
|
|
@@ -408,24 +430,18 @@ var script = {
|
|
|
408
430
|
this.overlay = null;
|
|
409
431
|
},
|
|
410
432
|
methods: {
|
|
411
|
-
isComparable: function isComparable() {
|
|
412
|
-
return this.d_value != null && typeof this.d_value !== 'string';
|
|
413
|
-
},
|
|
414
433
|
isSelected: function isSelected(dateMeta) {
|
|
415
|
-
if (
|
|
416
|
-
return false;
|
|
417
|
-
}
|
|
418
|
-
if (this.d_value) {
|
|
434
|
+
if (this.rawValue) {
|
|
419
435
|
if (this.isSingleSelection()) {
|
|
420
|
-
return this.isDateEquals(this.
|
|
436
|
+
return this.isDateEquals(this.parseValueForComparison(this.rawValue), dateMeta);
|
|
421
437
|
} else if (this.isMultipleSelection()) {
|
|
422
438
|
var selected = false;
|
|
423
|
-
var _iterator = _createForOfIteratorHelper(this.
|
|
439
|
+
var _iterator = _createForOfIteratorHelper(this.rawValue),
|
|
424
440
|
_step;
|
|
425
441
|
try {
|
|
426
442
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
427
443
|
var date = _step.value;
|
|
428
|
-
selected = this.isDateEquals(date, dateMeta);
|
|
444
|
+
selected = this.isDateEquals(this.parseValueForComparison(date), dateMeta);
|
|
429
445
|
if (selected) {
|
|
430
446
|
break;
|
|
431
447
|
}
|
|
@@ -437,8 +453,12 @@ var script = {
|
|
|
437
453
|
}
|
|
438
454
|
return selected;
|
|
439
455
|
} else if (this.isRangeSelection()) {
|
|
440
|
-
|
|
441
|
-
|
|
456
|
+
var start = this.parseValueForComparison(this.rawValue[0]);
|
|
457
|
+
if (this.rawValue[1]) {
|
|
458
|
+
var end = this.parseValueForComparison(this.rawValue[1]);
|
|
459
|
+
return this.isDateEquals(start, dateMeta) || this.isDateEquals(end, dateMeta) || this.isDateBetween(start, end, dateMeta);
|
|
460
|
+
} else {
|
|
461
|
+
return this.isDateEquals(start, dateMeta);
|
|
442
462
|
}
|
|
443
463
|
}
|
|
444
464
|
}
|
|
@@ -446,37 +466,47 @@ var script = {
|
|
|
446
466
|
},
|
|
447
467
|
isMonthSelected: function isMonthSelected(month) {
|
|
448
468
|
var _this2 = this;
|
|
449
|
-
if (!this.isComparable()) return false;
|
|
450
469
|
if (this.isMultipleSelection()) {
|
|
451
|
-
|
|
452
|
-
|
|
470
|
+
var _this$rawValue;
|
|
471
|
+
return (_this$rawValue = this.rawValue) === null || _this$rawValue === void 0 ? void 0 : _this$rawValue.some(function (currentValue) {
|
|
472
|
+
var parsedDate = _this2.parseValueForComparison(currentValue);
|
|
473
|
+
return parsedDate.getMonth() === month && parsedDate.getFullYear() === _this2.currentYear;
|
|
453
474
|
});
|
|
454
475
|
} else if (this.isRangeSelection()) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
476
|
+
var _this$rawValue2, _this$rawValue3;
|
|
477
|
+
var parsedStart = (_this$rawValue2 = this.rawValue) !== null && _this$rawValue2 !== void 0 && _this$rawValue2[0] ? this.parseValueForComparison(this.rawValue[0]) : null;
|
|
478
|
+
var parsedEnd = (_this$rawValue3 = this.rawValue) !== null && _this$rawValue3 !== void 0 && _this$rawValue3[1] ? this.parseValueForComparison(this.rawValue[1]) : null;
|
|
479
|
+
if (!parsedEnd) {
|
|
480
|
+
return (parsedStart === null || parsedStart === void 0 ? void 0 : parsedStart.getFullYear()) === this.currentYear && (parsedStart === null || parsedStart === void 0 ? void 0 : parsedStart.getMonth()) === month;
|
|
458
481
|
} else {
|
|
459
482
|
var currentDate = new Date(this.currentYear, month, 1);
|
|
460
|
-
var startDate = new Date(
|
|
461
|
-
var endDate = new Date(
|
|
483
|
+
var startDate = new Date(parsedStart.getFullYear(), parsedStart.getMonth(), 1);
|
|
484
|
+
var endDate = new Date(parsedEnd.getFullYear(), parsedEnd.getMonth(), 1);
|
|
462
485
|
return currentDate >= startDate && currentDate <= endDate;
|
|
463
486
|
}
|
|
464
487
|
} else {
|
|
465
|
-
|
|
488
|
+
var _this$rawValue4, _this$rawValue5;
|
|
489
|
+
return ((_this$rawValue4 = this.rawValue) === null || _this$rawValue4 === void 0 ? void 0 : _this$rawValue4.getMonth()) === month && ((_this$rawValue5 = this.rawValue) === null || _this$rawValue5 === void 0 ? void 0 : _this$rawValue5.getFullYear()) === this.currentYear;
|
|
466
490
|
}
|
|
467
491
|
},
|
|
468
492
|
isYearSelected: function isYearSelected(year) {
|
|
469
|
-
|
|
493
|
+
var _this3 = this;
|
|
470
494
|
if (this.isMultipleSelection()) {
|
|
471
|
-
|
|
472
|
-
|
|
495
|
+
var _this$rawValue6;
|
|
496
|
+
return (_this$rawValue6 = this.rawValue) === null || _this$rawValue6 === void 0 ? void 0 : _this$rawValue6.some(function (currentValue) {
|
|
497
|
+
var parsedDate = _this3.parseValueForComparison(currentValue);
|
|
498
|
+
return parsedDate.getFullYear() === year;
|
|
473
499
|
});
|
|
474
500
|
} else if (this.isRangeSelection()) {
|
|
475
|
-
var
|
|
476
|
-
var
|
|
501
|
+
var _this$rawValue7, _this$rawValue8;
|
|
502
|
+
var parsedStart = (_this$rawValue7 = this.rawValue) !== null && _this$rawValue7 !== void 0 && _this$rawValue7[0] ? this.parseValueForComparison(this.rawValue[0]) : null;
|
|
503
|
+
var parsedEnd = (_this$rawValue8 = this.rawValue) !== null && _this$rawValue8 !== void 0 && _this$rawValue8[1] ? this.parseValueForComparison(this.rawValue[1]) : null;
|
|
504
|
+
var start = parsedStart ? parsedStart.getFullYear() : null;
|
|
505
|
+
var end = parsedEnd ? parsedEnd.getFullYear() : null;
|
|
477
506
|
return start === year || end === year || start < year && end > year;
|
|
478
507
|
} else {
|
|
479
|
-
|
|
508
|
+
var _this$rawValue9;
|
|
509
|
+
return ((_this$rawValue9 = this.rawValue) === null || _this$rawValue9 === void 0 ? void 0 : _this$rawValue9.getFullYear()) === year;
|
|
480
510
|
}
|
|
481
511
|
},
|
|
482
512
|
isDateEquals: function isDateEquals(value, dateMeta) {
|
|
@@ -484,9 +514,11 @@ var script = {
|
|
|
484
514
|
},
|
|
485
515
|
isDateBetween: function isDateBetween(start, end, dateMeta) {
|
|
486
516
|
var between = false;
|
|
487
|
-
|
|
517
|
+
var parsedStart = this.parseValueForComparison(start);
|
|
518
|
+
var parsedEnd = this.parseValueForComparison(end);
|
|
519
|
+
if (parsedStart && parsedEnd) {
|
|
488
520
|
var date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
|
|
489
|
-
return
|
|
521
|
+
return parsedStart.getTime() <= date.getTime() && parsedEnd.getTime() >= date.getTime();
|
|
490
522
|
}
|
|
491
523
|
return between;
|
|
492
524
|
},
|
|
@@ -728,11 +760,11 @@ var script = {
|
|
|
728
760
|
this.currentSecond = Math.floor(date.getSeconds() / this.stepSecond) * this.stepSecond;
|
|
729
761
|
},
|
|
730
762
|
bindOutsideClickListener: function bindOutsideClickListener() {
|
|
731
|
-
var
|
|
763
|
+
var _this4 = this;
|
|
732
764
|
if (!this.outsideClickListener) {
|
|
733
765
|
this.outsideClickListener = function (event) {
|
|
734
|
-
if (
|
|
735
|
-
|
|
766
|
+
if (_this4.overlayVisible && _this4.isOutsideClicked(event)) {
|
|
767
|
+
_this4.overlayVisible = false;
|
|
736
768
|
}
|
|
737
769
|
};
|
|
738
770
|
document.addEventListener('mousedown', this.outsideClickListener);
|
|
@@ -745,11 +777,11 @@ var script = {
|
|
|
745
777
|
}
|
|
746
778
|
},
|
|
747
779
|
bindScrollListener: function bindScrollListener() {
|
|
748
|
-
var
|
|
780
|
+
var _this5 = this;
|
|
749
781
|
if (!this.scrollHandler) {
|
|
750
782
|
this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function () {
|
|
751
|
-
if (
|
|
752
|
-
|
|
783
|
+
if (_this5.overlayVisible) {
|
|
784
|
+
_this5.overlayVisible = false;
|
|
753
785
|
}
|
|
754
786
|
});
|
|
755
787
|
}
|
|
@@ -761,11 +793,11 @@ var script = {
|
|
|
761
793
|
}
|
|
762
794
|
},
|
|
763
795
|
bindResizeListener: function bindResizeListener() {
|
|
764
|
-
var
|
|
796
|
+
var _this6 = this;
|
|
765
797
|
if (!this.resizeListener) {
|
|
766
798
|
this.resizeListener = function () {
|
|
767
|
-
if (
|
|
768
|
-
|
|
799
|
+
if (_this6.overlayVisible && !isTouchDevice()) {
|
|
800
|
+
_this6.overlayVisible = false;
|
|
769
801
|
}
|
|
770
802
|
};
|
|
771
803
|
window.addEventListener('resize', this.resizeListener);
|
|
@@ -778,14 +810,14 @@ var script = {
|
|
|
778
810
|
}
|
|
779
811
|
},
|
|
780
812
|
bindMatchMediaListener: function bindMatchMediaListener() {
|
|
781
|
-
var
|
|
813
|
+
var _this7 = this;
|
|
782
814
|
if (!this.matchMediaListener) {
|
|
783
815
|
var query = matchMedia("(max-width: ".concat(this.breakpoint, ")"));
|
|
784
816
|
this.query = query;
|
|
785
817
|
this.queryMatches = query.matches;
|
|
786
818
|
this.matchMediaListener = function () {
|
|
787
|
-
|
|
788
|
-
|
|
819
|
+
_this7.queryMatches = query.matches;
|
|
820
|
+
_this7.mobileActive = false;
|
|
789
821
|
};
|
|
790
822
|
this.query.addEventListener('change', this.matchMediaListener);
|
|
791
823
|
}
|
|
@@ -797,12 +829,12 @@ var script = {
|
|
|
797
829
|
}
|
|
798
830
|
},
|
|
799
831
|
bindMatchMediaOrientationListener: function bindMatchMediaOrientationListener() {
|
|
800
|
-
var
|
|
832
|
+
var _this8 = this;
|
|
801
833
|
if (!this.matchMediaOrientationListener) {
|
|
802
834
|
var query = matchMedia("(orientation: portrait)");
|
|
803
835
|
this.queryOrientation = query;
|
|
804
836
|
this.matchMediaOrientationListener = function () {
|
|
805
|
-
|
|
837
|
+
_this8.alignOverlay();
|
|
806
838
|
};
|
|
807
839
|
this.queryOrientation.addEventListener('change', this.matchMediaOrientationListener);
|
|
808
840
|
}
|
|
@@ -888,7 +920,7 @@ var script = {
|
|
|
888
920
|
});
|
|
889
921
|
},
|
|
890
922
|
onDateSelect: function onDateSelect(event, dateMeta) {
|
|
891
|
-
var
|
|
923
|
+
var _this9 = this;
|
|
892
924
|
if (this.disabled || !dateMeta.selectable) {
|
|
893
925
|
return;
|
|
894
926
|
}
|
|
@@ -899,8 +931,8 @@ var script = {
|
|
|
899
931
|
event.currentTarget.focus();
|
|
900
932
|
}
|
|
901
933
|
if (this.isMultipleSelection() && this.isSelected(dateMeta)) {
|
|
902
|
-
var newValue = this.
|
|
903
|
-
return !
|
|
934
|
+
var newValue = this.rawValue.filter(function (date) {
|
|
935
|
+
return !_this9.isDateEquals(_this9.parseValueForComparison(date), dateMeta);
|
|
904
936
|
});
|
|
905
937
|
this.updateModel(newValue);
|
|
906
938
|
} else {
|
|
@@ -919,12 +951,12 @@ var script = {
|
|
|
919
951
|
this.input.focus();
|
|
920
952
|
}
|
|
921
953
|
setTimeout(function () {
|
|
922
|
-
|
|
954
|
+
_this9.overlayVisible = false;
|
|
923
955
|
}, 150);
|
|
924
956
|
}
|
|
925
957
|
},
|
|
926
958
|
selectDate: function selectDate(dateMeta) {
|
|
927
|
-
var
|
|
959
|
+
var _this0 = this;
|
|
928
960
|
var date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
|
|
929
961
|
if (this.showTime) {
|
|
930
962
|
this.hourFormat === '12' && this.currentHour !== 12 && this.pm ? date.setHours(this.currentHour + 12) : date.setHours(this.currentHour);
|
|
@@ -947,11 +979,11 @@ var script = {
|
|
|
947
979
|
if (this.isSingleSelection()) {
|
|
948
980
|
modelVal = date;
|
|
949
981
|
} else if (this.isMultipleSelection()) {
|
|
950
|
-
modelVal = this.
|
|
982
|
+
modelVal = this.rawValue ? [].concat(_toConsumableArray(this.rawValue), [date]) : [date];
|
|
951
983
|
} else if (this.isRangeSelection()) {
|
|
952
|
-
if (this.
|
|
953
|
-
var startDate = this.
|
|
954
|
-
var endDate = this.
|
|
984
|
+
if (this.rawValue && this.rawValue.length) {
|
|
985
|
+
var startDate = this.parseValueForComparison(this.rawValue[0]);
|
|
986
|
+
var endDate = this.rawValue[1];
|
|
955
987
|
if (!endDate && date.getTime() >= startDate.getTime()) {
|
|
956
988
|
endDate = date;
|
|
957
989
|
this.focusedDateIndex = 1;
|
|
@@ -971,16 +1003,53 @@ var script = {
|
|
|
971
1003
|
}
|
|
972
1004
|
if (this.isRangeSelection() && this.hideOnRangeSelection && modelVal[1] !== null) {
|
|
973
1005
|
setTimeout(function () {
|
|
974
|
-
|
|
1006
|
+
_this0.overlayVisible = false;
|
|
975
1007
|
}, 150);
|
|
976
1008
|
}
|
|
977
1009
|
this.$emit('date-select', date);
|
|
978
1010
|
},
|
|
979
1011
|
updateModel: function updateModel(value) {
|
|
980
|
-
this
|
|
1012
|
+
var _this1 = this;
|
|
1013
|
+
this.rawValue = value;
|
|
1014
|
+
if (this.updateModelType === 'date') {
|
|
1015
|
+
if (this.isSingleSelection()) {
|
|
1016
|
+
this.writeValue(value);
|
|
1017
|
+
} else {
|
|
1018
|
+
var stringArrValue = null;
|
|
1019
|
+
if (Array.isArray(value)) {
|
|
1020
|
+
stringArrValue = value.map(function (date) {
|
|
1021
|
+
return _this1.parseValueForComparison(date);
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
this.writeValue(stringArrValue);
|
|
1025
|
+
}
|
|
1026
|
+
} else if (this.updateModelType == 'string') {
|
|
1027
|
+
if (this.isSingleSelection()) {
|
|
1028
|
+
this.writeValue(this.formatDateTime(value));
|
|
1029
|
+
} else if (this.isMultipleSelection()) {
|
|
1030
|
+
var _stringArrValue = null;
|
|
1031
|
+
if (Array.isArray(value)) {
|
|
1032
|
+
_stringArrValue = value.map(function (date) {
|
|
1033
|
+
return _this1.formatDateTime(date);
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
this.writeValue(_stringArrValue);
|
|
1037
|
+
} else if (this.isRangeSelection()) {
|
|
1038
|
+
var _stringArrValue2 = null;
|
|
1039
|
+
if (Array.isArray(value)) {
|
|
1040
|
+
_stringArrValue2 = value.map(function (date) {
|
|
1041
|
+
if (date === null || date === undefined) {
|
|
1042
|
+
return null;
|
|
1043
|
+
}
|
|
1044
|
+
return typeof date === 'string' ? date : _this1.formatDateTime(date);
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
this.writeValue(_stringArrValue2);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
981
1050
|
},
|
|
982
1051
|
shouldSelectDate: function shouldSelectDate() {
|
|
983
|
-
if (this.isMultipleSelection()) return this.maxDateCount != null ? this.maxDateCount > (this.
|
|
1052
|
+
if (this.isMultipleSelection()) return this.maxDateCount != null ? this.maxDateCount > (this.rawValue ? this.rawValue.length : 0) : true;else return true;
|
|
984
1053
|
},
|
|
985
1054
|
isSingleSelection: function isSingleSelection() {
|
|
986
1055
|
return this.selectionMode === 'single';
|
|
@@ -1002,7 +1071,7 @@ var script = {
|
|
|
1002
1071
|
formattedValue = this.formatDateTime(value);
|
|
1003
1072
|
} else if (this.isMultipleSelection()) {
|
|
1004
1073
|
for (var i = 0; i < value.length; i++) {
|
|
1005
|
-
var dateAsString = this.formatDateTime(value[i]);
|
|
1074
|
+
var dateAsString = typeof value[i] === 'string' ? this.formatDateTime(this.parseValueForComparison(value[i])) : this.formatDateTime(value[i]);
|
|
1006
1075
|
formattedValue += dateAsString;
|
|
1007
1076
|
if (i !== value.length - 1) {
|
|
1008
1077
|
formattedValue += ', ';
|
|
@@ -1010,8 +1079,8 @@ var script = {
|
|
|
1010
1079
|
}
|
|
1011
1080
|
} else if (this.isRangeSelection()) {
|
|
1012
1081
|
if (value && value.length) {
|
|
1013
|
-
var startDate = value[0];
|
|
1014
|
-
var endDate = value[1];
|
|
1082
|
+
var startDate = this.parseValueForComparison(value[0]);
|
|
1083
|
+
var endDate = this.parseValueForComparison(value[1]);
|
|
1015
1084
|
formattedValue = this.formatDateTime(startDate);
|
|
1016
1085
|
if (endDate) {
|
|
1017
1086
|
formattedValue += ' - ' + this.formatDateTime(endDate);
|
|
@@ -1026,7 +1095,7 @@ var script = {
|
|
|
1026
1095
|
},
|
|
1027
1096
|
formatDateTime: function formatDateTime(date) {
|
|
1028
1097
|
var formattedValue = null;
|
|
1029
|
-
if (date) {
|
|
1098
|
+
if (isDate(date) && isNotEmpty(date)) {
|
|
1030
1099
|
if (this.timeOnly) {
|
|
1031
1100
|
formattedValue = this.formatTime(date);
|
|
1032
1101
|
} else {
|
|
@@ -1035,6 +1104,8 @@ var script = {
|
|
|
1035
1104
|
formattedValue += ' ' + this.formatTime(date);
|
|
1036
1105
|
}
|
|
1037
1106
|
}
|
|
1107
|
+
} else if (this.updateModelType === 'string') {
|
|
1108
|
+
formattedValue = date;
|
|
1038
1109
|
}
|
|
1039
1110
|
return formattedValue;
|
|
1040
1111
|
},
|
|
@@ -1155,7 +1226,7 @@ var script = {
|
|
|
1155
1226
|
event.preventDefault();
|
|
1156
1227
|
},
|
|
1157
1228
|
onClearButtonClick: function onClearButtonClick(event) {
|
|
1158
|
-
this.updateModel(
|
|
1229
|
+
this.updateModel(null);
|
|
1159
1230
|
this.overlayVisible = false;
|
|
1160
1231
|
this.$emit('clear-click', event);
|
|
1161
1232
|
event.preventDefault();
|
|
@@ -1202,11 +1273,11 @@ var script = {
|
|
|
1202
1273
|
}
|
|
1203
1274
|
},
|
|
1204
1275
|
repeat: function repeat(event, interval, type, direction) {
|
|
1205
|
-
var
|
|
1276
|
+
var _this10 = this;
|
|
1206
1277
|
var i = interval || 500;
|
|
1207
1278
|
this.clearTimePickerTimer();
|
|
1208
1279
|
this.timePickerTimer = setTimeout(function () {
|
|
1209
|
-
|
|
1280
|
+
_this10.repeat(event, 100, type, direction);
|
|
1210
1281
|
}, i);
|
|
1211
1282
|
switch (type) {
|
|
1212
1283
|
case 0:
|
|
@@ -1231,13 +1302,13 @@ var script = {
|
|
|
1231
1302
|
return hours;
|
|
1232
1303
|
},
|
|
1233
1304
|
validateTime: function validateTime(hour, minute, second, pm) {
|
|
1234
|
-
var value = this.
|
|
1305
|
+
var value = this.viewDate;
|
|
1235
1306
|
var convertedHour = this.convertTo24Hour(hour, pm);
|
|
1236
1307
|
if (this.isRangeSelection()) {
|
|
1237
|
-
value = this.
|
|
1308
|
+
value = this.rawValue[1] || this.rawValue[0];
|
|
1238
1309
|
}
|
|
1239
1310
|
if (this.isMultipleSelection()) {
|
|
1240
|
-
value = this.
|
|
1311
|
+
value = this.rawValue[this.rawValue.length - 1];
|
|
1241
1312
|
}
|
|
1242
1313
|
var valueDateString = value ? value.toDateString() : null;
|
|
1243
1314
|
if (this.minDate && valueDateString && this.minDate.toDateString() === valueDateString) {
|
|
@@ -1336,14 +1407,14 @@ var script = {
|
|
|
1336
1407
|
event.preventDefault();
|
|
1337
1408
|
},
|
|
1338
1409
|
updateModelTime: function updateModelTime() {
|
|
1339
|
-
var
|
|
1410
|
+
var _this11 = this;
|
|
1340
1411
|
this.timePickerChange = true;
|
|
1341
|
-
var value = this.
|
|
1412
|
+
var value = this.viewDate;
|
|
1342
1413
|
if (this.isRangeSelection()) {
|
|
1343
|
-
value = this.
|
|
1414
|
+
value = this.rawValue[this.focusedDateIndex] || this.rawValue[0];
|
|
1344
1415
|
}
|
|
1345
1416
|
if (this.isMultipleSelection()) {
|
|
1346
|
-
value = this.
|
|
1417
|
+
value = this.rawValue[this.rawValue.length - 1];
|
|
1347
1418
|
}
|
|
1348
1419
|
value = value ? new Date(value.getTime()) : new Date();
|
|
1349
1420
|
if (this.hourFormat == '12') {
|
|
@@ -1354,21 +1425,21 @@ var script = {
|
|
|
1354
1425
|
value.setMinutes(this.currentMinute);
|
|
1355
1426
|
value.setSeconds(this.currentSecond);
|
|
1356
1427
|
if (this.isRangeSelection()) {
|
|
1357
|
-
if (this.focusedDateIndex === 1 && this.
|
|
1358
|
-
value = [this.
|
|
1428
|
+
if (this.focusedDateIndex === 1 && this.rawValue[1]) {
|
|
1429
|
+
value = [this.rawValue[0], value];
|
|
1359
1430
|
} else if (this.focusedDateIndex === 0) {
|
|
1360
|
-
value = [value, this.
|
|
1431
|
+
value = [value, this.rawValue[1]];
|
|
1361
1432
|
} else {
|
|
1362
1433
|
value = [value, null];
|
|
1363
1434
|
}
|
|
1364
1435
|
}
|
|
1365
1436
|
if (this.isMultipleSelection()) {
|
|
1366
|
-
value = [].concat(_toConsumableArray(this.
|
|
1437
|
+
value = [].concat(_toConsumableArray(this.rawValue.slice(0, -1)), [value]);
|
|
1367
1438
|
}
|
|
1368
1439
|
this.updateModel(value);
|
|
1369
1440
|
this.$emit('date-select', value);
|
|
1370
1441
|
setTimeout(function () {
|
|
1371
|
-
return
|
|
1442
|
+
return _this11.timePickerChange = false;
|
|
1372
1443
|
}, 0);
|
|
1373
1444
|
},
|
|
1374
1445
|
toggleAMPM: function toggleAMPM(event) {
|
|
@@ -1427,14 +1498,14 @@ var script = {
|
|
|
1427
1498
|
this.currentYear = viewDate.getFullYear();
|
|
1428
1499
|
if (this.showTime || this.timeOnly) {
|
|
1429
1500
|
var timeDate = viewDate;
|
|
1430
|
-
if (this.isRangeSelection() && this.
|
|
1431
|
-
timeDate = this.
|
|
1501
|
+
if (this.isRangeSelection() && this.rawValue && this.rawValue[this.focusedDateIndex]) {
|
|
1502
|
+
timeDate = this.rawValue[this.focusedDateIndex];
|
|
1432
1503
|
}
|
|
1433
1504
|
this.updateCurrentTimeMeta(timeDate);
|
|
1434
1505
|
}
|
|
1435
1506
|
},
|
|
1436
1507
|
isValidSelection: function isValidSelection(value) {
|
|
1437
|
-
var
|
|
1508
|
+
var _this12 = this;
|
|
1438
1509
|
if (value == null) {
|
|
1439
1510
|
return true;
|
|
1440
1511
|
}
|
|
@@ -1444,7 +1515,7 @@ var script = {
|
|
|
1444
1515
|
isValid = false;
|
|
1445
1516
|
}
|
|
1446
1517
|
} else if (value.every(function (v) {
|
|
1447
|
-
return
|
|
1518
|
+
return _this12.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false);
|
|
1448
1519
|
})) {
|
|
1449
1520
|
if (this.isRangeSelection()) {
|
|
1450
1521
|
isValid = value.length > 1 && value[1] >= value[0];
|
|
@@ -1483,17 +1554,24 @@ var script = {
|
|
|
1483
1554
|
}
|
|
1484
1555
|
return value;
|
|
1485
1556
|
},
|
|
1557
|
+
parseValueForComparison: function parseValueForComparison(value) {
|
|
1558
|
+
if (typeof value === 'string') {
|
|
1559
|
+
var parsedValue = this.parseValue(value);
|
|
1560
|
+
return this.isSingleSelection() ? parsedValue : parsedValue[0];
|
|
1561
|
+
}
|
|
1562
|
+
return value;
|
|
1563
|
+
},
|
|
1486
1564
|
parseDateTime: function parseDateTime(text) {
|
|
1487
1565
|
var date;
|
|
1488
|
-
var parts = text.
|
|
1566
|
+
var parts = text.match(/(?:(.+?) )?(\d{2}:\d{2})(?: (am|pm))?/);
|
|
1489
1567
|
if (this.timeOnly) {
|
|
1490
1568
|
date = new Date();
|
|
1491
|
-
this.populateTime(date, parts[
|
|
1569
|
+
this.populateTime(date, parts[2], parts[3]);
|
|
1492
1570
|
} else {
|
|
1493
1571
|
var dateFormat = this.datePattern;
|
|
1494
1572
|
if (this.showTime) {
|
|
1495
|
-
date = this.parseDate(parts[
|
|
1496
|
-
this.populateTime(date, parts[
|
|
1573
|
+
date = this.parseDate(parts[1], dateFormat);
|
|
1574
|
+
this.populateTime(date, parts[2], parts[3]);
|
|
1497
1575
|
} else {
|
|
1498
1576
|
date = this.parseDate(text, dateFormat);
|
|
1499
1577
|
}
|
|
@@ -1676,7 +1754,7 @@ var script = {
|
|
|
1676
1754
|
month = 1;
|
|
1677
1755
|
day = doy;
|
|
1678
1756
|
do {
|
|
1679
|
-
dim = this.getDaysCountInMonth(
|
|
1757
|
+
dim = this.getDaysCountInMonth(month - 1, year);
|
|
1680
1758
|
if (day <= dim) {
|
|
1681
1759
|
break;
|
|
1682
1760
|
}
|
|
@@ -2221,12 +2299,16 @@ var script = {
|
|
|
2221
2299
|
},
|
|
2222
2300
|
onInput: function onInput(event) {
|
|
2223
2301
|
try {
|
|
2302
|
+
var _this$$refs$clearIcon3;
|
|
2224
2303
|
this.selectionStart = this.input.selectionStart;
|
|
2225
2304
|
this.selectionEnd = this.input.selectionEnd;
|
|
2305
|
+
if ((_this$$refs$clearIcon3 = this.$refs.clearIcon) !== null && _this$$refs$clearIcon3 !== void 0 && (_this$$refs$clearIcon3 = _this$$refs$clearIcon3.$el) !== null && _this$$refs$clearIcon3 !== void 0 && _this$$refs$clearIcon3.style) {
|
|
2306
|
+
this.$refs.clearIcon.$el.style.display = isEmpty(event.target.value) ? 'none' : 'block';
|
|
2307
|
+
}
|
|
2226
2308
|
var value = this.parseValue(event.target.value);
|
|
2227
2309
|
if (this.isValidSelection(value)) {
|
|
2228
2310
|
this.typeUpdate = true;
|
|
2229
|
-
this.updateModel(value);
|
|
2311
|
+
this.updateModel(this.updateModelType === 'string' ? this.formatValue(value) : value);
|
|
2230
2312
|
this.updateCurrentMetaData();
|
|
2231
2313
|
}
|
|
2232
2314
|
} catch (err) {
|
|
@@ -2247,14 +2329,17 @@ var script = {
|
|
|
2247
2329
|
this.$emit('focus', event);
|
|
2248
2330
|
},
|
|
2249
2331
|
onBlur: function onBlur(event) {
|
|
2250
|
-
var _this$formField$onBlu, _this$formField;
|
|
2332
|
+
var _this$formField$onBlu, _this$formField, _this$$refs$clearIcon4;
|
|
2251
2333
|
this.$emit('blur', {
|
|
2252
2334
|
originalEvent: event,
|
|
2253
2335
|
value: event.target.value
|
|
2254
2336
|
});
|
|
2255
2337
|
(_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField);
|
|
2256
2338
|
this.focused = false;
|
|
2257
|
-
event.target.value = this.formatValue(this.
|
|
2339
|
+
event.target.value = this.formatValue(this.rawValue);
|
|
2340
|
+
if ((_this$$refs$clearIcon4 = this.$refs.clearIcon) !== null && _this$$refs$clearIcon4 !== void 0 && (_this$$refs$clearIcon4 = _this$$refs$clearIcon4.$el) !== null && _this$$refs$clearIcon4 !== void 0 && _this$$refs$clearIcon4.style) {
|
|
2341
|
+
this.$refs.clearIcon.$el.style.display = isEmpty(event.target.value) ? 'none' : 'block';
|
|
2342
|
+
}
|
|
2258
2343
|
},
|
|
2259
2344
|
onKeyDown: function onKeyDown(event) {
|
|
2260
2345
|
if (event.code === 'ArrowDown' && this.overlay) {
|
|
@@ -2309,6 +2394,10 @@ var script = {
|
|
|
2309
2394
|
getYear: function getYear(month) {
|
|
2310
2395
|
return this.currentView === 'month' ? this.currentYear : month.year;
|
|
2311
2396
|
},
|
|
2397
|
+
onClearClick: function onClearClick() {
|
|
2398
|
+
this.updateModel(null);
|
|
2399
|
+
this.overlayVisible = false;
|
|
2400
|
+
},
|
|
2312
2401
|
onOverlayClick: function onOverlayClick(event) {
|
|
2313
2402
|
event.stopPropagation();
|
|
2314
2403
|
if (!this.inline) {
|
|
@@ -2380,17 +2469,21 @@ var script = {
|
|
|
2380
2469
|
},
|
|
2381
2470
|
computed: {
|
|
2382
2471
|
viewDate: function viewDate() {
|
|
2383
|
-
var propValue = this.
|
|
2472
|
+
var propValue = this.rawValue;
|
|
2384
2473
|
if (propValue && Array.isArray(propValue)) {
|
|
2385
2474
|
if (this.isRangeSelection()) {
|
|
2386
|
-
if (propValue.length ===
|
|
2475
|
+
if (propValue.length === 0) {
|
|
2476
|
+
propValue = null;
|
|
2477
|
+
} else if (propValue.length === 1) {
|
|
2387
2478
|
propValue = propValue[0];
|
|
2388
2479
|
} else {
|
|
2389
|
-
var
|
|
2480
|
+
var start = this.parseValueForComparison(propValue[0]);
|
|
2481
|
+
var lastVisibleMonth = new Date(start.getFullYear(), start.getMonth() + this.numberOfMonths, 1);
|
|
2390
2482
|
if (propValue[1] < lastVisibleMonth) {
|
|
2391
2483
|
propValue = propValue[0];
|
|
2392
2484
|
} else {
|
|
2393
|
-
|
|
2485
|
+
var end = this.parseValueForComparison(propValue[1]);
|
|
2486
|
+
propValue = new Date(end.getFullYear(), end.getMonth() - this.numberOfMonths + 1, 1);
|
|
2394
2487
|
}
|
|
2395
2488
|
}
|
|
2396
2489
|
} else if (this.isMultipleSelection()) {
|
|
@@ -2411,7 +2504,7 @@ var script = {
|
|
|
2411
2504
|
}
|
|
2412
2505
|
},
|
|
2413
2506
|
inputFieldValue: function inputFieldValue() {
|
|
2414
|
-
return this.formatValue(this.
|
|
2507
|
+
return this.formatValue(this.rawValue);
|
|
2415
2508
|
},
|
|
2416
2509
|
months: function months() {
|
|
2417
2510
|
var months = [];
|
|
@@ -2512,20 +2605,20 @@ var script = {
|
|
|
2512
2605
|
return this.dateFormat || this.$primevue.config.locale.dateFormat;
|
|
2513
2606
|
},
|
|
2514
2607
|
monthPickerValues: function monthPickerValues() {
|
|
2515
|
-
var
|
|
2608
|
+
var _this13 = this;
|
|
2516
2609
|
var monthPickerValues = [];
|
|
2517
2610
|
var isSelectableMonth = function isSelectableMonth(baseMonth) {
|
|
2518
|
-
if (
|
|
2519
|
-
var minMonth =
|
|
2520
|
-
var minYear =
|
|
2521
|
-
if (
|
|
2611
|
+
if (_this13.minDate) {
|
|
2612
|
+
var minMonth = _this13.minDate.getMonth();
|
|
2613
|
+
var minYear = _this13.minDate.getFullYear();
|
|
2614
|
+
if (_this13.currentYear < minYear || _this13.currentYear === minYear && baseMonth < minMonth) {
|
|
2522
2615
|
return false;
|
|
2523
2616
|
}
|
|
2524
2617
|
}
|
|
2525
|
-
if (
|
|
2526
|
-
var maxMonth =
|
|
2527
|
-
var maxYear =
|
|
2528
|
-
if (
|
|
2618
|
+
if (_this13.maxDate) {
|
|
2619
|
+
var maxMonth = _this13.maxDate.getMonth();
|
|
2620
|
+
var maxYear = _this13.maxDate.getFullYear();
|
|
2621
|
+
if (_this13.currentYear > maxYear || _this13.currentYear === maxYear && baseMonth > maxMonth) {
|
|
2529
2622
|
return false;
|
|
2530
2623
|
}
|
|
2531
2624
|
}
|
|
@@ -2540,15 +2633,15 @@ var script = {
|
|
|
2540
2633
|
return monthPickerValues;
|
|
2541
2634
|
},
|
|
2542
2635
|
yearPickerValues: function yearPickerValues() {
|
|
2543
|
-
var
|
|
2636
|
+
var _this14 = this;
|
|
2544
2637
|
var yearPickerValues = [];
|
|
2545
2638
|
var base = this.currentYear - this.currentYear % 10;
|
|
2546
2639
|
var isSelectableYear = function isSelectableYear(baseYear) {
|
|
2547
|
-
if (
|
|
2548
|
-
if (
|
|
2640
|
+
if (_this14.minDate) {
|
|
2641
|
+
if (_this14.minDate.getFullYear() > baseYear) return false;
|
|
2549
2642
|
}
|
|
2550
|
-
if (
|
|
2551
|
-
if (
|
|
2643
|
+
if (_this14.maxDate) {
|
|
2644
|
+
if (_this14.maxDate.getFullYear() < baseYear) return false;
|
|
2552
2645
|
}
|
|
2553
2646
|
return true;
|
|
2554
2647
|
};
|
|
@@ -2587,6 +2680,9 @@ var script = {
|
|
|
2587
2680
|
switchViewButtonDisabled: function switchViewButtonDisabled() {
|
|
2588
2681
|
return this.numberOfMonths > 1 || this.disabled;
|
|
2589
2682
|
},
|
|
2683
|
+
isClearIconVisible: function isClearIconVisible() {
|
|
2684
|
+
return this.showClear && this.rawValue != null && !this.disabled;
|
|
2685
|
+
},
|
|
2590
2686
|
panelId: function panelId() {
|
|
2591
2687
|
return this.$id + '_panel';
|
|
2592
2688
|
},
|
|
@@ -2609,122 +2705,122 @@ var script = {
|
|
|
2609
2705
|
});
|
|
2610
2706
|
},
|
|
2611
2707
|
hourIncrementCallbacks: function hourIncrementCallbacks() {
|
|
2612
|
-
var
|
|
2708
|
+
var _this15 = this;
|
|
2613
2709
|
return {
|
|
2614
2710
|
mousedown: function mousedown(event) {
|
|
2615
|
-
return
|
|
2711
|
+
return _this15.onTimePickerElementMouseDown(event, 0, 1);
|
|
2616
2712
|
},
|
|
2617
2713
|
mouseup: function mouseup(event) {
|
|
2618
|
-
return
|
|
2714
|
+
return _this15.onTimePickerElementMouseUp(event);
|
|
2619
2715
|
},
|
|
2620
2716
|
mouseleave: function mouseleave() {
|
|
2621
|
-
return
|
|
2717
|
+
return _this15.onTimePickerElementMouseLeave();
|
|
2622
2718
|
},
|
|
2623
2719
|
keydown: function keydown(event) {
|
|
2624
|
-
return
|
|
2720
|
+
return _this15.onTimePickerElementKeyDown(event, 0, 1);
|
|
2625
2721
|
},
|
|
2626
2722
|
keyup: function keyup(event) {
|
|
2627
|
-
return
|
|
2723
|
+
return _this15.onTimePickerElementKeyUp(event);
|
|
2628
2724
|
}
|
|
2629
2725
|
};
|
|
2630
2726
|
},
|
|
2631
2727
|
hourDecrementCallbacks: function hourDecrementCallbacks() {
|
|
2632
|
-
var
|
|
2728
|
+
var _this16 = this;
|
|
2633
2729
|
return {
|
|
2634
2730
|
mousedown: function mousedown(event) {
|
|
2635
|
-
return
|
|
2731
|
+
return _this16.onTimePickerElementMouseDown(event, 0, -1);
|
|
2636
2732
|
},
|
|
2637
2733
|
mouseup: function mouseup(event) {
|
|
2638
|
-
return
|
|
2734
|
+
return _this16.onTimePickerElementMouseUp(event);
|
|
2639
2735
|
},
|
|
2640
2736
|
mouseleave: function mouseleave() {
|
|
2641
|
-
return
|
|
2737
|
+
return _this16.onTimePickerElementMouseLeave();
|
|
2642
2738
|
},
|
|
2643
2739
|
keydown: function keydown(event) {
|
|
2644
|
-
return
|
|
2740
|
+
return _this16.onTimePickerElementKeyDown(event, 0, -1);
|
|
2645
2741
|
},
|
|
2646
2742
|
keyup: function keyup(event) {
|
|
2647
|
-
return
|
|
2743
|
+
return _this16.onTimePickerElementKeyUp(event);
|
|
2648
2744
|
}
|
|
2649
2745
|
};
|
|
2650
2746
|
},
|
|
2651
2747
|
minuteIncrementCallbacks: function minuteIncrementCallbacks() {
|
|
2652
|
-
var
|
|
2748
|
+
var _this17 = this;
|
|
2653
2749
|
return {
|
|
2654
2750
|
mousedown: function mousedown(event) {
|
|
2655
|
-
return
|
|
2751
|
+
return _this17.onTimePickerElementMouseDown(event, 1, 1);
|
|
2656
2752
|
},
|
|
2657
2753
|
mouseup: function mouseup(event) {
|
|
2658
|
-
return
|
|
2754
|
+
return _this17.onTimePickerElementMouseUp(event);
|
|
2659
2755
|
},
|
|
2660
2756
|
mouseleave: function mouseleave() {
|
|
2661
|
-
return
|
|
2757
|
+
return _this17.onTimePickerElementMouseLeave();
|
|
2662
2758
|
},
|
|
2663
2759
|
keydown: function keydown(event) {
|
|
2664
|
-
return
|
|
2760
|
+
return _this17.onTimePickerElementKeyDown(event, 1, 1);
|
|
2665
2761
|
},
|
|
2666
2762
|
keyup: function keyup(event) {
|
|
2667
|
-
return
|
|
2763
|
+
return _this17.onTimePickerElementKeyUp(event);
|
|
2668
2764
|
}
|
|
2669
2765
|
};
|
|
2670
2766
|
},
|
|
2671
2767
|
minuteDecrementCallbacks: function minuteDecrementCallbacks() {
|
|
2672
|
-
var
|
|
2768
|
+
var _this18 = this;
|
|
2673
2769
|
return {
|
|
2674
2770
|
mousedown: function mousedown(event) {
|
|
2675
|
-
return
|
|
2771
|
+
return _this18.onTimePickerElementMouseDown(event, 1, -1);
|
|
2676
2772
|
},
|
|
2677
2773
|
mouseup: function mouseup(event) {
|
|
2678
|
-
return
|
|
2774
|
+
return _this18.onTimePickerElementMouseUp(event);
|
|
2679
2775
|
},
|
|
2680
2776
|
mouseleave: function mouseleave() {
|
|
2681
|
-
return
|
|
2777
|
+
return _this18.onTimePickerElementMouseLeave();
|
|
2682
2778
|
},
|
|
2683
2779
|
keydown: function keydown(event) {
|
|
2684
|
-
return
|
|
2780
|
+
return _this18.onTimePickerElementKeyDown(event, 1, -1);
|
|
2685
2781
|
},
|
|
2686
2782
|
keyup: function keyup(event) {
|
|
2687
|
-
return
|
|
2783
|
+
return _this18.onTimePickerElementKeyUp(event);
|
|
2688
2784
|
}
|
|
2689
2785
|
};
|
|
2690
2786
|
},
|
|
2691
2787
|
secondIncrementCallbacks: function secondIncrementCallbacks() {
|
|
2692
|
-
var
|
|
2788
|
+
var _this19 = this;
|
|
2693
2789
|
return {
|
|
2694
2790
|
mousedown: function mousedown(event) {
|
|
2695
|
-
return
|
|
2791
|
+
return _this19.onTimePickerElementMouseDown(event, 2, 1);
|
|
2696
2792
|
},
|
|
2697
2793
|
mouseup: function mouseup(event) {
|
|
2698
|
-
return
|
|
2794
|
+
return _this19.onTimePickerElementMouseUp(event);
|
|
2699
2795
|
},
|
|
2700
2796
|
mouseleave: function mouseleave() {
|
|
2701
|
-
return
|
|
2797
|
+
return _this19.onTimePickerElementMouseLeave();
|
|
2702
2798
|
},
|
|
2703
2799
|
keydown: function keydown(event) {
|
|
2704
|
-
return
|
|
2800
|
+
return _this19.onTimePickerElementKeyDown(event, 2, 1);
|
|
2705
2801
|
},
|
|
2706
2802
|
keyup: function keyup(event) {
|
|
2707
|
-
return
|
|
2803
|
+
return _this19.onTimePickerElementKeyUp(event);
|
|
2708
2804
|
}
|
|
2709
2805
|
};
|
|
2710
2806
|
},
|
|
2711
2807
|
secondDecrementCallbacks: function secondDecrementCallbacks() {
|
|
2712
|
-
var
|
|
2808
|
+
var _this20 = this;
|
|
2713
2809
|
return {
|
|
2714
2810
|
mousedown: function mousedown(event) {
|
|
2715
|
-
return
|
|
2811
|
+
return _this20.onTimePickerElementMouseDown(event, 2, -1);
|
|
2716
2812
|
},
|
|
2717
2813
|
mouseup: function mouseup(event) {
|
|
2718
|
-
return
|
|
2814
|
+
return _this20.onTimePickerElementMouseUp(event);
|
|
2719
2815
|
},
|
|
2720
2816
|
mouseleave: function mouseleave() {
|
|
2721
|
-
return
|
|
2817
|
+
return _this20.onTimePickerElementMouseLeave();
|
|
2722
2818
|
},
|
|
2723
2819
|
keydown: function keydown(event) {
|
|
2724
|
-
return
|
|
2820
|
+
return _this20.onTimePickerElementKeyDown(event, 2, -1);
|
|
2725
2821
|
},
|
|
2726
2822
|
keyup: function keyup(event) {
|
|
2727
|
-
return
|
|
2823
|
+
return _this20.onTimePickerElementKeyUp(event);
|
|
2728
2824
|
}
|
|
2729
2825
|
};
|
|
2730
2826
|
}
|
|
@@ -2737,7 +2833,8 @@ var script = {
|
|
|
2737
2833
|
ChevronLeftIcon: ChevronLeftIcon,
|
|
2738
2834
|
ChevronRightIcon: ChevronRightIcon,
|
|
2739
2835
|
ChevronUpIcon: ChevronUpIcon,
|
|
2740
|
-
ChevronDownIcon: ChevronDownIcon
|
|
2836
|
+
ChevronDownIcon: ChevronDownIcon,
|
|
2837
|
+
TimesIcon: TimesIcon
|
|
2741
2838
|
},
|
|
2742
2839
|
directives: {
|
|
2743
2840
|
ripple: Ripple
|
|
@@ -2762,6 +2859,7 @@ var _hoisted_15 = ["onClick", "onKeydown", "data-p-disabled", "data-p-selected"]
|
|
|
2762
2859
|
var _hoisted_16 = ["data-p"];
|
|
2763
2860
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2764
2861
|
var _component_InputText = resolveComponent("InputText");
|
|
2862
|
+
var _component_TimesIcon = resolveComponent("TimesIcon");
|
|
2765
2863
|
var _component_Button = resolveComponent("Button");
|
|
2766
2864
|
var _component_Portal = resolveComponent("Portal");
|
|
2767
2865
|
var _directive_ripple = resolveDirective("ripple");
|
|
@@ -2806,8 +2904,18 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2806
2904
|
"data-p-has-dropdown": _ctx.showIcon && _ctx.iconDisplay === 'button' && !_ctx.inline,
|
|
2807
2905
|
"data-p-has-e-icon": _ctx.showIcon && _ctx.iconDisplay === 'input' && !_ctx.inline,
|
|
2808
2906
|
pt: _ctx.ptm('pcInputText')
|
|
2809
|
-
}, null, 8, ["id", "class", "style", "defaultValue", "placeholder", "name", "size", "invalid", "variant", "fluid", "required", "unstyled", "aria-expanded", "aria-controls", "aria-labelledby", "aria-label", "disabled", "readonly", "onInput", "onClick", "onFocus", "onBlur", "onKeydown", "data-p-has-dropdown", "data-p-has-e-icon", "pt"])) : createCommentVNode("", true), _ctx.
|
|
2907
|
+
}, null, 8, ["id", "class", "style", "defaultValue", "placeholder", "name", "size", "invalid", "variant", "fluid", "required", "unstyled", "aria-expanded", "aria-controls", "aria-labelledby", "aria-label", "disabled", "readonly", "onInput", "onClick", "onFocus", "onBlur", "onKeydown", "data-p-has-dropdown", "data-p-has-e-icon", "pt"])) : createCommentVNode("", true), _ctx.showClear && !_ctx.inline ? renderSlot(_ctx.$slots, "clearicon", {
|
|
2810
2908
|
key: 1,
|
|
2909
|
+
"class": normalizeClass(_ctx.cx('clearIcon')),
|
|
2910
|
+
clearCallback: $options.onClearClick
|
|
2911
|
+
}, function () {
|
|
2912
|
+
return [createVNode(_component_TimesIcon, mergeProps({
|
|
2913
|
+
ref: "clearIcon",
|
|
2914
|
+
"class": [_ctx.cx('clearIcon')],
|
|
2915
|
+
onClick: $options.onClearClick
|
|
2916
|
+
}, _ctx.ptm('clearIcon')), null, 16, ["class", "onClick"])];
|
|
2917
|
+
}) : createCommentVNode("", true), _ctx.showIcon && _ctx.iconDisplay === 'button' && !_ctx.inline ? renderSlot(_ctx.$slots, "dropdownbutton", {
|
|
2918
|
+
key: 2,
|
|
2811
2919
|
toggleCallback: $options.onButtonClick
|
|
2812
2920
|
}, function () {
|
|
2813
2921
|
return [createElementVNode("button", mergeProps({
|
|
@@ -2829,7 +2937,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2829
2937
|
}, _ctx.ptm('dropdownIcon')), null, 16, ["class"]))];
|
|
2830
2938
|
})], 16, _hoisted_2)];
|
|
2831
2939
|
}) : _ctx.showIcon && _ctx.iconDisplay === 'input' && !_ctx.inline ? (openBlock(), createElementBlock(Fragment, {
|
|
2832
|
-
key:
|
|
2940
|
+
key: 3
|
|
2833
2941
|
}, [_ctx.$slots.inputicon || _ctx.showIcon ? (openBlock(), createElementBlock("span", mergeProps({
|
|
2834
2942
|
key: 0,
|
|
2835
2943
|
"class": _ctx.cx('inputIconContainer'),
|
|
@@ -2922,8 +3030,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2922
3030
|
}, _ctx.ptm('pcPrevButton')['icon']), null, 16, ["class"]))];
|
|
2923
3031
|
})];
|
|
2924
3032
|
}),
|
|
2925
|
-
_:
|
|
2926
|
-
},
|
|
3033
|
+
_: 3
|
|
3034
|
+
}, 16, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, groupIndex === 0]])];
|
|
2927
3035
|
}), createElementVNode("div", mergeProps({
|
|
2928
3036
|
"class": _ctx.cx('title')
|
|
2929
3037
|
}, {
|
|
@@ -3037,8 +3145,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3037
3145
|
}, _ctx.ptm('pcNextButton')['icon']), null, 16, ["class"]))];
|
|
3038
3146
|
})];
|
|
3039
3147
|
}),
|
|
3040
|
-
_:
|
|
3041
|
-
},
|
|
3148
|
+
_: 3
|
|
3149
|
+
}, 16, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, _ctx.numberOfMonths === 1 ? true : groupIndex === _ctx.numberOfMonths - 1]])];
|
|
3042
3150
|
})], 16), $data.currentView === 'date' ? (openBlock(), createElementBlock("table", mergeProps({
|
|
3043
3151
|
key: 0,
|
|
3044
3152
|
"class": _ctx.cx('dayView'),
|