@syncfusion/ej2-calendars 21.2.9 → 21.2.10

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.
@@ -3205,6 +3205,7 @@ let DatePicker = class DatePicker extends Calendar {
3205
3205
  this.isDynamicValueChanged = false;
3206
3206
  this.moduleName = this.getModuleName();
3207
3207
  this.isFocused = false;
3208
+ this.isBlur = false;
3208
3209
  this.datepickerOptions = options;
3209
3210
  }
3210
3211
  /**
@@ -3337,10 +3338,10 @@ let DatePicker = class DatePicker extends Calendar {
3337
3338
  Input.addAttributes({ 'aria-label': 'select' }, this.inputWrapper.buttons[0]);
3338
3339
  addClass([this.inputWrapper.container], DATEWRAPPER);
3339
3340
  }
3340
- updateInput(isDynamic = false) {
3341
+ updateInput(isDynamic = false, isBlur = false) {
3341
3342
  let formatOptions;
3342
3343
  if (this.value && !this.isCalendar()) {
3343
- this.disabledDates(isDynamic);
3344
+ this.disabledDates(isDynamic, isBlur);
3344
3345
  }
3345
3346
  if (isNaN(+new Date(this.checkValue(this.value)))) {
3346
3347
  this.setProperties({ value: null }, true);
@@ -3821,7 +3822,9 @@ let DatePicker = class DatePicker extends Calendar {
3821
3822
  this.invalidValueString = null;
3822
3823
  this.updateInputValue('');
3823
3824
  }
3824
- this.updateInput();
3825
+ this.isBlur = true;
3826
+ this.updateInput(false, true);
3827
+ this.isBlur = false;
3825
3828
  this.popupUpdate();
3826
3829
  this.changeTrigger(e);
3827
3830
  if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
@@ -4204,7 +4207,7 @@ let DatePicker = class DatePicker extends Calendar {
4204
4207
  this.trigger('navigated', this.navigatedArgs);
4205
4208
  }
4206
4209
  changeEvent(event) {
4207
- if (!this.isIconClicked) {
4210
+ if (!this.isIconClicked && !this.isBlur) {
4208
4211
  this.selectCalendar(event);
4209
4212
  }
4210
4213
  if (((this.previousDate && this.previousDate.valueOf()) !== (this.value && this.value.valueOf()))) {
@@ -4775,7 +4778,7 @@ let DatePicker = class DatePicker extends Calendar {
4775
4778
  getModuleName() {
4776
4779
  return 'datepicker';
4777
4780
  }
4778
- disabledDates(isDynamic = false) {
4781
+ disabledDates(isDynamic = false, isBlur = false) {
4779
4782
  let formatOptions;
4780
4783
  let globalize;
4781
4784
  const valueCopy = this.checkDateValue(this.value) ? new Date(+this.value) : new Date(this.checkValue(this.value));
@@ -4830,7 +4833,7 @@ let DatePicker = class DatePicker extends Calendar {
4830
4833
  if (this.enableMask) {
4831
4834
  this.updateInputValue(this.maskedDateValue);
4832
4835
  this.notify('createMask', {
4833
- module: 'MaskedDateTime'
4836
+ module: 'MaskedDateTime', isBlur: isBlur
4834
4837
  });
4835
4838
  }
4836
4839
  }
@@ -10686,9 +10689,7 @@ let TimePicker = class TimePicker extends Component {
10686
10689
  if (this.isValidLI(li)) {
10687
10690
  this.checkValue(li.getAttribute('data-value'));
10688
10691
  if (this.enableMask) {
10689
- this.notify('createMask', {
10690
- module: 'MaskedDateTime', navigated: true
10691
- });
10692
+ this.createMask();
10692
10693
  }
10693
10694
  this.selectedElement = li;
10694
10695
  this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
@@ -13705,6 +13706,7 @@ class MaskedDateTime {
13705
13706
  this.isComplete = false;
13706
13707
  this.isNavigate = false;
13707
13708
  this.navigated = false;
13709
+ this.isBlur = false;
13708
13710
  this.formatRegex = /EEEEE|EEEE|EEE|EE|E|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|HH|H|hh|h|mm|m|fff|ff|f|aa|a|ss|s|zzzz|zzz|zz|z|'[^']*'|'[^']*'/g;
13709
13711
  this.isDeletion = false;
13710
13712
  this.isShortYear = false;
@@ -13751,7 +13753,7 @@ class MaskedDateTime {
13751
13753
  this.parent.off('keyDownHandler', this.maskKeydownHandler);
13752
13754
  this.parent.off('clearHandler', this.clearHandler);
13753
13755
  }
13754
- createMask(navigated = false) {
13756
+ createMask(mask) {
13755
13757
  this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = false;
13756
13758
  this.dateformat = this.getCulturedFormat();
13757
13759
  if (this.parent.maskPlaceholder.day) {
@@ -13784,7 +13786,8 @@ class MaskedDateTime {
13784
13786
  this.mask = this.previousValue = inputValue;
13785
13787
  this.parent.maskedDateValue = this.mask;
13786
13788
  if (this.parent.value) {
13787
- this.navigated = navigated;
13789
+ this.navigated = true;
13790
+ this.isBlur = mask.isBlur;
13788
13791
  this.setDynamicValue();
13789
13792
  }
13790
13793
  }
@@ -13813,7 +13816,9 @@ class MaskedDateTime {
13813
13816
  this.maskDateValue = new Date(+this.parent.value);
13814
13817
  this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = true;
13815
13818
  this.updateValue();
13816
- this.validCharacterCheck();
13819
+ if (!this.isBlur) {
13820
+ this.validCharacterCheck();
13821
+ }
13817
13822
  }
13818
13823
  setSelection(validChar) {
13819
13824
  let start = -1;