@syncfusion/ej2-inputs 31.1.23 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 31.1.23
3
+ * version : 31.2.4
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-inputs",
3
- "version": "31.1.23",
3
+ "version": "31.2.4",
4
4
  "description": "A package of Essential JS 2 input components such as Textbox, Color-picker, Masked-textbox, Numeric-textbox, Slider, Upload, and Form-validator that is used to get input from the users.",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,10 +8,10 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-inputs.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~31.1.22",
12
- "@syncfusion/ej2-buttons": "~31.1.21",
13
- "@syncfusion/ej2-popups": "~31.1.20",
14
- "@syncfusion/ej2-splitbuttons": "~31.1.17"
11
+ "@syncfusion/ej2-base": "~31.2.4",
12
+ "@syncfusion/ej2-buttons": "~31.2.3",
13
+ "@syncfusion/ej2-popups": "~31.2.2",
14
+ "@syncfusion/ej2-splitbuttons": "~31.2.2"
15
15
  },
16
16
  "devDependencies": {},
17
17
  "keywords": [
@@ -287,6 +287,12 @@ export function maskInputFocusHandler(event) {
287
287
  if (!this.isClicked) {
288
288
  triggerFocus.call(this, eventArgs, inputElement);
289
289
  }
290
+ if (this.floatLabelType !== 'Never' && this.inputObj && this.inputObj.container) {
291
+ var label = this.inputObj.container.querySelector('.e-float-text');
292
+ if (label) {
293
+ label.removeAttribute('style');
294
+ }
295
+ }
290
296
  if (this.mask) {
291
297
  if (!(!(modelValue === null || modelValue === '') || this.floatLabelType === 'Always' ||
292
298
  this.placeholder === null || this.placeholder === '')) {
@@ -388,6 +394,7 @@ export function maskInputBlurHandler(event) {
388
394
  container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
389
395
  };
390
396
  this.trigger('blur', this.blurEventArgs);
397
+ this.updateFloatLabelOverflowWidth();
391
398
  if (this.mask) {
392
399
  this.isFocus = false;
393
400
  if (this.placeholder && this.element.value === this.promptMask && this.floatLabelType !== 'Always') {
@@ -255,6 +255,8 @@ export declare class MaskedTextBox extends Component<HTMLInputElement> implement
255
255
  * @returns {void}
256
256
  */
257
257
  focusOut(): void;
258
+ private getRightIconsWidth;
259
+ private updateFloatLabelOverflowWidth;
258
260
  /**
259
261
  * Removes the component from the DOM and detaches all its related event handlers.
260
262
  * Also it maintains the initial input element from the DOM.
@@ -165,6 +165,7 @@ var MaskedTextBox = /** @class */ (function (_super) {
165
165
  if (!this.element.hasAttribute('aria-labelledby') && !this.element.hasAttribute('placeholder') && !this.element.hasAttribute('aria-label')) {
166
166
  this.element.setAttribute('aria-label', 'maskedtextbox');
167
167
  }
168
+ this.updateFloatLabelOverflowWidth();
168
169
  this.renderComplete();
169
170
  }
170
171
  };
@@ -441,6 +442,24 @@ var MaskedTextBox = /** @class */ (function (_super) {
441
442
  removeClass([this.inputObj.container], [MASKINPUT_FOCUS]);
442
443
  }
443
444
  };
445
+ MaskedTextBox.prototype.getRightIconsWidth = function () {
446
+ var container = this.inputObj.container;
447
+ var width = 0;
448
+ var iconSelectors = '.e-input-group-icon, .e-clear-icon';
449
+ var icons = container.querySelectorAll(iconSelectors);
450
+ for (var index = 0; index < icons.length; index++) {
451
+ width += icons[index].offsetWidth;
452
+ }
453
+ return width;
454
+ };
455
+ MaskedTextBox.prototype.updateFloatLabelOverflowWidth = function () {
456
+ var container = this.inputObj.container;
457
+ var label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
458
+ var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
459
+ if (label && calculateWidth) {
460
+ label.style.width = calculateWidth + 'px';
461
+ }
462
+ };
444
463
  /**
445
464
  * Removes the component from the DOM and detaches all its related event handlers.
446
465
  * Also it maintains the initial input element from the DOM.
@@ -380,6 +380,8 @@ export declare class NumericTextBox extends Component<HTMLInputElement> implemen
380
380
  onPropertyChanged(newProp: NumericTextBoxModel, oldProp: NumericTextBoxModel): void;
381
381
  private updateClearButton;
382
382
  private updateSpinButton;
383
+ private getRightIconsWidth;
384
+ private updateFloatLabelOverflowWidth;
383
385
  /**
384
386
  * Gets the component name
385
387
  *
@@ -165,6 +165,7 @@ var NumericTextBox = /** @class */ (function (_super) {
165
165
  if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
166
166
  this.enabled = false;
167
167
  }
168
+ this.updateFloatLabelOverflowWidth();
168
169
  this.renderComplete();
169
170
  }
170
171
  };
@@ -948,6 +949,12 @@ var NumericTextBox = /** @class */ (function (_super) {
948
949
  return;
949
950
  }
950
951
  this.isFocused = true;
952
+ if (this.floatLabelType !== 'Never' && this.inputWrapper && this.inputWrapper.container) {
953
+ var label = this.inputWrapper.container.querySelector('.e-float-text');
954
+ if (label) {
955
+ label.removeAttribute('style');
956
+ }
957
+ }
951
958
  this.prevValue = this.value;
952
959
  if ((this.value || this.value === 0)) {
953
960
  var formatValue_1 = this.formatNumber();
@@ -1004,6 +1011,7 @@ var NumericTextBox = /** @class */ (function (_super) {
1004
1011
  EventHandler.remove(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel);
1005
1012
  }
1006
1013
  }
1014
+ this.updateFloatLabelOverflowWidth();
1007
1015
  var formElement = closest(this.element, 'form');
1008
1016
  if (formElement) {
1009
1017
  var element = this.element.nextElementSibling;
@@ -1366,6 +1374,24 @@ var NumericTextBox = /** @class */ (function (_super) {
1366
1374
  detach(this.spinDown);
1367
1375
  }
1368
1376
  };
1377
+ NumericTextBox.prototype.getRightIconsWidth = function () {
1378
+ var container = this.inputWrapper.container;
1379
+ var width = 0;
1380
+ var iconSelectors = '.e-input-group-icon, .e-clear-icon';
1381
+ var icons = container.querySelectorAll(iconSelectors);
1382
+ for (var index = 0; index < icons.length; index++) {
1383
+ width += icons[index].offsetWidth;
1384
+ }
1385
+ return width;
1386
+ };
1387
+ NumericTextBox.prototype.updateFloatLabelOverflowWidth = function () {
1388
+ var container = this.inputWrapper.container;
1389
+ var label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
1390
+ var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
1391
+ if (label && calculateWidth) {
1392
+ label.style.width = calculateWidth + 'px';
1393
+ }
1394
+ };
1369
1395
  /**
1370
1396
  * Gets the component name
1371
1397
  *
@@ -234,4 +234,6 @@ export declare class TextArea extends Component<HTMLTextAreaElement> implements
234
234
  private resetValue;
235
235
  private setElementWidth;
236
236
  private getCurrentResizeClass;
237
+ private getRightIconsWidth;
238
+ private updateFloatLabelOverflowWidth;
237
239
  }
@@ -275,6 +275,7 @@ var TextArea = /** @class */ (function (_super) {
275
275
  this.element.defaultValue = this.element.value;
276
276
  Input.setWidth(this.width, this.textareaWrapper.container);
277
277
  this.setWrapperWidth();
278
+ this.updateFloatLabelOverflowWidth();
278
279
  this.renderComplete();
279
280
  };
280
281
  TextArea.prototype.getModuleName = function () {
@@ -382,6 +383,12 @@ var TextArea = /** @class */ (function (_super) {
382
383
  event: args,
383
384
  value: this.value
384
385
  };
386
+ if (this.floatLabelType !== 'Never' && this.textareaWrapper && this.textareaWrapper.container) {
387
+ var label = this.textareaWrapper.container.querySelector('.e-float-text');
388
+ if (label) {
389
+ label.removeAttribute('style');
390
+ }
391
+ }
385
392
  this.trigger('focus', eventArgs);
386
393
  };
387
394
  TextArea.prototype.focusOutHandler = function (args) {
@@ -394,6 +401,7 @@ var TextArea = /** @class */ (function (_super) {
394
401
  event: args,
395
402
  value: this.value
396
403
  };
404
+ this.updateFloatLabelOverflowWidth();
397
405
  this.trigger('blur', eventArgs);
398
406
  };
399
407
  TextArea.prototype.keydownHandler = function (args) {
@@ -641,6 +649,24 @@ var TextArea = /** @class */ (function (_super) {
641
649
  TextArea.prototype.getCurrentResizeClass = function (resizeMode) {
642
650
  return resizeMode === 'None' ? RESIZE_NONE : (resizeMode === 'Both' ? RESIZE_XY : resizeMode === 'Horizontal' ? RESIZE_X : RESIZE_Y);
643
651
  };
652
+ TextArea.prototype.getRightIconsWidth = function () {
653
+ var container = this.textareaWrapper.container;
654
+ var width = 0;
655
+ var iconSelectors = '.e-input-group-icon, .e-clear-icon';
656
+ var icons = container.querySelectorAll(iconSelectors);
657
+ for (var index = 0; index < icons.length; index++) {
658
+ width += icons[index].offsetWidth;
659
+ }
660
+ return width;
661
+ };
662
+ TextArea.prototype.updateFloatLabelOverflowWidth = function () {
663
+ var container = this.textareaWrapper.container;
664
+ var label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
665
+ var calculateWidth = (container.clientWidth - this.getRightIconsWidth());
666
+ if (label && calculateWidth) {
667
+ label.style.width = calculateWidth + 'px';
668
+ }
669
+ };
644
670
  __decorate([
645
671
  Property(false)
646
672
  ], TextArea.prototype, "readonly", void 0);
@@ -1227,6 +1227,12 @@ var Uploader = /** @class */ (function (_super) {
1227
1227
  if (!this.enabled) {
1228
1228
  return;
1229
1229
  }
1230
+ if (!this.multiple && this.getFilesData().length > 0) {
1231
+ var selectedFile = this.getSelectedFiles(0);
1232
+ if (selectedFile) {
1233
+ this.remove(selectedFile, false, false, true, null);
1234
+ }
1235
+ }
1230
1236
  var targetFiles;
1231
1237
  /* istanbul ignore next */
1232
1238
  if (args.type === 'drop') {
@@ -1981,7 +1987,7 @@ var Uploader = /** @class */ (function (_super) {
1981
1987
  var progressbarWrapper = this.createElement('span', { className: PROGRESS_WRAPPER });
1982
1988
  var progressBar = this.createElement('progressbar', { className: PROGRESSBAR, attrs: { value: '0', max: '100' } });
1983
1989
  var progressbarInnerWrapper = this.createElement('span', { className: PROGRESS_INNER_WRAPPER });
1984
- progressBar.setAttribute('style', 'width: 0%');
1990
+ progressBar.style.width = '0%';
1985
1991
  var progressbarText = this.createElement('span', { className: PROGRESSBAR_TEXT });
1986
1992
  progressbarText.textContent = '0%';
1987
1993
  progressbarInnerWrapper.appendChild(progressBar);
@@ -2004,7 +2010,7 @@ var Uploader = /** @class */ (function (_super) {
2004
2010
  }
2005
2011
  };
2006
2012
  Uploader.prototype.changeProgressValue = function (li, progressValue) {
2007
- li.querySelector('.' + PROGRESSBAR).setAttribute('style', 'width:' + progressValue);
2013
+ li.querySelector('.' + PROGRESSBAR).style.width = progressValue;
2008
2014
  li.querySelector('.' + PROGRESSBAR_TEXT).textContent = progressValue;
2009
2015
  };
2010
2016
  Uploader.prototype.uploadInProgress = function (e, files, customUI, request) {