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