@topconsultnpm/sdkui-react-beta 6.15.44 → 6.15.45
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.
|
@@ -143,6 +143,26 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
143
143
|
}
|
|
144
144
|
;
|
|
145
145
|
}, []);
|
|
146
|
+
// Callback function to handle double-click events on a tree view cell
|
|
147
|
+
const onCellDblClickTreeView = useCallback((e) => {
|
|
148
|
+
// Extract the data from the clicked cell and cast it to the TreeItemDescriptor type
|
|
149
|
+
const treeItem = e.data;
|
|
150
|
+
// Get a reference to the TreeList component instance that triggered the event
|
|
151
|
+
const treeList = e.component;
|
|
152
|
+
// Get the unique key of the clicked row
|
|
153
|
+
const key = e.key;
|
|
154
|
+
// Check if the clicked item is of type Folder, row expansion state to toggle visibility of children
|
|
155
|
+
if (treeItem.type === TreeItemTypes.Folder) {
|
|
156
|
+
// If the folder row is currently expanded, collapse it
|
|
157
|
+
if (treeList.isRowExpanded(key)) {
|
|
158
|
+
treeList.collapseRow(key);
|
|
159
|
+
}
|
|
160
|
+
// If the folder row is collapsed, expand it
|
|
161
|
+
else {
|
|
162
|
+
treeList.expandRow(key);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, []);
|
|
146
166
|
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
147
167
|
if (defaultTreeId == selectedTreeId) {
|
|
148
168
|
if (layoutMode == LayoutModes.Update)
|
|
@@ -175,7 +195,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
175
195
|
}, value: selectedTreeId, opened: isGridBoxOpened, valueExpr: "id", displayExpr: "nameLoc", deferRendering: false, dataSource: trees, onValueChanged: syncDataGridSelection, onOptionChanged: onGridBoxOpened, style: { height: 30, padding: '5px' }, children: _jsx(TMDataGrid, { height: "100%", width: "100%", dataSource: trees, dataColumns: [
|
|
176
196
|
{ dataField: 'nameLoc', caption: SDKUI_Localizator.Name, width: 'auto' },
|
|
177
197
|
{ dataField: 'description', caption: SDKUI_Localizator.Description, width: 'auto' },
|
|
178
|
-
], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, onContentReady: (e) => e.component.clearSelection(), onSelectionChanged: (e) => {
|
|
198
|
+
], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, onContentReady: (e) => e.component.clearSelection(), onCellDblClick: onCellDblClickTreeView, onSelectionChanged: (e) => {
|
|
179
199
|
if (e.selectedRowsData[0] && e.selectedRowsData[0].type == TreeItemTypes.DcmtType) {
|
|
180
200
|
onSelectedTIDChanged?.(e.selectedRowsData[0].tid, selectedTreeId);
|
|
181
201
|
}
|