@syncfusion/ej2-calendars 27.1.57 → 27.2.3

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.
@@ -3897,6 +3897,9 @@ let DatePicker = class DatePicker extends Calendar {
3897
3897
  this.inputElement.selectionEnd = this.inputElement.value.length;
3898
3898
  }
3899
3899
  }
3900
+ if (this.enableMask && this.showClearButton && this.inputElement && this.inputElement.value === this.maskedDateValue && this.inputWrapper && this.inputWrapper.clearButton && !this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide')) {
3901
+ this.inputWrapper.clearButton.classList.add('e-clear-icon-hide');
3902
+ }
3900
3903
  const focusArguments = {
3901
3904
  model: this
3902
3905
  };
@@ -4402,6 +4405,9 @@ let DatePicker = class DatePicker extends Calendar {
4402
4405
  }
4403
4406
  keyupHandler(e) {
4404
4407
  this.isKeyAction = (this.inputElement.value !== this.previousElementValue) ? true : false;
4408
+ if (this.enableMask && this.showClearButton && this.inputElement && this.inputElement.value === this.maskedDateValue && this.inputWrapper && this.inputWrapper.clearButton && !this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide')) {
4409
+ this.inputWrapper.clearButton.classList.add('e-clear-icon-hide');
4410
+ }
4405
4411
  }
4406
4412
  changeEvent(event) {
4407
4413
  if (!this.isIconClicked && !(this.isBlur || this.isKeyAction)) {
@@ -5237,6 +5243,12 @@ let DatePicker = class DatePicker extends Calendar {
5237
5243
  if (this.calendarElement && this.isCalendar()) {
5238
5244
  super.onPropertyChanged(newProp, oldProp);
5239
5245
  }
5246
+ if (prop === 'min' && isNullOrUndefined(this.min)) {
5247
+ this.min = new Date(1900, 0, 1);
5248
+ }
5249
+ if (prop === 'max' && isNullOrUndefined(this.max)) {
5250
+ this.max = new Date(2099, 11, 31);
5251
+ }
5240
5252
  break;
5241
5253
  }
5242
5254
  if (!this.isDynamicValueChanged) {
@@ -8219,6 +8231,21 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
8219
8231
  this.popupObj.hide();
8220
8232
  this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: ROOT$2 + ' ' + POPUP$1 });
8221
8233
  this.renderControl();
8234
+ this.openEventArgs = {
8235
+ popup: this.popupObj || null,
8236
+ cancel: false,
8237
+ date: this.inputElement.value,
8238
+ model: this,
8239
+ event: event ? event : null,
8240
+ appendTo: this.isMobile || Browser.isDevice ? this.mobileRangePopupWrap : document.body
8241
+ };
8242
+ const eventArgs = this.openEventArgs;
8243
+ this.trigger('open', eventArgs, (eventArgs) => {
8244
+ this.openEventArgs = eventArgs;
8245
+ if (this.openEventArgs.cancel) {
8246
+ return;
8247
+ }
8248
+ });
8222
8249
  this.openEventArgs.appendTo.appendChild(this.popupWrapper);
8223
8250
  this.showPopup();
8224
8251
  this.isCustomRange = true;
@@ -11225,6 +11252,7 @@ let TimePicker = class TimePicker extends Component {
11225
11252
  EventHandler.add(this.inputElement, 'input', this.inputEventHandler, this);
11226
11253
  if (this.enableMask) {
11227
11254
  EventHandler.add(this.inputElement, 'keydown', this.keydownHandler, this);
11255
+ EventHandler.add(this.inputElement, 'keyup', this.keyupHandler, this);
11228
11256
  }
11229
11257
  if (this.showClearButton && this.inputWrapper.clearButton) {
11230
11258
  EventHandler.add(this.inputWrapper.clearButton, 'mousedown', this.clearHandler, this);
@@ -11256,6 +11284,11 @@ let TimePicker = class TimePicker extends Component {
11256
11284
  break;
11257
11285
  }
11258
11286
  }
11287
+ keyupHandler(e) {
11288
+ if ((e.code === 'Backspace' || e.code === 'Delete') && (this.enableMask && this.showClearButton && this.inputElement && this.inputElement.value === this.maskedDateValue && this.inputWrapper && this.inputWrapper.clearButton && !this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide'))) {
11289
+ this.inputWrapper.clearButton.classList.add('e-clear-icon-hide');
11290
+ }
11291
+ }
11259
11292
  formResetHandler() {
11260
11293
  if (!this.enabled) {
11261
11294
  return;
@@ -11306,6 +11339,9 @@ let TimePicker = class TimePicker extends Component {
11306
11339
  EventHandler.remove(this.inputElement, 'focus', this.inputFocusHandler);
11307
11340
  EventHandler.remove(this.inputElement, 'change', this.inputChangeHandler);
11308
11341
  EventHandler.remove(this.inputElement, 'input', this.inputEventHandler);
11342
+ if (this.enableMask) {
11343
+ EventHandler.remove(this.inputElement, 'keyup', this.keyupHandler);
11344
+ }
11309
11345
  if (this.inputEvent) {
11310
11346
  this.inputEvent.destroy();
11311
11347
  }
@@ -12052,6 +12088,9 @@ let TimePicker = class TimePicker extends Component {
12052
12088
  this.inputElement.selectionEnd = this.inputElement.value.length;
12053
12089
  }
12054
12090
  }
12091
+ if (this.enableMask && this.showClearButton && this.inputElement && this.inputElement.value === this.maskedDateValue && this.inputWrapper && this.inputWrapper.clearButton && !this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide')) {
12092
+ this.inputWrapper.clearButton.classList.add('e-clear-icon-hide');
12093
+ }
12055
12094
  this.trigger('focus', focusArguments);
12056
12095
  this.clearIconState();
12057
12096
  if (this.openOnFocus) {
@@ -15196,6 +15235,9 @@ class MaskedDateTime {
15196
15235
  clearHandler() {
15197
15236
  this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = false;
15198
15237
  this.updateValue();
15238
+ if (this.parent.inputElement && this.parent.inputElement.value === this.parent.maskedDateValue && this.parent.inputWrapper && this.parent.inputWrapper.clearButton && !this.parent.inputWrapper.clearButton.classList.contains('e-clear-icon-hide')) {
15239
+ this.parent.inputWrapper.clearButton.classList.add('e-clear-icon-hide');
15240
+ }
15199
15241
  }
15200
15242
  updateValue() {
15201
15243
  this.monthCharacter = this.periodCharacter = '';