@stenajs-webui/filter 17.21.0 → 17.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/features/search-filter/components/ClearFiltersButton.d.ts +1 -1
- package/dist/features/search-filter/components/StickyFooter.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +105 -90
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v17.22.0 (Mon Oct 24 2022)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Add `StickyFooter` for filter, automatically makes buttons 100% wide [#521](https://github.com/StenaIT/stenajs-webui/pull/521) ([@mattias800](https://github.com/mattias800))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Mattias Andersson ([@mattias800](https://github.com/mattias800))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v17.18.3 (Thu Sep 29 2022)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxProps } from "@stenajs-webui/core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
export interface StickySearchButtonProps extends Pick<BoxProps, "gap"> {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const StickyFooter: React.FC<StickySearchButtonProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./features/search-filter/components/SearchFilterDrawer";
|
|
|
5
5
|
export * from "./features/search-filter/components/SearchFilterButton";
|
|
6
6
|
export * from "./features/search-filter/components/SearchFilterSection";
|
|
7
7
|
export * from "./features/search-filter/components/SearchFilterPanelHeader";
|
|
8
|
+
export * from "./features/search-filter/components/StickyFooter";
|
|
8
9
|
export * from "./features/search-filter/components/context/SearchFilterContext";
|
|
9
10
|
export * from "./features/search-filter/components/context/SearchFilterLocalStateContext";
|
|
10
11
|
export * from "./features/search-filter/config/SearchFilterConfig";
|
package/dist/index.es.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { createContext as M, useContext as L, useCallback as h, useState as R, useReducer as Q, useMemo as v } from "react";
|
|
3
3
|
import { Drawer as U } from "@stenajs-webui/modal";
|
|
4
4
|
import { cssColor as X } from "@stenajs-webui/theme";
|
|
5
|
-
import { Row as
|
|
6
|
-
import { CardHeader as _, FlatButton as B, stenaTimes as I, stenaSliders as
|
|
7
|
-
import { jsx as c, jsxs as
|
|
5
|
+
import { Row as E, Column as y, truthyKeysAsList as $, Text as Z, Box as T } from "@stenajs-webui/core";
|
|
6
|
+
import { CardHeader as _, FlatButton as B, stenaTimes as I, stenaSliders as z, SecondaryButton as N, Spinner as ee, Banner as te, Chip as D } from "@stenajs-webui/elements";
|
|
7
|
+
import { jsx as c, jsxs as O, Fragment as ne } from "react/jsx-runtime";
|
|
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
|
-
import { combineReducers as
|
|
11
|
-
import { reducerIdGate as
|
|
10
|
+
import { combineReducers as ie } from "redux";
|
|
11
|
+
import { reducerIdGate as k, createValueByIdReducer as le, createEntityReducer as j, reducerIdGateAction as S, createEntityActions as g, createValueByIdActions as w } from "@stenajs-webui/redux";
|
|
12
12
|
import ae from "@emotion/styled";
|
|
13
13
|
import { Checkbox as de } from "@stenajs-webui/forms";
|
|
14
14
|
import { ChipMultiSelect as ue } from "@stenajs-webui/select";
|
|
@@ -16,11 +16,11 @@ import { stringsToDateRange as he, dateRangeToStrings as pe, DateRangeCalendar a
|
|
|
16
16
|
const Se = ({
|
|
17
17
|
onRequestClose: e,
|
|
18
18
|
header: t = "Filters",
|
|
19
|
-
headerIcon: n =
|
|
19
|
+
headerIcon: n = z,
|
|
20
20
|
contentRight: r
|
|
21
21
|
}) => /* @__PURE__ */ c(_, {
|
|
22
22
|
flex: "0 0 auto",
|
|
23
|
-
contentRight: /* @__PURE__ */
|
|
23
|
+
contentRight: /* @__PURE__ */ O(E, {
|
|
24
24
|
gap: 2,
|
|
25
25
|
children: [r, /* @__PURE__ */ c(B, {
|
|
26
26
|
leftIcon: I,
|
|
@@ -29,8 +29,8 @@ const Se = ({
|
|
|
29
29
|
}),
|
|
30
30
|
leftIcon: n,
|
|
31
31
|
text: t
|
|
32
|
-
}),
|
|
33
|
-
const e = L(
|
|
32
|
+
}), q = M(null), G = () => {
|
|
33
|
+
const e = L(q);
|
|
34
34
|
if (!e)
|
|
35
35
|
throw new Error(
|
|
36
36
|
"Missing search filter context, wrap components with SearchFilterContext component."
|
|
@@ -57,16 +57,16 @@ const Se = ({
|
|
|
57
57
|
settings: {
|
|
58
58
|
open: s
|
|
59
59
|
}
|
|
60
|
-
} = G(),
|
|
61
|
-
|
|
62
|
-
}, [a,
|
|
60
|
+
} = G(), i = F(), a = x(), d = h(() => {
|
|
61
|
+
i(a.closeFilters());
|
|
62
|
+
}, [a, i]);
|
|
63
63
|
return /* @__PURE__ */ c(U, {
|
|
64
64
|
background: X("--lhds-color-ui-50"),
|
|
65
65
|
width: "370px",
|
|
66
66
|
isOpen: s,
|
|
67
67
|
onRequestClose: d,
|
|
68
68
|
...o,
|
|
69
|
-
children: /* @__PURE__ */ y
|
|
69
|
+
children: /* @__PURE__ */ O(y, {
|
|
70
70
|
height: "100%",
|
|
71
71
|
children: [/* @__PURE__ */ c(Se, {
|
|
72
72
|
onRequestClose: d,
|
|
@@ -78,7 +78,7 @@ const Se = ({
|
|
|
78
78
|
});
|
|
79
79
|
}, We = ({
|
|
80
80
|
label: e = "Filters",
|
|
81
|
-
leftIcon: t =
|
|
81
|
+
leftIcon: t = z
|
|
82
82
|
}) => {
|
|
83
83
|
const n = F(), r = x(), o = h(() => {
|
|
84
84
|
n(r.openFilters());
|
|
@@ -88,19 +88,19 @@ const Se = ({
|
|
|
88
88
|
leftIcon: t,
|
|
89
89
|
onClick: o
|
|
90
90
|
});
|
|
91
|
-
},
|
|
91
|
+
}, A = function({
|
|
92
92
|
sectionId: t,
|
|
93
93
|
label: n,
|
|
94
94
|
contentLeft: r,
|
|
95
95
|
contentRight: o,
|
|
96
96
|
loading: s,
|
|
97
|
-
error:
|
|
97
|
+
error: i,
|
|
98
98
|
onRetry: a,
|
|
99
99
|
disableContentPadding: d,
|
|
100
100
|
children: p
|
|
101
101
|
}) {
|
|
102
|
-
var
|
|
103
|
-
const
|
|
102
|
+
var V;
|
|
103
|
+
const l = G(), C = F(), f = x(), m = (V = l.expandedSections.values[t]) != null ? V : !1, b = h(() => {
|
|
104
104
|
C(f.setSectionExpanded(t, !m));
|
|
105
105
|
}, [f, C, m, t]), J = n != null ? n : fe(t);
|
|
106
106
|
return /* @__PURE__ */ c(re, {
|
|
@@ -110,7 +110,7 @@ const Se = ({
|
|
|
110
110
|
contentLeft: r,
|
|
111
111
|
contentRight: o,
|
|
112
112
|
children: s ? /* @__PURE__ */ c(H, {
|
|
113
|
-
children: /* @__PURE__ */ c(
|
|
113
|
+
children: /* @__PURE__ */ c(E, {
|
|
114
114
|
spacing: !0,
|
|
115
115
|
justifyContent: "center",
|
|
116
116
|
flex: 1,
|
|
@@ -118,9 +118,9 @@ const Se = ({
|
|
|
118
118
|
size: "small"
|
|
119
119
|
})
|
|
120
120
|
})
|
|
121
|
-
}) :
|
|
121
|
+
}) : i ? /* @__PURE__ */ c(te, {
|
|
122
122
|
variant: "error",
|
|
123
|
-
text:
|
|
123
|
+
text: i,
|
|
124
124
|
contentRight: a ? /* @__PURE__ */ c(B, {
|
|
125
125
|
label: "Retry",
|
|
126
126
|
onClick: a
|
|
@@ -129,7 +129,21 @@ const Se = ({
|
|
|
129
129
|
children: p
|
|
130
130
|
})
|
|
131
131
|
});
|
|
132
|
-
}, fe = (e) => ce(se(e)),
|
|
132
|
+
}, fe = (e) => ce(se(e)), Ye = ({
|
|
133
|
+
children: e,
|
|
134
|
+
...t
|
|
135
|
+
}) => /* @__PURE__ */ c(y, {
|
|
136
|
+
style: {
|
|
137
|
+
marginTop: "auto"
|
|
138
|
+
},
|
|
139
|
+
justifyContent: "center",
|
|
140
|
+
spacing: 2,
|
|
141
|
+
indent: !0,
|
|
142
|
+
shadow: "popover",
|
|
143
|
+
zIndex: 1,
|
|
144
|
+
...t,
|
|
145
|
+
children: e
|
|
146
|
+
}), Y = M(null), Je = () => {
|
|
133
147
|
const e = L(Y);
|
|
134
148
|
if (!e)
|
|
135
149
|
throw new Error(
|
|
@@ -146,7 +160,7 @@ const Se = ({
|
|
|
146
160
|
value: n,
|
|
147
161
|
children: /* @__PURE__ */ c(W.Provider, {
|
|
148
162
|
value: r,
|
|
149
|
-
children: /* @__PURE__ */ c(
|
|
163
|
+
children: /* @__PURE__ */ c(q.Provider, {
|
|
150
164
|
value: t,
|
|
151
165
|
children: /* @__PURE__ */ c(Y.Provider, {
|
|
152
166
|
value: t.formModel,
|
|
@@ -161,18 +175,18 @@ const Se = ({
|
|
|
161
175
|
},
|
|
162
176
|
formModel: e,
|
|
163
177
|
expandedSections: { values: {} }
|
|
164
|
-
}), xe = (e, t) =>
|
|
165
|
-
expandedSections:
|
|
178
|
+
}), xe = (e, t) => ie({
|
|
179
|
+
expandedSections: k(
|
|
166
180
|
u(e, "expandedSections"),
|
|
167
|
-
|
|
181
|
+
le(t.expandedSections)
|
|
168
182
|
),
|
|
169
|
-
formModel:
|
|
183
|
+
formModel: k(
|
|
170
184
|
u(e, "formModel"),
|
|
171
|
-
|
|
185
|
+
j(t.formModel)
|
|
172
186
|
),
|
|
173
|
-
settings:
|
|
187
|
+
settings: k(
|
|
174
188
|
u(e, "settings"),
|
|
175
|
-
|
|
189
|
+
j(t.settings)
|
|
176
190
|
)
|
|
177
191
|
}), ge = (e, t) => ({
|
|
178
192
|
openFilters: () => S(
|
|
@@ -225,7 +239,7 @@ const Se = ({
|
|
|
225
239
|
state: r,
|
|
226
240
|
dispatch: o
|
|
227
241
|
};
|
|
228
|
-
},
|
|
242
|
+
}, Qe = function({
|
|
229
243
|
initialFormModel: t,
|
|
230
244
|
children: n
|
|
231
245
|
}) {
|
|
@@ -240,17 +254,17 @@ const Se = ({
|
|
|
240
254
|
dispatch: s,
|
|
241
255
|
children: n
|
|
242
256
|
});
|
|
243
|
-
},
|
|
257
|
+
}, P = ae.div`
|
|
244
258
|
padding: calc(var(--swui-metrics-spacing) / 2)
|
|
245
259
|
calc(var(--swui-metrics-indent) / 2);
|
|
246
|
-
`,
|
|
260
|
+
`, Ue = ({
|
|
247
261
|
children: e,
|
|
248
262
|
disableClearAllButton: t = !1
|
|
249
263
|
}) => {
|
|
250
264
|
const n = F(), r = x(), o = h(() => n(r.clearFormModel()), [r, n]);
|
|
251
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ O(E, {
|
|
252
266
|
flexWrap: "wrap",
|
|
253
|
-
children: [e, !t && /* @__PURE__ */ c(
|
|
267
|
+
children: [e, !t && /* @__PURE__ */ c(P, {
|
|
254
268
|
children: /* @__PURE__ */ c(B, {
|
|
255
269
|
size: "small",
|
|
256
270
|
label: "Clear all",
|
|
@@ -265,8 +279,8 @@ const Se = ({
|
|
|
265
279
|
const r = F(), o = x(), s = h(() => {
|
|
266
280
|
r(o.clearExpandedSections()), r(o.expandSection(n)), r(o.openFilters());
|
|
267
281
|
}, [o, r, n]);
|
|
268
|
-
return /* @__PURE__ */ c(
|
|
269
|
-
children: /* @__PURE__ */ c(
|
|
282
|
+
return /* @__PURE__ */ c(P, {
|
|
283
|
+
children: /* @__PURE__ */ c(D, {
|
|
270
284
|
label: t,
|
|
271
285
|
variant: "secondary",
|
|
272
286
|
onClick: s
|
|
@@ -278,22 +292,22 @@ const Se = ({
|
|
|
278
292
|
value: r,
|
|
279
293
|
onClickRemove: o
|
|
280
294
|
}) {
|
|
281
|
-
const s = F(),
|
|
295
|
+
const s = F(), i = x(), a = h((l) => s(i.setFormModelFields(l)), [s, i]), d = h(() => {
|
|
282
296
|
o == null || o({
|
|
283
297
|
value: r,
|
|
284
298
|
setFormModelFields: a
|
|
285
299
|
});
|
|
286
300
|
}, [o, a, r]), p = h(() => {
|
|
287
|
-
s(
|
|
288
|
-
}, [
|
|
289
|
-
return /* @__PURE__ */ c(
|
|
290
|
-
children: /* @__PURE__ */ c(
|
|
301
|
+
s(i.clearExpandedSections()), s(i.expandSection(t)), s(i.openFilters());
|
|
302
|
+
}, [i, s, t]);
|
|
303
|
+
return /* @__PURE__ */ c(P, {
|
|
304
|
+
children: /* @__PURE__ */ c(D, {
|
|
291
305
|
label: n != null ? n : t,
|
|
292
306
|
onClick: p,
|
|
293
307
|
onClickRemove: o ? d : void 0
|
|
294
308
|
})
|
|
295
309
|
});
|
|
296
|
-
},
|
|
310
|
+
}, Xe = function({
|
|
297
311
|
sectionId: t,
|
|
298
312
|
chips: n,
|
|
299
313
|
emptyChipLabel: r,
|
|
@@ -302,18 +316,18 @@ const Se = ({
|
|
|
302
316
|
return n != null && n.length ? /* @__PURE__ */ c(ne, {
|
|
303
317
|
children: n.map(({
|
|
304
318
|
label: s,
|
|
305
|
-
value:
|
|
319
|
+
value: i
|
|
306
320
|
}) => /* @__PURE__ */ c(ve, {
|
|
307
321
|
label: s != null ? s : t,
|
|
308
322
|
sectionId: t,
|
|
309
323
|
onClickRemove: o,
|
|
310
|
-
value:
|
|
311
|
-
},
|
|
324
|
+
value: i
|
|
325
|
+
}, i))
|
|
312
326
|
}) : r ? /* @__PURE__ */ c(Re, {
|
|
313
327
|
sectionId: t,
|
|
314
328
|
label: r
|
|
315
329
|
}) : null;
|
|
316
|
-
},
|
|
330
|
+
}, Ze = (e, t, n) => ({
|
|
317
331
|
chips: Me(
|
|
318
332
|
e[t],
|
|
319
333
|
n
|
|
@@ -322,7 +336,7 @@ const Se = ({
|
|
|
322
336
|
e,
|
|
323
337
|
t
|
|
324
338
|
)
|
|
325
|
-
}), Me = (e, t) =>
|
|
339
|
+
}), Me = (e, t) => $(e).map((n) => {
|
|
326
340
|
var o;
|
|
327
341
|
const r = t == null ? void 0 : t.find((s) => s.value === n);
|
|
328
342
|
return { value: n, label: (o = r == null ? void 0 : r.label) != null ? o : n };
|
|
@@ -331,15 +345,15 @@ const Se = ({
|
|
|
331
345
|
o[r] = !1, n({
|
|
332
346
|
[t]: o
|
|
333
347
|
});
|
|
334
|
-
},
|
|
348
|
+
}, _e = ({
|
|
335
349
|
options: e,
|
|
336
350
|
value: t,
|
|
337
351
|
onValueChange: n,
|
|
338
352
|
...r
|
|
339
|
-
}) => /* @__PURE__ */ c(
|
|
353
|
+
}) => /* @__PURE__ */ c(A, {
|
|
340
354
|
disableContentPadding: !0,
|
|
341
355
|
...r,
|
|
342
|
-
children: /* @__PURE__ */ c(
|
|
356
|
+
children: /* @__PURE__ */ c(y, {
|
|
343
357
|
maxHeight: "400px",
|
|
344
358
|
overflowY: "auto",
|
|
345
359
|
flex: 1,
|
|
@@ -362,24 +376,24 @@ const Se = ({
|
|
|
362
376
|
})
|
|
363
377
|
}, o.value))
|
|
364
378
|
})
|
|
365
|
-
}),
|
|
379
|
+
}), Ie = ({
|
|
366
380
|
options: e,
|
|
367
381
|
value: t,
|
|
368
382
|
noneSelectedLabel: n,
|
|
369
383
|
onValueChange: r,
|
|
370
384
|
...o
|
|
371
385
|
}) => {
|
|
372
|
-
const [s,
|
|
386
|
+
const [s, i] = R(""), a = v(() => t ? $(t).map((l) => {
|
|
373
387
|
var f;
|
|
374
|
-
const C = e == null ? void 0 : e.find((m) => m.value ===
|
|
388
|
+
const C = e == null ? void 0 : e.find((m) => m.value === l);
|
|
375
389
|
return {
|
|
376
|
-
value:
|
|
377
|
-
label: (f = C == null ? void 0 : C.label) != null ? f :
|
|
390
|
+
value: l,
|
|
391
|
+
label: (f = C == null ? void 0 : C.label) != null ? f : l
|
|
378
392
|
};
|
|
379
|
-
}) : [], [e, t]), d = v(() => e == null ? void 0 : e.filter((
|
|
380
|
-
r == null || r(be(
|
|
393
|
+
}) : [], [e, t]), d = v(() => e == null ? void 0 : e.filter((l) => l.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1 || l.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1), [e, s]), p = h((l) => {
|
|
394
|
+
r == null || r(be(l));
|
|
381
395
|
}, [r]);
|
|
382
|
-
return /* @__PURE__ */ c(
|
|
396
|
+
return /* @__PURE__ */ c(A, {
|
|
383
397
|
...o,
|
|
384
398
|
children: /* @__PURE__ */ c(ue, {
|
|
385
399
|
options: d,
|
|
@@ -387,100 +401,101 @@ const Se = ({
|
|
|
387
401
|
onValueChange: p,
|
|
388
402
|
inputValue: s,
|
|
389
403
|
noneSelectedLabel: n,
|
|
390
|
-
onInputChange:
|
|
404
|
+
onInputChange: i,
|
|
391
405
|
closeMenuOnSelect: !1
|
|
392
406
|
})
|
|
393
407
|
});
|
|
394
|
-
}, be = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}),
|
|
395
|
-
chips:
|
|
408
|
+
}, be = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ne = (e, t, n) => ({
|
|
409
|
+
chips: ke(
|
|
396
410
|
e[t],
|
|
397
411
|
e[n]
|
|
398
412
|
),
|
|
399
|
-
onClickRemoveOnChip:
|
|
413
|
+
onClickRemoveOnChip: Ee(
|
|
400
414
|
t,
|
|
401
415
|
n
|
|
402
416
|
)
|
|
403
|
-
}),
|
|
417
|
+
}), ke = (e, t) => !e && !t ? [] : [
|
|
404
418
|
{ value: "dateRange", label: `${e != null ? e : ""} - ${t != null ? t : ""}` }
|
|
405
|
-
],
|
|
419
|
+
], Ee = (e, t) => ({ setFormModelFields: n }) => {
|
|
406
420
|
n({
|
|
407
421
|
[e]: void 0,
|
|
408
422
|
[t]: void 0
|
|
409
423
|
});
|
|
410
|
-
},
|
|
424
|
+
}, et = (e, t, n) => ({
|
|
411
425
|
value: {
|
|
412
426
|
startDate: e[t],
|
|
413
427
|
endDate: e[n]
|
|
414
428
|
},
|
|
415
429
|
onValueChange: (r, { dispatch: o, actions: s }) => {
|
|
416
|
-
const
|
|
430
|
+
const i = {
|
|
417
431
|
[t]: r.startDate,
|
|
418
432
|
[n]: r.endDate
|
|
419
433
|
};
|
|
420
|
-
o(s.setFormModelFields(
|
|
434
|
+
o(s.setFormModelFields(i));
|
|
421
435
|
}
|
|
422
|
-
}),
|
|
436
|
+
}), tt = ({
|
|
423
437
|
value: e,
|
|
424
438
|
onValueChange: t,
|
|
425
439
|
sectionId: n,
|
|
426
440
|
contentLeft: r,
|
|
427
441
|
contentRight: o,
|
|
428
442
|
disableContentPadding: s,
|
|
429
|
-
...
|
|
443
|
+
...i
|
|
430
444
|
}) => {
|
|
431
445
|
const a = F(), d = x(), p = v(() => ({
|
|
432
446
|
dispatch: a,
|
|
433
447
|
actions: d
|
|
434
|
-
}), [d, a]), [
|
|
448
|
+
}), [d, a]), [l, C] = R("startDate"), f = v(() => he(e), [e]), m = h((b) => {
|
|
435
449
|
t(pe(b), p);
|
|
436
450
|
}, [t, p]);
|
|
437
|
-
return /* @__PURE__ */ c(
|
|
451
|
+
return /* @__PURE__ */ c(A, {
|
|
438
452
|
sectionId: n,
|
|
439
453
|
contentRight: o,
|
|
440
454
|
contentLeft: r,
|
|
441
455
|
disableContentPadding: s,
|
|
442
|
-
children: /* @__PURE__ */ c(
|
|
456
|
+
children: /* @__PURE__ */ c(T, {
|
|
443
457
|
flex: 1,
|
|
444
458
|
alignItems: "center",
|
|
445
|
-
children: /* @__PURE__ */ c(
|
|
459
|
+
children: /* @__PURE__ */ c(T, {
|
|
446
460
|
background: "white",
|
|
447
461
|
indent: !0,
|
|
448
462
|
children: /* @__PURE__ */ c(Ce, {
|
|
449
463
|
setFocusedInput: C,
|
|
450
|
-
focusedInput:
|
|
464
|
+
focusedInput: l,
|
|
451
465
|
value: f,
|
|
452
466
|
onValueChange: m,
|
|
453
|
-
...
|
|
467
|
+
...i
|
|
454
468
|
})
|
|
455
469
|
})
|
|
456
470
|
})
|
|
457
471
|
});
|
|
458
472
|
};
|
|
459
473
|
export {
|
|
460
|
-
|
|
461
|
-
|
|
474
|
+
Ie as ChipMultiSelectSection,
|
|
475
|
+
tt as DateRangeCalendarSection,
|
|
462
476
|
Re as EmptyChip,
|
|
463
477
|
W as SearchFilterActionsContext,
|
|
464
478
|
We as SearchFilterButton,
|
|
465
479
|
ve as SearchFilterChip,
|
|
466
|
-
|
|
480
|
+
Ue as SearchFilterChips,
|
|
467
481
|
me as SearchFilterContext,
|
|
468
482
|
K as SearchFilterDispatchContext,
|
|
469
483
|
Ke as SearchFilterDrawer,
|
|
470
|
-
|
|
484
|
+
Qe as SearchFilterLocalStateContext,
|
|
471
485
|
Y as SearchFilterModelContext,
|
|
472
486
|
Se as SearchFilterPanelHeader,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
487
|
+
A as SearchFilterSection,
|
|
488
|
+
q as SearchFilterStateContext,
|
|
489
|
+
Xe as SectionChips,
|
|
490
|
+
_e as SimpleCheckboxListSection,
|
|
491
|
+
Ye as StickyFooter,
|
|
477
492
|
Me as createChipsForBooleanRecord,
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
493
|
+
ke as createChipsForDateRange,
|
|
494
|
+
Ze as createChipsPropsForBooleanRecord,
|
|
495
|
+
Ne as createChipsPropsForDateRange,
|
|
496
|
+
et as createDateRangeSectionProps,
|
|
482
497
|
Le as createOnClickRemoveOnChipForBooleanRecord,
|
|
483
|
-
|
|
498
|
+
Ee as createOnClickRemoveOnChipForDateRange,
|
|
484
499
|
ge as createSearchFilterActions,
|
|
485
500
|
Fe as createSearchFilterInitialState,
|
|
486
501
|
xe as createSearchFilterReducer,
|
|
@@ -489,7 +504,7 @@ export {
|
|
|
489
504
|
we as useLocalSearchFilterState,
|
|
490
505
|
x as useSearchFilterActions,
|
|
491
506
|
F as useSearchFilterDispatch,
|
|
492
|
-
|
|
507
|
+
Je as useSearchFilterModel,
|
|
493
508
|
G as useSearchFilterState
|
|
494
509
|
};
|
|
495
510
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/features/search-filter/components/SearchFilterPanelHeader.tsx","../src/features/search-filter/context/SearchFilterStateContext.ts","../src/features/search-filter/context/SearchFilterDispatchContext.ts","../src/features/search-filter/context/SearchFilterActionsContext.ts","../src/features/search-filter/components/SearchFilterDrawer.tsx","../src/features/search-filter/components/SearchFilterButton.tsx","../src/features/search-filter/components/SearchFilterSection.tsx","../src/features/search-filter/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 { 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","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;AAAA,EACHC,gBAAAA;AAAAA,EACAC,QAAAA,IAAS;AAAA,EACTC,YAAAA,IAAaC;AAAAA,EACbC,cAAAA;AAJG,wBAOAC,GAAD;AAAA,EACE,MAAM;AAAA,EACN,gCACGC,GAAD;AAAA,IAAK,KAAK;AAAA,IAAV,UACGF,CAAAA,GACDG,gBAAAA,EAACC,GAAD;AAAA,MAAY,UAAUC;AAAAA,MAAY,SAAST;AAAAA,IAAAA,CAF7C,CAAA;AAAA,EAAA,CAHJ;AAAA,EAQE,UAAUE;AAAAA,EACV,MAAMD;AAAAA,CAVV,GCvBWS,IAA2BC,EAEtC,IAA6C,GAElCC,IAAuB,MAEE;AAC9B,QAAAC,IAAIC,EAAWJ,CAAwB;AAC7C,MAAI,CAACG;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGG,SAAAA;AACT,GCdaE,IAA8BJ,EAEzC,IAAgD,GAErCK,IAA0B,MAAM;AACrC,QAAAH,IAAIC,EAAWC,CAA2B;AAChD,MAAI,CAACF;AACG,UAAA,IAAI,MAAM,yCAAyC;AAEpD,SAAAA;AACT,GCVaI,IAA6BN,EAExC,IAAoD,GAEzCO,IAAyB,MAG/B;AACC,QAAAL,IAAIC,EAAWG,CAA0B;AAC/C,MAAI,CAACJ;AACG,UAAA,IAAI,MAAM,wCAAwC;AAEnD,SAAAA;AACT,GCEaM,KAAwD,CAAC;AAAA,EACpEC,UAAAA;AAAAA,EACAnB,QAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAmB,oBAAAA;AAAAA,KACGC;AALiE,MAMhE;AACE,QAAA;AAAA,IACJC,UAAU;AAAA,MAAEC,MAAAA;AAAAA,I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,uBAAAA;AAAAA,KACGiH;AAPH,MAQ4D;AAC5D,QAAMrI,IAAWT,KACXU,IAAUR,KAEV+F,IAAUuB,EACd,OAAO;AAAA,IAAE/G,UAAAA;AAAAA,IAAUC,SAAAA;AAAAA,EACnB,IAAA,CAACA,GAASD,CAAV,CAFqB,GAIjB,CAACsI,GAAcC,CAAf,IACJ5E,EAAgC,WAAxB,GAEJ6E,IAAiBzB,EAAQ,MAAM0B,GAAmB/D,CAAD,GAAS,CAACA,CAAD,CAAlC,GAExBgE,IAAuBvI,EAC3B,CAACuE,MAAqB;AACNiE,IAAAA,EAAAA,GAAmBjE,CAAD,GAASc,CAA5B;AAAA,EAAA,GAEf,CAACW,GAAeX,CAAhB,CAJsC;AAOxC,2BACG1E,GAAD;AAAA,IACE,WAAAC;AAAA,IACA,cAAApC;AAAA,IACA,aAAAqC;AAAA,IACA,uBAAAI;AAAA,IAJF,4BAMGwH,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","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;AAAA,EACHC,gBAAAA;AAAAA,EACAC,QAAAA,IA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AAA,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;"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e)}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),J=require("@stenajs-webui/modal"),Q=require("@stenajs-webui/theme"),S=require("@stenajs-webui/core"),x=require("@stenajs-webui/elements"),s=require("react/jsx-runtime"),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"),
|
|
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"),s=require("react/jsx-runtime"),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;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/features/search-filter/components/SearchFilterPanelHeader.tsx","../src/features/search-filter/context/SearchFilterStateContext.ts","../src/features/search-filter/context/SearchFilterDispatchContext.ts","../src/features/search-filter/context/SearchFilterActionsContext.ts","../src/features/search-filter/components/SearchFilterDrawer.tsx","../src/features/search-filter/components/SearchFilterButton.tsx","../src/features/search-filter/components/SearchFilterSection.tsx","../src/features/search-filter/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 { 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","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,E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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","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,EACA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6E,EAAiB1B,EAAAA,QAAQ,IAAM2B,EAAAA,mBAAmB/D,CAAD,EAAS,CAACA,CAAD,CAAlC,EAExBgE,EAAuB1I,cAC1B0E,GAAqB,CACNiE,EAAAA,EAAAA,mBAAmBjE,CAAD,EAASc,CAA5B,CAAA,EAEf,CAACU,EAAeV,CAAhB,CAJsC,EAOxC,aACG7E,EAAD,CACE,UAAAC,EACA,aAAApC,EACA,YAAAqC,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stenajs-webui/filter",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.23.0",
|
|
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": "17.
|
|
30
|
-
"@stenajs-webui/core": "17.
|
|
31
|
-
"@stenajs-webui/elements": "17.
|
|
32
|
-
"@stenajs-webui/forms": "17.
|
|
33
|
-
"@stenajs-webui/modal": "17.
|
|
34
|
-
"@stenajs-webui/panels": "17.
|
|
35
|
-
"@stenajs-webui/redux": "17.
|
|
36
|
-
"@stenajs-webui/select": "17.
|
|
37
|
-
"@stenajs-webui/theme": "17.
|
|
29
|
+
"@stenajs-webui/calendar": "17.23.0",
|
|
30
|
+
"@stenajs-webui/core": "17.23.0",
|
|
31
|
+
"@stenajs-webui/elements": "17.23.0",
|
|
32
|
+
"@stenajs-webui/forms": "17.23.0",
|
|
33
|
+
"@stenajs-webui/modal": "17.23.0",
|
|
34
|
+
"@stenajs-webui/panels": "17.23.0",
|
|
35
|
+
"@stenajs-webui/redux": "17.23.0",
|
|
36
|
+
"@stenajs-webui/select": "17.23.0",
|
|
37
|
+
"@stenajs-webui/theme": "17.23.0",
|
|
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": "38a8785db11f22a185a3b659d316821af20022fb"
|
|
69
69
|
}
|