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