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