@syncfusion/ej2-inputs 21.2.4 → 21.2.6

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.
@@ -238,11 +238,13 @@ var Input;
238
238
  return inputObject;
239
239
  }
240
240
  function updateIconState(value, button, readonly) {
241
- if (value && !readonly) {
242
- removeClass([button], CLASSNAMES.CLEARICONHIDE);
243
- }
244
- else {
245
- addClass([button], CLASSNAMES.CLEARICONHIDE);
241
+ if (!isNullOrUndefined(button)) {
242
+ if (value && !readonly) {
243
+ removeClass([button], CLASSNAMES.CLEARICONHIDE);
244
+ }
245
+ else {
246
+ addClass([button], CLASSNAMES.CLEARICONHIDE);
247
+ }
246
248
  }
247
249
  }
248
250
  function updateLabelState(value, label, element = null) {
@@ -296,7 +298,7 @@ var Input;
296
298
  }
297
299
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
298
300
  function wireClearBtnEvents(element, button, container) {
299
- if (isBindClearAction === undefined || isBindClearAction) {
301
+ if (!isNullOrUndefined(button) && (isBindClearAction === undefined || isBindClearAction)) {
300
302
  button.addEventListener('click', (event) => {
301
303
  if (!(element.classList.contains(CLASSNAMES.DISABLE) || element.readOnly)) {
302
304
  event.preventDefault();
@@ -319,7 +321,10 @@ var Input;
319
321
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
320
322
  element.addEventListener('blur', (event) => {
321
323
  setTimeout(() => {
322
- addClass([button], CLASSNAMES.CLEARICONHIDE);
324
+ if (!isNullOrUndefined(button)) {
325
+ addClass([button], CLASSNAMES.CLEARICONHIDE);
326
+ button = !isNullOrUndefined(element) && element.classList.contains('e-combobox') ? null : button;
327
+ }
323
328
  }, 200);
324
329
  });
325
330
  }
@@ -3692,9 +3697,13 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3692
3697
  switch (prop) {
3693
3698
  case 'value':
3694
3699
  setMaskValue.call(this, this.value);
3695
- if (this.placeholder) {
3700
+ if (this.placeholder && !this.isFocus) {
3696
3701
  this.setMaskPlaceholder(false, false);
3697
3702
  }
3703
+ if (this.value === "") {
3704
+ this.element.selectionStart = 0;
3705
+ this.element.selectionEnd = 0;
3706
+ }
3698
3707
  break;
3699
3708
  case 'placeholder':
3700
3709
  this.setMaskPlaceholder(true, true);
@@ -3788,6 +3797,7 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3788
3797
  */
3789
3798
  focusIn() {
3790
3799
  if (document.activeElement !== this.element && this.enabled) {
3800
+ this.isFocus = true;
3791
3801
  this.element.focus();
3792
3802
  addClass([this.inputObj.container], [MASKINPUT_FOCUS]);
3793
3803
  }
@@ -3799,6 +3809,7 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3799
3809
  */
3800
3810
  focusOut() {
3801
3811
  if (document.activeElement === this.element && this.enabled) {
3812
+ this.isFocus = false;
3802
3813
  this.element.blur();
3803
3814
  removeClass([this.inputObj.container], [MASKINPUT_FOCUS]);
3804
3815
  }
@@ -7813,7 +7824,10 @@ let Uploader = class Uploader extends Component {
7813
7824
  this.updateDirectoryAttributes();
7814
7825
  break;
7815
7826
  case 'template':
7816
- this.clearAll();
7827
+ const ejInstance = getValue('ej2_instances', this.element);
7828
+ if (!ejInstance[0].isReact) {
7829
+ this.clearAll();
7830
+ }
7817
7831
  break;
7818
7832
  case 'minFileSize':
7819
7833
  case 'maxFileSize':
@@ -8919,7 +8933,6 @@ let Uploader = class Uploader extends Component {
8919
8933
  }
8920
8934
  else {
8921
8935
  this.createFileList(fileData, true);
8922
- this.filesData = this.filesData.concat(fileData);
8923
8936
  if (!this.isForm || this.allowUpload()) {
8924
8937
  this.checkAutoUpload(fileData);
8925
8938
  }
@@ -9294,6 +9307,7 @@ let Uploader = class Uploader extends Component {
9294
9307
  createFileList(fileData, isSelectedFile) {
9295
9308
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
9296
9309
  this.createParentUL();
9310
+ this.filesData = (isSelectedFile) ? this.filesData.concat(fileData) : fileData;
9297
9311
  if (this.template !== '' && !isNullOrUndefined(this.template)) {
9298
9312
  if (this.isFormUpload()) {
9299
9313
  this.uploadWrapper.classList.add(FORM_UPLOAD);