@dbcdk/react-components 0.0.5 → 0.0.7
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.
- package/dist/assets/logo.js +2 -85
- package/dist/components/__stories__/_data/table.d.ts +15 -0
- package/dist/components/__stories__/_data/table.js +49 -0
- package/dist/components/__stories__/story-components/Colors.d.ts +2 -1
- package/dist/components/__stories__/story-components/Colors.js +87 -142
- package/dist/components/__stories__/story-components/Spacing.d.ts +1 -0
- package/dist/components/__stories__/story-components/Spacing.js +58 -166
- package/dist/components/app-header/AppHeader.d.ts +4 -3
- package/dist/components/app-header/AppHeader.js +3 -6
- package/dist/components/attribute-chip/AttributeChip.d.ts +1 -0
- package/dist/components/attribute-chip/AttributeChip.js +3 -14
- package/dist/components/avatar/Avatar.d.ts +2 -2
- package/dist/components/avatar/Avatar.js +37 -71
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/dist/components/breadcrumbs/Breadcrumbs.js +4 -13
- package/dist/components/button/Button.d.ts +3 -2
- package/dist/components/button/Button.js +54 -56
- package/dist/components/button/Button.module.css +1 -1
- package/dist/components/card/Card.d.ts +8 -7
- package/dist/components/card/Card.js +19 -60
- package/dist/components/card-container/CardContainer.d.ts +3 -3
- package/dist/components/card-container/CardContainer.js +4 -16
- package/dist/components/chip/Chip.d.ts +6 -5
- package/dist/components/chip/Chip.js +14 -38
- package/dist/components/chip/Chip.module.css +9 -1
- package/dist/components/circle/Circle.d.ts +3 -2
- package/dist/components/circle/Circle.js +3 -10
- package/dist/components/clear-button/ClearButton.d.ts +2 -1
- package/dist/components/clear-button/ClearButton.js +6 -17
- package/dist/components/code-block/CodeBlock.d.ts +1 -0
- package/dist/components/code-block/CodeBlock.js +4 -10
- package/dist/components/copy-button/CopyButton.d.ts +4 -3
- package/dist/components/copy-button/CopyButton.js +19 -26
- package/dist/components/datetime-picker/DateTimePicker.d.ts +8 -5
- package/dist/components/datetime-picker/DateTimePicker.js +262 -475
- package/dist/components/datetime-picker/dateTimeHelpers.d.ts +13 -0
- package/dist/components/datetime-picker/dateTimeHelpers.js +119 -0
- package/dist/components/filter-field/FilterField.d.ts +5 -2
- package/dist/components/filter-field/FilterField.js +130 -173
- package/dist/components/filter-field/FilterField.module.css +21 -5
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.d.ts +36 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +53 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +60 -0
- package/dist/components/forms/checkbox/Checkbox.d.ts +31 -0
- package/dist/components/forms/checkbox/Checkbox.js +27 -0
- package/dist/components/{checkbox → forms/checkbox}/Checkbox.module.css +0 -1
- package/dist/components/forms/checkbox-group/CheckboxGroup.d.ts +47 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +75 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
- package/dist/components/{input → forms/input}/Input.d.ts +9 -5
- package/dist/components/forms/input/Input.js +70 -0
- package/dist/components/{input → forms/input}/Input.module.css +1 -0
- package/dist/components/forms/input-container/InputContainer.d.ts +15 -0
- package/dist/components/forms/input-container/InputContainer.js +15 -0
- package/dist/components/forms/input-container/InputContainer.module.css +34 -0
- package/dist/components/forms/multi-select/MultiSelect.d.ts +20 -0
- package/dist/components/forms/multi-select/MultiSelect.js +19 -0
- package/dist/components/forms/select/Select.d.ts +21 -0
- package/dist/components/forms/select/Select.js +94 -0
- package/dist/components/forms/text-area/Textarea.d.ts +17 -0
- package/dist/components/forms/text-area/Textarea.js +33 -0
- package/dist/components/forms/text-area/Textarea.module.css +26 -0
- package/dist/components/headline/Headline.js +18 -43
- package/dist/components/{link/Link.d.ts → hyperlink/Hyperlink.d.ts} +2 -2
- package/dist/components/hyperlink/Hyperlink.js +11 -0
- package/dist/components/{link/Link.module.css → hyperlink/Hyperlink.module.css} +5 -14
- package/dist/components/icon/Icon.d.ts +4 -3
- package/dist/components/icon/Icon.js +11 -17
- package/dist/components/interval-select/IntervalSelect.d.ts +30 -0
- package/dist/components/interval-select/IntervalSelect.js +82 -0
- package/dist/components/menu/Menu.js +25 -67
- package/dist/components/meta-bar/MetaBar.d.ts +4 -4
- package/dist/components/meta-bar/MetaBar.js +7 -20
- package/dist/components/nav-bar/NavBar.d.ts +5 -5
- package/dist/components/nav-bar/NavBar.js +15 -45
- package/dist/components/{modal → overlay/modal}/Modal.d.ts +4 -2
- package/dist/components/overlay/modal/Modal.js +92 -0
- package/dist/components/{modal → overlay/modal}/provider/ModalProvider.d.ts +0 -1
- package/dist/components/overlay/modal/provider/ModalProvider.js +70 -0
- package/dist/components/overlay/side-panel/SidePanel.d.ts +16 -0
- package/dist/components/overlay/side-panel/SidePanel.js +10 -0
- package/dist/components/overlay/side-panel/SidePanel.module.css +56 -0
- package/dist/components/overlay/side-panel/useSidePanel.d.ts +5 -0
- package/dist/components/overlay/side-panel/useSidePanel.js +11 -0
- package/dist/components/overlay/tooltip/Tooltip.d.ts +13 -0
- package/dist/components/overlay/tooltip/Tooltip.js +17 -0
- package/dist/components/overlay/tooltip/Tooltip.module.css +106 -0
- package/dist/components/overlay/tooltip/TooltipProvider.d.ts +20 -0
- package/dist/components/overlay/tooltip/TooltipProvider.js +244 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.d.ts +24 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +108 -0
- package/dist/components/page/Page.d.ts +7 -6
- package/dist/components/page/Page.js +4 -21
- package/dist/components/page-layout/PageLayout.d.ts +11 -12
- package/dist/components/page-layout/PageLayout.js +35 -71
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.js +4 -22
- package/dist/components/pagination/Pagination.d.ts +2 -1
- package/dist/components/pagination/Pagination.js +38 -121
- package/dist/components/panel/Panel.d.ts +4 -3
- package/dist/components/panel/Panel.js +5 -10
- package/dist/components/popover/Popover.d.ts +1 -0
- package/dist/components/popover/Popover.js +116 -141
- package/dist/components/search-box/SearchBox.d.ts +2 -2
- package/dist/components/search-box/SearchBox.js +112 -162
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +1 -1
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +47 -94
- package/dist/components/sidebar/Sidebar.d.ts +1 -0
- package/dist/components/sidebar/Sidebar.js +5 -7
- package/dist/components/sidebar/components/SidebarItem.js +6 -14
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +1 -1
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +48 -88
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +3 -2
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +11 -41
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +1 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +4 -25
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +9 -23
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +19 -40
- package/dist/components/sidebar/providers/SidebarProvider.d.ts +2 -1
- package/dist/components/sidebar/providers/SidebarProvider.js +182 -165
- package/dist/components/skeleton-loader/SkeletonLoader.js +68 -266
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +11 -34
- package/dist/components/split-button/SplitButton.d.ts +7 -5
- package/dist/components/split-button/SplitButton.js +4 -27
- package/dist/components/split-pane/SplitPane.js +69 -105
- package/dist/components/split-pane/provider/SplitPaneContext.js +77 -71
- package/dist/components/table/Table.d.ts +9 -7
- package/dist/components/table/Table.js +115 -238
- package/dist/components/table/Table.module.css +5 -1
- package/dist/components/table/components/column-resizer/ColumnResizer.js +4 -15
- package/dist/components/table/components/empty-state/EmptyState.d.ts +6 -5
- package/dist/components/table/components/empty-state/EmptyState.js +22 -41
- package/dist/components/table/components/table-settings/TableSettings.d.ts +2 -1
- package/dist/components/table/components/table-settings/TableSettings.js +9 -27
- package/dist/components/table/tanstack.d.ts +1 -1
- package/dist/components/table/tanstack.js +154 -160
- package/dist/components/tabs/Tabs.d.ts +1 -0
- package/dist/components/tabs/Tabs.js +32 -81
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +4 -37
- package/dist/components/toast/Toast.module.css +1 -0
- package/dist/components/toast/provider/ToastProvider.d.ts +1 -1
- package/dist/components/toast/provider/ToastProvider.js +60 -87
- package/dist/components/user-display/UserDisplay.d.ts +2 -1
- package/dist/components/user-display/UserDisplay.js +4 -20
- package/dist/constants/severity.d.ts +1 -1
- package/dist/constants/severity.js +14 -16
- package/dist/constants/severity.types.d.ts +1 -1
- package/dist/constants/severity.types.js +1 -1
- package/dist/constants/sizes.js +6 -8
- package/dist/hooks/usePagination.d.ts +1 -1
- package/dist/hooks/usePagination.js +75 -82
- package/dist/hooks/useSorting.js +112 -110
- package/dist/hooks/useTableData.d.ts +1 -1
- package/dist/hooks/useTableData.js +42 -47
- package/dist/hooks/useTableSelection.js +121 -121
- package/dist/hooks/useTableSettings.js +23 -25
- package/dist/hooks/useTheme.d.ts +3 -7
- package/dist/hooks/useTheme.js +52 -47
- package/dist/hooks/useTimeDuration.d.ts +2 -2
- package/dist/hooks/useTimeDuration.js +33 -34
- package/dist/hooks/useViewportFill.d.ts +3 -2
- package/dist/hooks/useViewportFill.js +55 -48
- package/dist/index.d.ts +17 -8
- package/dist/index.js +18 -8
- package/dist/src/styles/styles.css +3 -3
- package/dist/styles/css-helper-classes/flex.css +4 -0
- package/dist/styles/styles.css +3 -3
- package/dist/styles/themes/dbc/dark.css +1 -1
- package/dist/styles/themes/dbc/light.css +2 -1
- package/dist/styles/themes/forfatterweb/light.css +1 -1
- package/dist/styles/themes/types.js +1 -1
- package/dist/types/a11y-props.types.d.ts +5 -5
- package/dist/types/a11y-props.types.js +1 -1
- package/dist/types/sizes.types.js +1 -1
- package/dist/utils/arrays/nested-filtering.js +43 -33
- package/dist/utils/date/formatDate.js +25 -16
- package/package.json +18 -9
- package/dist/assets/logo.cjs +0 -87
- package/dist/components/__stories__/story-components/Colors.cjs +0 -159
- package/dist/components/__stories__/story-components/Spacing.cjs +0 -190
- package/dist/components/app-header/AppHeader.cjs +0 -14
- package/dist/components/attribute-chip/AttributeChip.cjs +0 -22
- package/dist/components/avatar/Avatar.cjs +0 -101
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +0 -22
- package/dist/components/button/Button.cjs +0 -87
- package/dist/components/card/Card.cjs +0 -69
- package/dist/components/card-container/CardContainer.cjs +0 -24
- package/dist/components/checkbox/Checkbox.cjs +0 -42
- package/dist/components/checkbox/Checkbox.d.ts +0 -12
- package/dist/components/checkbox/Checkbox.js +0 -36
- package/dist/components/chip/Chip.cjs +0 -50
- package/dist/components/circle/Circle.cjs +0 -18
- package/dist/components/clear-button/ClearButton.cjs +0 -26
- package/dist/components/code-block/CodeBlock.cjs +0 -18
- package/dist/components/copy-button/CopyButton.cjs +0 -35
- package/dist/components/datetime-picker/DateTimePicker.cjs +0 -504
- package/dist/components/filter-field/FilterField.cjs +0 -189
- package/dist/components/headline/Headline.cjs +0 -53
- package/dist/components/icon/Icon.cjs +0 -27
- package/dist/components/input/Input.cjs +0 -89
- package/dist/components/input/Input.js +0 -83
- package/dist/components/link/Link.cjs +0 -46
- package/dist/components/link/Link.js +0 -21
- package/dist/components/menu/Menu.cjs +0 -96
- package/dist/components/meta-bar/MetaBar.cjs +0 -29
- package/dist/components/modal/Modal.cjs +0 -134
- package/dist/components/modal/Modal.js +0 -128
- package/dist/components/modal/provider/ModalProvider.cjs +0 -80
- package/dist/components/modal/provider/ModalProvider.js +0 -77
- package/dist/components/multi-select/MultiSelect.cjs +0 -59
- package/dist/components/multi-select/MultiSelect.d.ts +0 -18
- package/dist/components/multi-select/MultiSelect.js +0 -57
- package/dist/components/nav-bar/NavBar.cjs +0 -55
- package/dist/components/page/Page.cjs +0 -30
- package/dist/components/page-layout/PageLayout.cjs +0 -84
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.cjs +0 -32
- package/dist/components/pagination/Pagination.cjs +0 -133
- package/dist/components/panel/Panel.cjs +0 -18
- package/dist/components/popover/Popover.cjs +0 -149
- package/dist/components/search-box/SearchBox.cjs +0 -175
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +0 -103
- package/dist/components/select/Select.cjs +0 -121
- package/dist/components/select/Select.d.ts +0 -12
- package/dist/components/select/Select.js +0 -119
- package/dist/components/sidebar/Sidebar.cjs +0 -11
- package/dist/components/sidebar/components/SidebarItem.cjs +0 -18
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +0 -100
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +0 -50
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +0 -34
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +0 -29
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +0 -52
- package/dist/components/sidebar/providers/SidebarProvider.cjs +0 -179
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +0 -270
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +0 -42
- package/dist/components/split-button/SplitButton.cjs +0 -37
- package/dist/components/split-pane/SplitPane.cjs +0 -123
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +0 -87
- package/dist/components/table/Table.cjs +0 -249
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +0 -22
- package/dist/components/table/components/empty-state/EmptyState.cjs +0 -52
- package/dist/components/table/components/table-settings/TableSettings.cjs +0 -32
- package/dist/components/table/tanstack.cjs +0 -193
- package/dist/components/tabs/Tabs.cjs +0 -90
- package/dist/components/text-area/Textarea.cjs +0 -62
- package/dist/components/text-area/Textarea.d.ts +0 -14
- package/dist/components/text-area/Textarea.js +0 -56
- package/dist/components/text-area/Textarea.module.css +0 -3
- package/dist/components/toast/Toast.cjs +0 -47
- package/dist/components/toast/provider/ToastProvider.cjs +0 -98
- package/dist/components/tooltip/Tooltip.cjs +0 -183
- package/dist/components/tooltip/Tooltip.d.ts +0 -11
- package/dist/components/tooltip/Tooltip.js +0 -177
- package/dist/components/tooltip/Tooltip.module.css +0 -66
- package/dist/components/user-display/UserDisplay.cjs +0 -28
- package/dist/constants/severity.cjs +0 -21
- package/dist/constants/severity.types.cjs +0 -2
- package/dist/constants/sizes.cjs +0 -11
- package/dist/hooks/usePagination.cjs +0 -88
- package/dist/hooks/useSorting.cjs +0 -118
- package/dist/hooks/useTableData.cjs +0 -52
- package/dist/hooks/useTableSelection.cjs +0 -130
- package/dist/hooks/useTableSettings.cjs +0 -28
- package/dist/hooks/useTheme.cjs +0 -58
- package/dist/hooks/useTimeDuration.cjs +0 -39
- package/dist/hooks/useViewportFill.cjs +0 -52
- package/dist/index.cjs +0 -383
- package/dist/styles/themes/types.cjs +0 -2
- package/dist/types/a11y-props.types.cjs +0 -2
- package/dist/types/assets.d.cjs +0 -2
- package/dist/types/assets.d.js +0 -1
- package/dist/types/css.d.cjs +0 -2
- package/dist/types/css.d.js +0 -1
- package/dist/types/sizes.types.cjs +0 -2
- package/dist/utils/arrays/nested-filtering.cjs +0 -40
- package/dist/utils/date/formatDate.cjs +0 -19
- /package/dist/components/{modal → overlay/modal}/Modal.module.css +0 -0
|
@@ -1,79 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const SplitPaneContext = React.createContext(null);
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
export const SplitPaneContext = React.createContext(null);
|
|
5
5
|
function clamp(n, min, max) {
|
|
6
|
-
|
|
6
|
+
return Math.max(min, Math.min(max, n));
|
|
7
7
|
}
|
|
8
8
|
function readStoredSize(key) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
try {
|
|
10
|
+
const raw = localStorage.getItem(key);
|
|
11
|
+
if (!raw)
|
|
12
|
+
return null;
|
|
13
|
+
const num = Number(raw);
|
|
14
|
+
return Number.isFinite(num) ? num : null;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
function writeStoredSize(key, value) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
try {
|
|
22
|
+
localStorage.setItem(key, String(Math.round(value)));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
// ignore (private mode, disabled storage, etc.)
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
|
-
function useSplitPaneContext() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
export function useSplitPaneContext() {
|
|
29
|
+
const ctx = React.useContext(SplitPaneContext);
|
|
30
|
+
if (!ctx)
|
|
31
|
+
throw new Error('SplitPane components must be used within <SplitPane />');
|
|
32
|
+
return ctx;
|
|
28
33
|
}
|
|
29
|
-
function SplitPaneProvider({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
() =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
34
|
+
export function SplitPaneProvider({ children, direction, initialPrimarySize, minPrimarySize, minSecondarySize, storageKey, }) {
|
|
35
|
+
const containerRef = useRef(null);
|
|
36
|
+
/**
|
|
37
|
+
* IMPORTANT (Next.js hydration):
|
|
38
|
+
* Always start with initialPrimarySize so server HTML and first client render match.
|
|
39
|
+
* Then, after hydration, read localStorage and update.
|
|
40
|
+
*/
|
|
41
|
+
const [primarySize, setPrimarySize] = useState(initialPrimarySize);
|
|
42
|
+
// Apply persisted size AFTER hydration (prevents SSR/client mismatch warnings)
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!storageKey)
|
|
45
|
+
return;
|
|
46
|
+
const stored = readStoredSize(storageKey);
|
|
47
|
+
if (stored === null)
|
|
48
|
+
return;
|
|
49
|
+
setPrimarySize(stored);
|
|
50
|
+
}, [storageKey]);
|
|
51
|
+
// Clamp after mount / when container is measurable; re-clamp on resize
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const el = containerRef.current;
|
|
54
|
+
if (!el)
|
|
55
|
+
return;
|
|
56
|
+
const clampToContainer = () => {
|
|
57
|
+
const rect = el.getBoundingClientRect();
|
|
58
|
+
const total = direction === 'horizontal' ? rect.width : rect.height;
|
|
59
|
+
if (!Number.isFinite(total) || total <= 0)
|
|
60
|
+
return;
|
|
61
|
+
const maxPrimary = Math.max(minPrimarySize, total - minSecondarySize);
|
|
62
|
+
setPrimarySize(prev => clamp(prev, minPrimarySize, maxPrimary));
|
|
63
|
+
};
|
|
64
|
+
clampToContainer();
|
|
65
|
+
const ro = new ResizeObserver(() => clampToContainer());
|
|
66
|
+
ro.observe(el);
|
|
67
|
+
return () => ro.disconnect();
|
|
68
|
+
}, [direction, minPrimarySize, minSecondarySize]);
|
|
69
|
+
// Persist on change
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!storageKey)
|
|
72
|
+
return;
|
|
73
|
+
writeStoredSize(storageKey, primarySize);
|
|
74
|
+
}, [storageKey, primarySize]);
|
|
75
|
+
const value = useMemo(() => ({
|
|
76
|
+
direction,
|
|
77
|
+
primarySize,
|
|
78
|
+
setPrimarySize,
|
|
79
|
+
minPrimarySize,
|
|
80
|
+
minSecondarySize,
|
|
81
|
+
containerRef,
|
|
82
|
+
storageKey,
|
|
83
|
+
}), [direction, primarySize, minPrimarySize, minSecondarySize, storageKey]);
|
|
84
|
+
return _jsx(SplitPaneContext.Provider, { value: value, children: children });
|
|
77
85
|
}
|
|
78
|
-
|
|
79
|
-
export { SplitPaneContext, SplitPaneProvider, useSplitPaneContext };
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { JSX, ReactNode } from 'react';
|
|
3
3
|
import { Severity } from '../../constants/severity.types';
|
|
4
|
-
import {
|
|
4
|
+
import { PageChangeEvent } from '../../components/pagination/Pagination';
|
|
5
|
+
import { ViewMode } from '../../hooks/useTableSettings';
|
|
5
6
|
import { TableEmptyConfig } from './components/empty-state/EmptyState';
|
|
6
7
|
type SortDirection = 'asc' | 'desc' | null;
|
|
7
8
|
export interface ColumnItem<T> {
|
|
8
9
|
id: string;
|
|
9
|
-
header: string | (() =>
|
|
10
|
+
header: string | (() => ReactNode);
|
|
10
11
|
accessor?: keyof T;
|
|
11
12
|
sortable?: boolean;
|
|
12
13
|
sortFunction?: (a: T, b: T) => -1 | 0 | 1;
|
|
13
|
-
render?: (item: T) =>
|
|
14
|
+
render?: (item: T) => ReactNode;
|
|
14
15
|
hidden?: boolean;
|
|
15
16
|
align?: 'left' | 'right' | 'center';
|
|
16
17
|
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
17
18
|
fitContent?: boolean;
|
|
18
19
|
allowWrap?: boolean;
|
|
19
|
-
emptyPlaceholder?:
|
|
20
|
+
emptyPlaceholder?: ReactNode;
|
|
21
|
+
width?: number | string;
|
|
20
22
|
}
|
|
21
23
|
type HeaderExtrasArgs<T> = {
|
|
22
24
|
column: ColumnItem<T>;
|
|
@@ -37,9 +39,9 @@ export interface TableProps<T extends Record<string, any>> {
|
|
|
37
39
|
sortById?: string;
|
|
38
40
|
sortDirection?: SortDirection;
|
|
39
41
|
loading?: boolean;
|
|
40
|
-
headerExtras?: (args: HeaderExtrasArgs<T>) =>
|
|
42
|
+
headerExtras?: (args: HeaderExtrasArgs<T>) => ReactNode;
|
|
41
43
|
columnStyles?: Partial<Record<string, React.CSSProperties>>;
|
|
42
|
-
headerBelowRow?:
|
|
44
|
+
headerBelowRow?: ReactNode;
|
|
43
45
|
striped?: boolean;
|
|
44
46
|
fillViewport?: boolean;
|
|
45
47
|
viewportBottomOffset?: number;
|
|
@@ -1,243 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import styles from './Table.module.css';
|
|
6
|
-
import { useViewportFill } from '../../hooks/useViewportFill';
|
|
7
|
-
import { Pagination } from '../pagination/Pagination';
|
|
8
|
-
import { SkeletonLoaderItem } from '../skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowDown, ArrowUp } from 'lucide-react';
|
|
4
|
+
import { useCallback, useMemo, useRef } from 'react';
|
|
9
5
|
import { SeverityBgColor } from '../../constants/severity';
|
|
6
|
+
import { useViewportFill } from '../../hooks/useViewportFill';
|
|
7
|
+
import { Checkbox } from '../../components/forms/checkbox/Checkbox';
|
|
8
|
+
import { Pagination } from '../../components/pagination/Pagination';
|
|
9
|
+
import { SkeletonLoaderItem } from '../../components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
|
|
10
10
|
import { TableEmptyState } from './components/empty-state/EmptyState';
|
|
11
|
-
|
|
12
|
-
function Table({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
fillViewport = false,
|
|
28
|
-
viewportBottomOffset = 0,
|
|
29
|
-
viewportMin = 120,
|
|
30
|
-
viewportIncludeMarginTop = false,
|
|
31
|
-
take,
|
|
32
|
-
skip,
|
|
33
|
-
paginationPlacement = "bottom",
|
|
34
|
-
totalItemsCount,
|
|
35
|
-
onPageChange,
|
|
36
|
-
loading,
|
|
37
|
-
variant = "primary",
|
|
38
|
-
size = "md",
|
|
39
|
-
getRowSeverity,
|
|
40
|
-
showFirstLast = false,
|
|
41
|
-
allRowsSelected,
|
|
42
|
-
onSelectAllRows,
|
|
43
|
-
viewMode,
|
|
44
|
-
emptyConfig
|
|
45
|
-
}) {
|
|
46
|
-
const filteredColumns = useMemo(() => columns.filter((c) => !c.hidden), [columns]);
|
|
47
|
-
const handlePageChange = useCallback(
|
|
48
|
-
(e) => {
|
|
49
|
-
onPageChange == null ? void 0 : onPageChange(e);
|
|
50
|
-
},
|
|
51
|
-
[onPageChange]
|
|
52
|
-
);
|
|
53
|
-
const getColStyle = (columnId, alignment, verticalAlignment) => {
|
|
54
|
-
const baseStyle = columnStyles == null ? void 0 : columnStyles[columnId];
|
|
55
|
-
return {
|
|
56
|
-
...baseStyle != null ? baseStyle : {},
|
|
57
|
-
...alignment === "right" && { fontVariantNumeric: "tabular-nums" },
|
|
58
|
-
verticalAlign: verticalAlignment != null ? verticalAlignment : "top",
|
|
59
|
-
textAlign: alignment != null ? alignment : "left"
|
|
11
|
+
import styles from './Table.module.css';
|
|
12
|
+
export function Table({ data, columns, selectedRows, onRowSelect, selectionMode = 'single', onSortChange, onRowClick, sortById, sortDirection, dataKey, headerExtras, columnStyles, headerBelowRow, striped, fillViewport = false, viewportBottomOffset = 0, viewportMin = 120, viewportIncludeMarginTop = false, take, skip, paginationPlacement = 'bottom', totalItemsCount, onPageChange, loading, variant = 'primary', size = 'md', getRowSeverity, showFirstLast = false, allRowsSelected, onSelectAllRows, viewMode, emptyConfig, }) {
|
|
13
|
+
const filteredColumns = useMemo(() => columns.filter(c => !c.hidden), [columns]);
|
|
14
|
+
const handlePageChange = useCallback((e) => {
|
|
15
|
+
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(e);
|
|
16
|
+
}, [onPageChange]);
|
|
17
|
+
const getColStyle = (columnId, alignment, verticalAlignment, width) => {
|
|
18
|
+
const baseStyle = columnStyles === null || columnStyles === void 0 ? void 0 : columnStyles[columnId];
|
|
19
|
+
return {
|
|
20
|
+
...(baseStyle !== null && baseStyle !== void 0 ? baseStyle : {}),
|
|
21
|
+
...(alignment === 'right' && { fontVariantNumeric: 'tabular-nums' }),
|
|
22
|
+
verticalAlign: verticalAlignment !== null && verticalAlignment !== void 0 ? verticalAlignment : 'top',
|
|
23
|
+
textAlign: alignment !== null && alignment !== void 0 ? alignment : 'left',
|
|
24
|
+
width: width !== null && width !== void 0 ? width : baseStyle === null || baseStyle === void 0 ? void 0 : baseStyle.width,
|
|
25
|
+
minWidth: width !== null && width !== void 0 ? width : baseStyle === null || baseStyle === void 0 ? void 0 : baseStyle.minWidth,
|
|
26
|
+
};
|
|
60
27
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
e.stopPropagation();
|
|
146
|
-
const isSelected = selectedRows.has(rowId);
|
|
147
|
-
if (selectionMode === "single") {
|
|
148
|
-
onRowSelect(rowId, !isSelected);
|
|
149
|
-
} else {
|
|
150
|
-
onRowSelect(rowId, !isSelected);
|
|
151
|
-
}
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
onRowClick == null ? void 0 : onRowClick(row);
|
|
155
|
-
},
|
|
156
|
-
style: {
|
|
157
|
-
["--row-severity-color"]: rowSeverity ? SeverityBgColor[rowSeverity] : void 0
|
|
158
|
-
},
|
|
159
|
-
className: `${onRowClick ? styles.clickableRow : ""} ${(selectedRows == null ? void 0 : selectedRows.has(row[dataKey])) ? styles.selectedRow : ""} ${rowSeverity ? styles.severity : ""}`,
|
|
160
|
-
children: [
|
|
161
|
-
selectedRows && dataKey && /* @__PURE__ */ jsx("td", { className: "fitContent", onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
162
|
-
Checkbox,
|
|
163
|
-
{
|
|
164
|
-
variant: "primary",
|
|
165
|
-
checked: selectedRows.has(row[dataKey]),
|
|
166
|
-
size: "sm",
|
|
167
|
-
onChange: () => onRowSelect == null ? void 0 : onRowSelect(row[dataKey], !selectedRows.has(row[dataKey]))
|
|
168
|
-
}
|
|
169
|
-
) }),
|
|
170
|
-
filteredColumns.map((column) => {
|
|
171
|
-
var _a, _b;
|
|
172
|
-
return /* @__PURE__ */ jsx(
|
|
173
|
-
"td",
|
|
174
|
-
{
|
|
175
|
-
style: getColStyle(column.id, column.align, column.verticalAlign),
|
|
176
|
-
className: `${styles.tableCell} ${column.fitContent ? "fitContent" : ""} ${column.allowWrap || (selectedRows == null ? void 0 : selectedRows.has(row[dataKey])) || viewMode === "comfortable" ? "" : styles.nowrap} `,
|
|
177
|
-
children: column.render ? column.render(row) || ((_a = column.emptyPlaceholder) != null ? _a : "") : column.accessor ? row[column.accessor] || ((_b = column.emptyPlaceholder) != null ? _b : "") : null
|
|
178
|
-
},
|
|
179
|
-
column.id
|
|
180
|
-
);
|
|
181
|
-
})
|
|
182
|
-
]
|
|
183
|
-
},
|
|
184
|
-
`tableRow-${String(row[dataKey])}-${rowIndex}`
|
|
185
|
-
);
|
|
186
|
-
}) })
|
|
187
|
-
] }),
|
|
188
|
-
!data.length && /* @__PURE__ */ jsx(TableEmptyState, { config: emptyConfig })
|
|
189
|
-
] });
|
|
190
|
-
if (fillViewport) {
|
|
191
|
-
return /* @__PURE__ */ jsxs(
|
|
192
|
-
"div",
|
|
193
|
-
{
|
|
194
|
-
style: {
|
|
195
|
-
display: "flex",
|
|
196
|
-
flexDirection: "column",
|
|
197
|
-
gap: "20px",
|
|
198
|
-
flexFlow: paginationPlacement === "top" ? "column-reverse" : "column",
|
|
199
|
-
position: "relative"
|
|
200
|
-
},
|
|
201
|
-
children: [
|
|
202
|
-
/* @__PURE__ */ jsx("div", { ref: scrollRef, style: viewportStyle, className: styles.tableScroll, children: tableEl }),
|
|
203
|
-
onPageChange && /* @__PURE__ */ jsx(
|
|
204
|
-
Pagination,
|
|
205
|
-
{
|
|
206
|
-
itemsCount: totalItemsCount,
|
|
207
|
-
take,
|
|
208
|
-
skip,
|
|
209
|
-
onPageChange: handlePageChange,
|
|
210
|
-
showFirstLast
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
]
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
return /* @__PURE__ */ jsxs(
|
|
218
|
-
"div",
|
|
219
|
-
{
|
|
220
|
-
style: {
|
|
221
|
-
display: "flex",
|
|
222
|
-
flexDirection: "column",
|
|
223
|
-
gap: "20px",
|
|
224
|
-
flexFlow: paginationPlacement === "top" ? "column-reverse" : "column",
|
|
225
|
-
position: "relative"
|
|
226
|
-
},
|
|
227
|
-
children: [
|
|
228
|
-
tableEl,
|
|
229
|
-
onPageChange && /* @__PURE__ */ jsx(
|
|
230
|
-
Pagination,
|
|
231
|
-
{
|
|
232
|
-
itemsCount: totalItemsCount,
|
|
233
|
-
take,
|
|
234
|
-
skip,
|
|
235
|
-
onPageChange: handlePageChange
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
]
|
|
28
|
+
const scrollRef = useRef(null);
|
|
29
|
+
const { style: viewportStyle } = useViewportFill(scrollRef, {
|
|
30
|
+
bottomOffset: viewportBottomOffset + 60,
|
|
31
|
+
min: viewportMin,
|
|
32
|
+
includeMarginTop: viewportIncludeMarginTop,
|
|
33
|
+
});
|
|
34
|
+
const tableEl = (_jsxs(_Fragment, { children: [_jsxs("table", { className: `${styles.table} ${styles[variant]} ${styles[size]}`, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [selectedRows && onRowSelect && dataKey && (_jsx("th", { className: `${styles.fitContent} ${styles.th}`, children: selectionMode === 'multiple' ? (_jsx(Checkbox, { size: "sm", variant: "primary", checked: allRowsSelected, onChange: checked => onSelectAllRows === null || onSelectAllRows === void 0 ? void 0 : onSelectAllRows(checked) })) : null })), filteredColumns.map((column, index) => {
|
|
35
|
+
const isActiveSort = sortById === column.id;
|
|
36
|
+
const ariaSort = column.sortable && isActiveSort
|
|
37
|
+
? sortDirection === 'asc'
|
|
38
|
+
? 'ascending'
|
|
39
|
+
: 'descending'
|
|
40
|
+
: 'none';
|
|
41
|
+
const toggleSort = () => {
|
|
42
|
+
if (!onSortChange || !column.sortable)
|
|
43
|
+
return;
|
|
44
|
+
const nextDir = !isActiveSort
|
|
45
|
+
? 'asc'
|
|
46
|
+
: sortDirection === 'asc'
|
|
47
|
+
? 'desc'
|
|
48
|
+
: null;
|
|
49
|
+
onSortChange(column, nextDir);
|
|
50
|
+
};
|
|
51
|
+
return (_jsx("th", { style: getColStyle(column.id, column.align, 'middle'), "aria-sort": ariaSort, className: `${styles.th} ${column.sortable ? styles.sortable : ''} `, onClick: e => {
|
|
52
|
+
if (!column.sortable)
|
|
53
|
+
return;
|
|
54
|
+
if (e.target instanceof HTMLElement && e.target.closest('.resizer'))
|
|
55
|
+
return;
|
|
56
|
+
toggleSort();
|
|
57
|
+
}, role: column.sortable ? 'button' : undefined, tabIndex: column.sortable ? 0 : undefined, onKeyDown: e => {
|
|
58
|
+
if (!column.sortable)
|
|
59
|
+
return;
|
|
60
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
toggleSort();
|
|
63
|
+
}
|
|
64
|
+
}, children: _jsx("div", { className: styles.thInner, children: _jsxs("span", { children: [_jsx("span", { className: styles.thLabel, children: typeof column.header === 'function' ? column.header() : column.header }), column.sortable && (_jsxs("span", { className: styles.sortIndicator, "aria-hidden": "true", children: [isActiveSort && sortDirection === 'asc' && _jsx(ArrowUp, {}), isActiveSort && sortDirection === 'desc' && (_jsx(ArrowDown, { className: styles.descending })), !isActiveSort && (_jsx(ArrowDown, { className: `${styles.descending} ${styles.inActiveSort}` }))] })), headerExtras === null || headerExtras === void 0 ? void 0 : headerExtras({ column, index })] }) }) }, column.id));
|
|
65
|
+
})] }), headerBelowRow ? (_jsx("tr", { className: styles.headerBelowRow, children: _jsx("th", { colSpan: filteredColumns.length, children: headerBelowRow }) })) : null] }), loading && !data.length ? (_jsx("tbody", { className: `${styles.tBody} ${striped ? styles.striped : ''}`, children: Array.from({ length: take !== null && take !== void 0 ? take : 5 }).map((_, rowIndex) => (_jsx("tr", { children: filteredColumns.map((column, colIndex) => (_jsx("td", { style: getColStyle(column.id, column.align, 'middle', column.width), className: `${styles.tableCell} ${column.fitContent ? 'fitContent' : ''}`, children: _jsx(SkeletonLoaderItem, { height: 20, width: "100%" }) }, `${column.id}-${colIndex}`))) }, `loading-row-${rowIndex}`))) })) : (_jsx("tbody", { className: `${styles.tBody} ${striped ? styles.striped : ''}`, children: data === null || data === void 0 ? void 0 : data.map((row, rowIndex) => {
|
|
66
|
+
const rowSeverity = getRowSeverity === null || getRowSeverity === void 0 ? void 0 : getRowSeverity(row);
|
|
67
|
+
return (_jsxs("tr", { tabIndex: onRowClick ? 0 : -1, onClick: e => {
|
|
68
|
+
const rowId = row[dataKey];
|
|
69
|
+
const isModifierClick = e.metaKey || e.ctrlKey;
|
|
70
|
+
const canSelect = Boolean(selectedRows && onRowSelect && dataKey);
|
|
71
|
+
if (isModifierClick && canSelect) {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
const isSelected = selectedRows.has(rowId);
|
|
75
|
+
if (selectionMode === 'single') {
|
|
76
|
+
// In single mode, treat modifier-click as "select this row"
|
|
77
|
+
// (toggle if already selected)
|
|
78
|
+
onRowSelect(rowId, !isSelected);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// multiple mode: toggle selection
|
|
82
|
+
onRowSelect(rowId, !isSelected);
|
|
83
|
+
}
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(row);
|
|
87
|
+
}, style: {
|
|
88
|
+
['--row-severity-color']: rowSeverity
|
|
89
|
+
? SeverityBgColor[rowSeverity]
|
|
90
|
+
: undefined,
|
|
91
|
+
}, className: `${onRowClick ? styles.clickableRow : ''} ${(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.has(row[dataKey])) ? styles.selectedRow : ''} ${rowSeverity ? styles.severity : ''}`, children: [selectedRows && onRowSelect && dataKey && (_jsx("td", { className: "fitContent", onClick: e => e.stopPropagation(), children: _jsx(Checkbox, { variant: "primary", checked: selectedRows.has(row[dataKey]), size: "sm", onChange: () => onRowSelect === null || onRowSelect === void 0 ? void 0 : onRowSelect(row[dataKey], !selectedRows.has(row[dataKey])) }) })), filteredColumns.map(column => {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
return (_jsx("td", { style: getColStyle(column.id, column.align, column.verticalAlign, column.width), className: `${styles.tableCell} ${column.fitContent ? 'fitContent' : ''} ${column.allowWrap ||
|
|
94
|
+
(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.has(row[dataKey])) ||
|
|
95
|
+
viewMode === 'comfortable'
|
|
96
|
+
? styles.allowWrap
|
|
97
|
+
: styles.nowrap} `, children: column.render
|
|
98
|
+
? column.render(row) || ((_a = column.emptyPlaceholder) !== null && _a !== void 0 ? _a : '')
|
|
99
|
+
: column.accessor
|
|
100
|
+
? row[column.accessor] || ((_b = column.emptyPlaceholder) !== null && _b !== void 0 ? _b : '')
|
|
101
|
+
: null }, column.id));
|
|
102
|
+
})] }, `tableRow-${String(row[dataKey])}-${rowIndex}`));
|
|
103
|
+
}) }))] }), !data.length && !loading && _jsx(TableEmptyState, { config: emptyConfig })] }));
|
|
104
|
+
if (fillViewport) {
|
|
105
|
+
return (_jsxs("div", { style: {
|
|
106
|
+
display: 'flex',
|
|
107
|
+
flexDirection: 'column',
|
|
108
|
+
gap: '20px',
|
|
109
|
+
flexFlow: paginationPlacement === 'top' ? 'column-reverse' : 'column',
|
|
110
|
+
position: 'relative',
|
|
111
|
+
}, children: [_jsx("div", { ref: scrollRef, style: viewportStyle, className: styles.tableScroll, children: tableEl }), onPageChange && (_jsx(Pagination, { itemsCount: totalItemsCount, take: take, skip: skip, onPageChange: handlePageChange, showFirstLast: showFirstLast }))] }));
|
|
239
112
|
}
|
|
240
|
-
|
|
113
|
+
return (_jsxs("div", { style: {
|
|
114
|
+
display: 'flex',
|
|
115
|
+
flexDirection: 'column',
|
|
116
|
+
gap: '20px',
|
|
117
|
+
flexFlow: paginationPlacement === 'top' ? 'column-reverse' : 'column',
|
|
118
|
+
position: 'relative',
|
|
119
|
+
}, children: [tableEl, onPageChange && (_jsx(Pagination, { itemsCount: totalItemsCount, take: take, skip: skip, onPageChange: handlePageChange }))] }));
|
|
241
120
|
}
|
|
242
|
-
|
|
243
|
-
export { Table };
|
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
cursor: pointer;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
.allowWrap {
|
|
38
|
+
word-break: break-all !important;
|
|
39
|
+
overflow-wrap: anywhere !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
.clickableRow:hover {
|
|
38
43
|
background-color: var(--color-bg-contextual);
|
|
39
44
|
}
|
|
@@ -63,7 +68,6 @@
|
|
|
63
68
|
white-space: nowrap;
|
|
64
69
|
min-width: unset;
|
|
65
70
|
max-width: unset;
|
|
66
|
-
width: 1%;
|
|
67
71
|
vertical-align: middle;
|
|
68
72
|
}
|
|
69
73
|
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import styles from './ColumnResizer.module.css';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"span",
|
|
6
|
-
{
|
|
7
|
-
className: styles.resizer,
|
|
8
|
-
onMouseDown: handler,
|
|
9
|
-
onTouchStart: handler,
|
|
10
|
-
role: "separator",
|
|
11
|
-
"aria-label": `Resize ${id}`
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
var ColumnResizer_default = ColumnResizer;
|
|
15
|
-
|
|
16
|
-
export { ColumnResizer_default as default };
|
|
4
|
+
const ColumnResizer = ({ id, handler }) => (_jsx("span", { className: styles.resizer, onMouseDown: handler, onTouchStart: handler, role: "separator", "aria-label": `Resize ${id}` }));
|
|
5
|
+
export default ColumnResizer;
|