@stenajs-webui/filter 19.0.0-next.2 → 19.0.0-next.20

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