@topconsultnpm/sdkui-react-beta 6.8.22 → 6.8.23

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,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  interface TMTreeDropDownProps {
3
3
  dataSource: Array<{
4
4
  id: number;
@@ -6,6 +6,7 @@ interface TMTreeDropDownProps {
6
6
  value: string;
7
7
  categoryId?: number;
8
8
  expanded?: boolean;
9
+ tooltipContent?: ReactNode;
9
10
  }>;
10
11
  values: Array<number>;
11
12
  setValues: React.Dispatch<React.SetStateAction<Array<number>>>;
@@ -54,6 +54,10 @@ const TMTreeDropDown = (props) => {
54
54
  return value.toString();
55
55
  return SDKUI_Localizator.Filters + " (" + value.length + ")";
56
56
  }, []);
57
- return _jsx(TMTooltip, { content: getLabelsByIds(values, 'formatted'), children: _jsx(DropDownBox, { width: "100%", style: elementStyle, valueExpr: "id", displayExpr: "label", displayValueFormatter: displayValueFormatter, value: values, dataSource: dataSource, placeholder: SDKUI_Localizator.SelectDesiredFilters, onContentReady: syncTreeViewSelection, focusStateEnabled: true, contentRender: () => _jsx(TreeView, { ref: treeViewRef, keyExpr: "id", dataSource: dataSource, selectByClick: true, selectNodesRecursive: true, selectionMode: "multiple", displayExpr: "label", parentIdExpr: "categoryId", dataStructure: "plain", showCheckBoxesMode: "normal", onContentReady: syncTreeViewSelection, onItemSelectionChanged: (e) => treeViewItemSelectionChanged(e) }) }) });
57
+ const renderTreeViewItem = (item) => {
58
+ // Customize how tree view items are rendered with a tooltip
59
+ return (item.tooltipContent ? _jsx(TMTooltip, { content: item.tooltipContent, children: item.label }) : item.label);
60
+ };
61
+ return _jsx(TMTooltip, { content: getLabelsByIds(values, 'formatted'), children: _jsx(DropDownBox, { width: "100%", style: elementStyle, valueExpr: "id", displayExpr: "label", displayValueFormatter: displayValueFormatter, value: values, dataSource: dataSource, placeholder: SDKUI_Localizator.SelectDesiredFilters, onContentReady: syncTreeViewSelection, focusStateEnabled: true, contentRender: () => _jsx(TreeView, { ref: treeViewRef, keyExpr: "id", dataSource: dataSource, selectByClick: true, selectNodesRecursive: true, selectionMode: "multiple", displayExpr: "label", parentIdExpr: "categoryId", dataStructure: "plain", showCheckBoxesMode: "normal", onContentReady: syncTreeViewSelection, onItemSelectionChanged: (e) => treeViewItemSelectionChanged(e), itemRender: renderTreeViewItem }) }) });
58
62
  };
59
63
  export default TMTreeDropDown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.8.22",
3
+ "version": "6.8.23",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",