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