@syncfusion/ej2-inputs 31.2.2 → 31.2.4
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/README.md +11 -2
- package/dist/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +84 -0
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +84 -0
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/maskedtextbox/base/mask-base.js +7 -0
- package/src/maskedtextbox/maskedtextbox/maskedtextbox.d.ts +2 -0
- package/src/maskedtextbox/maskedtextbox/maskedtextbox.js +19 -0
- package/src/numerictextbox/numerictextbox.d.ts +2 -0
- package/src/numerictextbox/numerictextbox.js +26 -0
- package/src/textarea/textarea.d.ts +2 -0
- package/src/textarea/textarea.js +26 -0
- package/src/uploader/uploader.js +6 -0
|
@@ -1277,6 +1277,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
1277
1277
|
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
1278
1278
|
this.enabled = false;
|
|
1279
1279
|
}
|
|
1280
|
+
this.updateFloatLabelOverflowWidth();
|
|
1280
1281
|
this.renderComplete();
|
|
1281
1282
|
}
|
|
1282
1283
|
};
|
|
@@ -2059,6 +2060,12 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
2059
2060
|
return;
|
|
2060
2061
|
}
|
|
2061
2062
|
this.isFocused = true;
|
|
2063
|
+
if (this.floatLabelType !== 'Never' && this.inputWrapper && this.inputWrapper.container) {
|
|
2064
|
+
var label = this.inputWrapper.container.querySelector('.e-float-text');
|
|
2065
|
+
if (label) {
|
|
2066
|
+
label.removeAttribute('style');
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2062
2069
|
this.prevValue = this.value;
|
|
2063
2070
|
if ((this.value || this.value === 0)) {
|
|
2064
2071
|
var formatValue_1 = this.formatNumber();
|
|
@@ -2115,6 +2122,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
2115
2122
|
EventHandler.remove(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel);
|
|
2116
2123
|
}
|
|
2117
2124
|
}
|
|
2125
|
+
this.updateFloatLabelOverflowWidth();
|
|
2118
2126
|
var formElement = closest(this.element, 'form');
|
|
2119
2127
|
if (formElement) {
|
|
2120
2128
|
var element = this.element.nextElementSibling;
|
|
@@ -2477,6 +2485,24 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
2477
2485
|
detach(this.spinDown);
|
|
2478
2486
|
}
|
|
2479
2487
|
};
|
|
2488
|
+
NumericTextBox.prototype.getRightIconsWidth = function () {
|
|
2489
|
+
var container = this.inputWrapper.container;
|
|
2490
|
+
var width = 0;
|
|
2491
|
+
var iconSelectors = '.e-input-group-icon, .e-clear-icon';
|
|
2492
|
+
var icons = container.querySelectorAll(iconSelectors);
|
|
2493
|
+
for (var index = 0; index < icons.length; index++) {
|
|
2494
|
+
width += icons[index].offsetWidth;
|
|
2495
|
+
}
|
|
2496
|
+
return width;
|
|
2497
|
+
};
|
|
2498
|
+
NumericTextBox.prototype.updateFloatLabelOverflowWidth = function () {
|
|
2499
|
+
var container = this.inputWrapper.container;
|
|
2500
|
+
var label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
|
|
2501
|
+
var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
|
|
2502
|
+
if (label && calculateWidth) {
|
|
2503
|
+
label.style.width = calculateWidth + 'px';
|
|
2504
|
+
}
|
|
2505
|
+
};
|
|
2480
2506
|
/**
|
|
2481
2507
|
* Gets the component name
|
|
2482
2508
|
*
|
|
@@ -2851,6 +2877,12 @@ function maskInputFocusHandler(event) {
|
|
|
2851
2877
|
if (!this.isClicked) {
|
|
2852
2878
|
triggerFocus.call(this, eventArgs, inputElement);
|
|
2853
2879
|
}
|
|
2880
|
+
if (this.floatLabelType !== 'Never' && this.inputObj && this.inputObj.container) {
|
|
2881
|
+
var label = this.inputObj.container.querySelector('.e-float-text');
|
|
2882
|
+
if (label) {
|
|
2883
|
+
label.removeAttribute('style');
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2854
2886
|
if (this.mask) {
|
|
2855
2887
|
if (!(!(modelValue === null || modelValue === '') || this.floatLabelType === 'Always' ||
|
|
2856
2888
|
this.placeholder === null || this.placeholder === '')) {
|
|
@@ -2952,6 +2984,7 @@ function maskInputBlurHandler(event) {
|
|
|
2952
2984
|
container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
|
|
2953
2985
|
};
|
|
2954
2986
|
this.trigger('blur', this.blurEventArgs);
|
|
2987
|
+
this.updateFloatLabelOverflowWidth();
|
|
2955
2988
|
if (this.mask) {
|
|
2956
2989
|
this.isFocus = false;
|
|
2957
2990
|
if (this.placeholder && this.element.value === this.promptMask && this.floatLabelType !== 'Always') {
|
|
@@ -3883,6 +3916,7 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
3883
3916
|
if (!this.element.hasAttribute('aria-labelledby') && !this.element.hasAttribute('placeholder') && !this.element.hasAttribute('aria-label')) {
|
|
3884
3917
|
this.element.setAttribute('aria-label', 'maskedtextbox');
|
|
3885
3918
|
}
|
|
3919
|
+
this.updateFloatLabelOverflowWidth();
|
|
3886
3920
|
this.renderComplete();
|
|
3887
3921
|
}
|
|
3888
3922
|
};
|
|
@@ -4159,6 +4193,24 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
4159
4193
|
removeClass([this.inputObj.container], [MASKINPUT_FOCUS]);
|
|
4160
4194
|
}
|
|
4161
4195
|
};
|
|
4196
|
+
MaskedTextBox.prototype.getRightIconsWidth = function () {
|
|
4197
|
+
var container = this.inputObj.container;
|
|
4198
|
+
var width = 0;
|
|
4199
|
+
var iconSelectors = '.e-input-group-icon, .e-clear-icon';
|
|
4200
|
+
var icons = container.querySelectorAll(iconSelectors);
|
|
4201
|
+
for (var index = 0; index < icons.length; index++) {
|
|
4202
|
+
width += icons[index].offsetWidth;
|
|
4203
|
+
}
|
|
4204
|
+
return width;
|
|
4205
|
+
};
|
|
4206
|
+
MaskedTextBox.prototype.updateFloatLabelOverflowWidth = function () {
|
|
4207
|
+
var container = this.inputObj.container;
|
|
4208
|
+
var label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
|
|
4209
|
+
var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
|
|
4210
|
+
if (label && calculateWidth) {
|
|
4211
|
+
label.style.width = calculateWidth + 'px';
|
|
4212
|
+
}
|
|
4213
|
+
};
|
|
4162
4214
|
/**
|
|
4163
4215
|
* Removes the component from the DOM and detaches all its related event handlers.
|
|
4164
4216
|
* Also it maintains the initial input element from the DOM.
|
|
@@ -9516,6 +9568,12 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
|
|
|
9516
9568
|
if (!this.enabled) {
|
|
9517
9569
|
return;
|
|
9518
9570
|
}
|
|
9571
|
+
if (!this.multiple && this.getFilesData().length > 0) {
|
|
9572
|
+
var selectedFile = this.getSelectedFiles(0);
|
|
9573
|
+
if (selectedFile) {
|
|
9574
|
+
this.remove(selectedFile, false, false, true, null);
|
|
9575
|
+
}
|
|
9576
|
+
}
|
|
9519
9577
|
var targetFiles;
|
|
9520
9578
|
/* istanbul ignore next */
|
|
9521
9579
|
if (args.type === 'drop') {
|
|
@@ -14968,6 +15026,7 @@ var TextArea = /** @__PURE__ @class */ (function (_super) {
|
|
|
14968
15026
|
this.element.defaultValue = this.element.value;
|
|
14969
15027
|
Input.setWidth(this.width, this.textareaWrapper.container);
|
|
14970
15028
|
this.setWrapperWidth();
|
|
15029
|
+
this.updateFloatLabelOverflowWidth();
|
|
14971
15030
|
this.renderComplete();
|
|
14972
15031
|
};
|
|
14973
15032
|
TextArea.prototype.getModuleName = function () {
|
|
@@ -15075,6 +15134,12 @@ var TextArea = /** @__PURE__ @class */ (function (_super) {
|
|
|
15075
15134
|
event: args,
|
|
15076
15135
|
value: this.value
|
|
15077
15136
|
};
|
|
15137
|
+
if (this.floatLabelType !== 'Never' && this.textareaWrapper && this.textareaWrapper.container) {
|
|
15138
|
+
var label = this.textareaWrapper.container.querySelector('.e-float-text');
|
|
15139
|
+
if (label) {
|
|
15140
|
+
label.removeAttribute('style');
|
|
15141
|
+
}
|
|
15142
|
+
}
|
|
15078
15143
|
this.trigger('focus', eventArgs);
|
|
15079
15144
|
};
|
|
15080
15145
|
TextArea.prototype.focusOutHandler = function (args) {
|
|
@@ -15087,6 +15152,7 @@ var TextArea = /** @__PURE__ @class */ (function (_super) {
|
|
|
15087
15152
|
event: args,
|
|
15088
15153
|
value: this.value
|
|
15089
15154
|
};
|
|
15155
|
+
this.updateFloatLabelOverflowWidth();
|
|
15090
15156
|
this.trigger('blur', eventArgs);
|
|
15091
15157
|
};
|
|
15092
15158
|
TextArea.prototype.keydownHandler = function (args) {
|
|
@@ -15334,6 +15400,24 @@ var TextArea = /** @__PURE__ @class */ (function (_super) {
|
|
|
15334
15400
|
TextArea.prototype.getCurrentResizeClass = function (resizeMode) {
|
|
15335
15401
|
return resizeMode === 'None' ? RESIZE_NONE : (resizeMode === 'Both' ? RESIZE_XY : resizeMode === 'Horizontal' ? RESIZE_X : RESIZE_Y);
|
|
15336
15402
|
};
|
|
15403
|
+
TextArea.prototype.getRightIconsWidth = function () {
|
|
15404
|
+
var container = this.textareaWrapper.container;
|
|
15405
|
+
var width = 0;
|
|
15406
|
+
var iconSelectors = '.e-input-group-icon, .e-clear-icon';
|
|
15407
|
+
var icons = container.querySelectorAll(iconSelectors);
|
|
15408
|
+
for (var index = 0; index < icons.length; index++) {
|
|
15409
|
+
width += icons[index].offsetWidth;
|
|
15410
|
+
}
|
|
15411
|
+
return width;
|
|
15412
|
+
};
|
|
15413
|
+
TextArea.prototype.updateFloatLabelOverflowWidth = function () {
|
|
15414
|
+
var container = this.textareaWrapper.container;
|
|
15415
|
+
var label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
|
|
15416
|
+
var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
|
|
15417
|
+
if (label && calculateWidth) {
|
|
15418
|
+
label.style.width = calculateWidth + 'px';
|
|
15419
|
+
}
|
|
15420
|
+
};
|
|
15337
15421
|
__decorate$7([
|
|
15338
15422
|
Property(false)
|
|
15339
15423
|
], TextArea.prototype, "readonly", void 0);
|