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