@syncfusion/ej2-treemap 34.2.2 → 34.2.3

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 34.2.2
3
+ * version : 34.2.3
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-treemap",
3
- "version": "34.2.2",
3
+ "version": "34.2.3",
4
4
  "description": "Essential JS 2 TreeMap Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -511,7 +511,17 @@ var LayoutPanel = /** @class */ (function () {
511
511
  }
512
512
  levelName = item['name'];
513
513
  }
514
- renderText = textFormatter(format, item['data'], this_1.treemap) || levelName || 'undefined';
514
+ // Use nullish coalescing (??) to preserve empty string '' (blank tile for null labelPath)
515
+ var formatterOutput = textFormatter(format, item['data'], this_1.treemap);
516
+ if (!isNullOrUndefined(formatterOutput)) {
517
+ renderText = formatterOutput;
518
+ }
519
+ else if (!isNullOrUndefined(levelName)) {
520
+ renderText = levelName;
521
+ }
522
+ else {
523
+ renderText = 'undefined';
524
+ }
515
525
  childItems = findChildren(item)['values'];
516
526
  renderText = !isLeafItem && childItems && childItems.length > 0 && this_1.treemap.enableDrillDown ?
517
527
  !item['isDrilled'] ? treeMap.enableRtl ? renderText + ' [+]' : '[+] ' + renderText :
@@ -305,21 +305,31 @@ var TreeMap = /** @class */ (function (_super) {
305
305
  if (this.isHierarchicalData && child && child.length > 0) {
306
306
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
307
307
  child.forEach(function (currentData) {
308
- if (currentData[path]) {
308
+ if (!isNullOrUndefined(currentData[_this.weightValuePath])) {
309
309
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
310
+ var labelValue = currentData[path];
311
+ var isBlank = isNullOrUndefined(labelValue) || labelValue === '';
312
+ var itemName = isBlank ? '' : labelValue;
313
+ var orderName = isBlank ?
314
+ 'undefined_' + currentData[_this.weightValuePath] : labelValue.toString();
310
315
  data_1[path].push({
311
- groupIndex: 0, name: currentData[path],
312
- levelOrderName: currentData[path].toString(),
316
+ groupIndex: 0, name: itemName,
317
+ levelOrderName: orderName,
313
318
  data: currentData, weight: currentData[_this.weightValuePath]
314
319
  });
315
320
  }
316
321
  });
317
322
  }
318
323
  else {
319
- if (this.dataSource[i][path]) {
324
+ if (!isNullOrUndefined(this.dataSource[i][this.weightValuePath])) {
320
325
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
326
+ var labelValue = this.dataSource[i][path];
327
+ var isBlank = isNullOrUndefined(labelValue) || labelValue === '';
328
+ var itemName = isBlank ? '' : labelValue;
329
+ var orderName = isBlank ?
330
+ 'undefined_' + this.dataSource[i][this.weightValuePath] : labelValue.toString();
321
331
  data_1[path].push({
322
- groupIndex: 0, name: this.dataSource[i][path], levelOrderName: this.dataSource[i][path].toString(), data: this.dataSource[i],
332
+ groupIndex: 0, name: itemName, levelOrderName: orderName, data: this.dataSource[i],
323
333
  weight: this.dataSource[i][this.weightValuePath]
324
334
  });
325
335
  }
@@ -330,7 +330,24 @@ export function isContainsData(source, pathName, processData, treemap) {
330
330
  for (var i = 0; i < source.length; i++) {
331
331
  path = treemap.levels[i] ? treemap.levels[i].groupPath : leaf.labelPath ? leaf.labelPath :
332
332
  treemap.weightValuePath;
333
- var data = processData[path] || 'undefined';
333
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
334
+ var rawValue = processData[path];
335
+ var isBlank = isNullOrUndefined(rawValue) || rawValue === '';
336
+ var data = void 0;
337
+ if (isBlank) {
338
+ if (treemap.levels && treemap.levels.length > 0) {
339
+ // Multi-level: match the '+ ""' coercion result (null -> 'null', undefined -> 'undefined')
340
+ data = isNullOrUndefined(rawValue) ? String(rawValue) : '';
341
+ }
342
+ else {
343
+ // Flat data: use the unique 'undefined_<weight>' suffix
344
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
345
+ data = 'undefined_' + processData[treemap.weightValuePath];
346
+ }
347
+ }
348
+ else {
349
+ data = rawValue.toString();
350
+ }
334
351
  if (source[i] === data) {
335
352
  name += data + (i === source.length - 1 ? '' : '#');
336
353
  if (name === pathName) {