@dbcdk/react-components 0.0.168 → 0.0.169
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/package.json +1 -1
- package/dist/assets/logo.cjs +0 -87
- package/dist/assets/logo.d.ts +0 -2
- package/dist/assets/logo.js +0 -85
- package/dist/client.cjs +0 -629
- package/dist/client.d.ts +0 -89
- package/dist/client.js +0 -90
- package/dist/components/accordion/Accordion.cjs +0 -127
- package/dist/components/accordion/Accordion.d.ts +0 -36
- package/dist/components/accordion/Accordion.js +0 -121
- package/dist/components/accordion/Accordion.module.css +0 -41
- package/dist/components/accordion/components/AccordionRow.cjs +0 -129
- package/dist/components/accordion/components/AccordionRow.d.ts +0 -14
- package/dist/components/accordion/components/AccordionRow.js +0 -123
- package/dist/components/accordion/components/AccordionRow.module.css +0 -129
- package/dist/components/alert/Alert.cjs +0 -52
- package/dist/components/alert/Alert.d.ts +0 -14
- package/dist/components/alert/Alert.js +0 -46
- package/dist/components/alert/Alert.module.css +0 -102
- package/dist/components/app-header/AppHeader.cjs +0 -14
- package/dist/components/app-header/AppHeader.d.ts +0 -8
- package/dist/components/app-header/AppHeader.js +0 -8
- package/dist/components/app-header/AppHeader.module.css +0 -74
- package/dist/components/attribute-chip/AttributeChip.cjs +0 -36
- package/dist/components/attribute-chip/AttributeChip.d.ts +0 -11
- package/dist/components/attribute-chip/AttributeChip.js +0 -30
- package/dist/components/attribute-chip/AttributeChip.module.css +0 -64
- package/dist/components/avatar/Avatar.cjs +0 -111
- package/dist/components/avatar/Avatar.d.ts +0 -17
- package/dist/components/avatar/Avatar.js +0 -86
- package/dist/components/avatar/Avatar.module.css +0 -91
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +0 -24
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +0 -12
- package/dist/components/breadcrumbs/Breadcrumbs.js +0 -18
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +0 -77
- package/dist/components/button/Button.cjs +0 -150
- package/dist/components/button/Button.d.ts +0 -18
- package/dist/components/button/Button.js +0 -125
- package/dist/components/button/Button.module.css +0 -266
- package/dist/components/button-select/ButtonSelect.cjs +0 -35
- package/dist/components/button-select/ButtonSelect.d.ts +0 -16
- package/dist/components/button-select/ButtonSelect.js +0 -29
- package/dist/components/button-select/ButtonSelect.module.css +0 -40
- package/dist/components/card/Card.cjs +0 -109
- package/dist/components/card/Card.d.ts +0 -37
- package/dist/components/card/Card.js +0 -103
- package/dist/components/card/Card.module.css +0 -191
- package/dist/components/card/components/CardMeta.cjs +0 -62
- package/dist/components/card/components/CardMeta.d.ts +0 -16
- package/dist/components/card/components/CardMeta.js +0 -55
- package/dist/components/card/components/CardMeta.module.css +0 -55
- package/dist/components/card-container/CardContainer.cjs +0 -34
- package/dist/components/card-container/CardContainer.d.ts +0 -12
- package/dist/components/card-container/CardContainer.js +0 -28
- package/dist/components/card-container/CardContainer.module.css +0 -63
- package/dist/components/chip/Chip.cjs +0 -65
- package/dist/components/chip/Chip.d.ts +0 -16
- package/dist/components/chip/Chip.js +0 -59
- package/dist/components/chip/Chip.module.css +0 -247
- package/dist/components/circle/Circle.cjs +0 -39
- package/dist/components/circle/Circle.d.ts +0 -14
- package/dist/components/circle/Circle.js +0 -33
- package/dist/components/circle/Circle.module.css +0 -138
- package/dist/components/clear-button/ClearButton.cjs +0 -33
- package/dist/components/clear-button/ClearButton.d.ts +0 -8
- package/dist/components/clear-button/ClearButton.js +0 -27
- package/dist/components/clear-button/ClearButton.module.css +0 -26
- package/dist/components/code-block/CodeBlock.cjs +0 -107
- package/dist/components/code-block/CodeBlock.d.ts +0 -11
- package/dist/components/code-block/CodeBlock.js +0 -101
- package/dist/components/code-block/CodeBlock.module.css +0 -135
- package/dist/components/copy-button/CopyButton.cjs +0 -139
- package/dist/components/copy-button/CopyButton.d.ts +0 -13
- package/dist/components/copy-button/CopyButton.js +0 -133
- package/dist/components/copy-button/CopyButton.module.css +0 -22
- package/dist/components/datetime-picker/DateTimePicker.cjs +0 -563
- package/dist/components/datetime-picker/DateTimePicker.d.ts +0 -66
- package/dist/components/datetime-picker/DateTimePicker.js +0 -557
- package/dist/components/datetime-picker/DateTimePicker.module.css +0 -155
- package/dist/components/datetime-picker/dateTimeHelpers.cjs +0 -185
- package/dist/components/datetime-picker/dateTimeHelpers.d.ts +0 -37
- package/dist/components/datetime-picker/dateTimeHelpers.js +0 -166
- package/dist/components/divider/Divider.cjs +0 -22
- package/dist/components/divider/Divider.d.ts +0 -5
- package/dist/components/divider/Divider.js +0 -20
- package/dist/components/environment-banner/EnvironmentBanner.cjs +0 -20
- package/dist/components/environment-banner/EnvironmentBanner.d.ts +0 -13
- package/dist/components/environment-banner/EnvironmentBanner.js +0 -14
- package/dist/components/environment-banner/EnvironmentBanner.module.css +0 -54
- package/dist/components/filter-field/FilterField.cjs +0 -288
- package/dist/components/filter-field/FilterField.d.ts +0 -37
- package/dist/components/filter-field/FilterField.js +0 -281
- package/dist/components/filter-field/FilterField.module.css +0 -324
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.cjs +0 -115
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.d.ts +0 -35
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +0 -108
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +0 -59
- package/dist/components/forms/checkbox/Checkbox.cjs +0 -99
- package/dist/components/forms/checkbox/Checkbox.d.ts +0 -39
- package/dist/components/forms/checkbox/Checkbox.js +0 -93
- package/dist/components/forms/checkbox/Checkbox.module.css +0 -110
- package/dist/components/forms/checkbox-group/CheckboxGroup.cjs +0 -121
- package/dist/components/forms/checkbox-group/CheckboxGroup.d.ts +0 -47
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +0 -115
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +0 -115
- package/dist/components/forms/file-upload/FileUpload.cjs +0 -127
- package/dist/components/forms/file-upload/FileUpload.d.ts +0 -18
- package/dist/components/forms/file-upload/FileUpload.js +0 -121
- package/dist/components/forms/file-upload/FileUpload.module.css +0 -75
- package/dist/components/forms/form-select/FormSelect.cjs +0 -191
- package/dist/components/forms/form-select/FormSelect.d.ts +0 -35
- package/dist/components/forms/form-select/FormSelect.js +0 -166
- package/dist/components/forms/form-select/FormSelect.module.css +0 -236
- package/dist/components/forms/input/Input.cjs +0 -190
- package/dist/components/forms/input/Input.d.ts +0 -37
- package/dist/components/forms/input/Input.js +0 -184
- package/dist/components/forms/input/Input.module.css +0 -478
- package/dist/components/forms/input-container/InputContainer.cjs +0 -72
- package/dist/components/forms/input-container/InputContainer.d.ts +0 -18
- package/dist/components/forms/input-container/InputContainer.js +0 -66
- package/dist/components/forms/input-container/InputContainer.module.css +0 -59
- package/dist/components/forms/multi-select/MultiSelect.cjs +0 -229
- package/dist/components/forms/multi-select/MultiSelect.d.ts +0 -26
- package/dist/components/forms/multi-select/MultiSelect.js +0 -227
- package/dist/components/forms/radio-buttons/RadioButton.cjs +0 -94
- package/dist/components/forms/radio-buttons/RadioButton.d.ts +0 -46
- package/dist/components/forms/radio-buttons/RadioButton.js +0 -88
- package/dist/components/forms/radio-buttons/RadioButtonGroup.cjs +0 -74
- package/dist/components/forms/radio-buttons/RadioButtonGroup.d.ts +0 -25
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +0 -72
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +0 -131
- package/dist/components/forms/select/Select.cjs +0 -287
- package/dist/components/forms/select/Select.d.ts +0 -24
- package/dist/components/forms/select/Select.js +0 -281
- package/dist/components/forms/select/Select.module.css +0 -41
- package/dist/components/forms/switch/Switch.cjs +0 -93
- package/dist/components/forms/switch/Switch.d.ts +0 -37
- package/dist/components/forms/switch/Switch.js +0 -87
- package/dist/components/forms/switch/Switch.module.css +0 -89
- package/dist/components/forms/text-area/Textarea.cjs +0 -118
- package/dist/components/forms/text-area/Textarea.d.ts +0 -17
- package/dist/components/forms/text-area/Textarea.js +0 -112
- package/dist/components/forms/text-area/Textarea.module.css +0 -70
- package/dist/components/forms/typeahead/Typeahead.cjs +0 -792
- package/dist/components/forms/typeahead/Typeahead.d.ts +0 -40
- package/dist/components/forms/typeahead/Typeahead.js +0 -768
- package/dist/components/forms/typeahead/Typeahead.module.css +0 -38
- package/dist/components/grid/Grid.cjs +0 -58
- package/dist/components/grid/Grid.d.ts +0 -29
- package/dist/components/grid/Grid.js +0 -51
- package/dist/components/grid/Grid.module.css +0 -44
- package/dist/components/headline/CollapsibleHeadline.cjs +0 -84
- package/dist/components/headline/CollapsibleHeadline.d.ts +0 -25
- package/dist/components/headline/CollapsibleHeadline.js +0 -78
- package/dist/components/headline/Headline.cjs +0 -59
- package/dist/components/headline/Headline.d.ts +0 -20
- package/dist/components/headline/Headline.js +0 -53
- package/dist/components/headline/Headline.module.css +0 -167
- package/dist/components/highlighted-text/HighlightedText.cjs +0 -21
- package/dist/components/highlighted-text/HighlightedText.d.ts +0 -7
- package/dist/components/highlighted-text/HighlightedText.js +0 -19
- package/dist/components/hyperlink/Hyperlink.cjs +0 -113
- package/dist/components/hyperlink/Hyperlink.d.ts +0 -24
- package/dist/components/hyperlink/Hyperlink.js +0 -88
- package/dist/components/hyperlink/Hyperlink.module.css +0 -121
- package/dist/components/icon/Icon.cjs +0 -39
- package/dist/components/icon/Icon.d.ts +0 -14
- package/dist/components/icon/Icon.js +0 -32
- package/dist/components/icon/Icon.module.css +0 -50
- package/dist/components/inline-status/InlineStatus.cjs +0 -39
- package/dist/components/inline-status/InlineStatus.d.ts +0 -11
- package/dist/components/inline-status/InlineStatus.js +0 -33
- package/dist/components/inline-status/InlineStatus.module.css +0 -98
- package/dist/components/interval-select/IntervalSelect.cjs +0 -203
- package/dist/components/interval-select/IntervalSelect.d.ts +0 -37
- package/dist/components/interval-select/IntervalSelect.js +0 -201
- package/dist/components/json-viewer/JsonNode.cjs +0 -124
- package/dist/components/json-viewer/JsonNode.d.ts +0 -3
- package/dist/components/json-viewer/JsonNode.js +0 -118
- package/dist/components/json-viewer/JsonViewer.cjs +0 -164
- package/dist/components/json-viewer/JsonViewer.d.ts +0 -4
- package/dist/components/json-viewer/JsonViewer.js +0 -158
- package/dist/components/json-viewer/JsonViewer.module.css +0 -346
- package/dist/components/json-viewer/types.cjs +0 -2
- package/dist/components/json-viewer/types.d.ts +0 -33
- package/dist/components/json-viewer/types.js +0 -1
- package/dist/components/json-viewer/useClipboardStatus.cjs +0 -15
- package/dist/components/json-viewer/useClipboardStatus.d.ts +0 -4
- package/dist/components/json-viewer/useClipboardStatus.js +0 -13
- package/dist/components/json-viewer/utils.cjs +0 -126
- package/dist/components/json-viewer/utils.d.ts +0 -17
- package/dist/components/json-viewer/utils.js +0 -111
- package/dist/components/lightbox/Lightbox.cjs +0 -291
- package/dist/components/lightbox/Lightbox.d.ts +0 -36
- package/dist/components/lightbox/Lightbox.js +0 -285
- package/dist/components/lightbox/Lightbox.module.css +0 -214
- package/dist/components/media-card/MediaCard.cjs +0 -87
- package/dist/components/media-card/MediaCard.d.ts +0 -21
- package/dist/components/media-card/MediaCard.js +0 -80
- package/dist/components/media-card/MediaCard.module.css +0 -91
- package/dist/components/menu/Menu.cjs +0 -455
- package/dist/components/menu/Menu.d.ts +0 -102
- package/dist/components/menu/Menu.js +0 -430
- package/dist/components/menu/Menu.module.css +0 -286
- package/dist/components/meta-bar/MetaBar.cjs +0 -28
- package/dist/components/meta-bar/MetaBar.d.ts +0 -12
- package/dist/components/meta-bar/MetaBar.js +0 -22
- package/dist/components/meta-bar/MetaBar.module.css +0 -27
- package/dist/components/metric-tile/MetricTile.cjs +0 -33
- package/dist/components/metric-tile/MetricTile.d.ts +0 -15
- package/dist/components/metric-tile/MetricTile.js +0 -27
- package/dist/components/metric-tile/MetricTile.module.css +0 -103
- package/dist/components/nav-bar/NavBar.cjs +0 -107
- package/dist/components/nav-bar/NavBar.d.ts +0 -44
- package/dist/components/nav-bar/NavBar.js +0 -101
- package/dist/components/nav-bar/NavBar.module.css +0 -243
- package/dist/components/overlay/fade-overlay/FadeOverlay.cjs +0 -30
- package/dist/components/overlay/fade-overlay/FadeOverlay.d.ts +0 -13
- package/dist/components/overlay/fade-overlay/FadeOverlay.js +0 -24
- package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +0 -54
- package/dist/components/overlay/modal/Modal.cjs +0 -191
- package/dist/components/overlay/modal/Modal.d.ts +0 -29
- package/dist/components/overlay/modal/Modal.js +0 -185
- package/dist/components/overlay/modal/Modal.module.css +0 -112
- package/dist/components/overlay/modal/provider/ModalProvider.cjs +0 -98
- package/dist/components/overlay/modal/provider/ModalProvider.d.ts +0 -23
- package/dist/components/overlay/modal/provider/ModalProvider.js +0 -95
- package/dist/components/overlay/side-panel/SidePanel.cjs +0 -173
- package/dist/components/overlay/side-panel/SidePanel.d.ts +0 -25
- package/dist/components/overlay/side-panel/SidePanel.js +0 -167
- package/dist/components/overlay/side-panel/SidePanel.module.css +0 -177
- package/dist/components/overlay/side-panel/useSidePanel.cjs +0 -16
- package/dist/components/overlay/side-panel/useSidePanel.d.ts +0 -5
- package/dist/components/overlay/side-panel/useSidePanel.js +0 -14
- package/dist/components/overlay/tooltip/Tooltip.cjs +0 -56
- package/dist/components/overlay/tooltip/Tooltip.d.ts +0 -12
- package/dist/components/overlay/tooltip/Tooltip.js +0 -54
- package/dist/components/overlay/tooltip/Tooltip.module.css +0 -104
- package/dist/components/overlay/tooltip/TooltipProvider.cjs +0 -238
- package/dist/components/overlay/tooltip/TooltipProvider.d.ts +0 -20
- package/dist/components/overlay/tooltip/TooltipProvider.js +0 -231
- package/dist/components/overlay/tooltip/useTooltipTrigger.cjs +0 -117
- package/dist/components/overlay/tooltip/useTooltipTrigger.d.ts +0 -28
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +0 -115
- package/dist/components/page/Page.cjs +0 -64
- package/dist/components/page/Page.d.ts +0 -21
- package/dist/components/page/Page.js +0 -58
- package/dist/components/page/Page.module.css +0 -95
- package/dist/components/page-layout/PageLayout.cjs +0 -126
- package/dist/components/page-layout/PageLayout.d.ts +0 -47
- package/dist/components/page-layout/PageLayout.js +0 -120
- package/dist/components/page-layout/PageLayout.module.css +0 -333
- package/dist/components/page-layout/components/footer/Footer.cjs +0 -53
- package/dist/components/page-layout/components/footer/Footer.d.ts +0 -14
- package/dist/components/page-layout/components/footer/Footer.js +0 -47
- package/dist/components/page-layout/components/footer/Footer.module.css +0 -86
- package/dist/components/pagination/Pagination.cjs +0 -161
- package/dist/components/pagination/Pagination.d.ts +0 -21
- package/dist/components/pagination/Pagination.js +0 -155
- package/dist/components/pagination/Pagination.module.css +0 -25
- package/dist/components/panel/Panel.cjs +0 -38
- package/dist/components/panel/Panel.d.ts +0 -13
- package/dist/components/panel/Panel.js +0 -32
- package/dist/components/panel/Panel.module.css +0 -30
- package/dist/components/popover/Popover.cjs +0 -331
- package/dist/components/popover/Popover.d.ts +0 -27
- package/dist/components/popover/Popover.js +0 -307
- package/dist/components/popover/Popover.module.css +0 -52
- package/dist/components/search-box/SearchBox.cjs +0 -297
- package/dist/components/search-box/SearchBox.d.ts +0 -30
- package/dist/components/search-box/SearchBox.js +0 -291
- package/dist/components/search-box/SearchBox.module.css +0 -27
- package/dist/components/section-label/SectionLabel.cjs +0 -18
- package/dist/components/section-label/SectionLabel.d.ts +0 -5
- package/dist/components/section-label/SectionLabel.js +0 -12
- package/dist/components/section-label/SectionLabel.module.css +0 -12
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +0 -130
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +0 -27
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +0 -124
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +0 -187
- package/dist/components/sidebar/Sidebar.cjs +0 -41
- package/dist/components/sidebar/Sidebar.d.ts +0 -23
- package/dist/components/sidebar/Sidebar.js +0 -39
- package/dist/components/sidebar/components/SidebarItem.cjs +0 -29
- package/dist/components/sidebar/components/SidebarItem.d.ts +0 -11
- package/dist/components/sidebar/components/SidebarItem.js +0 -27
- package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +0 -153
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +0 -13
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +0 -147
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +0 -47
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +0 -220
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +0 -18
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +0 -213
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +0 -293
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +0 -54
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +0 -13
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +0 -47
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +0 -117
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +0 -61
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +0 -4
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +0 -55
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +0 -20
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +0 -96
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.d.ts +0 -7
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +0 -90
- package/dist/components/sidebar/providers/SidebarProvider.cjs +0 -223
- package/dist/components/sidebar/providers/SidebarProvider.d.ts +0 -34
- package/dist/components/sidebar/providers/SidebarProvider.js +0 -220
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +0 -442
- package/dist/components/skeleton-loader/SkeletonLoader.d.ts +0 -9
- package/dist/components/skeleton-loader/SkeletonLoader.js +0 -440
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +0 -42
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.d.ts +0 -11
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +0 -36
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +0 -55
- package/dist/components/split-button/SplitButton.cjs +0 -46
- package/dist/components/split-button/SplitButton.d.ts +0 -16
- package/dist/components/split-button/SplitButton.js +0 -40
- package/dist/components/split-button/SplitButton.module.css +0 -32
- package/dist/components/split-pane/SplitPane.cjs +0 -191
- package/dist/components/split-pane/SplitPane.d.ts +0 -21
- package/dist/components/split-pane/SplitPane.js +0 -182
- package/dist/components/split-pane/SplitPane.module.css +0 -118
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +0 -129
- package/dist/components/split-pane/provider/SplitPaneContext.d.ts +0 -24
- package/dist/components/split-pane/provider/SplitPaneContext.js +0 -121
- package/dist/components/stack/Stack.cjs +0 -56
- package/dist/components/stack/Stack.d.ts +0 -26
- package/dist/components/stack/Stack.js +0 -50
- package/dist/components/stack/Stack.module.css +0 -77
- package/dist/components/state-page/StatePage.cjs +0 -48
- package/dist/components/state-page/StatePage.d.ts +0 -10
- package/dist/components/state-page/StatePage.js +0 -42
- package/dist/components/state-page/StatePage.module.css +0 -9
- package/dist/components/state-page/empty.cjs +0 -664
- package/dist/components/state-page/empty.d.ts +0 -2
- package/dist/components/state-page/empty.js +0 -662
- package/dist/components/state-page/error.cjs +0 -310
- package/dist/components/state-page/error.d.ts +0 -2
- package/dist/components/state-page/error.js +0 -308
- package/dist/components/state-page/notFound.cjs +0 -243
- package/dist/components/state-page/notFound.d.ts +0 -2
- package/dist/components/state-page/notFound.js +0 -241
- package/dist/components/sticky-footer-layout/StickyFooterLayout.cjs +0 -98
- package/dist/components/sticky-footer-layout/StickyFooterLayout.d.ts +0 -14
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +0 -96
- package/dist/components/table/Table.cjs +0 -240
- package/dist/components/table/Table.d.ts +0 -4
- package/dist/components/table/Table.js +0 -234
- package/dist/components/table/Table.module.css +0 -704
- package/dist/components/table/Table.types.cjs +0 -2
- package/dist/components/table/Table.types.d.ts +0 -91
- package/dist/components/table/Table.types.js +0 -1
- package/dist/components/table/TanstackTable.cjs +0 -191
- package/dist/components/table/TanstackTable.d.ts +0 -15
- package/dist/components/table/TanstackTable.js +0 -166
- package/dist/components/table/components/TableBody.cjs +0 -58
- package/dist/components/table/components/TableBody.d.ts +0 -28
- package/dist/components/table/components/TableBody.js +0 -52
- package/dist/components/table/components/TableHeader.cjs +0 -56
- package/dist/components/table/components/TableHeader.d.ts +0 -16
- package/dist/components/table/components/TableHeader.js +0 -50
- package/dist/components/table/components/TableHeaderCell.cjs +0 -68
- package/dist/components/table/components/TableHeaderCell.d.ts +0 -12
- package/dist/components/table/components/TableHeaderCell.js +0 -62
- package/dist/components/table/components/TablePagination.cjs +0 -2
- package/dist/components/table/components/TablePagination.d.ts +0 -0
- package/dist/components/table/components/TablePagination.js +0 -1
- package/dist/components/table/components/TableRow.cjs +0 -287
- package/dist/components/table/components/TableRow.d.ts +0 -28
- package/dist/components/table/components/TableRow.js +0 -281
- package/dist/components/table/components/TableSelectionCell.cjs +0 -41
- package/dist/components/table/components/TableSelectionCell.d.ts +0 -9
- package/dist/components/table/components/TableSelectionCell.js +0 -35
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +0 -25
- package/dist/components/table/components/column-resizer/ColumnResizer.d.ts +0 -7
- package/dist/components/table/components/column-resizer/ColumnResizer.js +0 -19
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +0 -24
- package/dist/components/table/components/empty-state/EmptyState.cjs +0 -33
- package/dist/components/table/components/empty-state/EmptyState.d.ts +0 -21
- package/dist/components/table/components/empty-state/EmptyState.js +0 -31
- package/dist/components/table/components/empty-state/EmptyState.module.css +0 -4
- package/dist/components/table/components/table-settings/TableSettings.cjs +0 -139
- package/dist/components/table/components/table-settings/TableSettings.d.ts +0 -18
- package/dist/components/table/components/table-settings/TableSettings.js +0 -137
- package/dist/components/table/hooks/useTableRowInteractions.cjs +0 -47
- package/dist/components/table/hooks/useTableRowInteractions.d.ts +0 -15
- package/dist/components/table/hooks/useTableRowInteractions.js +0 -45
- package/dist/components/table/table.classes.cjs +0 -49
- package/dist/components/table/table.classes.d.ts +0 -10
- package/dist/components/table/table.classes.js +0 -40
- package/dist/components/table/table.utils.cjs +0 -59
- package/dist/components/table/table.utils.d.ts +0 -18
- package/dist/components/table/table.utils.js +0 -46
- package/dist/components/table/tanstackTable.utils.cjs +0 -181
- package/dist/components/table/tanstackTable.utils.d.ts +0 -29
- package/dist/components/table/tanstackTable.utils.js +0 -174
- package/dist/components/tabs/Tabs.cjs +0 -187
- package/dist/components/tabs/Tabs.d.ts +0 -52
- package/dist/components/tabs/Tabs.js +0 -181
- package/dist/components/tabs/Tabs.module.css +0 -263
- package/dist/components/theme-button/ThemeButton.cjs +0 -75
- package/dist/components/theme-button/ThemeButton.d.ts +0 -8
- package/dist/components/theme-button/ThemeButton.js +0 -72
- package/dist/components/toast/Toast.cjs +0 -68
- package/dist/components/toast/Toast.d.ts +0 -15
- package/dist/components/toast/Toast.js +0 -62
- package/dist/components/toast/Toast.module.css +0 -165
- package/dist/components/toast/provider/ToastProvider.cjs +0 -105
- package/dist/components/toast/provider/ToastProvider.d.ts +0 -24
- package/dist/components/toast/provider/ToastProvider.js +0 -97
- package/dist/components/user-display/UserDisplay.cjs +0 -22
- package/dist/components/user-display/UserDisplay.d.ts +0 -10
- package/dist/components/user-display/UserDisplay.js +0 -16
- package/dist/components/user-display/UserDisplay.module.css +0 -25
- package/dist/constants/chart-colors.cjs +0 -10
- package/dist/constants/chart-colors.d.ts +0 -2
- package/dist/constants/chart-colors.js +0 -8
- package/dist/constants/chart-colors.types.cjs +0 -2
- package/dist/constants/chart-colors.types.d.ts +0 -3
- package/dist/constants/chart-colors.types.js +0 -1
- package/dist/constants/severity.cjs +0 -33
- package/dist/constants/severity.d.ts +0 -4
- package/dist/constants/severity.js +0 -29
- package/dist/constants/severity.types.cjs +0 -2
- package/dist/constants/severity.types.d.ts +0 -1
- package/dist/constants/severity.types.js +0 -1
- package/dist/constants/sizes.cjs +0 -11
- package/dist/constants/sizes.d.ts +0 -2
- package/dist/constants/sizes.js +0 -9
- package/dist/hooks/useDeviceSize.cjs +0 -33
- package/dist/hooks/useDeviceSize.d.ts +0 -2
- package/dist/hooks/useDeviceSize.js +0 -31
- package/dist/hooks/useListNavigation.cjs +0 -237
- package/dist/hooks/useListNavigation.d.ts +0 -24
- package/dist/hooks/useListNavigation.js +0 -235
- package/dist/hooks/usePagination.cjs +0 -144
- package/dist/hooks/usePagination.d.ts +0 -38
- package/dist/hooks/usePagination.js +0 -142
- package/dist/hooks/usePersistentState.cjs +0 -60
- package/dist/hooks/usePersistentState.d.ts +0 -33
- package/dist/hooks/usePersistentState.js +0 -58
- package/dist/hooks/useSorting.cjs +0 -120
- package/dist/hooks/useSorting.d.ts +0 -50
- package/dist/hooks/useSorting.js +0 -117
- package/dist/hooks/useTableData.cjs +0 -75
- package/dist/hooks/useTableData.d.ts +0 -42
- package/dist/hooks/useTableData.js +0 -73
- package/dist/hooks/useTableSelection.cjs +0 -172
- package/dist/hooks/useTableSelection.d.ts +0 -27
- package/dist/hooks/useTableSelection.js +0 -170
- package/dist/hooks/useTableSettings.cjs +0 -90
- package/dist/hooks/useTableSettings.d.ts +0 -26
- package/dist/hooks/useTableSettings.js +0 -87
- package/dist/hooks/useTheme.cjs +0 -64
- package/dist/hooks/useTheme.d.ts +0 -7
- package/dist/hooks/useTheme.js +0 -62
- package/dist/hooks/useTimeDuration.cjs +0 -75
- package/dist/hooks/useTimeDuration.d.ts +0 -26
- package/dist/hooks/useTimeDuration.js +0 -73
- package/dist/hooks/useViewportFill.cjs +0 -82
- package/dist/hooks/useViewportFill.d.ts +0 -13
- package/dist/hooks/useViewportFill.js +0 -80
- package/dist/index.cjs +0 -292
- package/dist/index.css +0 -75
- package/dist/index.d.ts +0 -42
- package/dist/index.js +0 -41
- package/dist/styles/animation.cjs +0 -9
- package/dist/styles/animation.d.ts +0 -5
- package/dist/styles/animation.js +0 -7
- package/dist/styles/css-helper-classes/flex.css +0 -113
- package/dist/styles/css-helper-classes/spacing.css +0 -312
- package/dist/styles/css-helper-classes/typography.css +0 -11
- package/dist/styles/fonts/Roboto/OFL.txt +0 -93
- package/dist/styles/fonts/Roboto/README.txt +0 -118
- package/dist/styles/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Tajawal/OFL.txt +0 -93
- package/dist/styles/fonts/Tajawal/Tajawal-Black.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Bold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Light.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Medium.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Regular.ttf +0 -0
- package/dist/styles/styles.css +0 -377
- package/dist/styles/themes/dbc/base.css +0 -141
- package/dist/styles/themes/dbc/colors.css +0 -320
- package/dist/styles/themes/filmstriben-budget/theme.css +0 -22
- package/dist/styles/themes/types.cjs +0 -2
- package/dist/styles/themes/types.d.ts +0 -16
- package/dist/styles/themes/types.js +0 -1
- package/dist/styles.css +0 -377
- package/dist/tanstack.cjs +0 -26
- package/dist/tanstack.d.ts +0 -3
- package/dist/tanstack.js +0 -3
- package/dist/themes/dbc.css +0 -3
- package/dist/themes/filmstriben-budget.css +0 -3
- package/dist/types/a11y-props.types.cjs +0 -2
- package/dist/types/a11y-props.types.d.ts +0 -8
- package/dist/types/a11y-props.types.js +0 -1
- 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/types/sizes.types.d.ts +0 -2
- package/dist/types/sizes.types.js +0 -1
- package/dist/utils/arrays/nested-filtering.cjs +0 -40
- package/dist/utils/arrays/nested-filtering.d.ts +0 -9
- package/dist/utils/arrays/nested-filtering.js +0 -38
- package/dist/utils/cookie.utils.cjs +0 -44
- package/dist/utils/cookie.utils.d.ts +0 -19
- package/dist/utils/cookie.utils.js +0 -40
- package/dist/utils/date/formatDate.cjs +0 -49
- package/dist/utils/date/formatDate.d.ts +0 -28
- package/dist/utils/date/formatDate.js +0 -47
- package/dist/utils/localStorage.utils.cjs +0 -53
- package/dist/utils/localStorage.utils.d.ts +0 -19
- package/dist/utils/localStorage.utils.js +0 -49
- package/dist/utils/text/get-highlighted-segments.cjs +0 -49
- package/dist/utils/text/get-highlighted-segments.d.ts +0 -5
- package/dist/utils/text/get-highlighted-segments.js +0 -47
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
-
import type { JSX, ReactNode } from 'react';
|
|
3
|
-
import { ViewMode } from '../../../../hooks/useTableSettings';
|
|
4
|
-
import { ButtonSize } from '../../../button/Button';
|
|
5
|
-
interface TableSettingsProps<T extends Record<string, any>> {
|
|
6
|
-
handleChangeViewMode: (mode: ViewMode) => void;
|
|
7
|
-
viewMode: ViewMode;
|
|
8
|
-
columns?: ColumnDef<T>[];
|
|
9
|
-
visibleColumnIds?: string[];
|
|
10
|
-
onVisibleColumnIdsChange?: (nextVisibleIds: string[]) => void;
|
|
11
|
-
columnsLabel?: string;
|
|
12
|
-
allPresetLabel?: string;
|
|
13
|
-
standardPresetLabel?: string;
|
|
14
|
-
buttonSize?: ButtonSize;
|
|
15
|
-
additionalSettings?: (close?: () => void) => ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export declare function TableSettings<T extends Record<string, any>>({ viewMode, handleChangeViewMode, columns, visibleColumnIds, onVisibleColumnIdsChange, columnsLabel, allPresetLabel, standardPresetLabel, buttonSize, additionalSettings, }: TableSettingsProps<T>): JSX.Element;
|
|
18
|
-
export {};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { ListChevronsUpDown, Settings } from 'lucide-react';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
import { Button } from '../../../button/Button';
|
|
6
|
-
import { Menu } from '../../../menu/Menu';
|
|
7
|
-
import { Popover } from '../../../popover/Popover';
|
|
8
|
-
|
|
9
|
-
function TableSettings({
|
|
10
|
-
viewMode,
|
|
11
|
-
handleChangeViewMode,
|
|
12
|
-
columns = [],
|
|
13
|
-
visibleColumnIds = [],
|
|
14
|
-
onVisibleColumnIdsChange,
|
|
15
|
-
columnsLabel = "Kolonner",
|
|
16
|
-
allPresetLabel = "Alle",
|
|
17
|
-
standardPresetLabel = "Standard",
|
|
18
|
-
buttonSize = "sm",
|
|
19
|
-
additionalSettings
|
|
20
|
-
}) {
|
|
21
|
-
const handleViewModeChange = (mode, close) => {
|
|
22
|
-
handleChangeViewMode(mode === "wrapped" ? "compact" : "wrapped");
|
|
23
|
-
close == null ? void 0 : close();
|
|
24
|
-
};
|
|
25
|
-
const hideableColumns = useMemo(() => columns.filter((c) => c.enableHiding !== false), [columns]);
|
|
26
|
-
const allPresetIds = useMemo(() => hideableColumns.map((c) => c.id), [hideableColumns]);
|
|
27
|
-
const standardPresetIds = useMemo(
|
|
28
|
-
() => hideableColumns.filter((c) => {
|
|
29
|
-
var _a;
|
|
30
|
-
return ((_a = c.meta) == null ? void 0 : _a.hidden) !== true;
|
|
31
|
-
}).map((c) => c.id),
|
|
32
|
-
[hideableColumns]
|
|
33
|
-
);
|
|
34
|
-
const visibleSet = useMemo(() => new Set(visibleColumnIds), [visibleColumnIds]);
|
|
35
|
-
const visibleCount = useMemo(() => {
|
|
36
|
-
return hideableColumns.reduce((acc, c) => {
|
|
37
|
-
var _a;
|
|
38
|
-
return acc + (visibleSet.has((_a = c.id) != null ? _a : "") ? 1 : 0);
|
|
39
|
-
}, 0);
|
|
40
|
-
}, [hideableColumns, visibleSet]);
|
|
41
|
-
const setVisibleIds = (nextIds) => {
|
|
42
|
-
if (!onVisibleColumnIdsChange) return;
|
|
43
|
-
const safe = nextIds.length > 0 ? nextIds : standardPresetIds.length > 0 ? standardPresetIds : allPresetIds;
|
|
44
|
-
onVisibleColumnIdsChange(
|
|
45
|
-
safe.filter((id) => typeof id === "string" && Boolean(id))
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
const toggleColumn = (id, nextVisible) => {
|
|
49
|
-
const next = new Set(visibleColumnIds);
|
|
50
|
-
if (nextVisible) next.add(id);
|
|
51
|
-
else next.delete(id);
|
|
52
|
-
setVisibleIds(Array.from(next));
|
|
53
|
-
};
|
|
54
|
-
const isAllActive = useMemo(() => {
|
|
55
|
-
if (!hideableColumns.length) return false;
|
|
56
|
-
return hideableColumns.every((c) => c.id && visibleSet.has(c.id));
|
|
57
|
-
}, [hideableColumns, visibleSet]);
|
|
58
|
-
const isStandardActive = useMemo(() => {
|
|
59
|
-
if (!hideableColumns.length) return false;
|
|
60
|
-
const std = new Set(standardPresetIds);
|
|
61
|
-
return hideableColumns.every((c) => c.id && visibleSet.has(c.id) === std.has(c.id));
|
|
62
|
-
}, [hideableColumns, visibleSet, standardPresetIds]);
|
|
63
|
-
const presetRadioName = "table-columns-preset";
|
|
64
|
-
return /* @__PURE__ */ jsx(
|
|
65
|
-
Popover,
|
|
66
|
-
{
|
|
67
|
-
trigger: (onClick, icon) => /* @__PURE__ */ jsxs(Button, { size: buttonSize, onClick, type: "button", children: [
|
|
68
|
-
/* @__PURE__ */ jsx(Settings, {}),
|
|
69
|
-
icon
|
|
70
|
-
] }),
|
|
71
|
-
children: (close) => /* @__PURE__ */ jsxs(Menu, { children: [
|
|
72
|
-
additionalSettings == null ? void 0 : additionalSettings(close),
|
|
73
|
-
/* @__PURE__ */ jsx(Menu.Item, { active: viewMode === "wrapped", children: /* @__PURE__ */ jsxs("button", { type: "button", onClick: () => handleViewModeChange(viewMode, close), children: [
|
|
74
|
-
/* @__PURE__ */ jsx(ListChevronsUpDown, {}),
|
|
75
|
-
"Ombryd tekst"
|
|
76
|
-
] }) }),
|
|
77
|
-
hideableColumns.length > 0 && onVisibleColumnIdsChange ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
-
/* @__PURE__ */ jsx(Menu.Separator, {}),
|
|
79
|
-
/* @__PURE__ */ jsx("div", { style: { padding: "6px 10px", fontSize: 12, opacity: 0.7 }, children: columnsLabel }),
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
Menu.RadioItem,
|
|
82
|
-
{
|
|
83
|
-
name: presetRadioName,
|
|
84
|
-
value: "all",
|
|
85
|
-
checked: isAllActive,
|
|
86
|
-
label: allPresetLabel,
|
|
87
|
-
onValueChange: () => {
|
|
88
|
-
setVisibleIds(
|
|
89
|
-
allPresetIds.filter((id) => typeof id === "string" && Boolean(id))
|
|
90
|
-
);
|
|
91
|
-
close == null ? void 0 : close();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
/* @__PURE__ */ jsx(
|
|
96
|
-
Menu.RadioItem,
|
|
97
|
-
{
|
|
98
|
-
name: presetRadioName,
|
|
99
|
-
value: "standard",
|
|
100
|
-
checked: isStandardActive,
|
|
101
|
-
label: standardPresetLabel,
|
|
102
|
-
onValueChange: () => {
|
|
103
|
-
setVisibleIds(
|
|
104
|
-
standardPresetIds.filter(
|
|
105
|
-
(id) => typeof id === "string" && Boolean(id)
|
|
106
|
-
)
|
|
107
|
-
);
|
|
108
|
-
close == null ? void 0 : close();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
/* @__PURE__ */ jsx(Menu.Separator, {}),
|
|
113
|
-
hideableColumns.map((col) => {
|
|
114
|
-
const isVisible = col.id ? visibleSet.has(col.id) : false;
|
|
115
|
-
const disableUncheckingLast = isVisible && visibleCount <= 1;
|
|
116
|
-
const label = col.header;
|
|
117
|
-
return /* @__PURE__ */ jsx(
|
|
118
|
-
Menu.CheckItem,
|
|
119
|
-
{
|
|
120
|
-
checked: isVisible,
|
|
121
|
-
disabled: disableUncheckingLast,
|
|
122
|
-
label,
|
|
123
|
-
onCheckedChange: (nextChecked) => {
|
|
124
|
-
if (disableUncheckingLast) return;
|
|
125
|
-
toggleColumn(col.id, nextChecked);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
col.id
|
|
129
|
-
);
|
|
130
|
-
})
|
|
131
|
-
] }) : null
|
|
132
|
-
] })
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export { TableSettings };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var react = require('react');
|
|
4
|
-
var table_utils = require('../table.utils');
|
|
5
|
-
|
|
6
|
-
function useTableRowInteractions({
|
|
7
|
-
row,
|
|
8
|
-
rowId,
|
|
9
|
-
isSelected,
|
|
10
|
-
canSelect,
|
|
11
|
-
onRowClick,
|
|
12
|
-
onRowSelect
|
|
13
|
-
}) {
|
|
14
|
-
const handleRowClick = react.useCallback(
|
|
15
|
-
(e) => {
|
|
16
|
-
var _a, _b;
|
|
17
|
-
if (e.button !== 0) return;
|
|
18
|
-
const target = e.target;
|
|
19
|
-
if (((_a = target == null ? void 0 : target.closest) == null ? void 0 : _a.call(target, '[data-selection-control="true"]')) || ((_b = target == null ? void 0 : target.closest) == null ? void 0 : _b.call(target, '[data-row-context-menu="true"]'))) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (table_utils.isModifierClick(e) && canSelect) {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
e.stopPropagation();
|
|
25
|
-
onRowSelect == null ? void 0 : onRowSelect(rowId, !isSelected);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
onRowClick == null ? void 0 : onRowClick(row);
|
|
29
|
-
},
|
|
30
|
-
[canSelect, isSelected, onRowClick, onRowSelect, row, rowId]
|
|
31
|
-
);
|
|
32
|
-
const handleRowKeyDown = react.useCallback(
|
|
33
|
-
(e) => {
|
|
34
|
-
if (!onRowClick) return;
|
|
35
|
-
if (!table_utils.shouldToggleOnKey(e.key)) return;
|
|
36
|
-
e.preventDefault();
|
|
37
|
-
onRowClick(row);
|
|
38
|
-
},
|
|
39
|
-
[onRowClick, row]
|
|
40
|
-
);
|
|
41
|
-
return {
|
|
42
|
-
handleRowClick,
|
|
43
|
-
handleRowKeyDown
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
exports.useTableRowInteractions = useTableRowInteractions;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { KeyboardEvent, MouseEvent } from 'react';
|
|
2
|
-
type UseTableRowInteractionsArgs<T> = {
|
|
3
|
-
row: T;
|
|
4
|
-
rowId: string | number;
|
|
5
|
-
isSelected: boolean;
|
|
6
|
-
canSelect: boolean;
|
|
7
|
-
onRowClick?: (row: T) => void;
|
|
8
|
-
onRowSelect?: (rowId: string | number, isSelected: boolean) => void;
|
|
9
|
-
};
|
|
10
|
-
type UseTableRowInteractionsReturn = {
|
|
11
|
-
handleRowClick: (e: MouseEvent<HTMLDivElement>) => void;
|
|
12
|
-
handleRowKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
13
|
-
};
|
|
14
|
-
export declare function useTableRowInteractions<T>({ row, rowId, isSelected, canSelect, onRowClick, onRowSelect, }: UseTableRowInteractionsArgs<T>): UseTableRowInteractionsReturn;
|
|
15
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { isModifierClick, shouldToggleOnKey } from '../table.utils';
|
|
3
|
-
|
|
4
|
-
function useTableRowInteractions({
|
|
5
|
-
row,
|
|
6
|
-
rowId,
|
|
7
|
-
isSelected,
|
|
8
|
-
canSelect,
|
|
9
|
-
onRowClick,
|
|
10
|
-
onRowSelect
|
|
11
|
-
}) {
|
|
12
|
-
const handleRowClick = useCallback(
|
|
13
|
-
(e) => {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
if (e.button !== 0) return;
|
|
16
|
-
const target = e.target;
|
|
17
|
-
if (((_a = target == null ? void 0 : target.closest) == null ? void 0 : _a.call(target, '[data-selection-control="true"]')) || ((_b = target == null ? void 0 : target.closest) == null ? void 0 : _b.call(target, '[data-row-context-menu="true"]'))) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (isModifierClick(e) && canSelect) {
|
|
21
|
-
e.preventDefault();
|
|
22
|
-
e.stopPropagation();
|
|
23
|
-
onRowSelect == null ? void 0 : onRowSelect(rowId, !isSelected);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
onRowClick == null ? void 0 : onRowClick(row);
|
|
27
|
-
},
|
|
28
|
-
[canSelect, isSelected, onRowClick, onRowSelect, row, rowId]
|
|
29
|
-
);
|
|
30
|
-
const handleRowKeyDown = useCallback(
|
|
31
|
-
(e) => {
|
|
32
|
-
if (!onRowClick) return;
|
|
33
|
-
if (!shouldToggleOnKey(e.key)) return;
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
onRowClick(row);
|
|
36
|
-
},
|
|
37
|
-
[onRowClick, row]
|
|
38
|
-
);
|
|
39
|
-
return {
|
|
40
|
-
handleRowClick,
|
|
41
|
-
handleRowKeyDown
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { useTableRowInteractions };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var styles = require('./Table.module.css');
|
|
4
|
-
|
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
-
|
|
7
|
-
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
8
|
-
|
|
9
|
-
function cx(...values) {
|
|
10
|
-
return values.filter(Boolean).join(" ");
|
|
11
|
-
}
|
|
12
|
-
function getDividerClass(column) {
|
|
13
|
-
if (column.divider === "left") return styles__default.default.dividerLeft;
|
|
14
|
-
if (column.divider === "right") return styles__default.default.dividerRight;
|
|
15
|
-
return "";
|
|
16
|
-
}
|
|
17
|
-
function getAlignValue(column) {
|
|
18
|
-
var _a;
|
|
19
|
-
return (_a = column.align) != null ? _a : "left";
|
|
20
|
-
}
|
|
21
|
-
function getHeaderAlignClasses(align) {
|
|
22
|
-
return {
|
|
23
|
-
inner: cx(
|
|
24
|
-
styles__default.default.thInner,
|
|
25
|
-
align === "right" && styles__default.default.thInnerRight,
|
|
26
|
-
align === "center" && styles__default.default.thInnerCenter
|
|
27
|
-
),
|
|
28
|
-
main: cx(
|
|
29
|
-
styles__default.default.thMain,
|
|
30
|
-
align === "right" && styles__default.default.thMainRight,
|
|
31
|
-
align === "center" && styles__default.default.thMainCenter
|
|
32
|
-
),
|
|
33
|
-
button: cx(
|
|
34
|
-
styles__default.default.thButton,
|
|
35
|
-
align === "right" && styles__default.default.thButtonRight,
|
|
36
|
-
align === "center" && styles__default.default.thButtonCenter
|
|
37
|
-
),
|
|
38
|
-
label: cx(
|
|
39
|
-
styles__default.default.thLabel,
|
|
40
|
-
align === "right" && styles__default.default.thLabelRight,
|
|
41
|
-
align === "center" && styles__default.default.thLabelCenter
|
|
42
|
-
)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.cx = cx;
|
|
47
|
-
exports.getAlignValue = getAlignValue;
|
|
48
|
-
exports.getDividerClass = getDividerClass;
|
|
49
|
-
exports.getHeaderAlignClasses = getHeaderAlignClasses;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ColumnItem } from './Table.types';
|
|
2
|
-
export declare function cx(...values: Array<string | false | null | undefined>): string;
|
|
3
|
-
export declare function getDividerClass<T>(column: ColumnItem<T>): string;
|
|
4
|
-
export declare function getAlignValue<T>(column: ColumnItem<T>): 'left' | 'right' | 'center';
|
|
5
|
-
export declare function getHeaderAlignClasses(align: 'left' | 'right' | 'center'): {
|
|
6
|
-
inner: string;
|
|
7
|
-
main: string;
|
|
8
|
-
button: string;
|
|
9
|
-
label: string;
|
|
10
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import styles from './Table.module.css';
|
|
2
|
-
|
|
3
|
-
function cx(...values) {
|
|
4
|
-
return values.filter(Boolean).join(" ");
|
|
5
|
-
}
|
|
6
|
-
function getDividerClass(column) {
|
|
7
|
-
if (column.divider === "left") return styles.dividerLeft;
|
|
8
|
-
if (column.divider === "right") return styles.dividerRight;
|
|
9
|
-
return "";
|
|
10
|
-
}
|
|
11
|
-
function getAlignValue(column) {
|
|
12
|
-
var _a;
|
|
13
|
-
return (_a = column.align) != null ? _a : "left";
|
|
14
|
-
}
|
|
15
|
-
function getHeaderAlignClasses(align) {
|
|
16
|
-
return {
|
|
17
|
-
inner: cx(
|
|
18
|
-
styles.thInner,
|
|
19
|
-
align === "right" && styles.thInnerRight,
|
|
20
|
-
align === "center" && styles.thInnerCenter
|
|
21
|
-
),
|
|
22
|
-
main: cx(
|
|
23
|
-
styles.thMain,
|
|
24
|
-
align === "right" && styles.thMainRight,
|
|
25
|
-
align === "center" && styles.thMainCenter
|
|
26
|
-
),
|
|
27
|
-
button: cx(
|
|
28
|
-
styles.thButton,
|
|
29
|
-
align === "right" && styles.thButtonRight,
|
|
30
|
-
align === "center" && styles.thButtonCenter
|
|
31
|
-
),
|
|
32
|
-
label: cx(
|
|
33
|
-
styles.thLabel,
|
|
34
|
-
align === "right" && styles.thLabelRight,
|
|
35
|
-
align === "center" && styles.thLabelCenter
|
|
36
|
-
)
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { cx, getAlignValue, getDividerClass, getHeaderAlignClasses };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const SELECTION_COLUMN_PX = 32;
|
|
4
|
-
const ACTIONS_COLUMN_PX = 0;
|
|
5
|
-
const DEFAULT_COLUMN_PX = 150;
|
|
6
|
-
function getVisibleColumns(columns) {
|
|
7
|
-
return columns.filter((column) => !column.hidden);
|
|
8
|
-
}
|
|
9
|
-
function getHeaderLabel(header) {
|
|
10
|
-
return typeof header === "function" ? header() : header;
|
|
11
|
-
}
|
|
12
|
-
function isActiveSort(sortById, columnId) {
|
|
13
|
-
return sortById === columnId;
|
|
14
|
-
}
|
|
15
|
-
function getAriaSort(sortable, active, direction) {
|
|
16
|
-
if (!sortable || !active || !direction) return "none";
|
|
17
|
-
return direction === "asc" ? "ascending" : "descending";
|
|
18
|
-
}
|
|
19
|
-
function getNextSortDirection(sortable, active, currentDirection) {
|
|
20
|
-
if (!sortable) return null;
|
|
21
|
-
if (!active) return "asc";
|
|
22
|
-
if (currentDirection === "asc") return "desc";
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
function shouldToggleOnKey(key) {
|
|
26
|
-
return key === "Enter" || key === " ";
|
|
27
|
-
}
|
|
28
|
-
function isModifierClick(e) {
|
|
29
|
-
return Boolean(e.metaKey || e.ctrlKey);
|
|
30
|
-
}
|
|
31
|
-
function shouldAllowWrap(columnAllowWrap, isRowSelected, viewMode) {
|
|
32
|
-
return Boolean(columnAllowWrap || isRowSelected || viewMode === "wrapped");
|
|
33
|
-
}
|
|
34
|
-
function getCellDisplayValue(row, column) {
|
|
35
|
-
var _a;
|
|
36
|
-
const empty = (_a = column.emptyPlaceholder) != null ? _a : "";
|
|
37
|
-
if (column.render) {
|
|
38
|
-
const rendered = column.render(row);
|
|
39
|
-
return rendered != null ? rendered : empty;
|
|
40
|
-
}
|
|
41
|
-
if (column.accessor) {
|
|
42
|
-
const value = row[column.accessor];
|
|
43
|
-
return value != null ? value : empty;
|
|
44
|
-
}
|
|
45
|
-
return empty;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
exports.ACTIONS_COLUMN_PX = ACTIONS_COLUMN_PX;
|
|
49
|
-
exports.DEFAULT_COLUMN_PX = DEFAULT_COLUMN_PX;
|
|
50
|
-
exports.SELECTION_COLUMN_PX = SELECTION_COLUMN_PX;
|
|
51
|
-
exports.getAriaSort = getAriaSort;
|
|
52
|
-
exports.getCellDisplayValue = getCellDisplayValue;
|
|
53
|
-
exports.getHeaderLabel = getHeaderLabel;
|
|
54
|
-
exports.getNextSortDirection = getNextSortDirection;
|
|
55
|
-
exports.getVisibleColumns = getVisibleColumns;
|
|
56
|
-
exports.isActiveSort = isActiveSort;
|
|
57
|
-
exports.isModifierClick = isModifierClick;
|
|
58
|
-
exports.shouldAllowWrap = shouldAllowWrap;
|
|
59
|
-
exports.shouldToggleOnKey = shouldToggleOnKey;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ColumnItem } from './Table.types';
|
|
3
|
-
export declare const SELECTION_COLUMN_PX: 32;
|
|
4
|
-
export declare const ACTIONS_COLUMN_PX: 0;
|
|
5
|
-
export declare const DEFAULT_COLUMN_PX: 150;
|
|
6
|
-
export type SortDirection = 'asc' | 'desc' | null;
|
|
7
|
-
export declare function getVisibleColumns<T>(columns: Array<ColumnItem<T>>): Array<ColumnItem<T>>;
|
|
8
|
-
export declare function getHeaderLabel(header: string | (() => ReactNode)): ReactNode;
|
|
9
|
-
export declare function isActiveSort(sortById: string | undefined, columnId: string): boolean;
|
|
10
|
-
export declare function getAriaSort(sortable: boolean | undefined, active: boolean, direction: SortDirection): 'ascending' | 'descending' | 'none';
|
|
11
|
-
export declare function getNextSortDirection(sortable: boolean | undefined, active: boolean, currentDirection: SortDirection): SortDirection;
|
|
12
|
-
export declare function shouldToggleOnKey(key: string): boolean;
|
|
13
|
-
export declare function isModifierClick(e: {
|
|
14
|
-
metaKey?: boolean;
|
|
15
|
-
ctrlKey?: boolean;
|
|
16
|
-
}): boolean;
|
|
17
|
-
export declare function shouldAllowWrap(columnAllowWrap: boolean | undefined, isRowSelected: boolean, viewMode?: 'wrapped' | string): boolean;
|
|
18
|
-
export declare function getCellDisplayValue<T extends Record<string, any>>(row: T, column: ColumnItem<T>): ReactNode;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const SELECTION_COLUMN_PX = 32;
|
|
2
|
-
const ACTIONS_COLUMN_PX = 0;
|
|
3
|
-
const DEFAULT_COLUMN_PX = 150;
|
|
4
|
-
function getVisibleColumns(columns) {
|
|
5
|
-
return columns.filter((column) => !column.hidden);
|
|
6
|
-
}
|
|
7
|
-
function getHeaderLabel(header) {
|
|
8
|
-
return typeof header === "function" ? header() : header;
|
|
9
|
-
}
|
|
10
|
-
function isActiveSort(sortById, columnId) {
|
|
11
|
-
return sortById === columnId;
|
|
12
|
-
}
|
|
13
|
-
function getAriaSort(sortable, active, direction) {
|
|
14
|
-
if (!sortable || !active || !direction) return "none";
|
|
15
|
-
return direction === "asc" ? "ascending" : "descending";
|
|
16
|
-
}
|
|
17
|
-
function getNextSortDirection(sortable, active, currentDirection) {
|
|
18
|
-
if (!sortable) return null;
|
|
19
|
-
if (!active) return "asc";
|
|
20
|
-
if (currentDirection === "asc") return "desc";
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
function shouldToggleOnKey(key) {
|
|
24
|
-
return key === "Enter" || key === " ";
|
|
25
|
-
}
|
|
26
|
-
function isModifierClick(e) {
|
|
27
|
-
return Boolean(e.metaKey || e.ctrlKey);
|
|
28
|
-
}
|
|
29
|
-
function shouldAllowWrap(columnAllowWrap, isRowSelected, viewMode) {
|
|
30
|
-
return Boolean(columnAllowWrap || isRowSelected || viewMode === "wrapped");
|
|
31
|
-
}
|
|
32
|
-
function getCellDisplayValue(row, column) {
|
|
33
|
-
var _a;
|
|
34
|
-
const empty = (_a = column.emptyPlaceholder) != null ? _a : "";
|
|
35
|
-
if (column.render) {
|
|
36
|
-
const rendered = column.render(row);
|
|
37
|
-
return rendered != null ? rendered : empty;
|
|
38
|
-
}
|
|
39
|
-
if (column.accessor) {
|
|
40
|
-
const value = row[column.accessor];
|
|
41
|
-
return value != null ? value : empty;
|
|
42
|
-
}
|
|
43
|
-
return empty;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { ACTIONS_COLUMN_PX, DEFAULT_COLUMN_PX, SELECTION_COLUMN_PX, getAriaSort, getCellDisplayValue, getHeaderLabel, getNextSortDirection, getVisibleColumns, isActiveSort, isModifierClick, shouldAllowWrap, shouldToggleOnKey };
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var table_utils = require('./table.utils');
|
|
4
|
-
|
|
5
|
-
function getColumnId(def, index) {
|
|
6
|
-
const d = def;
|
|
7
|
-
if (d.id != null && String(d.id).length > 0) return String(d.id);
|
|
8
|
-
if (d.accessorKey != null && String(d.accessorKey).length > 0) return String(d.accessorKey);
|
|
9
|
-
return `col_${index}`;
|
|
10
|
-
}
|
|
11
|
-
function buildColumnVisibilityFromVisibleIds(defs, visibleColumnIds) {
|
|
12
|
-
if (!(visibleColumnIds == null ? void 0 : visibleColumnIds.length)) return {};
|
|
13
|
-
const visible = new Set(visibleColumnIds);
|
|
14
|
-
const next = {};
|
|
15
|
-
defs.forEach((def, index) => {
|
|
16
|
-
const id = getColumnId(def, index);
|
|
17
|
-
next[id] = visible.has(id);
|
|
18
|
-
});
|
|
19
|
-
return next;
|
|
20
|
-
}
|
|
21
|
-
function mapDefsToColumnItems(defs, columnVisibility, resolvedLayout = {}) {
|
|
22
|
-
return defs.map((def, index) => {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
24
|
-
const id = getColumnId(def, index);
|
|
25
|
-
const accessorKey = def.accessorKey;
|
|
26
|
-
const accessorFn = def.accessorFn;
|
|
27
|
-
const cell = def.cell;
|
|
28
|
-
const meta = (_a = def.meta) != null ? _a : {};
|
|
29
|
-
let render;
|
|
30
|
-
if (typeof cell === "function") {
|
|
31
|
-
render = (row) => cell({
|
|
32
|
-
row: { original: row },
|
|
33
|
-
getValue: () => accessorKey != null ? row[accessorKey] : accessorFn ? accessorFn(row) : void 0
|
|
34
|
-
});
|
|
35
|
-
} else if (accessorFn) {
|
|
36
|
-
render = (row) => accessorFn(row);
|
|
37
|
-
} else if (accessorKey != null) {
|
|
38
|
-
render = (row) => row[accessorKey];
|
|
39
|
-
} else {
|
|
40
|
-
render = () => null;
|
|
41
|
-
}
|
|
42
|
-
const isVisible = (_b = columnVisibility[id]) != null ? _b : true;
|
|
43
|
-
return {
|
|
44
|
-
id,
|
|
45
|
-
header: def.header,
|
|
46
|
-
accessor: accessorKey,
|
|
47
|
-
sortable: (_c = def.enableSorting) != null ? _c : !!accessorKey,
|
|
48
|
-
render,
|
|
49
|
-
hidden: !isVisible,
|
|
50
|
-
width: (_d = resolvedLayout[id]) == null ? void 0 : _d.width,
|
|
51
|
-
align: meta.align,
|
|
52
|
-
verticalAlign: meta.verticalAlign,
|
|
53
|
-
emptyPlaceholder: (_e = meta.emptyPlaceholder) != null ? _e : "-",
|
|
54
|
-
allowWrap: (_f = meta.allowWrap) != null ? _f : false,
|
|
55
|
-
severity: meta.severity,
|
|
56
|
-
divider: meta.divider,
|
|
57
|
-
allowOverflow: (_g = meta.allowOverflow) != null ? _g : false
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function sortingEqual(a, b) {
|
|
62
|
-
const A = a == null ? void 0 : a[0];
|
|
63
|
-
const B = b == null ? void 0 : b[0];
|
|
64
|
-
if (!A && !B) return true;
|
|
65
|
-
if (!A || !B) return false;
|
|
66
|
-
return A.id === B.id && A.desc === B.desc;
|
|
67
|
-
}
|
|
68
|
-
function getSortPropsFromSorting(sorting) {
|
|
69
|
-
const s = sorting == null ? void 0 : sorting[0];
|
|
70
|
-
return {
|
|
71
|
-
sortById: s == null ? void 0 : s.id,
|
|
72
|
-
sortDirection: s ? s.desc ? "desc" : "asc" : null
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function clamp(value, min, max) {
|
|
76
|
-
const lowerBounded = Math.max(min, value);
|
|
77
|
-
if (max == null || !Number.isFinite(max)) return lowerBounded;
|
|
78
|
-
return Math.min(lowerBounded, max);
|
|
79
|
-
}
|
|
80
|
-
function toIntegerTrackWidths(tracks, targetWidth) {
|
|
81
|
-
const floored = tracks.map((track) => ({
|
|
82
|
-
id: track.id,
|
|
83
|
-
width: Math.floor(track.width),
|
|
84
|
-
fraction: track.width - Math.floor(track.width)
|
|
85
|
-
}));
|
|
86
|
-
const baseTotal = floored.reduce((sum, track) => sum + track.width, 0);
|
|
87
|
-
let remainder = Math.max(0, targetWidth - baseTotal);
|
|
88
|
-
floored.slice().sort((a, b) => b.fraction - a.fraction).forEach((track) => {
|
|
89
|
-
if (remainder <= 0) return;
|
|
90
|
-
track.width += 1;
|
|
91
|
-
remainder -= 1;
|
|
92
|
-
});
|
|
93
|
-
return Object.fromEntries(floored.map((track) => [track.id, track.width]));
|
|
94
|
-
}
|
|
95
|
-
function buildDistributedColumnWidths(args) {
|
|
96
|
-
const {
|
|
97
|
-
table,
|
|
98
|
-
hasSelection,
|
|
99
|
-
hasContextMenu = false,
|
|
100
|
-
defaultMinPx,
|
|
101
|
-
columnSizing,
|
|
102
|
-
availableWidth
|
|
103
|
-
} = args;
|
|
104
|
-
const leaf = table.getVisibleLeafColumns();
|
|
105
|
-
const selectionWidth = hasSelection ? table_utils.SELECTION_COLUMN_PX : 0;
|
|
106
|
-
const contextMenuWidth = hasContextMenu ? 0 : 0;
|
|
107
|
-
const tracks = leaf.map((c) => {
|
|
108
|
-
var _a, _b, _c, _d;
|
|
109
|
-
const def = c.columnDef;
|
|
110
|
-
const meta = (_a = def.meta) != null ? _a : {};
|
|
111
|
-
const min = Math.max(1, Number((_b = def.minSize) != null ? _b : defaultMinPx));
|
|
112
|
-
const max = def.maxSize != null ? Math.max(min, Number(def.maxSize)) : void 0;
|
|
113
|
-
const resizedPxRaw = columnSizing[c.id];
|
|
114
|
-
const resizedPx = resizedPxRaw != null ? Math.round(clamp(Number(resizedPxRaw), min, max)) : void 0;
|
|
115
|
-
if (resizedPx != null) {
|
|
116
|
-
return {
|
|
117
|
-
id: c.id,
|
|
118
|
-
width: resizedPx,
|
|
119
|
-
weight: 0,
|
|
120
|
-
max: resizedPx,
|
|
121
|
-
fixed: true
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
const rawWeight = Number((_d = (_c = meta.weight) != null ? _c : def.size) != null ? _d : table_utils.DEFAULT_COLUMN_PX);
|
|
125
|
-
const weight = Number.isFinite(rawWeight) && rawWeight > 0 ? rawWeight : table_utils.DEFAULT_COLUMN_PX;
|
|
126
|
-
return {
|
|
127
|
-
id: c.id,
|
|
128
|
-
width: min,
|
|
129
|
-
weight,
|
|
130
|
-
max,
|
|
131
|
-
fixed: false
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
const fixedWidth = selectionWidth + contextMenuWidth + tracks.reduce((sum, track) => sum + track.width, 0);
|
|
135
|
-
let remaining = Math.max(0, availableWidth - fixedWidth);
|
|
136
|
-
let active = tracks.filter(
|
|
137
|
-
(track) => !track.fixed && (track.max == null || track.width < track.max)
|
|
138
|
-
);
|
|
139
|
-
while (remaining > 0.5 && active.length > 0) {
|
|
140
|
-
const totalWeight = active.reduce((sum, track) => sum + track.weight, 0);
|
|
141
|
-
if (totalWeight <= 0) break;
|
|
142
|
-
let consumed = 0;
|
|
143
|
-
const nextActive = [];
|
|
144
|
-
for (const track of active) {
|
|
145
|
-
const share = remaining * track.weight / totalWeight;
|
|
146
|
-
const maxGrow = track.max == null ? share : Math.max(0, track.max - track.width);
|
|
147
|
-
const growth = Math.min(share, maxGrow);
|
|
148
|
-
track.width += growth;
|
|
149
|
-
consumed += growth;
|
|
150
|
-
if (track.max == null || track.width < track.max - 0.5) {
|
|
151
|
-
nextActive.push(track);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (consumed <= 0.5) break;
|
|
155
|
-
remaining -= consumed;
|
|
156
|
-
active = nextActive;
|
|
157
|
-
}
|
|
158
|
-
const floatTrackTotal = tracks.reduce((sum, track) => sum + track.width, 0);
|
|
159
|
-
const maxTrackWidth = availableWidth - selectionWidth - contextMenuWidth;
|
|
160
|
-
const targetTrackWidth = Math.min(
|
|
161
|
-
floatTrackTotal <= maxTrackWidth ? Math.floor(floatTrackTotal) : Math.ceil(floatTrackTotal),
|
|
162
|
-
maxTrackWidth
|
|
163
|
-
);
|
|
164
|
-
const widths = toIntegerTrackWidths(tracks, targetTrackWidth);
|
|
165
|
-
const totalWidth = selectionWidth + contextMenuWidth + Object.values(widths).reduce((sum, width) => sum + width, 0);
|
|
166
|
-
return {
|
|
167
|
-
selectionWidth: hasSelection ? table_utils.SELECTION_COLUMN_PX : void 0,
|
|
168
|
-
contextMenuWidth: hasContextMenu ? 0 : void 0,
|
|
169
|
-
widths,
|
|
170
|
-
totalWidth,
|
|
171
|
-
availableWidth,
|
|
172
|
-
shouldOverflow: totalWidth > availableWidth
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
exports.buildColumnVisibilityFromVisibleIds = buildColumnVisibilityFromVisibleIds;
|
|
177
|
-
exports.buildDistributedColumnWidths = buildDistributedColumnWidths;
|
|
178
|
-
exports.getColumnId = getColumnId;
|
|
179
|
-
exports.getSortPropsFromSorting = getSortPropsFromSorting;
|
|
180
|
-
exports.mapDefsToColumnItems = mapDefsToColumnItems;
|
|
181
|
-
exports.sortingEqual = sortingEqual;
|