@syncfusion/ej2-calendars 35.1.41 → 35.1.43
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.
- package/dist/ej2-calendars.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js.map +1 -1
- package/dist/es6/ej2-calendars.es2015.js +52 -7
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +52 -7
- package/dist/es6/ej2-calendars.es5.js.map +1 -1
- package/dist/global/ej2-calendars.min.js +2 -2
- package/dist/global/ej2-calendars.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/calendar/calendar.js +6 -0
- package/src/datepicker/datepicker.d.ts +3 -0
- package/src/datepicker/datepicker.js +46 -7
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 35.1.
|
|
3
|
+
* version : 35.1.43
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. 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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-calendars",
|
|
3
|
-
"version": "35.1.
|
|
3
|
+
"version": "35.1.43",
|
|
4
4
|
"description": "A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@syncfusion/ej2-base": "~35.1.37",
|
|
12
12
|
"@syncfusion/ej2-buttons": "~35.1.41",
|
|
13
|
-
"@syncfusion/ej2-inputs": "~35.1.
|
|
14
|
-
"@syncfusion/ej2-lists": "~35.1.
|
|
15
|
-
"@syncfusion/ej2-popups": "~35.1.
|
|
13
|
+
"@syncfusion/ej2-inputs": "~35.1.43",
|
|
14
|
+
"@syncfusion/ej2-lists": "~35.1.43",
|
|
15
|
+
"@syncfusion/ej2-popups": "~35.1.42"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {},
|
|
18
18
|
"keywords": [
|
package/src/calendar/calendar.js
CHANGED
|
@@ -2350,6 +2350,12 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
2350
2350
|
else {
|
|
2351
2351
|
tempValue = new Date(tempValue.getFullYear(), tempValue.getMonth(), tempValue.getDate(), 0, 0, 0, 0);
|
|
2352
2352
|
}
|
|
2353
|
+
if (+tempValue < +this.min) {
|
|
2354
|
+
tempValue = new Date(+this.min);
|
|
2355
|
+
}
|
|
2356
|
+
else if (+tempValue > +this.max) {
|
|
2357
|
+
tempValue = new Date(+this.max);
|
|
2358
|
+
}
|
|
2353
2359
|
return tempValue;
|
|
2354
2360
|
};
|
|
2355
2361
|
Calendar.prototype.todayButtonClick = function (e) {
|
|
@@ -438,6 +438,9 @@ export declare class DatePicker extends Calendar implements IInput {
|
|
|
438
438
|
private clear;
|
|
439
439
|
private preventEventBubbling;
|
|
440
440
|
private updateInputValue;
|
|
441
|
+
private isMaskPlaceholderSwap;
|
|
442
|
+
private setMaskedInputValue;
|
|
443
|
+
private swapMaskPlaceholder;
|
|
441
444
|
private windowResize;
|
|
442
445
|
private dateIconHandler;
|
|
443
446
|
protected updateHtmlAttributeToWrapper(): void;
|
|
@@ -163,7 +163,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
163
163
|
this.setAllowEdit();
|
|
164
164
|
if (this.enableMask && !this.value && this.maskedDateValue && (this.floatLabelType === 'Always' || !this.floatLabelType || !this.placeholder)) {
|
|
165
165
|
this.updateInput(true);
|
|
166
|
-
this.
|
|
166
|
+
this.setMaskedInputValue();
|
|
167
167
|
}
|
|
168
168
|
else if (!this.enableMask) {
|
|
169
169
|
this.updateInput(true);
|
|
@@ -285,7 +285,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
285
285
|
this.updateInputValue('');
|
|
286
286
|
}
|
|
287
287
|
else {
|
|
288
|
-
this.
|
|
288
|
+
this.setMaskedInputValue();
|
|
289
289
|
this.notify('createMask', {
|
|
290
290
|
module: 'MaskedDateTime'
|
|
291
291
|
});
|
|
@@ -579,6 +579,31 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
579
579
|
DatePicker.prototype.updateInputValue = function (value) {
|
|
580
580
|
Input.setValue(value, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
581
581
|
};
|
|
582
|
+
DatePicker.prototype.isMaskPlaceholderSwap = function () {
|
|
583
|
+
return this.getModuleName() === 'datepicker' && this.enableMask && this.strictMode
|
|
584
|
+
&& (!this.placeholder || this.floatLabelType === 'Always') && !!this.maskedDateValue
|
|
585
|
+
&& !this.value && !isNullOrUndefined(this.inputElement) && !isNullOrUndefined(closest(this.inputElement, 'form'));
|
|
586
|
+
};
|
|
587
|
+
DatePicker.prototype.setMaskedInputValue = function () {
|
|
588
|
+
if (this.isMaskPlaceholderSwap() && (this.isBlur || document.activeElement !== this.inputElement)) {
|
|
589
|
+
this.swapMaskPlaceholder(false);
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
this.updateInputValue(this.maskedDateValue);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
DatePicker.prototype.swapMaskPlaceholder = function (toValue) {
|
|
596
|
+
if (toValue) {
|
|
597
|
+
this.updateInputValue(this.maskedDateValue);
|
|
598
|
+
if (this.inputElement.hasAttribute('placeholder')) {
|
|
599
|
+
this.inputElement.removeAttribute('placeholder');
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
this.updateInputValue('');
|
|
604
|
+
this.inputElement.setAttribute('placeholder', this.maskedDateValue);
|
|
605
|
+
}
|
|
606
|
+
};
|
|
582
607
|
DatePicker.prototype.windowResize = function () {
|
|
583
608
|
this.updateFloatLabelOverflowWidth(true);
|
|
584
609
|
};
|
|
@@ -715,7 +740,10 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
715
740
|
if (this.initTimeZone !== new Date().getTimezoneOffset()) {
|
|
716
741
|
this.strictModeUpdate(true);
|
|
717
742
|
}
|
|
718
|
-
if (this.
|
|
743
|
+
if (this.isMaskPlaceholderSwap() && (!this.inputElement.value || this.inputElement.value === this.maskedDateValue)) {
|
|
744
|
+
this.swapMaskPlaceholder(true);
|
|
745
|
+
}
|
|
746
|
+
else if (this.enableMask && !this.inputElement.value && this.placeholder) {
|
|
719
747
|
if (this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
720
748
|
this.updateInputValue(this.maskedDateValue);
|
|
721
749
|
this.inputElement.selectionStart = 0;
|
|
@@ -766,7 +794,10 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
766
794
|
this.isBlur = false;
|
|
767
795
|
this.popupUpdate();
|
|
768
796
|
this.changeTrigger(e);
|
|
769
|
-
if (this.
|
|
797
|
+
if (this.isMaskPlaceholderSwap() && (!this.inputElement.value || this.inputElement.value === this.maskedDateValue)) {
|
|
798
|
+
this.swapMaskPlaceholder(false);
|
|
799
|
+
}
|
|
800
|
+
else if (this.enableMask && this.maskedDateValue && this.placeholder && this.floatLabelType !== 'Always') {
|
|
770
801
|
if (this.inputElement.value === this.maskedDateValue && !this.value && (this.floatLabelType === 'Auto' || this.floatLabelType === 'Never' || this.placeholder)) {
|
|
771
802
|
this.updateInputValue('');
|
|
772
803
|
}
|
|
@@ -2035,7 +2066,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
2035
2066
|
if (!this.popupObj) {
|
|
2036
2067
|
this.updateInputValue(inputVal);
|
|
2037
2068
|
if (this.enableMask) {
|
|
2038
|
-
this.
|
|
2069
|
+
this.setMaskedInputValue();
|
|
2039
2070
|
this.notify('createMask', {
|
|
2040
2071
|
module: 'MaskedDateTime', isBlur: isBlur
|
|
2041
2072
|
});
|
|
@@ -2108,7 +2139,7 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
2108
2139
|
this.previousElementValue = this.inputElement.value;
|
|
2109
2140
|
if (isNullOrUndefined(this.value)) {
|
|
2110
2141
|
if (this.enableMask) {
|
|
2111
|
-
this.
|
|
2142
|
+
this.setMaskedInputValue();
|
|
2112
2143
|
}
|
|
2113
2144
|
else {
|
|
2114
2145
|
this.updateInputValue('');
|
|
@@ -2220,13 +2251,21 @@ var DatePicker = /** @class */ (function (_super) {
|
|
|
2220
2251
|
this.notify('createMask', {
|
|
2221
2252
|
module: 'MaskedDateTime'
|
|
2222
2253
|
});
|
|
2223
|
-
this.
|
|
2254
|
+
if (this.isMaskPlaceholderSwap() && document.activeElement !== this.inputElement) {
|
|
2255
|
+
this.swapMaskPlaceholder(false);
|
|
2256
|
+
}
|
|
2257
|
+
else {
|
|
2258
|
+
this.updateInputValue(this.maskedDateValue);
|
|
2259
|
+
}
|
|
2224
2260
|
this.bindInputEvent();
|
|
2225
2261
|
}
|
|
2226
2262
|
else {
|
|
2227
2263
|
if (this.inputElement.value === this.maskedDateValue) {
|
|
2228
2264
|
this.updateInputValue('');
|
|
2229
2265
|
}
|
|
2266
|
+
if (!this.placeholder && this.inputElement.hasAttribute('placeholder') && this.inputElement.getAttribute('placeholder') === this.maskedDateValue) {
|
|
2267
|
+
this.inputElement.removeAttribute('placeholder');
|
|
2268
|
+
}
|
|
2230
2269
|
}
|
|
2231
2270
|
break;
|
|
2232
2271
|
case 'min':
|