@stenajs-webui/filter 22.6.2 → 22.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +190 -190
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { jsx as c, jsxs as w, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as M, useContext as k, useCallback as d, useState as R, useReducer as W, useMemo as b } from "react";
|
|
3
3
|
import { DrawerHeader as Y, Drawer as J } from "@stenajs-webui/modal";
|
|
4
4
|
import { cssColor as Q } from "@stenajs-webui/theme";
|
|
5
|
-
import { Column as
|
|
5
|
+
import { Column as V, Box as y, Row as D, Space as U, Text as X, truthyKeysAsList as T } from "@stenajs-webui/core";
|
|
6
6
|
import { SecondaryButton as Z, stenaSlidersMini as _, MenuButton as I, Spinner as N, Banner as ee, FlatButton as j, ContentMenuButton as te, stenaClean as ne, Chip as H } from "@stenajs-webui/elements";
|
|
7
|
-
import { upperFirst as
|
|
7
|
+
import { upperFirst as oe, lowerCase as re } from "lodash-es";
|
|
8
8
|
import { combineReducers as ce } from "redux";
|
|
9
|
-
import {
|
|
9
|
+
import { reducerIdGateAction as C, reducerIdGate as B, createEntityReducer as A, createValueByIdReducer as se, createValueByIdActions as g, createEntityActions as v } from "@stenajs-webui/redux";
|
|
10
10
|
import { Checkbox as ae } from "@stenajs-webui/forms";
|
|
11
11
|
import { ChipMultiSelect as le } from "@stenajs-webui/select";
|
|
12
|
-
import { stringsToDateRange as ie, dateRangeToStrings as
|
|
13
|
-
const
|
|
14
|
-
const e =
|
|
12
|
+
import { stringsToDateRange as ie, dateRangeToStrings as ue, DateRangeCalendar as de } from "@stenajs-webui/calendar";
|
|
13
|
+
const pe = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, header: e }), $ = M(null), z = () => {
|
|
14
|
+
const e = k($);
|
|
15
15
|
if (!e)
|
|
16
16
|
throw new Error(
|
|
17
17
|
"Missing search filter context, wrap components with SearchFilterContext component."
|
|
18
18
|
);
|
|
19
19
|
return e;
|
|
20
|
-
}, q =
|
|
21
|
-
const e =
|
|
20
|
+
}, q = M(null), f = () => {
|
|
21
|
+
const e = k(q);
|
|
22
22
|
if (!e)
|
|
23
23
|
throw new Error("Missing search filter dispatch context.");
|
|
24
24
|
return e;
|
|
25
|
-
}, G =
|
|
26
|
-
const e =
|
|
25
|
+
}, G = M(null), F = () => {
|
|
26
|
+
const e = k(G);
|
|
27
27
|
if (!e)
|
|
28
28
|
throw new Error("Missing search filter actions context.");
|
|
29
29
|
return e;
|
|
@@ -31,29 +31,29 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
31
31
|
children: e,
|
|
32
32
|
header: t,
|
|
33
33
|
headerContentRight: n,
|
|
34
|
-
...
|
|
34
|
+
...o
|
|
35
35
|
}) => {
|
|
36
36
|
const {
|
|
37
|
-
settings: { open:
|
|
38
|
-
} = z(), s =
|
|
37
|
+
settings: { open: r }
|
|
38
|
+
} = z(), s = f(), a = F(), i = d(() => {
|
|
39
39
|
s(a.closeFilters());
|
|
40
40
|
}, [a, s]);
|
|
41
41
|
return /* @__PURE__ */ c(
|
|
42
42
|
J,
|
|
43
43
|
{
|
|
44
44
|
floating: !0,
|
|
45
|
-
isOpen:
|
|
45
|
+
isOpen: r,
|
|
46
46
|
onRequestClose: i,
|
|
47
|
-
...
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
|
|
47
|
+
...o,
|
|
48
|
+
children: /* @__PURE__ */ w(
|
|
49
|
+
V,
|
|
50
50
|
{
|
|
51
51
|
height: "100%",
|
|
52
52
|
borderRadius: "var(--swui-border-radius)",
|
|
53
53
|
background: Q("--lhds-color-ui-50"),
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ c(
|
|
56
|
-
|
|
56
|
+
pe,
|
|
57
57
|
{
|
|
58
58
|
onRequestClose: i,
|
|
59
59
|
header: t,
|
|
@@ -70,59 +70,59 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
70
70
|
label: e = "Filters",
|
|
71
71
|
leftIcon: t = _
|
|
72
72
|
}) => {
|
|
73
|
-
const n =
|
|
74
|
-
n(
|
|
75
|
-
}, [
|
|
73
|
+
const n = f(), o = F(), r = d(() => {
|
|
74
|
+
n(o.openFilters());
|
|
75
|
+
}, [o, n]);
|
|
76
76
|
return /* @__PURE__ */ c(
|
|
77
77
|
Z,
|
|
78
78
|
{
|
|
79
79
|
label: e,
|
|
80
80
|
leftIcon: t,
|
|
81
|
-
onClick:
|
|
81
|
+
onClick: r
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
},
|
|
84
|
+
}, O = function({
|
|
85
85
|
sectionId: t,
|
|
86
86
|
label: n,
|
|
87
|
-
loading:
|
|
88
|
-
error:
|
|
87
|
+
loading: o,
|
|
88
|
+
error: r,
|
|
89
89
|
onRetry: s,
|
|
90
90
|
disableContentPadding: a,
|
|
91
91
|
children: i,
|
|
92
|
-
leftIcon:
|
|
93
|
-
contentRight:
|
|
92
|
+
leftIcon: p,
|
|
93
|
+
contentRight: h
|
|
94
94
|
}) {
|
|
95
|
-
const l = z(),
|
|
96
|
-
|
|
97
|
-
}, [m, S,
|
|
98
|
-
return /* @__PURE__ */
|
|
95
|
+
const l = z(), m = f(), x = F(), S = l.expandedSections.values[t] ?? !1, L = d(() => {
|
|
96
|
+
m(x.setSectionExpanded(t, !S));
|
|
97
|
+
}, [x, m, S, t]), E = n ?? he(t);
|
|
98
|
+
return /* @__PURE__ */ w(P, { children: [
|
|
99
99
|
/* @__PURE__ */ c(
|
|
100
100
|
I,
|
|
101
101
|
{
|
|
102
|
-
label:
|
|
103
|
-
leftIcon:
|
|
102
|
+
label: E,
|
|
103
|
+
leftIcon: p,
|
|
104
104
|
expandable: !0,
|
|
105
|
-
expanded:
|
|
106
|
-
selected:
|
|
107
|
-
onClick:
|
|
108
|
-
right:
|
|
109
|
-
children:
|
|
105
|
+
expanded: S,
|
|
106
|
+
selected: S,
|
|
107
|
+
onClick: L,
|
|
108
|
+
right: h,
|
|
109
|
+
children: o ? /* @__PURE__ */ c(D, { spacing: !0, justifyContent: "center", flex: 1, children: /* @__PURE__ */ c(N, { size: "small" }) }) : r ? /* @__PURE__ */ c(
|
|
110
110
|
ee,
|
|
111
111
|
{
|
|
112
112
|
variant: "error",
|
|
113
|
-
text:
|
|
113
|
+
text: r,
|
|
114
114
|
contentRight: s ? /* @__PURE__ */ c(j, { label: "Retry", onClick: s }) : null
|
|
115
115
|
}
|
|
116
116
|
) : i
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
-
|
|
119
|
+
S && /* @__PURE__ */ c(U, {})
|
|
120
120
|
] });
|
|
121
|
-
},
|
|
121
|
+
}, he = (e) => oe(re(e)), Ge = ({
|
|
122
122
|
children: e,
|
|
123
123
|
...t
|
|
124
124
|
}) => /* @__PURE__ */ c(
|
|
125
|
-
|
|
125
|
+
V,
|
|
126
126
|
{
|
|
127
127
|
style: { marginTop: "auto" },
|
|
128
128
|
justifyContent: "center",
|
|
@@ -133,115 +133,115 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
133
133
|
...t,
|
|
134
134
|
children: e
|
|
135
135
|
}
|
|
136
|
-
), K =
|
|
137
|
-
const e =
|
|
136
|
+
), K = M(null), Ke = () => {
|
|
137
|
+
const e = k(K);
|
|
138
138
|
if (!e)
|
|
139
139
|
throw new Error(
|
|
140
140
|
"Missing search filter context, wrap components with SearchFilterContext component."
|
|
141
141
|
);
|
|
142
142
|
return e;
|
|
143
|
-
},
|
|
143
|
+
}, Ce = function({
|
|
144
144
|
state: t,
|
|
145
145
|
dispatch: n,
|
|
146
|
-
actions:
|
|
147
|
-
children:
|
|
146
|
+
actions: o,
|
|
147
|
+
children: r
|
|
148
148
|
}) {
|
|
149
149
|
return /* @__PURE__ */ c(
|
|
150
150
|
q.Provider,
|
|
151
151
|
{
|
|
152
152
|
value: n,
|
|
153
|
-
children: /* @__PURE__ */ c(G.Provider, { value:
|
|
153
|
+
children: /* @__PURE__ */ c(G.Provider, { value: o, children: /* @__PURE__ */ c($.Provider, { value: t, children: /* @__PURE__ */ c(K.Provider, { value: t.formModel, children: r }) }) })
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
|
-
},
|
|
156
|
+
}, Se = (e) => ({
|
|
157
157
|
settings: {
|
|
158
158
|
open: !1
|
|
159
159
|
},
|
|
160
160
|
formModel: e,
|
|
161
161
|
expandedSections: { values: {} }
|
|
162
|
-
}),
|
|
162
|
+
}), fe = (e, t) => ce({
|
|
163
163
|
expandedSections: B(
|
|
164
|
-
|
|
164
|
+
u(e, "expandedSections"),
|
|
165
165
|
se(t.expandedSections)
|
|
166
166
|
),
|
|
167
167
|
formModel: B(
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
u(e, "formModel"),
|
|
169
|
+
A(t.formModel)
|
|
170
170
|
),
|
|
171
171
|
settings: B(
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
u(e, "settings"),
|
|
173
|
+
A(t.settings)
|
|
174
174
|
)
|
|
175
175
|
}), Fe = (e, t) => ({
|
|
176
|
-
openFilters: () =>
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
openFilters: () => C(
|
|
177
|
+
u(e, "settings"),
|
|
178
|
+
v().setEntityFields({
|
|
179
179
|
open: !0
|
|
180
180
|
})
|
|
181
181
|
),
|
|
182
|
-
closeFilters: () =>
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
closeFilters: () => C(
|
|
183
|
+
u(e, "settings"),
|
|
184
|
+
v().setEntityFields({
|
|
185
185
|
open: !1
|
|
186
186
|
})
|
|
187
187
|
),
|
|
188
|
-
setFormModelFields: (n) =>
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
setFormModelFields: (n) => C(
|
|
189
|
+
u(e, "formModel"),
|
|
190
|
+
v().setEntityFields(n)
|
|
191
191
|
),
|
|
192
|
-
clearFormModel: () =>
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
clearFormModel: () => C(
|
|
193
|
+
u(e, "formModel"),
|
|
194
|
+
v().setEntity(t)
|
|
195
195
|
),
|
|
196
|
-
expandSection: (n) =>
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
expandSection: (n) => C(
|
|
197
|
+
u(e, "expandedSections"),
|
|
198
|
+
g().setValue(n, !0)
|
|
199
199
|
),
|
|
200
|
-
collapseSection: (n) =>
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
collapseSection: (n) => C(
|
|
201
|
+
u(e, "expandedSections"),
|
|
202
|
+
g().setValue(n, !1)
|
|
203
203
|
),
|
|
204
|
-
setSectionExpanded: (n,
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
setSectionExpanded: (n, o) => C(
|
|
205
|
+
u(e, "expandedSections"),
|
|
206
|
+
g().setValue(n, o)
|
|
207
207
|
),
|
|
208
|
-
clearExpandedSections: () =>
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
clearExpandedSections: () => C(
|
|
209
|
+
u(e, "expandedSections"),
|
|
210
|
+
g().clearAllValues()
|
|
211
211
|
)
|
|
212
|
-
}),
|
|
213
|
-
const [t] =
|
|
214
|
-
() =>
|
|
215
|
-
), [n] =
|
|
212
|
+
}), u = (e, t) => `${e}.${t}`, me = (e) => {
|
|
213
|
+
const [t] = R(
|
|
214
|
+
() => fe("local", e)
|
|
215
|
+
), [n] = R(
|
|
216
216
|
() => Fe(
|
|
217
217
|
"local",
|
|
218
218
|
e.formModel
|
|
219
219
|
)
|
|
220
|
-
), [
|
|
220
|
+
), [o, r] = W(t, e);
|
|
221
221
|
return {
|
|
222
222
|
actions: n,
|
|
223
|
-
state:
|
|
224
|
-
dispatch:
|
|
223
|
+
state: o,
|
|
224
|
+
dispatch: r
|
|
225
225
|
};
|
|
226
226
|
}, We = function({
|
|
227
227
|
initialFormModel: t,
|
|
228
228
|
children: n
|
|
229
229
|
}) {
|
|
230
|
-
const { state:
|
|
231
|
-
|
|
230
|
+
const { state: o, actions: r, dispatch: s } = me(
|
|
231
|
+
Se(t)
|
|
232
232
|
);
|
|
233
|
-
return /* @__PURE__ */ c(
|
|
234
|
-
},
|
|
233
|
+
return /* @__PURE__ */ c(Ce, { state: o, actions: r, dispatch: s, children: n });
|
|
234
|
+
}, xe = ({
|
|
235
235
|
label: e,
|
|
236
236
|
...t
|
|
237
|
-
}) => /* @__PURE__ */ c(te, { children: /* @__PURE__ */
|
|
237
|
+
}) => /* @__PURE__ */ c(te, { children: /* @__PURE__ */ w(D, { gap: 2, alignItems: "center", justifyContent: "flex-start", children: [
|
|
238
238
|
/* @__PURE__ */ c(ae, { ...t }),
|
|
239
239
|
/* @__PURE__ */ c(X, { children: e })
|
|
240
240
|
] }) }), ge = ({
|
|
241
241
|
children: e,
|
|
242
242
|
maxHeight: t
|
|
243
243
|
}) => /* @__PURE__ */ c(
|
|
244
|
-
|
|
244
|
+
V,
|
|
245
245
|
{
|
|
246
246
|
maxHeight: t,
|
|
247
247
|
overflowY: t ? "auto" : void 0,
|
|
@@ -252,11 +252,11 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
252
252
|
children: e,
|
|
253
253
|
disableClearAllButton: t = !1
|
|
254
254
|
}) => {
|
|
255
|
-
const n =
|
|
256
|
-
() => n(
|
|
257
|
-
[
|
|
255
|
+
const n = f(), o = F(), r = d(
|
|
256
|
+
() => n(o.clearFormModel()),
|
|
257
|
+
[o, n]
|
|
258
258
|
);
|
|
259
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ w(D, { flexWrap: "wrap", alignItems: "center", gap: !0, children: [
|
|
260
260
|
e,
|
|
261
261
|
!t && /* @__PURE__ */ c(
|
|
262
262
|
j,
|
|
@@ -264,134 +264,134 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
264
264
|
size: "small",
|
|
265
265
|
leftIcon: ne,
|
|
266
266
|
label: "Clear",
|
|
267
|
-
onClick:
|
|
267
|
+
onClick: r
|
|
268
268
|
}
|
|
269
269
|
)
|
|
270
270
|
] });
|
|
271
|
-
},
|
|
271
|
+
}, ve = function({
|
|
272
272
|
label: t,
|
|
273
273
|
sectionId: n
|
|
274
274
|
}) {
|
|
275
|
-
const
|
|
276
|
-
r
|
|
277
|
-
}, [
|
|
275
|
+
const o = f(), r = F(), s = d(() => {
|
|
276
|
+
o(r.clearExpandedSections()), o(r.expandSection(n)), o(r.openFilters());
|
|
277
|
+
}, [r, o, n]);
|
|
278
278
|
return /* @__PURE__ */ c(H, { label: t, variant: "secondary", onClick: s });
|
|
279
|
-
},
|
|
279
|
+
}, Re = function({
|
|
280
280
|
sectionId: t,
|
|
281
281
|
label: n,
|
|
282
|
-
value:
|
|
283
|
-
onClickRemove:
|
|
282
|
+
value: o,
|
|
283
|
+
onClickRemove: r
|
|
284
284
|
}) {
|
|
285
|
-
const s =
|
|
285
|
+
const s = f(), a = F(), i = d(
|
|
286
286
|
(l) => s(a.setFormModelFields(l)),
|
|
287
287
|
[s, a]
|
|
288
|
-
),
|
|
289
|
-
|
|
290
|
-
}, [
|
|
288
|
+
), p = d(() => {
|
|
289
|
+
r?.({ value: o, setFormModelFields: i });
|
|
290
|
+
}, [r, i, o]), h = d(() => {
|
|
291
291
|
s(a.clearExpandedSections()), s(a.expandSection(t)), s(a.openFilters());
|
|
292
292
|
}, [a, s, t]);
|
|
293
293
|
return /* @__PURE__ */ c(
|
|
294
294
|
H,
|
|
295
295
|
{
|
|
296
296
|
label: n ?? t,
|
|
297
|
-
onClick:
|
|
298
|
-
onClickRemove:
|
|
297
|
+
onClick: h,
|
|
298
|
+
onClickRemove: r ? p : void 0
|
|
299
299
|
}
|
|
300
300
|
);
|
|
301
301
|
}, Je = function({
|
|
302
302
|
sectionId: t,
|
|
303
303
|
chips: n,
|
|
304
|
-
emptyChipLabel:
|
|
305
|
-
onClickRemoveOnChip:
|
|
304
|
+
emptyChipLabel: o,
|
|
305
|
+
onClickRemoveOnChip: r
|
|
306
306
|
}) {
|
|
307
|
-
return n
|
|
308
|
-
|
|
307
|
+
return n?.length ? /* @__PURE__ */ c(P, { children: n.map(({ label: s, value: a }) => /* @__PURE__ */ c(
|
|
308
|
+
Re,
|
|
309
309
|
{
|
|
310
310
|
label: s ?? t,
|
|
311
311
|
sectionId: t,
|
|
312
|
-
onClickRemove:
|
|
312
|
+
onClickRemove: r,
|
|
313
313
|
value: a
|
|
314
314
|
},
|
|
315
315
|
a
|
|
316
|
-
)) }) :
|
|
316
|
+
)) }) : o ? /* @__PURE__ */ c(ve, { sectionId: t, label: o }) : null;
|
|
317
317
|
}, Qe = (e, t, n) => ({
|
|
318
|
-
chips:
|
|
318
|
+
chips: be(
|
|
319
319
|
e[t],
|
|
320
320
|
n
|
|
321
321
|
),
|
|
322
|
-
onClickRemoveOnChip:
|
|
322
|
+
onClickRemoveOnChip: we(
|
|
323
323
|
e,
|
|
324
324
|
t
|
|
325
325
|
)
|
|
326
|
-
}),
|
|
327
|
-
const
|
|
328
|
-
return { value: n, label:
|
|
329
|
-
}),
|
|
330
|
-
const
|
|
331
|
-
o
|
|
332
|
-
[t]:
|
|
326
|
+
}), be = (e, t) => T(e).map((n) => {
|
|
327
|
+
const o = t?.find((r) => r.value === n);
|
|
328
|
+
return { value: n, label: o?.label ?? n };
|
|
329
|
+
}), we = (e, t) => ({ setFormModelFields: n, value: o }) => {
|
|
330
|
+
const r = { ...e[t] };
|
|
331
|
+
r[o] = !1, n({
|
|
332
|
+
[t]: r
|
|
333
333
|
});
|
|
334
334
|
}, Ue = ({
|
|
335
335
|
options: e,
|
|
336
336
|
value: t,
|
|
337
337
|
onValueChange: n,
|
|
338
|
-
...
|
|
339
|
-
}) => /* @__PURE__ */ c(
|
|
340
|
-
|
|
338
|
+
...o
|
|
339
|
+
}) => /* @__PURE__ */ c(O, { disableContentPadding: !0, ...o, children: /* @__PURE__ */ c(ge, { maxHeight: "400px", children: e?.map((r) => /* @__PURE__ */ c(
|
|
340
|
+
xe,
|
|
341
341
|
{
|
|
342
|
-
value: t
|
|
343
|
-
label:
|
|
344
|
-
onValueChange: (s) => n
|
|
342
|
+
value: t?.[r.value],
|
|
343
|
+
label: r.label,
|
|
344
|
+
onValueChange: (s) => n?.({
|
|
345
345
|
...t,
|
|
346
|
-
[
|
|
346
|
+
[r.value]: s
|
|
347
347
|
})
|
|
348
348
|
},
|
|
349
|
-
|
|
349
|
+
r.value
|
|
350
350
|
)) }) }), Xe = ({
|
|
351
351
|
options: e,
|
|
352
352
|
value: t,
|
|
353
353
|
noneSelectedLabel: n,
|
|
354
|
-
onValueChange:
|
|
355
|
-
...
|
|
354
|
+
onValueChange: o,
|
|
355
|
+
...r
|
|
356
356
|
}) => {
|
|
357
|
-
const [s, a] =
|
|
358
|
-
() => t ?
|
|
359
|
-
const
|
|
360
|
-
return { value: l, label:
|
|
357
|
+
const [s, a] = R(""), i = b(
|
|
358
|
+
() => t ? T(t).map((l) => {
|
|
359
|
+
const m = e?.find((x) => x.value === l);
|
|
360
|
+
return { value: l, label: m?.label ?? l };
|
|
361
361
|
}) : [],
|
|
362
362
|
[e, t]
|
|
363
|
-
),
|
|
363
|
+
), p = b(() => e?.filter(
|
|
364
364
|
(l) => l.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1 || l.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1
|
|
365
|
-
), [e, s]),
|
|
365
|
+
), [e, s]), h = d(
|
|
366
366
|
(l) => {
|
|
367
|
-
|
|
367
|
+
o?.(Me(l));
|
|
368
368
|
},
|
|
369
|
-
[
|
|
369
|
+
[o]
|
|
370
370
|
);
|
|
371
|
-
return /* @__PURE__ */ c(
|
|
371
|
+
return /* @__PURE__ */ c(O, { ...r, children: /* @__PURE__ */ c(
|
|
372
372
|
le,
|
|
373
373
|
{
|
|
374
|
-
options:
|
|
374
|
+
options: p,
|
|
375
375
|
value: i,
|
|
376
|
-
onValueChange:
|
|
376
|
+
onValueChange: h,
|
|
377
377
|
inputValue: s,
|
|
378
378
|
noneSelectedLabel: n,
|
|
379
379
|
onInputChange: a,
|
|
380
380
|
closeMenuOnSelect: !1
|
|
381
381
|
}
|
|
382
382
|
) });
|
|
383
|
-
},
|
|
384
|
-
chips:
|
|
383
|
+
}, Me = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ze = (e, t, n) => ({
|
|
384
|
+
chips: ke(
|
|
385
385
|
e[t],
|
|
386
386
|
e[n]
|
|
387
387
|
),
|
|
388
|
-
onClickRemoveOnChip:
|
|
388
|
+
onClickRemoveOnChip: Le(
|
|
389
389
|
t,
|
|
390
390
|
n
|
|
391
391
|
)
|
|
392
|
-
}),
|
|
392
|
+
}), ke = (e, t) => !e && !t ? [] : [
|
|
393
393
|
{ value: "dateRange", label: `${e ?? ""} - ${t ?? ""}` }
|
|
394
|
-
],
|
|
394
|
+
], Le = (e, t) => ({ setFormModelFields: n }) => {
|
|
395
395
|
n({
|
|
396
396
|
[e]: void 0,
|
|
397
397
|
[t]: void 0
|
|
@@ -402,47 +402,47 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
402
402
|
endDate: e[n]
|
|
403
403
|
},
|
|
404
404
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
405
|
-
onValueChange: (
|
|
405
|
+
onValueChange: (o, { dispatch: r, actions: s }) => {
|
|
406
406
|
const a = {
|
|
407
|
-
[t]:
|
|
408
|
-
[n]:
|
|
407
|
+
[t]: o.startDate,
|
|
408
|
+
[n]: o.endDate
|
|
409
409
|
};
|
|
410
|
-
|
|
410
|
+
r(s.setFormModelFields(a));
|
|
411
411
|
}
|
|
412
412
|
}), Ie = ({
|
|
413
413
|
value: e,
|
|
414
414
|
onValueChange: t,
|
|
415
415
|
sectionId: n,
|
|
416
|
-
contentRight:
|
|
417
|
-
disableContentPadding:
|
|
416
|
+
contentRight: o,
|
|
417
|
+
disableContentPadding: r,
|
|
418
418
|
label: s,
|
|
419
419
|
leftIcon: a,
|
|
420
420
|
...i
|
|
421
421
|
}) => {
|
|
422
|
-
const
|
|
423
|
-
() => ({ dispatch:
|
|
424
|
-
[
|
|
425
|
-
), [
|
|
426
|
-
(
|
|
427
|
-
t(
|
|
422
|
+
const p = f(), h = F(), l = b(
|
|
423
|
+
() => ({ dispatch: p, actions: h }),
|
|
424
|
+
[h, p]
|
|
425
|
+
), [m, x] = R("startDate"), S = b(() => ie(e), [e]), L = d(
|
|
426
|
+
(E) => {
|
|
427
|
+
t(ue(E), l);
|
|
428
428
|
},
|
|
429
429
|
[t, l]
|
|
430
430
|
);
|
|
431
431
|
return /* @__PURE__ */ c(
|
|
432
|
-
|
|
432
|
+
O,
|
|
433
433
|
{
|
|
434
434
|
label: s,
|
|
435
435
|
leftIcon: a,
|
|
436
436
|
sectionId: n,
|
|
437
|
-
contentRight:
|
|
438
|
-
disableContentPadding:
|
|
437
|
+
contentRight: o,
|
|
438
|
+
disableContentPadding: r,
|
|
439
439
|
children: /* @__PURE__ */ c(y, { flex: 1, alignItems: "center", children: /* @__PURE__ */ c(y, { background: "white", indent: !0, children: /* @__PURE__ */ c(
|
|
440
|
-
|
|
440
|
+
de,
|
|
441
441
|
{
|
|
442
|
-
setFocusedInput:
|
|
443
|
-
focusedInput:
|
|
444
|
-
value:
|
|
445
|
-
onValueChange:
|
|
442
|
+
setFocusedInput: x,
|
|
443
|
+
focusedInput: m,
|
|
444
|
+
value: S,
|
|
445
|
+
onValueChange: L,
|
|
446
446
|
...i
|
|
447
447
|
}
|
|
448
448
|
) }) })
|
|
@@ -452,39 +452,39 @@ const he = ({ header: e = "Filter", ...t }) => /* @__PURE__ */ c(Y, { ...t, head
|
|
|
452
452
|
export {
|
|
453
453
|
Xe as ChipMultiSelectSection,
|
|
454
454
|
Ie as DateRangeCalendarSection,
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
ve as EmptyChip,
|
|
456
|
+
xe as FilterCheckbox,
|
|
457
457
|
ge as FilterCheckboxList,
|
|
458
458
|
G as SearchFilterActionsContext,
|
|
459
459
|
qe as SearchFilterButton,
|
|
460
|
-
|
|
460
|
+
Re as SearchFilterChip,
|
|
461
461
|
Ye as SearchFilterChips,
|
|
462
|
-
|
|
462
|
+
Ce as SearchFilterContext,
|
|
463
463
|
q as SearchFilterDispatchContext,
|
|
464
464
|
ze as SearchFilterDrawer,
|
|
465
465
|
We as SearchFilterLocalStateContext,
|
|
466
466
|
K as SearchFilterModelContext,
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
pe as SearchFilterPanelHeader,
|
|
468
|
+
O as SearchFilterSection,
|
|
469
469
|
$ as SearchFilterStateContext,
|
|
470
470
|
Je as SectionChips,
|
|
471
471
|
Ue as SimpleCheckboxListSection,
|
|
472
472
|
Ge as StickyFooter,
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
be as createChipsForBooleanRecord,
|
|
474
|
+
ke as createChipsForDateRange,
|
|
475
475
|
Qe as createChipsPropsForBooleanRecord,
|
|
476
476
|
Ze as createChipsPropsForDateRange,
|
|
477
477
|
_e as createDateRangeSectionProps,
|
|
478
|
-
|
|
479
|
-
|
|
478
|
+
we as createOnClickRemoveOnChipForBooleanRecord,
|
|
479
|
+
Le as createOnClickRemoveOnChipForDateRange,
|
|
480
480
|
Fe as createSearchFilterActions,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
481
|
+
Se as createSearchFilterInitialState,
|
|
482
|
+
fe as createSearchFilterReducer,
|
|
483
|
+
he as formatColumnIdToHeaderCellLabel,
|
|
484
|
+
u as getReducerIdFor,
|
|
485
|
+
me as useLocalSearchFilterState,
|
|
486
|
+
F as useSearchFilterActions,
|
|
487
|
+
f as useSearchFilterDispatch,
|
|
488
488
|
Ke as useSearchFilterModel,
|
|
489
489
|
z as useSearchFilterState
|
|
490
490
|
};
|