@syncfusion/ej2-calendars 22.2.10 → 22.2.12

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.
@@ -3206,6 +3206,7 @@ let DatePicker = class DatePicker extends Calendar {
3206
3206
  this.moduleName = this.getModuleName();
3207
3207
  this.isFocused = false;
3208
3208
  this.isBlur = false;
3209
+ this.isKeyAction = false;
3209
3210
  this.datepickerOptions = options;
3210
3211
  }
3211
3212
  /**
@@ -3533,6 +3534,7 @@ let DatePicker = class DatePicker extends Calendar {
3533
3534
  EventHandler.add(this.inputElement, 'mouseup', this.mouseUpHandler, this);
3534
3535
  EventHandler.add(this.inputElement, 'focus', this.inputFocusHandler, this);
3535
3536
  EventHandler.add(this.inputElement, 'blur', this.inputBlurHandler, this);
3537
+ EventHandler.add(this.inputElement, 'keyup', this.keyupHandler, this);
3536
3538
  if (this.enableMask) {
3537
3539
  EventHandler.add(this.inputElement, 'keydown', this.keydownHandler, this);
3538
3540
  }
@@ -3583,6 +3585,7 @@ let DatePicker = class DatePicker extends Calendar {
3583
3585
  EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);
3584
3586
  EventHandler.remove(this.inputElement, 'blur', this.inputBlurHandler);
3585
3587
  EventHandler.remove(this.inputElement, 'change', this.inputChangeHandler);
3588
+ EventHandler.remove(this.inputElement, 'keyup', this.keyupHandler);
3586
3589
  if (this.enableMask) {
3587
3590
  EventHandler.remove(this.inputElement, 'keydown', this.keydownHandler);
3588
3591
  }
@@ -4271,12 +4274,16 @@ let DatePicker = class DatePicker extends Calendar {
4271
4274
  this.isInteracted = true;
4272
4275
  }
4273
4276
  }
4277
+ this.isKeyAction = false;
4274
4278
  }
4275
4279
  navigatedEvent() {
4276
4280
  this.trigger('navigated', this.navigatedArgs);
4277
4281
  }
4282
+ keyupHandler(e) {
4283
+ this.isKeyAction = (this.inputElement.value !== this.previousElementValue) ? true : false;
4284
+ }
4278
4285
  changeEvent(event) {
4279
- if (!this.isIconClicked && !this.isBlur) {
4286
+ if (!this.isIconClicked && !(this.isBlur || this.isKeyAction)) {
4280
4287
  this.selectCalendar(event);
4281
4288
  }
4282
4289
  if (((this.previousDate && this.previousDate.valueOf()) !== (this.value && this.value.valueOf()))) {
@@ -4296,6 +4303,7 @@ let DatePicker = class DatePicker extends Calendar {
4296
4303
  else if (event) {
4297
4304
  this.hide(event);
4298
4305
  }
4306
+ this.isKeyAction = false;
4299
4307
  }
4300
4308
  requiredModules() {
4301
4309
  const modules = [];
@@ -5304,6 +5312,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
5304
5312
  this.invalidValueString = null;
5305
5313
  this.isAngular = false;
5306
5314
  this.preventChange = false;
5315
+ this.isKeyPressed = false;
5307
5316
  this.dateRangeOptions = options;
5308
5317
  }
5309
5318
  /**
@@ -5654,6 +5663,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
5654
5663
  EventHandler.add(this.inputElement, 'focus', this.inputFocusHandler, this);
5655
5664
  EventHandler.add(this.inputElement, 'blur', this.inputBlurHandler, this);
5656
5665
  EventHandler.add(this.inputElement, 'change', this.inputChangeHandler, this);
5666
+ EventHandler.add(this.inputElement, 'keyup', this.keyupHandler, this);
5657
5667
  if (this.showClearButton && this.inputWrapper.clearButton) {
5658
5668
  EventHandler.add(this.inputWrapper.clearButton, 'mousedown', this.resetHandler, this);
5659
5669
  }
@@ -5680,6 +5690,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
5680
5690
  EventHandler.remove(this.inputElement, 'blur', this.inputBlurHandler);
5681
5691
  EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);
5682
5692
  EventHandler.remove(this.inputElement, 'change', this.inputChangeHandler);
5693
+ EventHandler.remove(this.inputElement, 'keyup', this.keyupHandler);
5683
5694
  if (this.showClearButton && this.inputWrapper.clearButton) {
5684
5695
  EventHandler.remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler);
5685
5696
  }
@@ -7889,6 +7900,9 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
7889
7900
  this.startButton.element.classList.add(ACTIVE$1);
7890
7901
  }
7891
7902
  }
7903
+ keyupHandler(e) {
7904
+ this.isKeyPressed = (this.inputElement.value !== this.previousEleValue) ? true : false;
7905
+ }
7892
7906
  applyFunction(eve) {
7893
7907
  let isValueChanged = false;
7894
7908
  if (eve.type !== 'touchstart') {
@@ -7914,7 +7928,10 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
7914
7928
  this.previousStartValue = new Date(+this.startValue);
7915
7929
  this.previousEndValue = new Date(+this.endValue);
7916
7930
  this.previousEleValue = this.inputElement.value;
7917
- Input.setValue(this.rangeArgs(eve).text, this.inputElement, this.floatLabelType, this.showClearButton);
7931
+ if (!this.isKeyPressed) {
7932
+ Input.setValue(this.rangeArgs(eve).text, this.inputElement, this.floatLabelType, this.showClearButton);
7933
+ }
7934
+ this.isKeyPressed = false;
7918
7935
  if (+this.initStartDate !== +this.startValue || +this.initEndDate !== +this.endValue) {
7919
7936
  isValueChanged = true;
7920
7937
  }
@@ -10694,7 +10711,7 @@ let TimePicker = class TimePicker extends Component {
10694
10711
  }
10695
10712
  inputHandler(event) {
10696
10713
  if (!this.readonly && this.enabled) {
10697
- if (!((event.action == 'right' || event.action == 'left' || event.action == 'tab') || ((event.action == 'home' || event.action == 'end') && !this.isPopupOpen()))) {
10714
+ if (!((event.action == 'right' || event.action == 'left' || event.action == 'tab') || ((event.action == 'home' || event.action == 'end' || event.action == 'up' || event.action == 'down') && !this.isPopupOpen() && !this.enableMask))) {
10698
10715
  event.preventDefault();
10699
10716
  }
10700
10717
  switch (event.action) {
@@ -11495,7 +11512,9 @@ let TimePicker = class TimePicker extends Component {
11495
11512
  this.isNavigate = true;
11496
11513
  this.setHover(this.selectedElement, NAVIGATION);
11497
11514
  this.setActiveDescendant();
11498
- this.selectInputText();
11515
+ if (this.enableMask) {
11516
+ this.selectInputText();
11517
+ }
11499
11518
  if (this.isPopupOpen() && this.selectedElement !== null && (!event || event.type !== 'click')) {
11500
11519
  this.setScrollPosition();
11501
11520
  }