@syncfusion/ej2-treemap 28.1.39 → 29.1.33

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 : 28.1.39
3
+ * version : 29.1.33
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. 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,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-treemap@*",
3
- "_id": "@syncfusion/ej2-treemap@28.1.33",
3
+ "_id": "@syncfusion/ej2-treemap@16.31.24",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-El1k0YtGfUvHSLUWCCf99WYUOuUw90LIVZMDnC8iRwBFGPoZRktjx5h6hnZjs6XmrzVtBLksINCO4Os85tloSw==",
5
+ "_integrity": "sha512-mn0RrYtSijuv3TanFqBVfP+iP4OgP20jH2TQfZkjiatRK2j1FabYn/nbdit/zZhdBSPHbDOPLuhkjcgG7FX2pQ==",
6
6
  "_location": "/@syncfusion/ej2-treemap",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,10 +23,10 @@
23
23
  "/@syncfusion/ej2-react-treemap",
24
24
  "/@syncfusion/ej2-vue-treemap"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-treemap/-/ej2-treemap-28.1.33.tgz",
27
- "_shasum": "1fac964b894760375cc3c4b74d2542bbae61ea85",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-treemap/-/ej2-treemap-16.31.24.tgz",
27
+ "_shasum": "7ae216806eb0d8d5d03adef6070b75cd25d0b8b1",
28
28
  "_spec": "@syncfusion/ej2-treemap@*",
29
- "_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
29
+ "_where": "/jenkins/workspace/elease-automation_release_29.1.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
@@ -35,12 +35,12 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~28.1.33",
39
- "@syncfusion/ej2-compression": "~28.1.33",
40
- "@syncfusion/ej2-data": "~28.1.33",
41
- "@syncfusion/ej2-file-utils": "~28.1.33",
42
- "@syncfusion/ej2-pdf-export": "~28.1.38",
43
- "@syncfusion/ej2-svg-base": "~28.1.37"
38
+ "@syncfusion/ej2-base": "~29.1.33",
39
+ "@syncfusion/ej2-compression": "~29.1.33",
40
+ "@syncfusion/ej2-data": "~29.1.33",
41
+ "@syncfusion/ej2-file-utils": "~29.1.33",
42
+ "@syncfusion/ej2-pdf-export": "~29.1.33",
43
+ "@syncfusion/ej2-svg-base": "~29.1.33"
44
44
  },
45
45
  "deprecated": false,
46
46
  "description": "Essential JS 2 TreeMap Components",
@@ -81,6 +81,6 @@
81
81
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
82
82
  },
83
83
  "typings": "index.d.ts",
84
- "version": "28.1.39",
84
+ "version": "29.1.33",
85
85
  "sideEffects": false
86
86
  }
@@ -519,7 +519,7 @@ var TreeMapLegend = /** @class */ (function () {
519
519
  legendIndex++;
520
520
  }
521
521
  for (var k = this.legendCollections.length - 1; k >= 0; k--) {
522
- if (this.legendCollections[k]['groupIndex'] === data[i]['groupIndex']) {
522
+ if (this.legendCollections[k]['actualValue'] === (colorMap.label || 'Others')) {
523
523
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
524
524
  this.legendCollections[k]['legendData'].push(data[i]);
525
525
  break;
@@ -616,7 +616,10 @@ var TreeMapLegend = /** @class */ (function () {
616
616
  var text = this.treemap.enableHtmlSanitizer ? (SanitizeHtmlHelper.sanitize(item['text'])) : item['text'];
617
617
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', text, '', '');
618
618
  renderTextElement(textOptions, textFont, textFont.color || this.treemap.themeStyle.legendTextColor, this.legendGroup);
619
- this.legendGroup.appendChild(render.drawRectangle(rectOptions));
619
+ var legendElement = render.drawRectangle(rectOptions);
620
+ legendElement.setAttribute('tabindex', this.treemap.tabIndex.toString());
621
+ legendElement.style.outline = '';
622
+ this.legendGroup.appendChild(legendElement);
620
623
  }
621
624
  }
622
625
  legendMaintain(this.treemap, this.legendGroup);
@@ -667,6 +670,8 @@ var TreeMapLegend = /** @class */ (function () {
667
670
  var legendElement = render.createGroup({ id: treemap.element.id + '_Legend_Index_' + i });
668
671
  legendElement.setAttribute('aria-label', legendText + ' Legend');
669
672
  legendElement.setAttribute('role', 'region');
673
+ legendElement.setAttribute('tabindex', this_1.treemap.tabIndex.toString());
674
+ legendElement.style.outline = 'none';
670
675
  var shapeId = treemap.element.id + '_Legend_Shape_Index_' + i;
671
676
  var textId = treemap.element.id + '_Legend_Text_Index_' + i;
672
677
  var shapeLocation = collection['Shape'];
@@ -564,10 +564,11 @@ var LayoutPanel = /** @class */ (function () {
564
564
  }
565
565
  }
566
566
  itemGroup.setAttribute('aria-label', item['name']);
567
- if ((_this.treemap.enableDrillDown && isLeafItem) || (_this.treemap.selectionSettings.enable ||
567
+ if ((_this.treemap.enableDrillDown && !isLeafItem) || (_this.treemap.selectionSettings.enable ||
568
568
  _this.treemap.highlightSettings.enable)) {
569
569
  itemGroup.setAttribute('role', 'button');
570
570
  itemGroup.setAttribute('tabindex', _this.treemap.tabIndex.toString());
571
+ itemGroup.style.outline = 'none';
571
572
  itemGroup.style.cursor = _this.treemap.highlightSettings.enable && !_this.treemap.selectionSettings.enable && (_this.treemap.enableDrillDown && item['groupIndex'] === (_this.treemap.levels.length - 1)) ? 'default' :
572
573
  _this.treemap.highlightSettings.enable && !_this.treemap.selectionSettings.enable && !_this.treemap.enableDrillDown ? 'default' : 'pointer';
573
574
  }
@@ -636,7 +636,7 @@ export declare class TreeMap extends Component<HTMLElement> implements INotifyPr
636
636
  * @returns {void}
637
637
  * @private
638
638
  */
639
- mouseEndOnTreeMap(e: PointerEvent): void;
639
+ mouseEndOnTreeMap(e: PointerEvent | KeyboardEvent): void;
640
640
  /**
641
641
  * This method handles mouse leave event in treemap.
642
642
  *
@@ -645,6 +645,31 @@ export declare class TreeMap extends Component<HTMLElement> implements INotifyPr
645
645
  * @private
646
646
  */
647
647
  mouseLeaveOnTreeMap(e: PointerEvent): void;
648
+ /**
649
+ * This method is used to perform operations when keyboard up on TreeMap.
650
+ *
651
+ * @param {KeyboardEvent} event - Specifies the keyboard event on TreeMap.
652
+ * @returns {void}
653
+ * @private
654
+ */
655
+ keyUpHandler(event: KeyboardEvent): void;
656
+ /**
657
+ * This method is used to perform operations when keyboard down on treemap.
658
+ *
659
+ * @param {KeyboardEvent} event - Specifies the keyboard event on treemap.
660
+ * @returns {void}
661
+ * @private
662
+ */
663
+ keyDownHandler(event: KeyboardEvent): void;
664
+ /**
665
+ * This method is used to perform operations when focus out on treemap.
666
+ *
667
+ * @param {KeyboardEvent} event - Specifies the keyboard event on treemap.
668
+ * @returns {void}
669
+ * @private
670
+ */
671
+ focusHandler(event: FocusEvent): void;
672
+ private removeFocus;
648
673
  /**
649
674
  * This method is used to select or remove the selection of treemap item based on the provided selection settings.
650
675
  *
@@ -608,6 +608,9 @@ var TreeMap = /** @class */ (function (_super) {
608
608
  EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnTreeMap);
609
609
  EventHandler.remove(this.element, Browser.touchEndEvent, this.mouseEndOnTreeMap);
610
610
  EventHandler.remove(this.element, 'pointerleave mouseleave', this.mouseLeaveOnTreeMap);
611
+ EventHandler.remove(this.element, 'keydown', this.keyDownHandler);
612
+ EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
613
+ EventHandler.remove(this.element, 'focusout', this.focusHandler);
611
614
  window.removeEventListener('resize', this.resizeEvent);
612
615
  };
613
616
  /**
@@ -623,6 +626,9 @@ var TreeMap = /** @class */ (function (_super) {
623
626
  EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnTreeMap, this);
624
627
  EventHandler.add(this.element, Browser.touchEndEvent, this.mouseEndOnTreeMap, this);
625
628
  EventHandler.add(this.element, 'pointerleave mouseleave', this.mouseLeaveOnTreeMap, this);
629
+ EventHandler.add(this.element, 'keydown', this.keyDownHandler, this);
630
+ EventHandler.add(this.element, 'keyup', this.keyUpHandler, this);
631
+ EventHandler.add(this.element, 'focusout', this.focusHandler, this);
626
632
  this.resizeEvent = this.resizeOnTreeMap.bind(this);
627
633
  window.addEventListener('resize', this.resizeEvent);
628
634
  };
@@ -760,6 +766,10 @@ var TreeMap = /** @class */ (function (_super) {
760
766
  if (e.target.id.indexOf('_Item_Index') > -1) {
761
767
  this.mouseDown = true;
762
768
  }
769
+ if (e.type === 'touchstart' || e.type === 'mousedown') {
770
+ this.removeFocus('none');
771
+ e.preventDefault();
772
+ }
763
773
  this.notify(Browser.touchStartEvent, e);
764
774
  };
765
775
  /**
@@ -779,6 +789,7 @@ var TreeMap = /** @class */ (function (_super) {
779
789
  this.trigger(mouseMove, moveArgs);
780
790
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
781
791
  var childItems;
792
+ this.removeFocus('none');
782
793
  if (targetId.indexOf('_Item_Index') > -1) {
783
794
  item = this.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
784
795
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1053,6 +1064,95 @@ var TreeMap = /** @class */ (function (_super) {
1053
1064
  removeLegend(this.treeMapHighlightModule.shapeHighlightCollection, this);
1054
1065
  this.treeMapHighlightModule.highLightId = '';
1055
1066
  }
1067
+ this.removeFocus('');
1068
+ };
1069
+ /**
1070
+ * This method is used to perform operations when keyboard up on TreeMap.
1071
+ *
1072
+ * @param {KeyboardEvent} event - Specifies the keyboard event on TreeMap.
1073
+ * @returns {void}
1074
+ * @private
1075
+ */
1076
+ TreeMap.prototype.keyUpHandler = function (event) {
1077
+ if (event.code !== 'Tab') {
1078
+ return;
1079
+ }
1080
+ var id = event.target['id'];
1081
+ var targetEle = document.getElementById(id);
1082
+ if ((id.indexOf('Item_Index') > -1 || id.indexOf('Legend') > -1)) {
1083
+ if (this.treeMapTooltipModule) {
1084
+ this.treeMapTooltipModule.removeTooltip();
1085
+ }
1086
+ if (this.treeMapHighlightModule && this.highlightSettings.enable) {
1087
+ targetEle.style.setProperty('outline', 'none');
1088
+ targetEle.classList.add('keyboard-focused');
1089
+ var highlightElement = id.indexOf('_Legend_') > -1 && this.legendSettings.mode === 'Default' ?
1090
+ targetEle.children[0] : targetEle;
1091
+ this.treeMapHighlightModule.highlightOnMouseMove(highlightElement);
1092
+ }
1093
+ else {
1094
+ this.removeFocus('');
1095
+ targetEle.style.outline = '2px solid black';
1096
+ targetEle.classList.add('keyboard-focused');
1097
+ }
1098
+ }
1099
+ else {
1100
+ removeClassNames(document.getElementsByClassName('treeMapHighLight'), 'treeMapHighLight', this);
1101
+ if (this.treeMapHighlightModule) {
1102
+ removeLegend(this.treeMapHighlightModule.shapeHighlightCollection, this);
1103
+ }
1104
+ this.removeFocus('none');
1105
+ }
1106
+ };
1107
+ /**
1108
+ * This method is used to perform operations when keyboard down on treemap.
1109
+ *
1110
+ * @param {KeyboardEvent} event - Specifies the keyboard event on treemap.
1111
+ * @returns {void}
1112
+ * @private
1113
+ */
1114
+ TreeMap.prototype.keyDownHandler = function (event) {
1115
+ var id = event.target['id'];
1116
+ var targetEle = document.getElementById(id);
1117
+ if (event.code === 'Enter') {
1118
+ if (this.selectionSettings.enable && (id.indexOf('Item_Index') > -1 || id.indexOf('Legend') > -1)) {
1119
+ var selectionElement = id.indexOf('_Legend_') > -1 && this.legendSettings.mode === 'Default' ?
1120
+ targetEle.children[0] : targetEle;
1121
+ this.treeMapSelectionModule.selectionOnMouseDown(selectionElement);
1122
+ }
1123
+ if (this.enableDrillDown && targetEle.childElementCount > 0) {
1124
+ this.mouseEndOnTreeMap(event);
1125
+ }
1126
+ }
1127
+ };
1128
+ /**
1129
+ * This method is used to perform operations when focus out on treemap.
1130
+ *
1131
+ * @param {KeyboardEvent} event - Specifies the keyboard event on treemap.
1132
+ * @returns {void}
1133
+ * @private
1134
+ */
1135
+ TreeMap.prototype.focusHandler = function (event) {
1136
+ var id = event.target['id'];
1137
+ if (!this.element.contains(event.relatedTarget) ||
1138
+ (id.indexOf('Item_Index') > -1 && event.relatedTarget.id.indexOf('Legend') > -1) ||
1139
+ (id.indexOf('Legend') > -1 && event.relatedTarget.id.indexOf('Item_Index') > -1)) {
1140
+ if (this.treeMapHighlightModule && this.highlightSettings.enable) {
1141
+ removeClassNames(document.getElementsByClassName('treeMapHighLight'), 'treeMapHighLight', this);
1142
+ removeLegend(this.treeMapHighlightModule.legendHighlightCollection, this);
1143
+ this.treeMapHighlightModule.highLightId = '';
1144
+ }
1145
+ else {
1146
+ this.removeFocus('none');
1147
+ }
1148
+ }
1149
+ };
1150
+ TreeMap.prototype.removeFocus = function (outline) {
1151
+ var highlightedElement = document.querySelector('.keyboard-focused');
1152
+ if (highlightedElement) {
1153
+ highlightedElement.style.outline = outline;
1154
+ highlightedElement.classList.remove('keyboard-focused');
1155
+ }
1056
1156
  };
1057
1157
  /**
1058
1158
  * This method is used to select or remove the selection of treemap item based on the provided selection settings.
@@ -13,13 +13,21 @@ export declare class TreeMapHighlight {
13
13
  currentElement: any[];
14
14
  constructor(treeMap: TreeMap);
15
15
  /**
16
- * Mouse down event in highlight
16
+ * Mouse Move event in highlight
17
17
  *
18
18
  * @param {PointerEvent} e - Specifies the pointer argument.
19
19
  * @returns {boolean} - return the highlight process is true or false.
20
20
  * @private
21
21
  */
22
- mouseMove(e: PointerEvent): boolean;
22
+ mouseMove(e: PointerEvent | KeyboardEvent): boolean;
23
+ /**
24
+ * This method highlights the target element for mouse move event.
25
+ *
26
+ * @param {Element} targetElement - Specifies the target element to highlight.
27
+ * @returns {boolean} - return the highlight process is true or false.
28
+ * @private
29
+ */
30
+ highlightOnMouseMove(targetElement: Element): boolean;
23
31
  /**
24
32
  * To bind events for highlight
25
33
  *
@@ -66,7 +74,15 @@ export declare class TreeMapSelection {
66
74
  * @returns {void}
67
75
  * @private
68
76
  */
69
- mouseDown(e: PointerEvent): void;
77
+ mouseDown(e: PointerEvent | KeyboardEvent): void;
78
+ /**
79
+ * This method selects the target element for mouse down event.
80
+ *
81
+ * @param {Element} targetEle - Specifies the target element that was clicked.
82
+ * @returns {void}
83
+ * @private
84
+ */
85
+ selectionOnMouseDown(targetEle: Element): void;
70
86
  /**
71
87
  * @param {string} levelOrder - Specifies the level order of treemap item
72
88
  * @param {boolean} enable - Specifies the boolean value