@syncfusion/ej2-treemap 20.1.59 → 20.2.36

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.
@@ -2111,9 +2111,11 @@ class LayoutPanel {
2111
2111
  }
2112
2112
  if (template) {
2113
2113
  templateEle = this.renderTemplate(secondaryEle, groupId, rect, templatePosition, template, item, isLeafItem);
2114
- templateGroup.appendChild(templateEle);
2115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2116
- this.treemap.renderReactTemplates();
2114
+ if (!isNullOrUndefined(templateEle)) {
2115
+ templateGroup.appendChild(templateEle);
2116
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2117
+ this.treemap.renderReactTemplates();
2118
+ }
2117
2119
  }
2118
2120
  itemGroup.setAttribute('aria-label', item['name']);
2119
2121
  itemGroup.setAttribute('tabindex', (this.treemap.tabIndex + i + 2).toString());
@@ -2248,15 +2250,18 @@ class LayoutPanel {
2248
2250
  template = template.replace(new RegExp('{{:' + keys[i] + '}}', 'g'), item['data'][keys[i].toString()]);
2249
2251
  }
2250
2252
  }
2251
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2252
- const templateFn = getTemplateFunction(template);
2253
- const templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
2254
- const labelEle = convertElement(templateElement, templateId, item['data']);
2255
- const templateSize = measureElement(labelEle, secondaryEle);
2256
- const templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
2257
- labelEle.style.left = templateLocation.x + 'px';
2258
- labelEle.style.top = templateLocation.y + 'px';
2259
- return labelEle;
2253
+ let labelElement;
2254
+ if (!isNullOrUndefined(document.getElementById(this.treemap.element.id + '_Secondary_Element'))) {
2255
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2256
+ const templateFn = getTemplateFunction(template);
2257
+ const templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
2258
+ labelElement = convertElement(templateElement, templateId, item['data']);
2259
+ const templateSize = measureElement(labelElement, secondaryEle);
2260
+ const templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
2261
+ labelElement.style.left = templateLocation.x + 'px';
2262
+ labelElement.style.top = templateLocation.y + 'px';
2263
+ }
2264
+ return labelElement;
2260
2265
  }
2261
2266
  labelInterSectAction(rect, text, textStyle, alignment) {
2262
2267
  let textValue;
@@ -2896,7 +2901,8 @@ let TreeMap = class TreeMap extends Component {
2896
2901
  }
2897
2902
  elementChange() {
2898
2903
  if (this.treeMapLegendModule && this.legendSettings.visible && this.treeMapLegendModule.legendGroup && this.layout.layoutGroup
2899
- && !isNullOrUndefined(this.svgObject)) {
2904
+ && !isNullOrUndefined(this.svgObject) && !isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))
2905
+ && !isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))) {
2900
2906
  this.svgObject.insertBefore(this.layout.layoutGroup, this.treeMapLegendModule.legendGroup);
2901
2907
  }
2902
2908
  }