@stenajs-webui/filter 19.0.0-next.26 → 19.0.0-next.28
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/features/search-filter/features/filter-checkbox/FilterCheckbox.d.ts +6 -0
- package/dist/features/search-filter/features/filter-checkbox/FilterCheckboxList.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +151 -131
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export * from "./features/search-filter/context/SearchFilterDispatchContext";
|
|
|
16
16
|
export * from "./features/search-filter/hooks/UseLocalSearchFilterState";
|
|
17
17
|
export * from "./features/search-filter/redux/SearchFilterRedux";
|
|
18
18
|
export * from "./features/search-filter/types/FilterEntity";
|
|
19
|
+
export * from "./features/search-filter/features/filter-checkbox/FilterCheckbox";
|
|
20
|
+
export * from "./features/search-filter/features/filter-checkbox/FilterCheckboxList";
|
|
19
21
|
export * from "./features/search-filter/features/chips/SearchFilterChips";
|
|
20
22
|
export * from "./features/search-filter/features/chips/SectionChips";
|
|
21
23
|
export * from "./features/search-filter/features/chips/SearchFilterChip";
|
package/dist/index.es.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
(function(){"use strict";try{var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e)}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { jsx as c, jsxs as
|
|
3
|
-
import { createContext as
|
|
2
|
+
import { jsx as c, jsxs as M, Fragment as H } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as b, useContext as L, useCallback as u, useState as R, useReducer as J, useMemo as v } from "react";
|
|
4
4
|
import { DrawerHeader as Q, Drawer as U } from "@stenajs-webui/modal";
|
|
5
5
|
import { cssColor as X } from "@stenajs-webui/theme";
|
|
6
|
-
import { Column as O, Box as
|
|
7
|
-
import { SecondaryButton as
|
|
8
|
-
import { upperFirst as
|
|
9
|
-
import { combineReducers as
|
|
10
|
-
import { reducerIdGate as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { ChipMultiSelect as
|
|
14
|
-
import { stringsToDateRange as
|
|
15
|
-
const
|
|
16
|
-
const e =
|
|
6
|
+
import { Column as O, Box as B, Row as A, Space as Z, Text as _, truthyKeysAsList as D } from "@stenajs-webui/core";
|
|
7
|
+
import { SecondaryButton as I, stenaSlidersMini as N, MenuButton as ee, Spinner as te, Banner as ne, FlatButton as $, ContentMenuButton as re, Chip as z } from "@stenajs-webui/elements";
|
|
8
|
+
import { upperFirst as oe, lowerCase as ce } from "lodash";
|
|
9
|
+
import { combineReducers as se } from "redux";
|
|
10
|
+
import { reducerIdGate as y, createValueByIdReducer as ie, createEntityReducer as j, reducerIdGateAction as f, createEntityActions as g, createValueByIdActions as w } from "@stenajs-webui/redux";
|
|
11
|
+
import { Checkbox as ae } from "@stenajs-webui/forms";
|
|
12
|
+
import le from "@emotion/styled";
|
|
13
|
+
import { ChipMultiSelect as de } from "@stenajs-webui/select";
|
|
14
|
+
import { stringsToDateRange as ue, dateRangeToStrings as he, DateRangeCalendar as pe } from "@stenajs-webui/calendar";
|
|
15
|
+
const Se = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, header: e }), q = b(null), G = () => {
|
|
16
|
+
const e = L(q);
|
|
17
17
|
if (!e)
|
|
18
18
|
throw new Error(
|
|
19
19
|
"Missing search filter context, wrap components with SearchFilterContext component."
|
|
20
20
|
);
|
|
21
21
|
return e;
|
|
22
|
-
},
|
|
23
|
-
const e =
|
|
22
|
+
}, K = b(null), m = () => {
|
|
23
|
+
const e = L(K);
|
|
24
24
|
if (!e)
|
|
25
25
|
throw new Error("Missing search filter dispatch context.");
|
|
26
26
|
return e;
|
|
27
|
-
},
|
|
28
|
-
const e =
|
|
27
|
+
}, W = b(null), x = () => {
|
|
28
|
+
const e = L(W);
|
|
29
29
|
if (!e)
|
|
30
30
|
throw new Error("Missing search filter actions context.");
|
|
31
31
|
return e;
|
|
32
|
-
},
|
|
32
|
+
}, Ke = ({
|
|
33
33
|
children: e,
|
|
34
34
|
header: t,
|
|
35
35
|
headerContentRight: n,
|
|
@@ -37,7 +37,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
37
37
|
}) => {
|
|
38
38
|
const {
|
|
39
39
|
settings: { open: o }
|
|
40
|
-
} = G(), s =
|
|
40
|
+
} = G(), s = m(), i = x(), l = u(() => {
|
|
41
41
|
s(i.closeFilters());
|
|
42
42
|
}, [i, s]);
|
|
43
43
|
return /* @__PURE__ */ c(
|
|
@@ -47,7 +47,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
47
47
|
isOpen: o,
|
|
48
48
|
onRequestClose: l,
|
|
49
49
|
...r,
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ M(
|
|
51
51
|
O,
|
|
52
52
|
{
|
|
53
53
|
height: "100%",
|
|
@@ -55,28 +55,28 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
55
55
|
background: X("--lhds-color-ui-50"),
|
|
56
56
|
children: [
|
|
57
57
|
/* @__PURE__ */ c(
|
|
58
|
-
|
|
58
|
+
Se,
|
|
59
59
|
{
|
|
60
60
|
onRequestClose: l,
|
|
61
61
|
header: t,
|
|
62
62
|
contentRight: n
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
/* @__PURE__ */ c(
|
|
65
|
+
/* @__PURE__ */ c(B, { spacing: 1, indent: 1, gap: 1, children: e })
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
)
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
},
|
|
71
|
+
}, We = ({
|
|
72
72
|
label: e = "Filters",
|
|
73
|
-
leftIcon: t =
|
|
73
|
+
leftIcon: t = N
|
|
74
74
|
}) => {
|
|
75
|
-
const n =
|
|
75
|
+
const n = m(), r = x(), o = u(() => {
|
|
76
76
|
n(r.openFilters());
|
|
77
77
|
}, [r, n]);
|
|
78
78
|
return /* @__PURE__ */ c(
|
|
79
|
-
|
|
79
|
+
I,
|
|
80
80
|
{
|
|
81
81
|
label: e,
|
|
82
82
|
leftIcon: t,
|
|
@@ -95,22 +95,22 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
95
95
|
contentRight: S
|
|
96
96
|
}) {
|
|
97
97
|
var V;
|
|
98
|
-
const a = G(), C =
|
|
99
|
-
C(
|
|
100
|
-
}, [
|
|
101
|
-
return /* @__PURE__ */
|
|
98
|
+
const a = G(), C = m(), F = x(), h = (V = a.expandedSections.values[t]) != null ? V : !1, E = u(() => {
|
|
99
|
+
C(F.setSectionExpanded(t, !h));
|
|
100
|
+
}, [F, C, h, t]), k = n != null ? n : Ce(t);
|
|
101
|
+
return /* @__PURE__ */ M(H, { children: [
|
|
102
102
|
/* @__PURE__ */ c(
|
|
103
|
-
|
|
103
|
+
ee,
|
|
104
104
|
{
|
|
105
|
-
label:
|
|
105
|
+
label: k,
|
|
106
106
|
leftIcon: p,
|
|
107
107
|
expandable: !0,
|
|
108
108
|
expanded: h,
|
|
109
109
|
selected: h,
|
|
110
|
-
onClick:
|
|
110
|
+
onClick: E,
|
|
111
111
|
right: S,
|
|
112
|
-
children: r ? /* @__PURE__ */ c(A, { spacing: !0, justifyContent: "center", flex: 1, children: /* @__PURE__ */ c(
|
|
113
|
-
|
|
112
|
+
children: r ? /* @__PURE__ */ c(A, { spacing: !0, justifyContent: "center", flex: 1, children: /* @__PURE__ */ c(te, { size: "small" }) }) : o ? /* @__PURE__ */ c(
|
|
113
|
+
ne,
|
|
114
114
|
{
|
|
115
115
|
variant: "error",
|
|
116
116
|
text: o,
|
|
@@ -121,7 +121,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
121
121
|
),
|
|
122
122
|
h && /* @__PURE__ */ c(Z, {})
|
|
123
123
|
] });
|
|
124
|
-
},
|
|
124
|
+
}, Ce = (e) => oe(ce(e)), Ye = ({
|
|
125
125
|
children: e,
|
|
126
126
|
...t
|
|
127
127
|
}) => /* @__PURE__ */ c(
|
|
@@ -136,46 +136,46 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
136
136
|
...t,
|
|
137
137
|
children: e
|
|
138
138
|
}
|
|
139
|
-
), Y =
|
|
140
|
-
const e =
|
|
139
|
+
), Y = b(null), Je = () => {
|
|
140
|
+
const e = L(Y);
|
|
141
141
|
if (!e)
|
|
142
142
|
throw new Error(
|
|
143
143
|
"Missing search filter context, wrap components with SearchFilterContext component."
|
|
144
144
|
);
|
|
145
145
|
return e;
|
|
146
|
-
},
|
|
146
|
+
}, fe = function({
|
|
147
147
|
state: t,
|
|
148
148
|
dispatch: n,
|
|
149
149
|
actions: r,
|
|
150
150
|
children: o
|
|
151
151
|
}) {
|
|
152
152
|
return /* @__PURE__ */ c(
|
|
153
|
-
|
|
153
|
+
K.Provider,
|
|
154
154
|
{
|
|
155
155
|
value: n,
|
|
156
|
-
children: /* @__PURE__ */ c(
|
|
156
|
+
children: /* @__PURE__ */ c(W.Provider, { value: r, children: /* @__PURE__ */ c(q.Provider, { value: t, children: /* @__PURE__ */ c(Y.Provider, { value: t.formModel, children: o }) }) })
|
|
157
157
|
}
|
|
158
158
|
);
|
|
159
|
-
},
|
|
159
|
+
}, Fe = (e) => ({
|
|
160
160
|
settings: {
|
|
161
161
|
open: !1
|
|
162
162
|
},
|
|
163
163
|
formModel: e,
|
|
164
164
|
expandedSections: { values: {} }
|
|
165
|
-
}),
|
|
166
|
-
expandedSections:
|
|
165
|
+
}), me = (e, t) => se({
|
|
166
|
+
expandedSections: y(
|
|
167
167
|
d(e, "expandedSections"),
|
|
168
|
-
|
|
168
|
+
ie(t.expandedSections)
|
|
169
169
|
),
|
|
170
|
-
formModel:
|
|
170
|
+
formModel: y(
|
|
171
171
|
d(e, "formModel"),
|
|
172
|
-
|
|
172
|
+
j(t.formModel)
|
|
173
173
|
),
|
|
174
|
-
settings:
|
|
174
|
+
settings: y(
|
|
175
175
|
d(e, "settings"),
|
|
176
|
-
|
|
176
|
+
j(t.settings)
|
|
177
177
|
)
|
|
178
|
-
}),
|
|
178
|
+
}), xe = (e, t) => ({
|
|
179
179
|
openFilters: () => f(
|
|
180
180
|
d(e, "settings"),
|
|
181
181
|
g().setEntityFields({
|
|
@@ -212,11 +212,11 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
212
212
|
d(e, "expandedSections"),
|
|
213
213
|
w().clearAllValues()
|
|
214
214
|
)
|
|
215
|
-
}), d = (e, t) => `${e}.${t}`,
|
|
215
|
+
}), d = (e, t) => `${e}.${t}`, ge = (e) => {
|
|
216
216
|
const [t] = R(
|
|
217
|
-
() =>
|
|
217
|
+
() => me("local", e)
|
|
218
218
|
), [n] = R(
|
|
219
|
-
() =>
|
|
219
|
+
() => xe(
|
|
220
220
|
"local",
|
|
221
221
|
e.formModel
|
|
222
222
|
)
|
|
@@ -226,28 +226,46 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
226
226
|
state: r,
|
|
227
227
|
dispatch: o
|
|
228
228
|
};
|
|
229
|
-
},
|
|
229
|
+
}, Qe = function({
|
|
230
230
|
initialFormModel: t,
|
|
231
231
|
children: n
|
|
232
232
|
}) {
|
|
233
|
-
const { state: r, actions: o, dispatch: s } =
|
|
234
|
-
|
|
233
|
+
const { state: r, actions: o, dispatch: s } = ge(
|
|
234
|
+
Fe(t)
|
|
235
235
|
);
|
|
236
|
-
return /* @__PURE__ */ c(
|
|
237
|
-
},
|
|
236
|
+
return /* @__PURE__ */ c(fe, { state: r, actions: o, dispatch: s, children: n });
|
|
237
|
+
}, we = ({
|
|
238
|
+
label: e,
|
|
239
|
+
...t
|
|
240
|
+
}) => /* @__PURE__ */ c(re, { children: /* @__PURE__ */ M(A, { gap: 2, alignItems: "center", justifyContent: "flex-start", children: [
|
|
241
|
+
/* @__PURE__ */ c(ae, { ...t }),
|
|
242
|
+
/* @__PURE__ */ c(_, { children: e })
|
|
243
|
+
] }) }), Re = ({
|
|
244
|
+
children: e,
|
|
245
|
+
maxHeight: t
|
|
246
|
+
}) => /* @__PURE__ */ c(
|
|
247
|
+
O,
|
|
248
|
+
{
|
|
249
|
+
maxHeight: t,
|
|
250
|
+
overflowY: t ? "auto" : void 0,
|
|
251
|
+
gap: 1,
|
|
252
|
+
spacing: 1,
|
|
253
|
+
children: e
|
|
254
|
+
}
|
|
255
|
+
), T = le.div`
|
|
238
256
|
padding: calc(var(--swui-metrics-spacing) / 2)
|
|
239
257
|
calc(var(--swui-metrics-indent) / 2);
|
|
240
|
-
`,
|
|
258
|
+
`, Ue = ({
|
|
241
259
|
children: e,
|
|
242
260
|
disableClearAllButton: t = !1
|
|
243
261
|
}) => {
|
|
244
|
-
const n =
|
|
262
|
+
const n = m(), r = x(), o = u(
|
|
245
263
|
() => n(r.clearFormModel()),
|
|
246
264
|
[r, n]
|
|
247
265
|
);
|
|
248
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ M(A, { flexWrap: "wrap", children: [
|
|
249
267
|
e,
|
|
250
|
-
!t && /* @__PURE__ */ c(
|
|
268
|
+
!t && /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(
|
|
251
269
|
$,
|
|
252
270
|
{
|
|
253
271
|
size: "small",
|
|
@@ -256,21 +274,21 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
256
274
|
}
|
|
257
275
|
) })
|
|
258
276
|
] });
|
|
259
|
-
},
|
|
277
|
+
}, ve = function({
|
|
260
278
|
label: t,
|
|
261
279
|
sectionId: n
|
|
262
280
|
}) {
|
|
263
|
-
const r =
|
|
281
|
+
const r = m(), o = x(), s = u(() => {
|
|
264
282
|
r(o.clearExpandedSections()), r(o.expandSection(n)), r(o.openFilters());
|
|
265
283
|
}, [o, r, n]);
|
|
266
|
-
return /* @__PURE__ */ c(
|
|
267
|
-
},
|
|
284
|
+
return /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(z, { label: t, variant: "secondary", onClick: s }) });
|
|
285
|
+
}, Me = function({
|
|
268
286
|
sectionId: t,
|
|
269
287
|
label: n,
|
|
270
288
|
value: r,
|
|
271
289
|
onClickRemove: o
|
|
272
290
|
}) {
|
|
273
|
-
const s =
|
|
291
|
+
const s = m(), i = x(), l = u(
|
|
274
292
|
(a) => s(i.setFormModelFields(a)),
|
|
275
293
|
[s, i]
|
|
276
294
|
), p = u(() => {
|
|
@@ -278,7 +296,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
278
296
|
}, [o, l, r]), S = u(() => {
|
|
279
297
|
s(i.clearExpandedSections()), s(i.expandSection(t)), s(i.openFilters());
|
|
280
298
|
}, [i, s, t]);
|
|
281
|
-
return /* @__PURE__ */ c(
|
|
299
|
+
return /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(
|
|
282
300
|
z,
|
|
283
301
|
{
|
|
284
302
|
label: n != null ? n : t,
|
|
@@ -286,14 +304,14 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
286
304
|
onClickRemove: o ? p : void 0
|
|
287
305
|
}
|
|
288
306
|
) });
|
|
289
|
-
},
|
|
307
|
+
}, Xe = function({
|
|
290
308
|
sectionId: t,
|
|
291
309
|
chips: n,
|
|
292
310
|
emptyChipLabel: r,
|
|
293
311
|
onClickRemoveOnChip: o
|
|
294
312
|
}) {
|
|
295
|
-
return n != null && n.length ? /* @__PURE__ */ c(
|
|
296
|
-
|
|
313
|
+
return n != null && n.length ? /* @__PURE__ */ c(H, { children: n.map(({ label: s, value: i }) => /* @__PURE__ */ c(
|
|
314
|
+
Me,
|
|
297
315
|
{
|
|
298
316
|
label: s != null ? s : t,
|
|
299
317
|
sectionId: t,
|
|
@@ -301,42 +319,42 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
301
319
|
value: i
|
|
302
320
|
},
|
|
303
321
|
i
|
|
304
|
-
)) }) : r ? /* @__PURE__ */ c(
|
|
305
|
-
},
|
|
306
|
-
chips:
|
|
322
|
+
)) }) : r ? /* @__PURE__ */ c(ve, { sectionId: t, label: r }) : null;
|
|
323
|
+
}, Ze = (e, t, n) => ({
|
|
324
|
+
chips: be(
|
|
307
325
|
e[t],
|
|
308
326
|
n
|
|
309
327
|
),
|
|
310
|
-
onClickRemoveOnChip:
|
|
328
|
+
onClickRemoveOnChip: Le(
|
|
311
329
|
e,
|
|
312
330
|
t
|
|
313
331
|
)
|
|
314
|
-
}),
|
|
332
|
+
}), be = (e, t) => D(e).map((n) => {
|
|
315
333
|
var o;
|
|
316
334
|
const r = t == null ? void 0 : t.find((s) => s.value === n);
|
|
317
335
|
return { value: n, label: (o = r == null ? void 0 : r.label) != null ? o : n };
|
|
318
|
-
}),
|
|
336
|
+
}), Le = (e, t) => ({ setFormModelFields: n, value: r }) => {
|
|
319
337
|
const o = { ...e[t] };
|
|
320
338
|
o[r] = !1, n({
|
|
321
339
|
[t]: o
|
|
322
340
|
});
|
|
323
|
-
},
|
|
341
|
+
}, _e = ({
|
|
324
342
|
options: e,
|
|
325
343
|
value: t,
|
|
326
344
|
onValueChange: n,
|
|
327
345
|
...r
|
|
328
|
-
}) => /* @__PURE__ */ c(P, { disableContentPadding: !0, ...r, children: /* @__PURE__ */ c(
|
|
329
|
-
|
|
346
|
+
}) => /* @__PURE__ */ c(P, { disableContentPadding: !0, ...r, children: /* @__PURE__ */ c(Re, { maxHeight: "400px", children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ c(
|
|
347
|
+
we,
|
|
330
348
|
{
|
|
331
|
-
tabIndex: -1,
|
|
332
349
|
value: t == null ? void 0 : t[o.value],
|
|
333
350
|
label: o.label,
|
|
334
351
|
onValueChange: (s) => n == null ? void 0 : n({
|
|
335
352
|
...t,
|
|
336
353
|
[o.value]: s
|
|
337
354
|
})
|
|
338
|
-
}
|
|
339
|
-
|
|
355
|
+
},
|
|
356
|
+
o.value
|
|
357
|
+
)) }) }), Ie = ({
|
|
340
358
|
options: e,
|
|
341
359
|
value: t,
|
|
342
360
|
noneSelectedLabel: n,
|
|
@@ -345,21 +363,21 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
345
363
|
}) => {
|
|
346
364
|
const [s, i] = R(""), l = v(
|
|
347
365
|
() => t ? D(t).map((a) => {
|
|
348
|
-
var
|
|
366
|
+
var F;
|
|
349
367
|
const C = e == null ? void 0 : e.find((h) => h.value === a);
|
|
350
|
-
return { value: a, label: (
|
|
368
|
+
return { value: a, label: (F = C == null ? void 0 : C.label) != null ? F : a };
|
|
351
369
|
}) : [],
|
|
352
370
|
[e, t]
|
|
353
371
|
), p = v(() => e == null ? void 0 : e.filter(
|
|
354
372
|
(a) => a.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1 || a.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1
|
|
355
373
|
), [e, s]), S = u(
|
|
356
374
|
(a) => {
|
|
357
|
-
r == null || r(
|
|
375
|
+
r == null || r(Ee(a));
|
|
358
376
|
},
|
|
359
377
|
[r]
|
|
360
378
|
);
|
|
361
379
|
return /* @__PURE__ */ c(P, { ...o, children: /* @__PURE__ */ c(
|
|
362
|
-
|
|
380
|
+
de,
|
|
363
381
|
{
|
|
364
382
|
options: p,
|
|
365
383
|
value: l,
|
|
@@ -370,23 +388,23 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
370
388
|
closeMenuOnSelect: !1
|
|
371
389
|
}
|
|
372
390
|
) });
|
|
373
|
-
},
|
|
374
|
-
chips:
|
|
391
|
+
}, Ee = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ne = (e, t, n) => ({
|
|
392
|
+
chips: ke(
|
|
375
393
|
e[t],
|
|
376
394
|
e[n]
|
|
377
395
|
),
|
|
378
|
-
onClickRemoveOnChip:
|
|
396
|
+
onClickRemoveOnChip: ye(
|
|
379
397
|
t,
|
|
380
398
|
n
|
|
381
399
|
)
|
|
382
|
-
}),
|
|
400
|
+
}), ke = (e, t) => !e && !t ? [] : [
|
|
383
401
|
{ value: "dateRange", label: `${e != null ? e : ""} - ${t != null ? t : ""}` }
|
|
384
|
-
],
|
|
402
|
+
], ye = (e, t) => ({ setFormModelFields: n }) => {
|
|
385
403
|
n({
|
|
386
404
|
[e]: void 0,
|
|
387
405
|
[t]: void 0
|
|
388
406
|
});
|
|
389
|
-
},
|
|
407
|
+
}, et = (e, t, n) => ({
|
|
390
408
|
value: {
|
|
391
409
|
startDate: e[t],
|
|
392
410
|
endDate: e[n]
|
|
@@ -398,7 +416,7 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
398
416
|
};
|
|
399
417
|
o(s.setFormModelFields(i));
|
|
400
418
|
}
|
|
401
|
-
}),
|
|
419
|
+
}), tt = ({
|
|
402
420
|
value: e,
|
|
403
421
|
onValueChange: t,
|
|
404
422
|
sectionId: n,
|
|
@@ -408,12 +426,12 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
408
426
|
leftIcon: i,
|
|
409
427
|
...l
|
|
410
428
|
}) => {
|
|
411
|
-
const p =
|
|
429
|
+
const p = m(), S = x(), a = v(
|
|
412
430
|
() => ({ dispatch: p, actions: S }),
|
|
413
431
|
[S, p]
|
|
414
|
-
), [C,
|
|
415
|
-
(
|
|
416
|
-
t(
|
|
432
|
+
), [C, F] = R("startDate"), h = v(() => ue(e), [e]), E = u(
|
|
433
|
+
(k) => {
|
|
434
|
+
t(he(k), a);
|
|
417
435
|
},
|
|
418
436
|
[t, a]
|
|
419
437
|
);
|
|
@@ -425,13 +443,13 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
425
443
|
sectionId: n,
|
|
426
444
|
contentRight: r,
|
|
427
445
|
disableContentPadding: o,
|
|
428
|
-
children: /* @__PURE__ */ c(
|
|
429
|
-
|
|
446
|
+
children: /* @__PURE__ */ c(B, { flex: 1, alignItems: "center", children: /* @__PURE__ */ c(B, { background: "white", indent: !0, children: /* @__PURE__ */ c(
|
|
447
|
+
pe,
|
|
430
448
|
{
|
|
431
|
-
setFocusedInput:
|
|
449
|
+
setFocusedInput: F,
|
|
432
450
|
focusedInput: C,
|
|
433
451
|
value: h,
|
|
434
|
-
onValueChange:
|
|
452
|
+
onValueChange: E,
|
|
435
453
|
...l
|
|
436
454
|
}
|
|
437
455
|
) }) })
|
|
@@ -439,40 +457,42 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Q, { ...t, head
|
|
|
439
457
|
);
|
|
440
458
|
};
|
|
441
459
|
export {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
460
|
+
Ie as ChipMultiSelectSection,
|
|
461
|
+
tt as DateRangeCalendarSection,
|
|
462
|
+
ve as EmptyChip,
|
|
463
|
+
we as FilterCheckbox,
|
|
464
|
+
Re as FilterCheckboxList,
|
|
465
|
+
W as SearchFilterActionsContext,
|
|
466
|
+
We as SearchFilterButton,
|
|
467
|
+
Me as SearchFilterChip,
|
|
468
|
+
Ue as SearchFilterChips,
|
|
469
|
+
fe as SearchFilterContext,
|
|
470
|
+
K as SearchFilterDispatchContext,
|
|
471
|
+
Ke as SearchFilterDrawer,
|
|
472
|
+
Qe as SearchFilterLocalStateContext,
|
|
453
473
|
Y as SearchFilterModelContext,
|
|
454
|
-
|
|
474
|
+
Se as SearchFilterPanelHeader,
|
|
455
475
|
P as SearchFilterSection,
|
|
456
476
|
q as SearchFilterStateContext,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
477
|
+
Xe as SectionChips,
|
|
478
|
+
_e as SimpleCheckboxListSection,
|
|
479
|
+
Ye as StickyFooter,
|
|
480
|
+
be as createChipsForBooleanRecord,
|
|
481
|
+
ke as createChipsForDateRange,
|
|
482
|
+
Ze as createChipsPropsForBooleanRecord,
|
|
483
|
+
Ne as createChipsPropsForDateRange,
|
|
484
|
+
et as createDateRangeSectionProps,
|
|
485
|
+
Le as createOnClickRemoveOnChipForBooleanRecord,
|
|
486
|
+
ye as createOnClickRemoveOnChipForDateRange,
|
|
487
|
+
xe as createSearchFilterActions,
|
|
488
|
+
Fe as createSearchFilterInitialState,
|
|
489
|
+
me as createSearchFilterReducer,
|
|
490
|
+
Ce as formatColumnIdToHeaderCellLabel,
|
|
471
491
|
d as getReducerIdFor,
|
|
472
|
-
|
|
492
|
+
ge as useLocalSearchFilterState,
|
|
473
493
|
x as useSearchFilterActions,
|
|
474
|
-
|
|
475
|
-
|
|
494
|
+
m as useSearchFilterDispatch,
|
|
495
|
+
Je as useSearchFilterModel,
|
|
476
496
|
G as useSearchFilterState
|
|
477
497
|
};
|
|
478
498
|
//# 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/chips/ChipSpacer.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 styled from \"@emotion/styled\";\n\nexport const ChipSpacer = styled.div`\n padding: calc(var(--swui-metrics-spacing) / 2)\n calc(var(--swui-metrics-indent) / 2);\n`;\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { ChipSpacer } from \"./ChipSpacer\";\nimport { FlatButton } 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\"}>\n {children}\n {!disableClearAllButton && (\n <ChipSpacer>\n <FlatButton\n size={\"small\"}\n label={\"Clear all\"}\n onClick={onClickClearAll}\n />\n </ChipSpacer>\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 (\n <ChipSpacer>\n <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />\n </ChipSpacer>\n );\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 <ChipSpacer>\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n </ChipSpacer>\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 { Column, Row } from \"@stenajs-webui/core\";\nimport {\n CheckboxWithLabel,\n ValueAndOnValueChangeProps,\n} from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\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 <Column maxHeight={\"400px\"} overflowY={\"auto\"} flex={1} gap={1} spacing={1}>\n {options?.map((d) => (\n <Row key={d.value} alignItems={\"center\"}>\n <CheckboxWithLabel\n tabIndex={-1}\n value={value?.[d.value]}\n label={d.label}\n onValueChange={(v) =>\n onValueChange?.({\n ...value,\n [d.value]: v,\n })\n }\n />\n </Row>\n ))}\n </Column>\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","_a","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","ChipSpacer","styled","SearchFilterChips","disableClearAllButton","onClickClearAll","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","CheckboxWithLabel","v","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","filteredOptions","p","onValueChangeInternal","createBooleanRecordFromValue","ChipMultiSelect","sum","item","createChipsPropsForDateRange","startDateFieldName","endDateFieldName","createChipsForDateRange","createOnClickRemoveOnChipForDateRange","startDate","endDate","createDateRangeSectionProps","DateRangeCalendarSection","dateRangeCalendarProps","focusedInput","setFocusedInput","dateRangeValue","stringsToDateRange","onValueChangeHandler","dateRangeToStrings","DateRangeCalendar"],"mappings":";;;;;;;;;;;;;AAUO,MAAMA,KAET,CAAC,EAAE,QAAAC,IAAS,aAAaC,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,CAA2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AAY,SAAS,QAAM,IAC9B,UAAA,gBAAAxB;AAAA,QAACgJ;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/ChipSpacer.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 gap={1}\n spacing={1}\n >\n {children}\n </Column>\n );\n};\n","import styled from \"@emotion/styled\";\n\nexport const ChipSpacer = styled.div`\n padding: calc(var(--swui-metrics-spacing) / 2)\n calc(var(--swui-metrics-indent) / 2);\n`;\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { ChipSpacer } from \"./ChipSpacer\";\nimport { FlatButton } 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\"}>\n {children}\n {!disableClearAllButton && (\n <ChipSpacer>\n <FlatButton\n size={\"small\"}\n label={\"Clear all\"}\n onClick={onClickClearAll}\n />\n </ChipSpacer>\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 (\n <ChipSpacer>\n <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />\n </ChipSpacer>\n );\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 <ChipSpacer>\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n </ChipSpacer>\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","_a","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","ChipSpacer","styled","SearchFilterChips","disableClearAllButton","onClickClearAll","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":";;;;;;;;;;;;;AAUO,MAAMA,KAET,CAAC,EAAE,QAAAC,IAAS,aAAaC,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,GCVa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,EAAAgC,GAAmBrD,CAAK,GAAGW,CAAO;AAAA,IAClD;AAAA,IACA,CAACU,GAAeV,CAAO;AAAA,EAAA;AAIvB,SAAA,gBAAA3G;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,QAACsJ;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,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e)}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),a=require("react"),q=require("@stenajs-webui/modal"),U=require("@stenajs-webui/theme"),d=require("@stenajs-webui/core"),S=require("@stenajs-webui/elements"),O=require("lodash"),X=require("redux"),i=require("@stenajs-webui/redux"),Z=require("@stenajs-webui/forms"),N=require("@emotion/styled"),ee=require("@stenajs-webui/select"),M=require("@stenajs-webui/calendar"),te=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},re=te(N),P=({header:e="Filter",...t})=>c.jsx(q.DrawerHeader,{...t,header:e}),k=a.createContext(null),v=()=>{const e=a.useContext(k);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},y=a.createContext(null),f=()=>{const e=a.useContext(y);if(!e)throw new Error("Missing search filter dispatch context.");return e},A=a.createContext(null),g=()=>{const e=a.useContext(A);if(!e)throw new Error("Missing search filter actions context.");return e},ne=({children:e,header:t,headerContentRight:r,...n})=>{const{settings:{open:s}}=v(),o=f(),l=g(),h=a.useCallback(()=>{o(l.closeFilters())},[l,o]);return c.jsx(q.Drawer,{floating:!0,isOpen:s,onRequestClose:h,...n,children:c.jsxs(d.Column,{height:"100%",borderRadius:"var(--swui-border-radius)",background:U.cssColor("--lhds-color-ui-50"),children:[c.jsx(P,{onRequestClose:h,header:t,contentRight:r}),c.jsx(d.Box,{spacing:1,indent:1,gap:1,children:e})]})})},ce=({label:e="Filters",leftIcon:t=S.stenaSlidersMini})=>{const r=f(),n=g(),s=a.useCallback(()=>{r(n.openFilters())},[n,r]);return c.jsx(S.SecondaryButton,{label:e,leftIcon:t,onClick:s})},R=function({sectionId:t,label:r,loading:n,error:s,onRetry:o,disableContentPadding:l,children:h,leftIcon:p,contentRight:F}){var E;const u=v(),j=f(),m=g(),C=(E=u.expandedSections.values[t])!=null?E:!1,b=a.useCallback(()=>{j(m.setSectionExpanded(t,!C))},[m,j,C,t]),w=r!=null?r:D(t);return c.jsxs(c.Fragment,{children:[c.jsx(S.MenuButton,{label:w,leftIcon:p,expandable:!0,expanded:C,selected:C,onClick:b,right:F,children:n?c.jsx(d.Row,{spacing:!0,justifyContent:"center",flex:1,children:c.jsx(S.Spinner,{size:"small"})}):s?c.jsx(S.Banner,{variant:"error",text:s,contentRight:o?c.jsx(S.FlatButton,{label:"Retry",onClick:o}):null}):h}),C&&c.jsx(d.Space,{})]})},D=e=>O.upperFirst(O.lowerCase(e)),se=({children:e,...t})=>c.jsx(d.Column,{style:{marginTop:"auto"},justifyContent:"center",spacing:2,indent:!0,shadow:"popover",zIndex:1,...t,children:e}),L=a.createContext(null),oe=()=>{const e=a.useContext(L);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},I=function({state:t,dispatch:r,actions:n,children:s}){return c.jsx(y.Provider,{value:r,children:c.jsx(A.Provider,{value:n,children:c.jsx(k.Provider,{value:t,children:c.jsx(L.Provider,{value:t.formModel,children:s})})})})},G=e=>({settings:{open:!1},formModel:e,expandedSections:{values:{}}}),V=(e,t)=>X.combineReducers({expandedSections:i.reducerIdGate(x(e,"expandedSections"),i.createValueByIdReducer(t.expandedSections)),formModel:i.reducerIdGate(x(e,"formModel"),i.createEntityReducer(t.formModel)),settings:i.reducerIdGate(x(e,"settings"),i.createEntityReducer(t.settings))}),T=(e,t)=>({openFilters:()=>i.reducerIdGateAction(x(e,"settings"),i.createEntityActions().setEntityFields({open:!0})),closeFilters:()=>i.reducerIdGateAction(x(e,"settings"),i.createEntityActions().setEntityFields({open:!1})),setFormModelFields:r=>i.reducerIdGateAction(x(e,"formModel"),i.createEntityActions().setEntityFields(r)),clearFormModel:()=>i.reducerIdGateAction(x(e,"formModel"),i.createEntityActions().setEntity(t)),expandSection:r=>i.reducerIdGateAction(x(e,"expandedSections"),i.createValueByIdActions().setValue(r,!0)),collapseSection:r=>i.reducerIdGateAction(x(e,"expandedSections"),i.createValueByIdActions().setValue(r,!1)),setSectionExpanded:(r,n)=>i.reducerIdGateAction(x(e,"expandedSections"),i.createValueByIdActions().setValue(r,n)),clearExpandedSections:()=>i.reducerIdGateAction(x(e,"expandedSections"),i.createValueByIdActions().clearAllValues())}),x=(e,t)=>`${e}.${t}`,H=e=>{const[t]=a.useState(()=>V("local",e)),[r]=a.useState(()=>T("local",e.formModel)),[n,s]=a.useReducer(t,e);return{actions:r,state:n,dispatch:s}},ae=function({initialFormModel:t,children:r}){const{state:n,actions:s,dispatch:o}=H(G(t));return c.jsx(I,{state:n,actions:s,dispatch:o,children:r})},_=({label:e,...t})=>c.jsx(S.ContentMenuButton,{children:c.jsxs(d.Row,{gap:2,alignItems:"center",justifyContent:"flex-start",children:[c.jsx(Z.Checkbox,{...t}),c.jsx(d.Text,{children:e})]})}),$=({children:e,maxHeight:t})=>c.jsx(d.Column,{maxHeight:t,overflowY:t?"auto":void 0,gap:1,spacing:1,children:e}),B=re.default.div`
|
|
3
3
|
padding: calc(var(--swui-metrics-spacing) / 2)
|
|
4
4
|
calc(var(--swui-metrics-indent) / 2);
|
|
5
|
-
`,
|
|
5
|
+
`,ie=({children:e,disableClearAllButton:t=!1})=>{const r=f(),n=g(),s=a.useCallback(()=>r(n.clearFormModel()),[n,r]);return c.jsxs(d.Row,{flexWrap:"wrap",children:[e,!t&&c.jsx(B,{children:c.jsx(S.FlatButton,{size:"small",label:"Clear all",onClick:s})})]})},z=function({label:t,sectionId:r}){const n=f(),s=g(),o=a.useCallback(()=>{n(s.clearExpandedSections()),n(s.expandSection(r)),n(s.openFilters())},[s,n,r]);return c.jsx(B,{children:c.jsx(S.Chip,{label:t,variant:"secondary",onClick:o})})},K=function({sectionId:t,label:r,value:n,onClickRemove:s}){const o=f(),l=g(),h=a.useCallback(u=>o(l.setFormModelFields(u)),[o,l]),p=a.useCallback(()=>{s==null||s({value:n,setFormModelFields:h})},[s,h,n]),F=a.useCallback(()=>{o(l.clearExpandedSections()),o(l.expandSection(t)),o(l.openFilters())},[l,o,t]);return c.jsx(B,{children:c.jsx(S.Chip,{label:r!=null?r:t,onClick:F,onClickRemove:s?p:void 0})})},le=function({sectionId:t,chips:r,emptyChipLabel:n,onClickRemoveOnChip:s}){return r!=null&&r.length?c.jsx(c.Fragment,{children:r.map(({label:o,value:l})=>c.jsx(K,{label:o!=null?o:t,sectionId:t,onClickRemove:s,value:l},l))}):n?c.jsx(z,{sectionId:t,label:n}):null},ue=(e,t,r)=>({chips:W(e[t],r),onClickRemoveOnChip:Y(e,t)}),W=(e,t)=>d.truthyKeysAsList(e).map(r=>{var s;const n=t==null?void 0:t.find(o=>o.value===r);return{value:r,label:(s=n==null?void 0:n.label)!=null?s:r}}),Y=(e,t)=>({setFormModelFields:r,value:n})=>{const s={...e[t]};s[n]=!1,r({[t]:s})},de=({options:e,value:t,onValueChange:r,...n})=>c.jsx(R,{disableContentPadding:!0,...n,children:c.jsx($,{maxHeight:"400px",children:e==null?void 0:e.map(s=>c.jsx(_,{value:t==null?void 0:t[s.value],label:s.label,onValueChange:o=>r==null?void 0:r({...t,[s.value]:o})},s.value))})}),he=({options:e,value:t,noneSelectedLabel:r,onValueChange:n,...s})=>{const[o,l]=a.useState(""),h=a.useMemo(()=>t?d.truthyKeysAsList(t).map(u=>{var m;const j=e==null?void 0:e.find(C=>C.value===u);return{value:u,label:(m=j==null?void 0:j.label)!=null?m:u}}):[],[e,t]),p=a.useMemo(()=>e==null?void 0:e.filter(u=>u.value.toLocaleLowerCase().indexOf(o.toLocaleLowerCase())>-1||u.label.toLocaleLowerCase().indexOf(o.toLocaleLowerCase())>-1),[e,o]),F=a.useCallback(u=>{n==null||n(xe(u))},[n]);return c.jsx(R,{...s,children:c.jsx(ee.ChipMultiSelect,{options:p,value:h,onValueChange:F,inputValue:o,noneSelectedLabel:r,onInputChange:l,closeMenuOnSelect:!1})})},xe=e=>e.reduce((t,r)=>(t[r.value]=!0,t),{}),Se=(e,t,r)=>({chips:J(e[t],e[r]),onClickRemoveOnChip:Q(t,r)}),J=(e,t)=>!e&&!t?[]:[{value:"dateRange",label:`${e!=null?e:""} - ${t!=null?t:""}`}],Q=(e,t)=>({setFormModelFields:r})=>{r({[e]:void 0,[t]:void 0})},Ce=(e,t,r)=>({value:{startDate:e[t],endDate:e[r]},onValueChange:(n,{dispatch:s,actions:o})=>{const l={[t]:n.startDate,[r]:n.endDate};s(o.setFormModelFields(l))}}),pe=({value:e,onValueChange:t,sectionId:r,contentRight:n,disableContentPadding:s,label:o,leftIcon:l,...h})=>{const p=f(),F=g(),u=a.useMemo(()=>({dispatch:p,actions:F}),[F,p]),[j,m]=a.useState("startDate"),C=a.useMemo(()=>M.stringsToDateRange(e),[e]),b=a.useCallback(w=>{t(M.dateRangeToStrings(w),u)},[t,u]);return c.jsx(R,{label:o,leftIcon:l,sectionId:r,contentRight:n,disableContentPadding:s,children:c.jsx(d.Box,{flex:1,alignItems:"center",children:c.jsx(d.Box,{background:"white",indent:!0,children:c.jsx(M.DateRangeCalendar,{setFocusedInput:m,focusedInput:j,value:C,onValueChange:b,...h})})})})};exports.ChipMultiSelectSection=he;exports.DateRangeCalendarSection=pe;exports.EmptyChip=z;exports.FilterCheckbox=_;exports.FilterCheckboxList=$;exports.SearchFilterActionsContext=A;exports.SearchFilterButton=ce;exports.SearchFilterChip=K;exports.SearchFilterChips=ie;exports.SearchFilterContext=I;exports.SearchFilterDispatchContext=y;exports.SearchFilterDrawer=ne;exports.SearchFilterLocalStateContext=ae;exports.SearchFilterModelContext=L;exports.SearchFilterPanelHeader=P;exports.SearchFilterSection=R;exports.SearchFilterStateContext=k;exports.SectionChips=le;exports.SimpleCheckboxListSection=de;exports.StickyFooter=se;exports.createChipsForBooleanRecord=W;exports.createChipsForDateRange=J;exports.createChipsPropsForBooleanRecord=ue;exports.createChipsPropsForDateRange=Se;exports.createDateRangeSectionProps=Ce;exports.createOnClickRemoveOnChipForBooleanRecord=Y;exports.createOnClickRemoveOnChipForDateRange=Q;exports.createSearchFilterActions=T;exports.createSearchFilterInitialState=G;exports.createSearchFilterReducer=V;exports.formatColumnIdToHeaderCellLabel=D;exports.getReducerIdFor=x;exports.useLocalSearchFilterState=H;exports.useSearchFilterActions=g;exports.useSearchFilterDispatch=f;exports.useSearchFilterModel=oe;exports.useSearchFilterState=v;
|
|
6
6
|
//# 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/chips/ChipSpacer.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 styled from \"@emotion/styled\";\n\nexport const ChipSpacer = styled.div`\n padding: calc(var(--swui-metrics-spacing) / 2)\n calc(var(--swui-metrics-indent) / 2);\n`;\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { ChipSpacer } from \"./ChipSpacer\";\nimport { FlatButton } 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\"}>\n {children}\n {!disableClearAllButton && (\n <ChipSpacer>\n <FlatButton\n size={\"small\"}\n label={\"Clear all\"}\n onClick={onClickClearAll}\n />\n </ChipSpacer>\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 (\n <ChipSpacer>\n <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />\n </ChipSpacer>\n );\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 <ChipSpacer>\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n </ChipSpacer>\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 { Column, Row } from \"@stenajs-webui/core\";\nimport {\n CheckboxWithLabel,\n ValueAndOnValueChangeProps,\n} from \"@stenajs-webui/forms\";\nimport { BooleanRecord, BooleanRecordOptions } from \"../BooleanRecordTypes\";\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 <Column maxHeight={\"400px\"} overflowY={\"auto\"} flex={1} gap={1} spacing={1}>\n {options?.map((d) => (\n <Row key={d.value} alignItems={\"center\"}>\n <CheckboxWithLabel\n tabIndex={-1}\n value={value?.[d.value]}\n label={d.label}\n onValueChange={(v) =>\n onValueChange?.({\n ...value,\n [d.value]: v,\n })\n }\n />\n </Row>\n ))}\n </Column>\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","_a","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","ChipSpacer","styled","SearchFilterChips","disableClearAllButton","onClickClearAll","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","CheckboxWithLabel","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":"8jBAUaA,EAET,CAAC,CAAE,OAAAC,EAAS,YAAaC,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,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D,CAAM,CAAC,CAC7C,CACF,GCqBagE,GAA2B,CAGtC,CACA,MAAA/C,EACA,cAAAoB,EACA,UAAA7E,EACA,aAAAK,EACA,sBAAAD,EACA,MAAAV,EACA,SAAAC,KACG8G,CACL,IAA8D,CAC5D,MAAMzH,EAAWR,IACXS,EAAUP,IAEV0F,EAAUmB,EAAA,QACd,KAAO,CAAE,SAAAvG,EAAU,QAAAC,IACnB,CAACA,EAASD,CAAQ,CAAA,EAEd,CAAC0H,EAAcC,CAAe,EAClC7D,WAAgC,WAAW,EAEvC8D,EAAiBrB,EAAAA,QAAQ,IAAMsB,EAAAA,mBAAmBpD,CAAK,EAAG,CAACA,CAAK,CAAC,EAEjEqD,EAAuB3H,EAAA,YAC1BsE,GAAqB,CACNoB,EAAAkC,EAAA,mBAAmBtD,CAAK,EAAGW,CAAO,CAClD,EACA,CAACS,EAAeT,CAAO,CAAA,EAIvB,OAAApG,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,IAACgJ,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/ChipSpacer.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 gap={1}\n spacing={1}\n >\n {children}\n </Column>\n );\n};\n","import styled from \"@emotion/styled\";\n\nexport const ChipSpacer = styled.div`\n padding: calc(var(--swui-metrics-spacing) / 2)\n calc(var(--swui-metrics-indent) / 2);\n`;\n","import * as React from \"react\";\nimport { ReactNode, useCallback } from \"react\";\nimport { Row } from \"@stenajs-webui/core\";\nimport { ChipSpacer } from \"./ChipSpacer\";\nimport { FlatButton } 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\"}>\n {children}\n {!disableClearAllButton && (\n <ChipSpacer>\n <FlatButton\n size={\"small\"}\n label={\"Clear all\"}\n onClick={onClickClearAll}\n />\n </ChipSpacer>\n )}\n </Row>\n );\n};\n","import * as React from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 (\n <ChipSpacer>\n <Chip label={label} variant={\"secondary\"} onClick={onClickLabel} />\n </ChipSpacer>\n );\n};\n","import * as React from \"react\";\nimport { useCallback } from \"react\";\nimport { ChipSpacer } from \"./ChipSpacer\";\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 <ChipSpacer>\n <Chip\n label={label ?? sectionId}\n onClick={onClickLabel}\n onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}\n />\n </ChipSpacer>\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","_a","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","ChipSpacer","styled","SearchFilterChips","disableClearAllButton","onClickClearAll","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":"ikBAUaA,EAET,CAAC,CAAE,OAAAC,EAAS,YAAaC,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,GAAwD,CAAC,CACpE,SAAAC,EACA,OAAAd,EACA,mBAAAe,KACGC,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,O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AAA7G,EAAU,QAAAC,IACnB,CAACA,EAASD,CAAQ,CAAA,EAEd,CAACgI,EAAcC,CAAe,EAClCnE,WAAgC,WAAW,EAEvCoE,EAAiBrB,EAAAA,QAAQ,IAAMsB,EAAAA,mBAAmBnD,CAAK,EAAG,CAACA,CAAK,CAAC,EAEjEoD,EAAuBjI,EAAA,YAC1B6E,GAAqB,CACNoB,EAAAiC,EAAA,mBAAmBrD,CAAK,EAAGW,CAAO,CAClD,EACA,CAACS,EAAeT,CAAO,CAAA,EAIvB,OAAA3G,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,IAACsJ,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": "19.0.0-next.
|
|
3
|
+
"version": "19.0.0-next.28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "mattias800",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"deploy": "gh-pages -d example/build"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@stenajs-webui/calendar": "19.0.0-next.
|
|
30
|
-
"@stenajs-webui/core": "19.0.0-next.
|
|
31
|
-
"@stenajs-webui/elements": "19.0.0-next.
|
|
32
|
-
"@stenajs-webui/forms": "19.0.0-next.
|
|
33
|
-
"@stenajs-webui/modal": "19.0.0-next.
|
|
34
|
-
"@stenajs-webui/panels": "19.0.0-next.
|
|
35
|
-
"@stenajs-webui/redux": "19.0.0-next.
|
|
36
|
-
"@stenajs-webui/select": "19.0.0-next.
|
|
37
|
-
"@stenajs-webui/theme": "19.0.0-next.
|
|
29
|
+
"@stenajs-webui/calendar": "19.0.0-next.28",
|
|
30
|
+
"@stenajs-webui/core": "19.0.0-next.28",
|
|
31
|
+
"@stenajs-webui/elements": "19.0.0-next.28",
|
|
32
|
+
"@stenajs-webui/forms": "19.0.0-next.28",
|
|
33
|
+
"@stenajs-webui/modal": "19.0.0-next.28",
|
|
34
|
+
"@stenajs-webui/panels": "19.0.0-next.28",
|
|
35
|
+
"@stenajs-webui/redux": "19.0.0-next.28",
|
|
36
|
+
"@stenajs-webui/select": "19.0.0-next.28",
|
|
37
|
+
"@stenajs-webui/theme": "19.0.0-next.28",
|
|
38
38
|
"date-fns": "2.26.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"files": [
|
|
66
66
|
"dist"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "beca9576dfe1a47d6aaf5122585c227bcad75383"
|
|
69
69
|
}
|