@stenajs-webui/filter 19.0.0-next.4 → 19.0.0-next.40

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,383 @@
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
+ spacing: 1,
252
+ children: e
253
+ }
254
+ ), T = le.div`
271
255
  padding: calc(var(--swui-metrics-spacing) / 2)
272
256
  calc(var(--swui-metrics-indent) / 2);
273
- `, Ie = ({
257
+ `, Ue = ({
274
258
  children: e,
275
259
  disableClearAllButton: t = !1
276
260
  }) => {
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, {
261
+ const n = m(), r = x(), o = u(
262
+ () => n(r.clearFormModel()),
263
+ [r, n]
264
+ );
265
+ return /* @__PURE__ */ M(A, { flexWrap: "wrap", children: [
266
+ e,
267
+ !t && /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(
268
+ $,
269
+ {
282
270
  size: "small",
283
271
  label: "Clear all",
284
- onClick: c
285
- })
286
- })]
287
- });
288
- }, we = function({
272
+ onClick: o
273
+ }
274
+ ) })
275
+ ] });
276
+ }, ve = function({
289
277
  label: t,
290
278
  sectionId: n
291
279
  }) {
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({
280
+ const r = m(), o = x(), s = u(() => {
281
+ r(o.clearExpandedSections()), r(o.expandSection(n)), r(o.openFilters());
282
+ }, [o, r, n]);
283
+ return /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(z, { label: t, variant: "secondary", onClick: s }) });
284
+ }, Me = function({
303
285
  sectionId: t,
304
286
  label: n,
305
287
  value: r,
306
- onClickRemove: c
288
+ onClickRemove: o
307
289
  }) {
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(() => {
290
+ const s = m(), i = x(), l = u(
291
+ (a) => s(i.setFormModelFields(a)),
292
+ [s, i]
293
+ ), p = u(() => {
294
+ o == null || o({ value: r, setFormModelFields: l });
295
+ }, [o, l, r]), S = u(() => {
314
296
  s(i.clearExpandedSections()), s(i.expandSection(t)), s(i.openFilters());
315
297
  }, [i, s, t]);
316
- return /* @__PURE__ */ o(V, {
317
- children: /* @__PURE__ */ o(D, {
298
+ return /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(
299
+ z,
300
+ {
318
301
  label: n != null ? n : t,
319
302
  onClick: S,
320
- onClickRemove: c ? p : void 0
321
- })
322
- });
323
- }, Je = function({
303
+ onClickRemove: o ? p : void 0
304
+ }
305
+ ) });
306
+ }, Xe = function({
324
307
  sectionId: t,
325
308
  chips: n,
326
309
  emptyChipLabel: r,
327
- onClickRemoveOnChip: c
310
+ onClickRemoveOnChip: o
328
311
  }) {
329
- return n != null && n.length ? /* @__PURE__ */ o(q, {
330
- children: n.map(({
331
- label: s,
332
- value: i
333
- }) => /* @__PURE__ */ o(ve, {
312
+ return n != null && n.length ? /* @__PURE__ */ c(H, { children: n.map(({ label: s, value: i }) => /* @__PURE__ */ c(
313
+ Me,
314
+ {
334
315
  label: s != null ? s : t,
335
316
  sectionId: t,
336
- onClickRemove: c,
317
+ onClickRemove: o,
337
318
  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(
319
+ },
320
+ i
321
+ )) }) : r ? /* @__PURE__ */ c(ve, { sectionId: t, label: r }) : null;
322
+ }, Ze = (e, t, n) => ({
323
+ chips: be(
345
324
  e[t],
346
325
  n
347
326
  ),
348
- onClickRemoveOnChip: Me(
327
+ onClickRemoveOnChip: Le(
349
328
  e,
350
329
  t
351
330
  )
352
- }), Re = (e, t) => z(e).map((n) => {
353
- var c;
331
+ }), be = (e, t) => D(e).map((n) => {
332
+ var o;
354
333
  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
334
+ return { value: n, label: (o = r == null ? void 0 : r.label) != null ? o : n };
335
+ }), Le = (e, t) => ({ setFormModelFields: n, value: r }) => {
336
+ const o = { ...e[t] };
337
+ o[r] = !1, n({
338
+ [t]: o
360
339
  });
361
- }, Ue = ({
340
+ }, _e = ({
362
341
  options: e,
363
342
  value: t,
364
343
  onValueChange: n,
365
344
  ...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 = ({
345
+ }) => /* @__PURE__ */ c(P, { disableContentPadding: !0, ...r, children: /* @__PURE__ */ c(Re, { maxHeight: "400px", children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ c(
346
+ we,
347
+ {
348
+ value: t == null ? void 0 : t[o.value],
349
+ label: o.label,
350
+ onValueChange: (s) => n == null ? void 0 : n({
351
+ ...t,
352
+ [o.value]: s
353
+ })
354
+ },
355
+ o.value
356
+ )) }) }), Ie = ({
389
357
  options: e,
390
358
  value: t,
391
359
  noneSelectedLabel: n,
392
360
  onValueChange: r,
393
- ...c
361
+ ...o
394
362
  }) => {
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, {
363
+ const [s, i] = R(""), l = v(
364
+ () => t ? D(t).map((a) => {
365
+ var F;
366
+ const C = e == null ? void 0 : e.find((h) => h.value === a);
367
+ return { value: a, label: (F = C == null ? void 0 : C.label) != null ? F : a };
368
+ }) : [],
369
+ [e, t]
370
+ ), p = v(() => e == null ? void 0 : e.filter(
371
+ (a) => a.value.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1 || a.label.toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1
372
+ ), [e, s]), S = u(
373
+ (a) => {
374
+ r == null || r(Ee(a));
375
+ },
376
+ [r]
377
+ );
378
+ return /* @__PURE__ */ c(P, { ...o, children: /* @__PURE__ */ c(
379
+ de,
380
+ {
408
381
  options: p,
409
382
  value: l,
410
383
  onValueChange: S,
@@ -412,110 +385,113 @@ const Se = ({
412
385
  noneSelectedLabel: n,
413
386
  onInputChange: i,
414
387
  closeMenuOnSelect: !1
415
- })
416
- });
417
- }, be = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ze = (e, t, n) => ({
418
- chips: Le(
388
+ }
389
+ ) });
390
+ }, Ee = (e) => e.reduce((t, n) => (t[n.value] = !0, t), {}), Ne = (e, t, n) => ({
391
+ chips: ke(
419
392
  e[t],
420
393
  e[n]
421
394
  ),
422
- onClickRemoveOnChip: Ee(
395
+ onClickRemoveOnChip: ye(
423
396
  t,
424
397
  n
425
398
  )
426
- }), Le = (e, t) => !e && !t ? [] : [
399
+ }), ke = (e, t) => !e && !t ? [] : [
427
400
  { value: "dateRange", label: `${e != null ? e : ""} - ${t != null ? t : ""}` }
428
- ], Ee = (e, t) => ({ setFormModelFields: n }) => {
401
+ ], ye = (e, t) => ({ setFormModelFields: n }) => {
429
402
  n({
430
403
  [e]: void 0,
431
404
  [t]: void 0
432
405
  });
433
- }, _e = (e, t, n) => ({
406
+ }, et = (e, t, n) => ({
434
407
  value: {
435
408
  startDate: e[t],
436
409
  endDate: e[n]
437
410
  },
438
- onValueChange: (r, { dispatch: c, actions: s }) => {
411
+ onValueChange: (r, { dispatch: o, actions: s }) => {
439
412
  const i = {
440
413
  [t]: r.startDate,
441
414
  [n]: r.endDate
442
415
  };
443
- c(s.setFormModelFields(i));
416
+ o(s.setFormModelFields(i));
444
417
  }
445
- }), Ne = ({
418
+ }), tt = ({
446
419
  value: e,
447
420
  onValueChange: t,
448
421
  sectionId: n,
449
422
  contentRight: r,
450
- disableContentPadding: c,
423
+ disableContentPadding: o,
451
424
  label: s,
452
425
  leftIcon: i,
453
426
  ...l
454
427
  }) => {
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,
428
+ const p = m(), S = x(), a = v(
429
+ () => ({ dispatch: p, actions: S }),
430
+ [S, p]
431
+ ), [C, F] = R("startDate"), h = v(() => ue(e), [e]), E = u(
432
+ (k) => {
433
+ t(he(k), a);
434
+ },
435
+ [t, a]
436
+ );
437
+ return /* @__PURE__ */ c(
438
+ P,
439
+ {
440
+ label: s,
441
+ leftIcon: i,
442
+ sectionId: n,
443
+ contentRight: r,
444
+ disableContentPadding: o,
445
+ children: /* @__PURE__ */ c(B, { flex: 1, alignItems: "center", children: /* @__PURE__ */ c(B, { background: "white", indent: !0, children: /* @__PURE__ */ c(
446
+ pe,
447
+ {
448
+ setFocusedInput: F,
449
+ focusedInput: C,
476
450
  value: h,
477
- onValueChange: k,
451
+ onValueChange: E,
478
452
  ...l
479
- })
480
- })
481
- })
482
- });
453
+ }
454
+ ) }) })
455
+ }
456
+ );
483
457
  };
484
458
  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,
459
+ Ie as ChipMultiSelectSection,
460
+ tt as DateRangeCalendarSection,
461
+ ve as EmptyChip,
462
+ we as FilterCheckbox,
463
+ Re as FilterCheckboxList,
464
+ W as SearchFilterActionsContext,
465
+ We as SearchFilterButton,
466
+ Me as SearchFilterChip,
467
+ Ue as SearchFilterChips,
468
+ fe as SearchFilterContext,
493
469
  K as SearchFilterDispatchContext,
494
- qe as SearchFilterDrawer,
495
- Ye as SearchFilterLocalStateContext,
496
- I as SearchFilterModelContext,
470
+ Ke as SearchFilterDrawer,
471
+ Qe as SearchFilterLocalStateContext,
472
+ Y as SearchFilterModelContext,
497
473
  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,
474
+ P as SearchFilterSection,
475
+ q as SearchFilterStateContext,
476
+ Xe as SectionChips,
477
+ _e as SimpleCheckboxListSection,
478
+ Ye as StickyFooter,
479
+ be as createChipsForBooleanRecord,
480
+ ke as createChipsForDateRange,
481
+ Ze as createChipsPropsForBooleanRecord,
482
+ Ne as createChipsPropsForDateRange,
483
+ et as createDateRangeSectionProps,
484
+ Le as createOnClickRemoveOnChipForBooleanRecord,
485
+ ye as createOnClickRemoveOnChipForDateRange,
510
486
  xe as createSearchFilterActions,
511
- fe as createSearchFilterInitialState,
512
- Fe as createSearchFilterReducer,
513
- me as formatColumnIdToHeaderCellLabel,
487
+ Fe as createSearchFilterInitialState,
488
+ me as createSearchFilterReducer,
489
+ Ce as formatColumnIdToHeaderCellLabel,
514
490
  d as getReducerIdFor,
515
491
  ge as useLocalSearchFilterState,
516
492
  x as useSearchFilterActions,
517
- F as useSearchFilterDispatch,
518
- Ke as useSearchFilterModel,
519
- W as useSearchFilterState
493
+ m as useSearchFilterDispatch,
494
+ Je as useSearchFilterModel,
495
+ G as useSearchFilterState
520
496
  };
521
497
  //# sourceMappingURL=index.es.js.map