@syncfusion/ej2-calendars 19.2.62 → 19.3.53
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/.eslintrc.json +1 -1
- package/CHANGELOG.md +8 -0
- 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 +612 -1062
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +609 -1059
- 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 +10 -10
- package/src/calendar/calendar-model.d.ts +1 -10
- package/src/calendar/calendar.d.ts +0 -12
- package/src/calendar/calendar.js +146 -201
- package/src/datepicker/datepicker-model.d.ts +1 -11
- package/src/datepicker/datepicker.d.ts +0 -11
- package/src/datepicker/datepicker.js +168 -310
- package/src/daterangepicker/daterangepicker-model.d.ts +1 -23
- package/src/daterangepicker/daterangepicker.d.ts +0 -22
- package/src/daterangepicker/daterangepicker.js +19 -19
- package/src/datetimepicker/datetimepicker-model.d.ts +1 -14
- package/src/datetimepicker/datetimepicker.d.ts +0 -13
- package/src/datetimepicker/datetimepicker.js +10 -13
- package/src/maskbase/masked-date-time.d.ts +6 -0
- package/src/maskbase/masked-date-time.js +35 -1
- package/src/timepicker/timepicker-model.d.ts +1 -15
- package/src/timepicker/timepicker.d.ts +0 -19
- package/src/timepicker/timepicker.js +238 -519
- package/styles/bootstrap-dark.css +17 -2
- package/styles/bootstrap.css +17 -2
- package/styles/bootstrap4.css +17 -2
- package/styles/bootstrap5-dark.css +2676 -0
- package/styles/bootstrap5-dark.scss +5 -0
- package/styles/bootstrap5.css +2676 -0
- package/styles/bootstrap5.scss +5 -0
- package/styles/calendar/_bootstrap-dark-definition.scss +4 -2
- package/styles/calendar/_bootstrap-definition.scss +4 -2
- package/styles/calendar/_bootstrap4-definition.scss +4 -2
- package/styles/calendar/_bootstrap5-dark-definition.scss +1 -0
- package/styles/calendar/_bootstrap5-definition.scss +213 -0
- package/styles/calendar/_fabric-dark-definition.scss +3 -0
- package/styles/calendar/_fabric-definition.scss +3 -0
- package/styles/calendar/_highcontrast-definition.scss +3 -0
- package/styles/calendar/_highcontrast-light-definition.scss +3 -0
- package/styles/calendar/_layout.scss +8 -0
- package/styles/calendar/_material-dark-definition.scss +3 -0
- package/styles/calendar/_material-definition.scss +3 -0
- package/styles/calendar/_tailwind-dark-definition.scss +1 -220
- package/styles/calendar/_tailwind-definition.scss +84 -101
- package/styles/calendar/_theme.scss +40 -0
- package/styles/calendar/bootstrap-dark.css +17 -2
- package/styles/calendar/bootstrap.css +17 -2
- package/styles/calendar/bootstrap4.css +17 -2
- package/styles/calendar/bootstrap5-dark.css +1038 -0
- package/styles/calendar/bootstrap5-dark.scss +5 -0
- package/styles/calendar/bootstrap5.css +1038 -0
- package/styles/calendar/bootstrap5.scss +5 -0
- package/styles/calendar/fabric-dark.css +15 -0
- package/styles/calendar/fabric.css +15 -0
- package/styles/calendar/highcontrast-light.css +15 -0
- package/styles/calendar/highcontrast.css +15 -0
- package/styles/calendar/icons/_bootstrap5-dark.scss +1 -0
- package/styles/calendar/icons/_bootstrap5.scss +12 -0
- package/styles/calendar/icons/_tailwind-dark.scss +1 -13
- package/styles/calendar/material-dark.css +28 -13
- package/styles/calendar/material.css +15 -0
- package/styles/calendar/tailwind-dark.css +17 -2
- package/styles/calendar/tailwind.css +17 -2
- package/styles/datepicker/_bootstrap5-dark-definition.scss +1 -0
- package/styles/datepicker/_bootstrap5-definition.scss +36 -0
- package/styles/datepicker/_layout.scss +1 -2
- package/styles/datepicker/_tailwind-dark-definition.scss +1 -34
- package/styles/datepicker/_tailwind-definition.scss +13 -13
- package/styles/datepicker/_theme.scss +2 -2
- package/styles/datepicker/bootstrap5-dark.css +177 -0
- package/styles/datepicker/bootstrap5-dark.scss +7 -0
- package/styles/datepicker/bootstrap5.css +177 -0
- package/styles/datepicker/bootstrap5.scss +7 -0
- package/styles/datepicker/icons/_bootstrap5-dark.scss +1 -0
- package/styles/datepicker/icons/_bootstrap5.scss +55 -0
- package/styles/datepicker/icons/_tailwind-dark.scss +1 -55
- package/styles/datepicker/material-dark.css +3 -3
- package/styles/daterangepicker/_bootstrap5-dark-definition.scss +1 -0
- package/styles/daterangepicker/_bootstrap5-definition.scss +222 -0
- package/styles/daterangepicker/_layout.scss +2 -2
- package/styles/daterangepicker/_tailwind-dark-definition.scss +1 -192
- package/styles/daterangepicker/_tailwind-definition.scss +81 -79
- package/styles/daterangepicker/_theme.scss +82 -0
- package/styles/daterangepicker/bootstrap5-dark.css +1029 -0
- package/styles/daterangepicker/bootstrap5-dark.scss +7 -0
- package/styles/daterangepicker/bootstrap5.css +1029 -0
- package/styles/daterangepicker/bootstrap5.scss +7 -0
- package/styles/daterangepicker/icons/_bootstrap5-dark.scss +1 -0
- package/styles/daterangepicker/icons/_bootstrap5.scss +67 -0
- package/styles/daterangepicker/icons/_tailwind-dark.scss +1 -63
- package/styles/daterangepicker/material-dark.css +9 -9
- package/styles/datetimepicker/_bootstrap5-dark-definition.scss +1 -0
- package/styles/datetimepicker/_bootstrap5-definition.scss +55 -0
- package/styles/datetimepicker/_tailwind-dark-definition.scss +1 -53
- package/styles/datetimepicker/_tailwind-definition.scss +16 -14
- package/styles/datetimepicker/bootstrap5-dark.css +205 -0
- package/styles/datetimepicker/bootstrap5-dark.scss +8 -0
- package/styles/datetimepicker/bootstrap5.css +205 -0
- package/styles/datetimepicker/bootstrap5.scss +8 -0
- package/styles/datetimepicker/icons/_bootstrap5-dark.scss +1 -0
- package/styles/datetimepicker/icons/_bootstrap5.scss +11 -0
- package/styles/datetimepicker/icons/_tailwind-dark.scss +1 -10
- package/styles/datetimepicker/material-dark.css +4 -4
- package/styles/fabric-dark.css +15 -0
- package/styles/fabric.css +15 -0
- package/styles/highcontrast-light.css +15 -0
- package/styles/highcontrast.css +15 -0
- package/styles/material-dark.css +48 -33
- package/styles/material.css +15 -0
- package/styles/tailwind-dark.css +17 -2
- package/styles/tailwind.css +17 -2
- package/styles/timepicker/_bootstrap5-dark-definition.scss +1 -0
- package/styles/timepicker/_bootstrap5-definition.scss +52 -0
- package/styles/timepicker/_tailwind-dark-definition.scss +1 -48
- package/styles/timepicker/_tailwind-definition.scss +19 -17
- package/styles/timepicker/_theme.scss +1 -1
- package/styles/timepicker/bootstrap5-dark.css +223 -0
- package/styles/timepicker/bootstrap5-dark.scss +6 -0
- package/styles/timepicker/bootstrap5.css +223 -0
- package/styles/timepicker/bootstrap5.scss +6 -0
- package/styles/timepicker/icons/_bootstrap5-dark.scss +1 -0
- package/styles/timepicker/icons/_bootstrap5.scss +13 -0
- package/styles/timepicker/icons/_tailwind-dark.scss +1 -12
- package/styles/timepicker/material-dark.css +4 -4
|
@@ -19,9 +19,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
19
19
|
};
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
21
21
|
/// <reference path='../calendar/calendar-model.d.ts'/>
|
|
22
|
-
import { EventHandler, Property, Internationalization, NotifyPropertyChanges
|
|
22
|
+
import { EventHandler, Property, Internationalization, NotifyPropertyChanges } from '@syncfusion/ej2-base';
|
|
23
23
|
import { KeyboardEvents, Animation, Event, extend, L10n, Browser, formatUnit } from '@syncfusion/ej2-base';
|
|
24
|
-
import { detach, addClass, removeClass, closest, attributes
|
|
24
|
+
import { detach, addClass, removeClass, closest, attributes } from '@syncfusion/ej2-base';
|
|
25
25
|
import { isNullOrUndefined, setValue, getUniqueID } from '@syncfusion/ej2-base';
|
|
26
26
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
27
27
|
import { Input } from '@syncfusion/ej2-inputs';
|
|
@@ -77,7 +77,6 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
77
77
|
_this.isDateIconClicked = false;
|
|
78
78
|
_this.isAltKeyPressed = false;
|
|
79
79
|
_this.isInteracted = true;
|
|
80
|
-
_this.isBlazorServer = false;
|
|
81
80
|
_this.invalidValueString = null;
|
|
82
81
|
_this.checkPreviousValue = null;
|
|
83
82
|
_this.maskedDateValue = '';
|
|
@@ -99,9 +98,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
99
98
|
this.initialize();
|
|
100
99
|
this.bindEvents();
|
|
101
100
|
this.renderComplete();
|
|
102
|
-
|
|
103
|
-
this.setTimeZone(this.serverTimezoneOffset);
|
|
104
|
-
}
|
|
101
|
+
this.setTimeZone(this.serverTimezoneOffset);
|
|
105
102
|
};
|
|
106
103
|
DatePicker.prototype.setTimeZone = function (offsetValue) {
|
|
107
104
|
if (!isNullOrUndefined(this.serverTimezoneOffset) && this.value) {
|
|
@@ -143,36 +140,18 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
143
140
|
}
|
|
144
141
|
};
|
|
145
142
|
DatePicker.prototype.initialize = function () {
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
module: "MaskedDateTime",
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
this.checkInvalidValue(this.value);
|
|
153
|
-
this.createInput();
|
|
154
|
-
this.updateHtmlAttributeToWrapper();
|
|
155
|
-
this.setAllowEdit();
|
|
156
|
-
this.updateInput();
|
|
157
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
158
|
-
this.updateInputValue(this.maskedDateValue);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
var parentElement = this.element.parentElement;
|
|
163
|
-
this.inputWrapper = {
|
|
164
|
-
container: parentElement,
|
|
165
|
-
clearButton: parentElement.querySelector('.' + CLEARICON),
|
|
166
|
-
buttons: [parentElement.querySelector('.' + DATEICON)]
|
|
167
|
-
};
|
|
168
|
-
Input.bindInitialEvent({
|
|
169
|
-
element: this.inputElement,
|
|
170
|
-
floatLabelType: this.floatLabelType
|
|
143
|
+
if (this.enableMask) {
|
|
144
|
+
this.notify("createMask", {
|
|
145
|
+
module: "MaskedDateTime",
|
|
171
146
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
147
|
+
}
|
|
148
|
+
this.checkInvalidValue(this.value);
|
|
149
|
+
this.createInput();
|
|
150
|
+
this.updateHtmlAttributeToWrapper();
|
|
151
|
+
this.setAllowEdit();
|
|
152
|
+
this.updateInput();
|
|
153
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
154
|
+
this.updateInputValue(this.maskedDateValue);
|
|
176
155
|
}
|
|
177
156
|
this.previousElementValue = this.inputElement.value;
|
|
178
157
|
this.previousDate = !isNullOrUndefined(this.value) ? new Date(+this.value) : null;
|
|
@@ -234,9 +213,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
234
213
|
if (isDynamic === void 0) { isDynamic = false; }
|
|
235
214
|
var formatOptions;
|
|
236
215
|
if (this.value && !this.isCalendar() && !isDynamic) {
|
|
237
|
-
|
|
238
|
-
this.disabledDates();
|
|
239
|
-
}
|
|
216
|
+
this.disabledDates();
|
|
240
217
|
}
|
|
241
218
|
if (isNaN(+new Date(this.checkValue(this.value)))) {
|
|
242
219
|
this.setProperties({ value: null }, true);
|
|
@@ -254,7 +231,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
254
231
|
if (this.getModuleName() === 'datetimepicker') {
|
|
255
232
|
if (this.calendarMode === 'Gregorian') {
|
|
256
233
|
dateString = this.globalize.formatDate(this.value, {
|
|
257
|
-
format: tempFormat, type: 'dateTime', skeleton:
|
|
234
|
+
format: tempFormat, type: 'dateTime', skeleton: 'yMd'
|
|
258
235
|
});
|
|
259
236
|
}
|
|
260
237
|
else {
|
|
@@ -265,7 +242,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
265
242
|
}
|
|
266
243
|
else {
|
|
267
244
|
if (this.calendarMode === 'Gregorian') {
|
|
268
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
245
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
269
246
|
}
|
|
270
247
|
else {
|
|
271
248
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -319,8 +296,8 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
319
296
|
if (this.getModuleName() === 'datetimepicker') {
|
|
320
297
|
var culture = new Internationalization(this.locale);
|
|
321
298
|
if (this.calendarMode === 'Gregorian') {
|
|
322
|
-
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton:
|
|
323
|
-
formatDateTime = { format: culture.getDatePattern({ skeleton:
|
|
299
|
+
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd' };
|
|
300
|
+
formatDateTime = { format: culture.getDatePattern({ skeleton: 'yMd' }), type: 'dateTime' };
|
|
324
301
|
}
|
|
325
302
|
else {
|
|
326
303
|
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -329,7 +306,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
329
306
|
}
|
|
330
307
|
else {
|
|
331
308
|
if (this.calendarMode === 'Gregorian') {
|
|
332
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
309
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
333
310
|
}
|
|
334
311
|
else {
|
|
335
312
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -353,8 +330,8 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
353
330
|
if (this.getModuleName() === 'datetimepicker') {
|
|
354
331
|
var culture = new Internationalization(this.locale);
|
|
355
332
|
if (this.calendarMode === 'Gregorian') {
|
|
356
|
-
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton:
|
|
357
|
-
formatDateTime = { format: culture.getDatePattern({ skeleton:
|
|
333
|
+
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd' };
|
|
334
|
+
formatDateTime = { format: culture.getDatePattern({ skeleton: 'yMd' }), type: 'dateTime' };
|
|
358
335
|
}
|
|
359
336
|
else {
|
|
360
337
|
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -364,7 +341,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
364
341
|
}
|
|
365
342
|
else {
|
|
366
343
|
if (this.calendarMode === 'Gregorian') {
|
|
367
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
344
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
368
345
|
}
|
|
369
346
|
else {
|
|
370
347
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -419,7 +396,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
419
396
|
}
|
|
420
397
|
};
|
|
421
398
|
DatePicker.prototype.bindEvents = function () {
|
|
422
|
-
EventHandler.add(this.inputWrapper.buttons[0], 'mousedown touchstart',
|
|
399
|
+
EventHandler.add(this.inputWrapper.buttons[0], 'mousedown touchstart', this.dateIconHandler, this);
|
|
423
400
|
EventHandler.add(this.inputElement, 'mouseup', this.mouseUpHandler, this);
|
|
424
401
|
EventHandler.add(this.inputElement, 'focus', this.inputFocusHandler, this);
|
|
425
402
|
EventHandler.add(this.inputElement, 'blur', this.inputBlurHandler, this);
|
|
@@ -429,7 +406,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
429
406
|
this.bindInputEvent();
|
|
430
407
|
// To prevent the twice triggering.
|
|
431
408
|
EventHandler.add(this.inputElement, 'change', this.inputChangeHandler, this);
|
|
432
|
-
if (this.showClearButton &&
|
|
409
|
+
if (this.showClearButton && this.inputWrapper.clearButton) {
|
|
433
410
|
EventHandler.add(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler, this);
|
|
434
411
|
}
|
|
435
412
|
if (this.formElement) {
|
|
@@ -466,7 +443,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
466
443
|
}
|
|
467
444
|
};
|
|
468
445
|
DatePicker.prototype.unBindEvents = function () {
|
|
469
|
-
EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart',
|
|
446
|
+
EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart', this.dateIconHandler);
|
|
470
447
|
EventHandler.remove(this.inputElement, 'mouseup', this.mouseUpHandler);
|
|
471
448
|
EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);
|
|
472
449
|
EventHandler.remove(this.inputElement, 'blur', this.inputBlurHandler);
|
|
@@ -474,7 +451,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
474
451
|
if (this.enableMask) {
|
|
475
452
|
EventHandler.remove(this.inputElement, 'keydown', this.keydownHandler);
|
|
476
453
|
}
|
|
477
|
-
if (this.showClearButton &&
|
|
454
|
+
if (this.showClearButton && this.inputWrapper.clearButton) {
|
|
478
455
|
EventHandler.remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler);
|
|
479
456
|
}
|
|
480
457
|
if (this.formElement) {
|
|
@@ -492,13 +469,11 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
492
469
|
this.inputValueCopy = null;
|
|
493
470
|
this.inputElement.setAttribute('value', '');
|
|
494
471
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
this.errorClass();
|
|
501
|
-
}
|
|
472
|
+
this.setProperties({ value: this.inputValueCopy }, true);
|
|
473
|
+
this.restoreValue();
|
|
474
|
+
if (this.inputElement) {
|
|
475
|
+
this.updateInputValue(value);
|
|
476
|
+
this.errorClass();
|
|
502
477
|
}
|
|
503
478
|
}
|
|
504
479
|
};
|
|
@@ -507,7 +482,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
507
482
|
this.previousDate = this.value;
|
|
508
483
|
this.previousElementValue = (isNullOrUndefined(this.inputValueCopy)) ? '' :
|
|
509
484
|
this.globalize.formatDate(this.inputValueCopy, {
|
|
510
|
-
format: this.formatString, type: 'dateTime', skeleton:
|
|
485
|
+
format: this.formatString, type: 'dateTime', skeleton: 'yMd'
|
|
511
486
|
});
|
|
512
487
|
};
|
|
513
488
|
DatePicker.prototype.inputChangeHandler = function (e) {
|
|
@@ -537,9 +512,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
537
512
|
}
|
|
538
513
|
};
|
|
539
514
|
DatePicker.prototype.clear = function (event) {
|
|
540
|
-
|
|
541
|
-
this.setProperties({ value: null }, true);
|
|
542
|
-
}
|
|
515
|
+
this.setProperties({ value: null }, true);
|
|
543
516
|
if (!this.enableMask) {
|
|
544
517
|
this.updateInputValue('');
|
|
545
518
|
}
|
|
@@ -548,19 +521,13 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
548
521
|
};
|
|
549
522
|
this.trigger('cleared', clearedArgs);
|
|
550
523
|
this.invalidValueString = '';
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
if (this.isBlazorServer) {
|
|
562
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
563
|
-
this.interopAdaptor.invokeMethodAsync('OnValueCleared');
|
|
524
|
+
this.updateInput();
|
|
525
|
+
this.popupUpdate();
|
|
526
|
+
this.changeEvent(event);
|
|
527
|
+
if (this.enableMask) {
|
|
528
|
+
this.notify("clearHandler", {
|
|
529
|
+
module: "MaskedDateTime"
|
|
530
|
+
});
|
|
564
531
|
}
|
|
565
532
|
};
|
|
566
533
|
DatePicker.prototype.preventEventBubbling = function (e) {
|
|
@@ -580,24 +547,20 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
580
547
|
this.inputElement.setAttribute('readonly', '');
|
|
581
548
|
this.inputElement.blur();
|
|
582
549
|
}
|
|
583
|
-
|
|
584
|
-
e.preventDefault();
|
|
585
|
-
}
|
|
550
|
+
e.preventDefault();
|
|
586
551
|
if (!this.readonly) {
|
|
587
|
-
if (this.isCalendar()
|
|
552
|
+
if (this.isCalendar()) {
|
|
588
553
|
this.hide(e);
|
|
589
554
|
}
|
|
590
555
|
else {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
if (this.getModuleName() === 'datetimepicker') {
|
|
595
|
-
this.inputElement.focus();
|
|
596
|
-
}
|
|
556
|
+
this.isDateIconClicked = true;
|
|
557
|
+
this.show(null, e);
|
|
558
|
+
if (this.getModuleName() === 'datetimepicker') {
|
|
597
559
|
this.inputElement.focus();
|
|
598
|
-
addClass([this.inputWrapper.container], [INPUTFOCUS]);
|
|
599
|
-
addClass(this.inputWrapper.buttons, ACTIVE);
|
|
600
560
|
}
|
|
561
|
+
this.inputElement.focus();
|
|
562
|
+
addClass([this.inputWrapper.container], [INPUTFOCUS]);
|
|
563
|
+
addClass(this.inputWrapper.buttons, ACTIVE);
|
|
601
564
|
}
|
|
602
565
|
}
|
|
603
566
|
this.isIconClicked = false;
|
|
@@ -698,7 +661,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
698
661
|
}
|
|
699
662
|
}
|
|
700
663
|
var focusArguments = {
|
|
701
|
-
model:
|
|
664
|
+
model: this
|
|
702
665
|
};
|
|
703
666
|
this.isDateIconClicked = false;
|
|
704
667
|
this.trigger('focus', focusArguments);
|
|
@@ -719,32 +682,26 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
719
682
|
if (!this.enabled) {
|
|
720
683
|
return;
|
|
721
684
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
685
|
+
this.strictModeUpdate();
|
|
686
|
+
if (this.inputElement.value === '' && isNullOrUndefined(this.value)) {
|
|
687
|
+
this.invalidValueString = null;
|
|
688
|
+
this.updateInputValue('');
|
|
689
|
+
}
|
|
690
|
+
this.updateInput();
|
|
691
|
+
this.popupUpdate();
|
|
692
|
+
this.changeTrigger(e);
|
|
693
|
+
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
694
|
+
if (this.inputElement.value == this.maskedDateValue && !this.value && (this.floatLabelType == 'Auto' || this.floatLabelType == 'Never' || this.placeholder)) {
|
|
726
695
|
this.updateInputValue('');
|
|
727
696
|
}
|
|
728
|
-
this.updateInput();
|
|
729
|
-
this.popupUpdate();
|
|
730
|
-
this.changeTrigger(e);
|
|
731
|
-
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
732
|
-
if (this.inputElement.value == this.maskedDateValue && !this.value && (this.floatLabelType == 'Auto' || this.floatLabelType == 'Never' || this.placeholder)) {
|
|
733
|
-
this.updateInputValue('');
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
this.errorClass();
|
|
737
|
-
}
|
|
738
|
-
else {
|
|
739
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
740
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
741
697
|
}
|
|
698
|
+
this.errorClass();
|
|
742
699
|
if (this.isCalendar() && document.activeElement === this.inputElement) {
|
|
743
700
|
this.hide(e);
|
|
744
701
|
}
|
|
745
702
|
if (this.getModuleName() === 'datepicker') {
|
|
746
703
|
var blurArguments = {
|
|
747
|
-
model:
|
|
704
|
+
model: this
|
|
748
705
|
};
|
|
749
706
|
this.trigger('blur', blurArguments);
|
|
750
707
|
}
|
|
@@ -782,7 +739,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
782
739
|
else if (closest(target, '.e-footer-container')
|
|
783
740
|
&& target.classList.contains('e-today')
|
|
784
741
|
&& target.classList.contains('e-btn')
|
|
785
|
-
&& (+new Date(+this.value) === +_super.prototype.generateTodayVal.call(this, this.value)
|
|
742
|
+
&& (+new Date(+this.value) === +_super.prototype.generateTodayVal.call(this, this.value))) {
|
|
786
743
|
this.hide(e);
|
|
787
744
|
}
|
|
788
745
|
}
|
|
@@ -797,40 +754,22 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
797
754
|
break;
|
|
798
755
|
case 'altDownArrow':
|
|
799
756
|
this.isAltKeyPressed = true;
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
this.changeTrigger(e);
|
|
804
|
-
}
|
|
805
|
-
else {
|
|
806
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
807
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
808
|
-
}
|
|
757
|
+
this.strictModeUpdate();
|
|
758
|
+
this.updateInput();
|
|
759
|
+
this.changeTrigger(e);
|
|
809
760
|
if (this.getModuleName() === 'datepicker') {
|
|
810
|
-
|
|
811
|
-
this.show(null, e);
|
|
812
|
-
}
|
|
813
|
-
else {
|
|
814
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
815
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', true);
|
|
816
|
-
}
|
|
761
|
+
this.show(null, e);
|
|
817
762
|
}
|
|
818
763
|
break;
|
|
819
764
|
case 'escape':
|
|
820
765
|
this.hide(e);
|
|
821
766
|
break;
|
|
822
767
|
case 'enter':
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
this.errorClass();
|
|
829
|
-
}
|
|
830
|
-
else {
|
|
831
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
832
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
833
|
-
}
|
|
768
|
+
this.strictModeUpdate();
|
|
769
|
+
this.updateInput();
|
|
770
|
+
this.popupUpdate();
|
|
771
|
+
this.changeTrigger(e);
|
|
772
|
+
this.errorClass();
|
|
834
773
|
if (!this.isCalendar() && document.activeElement === this.inputElement) {
|
|
835
774
|
this.hide(e);
|
|
836
775
|
}
|
|
@@ -855,17 +794,11 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
855
794
|
start = this.inputElement.selectionStart;
|
|
856
795
|
end = this.inputElement.selectionEnd;
|
|
857
796
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
this.errorClass();
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
867
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
868
|
-
}
|
|
797
|
+
this.strictModeUpdate();
|
|
798
|
+
this.updateInput();
|
|
799
|
+
this.popupUpdate();
|
|
800
|
+
this.changeTrigger(e);
|
|
801
|
+
this.errorClass();
|
|
869
802
|
if (this.enableMask) {
|
|
870
803
|
this.inputElement.selectionStart = start;
|
|
871
804
|
this.inputElement.selectionEnd = end;
|
|
@@ -884,7 +817,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
884
817
|
this.previousDate = ((!isNullOrUndefined(this.value) && new Date(+this.value)) || null);
|
|
885
818
|
if (this.isCalendar()) {
|
|
886
819
|
_super.prototype.keyActionHandle.call(this, e);
|
|
887
|
-
if (
|
|
820
|
+
if (this.isCalendar()) {
|
|
888
821
|
attributes(this.inputElement, {
|
|
889
822
|
'aria-activedescendant': '' + this.setActiveDescendant()
|
|
890
823
|
});
|
|
@@ -899,7 +832,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
899
832
|
removeClass(this.popupObj.element.querySelectorAll('.' + SELECTED), [SELECTED]);
|
|
900
833
|
}
|
|
901
834
|
}
|
|
902
|
-
if (!isNullOrUndefined(this.value)
|
|
835
|
+
if (!isNullOrUndefined(this.value)) {
|
|
903
836
|
if ((+this.value >= +this.min) && (+this.value <= +this.max)) {
|
|
904
837
|
var targetdate = new Date(this.checkValue(this.value));
|
|
905
838
|
_super.prototype.navigateTo.call(this, 'Month', targetdate);
|
|
@@ -927,7 +860,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
927
860
|
if (this.calendarMode === 'Gregorian') {
|
|
928
861
|
dateOptions = {
|
|
929
862
|
format: !isNullOrUndefined(this.formatString) ? this.formatString : this.dateTimeFormat,
|
|
930
|
-
type: 'dateTime', skeleton:
|
|
863
|
+
type: 'dateTime', skeleton: 'yMd'
|
|
931
864
|
};
|
|
932
865
|
}
|
|
933
866
|
else {
|
|
@@ -939,7 +872,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
939
872
|
}
|
|
940
873
|
else {
|
|
941
874
|
if (this.calendarMode === 'Gregorian') {
|
|
942
|
-
formatOptions = { format: format, type: 'dateTime', skeleton:
|
|
875
|
+
formatOptions = { format: format, type: 'dateTime', skeleton: 'yMd' };
|
|
943
876
|
}
|
|
944
877
|
else {
|
|
945
878
|
formatOptions = { format: format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -956,7 +889,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
956
889
|
}
|
|
957
890
|
else {
|
|
958
891
|
if (this.calendarMode === 'Gregorian') {
|
|
959
|
-
formatOptions = { type: 'dateTime', skeleton:
|
|
892
|
+
formatOptions = { type: 'dateTime', skeleton: 'yMd' };
|
|
960
893
|
}
|
|
961
894
|
else {
|
|
962
895
|
formatOptions = { type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -1001,17 +934,9 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1001
934
|
};
|
|
1002
935
|
DatePicker.prototype.createCalendar = function () {
|
|
1003
936
|
var _this = this;
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
this.popupWrapper.className += ' ' + this.cssClass;
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
else {
|
|
1011
|
-
this.popupWrapper = this.inputWrapper.container.nextElementSibling;
|
|
1012
|
-
this.calendarElement = this.popupWrapper.firstElementChild;
|
|
1013
|
-
this.tableBodyElement = select('tbody', this.calendarElement);
|
|
1014
|
-
this.contentElement = select('.e-content', this.calendarElement);
|
|
937
|
+
this.popupWrapper = this.createElement('div', { className: '' + ROOT + ' ' + POPUPWRAPPER });
|
|
938
|
+
if (!isNullOrUndefined(this.cssClass)) {
|
|
939
|
+
this.popupWrapper.className += ' ' + this.cssClass;
|
|
1015
940
|
}
|
|
1016
941
|
if (Browser.isDevice) {
|
|
1017
942
|
this.modelHeader();
|
|
@@ -1024,7 +949,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1024
949
|
//this.calendarElement represent the Calendar object from the Calendar class.
|
|
1025
950
|
this.calendarElement.querySelector('table tbody').className = '';
|
|
1026
951
|
this.popupObj = new Popup(this.popupWrapper, {
|
|
1027
|
-
content: this.
|
|
952
|
+
content: this.calendarElement,
|
|
1028
953
|
relateTo: Browser.isDevice ? document.body : this.inputWrapper.container,
|
|
1029
954
|
position: Browser.isDevice ? { X: 'center', Y: 'center' } : { X: 'left', Y: 'bottom' },
|
|
1030
955
|
offsetY: OFFSETVALUE,
|
|
@@ -1053,7 +978,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1053
978
|
if (_this.isDateIconClicked) {
|
|
1054
979
|
_this.inputWrapper.container.children[_this.index].focus();
|
|
1055
980
|
}
|
|
1056
|
-
if (_this.value
|
|
981
|
+
if (_this.value) {
|
|
1057
982
|
_this.disabledDates();
|
|
1058
983
|
}
|
|
1059
984
|
if (_this.popupObj) {
|
|
@@ -1071,9 +996,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1071
996
|
}
|
|
1072
997
|
}
|
|
1073
998
|
});
|
|
1074
|
-
|
|
1075
|
-
this.popupObj.element.className += ' ' + this.cssClass;
|
|
1076
|
-
}
|
|
999
|
+
this.popupObj.element.className += ' ' + this.cssClass;
|
|
1077
1000
|
this.setAriaAttributes();
|
|
1078
1001
|
};
|
|
1079
1002
|
DatePicker.prototype.setAriaDisabled = function () {
|
|
@@ -1186,7 +1109,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1186
1109
|
if (this.value) {
|
|
1187
1110
|
if (this.getModuleName() === 'datetimepicker') {
|
|
1188
1111
|
if (this.calendarMode === 'Gregorian') {
|
|
1189
|
-
formatOptions = { format: tempFormat, type: 'dateTime', skeleton:
|
|
1112
|
+
formatOptions = { format: tempFormat, type: 'dateTime', skeleton: 'yMd' };
|
|
1190
1113
|
}
|
|
1191
1114
|
else {
|
|
1192
1115
|
formatOptions = { format: tempFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -1195,7 +1118,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1195
1118
|
}
|
|
1196
1119
|
else {
|
|
1197
1120
|
if (this.calendarMode === 'Gregorian') {
|
|
1198
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
1121
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
1199
1122
|
}
|
|
1200
1123
|
else {
|
|
1201
1124
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -1251,18 +1174,14 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1251
1174
|
var outOfRange = void 0;
|
|
1252
1175
|
if (!isNullOrUndefined(this.value) && !(+this.value >= +this.min && +this.value <= +this.max)) {
|
|
1253
1176
|
outOfRange = new Date(this.checkValue(this.value));
|
|
1254
|
-
|
|
1255
|
-
this.setProperties({ 'value': null }, true);
|
|
1256
|
-
}
|
|
1177
|
+
this.setProperties({ 'value': null }, true);
|
|
1257
1178
|
}
|
|
1258
1179
|
else {
|
|
1259
1180
|
outOfRange = this.value || null;
|
|
1260
1181
|
}
|
|
1261
1182
|
if (!this.isCalendar()) {
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
this.setProperties({ 'value': outOfRange || null }, true);
|
|
1265
|
-
}
|
|
1183
|
+
_super.prototype.render.call(this);
|
|
1184
|
+
this.setProperties({ 'value': outOfRange || null }, true);
|
|
1266
1185
|
this.previousDate = outOfRange;
|
|
1267
1186
|
this.createCalendar();
|
|
1268
1187
|
}
|
|
@@ -1274,7 +1193,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1274
1193
|
preventDefault: function () {
|
|
1275
1194
|
prevent_1 = false;
|
|
1276
1195
|
},
|
|
1277
|
-
popup:
|
|
1196
|
+
popup: this.popupObj,
|
|
1278
1197
|
event: e || null,
|
|
1279
1198
|
cancel: false,
|
|
1280
1199
|
appendTo: Browser.isDevice ? this.mobilePopupWrapper : document.body
|
|
@@ -1283,11 +1202,6 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1283
1202
|
this.trigger('open', eventArgs, function (eventArgs) {
|
|
1284
1203
|
_this.preventArgs = eventArgs;
|
|
1285
1204
|
if (prevent_1 && !_this.preventArgs.cancel) {
|
|
1286
|
-
if (_this.isBlazorServer) {
|
|
1287
|
-
_this.popupWrapper.style.visibility = '';
|
|
1288
|
-
_this.popupWrapper.style.width = 'auto';
|
|
1289
|
-
_this.popupWrapper.style.height = 'auto';
|
|
1290
|
-
}
|
|
1291
1205
|
addClass(_this.inputWrapper.buttons, ACTIVE);
|
|
1292
1206
|
_this.preventArgs.appendTo.appendChild(_this.popupWrapper);
|
|
1293
1207
|
_this.popupObj.refreshPosition(_this.inputElement);
|
|
@@ -1301,18 +1215,12 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1301
1215
|
else {
|
|
1302
1216
|
_this.popupObj.show(new Animation(openAnimation), null);
|
|
1303
1217
|
}
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
_super.prototype.setOverlayIndex.call(_this, _this.mobilePopupWrapper, _this.popupObj.element, _this.modal, Browser.isDevice);
|
|
1307
|
-
}
|
|
1218
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1219
|
+
_super.prototype.setOverlayIndex.call(_this, _this.mobilePopupWrapper, _this.popupObj.element, _this.modal, Browser.isDevice);
|
|
1308
1220
|
_this.setAriaAttributes();
|
|
1309
1221
|
}
|
|
1310
1222
|
else {
|
|
1311
1223
|
_this.popupObj.destroy();
|
|
1312
|
-
if (_this.isBlazorServer) {
|
|
1313
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1314
|
-
_this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
|
|
1315
|
-
}
|
|
1316
1224
|
_this.popupWrapper = _this.popupObj = null;
|
|
1317
1225
|
}
|
|
1318
1226
|
if (!isNullOrUndefined(_this.inputElement) && _this.inputElement.value === '') {
|
|
@@ -1339,7 +1247,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1339
1247
|
preventDefault: function () {
|
|
1340
1248
|
prevent_2 = false;
|
|
1341
1249
|
},
|
|
1342
|
-
popup:
|
|
1250
|
+
popup: this.popupObj,
|
|
1343
1251
|
event: event || null,
|
|
1344
1252
|
cancel: false
|
|
1345
1253
|
};
|
|
@@ -1366,17 +1274,9 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1366
1274
|
DatePicker.prototype.closeEventCallback = function (prevent, eventArgs) {
|
|
1367
1275
|
this.preventArgs = eventArgs;
|
|
1368
1276
|
if (this.isCalendar() && (prevent && !this.preventArgs.cancel)) {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
this.keyboardModule.destroy();
|
|
1373
|
-
}
|
|
1374
|
-
else {
|
|
1375
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1376
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
|
|
1377
|
-
this.isAltKeyPressed = false;
|
|
1378
|
-
this.popupWrapper = this.popupObj = null;
|
|
1379
|
-
}
|
|
1277
|
+
this.popupObj.hide();
|
|
1278
|
+
this.isAltKeyPressed = false;
|
|
1279
|
+
this.keyboardModule.destroy();
|
|
1380
1280
|
removeClass(this.inputWrapper.buttons, ACTIVE);
|
|
1381
1281
|
}
|
|
1382
1282
|
this.setAriaAttributes();
|
|
@@ -1459,12 +1359,10 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1459
1359
|
*/
|
|
1460
1360
|
DatePicker.prototype.destroy = function () {
|
|
1461
1361
|
this.unBindEvents();
|
|
1462
|
-
|
|
1362
|
+
_super.prototype.destroy.call(this);
|
|
1363
|
+
this.keyboardModules.destroy();
|
|
1364
|
+
if (this.popupObj && this.popupObj.element.classList.contains(POPUP)) {
|
|
1463
1365
|
_super.prototype.destroy.call(this);
|
|
1464
|
-
this.keyboardModules.destroy();
|
|
1465
|
-
if (this.popupObj && this.popupObj.element.classList.contains(POPUP)) {
|
|
1466
|
-
_super.prototype.destroy.call(this);
|
|
1467
|
-
}
|
|
1468
1366
|
}
|
|
1469
1367
|
var ariaAttrs = {
|
|
1470
1368
|
'aria-live': 'assertive', 'aria-atomic': 'true', 'aria-disabled': 'true',
|
|
@@ -1489,9 +1387,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1489
1387
|
detach(this.popupWrapper);
|
|
1490
1388
|
}
|
|
1491
1389
|
this.popupObj = this.popupWrapper = null;
|
|
1492
|
-
|
|
1493
|
-
this.keyboardModule.destroy();
|
|
1494
|
-
}
|
|
1390
|
+
this.keyboardModule.destroy();
|
|
1495
1391
|
}
|
|
1496
1392
|
if (this.ngTag === null) {
|
|
1497
1393
|
if (this.inputElement) {
|
|
@@ -1537,45 +1433,40 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1537
1433
|
this.inputElement = this.element;
|
|
1538
1434
|
this.formElement = closest(this.inputElement, 'form');
|
|
1539
1435
|
this.index = this.showClearButton ? 2 : 1;
|
|
1540
|
-
this.
|
|
1541
|
-
if (
|
|
1542
|
-
this.ngTag =
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1436
|
+
this.ngTag = null;
|
|
1437
|
+
if (this.element.tagName === 'EJS-DATEPICKER' || this.element.tagName === 'EJS-DATETIMEPICKER') {
|
|
1438
|
+
this.ngTag = this.element.tagName;
|
|
1439
|
+
this.inputElement = this.createElement('input');
|
|
1440
|
+
this.element.appendChild(this.inputElement);
|
|
1441
|
+
}
|
|
1442
|
+
if (this.element.getAttribute('id')) {
|
|
1443
|
+
if (this.ngTag !== null) {
|
|
1444
|
+
this.inputElement.id = this.element.getAttribute('id') + '_input';
|
|
1547
1445
|
}
|
|
1548
|
-
|
|
1446
|
+
}
|
|
1447
|
+
else {
|
|
1448
|
+
if (this.getModuleName() === 'datetimepicker') {
|
|
1449
|
+
this.element.id = getUniqueID('ej2-datetimepicker');
|
|
1549
1450
|
if (this.ngTag !== null) {
|
|
1550
|
-
this.inputElement
|
|
1451
|
+
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
1551
1452
|
}
|
|
1552
1453
|
}
|
|
1553
1454
|
else {
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
else {
|
|
1561
|
-
this.element.id = getUniqueID('ej2-datepicker');
|
|
1562
|
-
if (this.ngTag !== null) {
|
|
1563
|
-
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
1564
|
-
}
|
|
1455
|
+
this.element.id = getUniqueID('ej2-datepicker');
|
|
1456
|
+
if (this.ngTag !== null) {
|
|
1457
|
+
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
1565
1458
|
}
|
|
1566
1459
|
}
|
|
1567
|
-
if (this.ngTag !== null) {
|
|
1568
|
-
this.validationAttribute(this.element, this.inputElement);
|
|
1569
|
-
}
|
|
1570
|
-
this.updateHtmlAttributeToElement();
|
|
1571
1460
|
}
|
|
1461
|
+
if (this.ngTag !== null) {
|
|
1462
|
+
this.validationAttribute(this.element, this.inputElement);
|
|
1463
|
+
}
|
|
1464
|
+
this.updateHtmlAttributeToElement();
|
|
1572
1465
|
this.defaultKeyConfigs = this.getDefaultKeyConfig();
|
|
1573
1466
|
this.checkHtmlAttributes(false);
|
|
1574
1467
|
this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
_super.prototype.preRender.call(this);
|
|
1578
|
-
}
|
|
1468
|
+
this.element.removeAttribute('tabindex');
|
|
1469
|
+
_super.prototype.preRender.call(this);
|
|
1579
1470
|
};
|
|
1580
1471
|
DatePicker.prototype.getDefaultKeyConfig = function () {
|
|
1581
1472
|
this.defaultKeyConfigs = {
|
|
@@ -1621,7 +1512,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1621
1512
|
var culture = new Internationalization(this.locale);
|
|
1622
1513
|
if (this.format) {
|
|
1623
1514
|
if (typeof this.format === 'string') {
|
|
1624
|
-
this.formatString =
|
|
1515
|
+
this.formatString = this.format;
|
|
1625
1516
|
}
|
|
1626
1517
|
else if (this.format.skeleton !== '' && !isNullOrUndefined(this.format.skeleton)) {
|
|
1627
1518
|
var skeletonString = this.format.skeleton;
|
|
@@ -1656,7 +1547,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1656
1547
|
if (this.calendarMode === 'Gregorian') {
|
|
1657
1548
|
options = {
|
|
1658
1549
|
format: !isNullOrUndefined(this.formatString) ? this.formatString : this.dateTimeFormat,
|
|
1659
|
-
type: 'dateTime', skeleton:
|
|
1550
|
+
type: 'dateTime', skeleton: 'yMd'
|
|
1660
1551
|
};
|
|
1661
1552
|
}
|
|
1662
1553
|
else {
|
|
@@ -1668,7 +1559,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1668
1559
|
}
|
|
1669
1560
|
else {
|
|
1670
1561
|
if (this.calendarMode === 'Gregorian') {
|
|
1671
|
-
options = { format: this.formatString, type: 'dateTime', skeleton:
|
|
1562
|
+
options = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
1672
1563
|
}
|
|
1673
1564
|
else {
|
|
1674
1565
|
options = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -1679,8 +1570,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1679
1570
|
if (!isNullOrUndefined(this.inputElement.getAttribute(prop))) {
|
|
1680
1571
|
switch (prop) {
|
|
1681
1572
|
case 'disabled':
|
|
1682
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['enabled'] === undefined)) || dynamic)
|
|
1683
|
-
!this.isBlazorServer) {
|
|
1573
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['enabled'] === undefined)) || dynamic)) {
|
|
1684
1574
|
var enabled = this.inputElement.getAttribute(prop) === 'disabled' ||
|
|
1685
1575
|
this.inputElement.getAttribute(prop) === '' ||
|
|
1686
1576
|
this.inputElement.getAttribute(prop) === 'true' ? false : true;
|
|
@@ -1688,32 +1578,25 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1688
1578
|
}
|
|
1689
1579
|
break;
|
|
1690
1580
|
case 'readonly':
|
|
1691
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['readonly'] === undefined)) || dynamic)
|
|
1692
|
-
!this.isBlazorServer) {
|
|
1581
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['readonly'] === undefined)) || dynamic)) {
|
|
1693
1582
|
var readonly = this.inputElement.getAttribute(prop) === 'readonly' ||
|
|
1694
1583
|
this.inputElement.getAttribute(prop) === '' || this.inputElement.getAttribute(prop) === 'true' ? true : false;
|
|
1695
1584
|
this.setProperties({ readonly: readonly }, !dynamic);
|
|
1696
1585
|
}
|
|
1697
1586
|
break;
|
|
1698
1587
|
case 'placeholder':
|
|
1699
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['placeholder'] === undefined)) || dynamic)
|
|
1700
|
-
!this.isBlazorServer) {
|
|
1588
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['placeholder'] === undefined)) || dynamic)) {
|
|
1701
1589
|
this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !dynamic);
|
|
1702
1590
|
}
|
|
1703
1591
|
break;
|
|
1704
1592
|
case 'style':
|
|
1705
|
-
|
|
1706
|
-
this.inputElement.setAttribute('style', '' + this.inputElement.getAttribute(prop));
|
|
1707
|
-
}
|
|
1593
|
+
this.inputElement.setAttribute('style', '' + this.inputElement.getAttribute(prop));
|
|
1708
1594
|
break;
|
|
1709
1595
|
case 'name':
|
|
1710
|
-
|
|
1711
|
-
this.inputElement.setAttribute('name', '' + this.inputElement.getAttribute(prop));
|
|
1712
|
-
}
|
|
1596
|
+
this.inputElement.setAttribute('name', '' + this.inputElement.getAttribute(prop));
|
|
1713
1597
|
break;
|
|
1714
1598
|
case 'value':
|
|
1715
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['value'] === undefined)) || dynamic)
|
|
1716
|
-
!this.isBlazorServer) {
|
|
1599
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['value'] === undefined)) || dynamic)) {
|
|
1717
1600
|
var value = this.inputElement.getAttribute(prop);
|
|
1718
1601
|
this.setProperties(setValue(prop, this.globalize.parseDate(value, options), {}), !dynamic);
|
|
1719
1602
|
}
|
|
@@ -1731,7 +1614,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1731
1614
|
}
|
|
1732
1615
|
break;
|
|
1733
1616
|
case 'type':
|
|
1734
|
-
if (this.inputElement.getAttribute(prop) !== 'text'
|
|
1617
|
+
if (this.inputElement.getAttribute(prop) !== 'text') {
|
|
1735
1618
|
this.inputElement.setAttribute('type', 'text');
|
|
1736
1619
|
}
|
|
1737
1620
|
break;
|
|
@@ -1755,9 +1638,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1755
1638
|
var previousValCopy = this.previousDate;
|
|
1756
1639
|
//calls the Calendar render method to check the disabled dates through renderDayCell event and update the input value accordingly.
|
|
1757
1640
|
this.minMaxUpdates();
|
|
1758
|
-
|
|
1759
|
-
_super.prototype.render.call(this);
|
|
1760
|
-
}
|
|
1641
|
+
_super.prototype.render.call(this);
|
|
1761
1642
|
this.previousDate = previousValCopy;
|
|
1762
1643
|
var date = valueCopy && +(valueCopy);
|
|
1763
1644
|
var dateIdString = '*[id^="/id"]'.replace('/id', '' + date);
|
|
@@ -1778,7 +1659,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1778
1659
|
if (this.calendarMode === 'Gregorian') {
|
|
1779
1660
|
globalize = this.globalize.formatDate(valueCopy, {
|
|
1780
1661
|
format: !isNullOrUndefined(this.formatString) ? this.formatString : this.dateTimeFormat,
|
|
1781
|
-
type: 'dateTime', skeleton:
|
|
1662
|
+
type: 'dateTime', skeleton: 'yMd'
|
|
1782
1663
|
});
|
|
1783
1664
|
}
|
|
1784
1665
|
else {
|
|
@@ -1791,7 +1672,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1791
1672
|
}
|
|
1792
1673
|
else {
|
|
1793
1674
|
if (this.calendarMode === 'Gregorian') {
|
|
1794
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
1675
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
1795
1676
|
}
|
|
1796
1677
|
else {
|
|
1797
1678
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -1809,26 +1690,13 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1809
1690
|
}
|
|
1810
1691
|
};
|
|
1811
1692
|
DatePicker.prototype.setAriaAttributes = function () {
|
|
1812
|
-
if (this.
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
var selectedEle = this.tableBodyElement.querySelector('tr td.e-selected');
|
|
1816
|
-
var id = (focusedEle || selectedEle) ? (focusedEle || selectedEle).getAttribute('id') : 'null';
|
|
1817
|
-
attributes(this.inputElement, { 'aria-activedescendant': '' + id });
|
|
1818
|
-
}
|
|
1819
|
-
else {
|
|
1820
|
-
attributes(this.inputElement, { 'aria-activedescendant': 'null' });
|
|
1821
|
-
}
|
|
1693
|
+
if (this.isCalendar()) {
|
|
1694
|
+
Input.addAttributes({ 'aria-expanded': 'true' }, this.inputElement);
|
|
1695
|
+
attributes(this.inputElement, { 'aria-activedescendant': '' + this.setActiveDescendant() });
|
|
1822
1696
|
}
|
|
1823
1697
|
else {
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
attributes(this.inputElement, { 'aria-activedescendant': '' + this.setActiveDescendant() });
|
|
1827
|
-
}
|
|
1828
|
-
else {
|
|
1829
|
-
Input.addAttributes({ 'aria-expanded': 'false' }, this.inputElement);
|
|
1830
|
-
attributes(this.inputElement, { 'aria-activedescendant': 'null' });
|
|
1831
|
-
}
|
|
1698
|
+
Input.addAttributes({ 'aria-expanded': 'false' }, this.inputElement);
|
|
1699
|
+
attributes(this.inputElement, { 'aria-activedescendant': 'null' });
|
|
1832
1700
|
}
|
|
1833
1701
|
};
|
|
1834
1702
|
DatePicker.prototype.errorClass = function () {
|
|
@@ -1863,20 +1731,16 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1863
1731
|
this.isDynamicValueChanged = true;
|
|
1864
1732
|
this.isInteracted = false;
|
|
1865
1733
|
this.invalidValueString = null;
|
|
1866
|
-
|
|
1867
|
-
this.checkInvalidValue(newProp.value);
|
|
1868
|
-
}
|
|
1734
|
+
this.checkInvalidValue(newProp.value);
|
|
1869
1735
|
newProp.value = this.value;
|
|
1870
1736
|
this.previousElementValue = this.inputElement.value;
|
|
1871
|
-
if (
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
this.changeTrigger(null);
|
|
1879
|
-
}
|
|
1737
|
+
if (isNullOrUndefined(this.value)) {
|
|
1738
|
+
this.updateInputValue('');
|
|
1739
|
+
this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
|
|
1740
|
+
}
|
|
1741
|
+
this.updateInput(true);
|
|
1742
|
+
if (+this.previousDate !== +this.value) {
|
|
1743
|
+
this.changeTrigger(null);
|
|
1880
1744
|
}
|
|
1881
1745
|
this.isInteracted = true;
|
|
1882
1746
|
this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
|
|
@@ -1889,15 +1753,13 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1889
1753
|
case 'format':
|
|
1890
1754
|
this.checkFormat();
|
|
1891
1755
|
this.bindInputEvent();
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
this.updateInputValue(this.maskedDateValue);
|
|
1900
|
-
}
|
|
1756
|
+
this.updateInput();
|
|
1757
|
+
if (this.enableMask) {
|
|
1758
|
+
this.notify("createMask", {
|
|
1759
|
+
module: "MaskedDateTime",
|
|
1760
|
+
});
|
|
1761
|
+
if (!this.value) {
|
|
1762
|
+
this.updateInputValue(this.maskedDateValue);
|
|
1901
1763
|
}
|
|
1902
1764
|
}
|
|
1903
1765
|
break;
|
|
@@ -1924,13 +1786,11 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1924
1786
|
this.l10n.setLocale(this.locale);
|
|
1925
1787
|
this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
|
|
1926
1788
|
Input.setPlaceholder(this.placeholder, this.inputElement);
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
});
|
|
1933
|
-
}
|
|
1789
|
+
this.updateInput();
|
|
1790
|
+
if (this.enableMask) {
|
|
1791
|
+
this.notify("createMask", {
|
|
1792
|
+
module: "MaskedDateTime",
|
|
1793
|
+
});
|
|
1934
1794
|
}
|
|
1935
1795
|
break;
|
|
1936
1796
|
case 'enableRtl':
|
|
@@ -1939,7 +1799,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1939
1799
|
case 'start':
|
|
1940
1800
|
case 'depth':
|
|
1941
1801
|
this.checkView();
|
|
1942
|
-
if (this.calendarElement
|
|
1802
|
+
if (this.calendarElement) {
|
|
1943
1803
|
_super.prototype.onPropertyChanged.call(this, newProp, oldProp);
|
|
1944
1804
|
}
|
|
1945
1805
|
break;
|
|
@@ -1956,9 +1816,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1956
1816
|
break;
|
|
1957
1817
|
case 'strictMode':
|
|
1958
1818
|
this.invalidValueString = null;
|
|
1959
|
-
|
|
1960
|
-
this.updateInput();
|
|
1961
|
-
}
|
|
1819
|
+
this.updateInput();
|
|
1962
1820
|
break;
|
|
1963
1821
|
case 'width':
|
|
1964
1822
|
this.setWidth(newProp.width);
|
|
@@ -1983,7 +1841,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
1983
1841
|
}
|
|
1984
1842
|
break;
|
|
1985
1843
|
default:
|
|
1986
|
-
if (this.calendarElement &&
|
|
1844
|
+
if (this.calendarElement && this.isCalendar()) {
|
|
1987
1845
|
_super.prototype.onPropertyChanged.call(this, newProp, oldProp);
|
|
1988
1846
|
}
|
|
1989
1847
|
break;
|