@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/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 { createContext as L, useContext as E, useCallback as u, useState as M, useReducer as J, useMemo as b } from "react";
3
- import { Drawer as Q } from "@stenajs-webui/modal";
4
- import { cssColor as U } from "@stenajs-webui/theme";
5
- import { Spacing as X, Row as g, Space as O, Heading as Z, Column as P, Box as A, truthyKeysAsList as z } from "@stenajs-webui/core";
6
- import { FlatButton as H, stenaTimes as _, SecondaryButton as N, stenaSlidersMini as ee, MenuButton as te, Spinner as ne, Banner as re, Chip as D } from "@stenajs-webui/elements";
7
- import { jsx as o, jsxs as w, Fragment as q } from "react/jsx-runtime";
8
- import { upperFirst as ce, lowerCase as oe } from "lodash";
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 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";
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
- onRequestClose: e,
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 = L(null), F = () => {
50
- const e = E(K);
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
- }, Y = L(null), x = () => {
55
- const e = E(Y);
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
- }, qe = ({
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
- open: c
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__ */ o(Q, {
73
- isOpen: c,
74
- onRequestClose: l,
75
- ...r,
76
- children: /* @__PURE__ */ w(P, {
77
- height: "100%",
78
- borderRadius: "var(--swui-border-radius)",
79
- background: U("--lhds-color-ui-50"),
80
- children: [/* @__PURE__ */ o(Se, {
81
- onRequestClose: l,
82
- header: t,
83
- contentRight: n
84
- }), /* @__PURE__ */ o(A, {
85
- spacing: 1,
86
- indent: 1,
87
- gap: 1,
88
- children: e
89
- })]
90
- })
91
- });
92
- }, Ge = ({
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 = ee
73
+ leftIcon: t = N
95
74
  }) => {
96
- const n = F(), r = x(), c = u(() => {
75
+ const n = m(), r = x(), o = u(() => {
97
76
  n(r.openFilters());
98
77
  }, [r, n]);
99
- return /* @__PURE__ */ o(N, {
100
- label: e,
101
- leftIcon: t,
102
- onClick: c
103
- });
104
- }, T = function({
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: c,
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 j;
116
- const a = W(), m = F(), f = x(), h = (j = a.expandedSections.values[t]) != null ? j : !1, k = u(() => {
117
- m(f.setSectionExpanded(t, !h));
118
- }, [f, m, h, t]), y = n != null ? n : me(t);
119
- return /* @__PURE__ */ w(q, {
120
- children: [/* @__PURE__ */ o(te, {
121
- label: y,
122
- leftIcon: p,
123
- expandable: !0,
124
- expanded: h,
125
- selected: h,
126
- onClick: k,
127
- right: S,
128
- children: r ? /* @__PURE__ */ o(g, {
129
- spacing: !0,
130
- justifyContent: "center",
131
- flex: 1,
132
- children: /* @__PURE__ */ o(ne, {
133
- size: "small"
134
- })
135
- }) : c ? /* @__PURE__ */ o(re, {
136
- variant: "error",
137
- text: c,
138
- contentRight: s ? /* @__PURE__ */ o(H, {
139
- label: "Retry",
140
- onClick: s
141
- }) : null
142
- }) : l
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__ */ o(P, {
149
- style: {
150
- marginTop: "auto"
151
- },
152
- justifyContent: "center",
153
- spacing: 2,
154
- indent: !0,
155
- shadow: "popover",
156
- zIndex: 1,
157
- ...t,
158
- children: e
159
- }), I = L(null), Ke = () => {
160
- const e = E(I);
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
- }, Ce = function({
146
+ }, fe = function({
167
147
  state: t,
168
148
  dispatch: n,
169
149
  actions: r,
170
- children: c
150
+ children: o
171
151
  }) {
172
- return /* @__PURE__ */ o(K.Provider, {
173
- value: n,
174
- children: /* @__PURE__ */ o(Y.Provider, {
175
- value: r,
176
- children: /* @__PURE__ */ o(G.Provider, {
177
- value: t,
178
- children: /* @__PURE__ */ o(I.Provider, {
179
- value: t.formModel,
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
- }), Fe = (e, t) => se({
192
- expandedSections: B(
165
+ }), me = (e, t) => se({
166
+ expandedSections: y(
193
167
  d(e, "expandedSections"),
194
168
  ie(t.expandedSections)
195
169
  ),
196
- formModel: B(
170
+ formModel: y(
197
171
  d(e, "formModel"),
198
- $(t.formModel)
172
+ j(t.formModel)
199
173
  ),
200
- settings: B(
174
+ settings: y(
201
175
  d(e, "settings"),
202
- $(t.settings)
176
+ j(t.settings)
203
177
  )
204
178
  }), xe = (e, t) => ({
205
- openFilters: () => C(
179
+ openFilters: () => f(
206
180
  d(e, "settings"),
207
- v().setEntityFields({
181
+ g().setEntityFields({
208
182
  open: !0
209
183
  })
210
184
  ),
211
- closeFilters: () => C(
185
+ closeFilters: () => f(
212
186
  d(e, "settings"),
213
- v().setEntityFields({
187
+ g().setEntityFields({
214
188
  open: !1
215
189
  })
216
190
  ),
217
- setFormModelFields: (n) => C(
191
+ setFormModelFields: (n) => f(
218
192
  d(e, "formModel"),
219
- v().setEntityFields(n)
193
+ g().setEntityFields(n)
220
194
  ),
221
- clearFormModel: () => C(
195
+ clearFormModel: () => f(
222
196
  d(e, "formModel"),
223
- v().setEntity(t)
197
+ g().setEntity(t)
224
198
  ),
225
- expandSection: (n) => C(
199
+ expandSection: (n) => f(
226
200
  d(e, "expandedSections"),
227
- R().setValue(n, !0)
201
+ w().setValue(n, !0)
228
202
  ),
229
- collapseSection: (n) => C(
203
+ collapseSection: (n) => f(
230
204
  d(e, "expandedSections"),
231
- R().setValue(n, !1)
205
+ w().setValue(n, !1)
232
206
  ),
233
- setSectionExpanded: (n, r) => C(
207
+ setSectionExpanded: (n, r) => f(
234
208
  d(e, "expandedSections"),
235
- R().setValue(n, r)
209
+ w().setValue(n, r)
236
210
  ),
237
- clearExpandedSections: () => C(
211
+ clearExpandedSections: () => f(
238
212
  d(e, "expandedSections"),
239
- R().clearAllValues()
213
+ w().clearAllValues()
240
214
  )
241
215
  }), d = (e, t) => `${e}.${t}`, ge = (e) => {
242
- const [t] = M(
243
- () => Fe("local", e)
244
- ), [n] = M(
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, c] = J(t, e);
223
+ ), [r, o] = J(t, e);
250
224
  return {
251
225
  actions: n,
252
226
  state: r,
253
- dispatch: c
227
+ dispatch: o
254
228
  };
255
- }, Ye = function({
229
+ }, Qe = function({
256
230
  initialFormModel: t,
257
231
  children: n
258
232
  }) {
259
- const {
260
- state: r,
261
- actions: c,
262
- dispatch: s
263
- } = ge(fe(t));
264
- return /* @__PURE__ */ o(Ce, {
265
- state: r,
266
- actions: c,
267
- dispatch: s,
268
- children: n
269
- });
270
- }, V = ae.div`
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
- `, Ie = ({
258
+ `, Ue = ({
274
259
  children: e,
275
260
  disableClearAllButton: t = !1
276
261
  }) => {
277
- const n = F(), r = x(), c = u(() => n(r.clearFormModel()), [r, n]);
278
- return /* @__PURE__ */ w(g, {
279
- flexWrap: "wrap",
280
- children: [e, !t && /* @__PURE__ */ o(V, {
281
- children: /* @__PURE__ */ o(H, {
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: c
285
- })
286
- })]
287
- });
288
- }, we = function({
273
+ onClick: o
274
+ }
275
+ ) })
276
+ ] });
277
+ }, ve = function({
289
278
  label: t,
290
279
  sectionId: n
291
280
  }) {
292
- const r = F(), c = x(), s = u(() => {
293
- r(c.clearExpandedSections()), r(c.expandSection(n)), r(c.openFilters());
294
- }, [c, r, n]);
295
- return /* @__PURE__ */ o(V, {
296
- children: /* @__PURE__ */ o(D, {
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: c
289
+ onClickRemove: o
307
290
  }) {
308
- const s = F(), i = x(), l = u((a) => s(i.setFormModelFields(a)), [s, i]), p = u(() => {
309
- c == null || c({
310
- value: r,
311
- setFormModelFields: l
312
- });
313
- }, [c, l, r]), S = u(() => {
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__ */ o(V, {
317
- children: /* @__PURE__ */ o(D, {
299
+ return /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(
300
+ z,
301
+ {
318
302
  label: n != null ? n : t,
319
303
  onClick: S,
320
- onClickRemove: c ? p : void 0
321
- })
322
- });
323
- }, Je = function({
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: c
311
+ onClickRemoveOnChip: o
328
312
  }) {
329
- return n != null && n.length ? /* @__PURE__ */ o(q, {
330
- children: n.map(({
331
- label: s,
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: c,
318
+ onClickRemove: o,
337
319
  value: i
338
- }, i))
339
- }) : r ? /* @__PURE__ */ o(we, {
340
- sectionId: t,
341
- label: r
342
- }) : null;
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: Me(
328
+ onClickRemoveOnChip: Le(
349
329
  e,
350
330
  t
351
331
  )
352
- }), Re = (e, t) => z(e).map((n) => {
353
- var c;
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: (c = r == null ? void 0 : r.label) != null ? c : n };
356
- }), Me = (e, t) => ({ setFormModelFields: n, value: r }) => {
357
- const c = { ...e[t] };
358
- c[r] = !1, n({
359
- [t]: c
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
- }, Ue = ({
341
+ }, _e = ({
362
342
  options: e,
363
343
  value: t,
364
344
  onValueChange: n,
365
345
  ...r
366
- }) => /* @__PURE__ */ o(T, {
367
- disableContentPadding: !0,
368
- ...r,
369
- children: /* @__PURE__ */ o(P, {
370
- maxHeight: "400px",
371
- overflowY: "auto",
372
- flex: 1,
373
- gap: 1,
374
- spacing: 1,
375
- children: e == null ? void 0 : e.map((c) => /* @__PURE__ */ o(g, {
376
- alignItems: "center",
377
- children: /* @__PURE__ */ o(le, {
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
- ...c
362
+ ...o
394
363
  }) => {
395
- const [s, i] = M(""), l = b(() => t ? z(t).map((a) => {
396
- var f;
397
- const m = e == null ? void 0 : e.find((h) => h.value === a);
398
- return {
399
- value: a,
400
- label: (f = m == null ? void 0 : m.label) != null ? f : a
401
- };
402
- }) : [], [e, t]), p = b(() => e == null ? void 0 : e.filter((a) => a.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1 || a.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1), [e, s]), S = u((a) => {
403
- r == null || r(be(a));
404
- }, [r]);
405
- return /* @__PURE__ */ o(T, {
406
- ...c,
407
- children: /* @__PURE__ */ o(de, {
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
- }, be = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ze = (e, t, n) => ({
418
- chips: Le(
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: Ee(
396
+ onClickRemoveOnChip: ye(
423
397
  t,
424
398
  n
425
399
  )
426
- }), Le = (e, t) => !e && !t ? [] : [
400
+ }), ke = (e, t) => !e && !t ? [] : [
427
401
  { value: "dateRange", label: `${e != null ? e : ""} - ${t != null ? t : ""}` }
428
- ], Ee = (e, t) => ({ setFormModelFields: n }) => {
402
+ ], ye = (e, t) => ({ setFormModelFields: n }) => {
429
403
  n({
430
404
  [e]: void 0,
431
405
  [t]: void 0
432
406
  });
433
- }, _e = (e, t, n) => ({
407
+ }, et = (e, t, n) => ({
434
408
  value: {
435
409
  startDate: e[t],
436
410
  endDate: e[n]
437
411
  },
438
- onValueChange: (r, { dispatch: c, actions: s }) => {
412
+ onValueChange: (r, { dispatch: o, actions: s }) => {
439
413
  const i = {
440
414
  [t]: r.startDate,
441
415
  [n]: r.endDate
442
416
  };
443
- c(s.setFormModelFields(i));
417
+ o(s.setFormModelFields(i));
444
418
  }
445
- }), Ne = ({
419
+ }), tt = ({
446
420
  value: e,
447
421
  onValueChange: t,
448
422
  sectionId: n,
449
423
  contentRight: r,
450
- disableContentPadding: c,
424
+ disableContentPadding: o,
451
425
  label: s,
452
426
  leftIcon: i,
453
427
  ...l
454
428
  }) => {
455
- const p = F(), S = x(), a = b(() => ({
456
- dispatch: p,
457
- actions: S
458
- }), [S, p]), [m, f] = M("startDate"), h = b(() => ue(e), [e]), k = u((y) => {
459
- t(he(y), a);
460
- }, [t, a]);
461
- return /* @__PURE__ */ o(T, {
462
- label: s,
463
- leftIcon: i,
464
- sectionId: n,
465
- contentRight: r,
466
- disableContentPadding: c,
467
- children: /* @__PURE__ */ o(A, {
468
- flex: 1,
469
- alignItems: "center",
470
- children: /* @__PURE__ */ o(A, {
471
- background: "white",
472
- indent: !0,
473
- children: /* @__PURE__ */ o(pe, {
474
- setFocusedInput: f,
475
- focusedInput: m,
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: k,
452
+ onValueChange: E,
478
453
  ...l
479
- })
480
- })
481
- })
482
- });
454
+ }
455
+ ) }) })
456
+ }
457
+ );
483
458
  };
484
459
  export {
485
- Xe as ChipMultiSelectSection,
486
- Ne as DateRangeCalendarSection,
487
- we as EmptyChip,
488
- Y as SearchFilterActionsContext,
489
- Ge as SearchFilterButton,
490
- ve as SearchFilterChip,
491
- Ie as SearchFilterChips,
492
- Ce as SearchFilterContext,
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
- qe as SearchFilterDrawer,
495
- Ye as SearchFilterLocalStateContext,
496
- I as SearchFilterModelContext,
471
+ Ke as SearchFilterDrawer,
472
+ Qe as SearchFilterLocalStateContext,
473
+ Y as SearchFilterModelContext,
497
474
  Se as SearchFilterPanelHeader,
498
- T as SearchFilterSection,
499
- G as SearchFilterStateContext,
500
- Je as SectionChips,
501
- Ue as SimpleCheckboxListSection,
502
- We as StickyFooter,
503
- Re as createChipsForBooleanRecord,
504
- Le as createChipsForDateRange,
505
- Qe as createChipsPropsForBooleanRecord,
506
- Ze as createChipsPropsForDateRange,
507
- _e as createDateRangeSectionProps,
508
- Me as createOnClickRemoveOnChipForBooleanRecord,
509
- Ee as createOnClickRemoveOnChipForDateRange,
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
- fe as createSearchFilterInitialState,
512
- Fe as createSearchFilterReducer,
513
- me as formatColumnIdToHeaderCellLabel,
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
- F as useSearchFilterDispatch,
518
- Ke as useSearchFilterModel,
519
- W as useSearchFilterState
494
+ m as useSearchFilterDispatch,
495
+ Je as useSearchFilterModel,
496
+ G as useSearchFilterState
520
497
  };
521
498
  //# sourceMappingURL=index.es.js.map