@syncfusion/ej2-inputs 32.2.5 → 32.2.7

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.
@@ -1183,8 +1183,9 @@ let NumericTextBox = class NumericTextBox extends Component {
1183
1183
  }
1184
1184
  this.element.classList.remove('e-control', 'e-numerictextbox');
1185
1185
  this.element.appendChild(input);
1186
+ setValue('ej2_instances', ejInstance, input);
1187
+ setValue('ej2_instances', null, this.element);
1186
1188
  this.element = input;
1187
- setValue('ej2_instances', ejInstance, this.element);
1188
1189
  }
1189
1190
  attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off' });
1190
1191
  const localeText = {
@@ -3930,8 +3931,9 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3930
3931
  this.element.classList.remove('e-control', 'e-maskedtextbox');
3931
3932
  this.element.classList.add('e-mask-container');
3932
3933
  this.element.appendChild(input);
3934
+ setValue('ej2_instances', ejInstance, input);
3935
+ setValue('ej2_instances', null, this.element);
3933
3936
  this.element = input;
3934
- setValue('ej2_instances', ejInstance, this.element);
3935
3937
  }
3936
3938
  this.updateHTMLAttrToElement();
3937
3939
  this.checkHtmlAttributes(false);
@@ -8760,8 +8762,10 @@ let Uploader = class Uploader extends Component {
8760
8762
  inputElement.setAttribute('name', 'UploadFiles');
8761
8763
  }
8762
8764
  this.element.appendChild(inputElement);
8765
+ setValue('ej2_instances', ejInstance, inputElement);
8766
+ // Clear reference from this.element to avoid retaining component instance
8767
+ setValue('ej2_instances', null, this.element);
8763
8768
  this.element = inputElement;
8764
- setValue('ej2_instances', ejInstance, this.element);
8765
8769
  }
8766
8770
  /* istanbul ignore next */
8767
8771
  if (ejInstance[0].isPureReactComponent) {
@@ -9149,7 +9153,8 @@ let Uploader = class Uploader extends Component {
9149
9153
  wireEvents() {
9150
9154
  EventHandler.add(this.browseButton, 'click', this.browseButtonClick, this);
9151
9155
  EventHandler.add(this.element, 'change', this.onSelectFiles, this);
9152
- EventHandler.add(document, 'click', this.removeFocus, this);
9156
+ this.documentClickHandler = this.removeFocus.bind(this);
9157
+ EventHandler.add(document, 'click', this.documentClickHandler);
9153
9158
  this.keyboardModule = new KeyboardEvents(this.uploadWrapper, {
9154
9159
  keyAction: this.keyActionHandler.bind(this),
9155
9160
  keyConfigs: this.keyConfigs,
@@ -9162,7 +9167,10 @@ let Uploader = class Uploader extends Component {
9162
9167
  unWireEvents() {
9163
9168
  EventHandler.remove(this.browseButton, 'click', this.browseButtonClick);
9164
9169
  EventHandler.remove(this.element, 'change', this.onSelectFiles);
9165
- EventHandler.remove(document, 'click', this.removeFocus);
9170
+ if (this.documentClickHandler) {
9171
+ EventHandler.remove(document, 'click', this.documentClickHandler);
9172
+ this.documentClickHandler = null;
9173
+ }
9166
9174
  if (this.isForm) {
9167
9175
  EventHandler.remove(this.formElement, 'reset', this.resetForm);
9168
9176
  }
@@ -12135,6 +12143,9 @@ let ColorPicker = class ColorPicker extends Component {
12135
12143
  }
12136
12144
  });
12137
12145
  this.splitBtn.createElement = this.createElement;
12146
+ if (this.isAngular) {
12147
+ this.splitBtn.isAngular = this.isAngular;
12148
+ }
12138
12149
  this.splitBtn.appendTo(splitButton);
12139
12150
  this.splitBtn.element.setAttribute('aria-label', 'colorpicker');
12140
12151
  const preview = this.createElement('span', { className: SPLITPREVIEW });
@@ -12207,8 +12218,9 @@ let ColorPicker = class ColorPicker extends Component {
12207
12218
  this.modal = this.createElement('div');
12208
12219
  this.modal.className = 'e-' + this.getModuleName() + ' e-modal';
12209
12220
  this.modal.style.display = 'none';
12210
- document.body.insertBefore(this.modal, popupEle);
12211
- document.body.className += ' e-colorpicker-overflow';
12221
+ const appendToElement = this.getAppendToElement();
12222
+ appendToElement.insertBefore(this.modal, popupEle);
12223
+ appendToElement.className += ' e-colorpicker-overflow';
12212
12224
  this.modal.style.display = 'block';
12213
12225
  this.modal.style.zIndex = (Number(popupEle.style.zIndex) - 1).toString();
12214
12226
  }
@@ -12242,6 +12254,16 @@ let ColorPicker = class ColorPicker extends Component {
12242
12254
  return callBackPromise;
12243
12255
  };
12244
12256
  }
12257
+ getAppendToElement() {
12258
+ if (this.isAngular) {
12259
+ const cdkPane = this.element.closest('.cdk-overlay-pane');
12260
+ const popoverEl = this.element.closest('[popover]');
12261
+ if (cdkPane && popoverEl) {
12262
+ return cdkPane;
12263
+ }
12264
+ }
12265
+ return document.body;
12266
+ }
12245
12267
  onPopupClose() {
12246
12268
  this.unWireEvents();
12247
12269
  this.destroyOtherComp();
@@ -12251,7 +12273,8 @@ let ColorPicker = class ColorPicker extends Component {
12251
12273
  this.container.innerHTML = '';
12252
12274
  removeClass([this.container], [PICKERCONTENT, PALETTECONTENT]);
12253
12275
  if (Browser.isDevice && this.modal) {
12254
- removeClass([document.body], 'e-colorpicker-overflow');
12276
+ const appendToElement = this.getAppendToElement();
12277
+ removeClass([appendToElement], 'e-colorpicker-overflow');
12255
12278
  this.modal.style.display = 'none';
12256
12279
  this.modal.outerHTML = '';
12257
12280
  this.modal = null;
@@ -13446,6 +13469,10 @@ let ColorPicker = class ColorPicker extends Component {
13446
13469
  this.unWireEvents();
13447
13470
  this.destroyOtherComp();
13448
13471
  }
13472
+ this.splitBtn.beforeClose = null;
13473
+ this.splitBtn.beforeOpen = null;
13474
+ this.splitBtn.click = null;
13475
+ this.splitBtn.open = null;
13449
13476
  this.splitBtn.destroy();
13450
13477
  this.splitBtn = null;
13451
13478
  }
@@ -14180,8 +14207,9 @@ let TextBox = class TextBox extends Component {
14180
14207
  }
14181
14208
  }
14182
14209
  this.element.appendChild(inputElement);
14210
+ setValue('ej2_instances', ejInstance, inputElement);
14211
+ setValue('ej2_instances', null, this.element);
14183
14212
  this.element = inputElement;
14184
- setValue('ej2_instances', ejInstance, this.element);
14185
14213
  }
14186
14214
  this.updateHTMLAttributesToElement();
14187
14215
  this.checkAttributes(false);
@@ -15063,8 +15091,9 @@ let TextArea = class TextArea extends Component {
15063
15091
  }
15064
15092
  }
15065
15093
  this.element.appendChild(inputElement);
15094
+ setValue('ej2_instances', ejInstance, inputElement);
15095
+ setValue('ej2_instances', null, this.element);
15066
15096
  this.element = inputElement;
15067
- setValue('ej2_instances', ejInstance, this.element);
15068
15097
  }
15069
15098
  this.updateHTMLAttributesToElement();
15070
15099
  this.checkAttributes(false);
@@ -16373,7 +16402,8 @@ class SignatureBase extends Component {
16373
16402
  if (isNullOrUndefined(this.pointColl) && !this.isReadOnly && !this.disabled) {
16374
16403
  EventHandler.add(this.canvasContext.canvas, 'mousedown touchstart', this.mouseDownHandler, this);
16375
16404
  EventHandler.add(this.canvasContext.canvas, 'keydown', this.keyboardHandler, this);
16376
- window.addEventListener('resize', this.resizeHandler.bind(this));
16405
+ this.boundResizeHandler = this.resizeHandler.bind(this);
16406
+ window.addEventListener('resize', this.boundResizeHandler);
16377
16407
  }
16378
16408
  else if (this.pointColl) {
16379
16409
  EventHandler.add(this.canvasContext.canvas, 'mousemove touchmove', this.mouseMoveHandler, this);
@@ -16394,7 +16424,10 @@ class SignatureBase extends Component {
16394
16424
  EventHandler.remove(this.canvasContext.canvas, 'mousedown touchstart', this.mouseDownHandler);
16395
16425
  EventHandler.remove(this.canvasContext.canvas, 'keydown', this.keyboardHandler);
16396
16426
  }
16397
- window.removeEventListener('resize', this.resizeHandler);
16427
+ if (this.boundResizeHandler) {
16428
+ window.removeEventListener('resize', this.boundResizeHandler);
16429
+ this.boundResizeHandler = null;
16430
+ }
16398
16431
  }
16399
16432
  }
16400
16433
  setHTMLProperties() {