@dbcdk/react-components 0.0.103 → 0.0.104
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 +103 -0
- package/dist/components/accordion/Accordion.js +97 -0
- package/dist/components/accordion/Accordion.module.css +41 -0
- package/dist/components/accordion/components/AccordionRow.cjs +115 -0
- package/dist/components/accordion/components/AccordionRow.js +109 -0
- package/dist/components/accordion/components/AccordionRow.module.css +99 -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 +80 -0
- package/dist/components/headline/CollapsibleHeadline.js +74 -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 +95 -0
- package/dist/components/nav-bar/NavBar.d.ts +1 -1
- package/dist/components/nav-bar/NavBar.js +89 -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 +177 -0
- package/dist/components/split-pane/SplitPane.js +168 -0
- package/dist/components/split-pane/SplitPane.module.css +111 -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,147 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useReactTable, getSortedRowModel, getCoreRowModel } from '@tanstack/react-table';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import ColumnResizer from './components/column-resizer/ColumnResizer';
|
|
6
|
+
import { Table } from './Table';
|
|
7
|
+
import { DEFAULT_COLUMN_PX } from './table.utils';
|
|
8
|
+
import { sortingEqual, buildColumnVisibilityFromVisibleIds, buildDistributedColumnWidths, mapDefsToColumnItems, getSortPropsFromSorting } from './tanstackTable.utils';
|
|
9
|
+
|
|
10
|
+
function TanstackTable(props) {
|
|
11
|
+
const {
|
|
12
|
+
data,
|
|
13
|
+
dataKey,
|
|
14
|
+
columns,
|
|
15
|
+
sorting: controlledSorting,
|
|
16
|
+
onSortingChange,
|
|
17
|
+
optimisticSortingUi = true,
|
|
18
|
+
visibleColumnIds,
|
|
19
|
+
manualSorting,
|
|
20
|
+
selectedRows,
|
|
21
|
+
onRowSelect,
|
|
22
|
+
...tableProps
|
|
23
|
+
} = props;
|
|
24
|
+
const isControlledSorting = controlledSorting != null;
|
|
25
|
+
const [uiSorting, setUiSorting] = React.useState(controlledSorting != null ? controlledSorting : []);
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
if (!isControlledSorting) return;
|
|
28
|
+
if (sortingEqual(uiSorting, controlledSorting)) return;
|
|
29
|
+
setUiSorting(controlledSorting);
|
|
30
|
+
}, [isControlledSorting, controlledSorting, uiSorting]);
|
|
31
|
+
const columnVisibility = React.useMemo(
|
|
32
|
+
() => buildColumnVisibilityFromVisibleIds(columns, visibleColumnIds),
|
|
33
|
+
[columns, visibleColumnIds]
|
|
34
|
+
);
|
|
35
|
+
const [columnSizing, setColumnSizing] = React.useState({});
|
|
36
|
+
const containerRef = React.useRef(null);
|
|
37
|
+
const [availableWidth, setAvailableWidth] = React.useState(void 0);
|
|
38
|
+
const table = useReactTable({
|
|
39
|
+
data,
|
|
40
|
+
columns,
|
|
41
|
+
state: {
|
|
42
|
+
sorting: uiSorting,
|
|
43
|
+
columnSizing,
|
|
44
|
+
columnVisibility
|
|
45
|
+
},
|
|
46
|
+
onSortingChange: (updater) => {
|
|
47
|
+
const next = typeof updater === "function" ? updater(uiSorting) : updater;
|
|
48
|
+
if (optimisticSortingUi) setUiSorting(next);
|
|
49
|
+
onSortingChange == null ? void 0 : onSortingChange(next);
|
|
50
|
+
},
|
|
51
|
+
onColumnSizingChange: setColumnSizing,
|
|
52
|
+
getCoreRowModel: getCoreRowModel(),
|
|
53
|
+
getSortedRowModel: getSortedRowModel(),
|
|
54
|
+
manualSorting: manualSorting != null ? manualSorting : false,
|
|
55
|
+
enableColumnResizing: true,
|
|
56
|
+
columnResizeMode: "onChange",
|
|
57
|
+
defaultColumn: {
|
|
58
|
+
enableResizing: true,
|
|
59
|
+
minSize: 80,
|
|
60
|
+
size: DEFAULT_COLUMN_PX
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
React.useLayoutEffect(() => {
|
|
64
|
+
const el = containerRef.current;
|
|
65
|
+
if (!el) return;
|
|
66
|
+
const updateWidth = () => {
|
|
67
|
+
const next = el.clientWidth;
|
|
68
|
+
setAvailableWidth(next > 0 ? next : void 0);
|
|
69
|
+
};
|
|
70
|
+
updateWidth();
|
|
71
|
+
if (typeof ResizeObserver === "undefined") {
|
|
72
|
+
window.addEventListener("resize", updateWidth);
|
|
73
|
+
return () => window.removeEventListener("resize", updateWidth);
|
|
74
|
+
}
|
|
75
|
+
const observer = new ResizeObserver(() => updateWidth());
|
|
76
|
+
observer.observe(el);
|
|
77
|
+
return () => observer.disconnect();
|
|
78
|
+
}, []);
|
|
79
|
+
const distributedLayout = React.useMemo(() => {
|
|
80
|
+
if (availableWidth == null) return null;
|
|
81
|
+
return buildDistributedColumnWidths({
|
|
82
|
+
table,
|
|
83
|
+
hasSelection: Boolean(selectedRows && onRowSelect && dataKey),
|
|
84
|
+
defaultMinPx: 80,
|
|
85
|
+
columnSizing,
|
|
86
|
+
availableWidth
|
|
87
|
+
});
|
|
88
|
+
}, [table, selectedRows, onRowSelect, dataKey, columnSizing, availableWidth]);
|
|
89
|
+
const initialLayoutReady = availableWidth != null;
|
|
90
|
+
const resolvedLayout = React.useMemo(() => {
|
|
91
|
+
const next = {};
|
|
92
|
+
table.getVisibleLeafColumns().forEach((column) => {
|
|
93
|
+
next[column.id] = {
|
|
94
|
+
width: distributedLayout == null ? void 0 : distributedLayout.widths[column.id]
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
return next;
|
|
98
|
+
}, [table, distributedLayout]);
|
|
99
|
+
const columnItems = React.useMemo(
|
|
100
|
+
() => mapDefsToColumnItems(columns, columnVisibility, resolvedLayout),
|
|
101
|
+
[columns, columnVisibility, resolvedLayout]
|
|
102
|
+
);
|
|
103
|
+
const visibleData = table.getRowModel().rows.map((r) => r.original);
|
|
104
|
+
const { sortById, sortDirection } = getSortPropsFromSorting(uiSorting);
|
|
105
|
+
const handleSortChange = React.useCallback(
|
|
106
|
+
(column, direction) => {
|
|
107
|
+
const next = direction == null ? [] : [{ id: column.id, desc: direction === "desc" }];
|
|
108
|
+
if (optimisticSortingUi) setUiSorting(next);
|
|
109
|
+
onSortingChange == null ? void 0 : onSortingChange(next);
|
|
110
|
+
},
|
|
111
|
+
[optimisticSortingUi, onSortingChange]
|
|
112
|
+
);
|
|
113
|
+
const headerExtras = React.useCallback(
|
|
114
|
+
({ index }) => {
|
|
115
|
+
var _a, _b, _c, _d;
|
|
116
|
+
const headerGroups = table.getHeaderGroups();
|
|
117
|
+
const leafHeaders = headerGroups.length > 0 ? headerGroups[headerGroups.length - 1].headers : [];
|
|
118
|
+
const header = leafHeaders[index];
|
|
119
|
+
if (!header) return null;
|
|
120
|
+
const canResize = (_c = (_b = (_a = header.column).getCanResize) == null ? void 0 : _b.call(_a)) != null ? _c : false;
|
|
121
|
+
const handler = (_d = header.getResizeHandler) == null ? void 0 : _d.call(header);
|
|
122
|
+
if (!canResize || !handler) return null;
|
|
123
|
+
return /* @__PURE__ */ jsx(ColumnResizer, { id: header.column.id, handler });
|
|
124
|
+
},
|
|
125
|
+
[table]
|
|
126
|
+
);
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
Table,
|
|
129
|
+
{
|
|
130
|
+
...tableProps,
|
|
131
|
+
tableRootRef: containerRef,
|
|
132
|
+
onSortChange: handleSortChange,
|
|
133
|
+
dataKey,
|
|
134
|
+
data: visibleData,
|
|
135
|
+
columns: columnItems,
|
|
136
|
+
tableWidth: distributedLayout == null ? void 0 : distributedLayout.totalWidth,
|
|
137
|
+
measuringLayout: !initialLayoutReady,
|
|
138
|
+
sortById,
|
|
139
|
+
sortDirection,
|
|
140
|
+
headerExtras,
|
|
141
|
+
selectedRows,
|
|
142
|
+
onRowSelect
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { TanstackTable };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var table_classes = require('../table.classes');
|
|
5
|
+
var styles = require('../Table.module.css');
|
|
6
|
+
var TableRow = require('./TableRow');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
11
|
+
|
|
12
|
+
function TableBody({
|
|
13
|
+
data,
|
|
14
|
+
dataKey,
|
|
15
|
+
columns,
|
|
16
|
+
striped,
|
|
17
|
+
selectedRows,
|
|
18
|
+
hasSelection,
|
|
19
|
+
selectionMode,
|
|
20
|
+
selectionInputName,
|
|
21
|
+
viewMode,
|
|
22
|
+
getRowSeverity,
|
|
23
|
+
onRowClick,
|
|
24
|
+
onRowMouseEnter,
|
|
25
|
+
onRowSelect
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: table_classes.cx(styles__default.default.body, striped && styles__default.default.striped), children: data.map((row) => {
|
|
28
|
+
const rowId = row[dataKey];
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
TableRow.TableRow,
|
|
31
|
+
{
|
|
32
|
+
row,
|
|
33
|
+
rowId,
|
|
34
|
+
columns,
|
|
35
|
+
selectedRows,
|
|
36
|
+
hasSelection,
|
|
37
|
+
selectionMode,
|
|
38
|
+
selectionInputName,
|
|
39
|
+
viewMode,
|
|
40
|
+
getRowSeverity,
|
|
41
|
+
onRowClick,
|
|
42
|
+
onRowMouseEnter,
|
|
43
|
+
onRowSelect
|
|
44
|
+
},
|
|
45
|
+
`gridRow-${rowId}`
|
|
46
|
+
);
|
|
47
|
+
}) });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
exports.TableBody = TableBody;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '../table.classes';
|
|
3
|
+
import styles from '../Table.module.css';
|
|
4
|
+
import { TableRow } from './TableRow';
|
|
5
|
+
|
|
6
|
+
function TableBody({
|
|
7
|
+
data,
|
|
8
|
+
dataKey,
|
|
9
|
+
columns,
|
|
10
|
+
striped,
|
|
11
|
+
selectedRows,
|
|
12
|
+
hasSelection,
|
|
13
|
+
selectionMode,
|
|
14
|
+
selectionInputName,
|
|
15
|
+
viewMode,
|
|
16
|
+
getRowSeverity,
|
|
17
|
+
onRowClick,
|
|
18
|
+
onRowMouseEnter,
|
|
19
|
+
onRowSelect
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx("tbody", { className: cx(styles.body, striped && styles.striped), children: data.map((row) => {
|
|
22
|
+
const rowId = row[dataKey];
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
TableRow,
|
|
25
|
+
{
|
|
26
|
+
row,
|
|
27
|
+
rowId,
|
|
28
|
+
columns,
|
|
29
|
+
selectedRows,
|
|
30
|
+
hasSelection,
|
|
31
|
+
selectionMode,
|
|
32
|
+
selectionInputName,
|
|
33
|
+
viewMode,
|
|
34
|
+
getRowSeverity,
|
|
35
|
+
onRowClick,
|
|
36
|
+
onRowMouseEnter,
|
|
37
|
+
onRowSelect
|
|
38
|
+
},
|
|
39
|
+
`gridRow-${rowId}`
|
|
40
|
+
);
|
|
41
|
+
}) });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { TableBody };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var TableHeaderCell = require('./TableHeaderCell');
|
|
5
|
+
var TableSelectionCell = require('./TableSelectionCell');
|
|
6
|
+
var styles = require('../Table.module.css');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
11
|
+
|
|
12
|
+
function TableHeader({
|
|
13
|
+
columns,
|
|
14
|
+
hasSelection,
|
|
15
|
+
selectionMode,
|
|
16
|
+
allRowsSelected,
|
|
17
|
+
onSelectAllRows,
|
|
18
|
+
sortById,
|
|
19
|
+
sortDirection,
|
|
20
|
+
onSortChange,
|
|
21
|
+
headerExtras,
|
|
22
|
+
stickyTop
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
"thead",
|
|
26
|
+
{
|
|
27
|
+
className: styles__default.default.header,
|
|
28
|
+
style: stickyTop ? { top: stickyTop, position: "sticky", zIndex: 2 } : void 0,
|
|
29
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: styles__default.default.headerRow, children: [
|
|
30
|
+
hasSelection ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
TableSelectionCell.TableSelectionCell,
|
|
32
|
+
{
|
|
33
|
+
isHeader: true,
|
|
34
|
+
multiple: selectionMode === "multiple",
|
|
35
|
+
checked: allRowsSelected,
|
|
36
|
+
onToggle: (checked) => onSelectAllRows == null ? void 0 : onSelectAllRows(checked)
|
|
37
|
+
}
|
|
38
|
+
) : null,
|
|
39
|
+
columns.map((column, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
+
TableHeaderCell.TableHeaderCell,
|
|
41
|
+
{
|
|
42
|
+
column,
|
|
43
|
+
index,
|
|
44
|
+
sortById,
|
|
45
|
+
sortDirection,
|
|
46
|
+
onSortChange,
|
|
47
|
+
extraContent: headerExtras == null ? void 0 : headerExtras({ column, index })
|
|
48
|
+
},
|
|
49
|
+
column.id
|
|
50
|
+
))
|
|
51
|
+
] })
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
exports.TableHeader = TableHeader;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { TableHeaderCell } from './TableHeaderCell';
|
|
3
|
+
import { TableSelectionCell } from './TableSelectionCell';
|
|
4
|
+
import styles from '../Table.module.css';
|
|
5
|
+
|
|
6
|
+
function TableHeader({
|
|
7
|
+
columns,
|
|
8
|
+
hasSelection,
|
|
9
|
+
selectionMode,
|
|
10
|
+
allRowsSelected,
|
|
11
|
+
onSelectAllRows,
|
|
12
|
+
sortById,
|
|
13
|
+
sortDirection,
|
|
14
|
+
onSortChange,
|
|
15
|
+
headerExtras,
|
|
16
|
+
stickyTop
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
"thead",
|
|
20
|
+
{
|
|
21
|
+
className: styles.header,
|
|
22
|
+
style: stickyTop ? { top: stickyTop, position: "sticky", zIndex: 2 } : void 0,
|
|
23
|
+
children: /* @__PURE__ */ jsxs("tr", { className: styles.headerRow, children: [
|
|
24
|
+
hasSelection ? /* @__PURE__ */ jsx(
|
|
25
|
+
TableSelectionCell,
|
|
26
|
+
{
|
|
27
|
+
isHeader: true,
|
|
28
|
+
multiple: selectionMode === "multiple",
|
|
29
|
+
checked: allRowsSelected,
|
|
30
|
+
onToggle: (checked) => onSelectAllRows == null ? void 0 : onSelectAllRows(checked)
|
|
31
|
+
}
|
|
32
|
+
) : null,
|
|
33
|
+
columns.map((column, index) => /* @__PURE__ */ jsx(
|
|
34
|
+
TableHeaderCell,
|
|
35
|
+
{
|
|
36
|
+
column,
|
|
37
|
+
index,
|
|
38
|
+
sortById,
|
|
39
|
+
sortDirection,
|
|
40
|
+
onSortChange,
|
|
41
|
+
extraContent: headerExtras == null ? void 0 : headerExtras({ column, index })
|
|
42
|
+
},
|
|
43
|
+
column.id
|
|
44
|
+
))
|
|
45
|
+
] })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { TableHeader };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var lucideReact = require('lucide-react');
|
|
5
|
+
var table_classes = require('../table.classes');
|
|
6
|
+
var styles = require('../Table.module.css');
|
|
7
|
+
var table_utils = require('../table.utils');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
12
|
+
|
|
13
|
+
function TableHeaderCell({
|
|
14
|
+
column,
|
|
15
|
+
index,
|
|
16
|
+
sortById,
|
|
17
|
+
sortDirection,
|
|
18
|
+
onSortChange,
|
|
19
|
+
extraContent
|
|
20
|
+
}) {
|
|
21
|
+
const active = table_utils.isActiveSort(sortById, column.id);
|
|
22
|
+
const ariaSort = table_utils.getAriaSort(column.sortable, active, sortDirection != null ? sortDirection : null);
|
|
23
|
+
const align = table_classes.getAlignValue(column);
|
|
24
|
+
const dividerClass = table_classes.getDividerClass(column);
|
|
25
|
+
const alignClasses = table_classes.getHeaderAlignClasses(align);
|
|
26
|
+
const handleToggleSort = () => {
|
|
27
|
+
if (!column.sortable || !onSortChange) return;
|
|
28
|
+
const nextDirection = table_utils.getNextSortDirection(column.sortable, active, sortDirection != null ? sortDirection : null);
|
|
29
|
+
onSortChange(column, nextDirection);
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32
|
+
"th",
|
|
33
|
+
{
|
|
34
|
+
className: table_classes.cx(styles__default.default.headerCell, dividerClass),
|
|
35
|
+
scope: "col",
|
|
36
|
+
"aria-sort": ariaSort,
|
|
37
|
+
"data-align": align,
|
|
38
|
+
"data-divider": column.divider,
|
|
39
|
+
"data-column-index": index,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: alignClasses.inner, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: alignClasses.main, children: column.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
type: "button",
|
|
45
|
+
className: alignClasses.button,
|
|
46
|
+
onClick: handleToggleSort,
|
|
47
|
+
onKeyDown: (e) => {
|
|
48
|
+
if (!table_utils.shouldToggleOnKey(e.key)) return;
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
handleToggleSort();
|
|
51
|
+
},
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: alignClasses.label, children: table_utils.getHeaderLabel(column.header) }),
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.sortIndicator, "aria-hidden": "true", children: [
|
|
55
|
+
active && sortDirection === "asc" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, {}),
|
|
56
|
+
active && sortDirection === "desc" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, {}),
|
|
57
|
+
!active && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: styles__default.default.inActiveSort })
|
|
58
|
+
] })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: alignClasses.label, children: table_utils.getHeaderLabel(column.header) }) }) }),
|
|
62
|
+
extraContent != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.thOverlayExtras, children: extraContent }) : null
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
column.id
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
exports.TableHeaderCell = TableHeaderCell;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ArrowUp, ArrowDown } from 'lucide-react';
|
|
3
|
+
import { getAlignValue, getDividerClass, getHeaderAlignClasses, cx } from '../table.classes';
|
|
4
|
+
import styles from '../Table.module.css';
|
|
5
|
+
import { isActiveSort, getAriaSort, getHeaderLabel, shouldToggleOnKey, getNextSortDirection } from '../table.utils';
|
|
6
|
+
|
|
7
|
+
function TableHeaderCell({
|
|
8
|
+
column,
|
|
9
|
+
index,
|
|
10
|
+
sortById,
|
|
11
|
+
sortDirection,
|
|
12
|
+
onSortChange,
|
|
13
|
+
extraContent
|
|
14
|
+
}) {
|
|
15
|
+
const active = isActiveSort(sortById, column.id);
|
|
16
|
+
const ariaSort = getAriaSort(column.sortable, active, sortDirection != null ? sortDirection : null);
|
|
17
|
+
const align = getAlignValue(column);
|
|
18
|
+
const dividerClass = getDividerClass(column);
|
|
19
|
+
const alignClasses = getHeaderAlignClasses(align);
|
|
20
|
+
const handleToggleSort = () => {
|
|
21
|
+
if (!column.sortable || !onSortChange) return;
|
|
22
|
+
const nextDirection = getNextSortDirection(column.sortable, active, sortDirection != null ? sortDirection : null);
|
|
23
|
+
onSortChange(column, nextDirection);
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
|
+
"th",
|
|
27
|
+
{
|
|
28
|
+
className: cx(styles.headerCell, dividerClass),
|
|
29
|
+
scope: "col",
|
|
30
|
+
"aria-sort": ariaSort,
|
|
31
|
+
"data-align": align,
|
|
32
|
+
"data-divider": column.divider,
|
|
33
|
+
"data-column-index": index,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx("div", { className: alignClasses.inner, children: /* @__PURE__ */ jsx("div", { className: alignClasses.main, children: column.sortable ? /* @__PURE__ */ jsxs(
|
|
36
|
+
"button",
|
|
37
|
+
{
|
|
38
|
+
type: "button",
|
|
39
|
+
className: alignClasses.button,
|
|
40
|
+
onClick: handleToggleSort,
|
|
41
|
+
onKeyDown: (e) => {
|
|
42
|
+
if (!shouldToggleOnKey(e.key)) return;
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
handleToggleSort();
|
|
45
|
+
},
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: alignClasses.label, children: getHeaderLabel(column.header) }),
|
|
48
|
+
/* @__PURE__ */ jsxs("span", { className: styles.sortIndicator, "aria-hidden": "true", children: [
|
|
49
|
+
active && sortDirection === "asc" && /* @__PURE__ */ jsx(ArrowUp, {}),
|
|
50
|
+
active && sortDirection === "desc" && /* @__PURE__ */ jsx(ArrowDown, {}),
|
|
51
|
+
!active && /* @__PURE__ */ jsx(ArrowDown, { className: styles.inActiveSort })
|
|
52
|
+
] })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) : /* @__PURE__ */ jsx("span", { className: alignClasses.label, children: getHeaderLabel(column.header) }) }) }),
|
|
56
|
+
extraContent != null ? /* @__PURE__ */ jsx("div", { className: styles.thOverlayExtras, children: extraContent }) : null
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
column.id
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { TableHeaderCell };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var SkeletonLoaderItem = require('../../../components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem');
|
|
5
|
+
var table_classes = require('../table.classes');
|
|
6
|
+
var styles = require('../Table.module.css');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
11
|
+
|
|
12
|
+
function TableLoadingBody({ rows, columns, hasSelection }) {
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: styles__default.default.body, children: Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: styles__default.default.row, children: [
|
|
14
|
+
hasSelection ? /* @__PURE__ */ jsxRuntime.jsx("td", { className: table_classes.cx(styles__default.default.cell, styles__default.default.selectionCell), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.cellContent, children: /* @__PURE__ */ jsxRuntime.jsx(SkeletonLoaderItem.SkeletonLoaderItem, { height: 20, width: 20 }) }) }) : null,
|
|
15
|
+
columns.map((column) => {
|
|
16
|
+
var _a;
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
+
"td",
|
|
19
|
+
{
|
|
20
|
+
className: table_classes.cx(
|
|
21
|
+
styles__default.default.cell,
|
|
22
|
+
column.divider === "left" && styles__default.default.dividerLeft,
|
|
23
|
+
column.divider === "right" && styles__default.default.dividerRight
|
|
24
|
+
),
|
|
25
|
+
"data-align": (_a = column.align) != null ? _a : "left",
|
|
26
|
+
"data-divider": column.divider,
|
|
27
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.cellContent, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.cellValueEllipsis, children: /* @__PURE__ */ jsxRuntime.jsx(SkeletonLoaderItem.SkeletonLoaderItem, { height: 20, width: "100%" }) }) })
|
|
28
|
+
},
|
|
29
|
+
column.id
|
|
30
|
+
);
|
|
31
|
+
})
|
|
32
|
+
] }, `loading-row-${rowIndex}`)) });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.TableLoadingBody = TableLoadingBody;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { SkeletonLoaderItem } from '../../../components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
|
|
3
|
+
import { cx } from '../table.classes';
|
|
4
|
+
import styles from '../Table.module.css';
|
|
5
|
+
|
|
6
|
+
function TableLoadingBody({ rows, columns, hasSelection }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("tbody", { className: styles.body, children: Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsxs("tr", { className: styles.row, children: [
|
|
8
|
+
hasSelection ? /* @__PURE__ */ jsx("td", { className: cx(styles.cell, styles.selectionCell), children: /* @__PURE__ */ jsx("div", { className: styles.cellContent, children: /* @__PURE__ */ jsx(SkeletonLoaderItem, { height: 20, width: 20 }) }) }) : null,
|
|
9
|
+
columns.map((column) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"td",
|
|
13
|
+
{
|
|
14
|
+
className: cx(
|
|
15
|
+
styles.cell,
|
|
16
|
+
column.divider === "left" && styles.dividerLeft,
|
|
17
|
+
column.divider === "right" && styles.dividerRight
|
|
18
|
+
),
|
|
19
|
+
"data-align": (_a = column.align) != null ? _a : "left",
|
|
20
|
+
"data-divider": column.divider,
|
|
21
|
+
children: /* @__PURE__ */ jsx("div", { className: styles.cellContent, children: /* @__PURE__ */ jsx("div", { className: styles.cellValueEllipsis, children: /* @__PURE__ */ jsx(SkeletonLoaderItem, { height: 20, width: "100%" }) }) })
|
|
22
|
+
},
|
|
23
|
+
column.id
|
|
24
|
+
);
|
|
25
|
+
})
|
|
26
|
+
] }, `loading-row-${rowIndex}`)) });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { TableLoadingBody };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|