@dbcdk/react-components 0.0.103 → 0.0.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/logo.cjs +87 -0
- package/dist/assets/logo.js +85 -0
- package/dist/client.cjs +587 -0
- package/dist/client.d.ts +83 -0
- package/dist/client.js +84 -0
- package/dist/components/accordion/Accordion.cjs +117 -0
- package/dist/components/accordion/Accordion.d.ts +5 -2
- package/dist/components/accordion/Accordion.js +111 -0
- package/dist/components/accordion/Accordion.module.css +41 -0
- package/dist/components/accordion/components/AccordionRow.cjs +120 -0
- package/dist/components/accordion/components/AccordionRow.js +114 -0
- package/dist/components/accordion/components/AccordionRow.module.css +133 -0
- package/dist/components/alert/Alert.cjs +52 -0
- package/dist/components/alert/Alert.d.ts +2 -1
- package/dist/components/alert/Alert.js +46 -0
- package/dist/components/alert/Alert.module.css +97 -0
- package/dist/components/app-header/AppHeader.cjs +14 -0
- package/dist/components/app-header/AppHeader.js +8 -0
- package/dist/components/app-header/AppHeader.module.css +74 -0
- package/dist/components/attribute-chip/AttributeChip.cjs +22 -0
- package/dist/components/attribute-chip/AttributeChip.js +16 -0
- package/dist/components/attribute-chip/AttributeChip.module.css +65 -0
- package/dist/components/avatar/Avatar.cjs +111 -0
- package/dist/components/avatar/Avatar.js +86 -0
- package/dist/components/avatar/Avatar.module.css +91 -0
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +24 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +18 -0
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +80 -0
- package/dist/components/button/Button.cjs +149 -0
- package/dist/components/button/Button.js +124 -0
- package/dist/components/button/Button.module.css +260 -0
- package/dist/components/button-select/ButtonSelect.cjs +35 -0
- package/dist/components/button-select/ButtonSelect.js +29 -0
- package/dist/components/button-select/ButtonSelect.module.css +40 -0
- package/dist/components/card/Card.cjs +112 -0
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/card/Card.js +106 -0
- package/dist/components/card/Card.module.css +187 -0
- package/dist/components/card/components/CardMeta.cjs +62 -0
- package/dist/components/card/components/CardMeta.js +55 -0
- package/dist/components/card/components/CardMeta.module.css +55 -0
- package/dist/components/card-container/CardContainer.cjs +34 -0
- package/dist/components/card-container/CardContainer.js +28 -0
- package/dist/components/card-container/CardContainer.module.css +63 -0
- package/dist/components/chip/Chip.cjs +65 -0
- package/dist/components/chip/Chip.js +59 -0
- package/dist/components/chip/Chip.module.css +236 -0
- package/dist/components/circle/Circle.cjs +33 -0
- package/dist/components/circle/Circle.js +27 -0
- package/dist/components/circle/Circle.module.css +128 -0
- package/dist/components/clear-button/ClearButton.cjs +33 -0
- package/dist/components/clear-button/ClearButton.d.ts +2 -1
- package/dist/components/clear-button/ClearButton.js +27 -0
- package/dist/components/clear-button/ClearButton.module.css +26 -0
- package/dist/components/code-block/CodeBlock.cjs +97 -0
- package/dist/components/code-block/CodeBlock.js +91 -0
- package/dist/components/code-block/CodeBlock.module.css +124 -0
- package/dist/components/copy-button/CopyButton.cjs +139 -0
- package/dist/components/copy-button/CopyButton.js +133 -0
- package/dist/components/copy-button/CopyButton.module.css +22 -0
- package/dist/components/datetime-picker/DateTimePicker.cjs +559 -0
- package/dist/components/datetime-picker/DateTimePicker.js +553 -0
- package/dist/components/datetime-picker/DateTimePicker.module.css +155 -0
- package/dist/components/datetime-picker/dateTimeHelpers.cjs +179 -0
- package/dist/components/datetime-picker/dateTimeHelpers.js +160 -0
- package/dist/components/divider/Divider.cjs +22 -0
- package/dist/components/divider/Divider.js +20 -0
- package/dist/components/filter-field/FilterField.cjs +296 -0
- package/dist/components/filter-field/FilterField.js +289 -0
- package/dist/components/filter-field/FilterField.module.css +379 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.cjs +115 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +108 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +59 -0
- package/dist/components/forms/checkbox/Checkbox.cjs +88 -0
- package/dist/components/forms/checkbox/Checkbox.js +82 -0
- package/dist/components/forms/checkbox/Checkbox.module.css +104 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.cjs +121 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +115 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
- package/dist/components/forms/form-select/FormSelect.cjs +191 -0
- package/dist/components/forms/form-select/FormSelect.js +166 -0
- package/dist/components/forms/form-select/FormSelect.module.css +236 -0
- package/dist/components/forms/input/Input.cjs +188 -0
- package/dist/components/forms/input/Input.d.ts +1 -0
- package/dist/components/forms/input/Input.js +182 -0
- package/dist/components/forms/input/Input.module.css +468 -0
- package/dist/components/forms/input-container/InputContainer.cjs +72 -0
- package/dist/components/forms/input-container/InputContainer.js +66 -0
- package/dist/components/forms/input-container/InputContainer.module.css +59 -0
- package/dist/components/forms/multi-select/MultiSelect.cjs +227 -0
- package/dist/components/forms/multi-select/MultiSelect.js +225 -0
- package/dist/components/forms/radio-buttons/RadioButton.cjs +91 -0
- package/dist/components/forms/radio-buttons/RadioButton.js +85 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.cjs +74 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +72 -0
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +118 -0
- package/dist/components/forms/select/Select.cjs +286 -0
- package/dist/components/forms/select/Select.js +280 -0
- package/dist/components/forms/select/Select.module.css +32 -0
- package/dist/components/forms/text-area/Textarea.cjs +116 -0
- package/dist/components/forms/text-area/Textarea.js +110 -0
- package/dist/components/forms/text-area/Textarea.module.css +70 -0
- package/dist/components/forms/typeahead/Typeahead.cjs +792 -0
- package/dist/components/forms/typeahead/Typeahead.js +768 -0
- package/dist/components/forms/typeahead/Typeahead.module.css +38 -0
- package/dist/components/grid/Grid.cjs +45 -0
- package/dist/components/grid/Grid.js +38 -0
- package/dist/components/grid/Grid.module.css +35 -0
- package/dist/components/headline/CollapsibleHeadline.cjs +89 -0
- package/dist/components/headline/CollapsibleHeadline.d.ts +4 -4
- package/dist/components/headline/CollapsibleHeadline.js +83 -0
- package/dist/components/headline/Headline.cjs +59 -0
- package/dist/components/headline/Headline.js +53 -0
- package/dist/components/headline/Headline.module.css +185 -0
- package/dist/components/hyperlink/Hyperlink.cjs +107 -0
- package/dist/components/hyperlink/Hyperlink.js +82 -0
- package/dist/components/hyperlink/Hyperlink.module.css +121 -0
- package/dist/components/icon/Icon.cjs +27 -0
- package/dist/components/icon/Icon.js +20 -0
- package/dist/components/icon/Icon.module.css +36 -0
- package/dist/components/inline-status/InlineStatus.cjs +39 -0
- package/dist/components/inline-status/InlineStatus.js +33 -0
- package/dist/components/inline-status/InlineStatus.module.css +92 -0
- package/dist/components/interval-select/IntervalSelect.cjs +203 -0
- package/dist/components/interval-select/IntervalSelect.js +201 -0
- package/dist/components/json-viewer/HighlightedText.cjs +13 -0
- package/dist/components/json-viewer/HighlightedText.js +11 -0
- package/dist/components/json-viewer/JsonNode.cjs +124 -0
- package/dist/components/json-viewer/JsonNode.js +118 -0
- package/dist/components/json-viewer/JsonViewer.cjs +164 -0
- package/dist/components/json-viewer/JsonViewer.js +158 -0
- package/dist/components/json-viewer/JsonViewer.module.css +346 -0
- package/dist/components/json-viewer/types.cjs +2 -0
- package/dist/components/json-viewer/types.js +1 -0
- package/dist/components/json-viewer/useClipboardStatus.cjs +15 -0
- package/dist/components/json-viewer/useClipboardStatus.js +13 -0
- package/dist/components/json-viewer/utils.cjs +126 -0
- package/dist/components/json-viewer/utils.js +111 -0
- package/dist/components/media-card/MediaCard.cjs +60 -0
- package/dist/components/media-card/MediaCard.d.ts +19 -0
- package/dist/components/media-card/MediaCard.js +54 -0
- package/dist/components/media-card/MediaCard.module.css +92 -0
- package/dist/components/menu/Menu.cjs +287 -0
- package/dist/components/menu/Menu.js +262 -0
- package/dist/components/menu/Menu.module.css +220 -0
- package/dist/components/meta-bar/MetaBar.cjs +28 -0
- package/dist/components/meta-bar/MetaBar.js +22 -0
- package/dist/components/meta-bar/MetaBar.module.css +27 -0
- package/dist/components/nav-bar/NavBar.cjs +104 -0
- package/dist/components/nav-bar/NavBar.d.ts +4 -3
- package/dist/components/nav-bar/NavBar.js +98 -0
- package/dist/components/nav-bar/NavBar.module.css +225 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.cjs +30 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.js +24 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +54 -0
- package/dist/components/overlay/modal/Modal.cjs +189 -0
- package/dist/components/overlay/modal/Modal.d.ts +2 -1
- package/dist/components/overlay/modal/Modal.js +183 -0
- package/dist/components/overlay/modal/Modal.module.css +112 -0
- package/dist/components/overlay/modal/provider/ModalProvider.cjs +98 -0
- package/dist/components/overlay/modal/provider/ModalProvider.js +95 -0
- package/dist/components/overlay/side-panel/SidePanel.cjs +173 -0
- package/dist/components/overlay/side-panel/SidePanel.js +167 -0
- package/dist/components/overlay/side-panel/SidePanel.module.css +177 -0
- package/dist/components/overlay/side-panel/useSidePanel.cjs +16 -0
- package/dist/components/overlay/side-panel/useSidePanel.js +14 -0
- package/dist/components/overlay/tooltip/Tooltip.cjs +34 -0
- package/dist/components/overlay/tooltip/Tooltip.js +32 -0
- package/dist/components/overlay/tooltip/Tooltip.module.css +104 -0
- package/dist/components/overlay/tooltip/TooltipProvider.cjs +238 -0
- package/dist/components/overlay/tooltip/TooltipProvider.js +231 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.cjs +117 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +115 -0
- package/dist/components/page/Page.cjs +63 -0
- package/dist/components/page/Page.js +57 -0
- package/dist/components/page/Page.module.css +95 -0
- package/dist/components/page-layout/PageLayout.cjs +97 -0
- package/dist/components/page-layout/PageLayout.d.ts +0 -5
- package/dist/components/page-layout/PageLayout.js +91 -0
- package/dist/components/page-layout/PageLayout.module.css +236 -0
- package/dist/components/page-layout/components/footer/Footer.cjs +53 -0
- package/dist/components/page-layout/components/footer/Footer.js +47 -0
- package/dist/components/page-layout/components/footer/Footer.module.css +89 -0
- package/dist/components/pagination/Pagination.cjs +160 -0
- package/dist/components/pagination/Pagination.js +154 -0
- package/dist/components/pagination/Pagination.module.css +25 -0
- package/dist/components/panel/Panel.cjs +38 -0
- package/dist/components/panel/Panel.js +32 -0
- package/dist/components/panel/Panel.module.css +30 -0
- package/dist/components/popover/Popover.cjs +331 -0
- package/dist/components/popover/Popover.js +307 -0
- package/dist/components/popover/Popover.module.css +52 -0
- package/dist/components/search-box/SearchBox.cjs +274 -0
- package/dist/components/search-box/SearchBox.js +268 -0
- package/dist/components/search-box/SearchBox.module.css +27 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +127 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +121 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +174 -0
- package/dist/components/sidebar/Sidebar.cjs +39 -0
- package/dist/components/sidebar/Sidebar.js +37 -0
- package/dist/components/sidebar/components/SidebarItem.cjs +29 -0
- package/dist/components/sidebar/components/SidebarItem.js +27 -0
- package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +133 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +127 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +29 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +214 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +207 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +260 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +54 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +47 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +106 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +61 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +55 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +20 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +97 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +91 -0
- package/dist/components/sidebar/providers/SidebarProvider.cjs +223 -0
- package/dist/components/sidebar/providers/SidebarProvider.js +220 -0
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +442 -0
- package/dist/components/skeleton-loader/SkeletonLoader.js +440 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +42 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +36 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +51 -0
- package/dist/components/split-button/SplitButton.cjs +46 -0
- package/dist/components/split-button/SplitButton.js +40 -0
- package/dist/components/split-button/SplitButton.module.css +32 -0
- package/dist/components/split-pane/SplitPane.cjs +188 -0
- package/dist/components/split-pane/SplitPane.d.ts +2 -1
- package/dist/components/split-pane/SplitPane.js +179 -0
- package/dist/components/split-pane/SplitPane.module.css +118 -0
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +129 -0
- package/dist/components/split-pane/provider/SplitPaneContext.js +121 -0
- package/dist/components/stack/Stack.cjs +47 -0
- package/dist/components/stack/Stack.d.ts +1 -1
- package/dist/components/stack/Stack.js +41 -0
- package/dist/components/stack/Stack.module.css +61 -0
- package/dist/components/state-page/StatePage.cjs +48 -0
- package/dist/components/state-page/StatePage.js +42 -0
- package/dist/components/state-page/StatePage.module.css +9 -0
- package/dist/components/state-page/empty.cjs +664 -0
- package/dist/components/state-page/empty.js +662 -0
- package/dist/components/state-page/error.cjs +310 -0
- package/dist/components/state-page/error.js +308 -0
- package/dist/components/state-page/notFound.cjs +243 -0
- package/dist/components/state-page/notFound.js +241 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.cjs +98 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +96 -0
- package/dist/components/table/Table.cjs +216 -0
- package/dist/components/table/Table.js +210 -0
- package/dist/components/table/Table.module.css +534 -0
- package/dist/components/table/Table.types.cjs +2 -0
- package/dist/components/table/Table.types.js +1 -0
- package/dist/components/table/TanstackTable.cjs +172 -0
- package/dist/components/table/TanstackTable.js +147 -0
- package/dist/components/table/components/TableBody.cjs +50 -0
- package/dist/components/table/components/TableBody.js +44 -0
- package/dist/components/table/components/TableHeader.cjs +56 -0
- package/dist/components/table/components/TableHeader.js +50 -0
- package/dist/components/table/components/TableHeaderCell.cjs +69 -0
- package/dist/components/table/components/TableHeaderCell.js +63 -0
- package/dist/components/table/components/TableLoadingBody.cjs +35 -0
- package/dist/components/table/components/TableLoadingBody.js +29 -0
- package/dist/components/table/components/TablePagination.cjs +2 -0
- package/dist/components/table/components/TablePagination.js +1 -0
- package/dist/components/table/components/TableRow.cjs +151 -0
- package/dist/components/table/components/TableRow.js +145 -0
- package/dist/components/table/components/TableSelectionCell.cjs +41 -0
- package/dist/components/table/components/TableSelectionCell.js +35 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +25 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.js +19 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +22 -0
- package/dist/components/table/components/empty-state/EmptyState.cjs +33 -0
- package/dist/components/table/components/empty-state/EmptyState.js +31 -0
- package/dist/components/table/components/empty-state/EmptyState.module.css +4 -0
- package/dist/components/table/components/table-settings/TableSettings.cjs +139 -0
- package/dist/components/table/components/table-settings/TableSettings.js +137 -0
- package/dist/components/table/hooks/useTableRowInteractions.cjs +46 -0
- package/dist/components/table/hooks/useTableRowInteractions.js +44 -0
- package/dist/components/table/table.classes.cjs +49 -0
- package/dist/components/table/table.classes.js +40 -0
- package/dist/components/table/table.utils.cjs +57 -0
- package/dist/components/table/table.utils.js +45 -0
- package/dist/components/table/tanstackTable.utils.cjs +166 -0
- package/dist/components/table/tanstackTable.utils.js +159 -0
- package/dist/components/tabs/Tabs.cjs +172 -0
- package/dist/components/tabs/Tabs.js +166 -0
- package/dist/components/tabs/Tabs.module.css +261 -0
- package/dist/components/theme-button/ThemeButton.cjs +78 -0
- package/dist/components/theme-button/ThemeButton.js +75 -0
- package/dist/components/toast/Toast.cjs +68 -0
- package/dist/components/toast/Toast.js +62 -0
- package/dist/components/toast/Toast.module.css +161 -0
- package/dist/components/toast/provider/ToastProvider.cjs +105 -0
- package/dist/components/toast/provider/ToastProvider.js +97 -0
- package/dist/components/user-display/UserDisplay.cjs +22 -0
- package/dist/components/user-display/UserDisplay.js +16 -0
- package/dist/components/user-display/UserDisplay.module.css +25 -0
- package/dist/constants/chart-colors.cjs +10 -0
- package/dist/constants/chart-colors.js +8 -0
- package/dist/constants/chart-colors.types.cjs +2 -0
- package/dist/constants/chart-colors.types.js +1 -0
- package/dist/constants/severity.cjs +30 -0
- package/dist/constants/severity.js +26 -0
- package/dist/constants/severity.types.cjs +2 -0
- package/dist/constants/severity.types.js +1 -0
- package/dist/constants/sizes.cjs +11 -0
- package/dist/constants/sizes.js +9 -0
- package/dist/hooks/useDeviceSize.cjs +35 -0
- package/dist/hooks/useDeviceSize.js +33 -0
- package/dist/hooks/useListNavigation.cjs +237 -0
- package/dist/hooks/useListNavigation.js +235 -0
- package/dist/hooks/usePagination.cjs +144 -0
- package/dist/hooks/usePagination.js +142 -0
- package/dist/hooks/useSorting.cjs +119 -0
- package/dist/hooks/useSorting.js +117 -0
- package/dist/hooks/useTableData.cjs +53 -0
- package/dist/hooks/useTableData.js +51 -0
- package/dist/hooks/useTableSelection.cjs +172 -0
- package/dist/hooks/useTableSelection.js +170 -0
- package/dist/hooks/useTableSettings.cjs +90 -0
- package/dist/hooks/useTableSettings.js +87 -0
- package/dist/hooks/useTheme.cjs +64 -0
- package/dist/hooks/useTheme.js +62 -0
- package/dist/hooks/useTimeDuration.cjs +72 -0
- package/dist/hooks/useTimeDuration.js +70 -0
- package/dist/hooks/useViewportFill.cjs +82 -0
- package/dist/hooks/useViewportFill.js +80 -0
- package/dist/index.cjs +161 -12908
- package/dist/index.css +67 -7357
- package/dist/index.d.ts +0 -58
- package/dist/index.js +24 -12809
- package/dist/styles/animation.cjs +9 -0
- package/dist/styles/animation.js +7 -0
- package/dist/styles/themes/dbc/colors.css +5 -0
- package/dist/styles/themes/types.cjs +2 -0
- package/dist/styles/themes/types.js +1 -0
- package/dist/tanstack.cjs +18 -2717
- package/dist/tanstack.js +3 -2701
- package/dist/types/a11y-props.types.cjs +2 -0
- package/dist/types/a11y-props.types.js +1 -0
- package/dist/types/assets.d.cjs +2 -0
- package/dist/types/assets.d.js +1 -0
- package/dist/types/css.d.cjs +2 -0
- package/dist/types/css.d.js +1 -0
- package/dist/types/sizes.types.cjs +2 -0
- package/dist/types/sizes.types.js +1 -0
- package/dist/utils/arrays/nested-filtering.cjs +40 -0
- package/dist/utils/arrays/nested-filtering.js +38 -0
- package/dist/utils/date/formatDate.cjs +35 -0
- package/dist/utils/date/formatDate.js +33 -0
- package/dist/utils/localStorage.utils.cjs +53 -0
- package/dist/utils/localStorage.utils.js +49 -0
- package/dist/utils/text/get-highlighted-segments.cjs +49 -0
- package/dist/utils/text/get-highlighted-segments.js +47 -0
- package/package.json +8 -3
- package/dist/tanstack.css +0 -1385
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Check } from 'lucide-react';
|
|
4
|
+
import { useRef, useMemo, useState, useEffect } from 'react';
|
|
5
|
+
import { Input } from '../../components/forms/input/Input';
|
|
6
|
+
import { Typeahead } from '../../components/forms/typeahead/Typeahead';
|
|
7
|
+
import styles from './FilterField.module.css';
|
|
8
|
+
import { Menu } from '../menu/Menu';
|
|
9
|
+
import { Popover } from '../popover/Popover';
|
|
10
|
+
|
|
11
|
+
const LABELS = {
|
|
12
|
+
is: "is",
|
|
13
|
+
isNot: "not",
|
|
14
|
+
contains: "contains",
|
|
15
|
+
notContains: "not contain",
|
|
16
|
+
startsWith: "starts with",
|
|
17
|
+
endsWith: "ends with",
|
|
18
|
+
gt: ">",
|
|
19
|
+
lt: "<",
|
|
20
|
+
gte: "\u2265",
|
|
21
|
+
lte: "\u2264",
|
|
22
|
+
in: "",
|
|
23
|
+
notIn: "not in",
|
|
24
|
+
isEmpty: "empty",
|
|
25
|
+
isNotEmpty: "not empty"
|
|
26
|
+
};
|
|
27
|
+
const DEFAULT_TEXT_OPERATORS = [
|
|
28
|
+
"is",
|
|
29
|
+
"isNot",
|
|
30
|
+
"contains",
|
|
31
|
+
"notContains",
|
|
32
|
+
"startsWith",
|
|
33
|
+
"endsWith",
|
|
34
|
+
"isEmpty",
|
|
35
|
+
"isNotEmpty"
|
|
36
|
+
];
|
|
37
|
+
const NUMBER_OPERATORS = [
|
|
38
|
+
"is",
|
|
39
|
+
"isNot",
|
|
40
|
+
"gt",
|
|
41
|
+
"lt",
|
|
42
|
+
"gte",
|
|
43
|
+
"lte",
|
|
44
|
+
"isEmpty",
|
|
45
|
+
"isNotEmpty"
|
|
46
|
+
];
|
|
47
|
+
const VALUELESS_OPERATORS = ["isEmpty", "isNotEmpty"];
|
|
48
|
+
const INPUT_DEBOUNCE_MS = 500;
|
|
49
|
+
function OperatorDropdown({
|
|
50
|
+
value,
|
|
51
|
+
onChange,
|
|
52
|
+
operators,
|
|
53
|
+
size = "sm",
|
|
54
|
+
disabled
|
|
55
|
+
}) {
|
|
56
|
+
const popRef = useRef(null);
|
|
57
|
+
const [activeIndex, setActiveIndex] = useState(() => Math.max(0, operators.indexOf(value)));
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
setActiveIndex(Math.max(0, operators.indexOf(value)));
|
|
60
|
+
}, [operators, value]);
|
|
61
|
+
const handleSelect = (op) => {
|
|
62
|
+
var _a;
|
|
63
|
+
onChange(op);
|
|
64
|
+
setActiveIndex(operators.indexOf(op));
|
|
65
|
+
(_a = popRef.current) == null ? void 0 : _a.close();
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
Popover,
|
|
69
|
+
{
|
|
70
|
+
ref: popRef,
|
|
71
|
+
minWidth: "160px",
|
|
72
|
+
trigger: (toggle, icon) => /* @__PURE__ */ jsxs(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: toggle,
|
|
77
|
+
disabled,
|
|
78
|
+
"aria-label": "Skift operator",
|
|
79
|
+
className: `${styles.operatorTrigger} ${styles[size]}`,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: styles.operatorText, children: LABELS[value] }),
|
|
82
|
+
icon
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
children: /* @__PURE__ */ jsx(Menu, { children: operators.map((op) => {
|
|
87
|
+
const selected = op === value;
|
|
88
|
+
return /* @__PURE__ */ jsx(Menu.Item, { active: selected, children: /* @__PURE__ */ jsxs("button", { type: "button", onClick: () => handleSelect(op), disabled, children: [
|
|
89
|
+
/* @__PURE__ */ jsx("span", { style: { width: 16, display: "inline-flex", justifyContent: "center" }, children: selected ? /* @__PURE__ */ jsx(Check, { size: 16 }) : null }),
|
|
90
|
+
LABELS[op]
|
|
91
|
+
] }) }, op);
|
|
92
|
+
}) })
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function isFilterActive(value) {
|
|
97
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
98
|
+
if (typeof value === "string") return value.trim().length > 0;
|
|
99
|
+
return value != null;
|
|
100
|
+
}
|
|
101
|
+
function FilterField({
|
|
102
|
+
field,
|
|
103
|
+
control,
|
|
104
|
+
operator,
|
|
105
|
+
value,
|
|
106
|
+
onChange,
|
|
107
|
+
operators,
|
|
108
|
+
options = [],
|
|
109
|
+
single = true,
|
|
110
|
+
size = "md",
|
|
111
|
+
variant = "surface",
|
|
112
|
+
label,
|
|
113
|
+
placeholder = "Type value\u2026",
|
|
114
|
+
disabled,
|
|
115
|
+
"data-cy": dataCy,
|
|
116
|
+
minWidth,
|
|
117
|
+
width,
|
|
118
|
+
maxWidth,
|
|
119
|
+
popoverWidth,
|
|
120
|
+
debounceTime = INPUT_DEBOUNCE_MS,
|
|
121
|
+
...inputProps
|
|
122
|
+
}) {
|
|
123
|
+
var _a, _b, _c, _d;
|
|
124
|
+
const filterFieldRef = useRef(null);
|
|
125
|
+
const ops = useMemo(() => operators != null ? operators : DEFAULT_TEXT_OPERATORS, [operators]);
|
|
126
|
+
const shouldAutoFitTypeahead = control === "select" && single && !width;
|
|
127
|
+
const [selectedOperator, setSelectedOperator] = useState(operator);
|
|
128
|
+
const active = isFilterActive(value);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (ops.includes(operator)) {
|
|
131
|
+
setSelectedOperator(operator);
|
|
132
|
+
}
|
|
133
|
+
}, [operator, ops]);
|
|
134
|
+
const [localValue, setLocalValue] = useState(value != null ? value : "");
|
|
135
|
+
const debounceRef = useRef(null);
|
|
136
|
+
const pendingValueRef = useRef(null);
|
|
137
|
+
const emit = (next) => {
|
|
138
|
+
var _a2, _b2;
|
|
139
|
+
const nextOperator = (_a2 = next.operator) != null ? _a2 : selectedOperator;
|
|
140
|
+
const nextValue = (_b2 = next.value) != null ? _b2 : value;
|
|
141
|
+
if (next.operator) {
|
|
142
|
+
setSelectedOperator(nextOperator);
|
|
143
|
+
}
|
|
144
|
+
onChange({
|
|
145
|
+
field,
|
|
146
|
+
operator: nextOperator,
|
|
147
|
+
value: nextValue
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
const clearDebounce = () => {
|
|
151
|
+
if (debounceRef.current) {
|
|
152
|
+
clearTimeout(debounceRef.current);
|
|
153
|
+
debounceRef.current = null;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const scheduleEmitValue = (nextVal) => {
|
|
157
|
+
clearDebounce();
|
|
158
|
+
pendingValueRef.current = nextVal;
|
|
159
|
+
debounceRef.current = setTimeout(() => {
|
|
160
|
+
emit({ value: nextVal });
|
|
161
|
+
}, debounceTime);
|
|
162
|
+
};
|
|
163
|
+
const flushPendingValue = () => {
|
|
164
|
+
if (control !== "input") return;
|
|
165
|
+
clearDebounce();
|
|
166
|
+
pendingValueRef.current = localValue;
|
|
167
|
+
emit({ value: localValue });
|
|
168
|
+
};
|
|
169
|
+
const handleOperatorChange = (op) => {
|
|
170
|
+
setSelectedOperator(op);
|
|
171
|
+
if (!active && !VALUELESS_OPERATORS.includes(op)) return;
|
|
172
|
+
if (VALUELESS_OPERATORS.includes(op)) {
|
|
173
|
+
clearDebounce();
|
|
174
|
+
pendingValueRef.current = null;
|
|
175
|
+
emit({ operator: op, value: null });
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
clearDebounce();
|
|
179
|
+
pendingValueRef.current = control === "input" ? localValue : typeof value === "string" ? value : null;
|
|
180
|
+
emit({ operator: op });
|
|
181
|
+
};
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
if (control !== "input") return;
|
|
184
|
+
const incoming = value != null ? value : "";
|
|
185
|
+
const pending = pendingValueRef.current;
|
|
186
|
+
if (pending !== null) {
|
|
187
|
+
if (incoming === pending) {
|
|
188
|
+
pendingValueRef.current = null;
|
|
189
|
+
}
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (incoming !== localValue) {
|
|
193
|
+
setLocalValue(incoming);
|
|
194
|
+
}
|
|
195
|
+
}, [value, control, localValue]);
|
|
196
|
+
useEffect(() => {
|
|
197
|
+
return () => {
|
|
198
|
+
clearDebounce();
|
|
199
|
+
};
|
|
200
|
+
}, []);
|
|
201
|
+
return /* @__PURE__ */ jsxs(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
ref: filterFieldRef,
|
|
205
|
+
...dataCy ? { "data-cy": dataCy } : {},
|
|
206
|
+
className: [styles.filterField, styles[size], styles[variant], active ? styles.active : ""].filter(Boolean).join(" "),
|
|
207
|
+
children: [
|
|
208
|
+
label ? /* @__PURE__ */ jsx("span", { className: `${styles.label} ${styles[size]}`, children: label }) : null,
|
|
209
|
+
/* @__PURE__ */ jsx("div", { className: styles.operatorWrapper, children: /* @__PURE__ */ jsx(
|
|
210
|
+
OperatorDropdown,
|
|
211
|
+
{
|
|
212
|
+
value: selectedOperator,
|
|
213
|
+
onChange: handleOperatorChange,
|
|
214
|
+
operators: ops,
|
|
215
|
+
size,
|
|
216
|
+
disabled
|
|
217
|
+
}
|
|
218
|
+
) }),
|
|
219
|
+
/* @__PURE__ */ jsx(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
className: [
|
|
223
|
+
styles.valueWrapper,
|
|
224
|
+
control === "input" ? "dbc-flex dbc-flex-grow" : "",
|
|
225
|
+
shouldAutoFitTypeahead ? styles.autoWidth : ""
|
|
226
|
+
].filter(Boolean).join(" "),
|
|
227
|
+
style: shouldAutoFitTypeahead ? maxWidth ? { maxWidth } : void 0 : { width, maxWidth },
|
|
228
|
+
children: control === "input" ? /* @__PURE__ */ jsx(
|
|
229
|
+
Input,
|
|
230
|
+
{
|
|
231
|
+
variant: "embedded",
|
|
232
|
+
...inputProps,
|
|
233
|
+
fieldClassName: styles.embeddedInputField,
|
|
234
|
+
inputClassName: styles.embeddedInputElement,
|
|
235
|
+
value: localValue,
|
|
236
|
+
onChange: (e) => {
|
|
237
|
+
const next = e.currentTarget.value;
|
|
238
|
+
setLocalValue(next);
|
|
239
|
+
scheduleEmitValue(next);
|
|
240
|
+
},
|
|
241
|
+
onBlur: () => {
|
|
242
|
+
flushPendingValue();
|
|
243
|
+
},
|
|
244
|
+
fullWidth: true,
|
|
245
|
+
inputSize: size,
|
|
246
|
+
placeholder,
|
|
247
|
+
disabled,
|
|
248
|
+
autoComplete: (_a = inputProps.autoComplete) != null ? _a : "off",
|
|
249
|
+
autoCorrect: (_b = inputProps.autoCorrect) != null ? _b : "off",
|
|
250
|
+
autoCapitalize: (_c = inputProps.autoCapitalize) != null ? _c : "none",
|
|
251
|
+
spellCheck: (_d = inputProps.spellCheck) != null ? _d : false,
|
|
252
|
+
onClear: () => {
|
|
253
|
+
clearDebounce();
|
|
254
|
+
pendingValueRef.current = "";
|
|
255
|
+
setLocalValue("");
|
|
256
|
+
emit({ value: "" });
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
) : /* @__PURE__ */ jsx(
|
|
260
|
+
Typeahead,
|
|
261
|
+
{
|
|
262
|
+
options,
|
|
263
|
+
mode: single ? "single" : "multi",
|
|
264
|
+
selectedValue: single ? value != null ? value : null : Array.isArray(value) ? value : [],
|
|
265
|
+
onChange: (v) => emit({ value: v }),
|
|
266
|
+
minWidth,
|
|
267
|
+
popoverWidth,
|
|
268
|
+
popoverAnchorRef: filterFieldRef,
|
|
269
|
+
placeholder,
|
|
270
|
+
variant: "embedded",
|
|
271
|
+
inputProps: {
|
|
272
|
+
inputSize: size,
|
|
273
|
+
fieldClassName: styles.embeddedInputField,
|
|
274
|
+
inputClassName: styles.embeddedInputElement
|
|
275
|
+
},
|
|
276
|
+
onClear: () => emit({ value: single ? "" : [] }),
|
|
277
|
+
disabled,
|
|
278
|
+
fullWidth: !shouldAutoFitTypeahead,
|
|
279
|
+
fitContent: shouldAutoFitTypeahead
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export { FilterField, NUMBER_OPERATORS };
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
.filterField {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: stretch;
|
|
4
|
+
gap: 0;
|
|
5
|
+
position: relative;
|
|
6
|
+
z-index: 0;
|
|
7
|
+
font-size: var(--font-size-sm);
|
|
8
|
+
font-family: var(--font-family);
|
|
9
|
+
color: var(--color-fg-default);
|
|
10
|
+
border: 1px solid transparent;
|
|
11
|
+
border-radius: var(--border-radius-default);
|
|
12
|
+
overflow: visible;
|
|
13
|
+
transition:
|
|
14
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
15
|
+
border-color var(--transition-fast) var(--ease-standard),
|
|
16
|
+
box-shadow var(--transition-fast) var(--ease-standard),
|
|
17
|
+
color var(--transition-fast) var(--ease-standard);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* =========================
|
|
21
|
+
VARIANTS
|
|
22
|
+
========================= */
|
|
23
|
+
|
|
24
|
+
.filterField.surface {
|
|
25
|
+
background: var(--color-bg-surface);
|
|
26
|
+
border-color: var(--color-border-subtle);
|
|
27
|
+
box-shadow: var(--shadow-xs);
|
|
28
|
+
--filter-operator-bg: var(--color-bg-surface);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.filterField.surface:hover {
|
|
32
|
+
border-color: var(--color-border-default);
|
|
33
|
+
box-shadow: var(--shadow-sm);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.filterField.surface.active {
|
|
37
|
+
background: color-mix(in srgb, var(--color-bg-selected) 45%, var(--color-bg-surface));
|
|
38
|
+
border-color: var(--color-border-selected);
|
|
39
|
+
box-shadow: var(--shadow-sm);
|
|
40
|
+
--filter-operator-bg: color-mix(in srgb, var(--color-bg-selected) 45%, var(--color-bg-surface));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.filterField.outlined {
|
|
44
|
+
background: var(--color-bg-surface);
|
|
45
|
+
border-color: var(--color-border-subtle);
|
|
46
|
+
box-shadow: none;
|
|
47
|
+
--filter-operator-bg: var(--color-bg-surface);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.filterField.outlined:hover {
|
|
51
|
+
border-color: var(--color-border-default);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.filterField.outlined.active {
|
|
55
|
+
background: color-mix(in srgb, var(--color-bg-selected) 38%, var(--color-bg-surface));
|
|
56
|
+
border-color: var(--color-border-selected);
|
|
57
|
+
box-shadow: none;
|
|
58
|
+
--filter-operator-bg: color-mix(in srgb, var(--color-bg-selected) 38%, var(--color-bg-surface));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.filterField.subtle {
|
|
62
|
+
background: var(--color-bg-toolbar);
|
|
63
|
+
border-color: transparent;
|
|
64
|
+
box-shadow: inset 0 0 0 1px transparent;
|
|
65
|
+
--filter-operator-bg: color-mix(in srgb, var(--color-fg-default) 4%, var(--color-bg-toolbar));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.filterField.subtle:hover {
|
|
69
|
+
background: var(--color-bg-surface-strong);
|
|
70
|
+
--filter-operator-bg: color-mix(
|
|
71
|
+
in srgb,
|
|
72
|
+
var(--color-fg-default) 6%,
|
|
73
|
+
var(--color-bg-surface-strong)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.filterField.subtle.active {
|
|
78
|
+
background: color-mix(in srgb, var(--color-bg-selected) 55%, var(--color-bg-surface-strong));
|
|
79
|
+
border-color: var(--color-border-selected);
|
|
80
|
+
box-shadow: inset 0 0 0 1px transparent;
|
|
81
|
+
--filter-operator-bg: color-mix(
|
|
82
|
+
in srgb,
|
|
83
|
+
var(--color-bg-selected) 55%,
|
|
84
|
+
var(--color-bg-surface-strong)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.filterField.active .label {
|
|
89
|
+
color: var(--color-fg-default);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* =========================
|
|
93
|
+
FOCUS
|
|
94
|
+
========================= */
|
|
95
|
+
|
|
96
|
+
.filterField:focus-within {
|
|
97
|
+
z-index: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.filterField.surface:focus-within,
|
|
101
|
+
.filterField.outlined:focus-within,
|
|
102
|
+
.filterField.subtle:focus-within {
|
|
103
|
+
border-color: var(--color-border-selected);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.filterField.surface:focus-within {
|
|
107
|
+
box-shadow: var(--shadow-sm);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.filterField.outlined:focus-within,
|
|
111
|
+
.filterField.subtle:focus-within {
|
|
112
|
+
box-shadow: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.filterField.surface.active:focus-within {
|
|
116
|
+
box-shadow: var(--shadow-sm);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.filterField.outlined.active:focus-within,
|
|
120
|
+
.filterField.subtle.active:focus-within {
|
|
121
|
+
box-shadow: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* =========================
|
|
125
|
+
SIZES
|
|
126
|
+
========================= */
|
|
127
|
+
|
|
128
|
+
.filterField.sm {
|
|
129
|
+
block-size: var(--component-size-sm);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.filterField.md {
|
|
133
|
+
block-size: var(--component-size-md);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.filterField.lg {
|
|
137
|
+
block-size: var(--component-size-lg);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* =========================
|
|
141
|
+
LABEL
|
|
142
|
+
========================= */
|
|
143
|
+
|
|
144
|
+
.filterField .label {
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
padding-block: var(--spacing-2xs);
|
|
148
|
+
padding-inline: var(--spacing-xs);
|
|
149
|
+
padding-inline-end: var(--spacing-xxs);
|
|
150
|
+
font-size: var(--font-size-sm);
|
|
151
|
+
color: var(--color-fg-subtle);
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
user-select: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* =========================
|
|
157
|
+
OPERATOR
|
|
158
|
+
========================= */
|
|
159
|
+
|
|
160
|
+
.filterField .operatorWrapper {
|
|
161
|
+
flex: 0 0 auto;
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: stretch;
|
|
164
|
+
min-width: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.filterField .operatorTrigger {
|
|
168
|
+
display: inline-flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
gap: var(--spacing-xxs);
|
|
172
|
+
height: 100%;
|
|
173
|
+
padding-block: var(--spacing-2xs);
|
|
174
|
+
padding-inline: var(--spacing-xxs);
|
|
175
|
+
color: var(--color-fg-default);
|
|
176
|
+
background: transparent;
|
|
177
|
+
border: 0;
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
position: relative;
|
|
180
|
+
z-index: 0;
|
|
181
|
+
font-weight: var(--font-weight-default);
|
|
182
|
+
font-size: var(--font-size-sm);
|
|
183
|
+
transition:
|
|
184
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
185
|
+
color var(--transition-fast) var(--ease-standard);
|
|
186
|
+
flex: 0 0 auto;
|
|
187
|
+
white-space: nowrap;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.filterField .operatorTrigger::after {
|
|
191
|
+
content: '';
|
|
192
|
+
position: absolute;
|
|
193
|
+
inset: 1px 0;
|
|
194
|
+
background: var(--filter-operator-bg, transparent);
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
z-index: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.filterField .operatorTrigger > * {
|
|
200
|
+
position: relative;
|
|
201
|
+
z-index: 1;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.filterField .operatorTrigger:hover:not(:disabled) {
|
|
205
|
+
color: var(--color-fg-default);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.filterField .operatorTrigger:hover:not(:disabled)::after {
|
|
209
|
+
background: color-mix(
|
|
210
|
+
in srgb,
|
|
211
|
+
var(--color-fg-default) 8%,
|
|
212
|
+
var(--filter-operator-bg, transparent)
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* =========================
|
|
217
|
+
SEPARATORS
|
|
218
|
+
========================= */
|
|
219
|
+
|
|
220
|
+
.filterField .operatorTrigger::before {
|
|
221
|
+
content: '';
|
|
222
|
+
position: absolute;
|
|
223
|
+
inset-inline-start: 0;
|
|
224
|
+
top: 8px;
|
|
225
|
+
bottom: 8px;
|
|
226
|
+
width: 1px;
|
|
227
|
+
background: var(--color-border-subtle);
|
|
228
|
+
pointer-events: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* =========================
|
|
232
|
+
DISABLED
|
|
233
|
+
========================= */
|
|
234
|
+
|
|
235
|
+
.filterField .operatorTrigger:disabled,
|
|
236
|
+
.filterField .operatorTrigger[aria-disabled='true'] {
|
|
237
|
+
cursor: not-allowed;
|
|
238
|
+
color: var(--color-disabled-fg);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.filterField.surface .operatorTrigger:disabled,
|
|
242
|
+
.filterField.outlined .operatorTrigger:disabled {
|
|
243
|
+
--filter-operator-bg: var(--color-disabled-bg);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.filterField.subtle .operatorTrigger:disabled {
|
|
247
|
+
--filter-operator-bg: color-mix(
|
|
248
|
+
in srgb,
|
|
249
|
+
var(--color-fg-default) 3%,
|
|
250
|
+
var(--color-bg-surface-subtle)
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.operatorTrigger svg {
|
|
255
|
+
height: var(--component-size-xxs);
|
|
256
|
+
width: var(--component-size-xxs);
|
|
257
|
+
flex: 0 0 auto;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* =========================
|
|
261
|
+
VALUE WRAPPER
|
|
262
|
+
========================= */
|
|
263
|
+
|
|
264
|
+
.filterField .valueWrapper {
|
|
265
|
+
display: flex;
|
|
266
|
+
align-items: center;
|
|
267
|
+
padding: 0;
|
|
268
|
+
height: 100%;
|
|
269
|
+
flex: 1 1 auto;
|
|
270
|
+
min-width: 0;
|
|
271
|
+
position: relative;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* Base child sizing */
|
|
275
|
+
.filterField .valueWrapper > * {
|
|
276
|
+
height: 100%;
|
|
277
|
+
min-width: 0;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.filterField .valueWrapper > div {
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
height: 100%;
|
|
284
|
+
min-width: 0;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Fill mode: regular inputs should stretch */
|
|
288
|
+
.filterField .valueWrapper:not(.autoWidth) > * {
|
|
289
|
+
width: 100%;
|
|
290
|
+
flex: 1 1 auto;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.filterField .valueWrapper:not(.autoWidth) > div {
|
|
294
|
+
width: 100%;
|
|
295
|
+
flex: 1 1 auto;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Auto-width mode: let Typeahead keep its measured width */
|
|
299
|
+
.filterField .valueWrapper.autoWidth {
|
|
300
|
+
flex: 1 1 auto;
|
|
301
|
+
width: auto;
|
|
302
|
+
min-width: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.filterField .valueWrapper.autoWidth > * {
|
|
306
|
+
width: auto;
|
|
307
|
+
flex: 1 1 auto;
|
|
308
|
+
min-width: 0;
|
|
309
|
+
max-width: 100%;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.filterField .valueWrapper.autoWidth > div {
|
|
313
|
+
width: auto;
|
|
314
|
+
flex: 1 1 auto;
|
|
315
|
+
min-width: 0;
|
|
316
|
+
max-width: 100%;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* Embedded Input internals */
|
|
320
|
+
.filterField .valueWrapper .field {
|
|
321
|
+
min-height: unset;
|
|
322
|
+
height: 100%;
|
|
323
|
+
block-size: 100%;
|
|
324
|
+
box-shadow: none;
|
|
325
|
+
border: none;
|
|
326
|
+
background: transparent;
|
|
327
|
+
min-width: 0;
|
|
328
|
+
width: 100%;
|
|
329
|
+
flex: 1 1 auto;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/* Keep a small breathing space inside the filter row */
|
|
333
|
+
.embeddedInputField {
|
|
334
|
+
min-width: 0;
|
|
335
|
+
width: 100%;
|
|
336
|
+
flex: 1 1 auto;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.embeddedInputElement {
|
|
340
|
+
flex: 1 1 auto;
|
|
341
|
+
inline-size: 100%;
|
|
342
|
+
width: 100%;
|
|
343
|
+
min-width: 0;
|
|
344
|
+
height: 100%;
|
|
345
|
+
block-size: 100%;
|
|
346
|
+
min-height: unset;
|
|
347
|
+
background: transparent;
|
|
348
|
+
border: none;
|
|
349
|
+
box-shadow: none;
|
|
350
|
+
padding-block: 0;
|
|
351
|
+
padding-inline: 0;
|
|
352
|
+
margin: 0;
|
|
353
|
+
box-sizing: border-box;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.filterField .valueWrapper .startAdornment {
|
|
357
|
+
margin-left: 0;
|
|
358
|
+
gap: 2px;
|
|
359
|
+
min-width: 0;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* =========================
|
|
363
|
+
TEXT
|
|
364
|
+
========================= */
|
|
365
|
+
|
|
366
|
+
.filterField .operatorText {
|
|
367
|
+
white-space: nowrap;
|
|
368
|
+
font-family: var(--font-family-mono);
|
|
369
|
+
font-size: var(--font-size-xs);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.filterField input {
|
|
373
|
+
height: 100%;
|
|
374
|
+
min-width: 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.filterField input::placeholder {
|
|
378
|
+
color: var(--color-fg-subtle);
|
|
379
|
+
}
|