@syncfusion/ej2-base 23.1.41 → 23.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.
@@ -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
@@ -9272,7 +9294,7 @@ Touch = __decorate$5([
9272
9294
  /**
9273
9295
  * Template Engine
9274
9296
  */
9275
- const LINES = new RegExp('\\n|\\r|\\s\\s+', 'g');
9297
+ const LINES = new RegExp('[\\n\\r\\s]+', 'g');
9276
9298
  const QUOTES = new RegExp(/'|"/g);
9277
9299
  const IF_STMT = new RegExp('if ?\\(');
9278
9300
  const ELSEIF_STMT = new RegExp('else if ?\\(');
@@ -9388,7 +9410,7 @@ function evalExp(str, nameSpace, helper, ignorePrefix) {
9388
9410
  str = str.replace(value, singleSpace);
9389
9411
  });
9390
9412
  }
9391
- return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\'$1\'').replace(exp,
9413
+ return str.replace(LINES, ' ').replace(DBL_QUOTED_STR, '\'$1\'').replace(exp,
9392
9414
  // eslint-disable-next-line
9393
9415
  (match, cnt, offset, matchStr) => {
9394
9416
  const SPECIAL_CHAR = /@|#|\$/gm;