@syncfusion/ej2-angular-base 19.3.59 → 19.3.60

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.
Files changed (52) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/bug.md +60 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/feature.md +37 -0
  3. package/CHANGELOG.md +74 -13
  4. package/dist/ej2-angular-base.umd.min.js +1 -10
  5. package/dist/ej2-angular-base.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-angular-base.es2015.js +122 -33
  7. package/dist/es6/ej2-angular-base.es2015.js.map +1 -1
  8. package/dist/es6/ej2-angular-base.es5.js +130 -36
  9. package/dist/es6/ej2-angular-base.es5.js.map +1 -1
  10. package/dist/global/ej2-angular-base.min.js +1 -10
  11. package/dist/global/ej2-angular-base.min.js.map +1 -1
  12. package/dist/global/index.d.ts +0 -9
  13. package/package.json +71 -71
  14. package/schematics/generators/component-builder.js +14 -14
  15. package/schematics/generators/template/schema.json +1 -1
  16. package/schematics/ng-add/index.js +2 -2
  17. package/schematics/ng-add/schema.json +1 -1
  18. package/schematics/ng-add/theme.js +5 -4
  19. package/schematics/utils/get-project.js +3 -0
  20. package/schematics/utils/helpers/helpers.d.ts +1 -1
  21. package/schematics/utils/project-style-file.js +2 -2
  22. package/src/complex-array-base.js +14 -5
  23. package/src/component-base.js +76 -19
  24. package/src/form-base.d.ts +2 -1
  25. package/src/form-base.js +12 -3
  26. package/src/template.js +7 -2
  27. package/src/util.js +21 -7
  28. package/styles/bootstrap-dark.scss +1 -1
  29. package/styles/bootstrap.scss +1 -1
  30. package/styles/bootstrap4.scss +1 -1
  31. package/styles/bootstrap5-dark.scss +1 -1
  32. package/styles/bootstrap5.scss +1 -1
  33. package/styles/fabric-dark.scss +1 -1
  34. package/styles/fabric.scss +1 -1
  35. package/styles/fluent-dark.css +0 -0
  36. package/styles/fluent-dark.scss +1 -0
  37. package/styles/fluent.css +0 -0
  38. package/styles/fluent.scss +1 -0
  39. package/styles/highcontrast-light.scss +1 -1
  40. package/styles/highcontrast.scss +1 -1
  41. package/styles/material-dark.css +0 -1
  42. package/styles/material-dark.scss +1 -1
  43. package/styles/material.css +0 -1
  44. package/styles/material.scss +1 -1
  45. package/styles/material3-dark.css +54 -0
  46. package/styles/material3-dark.scss +1 -0
  47. package/styles/material3.css +110 -0
  48. package/styles/material3.scss +1 -0
  49. package/styles/tailwind-dark.css +0 -1
  50. package/styles/tailwind-dark.scss +1 -1
  51. package/styles/tailwind.css +0 -1
  52. package/styles/tailwind.scss +1 -1
@@ -8,7 +8,7 @@ import { EventEmitter } from '@angular/core';
8
8
  function applyMixins(derivedClass, baseClass) {
9
9
  baseClass.forEach(function (baseClass) {
10
10
  Object.getOwnPropertyNames(baseClass.prototype).forEach(function (name) {
11
- if (!derivedClass.prototype.hasOwnProperty(name) || baseClass.isFormBase) {
11
+ if (!derivedClass.prototype.hasOwnProperty(name) || (baseClass.isFormBase && name !== 'constructor')) {
12
12
  derivedClass.prototype[name] = baseClass.prototype[name];
13
13
  }
14
14
  });
@@ -51,16 +51,28 @@ function clearTemplate(_this, templateNames, index) {
51
51
  var regProperties = templateNames && templateNames.filter(function (val) {
52
52
  return (/\./g.test(val) ? false : true);
53
53
  });
54
+ var tabaccordionTemp = /tab|accordion|toolbar/.test(_this.getModuleName());
54
55
  for (var _i = 0, _a = (regProperties && regProperties || regTemplates); _i < _a.length; _i++) {
55
56
  var registeredTemplate = _a[_i];
56
57
  /* istanbul ignore next */
57
58
  if (index && index.length) {
58
59
  for (var e = 0; e < index.length; e++) {
59
- for (var m = 0; m < _this.registeredTemplate.template.length; m++) {
60
- var value = _this.registeredTemplate.template[m].rootNodes[0];
61
- if (value === index[e]) {
62
- var rt = _this.registeredTemplate[registeredTemplate];
63
- rt[m].destroy();
60
+ if (tabaccordionTemp) {
61
+ for (var m = 0; m < _this.registeredTemplate[registeredTemplate].length; m++) {
62
+ var value = _this.registeredTemplate[registeredTemplate][m];
63
+ if (value && value === index[e]) {
64
+ value.destroy();
65
+ _this.registeredTemplate[registeredTemplate].splice(m, 1);
66
+ }
67
+ }
68
+ }
69
+ else {
70
+ for (var m = 0; m < _this.registeredTemplate.template.length; m++) {
71
+ var value = _this.registeredTemplate.template[m].rootNodes[0];
72
+ if (value === index[e]) {
73
+ var rt = _this.registeredTemplate[registeredTemplate];
74
+ rt[m].destroy();
75
+ }
64
76
  }
65
77
  }
66
78
  }
@@ -83,7 +95,9 @@ function clearTemplate(_this, templateNames, index) {
83
95
  }
84
96
  }
85
97
  }
86
- delete _this.registeredTemplate[registeredTemplate];
98
+ if (!tabaccordionTemp || !index) {
99
+ delete _this.registeredTemplate[registeredTemplate];
100
+ }
87
101
  }
88
102
  }
89
103
  var _loop_1 = function (tagObject) {
@@ -145,8 +159,14 @@ var ComplexBase = /** @__PURE__ @class */ (function () {
145
159
  var templateProperties = Object.keys(this);
146
160
  for (var i = 0; i < templateProperties.length; i++) {
147
161
  var tempProp = getValue(templateProperties[i], this);
148
- if (typeof tempProp === 'object' && tempProp.elementRef && !getValue(templateProperties[i].indexOf('Ref') !== -1 ? templateProperties[i] : templateProperties[i] + 'Ref', this)) {
149
- setValue(templateProperties[i].indexOf('Ref') !== -1 ? templateProperties[i] : templateProperties[i] + 'Ref', tempProp, this);
162
+ if (typeof tempProp === 'object' && tempProp && tempProp.elementRef) {
163
+ if (!getValue(templateProperties[i].indexOf('Ref') !== -1 ? templateProperties[i] : templateProperties[i] + 'Ref', this)) {
164
+ setValue(templateProperties[i].indexOf('Ref') !== -1 ? templateProperties[i] : templateProperties[i] + 'Ref', tempProp, this);
165
+ }
166
+ if (getValue("viewContainerRef", this) && !getValue("_viewContainerRef", tempProp.elementRef.nativeElement) && !getValue("propName", tempProp.elementRef.nativeElement)) {
167
+ setValue("_viewContainerRef", getValue("viewContainerRef", this), tempProp.elementRef.nativeElement);
168
+ setValue("propName", templateProperties[i].replace("Ref", ''), tempProp.elementRef.nativeElement);
169
+ }
150
170
  }
151
171
  }
152
172
  templateProperties = Object.keys(this);
@@ -165,7 +185,7 @@ var ComplexBase = /** @__PURE__ @class */ (function () {
165
185
  if (this.directivePropList) {
166
186
  for (var k = 0; k < this.directivePropList.length; k++) {
167
187
  var dirPropName = this.directivePropList[k];
168
- if (propList.indexOf(dirPropName) !== -1 && getValue(dirPropName, this)) {
188
+ if (propList.indexOf(dirPropName) !== -1 && (getValue(dirPropName, this) === false || getValue(dirPropName, this))) {
169
189
  setValue(dirPropName, getValue(dirPropName, this), this.propCollection);
170
190
  }
171
191
  }
@@ -298,9 +318,12 @@ var ArrayBase = /** @__PURE__ @class */ (function () {
298
318
  this.list[i].propCollection.dataSource = this.list[i].dataSource;
299
319
  this.list[i].hasChanges = true;
300
320
  }
301
- isSourceChanged = (JSON.stringify(this.list[i].propCollection.dataSource) !==
302
- JSON.stringify(childrenDataSource[i].propCollection.dataSource));
321
+ if (this.list[i].property !== "series") {
322
+ isSourceChanged = (JSON.stringify(this.list[i].propCollection.dataSource) !==
323
+ JSON.stringify(childrenDataSource[i].propCollection.dataSource));
324
+ }
303
325
  }
326
+ isSourceChanged = this.list[i].hasChanges !== childrenDataSource[i].hasChanges;
304
327
  }
305
328
  }
306
329
  this.hasNewChildren = (this.list.length !== this.children.length || isSourceChanged) ? true : null;
@@ -419,6 +442,19 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
419
442
  tempOnThis.tagObjects.push(tagObject);
420
443
  }
421
444
  var complexTemplates = Object.keys(tempOnThis);
445
+ for (var i = 0; i < complexTemplates.length; i++) {
446
+ var compProp = getValue(complexTemplates[i], tempOnThis);
447
+ if (typeof compProp === 'object' && compProp && compProp.elementRef) {
448
+ if (typeof compProp === 'object' && compProp && compProp.elementRef && complexTemplates[i].indexOf('_') !== -1 && complexTemplates[i].indexOf('Ref') === -1) {
449
+ setValue(complexTemplates[i] + 'Ref', compProp, tempOnThis);
450
+ }
451
+ if (tempOnThis.viewContainerRef && !getValue("_viewContainerRef", compProp.elementRef.nativeElement) && !getValue("propName", compProp.elementRef.nativeElement)) {
452
+ setValue("_viewContainerRef", tempOnThis.viewContainerRef, compProp.elementRef.nativeElement);
453
+ setValue("propName", complexTemplates[i].replace("Ref", ''), compProp.elementRef.nativeElement);
454
+ }
455
+ }
456
+ }
457
+ complexTemplates = Object.keys(tempOnThis);
422
458
  complexTemplates = complexTemplates.filter(function (val) {
423
459
  return /Ref$/i.test(val) && /\_/i.test(val);
424
460
  });
@@ -468,6 +504,7 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
468
504
  templateProperties = templateProperties.filter(function (val) {
469
505
  return /Ref$/i.test(val);
470
506
  });
507
+ var ngtempRef = tempAfterViewThis.getModuleName() === 'DocumentEditor';
471
508
  for (var _i = 0, templateProperties_1 = templateProperties; _i < templateProperties_1.length; _i++) {
472
509
  var tempName = templateProperties_1[_i];
473
510
  var propName = tempName.replace('Ref', '');
@@ -475,13 +512,21 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
475
512
  }
476
513
  // Used setTimeout for template binding
477
514
  // Refer Link: https://github.com/angular/angular/issues/6005
478
- setTimeout(function () {
515
+ var appendToComponent = function (tempAfterViewThis) {
479
516
  /* istanbul ignore else */
480
- if (typeof window !== 'undefined' && document.body.contains(tempAfterViewThis.element) || tempAfterViewThis.getModuleName() === 'btn') {
517
+ if (typeof window !== 'undefined' && tempAfterViewThis.element || tempAfterViewThis.getModuleName().includes('btn')) {
481
518
  tempAfterViewThis.appendTo(tempAfterViewThis.element);
482
519
  tempAfterViewThis.ngEle.nativeElement.style.visibility = '';
483
520
  }
484
- });
521
+ };
522
+ if (!ngtempRef) {
523
+ setTimeout(function () {
524
+ appendToComponent(tempAfterViewThis);
525
+ });
526
+ }
527
+ else {
528
+ appendToComponent(tempAfterViewThis);
529
+ }
485
530
  };
486
531
  // tslint:disable-next-line:no-any
487
532
  ComponentBase.prototype.ngOnDestroy = function (isTempRef) {
@@ -493,9 +538,28 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
493
538
  tempOnDestroyThis.destroy();
494
539
  tempOnDestroyThis.clearTemplate(null);
495
540
  // removing bounded events and tagobjects from component after destroy
496
- tempOnDestroyThis.ngBoundedEvents = {};
497
- tempOnDestroyThis.tagObjects = {};
498
- tempOnDestroyThis.ngEle = null;
541
+ setTimeout(function () {
542
+ for (var _i = 0, _a = Object.keys(tempOnDestroyThis); _i < _a.length; _i++) {
543
+ var key = _a[_i];
544
+ var value = tempOnDestroyThis[key];
545
+ if (value && /object/.test(typeof value) && Object.keys(value).length !== 0) {
546
+ if (/properties|changedProperties|childChangedProperties|oldProperties|moduleLoader/.test(key)) {
547
+ for (var _b = 0, _c = Object.keys(tempOnDestroyThis[key]); _b < _c.length; _b++) {
548
+ var propKey = _c[_b];
549
+ var propValue = value[propKey];
550
+ if (propValue && /object/.test(typeof propValue) && Object.keys(propValue).length !== 0 && (propValue.parent || propValue.parentObj)) {
551
+ tempOnDestroyThis[key][propKey] = null;
552
+ }
553
+ }
554
+ }
555
+ else {
556
+ if (value.parent || value.parentObj) {
557
+ tempOnDestroyThis[key] = null;
558
+ }
559
+ }
560
+ }
561
+ }
562
+ });
499
563
  }
500
564
  });
501
565
  };
@@ -535,24 +599,40 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
535
599
  var complexPropName = compDirPropList[k];
536
600
  obj[complexPropName] = tagObject.instance.list[h].propCollection[complexPropName];
537
601
  }
538
- for (var i = 0; i < tagObject.instance.list[h].tags.length; i++) {
602
+ var _loop_1 = function (i) {
539
603
  var tag = tagObject.instance.list[h].tags[i];
540
604
  var childObj = getValue('child' + tag.substring(0, 1).toUpperCase() + tag.substring(1), tagObject.instance.list[h]);
541
605
  if (childObj) {
542
606
  var innerchildObj = tagObject.instance.list[h]['child' + tag.substring(0, 1).toUpperCase() + tag.substring(1)];
543
- if (innerchildObj) {
544
- for (var j = 0; j < innerchildObj.list.length; j++) {
545
- var innerTag = innerchildObj.list[0].tags[0];
546
- if (innerTag) {
547
- var innerchildTag = getValue('child' + innerTag.substring(0, 1).toUpperCase() + innerTag.substring(1), innerchildObj.list[j]);
548
- if (innerchildTag) {
549
- innerchildObj.list[j].tagObjects.push({ instance: innerchildTag, name: innerTag });
607
+ // Update the inner child tag objects
608
+ var updateChildTag_1 = function (innerchild) {
609
+ var innerLevelTag = [];
610
+ if (innerchild) {
611
+ for (var j = 0; j < innerchild.list.length; j++) {
612
+ var innerTag = innerchild.list[0].tags[0];
613
+ if (innerTag) {
614
+ var innerchildTag = getValue('child' + innerTag.substring(0, 1).toUpperCase() + innerTag.substring(1), innerchild.list[j]);
615
+ if (innerchildTag) {
616
+ innerchild.list[j].tagObjects.push({ instance: innerchildTag, name: innerTag });
617
+ innerLevelTag.push(innerchildTag);
618
+ }
550
619
  }
551
620
  }
552
621
  }
553
- }
622
+ // check for inner level tag
623
+ if (innerLevelTag.length !== 0) {
624
+ for (var l = 0; l < innerLevelTag.length; l++) {
625
+ updateChildTag_1(innerLevelTag[l]);
626
+ }
627
+ }
628
+
629
+ };
630
+ updateChildTag_1(innerchildObj);
554
631
  tagObject.instance.list[h].tagObjects.push({ instance: childObj, name: tag });
555
632
  }
633
+ };
634
+ for (var i = 0; i < tagObject.instance.list[h].tags.length; i++) {
635
+ _loop_1(i);
556
636
  }
557
637
  tagObject.instance.list[h].propCollection[tagObject.instance.propertyName].push(obj);
558
638
  }
@@ -563,7 +643,7 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
563
643
  }
564
644
  else {
565
645
  /* istanbul ignore next */
566
- if ((tempAfterContentThis[tagObject.name].length !== tagObject.instance.list.length) || (tempAfterContentThis.getModuleName() === 'diagram')) {
646
+ if ((tempAfterContentThis[tagObject.name].length !== tagObject.instance.list.length) || (/diagram|DashboardLayout/.test(tempAfterContentThis.getModuleName()))) {
567
647
  tempAfterContentThis[tagObject.name] = tagObject.instance.list;
568
648
  }
569
649
  for (var _b = 0, _c = tagObject.instance.list; _b < _c.length; _b++) {
@@ -574,7 +654,7 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
574
654
  complexTemplates = complexTemplates.filter(function (val) {
575
655
  return /Ref$/i.test(val);
576
656
  });
577
- if (curChild.properties && Object.keys(curChild.properties).length !== 0 && /chart/.test(tempAfterContentThis.getModuleName())) {
657
+ if (curChild.properties && Object.keys(curChild.properties).length !== 0) {
578
658
  for (var _d = 0, complexTemplates_2 = complexTemplates; _d < complexTemplates_2.length; _d++) {
579
659
  var complexPropName = complexTemplates_2[_d];
580
660
  complexPropName = complexPropName.replace(/Ref/, '');
@@ -610,7 +690,7 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
610
690
  };
611
691
  ComponentBase.prototype.addTwoWay = function (propList) {
612
692
  var _this = this;
613
- var _loop_1 = function (prop) {
693
+ var _loop_2 = function (prop) {
614
694
  getValue(prop, this_1);
615
695
  Object.defineProperty(this_1, prop, {
616
696
  get: function () {
@@ -623,7 +703,7 @@ var ComponentBase = /** @__PURE__ @class */ (function () {
623
703
  var this_1 = this;
624
704
  for (var _i = 0, propList_1 = propList; _i < propList_1.length; _i++) {
625
705
  var prop = propList_1[_i];
626
- _loop_1(prop);
706
+ _loop_2(prop);
627
707
  }
628
708
  };
629
709
  ComponentBase.prototype.addEventListener = function (eventName, handler) {
@@ -706,6 +786,7 @@ var FormBase = /** @__PURE__ @class */ (function () {
706
786
  }
707
787
  }
708
788
  }
789
+ this.cdr.markForCheck();
709
790
  };
710
791
  FormBase.prototype.registerOnChange = function (registerFunction) {
711
792
  this.propagateChange = registerFunction;
@@ -731,16 +812,21 @@ var FormBase = /** @__PURE__ @class */ (function () {
731
812
  // Used setTimeout for template binding
732
813
  // Refer Link: https://github.com/angular/angular/issues/6005
733
814
  // Removed setTimeout, Because we have called markForCheck() method in Angular Template Compiler
734
- // setTimeout(() => {
735
815
  /* istanbul ignore else */
736
816
  if (typeof window !== 'undefined') {
737
- tempFormAfterViewThis.appendTo(tempFormAfterViewThis.element);
817
+ if ((tempFormAfterViewThis.getModuleName()).includes('dropdown')) {
818
+ setTimeout(function () {
819
+ tempFormAfterViewThis.appendTo(tempFormAfterViewThis.element);
820
+ });
821
+ }
822
+ else {
823
+ tempFormAfterViewThis.appendTo(tempFormAfterViewThis.element);
824
+ }
738
825
  var ele = tempFormAfterViewThis.inputElement || tempFormAfterViewThis.element;
739
826
  ele.addEventListener('focus', tempFormAfterViewThis.ngOnFocus.bind(tempFormAfterViewThis));
740
827
  ele.addEventListener('blur', tempFormAfterViewThis.ngOnBlur.bind(tempFormAfterViewThis));
741
828
  }
742
829
  this.isFormInit = false;
743
- // });
744
830
  };
745
831
  FormBase.prototype.setDisabledState = function (disabled) {
746
832
  this.enabled = !disabled;
@@ -774,6 +860,7 @@ var FormBase = /** @__PURE__ @class */ (function () {
774
860
  // When binding Html textbox value to syncfusion textbox, change event triggered dynamically.
775
861
  // To prevent change event, trigger change in component side based on `preventChange` value
776
862
  this.preventChange = this.isFormInit ? false : true;
863
+ this.cdr.markForCheck();
777
864
  if (value === null) {
778
865
  return;
779
866
  }
@@ -783,6 +870,7 @@ var FormBase = /** @__PURE__ @class */ (function () {
783
870
  if (this.skipFromEvent !== true) {
784
871
  this.focus.emit(e);
785
872
  }
873
+ this.cdr.markForCheck();
786
874
  };
787
875
  FormBase.prototype.ngOnBlur = function (e) {
788
876
  this.propagateTouch();
@@ -790,6 +878,7 @@ var FormBase = /** @__PURE__ @class */ (function () {
790
878
  if (this.skipFromEvent !== true) {
791
879
  this.blur.emit(e);
792
880
  }
881
+ this.cdr.markForCheck();
793
882
  };
794
883
  FormBase.isFormBase = true;
795
884
  return FormBase;
@@ -800,7 +889,7 @@ var stringCompiler = getTemplateEngine();
800
889
  * Angular Template Compiler
801
890
  */
802
891
  function compile(templateEle, helper) {
803
- if (typeof templateEle === 'string') {
892
+ if (typeof templateEle === 'string' || (typeof templateEle === 'function' && templateEle.prototype && templateEle.prototype.CSPTemplate)) {
804
893
  return stringCompiler(templateEle, helper);
805
894
  }
806
895
  else {
@@ -812,7 +901,12 @@ function compile(templateEle, helper) {
812
901
  /* istanbul ignore next */
813
902
  var conRef = contRef_1 ? contRef_1 : component.viewContainerRef;
814
903
  var viewRef = conRef.createEmbeddedView(templateEle, context);
815
- viewRef.markForCheck();
904
+ if (getValue('currentInstance.element.nodeName', conRef) === 'EJS-MENTION') {
905
+ viewRef.detectChanges();
906
+ }
907
+ else {
908
+ viewRef.markForCheck();
909
+ }
816
910
  /* istanbul ignore next */
817
911
  var viewCollection = (component && component.registeredTemplate) ?
818
912
  component.registeredTemplate : getValue('currentInstance.registeredTemplate', conRef);