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