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