@dbcdk/react-components 0.0.103 → 0.0.105
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.cjs +87 -0
- package/dist/assets/logo.js +85 -0
- package/dist/client.cjs +587 -0
- package/dist/client.d.ts +83 -0
- package/dist/client.js +84 -0
- package/dist/components/accordion/Accordion.cjs +117 -0
- package/dist/components/accordion/Accordion.d.ts +5 -2
- package/dist/components/accordion/Accordion.js +111 -0
- package/dist/components/accordion/Accordion.module.css +41 -0
- package/dist/components/accordion/components/AccordionRow.cjs +120 -0
- package/dist/components/accordion/components/AccordionRow.js +114 -0
- package/dist/components/accordion/components/AccordionRow.module.css +133 -0
- package/dist/components/alert/Alert.cjs +52 -0
- package/dist/components/alert/Alert.d.ts +2 -1
- package/dist/components/alert/Alert.js +46 -0
- package/dist/components/alert/Alert.module.css +97 -0
- package/dist/components/app-header/AppHeader.cjs +14 -0
- package/dist/components/app-header/AppHeader.js +8 -0
- package/dist/components/app-header/AppHeader.module.css +74 -0
- package/dist/components/attribute-chip/AttributeChip.cjs +22 -0
- package/dist/components/attribute-chip/AttributeChip.js +16 -0
- package/dist/components/attribute-chip/AttributeChip.module.css +65 -0
- package/dist/components/avatar/Avatar.cjs +111 -0
- package/dist/components/avatar/Avatar.js +86 -0
- package/dist/components/avatar/Avatar.module.css +91 -0
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +24 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +18 -0
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +80 -0
- package/dist/components/button/Button.cjs +149 -0
- package/dist/components/button/Button.js +124 -0
- package/dist/components/button/Button.module.css +260 -0
- package/dist/components/button-select/ButtonSelect.cjs +35 -0
- package/dist/components/button-select/ButtonSelect.js +29 -0
- package/dist/components/button-select/ButtonSelect.module.css +40 -0
- package/dist/components/card/Card.cjs +112 -0
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/card/Card.js +106 -0
- package/dist/components/card/Card.module.css +187 -0
- package/dist/components/card/components/CardMeta.cjs +62 -0
- package/dist/components/card/components/CardMeta.js +55 -0
- package/dist/components/card/components/CardMeta.module.css +55 -0
- package/dist/components/card-container/CardContainer.cjs +34 -0
- package/dist/components/card-container/CardContainer.js +28 -0
- package/dist/components/card-container/CardContainer.module.css +63 -0
- package/dist/components/chip/Chip.cjs +65 -0
- package/dist/components/chip/Chip.js +59 -0
- package/dist/components/chip/Chip.module.css +236 -0
- package/dist/components/circle/Circle.cjs +33 -0
- package/dist/components/circle/Circle.js +27 -0
- package/dist/components/circle/Circle.module.css +128 -0
- package/dist/components/clear-button/ClearButton.cjs +33 -0
- package/dist/components/clear-button/ClearButton.d.ts +2 -1
- package/dist/components/clear-button/ClearButton.js +27 -0
- package/dist/components/clear-button/ClearButton.module.css +26 -0
- package/dist/components/code-block/CodeBlock.cjs +97 -0
- package/dist/components/code-block/CodeBlock.js +91 -0
- package/dist/components/code-block/CodeBlock.module.css +124 -0
- package/dist/components/copy-button/CopyButton.cjs +139 -0
- package/dist/components/copy-button/CopyButton.js +133 -0
- package/dist/components/copy-button/CopyButton.module.css +22 -0
- package/dist/components/datetime-picker/DateTimePicker.cjs +559 -0
- package/dist/components/datetime-picker/DateTimePicker.js +553 -0
- package/dist/components/datetime-picker/DateTimePicker.module.css +155 -0
- package/dist/components/datetime-picker/dateTimeHelpers.cjs +179 -0
- package/dist/components/datetime-picker/dateTimeHelpers.js +160 -0
- package/dist/components/divider/Divider.cjs +22 -0
- package/dist/components/divider/Divider.js +20 -0
- package/dist/components/filter-field/FilterField.cjs +296 -0
- package/dist/components/filter-field/FilterField.js +289 -0
- package/dist/components/filter-field/FilterField.module.css +379 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.cjs +115 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +108 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +59 -0
- package/dist/components/forms/checkbox/Checkbox.cjs +88 -0
- package/dist/components/forms/checkbox/Checkbox.js +82 -0
- package/dist/components/forms/checkbox/Checkbox.module.css +104 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.cjs +121 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +115 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
- package/dist/components/forms/form-select/FormSelect.cjs +191 -0
- package/dist/components/forms/form-select/FormSelect.js +166 -0
- package/dist/components/forms/form-select/FormSelect.module.css +236 -0
- package/dist/components/forms/input/Input.cjs +188 -0
- package/dist/components/forms/input/Input.d.ts +1 -0
- package/dist/components/forms/input/Input.js +182 -0
- package/dist/components/forms/input/Input.module.css +468 -0
- package/dist/components/forms/input-container/InputContainer.cjs +72 -0
- package/dist/components/forms/input-container/InputContainer.js +66 -0
- package/dist/components/forms/input-container/InputContainer.module.css +59 -0
- package/dist/components/forms/multi-select/MultiSelect.cjs +227 -0
- package/dist/components/forms/multi-select/MultiSelect.js +225 -0
- package/dist/components/forms/radio-buttons/RadioButton.cjs +91 -0
- package/dist/components/forms/radio-buttons/RadioButton.js +85 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.cjs +74 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +72 -0
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +118 -0
- package/dist/components/forms/select/Select.cjs +286 -0
- package/dist/components/forms/select/Select.js +280 -0
- package/dist/components/forms/select/Select.module.css +32 -0
- package/dist/components/forms/text-area/Textarea.cjs +116 -0
- package/dist/components/forms/text-area/Textarea.js +110 -0
- package/dist/components/forms/text-area/Textarea.module.css +70 -0
- package/dist/components/forms/typeahead/Typeahead.cjs +792 -0
- package/dist/components/forms/typeahead/Typeahead.js +768 -0
- package/dist/components/forms/typeahead/Typeahead.module.css +38 -0
- package/dist/components/grid/Grid.cjs +45 -0
- package/dist/components/grid/Grid.js +38 -0
- package/dist/components/grid/Grid.module.css +35 -0
- package/dist/components/headline/CollapsibleHeadline.cjs +89 -0
- package/dist/components/headline/CollapsibleHeadline.d.ts +4 -4
- package/dist/components/headline/CollapsibleHeadline.js +83 -0
- package/dist/components/headline/Headline.cjs +59 -0
- package/dist/components/headline/Headline.js +53 -0
- package/dist/components/headline/Headline.module.css +185 -0
- package/dist/components/hyperlink/Hyperlink.cjs +107 -0
- package/dist/components/hyperlink/Hyperlink.js +82 -0
- package/dist/components/hyperlink/Hyperlink.module.css +121 -0
- package/dist/components/icon/Icon.cjs +27 -0
- package/dist/components/icon/Icon.js +20 -0
- package/dist/components/icon/Icon.module.css +36 -0
- package/dist/components/inline-status/InlineStatus.cjs +39 -0
- package/dist/components/inline-status/InlineStatus.js +33 -0
- package/dist/components/inline-status/InlineStatus.module.css +92 -0
- package/dist/components/interval-select/IntervalSelect.cjs +203 -0
- package/dist/components/interval-select/IntervalSelect.js +201 -0
- package/dist/components/json-viewer/HighlightedText.cjs +13 -0
- package/dist/components/json-viewer/HighlightedText.js +11 -0
- package/dist/components/json-viewer/JsonNode.cjs +124 -0
- package/dist/components/json-viewer/JsonNode.js +118 -0
- package/dist/components/json-viewer/JsonViewer.cjs +164 -0
- package/dist/components/json-viewer/JsonViewer.js +158 -0
- package/dist/components/json-viewer/JsonViewer.module.css +346 -0
- package/dist/components/json-viewer/types.cjs +2 -0
- package/dist/components/json-viewer/types.js +1 -0
- package/dist/components/json-viewer/useClipboardStatus.cjs +15 -0
- package/dist/components/json-viewer/useClipboardStatus.js +13 -0
- package/dist/components/json-viewer/utils.cjs +126 -0
- package/dist/components/json-viewer/utils.js +111 -0
- package/dist/components/media-card/MediaCard.cjs +60 -0
- package/dist/components/media-card/MediaCard.d.ts +19 -0
- package/dist/components/media-card/MediaCard.js +54 -0
- package/dist/components/media-card/MediaCard.module.css +92 -0
- package/dist/components/menu/Menu.cjs +287 -0
- package/dist/components/menu/Menu.js +262 -0
- package/dist/components/menu/Menu.module.css +220 -0
- package/dist/components/meta-bar/MetaBar.cjs +28 -0
- package/dist/components/meta-bar/MetaBar.js +22 -0
- package/dist/components/meta-bar/MetaBar.module.css +27 -0
- package/dist/components/nav-bar/NavBar.cjs +104 -0
- package/dist/components/nav-bar/NavBar.d.ts +4 -3
- package/dist/components/nav-bar/NavBar.js +98 -0
- package/dist/components/nav-bar/NavBar.module.css +225 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.cjs +30 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.js +24 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +54 -0
- package/dist/components/overlay/modal/Modal.cjs +189 -0
- package/dist/components/overlay/modal/Modal.d.ts +2 -1
- package/dist/components/overlay/modal/Modal.js +183 -0
- package/dist/components/overlay/modal/Modal.module.css +112 -0
- package/dist/components/overlay/modal/provider/ModalProvider.cjs +98 -0
- package/dist/components/overlay/modal/provider/ModalProvider.js +95 -0
- package/dist/components/overlay/side-panel/SidePanel.cjs +173 -0
- package/dist/components/overlay/side-panel/SidePanel.js +167 -0
- package/dist/components/overlay/side-panel/SidePanel.module.css +177 -0
- package/dist/components/overlay/side-panel/useSidePanel.cjs +16 -0
- package/dist/components/overlay/side-panel/useSidePanel.js +14 -0
- package/dist/components/overlay/tooltip/Tooltip.cjs +34 -0
- package/dist/components/overlay/tooltip/Tooltip.js +32 -0
- package/dist/components/overlay/tooltip/Tooltip.module.css +104 -0
- package/dist/components/overlay/tooltip/TooltipProvider.cjs +238 -0
- package/dist/components/overlay/tooltip/TooltipProvider.js +231 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.cjs +117 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +115 -0
- package/dist/components/page/Page.cjs +63 -0
- package/dist/components/page/Page.js +57 -0
- package/dist/components/page/Page.module.css +95 -0
- package/dist/components/page-layout/PageLayout.cjs +97 -0
- package/dist/components/page-layout/PageLayout.d.ts +0 -5
- package/dist/components/page-layout/PageLayout.js +91 -0
- package/dist/components/page-layout/PageLayout.module.css +236 -0
- package/dist/components/page-layout/components/footer/Footer.cjs +53 -0
- package/dist/components/page-layout/components/footer/Footer.js +47 -0
- package/dist/components/page-layout/components/footer/Footer.module.css +89 -0
- package/dist/components/pagination/Pagination.cjs +160 -0
- package/dist/components/pagination/Pagination.js +154 -0
- package/dist/components/pagination/Pagination.module.css +25 -0
- package/dist/components/panel/Panel.cjs +38 -0
- package/dist/components/panel/Panel.js +32 -0
- package/dist/components/panel/Panel.module.css +30 -0
- package/dist/components/popover/Popover.cjs +331 -0
- package/dist/components/popover/Popover.js +307 -0
- package/dist/components/popover/Popover.module.css +52 -0
- package/dist/components/search-box/SearchBox.cjs +274 -0
- package/dist/components/search-box/SearchBox.js +268 -0
- package/dist/components/search-box/SearchBox.module.css +27 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +127 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +121 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +174 -0
- package/dist/components/sidebar/Sidebar.cjs +39 -0
- package/dist/components/sidebar/Sidebar.js +37 -0
- package/dist/components/sidebar/components/SidebarItem.cjs +29 -0
- package/dist/components/sidebar/components/SidebarItem.js +27 -0
- package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +133 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +127 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +29 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +214 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +207 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +260 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +54 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +47 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +106 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +61 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +55 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +20 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +97 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +91 -0
- package/dist/components/sidebar/providers/SidebarProvider.cjs +223 -0
- package/dist/components/sidebar/providers/SidebarProvider.js +220 -0
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +442 -0
- package/dist/components/skeleton-loader/SkeletonLoader.js +440 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +42 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +36 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +51 -0
- package/dist/components/split-button/SplitButton.cjs +46 -0
- package/dist/components/split-button/SplitButton.js +40 -0
- package/dist/components/split-button/SplitButton.module.css +32 -0
- package/dist/components/split-pane/SplitPane.cjs +188 -0
- package/dist/components/split-pane/SplitPane.d.ts +2 -1
- package/dist/components/split-pane/SplitPane.js +179 -0
- package/dist/components/split-pane/SplitPane.module.css +118 -0
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +129 -0
- package/dist/components/split-pane/provider/SplitPaneContext.js +121 -0
- package/dist/components/stack/Stack.cjs +47 -0
- package/dist/components/stack/Stack.d.ts +1 -1
- package/dist/components/stack/Stack.js +41 -0
- package/dist/components/stack/Stack.module.css +61 -0
- package/dist/components/state-page/StatePage.cjs +48 -0
- package/dist/components/state-page/StatePage.js +42 -0
- package/dist/components/state-page/StatePage.module.css +9 -0
- package/dist/components/state-page/empty.cjs +664 -0
- package/dist/components/state-page/empty.js +662 -0
- package/dist/components/state-page/error.cjs +310 -0
- package/dist/components/state-page/error.js +308 -0
- package/dist/components/state-page/notFound.cjs +243 -0
- package/dist/components/state-page/notFound.js +241 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.cjs +98 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +96 -0
- package/dist/components/table/Table.cjs +216 -0
- package/dist/components/table/Table.js +210 -0
- package/dist/components/table/Table.module.css +534 -0
- package/dist/components/table/Table.types.cjs +2 -0
- package/dist/components/table/Table.types.js +1 -0
- package/dist/components/table/TanstackTable.cjs +172 -0
- package/dist/components/table/TanstackTable.js +147 -0
- package/dist/components/table/components/TableBody.cjs +50 -0
- package/dist/components/table/components/TableBody.js +44 -0
- package/dist/components/table/components/TableHeader.cjs +56 -0
- package/dist/components/table/components/TableHeader.js +50 -0
- package/dist/components/table/components/TableHeaderCell.cjs +69 -0
- package/dist/components/table/components/TableHeaderCell.js +63 -0
- package/dist/components/table/components/TableLoadingBody.cjs +35 -0
- package/dist/components/table/components/TableLoadingBody.js +29 -0
- package/dist/components/table/components/TablePagination.cjs +2 -0
- package/dist/components/table/components/TablePagination.js +1 -0
- package/dist/components/table/components/TableRow.cjs +151 -0
- package/dist/components/table/components/TableRow.js +145 -0
- package/dist/components/table/components/TableSelectionCell.cjs +41 -0
- package/dist/components/table/components/TableSelectionCell.js +35 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +25 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.js +19 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +22 -0
- package/dist/components/table/components/empty-state/EmptyState.cjs +33 -0
- package/dist/components/table/components/empty-state/EmptyState.js +31 -0
- package/dist/components/table/components/empty-state/EmptyState.module.css +4 -0
- package/dist/components/table/components/table-settings/TableSettings.cjs +139 -0
- package/dist/components/table/components/table-settings/TableSettings.js +137 -0
- package/dist/components/table/hooks/useTableRowInteractions.cjs +46 -0
- package/dist/components/table/hooks/useTableRowInteractions.js +44 -0
- package/dist/components/table/table.classes.cjs +49 -0
- package/dist/components/table/table.classes.js +40 -0
- package/dist/components/table/table.utils.cjs +57 -0
- package/dist/components/table/table.utils.js +45 -0
- package/dist/components/table/tanstackTable.utils.cjs +166 -0
- package/dist/components/table/tanstackTable.utils.js +159 -0
- package/dist/components/tabs/Tabs.cjs +172 -0
- package/dist/components/tabs/Tabs.js +166 -0
- package/dist/components/tabs/Tabs.module.css +261 -0
- package/dist/components/theme-button/ThemeButton.cjs +78 -0
- package/dist/components/theme-button/ThemeButton.js +75 -0
- package/dist/components/toast/Toast.cjs +68 -0
- package/dist/components/toast/Toast.js +62 -0
- package/dist/components/toast/Toast.module.css +161 -0
- package/dist/components/toast/provider/ToastProvider.cjs +105 -0
- package/dist/components/toast/provider/ToastProvider.js +97 -0
- package/dist/components/user-display/UserDisplay.cjs +22 -0
- package/dist/components/user-display/UserDisplay.js +16 -0
- package/dist/components/user-display/UserDisplay.module.css +25 -0
- package/dist/constants/chart-colors.cjs +10 -0
- package/dist/constants/chart-colors.js +8 -0
- package/dist/constants/chart-colors.types.cjs +2 -0
- package/dist/constants/chart-colors.types.js +1 -0
- package/dist/constants/severity.cjs +30 -0
- package/dist/constants/severity.js +26 -0
- package/dist/constants/severity.types.cjs +2 -0
- package/dist/constants/severity.types.js +1 -0
- package/dist/constants/sizes.cjs +11 -0
- package/dist/constants/sizes.js +9 -0
- package/dist/hooks/useDeviceSize.cjs +35 -0
- package/dist/hooks/useDeviceSize.js +33 -0
- package/dist/hooks/useListNavigation.cjs +237 -0
- package/dist/hooks/useListNavigation.js +235 -0
- package/dist/hooks/usePagination.cjs +144 -0
- package/dist/hooks/usePagination.js +142 -0
- package/dist/hooks/useSorting.cjs +119 -0
- package/dist/hooks/useSorting.js +117 -0
- package/dist/hooks/useTableData.cjs +53 -0
- package/dist/hooks/useTableData.js +51 -0
- package/dist/hooks/useTableSelection.cjs +172 -0
- package/dist/hooks/useTableSelection.js +170 -0
- package/dist/hooks/useTableSettings.cjs +90 -0
- package/dist/hooks/useTableSettings.js +87 -0
- package/dist/hooks/useTheme.cjs +64 -0
- package/dist/hooks/useTheme.js +62 -0
- package/dist/hooks/useTimeDuration.cjs +72 -0
- package/dist/hooks/useTimeDuration.js +70 -0
- package/dist/hooks/useViewportFill.cjs +82 -0
- package/dist/hooks/useViewportFill.js +80 -0
- package/dist/index.cjs +161 -12908
- package/dist/index.css +67 -7357
- package/dist/index.d.ts +0 -58
- package/dist/index.js +24 -12809
- package/dist/styles/animation.cjs +9 -0
- package/dist/styles/animation.js +7 -0
- package/dist/styles/themes/dbc/colors.css +5 -0
- package/dist/styles/themes/types.cjs +2 -0
- package/dist/styles/themes/types.js +1 -0
- package/dist/tanstack.cjs +18 -2717
- package/dist/tanstack.js +3 -2701
- package/dist/types/a11y-props.types.cjs +2 -0
- package/dist/types/a11y-props.types.js +1 -0
- package/dist/types/assets.d.cjs +2 -0
- package/dist/types/assets.d.js +1 -0
- package/dist/types/css.d.cjs +2 -0
- package/dist/types/css.d.js +1 -0
- package/dist/types/sizes.types.cjs +2 -0
- package/dist/types/sizes.types.js +1 -0
- package/dist/utils/arrays/nested-filtering.cjs +40 -0
- package/dist/utils/arrays/nested-filtering.js +38 -0
- package/dist/utils/date/formatDate.cjs +35 -0
- package/dist/utils/date/formatDate.js +33 -0
- package/dist/utils/localStorage.utils.cjs +53 -0
- package/dist/utils/localStorage.utils.js +49 -0
- package/dist/utils/text/get-highlighted-segments.cjs +49 -0
- package/dist/utils/text/get-highlighted-segments.js +47 -0
- package/package.json +8 -3
- package/dist/tanstack.css +0 -1385
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
.fillViewportRoot {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
block-size: 100%;
|
|
5
|
+
min-block-size: 0;
|
|
6
|
+
min-inline-size: 0;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.inlineRoot {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-block-size: 0;
|
|
14
|
+
min-inline-size: 0;
|
|
15
|
+
inline-size: 100%;
|
|
16
|
+
max-inline-size: 100%;
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.toolbarSlot {
|
|
21
|
+
margin-bottom: 12px;
|
|
22
|
+
flex: 0 0 auto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tableViewport {
|
|
26
|
+
flex: 1 1 auto;
|
|
27
|
+
min-block-size: 0;
|
|
28
|
+
min-inline-size: 0;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.paginationSlot {
|
|
35
|
+
flex: 0 0 auto;
|
|
36
|
+
overflow: visible;
|
|
37
|
+
margin-top: auto;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.paginationSlot:not(.paginationSlotTop) {
|
|
41
|
+
padding-top: var(--spacing-sm);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.paginationSlot.paginationSlotTop {
|
|
45
|
+
padding-bottom: var(--spacing-sm);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.tableRoot {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
flex: 1 1 auto;
|
|
52
|
+
min-block-size: 0;
|
|
53
|
+
min-inline-size: 0;
|
|
54
|
+
inline-size: 100%;
|
|
55
|
+
max-inline-size: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.measuringLayout {
|
|
59
|
+
visibility: hidden;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tableScroll {
|
|
63
|
+
flex: 1 1 auto;
|
|
64
|
+
min-block-size: 0;
|
|
65
|
+
min-inline-size: 0;
|
|
66
|
+
overflow: auto;
|
|
67
|
+
background: var(--table-row-bg);
|
|
68
|
+
-webkit-overflow-scrolling: touch;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.tableElement {
|
|
72
|
+
inline-size: 100%;
|
|
73
|
+
min-inline-size: 100%;
|
|
74
|
+
border-collapse: separate;
|
|
75
|
+
border-spacing: 0;
|
|
76
|
+
table-layout: fixed;
|
|
77
|
+
font-family: var(--font-family);
|
|
78
|
+
font-size: var(--font-size-sm);
|
|
79
|
+
color: var(--table-cell-fg);
|
|
80
|
+
background: var(--table-row-bg);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.header {
|
|
84
|
+
position: relative;
|
|
85
|
+
z-index: 10;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.headerRow,
|
|
89
|
+
.row {
|
|
90
|
+
position: relative;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.emptyStateSlot {
|
|
94
|
+
display: grid;
|
|
95
|
+
place-items: center;
|
|
96
|
+
min-block-size: 100%;
|
|
97
|
+
padding: var(--spacing-lg);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.body {
|
|
101
|
+
min-block-size: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.body .row:first-child .cell {
|
|
105
|
+
border-block-start: var(--spacing-xs) solid var(--table-row-bg);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.headerCell,
|
|
109
|
+
.cell {
|
|
110
|
+
position: relative;
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
min-width: 0;
|
|
113
|
+
vertical-align: top;
|
|
114
|
+
text-align: start;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.headerCell {
|
|
118
|
+
vertical-align: middle;
|
|
119
|
+
background-color: var(--table-header-bg);
|
|
120
|
+
border-block-end: 1px solid var(--table-border-header);
|
|
121
|
+
padding-block: var(--spacing-xxs);
|
|
122
|
+
padding-inline: var(--spacing-sm);
|
|
123
|
+
font-size: var(--font-size-xs);
|
|
124
|
+
font-weight: var(--font-weight-medium);
|
|
125
|
+
letter-spacing: var(--letter-spacing-wide);
|
|
126
|
+
text-transform: uppercase;
|
|
127
|
+
color: var(--table-header-fg);
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-sticky-header='true'] .headerCell {
|
|
132
|
+
position: sticky;
|
|
133
|
+
top: var(--table-sticky-top);
|
|
134
|
+
z-index: 6;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.cell {
|
|
138
|
+
padding-block: 6px;
|
|
139
|
+
padding-inline: var(--spacing-sm);
|
|
140
|
+
border-block-end: 1px solid var(--table-border-subtle);
|
|
141
|
+
background: var(--table-row-bg);
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
line-height: 20px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.md .headerCell {
|
|
147
|
+
padding-block: var(--spacing-xs);
|
|
148
|
+
padding-inline: var(--spacing-sm);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.md .cell {
|
|
152
|
+
padding-block: var(--spacing-xs);
|
|
153
|
+
padding-inline: var(--spacing-sm);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.sm .headerCell {
|
|
157
|
+
padding-block: var(--spacing-xxs);
|
|
158
|
+
padding-inline: var(--spacing-sm);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.sm .cell {
|
|
162
|
+
padding-block: var(--spacing-xxs);
|
|
163
|
+
padding-inline: var(--spacing-sm);
|
|
164
|
+
font-size: var(--font-size-xs);
|
|
165
|
+
line-height: 20px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.cell[data-vertical-align='top'] {
|
|
169
|
+
vertical-align: top;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.cell[data-vertical-align='middle'] {
|
|
173
|
+
vertical-align: middle;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.cell[data-vertical-align='bottom'] {
|
|
177
|
+
vertical-align: bottom;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.headerCell[data-align='right'],
|
|
181
|
+
.cell[data-align='right'] {
|
|
182
|
+
text-align: end;
|
|
183
|
+
font-variant-numeric: tabular-nums;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.headerCell[data-align='center'],
|
|
187
|
+
.cell[data-align='center'] {
|
|
188
|
+
text-align: center;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.headerCell.selectionCell,
|
|
192
|
+
.cell.selectionCell {
|
|
193
|
+
padding-inline: calc(var(--spacing-xxs) + 6px) var(--spacing-sm);
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
overflow: visible;
|
|
196
|
+
line-height: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.headerCell.selectionCell {
|
|
200
|
+
padding-block: var(--spacing-xxs);
|
|
201
|
+
vertical-align: middle;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.cell.selectionCell {
|
|
205
|
+
vertical-align: top;
|
|
206
|
+
padding-block: var(--spacing-xxs);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.selectionHitArea {
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
align-items: flex-start;
|
|
212
|
+
justify-content: flex-start;
|
|
213
|
+
min-block-size: 0;
|
|
214
|
+
padding: 0;
|
|
215
|
+
line-height: 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.selectionControlWrap {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: flex-start;
|
|
221
|
+
line-height: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.selectionControlWrap span {
|
|
225
|
+
gap: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.selectionControlWrap input[type='radio'] + span {
|
|
229
|
+
width: 18px;
|
|
230
|
+
height: 18px;
|
|
231
|
+
border-width: 1px;
|
|
232
|
+
border-color: color-mix(in srgb, var(--color-fg-default) 28%, transparent);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.selectionControlWrap input[type='radio'] + span > span {
|
|
236
|
+
width: 8px;
|
|
237
|
+
height: 8px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.clickableRow {
|
|
241
|
+
cursor: pointer;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.row:hover > .cell {
|
|
245
|
+
background-color: var(--table-row-bg-hover);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.selectedRow > .cell {
|
|
249
|
+
background-color: var(--table-row-bg-selected);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.selectedRow:hover > .cell {
|
|
253
|
+
background-color: var(--table-row-bg-selected-hover);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.striped > .row:nth-child(even):not(.selectedRow):not(:hover) > .cell {
|
|
257
|
+
background-color: var(--table-row-bg-alt);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.row:focus-within > .cell {
|
|
261
|
+
box-shadow:
|
|
262
|
+
inset 0 2px 0 var(--color-brand),
|
|
263
|
+
inset 0 -2px 0 var(--color-brand);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.row:focus-within > .cell:first-child {
|
|
267
|
+
box-shadow:
|
|
268
|
+
inset 2px 0 0 var(--color-brand),
|
|
269
|
+
inset 0 2px 0 var(--color-brand),
|
|
270
|
+
inset 0 -2px 0 var(--color-brand);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.row:focus-within > .cell:last-child {
|
|
274
|
+
box-shadow:
|
|
275
|
+
inset -2px 0 0 var(--color-brand),
|
|
276
|
+
inset 0 2px 0 var(--color-brand),
|
|
277
|
+
inset 0 -2px 0 var(--color-brand);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.nowrap {
|
|
281
|
+
white-space: nowrap;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.allowWrap {
|
|
285
|
+
white-space: normal;
|
|
286
|
+
overflow-wrap: break-word;
|
|
287
|
+
word-break: normal;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.thInner {
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
inline-size: 100%;
|
|
294
|
+
min-width: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.thInnerRight {
|
|
298
|
+
justify-content: flex-end;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.thInnerCenter {
|
|
302
|
+
justify-content: center;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.thMain {
|
|
306
|
+
flex: 1 1 auto;
|
|
307
|
+
min-width: 0;
|
|
308
|
+
display: flex;
|
|
309
|
+
align-items: center;
|
|
310
|
+
justify-content: flex-start;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.thMainRight {
|
|
314
|
+
justify-content: flex-end;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.thMainCenter {
|
|
318
|
+
justify-content: center;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.thButton {
|
|
322
|
+
all: unset;
|
|
323
|
+
display: inline-flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
gap: 4px;
|
|
326
|
+
min-width: 0;
|
|
327
|
+
max-inline-size: 100%;
|
|
328
|
+
cursor: pointer;
|
|
329
|
+
user-select: none;
|
|
330
|
+
border-radius: var(--border-radius-default);
|
|
331
|
+
padding-block: 2px;
|
|
332
|
+
padding-inline: 2px;
|
|
333
|
+
justify-content: flex-start;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.thButtonRight {
|
|
337
|
+
justify-content: flex-end;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.thButtonCenter {
|
|
341
|
+
justify-content: center;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.thLabel {
|
|
345
|
+
overflow: hidden;
|
|
346
|
+
text-overflow: ellipsis;
|
|
347
|
+
white-space: nowrap;
|
|
348
|
+
flex: 0 1 auto;
|
|
349
|
+
min-width: 0;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.thLabelRight {
|
|
353
|
+
text-align: right;
|
|
354
|
+
width: 100%;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.thLabelCenter {
|
|
358
|
+
text-align: center;
|
|
359
|
+
width: 100%;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.thOverlayExtras {
|
|
363
|
+
position: absolute;
|
|
364
|
+
inset-block: 0;
|
|
365
|
+
inset-inline-end: 0;
|
|
366
|
+
display: flex;
|
|
367
|
+
align-items: center;
|
|
368
|
+
justify-content: center;
|
|
369
|
+
min-width: 0;
|
|
370
|
+
pointer-events: none;
|
|
371
|
+
z-index: 7;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.thOverlayExtras > * {
|
|
375
|
+
pointer-events: auto;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.sortIndicator {
|
|
379
|
+
display: inline-flex;
|
|
380
|
+
flex: 0 0 auto;
|
|
381
|
+
align-items: center;
|
|
382
|
+
color: var(--color-fg-subtle);
|
|
383
|
+
opacity: 0.9;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.sortIndicator svg {
|
|
387
|
+
inline-size: var(--icon-size-sm);
|
|
388
|
+
block-size: var(--icon-size-sm);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.descending {
|
|
392
|
+
transform: rotate(180deg);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.inActiveSort {
|
|
396
|
+
opacity: 0.45;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.cellContent {
|
|
400
|
+
display: flex;
|
|
401
|
+
inline-size: 100%;
|
|
402
|
+
min-width: 0;
|
|
403
|
+
max-inline-size: 100%;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* horizontal alignment inside content wrapper */
|
|
407
|
+
.cellContent[data-align='left'] {
|
|
408
|
+
justify-content: flex-start;
|
|
409
|
+
text-align: left;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.cellContent[data-align='center'] {
|
|
413
|
+
justify-content: center;
|
|
414
|
+
text-align: center;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.cellContent[data-align='right'] {
|
|
418
|
+
justify-content: flex-end;
|
|
419
|
+
text-align: right;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* vertical alignment inside content wrapper */
|
|
423
|
+
.cellContent[data-vertical-align='top'] {
|
|
424
|
+
align-items: flex-start;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.cellContent[data-vertical-align='middle'] {
|
|
428
|
+
align-items: center;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.cellContent[data-vertical-align='bottom'] {
|
|
432
|
+
align-items: flex-end;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.cellContent > * {
|
|
436
|
+
min-width: 0;
|
|
437
|
+
max-inline-size: 100%;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* keep truncation + text alignment working */
|
|
441
|
+
.cellValueEllipsis {
|
|
442
|
+
display: block;
|
|
443
|
+
inline-size: 100%;
|
|
444
|
+
min-width: 0;
|
|
445
|
+
max-inline-size: 100%;
|
|
446
|
+
white-space: nowrap;
|
|
447
|
+
overflow: hidden;
|
|
448
|
+
text-overflow: ellipsis;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.cellContent[data-align='left'] .cellValueEllipsis {
|
|
452
|
+
text-align: left;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.cellContent[data-align='center'] .cellValueEllipsis {
|
|
456
|
+
text-align: center;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.cellContent[data-align='right'] .cellValueEllipsis {
|
|
460
|
+
text-align: right;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.allowWrap .cellContent,
|
|
464
|
+
.allowWrap .cellValueEllipsis {
|
|
465
|
+
white-space: normal;
|
|
466
|
+
overflow-wrap: break-word;
|
|
467
|
+
word-break: normal;
|
|
468
|
+
overflow: visible;
|
|
469
|
+
text-overflow: clip;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.severityTable {
|
|
473
|
+
--row-rail-width: 2px;
|
|
474
|
+
--row-rail-inset-block: 1px;
|
|
475
|
+
--row-rail-radius: 0;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.severityTable .row.severity > .cell:first-child {
|
|
479
|
+
position: relative;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.severityTable .row.severity > .cell:first-child::before {
|
|
483
|
+
content: '';
|
|
484
|
+
position: absolute;
|
|
485
|
+
inset-inline-start: 0;
|
|
486
|
+
inset-block-start: var(--row-rail-inset-block);
|
|
487
|
+
inset-block-end: var(--row-rail-inset-block);
|
|
488
|
+
inline-size: var(--row-rail-width);
|
|
489
|
+
background-color: var(--row-severity-color);
|
|
490
|
+
border-radius: var(--row-rail-radius);
|
|
491
|
+
z-index: 2;
|
|
492
|
+
pointer-events: none;
|
|
493
|
+
opacity: 0.95;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.severityTable .row.severity:hover > .cell:first-child::before,
|
|
497
|
+
.severityTable .row.severity:focus-within > .cell:first-child::before {
|
|
498
|
+
opacity: 1;
|
|
499
|
+
z-index: 8;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.severityTable .row.severityFailed > .cell:first-child::before {
|
|
503
|
+
box-shadow: 1px 0 0 color-mix(in srgb, var(--row-severity-color) 20%, transparent);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.sm .severityTable {
|
|
507
|
+
--row-rail-width: 4px;
|
|
508
|
+
--row-rail-inset-block: 1px;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.dividerLeft,
|
|
512
|
+
.dividerRight {
|
|
513
|
+
position: relative;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.dividerLeft::before {
|
|
517
|
+
content: '';
|
|
518
|
+
position: absolute;
|
|
519
|
+
left: 0;
|
|
520
|
+
top: 8px;
|
|
521
|
+
bottom: 8px;
|
|
522
|
+
width: 1px;
|
|
523
|
+
background: var(--table-divider);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.dividerRight::after {
|
|
527
|
+
content: '';
|
|
528
|
+
position: absolute;
|
|
529
|
+
right: 0;
|
|
530
|
+
top: 8px;
|
|
531
|
+
bottom: 8px;
|
|
532
|
+
width: 1px;
|
|
533
|
+
background: var(--table-divider);
|
|
534
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var reactTable = require('@tanstack/react-table');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var ColumnResizer = require('./components/column-resizer/ColumnResizer');
|
|
8
|
+
var Table = require('./Table');
|
|
9
|
+
var table_utils = require('./table.utils');
|
|
10
|
+
var tanstackTable_utils = require('./tanstackTable.utils');
|
|
11
|
+
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
function _interopNamespace(e) {
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
n.default = e;
|
|
29
|
+
return Object.freeze(n);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
|
+
var ColumnResizer__default = /*#__PURE__*/_interopDefault(ColumnResizer);
|
|
34
|
+
|
|
35
|
+
function TanstackTable(props) {
|
|
36
|
+
const {
|
|
37
|
+
data,
|
|
38
|
+
dataKey,
|
|
39
|
+
columns,
|
|
40
|
+
sorting: controlledSorting,
|
|
41
|
+
onSortingChange,
|
|
42
|
+
optimisticSortingUi = true,
|
|
43
|
+
visibleColumnIds,
|
|
44
|
+
manualSorting,
|
|
45
|
+
selectedRows,
|
|
46
|
+
onRowSelect,
|
|
47
|
+
...tableProps
|
|
48
|
+
} = props;
|
|
49
|
+
const isControlledSorting = controlledSorting != null;
|
|
50
|
+
const [uiSorting, setUiSorting] = React__namespace.useState(controlledSorting != null ? controlledSorting : []);
|
|
51
|
+
React__namespace.useEffect(() => {
|
|
52
|
+
if (!isControlledSorting) return;
|
|
53
|
+
if (tanstackTable_utils.sortingEqual(uiSorting, controlledSorting)) return;
|
|
54
|
+
setUiSorting(controlledSorting);
|
|
55
|
+
}, [isControlledSorting, controlledSorting, uiSorting]);
|
|
56
|
+
const columnVisibility = React__namespace.useMemo(
|
|
57
|
+
() => tanstackTable_utils.buildColumnVisibilityFromVisibleIds(columns, visibleColumnIds),
|
|
58
|
+
[columns, visibleColumnIds]
|
|
59
|
+
);
|
|
60
|
+
const [columnSizing, setColumnSizing] = React__namespace.useState({});
|
|
61
|
+
const containerRef = React__namespace.useRef(null);
|
|
62
|
+
const [availableWidth, setAvailableWidth] = React__namespace.useState(void 0);
|
|
63
|
+
const table = reactTable.useReactTable({
|
|
64
|
+
data,
|
|
65
|
+
columns,
|
|
66
|
+
state: {
|
|
67
|
+
sorting: uiSorting,
|
|
68
|
+
columnSizing,
|
|
69
|
+
columnVisibility
|
|
70
|
+
},
|
|
71
|
+
onSortingChange: (updater) => {
|
|
72
|
+
const next = typeof updater === "function" ? updater(uiSorting) : updater;
|
|
73
|
+
if (optimisticSortingUi) setUiSorting(next);
|
|
74
|
+
onSortingChange == null ? void 0 : onSortingChange(next);
|
|
75
|
+
},
|
|
76
|
+
onColumnSizingChange: setColumnSizing,
|
|
77
|
+
getCoreRowModel: reactTable.getCoreRowModel(),
|
|
78
|
+
getSortedRowModel: reactTable.getSortedRowModel(),
|
|
79
|
+
manualSorting: manualSorting != null ? manualSorting : false,
|
|
80
|
+
enableColumnResizing: true,
|
|
81
|
+
columnResizeMode: "onChange",
|
|
82
|
+
defaultColumn: {
|
|
83
|
+
enableResizing: true,
|
|
84
|
+
minSize: 80,
|
|
85
|
+
size: table_utils.DEFAULT_COLUMN_PX
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
React__namespace.useLayoutEffect(() => {
|
|
89
|
+
const el = containerRef.current;
|
|
90
|
+
if (!el) return;
|
|
91
|
+
const updateWidth = () => {
|
|
92
|
+
const next = el.clientWidth;
|
|
93
|
+
setAvailableWidth(next > 0 ? next : void 0);
|
|
94
|
+
};
|
|
95
|
+
updateWidth();
|
|
96
|
+
if (typeof ResizeObserver === "undefined") {
|
|
97
|
+
window.addEventListener("resize", updateWidth);
|
|
98
|
+
return () => window.removeEventListener("resize", updateWidth);
|
|
99
|
+
}
|
|
100
|
+
const observer = new ResizeObserver(() => updateWidth());
|
|
101
|
+
observer.observe(el);
|
|
102
|
+
return () => observer.disconnect();
|
|
103
|
+
}, []);
|
|
104
|
+
const distributedLayout = React__namespace.useMemo(() => {
|
|
105
|
+
if (availableWidth == null) return null;
|
|
106
|
+
return tanstackTable_utils.buildDistributedColumnWidths({
|
|
107
|
+
table,
|
|
108
|
+
hasSelection: Boolean(selectedRows && onRowSelect && dataKey),
|
|
109
|
+
defaultMinPx: 80,
|
|
110
|
+
columnSizing,
|
|
111
|
+
availableWidth
|
|
112
|
+
});
|
|
113
|
+
}, [table, selectedRows, onRowSelect, dataKey, columnSizing, availableWidth]);
|
|
114
|
+
const initialLayoutReady = availableWidth != null;
|
|
115
|
+
const resolvedLayout = React__namespace.useMemo(() => {
|
|
116
|
+
const next = {};
|
|
117
|
+
table.getVisibleLeafColumns().forEach((column) => {
|
|
118
|
+
next[column.id] = {
|
|
119
|
+
width: distributedLayout == null ? void 0 : distributedLayout.widths[column.id]
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
return next;
|
|
123
|
+
}, [table, distributedLayout]);
|
|
124
|
+
const columnItems = React__namespace.useMemo(
|
|
125
|
+
() => tanstackTable_utils.mapDefsToColumnItems(columns, columnVisibility, resolvedLayout),
|
|
126
|
+
[columns, columnVisibility, resolvedLayout]
|
|
127
|
+
);
|
|
128
|
+
const visibleData = table.getRowModel().rows.map((r) => r.original);
|
|
129
|
+
const { sortById, sortDirection } = tanstackTable_utils.getSortPropsFromSorting(uiSorting);
|
|
130
|
+
const handleSortChange = React__namespace.useCallback(
|
|
131
|
+
(column, direction) => {
|
|
132
|
+
const next = direction == null ? [] : [{ id: column.id, desc: direction === "desc" }];
|
|
133
|
+
if (optimisticSortingUi) setUiSorting(next);
|
|
134
|
+
onSortingChange == null ? void 0 : onSortingChange(next);
|
|
135
|
+
},
|
|
136
|
+
[optimisticSortingUi, onSortingChange]
|
|
137
|
+
);
|
|
138
|
+
const headerExtras = React__namespace.useCallback(
|
|
139
|
+
({ index }) => {
|
|
140
|
+
var _a, _b, _c, _d;
|
|
141
|
+
const headerGroups = table.getHeaderGroups();
|
|
142
|
+
const leafHeaders = headerGroups.length > 0 ? headerGroups[headerGroups.length - 1].headers : [];
|
|
143
|
+
const header = leafHeaders[index];
|
|
144
|
+
if (!header) return null;
|
|
145
|
+
const canResize = (_c = (_b = (_a = header.column).getCanResize) == null ? void 0 : _b.call(_a)) != null ? _c : false;
|
|
146
|
+
const handler = (_d = header.getResizeHandler) == null ? void 0 : _d.call(header);
|
|
147
|
+
if (!canResize || !handler) return null;
|
|
148
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ColumnResizer__default.default, { id: header.column.id, handler });
|
|
149
|
+
},
|
|
150
|
+
[table]
|
|
151
|
+
);
|
|
152
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
153
|
+
Table.Table,
|
|
154
|
+
{
|
|
155
|
+
...tableProps,
|
|
156
|
+
tableRootRef: containerRef,
|
|
157
|
+
onSortChange: handleSortChange,
|
|
158
|
+
dataKey,
|
|
159
|
+
data: visibleData,
|
|
160
|
+
columns: columnItems,
|
|
161
|
+
tableWidth: distributedLayout == null ? void 0 : distributedLayout.totalWidth,
|
|
162
|
+
measuringLayout: !initialLayoutReady,
|
|
163
|
+
sortById,
|
|
164
|
+
sortDirection,
|
|
165
|
+
headerExtras,
|
|
166
|
+
selectedRows,
|
|
167
|
+
onRowSelect
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
exports.TanstackTable = TanstackTable;
|