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