@stenajs-webui/filter 19.0.0-next.8 → 19.0.0

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