@syncfusion/ej2-calendars 27.1.51 → 27.1.52

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.
@@ -3950,12 +3950,19 @@ var DatePicker = /** @__PURE__ @class */ (function (_super) {
3950
3950
  this.show();
3951
3951
  }
3952
3952
  };
3953
- DatePicker.prototype.inputHandler = function () {
3953
+ DatePicker.prototype.inputHandler = function (e) {
3954
3954
  this.isPopupClicked = false;
3955
3955
  if (this.enableMask) {
3956
- this.notify('inputHandler', {
3957
- module: 'MaskedDateTime'
3958
- });
3956
+ if (!isNullOrUndefined(e) && !isNullOrUndefined(e.inputType) && e.inputType === 'insertFromPaste') {
3957
+ this.notify('maskPasteInputHandler', {
3958
+ module: 'MaskedDateTime'
3959
+ });
3960
+ }
3961
+ else {
3962
+ this.notify('inputHandler', {
3963
+ module: 'MaskedDateTime'
3964
+ });
3965
+ }
3959
3966
  }
3960
3967
  };
3961
3968
  DatePicker.prototype.inputBlurHandler = function (e) {
@@ -14516,6 +14523,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
14516
14523
  this.parent.on('inputHandler', this.maskInputHandler, this);
14517
14524
  this.parent.on('keyDownHandler', this.maskKeydownHandler, this);
14518
14525
  this.parent.on('clearHandler', this.clearHandler, this);
14526
+ this.parent.on('maskPasteInputHandler', this.maskPasteInputHandler, this);
14519
14527
  };
14520
14528
  MaskedDateTime.prototype.removeEventListener = function () {
14521
14529
  if (this.parent.isDestroyed) {
@@ -14526,6 +14534,7 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
14526
14534
  this.parent.off('inputHandler', this.maskInputHandler);
14527
14535
  this.parent.off('keyDownHandler', this.maskKeydownHandler);
14528
14536
  this.parent.off('clearHandler', this.clearHandler);
14537
+ this.parent.off('maskPasteInputHandler', this.maskPasteInputHandler);
14529
14538
  };
14530
14539
  MaskedDateTime.prototype.createMask = function (mask) {
14531
14540
  this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = false;
@@ -15107,6 +15116,25 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
15107
15116
  }
15108
15117
  return formatValueSpecifier;
15109
15118
  };
15119
+ MaskedDateTime.prototype.isValidDate = function (dateString) {
15120
+ var date = new Date(dateString);
15121
+ // Return true if the date is valid, false otherwise
15122
+ return !isNaN(date.getTime());
15123
+ };
15124
+ MaskedDateTime.prototype.maskPasteInputHandler = function () {
15125
+ if (this.isValidDate(this.parent.inputElement.value)) {
15126
+ this.maskDateValue = new Date(this.parent.inputElement.value);
15127
+ this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = true;
15128
+ this.updateValue();
15129
+ if (!this.isBlur) {
15130
+ this.validCharacterCheck();
15131
+ }
15132
+ return;
15133
+ }
15134
+ else {
15135
+ this.maskInputHandler();
15136
+ }
15137
+ };
15110
15138
  MaskedDateTime.prototype.maskInputHandler = function () {
15111
15139
  var start = this.parent.inputElement.selectionStart;
15112
15140
  var formatText = '';
@@ -15122,7 +15150,6 @@ var MaskedDateTime = /** @__PURE__ @class */ (function () {
15122
15150
  this.previousHiddenMask = this.hiddenMask;
15123
15151
  this.previousValue = inputValue;
15124
15152
  this.parent.inputElement.value = inputValue;
15125
- this.parent.inputElement.value = inputValue;
15126
15153
  for (var i = 0; i < this.hiddenMask.length; i++) {
15127
15154
  if (formatText === this.hiddenMask[i]) {
15128
15155
  start = i;