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