@topconsultnpm/sdkui-react-beta 6.7.90 → 6.7.92
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.
|
@@ -34,6 +34,6 @@ const TMDropDownMenu = ({ content, items, disabled = false, color = TMColors.tex
|
|
|
34
34
|
const [id, setID] = useState('');
|
|
35
35
|
useEffect(() => { setID(genUniqueId()); }, [content]);
|
|
36
36
|
const renderItemTemplate = (itemData) => (_jsxs(StyledMenuItem, { children: [itemData.icon && _jsx("div", { style: { display: 'flex', alignItems: 'center' }, children: itemData.icon }), _jsx("span", { style: { flexGrow: 1 }, children: itemData.text }), itemData.items && _jsx("span", { className: "dx-icon-spinright dx-icon", style: { marginLeft: '10px' } })] }));
|
|
37
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledContent, { id: `idContainer${id}`, tabIndex: disabled ? -1 : 0, "$disabled": disabled, "$color": color, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, children: content }), _jsx(ContextMenu, { target: `#idContainer${id}`, dataSource: items, showEvent: 'click', itemRender: renderItemTemplate
|
|
37
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledContent, { id: `idContainer${id}`, tabIndex: disabled ? -1 : 0, "$disabled": disabled, "$color": color, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, children: content }), _jsx(ContextMenu, { target: `#idContainer${id}`, dataSource: items, showEvent: 'click', itemRender: renderItemTemplate })] }));
|
|
38
38
|
};
|
|
39
39
|
export default TMDropDownMenu;
|
|
@@ -2,12 +2,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useRef } from 'react';
|
|
3
3
|
import DropDownBox from 'devextreme-react/drop-down-box';
|
|
4
4
|
import TreeView from 'devextreme-react/tree-view';
|
|
5
|
-
import { TMTooltip } from '@topconsultnpm/sdkui-react-beta/lib';
|
|
6
5
|
import { SDKUI_Localizator } from '../../helper';
|
|
6
|
+
import TMTooltip from '../base/TMTooltip';
|
|
7
7
|
// The TMTreeDropDown functional component
|
|
8
8
|
const TMTreeDropDown = (props) => {
|
|
9
9
|
// Destructure props for easy access
|
|
10
|
-
const { dataSource, values, setValues,
|
|
10
|
+
const { dataSource, values, setValues, isValidKey, elementStyle } = props;
|
|
11
11
|
// Reference to the TreeView component for programmatic control
|
|
12
12
|
const treeViewRef = useRef(null);
|
|
13
13
|
// Helper function to get a comma-separated string of labels for the selected IDs
|
|
@@ -49,6 +49,6 @@ const TMTreeDropDown = (props) => {
|
|
|
49
49
|
filteredKeys = selectedKeys.filter(isValidKey); // If a validation function is provided, filter the selected keys
|
|
50
50
|
setValues(filteredKeys);
|
|
51
51
|
}, []);
|
|
52
|
-
return _jsx(TMTooltip, { content: getLabelsByIds(values, 'formatted'), children: _jsx(DropDownBox, { width: "100%", style: elementStyle, valueExpr: "id", displayExpr:
|
|
52
|
+
return _jsx(TMTooltip, { content: getLabelsByIds(values, 'formatted'), children: _jsx(DropDownBox, { width: "100%", style: elementStyle, valueExpr: "id", displayExpr: "label", 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) }) }) });
|
|
53
53
|
};
|
|
54
54
|
export default TMTreeDropDown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.92",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@topconsultnpm/sdk-ts-beta": "^6.7.25",
|
|
32
|
-
"@topconsultnpm/sdkui-react-beta": "^6.7.37",
|
|
33
32
|
"buffer": "^6.0.3",
|
|
34
33
|
"devextreme": "24.1.6",
|
|
35
34
|
"devextreme-react": "24.1.6",
|