@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.
@@ -2206,9 +2206,11 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
2206
2206
  }
2207
2207
  if (template) {
2208
2208
  templateEle = _this.renderTemplate(secondaryEle, groupId, rect, templatePosition, template, item, isLeafItem);
2209
- templateGroup.appendChild(templateEle);
2210
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2211
- _this.treemap.renderReactTemplates();
2209
+ if (!isNullOrUndefined(templateEle)) {
2210
+ templateGroup.appendChild(templateEle);
2211
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2212
+ _this.treemap.renderReactTemplates();
2213
+ }
2212
2214
  }
2213
2215
  itemGroup.setAttribute('aria-label', item['name']);
2214
2216
  itemGroup.setAttribute('tabindex', (_this.treemap.tabIndex + i + 2).toString());
@@ -2347,15 +2349,18 @@ var LayoutPanel = /** @__PURE__ @class */ (function () {
2347
2349
  template = template.replace(new RegExp('{{:' + keys[i] + '}}', 'g'), item['data'][keys[i].toString()]);
2348
2350
  }
2349
2351
  }
2350
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2351
- var templateFn = getTemplateFunction(template);
2352
- var templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
2353
- var labelEle = convertElement(templateElement, templateId, item['data']);
2354
- var templateSize = measureElement(labelEle, secondaryEle);
2355
- var templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
2356
- labelEle.style.left = templateLocation.x + 'px';
2357
- labelEle.style.top = templateLocation.y + 'px';
2358
- return labelEle;
2352
+ var labelElement;
2353
+ if (!isNullOrUndefined(document.getElementById(this.treemap.element.id + '_Secondary_Element'))) {
2354
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2355
+ var templateFn = getTemplateFunction(template);
2356
+ var templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
2357
+ labelElement = convertElement(templateElement, templateId, item['data']);
2358
+ var templateSize = measureElement(labelElement, secondaryEle);
2359
+ var templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
2360
+ labelElement.style.left = templateLocation.x + 'px';
2361
+ labelElement.style.top = templateLocation.y + 'px';
2362
+ }
2363
+ return labelElement;
2359
2364
  };
2360
2365
  LayoutPanel.prototype.labelInterSectAction = function (rect, text, textStyle, alignment) {
2361
2366
  var textValue;
@@ -3019,7 +3024,8 @@ var TreeMap = /** @__PURE__ @class */ (function (_super) {
3019
3024
  };
3020
3025
  TreeMap.prototype.elementChange = function () {
3021
3026
  if (this.treeMapLegendModule && this.legendSettings.visible && this.treeMapLegendModule.legendGroup && this.layout.layoutGroup
3022
- && !isNullOrUndefined(this.svgObject)) {
3027
+ && !isNullOrUndefined(this.svgObject) && !isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))
3028
+ && !isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))) {
3023
3029
  this.svgObject.insertBefore(this.layout.layoutGroup, this.treeMapLegendModule.legendGroup);
3024
3030
  }
3025
3031
  };