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