@stenajs-webui/filter 20.6.4 → 20.6.5
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 +48 -47
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,8 @@ 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
|
|
7
|
+
import re from "lodash/lowerCase";
|
|
8
|
+
import oe from "lodash/upperFirst";
|
|
8
9
|
import { combineReducers as ce } from "redux";
|
|
9
10
|
import { reducerIdGate as y, createValueByIdReducer as se, createEntityReducer as P, reducerIdGateAction as C, createEntityActions as g, createValueByIdActions as b } from "@stenajs-webui/redux";
|
|
10
11
|
import { Checkbox as ae } from "@stenajs-webui/forms";
|
|
@@ -22,12 +23,12 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
22
23
|
if (!e)
|
|
23
24
|
throw new Error("Missing search filter dispatch context.");
|
|
24
25
|
return e;
|
|
25
|
-
}, G = M(null),
|
|
26
|
+
}, G = M(null), m = () => {
|
|
26
27
|
const e = L(G);
|
|
27
28
|
if (!e)
|
|
28
29
|
throw new Error("Missing search filter actions context.");
|
|
29
30
|
return e;
|
|
30
|
-
},
|
|
31
|
+
}, qe = ({
|
|
31
32
|
children: e,
|
|
32
33
|
header: t,
|
|
33
34
|
headerContentRight: n,
|
|
@@ -35,7 +36,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
35
36
|
}) => {
|
|
36
37
|
const {
|
|
37
38
|
settings: { open: o }
|
|
38
|
-
} = z(), s = F(), a =
|
|
39
|
+
} = z(), s = F(), a = m(), i = u(() => {
|
|
39
40
|
s(a.closeFilters());
|
|
40
41
|
}, [a, s]);
|
|
41
42
|
return /* @__PURE__ */ c(
|
|
@@ -66,11 +67,11 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
66
67
|
)
|
|
67
68
|
}
|
|
68
69
|
);
|
|
69
|
-
},
|
|
70
|
+
}, Ge = ({
|
|
70
71
|
label: e = "Filters",
|
|
71
72
|
leftIcon: t = _
|
|
72
73
|
}) => {
|
|
73
|
-
const n = F(), r =
|
|
74
|
+
const n = F(), r = m(), o = u(() => {
|
|
74
75
|
n(r.openFilters());
|
|
75
76
|
}, [r, n]);
|
|
76
77
|
return /* @__PURE__ */ c(
|
|
@@ -92,9 +93,9 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
92
93
|
leftIcon: h,
|
|
93
94
|
contentRight: p
|
|
94
95
|
}) {
|
|
95
|
-
const l = z(), S = F(),
|
|
96
|
-
S(
|
|
97
|
-
}, [
|
|
96
|
+
const l = z(), S = F(), x = m(), f = l.expandedSections.values[t] ?? !1, E = u(() => {
|
|
97
|
+
S(x.setSectionExpanded(t, !f));
|
|
98
|
+
}, [x, S, f, t]), k = n ?? pe(t);
|
|
98
99
|
return /* @__PURE__ */ v(T, { children: [
|
|
99
100
|
/* @__PURE__ */ c(
|
|
100
101
|
I,
|
|
@@ -118,7 +119,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
118
119
|
),
|
|
119
120
|
f && /* @__PURE__ */ c(U, {})
|
|
120
121
|
] });
|
|
121
|
-
}, pe = (e) => re(
|
|
122
|
+
}, pe = (e) => oe(re(e)), Ke = ({
|
|
122
123
|
children: e,
|
|
123
124
|
...t
|
|
124
125
|
}) => /* @__PURE__ */ c(
|
|
@@ -133,7 +134,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
133
134
|
...t,
|
|
134
135
|
children: e
|
|
135
136
|
}
|
|
136
|
-
), K = M(null),
|
|
137
|
+
), K = M(null), We = () => {
|
|
137
138
|
const e = L(K);
|
|
138
139
|
if (!e)
|
|
139
140
|
throw new Error(
|
|
@@ -209,7 +210,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
209
210
|
d(e, "expandedSections"),
|
|
210
211
|
b().clearAllValues()
|
|
211
212
|
)
|
|
212
|
-
}), d = (e, t) => `${e}.${t}`,
|
|
213
|
+
}), d = (e, t) => `${e}.${t}`, me = (e) => {
|
|
213
214
|
const [t] = w(
|
|
214
215
|
() => fe("local", e)
|
|
215
216
|
), [n] = w(
|
|
@@ -223,15 +224,15 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
223
224
|
state: r,
|
|
224
225
|
dispatch: o
|
|
225
226
|
};
|
|
226
|
-
},
|
|
227
|
+
}, Ye = function({
|
|
227
228
|
initialFormModel: t,
|
|
228
229
|
children: n
|
|
229
230
|
}) {
|
|
230
|
-
const { state: r, actions: o, dispatch: s } =
|
|
231
|
+
const { state: r, actions: o, dispatch: s } = me(
|
|
231
232
|
Ce(t)
|
|
232
233
|
);
|
|
233
234
|
return /* @__PURE__ */ c(Se, { state: r, actions: o, dispatch: s, children: n });
|
|
234
|
-
},
|
|
235
|
+
}, xe = ({
|
|
235
236
|
label: e,
|
|
236
237
|
...t
|
|
237
238
|
}) => /* @__PURE__ */ c(te, { children: /* @__PURE__ */ v(O, { gap: 2, alignItems: "center", justifyContent: "flex-start", children: [
|
|
@@ -248,11 +249,11 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
248
249
|
spacing: 1,
|
|
249
250
|
children: e
|
|
250
251
|
}
|
|
251
|
-
),
|
|
252
|
+
), Je = ({
|
|
252
253
|
children: e,
|
|
253
254
|
disableClearAllButton: t = !1
|
|
254
255
|
}) => {
|
|
255
|
-
const n = F(), r =
|
|
256
|
+
const n = F(), r = m(), o = u(
|
|
256
257
|
() => n(r.clearFormModel()),
|
|
257
258
|
[r, n]
|
|
258
259
|
);
|
|
@@ -272,7 +273,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
272
273
|
label: t,
|
|
273
274
|
sectionId: n
|
|
274
275
|
}) {
|
|
275
|
-
const r = F(), o =
|
|
276
|
+
const r = F(), o = m(), s = u(() => {
|
|
276
277
|
r(o.clearExpandedSections()), r(o.expandSection(n)), r(o.openFilters());
|
|
277
278
|
}, [o, r, n]);
|
|
278
279
|
return /* @__PURE__ */ c(H, { label: t, variant: "secondary", onClick: s });
|
|
@@ -282,7 +283,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
282
283
|
value: r,
|
|
283
284
|
onClickRemove: o
|
|
284
285
|
}) {
|
|
285
|
-
const s = F(), a =
|
|
286
|
+
const s = F(), a = m(), i = u(
|
|
286
287
|
(l) => s(a.setFormModelFields(l)),
|
|
287
288
|
[s, a]
|
|
288
289
|
), h = u(() => {
|
|
@@ -298,7 +299,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
298
299
|
onClickRemove: o ? h : void 0
|
|
299
300
|
}
|
|
300
301
|
);
|
|
301
|
-
},
|
|
302
|
+
}, Qe = function({
|
|
302
303
|
sectionId: t,
|
|
303
304
|
chips: n,
|
|
304
305
|
emptyChipLabel: r,
|
|
@@ -314,7 +315,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
314
315
|
},
|
|
315
316
|
a
|
|
316
317
|
)) }) : r ? /* @__PURE__ */ c(be, { sectionId: t, label: r }) : null;
|
|
317
|
-
},
|
|
318
|
+
}, Ue = (e, t, n) => ({
|
|
318
319
|
chips: Re(
|
|
319
320
|
e[t],
|
|
320
321
|
n
|
|
@@ -331,13 +332,13 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
331
332
|
o[r] = !1, n({
|
|
332
333
|
[t]: o
|
|
333
334
|
});
|
|
334
|
-
},
|
|
335
|
+
}, Xe = ({
|
|
335
336
|
options: e,
|
|
336
337
|
value: t,
|
|
337
338
|
onValueChange: n,
|
|
338
339
|
...r
|
|
339
340
|
}) => /* @__PURE__ */ c(A, { disableContentPadding: !0, ...r, children: /* @__PURE__ */ c(ge, { maxHeight: "400px", children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ c(
|
|
340
|
-
|
|
341
|
+
xe,
|
|
341
342
|
{
|
|
342
343
|
value: t == null ? void 0 : t[o.value],
|
|
343
344
|
label: o.label,
|
|
@@ -347,7 +348,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
347
348
|
})
|
|
348
349
|
},
|
|
349
350
|
o.value
|
|
350
|
-
)) }) }),
|
|
351
|
+
)) }) }), Ze = ({
|
|
351
352
|
options: e,
|
|
352
353
|
value: t,
|
|
353
354
|
noneSelectedLabel: n,
|
|
@@ -356,7 +357,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
356
357
|
}) => {
|
|
357
358
|
const [s, a] = w(""), i = R(
|
|
358
359
|
() => t ? V(t).map((l) => {
|
|
359
|
-
const S = e == null ? void 0 : e.find((
|
|
360
|
+
const S = e == null ? void 0 : e.find((x) => x.value === l);
|
|
360
361
|
return { value: l, label: (S == null ? void 0 : S.label) ?? l };
|
|
361
362
|
}) : [],
|
|
362
363
|
[e, t]
|
|
@@ -380,7 +381,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
380
381
|
closeMenuOnSelect: !1
|
|
381
382
|
}
|
|
382
383
|
) });
|
|
383
|
-
}, Me = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}),
|
|
384
|
+
}, Me = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), _e = (e, t, n) => ({
|
|
384
385
|
chips: Le(
|
|
385
386
|
e[t],
|
|
386
387
|
e[n]
|
|
@@ -396,7 +397,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
396
397
|
[e]: void 0,
|
|
397
398
|
[t]: void 0
|
|
398
399
|
});
|
|
399
|
-
},
|
|
400
|
+
}, Ie = (e, t, n) => ({
|
|
400
401
|
value: {
|
|
401
402
|
startDate: e[t],
|
|
402
403
|
endDate: e[n]
|
|
@@ -408,7 +409,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
408
409
|
};
|
|
409
410
|
o(s.setFormModelFields(a));
|
|
410
411
|
}
|
|
411
|
-
}),
|
|
412
|
+
}), Ne = ({
|
|
412
413
|
value: e,
|
|
413
414
|
onValueChange: t,
|
|
414
415
|
sectionId: n,
|
|
@@ -418,10 +419,10 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
418
419
|
leftIcon: a,
|
|
419
420
|
...i
|
|
420
421
|
}) => {
|
|
421
|
-
const h = F(), p =
|
|
422
|
+
const h = F(), p = m(), l = R(
|
|
422
423
|
() => ({ dispatch: h, actions: p }),
|
|
423
424
|
[p, h]
|
|
424
|
-
), [S,
|
|
425
|
+
), [S, x] = w("startDate"), f = R(() => ie(e), [e]), E = u(
|
|
425
426
|
(k) => {
|
|
426
427
|
t(de(k), l);
|
|
427
428
|
},
|
|
@@ -438,7 +439,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
438
439
|
children: /* @__PURE__ */ c(B, { flex: 1, alignItems: "center", children: /* @__PURE__ */ c(B, { background: "white", indent: !0, children: /* @__PURE__ */ c(
|
|
439
440
|
ue,
|
|
440
441
|
{
|
|
441
|
-
setFocusedInput:
|
|
442
|
+
setFocusedInput: x,
|
|
442
443
|
focusedInput: S,
|
|
443
444
|
value: f,
|
|
444
445
|
onValueChange: E,
|
|
@@ -449,31 +450,31 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
449
450
|
);
|
|
450
451
|
};
|
|
451
452
|
export {
|
|
452
|
-
|
|
453
|
-
|
|
453
|
+
Ze as ChipMultiSelectSection,
|
|
454
|
+
Ne as DateRangeCalendarSection,
|
|
454
455
|
be as EmptyChip,
|
|
455
|
-
|
|
456
|
+
xe as FilterCheckbox,
|
|
456
457
|
ge as FilterCheckboxList,
|
|
457
458
|
G as SearchFilterActionsContext,
|
|
458
|
-
|
|
459
|
+
Ge as SearchFilterButton,
|
|
459
460
|
we as SearchFilterChip,
|
|
460
|
-
|
|
461
|
+
Je as SearchFilterChips,
|
|
461
462
|
Se as SearchFilterContext,
|
|
462
463
|
q as SearchFilterDispatchContext,
|
|
463
|
-
|
|
464
|
-
|
|
464
|
+
qe as SearchFilterDrawer,
|
|
465
|
+
Ye as SearchFilterLocalStateContext,
|
|
465
466
|
K as SearchFilterModelContext,
|
|
466
467
|
he as SearchFilterPanelHeader,
|
|
467
468
|
A as SearchFilterSection,
|
|
468
469
|
$ as SearchFilterStateContext,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
Qe as SectionChips,
|
|
471
|
+
Xe as SimpleCheckboxListSection,
|
|
472
|
+
Ke as StickyFooter,
|
|
472
473
|
Re as createChipsForBooleanRecord,
|
|
473
474
|
Le as createChipsForDateRange,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
475
|
+
Ue as createChipsPropsForBooleanRecord,
|
|
476
|
+
_e as createChipsPropsForDateRange,
|
|
477
|
+
Ie as createDateRangeSectionProps,
|
|
477
478
|
ve as createOnClickRemoveOnChipForBooleanRecord,
|
|
478
479
|
Ee as createOnClickRemoveOnChipForDateRange,
|
|
479
480
|
Fe as createSearchFilterActions,
|
|
@@ -481,10 +482,10 @@ export {
|
|
|
481
482
|
fe as createSearchFilterReducer,
|
|
482
483
|
pe as formatColumnIdToHeaderCellLabel,
|
|
483
484
|
d as getReducerIdFor,
|
|
484
|
-
|
|
485
|
-
|
|
485
|
+
me as useLocalSearchFilterState,
|
|
486
|
+
m as useSearchFilterActions,
|
|
486
487
|
F as useSearchFilterDispatch,
|
|
487
|
-
|
|
488
|
+
We as useSearchFilterModel,
|
|
488
489
|
z as useSearchFilterState
|
|
489
490
|
};
|
|
490
491
|
//# 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, upperFirst } from \"lodash\";\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,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vB,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 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,CAA2B;AAChD,MAAI,CAACF;AACG,UAAA,IAAI,MAAM,yCAAyC;AAEpD,SAAAA;AACT,GCVaI,IAA6BN,EAExC,IAAoD,G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AAAL;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"),L=require("@stenajs-webui/modal"),J=require("@stenajs-webui/theme"),d=require("@stenajs-webui/core"),C=require("@stenajs-webui/elements"),Q=require("lodash/lowerCase"),U=require("lodash/upperFirst"),X=require("redux"),l=require("@stenajs-webui/redux"),Z=require("@stenajs-webui/forms"),_=require("@stenajs-webui/select"),w=require("@stenajs-webui/calendar"),E=({header:e="Filter",...t})=>o.jsx(L.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},N=({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(L.Drawer,{floating:!0,isOpen:c,onRequestClose:h,...n,children:o.jsxs(d.Column,{height:"100%",borderRadius:"var(--swui-border-radius)",background:J.cssColor("--lhds-color-ui-50"),children:[o.jsx(E,{onRequestClose:h,header:t,contentRight:r}),o.jsx(d.Box,{spacing:1,indent:1,gap:1,children:e})]})})},ee=({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??D(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,{})]})},D=e=>U(Q(e)),te=({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),re=()=>{const e=a.useContext(B);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},O=function({state:t,dispatch: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})})})})},q=e=>({settings:{open:!1},formModel:e,expandedSections:{values:{}}}),I=(e,t)=>X.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))}),P=(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}`,G=e=>{const[t]=a.useState(()=>I("local",e)),[r]=a.useState(()=>P("local",e.formModel)),[n,c]=a.useReducer(t,e);return{actions:r,state:n,dispatch:c}},ne=function({initialFormModel:t,children:r}){const{state:n,actions:c,dispatch:s}=G(q(t));return o.jsx(O,{state:n,actions:c,dispatch:s,children:r})},V=({label:e,...t})=>o.jsx(C.ContentMenuButton,{children:o.jsxs(d.Row,{gap:2,alignItems:"center",justifyContent:"flex-start",children:[o.jsx(Z.Checkbox,{...t}),o.jsx(d.Text,{children:e})]})}),T=({children:e,maxHeight:t})=>o.jsx(d.Column,{maxHeight:t,overflowY:t?"auto":void 0,spacing:1,children:e}),ce=({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})]})},H=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})},$=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})},oe=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($,{label:s??t,sectionId:t,onClickRemove:c,value:i},i))}):n?o.jsx(H,{sectionId:t,label:n}):null},se=(e,t,r)=>({chips:z(e[t],r),onClickRemoveOnChip:K(e,t)}),z=(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}}),K=(e,t)=>({setFormModelFields:r,value:n})=>{const c={...e[t]};c[n]=!1,r({[t]:c})},ae=({options:e,value:t,onValueChange:r,...n})=>o.jsx(j,{disableContentPadding:!0,...n,children:o.jsx(T,{maxHeight:"400px",children:e==null?void 0:e.map(c=>o.jsx(V,{value:t==null?void 0:t[c.value],label:c.label,onValueChange:s=>r==null?void 0:r({...t,[c.value]:s})},c.value))})}),le=({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(ie(u))},[n]);return o.jsx(j,{...c,children:o.jsx(_.ChipMultiSelect,{options:S,value:h,onValueChange:p,inputValue:s,noneSelectedLabel:r,onInputChange:i,closeMenuOnSelect:!1})})},ie=e=>e.reduce((t,r)=>(t[r.value]=!0,t),{}),ue=(e,t,r)=>({chips:W(e[t],e[r]),onClickRemoveOnChip:Y(t,r)}),W=(e,t)=>!e&&!t?[]:[{value:"dateRange",label:`${e??""} - ${t??""}`}],Y=(e,t)=>({setFormModelFields:r})=>{r({[e]:void 0,[t]:void 0})},de=(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))}}),he=({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=le;exports.DateRangeCalendarSection=he;exports.EmptyChip=H;exports.FilterCheckbox=V;exports.FilterCheckboxList=T;exports.SearchFilterActionsContext=A;exports.SearchFilterButton=ee;exports.SearchFilterChip=$;exports.SearchFilterChips=ce;exports.SearchFilterContext=O;exports.SearchFilterDispatchContext=y;exports.SearchFilterDrawer=N;exports.SearchFilterLocalStateContext=ne;exports.SearchFilterModelContext=B;exports.SearchFilterPanelHeader=E;exports.SearchFilterSection=j;exports.SearchFilterStateContext=M;exports.SectionChips=oe;exports.SimpleCheckboxListSection=ae;exports.StickyFooter=te;exports.createChipsForBooleanRecord=z;exports.createChipsForDateRange=W;exports.createChipsPropsForBooleanRecord=se;exports.createChipsPropsForDateRange=ue;exports.createDateRangeSectionProps=de;exports.createOnClickRemoveOnChipForBooleanRecord=K;exports.createOnClickRemoveOnChipForDateRange=Y;exports.createSearchFilterActions=P;exports.createSearchFilterInitialState=q;exports.createSearchFilterReducer=I;exports.formatColumnIdToHeaderCellLabel=D;exports.getReducerIdFor=x;exports.useLocalSearchFilterState=G;exports.useSearchFilterActions=f;exports.useSearchFilterDispatch=g;exports.useSearchFilterModel=re;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, upperFirst } from \"lodash\";\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":"qcAUaA,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,aAA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AA8B,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 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,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,EACAb,MAACwB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AO,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.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "mattias800",
|
|
@@ -33,15 +33,15 @@
|
|
|
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.
|
|
36
|
+
"@stenajs-webui/calendar": "20.6.5",
|
|
37
|
+
"@stenajs-webui/core": "20.6.5",
|
|
38
|
+
"@stenajs-webui/elements": "20.6.5",
|
|
39
|
+
"@stenajs-webui/forms": "20.6.5",
|
|
40
|
+
"@stenajs-webui/modal": "20.6.5",
|
|
41
|
+
"@stenajs-webui/panels": "20.6.5",
|
|
42
|
+
"@stenajs-webui/redux": "20.6.5",
|
|
43
|
+
"@stenajs-webui/select": "20.6.5",
|
|
44
|
+
"@stenajs-webui/theme": "20.6.5",
|
|
45
45
|
"date-fns": "2.26.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"files": [
|
|
73
73
|
"dist"
|
|
74
74
|
],
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "bfe4e7a5e7210acaa34723383deb3ca66ecdd5ef"
|
|
76
76
|
}
|