@stenajs-webui/filter 25.5.3 → 25.6.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/README.md +1 -1
- package/dist/features/search-filter/components/SearchFilterDrawer.d.ts +5 -0
- package/dist/features/search-filter/components/SearchFilterPanelHeader.d.ts +5 -0
- package/dist/index.es.js +43 -41
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -5,6 +5,11 @@ export type SearchFilterDrawerProps = SearchFilterDrawerLeftRightProps | SearchF
|
|
|
5
5
|
interface SearchFilterDrawerCommonProps {
|
|
6
6
|
header?: string;
|
|
7
7
|
headerContentRight?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Accessible name of the close button, for example "Close filters".
|
|
10
|
+
* Required, there is no default text.
|
|
11
|
+
*/
|
|
12
|
+
closeButtonAriaLabel: string;
|
|
8
13
|
}
|
|
9
14
|
interface SearchFilterDrawerLeftRightProps extends Omit<DrawerBaseLeftRight, "isOpen" | "onRequestClose">, SearchFilterDrawerCommonProps {
|
|
10
15
|
}
|
|
@@ -4,6 +4,11 @@ interface SearchFilterPanelHeaderProps {
|
|
|
4
4
|
onRequestClose: () => void;
|
|
5
5
|
header?: string;
|
|
6
6
|
contentRight?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Accessible name of the close button, for example "Close filters".
|
|
9
|
+
* Required, there is no default text.
|
|
10
|
+
*/
|
|
11
|
+
closeButtonAriaLabel: string;
|
|
7
12
|
}
|
|
8
13
|
export declare const SearchFilterPanelHeader: React.FC<SearchFilterPanelHeaderProps>;
|
|
9
14
|
export {};
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as c, jsxs as w, Fragment as P } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as M, useContext as k, useCallback as
|
|
2
|
+
import { createContext as M, useContext as k, useCallback as p, useState as R, useReducer as W, useMemo as b } from "react";
|
|
3
3
|
import { DrawerHeader as Y, Drawer as J } from "@stenajs-webui/modal";
|
|
4
4
|
import { cssColor as Q } from "@stenajs-webui/theme";
|
|
5
5
|
import { Column as V, Box as y, Row as D, Space as U, Text as X, truthyKeysAsList as T } from "@stenajs-webui/core";
|
|
@@ -31,20 +31,21 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
31
31
|
children: e,
|
|
32
32
|
header: t,
|
|
33
33
|
headerContentRight: n,
|
|
34
|
-
|
|
34
|
+
closeButtonAriaLabel: o,
|
|
35
|
+
...r
|
|
35
36
|
}) => {
|
|
36
37
|
const {
|
|
37
|
-
settings: { open:
|
|
38
|
-
} = z(),
|
|
39
|
-
|
|
40
|
-
}, [
|
|
38
|
+
settings: { open: s }
|
|
39
|
+
} = z(), a = f(), i = F(), u = p(() => {
|
|
40
|
+
a(i.closeFilters());
|
|
41
|
+
}, [i, a]);
|
|
41
42
|
return /* @__PURE__ */ c(
|
|
42
43
|
J,
|
|
43
44
|
{
|
|
44
45
|
floating: !0,
|
|
45
|
-
isOpen:
|
|
46
|
-
onRequestClose:
|
|
47
|
-
...
|
|
46
|
+
isOpen: s,
|
|
47
|
+
onRequestClose: u,
|
|
48
|
+
...r,
|
|
48
49
|
children: /* @__PURE__ */ w(
|
|
49
50
|
V,
|
|
50
51
|
{
|
|
@@ -55,9 +56,10 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
55
56
|
/* @__PURE__ */ c(
|
|
56
57
|
pe,
|
|
57
58
|
{
|
|
58
|
-
onRequestClose:
|
|
59
|
+
onRequestClose: u,
|
|
59
60
|
header: t,
|
|
60
|
-
contentRight: n
|
|
61
|
+
contentRight: n,
|
|
62
|
+
closeButtonAriaLabel: o
|
|
61
63
|
}
|
|
62
64
|
),
|
|
63
65
|
/* @__PURE__ */ c(y, { spacing: 1, indent: 1, gap: 1, children: e })
|
|
@@ -70,7 +72,7 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
70
72
|
label: e = "Filters",
|
|
71
73
|
leftIcon: t = _
|
|
72
74
|
}) => {
|
|
73
|
-
const n = f(), o = F(), r =
|
|
75
|
+
const n = f(), o = F(), r = p(() => {
|
|
74
76
|
n(o.openFilters());
|
|
75
77
|
}, [o, n]);
|
|
76
78
|
return /* @__PURE__ */ c(
|
|
@@ -89,10 +91,10 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
89
91
|
onRetry: s,
|
|
90
92
|
disableContentPadding: a,
|
|
91
93
|
children: i,
|
|
92
|
-
leftIcon:
|
|
94
|
+
leftIcon: u,
|
|
93
95
|
contentRight: h
|
|
94
96
|
}) {
|
|
95
|
-
const l = z(), m = f(), x = F(), S = l.expandedSections.values[t] ?? !1, L =
|
|
97
|
+
const l = z(), m = f(), x = F(), S = l.expandedSections.values[t] ?? !1, L = p(() => {
|
|
96
98
|
m(x.setSectionExpanded(t, !S));
|
|
97
99
|
}, [x, m, S, t]), E = n ?? he(t);
|
|
98
100
|
return /* @__PURE__ */ w(P, { children: [
|
|
@@ -100,7 +102,7 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
100
102
|
I,
|
|
101
103
|
{
|
|
102
104
|
label: E,
|
|
103
|
-
leftIcon:
|
|
105
|
+
leftIcon: u,
|
|
104
106
|
expandable: !0,
|
|
105
107
|
expanded: S,
|
|
106
108
|
selected: S,
|
|
@@ -161,55 +163,55 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
161
163
|
expandedSections: { values: {} }
|
|
162
164
|
}), fe = (e, t) => ce({
|
|
163
165
|
expandedSections: B(
|
|
164
|
-
|
|
166
|
+
d(e, "expandedSections"),
|
|
165
167
|
se(t.expandedSections)
|
|
166
168
|
),
|
|
167
169
|
formModel: B(
|
|
168
|
-
|
|
170
|
+
d(e, "formModel"),
|
|
169
171
|
A(t.formModel)
|
|
170
172
|
),
|
|
171
173
|
settings: B(
|
|
172
|
-
|
|
174
|
+
d(e, "settings"),
|
|
173
175
|
A(t.settings)
|
|
174
176
|
)
|
|
175
177
|
}), Fe = (e, t) => ({
|
|
176
178
|
openFilters: () => C(
|
|
177
|
-
|
|
179
|
+
d(e, "settings"),
|
|
178
180
|
v().setEntityFields({
|
|
179
181
|
open: !0
|
|
180
182
|
})
|
|
181
183
|
),
|
|
182
184
|
closeFilters: () => C(
|
|
183
|
-
|
|
185
|
+
d(e, "settings"),
|
|
184
186
|
v().setEntityFields({
|
|
185
187
|
open: !1
|
|
186
188
|
})
|
|
187
189
|
),
|
|
188
190
|
setFormModelFields: (n) => C(
|
|
189
|
-
|
|
191
|
+
d(e, "formModel"),
|
|
190
192
|
v().setEntityFields(n)
|
|
191
193
|
),
|
|
192
194
|
clearFormModel: () => C(
|
|
193
|
-
|
|
195
|
+
d(e, "formModel"),
|
|
194
196
|
v().setEntity(t)
|
|
195
197
|
),
|
|
196
198
|
expandSection: (n) => C(
|
|
197
|
-
|
|
199
|
+
d(e, "expandedSections"),
|
|
198
200
|
g().setValue(n, !0)
|
|
199
201
|
),
|
|
200
202
|
collapseSection: (n) => C(
|
|
201
|
-
|
|
203
|
+
d(e, "expandedSections"),
|
|
202
204
|
g().setValue(n, !1)
|
|
203
205
|
),
|
|
204
206
|
setSectionExpanded: (n, o) => C(
|
|
205
|
-
|
|
207
|
+
d(e, "expandedSections"),
|
|
206
208
|
g().setValue(n, o)
|
|
207
209
|
),
|
|
208
210
|
clearExpandedSections: () => C(
|
|
209
|
-
|
|
211
|
+
d(e, "expandedSections"),
|
|
210
212
|
g().clearAllValues()
|
|
211
213
|
)
|
|
212
|
-
}),
|
|
214
|
+
}), d = (e, t) => `${e}.${t}`, me = (e) => {
|
|
213
215
|
const [t] = R(
|
|
214
216
|
() => fe("local", e)
|
|
215
217
|
), [n] = R(
|
|
@@ -252,7 +254,7 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
252
254
|
children: e,
|
|
253
255
|
disableClearAllButton: t = !1
|
|
254
256
|
}) => {
|
|
255
|
-
const n = f(), o = F(), r =
|
|
257
|
+
const n = f(), o = F(), r = p(
|
|
256
258
|
() => n(o.clearFormModel()),
|
|
257
259
|
[o, n]
|
|
258
260
|
);
|
|
@@ -272,7 +274,7 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
272
274
|
label: t,
|
|
273
275
|
sectionId: n
|
|
274
276
|
}) {
|
|
275
|
-
const o = f(), r = F(), s =
|
|
277
|
+
const o = f(), r = F(), s = p(() => {
|
|
276
278
|
o(r.clearExpandedSections()), o(r.expandSection(n)), o(r.openFilters());
|
|
277
279
|
}, [r, o, n]);
|
|
278
280
|
return /* @__PURE__ */ c(H, { label: t, variant: "secondary", onClick: s });
|
|
@@ -282,12 +284,12 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
282
284
|
value: o,
|
|
283
285
|
onClickRemove: r
|
|
284
286
|
}) {
|
|
285
|
-
const s = f(), a = F(), i =
|
|
287
|
+
const s = f(), a = F(), i = p(
|
|
286
288
|
(l) => s(a.setFormModelFields(l)),
|
|
287
289
|
[s, a]
|
|
288
|
-
),
|
|
290
|
+
), u = p(() => {
|
|
289
291
|
r?.({ value: o, setFormModelFields: i });
|
|
290
|
-
}, [r, i, o]), h =
|
|
292
|
+
}, [r, i, o]), h = p(() => {
|
|
291
293
|
s(a.clearExpandedSections()), s(a.expandSection(t)), s(a.openFilters());
|
|
292
294
|
}, [a, s, t]);
|
|
293
295
|
return /* @__PURE__ */ c(
|
|
@@ -295,7 +297,7 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
295
297
|
{
|
|
296
298
|
label: n ?? t,
|
|
297
299
|
onClick: h,
|
|
298
|
-
onClickRemove: r ?
|
|
300
|
+
onClickRemove: r ? u : void 0
|
|
299
301
|
}
|
|
300
302
|
);
|
|
301
303
|
}, Je = function({
|
|
@@ -360,9 +362,9 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
360
362
|
return { value: l, label: m?.label ?? l };
|
|
361
363
|
}) : [],
|
|
362
364
|
[e, t]
|
|
363
|
-
),
|
|
365
|
+
), u = b(() => e?.filter(
|
|
364
366
|
(l) => l.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1 || l.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1
|
|
365
|
-
), [e, s]), h =
|
|
367
|
+
), [e, s]), h = p(
|
|
366
368
|
(l) => {
|
|
367
369
|
o?.(Me(l));
|
|
368
370
|
},
|
|
@@ -371,7 +373,7 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
371
373
|
return /* @__PURE__ */ c(O, { ...r, children: /* @__PURE__ */ c(
|
|
372
374
|
le,
|
|
373
375
|
{
|
|
374
|
-
options:
|
|
376
|
+
options: u,
|
|
375
377
|
value: i,
|
|
376
378
|
onValueChange: h,
|
|
377
379
|
inputValue: s,
|
|
@@ -419,10 +421,10 @@ const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
419
421
|
leftIcon: a,
|
|
420
422
|
...i
|
|
421
423
|
}) => {
|
|
422
|
-
const
|
|
423
|
-
() => ({ dispatch:
|
|
424
|
-
[h,
|
|
425
|
-
), [m, x] = R("startDate"), S = b(() => ie(e), [e]), L =
|
|
424
|
+
const u = f(), h = F(), l = b(
|
|
425
|
+
() => ({ dispatch: u, actions: h }),
|
|
426
|
+
[h, u]
|
|
427
|
+
), [m, x] = R("startDate"), S = b(() => ie(e), [e]), L = p(
|
|
426
428
|
(E) => {
|
|
427
429
|
t(ue(E), l);
|
|
428
430
|
},
|
|
@@ -481,7 +483,7 @@ export {
|
|
|
481
483
|
Se as createSearchFilterInitialState,
|
|
482
484
|
fe as createSearchFilterReducer,
|
|
483
485
|
he as formatColumnIdToHeaderCellLabel,
|
|
484
|
-
|
|
486
|
+
d as getReducerIdFor,
|
|
485
487
|
me as useLocalSearchFilterState,
|
|
486
488
|
F as useSearchFilterActions,
|
|
487
489
|
f as useSearchFilterDispatch,
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/features/search-filter/components/SearchFilterPanelHeader.tsx","../src/features/search-filter/context/SearchFilterStateContext.ts","../src/features/search-filter/context/SearchFilterDispatchContext.ts","../src/features/search-filter/context/SearchFilterActionsContext.ts","../src/features/search-filter/components/SearchFilterDrawer.tsx","../src/features/search-filter/components/SearchFilterButton.tsx","../src/features/search-filter/components/SearchFilterSection.tsx","../src/features/search-filter/components/StickyFooter.tsx","../src/features/search-filter/context/SearchFilterModelContext.ts","../src/features/search-filter/components/context/SearchFilterContext.tsx","../src/features/search-filter/redux/SearchFilterRedux.ts","../src/features/search-filter/hooks/UseLocalSearchFilterState.ts","../src/features/search-filter/components/context/SearchFilterLocalStateContext.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckbox.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckboxList.tsx","../src/features/search-filter/features/chips/SearchFilterChips.tsx","../src/features/search-filter/features/chips/EmptyChip.tsx","../src/features/search-filter/features/chips/SearchFilterChip.tsx","../src/features/search-filter/features/chips/SectionChips.tsx","../src/features/search-filter/section-factories/boolean-record/BooleanRecordChips.ts","../src/features/search-filter/section-factories/boolean-record/components/SimpleCheckboxListSection.tsx","../src/features/search-filter/section-factories/boolean-record/components/ChipMultiSelectSection.tsx","../src/features/search-filter/section-factories/date-range/DateRangeChips.ts","../src/features/search-filter/section-factories/date-range/DateRangePropsFactory.ts","../src/features/search-filter/section-factories/date-range/components/DateRangeCalendarSection.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport { DrawerHeader } from \"@stenajs-webui/modal\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n contentRight?: ReactNode;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({ header = \"Filter\", ...props }) => {\n return <DrawerHeader {...props} header={header} />;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterState } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterStateContext = createContext<\n SearchFilterState<unknown>\n>(null as unknown as SearchFilterState<unknown>);\n\nexport const useSearchFilterState = <\n TFormModel,\n>(): SearchFilterState<TFormModel> => {\n const c = useContext(SearchFilterStateContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as SearchFilterState<TFormModel>;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterDispatch } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterDispatchContext = createContext<\n SearchFilterDispatch<unknown>\n>(null as unknown as SearchFilterDispatch<unknown>);\n\nexport const useSearchFilterDispatch = () => {\n const c = useContext(SearchFilterDispatchContext);\n if (!c) {\n throw new Error(\"Missing search filter dispatch context.\");\n }\n return c;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterActions } from \"../redux/SearchFilterRedux\";\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const SearchFilterActionsContext = createContext<\n SearchFilterActions<unknown, any>\n>(null as unknown as SearchFilterActions<unknown, any>);\n\nexport const useSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>() => {\n const c = useContext(SearchFilterActionsContext);\n if (!c) {\n throw new Error(\"Missing search filter actions context.\");\n }\n return c as SearchFilterActions<TFormModel, TSectionKey>;\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport {\n Drawer,\n DrawerBaseLeftRight,\n DrawerBaseTopBottom,\n} from \"@stenajs-webui/modal\";\nimport { cssColor } from \"@stenajs-webui/theme\";\nimport { Box, Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport type SearchFilterDrawerProps =\n | SearchFilterDrawerLeftRightProps\n | SearchFilterDrawerTopBottomProps;\n\ninterface SearchFilterDrawerCommonProps {\n header?: string;\n headerContentRight?: ReactNode;\n}\n\ninterface SearchFilterDrawerLeftRightProps\n extends\n Omit<DrawerBaseLeftRight, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\ninterface SearchFilterDrawerTopBottomProps\n extends\n Omit<DrawerBaseTopBottom, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerContentRight,\n ...drawerProps\n}) => {\n const {\n settings: { open },\n } = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const closeDrawer = useCallback(() => {\n dispatch(actions.closeFilters());\n }, [actions, dispatch]);\n\n return (\n <Drawer\n floating\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column\n height={\"100%\"}\n borderRadius={\"var(--swui-border-radius)\"}\n background={cssColor(\"--lhds-color-ui-50\")}\n >\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n contentRight={headerContentRight}\n />\n <Box spacing={1} indent={1} gap={1}>\n {children}\n </Box>\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSlidersMini } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSlidersMini,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickButton = useCallback(() => {\n dispatch(actions.openFilters());\n }, [actions, dispatch]);\n\n return (\n <SecondaryButton\n label={label}\n leftIcon={leftIcon}\n onClick={onClickButton}\n />\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren, useCallback } from \"react\";\nimport { Row, Space } from \"@stenajs-webui/core\";\nimport { lowerCase, upperFirst } from \"lodash-es\";\nimport {\n Banner,\n FlatButton,\n MenuButton,\n Spinner,\n} from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label?: string;\n leftIcon?: IconDefinition;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string,\n>({\n sectionId,\n label,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\n leftIcon,\n contentRight,\n}: PropsWithChildren<SearchFilterSectionProps<TSectionKey>>) {\n const state = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const expanded = state.expandedSections.values[sectionId] ?? false;\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.setSectionExpanded(sectionId, !expanded));\n }, [actions, dispatch, expanded, sectionId]);\n\n const activeLabel = label ?? formatColumnIdToHeaderCellLabel(sectionId);\n\n return (\n <>\n <MenuButton\n label={activeLabel}\n leftIcon={leftIcon}\n expandable\n expanded={expanded}\n selected={expanded}\n onClick={onClickLabel}\n right={contentRight}\n >\n {loading ? (\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n ) : error ? (\n <Banner\n variant={\"error\"}\n text={error}\n contentRight={\n onRetry ? <FlatButton label={\"Retry\"} onClick={onRetry} /> : null\n }\n />\n ) : disableContentPadding ? (\n children\n ) : (\n children\n )}\n </MenuButton>\n {expanded && <Space />}\n </>\n );\n};\n\nexport const formatColumnIdToHeaderCellLabel = (columnId: string): string =>\n upperFirst(lowerCase(columnId));\n","import { BoxProps, Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface StickySearchButtonProps extends Pick<BoxProps, \"gap\"> {\n children?: ReactNode;\n}\n\nexport const StickyFooter: React.FC<StickySearchButtonProps> = ({\n children,\n ...boxProps\n}) => {\n return (\n <Column\n style={{ marginTop: \"auto\" }}\n justifyContent={\"center\"}\n spacing={2}\n indent\n shadow={\"popover\"}\n zIndex={1}\n {...boxProps}\n >\n {children}\n </Column>\n );\n};\n","import { createContext, useContext } from \"react\";\n\nexport const SearchFilterModelContext = createContext<unknown>(null as unknown);\n\nexport const useSearchFilterModel = <TFormModel>(): TFormModel => {\n const c = useContext(SearchFilterModelContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as TFormModel;\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n SearchFilterState,\n} from \"../../redux/SearchFilterRedux\";\nimport { SearchFilterDispatchContext } from \"../../context/SearchFilterDispatchContext\";\nimport { SearchFilterActionsContext } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterStateContext } from \"../../context/SearchFilterStateContext\";\nimport { SearchFilterModelContext } from \"../../context/SearchFilterModelContext\";\n\ninterface SearchFilterScopeProps<TFormModel, TSectionKey extends string> {\n state: SearchFilterState<TFormModel>;\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const SearchFilterContext = function SearchFilterScope<\n TFormModel,\n TSectionKey extends string,\n>({\n state,\n dispatch,\n actions,\n children,\n}: PropsWithChildren<SearchFilterScopeProps<TFormModel, TSectionKey>>) {\n return (\n <SearchFilterDispatchContext.Provider\n value={dispatch as SearchFilterDispatch<unknown>}\n >\n <SearchFilterActionsContext.Provider value={actions}>\n <SearchFilterStateContext.Provider value={state}>\n <SearchFilterModelContext.Provider value={state.formModel}>\n {children}\n </SearchFilterModelContext.Provider>\n </SearchFilterStateContext.Provider>\n </SearchFilterActionsContext.Provider>\n </SearchFilterDispatchContext.Provider>\n );\n};\n","import { combineReducers } from \"redux\";\nimport {\n createEntityActions,\n createEntityReducer,\n createValueByIdActions,\n createValueByIdReducer,\n EntityAction,\n EntityState,\n reducerIdGate,\n reducerIdGateAction,\n ReducerIdGateAction,\n ValueByIdAction,\n ValueByIdState,\n} from \"@stenajs-webui/redux\";\nimport { Dispatch } from \"react\";\n\nexport interface SearchFilterSettings {\n open: boolean;\n}\n\nexport type SearchFilterDispatch<TFormModel> = Dispatch<\n SearchFilterAction<TFormModel>\n>;\n\nexport interface SearchFilterState<TFormModel> {\n expandedSections: ValueByIdState<boolean>;\n formModel: EntityState<TFormModel>;\n settings: EntityState<SearchFilterSettings>;\n}\n\nexport type SearchFilterAction<TFormModel> =\n | ReducerIdGateAction<ValueByIdAction<boolean>>\n | ReducerIdGateAction<EntityAction<TFormModel>>\n | ReducerIdGateAction<EntityAction<SearchFilterSettings>>;\n\nexport const createSearchFilterInitialState = <TFormModel>(\n initialFormModel: TFormModel,\n): SearchFilterState<TFormModel> => ({\n settings: {\n open: false,\n },\n formModel: initialFormModel,\n expandedSections: { values: {} },\n});\n\nexport const createSearchFilterReducer = <TFormModel>(\n reducerId: string,\n initialState: SearchFilterState<TFormModel>,\n) =>\n combineReducers({\n expandedSections: reducerIdGate(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdReducer<boolean>(initialState.expandedSections),\n ),\n formModel: reducerIdGate(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityReducer<TFormModel>(initialState.formModel),\n ),\n settings: reducerIdGate(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityReducer<SearchFilterSettings>(initialState.settings),\n ),\n });\n\nexport interface SearchFilterActions<TFormModel, TSectionKey extends string> {\n openFilters: () => SearchFilterAction<TFormModel>;\n closeFilters: () => SearchFilterAction<TFormModel>;\n setFormModelFields: (\n fields: Partial<TFormModel>,\n ) => SearchFilterAction<TFormModel>;\n clearFormModel: () => SearchFilterAction<TFormModel>;\n expandSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n collapseSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n setSectionExpanded: (\n section: TSectionKey,\n expanded: boolean,\n ) => SearchFilterAction<TFormModel>;\n clearExpandedSections: () => SearchFilterAction<TFormModel>;\n}\n\nexport const createSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>(\n reducerId: string,\n initialFormModel: TFormModel,\n): SearchFilterActions<TFormModel, TSectionKey> => ({\n openFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: true,\n }),\n ),\n closeFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: false,\n }),\n ),\n setFormModelFields: (fields: Partial<TFormModel>) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntityFields(fields),\n ),\n clearFormModel: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntity(initialFormModel),\n ),\n expandSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, true),\n ),\n collapseSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, false),\n ),\n setSectionExpanded: (section: TSectionKey, expanded: boolean) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, expanded),\n ),\n clearExpandedSections: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().clearAllValues(),\n ),\n});\n\nexport const getReducerIdFor = (\n reducerId: string,\n reducerIdSuffix: keyof SearchFilterState<unknown>,\n): string => `${reducerId}.${reducerIdSuffix}`;\n","import {\n createSearchFilterActions,\n createSearchFilterReducer,\n SearchFilterState,\n} from \"../redux/SearchFilterRedux\";\nimport { useReducer, useState } from \"react\";\n\nexport const useLocalSearchFilterState = <\n TFormModel,\n TSectionKey extends string,\n>(\n initialState: SearchFilterState<TFormModel>,\n) => {\n const [reducer] = useState(() =>\n createSearchFilterReducer<TFormModel>(\"local\", initialState),\n );\n\n const [actions] = useState(() =>\n createSearchFilterActions<TFormModel, TSectionKey>(\n \"local\",\n initialState.formModel,\n ),\n );\n\n const [state, dispatch] = useReducer(reducer, initialState);\n\n return {\n actions,\n state,\n dispatch,\n };\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { useLocalSearchFilterState } from \"../../hooks/UseLocalSearchFilterState\";\nimport { SearchFilterContext } from \"./SearchFilterContext\";\nimport { createSearchFilterInitialState } from \"../../redux/SearchFilterRedux\";\n\ninterface SearchFilterLocalScopeProps<TFormModel> {\n initialFormModel: TFormModel;\n}\n\nexport const SearchFilterLocalStateContext = function SearchFilterLocalScope<\n TFormModel,\n>({\n initialFormModel,\n children,\n}: PropsWithChildren<SearchFilterLocalScopeProps<TFormModel>>) {\n const { state, actions, dispatch } = useLocalSearchFilterState(\n createSearchFilterInitialState(initialFormModel),\n );\n\n return (\n <SearchFilterContext state={state} actions={actions} dispatch={dispatch}>\n {children}\n </SearchFilterContext>\n );\n};\n","import * as React from \"react\";\nimport { Row, Text } from \"@stenajs-webui/core\";\nimport { ContentMenuButton } from \"@stenajs-webui/elements\";\nimport { Checkbox, CheckboxProps } from \"@stenajs-webui/forms\";\n\nexport interface FilterCheckboxProps extends CheckboxProps {\n label: string;\n}\n\nexport const FilterCheckbox: React.FC<FilterCheckboxProps> = ({\n label,\n ...checkboxProps\n}) => {\n return (\n <ContentMenuButton>\n <Row gap={2} alignItems={\"center\"} justifyContent={\"flex-start\"}>\n <Checkbox {...checkboxProps} />\n <Text>{label}</Text>\n </Row>\n </ContentMenuButton>\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { Column } from \"@stenajs-webui/core\";\n\nexport interface FilterCheckboxListProps extends PropsWithChildren {\n maxHeight?: string;\n}\n\nexport const FilterCheckboxList: React.FC<FilterCheckboxListProps> = ({\n children,\n maxHeight,\n}) => {\n return (\n <Column\n maxHeight={maxHeight}\n overflowY={maxHeight ? \"auto\" : undefined}\n spacing={1}\n >\n {children}\n </Column>\n );\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { FlatButton, stenaClean } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface SearchFilterChipsProps {\n disableClearAllButton?: boolean;\n children?: ReactNode;\n}\n\nexport const SearchFilterChips: React.FC<SearchFilterChipsProps> = ({\n children,\n disableClearAllButton = false,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickClearAll = useCallback(\n () => dispatch(actions.clearFormModel()),\n [actions, dispatch],\n );\n\n return (\n <Row flexWrap={\"wrap\"} alignItems={\"center\"} gap>\n {children}\n {!disableClearAllButton && (\n <FlatButton\n size={\"small\"}\n leftIcon={stenaClean}\n label={\"Clear\"}\n onClick={onClickClearAll}\n />\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface EmptyChipProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label: string;\n}\n\nexport const EmptyChip = function EmptyChip<TSectionKey extends string>({\n label,\n sectionId,\n}: EmptyChipProps<TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />;\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterSectionOnClickRemoveOnChip } from \"../../config/SearchFilterConfig\";\n\ninterface SearchFilterChipProps<TFormModel, TSectionKey> {\n sectionId: TSectionKey;\n label: string;\n value: string;\n onClickRemove?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SearchFilterChip = function SearchFilterChip<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n label,\n value,\n onClickRemove,\n}: SearchFilterChipProps<TFormModel, TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const setFormModelFields = useCallback(\n (fields: Partial<TFormModel>) =>\n dispatch(actions.setFormModelFields(fields)),\n [dispatch, actions],\n );\n\n const onClickRemoveHandler = useCallback(() => {\n onClickRemove?.({ value, setFormModelFields });\n }, [onClickRemove, setFormModelFields, value]);\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return (\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n );\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { EmptyChip } from \"./EmptyChip\";\nimport { SearchFilterChip } from \"./SearchFilterChip\";\n\nexport interface SectionChipsProps<TFormModel, TSectionKey extends string> {\n sectionId: TSectionKey;\n chips?: Array<SearchFilterSectionChipModel>;\n emptyChipLabel?: string;\n onClickRemoveOnChip?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SectionChips = function SectionChips<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n chips,\n emptyChipLabel,\n onClickRemoveOnChip,\n}: SectionChipsProps<TFormModel, TSectionKey>) {\n if (!chips?.length) {\n if (!emptyChipLabel) {\n return null;\n }\n return <EmptyChip sectionId={sectionId} label={emptyChipLabel} />;\n }\n\n return (\n <>\n {chips.map(({ label, value }) => (\n <SearchFilterChip\n key={value}\n label={label ?? sectionId}\n sectionId={sectionId}\n onClickRemove={onClickRemoveOnChip}\n value={value}\n />\n ))}\n </>\n );\n};\n","import { BooleanRecord, BooleanRecordOptions } from \"./BooleanRecordTypes\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue, truthyKeysAsList } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForBooleanRecord = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n options?: BooleanRecordOptions,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForBooleanRecord(\n formModel[fieldName] as unknown as BooleanRecord,\n options,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForBooleanRecord(\n formModel,\n fieldName,\n ),\n});\n\nexport const createChipsForBooleanRecord = (\n booleanRecord: BooleanRecord,\n options?: BooleanRecordOptions,\n): Array<SearchFilterSectionChipModel> =>\n truthyKeysAsList(booleanRecord).map((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n });\n\nexport const createOnClickRemoveOnChipForBooleanRecord = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields, value }) => {\n const newBooleanRecord = { ...formModel[fieldName] } as BooleanRecord;\n newBooleanRecord[value] = false;\n setFormModelFields({\n [fieldName]: newBooleanRecord,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { FilterCheckbox } from \"../../../features/filter-checkbox/FilterCheckbox\";\nimport { FilterCheckboxList } from \"../../../features/filter-checkbox/FilterCheckboxList\";\n\nexport interface SimpleCheckboxSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n options?: BooleanRecordOptions;\n}\n\nexport const SimpleCheckboxListSection = <TSectionKey extends string>({\n options,\n value,\n onValueChange,\n ...sectionProps\n}: SimpleCheckboxSectionProps<TSectionKey>): React.ReactElement => (\n <SearchFilterSection disableContentPadding {...sectionProps}>\n <FilterCheckboxList maxHeight={\"400px\"}>\n {options?.map((d) => (\n <FilterCheckbox\n key={d.value}\n value={value?.[d.value]}\n label={d.label}\n onValueChange={(v) =>\n onValueChange?.({\n ...value,\n [d.value]: v,\n })\n }\n />\n ))}\n </FilterCheckboxList>\n </SearchFilterSection>\n);\n","import * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { ChipMultiSelect, ChipMultiSelectValue } from \"@stenajs-webui/select\";\nimport { truthyKeysAsList } from \"@stenajs-webui/core\";\n\ninterface ChipMultiSelectSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n noneSelectedLabel?: string;\n options?: BooleanRecordOptions;\n}\n\nexport const ChipMultiSelectSection = <TSectionKey extends string>({\n options,\n value,\n noneSelectedLabel,\n onValueChange,\n ...sectionProps\n}: ChipMultiSelectSectionProps<TSectionKey>): React.ReactElement => {\n const [text, setText] = useState<string>(\"\");\n\n const listValue = useMemo<Array<ChipMultiSelectValue>>(\n () =>\n value\n ? truthyKeysAsList(value).map<ChipMultiSelectValue>((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n })\n : [],\n [options, value],\n );\n\n const filteredOptions = useMemo(() => {\n return options?.filter(\n (p) =>\n p.value.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1 ||\n p.label.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1,\n );\n }, [options, text]);\n\n const onValueChangeInternal = useCallback(\n (value: Array<ChipMultiSelectValue>) => {\n onValueChange?.(createBooleanRecordFromValue(value));\n },\n [onValueChange],\n );\n\n return (\n <SearchFilterSection {...sectionProps}>\n <ChipMultiSelect\n options={filteredOptions}\n value={listValue}\n onValueChange={onValueChangeInternal}\n inputValue={text}\n noneSelectedLabel={noneSelectedLabel}\n onInputChange={setText}\n closeMenuOnSelect={false}\n />\n </SearchFilterSection>\n );\n};\n\nconst createBooleanRecordFromValue = (\n value: Array<ChipMultiSelectValue>,\n): BooleanRecord => {\n return value.reduce<BooleanRecord>((sum, item) => {\n sum[item.value] = true;\n return sum;\n }, {});\n};\n","import {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForDateRange = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForDateRange(\n formModel[startDateFieldName] as unknown as string | undefined,\n formModel[endDateFieldName] as unknown as string | undefined,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForDateRange(\n startDateFieldName,\n endDateFieldName,\n ),\n});\n\nexport const createChipsForDateRange = (\n startDate: string | undefined,\n endDate: string | undefined,\n): Array<SearchFilterSectionChipModel> => {\n if (!startDate && !endDate) {\n return [];\n }\n return [\n { value: \"dateRange\", label: `${startDate ?? \"\"} - ${endDate ?? \"\"}` },\n ];\n};\n\nexport const createOnClickRemoveOnChipForDateRange = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n startDateFieldName: TField,\n endDateFieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields }) => {\n setFormModelFields({\n [startDateFieldName]: undefined,\n [endDateFieldName]: undefined,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import { PickByValue } from \"@stenajs-webui/core\";\nimport { DateRangeCalendarSectionProps } from \"./components/DateRangeCalendarSection\";\n\nexport const createDateRangeSectionProps = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n TSectionKey extends string,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n DateRangeCalendarSectionProps<TFormModel, TSectionKey>,\n \"value\" | \"onValueChange\"\n> => ({\n value: {\n startDate: formModel[startDateFieldName] as unknown as string | undefined,\n endDate: formModel[endDateFieldName] as unknown as string | undefined,\n },\n /* eslint-disable @typescript-eslint/no-explicit-any */\n onValueChange: (value, { dispatch, actions }) => {\n const fields: Partial<TFormModel> = {\n [startDateFieldName]: value.startDate,\n [endDateFieldName]: value.endDate,\n } as any;\n dispatch(actions.setFormModelFields(fields));\n },\n});\n","import {\n DateRange,\n DateRangeCalendar,\n DateRangeCalendarProps,\n DateRangeFocusedInput,\n dateRangeToStrings,\n DateStringRange,\n stringsToDateRange,\n} from \"@stenajs-webui/calendar\";\nimport * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { Box } from \"@stenajs-webui/core\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n} from \"../../../redux/SearchFilterRedux\";\nimport { useSearchFilterDispatch } from \"../../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../../context/SearchFilterActionsContext\";\n\nexport interface DateRangeCalendarSectionProps<\n TFormModel,\n TSectionKey extends string,\n>\n extends\n Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<unknown>,\n \"value\" | \"onValueChange\" | \"focusedInput\" | \"setFocusedInput\"\n > {\n value: DateStringRange;\n onValueChange: (\n value: DateStringRange,\n options: SetDateOptions<TFormModel, TSectionKey>,\n ) => void;\n label?: string;\n}\n\nexport interface SetDateOptions<TFormModel, TSectionKey extends string> {\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const DateRangeCalendarSection = <\n TFormModel,\n TSectionKey extends string,\n>({\n value,\n onValueChange,\n sectionId,\n contentRight,\n disableContentPadding,\n label,\n leftIcon,\n ...dateRangeCalendarProps\n}: DateRangeCalendarSectionProps<TFormModel, TSectionKey>) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions<TFormModel, TSectionKey>();\n\n const options = useMemo<SetDateOptions<TFormModel, TSectionKey>>(\n () => ({ dispatch, actions }),\n [actions, dispatch],\n );\n const [focusedInput, setFocusedInput] =\n useState<DateRangeFocusedInput>(\"startDate\");\n\n const dateRangeValue = useMemo(() => stringsToDateRange(value), [value]);\n\n const onValueChangeHandler = useCallback(\n (value: DateRange) => {\n onValueChange(dateRangeToStrings(value), options);\n },\n [onValueChange, options],\n );\n\n return (\n <SearchFilterSection\n label={label}\n leftIcon={leftIcon}\n sectionId={sectionId}\n contentRight={contentRight}\n disableContentPadding={disableContentPadding}\n >\n <Box flex={1} alignItems={\"center\"}>\n <Box background={\"white\"} indent>\n <DateRangeCalendar\n setFocusedInput={setFocusedInput}\n focusedInput={focusedInput}\n value={dateRangeValue}\n onValueChange={onValueChangeHandler}\n {...dateRangeCalendarProps}\n />\n </Box>\n </Box>\n </SearchFilterSection>\n );\n};\n"],"names":["SearchFilterPanelHeader","header","props","jsx","DrawerHeader","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","drawerProps","open","dispatch","actions","closeDrawer","useCallback","Drawer","jsxs","Column","cssColor","Box","SearchFilterButton","label","leftIcon","stenaSlidersMini","onClickButton","SecondaryButton","SearchFilterSection","sectionId","loading","error","onRetry","disableContentPadding","contentRight","state","expanded","onClickLabel","activeLabel","formatColumnIdToHeaderCellLabel","Fragment","MenuButton","Row","Spinner","Banner","FlatButton","Space","columnId","upperFirst","lowerCase","StickyFooter","boxProps","SearchFilterModelContext","useSearchFilterModel","SearchFilterContext","createSearchFilterInitialState","initialFormModel","createSearchFilterReducer","reducerId","initialState","combineReducers","reducerIdGate","getReducerIdFor","createValueByIdReducer","createEntityReducer","createSearchFilterActions","reducerIdGateAction","createEntityActions","fields","section","createValueByIdActions","reducerIdSuffix","useLocalSearchFilterState","reducer","useState","useReducer","SearchFilterLocalStateContext","FilterCheckbox","checkboxProps","ContentMenuButton","Checkbox","Text","FilterCheckboxList","maxHeight","SearchFilterChips","disableClearAllButton","onClickClearAll","stenaClean","EmptyChip","Chip","SearchFilterChip","value","onClickRemove","setFormModelFields","onClickRemoveHandler","SectionChips","chips","emptyChipLabel","onClickRemoveOnChip","createChipsPropsForBooleanRecord","formModel","fieldName","options","createChipsForBooleanRecord","createOnClickRemoveOnChipForBooleanRecord","booleanRecord","truthyKeysAsList","key","option","o","newBooleanRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","v","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","filteredOptions","p","onValueChangeInternal","createBooleanRecordFromValue","ChipMultiSelect","sum","item","createChipsPropsForDateRange","startDateFieldName","endDateFieldName","createChipsForDateRange","createOnClickRemoveOnChipForDateRange","startDate","endDate","createDateRangeSectionProps","DateRangeCalendarSection","dateRangeCalendarProps","focusedInput","setFocusedInput","dateRangeValue","stringsToDateRange","onValueChangeHandler","dateRangeToStrings","DateRangeCalendar"],"mappings":";;;;;;;;;;;;AAUO,MAAMA,KAET,CAAC,EAAE,QAAAC,IAAS,UAAU,GAAGC,QACpB,gBAAAC,EAACC,GAAA,EAAc,GAAGF,GAAO,QAAAD,EAAA,CAAgB,GCVrCI,IAA2BC,EAEtC,IAA6C,GAElCC,IAAuB,MAEE;AACpC,QAAMC,IAAIC,EAAWJ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WAAW,GAEvCmE,IAAiBpB,EAAQ,MAAMqB,GAAmBnD,CAAK,GAAG,CAACA,CAAK,CAAC,GAEjEoD,IAAuB/H;AAAA,IAC3B,CAAC2E,MAAqB;AACpB,MAAAqB,EAAcgC,GAAmBrD,CAAK,GAAGW,CAAO;AAAA,IAClD;AAAA,IACA,CAACU,GAAeV,CAAO;AAAA,EAAA;AAGzB,SACE,gBAAAzG;AAAA,IAAC+B;AAAA,IAAA;AAAA,MACC,OAAAL;AAAA,MACA,UAAAC;AAAA,MACA,WAAAK;AAAA,MACA,cAAAK;AAAA,MACA,uBAAAD;AAAA,MAEA,UAAA,gBAAApC,EAACwB,GAAA,EAAI,MAAM,GAAG,YAAY,UACxB,UAAA,gBAAAxB,EAACwB,GAAA,EAAI,YAAY,SAAS,QAAM,IAC9B,UAAA,gBAAAxB;AAAA,QAACoJ;AAAA,QAAA;AAAA,UACC,iBAAAL;AAAA,UACA,cAAAD;AAAA,UACA,OAAOE;AAAA,UACP,eAAeE;AAAA,UACd,GAAGL;AAAA,QAAA;AAAA,MAAA,GAER,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/features/search-filter/components/SearchFilterPanelHeader.tsx","../src/features/search-filter/context/SearchFilterStateContext.ts","../src/features/search-filter/context/SearchFilterDispatchContext.ts","../src/features/search-filter/context/SearchFilterActionsContext.ts","../src/features/search-filter/components/SearchFilterDrawer.tsx","../src/features/search-filter/components/SearchFilterButton.tsx","../src/features/search-filter/components/SearchFilterSection.tsx","../src/features/search-filter/components/StickyFooter.tsx","../src/features/search-filter/context/SearchFilterModelContext.ts","../src/features/search-filter/components/context/SearchFilterContext.tsx","../src/features/search-filter/redux/SearchFilterRedux.ts","../src/features/search-filter/hooks/UseLocalSearchFilterState.ts","../src/features/search-filter/components/context/SearchFilterLocalStateContext.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckbox.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckboxList.tsx","../src/features/search-filter/features/chips/SearchFilterChips.tsx","../src/features/search-filter/features/chips/EmptyChip.tsx","../src/features/search-filter/features/chips/SearchFilterChip.tsx","../src/features/search-filter/features/chips/SectionChips.tsx","../src/features/search-filter/section-factories/boolean-record/BooleanRecordChips.ts","../src/features/search-filter/section-factories/boolean-record/components/SimpleCheckboxListSection.tsx","../src/features/search-filter/section-factories/boolean-record/components/ChipMultiSelectSection.tsx","../src/features/search-filter/section-factories/date-range/DateRangeChips.ts","../src/features/search-filter/section-factories/date-range/DateRangePropsFactory.ts","../src/features/search-filter/section-factories/date-range/components/DateRangeCalendarSection.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport { DrawerHeader } from \"@stenajs-webui/modal\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n contentRight?: ReactNode;\n /**\n * Accessible name of the close button, for example \"Close filters\".\n * Required, there is no default text.\n */\n closeButtonAriaLabel: string;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({ header = \"Filter\", ...props }) => {\n return <DrawerHeader {...props} header={header} />;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterState } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterStateContext = createContext<\n SearchFilterState<unknown>\n>(null as unknown as SearchFilterState<unknown>);\n\nexport const useSearchFilterState = <\n TFormModel,\n>(): SearchFilterState<TFormModel> => {\n const c = useContext(SearchFilterStateContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as SearchFilterState<TFormModel>;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterDispatch } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterDispatchContext = createContext<\n SearchFilterDispatch<unknown>\n>(null as unknown as SearchFilterDispatch<unknown>);\n\nexport const useSearchFilterDispatch = () => {\n const c = useContext(SearchFilterDispatchContext);\n if (!c) {\n throw new Error(\"Missing search filter dispatch context.\");\n }\n return c;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterActions } from \"../redux/SearchFilterRedux\";\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const SearchFilterActionsContext = createContext<\n SearchFilterActions<unknown, any>\n>(null as unknown as SearchFilterActions<unknown, any>);\n\nexport const useSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>() => {\n const c = useContext(SearchFilterActionsContext);\n if (!c) {\n throw new Error(\"Missing search filter actions context.\");\n }\n return c as SearchFilterActions<TFormModel, TSectionKey>;\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport {\n Drawer,\n DrawerBaseLeftRight,\n DrawerBaseTopBottom,\n} from \"@stenajs-webui/modal\";\nimport { cssColor } from \"@stenajs-webui/theme\";\nimport { Box, Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport type SearchFilterDrawerProps =\n | SearchFilterDrawerLeftRightProps\n | SearchFilterDrawerTopBottomProps;\n\ninterface SearchFilterDrawerCommonProps {\n header?: string;\n headerContentRight?: ReactNode;\n /**\n * Accessible name of the close button, for example \"Close filters\".\n * Required, there is no default text.\n */\n closeButtonAriaLabel: string;\n}\n\ninterface SearchFilterDrawerLeftRightProps\n extends\n Omit<DrawerBaseLeftRight, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\ninterface SearchFilterDrawerTopBottomProps\n extends\n Omit<DrawerBaseTopBottom, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerContentRight,\n closeButtonAriaLabel,\n ...drawerProps\n}) => {\n const {\n settings: { open },\n } = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const closeDrawer = useCallback(() => {\n dispatch(actions.closeFilters());\n }, [actions, dispatch]);\n\n return (\n <Drawer\n floating\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column\n height={\"100%\"}\n borderRadius={\"var(--swui-border-radius)\"}\n background={cssColor(\"--lhds-color-ui-50\")}\n >\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n contentRight={headerContentRight}\n closeButtonAriaLabel={closeButtonAriaLabel}\n />\n <Box spacing={1} indent={1} gap={1}>\n {children}\n </Box>\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSlidersMini } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSlidersMini,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickButton = useCallback(() => {\n dispatch(actions.openFilters());\n }, [actions, dispatch]);\n\n return (\n <SecondaryButton\n label={label}\n leftIcon={leftIcon}\n onClick={onClickButton}\n />\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren, useCallback } from \"react\";\nimport { Row, Space } from \"@stenajs-webui/core\";\nimport { lowerCase, upperFirst } from \"lodash-es\";\nimport {\n Banner,\n FlatButton,\n MenuButton,\n Spinner,\n} from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label?: string;\n leftIcon?: IconDefinition;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string,\n>({\n sectionId,\n label,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\n leftIcon,\n contentRight,\n}: PropsWithChildren<SearchFilterSectionProps<TSectionKey>>) {\n const state = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const expanded = state.expandedSections.values[sectionId] ?? false;\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.setSectionExpanded(sectionId, !expanded));\n }, [actions, dispatch, expanded, sectionId]);\n\n const activeLabel = label ?? formatColumnIdToHeaderCellLabel(sectionId);\n\n return (\n <>\n <MenuButton\n label={activeLabel}\n leftIcon={leftIcon}\n expandable\n expanded={expanded}\n selected={expanded}\n onClick={onClickLabel}\n right={contentRight}\n >\n {loading ? (\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n ) : error ? (\n <Banner\n variant={\"error\"}\n text={error}\n contentRight={\n onRetry ? <FlatButton label={\"Retry\"} onClick={onRetry} /> : null\n }\n />\n ) : disableContentPadding ? (\n children\n ) : (\n children\n )}\n </MenuButton>\n {expanded && <Space />}\n </>\n );\n};\n\nexport const formatColumnIdToHeaderCellLabel = (columnId: string): string =>\n upperFirst(lowerCase(columnId));\n","import { BoxProps, Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface StickySearchButtonProps extends Pick<BoxProps, \"gap\"> {\n children?: ReactNode;\n}\n\nexport const StickyFooter: React.FC<StickySearchButtonProps> = ({\n children,\n ...boxProps\n}) => {\n return (\n <Column\n style={{ marginTop: \"auto\" }}\n justifyContent={\"center\"}\n spacing={2}\n indent\n shadow={\"popover\"}\n zIndex={1}\n {...boxProps}\n >\n {children}\n </Column>\n );\n};\n","import { createContext, useContext } from \"react\";\n\nexport const SearchFilterModelContext = createContext<unknown>(null as unknown);\n\nexport const useSearchFilterModel = <TFormModel>(): TFormModel => {\n const c = useContext(SearchFilterModelContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as TFormModel;\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n SearchFilterState,\n} from \"../../redux/SearchFilterRedux\";\nimport { SearchFilterDispatchContext } from \"../../context/SearchFilterDispatchContext\";\nimport { SearchFilterActionsContext } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterStateContext } from \"../../context/SearchFilterStateContext\";\nimport { SearchFilterModelContext } from \"../../context/SearchFilterModelContext\";\n\ninterface SearchFilterScopeProps<TFormModel, TSectionKey extends string> {\n state: SearchFilterState<TFormModel>;\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const SearchFilterContext = function SearchFilterScope<\n TFormModel,\n TSectionKey extends string,\n>({\n state,\n dispatch,\n actions,\n children,\n}: PropsWithChildren<SearchFilterScopeProps<TFormModel, TSectionKey>>) {\n return (\n <SearchFilterDispatchContext.Provider\n value={dispatch as SearchFilterDispatch<unknown>}\n >\n <SearchFilterActionsContext.Provider value={actions}>\n <SearchFilterStateContext.Provider value={state}>\n <SearchFilterModelContext.Provider value={state.formModel}>\n {children}\n </SearchFilterModelContext.Provider>\n </SearchFilterStateContext.Provider>\n </SearchFilterActionsContext.Provider>\n </SearchFilterDispatchContext.Provider>\n );\n};\n","import { combineReducers } from \"redux\";\nimport {\n createEntityActions,\n createEntityReducer,\n createValueByIdActions,\n createValueByIdReducer,\n EntityAction,\n EntityState,\n reducerIdGate,\n reducerIdGateAction,\n ReducerIdGateAction,\n ValueByIdAction,\n ValueByIdState,\n} from \"@stenajs-webui/redux\";\nimport { Dispatch } from \"react\";\n\nexport interface SearchFilterSettings {\n open: boolean;\n}\n\nexport type SearchFilterDispatch<TFormModel> = Dispatch<\n SearchFilterAction<TFormModel>\n>;\n\nexport interface SearchFilterState<TFormModel> {\n expandedSections: ValueByIdState<boolean>;\n formModel: EntityState<TFormModel>;\n settings: EntityState<SearchFilterSettings>;\n}\n\nexport type SearchFilterAction<TFormModel> =\n | ReducerIdGateAction<ValueByIdAction<boolean>>\n | ReducerIdGateAction<EntityAction<TFormModel>>\n | ReducerIdGateAction<EntityAction<SearchFilterSettings>>;\n\nexport const createSearchFilterInitialState = <TFormModel>(\n initialFormModel: TFormModel,\n): SearchFilterState<TFormModel> => ({\n settings: {\n open: false,\n },\n formModel: initialFormModel,\n expandedSections: { values: {} },\n});\n\nexport const createSearchFilterReducer = <TFormModel>(\n reducerId: string,\n initialState: SearchFilterState<TFormModel>,\n) =>\n combineReducers({\n expandedSections: reducerIdGate(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdReducer<boolean>(initialState.expandedSections),\n ),\n formModel: reducerIdGate(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityReducer<TFormModel>(initialState.formModel),\n ),\n settings: reducerIdGate(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityReducer<SearchFilterSettings>(initialState.settings),\n ),\n });\n\nexport interface SearchFilterActions<TFormModel, TSectionKey extends string> {\n openFilters: () => SearchFilterAction<TFormModel>;\n closeFilters: () => SearchFilterAction<TFormModel>;\n setFormModelFields: (\n fields: Partial<TFormModel>,\n ) => SearchFilterAction<TFormModel>;\n clearFormModel: () => SearchFilterAction<TFormModel>;\n expandSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n collapseSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n setSectionExpanded: (\n section: TSectionKey,\n expanded: boolean,\n ) => SearchFilterAction<TFormModel>;\n clearExpandedSections: () => SearchFilterAction<TFormModel>;\n}\n\nexport const createSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>(\n reducerId: string,\n initialFormModel: TFormModel,\n): SearchFilterActions<TFormModel, TSectionKey> => ({\n openFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: true,\n }),\n ),\n closeFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: false,\n }),\n ),\n setFormModelFields: (fields: Partial<TFormModel>) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntityFields(fields),\n ),\n clearFormModel: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntity(initialFormModel),\n ),\n expandSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, true),\n ),\n collapseSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, false),\n ),\n setSectionExpanded: (section: TSectionKey, expanded: boolean) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, expanded),\n ),\n clearExpandedSections: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().clearAllValues(),\n ),\n});\n\nexport const getReducerIdFor = (\n reducerId: string,\n reducerIdSuffix: keyof SearchFilterState<unknown>,\n): string => `${reducerId}.${reducerIdSuffix}`;\n","import {\n createSearchFilterActions,\n createSearchFilterReducer,\n SearchFilterState,\n} from \"../redux/SearchFilterRedux\";\nimport { useReducer, useState } from \"react\";\n\nexport const useLocalSearchFilterState = <\n TFormModel,\n TSectionKey extends string,\n>(\n initialState: SearchFilterState<TFormModel>,\n) => {\n const [reducer] = useState(() =>\n createSearchFilterReducer<TFormModel>(\"local\", initialState),\n );\n\n const [actions] = useState(() =>\n createSearchFilterActions<TFormModel, TSectionKey>(\n \"local\",\n initialState.formModel,\n ),\n );\n\n const [state, dispatch] = useReducer(reducer, initialState);\n\n return {\n actions,\n state,\n dispatch,\n };\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { useLocalSearchFilterState } from \"../../hooks/UseLocalSearchFilterState\";\nimport { SearchFilterContext } from \"./SearchFilterContext\";\nimport { createSearchFilterInitialState } from \"../../redux/SearchFilterRedux\";\n\ninterface SearchFilterLocalScopeProps<TFormModel> {\n initialFormModel: TFormModel;\n}\n\nexport const SearchFilterLocalStateContext = function SearchFilterLocalScope<\n TFormModel,\n>({\n initialFormModel,\n children,\n}: PropsWithChildren<SearchFilterLocalScopeProps<TFormModel>>) {\n const { state, actions, dispatch } = useLocalSearchFilterState(\n createSearchFilterInitialState(initialFormModel),\n );\n\n return (\n <SearchFilterContext state={state} actions={actions} dispatch={dispatch}>\n {children}\n </SearchFilterContext>\n );\n};\n","import * as React from \"react\";\nimport { Row, Text } from \"@stenajs-webui/core\";\nimport { ContentMenuButton } from \"@stenajs-webui/elements\";\nimport { Checkbox, CheckboxProps } from \"@stenajs-webui/forms\";\n\nexport interface FilterCheckboxProps extends CheckboxProps {\n label: string;\n}\n\nexport const FilterCheckbox: React.FC<FilterCheckboxProps> = ({\n label,\n ...checkboxProps\n}) => {\n return (\n <ContentMenuButton>\n <Row gap={2} alignItems={\"center\"} justifyContent={\"flex-start\"}>\n <Checkbox {...checkboxProps} />\n <Text>{label}</Text>\n </Row>\n </ContentMenuButton>\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { Column } from \"@stenajs-webui/core\";\n\nexport interface FilterCheckboxListProps extends PropsWithChildren {\n maxHeight?: string;\n}\n\nexport const FilterCheckboxList: React.FC<FilterCheckboxListProps> = ({\n children,\n maxHeight,\n}) => {\n return (\n <Column\n maxHeight={maxHeight}\n overflowY={maxHeight ? \"auto\" : undefined}\n spacing={1}\n >\n {children}\n </Column>\n );\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { FlatButton, stenaClean } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface SearchFilterChipsProps {\n disableClearAllButton?: boolean;\n children?: ReactNode;\n}\n\nexport const SearchFilterChips: React.FC<SearchFilterChipsProps> = ({\n children,\n disableClearAllButton = false,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickClearAll = useCallback(\n () => dispatch(actions.clearFormModel()),\n [actions, dispatch],\n );\n\n return (\n <Row flexWrap={\"wrap\"} alignItems={\"center\"} gap>\n {children}\n {!disableClearAllButton && (\n <FlatButton\n size={\"small\"}\n leftIcon={stenaClean}\n label={\"Clear\"}\n onClick={onClickClearAll}\n />\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface EmptyChipProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label: string;\n}\n\nexport const EmptyChip = function EmptyChip<TSectionKey extends string>({\n label,\n sectionId,\n}: EmptyChipProps<TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />;\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterSectionOnClickRemoveOnChip } from \"../../config/SearchFilterConfig\";\n\ninterface SearchFilterChipProps<TFormModel, TSectionKey> {\n sectionId: TSectionKey;\n label: string;\n value: string;\n onClickRemove?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SearchFilterChip = function SearchFilterChip<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n label,\n value,\n onClickRemove,\n}: SearchFilterChipProps<TFormModel, TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const setFormModelFields = useCallback(\n (fields: Partial<TFormModel>) =>\n dispatch(actions.setFormModelFields(fields)),\n [dispatch, actions],\n );\n\n const onClickRemoveHandler = useCallback(() => {\n onClickRemove?.({ value, setFormModelFields });\n }, [onClickRemove, setFormModelFields, value]);\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return (\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n );\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { EmptyChip } from \"./EmptyChip\";\nimport { SearchFilterChip } from \"./SearchFilterChip\";\n\nexport interface SectionChipsProps<TFormModel, TSectionKey extends string> {\n sectionId: TSectionKey;\n chips?: Array<SearchFilterSectionChipModel>;\n emptyChipLabel?: string;\n onClickRemoveOnChip?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SectionChips = function SectionChips<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n chips,\n emptyChipLabel,\n onClickRemoveOnChip,\n}: SectionChipsProps<TFormModel, TSectionKey>) {\n if (!chips?.length) {\n if (!emptyChipLabel) {\n return null;\n }\n return <EmptyChip sectionId={sectionId} label={emptyChipLabel} />;\n }\n\n return (\n <>\n {chips.map(({ label, value }) => (\n <SearchFilterChip\n key={value}\n label={label ?? sectionId}\n sectionId={sectionId}\n onClickRemove={onClickRemoveOnChip}\n value={value}\n />\n ))}\n </>\n );\n};\n","import { BooleanRecord, BooleanRecordOptions } from \"./BooleanRecordTypes\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue, truthyKeysAsList } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForBooleanRecord = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n options?: BooleanRecordOptions,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForBooleanRecord(\n formModel[fieldName] as unknown as BooleanRecord,\n options,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForBooleanRecord(\n formModel,\n fieldName,\n ),\n});\n\nexport const createChipsForBooleanRecord = (\n booleanRecord: BooleanRecord,\n options?: BooleanRecordOptions,\n): Array<SearchFilterSectionChipModel> =>\n truthyKeysAsList(booleanRecord).map((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n });\n\nexport const createOnClickRemoveOnChipForBooleanRecord = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields, value }) => {\n const newBooleanRecord = { ...formModel[fieldName] } as BooleanRecord;\n newBooleanRecord[value] = false;\n setFormModelFields({\n [fieldName]: newBooleanRecord,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { FilterCheckbox } from \"../../../features/filter-checkbox/FilterCheckbox\";\nimport { FilterCheckboxList } from \"../../../features/filter-checkbox/FilterCheckboxList\";\n\nexport interface SimpleCheckboxSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n options?: BooleanRecordOptions;\n}\n\nexport const SimpleCheckboxListSection = <TSectionKey extends string>({\n options,\n value,\n onValueChange,\n ...sectionProps\n}: SimpleCheckboxSectionProps<TSectionKey>): React.ReactElement => (\n <SearchFilterSection disableContentPadding {...sectionProps}>\n <FilterCheckboxList maxHeight={\"400px\"}>\n {options?.map((d) => (\n <FilterCheckbox\n key={d.value}\n value={value?.[d.value]}\n label={d.label}\n onValueChange={(v) =>\n onValueChange?.({\n ...value,\n [d.value]: v,\n })\n }\n />\n ))}\n </FilterCheckboxList>\n </SearchFilterSection>\n);\n","import * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { ChipMultiSelect, ChipMultiSelectValue } from \"@stenajs-webui/select\";\nimport { truthyKeysAsList } from \"@stenajs-webui/core\";\n\ninterface ChipMultiSelectSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n noneSelectedLabel?: string;\n options?: BooleanRecordOptions;\n}\n\nexport const ChipMultiSelectSection = <TSectionKey extends string>({\n options,\n value,\n noneSelectedLabel,\n onValueChange,\n ...sectionProps\n}: ChipMultiSelectSectionProps<TSectionKey>): React.ReactElement => {\n const [text, setText] = useState<string>(\"\");\n\n const listValue = useMemo<Array<ChipMultiSelectValue>>(\n () =>\n value\n ? truthyKeysAsList(value).map<ChipMultiSelectValue>((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n })\n : [],\n [options, value],\n );\n\n const filteredOptions = useMemo(() => {\n return options?.filter(\n (p) =>\n p.value.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1 ||\n p.label.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1,\n );\n }, [options, text]);\n\n const onValueChangeInternal = useCallback(\n (value: Array<ChipMultiSelectValue>) => {\n onValueChange?.(createBooleanRecordFromValue(value));\n },\n [onValueChange],\n );\n\n return (\n <SearchFilterSection {...sectionProps}>\n <ChipMultiSelect\n options={filteredOptions}\n value={listValue}\n onValueChange={onValueChangeInternal}\n inputValue={text}\n noneSelectedLabel={noneSelectedLabel}\n onInputChange={setText}\n closeMenuOnSelect={false}\n />\n </SearchFilterSection>\n );\n};\n\nconst createBooleanRecordFromValue = (\n value: Array<ChipMultiSelectValue>,\n): BooleanRecord => {\n return value.reduce<BooleanRecord>((sum, item) => {\n sum[item.value] = true;\n return sum;\n }, {});\n};\n","import {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForDateRange = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForDateRange(\n formModel[startDateFieldName] as unknown as string | undefined,\n formModel[endDateFieldName] as unknown as string | undefined,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForDateRange(\n startDateFieldName,\n endDateFieldName,\n ),\n});\n\nexport const createChipsForDateRange = (\n startDate: string | undefined,\n endDate: string | undefined,\n): Array<SearchFilterSectionChipModel> => {\n if (!startDate && !endDate) {\n return [];\n }\n return [\n { value: \"dateRange\", label: `${startDate ?? \"\"} - ${endDate ?? \"\"}` },\n ];\n};\n\nexport const createOnClickRemoveOnChipForDateRange = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n startDateFieldName: TField,\n endDateFieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields }) => {\n setFormModelFields({\n [startDateFieldName]: undefined,\n [endDateFieldName]: undefined,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import { PickByValue } from \"@stenajs-webui/core\";\nimport { DateRangeCalendarSectionProps } from \"./components/DateRangeCalendarSection\";\n\nexport const createDateRangeSectionProps = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n TSectionKey extends string,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n DateRangeCalendarSectionProps<TFormModel, TSectionKey>,\n \"value\" | \"onValueChange\"\n> => ({\n value: {\n startDate: formModel[startDateFieldName] as unknown as string | undefined,\n endDate: formModel[endDateFieldName] as unknown as string | undefined,\n },\n /* eslint-disable @typescript-eslint/no-explicit-any */\n onValueChange: (value, { dispatch, actions }) => {\n const fields: Partial<TFormModel> = {\n [startDateFieldName]: value.startDate,\n [endDateFieldName]: value.endDate,\n } as any;\n dispatch(actions.setFormModelFields(fields));\n },\n});\n","import {\n DateRange,\n DateRangeCalendar,\n DateRangeCalendarProps,\n DateRangeFocusedInput,\n dateRangeToStrings,\n DateStringRange,\n stringsToDateRange,\n} from \"@stenajs-webui/calendar\";\nimport * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { Box } from \"@stenajs-webui/core\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n} from \"../../../redux/SearchFilterRedux\";\nimport { useSearchFilterDispatch } from \"../../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../../context/SearchFilterActionsContext\";\n\nexport interface DateRangeCalendarSectionProps<\n TFormModel,\n TSectionKey extends string,\n>\n extends\n Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<unknown>,\n \"value\" | \"onValueChange\" | \"focusedInput\" | \"setFocusedInput\"\n > {\n value: DateStringRange;\n onValueChange: (\n value: DateStringRange,\n options: SetDateOptions<TFormModel, TSectionKey>,\n ) => void;\n label?: string;\n}\n\nexport interface SetDateOptions<TFormModel, TSectionKey extends string> {\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const DateRangeCalendarSection = <\n TFormModel,\n TSectionKey extends string,\n>({\n value,\n onValueChange,\n sectionId,\n contentRight,\n disableContentPadding,\n label,\n leftIcon,\n ...dateRangeCalendarProps\n}: DateRangeCalendarSectionProps<TFormModel, TSectionKey>) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions<TFormModel, TSectionKey>();\n\n const options = useMemo<SetDateOptions<TFormModel, TSectionKey>>(\n () => ({ dispatch, actions }),\n [actions, dispatch],\n );\n const [focusedInput, setFocusedInput] =\n useState<DateRangeFocusedInput>(\"startDate\");\n\n const dateRangeValue = useMemo(() => stringsToDateRange(value), [value]);\n\n const onValueChangeHandler = useCallback(\n (value: DateRange) => {\n onValueChange(dateRangeToStrings(value), options);\n },\n [onValueChange, options],\n );\n\n return (\n <SearchFilterSection\n label={label}\n leftIcon={leftIcon}\n sectionId={sectionId}\n contentRight={contentRight}\n disableContentPadding={disableContentPadding}\n >\n <Box flex={1} alignItems={\"center\"}>\n <Box background={\"white\"} indent>\n <DateRangeCalendar\n setFocusedInput={setFocusedInput}\n focusedInput={focusedInput}\n value={dateRangeValue}\n onValueChange={onValueChangeHandler}\n {...dateRangeCalendarProps}\n />\n </Box>\n </Box>\n </SearchFilterSection>\n );\n};\n"],"names":["SearchFilterPanelHeader","header","props","jsx","DrawerHeader","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","closeButtonAriaLabel","drawerProps","open","dispatch","actions","closeDrawer","useCallback","Drawer","jsxs","Column","cssColor","Box","SearchFilterButton","label","leftIcon","stenaSlidersMini","onClickButton","SecondaryButton","SearchFilterSection","sectionId","loading","error","onRetry","disableContentPadding","contentRight","state","expanded","onClickLabel","activeLabel","formatColumnIdToHeaderCellLabel","Fragment","MenuButton","Row","Spinner","Banner","FlatButton","Space","columnId","upperFirst","lowerCase","StickyFooter","boxProps","SearchFilterModelContext","useSearchFilterModel","SearchFilterContext","createSearchFilterInitialState","initialFormModel","createSearchFilterReducer","reducerId","initialState","combineReducers","reducerIdGate","getReducerIdFor","createValueByIdReducer","createEntityReducer","createSearchFilterActions","reducerIdGateAction","createEntityActions","fields","section","createValueByIdActions","reducerIdSuffix","useLocalSearchFilterState","reducer","useState","useReducer","SearchFilterLocalStateContext","FilterCheckbox","checkboxProps","ContentMenuButton","Checkbox","Text","FilterCheckboxList","maxHeight","SearchFilterChips","disableClearAllButton","onClickClearAll","stenaClean","EmptyChip","Chip","SearchFilterChip","value","onClickRemove","setFormModelFields","onClickRemoveHandler","SectionChips","chips","emptyChipLabel","onClickRemoveOnChip","createChipsPropsForBooleanRecord","formModel","fieldName","options","createChipsForBooleanRecord","createOnClickRemoveOnChipForBooleanRecord","booleanRecord","truthyKeysAsList","key","option","o","newBooleanRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","v","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","filteredOptions","p","onValueChangeInternal","createBooleanRecordFromValue","ChipMultiSelect","sum","item","createChipsPropsForDateRange","startDateFieldName","endDateFieldName","createChipsForDateRange","createOnClickRemoveOnChipForDateRange","startDate","endDate","createDateRangeSectionProps","DateRangeCalendarSection","dateRangeCalendarProps","focusedInput","setFocusedInput","dateRangeValue","stringsToDateRange","onValueChangeHandler","dateRangeToStrings","DateRangeCalendar"],"mappings":";;;;;;;;;;;;AAeO,MAAMA,KAET,CAAC,EAAE,QAAAC,IAAS,UAAU,GAAGC,QACpB,gBAAAC,EAACC,GAAA,EAAc,GAAGF,GAAO,QAAAD,EAAA,CAAgB,GCfrCI,IAA2BC,EAEtC,IAA6C,GAElCC,IAAuB,MAEE;AACpC,QAAMC,IAAIC,EAAWJ,CAAwB;AAC7C,MAAI,CAACG;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGJ,SAAOA;AACT,GCdaE,IAA8BJ,EAEzC,IAAgD,GAErCK,IAA0B,MAAM;AAC3C,QAAMH,IAAIC,EAAWC,CAA2B;AAChD,MAAI,CAACF;AACH,UAAM,IAAI,MAAM,yCAAyC;AAE3D,SAAOA;AACT,GCTaI,IAA6BN,EAExC,IAAoD,GAEzCO,IAAyB,MAG/B;AACL,QAAML,IAAIC,EAAWG,CAA0B;AAC/C,MAAI,CAACJ;AACH,UAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAOA;AACT,GCqBaM,KAAwD,CAAC;AAAA,EACpE,UAAAC;AAAA,EACA,QAAAd;AAAA,EACA,oBAAAe;AAAA,EACA,sBAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM;AAAA,IACJ,UAAU,EAAE,MAAAC,EAAA;AAAA,EAAK,IACfZ,EAAA,GACEa,IAAWT,EAAA,GACXU,IAAUR,EAAA,GAEVS,IAAcC,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A,UACd,GAAGL;AAAA,QAAA;AAAA,MAAA,GAER,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),a=require("react"),E=require("@stenajs-webui/modal"),Q=require("@stenajs-webui/theme"),d=require("@stenajs-webui/core"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),a=require("react"),E=require("@stenajs-webui/modal"),Q=require("@stenajs-webui/theme"),d=require("@stenajs-webui/core"),x=require("@stenajs-webui/elements"),L=require("lodash-es"),U=require("redux"),l=require("@stenajs-webui/redux"),X=require("@stenajs-webui/forms"),Z=require("@stenajs-webui/select"),v=require("@stenajs-webui/calendar"),D=({header:e="Filter",...t})=>o.jsx(E.DrawerHeader,{...t,header:e}),w=a.createContext(null),M=()=>{const e=a.useContext(w);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},y=a.createContext(null),F=()=>{const e=a.useContext(y);if(!e)throw new Error("Missing search filter dispatch context.");return e},A=a.createContext(null),g=()=>{const e=a.useContext(A);if(!e)throw new Error("Missing search filter actions context.");return e},_=({children:e,header:t,headerContentRight:n,closeButtonAriaLabel:r,...c})=>{const{settings:{open:s}}=M(),i=F(),h=g(),C=a.useCallback(()=>{i(h.closeFilters())},[h,i]);return o.jsx(E.Drawer,{floating:!0,isOpen:s,onRequestClose:C,...c,children:o.jsxs(d.Column,{height:"100%",borderRadius:"var(--swui-border-radius)",background:Q.cssColor("--lhds-color-ui-50"),children:[o.jsx(D,{onRequestClose:C,header:t,contentRight:n,closeButtonAriaLabel:r}),o.jsx(d.Box,{spacing:1,indent:1,gap:1,children:e})]})})},N=({label:e="Filters",leftIcon:t=x.stenaSlidersMini})=>{const n=F(),r=g(),c=a.useCallback(()=>{n(r.openFilters())},[r,n]);return o.jsx(x.SecondaryButton,{label:e,leftIcon:t,onClick:c})},b=function({sectionId:t,label:n,loading:r,error:c,onRetry:s,disableContentPadding:i,children:h,leftIcon:C,contentRight:S}){const u=M(),f=F(),R=g(),m=u.expandedSections.values[t]??!1,j=a.useCallback(()=>{f(R.setSectionExpanded(t,!m))},[R,f,m,t]),k=n??V(t);return o.jsxs(o.Fragment,{children:[o.jsx(x.MenuButton,{label:k,leftIcon:C,expandable:!0,expanded:m,selected:m,onClick:j,right:S,children:r?o.jsx(d.Row,{spacing:!0,justifyContent:"center",flex:1,children:o.jsx(x.Spinner,{size:"small"})}):c?o.jsx(x.Banner,{variant:"error",text:c,contentRight:s?o.jsx(x.FlatButton,{label:"Retry",onClick:s}):null}):h}),m&&o.jsx(d.Space,{})]})},V=e=>L.upperFirst(L.lowerCase(e)),ee=({children:e,...t})=>o.jsx(d.Column,{style:{marginTop:"auto"},justifyContent:"center",spacing:2,indent:!0,shadow:"popover",zIndex:1,...t,children:e}),B=a.createContext(null),te=()=>{const e=a.useContext(B);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},O=function({state:t,dispatch:n,actions:r,children:c}){return o.jsx(y.Provider,{value:n,children:o.jsx(A.Provider,{value:r,children:o.jsx(w.Provider,{value:t,children:o.jsx(B.Provider,{value:t.formModel,children:c})})})})},q=e=>({settings:{open:!1},formModel:e,expandedSections:{values:{}}}),I=(e,t)=>U.combineReducers({expandedSections:l.reducerIdGate(p(e,"expandedSections"),l.createValueByIdReducer(t.expandedSections)),formModel:l.reducerIdGate(p(e,"formModel"),l.createEntityReducer(t.formModel)),settings:l.reducerIdGate(p(e,"settings"),l.createEntityReducer(t.settings))}),P=(e,t)=>({openFilters:()=>l.reducerIdGateAction(p(e,"settings"),l.createEntityActions().setEntityFields({open:!0})),closeFilters:()=>l.reducerIdGateAction(p(e,"settings"),l.createEntityActions().setEntityFields({open:!1})),setFormModelFields:n=>l.reducerIdGateAction(p(e,"formModel"),l.createEntityActions().setEntityFields(n)),clearFormModel:()=>l.reducerIdGateAction(p(e,"formModel"),l.createEntityActions().setEntity(t)),expandSection:n=>l.reducerIdGateAction(p(e,"expandedSections"),l.createValueByIdActions().setValue(n,!0)),collapseSection:n=>l.reducerIdGateAction(p(e,"expandedSections"),l.createValueByIdActions().setValue(n,!1)),setSectionExpanded:(n,r)=>l.reducerIdGateAction(p(e,"expandedSections"),l.createValueByIdActions().setValue(n,r)),clearExpandedSections:()=>l.reducerIdGateAction(p(e,"expandedSections"),l.createValueByIdActions().clearAllValues())}),p=(e,t)=>`${e}.${t}`,G=e=>{const[t]=a.useState(()=>I("local",e)),[n]=a.useState(()=>P("local",e.formModel)),[r,c]=a.useReducer(t,e);return{actions:n,state:r,dispatch:c}},ne=function({initialFormModel:t,children:n}){const{state:r,actions:c,dispatch:s}=G(q(t));return o.jsx(O,{state:r,actions:c,dispatch:s,children:n})},T=({label:e,...t})=>o.jsx(x.ContentMenuButton,{children:o.jsxs(d.Row,{gap:2,alignItems:"center",justifyContent:"flex-start",children:[o.jsx(X.Checkbox,{...t}),o.jsx(d.Text,{children:e})]})}),H=({children:e,maxHeight:t})=>o.jsx(d.Column,{maxHeight:t,overflowY:t?"auto":void 0,spacing:1,children:e}),re=({children:e,disableClearAllButton:t=!1})=>{const n=F(),r=g(),c=a.useCallback(()=>n(r.clearFormModel()),[r,n]);return o.jsxs(d.Row,{flexWrap:"wrap",alignItems:"center",gap:!0,children:[e,!t&&o.jsx(x.FlatButton,{size:"small",leftIcon:x.stenaClean,label:"Clear",onClick:c})]})},$=function({label:t,sectionId:n}){const r=F(),c=g(),s=a.useCallback(()=>{r(c.clearExpandedSections()),r(c.expandSection(n)),r(c.openFilters())},[c,r,n]);return o.jsx(x.Chip,{label:t,variant:"secondary",onClick:s})},z=function({sectionId:t,label:n,value:r,onClickRemove:c}){const s=F(),i=g(),h=a.useCallback(u=>s(i.setFormModelFields(u)),[s,i]),C=a.useCallback(()=>{c?.({value:r,setFormModelFields:h})},[c,h,r]),S=a.useCallback(()=>{s(i.clearExpandedSections()),s(i.expandSection(t)),s(i.openFilters())},[i,s,t]);return o.jsx(x.Chip,{label:n??t,onClick:S,onClickRemove:c?C:void 0})},oe=function({sectionId:t,chips:n,emptyChipLabel:r,onClickRemoveOnChip:c}){return n?.length?o.jsx(o.Fragment,{children:n.map(({label:s,value:i})=>o.jsx(z,{label:s??t,sectionId:t,onClickRemove:c,value:i},i))}):r?o.jsx($,{sectionId:t,label:r}):null},ce=(e,t,n)=>({chips:K(e[t],n),onClickRemoveOnChip:W(e,t)}),K=(e,t)=>d.truthyKeysAsList(e).map(n=>{const r=t?.find(c=>c.value===n);return{value:n,label:r?.label??n}}),W=(e,t)=>({setFormModelFields:n,value:r})=>{const c={...e[t]};c[r]=!1,n({[t]:c})},se=({options:e,value:t,onValueChange:n,...r})=>o.jsx(b,{disableContentPadding:!0,...r,children:o.jsx(H,{maxHeight:"400px",children:e?.map(c=>o.jsx(T,{value:t?.[c.value],label:c.label,onValueChange:s=>n?.({...t,[c.value]:s})},c.value))})}),ae=({options:e,value:t,noneSelectedLabel:n,onValueChange:r,...c})=>{const[s,i]=a.useState(""),h=a.useMemo(()=>t?d.truthyKeysAsList(t).map(u=>{const f=e?.find(R=>R.value===u);return{value:u,label:f?.label??u}}):[],[e,t]),C=a.useMemo(()=>e?.filter(u=>u.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase())>-1||u.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase())>-1),[e,s]),S=a.useCallback(u=>{r?.(le(u))},[r]);return o.jsx(b,{...c,children:o.jsx(Z.ChipMultiSelect,{options:C,value:h,onValueChange:S,inputValue:s,noneSelectedLabel:n,onInputChange:i,closeMenuOnSelect:!1})})},le=e=>e.reduce((t,n)=>(t[n.value]=!0,t),{}),ie=(e,t,n)=>({chips:Y(e[t],e[n]),onClickRemoveOnChip:J(t,n)}),Y=(e,t)=>!e&&!t?[]:[{value:"dateRange",label:`${e??""} - ${t??""}`}],J=(e,t)=>({setFormModelFields:n})=>{n({[e]:void 0,[t]:void 0})},ue=(e,t,n)=>({value:{startDate:e[t],endDate:e[n]},onValueChange:(r,{dispatch:c,actions:s})=>{const i={[t]:r.startDate,[n]:r.endDate};c(s.setFormModelFields(i))}}),de=({value:e,onValueChange:t,sectionId:n,contentRight:r,disableContentPadding:c,label:s,leftIcon:i,...h})=>{const C=F(),S=g(),u=a.useMemo(()=>({dispatch:C,actions:S}),[S,C]),[f,R]=a.useState("startDate"),m=a.useMemo(()=>v.stringsToDateRange(e),[e]),j=a.useCallback(k=>{t(v.dateRangeToStrings(k),u)},[t,u]);return o.jsx(b,{label:s,leftIcon:i,sectionId:n,contentRight:r,disableContentPadding:c,children:o.jsx(d.Box,{flex:1,alignItems:"center",children:o.jsx(d.Box,{background:"white",indent:!0,children:o.jsx(v.DateRangeCalendar,{setFocusedInput:R,focusedInput:f,value:m,onValueChange:j,...h})})})})};exports.ChipMultiSelectSection=ae;exports.DateRangeCalendarSection=de;exports.EmptyChip=$;exports.FilterCheckbox=T;exports.FilterCheckboxList=H;exports.SearchFilterActionsContext=A;exports.SearchFilterButton=N;exports.SearchFilterChip=z;exports.SearchFilterChips=re;exports.SearchFilterContext=O;exports.SearchFilterDispatchContext=y;exports.SearchFilterDrawer=_;exports.SearchFilterLocalStateContext=ne;exports.SearchFilterModelContext=B;exports.SearchFilterPanelHeader=D;exports.SearchFilterSection=b;exports.SearchFilterStateContext=w;exports.SectionChips=oe;exports.SimpleCheckboxListSection=se;exports.StickyFooter=ee;exports.createChipsForBooleanRecord=K;exports.createChipsForDateRange=Y;exports.createChipsPropsForBooleanRecord=ce;exports.createChipsPropsForDateRange=ie;exports.createDateRangeSectionProps=ue;exports.createOnClickRemoveOnChipForBooleanRecord=W;exports.createOnClickRemoveOnChipForDateRange=J;exports.createSearchFilterActions=P;exports.createSearchFilterInitialState=q;exports.createSearchFilterReducer=I;exports.formatColumnIdToHeaderCellLabel=V;exports.getReducerIdFor=p;exports.useLocalSearchFilterState=G;exports.useSearchFilterActions=g;exports.useSearchFilterDispatch=F;exports.useSearchFilterModel=te;exports.useSearchFilterState=M;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/features/search-filter/components/SearchFilterPanelHeader.tsx","../src/features/search-filter/context/SearchFilterStateContext.ts","../src/features/search-filter/context/SearchFilterDispatchContext.ts","../src/features/search-filter/context/SearchFilterActionsContext.ts","../src/features/search-filter/components/SearchFilterDrawer.tsx","../src/features/search-filter/components/SearchFilterButton.tsx","../src/features/search-filter/components/SearchFilterSection.tsx","../src/features/search-filter/components/StickyFooter.tsx","../src/features/search-filter/context/SearchFilterModelContext.ts","../src/features/search-filter/components/context/SearchFilterContext.tsx","../src/features/search-filter/redux/SearchFilterRedux.ts","../src/features/search-filter/hooks/UseLocalSearchFilterState.ts","../src/features/search-filter/components/context/SearchFilterLocalStateContext.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckbox.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckboxList.tsx","../src/features/search-filter/features/chips/SearchFilterChips.tsx","../src/features/search-filter/features/chips/EmptyChip.tsx","../src/features/search-filter/features/chips/SearchFilterChip.tsx","../src/features/search-filter/features/chips/SectionChips.tsx","../src/features/search-filter/section-factories/boolean-record/BooleanRecordChips.ts","../src/features/search-filter/section-factories/boolean-record/components/SimpleCheckboxListSection.tsx","../src/features/search-filter/section-factories/boolean-record/components/ChipMultiSelectSection.tsx","../src/features/search-filter/section-factories/date-range/DateRangeChips.ts","../src/features/search-filter/section-factories/date-range/DateRangePropsFactory.ts","../src/features/search-filter/section-factories/date-range/components/DateRangeCalendarSection.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport { DrawerHeader } from \"@stenajs-webui/modal\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n contentRight?: ReactNode;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({ header = \"Filter\", ...props }) => {\n return <DrawerHeader {...props} header={header} />;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterState } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterStateContext = createContext<\n SearchFilterState<unknown>\n>(null as unknown as SearchFilterState<unknown>);\n\nexport const useSearchFilterState = <\n TFormModel,\n>(): SearchFilterState<TFormModel> => {\n const c = useContext(SearchFilterStateContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as SearchFilterState<TFormModel>;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterDispatch } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterDispatchContext = createContext<\n SearchFilterDispatch<unknown>\n>(null as unknown as SearchFilterDispatch<unknown>);\n\nexport const useSearchFilterDispatch = () => {\n const c = useContext(SearchFilterDispatchContext);\n if (!c) {\n throw new Error(\"Missing search filter dispatch context.\");\n }\n return c;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterActions } from \"../redux/SearchFilterRedux\";\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const SearchFilterActionsContext = createContext<\n SearchFilterActions<unknown, any>\n>(null as unknown as SearchFilterActions<unknown, any>);\n\nexport const useSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>() => {\n const c = useContext(SearchFilterActionsContext);\n if (!c) {\n throw new Error(\"Missing search filter actions context.\");\n }\n return c as SearchFilterActions<TFormModel, TSectionKey>;\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport {\n Drawer,\n DrawerBaseLeftRight,\n DrawerBaseTopBottom,\n} from \"@stenajs-webui/modal\";\nimport { cssColor } from \"@stenajs-webui/theme\";\nimport { Box, Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport type SearchFilterDrawerProps =\n | SearchFilterDrawerLeftRightProps\n | SearchFilterDrawerTopBottomProps;\n\ninterface SearchFilterDrawerCommonProps {\n header?: string;\n headerContentRight?: ReactNode;\n}\n\ninterface SearchFilterDrawerLeftRightProps\n extends\n Omit<DrawerBaseLeftRight, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\ninterface SearchFilterDrawerTopBottomProps\n extends\n Omit<DrawerBaseTopBottom, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerContentRight,\n ...drawerProps\n}) => {\n const {\n settings: { open },\n } = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const closeDrawer = useCallback(() => {\n dispatch(actions.closeFilters());\n }, [actions, dispatch]);\n\n return (\n <Drawer\n floating\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column\n height={\"100%\"}\n borderRadius={\"var(--swui-border-radius)\"}\n background={cssColor(\"--lhds-color-ui-50\")}\n >\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n contentRight={headerContentRight}\n />\n <Box spacing={1} indent={1} gap={1}>\n {children}\n </Box>\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSlidersMini } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSlidersMini,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickButton = useCallback(() => {\n dispatch(actions.openFilters());\n }, [actions, dispatch]);\n\n return (\n <SecondaryButton\n label={label}\n leftIcon={leftIcon}\n onClick={onClickButton}\n />\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren, useCallback } from \"react\";\nimport { Row, Space } from \"@stenajs-webui/core\";\nimport { lowerCase, upperFirst } from \"lodash-es\";\nimport {\n Banner,\n FlatButton,\n MenuButton,\n Spinner,\n} from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label?: string;\n leftIcon?: IconDefinition;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string,\n>({\n sectionId,\n label,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\n leftIcon,\n contentRight,\n}: PropsWithChildren<SearchFilterSectionProps<TSectionKey>>) {\n const state = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const expanded = state.expandedSections.values[sectionId] ?? false;\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.setSectionExpanded(sectionId, !expanded));\n }, [actions, dispatch, expanded, sectionId]);\n\n const activeLabel = label ?? formatColumnIdToHeaderCellLabel(sectionId);\n\n return (\n <>\n <MenuButton\n label={activeLabel}\n leftIcon={leftIcon}\n expandable\n expanded={expanded}\n selected={expanded}\n onClick={onClickLabel}\n right={contentRight}\n >\n {loading ? (\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n ) : error ? (\n <Banner\n variant={\"error\"}\n text={error}\n contentRight={\n onRetry ? <FlatButton label={\"Retry\"} onClick={onRetry} /> : null\n }\n />\n ) : disableContentPadding ? (\n children\n ) : (\n children\n )}\n </MenuButton>\n {expanded && <Space />}\n </>\n );\n};\n\nexport const formatColumnIdToHeaderCellLabel = (columnId: string): string =>\n upperFirst(lowerCase(columnId));\n","import { BoxProps, Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface StickySearchButtonProps extends Pick<BoxProps, \"gap\"> {\n children?: ReactNode;\n}\n\nexport const StickyFooter: React.FC<StickySearchButtonProps> = ({\n children,\n ...boxProps\n}) => {\n return (\n <Column\n style={{ marginTop: \"auto\" }}\n justifyContent={\"center\"}\n spacing={2}\n indent\n shadow={\"popover\"}\n zIndex={1}\n {...boxProps}\n >\n {children}\n </Column>\n );\n};\n","import { createContext, useContext } from \"react\";\n\nexport const SearchFilterModelContext = createContext<unknown>(null as unknown);\n\nexport const useSearchFilterModel = <TFormModel>(): TFormModel => {\n const c = useContext(SearchFilterModelContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as TFormModel;\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n SearchFilterState,\n} from \"../../redux/SearchFilterRedux\";\nimport { SearchFilterDispatchContext } from \"../../context/SearchFilterDispatchContext\";\nimport { SearchFilterActionsContext } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterStateContext } from \"../../context/SearchFilterStateContext\";\nimport { SearchFilterModelContext } from \"../../context/SearchFilterModelContext\";\n\ninterface SearchFilterScopeProps<TFormModel, TSectionKey extends string> {\n state: SearchFilterState<TFormModel>;\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const SearchFilterContext = function SearchFilterScope<\n TFormModel,\n TSectionKey extends string,\n>({\n state,\n dispatch,\n actions,\n children,\n}: PropsWithChildren<SearchFilterScopeProps<TFormModel, TSectionKey>>) {\n return (\n <SearchFilterDispatchContext.Provider\n value={dispatch as SearchFilterDispatch<unknown>}\n >\n <SearchFilterActionsContext.Provider value={actions}>\n <SearchFilterStateContext.Provider value={state}>\n <SearchFilterModelContext.Provider value={state.formModel}>\n {children}\n </SearchFilterModelContext.Provider>\n </SearchFilterStateContext.Provider>\n </SearchFilterActionsContext.Provider>\n </SearchFilterDispatchContext.Provider>\n );\n};\n","import { combineReducers } from \"redux\";\nimport {\n createEntityActions,\n createEntityReducer,\n createValueByIdActions,\n createValueByIdReducer,\n EntityAction,\n EntityState,\n reducerIdGate,\n reducerIdGateAction,\n ReducerIdGateAction,\n ValueByIdAction,\n ValueByIdState,\n} from \"@stenajs-webui/redux\";\nimport { Dispatch } from \"react\";\n\nexport interface SearchFilterSettings {\n open: boolean;\n}\n\nexport type SearchFilterDispatch<TFormModel> = Dispatch<\n SearchFilterAction<TFormModel>\n>;\n\nexport interface SearchFilterState<TFormModel> {\n expandedSections: ValueByIdState<boolean>;\n formModel: EntityState<TFormModel>;\n settings: EntityState<SearchFilterSettings>;\n}\n\nexport type SearchFilterAction<TFormModel> =\n | ReducerIdGateAction<ValueByIdAction<boolean>>\n | ReducerIdGateAction<EntityAction<TFormModel>>\n | ReducerIdGateAction<EntityAction<SearchFilterSettings>>;\n\nexport const createSearchFilterInitialState = <TFormModel>(\n initialFormModel: TFormModel,\n): SearchFilterState<TFormModel> => ({\n settings: {\n open: false,\n },\n formModel: initialFormModel,\n expandedSections: { values: {} },\n});\n\nexport const createSearchFilterReducer = <TFormModel>(\n reducerId: string,\n initialState: SearchFilterState<TFormModel>,\n) =>\n combineReducers({\n expandedSections: reducerIdGate(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdReducer<boolean>(initialState.expandedSections),\n ),\n formModel: reducerIdGate(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityReducer<TFormModel>(initialState.formModel),\n ),\n settings: reducerIdGate(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityReducer<SearchFilterSettings>(initialState.settings),\n ),\n });\n\nexport interface SearchFilterActions<TFormModel, TSectionKey extends string> {\n openFilters: () => SearchFilterAction<TFormModel>;\n closeFilters: () => SearchFilterAction<TFormModel>;\n setFormModelFields: (\n fields: Partial<TFormModel>,\n ) => SearchFilterAction<TFormModel>;\n clearFormModel: () => SearchFilterAction<TFormModel>;\n expandSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n collapseSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n setSectionExpanded: (\n section: TSectionKey,\n expanded: boolean,\n ) => SearchFilterAction<TFormModel>;\n clearExpandedSections: () => SearchFilterAction<TFormModel>;\n}\n\nexport const createSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>(\n reducerId: string,\n initialFormModel: TFormModel,\n): SearchFilterActions<TFormModel, TSectionKey> => ({\n openFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: true,\n }),\n ),\n closeFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: false,\n }),\n ),\n setFormModelFields: (fields: Partial<TFormModel>) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntityFields(fields),\n ),\n clearFormModel: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntity(initialFormModel),\n ),\n expandSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, true),\n ),\n collapseSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, false),\n ),\n setSectionExpanded: (section: TSectionKey, expanded: boolean) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, expanded),\n ),\n clearExpandedSections: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().clearAllValues(),\n ),\n});\n\nexport const getReducerIdFor = (\n reducerId: string,\n reducerIdSuffix: keyof SearchFilterState<unknown>,\n): string => `${reducerId}.${reducerIdSuffix}`;\n","import {\n createSearchFilterActions,\n createSearchFilterReducer,\n SearchFilterState,\n} from \"../redux/SearchFilterRedux\";\nimport { useReducer, useState } from \"react\";\n\nexport const useLocalSearchFilterState = <\n TFormModel,\n TSectionKey extends string,\n>(\n initialState: SearchFilterState<TFormModel>,\n) => {\n const [reducer] = useState(() =>\n createSearchFilterReducer<TFormModel>(\"local\", initialState),\n );\n\n const [actions] = useState(() =>\n createSearchFilterActions<TFormModel, TSectionKey>(\n \"local\",\n initialState.formModel,\n ),\n );\n\n const [state, dispatch] = useReducer(reducer, initialState);\n\n return {\n actions,\n state,\n dispatch,\n };\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { useLocalSearchFilterState } from \"../../hooks/UseLocalSearchFilterState\";\nimport { SearchFilterContext } from \"./SearchFilterContext\";\nimport { createSearchFilterInitialState } from \"../../redux/SearchFilterRedux\";\n\ninterface SearchFilterLocalScopeProps<TFormModel> {\n initialFormModel: TFormModel;\n}\n\nexport const SearchFilterLocalStateContext = function SearchFilterLocalScope<\n TFormModel,\n>({\n initialFormModel,\n children,\n}: PropsWithChildren<SearchFilterLocalScopeProps<TFormModel>>) {\n const { state, actions, dispatch } = useLocalSearchFilterState(\n createSearchFilterInitialState(initialFormModel),\n );\n\n return (\n <SearchFilterContext state={state} actions={actions} dispatch={dispatch}>\n {children}\n </SearchFilterContext>\n );\n};\n","import * as React from \"react\";\nimport { Row, Text } from \"@stenajs-webui/core\";\nimport { ContentMenuButton } from \"@stenajs-webui/elements\";\nimport { Checkbox, CheckboxProps } from \"@stenajs-webui/forms\";\n\nexport interface FilterCheckboxProps extends CheckboxProps {\n label: string;\n}\n\nexport const FilterCheckbox: React.FC<FilterCheckboxProps> = ({\n label,\n ...checkboxProps\n}) => {\n return (\n <ContentMenuButton>\n <Row gap={2} alignItems={\"center\"} justifyContent={\"flex-start\"}>\n <Checkbox {...checkboxProps} />\n <Text>{label}</Text>\n </Row>\n </ContentMenuButton>\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { Column } from \"@stenajs-webui/core\";\n\nexport interface FilterCheckboxListProps extends PropsWithChildren {\n maxHeight?: string;\n}\n\nexport const FilterCheckboxList: React.FC<FilterCheckboxListProps> = ({\n children,\n maxHeight,\n}) => {\n return (\n <Column\n maxHeight={maxHeight}\n overflowY={maxHeight ? \"auto\" : undefined}\n spacing={1}\n >\n {children}\n </Column>\n );\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { FlatButton, stenaClean } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface SearchFilterChipsProps {\n disableClearAllButton?: boolean;\n children?: ReactNode;\n}\n\nexport const SearchFilterChips: React.FC<SearchFilterChipsProps> = ({\n children,\n disableClearAllButton = false,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickClearAll = useCallback(\n () => dispatch(actions.clearFormModel()),\n [actions, dispatch],\n );\n\n return (\n <Row flexWrap={\"wrap\"} alignItems={\"center\"} gap>\n {children}\n {!disableClearAllButton && (\n <FlatButton\n size={\"small\"}\n leftIcon={stenaClean}\n label={\"Clear\"}\n onClick={onClickClearAll}\n />\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface EmptyChipProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label: string;\n}\n\nexport const EmptyChip = function EmptyChip<TSectionKey extends string>({\n label,\n sectionId,\n}: EmptyChipProps<TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />;\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterSectionOnClickRemoveOnChip } from \"../../config/SearchFilterConfig\";\n\ninterface SearchFilterChipProps<TFormModel, TSectionKey> {\n sectionId: TSectionKey;\n label: string;\n value: string;\n onClickRemove?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SearchFilterChip = function SearchFilterChip<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n label,\n value,\n onClickRemove,\n}: SearchFilterChipProps<TFormModel, TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const setFormModelFields = useCallback(\n (fields: Partial<TFormModel>) =>\n dispatch(actions.setFormModelFields(fields)),\n [dispatch, actions],\n );\n\n const onClickRemoveHandler = useCallback(() => {\n onClickRemove?.({ value, setFormModelFields });\n }, [onClickRemove, setFormModelFields, value]);\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return (\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n );\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { EmptyChip } from \"./EmptyChip\";\nimport { SearchFilterChip } from \"./SearchFilterChip\";\n\nexport interface SectionChipsProps<TFormModel, TSectionKey extends string> {\n sectionId: TSectionKey;\n chips?: Array<SearchFilterSectionChipModel>;\n emptyChipLabel?: string;\n onClickRemoveOnChip?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SectionChips = function SectionChips<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n chips,\n emptyChipLabel,\n onClickRemoveOnChip,\n}: SectionChipsProps<TFormModel, TSectionKey>) {\n if (!chips?.length) {\n if (!emptyChipLabel) {\n return null;\n }\n return <EmptyChip sectionId={sectionId} label={emptyChipLabel} />;\n }\n\n return (\n <>\n {chips.map(({ label, value }) => (\n <SearchFilterChip\n key={value}\n label={label ?? sectionId}\n sectionId={sectionId}\n onClickRemove={onClickRemoveOnChip}\n value={value}\n />\n ))}\n </>\n );\n};\n","import { BooleanRecord, BooleanRecordOptions } from \"./BooleanRecordTypes\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue, truthyKeysAsList } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForBooleanRecord = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n options?: BooleanRecordOptions,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForBooleanRecord(\n formModel[fieldName] as unknown as BooleanRecord,\n options,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForBooleanRecord(\n formModel,\n fieldName,\n ),\n});\n\nexport const createChipsForBooleanRecord = (\n booleanRecord: BooleanRecord,\n options?: BooleanRecordOptions,\n): Array<SearchFilterSectionChipModel> =>\n truthyKeysAsList(booleanRecord).map((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n });\n\nexport const createOnClickRemoveOnChipForBooleanRecord = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields, value }) => {\n const newBooleanRecord = { ...formModel[fieldName] } as BooleanRecord;\n newBooleanRecord[value] = false;\n setFormModelFields({\n [fieldName]: newBooleanRecord,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { FilterCheckbox } from \"../../../features/filter-checkbox/FilterCheckbox\";\nimport { FilterCheckboxList } from \"../../../features/filter-checkbox/FilterCheckboxList\";\n\nexport interface SimpleCheckboxSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n options?: BooleanRecordOptions;\n}\n\nexport const SimpleCheckboxListSection = <TSectionKey extends string>({\n options,\n value,\n onValueChange,\n ...sectionProps\n}: SimpleCheckboxSectionProps<TSectionKey>): React.ReactElement => (\n <SearchFilterSection disableContentPadding {...sectionProps}>\n <FilterCheckboxList maxHeight={\"400px\"}>\n {options?.map((d) => (\n <FilterCheckbox\n key={d.value}\n value={value?.[d.value]}\n label={d.label}\n onValueChange={(v) =>\n onValueChange?.({\n ...value,\n [d.value]: v,\n })\n }\n />\n ))}\n </FilterCheckboxList>\n </SearchFilterSection>\n);\n","import * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { ChipMultiSelect, ChipMultiSelectValue } from \"@stenajs-webui/select\";\nimport { truthyKeysAsList } from \"@stenajs-webui/core\";\n\ninterface ChipMultiSelectSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n noneSelectedLabel?: string;\n options?: BooleanRecordOptions;\n}\n\nexport const ChipMultiSelectSection = <TSectionKey extends string>({\n options,\n value,\n noneSelectedLabel,\n onValueChange,\n ...sectionProps\n}: ChipMultiSelectSectionProps<TSectionKey>): React.ReactElement => {\n const [text, setText] = useState<string>(\"\");\n\n const listValue = useMemo<Array<ChipMultiSelectValue>>(\n () =>\n value\n ? truthyKeysAsList(value).map<ChipMultiSelectValue>((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n })\n : [],\n [options, value],\n );\n\n const filteredOptions = useMemo(() => {\n return options?.filter(\n (p) =>\n p.value.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1 ||\n p.label.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1,\n );\n }, [options, text]);\n\n const onValueChangeInternal = useCallback(\n (value: Array<ChipMultiSelectValue>) => {\n onValueChange?.(createBooleanRecordFromValue(value));\n },\n [onValueChange],\n );\n\n return (\n <SearchFilterSection {...sectionProps}>\n <ChipMultiSelect\n options={filteredOptions}\n value={listValue}\n onValueChange={onValueChangeInternal}\n inputValue={text}\n noneSelectedLabel={noneSelectedLabel}\n onInputChange={setText}\n closeMenuOnSelect={false}\n />\n </SearchFilterSection>\n );\n};\n\nconst createBooleanRecordFromValue = (\n value: Array<ChipMultiSelectValue>,\n): BooleanRecord => {\n return value.reduce<BooleanRecord>((sum, item) => {\n sum[item.value] = true;\n return sum;\n }, {});\n};\n","import {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForDateRange = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForDateRange(\n formModel[startDateFieldName] as unknown as string | undefined,\n formModel[endDateFieldName] as unknown as string | undefined,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForDateRange(\n startDateFieldName,\n endDateFieldName,\n ),\n});\n\nexport const createChipsForDateRange = (\n startDate: string | undefined,\n endDate: string | undefined,\n): Array<SearchFilterSectionChipModel> => {\n if (!startDate && !endDate) {\n return [];\n }\n return [\n { value: \"dateRange\", label: `${startDate ?? \"\"} - ${endDate ?? \"\"}` },\n ];\n};\n\nexport const createOnClickRemoveOnChipForDateRange = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n startDateFieldName: TField,\n endDateFieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields }) => {\n setFormModelFields({\n [startDateFieldName]: undefined,\n [endDateFieldName]: undefined,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import { PickByValue } from \"@stenajs-webui/core\";\nimport { DateRangeCalendarSectionProps } from \"./components/DateRangeCalendarSection\";\n\nexport const createDateRangeSectionProps = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n TSectionKey extends string,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n DateRangeCalendarSectionProps<TFormModel, TSectionKey>,\n \"value\" | \"onValueChange\"\n> => ({\n value: {\n startDate: formModel[startDateFieldName] as unknown as string | undefined,\n endDate: formModel[endDateFieldName] as unknown as string | undefined,\n },\n /* eslint-disable @typescript-eslint/no-explicit-any */\n onValueChange: (value, { dispatch, actions }) => {\n const fields: Partial<TFormModel> = {\n [startDateFieldName]: value.startDate,\n [endDateFieldName]: value.endDate,\n } as any;\n dispatch(actions.setFormModelFields(fields));\n },\n});\n","import {\n DateRange,\n DateRangeCalendar,\n DateRangeCalendarProps,\n DateRangeFocusedInput,\n dateRangeToStrings,\n DateStringRange,\n stringsToDateRange,\n} from \"@stenajs-webui/calendar\";\nimport * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { Box } from \"@stenajs-webui/core\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n} from \"../../../redux/SearchFilterRedux\";\nimport { useSearchFilterDispatch } from \"../../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../../context/SearchFilterActionsContext\";\n\nexport interface DateRangeCalendarSectionProps<\n TFormModel,\n TSectionKey extends string,\n>\n extends\n Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<unknown>,\n \"value\" | \"onValueChange\" | \"focusedInput\" | \"setFocusedInput\"\n > {\n value: DateStringRange;\n onValueChange: (\n value: DateStringRange,\n options: SetDateOptions<TFormModel, TSectionKey>,\n ) => void;\n label?: string;\n}\n\nexport interface SetDateOptions<TFormModel, TSectionKey extends string> {\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const DateRangeCalendarSection = <\n TFormModel,\n TSectionKey extends string,\n>({\n value,\n onValueChange,\n sectionId,\n contentRight,\n disableContentPadding,\n label,\n leftIcon,\n ...dateRangeCalendarProps\n}: DateRangeCalendarSectionProps<TFormModel, TSectionKey>) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions<TFormModel, TSectionKey>();\n\n const options = useMemo<SetDateOptions<TFormModel, TSectionKey>>(\n () => ({ dispatch, actions }),\n [actions, dispatch],\n );\n const [focusedInput, setFocusedInput] =\n useState<DateRangeFocusedInput>(\"startDate\");\n\n const dateRangeValue = useMemo(() => stringsToDateRange(value), [value]);\n\n const onValueChangeHandler = useCallback(\n (value: DateRange) => {\n onValueChange(dateRangeToStrings(value), options);\n },\n [onValueChange, options],\n );\n\n return (\n <SearchFilterSection\n label={label}\n leftIcon={leftIcon}\n sectionId={sectionId}\n contentRight={contentRight}\n disableContentPadding={disableContentPadding}\n >\n <Box flex={1} alignItems={\"center\"}>\n <Box background={\"white\"} indent>\n <DateRangeCalendar\n setFocusedInput={setFocusedInput}\n focusedInput={focusedInput}\n value={dateRangeValue}\n onValueChange={onValueChangeHandler}\n {...dateRangeCalendarProps}\n />\n </Box>\n </Box>\n </SearchFilterSection>\n );\n};\n"],"names":["SearchFilterPanelHeader","header","props","jsx","DrawerHeader","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","drawerProps","open","dispatch","actions","closeDrawer","useCallback","Drawer","jsxs","Column","cssColor","Box","SearchFilterButton","label","leftIcon","stenaSlidersMini","onClickButton","SecondaryButton","SearchFilterSection","sectionId","loading","error","onRetry","disableContentPadding","contentRight","state","expanded","onClickLabel","activeLabel","formatColumnIdToHeaderCellLabel","Fragment","MenuButton","Row","Spinner","Banner","FlatButton","Space","columnId","upperFirst","lowerCase","StickyFooter","boxProps","SearchFilterModelContext","useSearchFilterModel","SearchFilterContext","createSearchFilterInitialState","initialFormModel","createSearchFilterReducer","reducerId","initialState","combineReducers","reducerIdGate","getReducerIdFor","createValueByIdReducer","createEntityReducer","createSearchFilterActions","reducerIdGateAction","createEntityActions","fields","section","createValueByIdActions","reducerIdSuffix","useLocalSearchFilterState","reducer","useState","useReducer","SearchFilterLocalStateContext","FilterCheckbox","checkboxProps","ContentMenuButton","Checkbox","Text","FilterCheckboxList","maxHeight","SearchFilterChips","disableClearAllButton","onClickClearAll","stenaClean","EmptyChip","Chip","SearchFilterChip","value","onClickRemove","setFormModelFields","onClickRemoveHandler","SectionChips","chips","emptyChipLabel","onClickRemoveOnChip","createChipsPropsForBooleanRecord","formModel","fieldName","options","createChipsForBooleanRecord","createOnClickRemoveOnChipForBooleanRecord","booleanRecord","truthyKeysAsList","key","option","o","newBooleanRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","v","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","filteredOptions","p","onValueChangeInternal","createBooleanRecordFromValue","ChipMultiSelect","sum","item","createChipsPropsForDateRange","startDateFieldName","endDateFieldName","createChipsForDateRange","createOnClickRemoveOnChipForDateRange","startDate","endDate","createDateRangeSectionProps","DateRangeCalendarSection","dateRangeCalendarProps","focusedInput","setFocusedInput","dateRangeValue","stringsToDateRange","onValueChangeHandler","dateRangeToStrings","DateRangeCalendar"],"mappings":"wcAUaA,EAET,CAAC,CAAE,OAAAC,EAAS,SAAU,GAAGC,KACpBC,EAAAA,IAACC,EAAAA,aAAA,CAAc,GAAGF,EAAO,OAAAD,CAAA,CAAgB,ECVrCI,EAA2BC,EAAAA,cAEtC,IAA6C,EAElCC,EAAuB,IAEE,CACpC,MAAMC,EAAIC,EAAAA,WAAWJ,CAAwB,EAC7C,GAAI,CAACG,EACH,MAAM,IAAI,MACR,oFAAA,EAGJ,OAAOA,CACT,ECdaE,EAA8BJ,EAAAA,cAEzC,IAAgD,EAErCK,EAA0B,IAAM,CAC3C,MAAMH,EAAIC,EAAAA,WAAWC,CAA2B,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AA,kBAAA,CACC,gBAAAL,EACA,aAAAD,EACA,MAAOE,EACP,cAAeE,EACd,GAAGL,CAAA,CAAA,EAER,CAAA,CACF,CAAA,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/features/search-filter/components/SearchFilterPanelHeader.tsx","../src/features/search-filter/context/SearchFilterStateContext.ts","../src/features/search-filter/context/SearchFilterDispatchContext.ts","../src/features/search-filter/context/SearchFilterActionsContext.ts","../src/features/search-filter/components/SearchFilterDrawer.tsx","../src/features/search-filter/components/SearchFilterButton.tsx","../src/features/search-filter/components/SearchFilterSection.tsx","../src/features/search-filter/components/StickyFooter.tsx","../src/features/search-filter/context/SearchFilterModelContext.ts","../src/features/search-filter/components/context/SearchFilterContext.tsx","../src/features/search-filter/redux/SearchFilterRedux.ts","../src/features/search-filter/hooks/UseLocalSearchFilterState.ts","../src/features/search-filter/components/context/SearchFilterLocalStateContext.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckbox.tsx","../src/features/search-filter/features/filter-checkbox/FilterCheckboxList.tsx","../src/features/search-filter/features/chips/SearchFilterChips.tsx","../src/features/search-filter/features/chips/EmptyChip.tsx","../src/features/search-filter/features/chips/SearchFilterChip.tsx","../src/features/search-filter/features/chips/SectionChips.tsx","../src/features/search-filter/section-factories/boolean-record/BooleanRecordChips.ts","../src/features/search-filter/section-factories/boolean-record/components/SimpleCheckboxListSection.tsx","../src/features/search-filter/section-factories/boolean-record/components/ChipMultiSelectSection.tsx","../src/features/search-filter/section-factories/date-range/DateRangeChips.ts","../src/features/search-filter/section-factories/date-range/DateRangePropsFactory.ts","../src/features/search-filter/section-factories/date-range/components/DateRangeCalendarSection.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport { DrawerHeader } from \"@stenajs-webui/modal\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n contentRight?: ReactNode;\n /**\n * Accessible name of the close button, for example \"Close filters\".\n * Required, there is no default text.\n */\n closeButtonAriaLabel: string;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({ header = \"Filter\", ...props }) => {\n return <DrawerHeader {...props} header={header} />;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterState } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterStateContext = createContext<\n SearchFilterState<unknown>\n>(null as unknown as SearchFilterState<unknown>);\n\nexport const useSearchFilterState = <\n TFormModel,\n>(): SearchFilterState<TFormModel> => {\n const c = useContext(SearchFilterStateContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as SearchFilterState<TFormModel>;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterDispatch } from \"../redux/SearchFilterRedux\";\n\nexport const SearchFilterDispatchContext = createContext<\n SearchFilterDispatch<unknown>\n>(null as unknown as SearchFilterDispatch<unknown>);\n\nexport const useSearchFilterDispatch = () => {\n const c = useContext(SearchFilterDispatchContext);\n if (!c) {\n throw new Error(\"Missing search filter dispatch context.\");\n }\n return c;\n};\n","import { createContext, useContext } from \"react\";\nimport { SearchFilterActions } from \"../redux/SearchFilterRedux\";\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const SearchFilterActionsContext = createContext<\n SearchFilterActions<unknown, any>\n>(null as unknown as SearchFilterActions<unknown, any>);\n\nexport const useSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>() => {\n const c = useContext(SearchFilterActionsContext);\n if (!c) {\n throw new Error(\"Missing search filter actions context.\");\n }\n return c as SearchFilterActions<TFormModel, TSectionKey>;\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport {\n Drawer,\n DrawerBaseLeftRight,\n DrawerBaseTopBottom,\n} from \"@stenajs-webui/modal\";\nimport { cssColor } from \"@stenajs-webui/theme\";\nimport { Box, Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport type SearchFilterDrawerProps =\n | SearchFilterDrawerLeftRightProps\n | SearchFilterDrawerTopBottomProps;\n\ninterface SearchFilterDrawerCommonProps {\n header?: string;\n headerContentRight?: ReactNode;\n /**\n * Accessible name of the close button, for example \"Close filters\".\n * Required, there is no default text.\n */\n closeButtonAriaLabel: string;\n}\n\ninterface SearchFilterDrawerLeftRightProps\n extends\n Omit<DrawerBaseLeftRight, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\ninterface SearchFilterDrawerTopBottomProps\n extends\n Omit<DrawerBaseTopBottom, \"isOpen\" | \"onRequestClose\">,\n SearchFilterDrawerCommonProps {}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerContentRight,\n closeButtonAriaLabel,\n ...drawerProps\n}) => {\n const {\n settings: { open },\n } = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const closeDrawer = useCallback(() => {\n dispatch(actions.closeFilters());\n }, [actions, dispatch]);\n\n return (\n <Drawer\n floating\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column\n height={\"100%\"}\n borderRadius={\"var(--swui-border-radius)\"}\n background={cssColor(\"--lhds-color-ui-50\")}\n >\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n contentRight={headerContentRight}\n closeButtonAriaLabel={closeButtonAriaLabel}\n />\n <Box spacing={1} indent={1} gap={1}>\n {children}\n </Box>\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSlidersMini } from \"@stenajs-webui/elements\";\nimport * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSlidersMini,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickButton = useCallback(() => {\n dispatch(actions.openFilters());\n }, [actions, dispatch]);\n\n return (\n <SecondaryButton\n label={label}\n leftIcon={leftIcon}\n onClick={onClickButton}\n />\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren, useCallback } from \"react\";\nimport { Row, Space } from \"@stenajs-webui/core\";\nimport { lowerCase, upperFirst } from \"lodash-es\";\nimport {\n Banner,\n FlatButton,\n MenuButton,\n Spinner,\n} from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label?: string;\n leftIcon?: IconDefinition;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string,\n>({\n sectionId,\n label,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\n leftIcon,\n contentRight,\n}: PropsWithChildren<SearchFilterSectionProps<TSectionKey>>) {\n const state = useSearchFilterState();\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const expanded = state.expandedSections.values[sectionId] ?? false;\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.setSectionExpanded(sectionId, !expanded));\n }, [actions, dispatch, expanded, sectionId]);\n\n const activeLabel = label ?? formatColumnIdToHeaderCellLabel(sectionId);\n\n return (\n <>\n <MenuButton\n label={activeLabel}\n leftIcon={leftIcon}\n expandable\n expanded={expanded}\n selected={expanded}\n onClick={onClickLabel}\n right={contentRight}\n >\n {loading ? (\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n ) : error ? (\n <Banner\n variant={\"error\"}\n text={error}\n contentRight={\n onRetry ? <FlatButton label={\"Retry\"} onClick={onRetry} /> : null\n }\n />\n ) : disableContentPadding ? (\n children\n ) : (\n children\n )}\n </MenuButton>\n {expanded && <Space />}\n </>\n );\n};\n\nexport const formatColumnIdToHeaderCellLabel = (columnId: string): string =>\n upperFirst(lowerCase(columnId));\n","import { BoxProps, Column } from \"@stenajs-webui/core\";\nimport * as React from \"react\";\nimport { ReactNode } from \"react\";\n\nexport interface StickySearchButtonProps extends Pick<BoxProps, \"gap\"> {\n children?: ReactNode;\n}\n\nexport const StickyFooter: React.FC<StickySearchButtonProps> = ({\n children,\n ...boxProps\n}) => {\n return (\n <Column\n style={{ marginTop: \"auto\" }}\n justifyContent={\"center\"}\n spacing={2}\n indent\n shadow={\"popover\"}\n zIndex={1}\n {...boxProps}\n >\n {children}\n </Column>\n );\n};\n","import { createContext, useContext } from \"react\";\n\nexport const SearchFilterModelContext = createContext<unknown>(null as unknown);\n\nexport const useSearchFilterModel = <TFormModel>(): TFormModel => {\n const c = useContext(SearchFilterModelContext);\n if (!c) {\n throw new Error(\n \"Missing search filter context, wrap components with SearchFilterContext component.\",\n );\n }\n return c as TFormModel;\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n SearchFilterState,\n} from \"../../redux/SearchFilterRedux\";\nimport { SearchFilterDispatchContext } from \"../../context/SearchFilterDispatchContext\";\nimport { SearchFilterActionsContext } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterStateContext } from \"../../context/SearchFilterStateContext\";\nimport { SearchFilterModelContext } from \"../../context/SearchFilterModelContext\";\n\ninterface SearchFilterScopeProps<TFormModel, TSectionKey extends string> {\n state: SearchFilterState<TFormModel>;\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const SearchFilterContext = function SearchFilterScope<\n TFormModel,\n TSectionKey extends string,\n>({\n state,\n dispatch,\n actions,\n children,\n}: PropsWithChildren<SearchFilterScopeProps<TFormModel, TSectionKey>>) {\n return (\n <SearchFilterDispatchContext.Provider\n value={dispatch as SearchFilterDispatch<unknown>}\n >\n <SearchFilterActionsContext.Provider value={actions}>\n <SearchFilterStateContext.Provider value={state}>\n <SearchFilterModelContext.Provider value={state.formModel}>\n {children}\n </SearchFilterModelContext.Provider>\n </SearchFilterStateContext.Provider>\n </SearchFilterActionsContext.Provider>\n </SearchFilterDispatchContext.Provider>\n );\n};\n","import { combineReducers } from \"redux\";\nimport {\n createEntityActions,\n createEntityReducer,\n createValueByIdActions,\n createValueByIdReducer,\n EntityAction,\n EntityState,\n reducerIdGate,\n reducerIdGateAction,\n ReducerIdGateAction,\n ValueByIdAction,\n ValueByIdState,\n} from \"@stenajs-webui/redux\";\nimport { Dispatch } from \"react\";\n\nexport interface SearchFilterSettings {\n open: boolean;\n}\n\nexport type SearchFilterDispatch<TFormModel> = Dispatch<\n SearchFilterAction<TFormModel>\n>;\n\nexport interface SearchFilterState<TFormModel> {\n expandedSections: ValueByIdState<boolean>;\n formModel: EntityState<TFormModel>;\n settings: EntityState<SearchFilterSettings>;\n}\n\nexport type SearchFilterAction<TFormModel> =\n | ReducerIdGateAction<ValueByIdAction<boolean>>\n | ReducerIdGateAction<EntityAction<TFormModel>>\n | ReducerIdGateAction<EntityAction<SearchFilterSettings>>;\n\nexport const createSearchFilterInitialState = <TFormModel>(\n initialFormModel: TFormModel,\n): SearchFilterState<TFormModel> => ({\n settings: {\n open: false,\n },\n formModel: initialFormModel,\n expandedSections: { values: {} },\n});\n\nexport const createSearchFilterReducer = <TFormModel>(\n reducerId: string,\n initialState: SearchFilterState<TFormModel>,\n) =>\n combineReducers({\n expandedSections: reducerIdGate(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdReducer<boolean>(initialState.expandedSections),\n ),\n formModel: reducerIdGate(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityReducer<TFormModel>(initialState.formModel),\n ),\n settings: reducerIdGate(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityReducer<SearchFilterSettings>(initialState.settings),\n ),\n });\n\nexport interface SearchFilterActions<TFormModel, TSectionKey extends string> {\n openFilters: () => SearchFilterAction<TFormModel>;\n closeFilters: () => SearchFilterAction<TFormModel>;\n setFormModelFields: (\n fields: Partial<TFormModel>,\n ) => SearchFilterAction<TFormModel>;\n clearFormModel: () => SearchFilterAction<TFormModel>;\n expandSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n collapseSection: (section: TSectionKey) => SearchFilterAction<TFormModel>;\n setSectionExpanded: (\n section: TSectionKey,\n expanded: boolean,\n ) => SearchFilterAction<TFormModel>;\n clearExpandedSections: () => SearchFilterAction<TFormModel>;\n}\n\nexport const createSearchFilterActions = <\n TFormModel,\n TSectionKey extends string,\n>(\n reducerId: string,\n initialFormModel: TFormModel,\n): SearchFilterActions<TFormModel, TSectionKey> => ({\n openFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: true,\n }),\n ),\n closeFilters: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"settings\"),\n createEntityActions<SearchFilterSettings>().setEntityFields({\n open: false,\n }),\n ),\n setFormModelFields: (fields: Partial<TFormModel>) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntityFields(fields),\n ),\n clearFormModel: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"formModel\"),\n createEntityActions<TFormModel>().setEntity(initialFormModel),\n ),\n expandSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, true),\n ),\n collapseSection: (section: TSectionKey) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, false),\n ),\n setSectionExpanded: (section: TSectionKey, expanded: boolean) =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().setValue(section, expanded),\n ),\n clearExpandedSections: () =>\n reducerIdGateAction(\n getReducerIdFor(reducerId, \"expandedSections\"),\n createValueByIdActions<boolean>().clearAllValues(),\n ),\n});\n\nexport const getReducerIdFor = (\n reducerId: string,\n reducerIdSuffix: keyof SearchFilterState<unknown>,\n): string => `${reducerId}.${reducerIdSuffix}`;\n","import {\n createSearchFilterActions,\n createSearchFilterReducer,\n SearchFilterState,\n} from \"../redux/SearchFilterRedux\";\nimport { useReducer, useState } from \"react\";\n\nexport const useLocalSearchFilterState = <\n TFormModel,\n TSectionKey extends string,\n>(\n initialState: SearchFilterState<TFormModel>,\n) => {\n const [reducer] = useState(() =>\n createSearchFilterReducer<TFormModel>(\"local\", initialState),\n );\n\n const [actions] = useState(() =>\n createSearchFilterActions<TFormModel, TSectionKey>(\n \"local\",\n initialState.formModel,\n ),\n );\n\n const [state, dispatch] = useReducer(reducer, initialState);\n\n return {\n actions,\n state,\n dispatch,\n };\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { useLocalSearchFilterState } from \"../../hooks/UseLocalSearchFilterState\";\nimport { SearchFilterContext } from \"./SearchFilterContext\";\nimport { createSearchFilterInitialState } from \"../../redux/SearchFilterRedux\";\n\ninterface SearchFilterLocalScopeProps<TFormModel> {\n initialFormModel: TFormModel;\n}\n\nexport const SearchFilterLocalStateContext = function SearchFilterLocalScope<\n TFormModel,\n>({\n initialFormModel,\n children,\n}: PropsWithChildren<SearchFilterLocalScopeProps<TFormModel>>) {\n const { state, actions, dispatch } = useLocalSearchFilterState(\n createSearchFilterInitialState(initialFormModel),\n );\n\n return (\n <SearchFilterContext state={state} actions={actions} dispatch={dispatch}>\n {children}\n </SearchFilterContext>\n );\n};\n","import * as React from \"react\";\nimport { Row, Text } from \"@stenajs-webui/core\";\nimport { ContentMenuButton } from \"@stenajs-webui/elements\";\nimport { Checkbox, CheckboxProps } from \"@stenajs-webui/forms\";\n\nexport interface FilterCheckboxProps extends CheckboxProps {\n label: string;\n}\n\nexport const FilterCheckbox: React.FC<FilterCheckboxProps> = ({\n label,\n ...checkboxProps\n}) => {\n return (\n <ContentMenuButton>\n <Row gap={2} alignItems={\"center\"} justifyContent={\"flex-start\"}>\n <Checkbox {...checkboxProps} />\n <Text>{label}</Text>\n </Row>\n </ContentMenuButton>\n );\n};\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport { Column } from \"@stenajs-webui/core\";\n\nexport interface FilterCheckboxListProps extends PropsWithChildren {\n maxHeight?: string;\n}\n\nexport const FilterCheckboxList: React.FC<FilterCheckboxListProps> = ({\n children,\n maxHeight,\n}) => {\n return (\n <Column\n maxHeight={maxHeight}\n overflowY={maxHeight ? \"auto\" : undefined}\n spacing={1}\n >\n {children}\n </Column>\n );\n};\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { FlatButton, stenaClean } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface SearchFilterChipsProps {\n disableClearAllButton?: boolean;\n children?: ReactNode;\n}\n\nexport const SearchFilterChips: React.FC<SearchFilterChipsProps> = ({\n children,\n disableClearAllButton = false,\n}) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickClearAll = useCallback(\n () => dispatch(actions.clearFormModel()),\n [actions, dispatch],\n );\n\n return (\n <Row flexWrap={\"wrap\"} alignItems={\"center\"} gap>\n {children}\n {!disableClearAllButton && (\n <FlatButton\n size={\"small\"}\n leftIcon={stenaClean}\n label={\"Clear\"}\n onClick={onClickClearAll}\n />\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useCallback } from \"react\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\n\ninterface EmptyChipProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n label: string;\n}\n\nexport const EmptyChip = function EmptyChip<TSectionKey extends string>({\n label,\n sectionId,\n}: EmptyChipProps<TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />;\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { Chip } from \"@stenajs-webui/elements\";\nimport { useSearchFilterDispatch } from \"../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../context/SearchFilterActionsContext\";\nimport { SearchFilterSectionOnClickRemoveOnChip } from \"../../config/SearchFilterConfig\";\n\ninterface SearchFilterChipProps<TFormModel, TSectionKey> {\n sectionId: TSectionKey;\n label: string;\n value: string;\n onClickRemove?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SearchFilterChip = function SearchFilterChip<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n label,\n value,\n onClickRemove,\n}: SearchFilterChipProps<TFormModel, TSectionKey>) {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions();\n\n const setFormModelFields = useCallback(\n (fields: Partial<TFormModel>) =>\n dispatch(actions.setFormModelFields(fields)),\n [dispatch, actions],\n );\n\n const onClickRemoveHandler = useCallback(() => {\n onClickRemove?.({ value, setFormModelFields });\n }, [onClickRemove, setFormModelFields, value]);\n\n const onClickLabel = useCallback(() => {\n dispatch(actions.clearExpandedSections());\n dispatch(actions.expandSection(sectionId));\n dispatch(actions.openFilters());\n }, [actions, dispatch, sectionId]);\n\n return (\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n );\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { EmptyChip } from \"./EmptyChip\";\nimport { SearchFilterChip } from \"./SearchFilterChip\";\n\nexport interface SectionChipsProps<TFormModel, TSectionKey extends string> {\n sectionId: TSectionKey;\n chips?: Array<SearchFilterSectionChipModel>;\n emptyChipLabel?: string;\n onClickRemoveOnChip?: SearchFilterSectionOnClickRemoveOnChip<TFormModel>;\n}\n\nexport const SectionChips = function SectionChips<\n TFormModel,\n TSectionKey extends string,\n>({\n sectionId,\n chips,\n emptyChipLabel,\n onClickRemoveOnChip,\n}: SectionChipsProps<TFormModel, TSectionKey>) {\n if (!chips?.length) {\n if (!emptyChipLabel) {\n return null;\n }\n return <EmptyChip sectionId={sectionId} label={emptyChipLabel} />;\n }\n\n return (\n <>\n {chips.map(({ label, value }) => (\n <SearchFilterChip\n key={value}\n label={label ?? sectionId}\n sectionId={sectionId}\n onClickRemove={onClickRemoveOnChip}\n value={value}\n />\n ))}\n </>\n );\n};\n","import { BooleanRecord, BooleanRecordOptions } from \"./BooleanRecordTypes\";\nimport {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue, truthyKeysAsList } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForBooleanRecord = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n options?: BooleanRecordOptions,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForBooleanRecord(\n formModel[fieldName] as unknown as BooleanRecord,\n options,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForBooleanRecord(\n formModel,\n fieldName,\n ),\n});\n\nexport const createChipsForBooleanRecord = (\n booleanRecord: BooleanRecord,\n options?: BooleanRecordOptions,\n): Array<SearchFilterSectionChipModel> =>\n truthyKeysAsList(booleanRecord).map((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n });\n\nexport const createOnClickRemoveOnChipForBooleanRecord = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, BooleanRecord>,\n>(\n formModel: TFormModel,\n fieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields, value }) => {\n const newBooleanRecord = { ...formModel[fieldName] } as BooleanRecord;\n newBooleanRecord[value] = false;\n setFormModelFields({\n [fieldName]: newBooleanRecord,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import * as React from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { FilterCheckbox } from \"../../../features/filter-checkbox/FilterCheckbox\";\nimport { FilterCheckboxList } from \"../../../features/filter-checkbox/FilterCheckboxList\";\n\nexport interface SimpleCheckboxSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n options?: BooleanRecordOptions;\n}\n\nexport const SimpleCheckboxListSection = <TSectionKey extends string>({\n options,\n value,\n onValueChange,\n ...sectionProps\n}: SimpleCheckboxSectionProps<TSectionKey>): React.ReactElement => (\n <SearchFilterSection disableContentPadding {...sectionProps}>\n <FilterCheckboxList maxHeight={\"400px\"}>\n {options?.map((d) => (\n <FilterCheckbox\n key={d.value}\n value={value?.[d.value]}\n label={d.label}\n onValueChange={(v) =>\n onValueChange?.({\n ...value,\n [d.value]: v,\n })\n }\n />\n ))}\n </FilterCheckboxList>\n </SearchFilterSection>\n);\n","import * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport { ValueAndOnValueChangeProps } from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\nimport { ChipMultiSelect, ChipMultiSelectValue } from \"@stenajs-webui/select\";\nimport { truthyKeysAsList } from \"@stenajs-webui/core\";\n\ninterface ChipMultiSelectSectionProps<TSectionKey extends string>\n extends\n SearchFilterSectionProps<TSectionKey>,\n ValueAndOnValueChangeProps<BooleanRecord> {\n noneSelectedLabel?: string;\n options?: BooleanRecordOptions;\n}\n\nexport const ChipMultiSelectSection = <TSectionKey extends string>({\n options,\n value,\n noneSelectedLabel,\n onValueChange,\n ...sectionProps\n}: ChipMultiSelectSectionProps<TSectionKey>): React.ReactElement => {\n const [text, setText] = useState<string>(\"\");\n\n const listValue = useMemo<Array<ChipMultiSelectValue>>(\n () =>\n value\n ? truthyKeysAsList(value).map<ChipMultiSelectValue>((key) => {\n const option = options?.find((o) => o.value === key);\n return { value: key, label: option?.label ?? key };\n })\n : [],\n [options, value],\n );\n\n const filteredOptions = useMemo(() => {\n return options?.filter(\n (p) =>\n p.value.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1 ||\n p.label.toLocaleLowerCase().indexOf(text.toLocaleLowerCase()) > -1,\n );\n }, [options, text]);\n\n const onValueChangeInternal = useCallback(\n (value: Array<ChipMultiSelectValue>) => {\n onValueChange?.(createBooleanRecordFromValue(value));\n },\n [onValueChange],\n );\n\n return (\n <SearchFilterSection {...sectionProps}>\n <ChipMultiSelect\n options={filteredOptions}\n value={listValue}\n onValueChange={onValueChangeInternal}\n inputValue={text}\n noneSelectedLabel={noneSelectedLabel}\n onInputChange={setText}\n closeMenuOnSelect={false}\n />\n </SearchFilterSection>\n );\n};\n\nconst createBooleanRecordFromValue = (\n value: Array<ChipMultiSelectValue>,\n): BooleanRecord => {\n return value.reduce<BooleanRecord>((sum, item) => {\n sum[item.value] = true;\n return sum;\n }, {});\n};\n","import {\n SearchFilterSectionChipModel,\n SearchFilterSectionOnClickRemoveOnChip,\n} from \"../../config/SearchFilterConfig\";\nimport { PickByValue } from \"@stenajs-webui/core\";\nimport { SectionChipsProps } from \"../../features/chips/SectionChips\";\n\nexport const createChipsPropsForDateRange = <\n TFormModel,\n TSectionKey extends string,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n SectionChipsProps<TFormModel, TSectionKey>,\n \"chips\" | \"onClickRemoveOnChip\"\n> => ({\n chips: createChipsForDateRange(\n formModel[startDateFieldName] as unknown as string | undefined,\n formModel[endDateFieldName] as unknown as string | undefined,\n ),\n onClickRemoveOnChip: createOnClickRemoveOnChipForDateRange(\n startDateFieldName,\n endDateFieldName,\n ),\n});\n\nexport const createChipsForDateRange = (\n startDate: string | undefined,\n endDate: string | undefined,\n): Array<SearchFilterSectionChipModel> => {\n if (!startDate && !endDate) {\n return [];\n }\n return [\n { value: \"dateRange\", label: `${startDate ?? \"\"} - ${endDate ?? \"\"}` },\n ];\n};\n\nexport const createOnClickRemoveOnChipForDateRange = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n>(\n startDateFieldName: TField,\n endDateFieldName: TField,\n): SearchFilterSectionOnClickRemoveOnChip<TFormModel> => {\n return ({ setFormModelFields }) => {\n setFormModelFields({\n [startDateFieldName]: undefined,\n [endDateFieldName]: undefined,\n } as unknown as Partial<TFormModel>);\n };\n};\n","import { PickByValue } from \"@stenajs-webui/core\";\nimport { DateRangeCalendarSectionProps } from \"./components/DateRangeCalendarSection\";\n\nexport const createDateRangeSectionProps = <\n TFormModel,\n TField extends keyof PickByValue<TFormModel, string | undefined>,\n TSectionKey extends string,\n>(\n formModel: TFormModel,\n startDateFieldName: TField,\n endDateFieldName: TField,\n): Pick<\n DateRangeCalendarSectionProps<TFormModel, TSectionKey>,\n \"value\" | \"onValueChange\"\n> => ({\n value: {\n startDate: formModel[startDateFieldName] as unknown as string | undefined,\n endDate: formModel[endDateFieldName] as unknown as string | undefined,\n },\n /* eslint-disable @typescript-eslint/no-explicit-any */\n onValueChange: (value, { dispatch, actions }) => {\n const fields: Partial<TFormModel> = {\n [startDateFieldName]: value.startDate,\n [endDateFieldName]: value.endDate,\n } as any;\n dispatch(actions.setFormModelFields(fields));\n },\n});\n","import {\n DateRange,\n DateRangeCalendar,\n DateRangeCalendarProps,\n DateRangeFocusedInput,\n dateRangeToStrings,\n DateStringRange,\n stringsToDateRange,\n} from \"@stenajs-webui/calendar\";\nimport * as React from \"react\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport { Box } from \"@stenajs-webui/core\";\nimport {\n SearchFilterSection,\n SearchFilterSectionProps,\n} from \"../../../components/SearchFilterSection\";\nimport {\n SearchFilterActions,\n SearchFilterDispatch,\n} from \"../../../redux/SearchFilterRedux\";\nimport { useSearchFilterDispatch } from \"../../../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../../../context/SearchFilterActionsContext\";\n\nexport interface DateRangeCalendarSectionProps<\n TFormModel,\n TSectionKey extends string,\n>\n extends\n Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<unknown>,\n \"value\" | \"onValueChange\" | \"focusedInput\" | \"setFocusedInput\"\n > {\n value: DateStringRange;\n onValueChange: (\n value: DateStringRange,\n options: SetDateOptions<TFormModel, TSectionKey>,\n ) => void;\n label?: string;\n}\n\nexport interface SetDateOptions<TFormModel, TSectionKey extends string> {\n dispatch: SearchFilterDispatch<TFormModel>;\n actions: SearchFilterActions<TFormModel, TSectionKey>;\n}\n\nexport const DateRangeCalendarSection = <\n TFormModel,\n TSectionKey extends string,\n>({\n value,\n onValueChange,\n sectionId,\n contentRight,\n disableContentPadding,\n label,\n leftIcon,\n ...dateRangeCalendarProps\n}: DateRangeCalendarSectionProps<TFormModel, TSectionKey>) => {\n const dispatch = useSearchFilterDispatch();\n const actions = useSearchFilterActions<TFormModel, TSectionKey>();\n\n const options = useMemo<SetDateOptions<TFormModel, TSectionKey>>(\n () => ({ dispatch, actions }),\n [actions, dispatch],\n );\n const [focusedInput, setFocusedInput] =\n useState<DateRangeFocusedInput>(\"startDate\");\n\n const dateRangeValue = useMemo(() => stringsToDateRange(value), [value]);\n\n const onValueChangeHandler = useCallback(\n (value: DateRange) => {\n onValueChange(dateRangeToStrings(value), options);\n },\n [onValueChange, options],\n );\n\n return (\n <SearchFilterSection\n label={label}\n leftIcon={leftIcon}\n sectionId={sectionId}\n contentRight={contentRight}\n disableContentPadding={disableContentPadding}\n >\n <Box flex={1} alignItems={\"center\"}>\n <Box background={\"white\"} indent>\n <DateRangeCalendar\n setFocusedInput={setFocusedInput}\n focusedInput={focusedInput}\n value={dateRangeValue}\n onValueChange={onValueChangeHandler}\n {...dateRangeCalendarProps}\n />\n </Box>\n </Box>\n </SearchFilterSection>\n );\n};\n"],"names":["SearchFilterPanelHeader","header","props","jsx","DrawerHeader","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","closeButtonAriaLabel","drawerProps","open","dispatch","actions","closeDrawer","useCallback","Drawer","jsxs","Column","cssColor","Box","SearchFilterButton","label","leftIcon","stenaSlidersMini","onClickButton","SecondaryButton","SearchFilterSection","sectionId","loading","error","onRetry","disableContentPadding","contentRight","state","expanded","onClickLabel","activeLabel","formatColumnIdToHeaderCellLabel","Fragment","MenuButton","Row","Spinner","Banner","FlatButton","Space","columnId","upperFirst","lowerCase","StickyFooter","boxProps","SearchFilterModelContext","useSearchFilterModel","SearchFilterContext","createSearchFilterInitialState","initialFormModel","createSearchFilterReducer","reducerId","initialState","combineReducers","reducerIdGate","getReducerIdFor","createValueByIdReducer","createEntityReducer","createSearchFilterActions","reducerIdGateAction","createEntityActions","fields","section","createValueByIdActions","reducerIdSuffix","useLocalSearchFilterState","reducer","useState","useReducer","SearchFilterLocalStateContext","FilterCheckbox","checkboxProps","ContentMenuButton","Checkbox","Text","FilterCheckboxList","maxHeight","SearchFilterChips","disableClearAllButton","onClickClearAll","stenaClean","EmptyChip","Chip","SearchFilterChip","value","onClickRemove","setFormModelFields","onClickRemoveHandler","SectionChips","chips","emptyChipLabel","onClickRemoveOnChip","createChipsPropsForBooleanRecord","formModel","fieldName","options","createChipsForBooleanRecord","createOnClickRemoveOnChipForBooleanRecord","booleanRecord","truthyKeysAsList","key","option","o","newBooleanRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","v","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","filteredOptions","p","onValueChangeInternal","createBooleanRecordFromValue","ChipMultiSelect","sum","item","createChipsPropsForDateRange","startDateFieldName","endDateFieldName","createChipsForDateRange","createOnClickRemoveOnChipForDateRange","startDate","endDate","createDateRangeSectionProps","DateRangeCalendarSection","dateRangeCalendarProps","focusedInput","setFocusedInput","dateRangeValue","stringsToDateRange","onValueChangeHandler","dateRangeToStrings","DateRangeCalendar"],"mappings":"wcAeaA,EAET,CAAC,CAAE,OAAAC,EAAS,SAAU,GAAGC,KACpBC,EAAAA,IAACC,EAAAA,aAAA,CAAc,GAAGF,EAAO,OAAAD,CAAA,CAAgB,ECfrCI,EAA2BC,EAAAA,cAEtC,IAA6C,EAElCC,EAAuB,IAEE,CACpC,MAAMC,EAAIC,EAAAA,WAAWJ,CAAwB,E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EACA,aAAAK,EACA,sBAAAD,EAEA,SAAArC,EAAAA,IAACyB,MAAA,CAAI,KAAM,EAAG,WAAY,SACxB,SAAAzB,EAAAA,IAACyB,EAAAA,IAAA,CAAI,WAAY,QAAS,OAAM,GAC9B,SAAAzB,EAAAA,IAACqJ,EAAAA,kBAAA,CACC,gBAAAL,EACA,aAAAD,EACA,MAAOE,EACP,cAAeE,EACd,GAAGL,CAAA,CAAA,EAER,CAAA,CACF,CAAA,CAAA,CAGN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stenajs-webui/filter",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "mattias800",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"deploy": "gh-pages -d example/build"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@stenajs-webui/calendar": "25.
|
|
39
|
-
"@stenajs-webui/core": "25.
|
|
40
|
-
"@stenajs-webui/elements": "25.
|
|
41
|
-
"@stenajs-webui/forms": "25.
|
|
42
|
-
"@stenajs-webui/modal": "25.
|
|
43
|
-
"@stenajs-webui/panels": "25.
|
|
44
|
-
"@stenajs-webui/redux": "25.
|
|
45
|
-
"@stenajs-webui/select": "25.
|
|
46
|
-
"@stenajs-webui/theme": "25.
|
|
38
|
+
"@stenajs-webui/calendar": "25.6.0",
|
|
39
|
+
"@stenajs-webui/core": "25.6.0",
|
|
40
|
+
"@stenajs-webui/elements": "25.6.0",
|
|
41
|
+
"@stenajs-webui/forms": "25.6.0",
|
|
42
|
+
"@stenajs-webui/modal": "25.6.0",
|
|
43
|
+
"@stenajs-webui/panels": "25.6.0",
|
|
44
|
+
"@stenajs-webui/redux": "25.6.0",
|
|
45
|
+
"@stenajs-webui/select": "25.6.0",
|
|
46
|
+
"@stenajs-webui/theme": "25.6.0",
|
|
47
47
|
"date-fns": "4.4.0",
|
|
48
48
|
"lodash-es": "^4.18.1"
|
|
49
49
|
},
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"files": [
|
|
73
73
|
"dist"
|
|
74
74
|
],
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "f6700eee6cc7d05d2d71f1e1ab53c0107db92640",
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
}
|