@syncfusion/ej2-calendars 20.4.54 → 21.1.37
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 +7 -7
- 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 +437 -374
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +392 -329
- 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 +67 -58
- 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
|
}
|
|
@@ -3201,7 +3218,6 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3201
3218
|
*/
|
|
3202
3219
|
function DatePicker(options, element) {
|
|
3203
3220
|
var _this = _super.call(this, options, element) || this;
|
|
3204
|
-
_this.previousElementValue = '';
|
|
3205
3221
|
_this.isDateIconClicked = false;
|
|
3206
3222
|
_this.isAltKeyPressed = false;
|
|
3207
3223
|
_this.isInteracted = true;
|
|
@@ -3230,7 +3246,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3230
3246
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
|
|
3231
3247
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
3232
3248
|
}
|
|
3233
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
3249
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
3234
3250
|
this.enabled = false;
|
|
3235
3251
|
}
|
|
3236
3252
|
this.renderComplete();
|
|
@@ -3278,15 +3294,15 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3278
3294
|
DatePicker.prototype.initialize = function () {
|
|
3279
3295
|
this.checkInvalidValue(this.value);
|
|
3280
3296
|
if (this.enableMask) {
|
|
3281
|
-
this.notify(
|
|
3282
|
-
module:
|
|
3297
|
+
this.notify('createMask', {
|
|
3298
|
+
module: 'MaskedDateTime'
|
|
3283
3299
|
});
|
|
3284
3300
|
}
|
|
3285
3301
|
this.createInput();
|
|
3286
3302
|
this.updateHtmlAttributeToWrapper();
|
|
3287
3303
|
this.setAllowEdit();
|
|
3288
3304
|
this.updateInput(true);
|
|
3289
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType
|
|
3305
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType === 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
3290
3306
|
this.updateInputValue(this.maskedDateValue);
|
|
3291
3307
|
}
|
|
3292
3308
|
this.previousElementValue = this.inputElement.value;
|
|
@@ -3400,8 +3416,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3400
3416
|
}
|
|
3401
3417
|
else {
|
|
3402
3418
|
this.updateInputValue(this.maskedDateValue);
|
|
3403
|
-
this.notify(
|
|
3404
|
-
module:
|
|
3419
|
+
this.notify('createMask', {
|
|
3420
|
+
module: 'MaskedDateTime'
|
|
3405
3421
|
});
|
|
3406
3422
|
}
|
|
3407
3423
|
}
|
|
@@ -3567,8 +3583,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3567
3583
|
if (e.code !== 'Delete') {
|
|
3568
3584
|
e.preventDefault();
|
|
3569
3585
|
}
|
|
3570
|
-
this.notify(
|
|
3571
|
-
module:
|
|
3586
|
+
this.notify('keyDownHandler', {
|
|
3587
|
+
module: 'MaskedDateTime',
|
|
3572
3588
|
e: e
|
|
3573
3589
|
});
|
|
3574
3590
|
}
|
|
@@ -3643,8 +3659,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3643
3659
|
DatePicker.prototype.mouseUpHandler = function (e) {
|
|
3644
3660
|
if (this.enableMask) {
|
|
3645
3661
|
e.preventDefault();
|
|
3646
|
-
this.notify(
|
|
3647
|
-
module:
|
|
3662
|
+
this.notify('setMaskSelection', {
|
|
3663
|
+
module: 'MaskedDateTime'
|
|
3648
3664
|
});
|
|
3649
3665
|
}
|
|
3650
3666
|
};
|
|
@@ -3662,8 +3678,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3662
3678
|
this.popupUpdate();
|
|
3663
3679
|
this.changeEvent(event);
|
|
3664
3680
|
if (this.enableMask) {
|
|
3665
|
-
this.notify(
|
|
3666
|
-
module:
|
|
3681
|
+
this.notify('clearHandler', {
|
|
3682
|
+
module: 'MaskedDateTime'
|
|
3667
3683
|
});
|
|
3668
3684
|
}
|
|
3669
3685
|
if (closest(this.element, 'form')) {
|
|
@@ -3798,7 +3814,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3798
3814
|
return;
|
|
3799
3815
|
}
|
|
3800
3816
|
if (this.enableMask && !this.inputElement.value && this.placeholder) {
|
|
3801
|
-
if (this.maskedDateValue && !this.value && (this.floatLabelType
|
|
3817
|
+
if (this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
3802
3818
|
this.updateInputValue(this.maskedDateValue);
|
|
3803
3819
|
this.inputElement.selectionStart = 0;
|
|
3804
3820
|
this.inputElement.selectionEnd = this.inputElement.value.length;
|
|
@@ -3817,8 +3833,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3817
3833
|
DatePicker.prototype.inputHandler = function () {
|
|
3818
3834
|
this.isPopupClicked = false;
|
|
3819
3835
|
if (this.enableMask) {
|
|
3820
|
-
this.notify(
|
|
3821
|
-
module:
|
|
3836
|
+
this.notify('inputHandler', {
|
|
3837
|
+
module: 'MaskedDateTime'
|
|
3822
3838
|
});
|
|
3823
3839
|
}
|
|
3824
3840
|
};
|
|
@@ -3835,7 +3851,7 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3835
3851
|
this.popupUpdate();
|
|
3836
3852
|
this.changeTrigger(e);
|
|
3837
3853
|
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
3838
|
-
if (this.inputElement.value
|
|
3854
|
+
if (this.inputElement.value === this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
3839
3855
|
this.updateInputValue('');
|
|
3840
3856
|
}
|
|
3841
3857
|
}
|
|
@@ -3924,31 +3940,33 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
3924
3940
|
break;
|
|
3925
3941
|
case 'tab':
|
|
3926
3942
|
case 'shiftTab':
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
e.
|
|
3943
|
+
{
|
|
3944
|
+
var start = this.inputElement.selectionStart;
|
|
3945
|
+
var end = this.inputElement.selectionEnd;
|
|
3946
|
+
if (this.enableMask && !this.popupObj && !this.readonly) {
|
|
3947
|
+
var length_1 = this.inputElement.value.length;
|
|
3948
|
+
if ((start === 0 && end === length_1) || (end !== length_1 && e.action === 'tab') || (start !== 0 && e.action === 'shiftTab')) {
|
|
3949
|
+
e.preventDefault();
|
|
3950
|
+
}
|
|
3951
|
+
this.notify('keyDownHandler', {
|
|
3952
|
+
module: 'MaskedDateTime',
|
|
3953
|
+
e: e
|
|
3954
|
+
});
|
|
3955
|
+
start = this.inputElement.selectionStart;
|
|
3956
|
+
end = this.inputElement.selectionEnd;
|
|
3933
3957
|
}
|
|
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;
|
|
3958
|
+
this.strictModeUpdate();
|
|
3959
|
+
this.updateInput();
|
|
3960
|
+
this.popupUpdate();
|
|
3961
|
+
this.changeTrigger(e);
|
|
3962
|
+
this.errorClass();
|
|
3963
|
+
if (this.enableMask) {
|
|
3964
|
+
this.inputElement.selectionStart = start;
|
|
3965
|
+
this.inputElement.selectionEnd = end;
|
|
3966
|
+
}
|
|
3967
|
+
this.hide(e);
|
|
3968
|
+
break;
|
|
3949
3969
|
}
|
|
3950
|
-
this.hide(e);
|
|
3951
|
-
break;
|
|
3952
3970
|
default:
|
|
3953
3971
|
this.defaultAction(e);
|
|
3954
3972
|
// Fix for close the popup when select the previously selected value.
|
|
@@ -4244,7 +4262,6 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4244
4262
|
}
|
|
4245
4263
|
return modules;
|
|
4246
4264
|
};
|
|
4247
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4248
4265
|
DatePicker.prototype.selectCalendar = function (e) {
|
|
4249
4266
|
var date;
|
|
4250
4267
|
var tempFormat;
|
|
@@ -4275,16 +4292,16 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4275
4292
|
date = this.globalize.formatDate(this.changedArgs.value, formatOptions);
|
|
4276
4293
|
}
|
|
4277
4294
|
if (this.enableMask) {
|
|
4278
|
-
this.notify(
|
|
4279
|
-
module:
|
|
4295
|
+
this.notify('createMask', {
|
|
4296
|
+
module: 'MaskedDateTime'
|
|
4280
4297
|
});
|
|
4281
4298
|
}
|
|
4282
4299
|
}
|
|
4283
4300
|
if (!isNullOrUndefined(date)) {
|
|
4284
4301
|
this.updateInputValue(date);
|
|
4285
4302
|
if (this.enableMask) {
|
|
4286
|
-
this.notify(
|
|
4287
|
-
module:
|
|
4303
|
+
this.notify('setMaskSelection', {
|
|
4304
|
+
module: 'MaskedDateTime'
|
|
4288
4305
|
});
|
|
4289
4306
|
}
|
|
4290
4307
|
}
|
|
@@ -4321,7 +4338,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4321
4338
|
else {
|
|
4322
4339
|
var prevent_1 = true;
|
|
4323
4340
|
var outOfRange = void 0;
|
|
4324
|
-
if (!isNullOrUndefined(this.value) && !(+this.value >= +new Date(this.checkValue(this.min))
|
|
4341
|
+
if (!isNullOrUndefined(this.value) && !(+this.value >= +new Date(this.checkValue(this.min))
|
|
4342
|
+
&& +this.value <= +new Date(this.checkValue(this.max)))) {
|
|
4325
4343
|
outOfRange = new Date(this.checkValue(this.value));
|
|
4326
4344
|
this.setProperties({ 'value': null }, true);
|
|
4327
4345
|
}
|
|
@@ -4842,8 +4860,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4842
4860
|
this.updateInputValue(inputVal);
|
|
4843
4861
|
if (this.enableMask) {
|
|
4844
4862
|
this.updateInputValue(this.maskedDateValue);
|
|
4845
|
-
this.notify(
|
|
4846
|
-
module:
|
|
4863
|
+
this.notify('createMask', {
|
|
4864
|
+
module: 'MaskedDateTime'
|
|
4847
4865
|
});
|
|
4848
4866
|
}
|
|
4849
4867
|
}
|
|
@@ -4867,7 +4885,10 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4867
4885
|
var isDisabledDate = this.calendarElement &&
|
|
4868
4886
|
this.calendarElement.querySelectorAll(dateIdString)[0] &&
|
|
4869
4887
|
this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled');
|
|
4870
|
-
if ((!isNullOrUndefined(this.value) && !isNullOrUndefined(this.min) &&
|
|
4888
|
+
if ((!isNullOrUndefined(this.value) && !isNullOrUndefined(this.min) &&
|
|
4889
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4890
|
+
!isNullOrUndefined(this.max) && !(new Date(this.value).setMilliseconds(0) >= new Date(this.min).setMilliseconds(0)
|
|
4891
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4871
4892
|
&& new Date(this.value).setMilliseconds(0) <= new Date(this.max).setMilliseconds(0)))
|
|
4872
4893
|
|| (!this.strictMode && this.inputElement.value !== '' && this.inputElement.value !== this.maskedDateValue && isNullOrUndefined(this.value) || isDisabledDate)) {
|
|
4873
4894
|
addClass([this.inputWrapper.container], ERROR);
|
|
@@ -4898,7 +4919,12 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4898
4919
|
newProp.value = this.value;
|
|
4899
4920
|
this.previousElementValue = this.inputElement.value;
|
|
4900
4921
|
if (isNullOrUndefined(this.value)) {
|
|
4901
|
-
this.
|
|
4922
|
+
if (this.enableMask) {
|
|
4923
|
+
this.updateInputValue(this.maskedDateValue);
|
|
4924
|
+
}
|
|
4925
|
+
else {
|
|
4926
|
+
this.updateInputValue('');
|
|
4927
|
+
}
|
|
4902
4928
|
this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
|
|
4903
4929
|
}
|
|
4904
4930
|
this.updateInput(true);
|
|
@@ -4908,8 +4934,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4908
4934
|
this.isInteracted = true;
|
|
4909
4935
|
this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
|
|
4910
4936
|
if (this.enableMask) {
|
|
4911
|
-
this.notify(
|
|
4912
|
-
module:
|
|
4937
|
+
this.notify('createMask', {
|
|
4938
|
+
module: 'MaskedDateTime'
|
|
4913
4939
|
});
|
|
4914
4940
|
}
|
|
4915
4941
|
break;
|
|
@@ -4918,8 +4944,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4918
4944
|
this.bindInputEvent();
|
|
4919
4945
|
this.updateInput();
|
|
4920
4946
|
if (this.enableMask) {
|
|
4921
|
-
this.notify(
|
|
4922
|
-
module:
|
|
4947
|
+
this.notify('createMask', {
|
|
4948
|
+
module: 'MaskedDateTime'
|
|
4923
4949
|
});
|
|
4924
4950
|
if (!this.value) {
|
|
4925
4951
|
this.updateInputValue(this.maskedDateValue);
|
|
@@ -4951,8 +4977,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4951
4977
|
Input.setPlaceholder(this.placeholder, this.inputElement);
|
|
4952
4978
|
this.updateInput();
|
|
4953
4979
|
if (this.enableMask) {
|
|
4954
|
-
this.notify(
|
|
4955
|
-
module:
|
|
4980
|
+
this.notify('createMask', {
|
|
4981
|
+
module: 'MaskedDateTime'
|
|
4956
4982
|
});
|
|
4957
4983
|
}
|
|
4958
4984
|
break;
|
|
@@ -4998,8 +5024,8 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
4998
5024
|
break;
|
|
4999
5025
|
case 'enableMask':
|
|
5000
5026
|
if (this.enableMask) {
|
|
5001
|
-
this.notify(
|
|
5002
|
-
module:
|
|
5027
|
+
this.notify('createMask', {
|
|
5028
|
+
module: 'MaskedDateTime'
|
|
5003
5029
|
});
|
|
5004
5030
|
this.updateInputValue(this.maskedDateValue);
|
|
5005
5031
|
this.bindInputEvent();
|
|
@@ -5277,7 +5303,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
5277
5303
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
|
|
5278
5304
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
5279
5305
|
}
|
|
5280
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
5306
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
5281
5307
|
this.enabled = false;
|
|
5282
5308
|
}
|
|
5283
5309
|
this.renderComplete();
|
|
@@ -5479,7 +5505,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
5479
5505
|
var attributes$$1 = {};
|
|
5480
5506
|
if (!isDynamic) {
|
|
5481
5507
|
for (var i = 0; i < this.element.attributes.length; i++) {
|
|
5482
|
-
attributes$$1[this.element.attributes[i].name] =
|
|
5508
|
+
attributes$$1[this.element.attributes[i].name] =
|
|
5509
|
+
this.element.getAttribute(this.element.attributes[i].name);
|
|
5483
5510
|
}
|
|
5484
5511
|
}
|
|
5485
5512
|
else {
|
|
@@ -5912,7 +5939,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
5912
5939
|
this.createControl();
|
|
5913
5940
|
this.bindCalendarEvents();
|
|
5914
5941
|
this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
|
|
5915
|
-
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
5942
|
+
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
5943
|
+
!isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
|
|
5916
5944
|
this.disabledDateRender();
|
|
5917
5945
|
}
|
|
5918
5946
|
this.updateHeader();
|
|
@@ -6158,6 +6186,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
6158
6186
|
}
|
|
6159
6187
|
this.updateHiddenInput();
|
|
6160
6188
|
};
|
|
6189
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
6161
6190
|
DateRangePicker.prototype.getStartEndDate = function (date, isEnd, range, dateOptions) {
|
|
6162
6191
|
if (this.depth === 'Month') {
|
|
6163
6192
|
return this.globalize.parseDate(range[isEnd ? 1 : 0].trim(), dateOptions);
|
|
@@ -6547,7 +6576,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
6547
6576
|
var isLeftYear = leftHeader ? leftHeader.classList.contains('e-year') : false;
|
|
6548
6577
|
var isRightDecade = rightHeader ? rightHeader.classList.contains('e-decade') : false;
|
|
6549
6578
|
var isLeftDecade = leftHeader ? leftHeader.classList.contains('e-decade') : false;
|
|
6550
|
-
return isLeftCalendar && (isLeftMonth || isLeftYear || isLeftDecade) &&
|
|
6579
|
+
return isLeftCalendar && (isLeftMonth || isLeftYear || isLeftDecade) &&
|
|
6580
|
+
(isRightMonth || isRightYear || isRightDecade) && !this.isMobile;
|
|
6551
6581
|
};
|
|
6552
6582
|
DateRangePicker.prototype.keyNavigation = function (calendar, e) {
|
|
6553
6583
|
this.bindCalendarCellEvents(calendar);
|
|
@@ -8507,7 +8537,8 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
8507
8537
|
if (!this.strictMode && (isDisabled)) {
|
|
8508
8538
|
this.clearRange();
|
|
8509
8539
|
}
|
|
8510
|
-
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
8540
|
+
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue) &&
|
|
8541
|
+
!isDisabled && !isNullOrUndefined(this.renderDayCellArgs) && this.renderDayCellArgs.isDisabled) {
|
|
8511
8542
|
this.disabledDateRender();
|
|
8512
8543
|
}
|
|
8513
8544
|
this.errorClass();
|
|
@@ -9254,6 +9285,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9254
9285
|
this.updateHeader();
|
|
9255
9286
|
}
|
|
9256
9287
|
};
|
|
9288
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
9257
9289
|
DateRangePicker.prototype.getStartEndValue = function (date, isEnd) {
|
|
9258
9290
|
if (this.depth === 'Month') {
|
|
9259
9291
|
return this.checkDateValue(new Date(this.checkValue(date)));
|
|
@@ -9809,7 +9841,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9809
9841
|
this.bindEvents();
|
|
9810
9842
|
this.validateDisable();
|
|
9811
9843
|
this.setValue(this.getFormattedValue(this.value));
|
|
9812
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType
|
|
9844
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType === 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
9813
9845
|
this.updateInputValue(this.maskedDateValue);
|
|
9814
9846
|
this.checkErrorState(this.maskedDateValue);
|
|
9815
9847
|
}
|
|
@@ -9819,7 +9851,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9819
9851
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
|
|
9820
9852
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
9821
9853
|
}
|
|
9822
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
9854
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
9823
9855
|
this.enabled = false;
|
|
9824
9856
|
}
|
|
9825
9857
|
this.renderComplete();
|
|
@@ -9920,8 +9952,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
9920
9952
|
attributes(this.inputElement, { 'name': this.element.id });
|
|
9921
9953
|
}
|
|
9922
9954
|
if (this.enableMask) {
|
|
9923
|
-
this.notify(
|
|
9924
|
-
module:
|
|
9955
|
+
this.notify('createMask', {
|
|
9956
|
+
module: 'MaskedDateTime'
|
|
9925
9957
|
});
|
|
9926
9958
|
}
|
|
9927
9959
|
};
|
|
@@ -10270,7 +10302,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10270
10302
|
};
|
|
10271
10303
|
TimePicker.prototype.checkErrorState = function (val) {
|
|
10272
10304
|
var value = this.getDateObject(val);
|
|
10273
|
-
if ((this.validateState(value) && !this.invalidValueString) ||
|
|
10305
|
+
if ((this.validateState(value) && !this.invalidValueString) ||
|
|
10306
|
+
(this.enableMask && this.inputElement.value === this.maskedDateValue)) {
|
|
10274
10307
|
this.removeErrorClass();
|
|
10275
10308
|
}
|
|
10276
10309
|
else {
|
|
@@ -10518,8 +10551,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10518
10551
|
event.preventDefault();
|
|
10519
10552
|
if (this.enableMask) {
|
|
10520
10553
|
event.preventDefault();
|
|
10521
|
-
this.notify(
|
|
10522
|
-
module:
|
|
10554
|
+
this.notify('setMaskSelection', {
|
|
10555
|
+
module: 'MaskedDateTime'
|
|
10523
10556
|
});
|
|
10524
10557
|
return;
|
|
10525
10558
|
}
|
|
@@ -10582,8 +10615,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10582
10615
|
case 'down':
|
|
10583
10616
|
if (this.enableMask && !this.readonly && !this.isPopupOpen()) {
|
|
10584
10617
|
event.preventDefault();
|
|
10585
|
-
this.notify(
|
|
10586
|
-
module:
|
|
10618
|
+
this.notify('keyDownHandler', {
|
|
10619
|
+
module: 'MaskedDateTime',
|
|
10587
10620
|
e: event
|
|
10588
10621
|
});
|
|
10589
10622
|
}
|
|
@@ -10628,12 +10661,12 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10628
10661
|
case 'tab':
|
|
10629
10662
|
case 'shiftTab':
|
|
10630
10663
|
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
|
|
10664
|
+
if ((this.inputElement.selectionStart === 0 && this.inputElement.selectionEnd === this.inputElement.value.length) ||
|
|
10665
|
+
(this.inputElement.selectionEnd !== this.inputElement.value.length && event.action === 'tab') ||
|
|
10666
|
+
(this.inputElement.selectionStart !== 0 && event.action === 'shiftTab') || (event.action === 'left' || event.action === 'right')) {
|
|
10634
10667
|
event.preventDefault();
|
|
10635
10668
|
}
|
|
10636
|
-
this.notify(
|
|
10669
|
+
this.notify('keyDownHandler', { module: 'MaskedDateTime',
|
|
10637
10670
|
e: event
|
|
10638
10671
|
});
|
|
10639
10672
|
}
|
|
@@ -10897,8 +10930,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10897
10930
|
switch (e.code) {
|
|
10898
10931
|
case 'Delete':
|
|
10899
10932
|
if (this.enableMask && !this.popupObj && !this.readonly) {
|
|
10900
|
-
this.notify(
|
|
10901
|
-
module:
|
|
10933
|
+
this.notify('keyDownHandler', {
|
|
10934
|
+
module: 'MaskedDateTime',
|
|
10902
10935
|
e: e
|
|
10903
10936
|
});
|
|
10904
10937
|
}
|
|
@@ -10944,8 +10977,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10944
10977
|
};
|
|
10945
10978
|
TimePicker.prototype.inputEventHandler = function () {
|
|
10946
10979
|
if (this.enableMask) {
|
|
10947
|
-
this.notify(
|
|
10948
|
-
module:
|
|
10980
|
+
this.notify('inputHandler', {
|
|
10981
|
+
module: 'MaskedDateTime'
|
|
10949
10982
|
});
|
|
10950
10983
|
}
|
|
10951
10984
|
};
|
|
@@ -10995,8 +11028,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
10995
11028
|
this.popupWrapper.scrollTop = 0;
|
|
10996
11029
|
}
|
|
10997
11030
|
if (this.enableMask) {
|
|
10998
|
-
this.notify(
|
|
10999
|
-
module:
|
|
11031
|
+
this.notify('clearHandler', {
|
|
11032
|
+
module: 'MaskedDateTime'
|
|
11000
11033
|
});
|
|
11001
11034
|
}
|
|
11002
11035
|
if (closest(this.element, 'form')) {
|
|
@@ -11123,10 +11156,10 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11123
11156
|
if (!inputVal) {
|
|
11124
11157
|
this.updateInputValue(this.maskedDateValue);
|
|
11125
11158
|
}
|
|
11126
|
-
if (isNullOrUndefined(val) && value
|
|
11159
|
+
if (isNullOrUndefined(val) && value !== this.maskedDateValue) {
|
|
11127
11160
|
this.createMask();
|
|
11128
11161
|
}
|
|
11129
|
-
if (isNullOrUndefined(val) && value
|
|
11162
|
+
if (isNullOrUndefined(val) && value === this.maskedDateValue) {
|
|
11130
11163
|
this.updateInputValue(this.maskedDateValue);
|
|
11131
11164
|
}
|
|
11132
11165
|
}
|
|
@@ -11198,13 +11231,13 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11198
11231
|
else {
|
|
11199
11232
|
this.updateInputValue(time);
|
|
11200
11233
|
if (this.enableMask) {
|
|
11201
|
-
if (time
|
|
11234
|
+
if (time === '') {
|
|
11202
11235
|
this.updateInputValue(this.maskedDateValue);
|
|
11203
11236
|
}
|
|
11204
|
-
if (isNullOrUndefined(time) && value
|
|
11237
|
+
if (isNullOrUndefined(time) && value !== this.maskedDateValue) {
|
|
11205
11238
|
this.createMask();
|
|
11206
11239
|
}
|
|
11207
|
-
if (isNullOrUndefined(time) && value
|
|
11240
|
+
if (isNullOrUndefined(time) && value === this.maskedDateValue) {
|
|
11208
11241
|
this.updateInputValue(this.maskedDateValue);
|
|
11209
11242
|
}
|
|
11210
11243
|
}
|
|
@@ -11212,8 +11245,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11212
11245
|
return time;
|
|
11213
11246
|
};
|
|
11214
11247
|
TimePicker.prototype.createMask = function () {
|
|
11215
|
-
this.notify(
|
|
11216
|
-
module:
|
|
11248
|
+
this.notify('createMask', {
|
|
11249
|
+
module: 'MaskedDateTime'
|
|
11217
11250
|
});
|
|
11218
11251
|
};
|
|
11219
11252
|
TimePicker.prototype.findNextElement = function (event) {
|
|
@@ -11324,7 +11357,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11324
11357
|
return elementIndex;
|
|
11325
11358
|
};
|
|
11326
11359
|
TimePicker.prototype.keyHandler = function (event) {
|
|
11327
|
-
if (isNullOrUndefined(this.step) || this.step <= 0 || !isNullOrUndefined(this.inputWrapper)
|
|
11360
|
+
if (isNullOrUndefined(this.step) || this.step <= 0 || !isNullOrUndefined(this.inputWrapper)
|
|
11361
|
+
&& this.inputWrapper.buttons[0].classList.contains(DISABLED$3)) {
|
|
11328
11362
|
return;
|
|
11329
11363
|
}
|
|
11330
11364
|
var count = this.timeCollections.length;
|
|
@@ -11352,7 +11386,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11352
11386
|
this.activeIndex = index = this.activeIndex < 0 ? (count - 1) : this.activeIndex;
|
|
11353
11387
|
this.activeIndex = index = this.validLiElement(this.activeIndex, (event.keyCode === 40 || event.keyCode === 39) ?
|
|
11354
11388
|
false : true);
|
|
11355
|
-
nextItem = isNullOrUndefined(this.timeCollections[index]) ?
|
|
11389
|
+
nextItem = isNullOrUndefined(this.timeCollections[index]) ?
|
|
11390
|
+
this.timeCollections[0] : this.timeCollections[index];
|
|
11356
11391
|
}
|
|
11357
11392
|
else if (event.action === 'home') {
|
|
11358
11393
|
var index = this.validLiElement(0);
|
|
@@ -11641,7 +11676,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11641
11676
|
}
|
|
11642
11677
|
this.closePopup(0, e);
|
|
11643
11678
|
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
11644
|
-
if (this.inputElement.value
|
|
11679
|
+
if (this.inputElement.value === this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
11645
11680
|
this.updateInputValue('');
|
|
11646
11681
|
}
|
|
11647
11682
|
}
|
|
@@ -11694,7 +11729,7 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11694
11729
|
this.selectInputText();
|
|
11695
11730
|
}
|
|
11696
11731
|
if (this.enableMask && !this.inputElement.value && this.placeholder) {
|
|
11697
|
-
if (this.maskedDateValue && !this.value && (this.floatLabelType
|
|
11732
|
+
if (this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
11698
11733
|
this.updateInputValue(this.maskedDateValue);
|
|
11699
11734
|
this.inputElement.selectionStart = 0;
|
|
11700
11735
|
this.inputElement.selectionEnd = this.inputElement.value.length;
|
|
@@ -11940,8 +11975,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11940
11975
|
this.updatePlaceHolder();
|
|
11941
11976
|
this.setValue(this.value);
|
|
11942
11977
|
if (this.enableMask) {
|
|
11943
|
-
this.notify(
|
|
11944
|
-
module:
|
|
11978
|
+
this.notify('createMask', {
|
|
11979
|
+
module: 'MaskedDateTime'
|
|
11945
11980
|
});
|
|
11946
11981
|
}
|
|
11947
11982
|
break;
|
|
@@ -11993,8 +12028,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
11993
12028
|
this.preventChange = false;
|
|
11994
12029
|
}
|
|
11995
12030
|
if (this.enableMask) {
|
|
11996
|
-
this.notify(
|
|
11997
|
-
module:
|
|
12031
|
+
this.notify('createMask', {
|
|
12032
|
+
module: 'MaskedDateTime'
|
|
11998
12033
|
});
|
|
11999
12034
|
}
|
|
12000
12035
|
break;
|
|
@@ -12028,8 +12063,8 @@ var TimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12028
12063
|
break;
|
|
12029
12064
|
case 'enableMask':
|
|
12030
12065
|
if (this.enableMask) {
|
|
12031
|
-
this.notify(
|
|
12032
|
-
module:
|
|
12066
|
+
this.notify('createMask', {
|
|
12067
|
+
module: 'MaskedDateTime'
|
|
12033
12068
|
});
|
|
12034
12069
|
this.updateInputValue(this.maskedDateValue);
|
|
12035
12070
|
}
|
|
@@ -12346,7 +12381,7 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12346
12381
|
this.cloneElement = this.element.cloneNode(true);
|
|
12347
12382
|
this.dateTimeFormat = this.cldrDateTimeFormat();
|
|
12348
12383
|
this.initValue = this.value;
|
|
12349
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
12384
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
12350
12385
|
this.enabled = false;
|
|
12351
12386
|
}
|
|
12352
12387
|
_super.prototype.updateHtmlAttributeToElement.call(this);
|
|
@@ -12359,12 +12394,12 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12359
12394
|
_super.prototype.updateHtmlAttributeToWrapper.call(this);
|
|
12360
12395
|
this.bindInputEvents();
|
|
12361
12396
|
if (this.enableMask) {
|
|
12362
|
-
this.notify(
|
|
12363
|
-
module:
|
|
12397
|
+
this.notify('createMask', {
|
|
12398
|
+
module: 'MaskedDateTime'
|
|
12364
12399
|
});
|
|
12365
12400
|
}
|
|
12366
12401
|
this.setValue(true);
|
|
12367
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType
|
|
12402
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType === 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
12368
12403
|
Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
12369
12404
|
}
|
|
12370
12405
|
this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkValue(this.scrollTo))) }, true);
|
|
@@ -12539,7 +12574,6 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12539
12574
|
}
|
|
12540
12575
|
return cldrTime;
|
|
12541
12576
|
};
|
|
12542
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12543
12577
|
DateTimePicker.prototype.getCldrFormat = function (type) {
|
|
12544
12578
|
var cldrDateTime;
|
|
12545
12579
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
@@ -12558,7 +12592,6 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12558
12592
|
return false;
|
|
12559
12593
|
}
|
|
12560
12594
|
};
|
|
12561
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12562
12595
|
DateTimePicker.prototype.getCultureTimeObject = function (ld, c) {
|
|
12563
12596
|
if (this.calendarMode === 'Gregorian') {
|
|
12564
12597
|
return getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld);
|
|
@@ -12656,8 +12689,7 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12656
12689
|
});
|
|
12657
12690
|
}
|
|
12658
12691
|
var value = isNullOrUndefined(this.value) ? this.inputElement.value !== '' ?
|
|
12659
|
-
dateObject :
|
|
12660
|
-
new Date() : this.value;
|
|
12692
|
+
dateObject : new Date() : this.value;
|
|
12661
12693
|
this.valueWithMinutes = value;
|
|
12662
12694
|
this.listWrapper = createElement('div', { className: CONTENT$3, attrs: { 'tabindex': '0' } });
|
|
12663
12695
|
var min = this.startTime(value);
|
|
@@ -12952,8 +12984,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
12952
12984
|
return this.validateMinMaxRange(value);
|
|
12953
12985
|
};
|
|
12954
12986
|
DateTimePicker.prototype.createMask = function () {
|
|
12955
|
-
this.notify(
|
|
12956
|
-
module:
|
|
12987
|
+
this.notify('createMask', {
|
|
12988
|
+
module: 'MaskedDateTime'
|
|
12957
12989
|
});
|
|
12958
12990
|
};
|
|
12959
12991
|
DateTimePicker.prototype.combineDateTime = function (value) {
|
|
@@ -13407,7 +13439,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13407
13439
|
var index = (event.keyCode === 40 || event.keyCode === 39) ? ++this.activeIndex : --this.activeIndex;
|
|
13408
13440
|
this.activeIndex = index = this.activeIndex === (listCount) ? 0 : this.activeIndex;
|
|
13409
13441
|
this.activeIndex = index = this.activeIndex < 0 ? (listCount - 1) : this.activeIndex;
|
|
13410
|
-
nextItemValue = isNullOrUndefined(this.timeCollections[index]) ?
|
|
13442
|
+
nextItemValue = isNullOrUndefined(this.timeCollections[index]) ?
|
|
13443
|
+
this.timeCollections[0] : this.timeCollections[index];
|
|
13411
13444
|
}
|
|
13412
13445
|
else if (event.action === 'home') {
|
|
13413
13446
|
this.activeIndex = 0;
|
|
@@ -13505,8 +13538,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13505
13538
|
this.changeTrigger(null);
|
|
13506
13539
|
this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
|
|
13507
13540
|
if (this.enableMask && this.value) {
|
|
13508
|
-
this.notify(
|
|
13509
|
-
module:
|
|
13541
|
+
this.notify('createMask', {
|
|
13542
|
+
module: 'MaskedDateTime'
|
|
13510
13543
|
});
|
|
13511
13544
|
}
|
|
13512
13545
|
break;
|
|
@@ -13549,8 +13582,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13549
13582
|
this.dateTimeFormat = this.formatString;
|
|
13550
13583
|
this.setValue();
|
|
13551
13584
|
if (this.enableMask) {
|
|
13552
|
-
this.notify(
|
|
13553
|
-
module:
|
|
13585
|
+
this.notify('createMask', {
|
|
13586
|
+
module: 'MaskedDateTime'
|
|
13554
13587
|
});
|
|
13555
13588
|
if (!this.value) {
|
|
13556
13589
|
Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
@@ -13601,8 +13634,8 @@ var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
13601
13634
|
break;
|
|
13602
13635
|
case 'enableMask':
|
|
13603
13636
|
if (this.enableMask) {
|
|
13604
|
-
this.notify(
|
|
13605
|
-
module:
|
|
13637
|
+
this.notify('createMask', {
|
|
13638
|
+
module: 'MaskedDateTime'
|
|
13606
13639
|
});
|
|
13607
13640
|
Input.setValue(this.maskedDateValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
13608
13641
|
}
|
|
@@ -13770,7 +13803,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13770
13803
|
hour: 'hour',
|
|
13771
13804
|
minute: 'minute',
|
|
13772
13805
|
second: 'second',
|
|
13773
|
-
dayOfTheWeek: 'day of the week'
|
|
13806
|
+
dayOfTheWeek: 'day of the week'
|
|
13774
13807
|
};
|
|
13775
13808
|
this.hiddenMask = '';
|
|
13776
13809
|
this.validCharacters = 'dMyhmHfasz';
|
|
@@ -13837,20 +13870,27 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13837
13870
|
if (navigated === void 0) { navigated = false; }
|
|
13838
13871
|
this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = false;
|
|
13839
13872
|
this.dateformat = this.getCulturedFormat();
|
|
13840
|
-
if (this.parent.maskPlaceholder.day)
|
|
13873
|
+
if (this.parent.maskPlaceholder.day) {
|
|
13841
13874
|
this.defaultConstant['day'] = this.parent.maskPlaceholder.day;
|
|
13842
|
-
|
|
13875
|
+
}
|
|
13876
|
+
if (this.parent.maskPlaceholder.month) {
|
|
13843
13877
|
this.defaultConstant['month'] = this.parent.maskPlaceholder.month;
|
|
13844
|
-
|
|
13878
|
+
}
|
|
13879
|
+
if (this.parent.maskPlaceholder.year) {
|
|
13845
13880
|
this.defaultConstant['year'] = this.parent.maskPlaceholder.year;
|
|
13846
|
-
|
|
13881
|
+
}
|
|
13882
|
+
if (this.parent.maskPlaceholder.hour) {
|
|
13847
13883
|
this.defaultConstant['hour'] = this.parent.maskPlaceholder.hour;
|
|
13848
|
-
|
|
13884
|
+
}
|
|
13885
|
+
if (this.parent.maskPlaceholder.minute) {
|
|
13849
13886
|
this.defaultConstant['minute'] = this.parent.maskPlaceholder.minute;
|
|
13850
|
-
|
|
13887
|
+
}
|
|
13888
|
+
if (this.parent.maskPlaceholder.second) {
|
|
13851
13889
|
this.defaultConstant['second'] = this.parent.maskPlaceholder.second;
|
|
13852
|
-
|
|
13890
|
+
}
|
|
13891
|
+
if (this.parent.maskPlaceholder.dayOfTheWeek) {
|
|
13853
13892
|
this.defaultConstant['dayOfTheWeek'] = this.parent.maskPlaceholder.dayOfTheWeek.toString();
|
|
13893
|
+
}
|
|
13854
13894
|
this.getCUltureMaskFormat();
|
|
13855
13895
|
var inputValue = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
13856
13896
|
this.isHiddenMask = true;
|
|
@@ -13868,7 +13908,8 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13868
13908
|
this.l10n = new L10n(this.parent.moduleName, this.defaultConstant, this.parent.locale);
|
|
13869
13909
|
this.objectString = Object.keys(this.defaultConstant);
|
|
13870
13910
|
for (var i = 0; i < this.objectString.length; i++) {
|
|
13871
|
-
this.defaultConstant[this.objectString[i].toString()] =
|
|
13911
|
+
this.defaultConstant[this.objectString[i].toString()] =
|
|
13912
|
+
this.l10n.getConstant(this.objectString[i].toString());
|
|
13872
13913
|
}
|
|
13873
13914
|
};
|
|
13874
13915
|
MaskedDateTime.prototype.validCharacterCheck = function () {
|
|
@@ -13888,7 +13929,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13888
13929
|
this.maskDateValue = new Date(+this.parent.value);
|
|
13889
13930
|
this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = true;
|
|
13890
13931
|
this.updateValue();
|
|
13891
|
-
// this.parent.inputElement.selectionStart = start;
|
|
13892
13932
|
this.validCharacterCheck();
|
|
13893
13933
|
};
|
|
13894
13934
|
MaskedDateTime.prototype.setSelection = function (validChar) {
|
|
@@ -13913,12 +13953,13 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13913
13953
|
this.isDeleteKey = true;
|
|
13914
13954
|
return;
|
|
13915
13955
|
}
|
|
13916
|
-
if ((!args.e.altKey && !args.e.ctrlKey) && (args.e.key === ARROWLEFT || args.e.key === ARROWRIGHT
|
|
13956
|
+
if ((!args.e.altKey && !args.e.ctrlKey) && (args.e.key === ARROWLEFT || args.e.key === ARROWRIGHT
|
|
13957
|
+
|| args.e.key === SHIFTTAB || args.e.key === TAB || args.e.action === SHIFTTAB ||
|
|
13917
13958
|
args.e.key === END || args.e.key === HOME)) {
|
|
13918
13959
|
var start = this.parent.inputElement.selectionStart;
|
|
13919
13960
|
var end = this.parent.inputElement.selectionEnd;
|
|
13920
13961
|
var length_1 = this.parent.inputElement.value.length;
|
|
13921
|
-
if ((start
|
|
13962
|
+
if ((start === 0 && end === length_1) && (args.e.key === TAB || args.e.action === SHIFTTAB)) {
|
|
13922
13963
|
var index = args.e.action === SHIFTTAB ? end : 0;
|
|
13923
13964
|
this.parent.inputElement.selectionStart = this.parent.inputElement.selectionEnd = index;
|
|
13924
13965
|
}
|
|
@@ -13963,7 +14004,8 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13963
14004
|
var newVal = inputValue.substring(0, start);
|
|
13964
14005
|
var newDateValue = new Date(+this.maskDateValue);
|
|
13965
14006
|
var maxDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth() + 1, 0).getDate();
|
|
13966
|
-
if (previousVal.indexOf(newVal) === 0 && (newVal.length === 0 ||
|
|
14007
|
+
if (previousVal.indexOf(newVal) === 0 && (newVal.length === 0 ||
|
|
14008
|
+
this.previousHiddenMask[newVal.length - 1] !== this.previousHiddenMask[newVal.length])) {
|
|
13967
14009
|
for (var i = newVal.length; i < previousVal.length; i++) {
|
|
13968
14010
|
if (this.previousHiddenMask[i] !== '' && this.validCharacters.indexOf(this.previousHiddenMask[i]) >= 0) {
|
|
13969
14011
|
this.isDeletion = this.handleDeletion(this.previousHiddenMask[i], false);
|
|
@@ -13975,114 +14017,123 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
13975
14017
|
}
|
|
13976
14018
|
switch (this.previousHiddenMask[start - 1]) {
|
|
13977
14019
|
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()) {
|
|
14020
|
+
{
|
|
14021
|
+
var date = (this.isDayPart && newDateValue.getDate().toString().length < 2 &&
|
|
14022
|
+
!this.isPersist() ? newDateValue.getDate() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14023
|
+
this.isDateZero = (newVal[start - 1] === '0');
|
|
14024
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14025
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14026
|
+
if (isNaN(date)) {
|
|
13993
14027
|
return;
|
|
13994
14028
|
}
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14029
|
+
for (var i = 0; date > maxDate; i++) {
|
|
14030
|
+
date = parseInt(date.toString().slice(1), 10);
|
|
14031
|
+
}
|
|
14032
|
+
if (date >= 1) {
|
|
14033
|
+
newDateValue.setDate(date);
|
|
14034
|
+
this.isNavigate = date.toString().length === 2;
|
|
14035
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14036
|
+
if (newDateValue.getMonth() !== this.maskDateValue.getMonth()) {
|
|
14037
|
+
return;
|
|
14038
|
+
}
|
|
14039
|
+
this.isDayPart = true;
|
|
14040
|
+
this.dayTypeCount = this.dayTypeCount + 1;
|
|
14041
|
+
}
|
|
14042
|
+
else {
|
|
14043
|
+
this.isDayPart = false;
|
|
14044
|
+
this.dayTypeCount = this.isDateZero ? this.dayTypeCount + 1 : this.dayTypeCount;
|
|
14045
|
+
}
|
|
14046
|
+
break;
|
|
14001
14047
|
}
|
|
14002
|
-
break;
|
|
14003
14048
|
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);
|
|
14049
|
+
{
|
|
14050
|
+
var month = void 0;
|
|
14051
|
+
if (newDateValue.getMonth().toString().length < 2 && !this.isPersist()) {
|
|
14052
|
+
month = (this.isMonthPart ? (newDateValue.getMonth() + 1) * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14053
|
+
}
|
|
14054
|
+
else {
|
|
14055
|
+
month = parseInt(newVal[start - 1], 10);
|
|
14056
|
+
}
|
|
14057
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14058
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14059
|
+
this.isMonthZero = (newVal[start - 1] === '0');
|
|
14060
|
+
if (!isNaN(month)) {
|
|
14061
|
+
while (month > 12) {
|
|
14062
|
+
month = parseInt(month.toString().slice(1), 10);
|
|
14024
14063
|
}
|
|
14025
|
-
if (
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
if (
|
|
14029
|
-
newDateValue.setDate(
|
|
14064
|
+
if (month >= 1) {
|
|
14065
|
+
newDateValue.setMonth(month - 1);
|
|
14066
|
+
this.isNavigate = month.toString().length === 2;
|
|
14067
|
+
if (newDateValue.getMonth() !== month - 1) {
|
|
14068
|
+
newDateValue.setDate(1);
|
|
14069
|
+
newDateValue.setMonth(month - 1);
|
|
14070
|
+
}
|
|
14071
|
+
if (this.isDayPart) {
|
|
14072
|
+
var previousMaxDate = new Date(this.previousDate.getFullYear(), this.previousDate.getMonth() + 1, 0).getDate();
|
|
14073
|
+
var currentMaxDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth() + 1, 0).getDate();
|
|
14074
|
+
if (this.previousDate.getDate() === previousMaxDate && currentMaxDate <= previousMaxDate) {
|
|
14075
|
+
newDateValue.setDate(currentMaxDate);
|
|
14076
|
+
}
|
|
14030
14077
|
}
|
|
14078
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14079
|
+
this.isMonthPart = true;
|
|
14080
|
+
this.monthTypeCount = this.monthTypeCount + 1;
|
|
14081
|
+
}
|
|
14082
|
+
else {
|
|
14083
|
+
newDateValue.setMonth(0);
|
|
14084
|
+
this.isMonthPart = false;
|
|
14085
|
+
this.monthTypeCount = this.isMonthZero ? this.monthTypeCount + 1 : this.monthTypeCount;
|
|
14031
14086
|
}
|
|
14032
|
-
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14033
|
-
this.isMonthPart = true;
|
|
14034
|
-
this.monthTypeCount = this.monthTypeCount + 1;
|
|
14035
14087
|
}
|
|
14036
14088
|
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;
|
|
14089
|
+
var monthString = (this.getCulturedValue('months[stand-alone].wide'));
|
|
14090
|
+
var monthValue = Object.keys(monthString);
|
|
14091
|
+
this.monthCharacter += newVal[start - 1].toLowerCase();
|
|
14092
|
+
while (this.monthCharacter.length > 0) {
|
|
14093
|
+
var i = 1;
|
|
14094
|
+
for (var _i = 0, monthValue_1 = monthValue; _i < monthValue_1.length; _i++) {
|
|
14095
|
+
var months = monthValue_1[_i];
|
|
14096
|
+
if (monthString[i].toLowerCase().indexOf(this.monthCharacter) === 0) {
|
|
14097
|
+
newDateValue.setMonth(i - 1);
|
|
14098
|
+
this.isMonthPart = true;
|
|
14099
|
+
this.maskDateValue = newDateValue;
|
|
14100
|
+
return;
|
|
14101
|
+
}
|
|
14102
|
+
i++;
|
|
14055
14103
|
}
|
|
14056
|
-
|
|
14104
|
+
this.monthCharacter = this.monthCharacter.substring(1, this.monthCharacter.length);
|
|
14057
14105
|
}
|
|
14058
|
-
this.monthCharacter = this.monthCharacter.substring(1, this.monthCharacter.length);
|
|
14059
14106
|
}
|
|
14107
|
+
break;
|
|
14060
14108
|
}
|
|
14061
|
-
break;
|
|
14062
14109
|
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;
|
|
14110
|
+
{
|
|
14111
|
+
var year = (this.isYearPart && (newDateValue.getFullYear().toString().length < 4
|
|
14112
|
+
&& !this.isShortYear) ? newDateValue.getFullYear() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14113
|
+
this.isShortYear = false;
|
|
14114
|
+
this.isYearZero = (newVal[start - 1] === '0');
|
|
14115
|
+
if (isNaN(year)) {
|
|
14116
|
+
return;
|
|
14079
14117
|
}
|
|
14080
|
-
|
|
14081
|
-
|
|
14118
|
+
while (year > 9999) {
|
|
14119
|
+
year = parseInt(year.toString().slice(1), 10);
|
|
14120
|
+
}
|
|
14121
|
+
if (year < 1) {
|
|
14122
|
+
this.isYearPart = false;
|
|
14123
|
+
}
|
|
14124
|
+
else {
|
|
14125
|
+
newDateValue.setFullYear(year);
|
|
14126
|
+
if (year.toString().length === 4) {
|
|
14127
|
+
this.isNavigate = true;
|
|
14128
|
+
}
|
|
14129
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14130
|
+
this.isYearPart = true;
|
|
14131
|
+
}
|
|
14132
|
+
break;
|
|
14082
14133
|
}
|
|
14083
|
-
break;
|
|
14084
14134
|
case 'h':
|
|
14085
|
-
this.hour = (this.isHourPart && (newDateValue.getHours() % 12 || 12).toString().length < 2
|
|
14135
|
+
this.hour = (this.isHourPart && (newDateValue.getHours() % 12 || 12).toString().length < 2
|
|
14136
|
+
&& !this.isPersist() ? (newDateValue.getHours() % 12 || 12) * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14086
14137
|
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14087
14138
|
this.navigated = this.navigated ? false : this.navigated;
|
|
14088
14139
|
if (isNaN(this.hour)) {
|
|
@@ -14097,7 +14148,8 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14097
14148
|
this.hourTypeCount = this.hourTypeCount + 1;
|
|
14098
14149
|
break;
|
|
14099
14150
|
case 'H':
|
|
14100
|
-
this.hour = (this.isHourPart && newDateValue.getHours().toString().length < 2 &&
|
|
14151
|
+
this.hour = (this.isHourPart && newDateValue.getHours().toString().length < 2 &&
|
|
14152
|
+
!this.isPersist() ? newDateValue.getHours() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14101
14153
|
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14102
14154
|
this.navigated = this.navigated ? false : this.navigated;
|
|
14103
14155
|
if (isNaN(this.hour)) {
|
|
@@ -14112,67 +14164,81 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14112
14164
|
this.hourTypeCount = this.hourTypeCount + 1;
|
|
14113
14165
|
break;
|
|
14114
14166
|
case 'm':
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14167
|
+
{
|
|
14168
|
+
var minutes = (this.isMinutePart && newDateValue.getMinutes().toString().length < 2
|
|
14169
|
+
&& !this.isPersist() ? newDateValue.getMinutes() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14170
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14171
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14172
|
+
if (isNaN(minutes)) {
|
|
14173
|
+
return;
|
|
14174
|
+
}
|
|
14175
|
+
for (var i = 0; minutes > 59; i++) {
|
|
14176
|
+
minutes = parseInt(minutes.toString().slice(1), 10);
|
|
14177
|
+
}
|
|
14178
|
+
newDateValue.setMinutes(minutes);
|
|
14179
|
+
this.isNavigate = minutes.toString().length === 2;
|
|
14180
|
+
this.isMinutePart = true;
|
|
14181
|
+
this.minuteTypeCount = this.minuteTypeCount + 1;
|
|
14182
|
+
break;
|
|
14123
14183
|
}
|
|
14124
|
-
newDateValue.setMinutes(minutes);
|
|
14125
|
-
this.isNavigate = minutes.toString().length === 2;
|
|
14126
|
-
this.isMinutePart = true;
|
|
14127
|
-
this.minuteTypeCount = this.minuteTypeCount + 1;
|
|
14128
|
-
break;
|
|
14129
14184
|
case 's':
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
|
|
14185
|
+
{
|
|
14186
|
+
var seconds = (this.isSecondsPart && newDateValue.getSeconds().toString().length < 2 &&
|
|
14187
|
+
!this.isPersist() ? newDateValue.getSeconds() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14188
|
+
this.parent.isFocused = this.parent.isFocused ? false : this.parent.isFocused;
|
|
14189
|
+
this.navigated = this.navigated ? false : this.navigated;
|
|
14190
|
+
if (isNaN(seconds)) {
|
|
14191
|
+
return;
|
|
14192
|
+
}
|
|
14193
|
+
for (var i = 0; seconds > 59; i++) {
|
|
14194
|
+
seconds = parseInt(seconds.toString().slice(1), 10);
|
|
14195
|
+
}
|
|
14196
|
+
newDateValue.setSeconds(seconds);
|
|
14197
|
+
this.isNavigate = seconds.toString().length === 2;
|
|
14198
|
+
this.isSecondsPart = true;
|
|
14199
|
+
this.secondTypeCount = this.secondTypeCount + 1;
|
|
14200
|
+
break;
|
|
14138
14201
|
}
|
|
14139
|
-
newDateValue.setSeconds(seconds);
|
|
14140
|
-
this.isNavigate = seconds.toString().length === 2;
|
|
14141
|
-
this.isSecondsPart = true;
|
|
14142
|
-
this.secondTypeCount = this.secondTypeCount + 1;
|
|
14143
|
-
break;
|
|
14144
14202
|
case 'a':
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14203
|
+
{
|
|
14204
|
+
this.periodCharacter += newVal[start - 1].toLowerCase();
|
|
14205
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14206
|
+
var periodString = (this.getCulturedValue('dayPeriods.format.wide'));
|
|
14207
|
+
var periodkeys = Object.keys(periodString);
|
|
14208
|
+
for (var i = 0; this.periodCharacter.length > 0; i++) {
|
|
14209
|
+
if ((periodString[periodkeys[0]].toLowerCase().indexOf(this.periodCharacter) === 0
|
|
14210
|
+
&& newDateValue.getHours() >= 12) || (periodString[periodkeys[1]].toLowerCase().
|
|
14211
|
+
indexOf(this.periodCharacter) === 0 && newDateValue.getHours() < 12)) {
|
|
14212
|
+
newDateValue.setHours((newDateValue.getHours() + 12) % 24);
|
|
14213
|
+
this.maskDateValue = newDateValue;
|
|
14214
|
+
}
|
|
14215
|
+
this.periodCharacter = this.periodCharacter.substring(1, this.periodCharacter.length);
|
|
14216
|
+
}
|
|
14217
|
+
break;
|
|
14157
14218
|
}
|
|
14158
|
-
break;
|
|
14159
14219
|
default:
|
|
14160
14220
|
break;
|
|
14161
14221
|
}
|
|
14162
14222
|
this.maskDateValue = newDateValue;
|
|
14163
14223
|
};
|
|
14224
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14164
14225
|
MaskedDateTime.prototype.formatCheck = function () {
|
|
14226
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
14165
14227
|
var proxy = this;
|
|
14166
14228
|
function formatValueSpecifier(formattext) {
|
|
14167
14229
|
var result;
|
|
14230
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14168
14231
|
var daysAbbreviated = proxy.getCulturedValue('days[stand-alone].abbreviated');
|
|
14169
14232
|
var dayKeyAbbreviated = Object.keys(daysAbbreviated);
|
|
14233
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14170
14234
|
var daysWide = (proxy.getCulturedValue('days[stand-alone].wide'));
|
|
14171
14235
|
var dayKeyWide = Object.keys(daysWide);
|
|
14236
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14172
14237
|
var daysNarrow = (proxy.getCulturedValue('days[stand-alone].narrow'));
|
|
14173
14238
|
var dayKeyNarrow = Object.keys(daysNarrow);
|
|
14174
14239
|
var monthAbbreviated = (proxy.getCulturedValue('months[stand-alone].abbreviated'));
|
|
14175
14240
|
var monthWide = (proxy.getCulturedValue('months[stand-alone].wide'));
|
|
14241
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14176
14242
|
var periodString = (proxy.getCulturedValue('dayPeriods.format.wide'));
|
|
14177
14243
|
var periodkeys = Object.keys(periodString);
|
|
14178
14244
|
var milliseconds;
|
|
@@ -14183,7 +14249,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14183
14249
|
case 'd':
|
|
14184
14250
|
result = proxy.isDayPart ? proxy.maskDateValue.getDate().toString() : proxy.defaultConstant['day'].toString();
|
|
14185
14251
|
result = proxy.zeroCheck(proxy.isDateZero, proxy.isDayPart, result);
|
|
14186
|
-
if (proxy.dayTypeCount
|
|
14252
|
+
if (proxy.dayTypeCount === 2) {
|
|
14187
14253
|
proxy.isNavigate = true;
|
|
14188
14254
|
proxy.dayTypeCount = 0;
|
|
14189
14255
|
}
|
|
@@ -14191,7 +14257,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14191
14257
|
case 'dd':
|
|
14192
14258
|
result = proxy.isDayPart ? proxy.roundOff(proxy.maskDateValue.getDate(), 2) : proxy.defaultConstant['day'].toString();
|
|
14193
14259
|
result = proxy.zeroCheck(proxy.isDateZero, proxy.isDayPart, result);
|
|
14194
|
-
if (proxy.dayTypeCount
|
|
14260
|
+
if (proxy.dayTypeCount === 2) {
|
|
14195
14261
|
proxy.isNavigate = true;
|
|
14196
14262
|
proxy.dayTypeCount = 0;
|
|
14197
14263
|
}
|
|
@@ -14210,7 +14276,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14210
14276
|
case 'M':
|
|
14211
14277
|
result = proxy.isMonthPart ? (proxy.maskDateValue.getMonth() + 1).toString() : proxy.defaultConstant['month'].toString();
|
|
14212
14278
|
result = proxy.zeroCheck(proxy.isMonthZero, proxy.isMonthPart, result);
|
|
14213
|
-
if (proxy.monthTypeCount
|
|
14279
|
+
if (proxy.monthTypeCount === 2) {
|
|
14214
14280
|
proxy.isNavigate = true;
|
|
14215
14281
|
proxy.monthTypeCount = 0;
|
|
14216
14282
|
}
|
|
@@ -14218,7 +14284,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14218
14284
|
case 'MM':
|
|
14219
14285
|
result = proxy.isMonthPart ? proxy.roundOff(proxy.maskDateValue.getMonth() + 1, 2) : proxy.defaultConstant['month'].toString();
|
|
14220
14286
|
result = proxy.zeroCheck(proxy.isMonthZero, proxy.isMonthPart, result);
|
|
14221
|
-
if (proxy.monthTypeCount
|
|
14287
|
+
if (proxy.monthTypeCount === 2) {
|
|
14222
14288
|
proxy.isNavigate = true;
|
|
14223
14289
|
proxy.monthTypeCount = 0;
|
|
14224
14290
|
}
|
|
@@ -14243,56 +14309,56 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14243
14309
|
break;
|
|
14244
14310
|
case 'h':
|
|
14245
14311
|
result = proxy.isHourPart ? (proxy.maskDateValue.getHours() % 12 || 12).toString() : proxy.defaultConstant['hour'].toString();
|
|
14246
|
-
if (proxy.hourTypeCount
|
|
14312
|
+
if (proxy.hourTypeCount === 2) {
|
|
14247
14313
|
proxy.isNavigate = true;
|
|
14248
14314
|
proxy.hourTypeCount = 0;
|
|
14249
14315
|
}
|
|
14250
14316
|
break;
|
|
14251
14317
|
case 'hh':
|
|
14252
14318
|
result = proxy.isHourPart ? proxy.roundOff(proxy.maskDateValue.getHours() % 12 || 12, 2) : proxy.defaultConstant['hour'].toString();
|
|
14253
|
-
if (proxy.hourTypeCount
|
|
14319
|
+
if (proxy.hourTypeCount === 2) {
|
|
14254
14320
|
proxy.isNavigate = true;
|
|
14255
14321
|
proxy.hourTypeCount = 0;
|
|
14256
14322
|
}
|
|
14257
14323
|
break;
|
|
14258
14324
|
case 'H':
|
|
14259
14325
|
result = proxy.isHourPart ? proxy.maskDateValue.getHours().toString() : proxy.defaultConstant['hour'].toString();
|
|
14260
|
-
if (proxy.hourTypeCount
|
|
14326
|
+
if (proxy.hourTypeCount === 2) {
|
|
14261
14327
|
proxy.isNavigate = true;
|
|
14262
14328
|
proxy.hourTypeCount = 0;
|
|
14263
14329
|
}
|
|
14264
14330
|
break;
|
|
14265
14331
|
case 'HH':
|
|
14266
14332
|
result = proxy.isHourPart ? proxy.roundOff(proxy.maskDateValue.getHours(), 2) : proxy.defaultConstant['hour'].toString();
|
|
14267
|
-
if (proxy.hourTypeCount
|
|
14333
|
+
if (proxy.hourTypeCount === 2) {
|
|
14268
14334
|
proxy.isNavigate = true;
|
|
14269
14335
|
proxy.hourTypeCount = 0;
|
|
14270
14336
|
}
|
|
14271
14337
|
break;
|
|
14272
14338
|
case 'm':
|
|
14273
14339
|
result = proxy.isMinutePart ? proxy.maskDateValue.getMinutes().toString() : proxy.defaultConstant['minute'].toString();
|
|
14274
|
-
if (proxy.minuteTypeCount
|
|
14340
|
+
if (proxy.minuteTypeCount === 2) {
|
|
14275
14341
|
proxy.isNavigate = true;
|
|
14276
14342
|
proxy.minuteTypeCount = 0;
|
|
14277
14343
|
}
|
|
14278
14344
|
break;
|
|
14279
14345
|
case 'mm':
|
|
14280
14346
|
result = proxy.isMinutePart ? proxy.roundOff(proxy.maskDateValue.getMinutes(), 2) : proxy.defaultConstant['minute'].toString();
|
|
14281
|
-
if (proxy.minuteTypeCount
|
|
14347
|
+
if (proxy.minuteTypeCount === 2) {
|
|
14282
14348
|
proxy.isNavigate = true;
|
|
14283
14349
|
proxy.minuteTypeCount = 0;
|
|
14284
14350
|
}
|
|
14285
14351
|
break;
|
|
14286
14352
|
case 's':
|
|
14287
14353
|
result = proxy.isSecondsPart ? proxy.maskDateValue.getSeconds().toString() : proxy.defaultConstant['second'].toString();
|
|
14288
|
-
if (proxy.secondTypeCount
|
|
14354
|
+
if (proxy.secondTypeCount === 2) {
|
|
14289
14355
|
proxy.isNavigate = true;
|
|
14290
14356
|
proxy.secondTypeCount = 0;
|
|
14291
14357
|
}
|
|
14292
14358
|
break;
|
|
14293
14359
|
case 'ss':
|
|
14294
14360
|
result = proxy.isSecondsPart ? proxy.roundOff(proxy.maskDateValue.getSeconds(), 2) : proxy.defaultConstant['second'].toString();
|
|
14295
|
-
if (proxy.secondTypeCount
|
|
14361
|
+
if (proxy.secondTypeCount === 2) {
|
|
14296
14362
|
proxy.isNavigate = true;
|
|
14297
14363
|
proxy.secondTypeCount = 0;
|
|
14298
14364
|
}
|
|
@@ -14341,14 +14407,12 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14341
14407
|
};
|
|
14342
14408
|
MaskedDateTime.prototype.maskInputHandler = function () {
|
|
14343
14409
|
var start = this.parent.inputElement.selectionStart;
|
|
14344
|
-
var selectionChar = this.previousHiddenMask[start - 1];
|
|
14345
14410
|
var formatText = '';
|
|
14346
14411
|
if (this.validCharacters.indexOf(this.hiddenMask[start]) !== -1) {
|
|
14347
14412
|
formatText = this.hiddenMask[start];
|
|
14348
14413
|
}
|
|
14349
|
-
var inputValue;
|
|
14350
14414
|
this.differenceCheck();
|
|
14351
|
-
inputValue = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
14415
|
+
var inputValue = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
14352
14416
|
this.isHiddenMask = true;
|
|
14353
14417
|
this.hiddenMask = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
14354
14418
|
this.isDateZero = this.isMonthZero = this.isYearZero = false;
|
|
@@ -14374,8 +14438,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14374
14438
|
this.isDeletion = false;
|
|
14375
14439
|
}
|
|
14376
14440
|
this.isDeleteKey = false;
|
|
14377
|
-
// this.setSelection(selectionChar);
|
|
14378
|
-
// this.navigateSelection(inputValue);
|
|
14379
14441
|
};
|
|
14380
14442
|
MaskedDateTime.prototype.navigateSelection = function (isbackward) {
|
|
14381
14443
|
var start = this.parent.inputElement.selectionStart;
|
|
@@ -14456,24 +14518,26 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14456
14518
|
newDateValue.setDate(newDateValue.getDate() + incrementValue);
|
|
14457
14519
|
break;
|
|
14458
14520
|
case 'M':
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14521
|
+
{
|
|
14522
|
+
var newMonth = newDateValue.getMonth() + incrementValue;
|
|
14523
|
+
newDateValue.setDate(1);
|
|
14524
|
+
newDateValue.setMonth(newMonth);
|
|
14525
|
+
if (this.isDayPart) {
|
|
14526
|
+
var previousMaxDate = new Date(this.previousDate.getFullYear(), this.previousDate.getMonth() + 1, 0).getDate();
|
|
14527
|
+
var currentMaxDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth() + 1, 0).getDate();
|
|
14528
|
+
if (this.previousDate.getDate() === previousMaxDate && currentMaxDate <= previousMaxDate) {
|
|
14529
|
+
newDateValue.setDate(currentMaxDate);
|
|
14530
|
+
}
|
|
14531
|
+
else {
|
|
14532
|
+
newDateValue.setDate(this.previousDate.getDate());
|
|
14533
|
+
}
|
|
14467
14534
|
}
|
|
14468
14535
|
else {
|
|
14469
14536
|
newDateValue.setDate(this.previousDate.getDate());
|
|
14470
14537
|
}
|
|
14538
|
+
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14539
|
+
break;
|
|
14471
14540
|
}
|
|
14472
|
-
else {
|
|
14473
|
-
newDateValue.setDate(this.previousDate.getDate());
|
|
14474
|
-
}
|
|
14475
|
-
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14476
|
-
break;
|
|
14477
14541
|
case 'y':
|
|
14478
14542
|
newDateValue.setFullYear(newDateValue.getFullYear() + incrementValue);
|
|
14479
14543
|
break;
|
|
@@ -14511,19 +14575,19 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14511
14575
|
};
|
|
14512
14576
|
MaskedDateTime.prototype.getCulturedFormat = function () {
|
|
14513
14577
|
var formatString = (this.getCulturedValue('dateTimeFormats[availableFormats].yMd')).toString();
|
|
14514
|
-
if (this.parent.moduleName
|
|
14578
|
+
if (this.parent.moduleName === 'datepicker') {
|
|
14515
14579
|
formatString = (this.getCulturedValue('dateTimeFormats[availableFormats].yMd')).toString();
|
|
14516
14580
|
if (this.parent.format && this.parent.formatString) {
|
|
14517
14581
|
formatString = this.parent.formatString;
|
|
14518
14582
|
}
|
|
14519
14583
|
}
|
|
14520
|
-
if (this.parent.moduleName
|
|
14584
|
+
if (this.parent.moduleName === 'datetimepicker') {
|
|
14521
14585
|
formatString = (this.getCulturedValue('dateTimeFormats[availableFormats].yMd')).toString();
|
|
14522
14586
|
if (this.parent.dateTimeFormat) {
|
|
14523
14587
|
formatString = this.parent.dateTimeFormat;
|
|
14524
14588
|
}
|
|
14525
14589
|
}
|
|
14526
|
-
if (this.parent.moduleName
|
|
14590
|
+
if (this.parent.moduleName === 'timepicker') {
|
|
14527
14591
|
formatString = this.parent.cldrTimeFormat();
|
|
14528
14592
|
}
|
|
14529
14593
|
return formatString;
|
|
@@ -14541,7 +14605,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
|
|
|
14541
14605
|
this.previousHiddenMask = this.hiddenMask;
|
|
14542
14606
|
this.previousValue = inputValue;
|
|
14543
14607
|
this.parent.updateInputValue(inputValue);
|
|
14544
|
-
//this.parent.inputElement.value = inputValue;
|
|
14545
14608
|
};
|
|
14546
14609
|
MaskedDateTime.prototype.destroy = function () {
|
|
14547
14610
|
this.removeEventListener();
|