@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.
@@ -1253,6 +1253,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1253
1253
  if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
1254
1254
  this.enabled = false;
1255
1255
  }
1256
+ this.updateFloatLabelOverflowWidth();
1256
1257
  this.renderComplete();
1257
1258
  }
1258
1259
  }
@@ -2028,6 +2029,12 @@ let NumericTextBox = class NumericTextBox extends Component {
2028
2029
  return;
2029
2030
  }
2030
2031
  this.isFocused = true;
2032
+ if (this.floatLabelType !== 'Never' && this.inputWrapper && this.inputWrapper.container) {
2033
+ const label = this.inputWrapper.container.querySelector('.e-float-text');
2034
+ if (label) {
2035
+ label.removeAttribute('style');
2036
+ }
2037
+ }
2031
2038
  this.prevValue = this.value;
2032
2039
  if ((this.value || this.value === 0)) {
2033
2040
  let formatValue = this.formatNumber();
@@ -2083,6 +2090,7 @@ let NumericTextBox = class NumericTextBox extends Component {
2083
2090
  EventHandler.remove(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel);
2084
2091
  }
2085
2092
  }
2093
+ this.updateFloatLabelOverflowWidth();
2086
2094
  const formElement = closest(this.element, 'form');
2087
2095
  if (formElement) {
2088
2096
  const element = this.element.nextElementSibling;
@@ -2441,6 +2449,24 @@ let NumericTextBox = class NumericTextBox extends Component {
2441
2449
  detach(this.spinDown);
2442
2450
  }
2443
2451
  }
2452
+ getRightIconsWidth() {
2453
+ const container = this.inputWrapper.container;
2454
+ let width = 0;
2455
+ const iconSelectors = '.e-input-group-icon, .e-clear-icon';
2456
+ const icons = container.querySelectorAll(iconSelectors);
2457
+ for (let index = 0; index < icons.length; index++) {
2458
+ width += icons[index].offsetWidth;
2459
+ }
2460
+ return width;
2461
+ }
2462
+ updateFloatLabelOverflowWidth() {
2463
+ const container = this.inputWrapper.container;
2464
+ const label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
2465
+ const calculateWidth = (container.clientWidth - this.getRightIconsWidth());
2466
+ if (label && calculateWidth) {
2467
+ label.style.width = calculateWidth + 'px';
2468
+ }
2469
+ }
2444
2470
  /**
2445
2471
  * Gets the component name
2446
2472
  *
@@ -2813,6 +2839,12 @@ function maskInputFocusHandler(event) {
2813
2839
  if (!this.isClicked) {
2814
2840
  triggerFocus.call(this, eventArgs, inputElement);
2815
2841
  }
2842
+ if (this.floatLabelType !== 'Never' && this.inputObj && this.inputObj.container) {
2843
+ const label = this.inputObj.container.querySelector('.e-float-text');
2844
+ if (label) {
2845
+ label.removeAttribute('style');
2846
+ }
2847
+ }
2816
2848
  if (this.mask) {
2817
2849
  if (!(!(modelValue === null || modelValue === '') || this.floatLabelType === 'Always' ||
2818
2850
  this.placeholder === null || this.placeholder === '')) {
@@ -2914,6 +2946,7 @@ function maskInputBlurHandler(event) {
2914
2946
  container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
2915
2947
  };
2916
2948
  this.trigger('blur', this.blurEventArgs);
2949
+ this.updateFloatLabelOverflowWidth();
2917
2950
  if (this.mask) {
2918
2951
  this.isFocus = false;
2919
2952
  if (this.placeholder && this.element.value === this.promptMask && this.floatLabelType !== 'Always') {
@@ -3824,6 +3857,7 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3824
3857
  if (!this.element.hasAttribute('aria-labelledby') && !this.element.hasAttribute('placeholder') && !this.element.hasAttribute('aria-label')) {
3825
3858
  this.element.setAttribute('aria-label', 'maskedtextbox');
3826
3859
  }
3860
+ this.updateFloatLabelOverflowWidth();
3827
3861
  this.renderComplete();
3828
3862
  }
3829
3863
  }
@@ -4096,6 +4130,24 @@ let MaskedTextBox = class MaskedTextBox extends Component {
4096
4130
  removeClass([this.inputObj.container], [MASKINPUT_FOCUS]);
4097
4131
  }
4098
4132
  }
4133
+ getRightIconsWidth() {
4134
+ const container = this.inputObj.container;
4135
+ let width = 0;
4136
+ const iconSelectors = '.e-input-group-icon, .e-clear-icon';
4137
+ const icons = container.querySelectorAll(iconSelectors);
4138
+ for (let index = 0; index < icons.length; index++) {
4139
+ width += icons[index].offsetWidth;
4140
+ }
4141
+ return width;
4142
+ }
4143
+ updateFloatLabelOverflowWidth() {
4144
+ const container = this.inputObj.container;
4145
+ const label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
4146
+ const calculateWidth = (container.clientWidth - this.getRightIconsWidth());
4147
+ if (label && calculateWidth) {
4148
+ label.style.width = calculateWidth + 'px';
4149
+ }
4150
+ }
4099
4151
  /**
4100
4152
  * Removes the component from the DOM and detaches all its related event handlers.
4101
4153
  * Also it maintains the initial input element from the DOM.
@@ -9323,6 +9375,12 @@ let Uploader = class Uploader extends Component {
9323
9375
  if (!this.enabled) {
9324
9376
  return;
9325
9377
  }
9378
+ if (!this.multiple && this.getFilesData().length > 0) {
9379
+ const selectedFile = this.getSelectedFiles(0);
9380
+ if (selectedFile) {
9381
+ this.remove(selectedFile, false, false, true, null);
9382
+ }
9383
+ }
9326
9384
  let targetFiles;
9327
9385
  /* istanbul ignore next */
9328
9386
  if (args.type === 'drop') {
@@ -10064,7 +10122,7 @@ let Uploader = class Uploader extends Component {
10064
10122
  const progressbarWrapper = this.createElement('span', { className: PROGRESS_WRAPPER });
10065
10123
  const progressBar = this.createElement('progressbar', { className: PROGRESSBAR, attrs: { value: '0', max: '100' } });
10066
10124
  const progressbarInnerWrapper = this.createElement('span', { className: PROGRESS_INNER_WRAPPER });
10067
- progressBar.setAttribute('style', 'width: 0%');
10125
+ progressBar.style.width = '0%';
10068
10126
  const progressbarText = this.createElement('span', { className: PROGRESSBAR_TEXT });
10069
10127
  progressbarText.textContent = '0%';
10070
10128
  progressbarInnerWrapper.appendChild(progressBar);
@@ -10087,7 +10145,7 @@ let Uploader = class Uploader extends Component {
10087
10145
  }
10088
10146
  }
10089
10147
  changeProgressValue(li, progressValue) {
10090
- li.querySelector('.' + PROGRESSBAR).setAttribute('style', 'width:' + progressValue);
10148
+ li.querySelector('.' + PROGRESSBAR).style.width = progressValue;
10091
10149
  li.querySelector('.' + PROGRESSBAR_TEXT).textContent = progressValue;
10092
10150
  }
10093
10151
  uploadInProgress(e, files, customUI, request) {
@@ -14670,6 +14728,7 @@ let TextArea = class TextArea extends Component {
14670
14728
  this.element.defaultValue = this.element.value;
14671
14729
  Input.setWidth(this.width, this.textareaWrapper.container);
14672
14730
  this.setWrapperWidth();
14731
+ this.updateFloatLabelOverflowWidth();
14673
14732
  this.renderComplete();
14674
14733
  }
14675
14734
  getModuleName() {
@@ -14776,6 +14835,12 @@ let TextArea = class TextArea extends Component {
14776
14835
  event: args,
14777
14836
  value: this.value
14778
14837
  };
14838
+ if (this.floatLabelType !== 'Never' && this.textareaWrapper && this.textareaWrapper.container) {
14839
+ const label = this.textareaWrapper.container.querySelector('.e-float-text');
14840
+ if (label) {
14841
+ label.removeAttribute('style');
14842
+ }
14843
+ }
14779
14844
  this.trigger('focus', eventArgs);
14780
14845
  }
14781
14846
  focusOutHandler(args) {
@@ -14788,6 +14853,7 @@ let TextArea = class TextArea extends Component {
14788
14853
  event: args,
14789
14854
  value: this.value
14790
14855
  };
14856
+ this.updateFloatLabelOverflowWidth();
14791
14857
  this.trigger('blur', eventArgs);
14792
14858
  }
14793
14859
  keydownHandler(args) {
@@ -15032,6 +15098,24 @@ let TextArea = class TextArea extends Component {
15032
15098
  getCurrentResizeClass(resizeMode) {
15033
15099
  return resizeMode === 'None' ? RESIZE_NONE : (resizeMode === 'Both' ? RESIZE_XY : resizeMode === 'Horizontal' ? RESIZE_X : RESIZE_Y);
15034
15100
  }
15101
+ getRightIconsWidth() {
15102
+ const container = this.textareaWrapper.container;
15103
+ let width = 0;
15104
+ const iconSelectors = '.e-input-group-icon, .e-clear-icon';
15105
+ const icons = container.querySelectorAll(iconSelectors);
15106
+ for (let index = 0; index < icons.length; index++) {
15107
+ width += icons[index].offsetWidth;
15108
+ }
15109
+ return width;
15110
+ }
15111
+ updateFloatLabelOverflowWidth() {
15112
+ const container = this.textareaWrapper.container;
15113
+ const label = container.querySelector('.e-float-text-overflow') || container.querySelector('.e-float-text');
15114
+ const calculateWidth = (container.clientWidth - this.getRightIconsWidth());
15115
+ if (label && calculateWidth) {
15116
+ label.style.width = calculateWidth + 'px';
15117
+ }
15118
+ }
15035
15119
  };
15036
15120
  __decorate$7([
15037
15121
  Property(false)