@stenajs-webui/filter 19.0.0-next.14 → 19.0.0-next.16

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