@servicetitan/anvil2 1.45.2 → 1.46.0
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 +12 -0
- package/dist/{Calendar-BK861SAW.js → Calendar-BQ5F2ENO.js} +2 -2
- package/dist/{Calendar-BK861SAW.js.map → Calendar-BQ5F2ENO.js.map} +1 -1
- package/dist/Calendar.js +1 -1
- package/dist/{Checkbox-ZphVb1l0.js → Checkbox-DDrmVC-u.js} +2 -2
- package/dist/{Checkbox-ZphVb1l0.js.map → Checkbox-DDrmVC-u.js.map} +1 -1
- package/dist/{Checkbox-CYNjFdtO.js → Checkbox-Dl4KTwEJ.js} +2 -2
- package/dist/{Checkbox-CYNjFdtO.js.map → Checkbox-Dl4KTwEJ.js.map} +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/{useInfiniteCombobox-BaYWUxjg.js → Combobox-B9nesJuc.js} +18 -185
- package/dist/Combobox-B9nesJuc.js.map +1 -0
- package/dist/Combobox.js +2 -1
- package/dist/Combobox.js.map +1 -1
- package/dist/{DateField-DnasO2rB.js → DateField-DXxPsRtf.js} +2 -2
- package/dist/{DateField-DnasO2rB.js.map → DateField-DXxPsRtf.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DateFieldRange-Ba-8T-Nz.js → DateFieldRange-Xauviu1w.js} +6 -6
- package/dist/DateFieldRange-Xauviu1w.js.map +1 -0
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-BBu5Hi9c.js → DateFieldSingle-yLnwpVzd.js} +4 -4
- package/dist/{DateFieldSingle-BBu5Hi9c.js.map → DateFieldSingle-yLnwpVzd.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/Dnd.js +1 -1
- package/dist/DndSort.js +1 -1
- package/dist/{ListView-DEAMQopB.js → ListView-pb3rIcze.js} +2 -2
- package/dist/{ListView-DEAMQopB.js.map → ListView-pb3rIcze.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{SearchField-BKXkoWPs.js → SearchField-Bb0uObwG.js} +2 -2
- package/dist/{SearchField-BKXkoWPs.js.map → SearchField-Bb0uObwG.js.map} +1 -1
- package/dist/SearchField.js +1 -1
- package/dist/{SelectCard-BWh8Yp7T.js → SelectCard-BTYZg9TG.js} +2 -2
- package/dist/{SelectCard-BWh8Yp7T.js.map → SelectCard-BTYZg9TG.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/Toolbar-D4zuUFhb.js +2077 -0
- package/dist/Toolbar-D4zuUFhb.js.map +1 -0
- package/dist/Toolbar.css +139 -28
- package/dist/Toolbar.d.ts +3 -3
- package/dist/Toolbar.js +1 -1
- package/dist/beta/components/Toolbar/Filters/FilterButton.d.ts +30 -0
- package/dist/beta/components/Toolbar/Filters/FilterDateRange.d.ts +37 -0
- package/dist/beta/components/Toolbar/Filters/FilterDateSingle.d.ts +30 -0
- package/dist/beta/components/Toolbar/Filters/FilterDrawer.d.ts +15 -0
- package/dist/beta/components/Toolbar/Filters/FilterGroup.d.ts +25 -0
- package/dist/beta/components/Toolbar/Filters/FilterItemWrapper.d.ts +24 -0
- package/dist/beta/components/Toolbar/Filters/FilterSelect.d.ts +29 -0
- package/dist/beta/components/Toolbar/Filters/FilterToggleButton.d.ts +24 -0
- package/dist/beta/components/Toolbar/Filters/internal/FilterGroupContext.d.ts +40 -0
- package/dist/beta/components/Toolbar/Filters/internal/types.d.ts +130 -0
- package/dist/beta/components/Toolbar/Filters/internal/utils/filter-state.d.ts +40 -0
- package/dist/beta/components/Toolbar/Filters/internal/utils/test.d.ts +57 -0
- package/dist/beta/components/Toolbar/Toolbar.d.ts +302 -0
- package/dist/beta/components/Toolbar/ToolbarButton.d.ts +41 -0
- package/dist/beta/components/Toolbar/ToolbarButtonLink.d.ts +43 -0
- package/dist/beta/components/Toolbar/ToolbarButtonToggle.d.ts +42 -0
- package/dist/beta/components/Toolbar/ToolbarControlGroup.d.ts +20 -0
- package/dist/beta/components/Toolbar/ToolbarSearchField.d.ts +20 -0
- package/dist/beta/components/Toolbar/ToolbarSelect.d.ts +108 -0
- package/dist/beta/components/Toolbar/index.d.ts +9 -0
- package/dist/beta/components/Toolbar/internal/ToolbarItemOverflowContext.d.ts +19 -0
- package/dist/beta/components/Toolbar/internal/ToolbarItemWrapper.d.ts +40 -0
- package/dist/beta/components/Toolbar/internal/ToolbarOverflowContext.d.ts +35 -0
- package/dist/beta/components/Toolbar/internal/ToolbarOverflowMenu.d.ts +29 -0
- package/dist/beta/components/Toolbar/internal/utils/accessibility.d.ts +26 -0
- package/dist/beta/components/Toolbar/internal/utils/test.d.ts +29 -0
- package/dist/beta/components/Toolbar/types.d.ts +50 -0
- package/dist/beta/components/index.d.ts +1 -0
- package/dist/beta/index.d.ts +1 -0
- package/dist/beta.d.ts +2 -0
- package/dist/beta.js +2 -0
- package/dist/beta.js.map +1 -0
- package/dist/components/Combobox/ComboboxTypes.d.ts +8 -0
- package/dist/components/DateFieldRange/internal/DateFieldRangeCalendar.d.ts +1 -1
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/{indeterminate_check_box-Bg24oeHy.js → indeterminate_check_box-RY9zr3xS.js} +17 -17
- package/dist/{indeterminate_check_box-Bg24oeHy.js.map → indeterminate_check_box-RY9zr3xS.js.map} +1 -1
- package/dist/indeterminate_check_box.css +72 -66
- package/dist/{index-CqdP5W00.js → index-V5Ez2gq_.js} +2 -2
- package/dist/{index-CqdP5W00.js.map → index-V5Ez2gq_.js.map} +1 -1
- package/dist/index.css +125 -26
- package/dist/index.js +756 -24
- package/dist/index.js.map +1 -1
- package/dist/index2.css +88 -105
- package/dist/internal/hooks/index.d.ts +1 -0
- package/dist/internal/hooks/useContainerQuery/index.d.ts +1 -0
- package/dist/internal/hooks/useContainerQuery/useContainerQuery.d.ts +46 -0
- package/dist/{useDateFieldOrchestration-DPLftOxu.js → useDateFieldOrchestration-BNJCsRkS.js} +2 -2
- package/dist/{useDateFieldOrchestration-DPLftOxu.js.map → useDateFieldOrchestration-BNJCsRkS.js.map} +1 -1
- package/dist/useInfiniteCombobox-WcRgC9p6.js +179 -0
- package/dist/useInfiniteCombobox-WcRgC9p6.js.map +1 -0
- package/dist/useIntersectionObserver-BEmMDO3P.js +70 -0
- package/dist/useIntersectionObserver-BEmMDO3P.js.map +1 -0
- package/package.json +2 -1
- package/dist/DateFieldRange-Ba-8T-Nz.js.map +0 -1
- package/dist/Toolbar-DK7tXy_W.js +0 -807
- package/dist/Toolbar-DK7tXy_W.js.map +0 -1
- package/dist/useInfiniteCombobox-BaYWUxjg.js.map +0 -1
- /package/dist/{useInfiniteCombobox.css → Combobox.css} +0 -0
package/dist/Toolbar.css
CHANGED
|
@@ -11,17 +11,24 @@ button[data-anv=toolbar-select] {
|
|
|
11
11
|
/* REVERT LAYER BUGFIX END */
|
|
12
12
|
/* -- Toolbar Base */
|
|
13
13
|
@layer base {
|
|
14
|
-
.
|
|
15
|
-
gap: 0.75rem;
|
|
16
|
-
}
|
|
17
|
-
._toolbar_7lbdr_13[aria-orientation=vertical] {
|
|
14
|
+
._toolbar_bslcr_13[aria-orientation=vertical] {
|
|
18
15
|
height: 100%;
|
|
19
16
|
max-height: inherit;
|
|
20
17
|
}
|
|
21
|
-
._toolbar-
|
|
22
|
-
|
|
18
|
+
._toolbar-outline-spacer_bslcr_17:not(:has([data-anv=toolbar-filter-group], [data-anv=toolbar-control-group])) {
|
|
19
|
+
padding: 0.25rem;
|
|
20
|
+
}
|
|
21
|
+
._toolbar-content_bslcr_20 {
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
width: 100%;
|
|
23
24
|
}
|
|
24
|
-
.
|
|
25
|
+
._overflow-wrap_bslcr_24 {
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
}
|
|
28
|
+
._overflow-collapse_bslcr_27 {
|
|
29
|
+
flex-wrap: nowrap;
|
|
30
|
+
}
|
|
31
|
+
._toolbar-overflow-content_bslcr_30 {
|
|
25
32
|
display: flex;
|
|
26
33
|
flex-direction: column;
|
|
27
34
|
gap: 0.75rem;
|
|
@@ -29,54 +36,158 @@ button[data-anv=toolbar-select] {
|
|
|
29
36
|
padding: 0.5rem !important;
|
|
30
37
|
margin: 0 !important;
|
|
31
38
|
}
|
|
32
|
-
._toolbar-overflow-
|
|
39
|
+
._toolbar-overflow-content_bslcr_30 ._toolbar-button-item_bslcr_38 {
|
|
33
40
|
width: 100%;
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
43
|
/* -- Toolbar Overflow and Orientation States */
|
|
37
44
|
@layer state {
|
|
38
|
-
[aria-orientation=vertical] ._toolbar-
|
|
39
|
-
[aria-orientation=vertical] ._toolbar-button-
|
|
45
|
+
[aria-orientation=vertical] ._toolbar-item_bslcr_44,
|
|
46
|
+
[aria-orientation=vertical] ._toolbar-button-item_bslcr_38 {
|
|
40
47
|
width: 100%;
|
|
41
48
|
}
|
|
42
|
-
._overflow-
|
|
49
|
+
._overflow-collapse_bslcr_27 {
|
|
43
50
|
overflow: hidden;
|
|
44
51
|
}
|
|
45
|
-
[aria-orientation=
|
|
46
|
-
padding-block: 0.25rem;
|
|
47
|
-
}
|
|
48
|
-
[aria-orientation=horizontal] ._overflow-collapse_7lbdr_41 ._toolbar-item_7lbdr_37:first-of-type {
|
|
49
|
-
padding-inline-start: 0.25rem;
|
|
50
|
-
}
|
|
51
|
-
[aria-orientation=vertical] ._overflow-collapse_7lbdr_41 {
|
|
52
|
+
[aria-orientation=vertical] ._overflow-collapse_bslcr_27 {
|
|
52
53
|
height: 100%;
|
|
53
54
|
}
|
|
54
|
-
[aria-orientation=vertical] ._overflow-collapse_7lbdr_41 ._toolbar-item_7lbdr_37:first-of-type {
|
|
55
|
-
padding-block-start: 0.25rem;
|
|
56
|
-
}
|
|
57
55
|
}
|
|
58
56
|
/* -- Toolbar Items Component Overrides */
|
|
59
57
|
@layer application {
|
|
60
|
-
._toolbar-button-
|
|
58
|
+
._toolbar-button-item_bslcr_38 {
|
|
61
59
|
white-space: nowrap;
|
|
62
60
|
font-size: 0.75rem;
|
|
63
61
|
min-width: -moz-min-content;
|
|
64
62
|
min-width: min-content;
|
|
65
63
|
padding: 0.375rem;
|
|
66
64
|
}
|
|
67
|
-
._toolbar-button-toggle-
|
|
65
|
+
._toolbar-button-toggle-item_bslcr_63[aria-pressed=false] {
|
|
68
66
|
border-color: var(--button-primary-foreground-color, #ffffff);
|
|
69
67
|
}
|
|
70
|
-
._toolbar-button-toggle-
|
|
68
|
+
._toolbar-button-toggle-item_bslcr_63[aria-pressed=true] {
|
|
71
69
|
border-color: var(--background-color-primary-subdued, #E0F2FF);
|
|
72
70
|
}
|
|
73
|
-
._toolbar-overflow-
|
|
71
|
+
._toolbar-overflow-trigger_bslcr_69 {
|
|
74
72
|
padding: 0.5rem;
|
|
75
73
|
}
|
|
76
|
-
._toolbar-overflow-
|
|
74
|
+
._toolbar-overflow-trigger_bslcr_69[aria-expanded=true] {
|
|
77
75
|
--button-background-color: var(--button-ghost-background-color-hover, rgba(20, 20, 20, 0.0784313725));
|
|
78
76
|
}
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
}@layer starter, reset, base, state, application;
|
|
78
|
+
|
|
79
|
+
button[data-anv=toolbar-button],
|
|
80
|
+
a[data-anv=toolbar-button-link],
|
|
81
|
+
button[data-anv=toolbar-button-toggle],
|
|
82
|
+
button[data-anv=filter-group-drawer-trigger],
|
|
83
|
+
button[data-anv=toolbar-boolean-filter],
|
|
84
|
+
button[data-anv=toolbar-select] {
|
|
85
|
+
all: revert-layer;
|
|
86
|
+
line-height: 1rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-anv=filter-group-drawer] > section,
|
|
90
|
+
[data-anv=filter-button-apply],
|
|
91
|
+
[data-anv=filter-button-content] {
|
|
92
|
+
all: revert-layer;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@layer base {
|
|
96
|
+
._filter-button-trigger_320zf_18 {
|
|
97
|
+
font-size: 0.75rem;
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
}
|
|
100
|
+
._filter-button-content_320zf_22 {
|
|
101
|
+
min-width: 12.5rem;
|
|
102
|
+
max-width: 22.5rem;
|
|
103
|
+
}
|
|
104
|
+
._filter-drawer-trigger_320zf_26 {
|
|
105
|
+
position: sticky;
|
|
106
|
+
right: 0;
|
|
107
|
+
border: none;
|
|
108
|
+
}
|
|
109
|
+
._filter-button-buttons_320zf_31 {
|
|
110
|
+
padding-block-start: 1rem;
|
|
111
|
+
}
|
|
112
|
+
[data-anv=toolbar-filter-group] {
|
|
113
|
+
container-type: inline-size;
|
|
114
|
+
}
|
|
115
|
+
._filter-item_320zf_37 {
|
|
116
|
+
max-height: 1.75rem;
|
|
117
|
+
}
|
|
118
|
+
@container (max-width: primitive.$breakpoint-md) {
|
|
119
|
+
._filter-item_320zf_37 {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
._filter-select-search_320zf_45 {
|
|
124
|
+
padding-block-end: 1rem;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
@layer application {
|
|
128
|
+
._filter-button-trigger_320zf_18 {
|
|
129
|
+
max-height: 1.75rem;
|
|
130
|
+
padding: 0.3125rem 0.375rem;
|
|
131
|
+
}
|
|
132
|
+
._filter-button-trigger_320zf_18[aria-expanded=true]:not(._filter-button-trigger--selected_320zf_54) {
|
|
133
|
+
--button-background-color: var(--button-ghost-background-color-hover, rgba(20, 20, 20, 0.0784313725));
|
|
134
|
+
}
|
|
135
|
+
._filter-button-trigger--selected_320zf_54 {
|
|
136
|
+
--button-background-color: var(--background-color-primary-subdued, #E0F2FF);
|
|
137
|
+
color: var(--foreground-color-primary, #0265DC);
|
|
138
|
+
}
|
|
139
|
+
._filter-drawer-trigger_320zf_26 {
|
|
140
|
+
padding-inline: 0.5rem;
|
|
141
|
+
}
|
|
142
|
+
._filter-drawer-trigger--chipped_320zf_64 {
|
|
143
|
+
background-color: var(--background-color-primary-subdued, #E0F2FF);
|
|
144
|
+
color: var(--foreground-color-primary, #0265DC);
|
|
145
|
+
min-width: -moz-max-content;
|
|
146
|
+
min-width: max-content;
|
|
147
|
+
}
|
|
148
|
+
}@layer starter, reset, base, state, application;
|
|
149
|
+
@layer base {
|
|
150
|
+
._toolbar-control-group_13h8p_2 {
|
|
151
|
+
overflow: hidden;
|
|
152
|
+
flex: var(--toolbar-group-flex);
|
|
153
|
+
flex-wrap: var(--toolbar-group-wrap, wrap);
|
|
154
|
+
padding-block: 0.5rem;
|
|
155
|
+
padding-inline: 0.25rem;
|
|
156
|
+
}
|
|
157
|
+
._toolbar-control-group_13h8p_2[data-anv=toolbar-filter-group] {
|
|
158
|
+
min-width: 5.625rem;
|
|
159
|
+
}
|
|
160
|
+
._toolbar-control-group_13h8p_2[data-anv=toolbar-control-group] {
|
|
161
|
+
justify-content: flex-end;
|
|
162
|
+
}
|
|
163
|
+
[data-anv=toolbar-content]:has(._toolbar-control-group_13h8p_2) {
|
|
164
|
+
flex-wrap: nowrap;
|
|
165
|
+
}
|
|
166
|
+
[data-anv=toolbar-content]:has(._toolbar-control-group_13h8p_2)[data-overflow=collapse] > [data-anv=toolbar-filter-group] {
|
|
167
|
+
--toolbar-group-flex: 1 0 0;
|
|
168
|
+
--toolbar-group-wrap: nowrap;
|
|
169
|
+
}
|
|
170
|
+
[data-anv=toolbar-content]:has(._toolbar-control-group_13h8p_2)[data-overflow=collapse] > [data-anv=toolbar-control-group] {
|
|
171
|
+
--toolbar-group-flex: 0 1 auto;
|
|
172
|
+
--toolbar-group-wrap: nowrap;
|
|
173
|
+
}
|
|
174
|
+
[data-anv=toolbar-content]:has(._toolbar-control-group_13h8p_2)[data-overflow=wrap] > [data-anv=toolbar-filter-group] {
|
|
175
|
+
--toolbar-group-flex: 1 0 0;
|
|
176
|
+
}
|
|
177
|
+
[data-anv=toolbar-content]:has(._toolbar-control-group_13h8p_2)[data-overflow=wrap] > [data-anv=toolbar-control-group] {
|
|
178
|
+
--toolbar-group-flex: 0 1 auto;
|
|
179
|
+
}
|
|
180
|
+
}@layer starter, reset, base, state, application;
|
|
181
|
+
@layer application {
|
|
182
|
+
._toolbar-search-field-container_9jh3s_2 {
|
|
183
|
+
padding-block: 0.5rem;
|
|
184
|
+
}
|
|
185
|
+
._toolbar-search-field_9jh3s_2 {
|
|
186
|
+
height: 1.75rem;
|
|
187
|
+
max-width: 12.5rem;
|
|
188
|
+
padding-inline-start: 0.25rem;
|
|
189
|
+
}
|
|
190
|
+
._toolbar-search-field_9jh3s_2 input {
|
|
191
|
+
padding-block: 0;
|
|
81
192
|
}
|
|
82
193
|
}
|
package/dist/Toolbar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './components/Toolbar/index'
|
|
1
|
+
export * from './beta/components/Toolbar/index'
|
|
2
2
|
export {}
|
|
3
|
-
import _default from './components/Toolbar/index'
|
|
3
|
+
import _default from './beta/components/Toolbar/index'
|
|
4
4
|
export default _default
|
|
5
|
-
export * from './components/Toolbar/index'
|
|
5
|
+
export * from './beta/components/Toolbar/index'
|
|
6
6
|
export {}
|
package/dist/Toolbar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { T as Toolbar, a as ToolbarButton, c as ToolbarButtonLink, b as ToolbarButtonToggle, e as ToolbarElement, d as ToolbarSelect, T as default } from './Toolbar-
|
|
1
|
+
export { T as Toolbar, a as ToolbarButton, c as ToolbarButtonLink, b as ToolbarButtonToggle, e as ToolbarControlGroup, g as ToolbarElement, f as ToolbarSearchField, d as ToolbarSelect, T as default } from './Toolbar-D4zuUFhb.js';
|
|
2
2
|
//# sourceMappingURL=Toolbar.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Filter } from './internal/types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the FilterButton component
|
|
5
|
+
*/
|
|
6
|
+
interface FilterButtonProps {
|
|
7
|
+
/** Filter configuration object */
|
|
8
|
+
filter: Filter;
|
|
9
|
+
/** Optional child content for non-custom filter types */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** Optional class name for the popover content */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* FilterButton component provides a popover interface for filter selection.
|
|
16
|
+
* Handles both controlled and uncontrolled filter updates.
|
|
17
|
+
* Built into FilterGroup for single-select, multi-select, date, and date range filter rendering.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Maintains draft state for controlled filters
|
|
21
|
+
* - Updates immediately for uncontrolled filters
|
|
22
|
+
* - Provides Apply and Cancel actions in controlled mode
|
|
23
|
+
* - Supports keyboard navigation and accessibility
|
|
24
|
+
* - Renders custom, single-select, multi-select, date, and date range filter types
|
|
25
|
+
* - Integrates with FilterGroup context for state management
|
|
26
|
+
* - Displays appropriate icons for date-based filters
|
|
27
|
+
* - Shows formatted date values in button labels
|
|
28
|
+
*/
|
|
29
|
+
export declare const FilterButton: ({ filter, children, className, }: FilterButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DateRangeFilter } from './internal/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the FilterDateRange component
|
|
4
|
+
*/
|
|
5
|
+
interface FilterDateRangeProps {
|
|
6
|
+
/**
|
|
7
|
+
* The date range filter configuration object containing mode and other settings
|
|
8
|
+
*/
|
|
9
|
+
filter: DateRangeFilter;
|
|
10
|
+
/**
|
|
11
|
+
* The current draft value for the date range filter with start and end dates in ISO 8601 format
|
|
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
|
|
19
|
+
*/
|
|
20
|
+
onDraftChange: (value: {
|
|
21
|
+
startDate: string | null;
|
|
22
|
+
endDate: string | null;
|
|
23
|
+
} | null) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* FilterDateRange component for selecting a date range in toolbar filters.
|
|
27
|
+
*
|
|
28
|
+
* Features:
|
|
29
|
+
* - Renders a masked date range input field with format validation
|
|
30
|
+
* - Provides calendar popup for date range selection
|
|
31
|
+
* - Integrates with toolbar filter state management
|
|
32
|
+
* - Supports controlled and uncontrolled date range selection
|
|
33
|
+
* - Maintains draft state for filter changes
|
|
34
|
+
* - Handles start and end date selection independently
|
|
35
|
+
*/
|
|
36
|
+
export declare const FilterDateRange: ({ filter, draftValue, onDraftChange, }: FilterDateRangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DateFilter } from './internal/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the FilterDateSingle component
|
|
4
|
+
*/
|
|
5
|
+
interface FilterDateSingleProps {
|
|
6
|
+
/**
|
|
7
|
+
* The date filter configuration object containing mode and other settings
|
|
8
|
+
*/
|
|
9
|
+
filter: DateFilter;
|
|
10
|
+
/**
|
|
11
|
+
* The current draft value for the date filter in ISO 8601 format
|
|
12
|
+
*/
|
|
13
|
+
draftValue: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Callback function to update the draft value when the date changes
|
|
16
|
+
*/
|
|
17
|
+
onDraftChange: (value: string | null) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* FilterDateSingle component for selecting a single date in toolbar filters.
|
|
21
|
+
*
|
|
22
|
+
* Features:
|
|
23
|
+
* - Renders a masked date input field with format validation
|
|
24
|
+
* - Provides calendar popup for date selection
|
|
25
|
+
* - Integrates with toolbar filter state management
|
|
26
|
+
* - Supports controlled and uncontrolled date selection
|
|
27
|
+
* - Maintains draft state for filter changes
|
|
28
|
+
*/
|
|
29
|
+
export declare const FilterDateSingle: ({ filter, draftValue, onDraftChange, }: FilterDateSingleProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FilterDrawer component provides a drawer interface for filter selection.
|
|
3
|
+
* Always operates in controlled mode with batch updates.
|
|
4
|
+
* Built into FilterGroup for mobile and overflow filter editing.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Shows all available filters in a side panel
|
|
8
|
+
* - Maintains separate draft state for all filters
|
|
9
|
+
* - Updates filters only when Apply is clicked
|
|
10
|
+
* - Provides Clear All functionality
|
|
11
|
+
* - Supports boolean, custom, single-select, multi-select, date, and date range filter types
|
|
12
|
+
* - Integrates with FilterGroup context for state management
|
|
13
|
+
* - Handles date and date range filters with appropriate input components
|
|
14
|
+
*/
|
|
15
|
+
export declare const FilterDrawer: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { Filter } from './internal/types';
|
|
3
|
+
import { LayoutUtilProps } from '../../../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the FilterGroup component
|
|
6
|
+
*
|
|
7
|
+
* @extends ComponentPropsWithoutRef<"div">
|
|
8
|
+
* @extends LayoutUtilProps
|
|
9
|
+
*/
|
|
10
|
+
export type FilterGroupProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & {
|
|
11
|
+
/** Array of filter objects */
|
|
12
|
+
filters: Filter[];
|
|
13
|
+
/** Callback function when filters change */
|
|
14
|
+
onFilterChange?: (filters: Filter[]) => void;
|
|
15
|
+
/** Whether the filters are submission is controlled via an apply button */
|
|
16
|
+
controlledFiltering?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const FilterGroup: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & LayoutUtilProps & {
|
|
19
|
+
/** Array of filter objects */
|
|
20
|
+
filters: Filter[];
|
|
21
|
+
/** Callback function when filters change */
|
|
22
|
+
onFilterChange?: (filters: Filter[]) => void;
|
|
23
|
+
/** Whether the filters are submission is controlled via an apply button */
|
|
24
|
+
controlledFiltering?: boolean;
|
|
25
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Filter } from './internal/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the FilterItemWrapper component
|
|
4
|
+
*/
|
|
5
|
+
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
|
+
/** The content to render inside the wrapper */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* FilterItemWrapper extends ToolbarItemWrapper to handle filter-specific visibility.
|
|
16
|
+
* Uses FilterGroupContext to track hidden filters instead of overflow menu.
|
|
17
|
+
* Built into FilterButton and other filter components for consistent overflow handling.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Wraps filter controls for consistent overflow and visibility handling
|
|
21
|
+
* - Integrates with FilterGroupContext to track hidden filters
|
|
22
|
+
*/
|
|
23
|
+
export declare const FilterItemWrapper: ({ filter, children, }: FilterItemWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MultiSelectFilter, SingleSelectFilter } from './internal/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the FilterSelect component
|
|
4
|
+
*/
|
|
5
|
+
interface FilterSelectProps<Item extends {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}> {
|
|
9
|
+
/** The filter configuration object */
|
|
10
|
+
filter: SingleSelectFilter<Item> | MultiSelectFilter<Item>;
|
|
11
|
+
/** The current draft value for the filter */
|
|
12
|
+
draftValue: Item | Item[] | undefined;
|
|
13
|
+
/** Callback to update the draft value */
|
|
14
|
+
onDraftChange: (value: Item | Item[] | undefined) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* FilterSelect component renders a Listbox or ListView for single or multi-select filters.
|
|
18
|
+
* Built into FilterButton and FilterDrawer for filter selection UI.
|
|
19
|
+
*
|
|
20
|
+
* Features:
|
|
21
|
+
* - Renders a Listbox for single select filters
|
|
22
|
+
* - Renders a ListView for multi select filters
|
|
23
|
+
* - Supports search field for filtering options
|
|
24
|
+
*/
|
|
25
|
+
export declare const FilterSelect: <Item extends {
|
|
26
|
+
id: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}>({ filter, draftValue, onDraftChange, }: FilterSelectProps<Item>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ToolbarButtonToggleProps } from '../ToolbarButtonToggle';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the FilterToggleButton component
|
|
4
|
+
*
|
|
5
|
+
* @extends Omit<ToolbarButtonToggleProps, "checked">
|
|
6
|
+
*/
|
|
7
|
+
export type FilterToggleButtonProps = Omit<ToolbarButtonToggleProps, "checked"> & {
|
|
8
|
+
/** Unique identifier for the filter */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Whether the toggle is checked */
|
|
11
|
+
checked: boolean;
|
|
12
|
+
/** The content to display inside the toggle button */
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* FilterToggleButton wraps ToolbarButtonToggle in a FilterItemWrapper for consistent overflow behavior with other filter types.
|
|
17
|
+
* Built into FilterGroup for boolean filter rendering.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Renders a toggle button for boolean filters
|
|
21
|
+
* - Integrates with FilterGroup and FilterItemWrapper for overflow handling
|
|
22
|
+
* - Supports accessibility and keyboard navigation
|
|
23
|
+
*/
|
|
24
|
+
export declare const FilterToggleButton: ({ id, checked, children, ...props }: FilterToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { FilterGroupProps } from '../FilterGroup';
|
|
3
|
+
import { Filter, FilterValue } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Context for sharing filter state and operations between FilterGroup and its children
|
|
6
|
+
*
|
|
7
|
+
* @extends FilterGroupProps
|
|
8
|
+
*/
|
|
9
|
+
type FilterGroupContextProps = FilterGroupProps & {
|
|
10
|
+
/** Reference to the filter group DOM element
|
|
11
|
+
* @default { current: null }
|
|
12
|
+
*/
|
|
13
|
+
filterGroupRef: RefObject<HTMLDivElement>;
|
|
14
|
+
/** Current filters array
|
|
15
|
+
* @default []
|
|
16
|
+
*/
|
|
17
|
+
filters: Filter[];
|
|
18
|
+
/** Function to update a single filter and submit if needed
|
|
19
|
+
* @default () => {}
|
|
20
|
+
*/
|
|
21
|
+
updateFilter: (filterId: string, value: FilterValue, submit: boolean) => void;
|
|
22
|
+
/** Array of filters that are currently hidden due to overflow
|
|
23
|
+
* @default []
|
|
24
|
+
*/
|
|
25
|
+
hiddenFilters: Filter[];
|
|
26
|
+
/** Function to mark a filter as hidden
|
|
27
|
+
* @default () => {}
|
|
28
|
+
*/
|
|
29
|
+
addHiddenFilter: (filter: Filter) => void;
|
|
30
|
+
/** Function to mark a filter as visible
|
|
31
|
+
* @default () => {}
|
|
32
|
+
*/
|
|
33
|
+
removeHiddenFilter: (filter: Filter) => void;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Context provider for filter-related operations
|
|
37
|
+
* Used to share filter state between FilterGroup and FilterDrawer
|
|
38
|
+
*/
|
|
39
|
+
export declare const FilterGroupContext: import('react').Context<FilterGroupContextProps>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DateFieldSingleProps } from '../../../../../components/DateFieldSingle';
|
|
3
|
+
import { DateFieldRangeProps } from '../../../../../components/DateFieldRange';
|
|
4
|
+
/**
|
|
5
|
+
* Base properties shared by all filter types
|
|
6
|
+
*/
|
|
7
|
+
export type BaseFilter = {
|
|
8
|
+
/** Unique identifier for the filter */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Display label for the filter */
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Built-in boolean filter type
|
|
15
|
+
* Used for simple true/false filtering
|
|
16
|
+
*/
|
|
17
|
+
export type BooleanFilter = BaseFilter & {
|
|
18
|
+
/** Identifies this as a boolean filter */
|
|
19
|
+
type: "boolean";
|
|
20
|
+
/** Current state of the boolean filter */
|
|
21
|
+
checked: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Props passed to custom filter render functions
|
|
25
|
+
*/
|
|
26
|
+
export type FilterRenderProps<T = unknown> = {
|
|
27
|
+
/** Current value of the filter */
|
|
28
|
+
value?: T;
|
|
29
|
+
/** Callback to update the filter value */
|
|
30
|
+
onChange: (value?: T) => void;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Custom filter type allowing for complex filter implementations
|
|
34
|
+
*/
|
|
35
|
+
export type CustomFilter<T = unknown> = BaseFilter & {
|
|
36
|
+
/** Identifies this as a custom filter */
|
|
37
|
+
type: "custom";
|
|
38
|
+
/** Function to render the filter content in the button/popover */
|
|
39
|
+
buttonRender: (props: FilterRenderProps<T>) => ReactNode;
|
|
40
|
+
/** Function to render the filter content in the drawer */
|
|
41
|
+
drawerRender: (props: FilterRenderProps<T>) => ReactNode;
|
|
42
|
+
/** Current value of the custom filter */
|
|
43
|
+
value?: T;
|
|
44
|
+
/** Optional number to display in a label chip */
|
|
45
|
+
labelChipCount?: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Single select filter type using Listbox component with optional search
|
|
49
|
+
*/
|
|
50
|
+
export type SingleSelectFilter<Item = {
|
|
51
|
+
id: string;
|
|
52
|
+
label: string;
|
|
53
|
+
}> = BaseFilter & {
|
|
54
|
+
/** Identifies this as a single select filter */
|
|
55
|
+
type: "singleSelect";
|
|
56
|
+
/** Array of items to select from */
|
|
57
|
+
items: Item[];
|
|
58
|
+
/** Currently selected item */
|
|
59
|
+
selectedItem?: Item;
|
|
60
|
+
} & ({
|
|
61
|
+
/** Whether to show the search field */
|
|
62
|
+
hasSearch: true;
|
|
63
|
+
/** Required callback for search functionality when hasSearch is true */
|
|
64
|
+
onSearch: (searchTerm: string) => void;
|
|
65
|
+
/** Optional callback when search is cleared (only used when hasSearch is true) */
|
|
66
|
+
onSearchClear: () => void;
|
|
67
|
+
simpleDrawerVariant?: never;
|
|
68
|
+
} | {
|
|
69
|
+
/** Whether to show the search field */
|
|
70
|
+
hasSearch?: false;
|
|
71
|
+
onSearch?: never;
|
|
72
|
+
onSearchClear?: never;
|
|
73
|
+
/** Whether to use simplified drawer rendering */
|
|
74
|
+
simpleDrawerVariant?: boolean;
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Multi select filter type using ListView component with optional search
|
|
78
|
+
*/
|
|
79
|
+
export type MultiSelectFilter<Item = {
|
|
80
|
+
id: string;
|
|
81
|
+
label: string;
|
|
82
|
+
}> = BaseFilter & {
|
|
83
|
+
/** Identifies this as a multi select filter */
|
|
84
|
+
type: "multiSelect";
|
|
85
|
+
/** Array of items to select from */
|
|
86
|
+
items: Item[];
|
|
87
|
+
/** Currently selected items array */
|
|
88
|
+
selectedItems: Item[] | [];
|
|
89
|
+
/** Whether to use simplified drawer rendering */
|
|
90
|
+
simpleDrawerVariant?: boolean;
|
|
91
|
+
} & ({
|
|
92
|
+
/** Whether to show the search field */
|
|
93
|
+
hasSearch: true;
|
|
94
|
+
/** Current search value */
|
|
95
|
+
searchValue?: string;
|
|
96
|
+
/** Required callback for search functionality when hasSearch is true */
|
|
97
|
+
onSearch: (searchTerm: string) => void;
|
|
98
|
+
/** Optional callback when search is cleared (only used when hasSearch is true) */
|
|
99
|
+
onSearchClear: () => void;
|
|
100
|
+
simpleDrawerVariant?: never;
|
|
101
|
+
} | {
|
|
102
|
+
/** Whether to show the search field */
|
|
103
|
+
hasSearch?: false;
|
|
104
|
+
searchValue?: never;
|
|
105
|
+
onSearch?: never;
|
|
106
|
+
onSearchClear?: never;
|
|
107
|
+
/** Whether to use simplified drawer rendering */
|
|
108
|
+
simpleDrawerVariant?: boolean;
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* Single date filter type using DateFieldSingle component
|
|
112
|
+
* Used for selecting a single date with calendar support
|
|
113
|
+
*/
|
|
114
|
+
export type DateFilter = BaseFilter & Pick<DateFieldSingleProps, "value" | "mode"> & {
|
|
115
|
+
type: "date";
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Date range filter type using DateFieldRange component
|
|
119
|
+
* Used for selecting a date range with calendar support
|
|
120
|
+
*/
|
|
121
|
+
export type DateRangeFilter = BaseFilter & Pick<DateFieldRangeProps, "value" | "mode"> & {
|
|
122
|
+
type: "dateRange";
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Union type of all available filter types
|
|
126
|
+
* Uses unknown instead of any for better type safety
|
|
127
|
+
*/
|
|
128
|
+
export type Filter = BooleanFilter | CustomFilter<any> | SingleSelectFilter<any> | MultiSelectFilter<any> | DateFilter | DateRangeFilter;
|
|
129
|
+
/** Type representing all possible filter values */
|
|
130
|
+
export type FilterValue = boolean | CustomFilter["value"] | SingleSelectFilter["selectedItem"] | MultiSelectFilter["selectedItems"] | DateFilter["value"] | DateRangeFilter["value"];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Filter, FilterValue } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an array of filters that are currently active (i.e., have a value set).
|
|
4
|
+
*
|
|
5
|
+
* @param {Filter[]} filters - Array of filter objects to check
|
|
6
|
+
* @returns {Filter[]} Array of active filters
|
|
7
|
+
*/
|
|
8
|
+
export declare const getActiveFilters: (filters: Filter[]) => Filter[];
|
|
9
|
+
/**
|
|
10
|
+
* Checks if any filters in the array have active values
|
|
11
|
+
*
|
|
12
|
+
* @param {Filter[]} filters - Array of filter objects to check
|
|
13
|
+
* @returns {boolean} True if any filter has an active value
|
|
14
|
+
*/
|
|
15
|
+
export declare const checkActiveFilters: (filters: Filter[]) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Resets all filters to their default state
|
|
18
|
+
*
|
|
19
|
+
* @param {Filter[]} filters - Array of filter objects to reset
|
|
20
|
+
* @returns {Filter[]} New array with reset filters
|
|
21
|
+
*/
|
|
22
|
+
export declare const resetFilters: (filters: Filter[]) => Filter[];
|
|
23
|
+
/**
|
|
24
|
+
* Updates a single filter in an array of filters
|
|
25
|
+
*
|
|
26
|
+
* @param {Filter[]} filters - Array of filter objects
|
|
27
|
+
* @param {string} filterId - ID of the filter to update
|
|
28
|
+
* @param {FilterValue} value - New value for the filter
|
|
29
|
+
* @returns {Filter[]} New array with updated filter
|
|
30
|
+
*/
|
|
31
|
+
export declare const updateSingleFilter: (filters: Filter[], filterId: string, value: FilterValue) => Filter[];
|
|
32
|
+
/**
|
|
33
|
+
* Determines if two filter values are different.
|
|
34
|
+
* For singleSelect, compares by id if both are objects with id.
|
|
35
|
+
*
|
|
36
|
+
* @param {T} a - First value to compare
|
|
37
|
+
* @param {T} b - Second value to compare
|
|
38
|
+
* @returns {boolean} True if the values are different
|
|
39
|
+
*/
|
|
40
|
+
export declare const hasChangedFilter: <T>(a: T, b: T) => boolean;
|