@syncfusion/ej2-calendars 20.4.54 → 21.1.35
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/CHANGELOG.md +0 -16
- package/README.md +94 -83
- package/dist/ej2-calendars.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js.map +1 -1
- package/dist/es6/ej2-calendars.es2015.js +431 -372
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +386 -327
- package/dist/es6/ej2-calendars.es5.js.map +1 -1
- package/dist/global/ej2-calendars.min.js +2 -2
- package/dist/global/ej2-calendars.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/calendar/calendar-model.d.ts +1 -1
- package/src/calendar/calendar.js +13 -6
- package/src/calendar/islamic.js +39 -29
- package/src/datepicker/datepicker-model.d.ts +3 -3
- package/src/datepicker/datepicker.js +61 -56
- package/src/daterangepicker/daterangepicker.js +11 -5
- package/src/datetimepicker/datetimepicker-model.d.ts +3 -3
- package/src/datetimepicker/datetimepicker.d.ts +4 -4
- package/src/datetimepicker/datetimepicker.js +15 -17
- package/src/maskbase/masked-date-time.js +208 -179
- package/src/timepicker/timepicker-model.d.ts +7 -7
- package/src/timepicker/timepicker.d.ts +9 -9
- package/src/timepicker/timepicker.js +39 -36
- package/styles/bootstrap-dark.css +9 -8
- package/styles/bootstrap.css +9 -3
- package/styles/bootstrap4.css +6 -4
- package/styles/bootstrap5-dark.css +19 -17
- package/styles/bootstrap5.css +17 -15
- package/styles/calendar/_bootstrap-dark-definition.scss +1 -1
- package/styles/calendar/_bootstrap5-definition.scss +21 -21
- package/styles/calendar/_fabric-dark-definition.scss +5 -3
- package/styles/calendar/_fabric-definition.scss +2 -0
- package/styles/calendar/_fluent-definition.scss +36 -36
- package/styles/calendar/_highcontrast-definition.scss +3 -1
- package/styles/calendar/_highcontrast-light-definition.scss +2 -0
- package/styles/calendar/_layout.scss +53 -6
- package/styles/calendar/_material-dark-definition.scss +4 -2
- package/styles/calendar/_material-definition.scss +2 -0
- package/styles/calendar/_tailwind-definition.scss +13 -13
- package/styles/calendar/_theme.scss +74 -13
- package/styles/calendar/bootstrap-dark.css +4 -3
- package/styles/calendar/bootstrap.css +3 -2
- package/styles/calendar/bootstrap4.css +3 -2
- package/styles/calendar/bootstrap5-dark.css +14 -13
- package/styles/calendar/bootstrap5.css +13 -12
- package/styles/calendar/fabric-dark.css +15 -5
- package/styles/calendar/fabric.css +12 -2
- package/styles/calendar/fluent-dark.css +51 -28
- package/styles/calendar/fluent.css +51 -28
- package/styles/calendar/highcontrast-light.css +3 -2
- package/styles/calendar/highcontrast.css +14 -4
- package/styles/calendar/icons/_material3.scss +3 -3
- package/styles/calendar/material-dark.css +14 -4
- package/styles/calendar/material.css +12 -2
- package/styles/calendar/tailwind-dark.css +11 -10
- package/styles/calendar/tailwind.css +11 -10
- package/styles/datepicker/_bootstrap5-definition.scss +8 -8
- package/styles/datepicker/_fluent-definition.scss +8 -8
- package/styles/datepicker/_layout.scss +16 -6
- package/styles/datepicker/_tailwind-definition.scss +8 -8
- package/styles/datepicker/_theme.scss +11 -1
- package/styles/datepicker/icons/_material3.scss +3 -3
- package/styles/daterangepicker/_bootstrap-dark-definition.scss +5 -5
- package/styles/daterangepicker/_bootstrap-definition.scss +1 -1
- package/styles/daterangepicker/_bootstrap4-definition.scss +2 -2
- package/styles/daterangepicker/_bootstrap5-definition.scss +21 -21
- package/styles/daterangepicker/_fabric-dark-definition.scss +1 -1
- package/styles/daterangepicker/_fabric-definition.scss +1 -1
- package/styles/daterangepicker/_fluent-definition.scss +27 -27
- package/styles/daterangepicker/_highcontrast-definition.scss +1 -1
- package/styles/daterangepicker/_highcontrast-light-definition.scss +1 -1
- package/styles/daterangepicker/_layout.scss +50 -3
- package/styles/daterangepicker/_material-dark-definition.scss +1 -1
- package/styles/daterangepicker/_material-definition.scss +1 -1
- package/styles/daterangepicker/_tailwind-definition.scss +19 -19
- package/styles/daterangepicker/_theme.scss +93 -15
- package/styles/daterangepicker/bootstrap-dark.css +5 -5
- package/styles/daterangepicker/bootstrap.css +6 -1
- package/styles/daterangepicker/bootstrap4.css +3 -2
- package/styles/daterangepicker/bootstrap5-dark.css +5 -4
- package/styles/daterangepicker/bootstrap5.css +4 -3
- package/styles/daterangepicker/fabric-dark.css +1 -1
- package/styles/daterangepicker/fabric.css +1 -1
- package/styles/daterangepicker/fluent-dark.css +33 -9
- package/styles/daterangepicker/fluent.css +33 -9
- package/styles/daterangepicker/highcontrast-light.css +1 -1
- package/styles/daterangepicker/highcontrast.css +1 -1
- package/styles/daterangepicker/icons/_material3.scss +33 -6
- package/styles/daterangepicker/material-dark.css +1 -1
- package/styles/daterangepicker/material.css +8 -2
- package/styles/daterangepicker/tailwind-dark.css +2 -2
- package/styles/daterangepicker/tailwind.css +2 -2
- package/styles/datetimepicker/_bootstrap5-definition.scss +1 -1
- package/styles/datetimepicker/_fluent-definition.scss +1 -1
- package/styles/datetimepicker/_layout.scss +8 -3
- package/styles/datetimepicker/_tailwind-definition.scss +1 -1
- package/styles/datetimepicker/_theme.scss +24 -4
- package/styles/datetimepicker/icons/_material3.scss +1 -1
- package/styles/fabric-dark.css +16 -6
- package/styles/fabric.css +16 -4
- package/styles/fluent-dark.css +84 -37
- package/styles/fluent.css +84 -37
- package/styles/highcontrast-light.css +4 -3
- package/styles/highcontrast.css +15 -5
- package/styles/material-dark.css +15 -5
- package/styles/material.css +20 -4
- package/styles/tailwind-dark.css +13 -12
- package/styles/tailwind.css +13 -12
- package/styles/timepicker/_bootstrap-dark-definition.scss +1 -0
- package/styles/timepicker/_bootstrap-definition.scss +1 -0
- package/styles/timepicker/_bootstrap4-definition.scss +1 -0
- package/styles/timepicker/_bootstrap5-definition.scss +6 -5
- package/styles/timepicker/_fabric-dark-definition.scss +1 -0
- package/styles/timepicker/_fabric-definition.scss +1 -0
- package/styles/timepicker/_fluent-definition.scss +6 -5
- package/styles/timepicker/_fusionnew-definition.scss +1 -0
- package/styles/timepicker/_highcontrast-definition.scss +1 -0
- package/styles/timepicker/_highcontrast-light-definition.scss +1 -0
- package/styles/timepicker/_layout.scss +11 -3
- package/styles/timepicker/_material-dark-definition.scss +1 -0
- package/styles/timepicker/_material-definition.scss +1 -0
- package/styles/timepicker/_tailwind-definition.scss +6 -5
- package/styles/timepicker/_theme.scss +36 -6
- package/styles/timepicker/icons/_material3.scss +1 -1
- package/styles/calendar/_material3-definition.scss +0 -250
- package/styles/datepicker/_material3-definition.scss +0 -46
- package/styles/daterangepicker/_material3-definition.scss +0 -230
- package/styles/datetimepicker/_material3-definition.scss +0 -60
- package/styles/timepicker/_material3-definition.scss +0 -57
|
@@ -23,6 +23,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
23
23
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
24
24
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
25
25
|
};
|
|
26
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
26
27
|
//class constant defination.
|
|
27
28
|
var OTHERMONTH = 'e-other-month';
|
|
28
29
|
var OTHERDECADE = 'e-other-year';
|
|
@@ -136,7 +137,7 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
136
137
|
'data-role': 'calendar'
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
140
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
140
141
|
this.enabled = false;
|
|
141
142
|
}
|
|
142
143
|
this.createHeader();
|
|
@@ -442,7 +443,8 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
442
443
|
this.footer && detach(this.footer);
|
|
443
444
|
this.todayElement = null;
|
|
444
445
|
this.renderDayCellArgs = null;
|
|
445
|
-
this.calendarElement = this.tableBodyElement = this.footer = this.tableHeadElement =
|
|
446
|
+
this.calendarElement = this.tableBodyElement = this.footer = this.tableHeadElement =
|
|
447
|
+
this.nextIcon = this.previousIcon = this.table = null;
|
|
446
448
|
};
|
|
447
449
|
CalendarBase.prototype.keyActionHandle = function (e, value, multiSelection) {
|
|
448
450
|
var focusedDate = this.tableBodyElement.querySelector('tr td.e-focused-date');
|
|
@@ -763,8 +765,9 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
763
765
|
// if (args.isDisabled && +this.value === +args.date) {
|
|
764
766
|
// this.setProperties({ value: null }, true);
|
|
765
767
|
// }
|
|
768
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
766
769
|
var currentTarget = void 0;
|
|
767
|
-
if (!isNullOrUndefined(e) && e.type
|
|
770
|
+
if (!isNullOrUndefined(e) && e.type === 'click') {
|
|
768
771
|
currentTarget = e.currentTarget;
|
|
769
772
|
}
|
|
770
773
|
if (multiSelection && !isNullOrUndefined(values) && !disabledCls) {
|
|
@@ -777,7 +780,8 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
777
780
|
|| (this.getDateVal(localDate, value))) {
|
|
778
781
|
addClass([tdEle], SELECTED);
|
|
779
782
|
}
|
|
780
|
-
if (!isNullOrUndefined(currentTarget) && currentTarget.innerText === tdEle.innerText &&
|
|
783
|
+
if (!isNullOrUndefined(currentTarget) && currentTarget.innerText === tdEle.innerText &&
|
|
784
|
+
this.previousDates && tdEle.classList.contains(SELECTED) && currentTarget.classList.contains(SELECTED)) {
|
|
781
785
|
removeClass([tdEle], SELECTED);
|
|
782
786
|
this.previousDates = false;
|
|
783
787
|
var copyValues = this.copyValues(values);
|
|
@@ -1028,7 +1032,8 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1028
1032
|
if (this.weekNumber && rowIterator === otherMonthCell + 1 && elements[otherMonthCell + 1].classList.contains(OTHERMONTH)) {
|
|
1029
1033
|
addClass([trEle], OTHERMONTHROW);
|
|
1030
1034
|
}
|
|
1031
|
-
if (!this.weekNumber && rowIterator === otherMonthCell && elements[otherMonthCell].
|
|
1035
|
+
if (!this.weekNumber && rowIterator === otherMonthCell && elements[otherMonthCell].
|
|
1036
|
+
classList.contains(OTHERMONTH)) {
|
|
1032
1037
|
addClass([trEle], OTHERMONTHROW);
|
|
1033
1038
|
}
|
|
1034
1039
|
if (this.weekNumber) {
|
|
@@ -2568,7 +2573,9 @@ var Calendar = /** @__PURE__ @class */ (function (_super) {
|
|
|
2568
2573
|
if (!isNullOrUndefined(this.value)) {
|
|
2569
2574
|
this.setProperties({ value: this.value }, true);
|
|
2570
2575
|
}
|
|
2571
|
-
|
|
2576
|
+
// eslint-disable-next-line use-isnan
|
|
2577
|
+
if (!this.isMultiSelection && +this.value !== Number.NaN && (!isNullOrUndefined(this.value) &&
|
|
2578
|
+
!isNullOrUndefined(this.previousDate) || this.previousDate === null
|
|
2572
2579
|
&& !isNaN(+this.value))) {
|
|
2573
2580
|
this.changeEvent(e);
|
|
2574
2581
|
}
|
|
@@ -2900,55 +2907,62 @@ var Islamic = /** @__PURE__ @class */ (function () {
|
|
|
2900
2907
|
this.calendarInstance.islamicPreviousHeader = null;
|
|
2901
2908
|
}
|
|
2902
2909
|
if (this.calendarInstance.previousIconClicked) {
|
|
2910
|
+
// eslint-disable-next-line no-var
|
|
2903
2911
|
for (var i = 0; i <= splityear.length; i++) {
|
|
2904
|
-
endHdrYr = endHdrYr - splityear[i] === 2 || splityear[i]
|
|
2912
|
+
endHdrYr = endHdrYr - splityear[i] === 2 || splityear[i]
|
|
2913
|
+
- endHdrYr === 2 ? (parseInt(endHdrYr, 10) + 1).toString() :
|
|
2914
|
+
endHdrYr - splityear[i] === 3 || splityear[i] - endHdrYr === 3 ?
|
|
2915
|
+
(parseInt(endHdrYr, 10) + 2).toString() : endHdrYr - splityear[i] === 4 ||
|
|
2916
|
+
splityear[i] - endHdrYr === 4 ? (parseInt(endHdrYr, 10) + 3).toString() :
|
|
2917
|
+
endHdrYr - splityear[i] === 5 || splityear[i] - endHdrYr === 5 ?
|
|
2918
|
+
(parseInt(endHdrYr, 10) + 4).toString() : endHdrYr;
|
|
2905
2919
|
if (endHdrYr - splityear[i] === 0 || splityear[i] - endHdrYr === 0) {
|
|
2906
|
-
endHdrYr = (parseInt(endHdrYr) - 1).toString();
|
|
2920
|
+
endHdrYr = (parseInt(endHdrYr, 10) - 1).toString();
|
|
2907
2921
|
}
|
|
2908
2922
|
}
|
|
2909
2923
|
if (endHdrYr - splityear[i] === 8 || splityear[i] - endHdrYr === 8) {
|
|
2910
|
-
endHdrYr = (parseInt(endHdrYr) - 9).toString();
|
|
2911
|
-
startHdrYr = (parseInt(endHdrYr) - 9).toString();
|
|
2924
|
+
endHdrYr = (parseInt(endHdrYr, 10) - 9).toString();
|
|
2925
|
+
startHdrYr = (parseInt(endHdrYr, 10) - 9).toString();
|
|
2912
2926
|
}
|
|
2913
2927
|
if (endHdrYr - splityear[i] === 7 || splityear[i] - endHdrYr === 7) {
|
|
2914
|
-
endHdrYr = (parseInt(endHdrYr) - 8).toString();
|
|
2915
|
-
startHdrYr = (parseInt(endHdrYr) - 9).toString();
|
|
2928
|
+
endHdrYr = (parseInt(endHdrYr, 10) - 8).toString();
|
|
2929
|
+
startHdrYr = (parseInt(endHdrYr, 10) - 9).toString();
|
|
2916
2930
|
}
|
|
2917
2931
|
startHdrYr = endHdrYr - startHdrYr === 10
|
|
2918
|
-
? (parseInt(startHdrYr) + 1).toString() : endHdrYr - startHdrYr === 11
|
|
2919
|
-
? (parseInt(startHdrYr) + 2).toString() : endHdrYr - startHdrYr === 12
|
|
2920
|
-
? (parseInt(startHdrYr) + 3).toString() : startHdrYr;
|
|
2932
|
+
? (parseInt(startHdrYr, 10) + 1).toString() : endHdrYr - startHdrYr === 11
|
|
2933
|
+
? (parseInt(startHdrYr, 10) + 2).toString() : endHdrYr - startHdrYr === 12
|
|
2934
|
+
? (parseInt(startHdrYr, 10) + 3).toString() : startHdrYr;
|
|
2921
2935
|
if (endHdrYr - startHdrYr === 8) {
|
|
2922
|
-
startHdrYr = (parseInt(startHdrYr) - 1).toString();
|
|
2936
|
+
startHdrYr = (parseInt(startHdrYr, 10) - 1).toString();
|
|
2923
2937
|
}
|
|
2924
2938
|
}
|
|
2925
2939
|
if (this.calendarInstance.nextIconClicked) {
|
|
2926
|
-
for (var
|
|
2927
|
-
if (startHdrYr - splityear[
|
|
2928
|
-
startHdrYr = (parseInt(startHdrYr) + 1).toString();
|
|
2940
|
+
for (var i_1 = 0; i_1 <= splityear.length; i_1++) {
|
|
2941
|
+
if (startHdrYr - splityear[i_1] === 0 || splityear[i_1] - startHdrYr === 0) {
|
|
2942
|
+
startHdrYr = (parseInt(startHdrYr, 10) + 1).toString();
|
|
2929
2943
|
}
|
|
2930
|
-
if (startHdrYr - splityear[
|
|
2931
|
-
startHdrYr = (parseInt(startHdrYr) - 1).toString();
|
|
2944
|
+
if (startHdrYr - splityear[i_1] === 2 && startHdrYr > splityear[i_1].trim()) {
|
|
2945
|
+
startHdrYr = (parseInt(startHdrYr, 10) - 1).toString();
|
|
2932
2946
|
}
|
|
2933
|
-
if (splityear[
|
|
2934
|
-
startHdrYr = (parseInt(startHdrYr) + 2).toString();
|
|
2947
|
+
if (splityear[i_1] - startHdrYr === 1 && startHdrYr < splityear[i_1].trim()) {
|
|
2948
|
+
startHdrYr = (parseInt(startHdrYr, 10) + 2).toString();
|
|
2935
2949
|
}
|
|
2936
2950
|
}
|
|
2937
2951
|
if (startHdrYr - this.calendarInstance.headerTitleElement.textContent.split('-')[1].trim() > 1) {
|
|
2938
|
-
startHdrYr = (parseInt(this.calendarInstance.headerTitleElement.textContent.split('-')[1].trim()) + 1).toString();
|
|
2939
|
-
endHdrYr = (parseInt(startHdrYr) + 9).toString();
|
|
2952
|
+
startHdrYr = (parseInt(this.calendarInstance.headerTitleElement.textContent.split('-')[1].trim(), 10) + 1).toString();
|
|
2953
|
+
endHdrYr = (parseInt(startHdrYr, 10) + 9).toString();
|
|
2940
2954
|
}
|
|
2941
|
-
endHdrYr = endHdrYr - startHdrYr === 10 ? (parseInt(endHdrYr) - 1).toString() : endHdrYr;
|
|
2955
|
+
endHdrYr = endHdrYr - startHdrYr === 10 ? (parseInt(endHdrYr, 10) - 1).toString() : endHdrYr;
|
|
2942
2956
|
endHdrYr = endHdrYr - startHdrYr === 7
|
|
2943
|
-
? (parseInt(endHdrYr) + 2).toString() : endHdrYr - startHdrYr === 8
|
|
2944
|
-
? (parseInt(endHdrYr) + 1).toString() : endHdrYr;
|
|
2957
|
+
? (parseInt(endHdrYr, 10) + 2).toString() : endHdrYr - startHdrYr === 8
|
|
2958
|
+
? (parseInt(endHdrYr, 10) + 1).toString() : endHdrYr;
|
|
2945
2959
|
}
|
|
2946
2960
|
this.calendarInstance.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
|
|
2947
2961
|
this.calendarInstance.nextIconClicked = this.calendarInstance.previousIconClicked = false;
|
|
2948
|
-
var year = (parseInt(startHdrYr) - 2).toString();
|
|
2949
|
-
startFullYr = Math.round(parseInt(startHdrYr) * 0.97 + 622);
|
|
2950
|
-
endFullYr = Math.round(parseInt(endHdrYr) * 0.97 + 622);
|
|
2951
|
-
var startYear = Math.round(parseInt(year) * 0.97 + 622);
|
|
2962
|
+
var year = (parseInt(startHdrYr, 10) - 2).toString();
|
|
2963
|
+
startFullYr = Math.round(parseInt(startHdrYr, 10) * 0.97 + 622);
|
|
2964
|
+
endFullYr = Math.round(parseInt(endHdrYr, 10) * 0.97 + 622);
|
|
2965
|
+
var startYear = Math.round(parseInt(year, 10) * 0.97 + 622);
|
|
2952
2966
|
for (var rowCount = 1; rowCount <= yearCell; ++rowCount) {
|
|
2953
2967
|
var year_1 = startYear + rowCount;
|
|
2954
2968
|
localDate.setFullYear(year_1);
|
|
@@ -2962,12 +2976,14 @@ var Islamic = /** @__PURE__ @class */ (function () {
|
|
|
2962
2976
|
islamicDate = this.getIslamicDate(localDate);
|
|
2963
2977
|
var gregorianObject_2 = HijriParser.toGregorian(islamicDate.year, 1, 1);
|
|
2964
2978
|
localDate = gregorianObject_2;
|
|
2965
|
-
if (islamicDate.year === parseInt(startHdrYr) - 1 || islamicDate.year >= startHdrYr &&
|
|
2979
|
+
if (islamicDate.year === parseInt(startHdrYr, 10) - 1 || islamicDate.year >= startHdrYr &&
|
|
2980
|
+
islamicDate.year <= endFullYr || islamicDate.year === parseInt(endHdrYr, 10) + 1) {
|
|
2966
2981
|
var tdEle = this.islamicDayCell(localDate);
|
|
2967
2982
|
attributes(tdEle, { 'role': 'gridcell' });
|
|
2968
2983
|
var dayLink = this.calendarInstance.createElement('span');
|
|
2969
2984
|
dayLink.textContent = this.calendarInstance.globalize.formatDate(localDate, { type: 'dateTime', format: 'y', calendar: 'islamic' });
|
|
2970
|
-
if (islamicDate.year === parseInt(startHdrYr) - 1 || (year_1 < startFullYr) ||
|
|
2985
|
+
if (islamicDate.year === parseInt(startHdrYr, 10) - 1 || (year_1 < startFullYr) ||
|
|
2986
|
+
(year_1 > endFullYr) && islamicDate.year !== parseInt(endHdrYr, 10)) {
|
|
2971
2987
|
addClass([tdEle], OTHERMONTH$1);
|
|
2972
2988
|
}
|
|
2973
2989
|
else if (year_1 < new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()
|
|
@@ -2980,7 +2996,8 @@ var Islamic = /** @__PURE__ @class */ (function () {
|
|
|
2980
2996
|
addClass([tdEle], SELECTED$1);
|
|
2981
2997
|
}
|
|
2982
2998
|
else {
|
|
2983
|
-
if (localDate.getFullYear() === this.calendarInstance.currentDate.getFullYear() &&
|
|
2999
|
+
if (localDate.getFullYear() === this.calendarInstance.currentDate.getFullYear() &&
|
|
3000
|
+
!tdEle.classList.contains(DISABLED$1)) {
|
|
2984
3001
|
addClass([tdEle], FOCUSEDDATE$1);
|
|
2985
3002
|
}
|
|
2986
3003
|
}
|
|
@@ -3230,7 +3247,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3230
3247
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
|
|
3231
3248
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
3232
3249
|
}
|
|
3233
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
3250
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
3234
3251
|
this.enabled = false;
|
|
3235
3252
|
}
|
|
3236
3253
|
this.renderComplete();
|
|
@@ -3278,15 +3295,15 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3278
3295
|
DatePicker.prototype.initialize = function () {
|
|
3279
3296
|
this.checkInvalidValue(this.value);
|
|
3280
3297
|
if (this.enableMask) {
|
|
3281
|
-
this.notify(
|
|
3282
|
-
module:
|
|
3298
|
+
this.notify('createMask', {
|
|
3299
|
+
module: 'MaskedDateTime'
|
|
3283
3300
|
});
|
|
3284
3301
|
}
|
|
3285
3302
|
this.createInput();
|
|
3286
3303
|
this.updateHtmlAttributeToWrapper();
|
|
3287
3304
|
this.setAllowEdit();
|
|
3288
3305
|
this.updateInput(true);
|
|
3289
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType
|
|
3306
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType === 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
3290
3307
|
this.updateInputValue(this.maskedDateValue);
|
|
3291
3308
|
}
|
|
3292
3309
|
this.previousElementValue = this.inputElement.value;
|
|
@@ -3400,8 +3417,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3400
3417
|
}
|
|
3401
3418
|
else {
|
|
3402
3419
|
this.updateInputValue(this.maskedDateValue);
|
|
3403
|
-
this.notify(
|
|
3404
|
-
module:
|
|
3420
|
+
this.notify('createMask', {
|
|
3421
|
+
module: 'MaskedDateTime'
|
|
3405
3422
|
});
|
|
3406
3423
|
}
|
|
3407
3424
|
}
|
|
@@ -3567,8 +3584,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3567
3584
|
if (e.code !== 'Delete') {
|
|
3568
3585
|
e.preventDefault();
|
|
3569
3586
|
}
|
|
3570
|
-
this.notify(
|
|
3571
|
-
module:
|
|
3587
|
+
this.notify('keyDownHandler', {
|
|
3588
|
+
module: 'MaskedDateTime',
|
|
3572
3589
|
e: e
|
|
3573
3590
|
});
|
|
3574
3591
|
}
|
|
@@ -3643,8 +3660,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3643
3660
|
DatePicker.prototype.mouseUpHandler = function (e) {
|
|
3644
3661
|
if (this.enableMask) {
|
|
3645
3662
|
e.preventDefault();
|
|
3646
|
-
this.notify(
|
|
3647
|
-
module:
|
|
3663
|
+
this.notify('setMaskSelection', {
|
|
3664
|
+
module: 'MaskedDateTime'
|
|
3648
3665
|
});
|
|
3649
3666
|
}
|
|
3650
3667
|
};
|
|
@@ -3662,8 +3679,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3662
3679
|
this.popupUpdate();
|
|
3663
3680
|
this.changeEvent(event);
|
|
3664
3681
|
if (this.enableMask) {
|
|
3665
|
-
this.notify(
|
|
3666
|
-
module:
|
|
3682
|
+
this.notify('clearHandler', {
|
|
3683
|
+
module: 'MaskedDateTime'
|
|
3667
3684
|
});
|
|
3668
3685
|
}
|
|
3669
3686
|
if (closest(this.element, 'form')) {
|
|
@@ -3798,7 +3815,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3798
3815
|
return;
|
|
3799
3816
|
}
|
|
3800
3817
|
if (this.enableMask && !this.inputElement.value && this.placeholder) {
|
|
3801
|
-
if (this.maskedDateValue && !this.value && (this.floatLabelType
|
|
3818
|
+
if (this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
3802
3819
|
this.updateInputValue(this.maskedDateValue);
|
|
3803
3820
|
this.inputElement.selectionStart = 0;
|
|
3804
3821
|
this.inputElement.selectionEnd = this.inputElement.value.length;
|
|
@@ -3817,8 +3834,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3817
3834
|
DatePicker.prototype.inputHandler = function () {
|
|
3818
3835
|
this.isPopupClicked = false;
|
|
3819
3836
|
if (this.enableMask) {
|
|
3820
|
-
this.notify(
|
|
3821
|
-
module:
|
|
3837
|
+
this.notify('inputHandler', {
|
|
3838
|
+
module: 'MaskedDateTime'
|
|
3822
3839
|
});
|
|
3823
3840
|
}
|
|
3824
3841
|
};
|
|
@@ -3835,7 +3852,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3835
3852
|
this.popupUpdate();
|
|
3836
3853
|
this.changeTrigger(e);
|
|
3837
3854
|
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
3838
|
-
if (this.inputElement.value
|
|
3855
|
+
if (this.inputElement.value === this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
3839
3856
|
this.updateInputValue('');
|
|
3840
3857
|
}
|
|
3841
3858
|
}
|
|
@@ -3924,31 +3941,33 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3924
3941
|
break;
|
|
3925
3942
|
case 'tab':
|
|
3926
3943
|
case 'shiftTab':
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
e.
|
|
3944
|
+
{
|
|
3945
|
+
var start = this.inputElement.selectionStart;
|
|
3946
|
+
var end = this.inputElement.selectionEnd;
|
|
3947
|
+
if (this.enableMask && !this.popupObj && !this.readonly) {
|
|
3948
|
+
var length_1 = this.inputElement.value.length;
|
|
3949
|
+
if ((start === 0 && end === length_1) || (end !== length_1 && e.action === 'tab') || (start !== 0 && e.action === 'shiftTab')) {
|
|
3950
|
+
e.preventDefault();
|
|
3951
|
+
}
|
|
3952
|
+
this.notify('keyDownHandler', {
|
|
3953
|
+
module: 'MaskedDateTime',
|
|
3954
|
+
e: e
|
|
3955
|
+
});
|
|
3956
|
+
start = this.inputElement.selectionStart;
|
|
3957
|
+
end = this.inputElement.selectionEnd;
|
|
3933
3958
|
}
|
|
3934
|
-
this.
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
this.errorClass();
|
|
3946
|
-
if (this.enableMask) {
|
|
3947
|
-
this.inputElement.selectionStart = start;
|
|
3948
|
-
this.inputElement.selectionEnd = end;
|
|
3959
|
+
this.strictModeUpdate();
|
|
3960
|
+
this.updateInput();
|
|
3961
|
+
this.popupUpdate();
|
|
3962
|
+
this.changeTrigger(e);
|
|
3963
|
+
this.errorClass();
|
|
3964
|
+
if (this.enableMask) {
|
|
3965
|
+
this.inputElement.selectionStart = start;
|
|
3966
|
+
this.inputElement.selectionEnd = end;
|
|
3967
|
+
}
|
|
3968
|
+
this.hide(e);
|
|
3969
|
+
break;
|
|
3949
3970
|
}
|
|
3950
|
-
this.hide(e);
|
|
3951
|
-
break;
|
|
3952
3971
|
default:
|
|
3953
3972
|
this.defaultAction(e);
|
|
3954
3973
|
// Fix for close the popup when select the previously selected value.
|
|
@@ -4244,7 +4263,6 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4244
4263
|
}
|
|
4245
4264
|
return modules;
|
|
4246
4265
|
};
|
|
4247
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4248
4266
|
DatePicker.prototype.selectCalendar = function (e) {
|
|
4249
4267
|
var date;
|
|
4250
4268
|
var tempFormat;
|
|
@@ -4275,16 +4293,16 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4275
4293
|
date = this.globalize.formatDate(this.changedArgs.value, formatOptions);
|
|
4276
4294
|
}
|
|
4277
4295
|
if (this.enableMask) {
|
|
4278
|
-
this.notify(
|
|
4279
|
-
module:
|
|
4296
|
+
this.notify('createMask', {
|
|
4297
|
+
module: 'MaskedDateTime'
|
|
4280
4298
|
});
|
|
4281
4299
|
}
|
|
4282
4300
|
}
|
|
4283
4301
|
if (!isNullOrUndefined(date)) {
|
|
4284
4302
|
this.updateInputValue(date);
|
|
4285
4303
|
if (this.enableMask) {
|
|
4286
|
-
this.notify(
|
|
4287
|
-
module:
|
|
4304
|
+
this.notify('setMaskSelection', {
|
|
4305
|
+
module: 'MaskedDateTime'
|
|
4288
4306
|
});
|
|
4289
4307
|
}
|
|
4290
4308
|
}
|
|
@@ -4321,7 +4339,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4321
4339
|
else {
|
|
4322
4340
|
var prevent_1 = true;
|
|
4323
4341
|
var outOfRange = void 0;
|
|
4324
|
-
if (!isNullOrUndefined(this.value) && !(+this.value >= +new Date(this.checkValue(this.min))
|
|
4342
|
+
if (!isNullOrUndefined(this.value) && !(+this.value >= +new Date(this.checkValue(this.min))
|
|
4343
|
+
&& +this.value <= +new Date(this.checkValue(this.max)))) {
|
|
4325
4344
|
outOfRange = new Date(this.checkValue(this.value));
|
|
4326
4345
|
this.setProperties({ 'value': null }, true);
|
|
4327
4346
|
}
|
|
@@ -4842,8 +4861,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4842
4861
|
this.updateInputValue(inputVal);
|
|
4843
4862
|
if (this.enableMask) {
|
|
4844
4863
|
this.updateInputValue(this.maskedDateValue);
|
|
4845
|
-
this.notify(
|
|
4846
|
-
module:
|
|
4864
|
+
this.notify('createMask', {
|
|
4865
|
+
module: 'MaskedDateTime'
|
|
4847
4866
|
});
|
|
4848
4867
|
}
|
|
4849
4868
|
}
|
|
@@ -4867,7 +4886,10 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4867
4886
|
var isDisabledDate = this.calendarElement &&
|
|
4868
4887
|
this.calendarElement.querySelectorAll(dateIdString)[0] &&
|
|
4869
4888
|
this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled');
|
|
4870
|
-
if ((!isNullOrUndefined(this.value) && !isNullOrUndefined(this.min) &&
|
|
4889
|
+
if ((!isNullOrUndefined(this.value) && !isNullOrUndefined(this.min) &&
|
|
4890
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4891
|
+
!isNullOrUndefined(this.max) && !(new Date(this.value).setMilliseconds(0) >= new Date(this.min).setMilliseconds(0)
|
|
4892
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4871
4893
|
&& new Date(this.value).setMilliseconds(0) <= new Date(this.max).setMilliseconds(0)))
|
|
4872
4894
|
|| (!this.strictMode && this.inputElement.value !== '' && this.inputElement.value !== this.maskedDateValue && isNullOrUndefined(this.value) || isDisabledDate)) {
|
|
4873
4895
|
addClass([this.inputWrapper.container], ERROR);
|
|
@@ -4908,8 +4930,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4908
4930
|
this.isInteracted = true;
|
|
4909
4931
|
this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
|
|
4910
4932
|
if (this.enableMask) {
|
|
4911
|
-
this.notify(
|
|
4912
|
-
module:
|
|
4933
|
+
this.notify('createMask', {
|
|
4934
|
+
module: 'MaskedDateTime'
|
|
4913
4935
|
});
|
|
4914
4936
|
}
|
|
4915
4937
|
break;
|
|
@@ -4918,8 +4940,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4918
4940
|
this.bindInputEvent();
|
|
4919
4941
|
this.updateInput();
|
|
4920
4942
|
if (this.enableMask) {
|
|
4921
|
-
this.notify(
|
|
4922
|
-
module:
|
|
4943
|
+
this.notify('createMask', {
|
|
4944
|
+
module: 'MaskedDateTime'
|
|
4923
4945
|
});
|
|
4924
4946
|
if (!this.value) {
|
|
4925
4947
|
this.updateInputValue(this.maskedDateValue);
|
|
@@ -4951,8 +4973,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4951
4973
|
Input.setPlaceholder(this.placeholder, this.inputElement);
|
|
4952
4974
|
this.updateInput();
|
|
4953
4975
|
if (this.enableMask) {
|
|
4954
|
-
this.notify(
|
|
4955
|
-
module:
|
|
4976
|
+
this.notify('createMask', {
|
|
4977
|
+
module: 'MaskedDateTime'
|
|
4956
4978
|
});
|
|
4957
4979
|
}
|
|
4958
4980
|
break;
|
|
@@ -4998,8 +5020,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4998
5020
|
break;
|
|
4999
5021
|
case 'enableMask':
|
|
5000
5022
|
if (this.enableMask) {
|
|
5001
|
-
this.notify(
|
|
5002
|
-
module:
|
|
5023
|
+
this.notify('createMask', {
|
|
5024
|
+
module: 'MaskedDateTime'
|
|
5003
5025
|
});
|
|
5004
5026
|
this.updateInputValue(this.maskedDateValue);
|
|
5005
5027
|
this.bindInputEvent();
|
|
@@ -5277,7 +5299,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
5277
5299
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
|
|
5278
5300
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
5279
5301
|
}
|
|
5280
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
5302
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
5281
5303
|
this.enabled = false;
|
|
5282
5304
|
}
|
|
5283
5305
|
this.renderComplete();
|
|
@@ -5479,7 +5501,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
5479
5501
|
var attributes$$1 = {};
|
|
5480
5502
|
if (!isDynamic) {
|
|
5481
5503
|
for (var i = 0; i < this.element.attributes.length; i++) {
|
|
5482
|
-
attributes$$1[this.element.attributes[i].name] =
|
|
5504
|
+
attributes$$1[this.element.attributes[i].name] =
|
|
5505
|
+
this.element.getAttribute(this.element.attributes[i].name);
|
|
5483
5506
|
}
|
|
5484
5507
|
}
|
|
5485
5508
|
else {
|
|
@@ -5912,7 +5935,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
5912
5935
|
this.createControl();
|
|
5913
5936
|
this.bindCalendarEvents();
|
|
5914
5937
|
this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
|
|
5915
|
-
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
5938
|
+
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
5939
|
+
!isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
|
|
5916
5940
|
this.disabledDateRender();
|
|
5917
5941
|
}
|
|
5918
5942
|
this.updateHeader();
|
|
@@ -6158,6 +6182,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
6158
6182
|
}
|
|
6159
6183
|
this.updateHiddenInput();
|
|
6160
6184
|
};
|
|
6185
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
6161
6186
|
DateRangePicker.prototype.getStartEndDate = function (date, isEnd, range, dateOptions) {
|
|
6162
6187
|
if (this.depth === 'Month') {
|
|
6163
6188
|
return this.globalize.parseDate(range[isEnd ? 1 : 0].trim(), dateOptions);
|
|
@@ -6547,7 +6572,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
6547
6572
|
var isLeftYear = leftHeader ? leftHeader.classList.contains('e-year') : false;
|
|
6548
6573
|
var isRightDecade = rightHeader ? rightHeader.classList.contains('e-decade') : false;
|
|
6549
6574
|
var isLeftDecade = leftHeader ? leftHeader.classList.contains('e-decade') : false;
|
|
6550
|
-
return isLeftCalendar && (isLeftMonth || isLeftYear || isLeftDecade) &&
|
|
6575
|
+
return isLeftCalendar && (isLeftMonth || isLeftYear || isLeftDecade) &&
|
|
6576
|
+
(isRightMonth || isRightYear || isRightDecade) && !this.isMobile;
|
|
6551
6577
|
};
|
|
6552
6578
|
DateRangePicker.prototype.keyNavigation = function (calendar, e) {
|
|
6553
6579
|
this.bindCalendarCellEvents(calendar);
|
|
@@ -8507,7 +8533,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
8507
8533
|
if (!this.strictMode && (isDisabled)) {
|
|
8508
8534
|
this.clearRange();
|
|
8509
8535
|
}
|
|
8510
|
-
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
8536
|
+
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
8537
|
+
!isDisabled && !isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
|
|
8511
8538
|
this.disabledDateRender();
|
|
8512
8539
|
}
|
|
8513
8540
|
this.errorClass();
|
|
@@ -9254,6 +9281,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9254
9281
|
this.updateHeader();
|
|
9255
9282
|
}
|
|
9256
9283
|
};
|
|
9284
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
9257
9285
|
DateRangePicker.prototype.getStartEndValue = function (date, isEnd) {
|
|
9258
9286
|
if (this.depth === 'Month') {
|
|
9259
9287
|
return this.checkDateValue(new Date(this.checkValue(date)));
|
|
@@ -9809,7 +9837,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9809
9837
|
this.bindEvents();
|
|
9810
9838
|
this.validateDisable();
|
|
9811
9839
|
this.setValue(this.getFormattedValue(this.value));
|
|
9812
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType
|
|
9840
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType === 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
9813
9841
|
this.updateInputValue(this.maskedDateValue);
|
|
9814
9842
|
this.checkErrorState(this.maskedDateValue);
|
|
9815
9843
|
}
|
|
@@ -9819,7 +9847,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9819
9847
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
|
|
9820
9848
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
9821
9849
|
}
|
|
9822
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
9850
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
9823
9851
|
this.enabled = false;
|
|
9824
9852
|
}
|
|
9825
9853
|
this.renderComplete();
|
|
@@ -9920,8 +9948,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9920
9948
|
attributes(this.inputElement, { 'name': this.element.id });
|
|
9921
9949
|
}
|
|
9922
9950
|
if (this.enableMask) {
|
|
9923
|
-
this.notify(
|
|
9924
|
-
module:
|
|
9951
|
+
this.notify('createMask', {
|
|
9952
|
+
module: 'MaskedDateTime'
|
|
9925
9953
|
});
|
|
9926
9954
|
}
|
|
9927
9955
|
};
|
|
@@ -10270,7 +10298,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10270
10298
|
};
|
|
10271
10299
|
TimePicker.prototype.checkErrorState = function (val) {
|
|
10272
10300
|
var value = this.getDateObject(val);
|
|
10273
|
-
if ((this.validateState(value) && !this.invalidValueString) ||
|
|
10301
|
+
if ((this.validateState(value) && !this.invalidValueString) ||
|
|
10302
|
+
(this.enableMask && this.inputElement.value === this.maskedDateValue)) {
|
|
10274
10303
|
this.removeErrorClass();
|
|
10275
10304
|
}
|
|
10276
10305
|
else {
|
|
@@ -10518,8 +10547,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10518
10547
|
event.preventDefault();
|
|
10519
10548
|
if (this.enableMask) {
|
|
10520
10549
|
event.preventDefault();
|
|
10521
|
-
this.notify(
|
|
10522
|
-
module:
|
|
10550
|
+
this.notify('setMaskSelection', {
|
|
10551
|
+
module: 'MaskedDateTime'
|
|
10523
10552
|
});
|
|
10524
10553
|
return;
|
|
10525
10554
|
}
|
|
@@ -10582,8 +10611,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10582
10611
|
case 'down':
|
|
10583
10612
|
if (this.enableMask && !this.readonly && !this.isPopupOpen()) {
|
|
10584
10613
|
event.preventDefault();
|
|
10585
|
-
this.notify(
|
|
10586
|
-
module:
|
|
10614
|
+
this.notify('keyDownHandler', {
|
|
10615
|
+
module: 'MaskedDateTime',
|
|
10587
10616
|
e: event
|
|
10588
10617
|
});
|
|
10589
10618
|
}
|
|
@@ -10628,12 +10657,12 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10628
10657
|
case 'tab':
|
|
10629
10658
|
case 'shiftTab':
|
|
10630
10659
|
if (!this.isPopupOpen() && this.enableMask && !this.readonly) {
|
|
10631
|
-
if ((this.inputElement.selectionStart
|
|
10632
|
-
(this.inputElement.selectionEnd !== this.inputElement.value.length && event.action
|
|
10633
|
-
(this.inputElement.selectionStart !== 0 && event.action
|
|
10660
|
+
if ((this.inputElement.selectionStart === 0 && this.inputElement.selectionEnd === this.inputElement.value.length) ||
|
|
10661
|
+
(this.inputElement.selectionEnd !== this.inputElement.value.length && event.action === 'tab') ||
|
|
10662
|
+
(this.inputElement.selectionStart !== 0 && event.action === 'shiftTab') || (event.action === 'left' || event.action === 'right')) {
|
|
10634
10663
|
event.preventDefault();
|
|
10635
10664
|
}
|
|
10636
|
-
this.notify(
|
|
10665
|
+
this.notify('keyDownHandler', { module: 'MaskedDateTime',
|
|
10637
10666
|
e: event
|
|
10638
10667
|
});
|
|
10639
10668
|
}
|
|
@@ -10897,8 +10926,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10897
10926
|
switch (e.code) {
|
|
10898
10927
|
case 'Delete':
|
|
10899
10928
|
if (this.enableMask && !this.popupObj && !this.readonly) {
|
|
10900
|
-
this.notify(
|
|
10901
|
-
module:
|
|
10929
|
+
this.notify('keyDownHandler', {
|
|
10930
|
+
module: 'MaskedDateTime',
|
|
10902
10931
|
e: e
|
|
10903
10932
|
});
|
|
10904
10933
|
}
|
|
@@ -10944,8 +10973,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10944
10973
|
};
|
|
10945
10974
|
TimePicker.prototype.inputEventHandler = function () {
|
|
10946
10975
|
if (this.enableMask) {
|
|
10947
|
-
this.notify(
|
|
10948
|
-
module:
|
|
10976
|
+
this.notify('inputHandler', {
|
|
10977
|
+
module: 'MaskedDateTime'
|
|
10949
10978
|
});
|
|
10950
10979
|
}
|
|
10951
10980
|
};
|
|
@@ -10995,8 +11024,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10995
11024
|
this.popupWrapper.scrollTop = 0;
|
|
10996
11025
|
}
|
|
10997
11026
|
if (this.enableMask) {
|
|
10998
|
-
this.notify(
|
|
10999
|
-
module:
|
|
11027
|
+
this.notify('clearHandler', {
|
|
11028
|
+
module: 'MaskedDateTime'
|
|
11000
11029
|
});
|
|
11001
11030
|
}
|
|
11002
11031
|
if (closest(this.element, 'form')) {
|
|
@@ -11123,10 +11152,10 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11123
11152
|
if (!inputVal) {
|
|
11124
11153
|
this.updateInputValue(this.maskedDateValue);
|
|
11125
11154
|
}
|
|
11126
|
-
if (isNullOrUndefined(val) && value
|
|
11155
|
+
if (isNullOrUndefined(val) && value !== this.maskedDateValue) {
|
|
11127
11156
|
this.createMask();
|
|
11128
11157
|
}
|
|
11129
|
-
if (isNullOrUndefined(val) && value
|
|
11158
|
+
if (isNullOrUndefined(val) && value === this.maskedDateValue) {
|
|
11130
11159
|
this.updateInputValue(this.maskedDateValue);
|
|
11131
11160
|
}
|
|
11132
11161
|
}
|
|
@@ -11198,13 +11227,13 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11198
11227
|
else {
|
|
11199
11228
|
this.updateInputValue(time);
|
|
11200
11229
|
if (this.enableMask) {
|
|
11201
|
-
if (time
|
|
11230
|
+
if (time === '') {
|
|
11202
11231
|
this.updateInputValue(this.maskedDateValue);
|
|
11203
11232
|
}
|
|
11204
|
-
if (isNullOrUndefined(time) && value
|
|
11233
|
+
if (isNullOrUndefined(time) && value !== this.maskedDateValue) {
|
|
11205
11234
|
this.createMask();
|
|
11206
11235
|
}
|
|
11207
|
-
if (isNullOrUndefined(time) && value
|
|
11236
|
+
if (isNullOrUndefined(time) && value === this.maskedDateValue) {
|
|
11208
11237
|
this.updateInputValue(this.maskedDateValue);
|
|
11209
11238
|
}
|
|
11210
11239
|
}
|
|
@@ -11212,8 +11241,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11212
11241
|
return time;
|
|
11213
11242
|
};
|
|
11214
11243
|
TimePicker.prototype.createMask = function () {
|
|
11215
|
-
this.notify(
|
|
11216
|
-
module:
|
|
11244
|
+
this.notify('createMask', {
|
|
11245
|
+
module: 'MaskedDateTime'
|
|
11217
11246
|
});
|
|
11218
11247
|
};
|
|
11219
11248
|
TimePicker.prototype.findNextElement = function (event) {
|
|
@@ -11324,7 +11353,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11324
11353
|
return elementIndex;
|
|
11325
11354
|
};
|
|
11326
11355
|
TimePicker.prototype.keyHandler = function (event) {
|
|
11327
|
-
if (isNullOrUndefined(this.step) || this.step <= 0 || !isNullOrUndefined(this.inputWrapper)
|
|
11356
|
+
if (isNullOrUndefined(this.step) || this.step <= 0 || !isNullOrUndefined(this.inputWrapper)
|
|
11357
|
+
&& this.inputWrapper.buttons[0].classList.contains(DISABLED$3)) {
|
|
11328
11358
|
return;
|
|
11329
11359
|
}
|
|
11330
11360
|
var count = this.timeCollections.length;
|
|
@@ -11352,7 +11382,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11352
11382
|
this.activeIndex = index = this.activeIndex < 0 ? (count - 1) : this.activeIndex;
|
|
11353
11383
|
this.activeIndex = index = this.validLiElement(this.activeIndex, (event.keyCode === 40 || event.keyCode === 39) ?
|
|
11354
11384
|
false : true);
|
|
11355
|
-
nextItem = isNullOrUndefined(this.timeCollections[index]) ?
|
|
11385
|
+
nextItem = isNullOrUndefined(this.timeCollections[index]) ?
|
|
11386
|
+
this.timeCollections[0] : this.timeCollections[index];
|
|
11356
11387
|
}
|
|
11357
11388
|
else if (event.action === 'home') {
|
|
11358
11389
|
var index = this.validLiElement(0);
|
|
@@ -11641,7 +11672,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11641
11672
|
}
|
|
11642
11673
|
this.closePopup(0, e);
|
|
11643
11674
|
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
11644
|
-
if (this.inputElement.value
|
|
11675
|
+
if (this.inputElement.value === this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
11645
11676
|
this.updateInputValue('');
|
|
11646
11677
|
}
|
|
11647
11678
|
}
|
|
@@ -11694,7 +11725,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11694
11725
|
this.selectInputText();
|
|
11695
11726
|
}
|
|
11696
11727
|
if (this.enableMask && !this.inputElement.value && this.placeholder) {
|
|
11697
|
-
if (this.maskedDateValue && !this.value && (this.floatLabelType
|
|
11728
|
+
if (this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
11698
11729
|
this.updateInputValue(this.maskedDateValue);
|
|
11699
11730
|
this.inputElement.selectionStart = 0;
|
|
11700
11731
|
this.inputElement.selectionEnd = this.inputElement.value.length;
|
|
@@ -11940,8 +11971,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11940
11971
|
this.updatePlaceHolder();
|
|
11941
11972
|
this.setValue(this.value);
|
|
11942
11973
|
if (this.enableMask) {
|
|
11943
|
-
this.notify(
|
|
11944
|
-
module:
|
|
11974
|
+
this.notify('createMask', {
|
|
11975
|
+
module: 'MaskedDateTime'
|
|
11945
11976
|
});
|
|
11946
11977
|
}
|
|
11947
11978
|
break;
|
|
@@ -11993,8 +12024,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11993
12024
|
this.preventChange = false;
|
|
11994
12025
|
}
|
|
11995
12026
|
if (this.enableMask) {
|
|
11996
|
-
this.notify(
|
|
11997
|
-
module:
|
|
12027
|
+
this.notify('createMask', {
|
|
12028
|
+
module: 'MaskedDateTime'
|
|
11998
12029
|
});
|
|
11999
12030
|
}
|
|
12000
12031
|
break;
|
|
@@ -12028,8 +12059,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12028
12059
|
break;
|
|
12029
12060
|
case 'enableMask':
|
|
12030
12061
|
if (this.enableMask) {
|
|
12031
|
-
this.notify(
|
|
12032
|
-
module:
|
|
12062
|
+
this.notify('createMask', {
|
|
12063
|
+
module: 'MaskedDateTime'
|
|
12033
12064
|
});
|
|
12034
12065
|
this.updateInputValue(this.maskedDateValue);
|
|
12035
12066
|
}
|
|
@@ -12346,7 +12377,7 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12346
12377
|
this.cloneElement = this.element.cloneNode(true);
|
|
12347
12378
|
this.dateTimeFormat = this.cldrDateTimeFormat();
|
|
12348
12379
|
this.initValue = this.value;
|
|
12349
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
12380
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
12350
12381
|
this.enabled = false;
|
|
12351
12382
|
}
|
|
12352
12383
|
_super.prototype.updateHtmlAttributeToElement.call(this);
|
|
@@ -12359,12 +12390,12 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12359
12390
|
_super.prototype.updateHtmlAttributeToWrapper.call(this);
|
|
12360
12391
|
this.bindInputEvents();
|
|
12361
12392
|
if (this.enableMask) {
|
|
12362
|
-
this.notify(
|
|
12363
|
-
module:
|
|
12393
|
+
this.notify('createMask', {
|
|
12394
|
+
module: 'MaskedDateTime'
|
|
12364
12395
|
});
|
|
12365
12396
|
}
|
|
12366
12397
|
this.setValue(true);
|
|
12367
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType
|
|
12398
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType === 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
12368
12399
|
Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
12369
12400
|
}
|
|
12370
12401
|
this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkValue(this.scrollTo))) }, true);
|
|
@@ -12539,7 +12570,6 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12539
12570
|
}
|
|
12540
12571
|
return cldrTime;
|
|
12541
12572
|
};
|
|
12542
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12543
12573
|
DateTimePicker.prototype.getCldrFormat = function (type) {
|
|
12544
12574
|
var cldrDateTime;
|
|
12545
12575
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
@@ -12558,7 +12588,6 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12558
12588
|
return false;
|
|
12559
12589
|
}
|
|
12560
12590
|
};
|
|
12561
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12562
12591
|
DateTimePicker.prototype.getCultureTimeObject = function (ld, c) {
|
|
12563
12592
|
if (this.calendarMode === 'Gregorian') {
|
|
12564
12593
|
return getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld);
|
|
@@ -12656,8 +12685,7 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12656
12685
|
});
|
|
12657
12686
|
}
|
|
12658
12687
|
var value = isNullOrUndefined(this.value) ? this.inputElement.value !== '' ?
|
|
12659
|
-
dateObject :
|
|
12660
|
-
new Date() : this.value;
|
|
12688
|
+
dateObject : new Date() : this.value;
|
|
12661
12689
|
this.valueWithMinutes = value;
|
|
12662
12690
|
this.listWrapper = createElement('div', { className: CONTENT$3, attrs: { 'tabindex': '0' } });
|
|
12663
12691
|
var min = this.startTime(value);
|
|
@@ -12952,8 +12980,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12952
12980
|
return this.validateMinMaxRange(value);
|
|
12953
12981
|
};
|
|
12954
12982
|
DateTimePicker.prototype.createMask = function () {
|
|
12955
|
-
this.notify(
|
|
12956
|
-
module:
|
|
12983
|
+
this.notify('createMask', {
|
|
12984
|
+
module: 'MaskedDateTime'
|
|
12957
12985
|
});
|
|
12958
12986
|
};
|
|
12959
12987
|
DateTimePicker.prototype.combineDateTime = function (value) {
|
|
@@ -13407,7 +13435,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13407
13435
|
var index = (event.keyCode === 40 || event.keyCode === 39) ? ++this.activeIndex : --this.activeIndex;
|
|
13408
13436
|
this.activeIndex = index = this.activeIndex === (listCount) ? 0 : this.activeIndex;
|
|
13409
13437
|
this.activeIndex = index = this.activeIndex < 0 ? (listCount - 1) : this.activeIndex;
|
|
13410
|
-
nextItemValue = isNullOrUndefined(this.timeCollections[index]) ?
|
|
13438
|
+
nextItemValue = isNullOrUndefined(this.timeCollections[index]) ?
|
|
13439
|
+
this.timeCollections[0] : this.timeCollections[index];
|
|
13411
13440
|
}
|
|
13412
13441
|
else if (event.action === 'home') {
|
|
13413
13442
|
this.activeIndex = 0;
|
|
@@ -13505,8 +13534,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13505
13534
|
this.changeTrigger(null);
|
|
13506
13535
|
this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
|
|
13507
13536
|
if (this.enableMask && this.value) {
|
|
13508
|
-
this.notify(
|
|
13509
|
-
module:
|
|
13537
|
+
this.notify('createMask', {
|
|
13538
|
+
module: 'MaskedDateTime'
|
|
13510
13539
|
});
|
|
13511
13540
|
}
|
|
13512
13541
|
break;
|
|
@@ -13549,8 +13578,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13549
13578
|
this.dateTimeFormat = this.formatString;
|
|
13550
13579
|
this.setValue();
|
|
13551
13580
|
if (this.enableMask) {
|
|
13552
|
-
this.notify(
|
|
13553
|
-
module:
|
|
13581
|
+
this.notify('createMask', {
|
|
13582
|
+
module: 'MaskedDateTime'
|
|
13554
13583
|
});
|
|
13555
13584
|
if (!this.value) {
|
|
13556
13585
|
Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
@@ -13601,8 +13630,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13601
13630
|
break;
|
|
13602
13631
|
case 'enableMask':
|
|
13603
13632
|
if (this.enableMask) {
|
|
13604
|
-
this.notify(
|
|
13605
|
-
module:
|
|
13633
|
+
this.notify('createMask', {
|
|
13634
|
+
module: 'MaskedDateTime'
|
|
13606
13635
|
});
|
|
13607
13636
|
Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
13608
13637
|
}
|
|
@@ -13770,7 +13799,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13770
13799
|
hour: 'hour',
|
|
13771
13800
|
minute: 'minute',
|
|
13772
13801
|
second: 'second',
|
|
13773
|
-
dayOfTheWeek: 'day of the week'
|
|
13802
|
+
dayOfTheWeek: 'day of the week'
|
|
13774
13803
|
};
|
|
13775
13804
|
this.hiddenMask = '';
|
|
13776
13805
|
this.validCharacters = 'dMyhmHfasz';
|
|
@@ -13837,20 +13866,27 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13837
13866
|
if (navigated === void 0) { navigated = false; }
|
|
13838
13867
|
this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = false;
|
|
13839
13868
|
this.dateformat = this.getCulturedFormat();
|
|
13840
|
-
if (this.parent.maskPlaceholder.day)
|
|
13869
|
+
if (this.parent.maskPlaceholder.day) {
|
|
13841
13870
|
this.defaultConstant['day'] = this.parent.maskPlaceholder.day;
|
|
13842
|
-
|
|
13871
|
+
}
|
|
13872
|
+
if (this.parent.maskPlaceholder.month) {
|
|
13843
13873
|
this.defaultConstant['month'] = this.parent.maskPlaceholder.month;
|
|
13844
|
-
|
|
13874
|
+
}
|
|
13875
|
+
if (this.parent.maskPlaceholder.year) {
|
|
13845
13876
|
this.defaultConstant['year'] = this.parent.maskPlaceholder.year;
|
|
13846
|
-
|
|
13877
|
+
}
|
|
13878
|
+
if (this.parent.maskPlaceholder.hour) {
|
|
13847
13879
|
this.defaultConstant['hour'] = this.parent.maskPlaceholder.hour;
|
|
13848
|
-
|
|
13880
|
+
}
|
|
13881
|
+
if (this.parent.maskPlaceholder.minute) {
|
|
13849
13882
|
this.defaultConstant['minute'] = this.parent.maskPlaceholder.minute;
|
|
13850
|
-
|
|
13883
|
+
}
|
|
13884
|
+
if (this.parent.maskPlaceholder.second) {
|
|
13851
13885
|
this.defaultConstant['second'] = this.parent.maskPlaceholder.second;
|
|
13852
|
-
|
|
13886
|
+
}
|
|
13887
|
+
if (this.parent.maskPlaceholder.dayOfTheWeek) {
|
|
13853
13888
|
this.defaultConstant['dayOfTheWeek'] = this.parent.maskPlaceholder.dayOfTheWeek.toString();
|
|
13889
|
+
}
|
|
13854
13890
|
this.getCUltureMaskFormat();
|
|
13855
13891
|
var inputValue = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
13856
13892
|
this.isHiddenMask = true;
|
|
@@ -13868,7 +13904,8 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13868
13904
|
this.l10n = new L10n(this.parent.moduleName, this.defaultConstant, this.parent.locale);
|
|
13869
13905
|
this.objectString = Object.keys(this.defaultConstant);
|
|
13870
13906
|
for (var i = 0; i < this.objectString.length; i++) {
|
|
13871
|
-
this.defaultConstant[this.objectString[i].toString()] =
|
|
13907
|
+
this.defaultConstant[this.objectString[i].toString()] =
|
|
13908
|
+
this.l10n.getConstant(this.objectString[i].toString());
|
|
13872
13909
|
}
|
|
13873
13910
|
};
|
|
13874
13911
|
MaskedDateTime.prototype.validCharacterCheck = function () {
|
|
@@ -13888,7 +13925,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13888
13925
|
this.maskDateValue = new Date(+this.parent.value);
|
|
13889
13926
|
this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = true;
|
|
13890
13927
|
this.updateValue();
|
|
13891
|
-
// this.parent.inputElement.selectionStart = start;
|
|
13892
13928
|
this.validCharacterCheck();
|
|
13893
13929
|
};
|
|
13894
13930
|
MaskedDateTime.prototype.setSelection = function (validChar) {
|
|
@@ -13913,12 +13949,13 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13913
13949
|
this.isDeleteKey = true;
|
|
13914
13950
|
return;
|
|
13915
13951
|
}
|
|
13916
|
-
if ((!args.e.altKey && !args.e.ctrlKey) && (args.e.key === ARROWLEFT || args.e.key === ARROWRIGHT
|
|
13952
|
+
if ((!args.e.altKey && !args.e.ctrlKey) && (args.e.key === ARROWLEFT || args.e.key === ARROWRIGHT
|
|
13953
|
+
|| args.e.key === SHIFTTAB || args.e.key === TAB || args.e.action === SHIFTTAB ||
|
|
13917
13954
|
args.e.key === END || args.e.key === HOME)) {
|
|
13918
13955
|
var start = this.parent.inputElement.selectionStart;
|
|
13919
13956
|
var end = this.parent.inputElement.selectionEnd;
|
|
13920
13957
|
var length_1 = this.parent.inputElement.value.length;
|
|
13921
|
-
if ((start
|
|
13958
|
+
if ((start === 0 && end === length_1) && (args.e.key === TAB || args.e.action === SHIFTTAB)) {
|
|
13922
13959
|
var index = args.e.action === SHIFTTAB ? end : 0;
|
|
13923
13960
|
this.parent.inputElement.selectionStart = this.parent.inputElement.selectionEnd = index;
|
|
13924
13961
|
}
|
|
@@ -13963,7 +14000,8 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13963
14000
|
var newVal = inputValue.substring(0, start);
|
|
13964
14001
|
var newDateValue = new Date(+this.maskDateValue);
|
|
13965
14002
|
var maxDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth() + 1, 0).getDate();
|
|
13966
|
-
if (previousVal.indexOf(newVal) === 0 && (newVal.length === 0 ||
|
|
14003
|
+
if (previousVal.indexOf(newVal) === 0 && (newVal.length === 0 ||
|
|
14004
|
+
this.previousHiddenMask[newVal.length - 1] !== this.previousHiddenMask[newVal.length])) {
|
|
13967
14005
|
for (var i = newVal.length; i < previousVal.length; i++) {
|
|
13968
14006
|
if (this.previousHiddenMask[i] !== '' && this.validCharacters.indexOf(this.previousHiddenMask[i]) >= 0) {
|
|
13969
14007
|
this.isDeletion = this.handleDeletion(this.previousHiddenMask[i], false);
|
|
@@ -13975,114 +14013,123 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13975
14013
|
}
|
|
13976
14014
|
switch (this.previousHiddenMask[start - 1]) {
|
|
13977
14015
|
case 'd':
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
for (var i = 0; date > maxDate; i++) {
|
|
13986
|
-
date = parseInt(date.toString().slice(1), 10);
|
|
13987
|
-
}
|
|
13988
|
-
if (date >= 1) {
|
|
13989
|
-
newDateValue.setDate(date);
|
|
13990
|
-
this.isNavigate = date.toString().length === 2;
|
|
13991
|
-
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
13992
|
-
if (newDateValue.getMonth() !== this.maskDateValue.getMonth()) {
|
|
14016
|
+
{
|
|
14017
|
+
var date = (this.isDayPart && newDateValue.getDate().toString().length < 2 &&
|
|
14018
|
+
!this.isPersist() ? newDateValue.getDate() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14019
|
+
this.isDateZero = (newVal[start - 1] === '0');
|
|
14020
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14021
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14022
|
+
if (isNaN(date)) {
|
|
13993
14023
|
return;
|
|
13994
14024
|
}
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14025
|
+
for (var i = 0; date > maxDate; i++) {
|
|
14026
|
+
date = parseInt(date.toString().slice(1), 10);
|
|
14027
|
+
}
|
|
14028
|
+
if (date >= 1) {
|
|
14029
|
+
newDateValue.setDate(date);
|
|
14030
|
+
this.isNavigate = date.toString().length === 2;
|
|
14031
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14032
|
+
if (newDateValue.getMonth() !== this.maskDateValue.getMonth()) {
|
|
14033
|
+
return;
|
|
14034
|
+
}
|
|
14035
|
+
this.isDayPart = true;
|
|
14036
|
+
this.dayTypeCount = this.dayTypeCount + 1;
|
|
14037
|
+
}
|
|
14038
|
+
else {
|
|
14039
|
+
this.isDayPart = false;
|
|
14040
|
+
this.dayTypeCount = this.isDateZero ? this.dayTypeCount + 1 : this.dayTypeCount;
|
|
14041
|
+
}
|
|
14042
|
+
break;
|
|
14001
14043
|
}
|
|
14002
|
-
break;
|
|
14003
14044
|
case 'M':
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14015
|
-
|
|
14016
|
-
month
|
|
14017
|
-
|
|
14018
|
-
if (month >= 1) {
|
|
14019
|
-
newDateValue.setMonth(month - 1);
|
|
14020
|
-
this.isNavigate = month.toString().length === 2;
|
|
14021
|
-
if (newDateValue.getMonth() !== month - 1) {
|
|
14022
|
-
newDateValue.setDate(1);
|
|
14023
|
-
newDateValue.setMonth(month - 1);
|
|
14045
|
+
{
|
|
14046
|
+
var month = void 0;
|
|
14047
|
+
if (newDateValue.getMonth().toString().length < 2 && !this.isPersist()) {
|
|
14048
|
+
month = (this.isMonthPart ? (newDateValue.getMonth() + 1) * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14049
|
+
}
|
|
14050
|
+
else {
|
|
14051
|
+
month = parseInt(newVal[start - 1], 10);
|
|
14052
|
+
}
|
|
14053
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14054
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14055
|
+
this.isMonthZero = (newVal[start - 1] === '0');
|
|
14056
|
+
if (!isNaN(month)) {
|
|
14057
|
+
while (month > 12) {
|
|
14058
|
+
month = parseInt(month.toString().slice(1), 10);
|
|
14024
14059
|
}
|
|
14025
|
-
if (
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
if (
|
|
14029
|
-
newDateValue.setDate(
|
|
14060
|
+
if (month >= 1) {
|
|
14061
|
+
newDateValue.setMonth(month - 1);
|
|
14062
|
+
this.isNavigate = month.toString().length === 2;
|
|
14063
|
+
if (newDateValue.getMonth() !== month - 1) {
|
|
14064
|
+
newDateValue.setDate(1);
|
|
14065
|
+
newDateValue.setMonth(month - 1);
|
|
14066
|
+
}
|
|
14067
|
+
if (this.isDayPart) {
|
|
14068
|
+
var previousMaxDate = new Date(this.previousDate.getFullYear(), this.previousDate.getMonth() + 1, 0).getDate();
|
|
14069
|
+
var currentMaxDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth() + 1, 0).getDate();
|
|
14070
|
+
if (this.previousDate.getDate() === previousMaxDate && currentMaxDate <= previousMaxDate) {
|
|
14071
|
+
newDateValue.setDate(currentMaxDate);
|
|
14072
|
+
}
|
|
14030
14073
|
}
|
|
14074
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14075
|
+
this.isMonthPart = true;
|
|
14076
|
+
this.monthTypeCount = this.monthTypeCount + 1;
|
|
14077
|
+
}
|
|
14078
|
+
else {
|
|
14079
|
+
newDateValue.setMonth(0);
|
|
14080
|
+
this.isMonthPart = false;
|
|
14081
|
+
this.monthTypeCount = this.isMonthZero ? this.monthTypeCount + 1 : this.monthTypeCount;
|
|
14031
14082
|
}
|
|
14032
|
-
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14033
|
-
this.isMonthPart = true;
|
|
14034
|
-
this.monthTypeCount = this.monthTypeCount + 1;
|
|
14035
14083
|
}
|
|
14036
14084
|
else {
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
this.
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
newDateValue.setMonth(i - 1);
|
|
14052
|
-
this.isMonthPart = true;
|
|
14053
|
-
this.maskDateValue = newDateValue;
|
|
14054
|
-
return;
|
|
14085
|
+
var monthString = (this.getCulturedValue('months[stand-alone].wide'));
|
|
14086
|
+
var monthValue = Object.keys(monthString);
|
|
14087
|
+
this.monthCharacter += newVal[start - 1].toLowerCase();
|
|
14088
|
+
while (this.monthCharacter.length > 0) {
|
|
14089
|
+
var i = 1;
|
|
14090
|
+
for (var _i = 0, monthValue_1 = monthValue; _i < monthValue_1.length; _i++) {
|
|
14091
|
+
var months = monthValue_1[_i];
|
|
14092
|
+
if (monthString[i].toLowerCase().indexOf(this.monthCharacter) === 0) {
|
|
14093
|
+
newDateValue.setMonth(i - 1);
|
|
14094
|
+
this.isMonthPart = true;
|
|
14095
|
+
this.maskDateValue = newDateValue;
|
|
14096
|
+
return;
|
|
14097
|
+
}
|
|
14098
|
+
i++;
|
|
14055
14099
|
}
|
|
14056
|
-
|
|
14100
|
+
this.monthCharacter = this.monthCharacter.substring(1, this.monthCharacter.length);
|
|
14057
14101
|
}
|
|
14058
|
-
this.monthCharacter = this.monthCharacter.substring(1, this.monthCharacter.length);
|
|
14059
14102
|
}
|
|
14103
|
+
break;
|
|
14060
14104
|
}
|
|
14061
|
-
break;
|
|
14062
14105
|
case 'y':
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
year = parseInt(year.toString().slice(1), 10);
|
|
14071
|
-
}
|
|
14072
|
-
if (year < 1) {
|
|
14073
|
-
this.isYearPart = false;
|
|
14074
|
-
}
|
|
14075
|
-
else {
|
|
14076
|
-
newDateValue.setFullYear(year);
|
|
14077
|
-
if (year.toString().length === 4) {
|
|
14078
|
-
this.isNavigate = true;
|
|
14106
|
+
{
|
|
14107
|
+
var year = (this.isYearPart && (newDateValue.getFullYear().toString().length < 4
|
|
14108
|
+
&& !this.isShortYear) ? newDateValue.getFullYear() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14109
|
+
this.isShortYear = false;
|
|
14110
|
+
this.isYearZero = (newVal[start - 1] === '0');
|
|
14111
|
+
if (isNaN(year)) {
|
|
14112
|
+
return;
|
|
14079
14113
|
}
|
|
14080
|
-
|
|
14081
|
-
|
|
14114
|
+
while (year > 9999) {
|
|
14115
|
+
year = parseInt(year.toString().slice(1), 10);
|
|
14116
|
+
}
|
|
14117
|
+
if (year < 1) {
|
|
14118
|
+
this.isYearPart = false;
|
|
14119
|
+
}
|
|
14120
|
+
else {
|
|
14121
|
+
newDateValue.setFullYear(year);
|
|
14122
|
+
if (year.toString().length === 4) {
|
|
14123
|
+
this.isNavigate = true;
|
|
14124
|
+
}
|
|
14125
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14126
|
+
this.isYearPart = true;
|
|
14127
|
+
}
|
|
14128
|
+
break;
|
|
14082
14129
|
}
|
|
14083
|
-
break;
|
|
14084
14130
|
case 'h':
|
|
14085
|
-
this.hour = (this.isHourPart && (newDateValue.getHours() % 12 || 12).toString().length < 2
|
|
14131
|
+
this.hour = (this.isHourPart && (newDateValue.getHours() % 12 || 12).toString().length < 2
|
|
14132
|
+
&& !this.isPersist() ? (newDateValue.getHours() % 12 || 12) * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14086
14133
|
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14087
14134
|
this.navigated = this.navigated ? false : this.navigated;
|
|
14088
14135
|
if (isNaN(this.hour)) {
|
|
@@ -14097,7 +14144,8 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14097
14144
|
this.hourTypeCount = this.hourTypeCount + 1;
|
|
14098
14145
|
break;
|
|
14099
14146
|
case 'H':
|
|
14100
|
-
this.hour = (this.isHourPart && newDateValue.getHours().toString().length < 2 &&
|
|
14147
|
+
this.hour = (this.isHourPart && newDateValue.getHours().toString().length < 2 &&
|
|
14148
|
+
!this.isPersist() ? newDateValue.getHours() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14101
14149
|
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14102
14150
|
this.navigated = this.navigated ? false : this.navigated;
|
|
14103
14151
|
if (isNaN(this.hour)) {
|
|
@@ -14112,67 +14160,81 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14112
14160
|
this.hourTypeCount = this.hourTypeCount + 1;
|
|
14113
14161
|
break;
|
|
14114
14162
|
case 'm':
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14163
|
+
{
|
|
14164
|
+
var minutes = (this.isMinutePart && newDateValue.getMinutes().toString().length < 2
|
|
14165
|
+
&& !this.isPersist() ? newDateValue.getMinutes() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14166
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14167
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14168
|
+
if (isNaN(minutes)) {
|
|
14169
|
+
return;
|
|
14170
|
+
}
|
|
14171
|
+
for (var i = 0; minutes > 59; i++) {
|
|
14172
|
+
minutes = parseInt(minutes.toString().slice(1), 10);
|
|
14173
|
+
}
|
|
14174
|
+
newDateValue.setMinutes(minutes);
|
|
14175
|
+
this.isNavigate = minutes.toString().length === 2;
|
|
14176
|
+
this.isMinutePart = true;
|
|
14177
|
+
this.minuteTypeCount = this.minuteTypeCount + 1;
|
|
14178
|
+
break;
|
|
14123
14179
|
}
|
|
14124
|
-
newDateValue.setMinutes(minutes);
|
|
14125
|
-
this.isNavigate = minutes.toString().length === 2;
|
|
14126
|
-
this.isMinutePart = true;
|
|
14127
|
-
this.minuteTypeCount = this.minuteTypeCount + 1;
|
|
14128
|
-
break;
|
|
14129
14180
|
case 's':
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
|
|
14181
|
+
{
|
|
14182
|
+
var seconds = (this.isSecondsPart && newDateValue.getSeconds().toString().length < 2 &&
|
|
14183
|
+
!this.isPersist() ? newDateValue.getSeconds() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14184
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14185
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14186
|
+
if (isNaN(seconds)) {
|
|
14187
|
+
return;
|
|
14188
|
+
}
|
|
14189
|
+
for (var i = 0; seconds > 59; i++) {
|
|
14190
|
+
seconds = parseInt(seconds.toString().slice(1), 10);
|
|
14191
|
+
}
|
|
14192
|
+
newDateValue.setSeconds(seconds);
|
|
14193
|
+
this.isNavigate = seconds.toString().length === 2;
|
|
14194
|
+
this.isSecondsPart = true;
|
|
14195
|
+
this.secondTypeCount = this.secondTypeCount + 1;
|
|
14196
|
+
break;
|
|
14138
14197
|
}
|
|
14139
|
-
newDateValue.setSeconds(seconds);
|
|
14140
|
-
this.isNavigate = seconds.toString().length === 2;
|
|
14141
|
-
this.isSecondsPart = true;
|
|
14142
|
-
this.secondTypeCount = this.secondTypeCount + 1;
|
|
14143
|
-
break;
|
|
14144
14198
|
case 'a':
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14199
|
+
{
|
|
14200
|
+
this.periodCharacter += newVal[start - 1].toLowerCase();
|
|
14201
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14202
|
+
var periodString = (this.getCulturedValue('dayPeriods.format.wide'));
|
|
14203
|
+
var periodkeys = Object.keys(periodString);
|
|
14204
|
+
for (var i = 0; this.periodCharacter.length > 0; i++) {
|
|
14205
|
+
if ((periodString[periodkeys[0]].toLowerCase().indexOf(this.periodCharacter) === 0
|
|
14206
|
+
&& newDateValue.getHours() >= 12) || (periodString[periodkeys[1]].toLowerCase().
|
|
14207
|
+
indexOf(this.periodCharacter) === 0 && newDateValue.getHours() < 12)) {
|
|
14208
|
+
newDateValue.setHours((newDateValue.getHours() + 12) % 24);
|
|
14209
|
+
this.maskDateValue = newDateValue;
|
|
14210
|
+
}
|
|
14211
|
+
this.periodCharacter = this.periodCharacter.substring(1, this.periodCharacter.length);
|
|
14212
|
+
}
|
|
14213
|
+
break;
|
|
14157
14214
|
}
|
|
14158
|
-
break;
|
|
14159
14215
|
default:
|
|
14160
14216
|
break;
|
|
14161
14217
|
}
|
|
14162
14218
|
this.maskDateValue = newDateValue;
|
|
14163
14219
|
};
|
|
14220
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14164
14221
|
MaskedDateTime.prototype.formatCheck = function () {
|
|
14222
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
14165
14223
|
var proxy = this;
|
|
14166
14224
|
function formatValueSpecifier(formattext) {
|
|
14167
14225
|
var result;
|
|
14226
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14168
14227
|
var daysAbbreviated = proxy.getCulturedValue('days[stand-alone].abbreviated');
|
|
14169
14228
|
var dayKeyAbbreviated = Object.keys(daysAbbreviated);
|
|
14229
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14170
14230
|
var daysWide = (proxy.getCulturedValue('days[stand-alone].wide'));
|
|
14171
14231
|
var dayKeyWide = Object.keys(daysWide);
|
|
14232
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14172
14233
|
var daysNarrow = (proxy.getCulturedValue('days[stand-alone].narrow'));
|
|
14173
14234
|
var dayKeyNarrow = Object.keys(daysNarrow);
|
|
14174
14235
|
var monthAbbreviated = (proxy.getCulturedValue('months[stand-alone].abbreviated'));
|
|
14175
14236
|
var monthWide = (proxy.getCulturedValue('months[stand-alone].wide'));
|
|
14237
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14176
14238
|
var periodString = (proxy.getCulturedValue('dayPeriods.format.wide'));
|
|
14177
14239
|
var periodkeys = Object.keys(periodString);
|
|
14178
14240
|
var milliseconds;
|
|
@@ -14183,7 +14245,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14183
14245
|
case 'd':
|
|
14184
14246
|
result = proxy.isDayPart ? proxy.maskDateValue.getDate().toString() : proxy.defaultConstant['day'].toString();
|
|
14185
14247
|
result = proxy.zeroCheck(proxy.isDateZero, proxy.isDayPart, result);
|
|
14186
|
-
if (proxy.dayTypeCount
|
|
14248
|
+
if (proxy.dayTypeCount === 2) {
|
|
14187
14249
|
proxy.isNavigate = true;
|
|
14188
14250
|
proxy.dayTypeCount = 0;
|
|
14189
14251
|
}
|
|
@@ -14191,7 +14253,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14191
14253
|
case 'dd':
|
|
14192
14254
|
result = proxy.isDayPart ? proxy.roundOff(proxy.maskDateValue.getDate(), 2) : proxy.defaultConstant['day'].toString();
|
|
14193
14255
|
result = proxy.zeroCheck(proxy.isDateZero, proxy.isDayPart, result);
|
|
14194
|
-
if (proxy.dayTypeCount
|
|
14256
|
+
if (proxy.dayTypeCount === 2) {
|
|
14195
14257
|
proxy.isNavigate = true;
|
|
14196
14258
|
proxy.dayTypeCount = 0;
|
|
14197
14259
|
}
|
|
@@ -14210,7 +14272,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14210
14272
|
case 'M':
|
|
14211
14273
|
result = proxy.isMonthPart ? (proxy.maskDateValue.getMonth() + 1).toString() : proxy.defaultConstant['month'].toString();
|
|
14212
14274
|
result = proxy.zeroCheck(proxy.isMonthZero, proxy.isMonthPart, result);
|
|
14213
|
-
if (proxy.monthTypeCount
|
|
14275
|
+
if (proxy.monthTypeCount === 2) {
|
|
14214
14276
|
proxy.isNavigate = true;
|
|
14215
14277
|
proxy.monthTypeCount = 0;
|
|
14216
14278
|
}
|
|
@@ -14218,7 +14280,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14218
14280
|
case 'MM':
|
|
14219
14281
|
result = proxy.isMonthPart ? proxy.roundOff(proxy.maskDateValue.getMonth() + 1, 2) : proxy.defaultConstant['month'].toString();
|
|
14220
14282
|
result = proxy.zeroCheck(proxy.isMonthZero, proxy.isMonthPart, result);
|
|
14221
|
-
if (proxy.monthTypeCount
|
|
14283
|
+
if (proxy.monthTypeCount === 2) {
|
|
14222
14284
|
proxy.isNavigate = true;
|
|
14223
14285
|
proxy.monthTypeCount = 0;
|
|
14224
14286
|
}
|
|
@@ -14243,56 +14305,56 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14243
14305
|
break;
|
|
14244
14306
|
case 'h':
|
|
14245
14307
|
result = proxy.isHourPart ? (proxy.maskDateValue.getHours() % 12 || 12).toString() : proxy.defaultConstant['hour'].toString();
|
|
14246
|
-
if (proxy.hourTypeCount
|
|
14308
|
+
if (proxy.hourTypeCount === 2) {
|
|
14247
14309
|
proxy.isNavigate = true;
|
|
14248
14310
|
proxy.hourTypeCount = 0;
|
|
14249
14311
|
}
|
|
14250
14312
|
break;
|
|
14251
14313
|
case 'hh':
|
|
14252
14314
|
result = proxy.isHourPart ? proxy.roundOff(proxy.maskDateValue.getHours() % 12 || 12, 2) : proxy.defaultConstant['hour'].toString();
|
|
14253
|
-
if (proxy.hourTypeCount
|
|
14315
|
+
if (proxy.hourTypeCount === 2) {
|
|
14254
14316
|
proxy.isNavigate = true;
|
|
14255
14317
|
proxy.hourTypeCount = 0;
|
|
14256
14318
|
}
|
|
14257
14319
|
break;
|
|
14258
14320
|
case 'H':
|
|
14259
14321
|
result = proxy.isHourPart ? proxy.maskDateValue.getHours().toString() : proxy.defaultConstant['hour'].toString();
|
|
14260
|
-
if (proxy.hourTypeCount
|
|
14322
|
+
if (proxy.hourTypeCount === 2) {
|
|
14261
14323
|
proxy.isNavigate = true;
|
|
14262
14324
|
proxy.hourTypeCount = 0;
|
|
14263
14325
|
}
|
|
14264
14326
|
break;
|
|
14265
14327
|
case 'HH':
|
|
14266
14328
|
result = proxy.isHourPart ? proxy.roundOff(proxy.maskDateValue.getHours(), 2) : proxy.defaultConstant['hour'].toString();
|
|
14267
|
-
if (proxy.hourTypeCount
|
|
14329
|
+
if (proxy.hourTypeCount === 2) {
|
|
14268
14330
|
proxy.isNavigate = true;
|
|
14269
14331
|
proxy.hourTypeCount = 0;
|
|
14270
14332
|
}
|
|
14271
14333
|
break;
|
|
14272
14334
|
case 'm':
|
|
14273
14335
|
result = proxy.isMinutePart ? proxy.maskDateValue.getMinutes().toString() : proxy.defaultConstant['minute'].toString();
|
|
14274
|
-
if (proxy.minuteTypeCount
|
|
14336
|
+
if (proxy.minuteTypeCount === 2) {
|
|
14275
14337
|
proxy.isNavigate = true;
|
|
14276
14338
|
proxy.minuteTypeCount = 0;
|
|
14277
14339
|
}
|
|
14278
14340
|
break;
|
|
14279
14341
|
case 'mm':
|
|
14280
14342
|
result = proxy.isMinutePart ? proxy.roundOff(proxy.maskDateValue.getMinutes(), 2) : proxy.defaultConstant['minute'].toString();
|
|
14281
|
-
if (proxy.minuteTypeCount
|
|
14343
|
+
if (proxy.minuteTypeCount === 2) {
|
|
14282
14344
|
proxy.isNavigate = true;
|
|
14283
14345
|
proxy.minuteTypeCount = 0;
|
|
14284
14346
|
}
|
|
14285
14347
|
break;
|
|
14286
14348
|
case 's':
|
|
14287
14349
|
result = proxy.isSecondsPart ? proxy.maskDateValue.getSeconds().toString() : proxy.defaultConstant['second'].toString();
|
|
14288
|
-
if (proxy.secondTypeCount
|
|
14350
|
+
if (proxy.secondTypeCount === 2) {
|
|
14289
14351
|
proxy.isNavigate = true;
|
|
14290
14352
|
proxy.secondTypeCount = 0;
|
|
14291
14353
|
}
|
|
14292
14354
|
break;
|
|
14293
14355
|
case 'ss':
|
|
14294
14356
|
result = proxy.isSecondsPart ? proxy.roundOff(proxy.maskDateValue.getSeconds(), 2) : proxy.defaultConstant['second'].toString();
|
|
14295
|
-
if (proxy.secondTypeCount
|
|
14357
|
+
if (proxy.secondTypeCount === 2) {
|
|
14296
14358
|
proxy.isNavigate = true;
|
|
14297
14359
|
proxy.secondTypeCount = 0;
|
|
14298
14360
|
}
|
|
@@ -14341,14 +14403,12 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14341
14403
|
};
|
|
14342
14404
|
MaskedDateTime.prototype.maskInputHandler = function () {
|
|
14343
14405
|
var start = this.parent.inputElement.selectionStart;
|
|
14344
|
-
var selectionChar = this.previousHiddenMask[start - 1];
|
|
14345
14406
|
var formatText = '';
|
|
14346
14407
|
if (this.validCharacters.indexOf(this.hiddenMask[start]) !== -1) {
|
|
14347
14408
|
formatText = this.hiddenMask[start];
|
|
14348
14409
|
}
|
|
14349
|
-
var inputValue;
|
|
14350
14410
|
this.differenceCheck();
|
|
14351
|
-
inputValue = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
14411
|
+
var inputValue = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
14352
14412
|
this.isHiddenMask = true;
|
|
14353
14413
|
this.hiddenMask = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
14354
14414
|
this.isDateZero = this.isMonthZero = this.isYearZero = false;
|
|
@@ -14374,8 +14434,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14374
14434
|
this.isDeletion = false;
|
|
14375
14435
|
}
|
|
14376
14436
|
this.isDeleteKey = false;
|
|
14377
|
-
// this.setSelection(selectionChar);
|
|
14378
|
-
// this.navigateSelection(inputValue);
|
|
14379
14437
|
};
|
|
14380
14438
|
MaskedDateTime.prototype.navigateSelection = function (isbackward) {
|
|
14381
14439
|
var start = this.parent.inputElement.selectionStart;
|
|
@@ -14456,24 +14514,26 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14456
14514
|
newDateValue.setDate(newDateValue.getDate() + incrementValue);
|
|
14457
14515
|
break;
|
|
14458
14516
|
case 'M':
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14517
|
+
{
|
|
14518
|
+
var newMonth = newDateValue.getMonth() + incrementValue;
|
|
14519
|
+
newDateValue.setDate(1);
|
|
14520
|
+
newDateValue.setMonth(newMonth);
|
|
14521
|
+
if (this.isDayPart) {
|
|
14522
|
+
var previousMaxDate = new Date(this.previousDate.getFullYear(), this.previousDate.getMonth() + 1, 0).getDate();
|
|
14523
|
+
var currentMaxDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth() + 1, 0).getDate();
|
|
14524
|
+
if (this.previousDate.getDate() === previousMaxDate && currentMaxDate <= previousMaxDate) {
|
|
14525
|
+
newDateValue.setDate(currentMaxDate);
|
|
14526
|
+
}
|
|
14527
|
+
else {
|
|
14528
|
+
newDateValue.setDate(this.previousDate.getDate());
|
|
14529
|
+
}
|
|
14467
14530
|
}
|
|
14468
14531
|
else {
|
|
14469
14532
|
newDateValue.setDate(this.previousDate.getDate());
|
|
14470
14533
|
}
|
|
14534
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14535
|
+
break;
|
|
14471
14536
|
}
|
|
14472
|
-
else {
|
|
14473
|
-
newDateValue.setDate(this.previousDate.getDate());
|
|
14474
|
-
}
|
|
14475
|
-
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14476
|
-
break;
|
|
14477
14537
|
case 'y':
|
|
14478
14538
|
newDateValue.setFullYear(newDateValue.getFullYear() + incrementValue);
|
|
14479
14539
|
break;
|
|
@@ -14511,19 +14571,19 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14511
14571
|
};
|
|
14512
14572
|
MaskedDateTime.prototype.getCulturedFormat = function () {
|
|
14513
14573
|
var formatString = (this.getCulturedValue('dateTimeFormats[availableFormats].yMd')).toString();
|
|
14514
|
-
if (this.parent.moduleName
|
|
14574
|
+
if (this.parent.moduleName === 'datepicker') {
|
|
14515
14575
|
formatString = (this.getCulturedValue('dateTimeFormats[availableFormats].yMd')).toString();
|
|
14516
14576
|
if (this.parent.format && this.parent.formatString) {
|
|
14517
14577
|
formatString = this.parent.formatString;
|
|
14518
14578
|
}
|
|
14519
14579
|
}
|
|
14520
|
-
if (this.parent.moduleName
|
|
14580
|
+
if (this.parent.moduleName === 'datetimepicker') {
|
|
14521
14581
|
formatString = (this.getCulturedValue('dateTimeFormats[availableFormats].yMd')).toString();
|
|
14522
14582
|
if (this.parent.dateTimeFormat) {
|
|
14523
14583
|
formatString = this.parent.dateTimeFormat;
|
|
14524
14584
|
}
|
|
14525
14585
|
}
|
|
14526
|
-
if (this.parent.moduleName
|
|
14586
|
+
if (this.parent.moduleName === 'timepicker') {
|
|
14527
14587
|
formatString = this.parent.cldrTimeFormat();
|
|
14528
14588
|
}
|
|
14529
14589
|
return formatString;
|
|
@@ -14541,7 +14601,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14541
14601
|
this.previousHiddenMask = this.hiddenMask;
|
|
14542
14602
|
this.previousValue = inputValue;
|
|
14543
14603
|
this.parent.updateInputValue(inputValue);
|
|
14544
|
-
//this.parent.inputElement.value = inputValue;
|
|
14545
14604
|
};
|
|
14546
14605
|
MaskedDateTime.prototype.destroy = function () {
|
|
14547
14606
|
this.removeEventListener();
|