@syncfusion/ej2-base 23.1.41 → 23.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.
@@ -2297,7 +2297,7 @@ class Observer {
2297
2297
  }
2298
2298
  const cntxt = context || this.context;
2299
2299
  if (this.notExist(property)) {
2300
- this.boundedEvents[`${property}`] = [{ handler: handler, context: cntxt }];
2300
+ this.boundedEvents[`${property}`] = [{ handler: handler, context: cntxt, id: id }];
2301
2301
  return;
2302
2302
  }
2303
2303
  if (!isNullOrUndefined(id)) {
@@ -2436,6 +2436,26 @@ class Observer {
2436
2436
  destroy() {
2437
2437
  this.boundedEvents = this.context = undefined;
2438
2438
  }
2439
+ /**
2440
+ * To remove internationalization events
2441
+ *
2442
+ * @returns {void} ?
2443
+ */
2444
+ offIntlEvents() {
2445
+ let eventsArr = this.boundedEvents['notifyExternalChange'];
2446
+ if (eventsArr) {
2447
+ for (let i = 0; i < eventsArr.length; i++) {
2448
+ let curContext = eventsArr[0].context;
2449
+ if (curContext && curContext.detectFunction && curContext.randomId && !curContext.isRendered) {
2450
+ this.off('notifyExternalChange', curContext.detectFunction, curContext.randomId);
2451
+ i--;
2452
+ }
2453
+ }
2454
+ if (!this.boundedEvents['notifyExternalChange'].length) {
2455
+ delete this.boundedEvents['notifyExternalChange'];
2456
+ }
2457
+ }
2458
+ }
2439
2459
  /**
2440
2460
  * Returns if the property exists.
2441
2461
  *
@@ -3564,7 +3584,8 @@ var IntlBase;
3564
3584
  */
3565
3585
  function changeCurrencySymbol(val, sym) {
3566
3586
  if (val) {
3567
- return val.replace(IntlBase.defaultCurrency, sym);
3587
+ val = val.replace(IntlBase.defaultCurrency, sym);
3588
+ return (sym === '') ? val.trim() : val;
3568
3589
  }
3569
3590
  return '';
3570
3591
  }
@@ -5413,7 +5434,8 @@ class Base {
5413
5434
  destroy() {
5414
5435
  // eslint-disable-next-line
5415
5436
  this.element.ej2_instances =
5416
- this.element.ej2_instances.filter((i) => { return i !== this; });
5437
+ this.element.ej2_instances ? this.element.ej2_instances.filter((i) => { return i !== this; })
5438
+ : [];
5417
5439
  removeClass([this.element], ['e-' + this.getModuleName()]);
5418
5440
  if (this.element.ej2_instances.length === 0) {
5419
5441
  // Remove module class from the root element