@servicetitan/anvil2 3.0.6 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/Combobox.js +1 -2
- package/dist/Combobox.js.map +1 -1
- package/dist/{DataTable-0kOuVgSB.js → DataTable-E8z0H8c7.js} +140 -13
- package/dist/{DataTable-0kOuVgSB.js.map → DataTable-E8z0H8c7.js.map} +1 -1
- package/dist/DataTable.css +47 -5
- package/dist/{DateFieldRange-Be_I9GTp.js → DateFieldRange-BN_uIvHI.js} +24 -12
- package/dist/DateFieldRange-BN_uIvHI.js.map +1 -0
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-CsrsY9i8.js → DateFieldSingle-h3YkdwPo.js} +2 -2
- package/dist/{DateFieldSingle-CsrsY9i8.js.map → DateFieldSingle-h3YkdwPo.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{Dialog-CD-SDfPT.js → Dialog-CvYSMvfD.js} +2 -2
- package/dist/{Dialog-CD-SDfPT.js.map → Dialog-CvYSMvfD.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/FilterBar-B4ZAs73g.js +412 -0
- package/dist/FilterBar-B4ZAs73g.js.map +1 -0
- package/dist/FilterBar.js +1 -1
- package/dist/{ListView-CcRRh1ap.js → ListView-DO5psxd4.js} +5 -5
- package/dist/{ListView-CcRRh1ap.js.map → ListView-DO5psxd4.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{ListView.module-CKUQP3kf.js → ListView.module-DfqtCL3Q.js} +3 -3
- package/dist/ListView.module-DfqtCL3Q.js.map +1 -0
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-BMVROOjy.js → MultiSelectFieldSync-CXX2F0ru.js} +59 -29
- package/dist/MultiSelectFieldSync-CXX2F0ru.js.map +1 -0
- package/dist/MultiSelectFieldSync.css +72 -69
- package/dist/MultiSelectMenu.js +1 -1
- package/dist/{MultiSelectMenuSync-BNPp_2Bm.js → MultiSelectMenuSync-EKtvlL62.js} +218 -47
- package/dist/MultiSelectMenuSync-EKtvlL62.js.map +1 -0
- package/dist/{Page-SBy27-Wv.js → Page-C2_Hm27h.js} +2 -2
- package/dist/{Page-SBy27-Wv.js.map → Page-C2_Hm27h.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Pagination-Cm8-K6VH.js → Pagination-Bmd4JORe.js} +2 -2
- package/dist/{Pagination-Cm8-K6VH.js.map → Pagination-Bmd4JORe.js.map} +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/SavedFiltersButton-2qba2Cgu.js +650 -0
- package/dist/SavedFiltersButton-2qba2Cgu.js.map +1 -0
- package/dist/SavedFiltersButton.css +8 -0
- package/dist/SavedFiltersButton.d.ts +1 -0
- package/dist/SavedFiltersButton.js +2 -0
- package/dist/SavedFiltersButton.js.map +1 -0
- package/dist/{SearchField-3tUPU8hH.js → SearchField-BMHJCVFu.js} +2 -2
- package/dist/{SearchField-3tUPU8hH.js.map → SearchField-BMHJCVFu.js.map} +1 -1
- package/dist/{SearchField-BcQZ5e0x.js → SearchField-fXc_vWEr.js} +2 -2
- package/dist/{SearchField-BcQZ5e0x.js.map → SearchField-fXc_vWEr.js.map} +1 -1
- package/dist/SearchField.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldSync-BeDYbJ2M.js → SelectFieldSync-DykGkR_w.js} +3 -3
- package/dist/{SelectFieldSync-BeDYbJ2M.js.map → SelectFieldSync-DykGkR_w.js.map} +1 -1
- package/dist/SelectMenu.js +1 -1
- package/dist/{SelectMenuSync-C-PFemsQ.js → SelectMenuSync-DTQ8Ofoz.js} +21 -9
- package/dist/SelectMenuSync-DTQ8Ofoz.js.map +1 -0
- package/dist/{SelectOptions-Tr11Ckqw.js → SelectOptions-DVSOJwRy.js} +2 -2
- package/dist/{SelectOptions-Tr11Ckqw.js.map → SelectOptions-DVSOJwRy.js.map} +1 -1
- package/dist/{SelectTrigger-DTz7V-Xx.js → SelectTrigger-CHk0KO-P.js} +2 -2
- package/dist/{SelectTrigger-DTz7V-Xx.js.map → SelectTrigger-CHk0KO-P.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-Ds6I7Qbr.js → SelectTriggerBase-B2S5SOZr.js} +134 -38
- package/dist/SelectTriggerBase-B2S5SOZr.js.map +1 -0
- package/dist/Table.js +1 -1
- package/dist/{Toolbar-BUd9eNkq.js → Toolbar-DaUKbbsL.js} +3 -3
- package/dist/{Toolbar-BUd9eNkq.js.map → Toolbar-DaUKbbsL.js.map} +1 -1
- package/dist/Toolbar.js +2 -2
- package/dist/{ToolbarButtonToggle-C06cqJ6F.js → ToolbarButtonToggle-BPu81Wuv.js} +4 -3
- package/dist/ToolbarButtonToggle-BPu81Wuv.js.map +1 -0
- package/dist/beta.js +10 -9
- package/dist/beta.js.map +1 -1
- package/dist/filter-state-Bx3aYS1r.js +1627 -0
- package/dist/filter-state-Bx3aYS1r.js.map +1 -0
- package/dist/{FilterBar.css → filter-state.css} +19 -33
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/src/beta/components/FilterBar/FilterBar.d.ts +12 -10
- package/dist/src/beta/components/FilterBar/FilterDateList.d.ts +15 -5
- package/dist/src/beta/components/FilterBar/FilterDateRange.d.ts +34 -29
- package/dist/src/beta/components/FilterBar/FilterDateSingle.d.ts +31 -22
- package/dist/src/beta/components/FilterBar/FilterDrawer.d.ts +1 -1
- package/dist/src/beta/components/FilterBar/FilterItemWrapper.d.ts +4 -12
- package/dist/src/beta/components/FilterBar/FilterNumericRange.d.ts +29 -0
- package/dist/src/beta/components/FilterBar/FilterPopoverButton.d.ts +86 -0
- package/dist/src/beta/components/FilterBar/FilterToggleButton.d.ts +2 -2
- package/dist/src/beta/components/FilterBar/FilterTriggerButton.d.ts +50 -0
- package/dist/src/beta/components/FilterBar/index.d.ts +1 -1
- package/dist/src/beta/components/FilterBar/internal/FilterGroupContext.d.ts +5 -9
- package/dist/src/beta/components/FilterBar/internal/adapters/asyncMultiSelect.d.ts +6 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/asyncSelect.d.ts +6 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/boolean.d.ts +3 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/custom.d.ts +3 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/date.d.ts +5 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/dateList.d.ts +5 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/dateRange.d.ts +8 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/index.d.ts +15 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/multiSelect.d.ts +6 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/numericRange.d.ts +3 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/singleSelect.d.ts +6 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/types.d.ts +78 -0
- package/dist/src/beta/components/FilterBar/internal/types.d.ts +166 -61
- package/dist/src/beta/components/FilterBar/internal/utils/dateListLibraryOptions.d.ts +2 -2
- package/dist/src/beta/components/FilterBar/internal/utils/filter-state.d.ts +2 -40
- package/dist/src/beta/components/FilterBar/internal/utils/test.d.ts +13 -28
- package/dist/src/beta/components/FilterBar/internal/utils/value-compare.d.ts +14 -0
- package/dist/src/beta/components/MultiSelectField/internal/MultiSelectFieldComboboxMode.d.ts +1 -1
- package/dist/src/beta/components/MultiSelectField/internal/MultiSelectFieldSelectMode.d.ts +1 -1
- package/dist/src/beta/components/MultiSelectField/internal/types.d.ts +4 -2
- package/dist/src/beta/components/MultiSelectField/internal/useComboMultiple.d.ts +7 -5
- package/dist/src/beta/components/MultiSelectField/internal/useSelectModeMultiple.d.ts +5 -2
- package/dist/src/beta/components/MultiSelectField/types.d.ts +21 -36
- package/dist/src/beta/components/MultiSelectMenu/MultiSelectMenu.d.ts +1 -0
- package/dist/src/beta/components/MultiSelectMenu/types.d.ts +52 -12
- package/dist/src/beta/components/SavedFiltersButton/SavedFiltersButton.d.ts +40 -0
- package/dist/src/beta/components/SavedFiltersButton/index.d.ts +2 -0
- package/dist/src/beta/components/SavedFiltersButton/internal/AddSavedFilterDrawer.d.ts +27 -0
- package/dist/src/beta/components/SavedFiltersButton/internal/EditSavedFiltersDrawer.d.ts +38 -0
- package/dist/src/beta/components/SavedFiltersButton/types.d.ts +147 -0
- package/dist/src/beta/components/SelectField/types.d.ts +7 -11
- package/dist/src/beta/components/SelectMenu/internal/useMenuInteraction.d.ts +8 -1
- package/dist/src/beta/components/SelectMenu/types.d.ts +21 -1
- package/dist/src/beta/components/Table/DataTable/internal/DataTablePagination.d.ts +6 -0
- package/dist/src/beta/components/Table/DataTable/types.d.ts +43 -10
- package/dist/src/beta/components/Toolbar/internal/ToolbarContext.d.ts +3 -2
- package/dist/src/beta/components/index.d.ts +1 -0
- package/dist/src/internal/components/MenuFooter/MenuFooter.d.ts +43 -0
- package/dist/src/internal/components/OptionCheckbox.d.ts +6 -0
- package/dist/src/internal/components/OptionContentArea.d.ts +8 -0
- package/dist/src/internal/components/OptionRow.d.ts +10 -0
- package/dist/src/internal/components/OptionsPopover/OptionsPopover.d.ts +4 -4
- package/dist/src/internal/hooks/index.d.ts +2 -0
- package/dist/src/internal/hooks/useBulkActionRunner.d.ts +41 -0
- package/dist/src/internal/hooks/useConfirmationDraft.d.ts +21 -0
- package/dist/src/internal/types/bulkActionTypes.d.ts +39 -0
- package/dist/src/internal/types/confirmationTypes.d.ts +19 -0
- package/dist/src/internal/types/optionContent.d.ts +19 -0
- package/dist/src/internal/types/selectFieldInternalTypes.d.ts +2 -0
- package/dist/{syncFilterUtils-COxBIkt6.js → syncFilterUtils-BEKek64h.js} +163 -124
- package/dist/syncFilterUtils-BEKek64h.js.map +1 -0
- package/dist/syncFilterUtils.css +96 -59
- package/dist/{Combobox-Cp7M4-4r.js → useInfiniteCombobox-CknXmqlQ.js} +185 -10
- package/dist/useInfiniteCombobox-CknXmqlQ.js.map +1 -0
- package/dist/{useMenuInteraction-C4RU5Fdq.js → useMenuInteraction-CpAOHSJu.js} +118 -5
- package/dist/useMenuInteraction-CpAOHSJu.js.map +1 -0
- package/dist/useMenuInteraction.css +28 -0
- package/dist/{useToggleSelection-B5PnTuT2.js → useToggleSelection-B-Z80gy2.js} +53 -4
- package/dist/useToggleSelection-B-Z80gy2.js.map +1 -0
- package/package.json +3 -3
- package/dist/Combobox-Cp7M4-4r.js.map +0 -1
- package/dist/DateFieldRange-Be_I9GTp.js.map +0 -1
- package/dist/FilterBar-yysyZ-t1.js +0 -1797
- package/dist/FilterBar-yysyZ-t1.js.map +0 -1
- package/dist/ListView.module-CKUQP3kf.js.map +0 -1
- package/dist/MultiSelectFieldSync-BMVROOjy.js.map +0 -1
- package/dist/MultiSelectMenuSync-BNPp_2Bm.js.map +0 -1
- package/dist/SelectMenuSync-C-PFemsQ.js.map +0 -1
- package/dist/SelectTriggerBase-Ds6I7Qbr.js.map +0 -1
- package/dist/ToolbarButtonToggle-C06cqJ6F.js.map +0 -1
- package/dist/src/beta/components/FilterBar/FilterButton.d.ts +0 -33
- package/dist/src/beta/components/FilterBar/FilterSelect.d.ts +0 -29
- package/dist/syncFilterUtils-COxBIkt6.js.map +0 -1
- package/dist/useInfiniteCombobox-WcRgC9p6.js +0 -179
- package/dist/useInfiniteCombobox-WcRgC9p6.js.map +0 -1
- package/dist/useMenuInteraction-C4RU5Fdq.js.map +0 -1
- package/dist/useToggleSelection-B5PnTuT2.js.map +0 -1
- /package/dist/{Combobox.css → useInfiniteCombobox.css} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { Filter } from './internal/types';
|
|
3
3
|
import { LayoutUtilProps } from '../../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { ToolbarSize } from '../Toolbar/types';
|
|
5
5
|
/**
|
|
6
6
|
* Props for the FilterBar component
|
|
7
7
|
*
|
|
@@ -23,10 +23,11 @@ export type FilterBarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps &
|
|
|
23
23
|
*/
|
|
24
24
|
size?: ToolbarSize;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* When true, filters stay inline at every container width instead of
|
|
27
|
+
* collapsing to drawer-only mode at narrow widths.
|
|
28
|
+
* @default false
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
disableCollapse?: boolean;
|
|
30
31
|
};
|
|
31
32
|
/**
|
|
32
33
|
* FilterBar component for displaying a standalone group of filters with toggles and a clear button.
|
|
@@ -35,13 +36,13 @@ export type FilterBarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps &
|
|
|
35
36
|
* - Standalone component with `role="toolbar"` and keyboard navigation
|
|
36
37
|
* - Renders filter toggles and popovers for all filter types
|
|
37
38
|
* - Supports controlled and uncontrolled filtering
|
|
38
|
-
* - Integrates with FilterDrawer for batch filter editing
|
|
39
|
+
* - Integrates with FilterDrawer for batch filter editing of drawer-only filters
|
|
39
40
|
* - Provides a clear all filters button
|
|
40
|
-
* - Handles overflow and hidden filters
|
|
41
41
|
* - Shares filter state via context for child components
|
|
42
42
|
* - Supports boolean, custom, single-select, multi-select, date, and date range filter types
|
|
43
43
|
* - Preserves filter state when filter configuration changes
|
|
44
|
-
* - Responsive:
|
|
44
|
+
* - Responsive: collapses to drawer-only mode below 640px; opt out via `disableCollapse`
|
|
45
|
+
* - Always wraps; never collapses items into an overflow menu
|
|
45
46
|
* - Can be composed alongside Toolbar as a sibling using Flex layout
|
|
46
47
|
*
|
|
47
48
|
* @example
|
|
@@ -80,8 +81,9 @@ export declare const FilterBar: import('react').ForwardRefExoticComponent<Omit<i
|
|
|
80
81
|
*/
|
|
81
82
|
size?: ToolbarSize;
|
|
82
83
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
84
|
+
* When true, filters stay inline at every container width instead of
|
|
85
|
+
* collapsing to drawer-only mode at narrow widths.
|
|
86
|
+
* @default false
|
|
85
87
|
*/
|
|
86
|
-
|
|
88
|
+
disableCollapse?: boolean;
|
|
87
89
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { DateFieldSingleProps } from '../../../components/DateFieldSingle';
|
|
2
3
|
import { DateListFilter, DateListLibraryOptionId, DateListOption } from './internal/types';
|
|
3
4
|
interface DateListDialogProps {
|
|
@@ -24,14 +25,23 @@ interface DateListDialogProps {
|
|
|
24
25
|
export declare const DateListDialog: ({ libraryId, parentFilterId, initialValue, mode, dialogCtaLabel, onCommit, onCancel, }: DateListDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
interface FilterDateListProps {
|
|
26
27
|
filter: DateListFilter;
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
committedValue: DateListOption | undefined;
|
|
29
|
+
onCommit: (value: DateListOption | undefined) => void;
|
|
30
|
+
label: ReactNode;
|
|
31
|
+
isSelected: boolean;
|
|
29
32
|
/** Primary CTA label for the library-option dialog. */
|
|
30
33
|
dialogCtaLabel: "Apply" | "Save";
|
|
34
|
+
/** Configures a "Clear" button in the SelectMenu footer. Presence enables it. */
|
|
35
|
+
clear?: {
|
|
36
|
+
onClick: () => void;
|
|
37
|
+
label?: string;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
};
|
|
31
40
|
}
|
|
32
41
|
/**
|
|
33
|
-
* FilterDateList renders the dateList filter's option list
|
|
34
|
-
* Consumer options commit immediately; library options open a Dialog
|
|
42
|
+
* FilterDateList renders the dateList filter's option list via SelectMenuSync.
|
|
43
|
+
* Consumer options commit immediately; library options open a Dialog whose
|
|
44
|
+
* Apply commits the final picked date or range.
|
|
35
45
|
*/
|
|
36
|
-
export declare const FilterDateList: ({ filter,
|
|
46
|
+
export declare const FilterDateList: ({ filter, committedValue, onCommit, label, isSelected, dialogCtaLabel, clear, }: FilterDateListProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
47
|
export {};
|
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
import { DateRangeFilter } from './internal/types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
2
|
+
type Value = {
|
|
3
|
+
startDate: string | null;
|
|
4
|
+
endDate: string | null;
|
|
5
|
+
} | null;
|
|
6
|
+
type InlineProps = {
|
|
7
|
+
variant: "inline";
|
|
9
8
|
filter: DateRangeFilter;
|
|
9
|
+
draftValue: Value;
|
|
10
|
+
onDraftChange: (value: Value) => void;
|
|
11
|
+
};
|
|
12
|
+
type PopoverProps = {
|
|
13
|
+
variant?: "popover";
|
|
14
|
+
filter: DateRangeFilter;
|
|
15
|
+
committedValue: Value;
|
|
16
|
+
onCommit: (value: Value) => void;
|
|
17
|
+
controlledFiltering: boolean;
|
|
18
|
+
label: React.ReactNode;
|
|
19
|
+
isSelected: boolean;
|
|
10
20
|
/**
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
draftValue: {
|
|
14
|
-
startDate: string | null;
|
|
15
|
-
endDate: string | null;
|
|
16
|
-
} | null;
|
|
17
|
-
/**
|
|
18
|
-
* Callback function to update the draft value when the date range changes
|
|
21
|
+
* Configures a "Clear" button in the popover footer. Presence enables it.
|
|
22
|
+
* Clear commits immediately regardless of `controlledFiltering`.
|
|
19
23
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
24
|
+
clear?: {
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
label?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type FilterDateRangeProps = InlineProps | PopoverProps;
|
|
25
31
|
/**
|
|
26
|
-
* FilterDateRange
|
|
32
|
+
* FilterDateRange renders a date-range picker for FilterBar.
|
|
27
33
|
*
|
|
28
|
-
*
|
|
29
|
-
* -
|
|
30
|
-
*
|
|
31
|
-
* -
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* - Handles start and end date selection independently
|
|
34
|
+
* Two variants:
|
|
35
|
+
* - `popover` (default) owns its trigger + OptionsPopover + (when controlled)
|
|
36
|
+
* Apply/Cancel footer, and commits via `onCommit`.
|
|
37
|
+
* - `inline` renders just the masked input + calendar body, with draft state
|
|
38
|
+
* lifted to the parent via `draftValue` / `onDraftChange`. Used when the
|
|
39
|
+
* component is embedded inside another shell (e.g. DateListDialog).
|
|
35
40
|
*/
|
|
36
|
-
export declare const FilterDateRange: (
|
|
41
|
+
export declare const FilterDateRange: (props: FilterDateRangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
42
|
export {};
|
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
import { DateFilter } from './internal/types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
interface FilterDateSingleProps {
|
|
6
|
-
/**
|
|
7
|
-
* The date filter configuration object containing mode and other settings
|
|
8
|
-
*/
|
|
2
|
+
type Value = string | null;
|
|
3
|
+
type InlineProps = {
|
|
4
|
+
variant: "inline";
|
|
9
5
|
filter: DateFilter;
|
|
6
|
+
draftValue: Value;
|
|
7
|
+
onDraftChange: (value: Value) => void;
|
|
8
|
+
};
|
|
9
|
+
type PopoverProps = {
|
|
10
|
+
variant?: "popover";
|
|
11
|
+
filter: DateFilter;
|
|
12
|
+
committedValue: Value;
|
|
13
|
+
onCommit: (value: Value) => void;
|
|
14
|
+
controlledFiltering: boolean;
|
|
15
|
+
label: React.ReactNode;
|
|
16
|
+
isSelected: boolean;
|
|
10
17
|
/**
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
draftValue: string | null;
|
|
14
|
-
/**
|
|
15
|
-
* Callback function to update the draft value when the date changes
|
|
18
|
+
* Configures a "Clear" button in the popover footer. Presence enables it.
|
|
19
|
+
* Clear commits immediately regardless of `controlledFiltering`.
|
|
16
20
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
clear?: {
|
|
22
|
+
onClick: () => void;
|
|
23
|
+
label?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type FilterDateSingleProps = InlineProps | PopoverProps;
|
|
19
28
|
/**
|
|
20
|
-
* FilterDateSingle
|
|
29
|
+
* FilterDateSingle renders a single-date picker for FilterBar.
|
|
21
30
|
*
|
|
22
|
-
*
|
|
23
|
-
* -
|
|
24
|
-
*
|
|
25
|
-
* -
|
|
26
|
-
*
|
|
27
|
-
*
|
|
31
|
+
* Two variants:
|
|
32
|
+
* - `popover` (default) owns its trigger + OptionsPopover + (when controlled)
|
|
33
|
+
* Apply/Cancel footer, and commits via `onCommit`.
|
|
34
|
+
* - `inline` renders just the masked input + calendar body, with draft state
|
|
35
|
+
* lifted to the parent via `draftValue` / `onDraftChange`. Used when the
|
|
36
|
+
* component is embedded inside another shell (e.g. DateListDialog).
|
|
28
37
|
*/
|
|
29
|
-
export declare const FilterDateSingle: (
|
|
38
|
+
export declare const FilterDateSingle: (props: FilterDateSingleProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
39
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FilterDrawer component provides a drawer interface for filter selection.
|
|
3
3
|
* Always operates in controlled mode with batch updates.
|
|
4
|
-
* Built into FilterGroup for
|
|
4
|
+
* Built into FilterGroup for batch editing of drawer-only and below-breakpoint filters.
|
|
5
5
|
*
|
|
6
6
|
* Features:
|
|
7
7
|
* - Shows all available filters in a side panel
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import { Filter } from './internal/types';
|
|
2
1
|
/**
|
|
3
2
|
* Props for the FilterItemWrapper component
|
|
4
3
|
*/
|
|
5
4
|
type FilterItemWrapperProps = {
|
|
6
|
-
/**
|
|
7
|
-
* Optional filter object. If provided, visibility changes will be tracked in FilterGroupContext.
|
|
8
|
-
* If not provided, only basic visibility tracking will be used.
|
|
9
|
-
*/
|
|
10
|
-
filter?: Filter;
|
|
11
5
|
/** The content to render inside the wrapper */
|
|
12
6
|
children: React.ReactNode;
|
|
13
7
|
};
|
|
14
8
|
/**
|
|
15
|
-
* FilterItemWrapper
|
|
16
|
-
*
|
|
17
|
-
* Built into FilterButton and other filter components for consistent overflow handling.
|
|
9
|
+
* FilterItemWrapper wraps a filter control in ToolbarItemWrapper so it
|
|
10
|
+
* registers with the surrounding toolbar context for keyboard navigation.
|
|
18
11
|
*
|
|
19
12
|
* Features:
|
|
20
|
-
* -
|
|
21
|
-
* - Integrates with FilterGroupContext to track hidden filters
|
|
13
|
+
* - Registers the control with the surrounding toolbar context
|
|
22
14
|
*/
|
|
23
|
-
export declare const FilterItemWrapper: ({
|
|
15
|
+
export declare const FilterItemWrapper: ({ children }: FilterItemWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
16
|
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NumericRangeFilter, NumericRangeValue } from './internal/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the FilterNumericRange component.
|
|
4
|
+
*/
|
|
5
|
+
interface FilterNumericRangeProps {
|
|
6
|
+
/** The numeric range filter — drives field labels, decorator props, and clamp bounds. */
|
|
7
|
+
filter: NumericRangeFilter;
|
|
8
|
+
/** Current min/max value (or null when no bounds are set). */
|
|
9
|
+
value: NumericRangeValue;
|
|
10
|
+
/** Callback to update the value. Emits `null` when both bounds are cleared. */
|
|
11
|
+
onChange: (value: NumericRangeValue) => void;
|
|
12
|
+
/**
|
|
13
|
+
* `compact` stacks the inputs vertically (toolbar popover); `grid` places
|
|
14
|
+
* Min / "to" / Max side-by-side under a single FieldLabel (drawer cell).
|
|
15
|
+
*/
|
|
16
|
+
layout: "compact" | "grid";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Min/Max NumberField inputs for the numericRange filter. Used as the popover
|
|
20
|
+
* body in the toolbar (`layout="compact"`) and as the cell in the drawer
|
|
21
|
+
* (`layout="grid"`).
|
|
22
|
+
*
|
|
23
|
+
* Value-driven: partial input (only one bound filled) flows straight to the
|
|
24
|
+
* caller, so a consumer can keep half-ranges (e.g. `> 100`) without juggling
|
|
25
|
+
* draft state here. Both bounds are clamped to `filter.minValue`/`maxValue`
|
|
26
|
+
* before emitting.
|
|
27
|
+
*/
|
|
28
|
+
export declare const FilterNumericRange: ({ filter, value, onChange, layout, }: FilterNumericRangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Filter } from './internal/types';
|
|
3
|
+
/**
|
|
4
|
+
* Render-prop ctx passed to FilterPopoverButton's children. The `custom`
|
|
5
|
+
* adapter (and any consumer using a `custom` filter) uses this to receive the
|
|
6
|
+
* draft (or committed) value and an `onChange` for its rendered body.
|
|
7
|
+
*
|
|
8
|
+
* When commitOnSelect is false (the default), `value` is the in-progress draft
|
|
9
|
+
* and `onChange` updates it; the user must click Apply for it to commit.
|
|
10
|
+
*
|
|
11
|
+
* When commitOnSelect is true, `value` is the filter's currently-committed
|
|
12
|
+
* value and `onChange` commits immediately (and closes the popover).
|
|
13
|
+
*/
|
|
14
|
+
export type FilterPopoverButtonRenderCtx<V = unknown> = {
|
|
15
|
+
value: V;
|
|
16
|
+
onChange: (value: V) => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Base props shared by both commit modes. `commitOnSelect` is left out so each
|
|
20
|
+
* variant can refine it as a literal; that's what lets `initialValue` be required
|
|
21
|
+
* for the draft branch and absent for the commit-on-select branch.
|
|
22
|
+
*/
|
|
23
|
+
type FilterPopoverButtonBaseProps<V> = {
|
|
24
|
+
/** The filter being edited. Used for id and dispatching commits. */
|
|
25
|
+
filter: Filter;
|
|
26
|
+
/** Trigger button label. Adapters typically pass adapter.formatLabel(filter). */
|
|
27
|
+
label: ReactNode;
|
|
28
|
+
/** Whether the filter currently has a non-default value (drives selected styling). */
|
|
29
|
+
isSelected: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The filter's currently-committed value. Used to seed the draft on open and
|
|
32
|
+
* to detect parent-provided changes mid-open. Adapters typically pass
|
|
33
|
+
* adapter.getValue(filter).
|
|
34
|
+
*/
|
|
35
|
+
committedValue: V;
|
|
36
|
+
/** Body content as a render-prop. Receives draft (or live) value + onChange. */
|
|
37
|
+
children: (ctx: FilterPopoverButtonRenderCtx<V>) => ReactNode;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Draft-mode props: requires `initialValue` so each consumer declares what
|
|
41
|
+
* "empty draft" means for its V (e.g. an array-shaped custom filter passes
|
|
42
|
+
* `[]`, a nullable scalar passes `null`). Eliminates the `[] as unknown as V`
|
|
43
|
+
* cast and forces non-nullable V consumers to opt in explicitly.
|
|
44
|
+
*/
|
|
45
|
+
type DraftModeProps<V> = FilterPopoverButtonBaseProps<V> & {
|
|
46
|
+
commitOnSelect?: false;
|
|
47
|
+
/**
|
|
48
|
+
* Initial draft value used until the popover opens and the draft is seeded
|
|
49
|
+
* from `committedValue`. Each adapter owns the empty-state for its V.
|
|
50
|
+
*/
|
|
51
|
+
initialValue: V;
|
|
52
|
+
/**
|
|
53
|
+
* If true, in uncontrolled mode the popover stays open after a body change
|
|
54
|
+
* instead of closing — for multi-selection workflows.
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
keepOpenOnUncontrolledChange?: boolean;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Commit-on-select props: no draft state exists, so `initialValue` and
|
|
61
|
+
* `keepOpenOnUncontrolledChange` don't apply.
|
|
62
|
+
*/
|
|
63
|
+
type CommitOnSelectProps<V> = FilterPopoverButtonBaseProps<V> & {
|
|
64
|
+
commitOnSelect: true;
|
|
65
|
+
};
|
|
66
|
+
type FilterPopoverButtonProps<V> = DraftModeProps<V> | CommitOnSelectProps<V>;
|
|
67
|
+
/**
|
|
68
|
+
* FilterPopoverButton is the popover-based trigger primitive used by the
|
|
69
|
+
* `custom` filter adapter (and anything else that needs to render an
|
|
70
|
+
* adapter-agnostic popover body with draft / Apply-Cancel semantics).
|
|
71
|
+
*
|
|
72
|
+
* Other filter types (`singleSelect`, `multiSelect`, `asyncSelect`,
|
|
73
|
+
* `asyncMultiSelect`, `date`, `dateRange`, `dateList`) compose menu primitives
|
|
74
|
+
* (`SelectMenu`, `MultiSelectMenu`) or their own popover shells directly and
|
|
75
|
+
* do not go through this component.
|
|
76
|
+
*
|
|
77
|
+
* It owns:
|
|
78
|
+
* - The trigger button (label + icon + selected state)
|
|
79
|
+
* - The OptionsPopover wrapper (open state, outside-press handling)
|
|
80
|
+
* - When commitOnSelect is false: draft state + MenuFooter Apply/Cancel chrome
|
|
81
|
+
*
|
|
82
|
+
* The body is supplied via render-prop children, which receive the
|
|
83
|
+
* appropriate value + onChange for the current commit mode.
|
|
84
|
+
*/
|
|
85
|
+
export declare const FilterPopoverButton: <V>(props: FilterPopoverButtonProps<V>) => import("react/jsx-runtime").JSX.Element;
|
|
86
|
+
export {};
|
|
@@ -13,12 +13,12 @@ export type FilterToggleButtonProps = Omit<ToolbarButtonToggleProps, "checked">
|
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
* FilterToggleButton wraps ToolbarButtonToggle in a FilterItemWrapper for
|
|
16
|
+
* FilterToggleButton wraps ToolbarButtonToggle in a FilterItemWrapper for
|
|
17
|
+
* consistent rendering with other filter types.
|
|
17
18
|
* Built into FilterGroup for boolean filter rendering.
|
|
18
19
|
*
|
|
19
20
|
* Features:
|
|
20
21
|
* - Renders a toggle button for boolean filters
|
|
21
|
-
* - Integrates with FilterGroup and FilterItemWrapper for overflow handling
|
|
22
22
|
* - Supports accessibility and keyboard navigation
|
|
23
23
|
*/
|
|
24
24
|
export declare const FilterToggleButton: ({ id, checked, children, ...props }: FilterToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '../../../components/Button';
|
|
3
|
+
/**
|
|
4
|
+
* Props that drive the visual identity of a filter's bar trigger — shared by
|
|
5
|
+
* any popover/menu primitive that wants the standard filter-trigger styling.
|
|
6
|
+
*
|
|
7
|
+
* All other Button props (ref, onClick, onKeyDown, aria-*, data-state, …) are
|
|
8
|
+
* accepted via spread, which lets this component slot underneath any menu
|
|
9
|
+
* primitive's trigger render-prop (`SelectMenu`, `MultiSelectMenu`,
|
|
10
|
+
* `FilterDateSingle` / `FilterDateRange`'s popover shell) or, for `custom`,
|
|
11
|
+
* `FilterPopoverButton`'s `Popover.Button`.
|
|
12
|
+
*/
|
|
13
|
+
export type FilterTriggerButtonProps = Omit<ButtonProps, "children" | "icon"> & {
|
|
14
|
+
/** Filter id — emitted as `data-id` for test selectors and analytics. */
|
|
15
|
+
filterId: string;
|
|
16
|
+
/** Label content rendered inside the button. */
|
|
17
|
+
label: ReactNode;
|
|
18
|
+
/** Whether the filter has a committed selection (drives the selected-state class). */
|
|
19
|
+
isSelected: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Trigger icon.
|
|
22
|
+
* - `calendar` → leading Event icon (used by date-shaped filters)
|
|
23
|
+
* - `dropdown` → trailing chevron (default)
|
|
24
|
+
* @default "dropdown"
|
|
25
|
+
*/
|
|
26
|
+
icon?: "calendar" | "dropdown";
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* FilterTriggerButton is the styled trigger primitive used by every popover-
|
|
30
|
+
* or menu-based filter type. It owns the visual identity (ghost appearance,
|
|
31
|
+
* toolbar-sized, selected-state, dropdown/calendar icon, data-id) and nothing
|
|
32
|
+
* else — open state and popover wiring belong to whatever component composes
|
|
33
|
+
* it (a menu's trigger render-prop, the date popover shells, or
|
|
34
|
+
* `FilterPopoverButton` for `custom`).
|
|
35
|
+
*/
|
|
36
|
+
export declare const FilterTriggerButton: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "children" | "icon"> & {
|
|
37
|
+
/** Filter id — emitted as `data-id` for test selectors and analytics. */
|
|
38
|
+
filterId: string;
|
|
39
|
+
/** Label content rendered inside the button. */
|
|
40
|
+
label: ReactNode;
|
|
41
|
+
/** Whether the filter has a committed selection (drives the selected-state class). */
|
|
42
|
+
isSelected: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Trigger icon.
|
|
45
|
+
* - `calendar` → leading Event icon (used by date-shaped filters)
|
|
46
|
+
* - `dropdown` → trailing chevron (default)
|
|
47
|
+
* @default "dropdown"
|
|
48
|
+
*/
|
|
49
|
+
icon?: "calendar" | "dropdown";
|
|
50
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './FilterBar';
|
|
2
2
|
export { FilterBar as default, type FilterBarProps } from './FilterBar';
|
|
3
|
-
export { type Filter, type BooleanFilter, type CustomFilter, type SingleSelectFilter, type MultiSelectFilter, type DateFilter, type DateRangeFilter, type DateListFilter, type DateListOption, type DateListLibraryOptionId, type FilterValue, type FilterRenderProps, type BaseFilter, } from './internal/types';
|
|
3
|
+
export { type Filter, type BooleanFilter, type CustomFilter, type SingleSelectFilter, type MultiSelectFilter, type DateFilter, type DateRangeFilter, type DateListFilter, type DateListOption, type DateListLibraryOptionId, type AsyncSelectFilter, type AsyncMultiSelectFilter, type NumericRangeFilter, type NumericRangeValue, type FilterValue, type FilterRenderProps, type BaseFilter, } from './internal/types';
|
|
@@ -19,18 +19,14 @@ type FilterGroupContextProps = FilterBarProps & {
|
|
|
19
19
|
* @default () => {}
|
|
20
20
|
*/
|
|
21
21
|
updateFilter: (filterId: string, value: FilterValue, submit: boolean) => void;
|
|
22
|
-
/**
|
|
22
|
+
/** Filters configured as drawer-only — never rendered inline in the toolbar
|
|
23
23
|
* @default []
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @default
|
|
28
|
-
*/
|
|
29
|
-
addHiddenFilter: (filter: Filter) => void;
|
|
30
|
-
/** Function to mark a filter as visible
|
|
31
|
-
* @default () => {}
|
|
25
|
+
drawerOnlyFilters: Filter[];
|
|
26
|
+
/** Whether the container is wide enough to render filters inline in the toolbar
|
|
27
|
+
* @default false
|
|
32
28
|
*/
|
|
33
|
-
|
|
29
|
+
showInlineFilters: boolean;
|
|
34
30
|
};
|
|
35
31
|
/**
|
|
36
32
|
* Context provider for filter-related operations
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MultiSelectMenuOption } from '../../../MultiSelectMenu';
|
|
2
|
+
import { AsyncMultiSelectFilter } from '../types';
|
|
3
|
+
import { FilterTypeAdapter } from './types';
|
|
4
|
+
type Value = MultiSelectMenuOption[];
|
|
5
|
+
export declare const asyncMultiSelectAdapter: FilterTypeAdapter<AsyncMultiSelectFilter, Value>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SelectMenuOption } from '../../../SelectMenu';
|
|
2
|
+
import { AsyncSelectFilter } from '../types';
|
|
3
|
+
import { FilterTypeAdapter } from './types';
|
|
4
|
+
type Value = SelectMenuOption | undefined;
|
|
5
|
+
export declare const asyncSelectAdapter: FilterTypeAdapter<AsyncSelectFilter, Value>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DateRangeFilter } from '../types';
|
|
2
|
+
import { FilterTypeAdapter } from './types';
|
|
3
|
+
type Value = {
|
|
4
|
+
startDate: string | null;
|
|
5
|
+
endDate: string | null;
|
|
6
|
+
} | null;
|
|
7
|
+
export declare const dateRangeAdapter: FilterTypeAdapter<DateRangeFilter, Value>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Filter } from '../types';
|
|
2
|
+
import { FilterAdapters, FilterTypeAdapter } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Per-type adapters keyed by Filter["type"]. Exhaustive: adding a new Filter
|
|
5
|
+
* variant forces a compile error here until an adapter is provided.
|
|
6
|
+
*/
|
|
7
|
+
export declare const filterAdapters: FilterAdapters;
|
|
8
|
+
/**
|
|
9
|
+
* Looks up the adapter for a given filter. The returned adapter's F and V
|
|
10
|
+
* are widened to Filter / unknown — callers that need narrow typing should pass
|
|
11
|
+
* the filter directly through the adapter methods, which preserves variance.
|
|
12
|
+
* Falls back to a no-op adapter for unknown filter types.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getAdapter: (filter: Filter) => FilterTypeAdapter<Filter, unknown>;
|
|
15
|
+
export type { FilterTypeAdapter } from './types';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MultiSelectMenuOption } from '../../../MultiSelectMenu';
|
|
2
|
+
import { MultiSelectFilter } from '../types';
|
|
3
|
+
import { FilterTypeAdapter } from './types';
|
|
4
|
+
type Value = MultiSelectMenuOption[];
|
|
5
|
+
export declare const multiSelectAdapter: FilterTypeAdapter<MultiSelectFilter, Value>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SelectMenuOption } from '../../../SelectMenu';
|
|
2
|
+
import { SingleSelectFilter } from '../types';
|
|
3
|
+
import { FilterTypeAdapter } from './types';
|
|
4
|
+
type Value = SelectMenuOption | undefined;
|
|
5
|
+
export declare const singleSelectAdapter: FilterTypeAdapter<SingleSelectFilter, Value>;
|
|
6
|
+
export {};
|