@topconsultnpm/sdkui-react-beta 6.13.39 → 6.13.41

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.
@@ -0,0 +1,320 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useRef, useState, Children, cloneElement, isValidElement, useEffect, useMemo, } from 'react';
3
+ import { SDKUI_Globals } from '../../helper';
4
+ export const TMPanelItem = (props) => (_jsx("div", { style: {
5
+ flexBasis: props.width || props.height || 'auto',
6
+ minWidth: props.minWidth,
7
+ minHeight: props.minHeight,
8
+ flexGrow: 0,
9
+ flexShrink: 0,
10
+ height: '100%',
11
+ width: '100%',
12
+ overflow: 'auto',
13
+ position: 'relative',
14
+ boxSizing: 'border-box',
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ ...props.style,
18
+ }, children: props.children }));
19
+ // Utility: recursively determine if a child is a group
20
+ function isGroup(child) {
21
+ return child?.type?.displayName === 'TMPanelGroup';
22
+ }
23
+ TMPanelItem.displayName = 'TMPanelItem';
24
+ export const TMPanelGroup = ({ orientation = 'horizontal', allowItemResize = false, gutters = SDKUI_Globals.userSettings.themeSettings.gutters, panelVisibility, onTogglePanel, panelLabels, children, parentVisibility = true, parentPanelCount, parentPanelVisibility, parentOnTogglePanel, path = [], ...rest }) => {
25
+ const childArray = Children.toArray(children).filter(Boolean);
26
+ const panelCount = childArray.length;
27
+ // Initial sizes in percent
28
+ const [sizes, setSizes] = useState(childArray.map((child) => orientation === 'horizontal'
29
+ ? child.props.width
30
+ ? parseFloat(child.props.width)
31
+ : 100 / panelCount
32
+ : child.props.height
33
+ ? parseFloat(child.props.height)
34
+ : 100 / panelCount));
35
+ // Compute effective visibility for each child (recursively for groups)
36
+ const effectiveVisibility = childArray.map((child, idx) => {
37
+ if (isValidElement(child) && isGroup(child)) {
38
+ // For nested groups, pass down visibility
39
+ return !panelVisibility || panelVisibility[idx];
40
+ }
41
+ return !panelVisibility || panelVisibility[idx];
42
+ });
43
+ // Recursively render children, and collect which are visible
44
+ const renderedPanels = [];
45
+ const renderedSizes = [];
46
+ const renderedPaths = [];
47
+ let accHidden = 0;
48
+ for (let i = 0; i < panelCount; i++) {
49
+ const child = childArray[i];
50
+ const visible = effectiveVisibility[i];
51
+ let childIsVisible = visible;
52
+ let renderedChild = child;
53
+ let childPath = [...path, i];
54
+ if (isValidElement(child) && isGroup(child)) {
55
+ // Recursively render group
56
+ renderedChild = cloneElement(child, {
57
+ parentVisibility: visible,
58
+ parentPanelCount: panelCount,
59
+ parentPanelVisibility: panelVisibility,
60
+ parentOnTogglePanel: parentOnTogglePanel || onTogglePanel,
61
+ path: childPath,
62
+ });
63
+ // If the group renders nothing, treat as hidden
64
+ // We'll check after rendering below
65
+ }
66
+ // For groups, check if they actually rendered anything
67
+ let actuallyVisible = childIsVisible;
68
+ if (isValidElement(child) && isGroup(child)) {
69
+ // If the group is not visible (returns null), treat as hidden
70
+ // We'll check after rendering below
71
+ // For now, optimistically add, and filter after
72
+ renderedPanels.push(renderedChild);
73
+ renderedSizes.push(sizes[i] + accHidden);
74
+ renderedPaths.push(childPath);
75
+ accHidden = 0;
76
+ }
77
+ else if (childIsVisible) {
78
+ renderedPanels.push(renderedChild);
79
+ renderedSizes.push(sizes[i] + accHidden);
80
+ renderedPaths.push(childPath);
81
+ accHidden = 0;
82
+ }
83
+ else {
84
+ accHidden += sizes[i];
85
+ }
86
+ }
87
+ // Remove panels that are null (hidden nested groups)
88
+ let filteredPanels = [];
89
+ let filteredSizes = [];
90
+ let filteredPaths = [];
91
+ let filteredAccHidden = 0;
92
+ for (let i = 0; i < renderedPanels.length; i++) {
93
+ if (renderedPanels[i] !== null && renderedPanels[i] !== undefined) {
94
+ filteredPanels.push(renderedPanels[i]);
95
+ filteredSizes.push(renderedSizes[i] + filteredAccHidden);
96
+ filteredPaths.push(renderedPaths[i]);
97
+ filteredAccHidden = 0;
98
+ }
99
+ else {
100
+ filteredAccHidden += renderedSizes[i];
101
+ }
102
+ }
103
+ // --- CORRECTED MERGING LOGIC ---
104
+ // Merge hidden panel sizes into the nearest visible sibling (prefer previous, else next)
105
+ const mergedPanels = [];
106
+ const mergedSizes = [];
107
+ const mergedPaths = [];
108
+ for (let i = 0; i < filteredPanels.length; i++) {
109
+ if (filteredPanels[i] !== null && filteredPanels[i] !== undefined) {
110
+ mergedPanels.push(filteredPanels[i]);
111
+ mergedSizes.push(filteredSizes[i]);
112
+ mergedPaths.push(filteredPaths[i]);
113
+ }
114
+ else {
115
+ // Hidden panel: merge its size into previous visible, or next if first
116
+ if (mergedPanels.length > 0) {
117
+ mergedSizes[mergedSizes.length - 1] += filteredSizes[i];
118
+ }
119
+ else {
120
+ // No previous, merge into next visible
121
+ let j = i + 1;
122
+ while (j < filteredPanels.length &&
123
+ (filteredPanels[j] === null || filteredPanels[j] === undefined)) {
124
+ j++;
125
+ }
126
+ if (j < filteredPanels.length) {
127
+ // Next visible found
128
+ if (filteredSizes[j] !== undefined) {
129
+ filteredSizes[j] += filteredSizes[i];
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ // If nothing is visible, tell parent to treat this group as hidden
136
+ if (mergedPanels.length === 0 || parentVisibility === false) {
137
+ return null;
138
+ }
139
+ // Resizing logic (same as before, but for visible panels)
140
+ const containerRef = useRef(null);
141
+ const [dragIndex, setDragIndex] = useState(null);
142
+ const [startPos, setStartPos] = useState(0);
143
+ const [startSizes, setStartSizes] = useState([]);
144
+ const handleMouseDown = (idx) => (e) => {
145
+ setDragIndex(idx);
146
+ setStartSizes([...mergedSizes]);
147
+ setStartPos(orientation === 'horizontal' ? e.clientX : e.clientY);
148
+ document.body.style.userSelect = 'none';
149
+ };
150
+ useEffect(() => {
151
+ if (dragIndex === null)
152
+ return;
153
+ const handleMouseMove = (e) => {
154
+ if (!containerRef.current)
155
+ return;
156
+ const rect = containerRef.current.getBoundingClientRect();
157
+ const total = orientation === 'horizontal' ? rect.width : rect.height;
158
+ const currentPos = orientation === 'horizontal' ? e.clientX : e.clientY;
159
+ const deltaPx = currentPos - startPos;
160
+ const deltaPercent = (deltaPx / total) * 100;
161
+ let newSizes = [...startSizes];
162
+ let left = Math.max(5, startSizes[dragIndex] + deltaPercent);
163
+ let right = Math.max(5, startSizes[dragIndex + 1] - deltaPercent);
164
+ // Prevent overflow
165
+ const sum = startSizes[dragIndex] + startSizes[dragIndex + 1];
166
+ if (left + right > sum) {
167
+ if (left > sum - 5)
168
+ left = sum - 5;
169
+ if (right > sum - 5)
170
+ right = sum - 5;
171
+ }
172
+ newSizes[dragIndex] = left;
173
+ newSizes[dragIndex + 1] = right;
174
+ // Update the original sizes array for all panels
175
+ let newAllSizes = [...sizes];
176
+ let visIdx = 0;
177
+ for (let k = 0; k < panelCount; k++) {
178
+ if (effectiveVisibility[k]) {
179
+ // Only update for visible panels
180
+ newAllSizes[k] = newSizes[visIdx++];
181
+ }
182
+ }
183
+ setSizes(newAllSizes);
184
+ };
185
+ const handleMouseUp = () => {
186
+ setDragIndex(null);
187
+ document.body.style.userSelect = '';
188
+ };
189
+ window.addEventListener('mousemove', handleMouseMove);
190
+ window.addEventListener('mouseup', handleMouseUp);
191
+ return () => {
192
+ window.removeEventListener('mousemove', handleMouseMove);
193
+ window.removeEventListener('mouseup', handleMouseUp);
194
+ };
195
+ }, [dragIndex, orientation, startPos, startSizes, effectiveVisibility, sizes, panelCount]);
196
+ return (_jsx("div", { ref: containerRef, style: {
197
+ display: 'flex',
198
+ flexDirection: orientation === 'horizontal' ? 'row' : 'column',
199
+ width: '100%',
200
+ height: '100%',
201
+ position: 'relative',
202
+ overflow: 'hidden',
203
+ gap: allowItemResize ? 0 : gutters,
204
+ }, ...rest, children: mergedPanels.map((child, idx) => (_jsxs(React.Fragment, { children: [isValidElement(child) && !isGroup(child)
205
+ ? cloneElement(child, {
206
+ style: {
207
+ ...(child.props.style || {}),
208
+ flexBasis: `${mergedSizes[idx]}%`,
209
+ height: orientation === 'vertical'
210
+ ? `${mergedSizes[idx]}%`
211
+ : '100%',
212
+ width: orientation === 'horizontal'
213
+ ? `${mergedSizes[idx]}%`
214
+ : '100%',
215
+ },
216
+ })
217
+ : child, allowItemResize && idx < mergedPanels.length - 1 && (_jsx("div", { style: {
218
+ cursor: orientation === 'horizontal'
219
+ ? 'col-resize'
220
+ : 'row-resize',
221
+ background: 'transparent',
222
+ width: orientation === 'horizontal' ? gutters : '100%',
223
+ height: orientation === 'vertical' ? gutters : '100%',
224
+ zIndex: 10,
225
+ userSelect: 'none',
226
+ flexShrink: 0,
227
+ flexGrow: 0,
228
+ borderRadius: 3,
229
+ minHeight: orientation === 'horizontal' ? '100%' : gutters,
230
+ minWidth: orientation === 'vertical' ? '100%' : gutters,
231
+ }, onMouseDown: handleMouseDown(idx) }))] }, mergedPaths[idx].join('-')))) }));
232
+ };
233
+ TMPanelGroup.displayName = 'TMPanelGroup';
234
+ function getAllPanelPaths(children, path = []) {
235
+ const arr = Children.toArray(children).filter(Boolean);
236
+ let result = [];
237
+ arr.forEach((child, idx) => {
238
+ if (isValidElement(child) && isGroup(child)) {
239
+ result = result.concat(getAllPanelPaths(child.props.children, [...path, idx]));
240
+ }
241
+ else if (isValidElement(child)) {
242
+ result.push({ label: child.props?.label || `Panel ${path.concat(idx).join('-')}`, path: path.concat(idx) });
243
+ }
244
+ });
245
+ return result;
246
+ }
247
+ const TMPanelLayout = ({ children, showToolbar = true, emptyContent, }) => {
248
+ // Only support a single TMPanelGroup as direct child for simplicity
249
+ const group = Children.only(children);
250
+ const childArray = Children.toArray(group.props.children).filter(Boolean);
251
+ // Build a flat list of all panel paths and labels for the toolbar
252
+ const allPanels = useMemo(() => getAllPanelPaths(group.props.children), [group.props.children]);
253
+ const [panelVisibility, setPanelVisibility] = useState(childArray.map(() => true));
254
+ // Helper to check if all panels (recursively) are hidden
255
+ function isAllPanelsHidden() {
256
+ // For now, just check top-level
257
+ return panelVisibility.every(v => !v);
258
+ }
259
+ // Toggle panel visibility by path (only top-level supported for now)
260
+ const handleTogglePanel = (idx) => {
261
+ setPanelVisibility((prev) => {
262
+ if (prev.filter(Boolean).length === 1 && prev[idx])
263
+ return prev;
264
+ const newArr = [...prev];
265
+ newArr[idx] = !newArr[idx];
266
+ return newArr;
267
+ });
268
+ };
269
+ // For nested: you can extend this to track nested visibility state if needed
270
+ const allHidden = isAllPanelsHidden();
271
+ return (_jsx("div", { style: {
272
+ width: '100%',
273
+ height: '100%',
274
+ position: 'relative',
275
+ overflow: 'hidden',
276
+ display: 'flex',
277
+ flexDirection: 'column',
278
+ }, children: _jsxs("div", { style: { width: '100%', height: '100%', position: 'relative' }, children: [!allHidden &&
279
+ cloneElement(group, {
280
+ panelVisibility,
281
+ onTogglePanel: handleTogglePanel,
282
+ panelLabels: allPanels.map(p => p.label),
283
+ }), showToolbar && (_jsx("div", { style: {
284
+ position: 'absolute',
285
+ top: 10,
286
+ right: 10,
287
+ zIndex: 1000,
288
+ background: 'rgba(255,255,255,0.9)',
289
+ borderRadius: 8,
290
+ boxShadow: '0 2px 8px #0002',
291
+ padding: 8,
292
+ display: 'flex',
293
+ flexDirection: 'column',
294
+ gap: 8,
295
+ }, children: _jsx(TMPanelLayoutToolbar, { panelLabels: allPanels.map(p => p.label), panelVisibility: panelVisibility, onTogglePanel: handleTogglePanel }) })), allHidden && (_jsx("div", { style: {
296
+ position: 'absolute',
297
+ left: 0,
298
+ top: 0,
299
+ width: '100%',
300
+ height: '100%',
301
+ background: '#fafbfc',
302
+ display: 'flex',
303
+ alignItems: 'center',
304
+ justifyContent: 'center',
305
+ zIndex: 1,
306
+ }, children: emptyContent || (_jsx("span", { style: { color: '#888', fontSize: 18 }, children: "No panels visible" })) }))] }) }));
307
+ };
308
+ export default TMPanelLayout;
309
+ export const TMPanelLayoutToolbar = ({ panelLabels, panelVisibility, onTogglePanel, }) => {
310
+ return (_jsx("div", { children: panelLabels.map((label, idx) => (_jsxs("button", { style: {
311
+ margin: 2,
312
+ padding: '4px 10px',
313
+ borderRadius: 4,
314
+ border: panelVisibility[idx] ? '2px solid #1976d2' : '1px solid #bbb',
315
+ background: panelVisibility[idx] ? '#1976d2' : '#eee',
316
+ color: panelVisibility[idx] ? '#fff' : '#555',
317
+ cursor: 'pointer',
318
+ opacity: 1,
319
+ }, onClick: () => onTogglePanel(idx), children: [panelVisibility[idx] ? 'Hide' : 'Show', " ", label] }, idx))) }));
320
+ };
@@ -251,3 +251,4 @@ declare const TMTidViewer: ({ tmSession, tid, showIcon, color, showId, noneSelec
251
251
  }) => import("react/jsx-runtime").JSX.Element;
252
252
  export default TMTidViewer;
253
253
  export declare const cellRenderTID: (data: DataGridTypes.ColumnCellTemplateData, noneSelectionText?: string) => import("react/jsx-runtime").JSX.Element;
254
+ export declare const renderDTDTooltipContent: (dtd: DcmtTypeDescriptor | undefined) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
3
  import { IconDcmtType, IconDcmtTypeOnlyMetadata, LocalizeArchiveConstraints, LocalizeParametricFilterTypes, SDKUI_Localizator, TMImageLibrary } from '../../helper';
4
4
  import { ArchiveConstraints, DcmtTypeListCacheService, OwnershipLevels, ParametricFilterTypes, SDK_Globals, SDK_Localizator, TemplateTIDs } from '@topconsultnpm/sdk-ts-beta';
@@ -256,15 +256,7 @@ export const TMDcmtTypeIcon = ({ dtd }) => {
256
256
  return (_jsx(TMDcmtTypeTooltip, { dtd: dtd, children: icon }));
257
257
  };
258
258
  export const TMDcmtTypeTooltip = ({ dtd, children }) => {
259
- const renderTooltipContent = (dtd) => {
260
- return (!dtd ? null
261
- : _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? dtd.nameLoc : dtd.name} (${dtd.isView ? 'VID' : 'TID'}: ${dtd.id}, RootTID: ${dtd.rootTID ?? 0})` }), dtd.description && _jsx(StyledTooltipItem, { children: dtd.description }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${SDKUI_Localizator.Yes}` }), dtd.cico && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), dtd.perm ?
262
- _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${dtd.perm.canArchive}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${dtd.perm.canView}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${dtd.perm.canSearch}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${dtd.perm.canUpdate}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${dtd.perm.canRetrieveFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${dtd.perm.canSubstFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${dtd.perm.canLogicalDelete}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${dtd.perm.canPhysicalDelete}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${dtd.perm.canReadBlog}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${dtd.perm.canWriteBlog}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.perm.canCICO}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${dtd.perm.canDelChron}` })] })
263
- : dtd.ownershipLevel == OwnershipLevels.DirectOwner || dtd.ownershipLevel == OwnershipLevels.IndirectOwner ?
264
- _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${SDKUI_Localizator.Yes}` })] })
265
- : _jsx(_Fragment, {})] }));
266
- };
267
- return (_jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMTooltip, { content: renderTooltipContent(dtd), children: children }) }));
259
+ return (_jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMTooltip, { content: renderDTDTooltipContent(dtd), children: children }) }));
268
260
  };
269
261
  const TMTidViewer = ({ tmSession, tid, showIcon = false, color, showId = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
270
262
  const [dtd, setDtd] = useState();
@@ -305,3 +297,11 @@ export default TMTidViewer;
305
297
  export const cellRenderTID = (data, noneSelectionText) => {
306
298
  return (_jsx(TMTidViewer, { tid: data.value, noneSelectionText: noneSelectionText }));
307
299
  };
300
+ export const renderDTDTooltipContent = (dtd) => {
301
+ return (!dtd ? null
302
+ : _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? dtd.nameLoc : dtd.name} (${dtd.isView ? 'VID' : 'TID'}: ${dtd.id}, RootTID: ${dtd.rootTID ?? 0})` }), dtd.description && _jsx(StyledTooltipItem, { children: dtd.description }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${SDKUI_Localizator.Yes}` }), dtd.cico && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), dtd.perm ?
303
+ _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${dtd.perm.canArchive}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${dtd.perm.canView}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${dtd.perm.canSearch}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${dtd.perm.canUpdate}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${dtd.perm.canRetrieveFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${dtd.perm.canSubstFile}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${dtd.perm.canLogicalDelete}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${dtd.perm.canPhysicalDelete}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${dtd.perm.canReadBlog}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${dtd.perm.canWriteBlog}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.perm.canCICO}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${dtd.perm.canDelChron}` })] })
304
+ : dtd.ownershipLevel == OwnershipLevels.DirectOwner || dtd.ownershipLevel == OwnershipLevels.IndirectOwner ?
305
+ _jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${SDKUI_Localizator.Yes}` })] })
306
+ : _jsx(_Fragment, {})] }));
307
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.13.39",
3
+ "version": "6.13.41",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -42,7 +42,7 @@
42
42
  "lib"
43
43
  ],
44
44
  "dependencies": {
45
- "@topconsultnpm/sdk-ts-beta": "6.13.5",
45
+ "@topconsultnpm/sdk-ts-beta": "6.13.6",
46
46
  "buffer": "^6.0.3",
47
47
  "devextreme": "24.2.6",
48
48
  "devextreme-react": "24.2.6",
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- interface ResizableGridProps {
3
- panels: React.ReactNode[];
4
- minPercents?: number[];
5
- initialPercents?: number[];
6
- }
7
- declare const ResizableGrid: React.FC<ResizableGridProps>;
8
- export default ResizableGrid;
@@ -1,58 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // ResizableGrid.tsx
3
- import React, { useRef, useState } from 'react';
4
- import { SDKUI_Globals } from '../../helper';
5
- const ResizableGrid = ({ panels, minPercents, initialPercents, }) => {
6
- const panelCount = panels.length;
7
- const defaultMinPercents = minPercents ?? Array(panelCount).fill(0.1);
8
- const [percents, setPercents] = useState(initialPercents ??
9
- Array(panelCount).fill(1 / panelCount));
10
- const containerRef = useRef(null);
11
- const handleMouseDown = (idx, e) => {
12
- e.preventDefault();
13
- const startX = e.clientX;
14
- const startPercents = [...percents];
15
- const onMouseMove = (moveEvent) => {
16
- if (!containerRef.current)
17
- return;
18
- const deltaPx = moveEvent.clientX - startX;
19
- const containerWidth = containerRef.current.offsetWidth;
20
- if (containerWidth === 0)
21
- return;
22
- const deltaPercent = deltaPx / containerWidth;
23
- let newPercents = [...startPercents];
24
- // Adjust the dragged panel and the next one
25
- newPercents[idx] = Math.max(defaultMinPercents[idx], startPercents[idx] + deltaPercent);
26
- newPercents[idx + 1] = Math.max(defaultMinPercents[idx + 1], startPercents[idx + 1] - deltaPercent);
27
- // Normalize if overflows
28
- const total = newPercents.reduce((a, b) => a + b, 0);
29
- newPercents = newPercents.map(p => p / total);
30
- setPercents(newPercents);
31
- };
32
- const onMouseUp = () => {
33
- window.removeEventListener('mousemove', onMouseMove);
34
- window.removeEventListener('mouseup', onMouseUp);
35
- };
36
- window.addEventListener('mousemove', onMouseMove);
37
- window.addEventListener('mouseup', onMouseUp);
38
- };
39
- // Build gridTemplateColumns string
40
- const gridTemplateColumns = percents
41
- .map((p, i) => `${(p * 100).toFixed(2)}%${i < panelCount - 1 ? ` ${SDKUI_Globals.userSettings.themeSettings.gutters}px` : ''}`)
42
- .join(' ');
43
- return (_jsx("div", { ref: containerRef, style: {
44
- display: 'grid',
45
- gridTemplateColumns,
46
- width: 'calc(100% - 20px)',
47
- height: '100%',
48
- position: 'relative',
49
- overflow: 'hidden',
50
- }, children: panels.map((panel, idx) => (_jsxs(React.Fragment, { children: [panel, idx < panelCount - 1 && (_jsx("div", { style: {
51
- cursor: 'col-resize',
52
- background: 'transparent',
53
- width: `${SDKUI_Globals.userSettings.themeSettings.gutters}px`,
54
- zIndex: 1,
55
- height: '100%',
56
- }, onMouseDown: e => handleMouseDown(idx, e) }))] }, idx))) }));
57
- };
58
- export default ResizableGrid;