@syncfusion/ej2-calendars 27.1.50 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.1.50
3
+ * version : 27.1.52
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-calendars@*",
3
- "_id": "@syncfusion/ej2-calendars@18.32.5",
3
+ "_id": "@syncfusion/ej2-calendars@27.1.51",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-rksJYsGIPpCObDMJj5UXpkHFC3zmO0oIq9E4epQ7uMf79Wwm7p1xmvrBVW4Ie71RnIfpTbHXPqJuFrfidkJcRQ==",
5
+ "_integrity": "sha512-46rnTrdhdnUUIXd6IlylzsnHHsihlRv8lSTBeRTHYrRfPyW+sR0HQtqh2Sy79f+hUyrTz0NN4o4irXimzo8w7A==",
6
6
  "_location": "/@syncfusion/ej2-calendars",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -31,8 +31,8 @@
31
31
  "/@syncfusion/ej2-schedule",
32
32
  "/@syncfusion/ej2-vue-calendars"
33
33
  ],
34
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-calendars/-/ej2-calendars-18.32.5.tgz",
35
- "_shasum": "c76c6f7cbc4265f8ddd213a442133b7c0a8f34e0",
34
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-calendars/-/ej2-calendars-27.1.51.tgz",
35
+ "_shasum": "02916eff14ef8c43e29a4616e5fe7507f78ff790",
36
36
  "_spec": "@syncfusion/ej2-calendars@*",
37
37
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
38
38
  "author": {
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "bundleDependencies": false,
45
45
  "dependencies": {
46
- "@syncfusion/ej2-base": "~27.1.50",
47
- "@syncfusion/ej2-buttons": "~27.1.50",
46
+ "@syncfusion/ej2-base": "~27.1.52",
47
+ "@syncfusion/ej2-buttons": "~27.1.51",
48
48
  "@syncfusion/ej2-inputs": "~27.1.50",
49
49
  "@syncfusion/ej2-lists": "~27.1.50",
50
50
  "@syncfusion/ej2-popups": "~27.1.50"
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "27.1.50",
83
+ "version": "27.1.52",
84
84
  "sideEffects": false
85
85
  }
@@ -447,9 +447,10 @@ var DatePicker = /** @class */ (function (_super) {
447
447
  case 'ArrowDown':
448
448
  case 'Home':
449
449
  case 'End':
450
+ case 'Backspace':
450
451
  case 'Delete':
451
452
  if (this.enableMask && !this.popupObj && !this.readonly) {
452
- if (e.code !== 'Delete') {
453
+ if (e.code !== 'Delete' && e.code !== 'Backspace') {
453
454
  e.preventDefault();
454
455
  }
455
456
  this.notify('keyDownHandler', {
@@ -698,12 +699,19 @@ var DatePicker = /** @class */ (function (_super) {
698
699
  this.show();
699
700
  }
700
701
  };
701
- DatePicker.prototype.inputHandler = function () {
702
+ DatePicker.prototype.inputHandler = function (e) {
702
703
  this.isPopupClicked = false;
703
704
  if (this.enableMask) {
704
- this.notify('inputHandler', {
705
- module: 'MaskedDateTime'
706
- });
705
+ if (!isNullOrUndefined(e) && !isNullOrUndefined(e.inputType) && e.inputType === 'insertFromPaste') {
706
+ this.notify('maskPasteInputHandler', {
707
+ module: 'MaskedDateTime'
708
+ });
709
+ }
710
+ else {
711
+ this.notify('inputHandler', {
712
+ module: 'MaskedDateTime'
713
+ });
714
+ }
707
715
  }
708
716
  };
709
717
  DatePicker.prototype.inputBlurHandler = function (e) {
@@ -54,6 +54,8 @@ export declare class MaskedDateTime {
54
54
  private isPersist;
55
55
  private differenceCheck;
56
56
  private formatCheck;
57
+ private isValidDate;
58
+ private maskPasteInputHandler;
57
59
  private maskInputHandler;
58
60
  private navigateSelection;
59
61
  private roundOff;
@@ -71,6 +71,7 @@ var MaskedDateTime = /** @class */ (function () {
71
71
  this.parent.on('inputHandler', this.maskInputHandler, this);
72
72
  this.parent.on('keyDownHandler', this.maskKeydownHandler, this);
73
73
  this.parent.on('clearHandler', this.clearHandler, this);
74
+ this.parent.on('maskPasteInputHandler', this.maskPasteInputHandler, this);
74
75
  };
75
76
  MaskedDateTime.prototype.removeEventListener = function () {
76
77
  if (this.parent.isDestroyed) {
@@ -81,6 +82,7 @@ var MaskedDateTime = /** @class */ (function () {
81
82
  this.parent.off('inputHandler', this.maskInputHandler);
82
83
  this.parent.off('keyDownHandler', this.maskKeydownHandler);
83
84
  this.parent.off('clearHandler', this.clearHandler);
85
+ this.parent.off('maskPasteInputHandler', this.maskPasteInputHandler);
84
86
  };
85
87
  MaskedDateTime.prototype.createMask = function (mask) {
86
88
  this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = false;
@@ -171,6 +173,34 @@ var MaskedDateTime = /** @class */ (function () {
171
173
  this.parent.inputElement.setSelectionRange(start, end);
172
174
  };
173
175
  MaskedDateTime.prototype.maskKeydownHandler = function (args) {
176
+ if (args.e.key === 'Backspace') {
177
+ var start = this.parent.inputElement.selectionStart;
178
+ var formatText = '';
179
+ if (this.validCharacters.indexOf(this.hiddenMask[start]) !== -1) {
180
+ formatText = this.hiddenMask[start];
181
+ }
182
+ switch (formatText) {
183
+ case 'd':
184
+ this.dayTypeCount = Math.max(this.dayTypeCount - 1, 0);
185
+ break;
186
+ case 'M':
187
+ this.monthTypeCount = Math.max(this.monthTypeCount - 1, 0);
188
+ break;
189
+ case 'H':
190
+ case 'h':
191
+ this.hourTypeCount = Math.max(this.hourTypeCount - 1, 0);
192
+ break;
193
+ case 'm':
194
+ this.minuteTypeCount = Math.max(this.minuteTypeCount - 1, 0);
195
+ break;
196
+ case 's':
197
+ this.secondTypeCount = Math.max(this.secondTypeCount - 1, 0);
198
+ break;
199
+ default:
200
+ break;
201
+ }
202
+ return;
203
+ }
174
204
  this.dayTypeCount = this.monthTypeCount = this.hourTypeCount = this.minuteTypeCount = this.secondTypeCount = 0;
175
205
  if (args.e.key === 'Delete') {
176
206
  this.isDeleteKey = true;
@@ -639,6 +669,25 @@ var MaskedDateTime = /** @class */ (function () {
639
669
  }
640
670
  return formatValueSpecifier;
641
671
  };
672
+ MaskedDateTime.prototype.isValidDate = function (dateString) {
673
+ var date = new Date(dateString);
674
+ // Return true if the date is valid, false otherwise
675
+ return !isNaN(date.getTime());
676
+ };
677
+ MaskedDateTime.prototype.maskPasteInputHandler = function () {
678
+ if (this.isValidDate(this.parent.inputElement.value)) {
679
+ this.maskDateValue = new Date(this.parent.inputElement.value);
680
+ this.isDayPart = this.isMonthPart = this.isYearPart = this.isHourPart = this.isMinutePart = this.isSecondsPart = true;
681
+ this.updateValue();
682
+ if (!this.isBlur) {
683
+ this.validCharacterCheck();
684
+ }
685
+ return;
686
+ }
687
+ else {
688
+ this.maskInputHandler();
689
+ }
690
+ };
642
691
  MaskedDateTime.prototype.maskInputHandler = function () {
643
692
  var start = this.parent.inputElement.selectionStart;
644
693
  var formatText = '';
@@ -654,7 +703,6 @@ var MaskedDateTime = /** @class */ (function () {
654
703
  this.previousHiddenMask = this.hiddenMask;
655
704
  this.previousValue = inputValue;
656
705
  this.parent.inputElement.value = inputValue;
657
- this.parent.inputElement.value = inputValue;
658
706
  for (var i = 0; i < this.hiddenMask.length; i++) {
659
707
  if (formatText === this.hiddenMask[i]) {
660
708
  start = i;