@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Animation, Browser, ChildProperty, Collection, Component, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, append, attributes,
|
|
1
|
+
import { Animation, Browser, ChildProperty, Collection, Component, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, append, attributes, cldrData, closest, createElement, detach, extend, formatUnit, getDefaultDateObject, getUniqueID, getValue, isNullOrUndefined, isUndefined, merge, prepend, remove, removeClass, rippleEffect, select, setStyleAttribute, setValue, throwError } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Popup } from '@syncfusion/ej2-popups';
|
|
3
3
|
import { Input } from '@syncfusion/ej2-inputs';
|
|
4
4
|
import { Button } from '@syncfusion/ej2-buttons';
|
|
@@ -281,7 +281,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
281
281
|
getCultureValues() {
|
|
282
282
|
const culShortNames = [];
|
|
283
283
|
let cldrObj;
|
|
284
|
-
const dayFormat =
|
|
284
|
+
const dayFormat = 'days.stand-alone.' + this.dayHeaderFormat.toLowerCase();
|
|
285
285
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
286
286
|
cldrObj = (getValue(dayFormat, getDefaultDateObject()));
|
|
287
287
|
}
|
|
@@ -389,17 +389,8 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
wireEvents(id, ref, keyConfig, moduleName) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
this.defaultKeyConfigs = extend(this.defaultKeyConfigs, this.keyConfigs);
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
this.element = document.getElementById(id);
|
|
398
|
-
this.defaultKeyConfigs = this.getDefaultKeyConfig();
|
|
399
|
-
this.defaultKeyConfigs = extend(this.defaultKeyConfigs, keyConfig);
|
|
400
|
-
this.blazorRef = ref;
|
|
401
|
-
this.serverModuleName = moduleName;
|
|
402
|
-
}
|
|
392
|
+
EventHandler.add(this.headerTitleElement, 'click', this.navigateTitle, this);
|
|
393
|
+
this.defaultKeyConfigs = extend(this.defaultKeyConfigs, this.keyConfigs);
|
|
403
394
|
if (this.getModuleName() === 'calendar') {
|
|
404
395
|
this.keyboardModule = new KeyboardEvents(this.element, {
|
|
405
396
|
eventName: 'keydown',
|
|
@@ -418,7 +409,6 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
418
409
|
dateWireEvents(id, ref, keyConfig, moduleName) {
|
|
419
410
|
this.defaultKeyConfigs = this.getDefaultKeyConfig();
|
|
420
411
|
this.defaultKeyConfigs = extend(this.defaultKeyConfigs, keyConfig);
|
|
421
|
-
this.blazorRef = ref;
|
|
422
412
|
this.serverModuleName = moduleName;
|
|
423
413
|
}
|
|
424
414
|
todayButtonClick(e, value, isCustomDate) {
|
|
@@ -449,21 +439,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
449
439
|
this.renderDayCellArgs = null;
|
|
450
440
|
this.calendarElement = this.tableBodyElement = this.footer = this.tableHeadElement = this.nextIcon = this.previousIcon = this.table = null;
|
|
451
441
|
}
|
|
452
|
-
checkDeviceMode(ref) {
|
|
453
|
-
if (Browser.isDevice && isBlazor() && ref) {
|
|
454
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
455
|
-
ref.invokeMethodAsync('OnDevice', true);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
442
|
keyActionHandle(e, value, multiSelection) {
|
|
459
|
-
if (isBlazor() && this.blazorRef) {
|
|
460
|
-
e.preventDefault();
|
|
461
|
-
if (!this.tableBodyElement) {
|
|
462
|
-
this.element = closest(e.target, '.' + 'e-calendar');
|
|
463
|
-
this.tableBodyElement = this.element.querySelector('tbody');
|
|
464
|
-
}
|
|
465
|
-
multiSelection = false;
|
|
466
|
-
}
|
|
467
443
|
const focusedDate = this.tableBodyElement.querySelector('tr td.e-focused-date');
|
|
468
444
|
let selectedDate;
|
|
469
445
|
if (multiSelection) {
|
|
@@ -477,147 +453,124 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
477
453
|
else {
|
|
478
454
|
selectedDate = this.tableBodyElement.querySelector('tr td.e-selected');
|
|
479
455
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
if (view === 0) {
|
|
526
|
-
this.keyboardNavigate(7, view, e, this.max, this.min);
|
|
527
|
-
}
|
|
528
|
-
else {
|
|
529
|
-
this.keyboardNavigate(4, view, e, this.max, this.min);
|
|
530
|
-
}
|
|
531
|
-
e.preventDefault();
|
|
532
|
-
break;
|
|
533
|
-
case 'select':
|
|
534
|
-
if (e.target === this.todayElement) {
|
|
535
|
-
this.todayButtonClick(e, value);
|
|
536
|
-
}
|
|
537
|
-
else {
|
|
538
|
-
const element = !isNullOrUndefined(focusedDate) ? focusedDate : selectedDate;
|
|
539
|
-
if (!isNullOrUndefined(element) && !element.classList.contains(DISABLED)) {
|
|
540
|
-
if (levelRestrict) {
|
|
541
|
-
// eslint-disable-next-line radix
|
|
542
|
-
const d = new Date(parseInt('' + (element).id, 0));
|
|
543
|
-
this.selectDate(e, d, (element));
|
|
544
|
-
}
|
|
545
|
-
else {
|
|
546
|
-
this.contentClick(null, --view, (element), value);
|
|
547
|
-
}
|
|
456
|
+
let view = this.getViewNumber(this.currentView());
|
|
457
|
+
const depthValue = this.getViewNumber(this.depth);
|
|
458
|
+
const levelRestrict = (view === depthValue && this.getViewNumber(this.start) >= depthValue);
|
|
459
|
+
this.effect = '';
|
|
460
|
+
switch (e.action) {
|
|
461
|
+
case 'moveLeft':
|
|
462
|
+
this.keyboardNavigate(-1, view, e, this.max, this.min);
|
|
463
|
+
e.preventDefault();
|
|
464
|
+
break;
|
|
465
|
+
case 'moveRight':
|
|
466
|
+
this.keyboardNavigate(1, view, e, this.max, this.min);
|
|
467
|
+
e.preventDefault();
|
|
468
|
+
break;
|
|
469
|
+
case 'moveUp':
|
|
470
|
+
if (view === 0) {
|
|
471
|
+
this.keyboardNavigate(-7, view, e, this.max, this.min); // move the current date to the previous seven days.
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
this.keyboardNavigate(-4, view, e, this.max, this.min); // move the current year to the previous four days.
|
|
475
|
+
}
|
|
476
|
+
e.preventDefault();
|
|
477
|
+
break;
|
|
478
|
+
case 'moveDown':
|
|
479
|
+
if (view === 0) {
|
|
480
|
+
this.keyboardNavigate(7, view, e, this.max, this.min);
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
this.keyboardNavigate(4, view, e, this.max, this.min);
|
|
484
|
+
}
|
|
485
|
+
e.preventDefault();
|
|
486
|
+
break;
|
|
487
|
+
case 'select':
|
|
488
|
+
if (e.target === this.todayElement) {
|
|
489
|
+
this.todayButtonClick(e, value);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
const element = !isNullOrUndefined(focusedDate) ? focusedDate : selectedDate;
|
|
493
|
+
if (!isNullOrUndefined(element) && !element.classList.contains(DISABLED)) {
|
|
494
|
+
if (levelRestrict) {
|
|
495
|
+
// eslint-disable-next-line radix
|
|
496
|
+
const d = new Date(parseInt('' + (element).id, 0));
|
|
497
|
+
this.selectDate(e, d, (element));
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
this.contentClick(null, --view, (element), value);
|
|
548
501
|
}
|
|
549
502
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
503
|
+
}
|
|
504
|
+
break;
|
|
505
|
+
case 'controlUp':
|
|
506
|
+
this.title();
|
|
507
|
+
e.preventDefault();
|
|
508
|
+
break;
|
|
509
|
+
case 'controlDown':
|
|
510
|
+
if (!isNullOrUndefined(focusedDate) || !isNullOrUndefined(selectedDate) && !levelRestrict) {
|
|
511
|
+
this.contentClick(null, --view, (focusedDate || selectedDate), value);
|
|
512
|
+
}
|
|
513
|
+
e.preventDefault();
|
|
514
|
+
break;
|
|
515
|
+
case 'home':
|
|
516
|
+
this.currentDate = this.firstDay(this.currentDate);
|
|
517
|
+
detach(this.tableBodyElement);
|
|
518
|
+
if (view === 0) {
|
|
519
|
+
this.renderMonths(e);
|
|
520
|
+
}
|
|
521
|
+
else if (view === 1) {
|
|
522
|
+
this.renderYears(e);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
this.renderDecades(e);
|
|
526
|
+
}
|
|
527
|
+
e.preventDefault();
|
|
528
|
+
break;
|
|
529
|
+
case 'end':
|
|
530
|
+
this.currentDate = this.lastDay(this.currentDate, view);
|
|
531
|
+
detach(this.tableBodyElement);
|
|
532
|
+
if (view === 0) {
|
|
533
|
+
this.renderMonths(e);
|
|
534
|
+
}
|
|
535
|
+
else if (view === 1) {
|
|
536
|
+
this.renderYears(e);
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
this.renderDecades(e);
|
|
540
|
+
}
|
|
541
|
+
e.preventDefault();
|
|
542
|
+
break;
|
|
543
|
+
case 'pageUp':
|
|
544
|
+
this.addMonths(this.currentDate, -1);
|
|
545
|
+
this.navigateTo('Month', this.currentDate);
|
|
546
|
+
e.preventDefault();
|
|
547
|
+
break;
|
|
548
|
+
case 'pageDown':
|
|
549
|
+
this.addMonths(this.currentDate, 1);
|
|
550
|
+
this.navigateTo('Month', this.currentDate);
|
|
551
|
+
e.preventDefault();
|
|
552
|
+
break;
|
|
553
|
+
case 'shiftPageUp':
|
|
554
|
+
this.addYears(this.currentDate, -1);
|
|
555
|
+
this.navigateTo('Month', this.currentDate);
|
|
556
|
+
e.preventDefault();
|
|
557
|
+
break;
|
|
558
|
+
case 'shiftPageDown':
|
|
559
|
+
this.addYears(this.currentDate, 1);
|
|
560
|
+
this.navigateTo('Month', this.currentDate);
|
|
561
|
+
e.preventDefault();
|
|
562
|
+
break;
|
|
563
|
+
case 'controlHome':
|
|
564
|
+
this.navigateTo('Month', new Date(this.currentDate.getFullYear(), 0, 1));
|
|
565
|
+
e.preventDefault();
|
|
566
|
+
break;
|
|
567
|
+
case 'controlEnd':
|
|
568
|
+
this.navigateTo('Month', new Date(this.currentDate.getFullYear(), 11, 31));
|
|
569
|
+
e.preventDefault();
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
if (this.getModuleName() === 'calendar') {
|
|
573
|
+
this.table.focus();
|
|
621
574
|
}
|
|
622
575
|
}
|
|
623
576
|
keyboardNavigate(number, currentView, e, max, min) {
|
|
@@ -740,12 +693,12 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
740
693
|
}
|
|
741
694
|
minMaxDate = new Date(+localDate);
|
|
742
695
|
localDate = this.minMaxDate(localDate);
|
|
743
|
-
const dateFormatOptions = { type: 'dateTime', skeleton:
|
|
696
|
+
const dateFormatOptions = { type: 'dateTime', skeleton: 'full' };
|
|
744
697
|
const date = this.globalize.parseDate(this.globalize.formatDate(localDate, dateFormatOptions), dateFormatOptions);
|
|
745
698
|
const tdEle = this.dayCell(localDate);
|
|
746
|
-
const title = this.globalize.formatDate(localDate, { type: 'date', skeleton:
|
|
699
|
+
const title = this.globalize.formatDate(localDate, { type: 'date', skeleton: 'full' });
|
|
747
700
|
const dayLink = this.createElement('span');
|
|
748
|
-
dayLink.textContent = this.globalize.formatDate(localDate, { format: 'd', type: 'date', skeleton:
|
|
701
|
+
dayLink.textContent = this.globalize.formatDate(localDate, { format: 'd', type: 'date', skeleton: 'yMd' });
|
|
749
702
|
const disabled = (this.min > localDate) || (this.max < localDate);
|
|
750
703
|
if (disabled) {
|
|
751
704
|
addClass([tdEle], DISABLED);
|
|
@@ -775,8 +728,8 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
775
728
|
if (multiSelection) {
|
|
776
729
|
if (!isNullOrUndefined(values) && values.length > 0) {
|
|
777
730
|
for (let index = 0; index < values.length; index++) {
|
|
778
|
-
const localDateString = +new Date(this.globalize.formatDate(argument.date, { type: 'date', skeleton:
|
|
779
|
-
const tempDateString = +new Date(this.globalize.formatDate(values[index], { type: 'date', skeleton:
|
|
731
|
+
const localDateString = +new Date(this.globalize.formatDate(argument.date, { type: 'date', skeleton: 'yMd' }));
|
|
732
|
+
const tempDateString = +new Date(this.globalize.formatDate(values[index], { type: 'date', skeleton: 'yMd' }));
|
|
780
733
|
if (localDateString === tempDateString) {
|
|
781
734
|
values.splice(index, 1);
|
|
782
735
|
index = -1;
|
|
@@ -807,7 +760,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
807
760
|
if (multiSelection && !isNullOrUndefined(values) && !disabledCls) {
|
|
808
761
|
for (let tempValue = 0; tempValue < values.length; tempValue++) {
|
|
809
762
|
const type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
|
|
810
|
-
const formatOptions = { format:
|
|
763
|
+
const formatOptions = { format: null, type: 'date', skeleton: 'short', calendar: type };
|
|
811
764
|
const localDateString = this.globalize.formatDate(localDate, formatOptions);
|
|
812
765
|
const tempDateString = this.globalize.formatDate(values[tempValue], formatOptions);
|
|
813
766
|
if ((localDateString === tempDateString && this.getDateVal(localDate, values[tempValue]))
|
|
@@ -874,7 +827,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
874
827
|
const localMonth = (value && (value).getMonth() === localDate.getMonth());
|
|
875
828
|
const select$$1 = (value && (value).getFullYear() === yr && localMonth);
|
|
876
829
|
dayLink.textContent = this.toCapitalize(this.globalize.formatDate(localDate, {
|
|
877
|
-
format:
|
|
830
|
+
format: null, type: 'dateTime', skeleton: 'MMM'
|
|
878
831
|
}));
|
|
879
832
|
if ((this.min && (curYrs < minYr || (month < minMonth && curYrs === minYr))) || (this.max && (curYrs > maxYr || (month > maxMonth && curYrs >= maxYr)))) {
|
|
880
833
|
addClass([tdEle], DISABLED);
|
|
@@ -911,9 +864,9 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
911
864
|
const startFullYr = startYr.getFullYear();
|
|
912
865
|
const endFullYr = endYr.getFullYear();
|
|
913
866
|
const startHdrYr = this.globalize.formatDate(startYr, {
|
|
914
|
-
format:
|
|
867
|
+
format: null, type: 'dateTime', skeleton: 'y'
|
|
915
868
|
});
|
|
916
|
-
const endHdrYr = this.globalize.formatDate(endYr, { format:
|
|
869
|
+
const endHdrYr = this.globalize.formatDate(endYr, { format: null, type: 'dateTime', skeleton: 'y' });
|
|
917
870
|
this.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
|
|
918
871
|
const start = new Date(localYr - (localYr % 10) - 1, 0, 1);
|
|
919
872
|
const startYear = start.getFullYear();
|
|
@@ -924,7 +877,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
924
877
|
attributes(tdEle, { 'role': 'gridcell' });
|
|
925
878
|
const dayLink = this.createElement('span');
|
|
926
879
|
dayLink.textContent = this.globalize.formatDate(localDate, {
|
|
927
|
-
format:
|
|
880
|
+
format: null, type: 'dateTime', skeleton: 'y'
|
|
928
881
|
});
|
|
929
882
|
if ((year < startFullYr) || (year > endFullYr)) {
|
|
930
883
|
addClass([tdEle], OTHERDECADE);
|
|
@@ -958,7 +911,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
958
911
|
}
|
|
959
912
|
dayCell(localDate) {
|
|
960
913
|
const type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
|
|
961
|
-
const dateFormatOptions = { skeleton:
|
|
914
|
+
const dateFormatOptions = { skeleton: 'full', type: 'dateTime', calendar: type };
|
|
962
915
|
const date = this.globalize.parseDate(this.globalize.formatDate(localDate, dateFormatOptions), dateFormatOptions);
|
|
963
916
|
const value = date.valueOf();
|
|
964
917
|
const attrs = {
|
|
@@ -1342,15 +1295,15 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1342
1295
|
const type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
|
|
1343
1296
|
let tempValueString;
|
|
1344
1297
|
if (this.calendarMode === 'Gregorian') {
|
|
1345
|
-
tempValueString = this.globalize.formatDate(tempValue, { type: 'date', skeleton:
|
|
1298
|
+
tempValueString = this.globalize.formatDate(tempValue, { type: 'date', skeleton: 'yMd' });
|
|
1346
1299
|
}
|
|
1347
1300
|
else {
|
|
1348
1301
|
tempValueString = this.globalize.formatDate(tempValue, { type: 'dateTime', skeleton: 'full', calendar: 'islamic' });
|
|
1349
1302
|
}
|
|
1350
|
-
const minFormatOption = { type: 'date', skeleton:
|
|
1303
|
+
const minFormatOption = { type: 'date', skeleton: 'yMd', calendar: type };
|
|
1351
1304
|
const minStringValue = this.globalize.formatDate(this.min, minFormatOption);
|
|
1352
1305
|
const minString = minStringValue;
|
|
1353
|
-
const maxFormatOption = { type: 'date', skeleton:
|
|
1306
|
+
const maxFormatOption = { type: 'date', skeleton: 'yMd', calendar: type };
|
|
1354
1307
|
const maxStringValue = this.globalize.formatDate(this.max, maxFormatOption);
|
|
1355
1308
|
const maxString = maxStringValue;
|
|
1356
1309
|
if (+new Date(tempValueString) < +new Date(minString) ||
|
|
@@ -1384,9 +1337,9 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1384
1337
|
let monthFormatOptions;
|
|
1385
1338
|
const type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
|
|
1386
1339
|
if (this.calendarMode === 'Gregorian') {
|
|
1387
|
-
dayFormatOptions = globalize.formatDate(date, { type: 'dateTime', skeleton:
|
|
1340
|
+
dayFormatOptions = globalize.formatDate(date, { type: 'dateTime', skeleton: 'yMMMM', calendar: type });
|
|
1388
1341
|
monthFormatOptions = globalize.formatDate(date, {
|
|
1389
|
-
format:
|
|
1342
|
+
format: null, type: 'dateTime', skeleton: 'y', calendar: type
|
|
1390
1343
|
});
|
|
1391
1344
|
}
|
|
1392
1345
|
else {
|
|
@@ -1409,11 +1362,11 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1409
1362
|
let title;
|
|
1410
1363
|
const view = this.currentView();
|
|
1411
1364
|
if (view === 'Month') {
|
|
1412
|
-
title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton:
|
|
1365
|
+
title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton: 'full', calendar: type });
|
|
1413
1366
|
}
|
|
1414
1367
|
else if (view === 'Year') {
|
|
1415
1368
|
if (type !== 'islamic') {
|
|
1416
|
-
title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton:
|
|
1369
|
+
title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton: 'yMMMM', calendar: type });
|
|
1417
1370
|
}
|
|
1418
1371
|
else {
|
|
1419
1372
|
title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton: 'GyMMM', calendar: type });
|
|
@@ -1421,7 +1374,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1421
1374
|
}
|
|
1422
1375
|
else {
|
|
1423
1376
|
title = this.globalize.formatDate(this.currentDate, {
|
|
1424
|
-
format:
|
|
1377
|
+
format: null, type: 'date', skeleton: 'y', calendar: type
|
|
1425
1378
|
});
|
|
1426
1379
|
}
|
|
1427
1380
|
if (selectedEle || focusedEle) {
|
|
@@ -1619,11 +1572,9 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1619
1572
|
}
|
|
1620
1573
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1621
1574
|
getCultureObjects(ld, c) {
|
|
1622
|
-
const gregorianFormat =
|
|
1623
|
-
|
|
1624
|
-
const
|
|
1625
|
-
'.dates.calendars.islamic.days.format.') + this.dayHeaderFormat.toLowerCase();
|
|
1626
|
-
const mainVal = isBlazor() ? '' : 'main.';
|
|
1575
|
+
const gregorianFormat = '.dates.calendars.gregorian.days.format.' + this.dayHeaderFormat.toLowerCase();
|
|
1576
|
+
const islamicFormat = '.dates.calendars.islamic.days.format.' + this.dayHeaderFormat.toLowerCase();
|
|
1577
|
+
const mainVal = 'main.';
|
|
1627
1578
|
if (this.calendarMode === 'Gregorian') {
|
|
1628
1579
|
return getValue(mainVal + '' + this.locale + gregorianFormat, ld);
|
|
1629
1580
|
}
|
|
@@ -1675,7 +1626,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1675
1626
|
eve = element;
|
|
1676
1627
|
}
|
|
1677
1628
|
const type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
|
|
1678
|
-
const dateFormatOptions = { type: 'dateTime', skeleton:
|
|
1629
|
+
const dateFormatOptions = { type: 'dateTime', skeleton: 'full', calendar: type };
|
|
1679
1630
|
// eslint-disable-next-line radix
|
|
1680
1631
|
const dateString = this.globalize.formatDate(new Date(parseInt('' + eve.getAttribute('id'), 0)), dateFormatOptions);
|
|
1681
1632
|
const date = this.globalize.parseDate(dateString, dateFormatOptions);
|
|
@@ -1743,7 +1694,7 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1743
1694
|
removeClass([element], SELECTED);
|
|
1744
1695
|
for (let i = 0; i < copyValues.length; i++) {
|
|
1745
1696
|
const type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
|
|
1746
|
-
const formatOptions = { format:
|
|
1697
|
+
const formatOptions = { format: null, type: 'date', skeleton: 'short', calendar: type };
|
|
1747
1698
|
const localDateString = this.globalize.formatDate(date, formatOptions);
|
|
1748
1699
|
const tempDateString = this.globalize.formatDate(copyValues[i], formatOptions);
|
|
1749
1700
|
if (localDateString === tempDateString) {
|
|
@@ -1763,22 +1714,16 @@ let CalendarBase = class CalendarBase extends Component {
|
|
|
1763
1714
|
}
|
|
1764
1715
|
this.isDateSelected = true;
|
|
1765
1716
|
}
|
|
1766
|
-
getFromatStringValue() {
|
|
1767
|
-
return isBlazor() ?
|
|
1768
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1769
|
-
'M' + getDefaultDateObject().dateSeperator + 'd' + getDefaultDateObject().dateSeperator + 'yy'
|
|
1770
|
-
: null;
|
|
1771
|
-
}
|
|
1772
1717
|
checkPresentDate(dates, values) {
|
|
1773
1718
|
let previousValue = false;
|
|
1774
1719
|
if (!isNullOrUndefined(values)) {
|
|
1775
1720
|
for (let checkPrevious = 0; checkPrevious < values.length; checkPrevious++) {
|
|
1776
1721
|
const type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
|
|
1777
1722
|
const localDateString = this.globalize.formatDate(dates, {
|
|
1778
|
-
format:
|
|
1723
|
+
format: null, type: 'date', skeleton: 'short', calendar: type
|
|
1779
1724
|
});
|
|
1780
1725
|
const tempDateString = this.globalize.formatDate(values[checkPrevious], {
|
|
1781
|
-
format:
|
|
1726
|
+
format: null, type: 'date', skeleton: 'short', calendar: type
|
|
1782
1727
|
});
|
|
1783
1728
|
if (localDateString === tempDateString) {
|
|
1784
1729
|
previousValue = true;
|
|
@@ -3083,7 +3028,6 @@ const ERROR = 'e-error';
|
|
|
3083
3028
|
const ACTIVE = 'e-active';
|
|
3084
3029
|
const OVERFLOW = 'e-date-overflow';
|
|
3085
3030
|
const DATEICON = 'e-date-icon';
|
|
3086
|
-
const CLEARICON = 'e-clear-icon';
|
|
3087
3031
|
const ICONS = 'e-icons';
|
|
3088
3032
|
const OPENDURATION = 300;
|
|
3089
3033
|
const OFFSETVALUE = 4;
|
|
@@ -3118,7 +3062,6 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3118
3062
|
this.isDateIconClicked = false;
|
|
3119
3063
|
this.isAltKeyPressed = false;
|
|
3120
3064
|
this.isInteracted = true;
|
|
3121
|
-
this.isBlazorServer = false;
|
|
3122
3065
|
this.invalidValueString = null;
|
|
3123
3066
|
this.checkPreviousValue = null;
|
|
3124
3067
|
this.maskedDateValue = '';
|
|
@@ -3139,9 +3082,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3139
3082
|
this.initialize();
|
|
3140
3083
|
this.bindEvents();
|
|
3141
3084
|
this.renderComplete();
|
|
3142
|
-
|
|
3143
|
-
this.setTimeZone(this.serverTimezoneOffset);
|
|
3144
|
-
}
|
|
3085
|
+
this.setTimeZone(this.serverTimezoneOffset);
|
|
3145
3086
|
}
|
|
3146
3087
|
setTimeZone(offsetValue) {
|
|
3147
3088
|
if (!isNullOrUndefined(this.serverTimezoneOffset) && this.value) {
|
|
@@ -3183,36 +3124,18 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3183
3124
|
}
|
|
3184
3125
|
}
|
|
3185
3126
|
initialize() {
|
|
3186
|
-
if (
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
module: "MaskedDateTime",
|
|
3190
|
-
});
|
|
3191
|
-
}
|
|
3192
|
-
this.checkInvalidValue(this.value);
|
|
3193
|
-
this.createInput();
|
|
3194
|
-
this.updateHtmlAttributeToWrapper();
|
|
3195
|
-
this.setAllowEdit();
|
|
3196
|
-
this.updateInput();
|
|
3197
|
-
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
3198
|
-
this.updateInputValue(this.maskedDateValue);
|
|
3199
|
-
}
|
|
3200
|
-
}
|
|
3201
|
-
else {
|
|
3202
|
-
const parentElement = this.element.parentElement;
|
|
3203
|
-
this.inputWrapper = {
|
|
3204
|
-
container: parentElement,
|
|
3205
|
-
clearButton: parentElement.querySelector('.' + CLEARICON),
|
|
3206
|
-
buttons: [parentElement.querySelector('.' + DATEICON)]
|
|
3207
|
-
};
|
|
3208
|
-
Input.bindInitialEvent({
|
|
3209
|
-
element: this.inputElement,
|
|
3210
|
-
floatLabelType: this.floatLabelType
|
|
3127
|
+
if (this.enableMask) {
|
|
3128
|
+
this.notify("createMask", {
|
|
3129
|
+
module: "MaskedDateTime",
|
|
3211
3130
|
});
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3131
|
+
}
|
|
3132
|
+
this.checkInvalidValue(this.value);
|
|
3133
|
+
this.createInput();
|
|
3134
|
+
this.updateHtmlAttributeToWrapper();
|
|
3135
|
+
this.setAllowEdit();
|
|
3136
|
+
this.updateInput();
|
|
3137
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
3138
|
+
this.updateInputValue(this.maskedDateValue);
|
|
3216
3139
|
}
|
|
3217
3140
|
this.previousElementValue = this.inputElement.value;
|
|
3218
3141
|
this.previousDate = !isNullOrUndefined(this.value) ? new Date(+this.value) : null;
|
|
@@ -3273,9 +3196,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3273
3196
|
updateInput(isDynamic = false) {
|
|
3274
3197
|
let formatOptions;
|
|
3275
3198
|
if (this.value && !this.isCalendar() && !isDynamic) {
|
|
3276
|
-
|
|
3277
|
-
this.disabledDates();
|
|
3278
|
-
}
|
|
3199
|
+
this.disabledDates();
|
|
3279
3200
|
}
|
|
3280
3201
|
if (isNaN(+new Date(this.checkValue(this.value)))) {
|
|
3281
3202
|
this.setProperties({ value: null }, true);
|
|
@@ -3293,7 +3214,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3293
3214
|
if (this.getModuleName() === 'datetimepicker') {
|
|
3294
3215
|
if (this.calendarMode === 'Gregorian') {
|
|
3295
3216
|
dateString = this.globalize.formatDate(this.value, {
|
|
3296
|
-
format: tempFormat, type: 'dateTime', skeleton:
|
|
3217
|
+
format: tempFormat, type: 'dateTime', skeleton: 'yMd'
|
|
3297
3218
|
});
|
|
3298
3219
|
}
|
|
3299
3220
|
else {
|
|
@@ -3304,7 +3225,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3304
3225
|
}
|
|
3305
3226
|
else {
|
|
3306
3227
|
if (this.calendarMode === 'Gregorian') {
|
|
3307
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
3228
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
3308
3229
|
}
|
|
3309
3230
|
else {
|
|
3310
3231
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -3358,8 +3279,8 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3358
3279
|
if (this.getModuleName() === 'datetimepicker') {
|
|
3359
3280
|
const culture = new Internationalization(this.locale);
|
|
3360
3281
|
if (this.calendarMode === 'Gregorian') {
|
|
3361
|
-
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton:
|
|
3362
|
-
formatDateTime = { format: culture.getDatePattern({ skeleton:
|
|
3282
|
+
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd' };
|
|
3283
|
+
formatDateTime = { format: culture.getDatePattern({ skeleton: 'yMd' }), type: 'dateTime' };
|
|
3363
3284
|
}
|
|
3364
3285
|
else {
|
|
3365
3286
|
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -3368,7 +3289,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3368
3289
|
}
|
|
3369
3290
|
else {
|
|
3370
3291
|
if (this.calendarMode === 'Gregorian') {
|
|
3371
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
3292
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
3372
3293
|
}
|
|
3373
3294
|
else {
|
|
3374
3295
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -3392,8 +3313,8 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3392
3313
|
if (this.getModuleName() === 'datetimepicker') {
|
|
3393
3314
|
const culture = new Internationalization(this.locale);
|
|
3394
3315
|
if (this.calendarMode === 'Gregorian') {
|
|
3395
|
-
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton:
|
|
3396
|
-
formatDateTime = { format: culture.getDatePattern({ skeleton:
|
|
3316
|
+
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd' };
|
|
3317
|
+
formatDateTime = { format: culture.getDatePattern({ skeleton: 'yMd' }), type: 'dateTime' };
|
|
3397
3318
|
}
|
|
3398
3319
|
else {
|
|
3399
3320
|
formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -3403,7 +3324,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3403
3324
|
}
|
|
3404
3325
|
else {
|
|
3405
3326
|
if (this.calendarMode === 'Gregorian') {
|
|
3406
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
3327
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
3407
3328
|
}
|
|
3408
3329
|
else {
|
|
3409
3330
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -3458,7 +3379,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3458
3379
|
}
|
|
3459
3380
|
}
|
|
3460
3381
|
bindEvents() {
|
|
3461
|
-
EventHandler.add(this.inputWrapper.buttons[0], 'mousedown touchstart',
|
|
3382
|
+
EventHandler.add(this.inputWrapper.buttons[0], 'mousedown touchstart', this.dateIconHandler, this);
|
|
3462
3383
|
EventHandler.add(this.inputElement, 'mouseup', this.mouseUpHandler, this);
|
|
3463
3384
|
EventHandler.add(this.inputElement, 'focus', this.inputFocusHandler, this);
|
|
3464
3385
|
EventHandler.add(this.inputElement, 'blur', this.inputBlurHandler, this);
|
|
@@ -3468,7 +3389,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3468
3389
|
this.bindInputEvent();
|
|
3469
3390
|
// To prevent the twice triggering.
|
|
3470
3391
|
EventHandler.add(this.inputElement, 'change', this.inputChangeHandler, this);
|
|
3471
|
-
if (this.showClearButton &&
|
|
3392
|
+
if (this.showClearButton && this.inputWrapper.clearButton) {
|
|
3472
3393
|
EventHandler.add(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler, this);
|
|
3473
3394
|
}
|
|
3474
3395
|
if (this.formElement) {
|
|
@@ -3505,7 +3426,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3505
3426
|
}
|
|
3506
3427
|
}
|
|
3507
3428
|
unBindEvents() {
|
|
3508
|
-
EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart',
|
|
3429
|
+
EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart', this.dateIconHandler);
|
|
3509
3430
|
EventHandler.remove(this.inputElement, 'mouseup', this.mouseUpHandler);
|
|
3510
3431
|
EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);
|
|
3511
3432
|
EventHandler.remove(this.inputElement, 'blur', this.inputBlurHandler);
|
|
@@ -3513,7 +3434,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3513
3434
|
if (this.enableMask) {
|
|
3514
3435
|
EventHandler.remove(this.inputElement, 'keydown', this.keydownHandler);
|
|
3515
3436
|
}
|
|
3516
|
-
if (this.showClearButton &&
|
|
3437
|
+
if (this.showClearButton && this.inputWrapper.clearButton) {
|
|
3517
3438
|
EventHandler.remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler);
|
|
3518
3439
|
}
|
|
3519
3440
|
if (this.formElement) {
|
|
@@ -3531,13 +3452,11 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3531
3452
|
this.inputValueCopy = null;
|
|
3532
3453
|
this.inputElement.setAttribute('value', '');
|
|
3533
3454
|
}
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
this.errorClass();
|
|
3540
|
-
}
|
|
3455
|
+
this.setProperties({ value: this.inputValueCopy }, true);
|
|
3456
|
+
this.restoreValue();
|
|
3457
|
+
if (this.inputElement) {
|
|
3458
|
+
this.updateInputValue(value);
|
|
3459
|
+
this.errorClass();
|
|
3541
3460
|
}
|
|
3542
3461
|
}
|
|
3543
3462
|
}
|
|
@@ -3546,7 +3465,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3546
3465
|
this.previousDate = this.value;
|
|
3547
3466
|
this.previousElementValue = (isNullOrUndefined(this.inputValueCopy)) ? '' :
|
|
3548
3467
|
this.globalize.formatDate(this.inputValueCopy, {
|
|
3549
|
-
format: this.formatString, type: 'dateTime', skeleton:
|
|
3468
|
+
format: this.formatString, type: 'dateTime', skeleton: 'yMd'
|
|
3550
3469
|
});
|
|
3551
3470
|
}
|
|
3552
3471
|
inputChangeHandler(e) {
|
|
@@ -3576,9 +3495,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3576
3495
|
}
|
|
3577
3496
|
}
|
|
3578
3497
|
clear(event) {
|
|
3579
|
-
|
|
3580
|
-
this.setProperties({ value: null }, true);
|
|
3581
|
-
}
|
|
3498
|
+
this.setProperties({ value: null }, true);
|
|
3582
3499
|
if (!this.enableMask) {
|
|
3583
3500
|
this.updateInputValue('');
|
|
3584
3501
|
}
|
|
@@ -3587,19 +3504,13 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3587
3504
|
};
|
|
3588
3505
|
this.trigger('cleared', clearedArgs);
|
|
3589
3506
|
this.invalidValueString = '';
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
});
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
if (this.isBlazorServer) {
|
|
3601
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3602
|
-
this.interopAdaptor.invokeMethodAsync('OnValueCleared');
|
|
3507
|
+
this.updateInput();
|
|
3508
|
+
this.popupUpdate();
|
|
3509
|
+
this.changeEvent(event);
|
|
3510
|
+
if (this.enableMask) {
|
|
3511
|
+
this.notify("clearHandler", {
|
|
3512
|
+
module: "MaskedDateTime"
|
|
3513
|
+
});
|
|
3603
3514
|
}
|
|
3604
3515
|
}
|
|
3605
3516
|
preventEventBubbling(e) {
|
|
@@ -3619,24 +3530,20 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3619
3530
|
this.inputElement.setAttribute('readonly', '');
|
|
3620
3531
|
this.inputElement.blur();
|
|
3621
3532
|
}
|
|
3622
|
-
|
|
3623
|
-
e.preventDefault();
|
|
3624
|
-
}
|
|
3533
|
+
e.preventDefault();
|
|
3625
3534
|
if (!this.readonly) {
|
|
3626
|
-
if (this.isCalendar()
|
|
3535
|
+
if (this.isCalendar()) {
|
|
3627
3536
|
this.hide(e);
|
|
3628
3537
|
}
|
|
3629
3538
|
else {
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
if (this.getModuleName() === 'datetimepicker') {
|
|
3634
|
-
this.inputElement.focus();
|
|
3635
|
-
}
|
|
3539
|
+
this.isDateIconClicked = true;
|
|
3540
|
+
this.show(null, e);
|
|
3541
|
+
if (this.getModuleName() === 'datetimepicker') {
|
|
3636
3542
|
this.inputElement.focus();
|
|
3637
|
-
addClass([this.inputWrapper.container], [INPUTFOCUS]);
|
|
3638
|
-
addClass(this.inputWrapper.buttons, ACTIVE);
|
|
3639
3543
|
}
|
|
3544
|
+
this.inputElement.focus();
|
|
3545
|
+
addClass([this.inputWrapper.container], [INPUTFOCUS]);
|
|
3546
|
+
addClass(this.inputWrapper.buttons, ACTIVE);
|
|
3640
3547
|
}
|
|
3641
3548
|
}
|
|
3642
3549
|
this.isIconClicked = false;
|
|
@@ -3735,7 +3642,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3735
3642
|
}
|
|
3736
3643
|
}
|
|
3737
3644
|
const focusArguments = {
|
|
3738
|
-
model:
|
|
3645
|
+
model: this
|
|
3739
3646
|
};
|
|
3740
3647
|
this.isDateIconClicked = false;
|
|
3741
3648
|
this.trigger('focus', focusArguments);
|
|
@@ -3756,32 +3663,26 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3756
3663
|
if (!this.enabled) {
|
|
3757
3664
|
return;
|
|
3758
3665
|
}
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3666
|
+
this.strictModeUpdate();
|
|
3667
|
+
if (this.inputElement.value === '' && isNullOrUndefined(this.value)) {
|
|
3668
|
+
this.invalidValueString = null;
|
|
3669
|
+
this.updateInputValue('');
|
|
3670
|
+
}
|
|
3671
|
+
this.updateInput();
|
|
3672
|
+
this.popupUpdate();
|
|
3673
|
+
this.changeTrigger(e);
|
|
3674
|
+
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
3675
|
+
if (this.inputElement.value == this.maskedDateValue && !this.value && (this.floatLabelType == 'Auto' || this.floatLabelType == 'Never' || this.placeholder)) {
|
|
3763
3676
|
this.updateInputValue('');
|
|
3764
3677
|
}
|
|
3765
|
-
this.updateInput();
|
|
3766
|
-
this.popupUpdate();
|
|
3767
|
-
this.changeTrigger(e);
|
|
3768
|
-
if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
3769
|
-
if (this.inputElement.value == this.maskedDateValue && !this.value && (this.floatLabelType == 'Auto' || this.floatLabelType == 'Never' || this.placeholder)) {
|
|
3770
|
-
this.updateInputValue('');
|
|
3771
|
-
}
|
|
3772
|
-
}
|
|
3773
|
-
this.errorClass();
|
|
3774
|
-
}
|
|
3775
|
-
else {
|
|
3776
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3777
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
3778
3678
|
}
|
|
3679
|
+
this.errorClass();
|
|
3779
3680
|
if (this.isCalendar() && document.activeElement === this.inputElement) {
|
|
3780
3681
|
this.hide(e);
|
|
3781
3682
|
}
|
|
3782
3683
|
if (this.getModuleName() === 'datepicker') {
|
|
3783
3684
|
const blurArguments = {
|
|
3784
|
-
model:
|
|
3685
|
+
model: this
|
|
3785
3686
|
};
|
|
3786
3687
|
this.trigger('blur', blurArguments);
|
|
3787
3688
|
}
|
|
@@ -3819,7 +3720,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3819
3720
|
else if (closest(target, '.e-footer-container')
|
|
3820
3721
|
&& target.classList.contains('e-today')
|
|
3821
3722
|
&& target.classList.contains('e-btn')
|
|
3822
|
-
&& (+new Date(+this.value) === +super.generateTodayVal(this.value)
|
|
3723
|
+
&& (+new Date(+this.value) === +super.generateTodayVal(this.value))) {
|
|
3823
3724
|
this.hide(e);
|
|
3824
3725
|
}
|
|
3825
3726
|
}
|
|
@@ -3834,40 +3735,22 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3834
3735
|
break;
|
|
3835
3736
|
case 'altDownArrow':
|
|
3836
3737
|
this.isAltKeyPressed = true;
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
this.changeTrigger(e);
|
|
3841
|
-
}
|
|
3842
|
-
else {
|
|
3843
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3844
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
3845
|
-
}
|
|
3738
|
+
this.strictModeUpdate();
|
|
3739
|
+
this.updateInput();
|
|
3740
|
+
this.changeTrigger(e);
|
|
3846
3741
|
if (this.getModuleName() === 'datepicker') {
|
|
3847
|
-
|
|
3848
|
-
this.show(null, e);
|
|
3849
|
-
}
|
|
3850
|
-
else {
|
|
3851
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3852
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', true);
|
|
3853
|
-
}
|
|
3742
|
+
this.show(null, e);
|
|
3854
3743
|
}
|
|
3855
3744
|
break;
|
|
3856
3745
|
case 'escape':
|
|
3857
3746
|
this.hide(e);
|
|
3858
3747
|
break;
|
|
3859
3748
|
case 'enter':
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
this.errorClass();
|
|
3866
|
-
}
|
|
3867
|
-
else {
|
|
3868
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3869
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
3870
|
-
}
|
|
3749
|
+
this.strictModeUpdate();
|
|
3750
|
+
this.updateInput();
|
|
3751
|
+
this.popupUpdate();
|
|
3752
|
+
this.changeTrigger(e);
|
|
3753
|
+
this.errorClass();
|
|
3871
3754
|
if (!this.isCalendar() && document.activeElement === this.inputElement) {
|
|
3872
3755
|
this.hide(e);
|
|
3873
3756
|
}
|
|
@@ -3892,17 +3775,11 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3892
3775
|
start = this.inputElement.selectionStart;
|
|
3893
3776
|
end = this.inputElement.selectionEnd;
|
|
3894
3777
|
}
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
this.errorClass();
|
|
3901
|
-
}
|
|
3902
|
-
else {
|
|
3903
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3904
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
|
|
3905
|
-
}
|
|
3778
|
+
this.strictModeUpdate();
|
|
3779
|
+
this.updateInput();
|
|
3780
|
+
this.popupUpdate();
|
|
3781
|
+
this.changeTrigger(e);
|
|
3782
|
+
this.errorClass();
|
|
3906
3783
|
if (this.enableMask) {
|
|
3907
3784
|
this.inputElement.selectionStart = start;
|
|
3908
3785
|
this.inputElement.selectionEnd = end;
|
|
@@ -3921,7 +3798,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3921
3798
|
this.previousDate = ((!isNullOrUndefined(this.value) && new Date(+this.value)) || null);
|
|
3922
3799
|
if (this.isCalendar()) {
|
|
3923
3800
|
super.keyActionHandle(e);
|
|
3924
|
-
if (
|
|
3801
|
+
if (this.isCalendar()) {
|
|
3925
3802
|
attributes(this.inputElement, {
|
|
3926
3803
|
'aria-activedescendant': '' + this.setActiveDescendant()
|
|
3927
3804
|
});
|
|
@@ -3936,7 +3813,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3936
3813
|
removeClass(this.popupObj.element.querySelectorAll('.' + SELECTED$2), [SELECTED$2]);
|
|
3937
3814
|
}
|
|
3938
3815
|
}
|
|
3939
|
-
if (!isNullOrUndefined(this.value)
|
|
3816
|
+
if (!isNullOrUndefined(this.value)) {
|
|
3940
3817
|
if ((+this.value >= +this.min) && (+this.value <= +this.max)) {
|
|
3941
3818
|
const targetdate = new Date(this.checkValue(this.value));
|
|
3942
3819
|
super.navigateTo('Month', targetdate);
|
|
@@ -3964,7 +3841,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3964
3841
|
if (this.calendarMode === 'Gregorian') {
|
|
3965
3842
|
dateOptions = {
|
|
3966
3843
|
format: !isNullOrUndefined(this.formatString) ? this.formatString : this.dateTimeFormat,
|
|
3967
|
-
type: 'dateTime', skeleton:
|
|
3844
|
+
type: 'dateTime', skeleton: 'yMd'
|
|
3968
3845
|
};
|
|
3969
3846
|
}
|
|
3970
3847
|
else {
|
|
@@ -3976,7 +3853,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3976
3853
|
}
|
|
3977
3854
|
else {
|
|
3978
3855
|
if (this.calendarMode === 'Gregorian') {
|
|
3979
|
-
formatOptions = { format: format, type: 'dateTime', skeleton:
|
|
3856
|
+
formatOptions = { format: format, type: 'dateTime', skeleton: 'yMd' };
|
|
3980
3857
|
}
|
|
3981
3858
|
else {
|
|
3982
3859
|
formatOptions = { format: format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -3993,7 +3870,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
3993
3870
|
}
|
|
3994
3871
|
else {
|
|
3995
3872
|
if (this.calendarMode === 'Gregorian') {
|
|
3996
|
-
formatOptions = { type: 'dateTime', skeleton:
|
|
3873
|
+
formatOptions = { type: 'dateTime', skeleton: 'yMd' };
|
|
3997
3874
|
}
|
|
3998
3875
|
else {
|
|
3999
3876
|
formatOptions = { type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -4037,17 +3914,9 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4037
3914
|
}
|
|
4038
3915
|
}
|
|
4039
3916
|
createCalendar() {
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
this.popupWrapper.className += ' ' + this.cssClass;
|
|
4044
|
-
}
|
|
4045
|
-
}
|
|
4046
|
-
else {
|
|
4047
|
-
this.popupWrapper = this.inputWrapper.container.nextElementSibling;
|
|
4048
|
-
this.calendarElement = this.popupWrapper.firstElementChild;
|
|
4049
|
-
this.tableBodyElement = select('tbody', this.calendarElement);
|
|
4050
|
-
this.contentElement = select('.e-content', this.calendarElement);
|
|
3917
|
+
this.popupWrapper = this.createElement('div', { className: '' + ROOT$1 + ' ' + POPUPWRAPPER });
|
|
3918
|
+
if (!isNullOrUndefined(this.cssClass)) {
|
|
3919
|
+
this.popupWrapper.className += ' ' + this.cssClass;
|
|
4051
3920
|
}
|
|
4052
3921
|
if (Browser.isDevice) {
|
|
4053
3922
|
this.modelHeader();
|
|
@@ -4060,7 +3929,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4060
3929
|
//this.calendarElement represent the Calendar object from the Calendar class.
|
|
4061
3930
|
this.calendarElement.querySelector('table tbody').className = '';
|
|
4062
3931
|
this.popupObj = new Popup(this.popupWrapper, {
|
|
4063
|
-
content: this.
|
|
3932
|
+
content: this.calendarElement,
|
|
4064
3933
|
relateTo: Browser.isDevice ? document.body : this.inputWrapper.container,
|
|
4065
3934
|
position: Browser.isDevice ? { X: 'center', Y: 'center' } : { X: 'left', Y: 'bottom' },
|
|
4066
3935
|
offsetY: OFFSETVALUE,
|
|
@@ -4089,7 +3958,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4089
3958
|
if (this.isDateIconClicked) {
|
|
4090
3959
|
this.inputWrapper.container.children[this.index].focus();
|
|
4091
3960
|
}
|
|
4092
|
-
if (this.value
|
|
3961
|
+
if (this.value) {
|
|
4093
3962
|
this.disabledDates();
|
|
4094
3963
|
}
|
|
4095
3964
|
if (this.popupObj) {
|
|
@@ -4107,9 +3976,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4107
3976
|
}
|
|
4108
3977
|
}
|
|
4109
3978
|
});
|
|
4110
|
-
|
|
4111
|
-
this.popupObj.element.className += ' ' + this.cssClass;
|
|
4112
|
-
}
|
|
3979
|
+
this.popupObj.element.className += ' ' + this.cssClass;
|
|
4113
3980
|
this.setAriaAttributes();
|
|
4114
3981
|
}
|
|
4115
3982
|
setAriaDisabled() {
|
|
@@ -4222,7 +4089,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4222
4089
|
if (this.value) {
|
|
4223
4090
|
if (this.getModuleName() === 'datetimepicker') {
|
|
4224
4091
|
if (this.calendarMode === 'Gregorian') {
|
|
4225
|
-
formatOptions = { format: tempFormat, type: 'dateTime', skeleton:
|
|
4092
|
+
formatOptions = { format: tempFormat, type: 'dateTime', skeleton: 'yMd' };
|
|
4226
4093
|
}
|
|
4227
4094
|
else {
|
|
4228
4095
|
formatOptions = { format: tempFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -4231,7 +4098,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4231
4098
|
}
|
|
4232
4099
|
else {
|
|
4233
4100
|
if (this.calendarMode === 'Gregorian') {
|
|
4234
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
4101
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
4235
4102
|
}
|
|
4236
4103
|
else {
|
|
4237
4104
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -4286,18 +4153,14 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4286
4153
|
let outOfRange;
|
|
4287
4154
|
if (!isNullOrUndefined(this.value) && !(+this.value >= +this.min && +this.value <= +this.max)) {
|
|
4288
4155
|
outOfRange = new Date(this.checkValue(this.value));
|
|
4289
|
-
|
|
4290
|
-
this.setProperties({ 'value': null }, true);
|
|
4291
|
-
}
|
|
4156
|
+
this.setProperties({ 'value': null }, true);
|
|
4292
4157
|
}
|
|
4293
4158
|
else {
|
|
4294
4159
|
outOfRange = this.value || null;
|
|
4295
4160
|
}
|
|
4296
4161
|
if (!this.isCalendar()) {
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
this.setProperties({ 'value': outOfRange || null }, true);
|
|
4300
|
-
}
|
|
4162
|
+
super.render();
|
|
4163
|
+
this.setProperties({ 'value': outOfRange || null }, true);
|
|
4301
4164
|
this.previousDate = outOfRange;
|
|
4302
4165
|
this.createCalendar();
|
|
4303
4166
|
}
|
|
@@ -4309,7 +4172,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4309
4172
|
preventDefault: () => {
|
|
4310
4173
|
prevent = false;
|
|
4311
4174
|
},
|
|
4312
|
-
popup:
|
|
4175
|
+
popup: this.popupObj,
|
|
4313
4176
|
event: e || null,
|
|
4314
4177
|
cancel: false,
|
|
4315
4178
|
appendTo: Browser.isDevice ? this.mobilePopupWrapper : document.body
|
|
@@ -4318,11 +4181,6 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4318
4181
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
4319
4182
|
this.preventArgs = eventArgs;
|
|
4320
4183
|
if (prevent && !this.preventArgs.cancel) {
|
|
4321
|
-
if (this.isBlazorServer) {
|
|
4322
|
-
this.popupWrapper.style.visibility = '';
|
|
4323
|
-
this.popupWrapper.style.width = 'auto';
|
|
4324
|
-
this.popupWrapper.style.height = 'auto';
|
|
4325
|
-
}
|
|
4326
4184
|
addClass(this.inputWrapper.buttons, ACTIVE);
|
|
4327
4185
|
this.preventArgs.appendTo.appendChild(this.popupWrapper);
|
|
4328
4186
|
this.popupObj.refreshPosition(this.inputElement);
|
|
@@ -4336,18 +4194,12 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4336
4194
|
else {
|
|
4337
4195
|
this.popupObj.show(new Animation(openAnimation), null);
|
|
4338
4196
|
}
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
super.setOverlayIndex(this.mobilePopupWrapper, this.popupObj.element, this.modal, Browser.isDevice);
|
|
4342
|
-
}
|
|
4197
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4198
|
+
super.setOverlayIndex(this.mobilePopupWrapper, this.popupObj.element, this.modal, Browser.isDevice);
|
|
4343
4199
|
this.setAriaAttributes();
|
|
4344
4200
|
}
|
|
4345
4201
|
else {
|
|
4346
4202
|
this.popupObj.destroy();
|
|
4347
|
-
if (this.isBlazorServer) {
|
|
4348
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4349
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
|
|
4350
|
-
}
|
|
4351
4203
|
this.popupWrapper = this.popupObj = null;
|
|
4352
4204
|
}
|
|
4353
4205
|
if (!isNullOrUndefined(this.inputElement) && this.inputElement.value === '') {
|
|
@@ -4373,7 +4225,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4373
4225
|
preventDefault: () => {
|
|
4374
4226
|
prevent = false;
|
|
4375
4227
|
},
|
|
4376
|
-
popup:
|
|
4228
|
+
popup: this.popupObj,
|
|
4377
4229
|
event: event || null,
|
|
4378
4230
|
cancel: false
|
|
4379
4231
|
};
|
|
@@ -4400,17 +4252,9 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4400
4252
|
closeEventCallback(prevent, eventArgs) {
|
|
4401
4253
|
this.preventArgs = eventArgs;
|
|
4402
4254
|
if (this.isCalendar() && (prevent && !this.preventArgs.cancel)) {
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
this.keyboardModule.destroy();
|
|
4407
|
-
}
|
|
4408
|
-
else {
|
|
4409
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4410
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
|
|
4411
|
-
this.isAltKeyPressed = false;
|
|
4412
|
-
this.popupWrapper = this.popupObj = null;
|
|
4413
|
-
}
|
|
4255
|
+
this.popupObj.hide();
|
|
4256
|
+
this.isAltKeyPressed = false;
|
|
4257
|
+
this.keyboardModule.destroy();
|
|
4414
4258
|
removeClass(this.inputWrapper.buttons, ACTIVE);
|
|
4415
4259
|
}
|
|
4416
4260
|
this.setAriaAttributes();
|
|
@@ -4493,12 +4337,10 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4493
4337
|
*/
|
|
4494
4338
|
destroy() {
|
|
4495
4339
|
this.unBindEvents();
|
|
4496
|
-
|
|
4340
|
+
super.destroy();
|
|
4341
|
+
this.keyboardModules.destroy();
|
|
4342
|
+
if (this.popupObj && this.popupObj.element.classList.contains(POPUP)) {
|
|
4497
4343
|
super.destroy();
|
|
4498
|
-
this.keyboardModules.destroy();
|
|
4499
|
-
if (this.popupObj && this.popupObj.element.classList.contains(POPUP)) {
|
|
4500
|
-
super.destroy();
|
|
4501
|
-
}
|
|
4502
4344
|
}
|
|
4503
4345
|
const ariaAttrs = {
|
|
4504
4346
|
'aria-live': 'assertive', 'aria-atomic': 'true', 'aria-disabled': 'true',
|
|
@@ -4523,9 +4365,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4523
4365
|
detach(this.popupWrapper);
|
|
4524
4366
|
}
|
|
4525
4367
|
this.popupObj = this.popupWrapper = null;
|
|
4526
|
-
|
|
4527
|
-
this.keyboardModule.destroy();
|
|
4528
|
-
}
|
|
4368
|
+
this.keyboardModule.destroy();
|
|
4529
4369
|
}
|
|
4530
4370
|
if (this.ngTag === null) {
|
|
4531
4371
|
if (this.inputElement) {
|
|
@@ -4571,45 +4411,40 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4571
4411
|
this.inputElement = this.element;
|
|
4572
4412
|
this.formElement = closest(this.inputElement, 'form');
|
|
4573
4413
|
this.index = this.showClearButton ? 2 : 1;
|
|
4574
|
-
this.
|
|
4575
|
-
if (
|
|
4576
|
-
this.ngTag =
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4414
|
+
this.ngTag = null;
|
|
4415
|
+
if (this.element.tagName === 'EJS-DATEPICKER' || this.element.tagName === 'EJS-DATETIMEPICKER') {
|
|
4416
|
+
this.ngTag = this.element.tagName;
|
|
4417
|
+
this.inputElement = this.createElement('input');
|
|
4418
|
+
this.element.appendChild(this.inputElement);
|
|
4419
|
+
}
|
|
4420
|
+
if (this.element.getAttribute('id')) {
|
|
4421
|
+
if (this.ngTag !== null) {
|
|
4422
|
+
this.inputElement.id = this.element.getAttribute('id') + '_input';
|
|
4581
4423
|
}
|
|
4582
|
-
|
|
4424
|
+
}
|
|
4425
|
+
else {
|
|
4426
|
+
if (this.getModuleName() === 'datetimepicker') {
|
|
4427
|
+
this.element.id = getUniqueID('ej2-datetimepicker');
|
|
4583
4428
|
if (this.ngTag !== null) {
|
|
4584
|
-
this.inputElement
|
|
4429
|
+
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
4585
4430
|
}
|
|
4586
4431
|
}
|
|
4587
4432
|
else {
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
4592
|
-
}
|
|
4593
|
-
}
|
|
4594
|
-
else {
|
|
4595
|
-
this.element.id = getUniqueID('ej2-datepicker');
|
|
4596
|
-
if (this.ngTag !== null) {
|
|
4597
|
-
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
4598
|
-
}
|
|
4433
|
+
this.element.id = getUniqueID('ej2-datepicker');
|
|
4434
|
+
if (this.ngTag !== null) {
|
|
4435
|
+
attributes(this.inputElement, { 'id': this.element.id + '_input' });
|
|
4599
4436
|
}
|
|
4600
4437
|
}
|
|
4601
|
-
if (this.ngTag !== null) {
|
|
4602
|
-
this.validationAttribute(this.element, this.inputElement);
|
|
4603
|
-
}
|
|
4604
|
-
this.updateHtmlAttributeToElement();
|
|
4605
4438
|
}
|
|
4439
|
+
if (this.ngTag !== null) {
|
|
4440
|
+
this.validationAttribute(this.element, this.inputElement);
|
|
4441
|
+
}
|
|
4442
|
+
this.updateHtmlAttributeToElement();
|
|
4606
4443
|
this.defaultKeyConfigs = this.getDefaultKeyConfig();
|
|
4607
4444
|
this.checkHtmlAttributes(false);
|
|
4608
4445
|
this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
super.preRender();
|
|
4612
|
-
}
|
|
4446
|
+
this.element.removeAttribute('tabindex');
|
|
4447
|
+
super.preRender();
|
|
4613
4448
|
}
|
|
4614
4449
|
getDefaultKeyConfig() {
|
|
4615
4450
|
this.defaultKeyConfigs = {
|
|
@@ -4655,7 +4490,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4655
4490
|
const culture = new Internationalization(this.locale);
|
|
4656
4491
|
if (this.format) {
|
|
4657
4492
|
if (typeof this.format === 'string') {
|
|
4658
|
-
this.formatString =
|
|
4493
|
+
this.formatString = this.format;
|
|
4659
4494
|
}
|
|
4660
4495
|
else if (this.format.skeleton !== '' && !isNullOrUndefined(this.format.skeleton)) {
|
|
4661
4496
|
const skeletonString = this.format.skeleton;
|
|
@@ -4690,7 +4525,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4690
4525
|
if (this.calendarMode === 'Gregorian') {
|
|
4691
4526
|
options = {
|
|
4692
4527
|
format: !isNullOrUndefined(this.formatString) ? this.formatString : this.dateTimeFormat,
|
|
4693
|
-
type: 'dateTime', skeleton:
|
|
4528
|
+
type: 'dateTime', skeleton: 'yMd'
|
|
4694
4529
|
};
|
|
4695
4530
|
}
|
|
4696
4531
|
else {
|
|
@@ -4702,7 +4537,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4702
4537
|
}
|
|
4703
4538
|
else {
|
|
4704
4539
|
if (this.calendarMode === 'Gregorian') {
|
|
4705
|
-
options = { format: this.formatString, type: 'dateTime', skeleton:
|
|
4540
|
+
options = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
4706
4541
|
}
|
|
4707
4542
|
else {
|
|
4708
4543
|
options = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -4712,8 +4547,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4712
4547
|
if (!isNullOrUndefined(this.inputElement.getAttribute(prop))) {
|
|
4713
4548
|
switch (prop) {
|
|
4714
4549
|
case 'disabled':
|
|
4715
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['enabled'] === undefined)) || dynamic)
|
|
4716
|
-
!this.isBlazorServer) {
|
|
4550
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['enabled'] === undefined)) || dynamic)) {
|
|
4717
4551
|
const enabled = this.inputElement.getAttribute(prop) === 'disabled' ||
|
|
4718
4552
|
this.inputElement.getAttribute(prop) === '' ||
|
|
4719
4553
|
this.inputElement.getAttribute(prop) === 'true' ? false : true;
|
|
@@ -4721,32 +4555,25 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4721
4555
|
}
|
|
4722
4556
|
break;
|
|
4723
4557
|
case 'readonly':
|
|
4724
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['readonly'] === undefined)) || dynamic)
|
|
4725
|
-
!this.isBlazorServer) {
|
|
4558
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['readonly'] === undefined)) || dynamic)) {
|
|
4726
4559
|
const readonly = this.inputElement.getAttribute(prop) === 'readonly' ||
|
|
4727
4560
|
this.inputElement.getAttribute(prop) === '' || this.inputElement.getAttribute(prop) === 'true' ? true : false;
|
|
4728
4561
|
this.setProperties({ readonly: readonly }, !dynamic);
|
|
4729
4562
|
}
|
|
4730
4563
|
break;
|
|
4731
4564
|
case 'placeholder':
|
|
4732
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['placeholder'] === undefined)) || dynamic)
|
|
4733
|
-
!this.isBlazorServer) {
|
|
4565
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['placeholder'] === undefined)) || dynamic)) {
|
|
4734
4566
|
this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !dynamic);
|
|
4735
4567
|
}
|
|
4736
4568
|
break;
|
|
4737
4569
|
case 'style':
|
|
4738
|
-
|
|
4739
|
-
this.inputElement.setAttribute('style', '' + this.inputElement.getAttribute(prop));
|
|
4740
|
-
}
|
|
4570
|
+
this.inputElement.setAttribute('style', '' + this.inputElement.getAttribute(prop));
|
|
4741
4571
|
break;
|
|
4742
4572
|
case 'name':
|
|
4743
|
-
|
|
4744
|
-
this.inputElement.setAttribute('name', '' + this.inputElement.getAttribute(prop));
|
|
4745
|
-
}
|
|
4573
|
+
this.inputElement.setAttribute('name', '' + this.inputElement.getAttribute(prop));
|
|
4746
4574
|
break;
|
|
4747
4575
|
case 'value':
|
|
4748
|
-
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['value'] === undefined)) || dynamic)
|
|
4749
|
-
!this.isBlazorServer) {
|
|
4576
|
+
if (((isNullOrUndefined(this.datepickerOptions) || (this.datepickerOptions['value'] === undefined)) || dynamic)) {
|
|
4750
4577
|
const value = this.inputElement.getAttribute(prop);
|
|
4751
4578
|
this.setProperties(setValue(prop, this.globalize.parseDate(value, options), {}), !dynamic);
|
|
4752
4579
|
}
|
|
@@ -4764,7 +4591,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4764
4591
|
}
|
|
4765
4592
|
break;
|
|
4766
4593
|
case 'type':
|
|
4767
|
-
if (this.inputElement.getAttribute(prop) !== 'text'
|
|
4594
|
+
if (this.inputElement.getAttribute(prop) !== 'text') {
|
|
4768
4595
|
this.inputElement.setAttribute('type', 'text');
|
|
4769
4596
|
}
|
|
4770
4597
|
break;
|
|
@@ -4788,9 +4615,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4788
4615
|
const previousValCopy = this.previousDate;
|
|
4789
4616
|
//calls the Calendar render method to check the disabled dates through renderDayCell event and update the input value accordingly.
|
|
4790
4617
|
this.minMaxUpdates();
|
|
4791
|
-
|
|
4792
|
-
super.render();
|
|
4793
|
-
}
|
|
4618
|
+
super.render();
|
|
4794
4619
|
this.previousDate = previousValCopy;
|
|
4795
4620
|
const date = valueCopy && +(valueCopy);
|
|
4796
4621
|
const dateIdString = '*[id^="/id"]'.replace('/id', '' + date);
|
|
@@ -4811,7 +4636,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4811
4636
|
if (this.calendarMode === 'Gregorian') {
|
|
4812
4637
|
globalize = this.globalize.formatDate(valueCopy, {
|
|
4813
4638
|
format: !isNullOrUndefined(this.formatString) ? this.formatString : this.dateTimeFormat,
|
|
4814
|
-
type: 'dateTime', skeleton:
|
|
4639
|
+
type: 'dateTime', skeleton: 'yMd'
|
|
4815
4640
|
});
|
|
4816
4641
|
}
|
|
4817
4642
|
else {
|
|
@@ -4824,7 +4649,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4824
4649
|
}
|
|
4825
4650
|
else {
|
|
4826
4651
|
if (this.calendarMode === 'Gregorian') {
|
|
4827
|
-
formatOptions = { format: this.formatString, type: 'dateTime', skeleton:
|
|
4652
|
+
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd' };
|
|
4828
4653
|
}
|
|
4829
4654
|
else {
|
|
4830
4655
|
formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -4842,26 +4667,13 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4842
4667
|
}
|
|
4843
4668
|
}
|
|
4844
4669
|
setAriaAttributes() {
|
|
4845
|
-
if (this.
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
const selectedEle = this.tableBodyElement.querySelector('tr td.e-selected');
|
|
4849
|
-
const id = (focusedEle || selectedEle) ? (focusedEle || selectedEle).getAttribute('id') : 'null';
|
|
4850
|
-
attributes(this.inputElement, { 'aria-activedescendant': '' + id });
|
|
4851
|
-
}
|
|
4852
|
-
else {
|
|
4853
|
-
attributes(this.inputElement, { 'aria-activedescendant': 'null' });
|
|
4854
|
-
}
|
|
4670
|
+
if (this.isCalendar()) {
|
|
4671
|
+
Input.addAttributes({ 'aria-expanded': 'true' }, this.inputElement);
|
|
4672
|
+
attributes(this.inputElement, { 'aria-activedescendant': '' + this.setActiveDescendant() });
|
|
4855
4673
|
}
|
|
4856
4674
|
else {
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
attributes(this.inputElement, { 'aria-activedescendant': '' + this.setActiveDescendant() });
|
|
4860
|
-
}
|
|
4861
|
-
else {
|
|
4862
|
-
Input.addAttributes({ 'aria-expanded': 'false' }, this.inputElement);
|
|
4863
|
-
attributes(this.inputElement, { 'aria-activedescendant': 'null' });
|
|
4864
|
-
}
|
|
4675
|
+
Input.addAttributes({ 'aria-expanded': 'false' }, this.inputElement);
|
|
4676
|
+
attributes(this.inputElement, { 'aria-activedescendant': 'null' });
|
|
4865
4677
|
}
|
|
4866
4678
|
}
|
|
4867
4679
|
errorClass() {
|
|
@@ -4895,20 +4707,16 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4895
4707
|
this.isDynamicValueChanged = true;
|
|
4896
4708
|
this.isInteracted = false;
|
|
4897
4709
|
this.invalidValueString = null;
|
|
4898
|
-
|
|
4899
|
-
this.checkInvalidValue(newProp.value);
|
|
4900
|
-
}
|
|
4710
|
+
this.checkInvalidValue(newProp.value);
|
|
4901
4711
|
newProp.value = this.value;
|
|
4902
4712
|
this.previousElementValue = this.inputElement.value;
|
|
4903
|
-
if (
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
this.changeTrigger(null);
|
|
4911
|
-
}
|
|
4713
|
+
if (isNullOrUndefined(this.value)) {
|
|
4714
|
+
this.updateInputValue('');
|
|
4715
|
+
this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
|
|
4716
|
+
}
|
|
4717
|
+
this.updateInput(true);
|
|
4718
|
+
if (+this.previousDate !== +this.value) {
|
|
4719
|
+
this.changeTrigger(null);
|
|
4912
4720
|
}
|
|
4913
4721
|
this.isInteracted = true;
|
|
4914
4722
|
this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
|
|
@@ -4921,15 +4729,13 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4921
4729
|
case 'format':
|
|
4922
4730
|
this.checkFormat();
|
|
4923
4731
|
this.bindInputEvent();
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
this.updateInputValue(this.maskedDateValue);
|
|
4932
|
-
}
|
|
4732
|
+
this.updateInput();
|
|
4733
|
+
if (this.enableMask) {
|
|
4734
|
+
this.notify("createMask", {
|
|
4735
|
+
module: "MaskedDateTime",
|
|
4736
|
+
});
|
|
4737
|
+
if (!this.value) {
|
|
4738
|
+
this.updateInputValue(this.maskedDateValue);
|
|
4933
4739
|
}
|
|
4934
4740
|
}
|
|
4935
4741
|
break;
|
|
@@ -4956,13 +4762,11 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4956
4762
|
this.l10n.setLocale(this.locale);
|
|
4957
4763
|
this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
|
|
4958
4764
|
Input.setPlaceholder(this.placeholder, this.inputElement);
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
});
|
|
4965
|
-
}
|
|
4765
|
+
this.updateInput();
|
|
4766
|
+
if (this.enableMask) {
|
|
4767
|
+
this.notify("createMask", {
|
|
4768
|
+
module: "MaskedDateTime",
|
|
4769
|
+
});
|
|
4966
4770
|
}
|
|
4967
4771
|
break;
|
|
4968
4772
|
case 'enableRtl':
|
|
@@ -4971,7 +4775,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4971
4775
|
case 'start':
|
|
4972
4776
|
case 'depth':
|
|
4973
4777
|
this.checkView();
|
|
4974
|
-
if (this.calendarElement
|
|
4778
|
+
if (this.calendarElement) {
|
|
4975
4779
|
super.onPropertyChanged(newProp, oldProp);
|
|
4976
4780
|
}
|
|
4977
4781
|
break;
|
|
@@ -4988,9 +4792,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
4988
4792
|
break;
|
|
4989
4793
|
case 'strictMode':
|
|
4990
4794
|
this.invalidValueString = null;
|
|
4991
|
-
|
|
4992
|
-
this.updateInput();
|
|
4993
|
-
}
|
|
4795
|
+
this.updateInput();
|
|
4994
4796
|
break;
|
|
4995
4797
|
case 'width':
|
|
4996
4798
|
this.setWidth(newProp.width);
|
|
@@ -5015,7 +4817,7 @@ let DatePicker = class DatePicker extends Calendar {
|
|
|
5015
4817
|
}
|
|
5016
4818
|
break;
|
|
5017
4819
|
default:
|
|
5018
|
-
if (this.calendarElement &&
|
|
4820
|
+
if (this.calendarElement && this.isCalendar()) {
|
|
5019
4821
|
super.onPropertyChanged(newProp, oldProp);
|
|
5020
4822
|
}
|
|
5021
4823
|
break;
|
|
@@ -5620,7 +5422,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
5620
5422
|
}
|
|
5621
5423
|
updateHiddenInput() {
|
|
5622
5424
|
if (this.firstHiddenChild && this.secondHiddenChild) {
|
|
5623
|
-
const format = { type: 'datetime', skeleton:
|
|
5425
|
+
const format = { type: 'datetime', skeleton: 'yMd' };
|
|
5624
5426
|
if (typeof this.startDate === 'string') {
|
|
5625
5427
|
this.startDate = this.globalize.parseDate(this.startDate, format);
|
|
5626
5428
|
}
|
|
@@ -5760,7 +5562,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
5760
5562
|
const attributes$$1 = isDynamic ? isNullOrUndefined(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
|
|
5761
5563
|
['startDate', 'endDate', 'minDays', 'maxDays', 'min', 'max', 'disabled', 'readonly', 'style', 'name', 'placeholder',
|
|
5762
5564
|
'type', 'value'];
|
|
5763
|
-
const format = { format: this.formatString, type: 'date', skeleton:
|
|
5565
|
+
const format = { format: this.formatString, type: 'date', skeleton: 'yMd' };
|
|
5764
5566
|
for (const prop of attributes$$1) {
|
|
5765
5567
|
if (!isNullOrUndefined(this.inputElement.getAttribute(prop))) {
|
|
5766
5568
|
switch (prop) {
|
|
@@ -6014,7 +5816,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6014
5816
|
}
|
|
6015
5817
|
this.preventBlur = false;
|
|
6016
5818
|
const focusArguments = {
|
|
6017
|
-
model:
|
|
5819
|
+
model: this
|
|
6018
5820
|
};
|
|
6019
5821
|
if (!this.preventFocus) {
|
|
6020
5822
|
this.trigger('focus', focusArguments);
|
|
@@ -6045,7 +5847,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6045
5847
|
const range = value.split(' ' + this.separator + ' ');
|
|
6046
5848
|
if (range.length > 1) {
|
|
6047
5849
|
this.invalidValueString = null;
|
|
6048
|
-
const dateOptions = { format: this.formatString, type: 'date', skeleton:
|
|
5850
|
+
const dateOptions = { format: this.formatString, type: 'date', skeleton: 'yMd' };
|
|
6049
5851
|
const startDate = this.globalize.parseDate(range[0].trim(), dateOptions);
|
|
6050
5852
|
const endDate = this.globalize.parseDate(range[1].trim(), dateOptions);
|
|
6051
5853
|
if (!isNullOrUndefined(startDate) && !isNaN(+startDate) && !isNullOrUndefined(endDate) && !isNaN(+endDate)) {
|
|
@@ -6061,7 +5863,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6061
5863
|
if (!this.preventBlur && document.activeElement !== this.inputElement) {
|
|
6062
5864
|
this.preventFocus = false;
|
|
6063
5865
|
const blurArguments = {
|
|
6064
|
-
model:
|
|
5866
|
+
model: this
|
|
6065
5867
|
};
|
|
6066
5868
|
this.trigger('blur', blurArguments);
|
|
6067
5869
|
}
|
|
@@ -6112,7 +5914,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6112
5914
|
if (!this.preventBlur && document.activeElement !== this.inputElement) {
|
|
6113
5915
|
this.preventFocus = false;
|
|
6114
5916
|
const blurArguments = {
|
|
6115
|
-
model:
|
|
5917
|
+
model: this
|
|
6116
5918
|
};
|
|
6117
5919
|
this.trigger('blur', blurArguments);
|
|
6118
5920
|
}
|
|
@@ -6667,11 +6469,11 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6667
6469
|
let range;
|
|
6668
6470
|
const startDate = !isNullOrUndefined(this.startValue) ?
|
|
6669
6471
|
this.globalize.formatDate(this.startValue, {
|
|
6670
|
-
format: this.formatString, type: 'date', skeleton:
|
|
6472
|
+
format: this.formatString, type: 'date', skeleton: 'yMd'
|
|
6671
6473
|
}) : null;
|
|
6672
6474
|
const endDate = !isNullOrUndefined(this.endValue) ?
|
|
6673
6475
|
this.globalize.formatDate(this.endValue, {
|
|
6674
|
-
format: this.formatString, type: 'date', skeleton:
|
|
6476
|
+
format: this.formatString, type: 'date', skeleton: 'yMd'
|
|
6675
6477
|
}) : null;
|
|
6676
6478
|
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue)) {
|
|
6677
6479
|
inputValue = startDate + ' ' + this.separator + ' ' + endDate;
|
|
@@ -7026,7 +6828,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
7026
6828
|
}
|
|
7027
6829
|
}
|
|
7028
6830
|
updateHeader() {
|
|
7029
|
-
const format = { type: 'date', skeleton:
|
|
6831
|
+
const format = { type: 'date', skeleton: 'yMMMd' };
|
|
7030
6832
|
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue)) {
|
|
7031
6833
|
let range = (Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime() -
|
|
7032
6834
|
this.removeTimeValueFromDate(this.endValue).getTime()) / (1000 * 60 * 60 * 24))) + 1);
|
|
@@ -7107,7 +6909,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
7107
6909
|
}
|
|
7108
6910
|
addSelectedAttributes(ele, date, isStartDate, sameDate) {
|
|
7109
6911
|
if (ele) {
|
|
7110
|
-
const title = this.globalize.formatDate(date, { type: 'date', skeleton:
|
|
6912
|
+
const title = this.globalize.formatDate(date, { type: 'date', skeleton: 'full' });
|
|
7111
6913
|
if (!isNullOrUndefined(sameDate) && sameDate) {
|
|
7112
6914
|
ele.setAttribute('aria-label', 'The current start and end date is ' + '' + title);
|
|
7113
6915
|
}
|
|
@@ -8388,7 +8190,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
8388
8190
|
}
|
|
8389
8191
|
updateInput() {
|
|
8390
8192
|
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue)) {
|
|
8391
|
-
const formatOption = { format: this.formatString, type: 'date', skeleton:
|
|
8193
|
+
const formatOption = { format: this.formatString, type: 'date', skeleton: 'yMd' };
|
|
8392
8194
|
const startDate = this.globalize.formatDate(this.startValue, formatOption);
|
|
8393
8195
|
const endDate = this.globalize.formatDate(this.endValue, formatOption);
|
|
8394
8196
|
Input.setValue(startDate + ' ' + this.separator + ' ' + endDate, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
@@ -8502,7 +8304,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
8502
8304
|
const valueString = value;
|
|
8503
8305
|
let invalid = false;
|
|
8504
8306
|
let formatOpt = null;
|
|
8505
|
-
formatOpt = { format: this.formatString, type: 'date', skeleton:
|
|
8307
|
+
formatOpt = { format: this.formatString, type: 'date', skeleton: 'yMd' };
|
|
8506
8308
|
if (typeof valueString !== 'string') {
|
|
8507
8309
|
invalid = true;
|
|
8508
8310
|
}
|
|
@@ -8886,10 +8688,10 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
8886
8688
|
document.body.appendChild(this.mobileRangePopupWrap);
|
|
8887
8689
|
}
|
|
8888
8690
|
this.openEventArgs = {
|
|
8889
|
-
popup:
|
|
8691
|
+
popup: this.popupObj || null,
|
|
8890
8692
|
cancel: false,
|
|
8891
8693
|
date: this.inputElement.value,
|
|
8892
|
-
model:
|
|
8694
|
+
model: this,
|
|
8893
8695
|
event: event ? event : null,
|
|
8894
8696
|
appendTo: this.isMobile || Browser.isDevice ? this.mobileRangePopupWrap : document.body
|
|
8895
8697
|
};
|
|
@@ -8950,9 +8752,9 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
8950
8752
|
if (this.isPopupOpen()) {
|
|
8951
8753
|
this.closeEventArgs = {
|
|
8952
8754
|
cancel: false,
|
|
8953
|
-
popup:
|
|
8755
|
+
popup: this.popupObj,
|
|
8954
8756
|
date: this.inputElement.value,
|
|
8955
|
-
model:
|
|
8757
|
+
model: this,
|
|
8956
8758
|
event: event ? event : null
|
|
8957
8759
|
};
|
|
8958
8760
|
const eventArgs = this.closeEventArgs;
|
|
@@ -9077,7 +8879,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
9077
8879
|
attributes(this.secondHiddenChild, {
|
|
9078
8880
|
'type': 'text', 'name': this.inputElement.getAttribute('data-name'), 'class': HIDDENELEMENT
|
|
9079
8881
|
});
|
|
9080
|
-
const format = { type: 'datetime', skeleton:
|
|
8882
|
+
const format = { type: 'datetime', skeleton: 'yMd' };
|
|
9081
8883
|
this.firstHiddenChild.value = this.startDate && this.globalize.formatDate(this.startDate, format);
|
|
9082
8884
|
this.secondHiddenChild.value = this.endDate && this.globalize.formatDate(this.endDate, format);
|
|
9083
8885
|
this.inputElement.parentElement.appendChild(this.firstHiddenChild);
|
|
@@ -9108,7 +8910,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
9108
8910
|
* @private
|
|
9109
8911
|
*/
|
|
9110
8912
|
onPropertyChanged(newProp, oldProp) {
|
|
9111
|
-
const format = { format: this.formatString, type: 'date', skeleton:
|
|
8913
|
+
const format = { format: this.formatString, type: 'date', skeleton: 'yMd' };
|
|
9112
8914
|
for (const prop of Object.keys(newProp)) {
|
|
9113
8915
|
const openPopup = ['maxDays', 'minDays', 'value'];
|
|
9114
8916
|
if (openPopup.indexOf(prop) < 0) {
|
|
@@ -9478,8 +9280,6 @@ const HOVER$1 = 'e-hover';
|
|
|
9478
9280
|
const NAVIGATION = 'e-navigation';
|
|
9479
9281
|
const DISABLED$3 = 'e-disabled';
|
|
9480
9282
|
const ICONANIMATION = 'e-icon-anim';
|
|
9481
|
-
const TIMEICON = 'e-time-icon';
|
|
9482
|
-
const CLEARICON$1 = 'e-clear-icon';
|
|
9483
9283
|
const FOCUS = 'e-input-focus';
|
|
9484
9284
|
const LISTCLASS$1 = 'e-list-item';
|
|
9485
9285
|
const HALFPOSITION = 2;
|
|
@@ -9562,10 +9362,8 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9562
9362
|
super(options, element);
|
|
9563
9363
|
this.liCollections = [];
|
|
9564
9364
|
this.timeCollections = [];
|
|
9565
|
-
this.blazorTimeCollections = [];
|
|
9566
9365
|
this.disableItemCollection = [];
|
|
9567
9366
|
this.invalidValueString = null;
|
|
9568
|
-
this.isBlazorServer = false;
|
|
9569
9367
|
this.isAngular = false;
|
|
9570
9368
|
this.preventChange = false;
|
|
9571
9369
|
this.maskedDateValue = '';
|
|
@@ -9597,62 +9395,35 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9597
9395
|
this.inputElement = this.element;
|
|
9598
9396
|
this.angularTag = null;
|
|
9599
9397
|
this.formElement = closest(this.element, 'form');
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
this.inputElement = this.createElement('input');
|
|
9605
|
-
this.element.appendChild(this.inputElement);
|
|
9606
|
-
}
|
|
9607
|
-
this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
|
|
9608
|
-
this.element.removeAttribute('tabindex');
|
|
9609
|
-
this.openPopupEventArgs = {
|
|
9610
|
-
appendTo: document.body
|
|
9611
|
-
};
|
|
9612
|
-
}
|
|
9613
|
-
}
|
|
9614
|
-
// element creation
|
|
9615
|
-
render() {
|
|
9616
|
-
if (!this.isBlazorServer) {
|
|
9617
|
-
this.initialize();
|
|
9618
|
-
this.createInputElement();
|
|
9619
|
-
this.updateHtmlAttributeToWrapper();
|
|
9620
|
-
this.setTimeAllowEdit();
|
|
9621
|
-
this.setEnable();
|
|
9622
|
-
this.validateInterval();
|
|
9623
|
-
}
|
|
9624
|
-
else {
|
|
9625
|
-
this.globalize = new Internationalization(this.locale);
|
|
9626
|
-
this.defaultCulture = new Internationalization('en');
|
|
9627
|
-
this.checkTimeFormat();
|
|
9628
|
-
const parentElement = this.element.parentElement;
|
|
9629
|
-
this.inputWrapper = {
|
|
9630
|
-
container: parentElement,
|
|
9631
|
-
clearButton: parentElement.querySelector('.' + CLEARICON$1),
|
|
9632
|
-
buttons: [parentElement.querySelector('.' + TIMEICON)]
|
|
9633
|
-
};
|
|
9634
|
-
Input.bindInitialEvent({
|
|
9635
|
-
element: this.inputElement,
|
|
9636
|
-
floatLabelType: this.floatLabelType
|
|
9637
|
-
});
|
|
9638
|
-
if (this.showClearButton && this.inputWrapper.clearButton) {
|
|
9639
|
-
Input.wireClearBtnEvents(this.inputElement, this.inputWrapper.clearButton, this.inputWrapper.container);
|
|
9640
|
-
}
|
|
9398
|
+
if (this.element.tagName === 'EJS-TIMEPICKER') {
|
|
9399
|
+
this.angularTag = this.element.tagName;
|
|
9400
|
+
this.inputElement = this.createElement('input');
|
|
9401
|
+
this.element.appendChild(this.inputElement);
|
|
9641
9402
|
}
|
|
9403
|
+
this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
|
|
9404
|
+
this.element.removeAttribute('tabindex');
|
|
9405
|
+
this.openPopupEventArgs = {
|
|
9406
|
+
appendTo: document.body
|
|
9407
|
+
};
|
|
9408
|
+
}
|
|
9409
|
+
// element creation
|
|
9410
|
+
render() {
|
|
9411
|
+
this.initialize();
|
|
9412
|
+
this.createInputElement();
|
|
9413
|
+
this.updateHtmlAttributeToWrapper();
|
|
9414
|
+
this.setTimeAllowEdit();
|
|
9415
|
+
this.setEnable();
|
|
9416
|
+
this.validateInterval();
|
|
9642
9417
|
this.bindEvents();
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
this.checkErrorState(this.maskedDateValue);
|
|
9649
|
-
}
|
|
9418
|
+
this.validateDisable();
|
|
9419
|
+
this.setValue(this.getFormattedValue(this.value));
|
|
9420
|
+
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType == 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
9421
|
+
this.updateInputValue(this.maskedDateValue);
|
|
9422
|
+
this.checkErrorState(this.maskedDateValue);
|
|
9650
9423
|
}
|
|
9651
9424
|
this.anchor = this.inputElement;
|
|
9652
9425
|
this.inputElement.setAttribute('value', this.inputElement.value);
|
|
9653
|
-
|
|
9654
|
-
this.inputEleValue = this.getDateObject(this.inputElement.value);
|
|
9655
|
-
}
|
|
9426
|
+
this.inputEleValue = this.getDateObject(this.inputElement.value);
|
|
9656
9427
|
this.renderComplete();
|
|
9657
9428
|
}
|
|
9658
9429
|
setTimeAllowEdit() {
|
|
@@ -9810,7 +9581,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9810
9581
|
getCldrDateTimeFormat() {
|
|
9811
9582
|
const culture = new Internationalization(this.locale);
|
|
9812
9583
|
let cldrTime;
|
|
9813
|
-
const dateFormat = culture.getDatePattern({ skeleton:
|
|
9584
|
+
const dateFormat = culture.getDatePattern({ skeleton: 'yMd' });
|
|
9814
9585
|
if (this.isNullOrEmpty(this.formatString)) {
|
|
9815
9586
|
cldrTime = dateFormat + ' ' + this.cldrFormat('time');
|
|
9816
9587
|
}
|
|
@@ -9840,7 +9611,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9840
9611
|
}));
|
|
9841
9612
|
if (isNullOrUndefined(valueExpression)) {
|
|
9842
9613
|
valueExpression = this.checkDateValue(this.globalize.parseDate(valueString, {
|
|
9843
|
-
format: this.formatString, type: 'dateTime', skeleton:
|
|
9614
|
+
format: this.formatString, type: 'dateTime', skeleton: 'yMd'
|
|
9844
9615
|
}));
|
|
9845
9616
|
}
|
|
9846
9617
|
}
|
|
@@ -9889,8 +9660,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9889
9660
|
cldrFormat(type) {
|
|
9890
9661
|
let cldrDateTimeString;
|
|
9891
9662
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
9892
|
-
cldrDateTimeString =
|
|
9893
|
-
(getValue('timeFormats.short', getDefaultDateObject()));
|
|
9663
|
+
cldrDateTimeString = (getValue('timeFormats.short', getDefaultDateObject()));
|
|
9894
9664
|
}
|
|
9895
9665
|
else {
|
|
9896
9666
|
cldrDateTimeString = (this.getCultureTimeObject(cldrData, '' + this.locale));
|
|
@@ -9899,48 +9669,43 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9899
9669
|
}
|
|
9900
9670
|
// destroy function
|
|
9901
9671
|
destroy() {
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
this.
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
if (this.inputElement) {
|
|
9914
|
-
Input.removeAttributes(ariaAttribute, this.inputElement);
|
|
9915
|
-
if (this.angularTag === null) {
|
|
9916
|
-
this.inputWrapper.container.parentElement.appendChild(this.inputElement);
|
|
9917
|
-
}
|
|
9918
|
-
if (!isNullOrUndefined(this.cloneElement.getAttribute('tabindex'))) {
|
|
9919
|
-
this.inputElement.setAttribute('tabindex', this.tabIndex);
|
|
9920
|
-
}
|
|
9921
|
-
else {
|
|
9922
|
-
this.inputElement.removeAttribute('tabindex');
|
|
9923
|
-
}
|
|
9924
|
-
this.ensureInputAttribute();
|
|
9925
|
-
this.enableElement([this.inputElement]);
|
|
9926
|
-
this.inputElement.classList.remove('e-input');
|
|
9927
|
-
if (isNullOrUndefined(this.cloneElement.getAttribute('disabled'))) {
|
|
9928
|
-
Input.setEnabled(true, this.inputElement, this.floatLabelType);
|
|
9929
|
-
}
|
|
9672
|
+
this.hide();
|
|
9673
|
+
this.unBindEvents();
|
|
9674
|
+
const ariaAttribute = {
|
|
9675
|
+
'aria-haspopup': 'true', 'aria-autocomplete': 'list', 'tabindex': '0', 'aria-activedescendant': 'null',
|
|
9676
|
+
'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off',
|
|
9677
|
+
'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false', 'aria-disabled': 'true', 'aria-invalid': 'false'
|
|
9678
|
+
};
|
|
9679
|
+
if (this.inputElement) {
|
|
9680
|
+
Input.removeAttributes(ariaAttribute, this.inputElement);
|
|
9681
|
+
if (this.angularTag === null) {
|
|
9682
|
+
this.inputWrapper.container.parentElement.appendChild(this.inputElement);
|
|
9930
9683
|
}
|
|
9931
|
-
if (this.
|
|
9932
|
-
|
|
9684
|
+
if (!isNullOrUndefined(this.cloneElement.getAttribute('tabindex'))) {
|
|
9685
|
+
this.inputElement.setAttribute('tabindex', this.tabIndex);
|
|
9933
9686
|
}
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
if (!isNullOrUndefined(this.rippleFn)) {
|
|
9937
|
-
this.rippleFn();
|
|
9687
|
+
else {
|
|
9688
|
+
this.inputElement.removeAttribute('tabindex');
|
|
9938
9689
|
}
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9690
|
+
this.ensureInputAttribute();
|
|
9691
|
+
this.enableElement([this.inputElement]);
|
|
9692
|
+
this.inputElement.classList.remove('e-input');
|
|
9693
|
+
if (isNullOrUndefined(this.cloneElement.getAttribute('disabled'))) {
|
|
9694
|
+
Input.setEnabled(true, this.inputElement, this.floatLabelType);
|
|
9942
9695
|
}
|
|
9943
9696
|
}
|
|
9697
|
+
if (this.inputWrapper.container) {
|
|
9698
|
+
detach(this.inputWrapper.container);
|
|
9699
|
+
}
|
|
9700
|
+
this.inputWrapper = this.popupWrapper = this.cloneElement = undefined;
|
|
9701
|
+
this.liCollections = this.timeCollections = this.disableItemCollection = [];
|
|
9702
|
+
if (!isNullOrUndefined(this.rippleFn)) {
|
|
9703
|
+
this.rippleFn();
|
|
9704
|
+
}
|
|
9705
|
+
super.destroy();
|
|
9706
|
+
if (this.formElement) {
|
|
9707
|
+
EventHandler.remove(this.formElement, 'reset', this.formResetHandler);
|
|
9708
|
+
}
|
|
9944
9709
|
}
|
|
9945
9710
|
ensureInputAttribute() {
|
|
9946
9711
|
const propertyList = [];
|
|
@@ -9964,24 +9729,18 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9964
9729
|
}
|
|
9965
9730
|
//popup creation
|
|
9966
9731
|
popupCreation() {
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
this.popupWrapper.className += ' ' + this.cssClass;
|
|
9974
|
-
}
|
|
9975
|
-
if (!isNullOrUndefined(this.step) && this.step > 0) {
|
|
9976
|
-
this.generateList();
|
|
9977
|
-
append([this.listWrapper], this.popupWrapper);
|
|
9978
|
-
}
|
|
9979
|
-
this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper);
|
|
9732
|
+
this.popupWrapper = this.createElement('div', {
|
|
9733
|
+
className: ROOT$3 + ' ' + POPUP$2,
|
|
9734
|
+
attrs: { 'id': this.element.id + '_popup', 'style': 'visibility:hidden' }
|
|
9735
|
+
});
|
|
9736
|
+
if (!isNullOrUndefined(this.cssClass)) {
|
|
9737
|
+
this.popupWrapper.className += ' ' + this.cssClass;
|
|
9980
9738
|
}
|
|
9981
|
-
|
|
9982
|
-
this.popupWrapper = this.inputWrapper.container.nextElementSibling;
|
|
9739
|
+
if (!isNullOrUndefined(this.step) && this.step > 0) {
|
|
9983
9740
|
this.generateList();
|
|
9741
|
+
append([this.listWrapper], this.popupWrapper);
|
|
9984
9742
|
}
|
|
9743
|
+
this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper);
|
|
9985
9744
|
this.addSelection();
|
|
9986
9745
|
this.renderPopup();
|
|
9987
9746
|
detach(this.popupWrapper);
|
|
@@ -9992,22 +9751,11 @@ let TimePicker = class TimePicker extends Component {
|
|
|
9992
9751
|
return popupHeight > height ? height : popupHeight;
|
|
9993
9752
|
}
|
|
9994
9753
|
generateList() {
|
|
9995
|
-
|
|
9996
|
-
this.createListItems();
|
|
9997
|
-
}
|
|
9998
|
-
else {
|
|
9999
|
-
this.listWrapper = this.popupWrapper.querySelector('.e-content');
|
|
10000
|
-
}
|
|
9754
|
+
this.createListItems();
|
|
10001
9755
|
this.wireListEvents();
|
|
10002
9756
|
const rippleModel = { duration: 300, selector: '.' + LISTCLASS$1 };
|
|
10003
9757
|
this.rippleFn = rippleEffect(this.listWrapper, rippleModel);
|
|
10004
9758
|
this.liCollections = this.listWrapper.querySelectorAll('.' + LISTCLASS$1);
|
|
10005
|
-
if (this.isBlazorServer) {
|
|
10006
|
-
this.blazorTimeCollections = [];
|
|
10007
|
-
for (let index = 0; index < this.liCollections.length; index++) {
|
|
10008
|
-
this.blazorTimeCollections.push(this.liCollections[index].getAttribute('data-value'));
|
|
10009
|
-
}
|
|
10010
|
-
}
|
|
10011
9759
|
}
|
|
10012
9760
|
renderPopup() {
|
|
10013
9761
|
this.containerStyle = this.inputWrapper.container.getBoundingClientRect();
|
|
@@ -10027,11 +9775,9 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10027
9775
|
removeClass([this.inputWrapper.buttons[0]], SELECTED$4);
|
|
10028
9776
|
this.unWireListEvents();
|
|
10029
9777
|
this.inputElement.setAttribute('aria-activedescendant', 'null');
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
this.popupWrapper.innerHTML = '';
|
|
10034
|
-
}
|
|
9778
|
+
remove(this.popupObj.element);
|
|
9779
|
+
this.popupObj.destroy();
|
|
9780
|
+
this.popupWrapper.innerHTML = '';
|
|
10035
9781
|
this.listWrapper = this.popupWrapper = this.listTag = undefined;
|
|
10036
9782
|
}, targetExitViewport: () => {
|
|
10037
9783
|
if (!Browser.isDevice) {
|
|
@@ -10050,7 +9796,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10050
9796
|
return null;
|
|
10051
9797
|
}
|
|
10052
9798
|
else {
|
|
10053
|
-
return this.globalize.formatDate(value, { skeleton:
|
|
9799
|
+
return this.globalize.formatDate(value, { skeleton: 'medium', type: 'time' });
|
|
10054
9800
|
}
|
|
10055
9801
|
}
|
|
10056
9802
|
getDateObject(text) {
|
|
@@ -10151,12 +9897,11 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10151
9897
|
getMeridianText() {
|
|
10152
9898
|
let meridian;
|
|
10153
9899
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
10154
|
-
meridian = getValue(
|
|
9900
|
+
meridian = getValue('dayPeriods.format.wide', getDefaultDateObject());
|
|
10155
9901
|
}
|
|
10156
9902
|
else {
|
|
10157
|
-
const gregorianFormat =
|
|
10158
|
-
|
|
10159
|
-
const mainVal = isBlazor() ? '' : 'main.';
|
|
9903
|
+
const gregorianFormat = '.dates.calendars.gregorian.dayPeriods.format.abbreviated';
|
|
9904
|
+
const mainVal = 'main.';
|
|
10160
9905
|
meridian = getValue(mainVal + '' + this.locale + gregorianFormat, cldrData);
|
|
10161
9906
|
}
|
|
10162
9907
|
return meridian;
|
|
@@ -10233,11 +9978,8 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10233
9978
|
if (!isNullOrUndefined(this.popupWrapper)) {
|
|
10234
9979
|
const items = this.popupWrapper.querySelectorAll('.' + LISTCLASS$1);
|
|
10235
9980
|
if (items.length) {
|
|
10236
|
-
const initialTime = this.
|
|
10237
|
-
|
|
10238
|
-
const scrollTime = this.isBlazorServer ? new Date(new Date().toDateString() + ' ' +
|
|
10239
|
-
this.scrollTo.toLocaleTimeString()).setMilliseconds(0) :
|
|
10240
|
-
this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();
|
|
9981
|
+
const initialTime = this.timeCollections[0];
|
|
9982
|
+
const scrollTime = this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();
|
|
10241
9983
|
element = items[Math.round((scrollTime - initialTime) / (this.step * 60000))];
|
|
10242
9984
|
}
|
|
10243
9985
|
}
|
|
@@ -10262,23 +10004,18 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10262
10004
|
cldrDateFormat() {
|
|
10263
10005
|
let cldrDate;
|
|
10264
10006
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
10265
|
-
cldrDate =
|
|
10266
|
-
(getValue('dateFormats.short', getDefaultDateObject()));
|
|
10007
|
+
cldrDate = (getValue('dateFormats.short', getDefaultDateObject()));
|
|
10267
10008
|
}
|
|
10268
10009
|
else {
|
|
10269
10010
|
cldrDate = (this.getCultureDateObject(cldrData, '' + this.locale));
|
|
10270
10011
|
}
|
|
10271
10012
|
return cldrDate;
|
|
10272
10013
|
}
|
|
10273
|
-
getBlazorCultureFormat(formatVal) {
|
|
10274
|
-
return (getValue(formatVal, getValue(this.locale, blazorCultureFormats))).replace(/tt/, 'a');
|
|
10275
|
-
}
|
|
10276
10014
|
cldrTimeFormat() {
|
|
10277
10015
|
let cldrTime;
|
|
10278
10016
|
if (this.isNullOrEmpty(this.formatString)) {
|
|
10279
10017
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
10280
|
-
cldrTime =
|
|
10281
|
-
(getValue('timeFormats.short', getDefaultDateObject()));
|
|
10018
|
+
cldrTime = (getValue('timeFormats.short', getDefaultDateObject()));
|
|
10282
10019
|
}
|
|
10283
10020
|
else {
|
|
10284
10021
|
cldrTime = (this.getCultureTimeObject(cldrData, '' + this.locale));
|
|
@@ -10292,12 +10029,10 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10292
10029
|
dateToNumeric() {
|
|
10293
10030
|
let cldrTime;
|
|
10294
10031
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
10295
|
-
cldrTime =
|
|
10296
|
-
(getValue('timeFormats.medium', getDefaultDateObject()));
|
|
10032
|
+
cldrTime = (getValue('timeFormats.medium', getDefaultDateObject()));
|
|
10297
10033
|
}
|
|
10298
10034
|
else {
|
|
10299
|
-
cldrTime =
|
|
10300
|
-
(getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.medium', cldrData));
|
|
10035
|
+
cldrTime = (getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.medium', cldrData));
|
|
10301
10036
|
}
|
|
10302
10037
|
return cldrTime;
|
|
10303
10038
|
}
|
|
@@ -10345,9 +10080,6 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10345
10080
|
e.preventDefault();
|
|
10346
10081
|
this.interopAdaptor.invokeMethodAsync('OnTimeIconClick');
|
|
10347
10082
|
}
|
|
10348
|
-
updateBlazorTimeCollections(listData) {
|
|
10349
|
-
this.blazorTimeCollections = listData;
|
|
10350
|
-
}
|
|
10351
10083
|
popupHandler(e) {
|
|
10352
10084
|
if (!this.enabled) {
|
|
10353
10085
|
return;
|
|
@@ -10355,10 +10087,8 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10355
10087
|
if (Browser.isDevice) {
|
|
10356
10088
|
this.inputElement.setAttribute('readonly', '');
|
|
10357
10089
|
}
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
}
|
|
10361
|
-
if (this.isPopupOpen() && !this.isBlazorServer) {
|
|
10090
|
+
e.preventDefault();
|
|
10091
|
+
if (this.isPopupOpen()) {
|
|
10362
10092
|
this.closePopup(0, e);
|
|
10363
10093
|
}
|
|
10364
10094
|
else {
|
|
@@ -10456,22 +10186,11 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10456
10186
|
case 'enter':
|
|
10457
10187
|
if (this.isNavigate) {
|
|
10458
10188
|
this.selectedElement = this.liCollections[this.activeIndex];
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
this.updateValue(this.valueWithMinutes, event);
|
|
10462
|
-
}
|
|
10463
|
-
else {
|
|
10464
|
-
this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
|
|
10465
|
-
this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
|
|
10466
|
-
}
|
|
10189
|
+
this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);
|
|
10190
|
+
this.updateValue(this.valueWithMinutes, event);
|
|
10467
10191
|
}
|
|
10468
10192
|
else {
|
|
10469
|
-
|
|
10470
|
-
this.updateValue(this.inputElement.value, event);
|
|
10471
|
-
}
|
|
10472
|
-
else {
|
|
10473
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictMode', this.inputElement.value);
|
|
10474
|
-
}
|
|
10193
|
+
this.updateValue(this.inputElement.value, event);
|
|
10475
10194
|
}
|
|
10476
10195
|
this.hide();
|
|
10477
10196
|
this.isNavigate = false;
|
|
@@ -10480,24 +10199,17 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10480
10199
|
}
|
|
10481
10200
|
break;
|
|
10482
10201
|
case 'open':
|
|
10483
|
-
|
|
10484
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', true);
|
|
10485
|
-
}
|
|
10486
|
-
else {
|
|
10487
|
-
this.show(event);
|
|
10488
|
-
}
|
|
10202
|
+
this.show(event);
|
|
10489
10203
|
break;
|
|
10490
10204
|
case 'escape':
|
|
10491
|
-
|
|
10492
|
-
|
|
10493
|
-
if (this.
|
|
10494
|
-
|
|
10495
|
-
this.updateInputValue(this.maskedDateValue);
|
|
10496
|
-
}
|
|
10497
|
-
this.createMask();
|
|
10205
|
+
this.updateInputValue(this.objToString(this.value));
|
|
10206
|
+
if (this.enableMask) {
|
|
10207
|
+
if (!this.value) {
|
|
10208
|
+
this.updateInputValue(this.maskedDateValue);
|
|
10498
10209
|
}
|
|
10499
|
-
this.
|
|
10210
|
+
this.createMask();
|
|
10500
10211
|
}
|
|
10212
|
+
this.previousState(this.value);
|
|
10501
10213
|
this.hide();
|
|
10502
10214
|
break;
|
|
10503
10215
|
case 'close':
|
|
@@ -10535,7 +10247,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10535
10247
|
closePopup(delay, e) {
|
|
10536
10248
|
if (this.isPopupOpen() && this.popupWrapper) {
|
|
10537
10249
|
const args = {
|
|
10538
|
-
popup: this.
|
|
10250
|
+
popup: this.popupObj,
|
|
10539
10251
|
event: e || null,
|
|
10540
10252
|
cancel: false,
|
|
10541
10253
|
name: 'open'
|
|
@@ -10552,12 +10264,6 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10552
10264
|
removeClass([this.inputWrapper.container], [ICONANIMATION]);
|
|
10553
10265
|
attributes(this.inputElement, { 'aria-expanded': 'false' });
|
|
10554
10266
|
EventHandler.remove(document, 'mousedown touchstart', this.documentClickHandler);
|
|
10555
|
-
if (this.isBlazorServer) {
|
|
10556
|
-
this.disposeServerPopup();
|
|
10557
|
-
this.inputWrapper.container.parentElement.insertBefore(this.popupWrapper, this.inputWrapper.container.nextElementSibling);
|
|
10558
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
|
|
10559
|
-
this.popupWrapper = this.popupObj = null;
|
|
10560
|
-
}
|
|
10561
10267
|
}
|
|
10562
10268
|
if (Browser.isDevice && this.modal) {
|
|
10563
10269
|
this.modal.style.display = 'none';
|
|
@@ -10630,30 +10336,19 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10630
10336
|
}
|
|
10631
10337
|
}
|
|
10632
10338
|
setSelection(li, event) {
|
|
10633
|
-
if (this.isValidLI(li)
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
});
|
|
10640
|
-
}
|
|
10641
|
-
this.selectedElement = li;
|
|
10642
|
-
this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
|
|
10643
|
-
this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);
|
|
10644
|
-
addClass([this.selectedElement], SELECTED$4);
|
|
10645
|
-
this.selectedElement.setAttribute('aria-selected', 'true');
|
|
10646
|
-
this.checkValueChange(event, true);
|
|
10647
|
-
}
|
|
10648
|
-
else {
|
|
10649
|
-
this.selectedElement = li;
|
|
10650
|
-
this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
|
|
10651
|
-
addClass([this.selectedElement], SELECTED$4);
|
|
10652
|
-
this.selectedElement.setAttribute('aria-selected', 'true');
|
|
10653
|
-
this.inputElement.setAttribute('value', li.getAttribute('data-value'));
|
|
10654
|
-
this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, false);
|
|
10655
|
-
this.addSelection();
|
|
10339
|
+
if (this.isValidLI(li)) {
|
|
10340
|
+
this.checkValue(li.getAttribute('data-value'));
|
|
10341
|
+
if (this.enableMask) {
|
|
10342
|
+
this.notify("setMaskSelection", {
|
|
10343
|
+
module: "MaskedDateTime"
|
|
10344
|
+
});
|
|
10656
10345
|
}
|
|
10346
|
+
this.selectedElement = li;
|
|
10347
|
+
this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
|
|
10348
|
+
this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);
|
|
10349
|
+
addClass([this.selectedElement], SELECTED$4);
|
|
10350
|
+
this.selectedElement.setAttribute('aria-selected', 'true');
|
|
10351
|
+
this.checkValueChange(event, true);
|
|
10657
10352
|
}
|
|
10658
10353
|
}
|
|
10659
10354
|
onMouseLeave() {
|
|
@@ -10761,7 +10456,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10761
10456
|
return dateVal;
|
|
10762
10457
|
}
|
|
10763
10458
|
bindEvents() {
|
|
10764
|
-
EventHandler.add(this.inputWrapper.buttons[0], 'mousedown',
|
|
10459
|
+
EventHandler.add(this.inputWrapper.buttons[0], 'mousedown', this.popupHandler, this);
|
|
10765
10460
|
EventHandler.add(this.inputElement, 'blur', this.inputBlurHandler, this);
|
|
10766
10461
|
EventHandler.add(this.inputElement, 'focus', this.inputFocusHandler, this);
|
|
10767
10462
|
EventHandler.add(this.inputElement, 'change', this.inputChangeHandler, this);
|
|
@@ -10807,18 +10502,16 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10807
10502
|
}
|
|
10808
10503
|
if (!this.inputElement.disabled) {
|
|
10809
10504
|
let timeValue = this.inputElement.getAttribute('value');
|
|
10810
|
-
let val = this.
|
|
10505
|
+
let val = this.checkDateValue(this.inputEleValue);
|
|
10811
10506
|
if (this.element.tagName === 'EJS-TIMEPICKER') {
|
|
10812
10507
|
val = null;
|
|
10813
10508
|
timeValue = '';
|
|
10814
10509
|
this.inputElement.setAttribute('value', '');
|
|
10815
10510
|
}
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
this.initValue = this.value;
|
|
10821
|
-
}
|
|
10511
|
+
this.setProperties({ value: val }, true);
|
|
10512
|
+
this.prevDate = this.value;
|
|
10513
|
+
this.valueWithMinutes = this.value;
|
|
10514
|
+
this.initValue = this.value;
|
|
10822
10515
|
if (this.inputElement) {
|
|
10823
10516
|
this.updateInputValue(timeValue);
|
|
10824
10517
|
if (this.enableMask) {
|
|
@@ -10827,9 +10520,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10827
10520
|
}
|
|
10828
10521
|
this.createMask();
|
|
10829
10522
|
}
|
|
10830
|
-
|
|
10831
|
-
this.checkErrorState(timeValue);
|
|
10832
|
-
}
|
|
10523
|
+
this.checkErrorState(timeValue);
|
|
10833
10524
|
this.prevValue = this.inputElement.value;
|
|
10834
10525
|
}
|
|
10835
10526
|
}
|
|
@@ -10849,7 +10540,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10849
10540
|
}
|
|
10850
10541
|
unBindEvents() {
|
|
10851
10542
|
if (this.inputWrapper) {
|
|
10852
|
-
EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart',
|
|
10543
|
+
EventHandler.remove(this.inputWrapper.buttons[0], 'mousedown touchstart', this.popupHandler);
|
|
10853
10544
|
}
|
|
10854
10545
|
EventHandler.remove(this.inputElement, 'blur', this.inputBlurHandler);
|
|
10855
10546
|
EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);
|
|
@@ -10889,9 +10580,6 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10889
10580
|
this.resetState();
|
|
10890
10581
|
this.raiseClearedEvent(e);
|
|
10891
10582
|
}
|
|
10892
|
-
if (this.isBlazorServer) {
|
|
10893
|
-
this.interopAdaptor.invokeMethodAsync('OnValueCleared');
|
|
10894
|
-
}
|
|
10895
10583
|
if (this.popupWrapper) {
|
|
10896
10584
|
this.popupWrapper.scrollTop = 0;
|
|
10897
10585
|
}
|
|
@@ -10902,15 +10590,11 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10902
10590
|
}
|
|
10903
10591
|
}
|
|
10904
10592
|
clear(event) {
|
|
10905
|
-
|
|
10906
|
-
this.setProperties({ value: null }, true);
|
|
10907
|
-
}
|
|
10593
|
+
this.setProperties({ value: null }, true);
|
|
10908
10594
|
this.initValue = null;
|
|
10909
10595
|
this.resetState();
|
|
10910
10596
|
this.raiseClearedEvent(event);
|
|
10911
|
-
|
|
10912
|
-
this.changeEvent(event);
|
|
10913
|
-
}
|
|
10597
|
+
this.changeEvent(event);
|
|
10914
10598
|
}
|
|
10915
10599
|
setZIndex() {
|
|
10916
10600
|
if (this.popupObj) {
|
|
@@ -10954,34 +10638,28 @@ let TimePicker = class TimePicker extends Component {
|
|
|
10954
10638
|
}
|
|
10955
10639
|
break;
|
|
10956
10640
|
case 'min':
|
|
10957
|
-
if (
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
this.setProperties({ min: value }, !isDynamic);
|
|
10962
|
-
}
|
|
10641
|
+
if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['min'] === undefined)) || isDynamic) {
|
|
10642
|
+
value = new Date(this.inputElement.getAttribute(prop));
|
|
10643
|
+
if (!isNullOrUndefined(this.checkDateValue(value))) {
|
|
10644
|
+
this.setProperties({ min: value }, !isDynamic);
|
|
10963
10645
|
}
|
|
10964
10646
|
}
|
|
10965
10647
|
break;
|
|
10966
10648
|
case 'max':
|
|
10967
|
-
if (
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
this.setProperties({ max: value }, !isDynamic);
|
|
10972
|
-
}
|
|
10649
|
+
if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['max'] === undefined)) || isDynamic) {
|
|
10650
|
+
value = new Date(this.inputElement.getAttribute(prop));
|
|
10651
|
+
if (!isNullOrUndefined(this.checkDateValue(value))) {
|
|
10652
|
+
this.setProperties({ max: value }, !isDynamic);
|
|
10973
10653
|
}
|
|
10974
10654
|
}
|
|
10975
10655
|
break;
|
|
10976
10656
|
case 'value':
|
|
10977
|
-
if (
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
this.setProperties({ value: value }, !isDynamic);
|
|
10984
|
-
}
|
|
10657
|
+
if ((isNullOrUndefined(this.timeOptions) || (this.timeOptions['value'] === undefined)) || isDynamic) {
|
|
10658
|
+
value = new Date(this.inputElement.getAttribute(prop));
|
|
10659
|
+
if (!isNullOrUndefined(this.checkDateValue(value))) {
|
|
10660
|
+
this.initValue = value;
|
|
10661
|
+
this.updateInput(false, this.initValue);
|
|
10662
|
+
this.setProperties({ value: value }, !isDynamic);
|
|
10985
10663
|
}
|
|
10986
10664
|
}
|
|
10987
10665
|
break;
|
|
@@ -11049,7 +10727,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11049
10727
|
this.removeSelection();
|
|
11050
10728
|
Input.setValue('', this.inputElement, this.floatLabelType, false);
|
|
11051
10729
|
this.valueWithMinutes = this.activeIndex = null;
|
|
11052
|
-
if (!this.strictMode
|
|
10730
|
+
if (!this.strictMode) {
|
|
11053
10731
|
this.checkErrorState(null);
|
|
11054
10732
|
}
|
|
11055
10733
|
}
|
|
@@ -11112,44 +10790,34 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11112
10790
|
}
|
|
11113
10791
|
findNextElement(event) {
|
|
11114
10792
|
const textVal = (this.inputElement).value;
|
|
11115
|
-
const value = isNullOrUndefined(this.valueWithMinutes)
|
|
10793
|
+
const value = isNullOrUndefined(this.valueWithMinutes) ? this.createDateObj(textVal) :
|
|
11116
10794
|
this.getDateObject(this.valueWithMinutes);
|
|
11117
10795
|
let timeVal = null;
|
|
11118
10796
|
const count = this.liCollections.length;
|
|
11119
|
-
const collections = this.
|
|
11120
|
-
this.blazorTimeCollections) : this.timeCollections;
|
|
10797
|
+
const collections = this.timeCollections;
|
|
11121
10798
|
if (!isNullOrUndefined(this.checkDateValue(value)) || !isNullOrUndefined(this.activeIndex)) {
|
|
11122
10799
|
if (event.action === 'home') {
|
|
11123
10800
|
const index = this.validLiElement(0);
|
|
11124
|
-
|
|
11125
|
-
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11126
|
-
}
|
|
10801
|
+
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11127
10802
|
this.activeIndex = index;
|
|
11128
10803
|
}
|
|
11129
10804
|
else if (event.action === 'end') {
|
|
11130
10805
|
const index = this.validLiElement(collections.length - 1, true);
|
|
11131
|
-
|
|
11132
|
-
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11133
|
-
}
|
|
10806
|
+
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11134
10807
|
this.activeIndex = index;
|
|
11135
10808
|
}
|
|
11136
10809
|
else {
|
|
11137
10810
|
if (event.action === 'down') {
|
|
11138
10811
|
for (let i = 0; i < count; i++) {
|
|
11139
|
-
if (
|
|
11140
|
-
(+value < this.timeCollections[i])) {
|
|
10812
|
+
if (+value < this.timeCollections[i]) {
|
|
11141
10813
|
const index = this.validLiElement(i);
|
|
11142
|
-
|
|
11143
|
-
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11144
|
-
}
|
|
10814
|
+
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11145
10815
|
this.activeIndex = index;
|
|
11146
10816
|
break;
|
|
11147
10817
|
}
|
|
11148
10818
|
else if (i === count - 1) {
|
|
11149
10819
|
const index = this.validLiElement(0);
|
|
11150
|
-
|
|
11151
|
-
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11152
|
-
}
|
|
10820
|
+
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11153
10821
|
this.activeIndex = index;
|
|
11154
10822
|
break;
|
|
11155
10823
|
}
|
|
@@ -11157,20 +10825,15 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11157
10825
|
}
|
|
11158
10826
|
else {
|
|
11159
10827
|
for (let i = count - 1; i >= 0; i--) {
|
|
11160
|
-
if (
|
|
11161
|
-
(+value > this.timeCollections[i])) {
|
|
10828
|
+
if (+value > this.timeCollections[i]) {
|
|
11162
10829
|
const index = this.validLiElement(i, true);
|
|
11163
|
-
|
|
11164
|
-
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11165
|
-
}
|
|
10830
|
+
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11166
10831
|
this.activeIndex = index;
|
|
11167
10832
|
break;
|
|
11168
10833
|
}
|
|
11169
10834
|
else if (i === 0) {
|
|
11170
10835
|
const index = this.validLiElement(count - 1);
|
|
11171
|
-
|
|
11172
|
-
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11173
|
-
}
|
|
10836
|
+
timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
|
|
11174
10837
|
this.activeIndex = index;
|
|
11175
10838
|
break;
|
|
11176
10839
|
}
|
|
@@ -11178,13 +10841,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11178
10841
|
}
|
|
11179
10842
|
}
|
|
11180
10843
|
this.selectedElement = this.liCollections[this.activeIndex];
|
|
11181
|
-
|
|
11182
|
-
this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
|
|
11183
|
-
this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
|
|
11184
|
-
}
|
|
11185
|
-
else {
|
|
11186
|
-
this.elementValue(isNullOrUndefined(timeVal) ? null : new Date(timeVal));
|
|
11187
|
-
}
|
|
10844
|
+
this.elementValue(isNullOrUndefined(timeVal) ? null : new Date(timeVal));
|
|
11188
10845
|
}
|
|
11189
10846
|
else {
|
|
11190
10847
|
this.selectNextItem(event);
|
|
@@ -11194,58 +10851,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11194
10851
|
const index = this.validLiElement(0, event.action === 'down' ? false : true);
|
|
11195
10852
|
this.activeIndex = index;
|
|
11196
10853
|
this.selectedElement = this.liCollections[index];
|
|
11197
|
-
|
|
11198
|
-
this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
|
|
11199
|
-
this.interopAdaptor.invokeMethodAsync('OnListItemClick', index, true);
|
|
11200
|
-
}
|
|
11201
|
-
else {
|
|
11202
|
-
this.elementValue(new Date(this.timeCollections[index]));
|
|
11203
|
-
}
|
|
11204
|
-
}
|
|
11205
|
-
findNextInBlazor(event) {
|
|
11206
|
-
const count = isNullOrUndefined(this.blazorTimeCollections) ? 0 : this.blazorTimeCollections.length;
|
|
11207
|
-
let index = 0;
|
|
11208
|
-
const value = this.createDateObj(this.inputElement.value);
|
|
11209
|
-
switch (event.action) {
|
|
11210
|
-
case 'home':
|
|
11211
|
-
this.activeIndex = index;
|
|
11212
|
-
break;
|
|
11213
|
-
case 'end':
|
|
11214
|
-
index = count - 1;
|
|
11215
|
-
this.activeIndex = index;
|
|
11216
|
-
break;
|
|
11217
|
-
case 'down':
|
|
11218
|
-
for (let i = 0; i < count; i++) {
|
|
11219
|
-
if (this.isBlazorServer ? (+value < +this.createDateObj(this.blazorTimeCollections[i])) :
|
|
11220
|
-
(+value < this.timeCollections[i])) {
|
|
11221
|
-
const index = this.validLiElement(i);
|
|
11222
|
-
this.activeIndex = index;
|
|
11223
|
-
break;
|
|
11224
|
-
}
|
|
11225
|
-
else if (i === count - 1) {
|
|
11226
|
-
const index = this.validLiElement(0);
|
|
11227
|
-
this.activeIndex = index;
|
|
11228
|
-
break;
|
|
11229
|
-
}
|
|
11230
|
-
}
|
|
11231
|
-
break;
|
|
11232
|
-
case 'up':
|
|
11233
|
-
for (let i = count - 1; i >= 0; i--) {
|
|
11234
|
-
if (this.isBlazorServer ? (+value > +this.createDateObj(this.blazorTimeCollections[i])) :
|
|
11235
|
-
(+value > this.timeCollections[i])) {
|
|
11236
|
-
const index = this.validLiElement(i, true);
|
|
11237
|
-
this.activeIndex = index;
|
|
11238
|
-
break;
|
|
11239
|
-
}
|
|
11240
|
-
else if (i === 0) {
|
|
11241
|
-
const index = this.validLiElement(count - 1);
|
|
11242
|
-
this.activeIndex = index;
|
|
11243
|
-
break;
|
|
11244
|
-
}
|
|
11245
|
-
}
|
|
11246
|
-
break;
|
|
11247
|
-
}
|
|
11248
|
-
this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
|
|
10854
|
+
this.elementValue(new Date(this.timeCollections[index]));
|
|
11249
10855
|
}
|
|
11250
10856
|
elementValue(value) {
|
|
11251
10857
|
if (!isNullOrUndefined(this.checkDateValue(value))) {
|
|
@@ -11254,53 +10860,34 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11254
10860
|
}
|
|
11255
10861
|
validLiElement(index, backward) {
|
|
11256
10862
|
let elementIndex = null;
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
10863
|
+
const items = isNullOrUndefined(this.popupWrapper) ? this.liCollections :
|
|
10864
|
+
this.popupWrapper.querySelectorAll('.' + LISTCLASS$1);
|
|
10865
|
+
let isCheck = true;
|
|
10866
|
+
if (items.length) {
|
|
10867
|
+
if (backward) {
|
|
10868
|
+
for (let i = index; i >= 0; i--) {
|
|
10869
|
+
if (!items[i].classList.contains(DISABLED$3)) {
|
|
11262
10870
|
elementIndex = i;
|
|
11263
10871
|
break;
|
|
11264
10872
|
}
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
10873
|
+
else if (i === 0) {
|
|
10874
|
+
if (isCheck) {
|
|
10875
|
+
index = i = items.length;
|
|
10876
|
+
isCheck = false;
|
|
10877
|
+
}
|
|
11270
10878
|
}
|
|
11271
10879
|
}
|
|
11272
10880
|
}
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
if (items.length) {
|
|
11279
|
-
if (backward) {
|
|
11280
|
-
for (let i = index; i >= 0; i--) {
|
|
11281
|
-
if (!items[i].classList.contains(DISABLED$3)) {
|
|
11282
|
-
elementIndex = i;
|
|
11283
|
-
break;
|
|
11284
|
-
}
|
|
11285
|
-
else if (i === 0) {
|
|
11286
|
-
if (isCheck) {
|
|
11287
|
-
index = i = items.length;
|
|
11288
|
-
isCheck = false;
|
|
11289
|
-
}
|
|
11290
|
-
}
|
|
10881
|
+
else {
|
|
10882
|
+
for (let i = index; i <= items.length - 1; i++) {
|
|
10883
|
+
if (!items[i].classList.contains(DISABLED$3)) {
|
|
10884
|
+
elementIndex = i;
|
|
10885
|
+
break;
|
|
11291
10886
|
}
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
elementIndex = i;
|
|
11297
|
-
break;
|
|
11298
|
-
}
|
|
11299
|
-
else if (i === items.length - 1) {
|
|
11300
|
-
if (isCheck) {
|
|
11301
|
-
index = i = -1;
|
|
11302
|
-
isCheck = false;
|
|
11303
|
-
}
|
|
10887
|
+
else if (i === items.length - 1) {
|
|
10888
|
+
if (isCheck) {
|
|
10889
|
+
index = i = -1;
|
|
10890
|
+
isCheck = false;
|
|
11304
10891
|
}
|
|
11305
10892
|
}
|
|
11306
10893
|
}
|
|
@@ -11312,32 +10899,21 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11312
10899
|
if (isNullOrUndefined(this.step) || this.step <= 0 || this.inputWrapper.buttons[0].classList.contains(DISABLED$3)) {
|
|
11313
10900
|
return;
|
|
11314
10901
|
}
|
|
11315
|
-
const count = this.
|
|
11316
|
-
this.blazorTimeCollections.length) : this.timeCollections.length;
|
|
10902
|
+
const count = this.timeCollections.length;
|
|
11317
10903
|
if (isNullOrUndefined(this.getActiveElement()) || this.getActiveElement().length === 0) {
|
|
11318
|
-
if (
|
|
11319
|
-
if (isNullOrUndefined(this.activeIndex)) {
|
|
10904
|
+
if (this.liCollections.length > 0) {
|
|
10905
|
+
if (isNullOrUndefined(this.value) && isNullOrUndefined(this.activeIndex)) {
|
|
11320
10906
|
const index = this.validLiElement(0, event.action === 'down' ? false : true);
|
|
11321
10907
|
this.activeIndex = index;
|
|
11322
|
-
this.
|
|
10908
|
+
this.selectedElement = this.liCollections[index];
|
|
10909
|
+
this.elementValue(new Date(this.timeCollections[index]));
|
|
11323
10910
|
}
|
|
11324
10911
|
else {
|
|
11325
|
-
this.
|
|
10912
|
+
this.findNextElement(event);
|
|
11326
10913
|
}
|
|
11327
10914
|
}
|
|
11328
10915
|
else {
|
|
11329
|
-
|
|
11330
|
-
if (this.isBlazorServer ? (isNullOrUndefined(this.activeIndex)) : (isNullOrUndefined(this.value) &&
|
|
11331
|
-
isNullOrUndefined(this.activeIndex))) {
|
|
11332
|
-
this.selectNextItem(event);
|
|
11333
|
-
}
|
|
11334
|
-
else {
|
|
11335
|
-
this.findNextElement(event);
|
|
11336
|
-
}
|
|
11337
|
-
}
|
|
11338
|
-
else {
|
|
11339
|
-
this.findNextElement(event);
|
|
11340
|
-
}
|
|
10916
|
+
this.findNextElement(event);
|
|
11341
10917
|
}
|
|
11342
10918
|
}
|
|
11343
10919
|
else {
|
|
@@ -11348,50 +10924,34 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11348
10924
|
this.activeIndex = index = this.activeIndex < 0 ? (count - 1) : this.activeIndex;
|
|
11349
10925
|
this.activeIndex = index = this.validLiElement(this.activeIndex, (event.keyCode === 40 || event.keyCode === 39) ?
|
|
11350
10926
|
false : true);
|
|
11351
|
-
|
|
11352
|
-
nextItem = isNullOrUndefined(this.timeCollections[index]) ? this.timeCollections[0] : this.timeCollections[index];
|
|
11353
|
-
}
|
|
10927
|
+
nextItem = isNullOrUndefined(this.timeCollections[index]) ? this.timeCollections[0] : this.timeCollections[index];
|
|
11354
10928
|
}
|
|
11355
10929
|
else if (event.action === 'home') {
|
|
11356
10930
|
const index = this.validLiElement(0);
|
|
11357
10931
|
this.activeIndex = index;
|
|
11358
|
-
|
|
11359
|
-
nextItem = this.timeCollections[index];
|
|
11360
|
-
}
|
|
10932
|
+
nextItem = this.timeCollections[index];
|
|
11361
10933
|
}
|
|
11362
10934
|
else if (event.action === 'end') {
|
|
11363
10935
|
const index = this.validLiElement(count - 1, true);
|
|
11364
10936
|
this.activeIndex = index;
|
|
11365
|
-
|
|
11366
|
-
nextItem = this.timeCollections[index];
|
|
11367
|
-
}
|
|
10937
|
+
nextItem = this.timeCollections[index];
|
|
11368
10938
|
}
|
|
11369
10939
|
this.selectedElement = this.liCollections[this.activeIndex];
|
|
11370
|
-
|
|
11371
|
-
this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
|
|
11372
|
-
this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
|
|
11373
|
-
}
|
|
11374
|
-
else {
|
|
11375
|
-
this.elementValue(new Date(nextItem));
|
|
11376
|
-
}
|
|
10940
|
+
this.elementValue(new Date(nextItem));
|
|
11377
10941
|
}
|
|
11378
10942
|
this.isNavigate = true;
|
|
11379
10943
|
this.setHover(this.selectedElement, NAVIGATION);
|
|
11380
10944
|
this.setActiveDescendant();
|
|
11381
|
-
|
|
11382
|
-
this.selectInputText();
|
|
11383
|
-
}
|
|
10945
|
+
this.selectInputText();
|
|
11384
10946
|
if (this.isPopupOpen() && this.selectedElement !== null && (!event || event.type !== 'click')) {
|
|
11385
10947
|
this.setScrollPosition();
|
|
11386
10948
|
}
|
|
11387
10949
|
}
|
|
11388
10950
|
getCultureTimeObject(ld, c) {
|
|
11389
|
-
return
|
|
11390
|
-
getValue('main.' + c + '.dates.calendars.gregorian.timeFormats.short', ld);
|
|
10951
|
+
return getValue('main.' + c + '.dates.calendars.gregorian.timeFormats.short', ld);
|
|
11391
10952
|
}
|
|
11392
10953
|
getCultureDateObject(ld, c) {
|
|
11393
|
-
return
|
|
11394
|
-
getValue('main.' + c + '.dates.calendars.gregorian.dateFormats.short', ld);
|
|
10954
|
+
return getValue('main.' + c + '.dates.calendars.gregorian.dateFormats.short', ld);
|
|
11395
10955
|
}
|
|
11396
10956
|
wireListEvents() {
|
|
11397
10957
|
EventHandler.add(this.listWrapper, 'click', this.onMouseClick, this);
|
|
@@ -11493,8 +11053,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11493
11053
|
const items = this.popupWrapper.querySelectorAll('.' + LISTCLASS$1);
|
|
11494
11054
|
if (items.length) {
|
|
11495
11055
|
for (let i = 0; i < items.length; i++) {
|
|
11496
|
-
if ((
|
|
11497
|
-
|| (this.isBlazorServer && this.blazorTimeCollections[i] === this.blazorTimeCollections[this.activeIndex])) {
|
|
11056
|
+
if ((this.timeCollections[i] === +this.getDateObject(this.valueWithMinutes))) {
|
|
11498
11057
|
items[i].setAttribute('aria-selected', 'true');
|
|
11499
11058
|
this.selectedElement = items[i];
|
|
11500
11059
|
this.activeIndex = i;
|
|
@@ -11517,9 +11076,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11517
11076
|
return (li && li.classList.contains(LISTCLASS$1) && !li.classList.contains(DISABLED$3));
|
|
11518
11077
|
}
|
|
11519
11078
|
createDateObj(val) {
|
|
11520
|
-
const formatStr =
|
|
11521
|
-
'M' + getDefaultDateObject().dateSeperator + 'd' + getDefaultDateObject().dateSeperator + 'yy'
|
|
11522
|
-
: null;
|
|
11079
|
+
const formatStr = null;
|
|
11523
11080
|
let today = this.globalize.formatDate(new Date(), { format: formatStr, skeleton: 'short', type: 'date' });
|
|
11524
11081
|
let value = null;
|
|
11525
11082
|
if (typeof val === 'string') {
|
|
@@ -11661,18 +11218,15 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11661
11218
|
}
|
|
11662
11219
|
removeClass([this.inputWrapper.container], [FOCUS]);
|
|
11663
11220
|
const blurArguments = {
|
|
11664
|
-
model: this
|
|
11221
|
+
model: this
|
|
11665
11222
|
};
|
|
11666
11223
|
this.trigger('blur', blurArguments);
|
|
11667
|
-
if (
|
|
11224
|
+
if (this.getText() !== this.inputElement.value) {
|
|
11668
11225
|
this.updateValue((this.inputElement).value, e);
|
|
11669
11226
|
}
|
|
11670
11227
|
else if (this.inputElement.value.trim().length === 0) {
|
|
11671
11228
|
this.resetState();
|
|
11672
11229
|
}
|
|
11673
|
-
if (this.isBlazorServer) {
|
|
11674
|
-
this.interopAdaptor.invokeMethodAsync('OnStrictMode', this.inputElement.value);
|
|
11675
|
-
}
|
|
11676
11230
|
this.cursorDetails = null;
|
|
11677
11231
|
this.isNavigate = false;
|
|
11678
11232
|
if (this.inputElement.value === '') {
|
|
@@ -11689,7 +11243,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11689
11243
|
this.inputElement.blur();
|
|
11690
11244
|
removeClass([this.inputWrapper.container], [FOCUS]);
|
|
11691
11245
|
const blurArguments = {
|
|
11692
|
-
model: this
|
|
11246
|
+
model: this
|
|
11693
11247
|
};
|
|
11694
11248
|
this.trigger('blur', blurArguments);
|
|
11695
11249
|
}
|
|
@@ -11705,7 +11259,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11705
11259
|
return;
|
|
11706
11260
|
}
|
|
11707
11261
|
const focusArguments = {
|
|
11708
|
-
model: this
|
|
11262
|
+
model: this
|
|
11709
11263
|
};
|
|
11710
11264
|
if (!this.readonly && !Browser.isDevice && !this.enableMask) {
|
|
11711
11265
|
this.selectInputText();
|
|
@@ -11767,7 +11321,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11767
11321
|
document.body.appendChild(this.mobileTimePopupWrap);
|
|
11768
11322
|
}
|
|
11769
11323
|
this.openPopupEventArgs = {
|
|
11770
|
-
popup: this.
|
|
11324
|
+
popup: this.popupObj || null,
|
|
11771
11325
|
cancel: false,
|
|
11772
11326
|
event: event || null,
|
|
11773
11327
|
name: 'open',
|
|
@@ -11775,19 +11329,8 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11775
11329
|
};
|
|
11776
11330
|
const eventArgs = this.openPopupEventArgs;
|
|
11777
11331
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
11778
|
-
if ((isBlazor() && this.isServerRendered)) {
|
|
11779
|
-
eventArgs.popup = this.popupObj || null;
|
|
11780
|
-
}
|
|
11781
11332
|
this.openPopupEventArgs = eventArgs;
|
|
11782
11333
|
if (!this.openPopupEventArgs.cancel && !this.inputWrapper.buttons[0].classList.contains(DISABLED$3)) {
|
|
11783
|
-
if (this.isBlazorServer) {
|
|
11784
|
-
this.popupWrapper.style.visibility = '';
|
|
11785
|
-
this.popupWrapper.style.width = this.inputWrapper.container.offsetWidth + 'px';
|
|
11786
|
-
this.popupWrapper.style.height = 'auto';
|
|
11787
|
-
}
|
|
11788
|
-
if (this.isBlazorServer) {
|
|
11789
|
-
this.openPopupEventArgs.popup = this.popupObj;
|
|
11790
|
-
}
|
|
11791
11334
|
this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper);
|
|
11792
11335
|
this.popupAlignment(this.openPopupEventArgs);
|
|
11793
11336
|
this.setScrollPosition();
|
|
@@ -11813,11 +11356,6 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11813
11356
|
}
|
|
11814
11357
|
else {
|
|
11815
11358
|
this.popupObj.destroy();
|
|
11816
|
-
if (this.isBlazorServer) {
|
|
11817
|
-
this.disposeServerPopup();
|
|
11818
|
-
this.inputWrapper.container.parentElement.insertBefore(this.popupWrapper, this.inputWrapper.container.nextElementSibling);
|
|
11819
|
-
this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
|
|
11820
|
-
}
|
|
11821
11359
|
this.popupWrapper = this.listTag = undefined;
|
|
11822
11360
|
this.liCollections = this.timeCollections = this.disableItemCollection = [];
|
|
11823
11361
|
this.popupObj = null;
|
|
@@ -11941,10 +11479,8 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11941
11479
|
this.setTimeAllowEdit();
|
|
11942
11480
|
break;
|
|
11943
11481
|
case 'enableRtl':
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
this.setEnableRtl();
|
|
11947
|
-
}
|
|
11482
|
+
this.setProperties({ enableRtl: newProp.enableRtl }, true);
|
|
11483
|
+
this.setEnableRtl();
|
|
11948
11484
|
break;
|
|
11949
11485
|
case 'cssClass':
|
|
11950
11486
|
this.updateCssClass(newProp.cssClass, oldProp.cssClass);
|
|
@@ -11960,9 +11496,7 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11960
11496
|
break;
|
|
11961
11497
|
case 'min':
|
|
11962
11498
|
case 'max':
|
|
11963
|
-
|
|
11964
|
-
this.getProperty(newProp, prop);
|
|
11965
|
-
}
|
|
11499
|
+
this.getProperty(newProp, prop);
|
|
11966
11500
|
break;
|
|
11967
11501
|
case 'showClearButton':
|
|
11968
11502
|
Input.setClearButton(this.showClearButton, this.inputElement, this.inputWrapper);
|
|
@@ -11973,13 +11507,11 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11973
11507
|
this.globalize = new Internationalization(this.locale);
|
|
11974
11508
|
this.l10n.setLocale(this.locale);
|
|
11975
11509
|
this.updatePlaceHolder();
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
});
|
|
11982
|
-
}
|
|
11510
|
+
this.setValue(this.value);
|
|
11511
|
+
if (this.enableMask) {
|
|
11512
|
+
this.notify("createMask", {
|
|
11513
|
+
module: "MaskedDateTime",
|
|
11514
|
+
});
|
|
11983
11515
|
}
|
|
11984
11516
|
break;
|
|
11985
11517
|
case 'width':
|
|
@@ -11989,50 +11521,46 @@ let TimePicker = class TimePicker extends Component {
|
|
|
11989
11521
|
case 'format':
|
|
11990
11522
|
this.setProperties({ format: newProp.format }, true);
|
|
11991
11523
|
this.checkTimeFormat();
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
this.updateInputValue(this.maskedDateValue);
|
|
11998
|
-
}
|
|
11524
|
+
this.setValue(this.value);
|
|
11525
|
+
if (this.enableMask) {
|
|
11526
|
+
this.createMask();
|
|
11527
|
+
if (!this.value) {
|
|
11528
|
+
this.updateInputValue(this.maskedDateValue);
|
|
11999
11529
|
}
|
|
12000
11530
|
}
|
|
12001
11531
|
break;
|
|
12002
11532
|
case 'value':
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
if (
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
newProp.value = this.value;
|
|
12011
|
-
}
|
|
12012
|
-
else {
|
|
12013
|
-
if ((newProp.value && +new Date(+newProp.value).setMilliseconds(0)) !== +this.value) {
|
|
12014
|
-
newProp.value = this.checkDateValue(new Date('' + newProp.value));
|
|
12015
|
-
}
|
|
12016
|
-
}
|
|
12017
|
-
this.initValue = newProp.value;
|
|
12018
|
-
newProp.value = this.compareFormatChange(this.checkValue(newProp.value));
|
|
11533
|
+
this.invalidValueString = null;
|
|
11534
|
+
this.checkInvalidValue(newProp.value);
|
|
11535
|
+
newProp.value = this.value;
|
|
11536
|
+
if (!this.invalidValueString) {
|
|
11537
|
+
if (typeof newProp.value === 'string') {
|
|
11538
|
+
this.setProperties({ value: this.checkDateValue(new Date(newProp.value)) }, true);
|
|
11539
|
+
newProp.value = this.value;
|
|
12019
11540
|
}
|
|
12020
11541
|
else {
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
this.checkValueChange(null, false);
|
|
12025
|
-
if (this.isPopupOpen()) {
|
|
12026
|
-
this.setScrollPosition();
|
|
12027
|
-
}
|
|
12028
|
-
if (this.isAngular && this.preventChange) {
|
|
12029
|
-
this.preventChange = false;
|
|
12030
|
-
}
|
|
12031
|
-
if (this.enableMask) {
|
|
12032
|
-
this.notify("createMask", {
|
|
12033
|
-
module: "MaskedDateTime",
|
|
12034
|
-
});
|
|
11542
|
+
if ((newProp.value && +new Date(+newProp.value).setMilliseconds(0)) !== +this.value) {
|
|
11543
|
+
newProp.value = this.checkDateValue(new Date('' + newProp.value));
|
|
11544
|
+
}
|
|
12035
11545
|
}
|
|
11546
|
+
this.initValue = newProp.value;
|
|
11547
|
+
newProp.value = this.compareFormatChange(this.checkValue(newProp.value));
|
|
11548
|
+
}
|
|
11549
|
+
else {
|
|
11550
|
+
this.updateInputValue(this.invalidValueString);
|
|
11551
|
+
this.checkErrorState(this.invalidValueString);
|
|
11552
|
+
}
|
|
11553
|
+
this.checkValueChange(null, false);
|
|
11554
|
+
if (this.isPopupOpen()) {
|
|
11555
|
+
this.setScrollPosition();
|
|
11556
|
+
}
|
|
11557
|
+
if (this.isAngular && this.preventChange) {
|
|
11558
|
+
this.preventChange = false;
|
|
11559
|
+
}
|
|
11560
|
+
if (this.enableMask) {
|
|
11561
|
+
this.notify("createMask", {
|
|
11562
|
+
module: "MaskedDateTime",
|
|
11563
|
+
});
|
|
12036
11564
|
}
|
|
12037
11565
|
break;
|
|
12038
11566
|
case 'floatLabelType':
|
|
@@ -12041,32 +11569,23 @@ let TimePicker = class TimePicker extends Component {
|
|
|
12041
11569
|
Input.addFloating(this.inputElement, this.floatLabelType, this.placeholder);
|
|
12042
11570
|
break;
|
|
12043
11571
|
case 'strictMode':
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
this.checkErrorState(null);
|
|
12048
|
-
}
|
|
12049
|
-
this.setProperties({ strictMode: newProp.strictMode }, true);
|
|
12050
|
-
this.checkValue((this.inputElement).value);
|
|
12051
|
-
this.checkValueChange(null, false);
|
|
11572
|
+
this.invalidValueString = null;
|
|
11573
|
+
if (newProp.strictMode) {
|
|
11574
|
+
this.checkErrorState(null);
|
|
12052
11575
|
}
|
|
11576
|
+
this.setProperties({ strictMode: newProp.strictMode }, true);
|
|
11577
|
+
this.checkValue((this.inputElement).value);
|
|
11578
|
+
this.checkValueChange(null, false);
|
|
12053
11579
|
break;
|
|
12054
11580
|
case 'scrollTo':
|
|
12055
|
-
if (
|
|
12056
|
-
if (this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo)))) {
|
|
12057
|
-
if (this.popupWrapper) {
|
|
12058
|
-
this.setScrollTo();
|
|
12059
|
-
}
|
|
12060
|
-
this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo))) }, true);
|
|
12061
|
-
}
|
|
12062
|
-
else {
|
|
12063
|
-
this.setProperties({ scrollTo: null }, true);
|
|
12064
|
-
}
|
|
12065
|
-
}
|
|
12066
|
-
else {
|
|
11581
|
+
if (this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo)))) {
|
|
12067
11582
|
if (this.popupWrapper) {
|
|
12068
11583
|
this.setScrollTo();
|
|
12069
11584
|
}
|
|
11585
|
+
this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo))) }, true);
|
|
11586
|
+
}
|
|
11587
|
+
else {
|
|
11588
|
+
this.setProperties({ scrollTo: null }, true);
|
|
12070
11589
|
}
|
|
12071
11590
|
break;
|
|
12072
11591
|
case 'enableMask':
|
|
@@ -12299,7 +11818,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
12299
11818
|
}
|
|
12300
11819
|
removeClass([this.inputWrapper.container], INPUTFOCUS$2);
|
|
12301
11820
|
const blurArguments = {
|
|
12302
|
-
model:
|
|
11821
|
+
model: this
|
|
12303
11822
|
};
|
|
12304
11823
|
if (this.isTimePopupOpen()) {
|
|
12305
11824
|
this.hide(e);
|
|
@@ -12478,7 +11997,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
12478
11997
|
let dateOptions;
|
|
12479
11998
|
if (!isNullOrUndefined(value)) {
|
|
12480
11999
|
if (this.calendarMode === 'Gregorian') {
|
|
12481
|
-
dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton:
|
|
12000
|
+
dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd' };
|
|
12482
12001
|
}
|
|
12483
12002
|
else {
|
|
12484
12003
|
dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
|
|
@@ -12529,8 +12048,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
12529
12048
|
let cldrTime;
|
|
12530
12049
|
if (this.isNullOrEmpty(this.timeFormat)) {
|
|
12531
12050
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
12532
|
-
cldrTime =
|
|
12533
|
-
(getValue('timeFormats.short', getDefaultDateObject()));
|
|
12051
|
+
cldrTime = (getValue('timeFormats.short', getDefaultDateObject()));
|
|
12534
12052
|
}
|
|
12535
12053
|
else {
|
|
12536
12054
|
cldrTime = (this.getCultureTimeObject(cldrData, '' + this.locale));
|
|
@@ -12544,7 +12062,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
12544
12062
|
cldrDateTimeFormat() {
|
|
12545
12063
|
let cldrTime;
|
|
12546
12064
|
const culture = new Internationalization(this.locale);
|
|
12547
|
-
const dateFormat = culture.getDatePattern({ skeleton:
|
|
12065
|
+
const dateFormat = culture.getDatePattern({ skeleton: 'yMd' });
|
|
12548
12066
|
if (this.isNullOrEmpty(this.formatString)) {
|
|
12549
12067
|
cldrTime = dateFormat + ' ' + this.getCldrFormat('time');
|
|
12550
12068
|
}
|
|
@@ -12557,8 +12075,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
12557
12075
|
getCldrFormat(type) {
|
|
12558
12076
|
let cldrDateTime;
|
|
12559
12077
|
if (this.locale === 'en' || this.locale === 'en-US') {
|
|
12560
|
-
cldrDateTime =
|
|
12561
|
-
(getValue('timeFormats.short', getDefaultDateObject()));
|
|
12078
|
+
cldrDateTime = (getValue('timeFormats.short', getDefaultDateObject()));
|
|
12562
12079
|
}
|
|
12563
12080
|
else {
|
|
12564
12081
|
cldrDateTime = (this.getCultureTimeObject(cldrData, '' + this.locale));
|
|
@@ -12576,8 +12093,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
12576
12093
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12577
12094
|
getCultureTimeObject(ld, c) {
|
|
12578
12095
|
if (this.calendarMode === 'Gregorian') {
|
|
12579
|
-
return
|
|
12580
|
-
(getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld));
|
|
12096
|
+
return getValue('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld);
|
|
12581
12097
|
}
|
|
12582
12098
|
else {
|
|
12583
12099
|
return getValue('main.' + '' + this.locale + '.dates.calendars.islamic.timeFormats.short', ld);
|
|
@@ -12723,7 +12239,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
12723
12239
|
openPopup(e) {
|
|
12724
12240
|
this.preventArgs = {
|
|
12725
12241
|
cancel: false,
|
|
12726
|
-
popup:
|
|
12242
|
+
popup: this.popupObject,
|
|
12727
12243
|
event: e || null
|
|
12728
12244
|
};
|
|
12729
12245
|
const eventArgs = this.preventArgs;
|
|
@@ -13130,7 +12646,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
13130
12646
|
if (this.popupObj || this.dateTimeWrapper) {
|
|
13131
12647
|
this.preventArgs = {
|
|
13132
12648
|
cancel: false,
|
|
13133
|
-
popup:
|
|
12649
|
+
popup: this.popupObj || this.popupObject,
|
|
13134
12650
|
event: e || null
|
|
13135
12651
|
};
|
|
13136
12652
|
const eventArgs = this.preventArgs;
|
|
@@ -13370,7 +12886,7 @@ let DateTimePicker = class DateTimePicker extends DatePicker {
|
|
|
13370
12886
|
if (this.calendarMode === 'Gregorian') {
|
|
13371
12887
|
dateString = this.globalize.formatDate(time, {
|
|
13372
12888
|
format: !isNullOrUndefined(this.formatString) ? this.formatString : this.cldrDateTimeFormat(),
|
|
13373
|
-
type: 'dateTime', skeleton:
|
|
12889
|
+
type: 'dateTime', skeleton: 'yMd'
|
|
13374
12890
|
});
|
|
13375
12891
|
}
|
|
13376
12892
|
else {
|
|
@@ -13792,9 +13308,14 @@ class MaskedDateTime {
|
|
|
13792
13308
|
this.isDeletion = false;
|
|
13793
13309
|
this.isShortYear = false;
|
|
13794
13310
|
this.isDeleteKey = false;
|
|
13311
|
+
this.isDateZero = false;
|
|
13312
|
+
this.isMonthZero = false;
|
|
13313
|
+
this.isYearZero = false;
|
|
13314
|
+
this.dayTypeCount = 0;
|
|
13315
|
+
this.monthTypeCount = 0;
|
|
13795
13316
|
this.parent = parent;
|
|
13796
13317
|
this.dateformat = this.getCulturedFormat();
|
|
13797
|
-
this.maskDateValue = this.parent.value != null ? this.parent.value : new Date();
|
|
13318
|
+
this.maskDateValue = this.parent.value != null ? new Date(+this.parent.value) : new Date();
|
|
13798
13319
|
this.maskDateValue.setMonth(0);
|
|
13799
13320
|
this.maskDateValue.setHours(0);
|
|
13800
13321
|
this.maskDateValue.setMinutes(0);
|
|
@@ -13952,6 +13473,7 @@ class MaskedDateTime {
|
|
|
13952
13473
|
switch (this.previousHiddenMask[start - 1]) {
|
|
13953
13474
|
case 'd':
|
|
13954
13475
|
let date = (this.isDayPart && newDateValue.getDate().toString().length < 2 ? newDateValue.getDate() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
13476
|
+
this.isDateZero = (newVal[start - 1] == '0');
|
|
13955
13477
|
if (isNaN(date)) {
|
|
13956
13478
|
return;
|
|
13957
13479
|
}
|
|
@@ -13966,9 +13488,11 @@ class MaskedDateTime {
|
|
|
13966
13488
|
return;
|
|
13967
13489
|
}
|
|
13968
13490
|
this.isDayPart = true;
|
|
13491
|
+
this.dayTypeCount = this.dayTypeCount + 1;
|
|
13969
13492
|
}
|
|
13970
13493
|
else {
|
|
13971
13494
|
this.isDayPart = false;
|
|
13495
|
+
this.dayTypeCount = this.isDateZero ? this.dayTypeCount + 1 : this.dayTypeCount;
|
|
13972
13496
|
}
|
|
13973
13497
|
break;
|
|
13974
13498
|
case 'M':
|
|
@@ -13979,6 +13503,7 @@ class MaskedDateTime {
|
|
|
13979
13503
|
else {
|
|
13980
13504
|
month = parseInt(newVal[start - 1], 10);
|
|
13981
13505
|
}
|
|
13506
|
+
this.isMonthZero = (newVal[start - 1] == '0');
|
|
13982
13507
|
if (!isNaN(month)) {
|
|
13983
13508
|
while (month > 12) {
|
|
13984
13509
|
month = parseInt(month.toString().slice(1), 10);
|
|
@@ -13999,10 +13524,12 @@ class MaskedDateTime {
|
|
|
13999
13524
|
}
|
|
14000
13525
|
this.previousDate = new Date(newDateValue.getFullYear(), newDateValue.getMonth(), newDateValue.getDate());
|
|
14001
13526
|
this.isMonthPart = true;
|
|
13527
|
+
this.monthTypeCount = this.monthTypeCount + 1;
|
|
14002
13528
|
}
|
|
14003
13529
|
else {
|
|
14004
13530
|
newDateValue.setMonth(0);
|
|
14005
13531
|
this.isMonthPart = false;
|
|
13532
|
+
this.monthTypeCount = this.isMonthZero ? this.monthTypeCount + 1 : this.monthTypeCount;
|
|
14006
13533
|
}
|
|
14007
13534
|
}
|
|
14008
13535
|
else { // let monthString: string[] = <string[]>(getValue('months[stand-alone].wide', getDefaultDateObject()));
|
|
@@ -14027,6 +13554,7 @@ class MaskedDateTime {
|
|
|
14027
13554
|
case 'y':
|
|
14028
13555
|
let year = (this.isYearPart && (newDateValue.getFullYear().toString().length < 4 && !this.isShortYear) ? newDateValue.getFullYear() * 10 : 0) + parseInt(newVal[start - 1], 10);
|
|
14029
13556
|
this.isShortYear = false;
|
|
13557
|
+
this.isYearZero = (newVal[start - 1] == '0');
|
|
14030
13558
|
if (isNaN(year)) {
|
|
14031
13559
|
return;
|
|
14032
13560
|
}
|
|
@@ -14134,9 +13662,15 @@ class MaskedDateTime {
|
|
|
14134
13662
|
case 'dddd':
|
|
14135
13663
|
case 'd':
|
|
14136
13664
|
result = proxy.isDayPart ? proxy.maskDateValue.getDate().toString() : proxy.defaultConstant['day'].toString();
|
|
13665
|
+
result = proxy.zeroCheck(proxy.isDateZero, proxy.isDayPart, result);
|
|
14137
13666
|
break;
|
|
14138
13667
|
case 'dd':
|
|
14139
13668
|
result = proxy.isDayPart ? proxy.roundOff(proxy.maskDateValue.getDate(), 2) : proxy.defaultConstant['day'].toString();
|
|
13669
|
+
result = proxy.zeroCheck(proxy.isDateZero, proxy.isDayPart, result);
|
|
13670
|
+
if (proxy.dayTypeCount == 2) {
|
|
13671
|
+
proxy.isNavigate = true;
|
|
13672
|
+
proxy.dayTypeCount = 0;
|
|
13673
|
+
}
|
|
14140
13674
|
break;
|
|
14141
13675
|
case 'E':
|
|
14142
13676
|
case 'EE':
|
|
@@ -14151,9 +13685,15 @@ class MaskedDateTime {
|
|
|
14151
13685
|
break;
|
|
14152
13686
|
case 'M':
|
|
14153
13687
|
result = proxy.isMonthPart ? (proxy.maskDateValue.getMonth() + 1).toString() : proxy.defaultConstant['month'].toString();
|
|
13688
|
+
result = proxy.zeroCheck(proxy.isMonthZero, proxy.isMonthPart, result);
|
|
14154
13689
|
break;
|
|
14155
13690
|
case 'MM':
|
|
14156
13691
|
result = proxy.isMonthPart ? proxy.roundOff(proxy.maskDateValue.getMonth() + 1, 2) : proxy.defaultConstant['month'].toString();
|
|
13692
|
+
result = proxy.zeroCheck(proxy.isMonthZero, proxy.isMonthPart, result);
|
|
13693
|
+
if (proxy.monthTypeCount == 2) {
|
|
13694
|
+
proxy.isNavigate = true;
|
|
13695
|
+
proxy.monthTypeCount = 0;
|
|
13696
|
+
}
|
|
14157
13697
|
break;
|
|
14158
13698
|
case 'MMM':
|
|
14159
13699
|
result = proxy.isMonthPart ? monthAbbreviated[proxy.maskDateValue.getMonth() + 1] : proxy.defaultConstant['month'].toString();
|
|
@@ -14163,6 +13703,7 @@ class MaskedDateTime {
|
|
|
14163
13703
|
break;
|
|
14164
13704
|
case 'yy':
|
|
14165
13705
|
result = proxy.isYearPart ? proxy.roundOff(proxy.maskDateValue.getFullYear() % 100, 2) : proxy.defaultConstant['year'].toString();
|
|
13706
|
+
result = proxy.zeroCheck(proxy.isYearZero, proxy.isYearPart, result);
|
|
14166
13707
|
if (proxy.isYearPart) {
|
|
14167
13708
|
proxy.isNavigate = proxy.isShortYear = (proxy.maskDateValue.getFullYear() % 100).toString().length === 2;
|
|
14168
13709
|
}
|
|
@@ -14170,6 +13711,7 @@ class MaskedDateTime {
|
|
|
14170
13711
|
case 'y':
|
|
14171
13712
|
case 'yyyy':
|
|
14172
13713
|
result = proxy.isYearPart ? proxy.roundOff(proxy.maskDateValue.getFullYear(), 4) : proxy.defaultConstant['year'].toString();
|
|
13714
|
+
result = proxy.zeroCheck(proxy.isYearZero, proxy.isYearPart, result);
|
|
14173
13715
|
break;
|
|
14174
13716
|
case 'h':
|
|
14175
13717
|
result = proxy.isHourPart ? (proxy.maskDateValue.getHours() % 12 || 12).toString() : proxy.defaultConstant['hour'].toString();
|
|
@@ -14245,6 +13787,7 @@ class MaskedDateTime {
|
|
|
14245
13787
|
inputValue = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
14246
13788
|
this.isHiddenMask = true;
|
|
14247
13789
|
this.hiddenMask = this.dateformat.replace(this.formatRegex, this.formatCheck());
|
|
13790
|
+
this.isDateZero = this.isMonthZero = this.isYearZero = false;
|
|
14248
13791
|
this.isHiddenMask = false;
|
|
14249
13792
|
this.previousHiddenMask = this.hiddenMask;
|
|
14250
13793
|
this.previousValue = inputValue;
|
|
@@ -14281,6 +13824,13 @@ class MaskedDateTime {
|
|
|
14281
13824
|
}
|
|
14282
13825
|
return result + valueText;
|
|
14283
13826
|
}
|
|
13827
|
+
zeroCheck(isZero, isDayPart, resultValue) {
|
|
13828
|
+
let result = resultValue;
|
|
13829
|
+
if (isZero && !isDayPart) {
|
|
13830
|
+
result = '0';
|
|
13831
|
+
}
|
|
13832
|
+
return result;
|
|
13833
|
+
}
|
|
14284
13834
|
handleDeletion(format, isSegment) {
|
|
14285
13835
|
switch (format) {
|
|
14286
13836
|
case 'd':
|