@stenajs-webui/filter 18.12.0 → 18.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +181 -203
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { jsx as c, jsxs as E, Fragment as Q } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as M, useContext as L, useCallback as h, useState as R, useReducer as U, useMemo as v } from "react";
|
|
4
|
+
import { Drawer as X } from "@stenajs-webui/modal";
|
|
5
|
+
import { cssColor as Z } from "@stenajs-webui/theme";
|
|
6
|
+
import { Row as y, Column as B, truthyKeysAsList as $, Text as _, Box as T } from "@stenajs-webui/core";
|
|
7
|
+
import { CardHeader as I, FlatButton as O, stenaTimes as N, stenaSliders as z, SecondaryButton as ee, Spinner as te, Banner as ne, Chip as D } from "@stenajs-webui/elements";
|
|
8
8
|
import { Collapsible as re, CollapsibleContent as H, CollapsibleClickableContent as oe } from "@stenajs-webui/panels";
|
|
9
9
|
import { upperFirst as ce, lowerCase as se } from "lodash";
|
|
10
10
|
import { combineReducers as ie } from "redux";
|
|
@@ -18,18 +18,18 @@ const Se = ({
|
|
|
18
18
|
header: t = "Filters",
|
|
19
19
|
headerIcon: n = z,
|
|
20
20
|
contentRight: r
|
|
21
|
-
}) => /* @__PURE__ */ c(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onClick: e
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
}) => /* @__PURE__ */ c(
|
|
22
|
+
I,
|
|
23
|
+
{
|
|
24
|
+
flex: "0 0 auto",
|
|
25
|
+
contentRight: /* @__PURE__ */ E(y, { gap: 2, children: [
|
|
26
|
+
r,
|
|
27
|
+
/* @__PURE__ */ c(O, { leftIcon: N, onClick: e })
|
|
28
|
+
] }),
|
|
29
|
+
leftIcon: n,
|
|
30
|
+
text: t
|
|
31
|
+
}
|
|
32
|
+
), q = M(null), G = () => {
|
|
33
33
|
const e = L(q);
|
|
34
34
|
if (!e)
|
|
35
35
|
throw new Error(
|
|
@@ -54,28 +54,32 @@ const Se = ({
|
|
|
54
54
|
...o
|
|
55
55
|
}) => {
|
|
56
56
|
const {
|
|
57
|
-
settings: {
|
|
58
|
-
open: s
|
|
59
|
-
}
|
|
57
|
+
settings: { open: s }
|
|
60
58
|
} = G(), i = F(), a = x(), d = h(() => {
|
|
61
59
|
i(a.closeFilters());
|
|
62
60
|
}, [a, i]);
|
|
63
|
-
return /* @__PURE__ */ c(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
children:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
return /* @__PURE__ */ c(
|
|
62
|
+
X,
|
|
63
|
+
{
|
|
64
|
+
background: Z("--lhds-color-ui-50"),
|
|
65
|
+
width: "370px",
|
|
66
|
+
isOpen: s,
|
|
67
|
+
onRequestClose: d,
|
|
68
|
+
...o,
|
|
69
|
+
children: /* @__PURE__ */ E(B, { height: "100%", children: [
|
|
70
|
+
/* @__PURE__ */ c(
|
|
71
|
+
Se,
|
|
72
|
+
{
|
|
73
|
+
onRequestClose: d,
|
|
74
|
+
header: t,
|
|
75
|
+
headerIcon: n,
|
|
76
|
+
contentRight: r
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
e
|
|
80
|
+
] })
|
|
81
|
+
}
|
|
82
|
+
);
|
|
79
83
|
}, We = ({
|
|
80
84
|
label: e = "Filters",
|
|
81
85
|
leftIcon: t = z
|
|
@@ -83,11 +87,14 @@ const Se = ({
|
|
|
83
87
|
const n = F(), r = x(), o = h(() => {
|
|
84
88
|
n(r.openFilters());
|
|
85
89
|
}, [r, n]);
|
|
86
|
-
return /* @__PURE__ */ c(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
return /* @__PURE__ */ c(
|
|
91
|
+
ee,
|
|
92
|
+
{
|
|
93
|
+
label: e,
|
|
94
|
+
leftIcon: t,
|
|
95
|
+
onClick: o
|
|
96
|
+
}
|
|
97
|
+
);
|
|
91
98
|
}, A = function({
|
|
92
99
|
sectionId: t,
|
|
93
100
|
label: n,
|
|
@@ -103,47 +110,40 @@ const Se = ({
|
|
|
103
110
|
const l = G(), C = F(), f = x(), m = (V = l.expandedSections.values[t]) != null ? V : !1, b = h(() => {
|
|
104
111
|
C(f.setSectionExpanded(t, !m));
|
|
105
112
|
}, [f, C, m, t]), J = n != null ? n : fe(t);
|
|
106
|
-
return /* @__PURE__ */ c(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
contentRight: a ? /* @__PURE__ */ c(B, {
|
|
125
|
-
label: "Retry",
|
|
126
|
-
onClick: a
|
|
127
|
-
}) : null
|
|
128
|
-
}) : d ? p : /* @__PURE__ */ c(H, {
|
|
129
|
-
children: p
|
|
130
|
-
})
|
|
131
|
-
});
|
|
113
|
+
return /* @__PURE__ */ c(
|
|
114
|
+
re,
|
|
115
|
+
{
|
|
116
|
+
label: J,
|
|
117
|
+
collapsed: !m,
|
|
118
|
+
onClick: b,
|
|
119
|
+
contentLeft: r,
|
|
120
|
+
contentRight: o,
|
|
121
|
+
children: s ? /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(y, { spacing: !0, justifyContent: "center", flex: 1, children: /* @__PURE__ */ c(te, { size: "small" }) }) }) : i ? /* @__PURE__ */ c(
|
|
122
|
+
ne,
|
|
123
|
+
{
|
|
124
|
+
variant: "error",
|
|
125
|
+
text: i,
|
|
126
|
+
contentRight: a ? /* @__PURE__ */ c(O, { label: "Retry", onClick: a }) : null
|
|
127
|
+
}
|
|
128
|
+
) : d ? p : /* @__PURE__ */ c(H, { children: p })
|
|
129
|
+
}
|
|
130
|
+
);
|
|
132
131
|
}, fe = (e) => ce(se(e)), Ye = ({
|
|
133
132
|
children: e,
|
|
134
133
|
...t
|
|
135
|
-
}) => /* @__PURE__ */ c(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
134
|
+
}) => /* @__PURE__ */ c(
|
|
135
|
+
B,
|
|
136
|
+
{
|
|
137
|
+
style: { marginTop: "auto" },
|
|
138
|
+
justifyContent: "center",
|
|
139
|
+
spacing: 2,
|
|
140
|
+
indent: !0,
|
|
141
|
+
shadow: "popover",
|
|
142
|
+
zIndex: 1,
|
|
143
|
+
...t,
|
|
144
|
+
children: e
|
|
145
|
+
}
|
|
146
|
+
), Y = M(null), Je = () => {
|
|
147
147
|
const e = L(Y);
|
|
148
148
|
if (!e)
|
|
149
149
|
throw new Error(
|
|
@@ -156,19 +156,13 @@ const Se = ({
|
|
|
156
156
|
actions: r,
|
|
157
157
|
children: o
|
|
158
158
|
}) {
|
|
159
|
-
return /* @__PURE__ */ c(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
value:
|
|
163
|
-
children: /* @__PURE__ */ c(q.Provider, {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
value: t.formModel,
|
|
167
|
-
children: o
|
|
168
|
-
})
|
|
169
|
-
})
|
|
170
|
-
})
|
|
171
|
-
});
|
|
159
|
+
return /* @__PURE__ */ c(
|
|
160
|
+
K.Provider,
|
|
161
|
+
{
|
|
162
|
+
value: n,
|
|
163
|
+
children: /* @__PURE__ */ c(W.Provider, { value: r, children: /* @__PURE__ */ c(q.Provider, { value: t, children: /* @__PURE__ */ c(Y.Provider, { value: t.formModel, children: o }) }) })
|
|
164
|
+
}
|
|
165
|
+
);
|
|
172
166
|
}, Fe = (e) => ({
|
|
173
167
|
settings: {
|
|
174
168
|
open: !1
|
|
@@ -233,7 +227,7 @@ const Se = ({
|
|
|
233
227
|
"local",
|
|
234
228
|
e.formModel
|
|
235
229
|
)
|
|
236
|
-
), [r, o] =
|
|
230
|
+
), [r, o] = U(t, e);
|
|
237
231
|
return {
|
|
238
232
|
actions: n,
|
|
239
233
|
state: r,
|
|
@@ -243,17 +237,10 @@ const Se = ({
|
|
|
243
237
|
initialFormModel: t,
|
|
244
238
|
children: n
|
|
245
239
|
}) {
|
|
246
|
-
const {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
} = we(Fe(t));
|
|
251
|
-
return /* @__PURE__ */ c(me, {
|
|
252
|
-
state: r,
|
|
253
|
-
actions: o,
|
|
254
|
-
dispatch: s,
|
|
255
|
-
children: n
|
|
256
|
-
});
|
|
240
|
+
const { state: r, actions: o, dispatch: s } = we(
|
|
241
|
+
Fe(t)
|
|
242
|
+
);
|
|
243
|
+
return /* @__PURE__ */ c(me, { state: r, actions: o, dispatch: s, children: n });
|
|
257
244
|
}, P = ae.div`
|
|
258
245
|
padding: calc(var(--swui-metrics-spacing) / 2)
|
|
259
246
|
calc(var(--swui-metrics-indent) / 2);
|
|
@@ -261,17 +248,21 @@ const Se = ({
|
|
|
261
248
|
children: e,
|
|
262
249
|
disableClearAllButton: t = !1
|
|
263
250
|
}) => {
|
|
264
|
-
const n = F(), r = x(), o = h(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
251
|
+
const n = F(), r = x(), o = h(
|
|
252
|
+
() => n(r.clearFormModel()),
|
|
253
|
+
[r, n]
|
|
254
|
+
);
|
|
255
|
+
return /* @__PURE__ */ E(y, { flexWrap: "wrap", children: [
|
|
256
|
+
e,
|
|
257
|
+
!t && /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(
|
|
258
|
+
O,
|
|
259
|
+
{
|
|
269
260
|
size: "small",
|
|
270
261
|
label: "Clear all",
|
|
271
262
|
onClick: o
|
|
272
|
-
}
|
|
273
|
-
})
|
|
274
|
-
});
|
|
263
|
+
}
|
|
264
|
+
) })
|
|
265
|
+
] });
|
|
275
266
|
}, Re = function({
|
|
276
267
|
label: t,
|
|
277
268
|
sectionId: n
|
|
@@ -279,54 +270,45 @@ const Se = ({
|
|
|
279
270
|
const r = F(), o = x(), s = h(() => {
|
|
280
271
|
r(o.clearExpandedSections()), r(o.expandSection(n)), r(o.openFilters());
|
|
281
272
|
}, [o, r, n]);
|
|
282
|
-
return /* @__PURE__ */ c(P, {
|
|
283
|
-
children: /* @__PURE__ */ c(D, {
|
|
284
|
-
label: t,
|
|
285
|
-
variant: "secondary",
|
|
286
|
-
onClick: s
|
|
287
|
-
})
|
|
288
|
-
});
|
|
273
|
+
return /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(D, { label: t, variant: "secondary", onClick: s }) });
|
|
289
274
|
}, ve = function({
|
|
290
275
|
sectionId: t,
|
|
291
276
|
label: n,
|
|
292
277
|
value: r,
|
|
293
278
|
onClickRemove: o
|
|
294
279
|
}) {
|
|
295
|
-
const s = F(), i = x(), a = h(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
});
|
|
280
|
+
const s = F(), i = x(), a = h(
|
|
281
|
+
(l) => s(i.setFormModelFields(l)),
|
|
282
|
+
[s, i]
|
|
283
|
+
), d = h(() => {
|
|
284
|
+
o == null || o({ value: r, setFormModelFields: a });
|
|
300
285
|
}, [o, a, r]), p = h(() => {
|
|
301
286
|
s(i.clearExpandedSections()), s(i.expandSection(t)), s(i.openFilters());
|
|
302
287
|
}, [i, s, t]);
|
|
303
|
-
return /* @__PURE__ */ c(P, {
|
|
304
|
-
|
|
288
|
+
return /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(
|
|
289
|
+
D,
|
|
290
|
+
{
|
|
305
291
|
label: n != null ? n : t,
|
|
306
292
|
onClick: p,
|
|
307
293
|
onClickRemove: o ? d : void 0
|
|
308
|
-
}
|
|
309
|
-
});
|
|
294
|
+
}
|
|
295
|
+
) });
|
|
310
296
|
}, Xe = function({
|
|
311
297
|
sectionId: t,
|
|
312
298
|
chips: n,
|
|
313
299
|
emptyChipLabel: r,
|
|
314
300
|
onClickRemoveOnChip: o
|
|
315
301
|
}) {
|
|
316
|
-
return n != null && n.length ? /* @__PURE__ */ c(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
value: i
|
|
320
|
-
}) => /* @__PURE__ */ c(ve, {
|
|
302
|
+
return n != null && n.length ? /* @__PURE__ */ c(Q, { children: n.map(({ label: s, value: i }) => /* @__PURE__ */ c(
|
|
303
|
+
ve,
|
|
304
|
+
{
|
|
321
305
|
label: s != null ? s : t,
|
|
322
306
|
sectionId: t,
|
|
323
307
|
onClickRemove: o,
|
|
324
308
|
value: i
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
label: r
|
|
329
|
-
}) : null;
|
|
309
|
+
},
|
|
310
|
+
i
|
|
311
|
+
)) }) : r ? /* @__PURE__ */ c(Re, { sectionId: t, label: r }) : null;
|
|
330
312
|
}, Ze = (e, t, n) => ({
|
|
331
313
|
chips: Me(
|
|
332
314
|
e[t],
|
|
@@ -350,52 +332,47 @@ const Se = ({
|
|
|
350
332
|
value: t,
|
|
351
333
|
onValueChange: n,
|
|
352
334
|
...r
|
|
353
|
-
}) => /* @__PURE__ */ c(A, {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
contentLeft: /* @__PURE__ */ c(de, {
|
|
371
|
-
tabIndex: -1,
|
|
372
|
-
value: t == null ? void 0 : t[o.value]
|
|
373
|
-
}),
|
|
374
|
-
children: /* @__PURE__ */ c(Z, {
|
|
375
|
-
children: o.label
|
|
376
|
-
})
|
|
377
|
-
}, o.value))
|
|
378
|
-
})
|
|
379
|
-
}), Ie = ({
|
|
335
|
+
}) => /* @__PURE__ */ c(A, { disableContentPadding: !0, ...r, children: /* @__PURE__ */ c(B, { maxHeight: "400px", overflowY: "auto", flex: 1, children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ c(
|
|
336
|
+
oe,
|
|
337
|
+
{
|
|
338
|
+
onClick: () => {
|
|
339
|
+
if (t && n) {
|
|
340
|
+
const s = !t[o.value];
|
|
341
|
+
n({
|
|
342
|
+
...t,
|
|
343
|
+
[o.value]: s
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
contentLeft: /* @__PURE__ */ c(de, { tabIndex: -1, value: t == null ? void 0 : t[o.value] }),
|
|
348
|
+
children: /* @__PURE__ */ c(_, { children: o.label })
|
|
349
|
+
},
|
|
350
|
+
o.value
|
|
351
|
+
)) }) }), Ie = ({
|
|
380
352
|
options: e,
|
|
381
353
|
value: t,
|
|
382
354
|
noneSelectedLabel: n,
|
|
383
355
|
onValueChange: r,
|
|
384
356
|
...o
|
|
385
357
|
}) => {
|
|
386
|
-
const [s, i] = R(""), a = v(
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
value: l,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
358
|
+
const [s, i] = R(""), a = v(
|
|
359
|
+
() => t ? $(t).map((l) => {
|
|
360
|
+
var f;
|
|
361
|
+
const C = e == null ? void 0 : e.find((m) => m.value === l);
|
|
362
|
+
return { value: l, label: (f = C == null ? void 0 : C.label) != null ? f : l };
|
|
363
|
+
}) : [],
|
|
364
|
+
[e, t]
|
|
365
|
+
), d = v(() => e == null ? void 0 : e.filter(
|
|
366
|
+
(l) => l.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1 || l.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1
|
|
367
|
+
), [e, s]), p = h(
|
|
368
|
+
(l) => {
|
|
369
|
+
r == null || r(be(l));
|
|
370
|
+
},
|
|
371
|
+
[r]
|
|
372
|
+
);
|
|
373
|
+
return /* @__PURE__ */ c(A, { ...o, children: /* @__PURE__ */ c(
|
|
374
|
+
ue,
|
|
375
|
+
{
|
|
399
376
|
options: d,
|
|
400
377
|
value: a,
|
|
401
378
|
onValueChange: p,
|
|
@@ -403,8 +380,8 @@ const Se = ({
|
|
|
403
380
|
noneSelectedLabel: n,
|
|
404
381
|
onInputChange: i,
|
|
405
382
|
closeMenuOnSelect: !1
|
|
406
|
-
}
|
|
407
|
-
});
|
|
383
|
+
}
|
|
384
|
+
) });
|
|
408
385
|
}, be = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ne = (e, t, n) => ({
|
|
409
386
|
chips: ke(
|
|
410
387
|
e[t],
|
|
@@ -442,33 +419,34 @@ const Se = ({
|
|
|
442
419
|
disableContentPadding: s,
|
|
443
420
|
...i
|
|
444
421
|
}) => {
|
|
445
|
-
const a = F(), d = x(), p = v(
|
|
446
|
-
dispatch: a,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
422
|
+
const a = F(), d = x(), p = v(
|
|
423
|
+
() => ({ dispatch: a, actions: d }),
|
|
424
|
+
[d, a]
|
|
425
|
+
), [l, C] = R("startDate"), f = v(() => he(e), [e]), m = h(
|
|
426
|
+
(b) => {
|
|
427
|
+
t(pe(b), p);
|
|
428
|
+
},
|
|
429
|
+
[t, p]
|
|
430
|
+
);
|
|
431
|
+
return /* @__PURE__ */ c(
|
|
432
|
+
A,
|
|
433
|
+
{
|
|
434
|
+
sectionId: n,
|
|
435
|
+
contentRight: o,
|
|
436
|
+
contentLeft: r,
|
|
437
|
+
disableContentPadding: s,
|
|
438
|
+
children: /* @__PURE__ */ c(T, { flex: 1, alignItems: "center", children: /* @__PURE__ */ c(T, { background: "white", indent: !0, children: /* @__PURE__ */ c(
|
|
439
|
+
Ce,
|
|
440
|
+
{
|
|
463
441
|
setFocusedInput: C,
|
|
464
442
|
focusedInput: l,
|
|
465
443
|
value: f,
|
|
466
444
|
onValueChange: m,
|
|
467
445
|
...i
|
|
468
|
-
}
|
|
469
|
-
})
|
|
470
|
-
}
|
|
471
|
-
|
|
446
|
+
}
|
|
447
|
+
) }) })
|
|
448
|
+
}
|
|
449
|
+
);
|
|
472
450
|
};
|
|
473
451
|
export {
|
|
474
452
|
Ie as ChipMultiSelectSection,
|
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 {\n CardHeader,\n FlatButton,\n stenaSliders,\n stenaTimes,\n} from \"@stenajs-webui/elements\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\nimport { Row } from \"@stenajs-webui/core\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n headerIcon?: IconDefinition;\n contentRight?: ReactNode;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({\n onRequestClose,\n header = \"Filters\",\n headerIcon = stenaSliders,\n contentRight,\n}) => {\n return (\n <CardHeader\n flex={\"0 0 auto\"}\n contentRight={\n <Row gap={2}>\n {contentRight}\n <FlatButton leftIcon={stenaTimes} onClick={onRequestClose} />\n </Row>\n }\n leftIcon={headerIcon}\n text={header}\n />\n );\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 { Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerIcon?: IconDefinition;\n headerContentRight?: ReactNode;\n}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerIcon,\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 background={cssColor(\"--lhds-color-ui-50\")}\n width={\"370px\"}\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column height={\"100%\"}>\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n headerIcon={headerIcon}\n contentRight={headerContentRight}\n />\n {children}\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSliders } 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/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSliders,\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 } from \"@stenajs-webui/core\";\nimport { Collapsible, CollapsibleContent } from \"@stenajs-webui/panels\";\nimport { lowerCase, upperFirst } from \"lodash\";\nimport { Banner, FlatButton, Spinner } from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n contentLeft?: React.ReactNode;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n label?: string;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string\n>({\n sectionId,\n label,\n contentLeft,\n contentRight,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\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 <Collapsible\n label={activeLabel}\n collapsed={!expanded}\n onClick={onClickLabel}\n contentLeft={contentLeft}\n contentRight={contentRight}\n >\n {loading ? (\n <CollapsibleContent>\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n </CollapsibleContent>\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 <CollapsibleContent>{children}</CollapsibleContent>\n )}\n </Collapsible>\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, Text } from \"@stenajs-webui/core\";\nimport { CollapsibleClickableContent } from \"@stenajs-webui/panels\";\nimport { Checkbox, ValueAndOnValueChangeProps } 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}>\n {options?.map((d) => (\n <CollapsibleClickableContent\n key={d.value}\n onClick={() => {\n if (value && onValueChange) {\n const sel = !value[d.value];\n onValueChange({\n ...value,\n [d.value]: sel,\n });\n }\n }}\n contentLeft={<Checkbox tabIndex={-1} value={value?.[d.value]} />}\n >\n <Text>{d.label}</Text>\n </CollapsibleClickableContent>\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}\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 contentLeft,\n contentRight,\n disableContentPadding,\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 sectionId={sectionId}\n contentRight={contentRight}\n contentLeft={contentLeft}\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","onRequestClose","header","headerIcon","stenaSliders","contentRight","CardHeader","Row","_jsx","FlatButton","stenaTimes","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","drawerProps","settings","open","dispatch","actions","closeDrawer","useCallback","closeFilters","Drawer","cssColor","Column","SearchFilterButton","label","leftIcon","onClickButton","openFilters","SecondaryButton","SearchFilterSection","sectionId","contentLeft","loading","error","onRetry","disableContentPadding","state","expanded","expandedSections","values","onClickLabel","setSectionExpanded","activeLabel","formatColumnIdToHeaderCellLabel","Collapsible","CollapsibleContent","Spinner","Banner","columnId","upperFirst","lowerCase","StickyFooter","boxProps","marginTop","SearchFilterModelContext","useSearchFilterModel","SearchFilterContext","formModel","createSearchFilterInitialState","initialFormModel","createSearchFilterReducer","reducerId","initialState","combineReducers","reducerIdGate","getReducerIdFor","createValueByIdReducer","createEntityReducer","createSearchFilterActions","reducerIdGateAction","createEntityActions","fields","section","createValueByIdActions","reducerIdSuffix","useLocalSearchFilterState","reducer","useState","useReducer","SearchFilterLocalStateContext","ChipSpacer","styled","div","SearchFilterChips","disableClearAllButton","onClickClearAll","clearFormModel","EmptyChip","clearExpandedSections","expandSection","Chip","SearchFilterChip","value","onClickRemove","setFormModelFields","onClickRemoveHandler","undefined","SectionChips","chips","emptyChipLabel","onClickRemoveOnChip","length","_Fragment","map","createChipsPropsForBooleanRecord","fieldName","options","createChipsForBooleanRecord","createOnClickRemoveOnChipForBooleanRecord","booleanRecord","truthyKeysAsList","key","option","o","_a","newRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","CollapsibleClickableContent","sel","Checkbox","Text","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","find","filteredOptions","filter","p","toLocaleLowerCase","indexOf","onValueChangeInternal","createBooleanRecordFromValue","ChipMultiSelect","reduce","sum","item","createChipsPropsForDateRange","startDateFieldName","endDateFieldName","createChipsForDateRange","createOnClickRemoveOnChipForDateRange","startDate","endDate","createDateRangeSectionProps","DateRangeCalendarSection","dateRangeCalendarProps","focusedInput","setFocusedInput","dateRangeValue","stringsToDateRange","onValueChangeHandler","dateRangeToStrings","Box","DateRangeCalendar"],"mappings":";;;;;;;;;;;;;;AAkBO,MAAMA,KAET,CAAC;AA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AA,EACAvF,WAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACArC,cAAAA;AAAAA,EACAyC,uBAAAA;AAAAA,KACGoH;AAPH,MAQ4D;AAC5D,QAAMxI,IAAWT,KACXU,IAAUR,KAEVkG,IAAUuB,EACd,OAAO;AAAA,IAAElH,UAAAA;AAAAA,IAAUC,SAAAA;AAAAA,EACnB,IAAA,CAACA,GAASD,CAAV,CAFqB,GAIjB,CAACyI,GAAcC,CAAf,IACJ5E,EAAgC,WAAxB,GAEJ6E,IAAiBzB,EAAQ,MAAM0B,GAAmB/D,CAAD,GAAS,CAACA,CAAD,CAAlC,GAExBgE,IAAuB1I,EAC3B,CAAC0E,MAAqB;AACNiE,IAAAA,EAAAA,GAAmBjE,CAAD,GAASc,CAA5B;AAAA,EAAA,GAEf,CAACW,GAAeX,CAAhB,CAJsC;AAOxC,2BACG7E,GAAD;AAAA,IACE,WAAAC;AAAA,IACA,cAAApC;AAAA,IACA,aAAAqC;AAAA,IACA,uBAAAI;AAAA,IAJF,4BAMG2H,GAAD;AAAA,MAAK,MAAM;AAAA,MAAG,YAAY;AAAA,MAA1B,4BACGA,GAAD;AAAA,QAAK,YAAY;AAAA,QAAS,QAA1B;AAAA,QAAA,4BACGC,IAAD;AAAA,UACE,iBAAAN;AAAA,UACA,cAAAD;AAAA,UACA,OAAOE;AAAAA,UACP,eAAeE;AAAAA,UAJjB,GAKML;AAAAA,QAAAA,CALN;AAAA,MAAA,CADF;AAAA,IAAA,CADF;AAAA,EAAA,CAPJ;AAoBD;"}
|
|
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 {\n CardHeader,\n FlatButton,\n stenaSliders,\n stenaTimes,\n} from \"@stenajs-webui/elements\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\nimport { Row } from \"@stenajs-webui/core\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n headerIcon?: IconDefinition;\n contentRight?: ReactNode;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({\n onRequestClose,\n header = \"Filters\",\n headerIcon = stenaSliders,\n contentRight,\n}) => {\n return (\n <CardHeader\n flex={\"0 0 auto\"}\n contentRight={\n <Row gap={2}>\n {contentRight}\n <FlatButton leftIcon={stenaTimes} onClick={onRequestClose} />\n </Row>\n }\n leftIcon={headerIcon}\n text={header}\n />\n );\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 { Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerIcon?: IconDefinition;\n headerContentRight?: ReactNode;\n}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerIcon,\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 background={cssColor(\"--lhds-color-ui-50\")}\n width={\"370px\"}\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column height={\"100%\"}>\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n headerIcon={headerIcon}\n contentRight={headerContentRight}\n />\n {children}\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSliders } 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/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSliders,\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 } from \"@stenajs-webui/core\";\nimport { Collapsible, CollapsibleContent } from \"@stenajs-webui/panels\";\nimport { lowerCase, upperFirst } from \"lodash\";\nimport { Banner, FlatButton, Spinner } from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n contentLeft?: React.ReactNode;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n label?: string;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string\n>({\n sectionId,\n label,\n contentLeft,\n contentRight,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\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 <Collapsible\n label={activeLabel}\n collapsed={!expanded}\n onClick={onClickLabel}\n contentLeft={contentLeft}\n contentRight={contentRight}\n >\n {loading ? (\n <CollapsibleContent>\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n </CollapsibleContent>\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 <CollapsibleContent>{children}</CollapsibleContent>\n )}\n </Collapsible>\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, Text } from \"@stenajs-webui/core\";\nimport { CollapsibleClickableContent } from \"@stenajs-webui/panels\";\nimport { Checkbox, ValueAndOnValueChangeProps } 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}>\n {options?.map((d) => (\n <CollapsibleClickableContent\n key={d.value}\n onClick={() => {\n if (value && onValueChange) {\n const sel = !value[d.value];\n onValueChange({\n ...value,\n [d.value]: sel,\n });\n }\n }}\n contentLeft={<Checkbox tabIndex={-1} value={value?.[d.value]} />}\n >\n <Text>{d.label}</Text>\n </CollapsibleClickableContent>\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}\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 contentLeft,\n contentRight,\n disableContentPadding,\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 sectionId={sectionId}\n contentRight={contentRight}\n contentLeft={contentLeft}\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","onRequestClose","header","headerIcon","stenaSliders","contentRight","jsx","CardHeader","jsxs","Row","FlatButton","stenaTimes","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","drawerProps","open","dispatch","actions","closeDrawer","useCallback","Drawer","cssColor","Column","SearchFilterButton","label","leftIcon","onClickButton","SecondaryButton","SearchFilterSection","sectionId","contentLeft","loading","error","onRetry","disableContentPadding","state","expanded","_a","onClickLabel","activeLabel","formatColumnIdToHeaderCellLabel","Collapsible","CollapsibleContent","Spinner","Banner","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","CollapsibleClickableContent","sel","Checkbox","Text","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","Box","DateRangeCalendar"],"mappings":";;;;;;;;;;;;;;AAkBO,MAAMA,KAET,CAAC;AAAA,EACH,gBAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,YAAAC,IAAaC;AAAA,EACb,cAAA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D,CAAK,GAAG,CAACA,CAAK,CAAC,GAEjEuD,IAAuBvH;AAAA,IAC3B,CAACgE,MAAqB;AACN,MAAAqB,EAAAmC,GAAmBxD,CAAK,GAAGW,CAAO;AAAA,IAClD;AAAA,IACA,CAACU,GAAeV,CAAO;AAAA,EAAA;AAIvB,SAAA,gBAAAlG;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,WAAAC;AAAA,MACA,cAAAlC;AAAA,MACA,aAAAmC;AAAA,MACA,uBAAAI;AAAA,MAEA,UAAA,gBAAAtC,EAACgJ,GAAI,EAAA,MAAM,GAAG,YAAY,UACxB,UAAA,gBAAAhJ,EAACgJ,GAAI,EAAA,YAAY,SAAS,QAAM,IAC9B,UAAA,gBAAAhJ;AAAA,QAACiJ;AAAA,QAAA;AAAA,UACC,iBAAAN;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,5 +1,5 @@
|
|
|
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 a=require("react"),J=require("@stenajs-webui/modal"),Q=require("@stenajs-webui/theme"),S=require("@stenajs-webui/core"),x=require("@stenajs-webui/elements"),
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),a=require("react"),J=require("@stenajs-webui/modal"),Q=require("@stenajs-webui/theme"),S=require("@stenajs-webui/core"),x=require("@stenajs-webui/elements"),R=require("@stenajs-webui/panels"),q=require("lodash"),U=require("redux"),l=require("@stenajs-webui/redux"),X=require("@emotion/styled"),Z=require("@stenajs-webui/forms"),N=require("@stenajs-webui/select"),k=require("@stenajs-webui/calendar"),ee=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},te=ee(X),O=({onRequestClose:e,header:t="Filters",headerIcon:n=x.stenaSliders,contentRight:r})=>s.jsx(x.CardHeader,{flex:"0 0 auto",contentRight:s.jsxs(S.Row,{gap:2,children:[r,s.jsx(x.FlatButton,{leftIcon:x.stenaTimes,onClick:e})]}),leftIcon:n,text:t}),y=a.createContext(null),M=()=>{const e=a.useContext(y);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},v=a.createContext(null),f=()=>{const e=a.useContext(v);if(!e)throw new Error("Missing search filter dispatch context.");return e},A=a.createContext(null),j=()=>{const e=a.useContext(A);if(!e)throw new Error("Missing search filter actions context.");return e},ne=({children:e,header:t,headerIcon:n,headerContentRight:r,...c})=>{const{settings:{open:o}}=M(),i=f(),d=j(),C=a.useCallback(()=>{i(d.closeFilters())},[d,i]);return s.jsx(J.Drawer,{background:Q.cssColor("--lhds-color-ui-50"),width:"370px",isOpen:o,onRequestClose:C,...c,children:s.jsxs(S.Column,{height:"100%",children:[s.jsx(O,{onRequestClose:C,header:t,headerIcon:n,contentRight:r}),e]})})},re=({label:e="Filters",leftIcon:t=x.stenaSliders})=>{const n=f(),r=j(),c=a.useCallback(()=>{n(r.openFilters())},[r,n]);return s.jsx(x.SecondaryButton,{label:e,leftIcon:t,onClick:c})},b=function({sectionId:t,label:n,contentLeft:r,contentRight:c,loading:o,error:i,onRetry:d,disableContentPadding:C,children:p}){var E;const u=M(),F=f(),m=j(),g=(E=u.expandedSections.values[t])!=null?E:!1,w=a.useCallback(()=>{F(m.setSectionExpanded(t,!g))},[m,F,g,t]),Y=n!=null?n:I(t);return s.jsx(R.Collapsible,{label:Y,collapsed:!g,onClick:w,contentLeft:r,contentRight:c,children:o?s.jsx(R.CollapsibleContent,{children:s.jsx(S.Row,{spacing:!0,justifyContent:"center",flex:1,children:s.jsx(x.Spinner,{size:"small"})})}):i?s.jsx(x.Banner,{variant:"error",text:i,contentRight:d?s.jsx(x.FlatButton,{label:"Retry",onClick:d}):null}):C?p:s.jsx(R.CollapsibleContent,{children:p})})},I=e=>q.upperFirst(q.lowerCase(e)),ce=({children:e,...t})=>s.jsx(S.Column,{style:{marginTop:"auto"},justifyContent:"center",spacing:2,indent:!0,shadow:"popover",zIndex:1,...t,children:e}),L=a.createContext(null),se=()=>{const e=a.useContext(L);if(!e)throw new Error("Missing search filter context, wrap components with SearchFilterContext component.");return e},P=function({state:t,dispatch:n,actions:r,children:c}){return s.jsx(v.Provider,{value:n,children:s.jsx(A.Provider,{value:r,children:s.jsx(y.Provider,{value:t,children:s.jsx(L.Provider,{value:t.formModel,children:c})})})})},D=e=>({settings:{open:!1},formModel:e,expandedSections:{values:{}}}),G=(e,t)=>U.combineReducers({expandedSections:l.reducerIdGate(h(e,"expandedSections"),l.createValueByIdReducer(t.expandedSections)),formModel:l.reducerIdGate(h(e,"formModel"),l.createEntityReducer(t.formModel)),settings:l.reducerIdGate(h(e,"settings"),l.createEntityReducer(t.settings))}),V=(e,t)=>({openFilters:()=>l.reducerIdGateAction(h(e,"settings"),l.createEntityActions().setEntityFields({open:!0})),closeFilters:()=>l.reducerIdGateAction(h(e,"settings"),l.createEntityActions().setEntityFields({open:!1})),setFormModelFields:n=>l.reducerIdGateAction(h(e,"formModel"),l.createEntityActions().setEntityFields(n)),clearFormModel:()=>l.reducerIdGateAction(h(e,"formModel"),l.createEntityActions().setEntity(t)),expandSection:n=>l.reducerIdGateAction(h(e,"expandedSections"),l.createValueByIdActions().setValue(n,!0)),collapseSection:n=>l.reducerIdGateAction(h(e,"expandedSections"),l.createValueByIdActions().setValue(n,!1)),setSectionExpanded:(n,r)=>l.reducerIdGateAction(h(e,"expandedSections"),l.createValueByIdActions().setValue(n,r)),clearExpandedSections:()=>l.reducerIdGateAction(h(e,"expandedSections"),l.createValueByIdActions().clearAllValues())}),h=(e,t)=>`${e}.${t}`,T=e=>{const[t]=a.useState(()=>G("local",e)),[n]=a.useState(()=>V("local",e.formModel)),[r,c]=a.useReducer(t,e);return{actions:n,state:r,dispatch:c}},oe=function({initialFormModel:t,children:n}){const{state:r,actions:c,dispatch:o}=T(D(t));return s.jsx(P,{state:r,actions:c,dispatch:o,children:n})},B=te.default.div`
|
|
3
3
|
padding: calc(var(--swui-metrics-spacing) / 2)
|
|
4
4
|
calc(var(--swui-metrics-indent) / 2);
|
|
5
5
|
`,ae=({children:e,disableClearAllButton:t=!1})=>{const n=f(),r=j(),c=a.useCallback(()=>n(r.clearFormModel()),[r,n]);return s.jsxs(S.Row,{flexWrap:"wrap",children:[e,!t&&s.jsx(B,{children:s.jsx(x.FlatButton,{size:"small",label:"Clear all",onClick:c})})]})},H=function({label:t,sectionId:n}){const r=f(),c=j(),o=a.useCallback(()=>{r(c.clearExpandedSections()),r(c.expandSection(n)),r(c.openFilters())},[c,r,n]);return s.jsx(B,{children:s.jsx(x.Chip,{label:t,variant:"secondary",onClick:o})})},_=function({sectionId:t,label:n,value:r,onClickRemove:c}){const o=f(),i=j(),d=a.useCallback(u=>o(i.setFormModelFields(u)),[o,i]),C=a.useCallback(()=>{c==null||c({value:r,setFormModelFields:d})},[c,d,r]),p=a.useCallback(()=>{o(i.clearExpandedSections()),o(i.expandSection(t)),o(i.openFilters())},[i,o,t]);return s.jsx(B,{children:s.jsx(x.Chip,{label:n!=null?n:t,onClick:p,onClickRemove:c?C:void 0})})},le=function({sectionId:t,chips:n,emptyChipLabel:r,onClickRemoveOnChip:c}){return n!=null&&n.length?s.jsx(s.Fragment,{children:n.map(({label:o,value:i})=>s.jsx(_,{label:o!=null?o:t,sectionId:t,onClickRemove:c,value:i},i))}):r?s.jsx(H,{sectionId:t,label:r}):null},ie=(e,t,n)=>({chips:$(e[t],n),onClickRemoveOnChip:z(e,t)}),$=(e,t)=>S.truthyKeysAsList(e).map(n=>{var c;const r=t==null?void 0:t.find(o=>o.value===n);return{value:n,label:(c=r==null?void 0:r.label)!=null?c:n}}),z=(e,t)=>({setFormModelFields:n,value:r})=>{const c={...e[t]};c[r]=!1,n({[t]:c})},ue=({options:e,value:t,onValueChange:n,...r})=>s.jsx(b,{disableContentPadding:!0,...r,children:s.jsx(S.Column,{maxHeight:"400px",overflowY:"auto",flex:1,children:e==null?void 0:e.map(c=>s.jsx(R.CollapsibleClickableContent,{onClick:()=>{if(t&&n){const o=!t[c.value];n({...t,[c.value]:o})}},contentLeft:s.jsx(Z.Checkbox,{tabIndex:-1,value:t==null?void 0:t[c.value]}),children:s.jsx(S.Text,{children:c.label})},c.value))})}),de=({options:e,value:t,noneSelectedLabel:n,onValueChange:r,...c})=>{const[o,i]=a.useState(""),d=a.useMemo(()=>t?S.truthyKeysAsList(t).map(u=>{var m;const F=e==null?void 0:e.find(g=>g.value===u);return{value:u,label:(m=F==null?void 0:F.label)!=null?m:u}}):[],[e,t]),C=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]),p=a.useCallback(u=>{r==null||r(he(u))},[r]);return s.jsx(b,{...c,children:s.jsx(N.ChipMultiSelect,{options:C,value:d,onValueChange:p,inputValue:o,noneSelectedLabel:n,onInputChange:i,closeMenuOnSelect:!1})})},he=e=>e.reduce((t,n)=>(t[n.value]=!0,t),{}),xe=(e,t,n)=>({chips:K(e[t],e[n]),onClickRemoveOnChip:W(t,n)}),K=(e,t)=>!e&&!t?[]:[{value:"dateRange",label:`${e!=null?e:""} - ${t!=null?t:""}`}],W=(e,t)=>({setFormModelFields:n})=>{n({[e]:void 0,[t]:void 0})},Ce=(e,t,n)=>({value:{startDate:e[t],endDate:e[n]},onValueChange:(r,{dispatch:c,actions:o})=>{const i={[t]:r.startDate,[n]:r.endDate};c(o.setFormModelFields(i))}}),Se=({value:e,onValueChange:t,sectionId:n,contentLeft:r,contentRight:c,disableContentPadding:o,...i})=>{const d=f(),C=j(),p=a.useMemo(()=>({dispatch:d,actions:C}),[C,d]),[u,F]=a.useState("startDate"),m=a.useMemo(()=>k.stringsToDateRange(e),[e]),g=a.useCallback(w=>{t(k.dateRangeToStrings(w),p)},[t,p]);return s.jsx(b,{sectionId:n,contentRight:c,contentLeft:r,disableContentPadding:o,children:s.jsx(S.Box,{flex:1,alignItems:"center",children:s.jsx(S.Box,{background:"white",indent:!0,children:s.jsx(k.DateRangeCalendar,{setFocusedInput:F,focusedInput:u,value:m,onValueChange:g,...i})})})})};exports.ChipMultiSelectSection=de;exports.DateRangeCalendarSection=Se;exports.EmptyChip=H;exports.SearchFilterActionsContext=A;exports.SearchFilterButton=re;exports.SearchFilterChip=_;exports.SearchFilterChips=ae;exports.SearchFilterContext=P;exports.SearchFilterDispatchContext=v;exports.SearchFilterDrawer=ne;exports.SearchFilterLocalStateContext=oe;exports.SearchFilterModelContext=L;exports.SearchFilterPanelHeader=O;exports.SearchFilterSection=b;exports.SearchFilterStateContext=y;exports.SectionChips=le;exports.SimpleCheckboxListSection=ue;exports.StickyFooter=ce;exports.createChipsForBooleanRecord=$;exports.createChipsForDateRange=K;exports.createChipsPropsForBooleanRecord=ie;exports.createChipsPropsForDateRange=xe;exports.createDateRangeSectionProps=Ce;exports.createOnClickRemoveOnChipForBooleanRecord=z;exports.createOnClickRemoveOnChipForDateRange=W;exports.createSearchFilterActions=V;exports.createSearchFilterInitialState=D;exports.createSearchFilterReducer=G;exports.formatColumnIdToHeaderCellLabel=I;exports.getReducerIdFor=h;exports.useLocalSearchFilterState=T;exports.useSearchFilterActions=j;exports.useSearchFilterDispatch=f;exports.useSearchFilterModel=se;exports.useSearchFilterState=M;
|
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 {\n CardHeader,\n FlatButton,\n stenaSliders,\n stenaTimes,\n} from \"@stenajs-webui/elements\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\nimport { Row } from \"@stenajs-webui/core\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n headerIcon?: IconDefinition;\n contentRight?: ReactNode;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({\n onRequestClose,\n header = \"Filters\",\n headerIcon = stenaSliders,\n contentRight,\n}) => {\n return (\n <CardHeader\n flex={\"0 0 auto\"}\n contentRight={\n <Row gap={2}>\n {contentRight}\n <FlatButton leftIcon={stenaTimes} onClick={onRequestClose} />\n </Row>\n }\n leftIcon={headerIcon}\n text={header}\n />\n );\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 { Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerIcon?: IconDefinition;\n headerContentRight?: ReactNode;\n}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerIcon,\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 background={cssColor(\"--lhds-color-ui-50\")}\n width={\"370px\"}\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column height={\"100%\"}>\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n headerIcon={headerIcon}\n contentRight={headerContentRight}\n />\n {children}\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSliders } 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/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSliders,\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 } from \"@stenajs-webui/core\";\nimport { Collapsible, CollapsibleContent } from \"@stenajs-webui/panels\";\nimport { lowerCase, upperFirst } from \"lodash\";\nimport { Banner, FlatButton, Spinner } from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n contentLeft?: React.ReactNode;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n label?: string;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string\n>({\n sectionId,\n label,\n contentLeft,\n contentRight,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\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 <Collapsible\n label={activeLabel}\n collapsed={!expanded}\n onClick={onClickLabel}\n contentLeft={contentLeft}\n contentRight={contentRight}\n >\n {loading ? (\n <CollapsibleContent>\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n </CollapsibleContent>\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 <CollapsibleContent>{children}</CollapsibleContent>\n )}\n </Collapsible>\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, Text } from \"@stenajs-webui/core\";\nimport { CollapsibleClickableContent } from \"@stenajs-webui/panels\";\nimport { Checkbox, ValueAndOnValueChangeProps } 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}>\n {options?.map((d) => (\n <CollapsibleClickableContent\n key={d.value}\n onClick={() => {\n if (value && onValueChange) {\n const sel = !value[d.value];\n onValueChange({\n ...value,\n [d.value]: sel,\n });\n }\n }}\n contentLeft={<Checkbox tabIndex={-1} value={value?.[d.value]} />}\n >\n <Text>{d.label}</Text>\n </CollapsibleClickableContent>\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}\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 contentLeft,\n contentRight,\n disableContentPadding,\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 sectionId={sectionId}\n contentRight={contentRight}\n contentLeft={contentLeft}\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","onRequestClose","header","headerIcon","stenaSliders","contentRight","CardHeader","Row","_jsx","FlatButton","stenaTimes","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","drawerProps","settings","open","dispatch","actions","closeDrawer","useCallback","closeFilters","Drawer","cssColor","Column","SearchFilterButton","label","leftIcon","onClickButton","openFilters","SecondaryButton","SearchFilterSection","sectionId","contentLeft","loading","error","onRetry","disableContentPadding","state","expanded","expandedSections","values","onClickLabel","setSectionExpanded","activeLabel","formatColumnIdToHeaderCellLabel","Collapsible","CollapsibleContent","Spinner","Banner","columnId","upperFirst","lowerCase","StickyFooter","boxProps","marginTop","SearchFilterModelContext","useSearchFilterModel","SearchFilterContext","formModel","createSearchFilterInitialState","initialFormModel","createSearchFilterReducer","reducerId","initialState","combineReducers","reducerIdGate","getReducerIdFor","createValueByIdReducer","createEntityReducer","createSearchFilterActions","reducerIdGateAction","createEntityActions","fields","section","createValueByIdActions","reducerIdSuffix","useLocalSearchFilterState","reducer","useState","useReducer","SearchFilterLocalStateContext","ChipSpacer","styled","div","SearchFilterChips","disableClearAllButton","onClickClearAll","clearFormModel","EmptyChip","clearExpandedSections","expandSection","Chip","SearchFilterChip","value","onClickRemove","setFormModelFields","onClickRemoveHandler","undefined","SectionChips","chips","emptyChipLabel","onClickRemoveOnChip","length","_Fragment","map","createChipsPropsForBooleanRecord","fieldName","options","createChipsForBooleanRecord","createOnClickRemoveOnChipForBooleanRecord","booleanRecord","truthyKeysAsList","key","option","_a","newRecord","SimpleCheckboxListSection","onValueChange","sectionProps","d","CollapsibleClickableContent","sel","Checkbox","Text","ChipMultiSelectSection","noneSelectedLabel","text","setText","listValue","useMemo","find","o","filteredOptions","filter","p","toLocaleLowerCase","indexOf","onValueChangeInternal","createBooleanRecordFromValue","ChipMultiSelect","reduce","sum","item","createChipsPropsForDateRange","startDateFieldName","endDateFieldName","createChipsForDateRange","createOnClickRemoveOnChipForDateRange","startDate","endDate","createDateRangeSectionProps","DateRangeCalendarSection","dateRangeCalendarProps","focusedInput","setFocusedInput","dateRangeValue","stringsToDateRange","onValueChangeHandler","dateRangeToStrings","Box","DateRangeCalendar"],"mappings":"mmBAkBaA,EAET,CAAC,CACHC,eAAAA,EACAC,OAAAA,EAAS,UACTC,WAAAA,EAAaC,EAAAA,aACbC,aAAAA,CAJG,UAOAC,EAAAA,WAAD,CACE,KAAM,WACN,oBACGC,MAAD,CAAK,IAAK,EAAV,SACGF,CAAAA,EACDG,EAAA,IAACC,aAAD,CAAY,SAAUC,EAAAA,WAAY,QAAST,CAAAA,CAF7C,CAAA,CAAA,CAHJ,EAQE,SAAUE,EACV,KAAMD,CAAAA,CAVV,ECvBWS,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,ECEaM,GAAwD,CAAC,CACpEC,SAAAA,EACAnB,OAAAA,EACAC,WAAAA,EACAmB,mBAAAA,KACGC,CALiE,IAMhE,CACE,KAAA,CACJC,SAAU,CAAEC,KAAAA,CAAF,GACRZ,EAFJ,EAGMa,EAAWT,IACXU,EAAUR,IAEVS,EAAcC,EAAAA,YAAY,IAAM,CAC3BF,EAAAA,EAAQG,cAAT,CAAA,EACP,CAACH,EAASD,CAAV,CAF4B,EAI/B,aACGK,EAAAA,OAAD,CACE,WAAYC,WAAS,oBAAD,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qC,EACA,sBAAAI,EAJF,eAMG2H,MAAD,CAAK,KAAM,EAAG,WAAY,SAA1B,eACGA,MAAD,CAAK,WAAY,QAAS,OAA1B,GAAA,eACGC,oBAAD,CACE,gBAAAN,EACA,aAAAD,EACA,MAAOE,EACP,cAAeE,EAJjB,GAKML,CAAAA,CALN,CAAA,CADF,CAAA,CADF,CAAA,CAPJ,CAoBD"}
|
|
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 {\n CardHeader,\n FlatButton,\n stenaSliders,\n stenaTimes,\n} from \"@stenajs-webui/elements\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\nimport { Row } from \"@stenajs-webui/core\";\n\ninterface SearchFilterPanelHeaderProps {\n onRequestClose: () => void;\n header?: string;\n headerIcon?: IconDefinition;\n contentRight?: ReactNode;\n}\n\nexport const SearchFilterPanelHeader: React.FC<\n SearchFilterPanelHeaderProps\n> = ({\n onRequestClose,\n header = \"Filters\",\n headerIcon = stenaSliders,\n contentRight,\n}) => {\n return (\n <CardHeader\n flex={\"0 0 auto\"}\n contentRight={\n <Row gap={2}>\n {contentRight}\n <FlatButton leftIcon={stenaTimes} onClick={onRequestClose} />\n </Row>\n }\n leftIcon={headerIcon}\n text={header}\n />\n );\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 { Column } from \"@stenajs-webui/core\";\nimport { SearchFilterPanelHeader } from \"./SearchFilterPanelHeader\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\nimport { IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerProps\n extends Omit<DrawerProps, \"isOpen\" | \"onRequestClose\"> {\n header?: string;\n headerIcon?: IconDefinition;\n headerContentRight?: ReactNode;\n}\n\nexport const SearchFilterDrawer: React.FC<SearchFilterDrawerProps> = ({\n children,\n header,\n headerIcon,\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 background={cssColor(\"--lhds-color-ui-50\")}\n width={\"370px\"}\n isOpen={open}\n onRequestClose={closeDrawer}\n {...drawerProps}\n >\n <Column height={\"100%\"}>\n <SearchFilterPanelHeader\n onRequestClose={closeDrawer}\n header={header}\n headerIcon={headerIcon}\n contentRight={headerContentRight}\n />\n {children}\n </Column>\n </Drawer>\n );\n};\n","import { SecondaryButton, stenaSliders } 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/free-solid-svg-icons\";\n\ninterface SearchFilterDrawerButtonProps {\n label?: string;\n leftIcon?: IconDefinition;\n}\n\nexport const SearchFilterButton: React.FC<SearchFilterDrawerButtonProps> = ({\n label = \"Filters\",\n leftIcon = stenaSliders,\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 } from \"@stenajs-webui/core\";\nimport { Collapsible, CollapsibleContent } from \"@stenajs-webui/panels\";\nimport { lowerCase, upperFirst } from \"lodash\";\nimport { Banner, FlatButton, Spinner } from \"@stenajs-webui/elements\";\nimport { useSearchFilterState } from \"../context/SearchFilterStateContext\";\nimport { useSearchFilterDispatch } from \"../context/SearchFilterDispatchContext\";\nimport { useSearchFilterActions } from \"../context/SearchFilterActionsContext\";\n\nexport interface SearchFilterSectionProps<TSectionKey extends string> {\n sectionId: TSectionKey;\n contentLeft?: React.ReactNode;\n contentRight?: React.ReactNode;\n disableContentPadding?: boolean;\n loading?: boolean;\n error?: string;\n onRetry?: () => void;\n label?: string;\n}\n\nexport const SearchFilterSection = function SearchFilterSection<\n TSectionKey extends string\n>({\n sectionId,\n label,\n contentLeft,\n contentRight,\n loading,\n error,\n onRetry,\n disableContentPadding,\n children,\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 <Collapsible\n label={activeLabel}\n collapsed={!expanded}\n onClick={onClickLabel}\n contentLeft={contentLeft}\n contentRight={contentRight}\n >\n {loading ? (\n <CollapsibleContent>\n <Row spacing justifyContent={\"center\"} flex={1}>\n <Spinner size={\"small\"} />\n </Row>\n </CollapsibleContent>\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 <CollapsibleContent>{children}</CollapsibleContent>\n )}\n </Collapsible>\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, Text } from \"@stenajs-webui/core\";\nimport { CollapsibleClickableContent } from \"@stenajs-webui/panels\";\nimport { Checkbox, ValueAndOnValueChangeProps } 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}>\n {options?.map((d) => (\n <CollapsibleClickableContent\n key={d.value}\n onClick={() => {\n if (value && onValueChange) {\n const sel = !value[d.value];\n onValueChange({\n ...value,\n [d.value]: sel,\n });\n }\n }}\n contentLeft={<Checkbox tabIndex={-1} value={value?.[d.value]} />}\n >\n <Text>{d.label}</Text>\n </CollapsibleClickableContent>\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}\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 contentLeft,\n contentRight,\n disableContentPadding,\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 sectionId={sectionId}\n contentRight={contentRight}\n contentLeft={contentLeft}\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","onRequestClose","header","headerIcon","stenaSliders","contentRight","jsx","CardHeader","jsxs","Row","FlatButton","stenaTimes","SearchFilterStateContext","createContext","useSearchFilterState","c","useContext","SearchFilterDispatchContext","useSearchFilterDispatch","SearchFilterActionsContext","useSearchFilterActions","SearchFilterDrawer","children","headerContentRight","drawerProps","open","dispatch","actions","closeDrawer","useCallback","Drawer","cssColor","Column","SearchFilterButton","label","leftIcon","onClickButton","SecondaryButton","SearchFilterSection","sectionId","contentLeft","loading","error","onRetry","disableContentPadding","state","expanded","_a","onClickLabel","activeLabel","formatColumnIdToHeaderCellLabel","Collapsible","CollapsibleContent","Spinner","Banner","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","CollapsibleClickableContent","sel","Checkbox","Text","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","Box","DateRangeCalendar"],"mappings":"mmBAkBaA,EAET,CAAC,CACH,eAAAC,EACA,OAAAC,EAAS,UACT,WAAAC,EAAaC,EAAA,aACb,aAAAC,CACF,IAEIC,EAAA,IAACC,EAAA,WAAA,CACC,KAAM,WACN,aACEC,EAAA,KAACC,EAAI,IAAA,CAAA,IAAK,EACP,SAAA,CAAAJ,EACAC,EAAA,IAAAI,EAAA,WAAA,CAAW,SAAUC,EAAAA,WAAY,QAASV,EAAgB,CAAA,EAC7D,EAEF,SAAUE,EACV,KAAMD,CAAA,CAAA,ECjCCU,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,ECEaM,GAAwD,CAAC,CACpE,SAAAC,EACA,OA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,EAAU,QAAAC,IACnB,CAACA,EAASD,CAAQ,CAAA,EAEd,CAACsH,EAAcC,CAAe,EAClC/D,WAAgC,WAAW,EAEvCgE,EAAiBrB,EAAAA,QAAQ,IAAMsB,EAAAA,mBAAmBtD,CAAK,EAAG,CAACA,CAAK,CAAC,EAEjEuD,EAAuBvH,EAAA,YAC1BgE,GAAqB,CACNoB,EAAAoC,EAAA,mBAAmBxD,CAAK,EAAGW,CAAO,CAClD,EACA,CAACS,EAAeT,CAAO,CAAA,EAIvB,OAAAlG,EAAA,IAACgC,EAAA,CACC,UAAAC,EACA,aAAAlC,EACA,YAAAmC,EACA,sBAAAI,EAEA,SAAAtC,EAAA,IAACgJ,MAAI,CAAA,KAAM,EAAG,WAAY,SACxB,SAAAhJ,EAAAA,IAACgJ,EAAAA,IAAI,CAAA,WAAY,QAAS,OAAM,GAC9B,SAAAhJ,EAAA,IAACiJ,EAAA,kBAAA,CACC,gBAAAN,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": "18.12.
|
|
3
|
+
"version": "18.12.1",
|
|
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": "18.12.
|
|
30
|
-
"@stenajs-webui/core": "18.12.
|
|
31
|
-
"@stenajs-webui/elements": "18.12.
|
|
32
|
-
"@stenajs-webui/forms": "18.12.
|
|
33
|
-
"@stenajs-webui/modal": "18.12.
|
|
34
|
-
"@stenajs-webui/panels": "18.12.
|
|
35
|
-
"@stenajs-webui/redux": "18.12.
|
|
36
|
-
"@stenajs-webui/select": "18.12.
|
|
37
|
-
"@stenajs-webui/theme": "18.12.
|
|
29
|
+
"@stenajs-webui/calendar": "18.12.1",
|
|
30
|
+
"@stenajs-webui/core": "18.12.1",
|
|
31
|
+
"@stenajs-webui/elements": "18.12.1",
|
|
32
|
+
"@stenajs-webui/forms": "18.12.1",
|
|
33
|
+
"@stenajs-webui/modal": "18.12.1",
|
|
34
|
+
"@stenajs-webui/panels": "18.12.1",
|
|
35
|
+
"@stenajs-webui/redux": "18.12.1",
|
|
36
|
+
"@stenajs-webui/select": "18.12.1",
|
|
37
|
+
"@stenajs-webui/theme": "18.12.1",
|
|
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": "8818f001c7328f889eb570756dc9f7ad7b394ca9"
|
|
69
69
|
}
|