@topconsultnpm/sdkui-react 6.20.0-dev3.19 → 6.20.0-dev3.20
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,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { IconChevronDown, IconChevronRight, SDKUI_Localizator } from '../../helper';
|
|
4
|
+
import { IconArrowLeft, IconArrowRight, IconChevronDown, IconChevronRight, SDKUI_Localizator } from '../../helper';
|
|
5
5
|
import TMButton from './TMButton';
|
|
6
6
|
const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, autoSelectChildren = true, itemsPerPage = 100, showLoadMoreButton = true }) => {
|
|
7
7
|
useEffect(() => {
|
|
@@ -350,7 +350,7 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
350
350
|
if (input) {
|
|
351
351
|
input.indeterminate = isIndeterminate(node);
|
|
352
352
|
}
|
|
353
|
-
} })), _jsx("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, onClick: (e) => { handleNodeClick(node, e); }, children: itemRender(node) })] }), node.expanded && node.items && (_jsxs("div", { style: { paddingLeft: 20, width: '100%' }, children: [renderTree(getVisibleItems(node)), needsPagination(node) && (_jsxs(StyledStickyPaginator, { children: [_jsx(TMButton, { onClick: () => handlePageChange(node.key, (node.currentPage ?? 0) - 1), showTooltip: false, caption: "\u25C4", disabled: (node.currentPage ?? 0) <= 0 }), _jsx("span", { style: { fontSize: '
|
|
353
|
+
} })), _jsx("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, onClick: (e) => { handleNodeClick(node, e); }, children: itemRender(node) })] }), node.expanded && node.items && (_jsxs("div", { style: { paddingLeft: 20, width: '100%' }, children: [renderTree(getVisibleItems(node)), needsPagination(node) && (_jsxs(StyledStickyPaginator, { children: [_jsx(TMButton, { btnStyle: 'icon', onClick: () => handlePageChange(node.key, (node.currentPage ?? 0) - 1), showTooltip: false, caption: "\u25C4", icon: _jsx(IconArrowLeft, { color: 'white' }), disabled: (node.currentPage ?? 0) <= 0 }), _jsx("span", { style: { fontSize: '11px', whiteSpace: 'nowrap', fontWeight: 500, overflow: 'hidden', textOverflow: 'ellipsis', minWidth: 0, color: 'white' }, children: SDKUI_Localizator.PaginationInfo.replaceParams((node.currentPage ?? 0) + 1, getTotalPages(node), node.items?.length ?? 0) }), _jsx(TMButton, { btnStyle: 'icon', onClick: () => handlePageChange(node.key, (node.currentPage ?? 0) + 1), showTooltip: false, caption: "\u25BA", icon: _jsx(IconArrowRight, { color: 'white' }), disabled: (node.currentPage ?? 0) >= getTotalPages(node) - 1 })] }))] }))] }, node.key)));
|
|
354
354
|
}, [handleNodeClick, handleNodeToggle, handleCheckboxChange, focusedItem, selectedItems, allowMultipleSelection, getVisibleItems, needsPagination, handlePageChange, getTotalPages]);
|
|
355
355
|
return (_jsx("div", { style: { height: '100%', width: '100%', overflowY: 'auto', overflowX: 'hidden', padding: '0px 5px 2px 2px' }, children: renderTree(dataSource) }));
|
|
356
356
|
};
|
|
@@ -378,19 +378,23 @@ export const StyledStickyPaginator = styled.div `
|
|
|
378
378
|
display: flex;
|
|
379
379
|
align-items: center;
|
|
380
380
|
justify-content: center;
|
|
381
|
-
|
|
382
|
-
margin:
|
|
383
|
-
|
|
381
|
+
width: fit-content;
|
|
382
|
+
margin: 3px auto;
|
|
383
|
+
gap: 15px;
|
|
384
|
+
padding: 4px 10px;
|
|
384
385
|
background: oklch(from var(--dx-color-primary) l c h / .85);
|
|
385
386
|
border: 1px solid oklch(from var(--dx-color-primary) l c h / .9);
|
|
386
|
-
border-radius:
|
|
387
|
-
box-shadow: 0 -
|
|
387
|
+
border-radius: 3px;
|
|
388
|
+
box-shadow: 0 -1px 4px oklch(from var(--dx-color-primary) l c h / .15);
|
|
388
389
|
transition: all 0.2s ease;
|
|
389
390
|
min-width: 0;
|
|
390
391
|
z-index: 10;
|
|
391
392
|
|
|
392
393
|
& > button {
|
|
393
394
|
flex-shrink: 0;
|
|
395
|
+
min-width: 24px !important;
|
|
396
|
+
min-height: 20px !important;
|
|
397
|
+
padding: 2px 6px !important;
|
|
394
398
|
}
|
|
395
399
|
|
|
396
400
|
& > span {
|
|
@@ -401,6 +405,6 @@ export const StyledStickyPaginator = styled.div `
|
|
|
401
405
|
&:hover {
|
|
402
406
|
background: oklch(from var(--dx-color-primary) l c h / .95);
|
|
403
407
|
border-color: oklch(from var(--dx-color-primary) l c h / 1);
|
|
404
|
-
box-shadow: 0 -
|
|
408
|
+
box-shadow: 0 -1px 6px oklch(from var(--dx-color-primary) l c h / .2);
|
|
405
409
|
}
|
|
406
410
|
`;
|