@stenajs-webui/filter 20.6.5 → 20.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +47 -48
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +19 -20
package/dist/index.es.js
CHANGED
|
@@ -4,8 +4,7 @@ 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 D, Box as B, Row as O, Space as U, Text as X, truthyKeysAsList as V } from "@stenajs-webui/core";
|
|
6
6
|
import { SecondaryButton as Z, stenaSlidersMini as _, MenuButton as I, Spinner as N, Banner as ee, FlatButton as j, ContentMenuButton as te, stenaClean as ne, Chip as H } from "@stenajs-webui/elements";
|
|
7
|
-
import re from "lodash
|
|
8
|
-
import oe from "lodash/upperFirst";
|
|
7
|
+
import { upperFirst as re, lowerCase as oe } from "lodash-es";
|
|
9
8
|
import { combineReducers as ce } from "redux";
|
|
10
9
|
import { reducerIdGate as y, createValueByIdReducer as se, createEntityReducer as P, reducerIdGateAction as C, createEntityActions as g, createValueByIdActions as b } from "@stenajs-webui/redux";
|
|
11
10
|
import { Checkbox as ae } from "@stenajs-webui/forms";
|
|
@@ -23,12 +22,12 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
23
22
|
if (!e)
|
|
24
23
|
throw new Error("Missing search filter dispatch context.");
|
|
25
24
|
return e;
|
|
26
|
-
}, G = M(null),
|
|
25
|
+
}, G = M(null), x = () => {
|
|
27
26
|
const e = L(G);
|
|
28
27
|
if (!e)
|
|
29
28
|
throw new Error("Missing search filter actions context.");
|
|
30
29
|
return e;
|
|
31
|
-
},
|
|
30
|
+
}, ze = ({
|
|
32
31
|
children: e,
|
|
33
32
|
header: t,
|
|
34
33
|
headerContentRight: n,
|
|
@@ -36,7 +35,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
36
35
|
}) => {
|
|
37
36
|
const {
|
|
38
37
|
settings: { open: o }
|
|
39
|
-
} = z(), s = F(), a =
|
|
38
|
+
} = z(), s = F(), a = x(), i = u(() => {
|
|
40
39
|
s(a.closeFilters());
|
|
41
40
|
}, [a, s]);
|
|
42
41
|
return /* @__PURE__ */ c(
|
|
@@ -67,11 +66,11 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
67
66
|
)
|
|
68
67
|
}
|
|
69
68
|
);
|
|
70
|
-
},
|
|
69
|
+
}, qe = ({
|
|
71
70
|
label: e = "Filters",
|
|
72
71
|
leftIcon: t = _
|
|
73
72
|
}) => {
|
|
74
|
-
const n = F(), r =
|
|
73
|
+
const n = F(), r = x(), o = u(() => {
|
|
75
74
|
n(r.openFilters());
|
|
76
75
|
}, [r, n]);
|
|
77
76
|
return /* @__PURE__ */ c(
|
|
@@ -93,9 +92,9 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
93
92
|
leftIcon: h,
|
|
94
93
|
contentRight: p
|
|
95
94
|
}) {
|
|
96
|
-
const l = z(), S = F(),
|
|
97
|
-
S(
|
|
98
|
-
}, [
|
|
95
|
+
const l = z(), S = F(), m = x(), f = l.expandedSections.values[t] ?? !1, E = u(() => {
|
|
96
|
+
S(m.setSectionExpanded(t, !f));
|
|
97
|
+
}, [m, S, f, t]), k = n ?? pe(t);
|
|
99
98
|
return /* @__PURE__ */ v(T, { children: [
|
|
100
99
|
/* @__PURE__ */ c(
|
|
101
100
|
I,
|
|
@@ -119,7 +118,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
119
118
|
),
|
|
120
119
|
f && /* @__PURE__ */ c(U, {})
|
|
121
120
|
] });
|
|
122
|
-
}, pe = (e) => oe(
|
|
121
|
+
}, pe = (e) => re(oe(e)), Ge = ({
|
|
123
122
|
children: e,
|
|
124
123
|
...t
|
|
125
124
|
}) => /* @__PURE__ */ c(
|
|
@@ -134,7 +133,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
134
133
|
...t,
|
|
135
134
|
children: e
|
|
136
135
|
}
|
|
137
|
-
), K = M(null),
|
|
136
|
+
), K = M(null), Ke = () => {
|
|
138
137
|
const e = L(K);
|
|
139
138
|
if (!e)
|
|
140
139
|
throw new Error(
|
|
@@ -210,7 +209,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
210
209
|
d(e, "expandedSections"),
|
|
211
210
|
b().clearAllValues()
|
|
212
211
|
)
|
|
213
|
-
}), d = (e, t) => `${e}.${t}`,
|
|
212
|
+
}), d = (e, t) => `${e}.${t}`, xe = (e) => {
|
|
214
213
|
const [t] = w(
|
|
215
214
|
() => fe("local", e)
|
|
216
215
|
), [n] = w(
|
|
@@ -224,15 +223,15 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
224
223
|
state: r,
|
|
225
224
|
dispatch: o
|
|
226
225
|
};
|
|
227
|
-
},
|
|
226
|
+
}, We = function({
|
|
228
227
|
initialFormModel: t,
|
|
229
228
|
children: n
|
|
230
229
|
}) {
|
|
231
|
-
const { state: r, actions: o, dispatch: s } =
|
|
230
|
+
const { state: r, actions: o, dispatch: s } = xe(
|
|
232
231
|
Ce(t)
|
|
233
232
|
);
|
|
234
233
|
return /* @__PURE__ */ c(Se, { state: r, actions: o, dispatch: s, children: n });
|
|
235
|
-
},
|
|
234
|
+
}, me = ({
|
|
236
235
|
label: e,
|
|
237
236
|
...t
|
|
238
237
|
}) => /* @__PURE__ */ c(te, { children: /* @__PURE__ */ v(O, { gap: 2, alignItems: "center", justifyContent: "flex-start", children: [
|
|
@@ -249,11 +248,11 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
249
248
|
spacing: 1,
|
|
250
249
|
children: e
|
|
251
250
|
}
|
|
252
|
-
),
|
|
251
|
+
), Ye = ({
|
|
253
252
|
children: e,
|
|
254
253
|
disableClearAllButton: t = !1
|
|
255
254
|
}) => {
|
|
256
|
-
const n = F(), r =
|
|
255
|
+
const n = F(), r = x(), o = u(
|
|
257
256
|
() => n(r.clearFormModel()),
|
|
258
257
|
[r, n]
|
|
259
258
|
);
|
|
@@ -273,7 +272,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
273
272
|
label: t,
|
|
274
273
|
sectionId: n
|
|
275
274
|
}) {
|
|
276
|
-
const r = F(), o =
|
|
275
|
+
const r = F(), o = x(), s = u(() => {
|
|
277
276
|
r(o.clearExpandedSections()), r(o.expandSection(n)), r(o.openFilters());
|
|
278
277
|
}, [o, r, n]);
|
|
279
278
|
return /* @__PURE__ */ c(H, { label: t, variant: "secondary", onClick: s });
|
|
@@ -283,7 +282,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
283
282
|
value: r,
|
|
284
283
|
onClickRemove: o
|
|
285
284
|
}) {
|
|
286
|
-
const s = F(), a =
|
|
285
|
+
const s = F(), a = x(), i = u(
|
|
287
286
|
(l) => s(a.setFormModelFields(l)),
|
|
288
287
|
[s, a]
|
|
289
288
|
), h = u(() => {
|
|
@@ -299,7 +298,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
299
298
|
onClickRemove: o ? h : void 0
|
|
300
299
|
}
|
|
301
300
|
);
|
|
302
|
-
},
|
|
301
|
+
}, Je = function({
|
|
303
302
|
sectionId: t,
|
|
304
303
|
chips: n,
|
|
305
304
|
emptyChipLabel: r,
|
|
@@ -315,7 +314,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
315
314
|
},
|
|
316
315
|
a
|
|
317
316
|
)) }) : r ? /* @__PURE__ */ c(be, { sectionId: t, label: r }) : null;
|
|
318
|
-
},
|
|
317
|
+
}, Qe = (e, t, n) => ({
|
|
319
318
|
chips: Re(
|
|
320
319
|
e[t],
|
|
321
320
|
n
|
|
@@ -332,13 +331,13 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
332
331
|
o[r] = !1, n({
|
|
333
332
|
[t]: o
|
|
334
333
|
});
|
|
335
|
-
},
|
|
334
|
+
}, Ue = ({
|
|
336
335
|
options: e,
|
|
337
336
|
value: t,
|
|
338
337
|
onValueChange: n,
|
|
339
338
|
...r
|
|
340
339
|
}) => /* @__PURE__ */ c(A, { disableContentPadding: !0, ...r, children: /* @__PURE__ */ c(ge, { maxHeight: "400px", children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ c(
|
|
341
|
-
|
|
340
|
+
me,
|
|
342
341
|
{
|
|
343
342
|
value: t == null ? void 0 : t[o.value],
|
|
344
343
|
label: o.label,
|
|
@@ -348,7 +347,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
348
347
|
})
|
|
349
348
|
},
|
|
350
349
|
o.value
|
|
351
|
-
)) }) }),
|
|
350
|
+
)) }) }), Xe = ({
|
|
352
351
|
options: e,
|
|
353
352
|
value: t,
|
|
354
353
|
noneSelectedLabel: n,
|
|
@@ -357,7 +356,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
357
356
|
}) => {
|
|
358
357
|
const [s, a] = w(""), i = R(
|
|
359
358
|
() => t ? V(t).map((l) => {
|
|
360
|
-
const S = e == null ? void 0 : e.find((
|
|
359
|
+
const S = e == null ? void 0 : e.find((m) => m.value === l);
|
|
361
360
|
return { value: l, label: (S == null ? void 0 : S.label) ?? l };
|
|
362
361
|
}) : [],
|
|
363
362
|
[e, t]
|
|
@@ -381,7 +380,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
381
380
|
closeMenuOnSelect: !1
|
|
382
381
|
}
|
|
383
382
|
) });
|
|
384
|
-
}, Me = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}),
|
|
383
|
+
}, Me = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ze = (e, t, n) => ({
|
|
385
384
|
chips: Le(
|
|
386
385
|
e[t],
|
|
387
386
|
e[n]
|
|
@@ -397,7 +396,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
397
396
|
[e]: void 0,
|
|
398
397
|
[t]: void 0
|
|
399
398
|
});
|
|
400
|
-
},
|
|
399
|
+
}, _e = (e, t, n) => ({
|
|
401
400
|
value: {
|
|
402
401
|
startDate: e[t],
|
|
403
402
|
endDate: e[n]
|
|
@@ -409,7 +408,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
409
408
|
};
|
|
410
409
|
o(s.setFormModelFields(a));
|
|
411
410
|
}
|
|
412
|
-
}),
|
|
411
|
+
}), Ie = ({
|
|
413
412
|
value: e,
|
|
414
413
|
onValueChange: t,
|
|
415
414
|
sectionId: n,
|
|
@@ -419,10 +418,10 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
419
418
|
leftIcon: a,
|
|
420
419
|
...i
|
|
421
420
|
}) => {
|
|
422
|
-
const h = F(), p =
|
|
421
|
+
const h = F(), p = x(), l = R(
|
|
423
422
|
() => ({ dispatch: h, actions: p }),
|
|
424
423
|
[p, h]
|
|
425
|
-
), [S,
|
|
424
|
+
), [S, m] = w("startDate"), f = R(() => ie(e), [e]), E = u(
|
|
426
425
|
(k) => {
|
|
427
426
|
t(de(k), l);
|
|
428
427
|
},
|
|
@@ -439,7 +438,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
439
438
|
children: /* @__PURE__ */ c(B, { flex: 1, alignItems: "center", children: /* @__PURE__ */ c(B, { background: "white", indent: !0, children: /* @__PURE__ */ c(
|
|
440
439
|
ue,
|
|
441
440
|
{
|
|
442
|
-
setFocusedInput:
|
|
441
|
+
setFocusedInput: m,
|
|
443
442
|
focusedInput: S,
|
|
444
443
|
value: f,
|
|
445
444
|
onValueChange: E,
|
|
@@ -450,31 +449,31 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
450
449
|
);
|
|
451
450
|
};
|
|
452
451
|
export {
|
|
453
|
-
|
|
454
|
-
|
|
452
|
+
Xe as ChipMultiSelectSection,
|
|
453
|
+
Ie as DateRangeCalendarSection,
|
|
455
454
|
be as EmptyChip,
|
|
456
|
-
|
|
455
|
+
me as FilterCheckbox,
|
|
457
456
|
ge as FilterCheckboxList,
|
|
458
457
|
G as SearchFilterActionsContext,
|
|
459
|
-
|
|
458
|
+
qe as SearchFilterButton,
|
|
460
459
|
we as SearchFilterChip,
|
|
461
|
-
|
|
460
|
+
Ye as SearchFilterChips,
|
|
462
461
|
Se as SearchFilterContext,
|
|
463
462
|
q as SearchFilterDispatchContext,
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
ze as SearchFilterDrawer,
|
|
464
|
+
We as SearchFilterLocalStateContext,
|
|
466
465
|
K as SearchFilterModelContext,
|
|
467
466
|
he as SearchFilterPanelHeader,
|
|
468
467
|
A as SearchFilterSection,
|
|
469
468
|
$ as SearchFilterStateContext,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
469
|
+
Je as SectionChips,
|
|
470
|
+
Ue as SimpleCheckboxListSection,
|
|
471
|
+
Ge as StickyFooter,
|
|
473
472
|
Re as createChipsForBooleanRecord,
|
|
474
473
|
Le as createChipsForDateRange,
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
474
|
+
Qe as createChipsPropsForBooleanRecord,
|
|
475
|
+
Ze as createChipsPropsForDateRange,
|
|
476
|
+
_e as createDateRangeSectionProps,
|
|
478
477
|
ve as createOnClickRemoveOnChipForBooleanRecord,
|
|
479
478
|
Ee as createOnClickRemoveOnChipForDateRange,
|
|
480
479
|
Fe as createSearchFilterActions,
|
|
@@ -482,10 +481,10 @@ export {
|
|
|
482
481
|
fe as createSearchFilterReducer,
|
|
483
482
|
pe as formatColumnIdToHeaderCellLabel,
|
|
484
483
|
d as getReducerIdFor,
|
|
485
|
-
|
|
486
|
-
|
|
484
|
+
xe as useLocalSearchFilterState,
|
|
485
|
+
x as useSearchFilterActions,
|
|
487
486
|
F as useSearchFilterDispatch,
|
|
488
|
-
|
|
487
|
+
Ke as useSearchFilterModel,
|
|
489
488
|
z as useSearchFilterState
|
|
490
489
|
};
|
|
491
490
|
//# sourceMappingURL=index.es.js.map
|
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\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 { Drawer, DrawerProps } 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\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerContentRight?: ReactNode;\n}\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 from \"lodash/lowerCase\";\nimport upperFirst from \"lodash/upperFirst\";\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 newRecord = { ...formModel[fieldName] };\n newRecord[value] = false;\n setFormModelFields({\n [fieldName]: newRecord,\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 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 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 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> extends Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<{}>,\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","newRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","v","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","o","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,QACnB,gBAAAC,EAAAC,GAAA,EAAc,GAAGF,GAAO,QAAAD,EAAgB,CAAA,GCVrCI,IAA2BC,EAEtC,IAA6C,GAElCC,IAAuB,MAEE;AAC9B,QAAAC,IAAIC,EAAWJ,CAAwB;AAC7C,MAAI,CAACG;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGG,SAAAA;AACT,GCdaE,IAA8BJ,EAEzC,IAAgD,GAErCK,IAA0B,MAAM;AACrC,QAAAH,IAAIC,EAAWC,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D;AAAA,IACA,CAACS,GAAeT,CAAO;AAAA,EAAA;AAIvB,SAAA,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,GAAI,EAAA,MAAM,GAAG,YAAY,UACxB,UAAA,gBAAAxB,EAACwB,GAAI,EAAA,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,SAER,EACF,CAAA;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\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\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 { Drawer, DrawerProps } 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\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerContentRight?: ReactNode;\n}\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 newRecord = { ...formModel[fieldName] };\n newRecord[value] = false;\n setFormModelFields({\n [fieldName]: newRecord,\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 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 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 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> extends Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<{}>,\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","newRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","v","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","o","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,QACnB,gBAAAC,EAAAC,GAAA,EAAc,GAAGF,GAAO,QAAAD,EAAgB,CAAA,GCVrCI,IAA2BC,EAEtC,IAA6C,GAElCC,IAAuB,MAEE;AAC9B,QAAAC,IAAIC,EAAWJ,CAAwB;AAC7C,MAAI,CAACG;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGG,SAAAA;AACT,GCdaE,IAA8BJ,EAEzC,IAAgD,GAErCK,IAA0B,MAAM;AACrC,QAAAH,IAAIC,EAAWC,CAA2B;AAChD,MAAI,CAACF;AACG,UAAA,IAAI,MAAM,yCAAyC;AAEpD,SAAAA;AACT,GCVaI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AAAA,IAAA;AAAA,MACC,OAAAL;AAAA,MACA,UAAAC;AAAA,MACA,WAAAK;AAAA,MACA,cAAAK;AAAA,MACA,uBAAAD;AAAA,MAEA,UAAA,gBAAApC,EAACwB,GAAI,EAAA,MAAM,GAAG,YAAY,UACxB,UAAA,gBAAAxB,EAACwB,GAAI,EAAA,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,SAER,EACF,CAAA;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"),
|
|
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"),C=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"),w=require("@stenajs-webui/calendar"),D=({header:e="Filter",...t})=>o.jsx(E.DrawerHeader,{...t,header:e}),M=a.createContext(null),v=()=>{const e=a.useContext(M);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},y=a.createContext(null),g=()=>{const e=a.useContext(y);if(!e)throw new Error("Missing search filter dispatch context.");return e},A=a.createContext(null),f=()=>{const e=a.useContext(A);if(!e)throw new Error("Missing search filter actions context.");return e},_=({children:e,header:t,headerContentRight:r,...n})=>{const{settings:{open:c}}=v(),s=g(),i=f(),h=a.useCallback(()=>{s(i.closeFilters())},[i,s]);return o.jsx(E.Drawer,{floating:!0,isOpen:c,onRequestClose:h,...n,children:o.jsxs(d.Column,{height:"100%",borderRadius:"var(--swui-border-radius)",background:Q.cssColor("--lhds-color-ui-50"),children:[o.jsx(D,{onRequestClose:h,header:t,contentRight:r}),o.jsx(d.Box,{spacing:1,indent:1,gap:1,children:e})]})})},N=({label:e="Filters",leftIcon:t=C.stenaSlidersMini})=>{const r=g(),n=f(),c=a.useCallback(()=>{r(n.openFilters())},[n,r]);return o.jsx(C.SecondaryButton,{label:e,leftIcon:t,onClick:c})},j=function({sectionId:t,label:r,loading:n,error:c,onRetry:s,disableContentPadding:i,children:h,leftIcon:S,contentRight:p}){const u=v(),F=g(),b=f(),m=u.expandedSections.values[t]??!1,R=a.useCallback(()=>{F(b.setSectionExpanded(t,!m))},[b,F,m,t]),k=r??O(t);return o.jsxs(o.Fragment,{children:[o.jsx(C.MenuButton,{label:k,leftIcon:S,expandable:!0,expanded:m,selected:m,onClick:R,right:p,children:n?o.jsx(d.Row,{spacing:!0,justifyContent:"center",flex:1,children:o.jsx(C.Spinner,{size:"small"})}):c?o.jsx(C.Banner,{variant:"error",text:c,contentRight:s?o.jsx(C.FlatButton,{label:"Retry",onClick:s}):null}):h}),m&&o.jsx(d.Space,{})]})},O=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},q=function({state:t,dispatch:r,actions:n,children:c}){return o.jsx(y.Provider,{value:r,children:o.jsx(A.Provider,{value:n,children:o.jsx(M.Provider,{value:t,children:o.jsx(B.Provider,{value:t.formModel,children:c})})})})},I=e=>({settings:{open:!1},formModel:e,expandedSections:{values:{}}}),P=(e,t)=>U.combineReducers({expandedSections:l.reducerIdGate(x(e,"expandedSections"),l.createValueByIdReducer(t.expandedSections)),formModel:l.reducerIdGate(x(e,"formModel"),l.createEntityReducer(t.formModel)),settings:l.reducerIdGate(x(e,"settings"),l.createEntityReducer(t.settings))}),G=(e,t)=>({openFilters:()=>l.reducerIdGateAction(x(e,"settings"),l.createEntityActions().setEntityFields({open:!0})),closeFilters:()=>l.reducerIdGateAction(x(e,"settings"),l.createEntityActions().setEntityFields({open:!1})),setFormModelFields:r=>l.reducerIdGateAction(x(e,"formModel"),l.createEntityActions().setEntityFields(r)),clearFormModel:()=>l.reducerIdGateAction(x(e,"formModel"),l.createEntityActions().setEntity(t)),expandSection:r=>l.reducerIdGateAction(x(e,"expandedSections"),l.createValueByIdActions().setValue(r,!0)),collapseSection:r=>l.reducerIdGateAction(x(e,"expandedSections"),l.createValueByIdActions().setValue(r,!1)),setSectionExpanded:(r,n)=>l.reducerIdGateAction(x(e,"expandedSections"),l.createValueByIdActions().setValue(r,n)),clearExpandedSections:()=>l.reducerIdGateAction(x(e,"expandedSections"),l.createValueByIdActions().clearAllValues())}),x=(e,t)=>`${e}.${t}`,V=e=>{const[t]=a.useState(()=>P("local",e)),[r]=a.useState(()=>G("local",e.formModel)),[n,c]=a.useReducer(t,e);return{actions:r,state:n,dispatch:c}},re=function({initialFormModel:t,children:r}){const{state:n,actions:c,dispatch:s}=V(I(t));return o.jsx(q,{state:n,actions:c,dispatch:s,children:r})},T=({label:e,...t})=>o.jsx(C.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}),ne=({children:e,disableClearAllButton:t=!1})=>{const r=g(),n=f(),c=a.useCallback(()=>r(n.clearFormModel()),[n,r]);return o.jsxs(d.Row,{flexWrap:"wrap",alignItems:"center",gap:!0,children:[e,!t&&o.jsx(C.FlatButton,{size:"small",leftIcon:C.stenaClean,label:"Clear",onClick:c})]})},$=function({label:t,sectionId:r}){const n=g(),c=f(),s=a.useCallback(()=>{n(c.clearExpandedSections()),n(c.expandSection(r)),n(c.openFilters())},[c,n,r]);return o.jsx(C.Chip,{label:t,variant:"secondary",onClick:s})},z=function({sectionId:t,label:r,value:n,onClickRemove:c}){const s=g(),i=f(),h=a.useCallback(u=>s(i.setFormModelFields(u)),[s,i]),S=a.useCallback(()=>{c==null||c({value:n,setFormModelFields:h})},[c,h,n]),p=a.useCallback(()=>{s(i.clearExpandedSections()),s(i.expandSection(t)),s(i.openFilters())},[i,s,t]);return o.jsx(C.Chip,{label:r??t,onClick:p,onClickRemove:c?S:void 0})},ce=function({sectionId:t,chips:r,emptyChipLabel:n,onClickRemoveOnChip:c}){return r!=null&&r.length?o.jsx(o.Fragment,{children:r.map(({label:s,value:i})=>o.jsx(z,{label:s??t,sectionId:t,onClickRemove:c,value:i},i))}):n?o.jsx($,{sectionId:t,label:n}):null},oe=(e,t,r)=>({chips:K(e[t],r),onClickRemoveOnChip:W(e,t)}),K=(e,t)=>d.truthyKeysAsList(e).map(r=>{const n=t==null?void 0:t.find(c=>c.value===r);return{value:r,label:(n==null?void 0:n.label)??r}}),W=(e,t)=>({setFormModelFields:r,value:n})=>{const c={...e[t]};c[n]=!1,r({[t]:c})},se=({options:e,value:t,onValueChange:r,...n})=>o.jsx(j,{disableContentPadding:!0,...n,children:o.jsx(H,{maxHeight:"400px",children:e==null?void 0:e.map(c=>o.jsx(T,{value:t==null?void 0:t[c.value],label:c.label,onValueChange:s=>r==null?void 0:r({...t,[c.value]:s})},c.value))})}),ae=({options:e,value:t,noneSelectedLabel:r,onValueChange:n,...c})=>{const[s,i]=a.useState(""),h=a.useMemo(()=>t?d.truthyKeysAsList(t).map(u=>{const F=e==null?void 0:e.find(b=>b.value===u);return{value:u,label:(F==null?void 0:F.label)??u}}):[],[e,t]),S=a.useMemo(()=>e==null?void 0:e.filter(u=>u.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase())>-1||u.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase())>-1),[e,s]),p=a.useCallback(u=>{n==null||n(le(u))},[n]);return o.jsx(j,{...c,children:o.jsx(Z.ChipMultiSelect,{options:S,value:h,onValueChange:p,inputValue:s,noneSelectedLabel:r,onInputChange:i,closeMenuOnSelect:!1})})},le=e=>e.reduce((t,r)=>(t[r.value]=!0,t),{}),ie=(e,t,r)=>({chips:Y(e[t],e[r]),onClickRemoveOnChip:J(t,r)}),Y=(e,t)=>!e&&!t?[]:[{value:"dateRange",label:`${e??""} - ${t??""}`}],J=(e,t)=>({setFormModelFields:r})=>{r({[e]:void 0,[t]:void 0})},ue=(e,t,r)=>({value:{startDate:e[t],endDate:e[r]},onValueChange:(n,{dispatch:c,actions:s})=>{const i={[t]:n.startDate,[r]:n.endDate};c(s.setFormModelFields(i))}}),de=({value:e,onValueChange:t,sectionId:r,contentRight:n,disableContentPadding:c,label:s,leftIcon:i,...h})=>{const S=g(),p=f(),u=a.useMemo(()=>({dispatch:S,actions:p}),[p,S]),[F,b]=a.useState("startDate"),m=a.useMemo(()=>w.stringsToDateRange(e),[e]),R=a.useCallback(k=>{t(w.dateRangeToStrings(k),u)},[t,u]);return o.jsx(j,{label:s,leftIcon:i,sectionId:r,contentRight:n,disableContentPadding:c,children:o.jsx(d.Box,{flex:1,alignItems:"center",children:o.jsx(d.Box,{background:"white",indent:!0,children:o.jsx(w.DateRangeCalendar,{setFocusedInput:b,focusedInput:F,value:m,onValueChange:R,...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=ne;exports.SearchFilterContext=q;exports.SearchFilterDispatchContext=y;exports.SearchFilterDrawer=_;exports.SearchFilterLocalStateContext=re;exports.SearchFilterModelContext=B;exports.SearchFilterPanelHeader=D;exports.SearchFilterSection=j;exports.SearchFilterStateContext=M;exports.SectionChips=ce;exports.SimpleCheckboxListSection=se;exports.StickyFooter=ee;exports.createChipsForBooleanRecord=K;exports.createChipsForDateRange=Y;exports.createChipsPropsForBooleanRecord=oe;exports.createChipsPropsForDateRange=ie;exports.createDateRangeSectionProps=ue;exports.createOnClickRemoveOnChipForBooleanRecord=W;exports.createOnClickRemoveOnChipForDateRange=J;exports.createSearchFilterActions=G;exports.createSearchFilterInitialState=I;exports.createSearchFilterReducer=P;exports.formatColumnIdToHeaderCellLabel=O;exports.getReducerIdFor=x;exports.useLocalSearchFilterState=V;exports.useSearchFilterActions=f;exports.useSearchFilterDispatch=g;exports.useSearchFilterModel=te;exports.useSearchFilterState=v;
|
|
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\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 { Drawer, DrawerProps } 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\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerContentRight?: ReactNode;\n}\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 from \"lodash/lowerCase\";\nimport upperFirst from \"lodash/upperFirst\";\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 newRecord = { ...formModel[fieldName] };\n newRecord[value] = false;\n setFormModelFields({\n [fieldName]: newRecord,\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 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 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 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> extends Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<{}>,\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","newRecord","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":"8eAUaA,EAET,CAAC,CAAE,OAAAC,EAAS,SAAU,GAAGC,KACnBC,EAAAA,IAAAC,EAAAA,aAAA,CAAc,GAAGF,EAAO,OAAAD,CAAgB,CAAA,ECVrCI,EAA2BC,gBAEtC,IAA6C,EAElCC,EAAuB,IAEE,CAC9B,MAAAC,EAAIC,aAAWJ,CAAwB,EAC7C,GAAI,CAACG,EACH,MAAM,IAAI,MACR,oFAAA,EAGG,OAAAA,CACT,ECdaE,EAA8BJ,gBAEzC,IAAgD,EAErCK,EAA0B,IAAM,CACrC,MAAAH,EAAIC,aAAWC,CAA2B,EAChD,GAAI,CAACF,EACG,MAAA,IAAI,MAAM,yCAAyC,EAEpD,OAAAA,CACT,ECVaI,EAA6BN,gBAExC,IAAoD,EAEz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AU,QAAAC,KAAc,CAC/C,MAAMsD,EAA8B,CAClC,CAAC8D,CAAkB,EAAGvC,EAAM,UAC5B,CAACwC,CAAgB,EAAGxC,EAAM,OAAA,EAEnB9E,EAAAC,EAAQ,mBAAmBsD,CAAM,CAAC,CAC7C,CACF,GCqBaqE,GAA2B,CAGtC,CACA,MAAA9C,EACA,cAAAqB,EACA,UAAAnF,EACA,aAAAK,EACA,sBAAAD,EACA,MAAAV,EACA,SAAAC,EACA,GAAGkH,CACL,IAA8D,CAC5D,MAAM7H,EAAWR,IACXS,EAAUP,IAEV+F,EAAUmB,EAAA,QACd,KAAO,CAAE,SAAA5G,EAAU,QAAAC,IACnB,CAACA,EAASD,CAAQ,CAAA,EAEd,CAAC8H,EAAcC,CAAe,EAClClE,WAAgC,WAAW,EAEvCmE,EAAiBpB,EAAAA,QAAQ,IAAMqB,EAAAA,mBAAmBnD,CAAK,EAAG,CAACA,CAAK,CAAC,EAEjEoD,EAAuB/H,EAAA,YAC1B2E,GAAqB,CACNqB,EAAAgC,EAAA,mBAAmBrD,CAAK,EAAGW,CAAO,CAClD,EACA,CAACU,EAAeV,CAAO,CAAA,EAIvB,OAAAzG,EAAA,IAAC+B,EAAA,CACC,MAAAL,EACA,SAAAC,EACA,UAAAK,EACA,aAAAK,EACA,sBAAAD,EAEA,SAAApC,EAAA,IAACwB,MAAI,CAAA,KAAM,EAAG,WAAY,SACxB,SAAAxB,EAAAA,IAACwB,EAAAA,IAAI,CAAA,WAAY,QAAS,OAAM,GAC9B,SAAAxB,EAAA,IAACoJ,EAAA,kBAAA,CACC,gBAAAL,EACA,aAAAD,EACA,MAAOE,EACP,cAAeE,EACd,GAAGL,CAAA,GAER,CACF,CAAA,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\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\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 { Drawer, DrawerProps } 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\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerContentRight?: ReactNode;\n}\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 newRecord = { ...formModel[fieldName] };\n newRecord[value] = false;\n setFormModelFields({\n [fieldName]: newRecord,\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 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 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 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> extends Omit<\n SearchFilterSectionProps<TSectionKey>,\n \"label\" | \"onRetry\" | \"error\" | \"loading\"\n >,\n Omit<\n DateRangeCalendarProps<{}>,\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","newRecord","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,KACnBC,EAAAA,IAAAC,EAAAA,aAAA,CAAc,GAAGF,EAAO,OAAAD,CAAgB,CAAA,ECVrCI,EAA2BC,gBAEtC,IAA6C,EAElCC,EAAuB,IAEE,CAC9B,MAAAC,EAAIC,aAAWJ,CAAwB,EAC7C,GAAI,CAACG,EACH,MAAM,IAAI,MACR,oFAAA,EAGG,OAAAA,CACT,ECdaE,EAA8BJ,gBAEzC,IAAgD,EAErCK,EAA0B,IAAM,CACrC,MAAAH,EAAIC,aAAWC,CAA2B,EAChD,GAAI,CAACF,EACG,MAAA,IAAI,MAAM,yCAAyC,EAEpD,OAAAA,CACT,ECVaI,EAA6BN,gBAExC,IAAoD,EAEzCO,EAAyB,IAG/B,CACC,MAAAL,EAAIC,aAAWG,CAA0B,EAC/C,GAAI,CAACJ,EACG,MAAA,IAAI,MAAM,wCAAwC,EAEnD,OAAAA,CACT,ECAaM,EAAwD,CAAC,CACpE,SAAAC,EACA,OAAAd,EACA,mBAAAe,EACA,GAAGC,CACL,IAAM,CACE,KAAA,CACJ,SAAU,CAAE,KAAAC,CAAK,GACfX,EAAqB,EACnBY,EAAWR,IACXS,EAAUP,IAEVQ,EAAcC,EAAAA,YAAY,IAAM,CAC3BH,EAAAC,EAAQ,cAAc,CAAA,EAC9B,CAACA,EAASD,CAAQ,CAAC,EAGpB,OAAAhB,EAAA,IAACoB,EAAA,OAAA,CACC,SAAQ,GACR,OAAQL,EACR,eAAgBG,EACf,GAAGJ,EAEJ,SAAAO,EAAA,KAACC,EAAA,OAAA,CACC,OAAQ,OACR,aAAc,4BACd,WAAYC,WAAS,oBAAoB,EAEzC,SAAA,CAAAvB,EAAA,IAACH,EAAA,CACC,eAAgBqB,EAChB,OAAApB,EACA,aAAce,CAAA,CAChB,E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D,CAAK,EAAGW,CAAO,CAClD,EACA,CAACU,EAAeV,CAAO,CAAA,EAIvB,OAAAzG,EAAA,IAAC+B,EAAA,CACC,MAAAL,EACA,SAAAC,EACA,UAAAK,EACA,aAAAK,EACA,sBAAAD,EAEA,SAAApC,EAAA,IAACwB,MAAI,CAAA,KAAM,EAAG,WAAY,SACxB,SAAAxB,EAAAA,IAACwB,EAAAA,IAAI,CAAA,WAAY,QAAS,OAAM,GAC9B,SAAAxB,EAAA,IAACoJ,EAAA,kBAAA,CACC,gBAAAL,EACA,aAAAD,EACA,MAAOE,EACP,cAAeE,EACd,GAAGL,CAAA,GAER,CACF,CAAA,CAAA,CAAA,CAGN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stenajs-webui/filter",
|
|
3
|
-
"version": "20.6.
|
|
3
|
+
"version": "20.6.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "mattias800",
|
|
@@ -33,37 +33,36 @@
|
|
|
33
33
|
"deploy": "gh-pages -d example/build"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@stenajs-webui/calendar": "20.6.
|
|
37
|
-
"@stenajs-webui/core": "20.6.
|
|
38
|
-
"@stenajs-webui/elements": "20.6.
|
|
39
|
-
"@stenajs-webui/forms": "20.6.
|
|
40
|
-
"@stenajs-webui/modal": "20.6.
|
|
41
|
-
"@stenajs-webui/panels": "20.6.
|
|
42
|
-
"@stenajs-webui/redux": "20.6.
|
|
43
|
-
"@stenajs-webui/select": "20.6.
|
|
44
|
-
"@stenajs-webui/theme": "20.6.
|
|
45
|
-
"date-fns": "2.26.0"
|
|
36
|
+
"@stenajs-webui/calendar": "20.6.7",
|
|
37
|
+
"@stenajs-webui/core": "20.6.7",
|
|
38
|
+
"@stenajs-webui/elements": "20.6.7",
|
|
39
|
+
"@stenajs-webui/forms": "20.6.7",
|
|
40
|
+
"@stenajs-webui/modal": "20.6.7",
|
|
41
|
+
"@stenajs-webui/panels": "20.6.7",
|
|
42
|
+
"@stenajs-webui/redux": "20.6.7",
|
|
43
|
+
"@stenajs-webui/select": "20.6.7",
|
|
44
|
+
"@stenajs-webui/theme": "20.6.7",
|
|
45
|
+
"date-fns": "2.26.0",
|
|
46
|
+
"lodash-es": "^4.17.21"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"@emotion/react": ">=11.
|
|
49
|
-
"@emotion/styled": ">=11.
|
|
49
|
+
"@emotion/react": ">=11.11.4",
|
|
50
|
+
"@emotion/styled": ">=11.11.5",
|
|
50
51
|
"@fortawesome/fontawesome-svg-core": ">=1.2.35",
|
|
51
|
-
"@types/lodash": ">=4.
|
|
52
|
-
"lodash": ">=4.17.21",
|
|
52
|
+
"@types/lodash-es": ">=4.17.12",
|
|
53
53
|
"prop-types": ">=15.5.4",
|
|
54
54
|
"react": ">=18.2.0",
|
|
55
55
|
"react-dom": ">=18.2.0",
|
|
56
56
|
"redux": ">=4.0.5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@emotion/react": "^11.
|
|
60
|
-
"@emotion/styled": "^11.
|
|
59
|
+
"@emotion/react": "^11.11.4",
|
|
60
|
+
"@emotion/styled": "^11.11.5",
|
|
61
61
|
"@fortawesome/fontawesome-svg-core": "1.2.35",
|
|
62
62
|
"@types/jest": "^23.1.5",
|
|
63
|
-
"@types/lodash": "^4.
|
|
63
|
+
"@types/lodash-es": "^4.17.12",
|
|
64
64
|
"@types/react": "^18.0.14",
|
|
65
65
|
"@types/react-dom": "^18.0.5",
|
|
66
|
-
"lodash": "^4.17.21",
|
|
67
66
|
"prop-types": "^15.5.4",
|
|
68
67
|
"react": "^18.2.0",
|
|
69
68
|
"react-dom": "^18.2.0",
|
|
@@ -72,5 +71,5 @@
|
|
|
72
71
|
"files": [
|
|
73
72
|
"dist"
|
|
74
73
|
],
|
|
75
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "ffaff5a2e0226ad09666d339571fc7dda9cf7d02"
|
|
76
75
|
}
|