@mittwald/flow-react-components 0.1.0-alpha.226 → 0.1.0-alpha.227

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/List.js CHANGED
@@ -1,70 +1,75 @@
1
1
  "use client"
2
2
  /* */
3
- var Ue = Object.defineProperty;
4
- var Oe = (a, e, t) => e in a ? Ue(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
5
- var r = (a, e, t) => Oe(a, typeof e != "symbol" ? e + "" : e, t);
6
- import n, { createContext as He, useContext as qe, createElement as me, useState as O, useEffect as k, useRef as Ke, Suspense as Ge, cloneElement as je } from "react";
3
+ var Ht = Object.defineProperty;
4
+ var qt = (a, t, e) => t in a ? Ht(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
5
+ var r = (a, t, e) => qt(a, typeof t != "symbol" ? t + "" : t, e);
6
+ import i, { createContext as Gt, useContext as jt, createElement as ft, useState as q, useEffect as k, useRef as _t, Suspense as Wt, cloneElement as Jt } from "react";
7
7
  import "./propsContext-DzAKlmhS.js";
8
- import { P as _e } from "./PropsContextProvider-C6Z4XGp6.js";
8
+ import { P as Yt } from "./PropsContextProvider-C6Z4XGp6.js";
9
9
  import "@react-aria/utils";
10
- import { isShallowEqual as We, unique as Je, times as Ye } from "remeda";
11
- import { d as Qe } from "./dynamic-ClpUSmEt.js";
12
- import { B as w } from "./Button-DPF2xiJl.js";
13
- import "@tabler/icons-react";
14
- import "./Icon-0QYDidQk.js";
15
- import { I as Xe } from "./IconContextMenu-DQey4U_b.js";
16
- import { a as B, C as H } from "./ContextMenuTrigger-CYlZTk_W.js";
17
- import { M as q } from "./MenuItem-Dr-3EfkY.js";
10
+ import { isShallowEqual as Qt, unique as Xt, difference as Zt, times as te } from "remeda";
11
+ import { d as ee } from "./dynamic-ClpUSmEt.js";
12
+ import { B as S } from "./Button-DPF2xiJl.js";
13
+ import { IconArrowBackUp as se } from "@tabler/icons-react";
14
+ import { I as ie } from "./Icon-0QYDidQk.js";
15
+ import { I as ae } from "./IconContextMenu-DQey4U_b.js";
16
+ import { a as D, C as G } from "./ContextMenuTrigger-CYlZTk_W.js";
17
+ import { M as j } from "./MenuItem-Dr-3EfkY.js";
18
18
  import { useLocalizedStringFormatter as y } from "react-aria";
19
- import { TunnelProvider as Ze, TunnelExit as ie } from "@mittwald/react-tunnel";
20
- import v from "clsx";
21
- import { g as et } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
- import { f as tt } from "./flowComponent-DT1Ap-ot.js";
23
- import { R as st } from "./Render-BdlTa7Qb.js";
19
+ import { TunnelProvider as ne, TunnelExit as ot } from "@mittwald/react-tunnel";
20
+ import w from "clsx";
21
+ import { g as re } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
+ import { f as oe } from "./flowComponent-DT1Ap-ot.js";
23
+ import { R as le } from "./Render-BdlTa7Qb.js";
24
24
  import { T as E } from "./Text-pgjmZdTC.js";
25
- import { I as he } from "./IconChevronDown-BSK1qOl0.js";
26
- import { I as at } from "./IconClose-gMf32kww.js";
27
- import { makeObservable as it, observable as ne, computed as re, action as D } from "mobx";
25
+ import { I as bt } from "./IconChevronDown-BSK1qOl0.js";
26
+ import { I as ce } from "./IconClose-gMf32kww.js";
27
+ import { I as ue, a as de } from "./IconSettings-CbceI0ro.js";
28
+ import { observer as me } from "mobx-react-lite";
29
+ import { a as lt, T as ct } from "./TooltipTrigger-TslkLN5s.js";
30
+ import { makeObservable as he, observable as ut, computed as dt, action as U } from "mobx";
28
31
  import "./context-Cf7tqFtF.js";
29
- import { u as nt } from "./useOnChange-C1Quwyuz.js";
30
- import { S as rt } from "./SearchField-CH1MrE_x.js";
31
- import { H as K } from "./Heading-CYASkLvk.js";
32
- import { S as ot } from "./Section-CrnRDzAf.js";
33
- import { I as lt } from "./IconSettings-CsKvxfZb.js";
34
- import { getProperty as ct } from "dot-prop";
35
- import { hash as pe } from "object-code";
36
- import { useReactTable as dt, getCoreRowModel as ut, getSortedRowModel as mt, getFilteredRowModel as ht, getPaginationRowModel as pt, getFacetedUniqueValues as gt } from "@tanstack/react-table";
37
- import ge from "invariant";
38
- import { getAsyncResource as oe } from "@mittwald/react-use-promise";
39
- import { u as le } from "./useSelector-DpU7_HMO.js";
40
- import * as G from "react-aria-components";
32
+ import { u as ge } from "./useOnChange-C1Quwyuz.js";
33
+ import { S as pe } from "./SearchField-CH1MrE_x.js";
34
+ import { H as _ } from "./Heading-CYASkLvk.js";
35
+ import { S as fe } from "./Section-CrnRDzAf.js";
36
+ import { getProperty as be } from "dot-prop";
37
+ import { hash as St } from "object-code";
38
+ import O from "zod";
39
+ import { useReactTable as Se, getCoreRowModel as ve, getSortedRowModel as ye, getFilteredRowModel as we, getPaginationRowModel as Ee, getFacetedUniqueValues as Fe } from "@tanstack/react-table";
40
+ import vt from "invariant";
41
+ import { getAsyncResource as mt } from "@mittwald/react-use-promise";
42
+ import { u as ht } from "./useSelector-DpU7_HMO.js";
43
+ import { u as Te } from "./SettingsProvider-vAngjrSo.js";
44
+ import * as W from "react-aria-components";
41
45
  import { S as A } from "./SkeletonText-B5ZghZhO.js";
42
- import { I as ft } from "./IllustratedMessage-B3MHD01M.js";
43
- import { I as bt } from "./IconSearch-BfV1RCJ-.js";
44
- import { d as f, a as I } from "./deepFindOfType-6pG0fH7S.js";
45
- import { ListLoaderAsyncResource as St, TypedListLoaderAsyncResource as wt } from "./List/ListLoaderAsyncResource.js";
46
- import { S as vt } from "./Skeleton-CKLaTmDR.js";
47
- import { T as fe, d as be, c as Se, a as we, e as ve, b as ye } from "./TableRow-BsPgWqkU.js";
48
- const yt = "flow--list--items--item--view", Et = "flow--list--items--item--view--title", Tt = "flow--list--items--item--view--top-content", Ft = "flow--list--items--item--view--content", Ct = "flow--list--items--item--view--action", It = "flow--list--items--item--view--avatar", Lt = "flow--list--items--item--view--text", Pt = "flow--list--items--item--view--heading", m = {
49
- view: yt,
50
- title: Et,
51
- topContent: Tt,
52
- content: Ft,
53
- action: Ct,
54
- avatar: It,
55
- text: Lt,
56
- heading: Pt,
46
+ import { I as Ce } from "./IllustratedMessage-B3MHD01M.js";
47
+ import { I as Ie } from "./IconSearch-BfV1RCJ-.js";
48
+ import { d as b, a as I } from "./deepFindOfType-6pG0fH7S.js";
49
+ import { ListLoaderAsyncResource as Le, TypedListLoaderAsyncResource as Pe } from "./List/ListLoaderAsyncResource.js";
50
+ import { S as Ve } from "./Skeleton-CKLaTmDR.js";
51
+ import { T as yt, d as wt, c as Et, a as Ft, e as Tt, b as Ct } from "./TableRow-BsPgWqkU.js";
52
+ const ke = "flow--list--items--item--view", Ae = "flow--list--items--item--view--title", Be = "flow--list--items--item--view--top-content", Me = "flow--list--items--item--view--content", De = "flow--list--items--item--view--action", xe = "flow--list--items--item--view--avatar", Re = "flow--list--items--item--view--text", Ne = "flow--list--items--item--view--heading", m = {
53
+ view: ke,
54
+ title: Ae,
55
+ topContent: Be,
56
+ content: Me,
57
+ action: De,
58
+ avatar: xe,
59
+ text: Re,
60
+ heading: Ne,
57
61
  "container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
58
62
  "container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
59
63
  "container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
60
64
  "container-breakpoint-size-l": "flow--list--items--item--view--container-breakpoint-size-l",
61
65
  "container-breakpoint-size-xl": "flow--list--items--item--view--container-breakpoint-size-xl"
62
- }, b = { "de-DE": {
66
+ }, f = { "de-DE": {
67
+ "list.filters.reset": "Filter zurücksetzen",
68
+ "list.filters.store": "Filter speichern",
63
69
  "list.noResult.heading": "Keine Suchergebnisse gefunden",
64
70
  "list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
65
71
  "list.options": "Optionen",
66
72
  "list.paginationInfo": (a) => `${a.visibleItemsCount} von insgesamt ${a.totalItemsCount} angezeigt`,
67
- "list.resetAll": "Alles zurücksetzen",
68
73
  "list.setSorting": (a) => `Sortierung: ${a.property}`,
69
74
  "list.settings": "Einstellungen",
70
75
  "list.settings.viewMode": "Ansicht",
@@ -73,11 +78,12 @@ const yt = "flow--list--items--item--view", Et = "flow--list--items--item--view-
73
78
  "list.showMore": "Mehr anzeigen",
74
79
  "list.sorting": "Sortierung"
75
80
  }, "en-EN": {
81
+ "list.filters.reset": "Reset filters",
82
+ "list.filters.store": "Store filters",
76
83
  "list.noResult.heading": "No search results found",
77
84
  "list.noResult.text": "Your search did not return any results. Please adjust the search query or your filters.",
78
85
  "list.options": "Options",
79
86
  "list.paginationInfo": (a) => `Showing ${a.visibleItemsCount} of ${a.totalItemsCount}`,
80
- "list.resetAll": "Reset filters",
81
87
  "list.setSorting": (a) => `Sorting: ${a.property}`,
82
88
  "list.settings": "Settings",
83
89
  "list.settings.viewMode": "View",
@@ -85,21 +91,21 @@ const yt = "flow--list--items--item--view", Et = "flow--list--items--item--view-
85
91
  "list.settings.viewMode.table": "Table",
86
92
  "list.showMore": "Show more",
87
93
  "list.sorting": "Sorting"
88
- } }, kt = (a) => {
89
- const { className: e, children: t } = a, s = y(b);
90
- return /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(
91
- w,
94
+ } }, $e = (a) => {
95
+ const { className: t, children: e } = a, s = y(f);
96
+ return /* @__PURE__ */ i.createElement(D, null, /* @__PURE__ */ i.createElement(
97
+ S,
92
98
  {
93
99
  variant: "plain",
94
- className: e,
100
+ className: t,
95
101
  "aria-label": s.format("list.options")
96
102
  },
97
- /* @__PURE__ */ n.createElement(Xe, null)
98
- ), t);
99
- }, At = (a) => a === "top" ? m.topContent : a === "bottom" ? m.content : m.topContent, Ee = (a) => {
100
- const { children: e, className: t, containerBreakpointSize: s = "m" } = a, i = {
103
+ /* @__PURE__ */ i.createElement(ae, null)
104
+ ), e);
105
+ }, ze = (a) => a === "top" ? m.topContent : a === "bottom" ? m.content : m.topContent, It = (a) => {
106
+ const { children: t, className: e, containerBreakpointSize: s = "m" } = a, n = {
101
107
  ContextMenu: {
102
- wrapWith: /* @__PURE__ */ n.createElement(kt, { className: m.action }),
108
+ wrapWith: /* @__PURE__ */ i.createElement($e, { className: m.action }),
103
109
  placement: "bottom end"
104
110
  },
105
111
  Button: {
@@ -110,7 +116,7 @@ const yt = "flow--list--items--item--view", Et = "flow--list--items--item--view-
110
116
  ignoreBreakpoint: !0
111
117
  },
112
118
  Content: {
113
- className: Qe((l) => At(l.slot)),
119
+ className: ee((c) => ze(c.slot)),
114
120
  tunnelId: "topContent"
115
121
  },
116
122
  Avatar: {
@@ -129,183 +135,182 @@ const yt = "flow--list--items--item--view", Et = "flow--list--items--item--view-
129
135
  Link: {
130
136
  unstyled: !0
131
137
  }
132
- }, o = v(
138
+ }, o = w(
133
139
  m.view,
134
- t,
135
- m[et(s)]
140
+ e,
141
+ m[re(s)]
136
142
  );
137
- return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(_e, { props: i }, /* @__PURE__ */ n.createElement(Ze, null, e, /* @__PURE__ */ n.createElement("div", { className: m.title }, /* @__PURE__ */ n.createElement(ie, { id: "title" })), /* @__PURE__ */ n.createElement(ie, { id: "topContent" }))));
138
- }, Te = He({}), h = () => qe(Te).list, Vt = () => h().loader.getLoaderInvocationHooks().map((e, t) => /* @__PURE__ */ n.createElement(st, { key: t }, () => {
139
- e();
140
- })), Bt = (a) => {
141
- const { sorting: e } = a;
142
- return /* @__PURE__ */ n.createElement(q, { id: e.id }, e.name);
143
- }, $ = (a) => {
144
- const { children: e, locales: t, variables: s } = a;
145
- return y(t).format(e, s);
146
- }, Mt = () => {
147
- const a = h(), e = a.visibleSorting.map((i) => /* @__PURE__ */ n.createElement(Bt, { sorting: i, key: i.id }));
148
- if (e.length === 0)
143
+ return /* @__PURE__ */ i.createElement("div", { className: o }, /* @__PURE__ */ i.createElement(Yt, { props: n }, /* @__PURE__ */ i.createElement(ne, null, t, /* @__PURE__ */ i.createElement("div", { className: m.title }, /* @__PURE__ */ i.createElement(ot, { id: "title" })), /* @__PURE__ */ i.createElement(ot, { id: "topContent" }))));
144
+ }, Lt = Gt({}), g = () => jt(Lt).list, Ue = () => g().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ i.createElement(le, { key: e }, () => {
145
+ t();
146
+ })), Oe = (a) => {
147
+ const { sorting: t } = a;
148
+ return /* @__PURE__ */ i.createElement(j, { id: t.id }, t.name);
149
+ }, B = (a) => {
150
+ const { children: t, locales: e, variables: s } = a;
151
+ return y(e).format(t, s);
152
+ }, Ke = () => {
153
+ const a = g(), t = a.visibleSorting.map((n) => /* @__PURE__ */ i.createElement(Oe, { sorting: n, key: n.id }));
154
+ if (t.length === 0)
149
155
  return null;
150
- const t = a.visibleSorting.find((i) => i.isSorted()), s = /* @__PURE__ */ n.createElement(E, null, t ? /* @__PURE__ */ n.createElement(
151
- $,
156
+ const e = a.visibleSorting.find((n) => n.isSorted()), s = /* @__PURE__ */ i.createElement(E, null, e ? /* @__PURE__ */ i.createElement(
157
+ B,
152
158
  {
153
- locales: b,
159
+ locales: f,
154
160
  variables: {
155
- property: t.name ?? t.property
161
+ property: e.name ?? e.property
156
162
  }
157
163
  },
158
164
  "list.setSorting"
159
- ) : /* @__PURE__ */ n.createElement($, { locales: b }, "list.sorting"));
160
- return /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(w, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ n.createElement(he, null)), /* @__PURE__ */ n.createElement(
161
- H,
165
+ ) : /* @__PURE__ */ i.createElement(B, { locales: f }, "list.sorting"));
166
+ return /* @__PURE__ */ i.createElement(D, null, /* @__PURE__ */ i.createElement(S, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ i.createElement(bt, null)), /* @__PURE__ */ i.createElement(
167
+ G,
162
168
  {
163
169
  selectionMode: "single",
164
- selectedKeys: t ? [t.id] : [],
165
- onAction: (i) => {
166
- a.getSorting(String(i)).enable();
170
+ selectedKeys: e ? [e.id] : [],
171
+ onAction: (n) => {
172
+ a.getSorting(String(n)).enable();
167
173
  }
168
174
  },
169
- e
175
+ t
170
176
  ));
171
- }, xt = (a) => {
172
- const { filter: e } = a, { values: t, mode: s, name: i, property: o } = e, l = t.map((d) => /* @__PURE__ */ n.createElement(
173
- q,
177
+ }, He = (a) => {
178
+ const { filter: t } = a, { values: e, mode: s, name: n, property: o } = t, c = e.map((u) => /* @__PURE__ */ i.createElement(
179
+ j,
174
180
  {
175
- id: d.id,
176
- key: d.id,
181
+ id: u.id,
182
+ key: u.id,
177
183
  onAction: () => {
178
- d.toggle();
184
+ u.toggle();
179
185
  }
180
186
  },
181
- d.render()
182
- )), c = t.filter((d) => d.isActive).map((d) => d.id);
183
- return /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(w, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(E, null, i ?? o), /* @__PURE__ */ n.createElement(he, null)), /* @__PURE__ */ n.createElement(
184
- H,
187
+ u.render()
188
+ )), l = e.filter((u) => u.isActive).map((u) => u.id);
189
+ return /* @__PURE__ */ i.createElement(D, null, /* @__PURE__ */ i.createElement(S, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ i.createElement(E, null, n ?? o), /* @__PURE__ */ i.createElement(bt, null)), /* @__PURE__ */ i.createElement(
190
+ G,
185
191
  {
186
192
  selectionMode: s === "one" ? "single" : "multiple",
187
- selectedKeys: c
193
+ selectedKeys: l
188
194
  },
189
- l
195
+ c
190
196
  ));
191
- }, Rt = "flow--list--header", Nt = "flow--list--header--picker-list-and-search", Dt = "flow--list--header--picker-list", $t = "flow--list--header--search-field", L = {
192
- header: Rt,
193
- pickerListAndSearch: Nt,
194
- pickerList: Dt,
195
- searchField: $t
196
- }, zt = "flow--list--header--active-filters", Ut = "flow--list--header--active-filters--clear-button", ce = {
197
- activeFilters: zt,
198
- clearButton: Ut
199
- }, Ot = () => {
200
- const a = h(), e = a.filters.flatMap(
201
- (t) => t.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ n.createElement(
202
- w,
203
- {
204
- variant: "soft",
205
- size: "s",
206
- key: s.id,
207
- onPress: () => s.deactivate()
208
- },
209
- /* @__PURE__ */ n.createElement(E, null, s.render()),
210
- /* @__PURE__ */ n.createElement(at, null)
211
- ))
212
- );
213
- return e.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className: ce.activeFilters }, e, /* @__PURE__ */ n.createElement(
214
- w,
197
+ }, qe = "flow--list--header", Ge = "flow--list--header--picker-list-and-search", je = "flow--list--header--picker-list", _e = "flow--list--header--search-field", L = {
198
+ header: qe,
199
+ pickerListAndSearch: Ge,
200
+ pickerList: je,
201
+ searchField: _e
202
+ }, We = "flow--list--header--active-filters", Je = "flow--list--header--active-filters--clear-button", Ye = {
203
+ activeFilters: We,
204
+ clearButton: Je
205
+ }, Qe = me(() => {
206
+ const a = g(), t = y(f), s = a.filters.flatMap((l) => l.values).filter((l) => l.isActive).map((l) => /* @__PURE__ */ i.createElement(S, { variant: "soft", size: "s", key: l.id, onPress: () => l.deactivate() }, /* @__PURE__ */ i.createElement(E, null, l.render()), /* @__PURE__ */ i.createElement(ce, null))), n = a.filters.filter((l) => l.hasChanged()).length > 0, o = a.supportsSettingsStorage && n && /* @__PURE__ */ i.createElement(lt, null, /* @__PURE__ */ i.createElement(ct, null, /* @__PURE__ */ i.createElement(B, { locales: f }, "list.filters.store")), /* @__PURE__ */ i.createElement(
207
+ S,
215
208
  {
216
- className: ce.clearButton,
217
209
  size: "s",
218
210
  variant: "plain",
219
- onPress: () => a.clearFilters()
211
+ color: "secondary",
212
+ onPress: () => a.storeFilterDefaultSettings(),
213
+ "aria-label": t.format("list.filters.store")
220
214
  },
221
- /* @__PURE__ */ n.createElement($, { locales: b }, "list.resetAll")
222
- ));
223
- }, Ht = (a) => {
224
- const { className: e, onChange: t, value: s, ...i } = a, [o, l] = O(s ?? "");
225
- nt(s, () => {
226
- l(s ?? "");
215
+ /* @__PURE__ */ i.createElement(ue, null)
216
+ )), c = n ? /* @__PURE__ */ i.createElement(lt, null, /* @__PURE__ */ i.createElement(ct, null, /* @__PURE__ */ i.createElement(B, { locales: f }, "list.filters.reset")), /* @__PURE__ */ i.createElement(
217
+ S,
218
+ {
219
+ size: "s",
220
+ variant: "plain",
221
+ color: "secondary",
222
+ onPress: () => a.resetFilters(),
223
+ "aria-label": t.format("list.filters.reset")
224
+ },
225
+ /* @__PURE__ */ i.createElement(ie, null, /* @__PURE__ */ i.createElement(se, null))
226
+ )) : void 0;
227
+ return s.length === 0 && !o && !c ? null : /* @__PURE__ */ i.createElement("div", { className: Ye.activeFilters }, s, o, c);
228
+ }), Xe = (a) => {
229
+ const { className: t, onChange: e, value: s, ...n } = a, [o, c] = q(s ?? "");
230
+ ge(s, () => {
231
+ c(s ?? "");
227
232
  }, [o]);
228
- const c = () => {
229
- t(void 0), l("");
230
- }, d = (u) => {
231
- u.key === "Enter" ? o.trim() === "" ? t(void 0) : t(o) : u.key === "Escape" && c();
233
+ const l = () => {
234
+ e(void 0), c("");
235
+ }, u = (d) => {
236
+ d.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : d.key === "Escape" && l();
232
237
  };
233
- return /* @__PURE__ */ n.createElement(
234
- rt,
238
+ return /* @__PURE__ */ i.createElement(
239
+ pe,
235
240
  {
236
- className: e,
241
+ className: t,
237
242
  value: o,
238
- onKeyUp: d,
239
- onChange: (u) => l(u),
240
- onClear: c,
241
- ...i
243
+ onKeyUp: u,
244
+ onChange: (d) => c(d),
245
+ onClear: l,
246
+ ...n
242
247
  }
243
248
  );
244
- }, qt = (a) => {
245
- const { className: e, search: t } = a, s = t.render ?? Ht;
246
- return me(s, {
247
- className: e,
248
- value: t.value,
249
- onChange: t.setValue.bind(t),
250
- ...t.textFieldProps
249
+ }, Ze = (a) => {
250
+ const { className: t, search: e } = a, s = e.render ?? Xe;
251
+ return ft(s, {
252
+ className: t,
253
+ value: e.value,
254
+ onChange: e.setValue.bind(e),
255
+ ...e.textFieldProps
251
256
  });
252
- }, Kt = () => {
253
- const a = y(b), e = h(), t = e.viewMode, s = [];
254
- return e.itemView && s.push("list"), e.table && s.push("table"), s.length <= 1 ? null : /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(
255
- w,
257
+ }, ts = () => {
258
+ const a = y(f), t = g(), e = t.viewMode, s = [];
259
+ return t.itemView && s.push("list"), t.table && s.push("table"), s.length <= 1 ? null : /* @__PURE__ */ i.createElement(D, null, /* @__PURE__ */ i.createElement(
260
+ S,
256
261
  {
257
262
  variant: "plain",
258
263
  color: "secondary",
259
264
  "aria-label": a.format("list.settings")
260
265
  },
261
- /* @__PURE__ */ n.createElement(lt, null)
262
- ), /* @__PURE__ */ n.createElement(H, { selectionMode: "single", selectedKeys: [t] }, /* @__PURE__ */ n.createElement(ot, null, /* @__PURE__ */ n.createElement(K, null, a.format("list.settings.viewMode")), s.map((i) => /* @__PURE__ */ n.createElement(
263
- q,
266
+ /* @__PURE__ */ i.createElement(de, null)
267
+ ), /* @__PURE__ */ i.createElement(G, { selectionMode: "single", selectedKeys: [e] }, /* @__PURE__ */ i.createElement(fe, null, /* @__PURE__ */ i.createElement(_, null, a.format("list.settings.viewMode")), s.map((n) => /* @__PURE__ */ i.createElement(
268
+ j,
264
269
  {
265
- id: i,
266
- key: i,
270
+ id: n,
271
+ key: n,
267
272
  onAction: () => {
268
- e.setViewMode(i);
273
+ t.setViewMode(n);
269
274
  }
270
275
  },
271
- a.format(`list.settings.viewMode.${i}`)
276
+ a.format(`list.settings.viewMode.${n}`)
272
277
  )))));
273
- }, Gt = (a) => {
274
- const { className: e } = a, t = h();
275
- if (t.filters.length === 0 && t.visibleSorting.length === 0 && !t.search)
278
+ }, es = (a) => {
279
+ const { className: t } = a, e = g();
280
+ if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
276
281
  return null;
277
- const s = t.filters.map((i) => /* @__PURE__ */ n.createElement(xt, { key: i.property, filter: i }));
278
- return /* @__PURE__ */ n.createElement("div", { className: v(e, L.header) }, /* @__PURE__ */ n.createElement("div", { className: L.pickerListAndSearch }, /* @__PURE__ */ n.createElement("div", { className: L.pickerList }, /* @__PURE__ */ n.createElement(Mt, null), s), t.search && /* @__PURE__ */ n.createElement(qt, { className: L.searchField, search: t.search }), /* @__PURE__ */ n.createElement(Kt, null)), /* @__PURE__ */ n.createElement(Ot, null));
279
- }, jt = "flow--list", _t = {
280
- list: jt
282
+ const s = e.filters.map((n) => /* @__PURE__ */ i.createElement(He, { key: n.property, filter: n }));
283
+ return /* @__PURE__ */ i.createElement("div", { className: w(t, L.header) }, /* @__PURE__ */ i.createElement("div", { className: L.pickerListAndSearch }, /* @__PURE__ */ i.createElement("div", { className: L.pickerList }, /* @__PURE__ */ i.createElement(Ke, null), s), e.search && /* @__PURE__ */ i.createElement(Ze, { className: L.searchField, search: e.search }), /* @__PURE__ */ i.createElement(ts, null)), /* @__PURE__ */ i.createElement(Qe, null));
284
+ }, ss = "flow--list", is = {
285
+ list: ss
281
286
  };
282
- let Wt = class Fe {
283
- constructor(e, t, s) {
287
+ let as = class Pt {
288
+ constructor(t, e, s) {
284
289
  r(this, "id");
285
290
  r(this, "data");
286
291
  r(this, "collection");
287
- this.collection = e, this.id = t, this.data = s;
292
+ this.collection = t, this.id = e, this.data = s;
288
293
  }
289
- static fromRow(e, t) {
290
- return new Fe(e, t.id, t.original);
294
+ static fromRow(t, e) {
295
+ return new Pt(t, e.id, e.original);
291
296
  }
292
297
  };
293
- class Jt {
294
- constructor(e) {
298
+ class ns {
299
+ constructor(t) {
295
300
  r(this, "list");
296
- this.list = e;
301
+ this.list = t;
297
302
  }
298
303
  get entries() {
299
- return this.list.reactTable.table.getRowModel().rows.map((e) => Wt.fromRow(this, e));
304
+ return this.list.reactTable.table.getRowModel().rows.map((t) => as.fromRow(this, t));
300
305
  }
301
306
  }
302
- class Yt {
303
- constructor(e, t = {}) {
307
+ class rs {
308
+ constructor(t, e = {}) {
304
309
  r(this, "batchSize");
305
310
  r(this, "list");
306
- var i;
307
- const { batchSize: s = 20 } = t;
308
- this.list = e, this.batchSize = s, e.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (i = e.search) == null || i.onUpdated(() => this.reset());
311
+ var n;
312
+ const { batchSize: s = 20 } = e;
313
+ this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (n = t.search) == null || n.onUpdated(() => this.reset());
309
314
  }
310
315
  get reactTable() {
311
316
  return this.list.reactTable.table;
@@ -322,10 +327,10 @@ class Yt {
322
327
  getVisibleItemsCount() {
323
328
  return this.reactTable.getRowModel().rows.length ?? 0;
324
329
  }
325
- updateItemTotalCount(e) {
326
- this.reactTable.setOptions((t) => ({
327
- ...t,
328
- rowCount: e
330
+ updateItemTotalCount(t) {
331
+ this.reactTable.setOptions((e) => ({
332
+ ...e,
333
+ rowCount: t
329
334
  }));
330
335
  }
331
336
  reset() {
@@ -338,27 +343,27 @@ class Yt {
338
343
  if (this.list.loader.manualPagination)
339
344
  this.reactTable.nextPage();
340
345
  else {
341
- const e = this.reactTable.getState().pagination.pageSize + this.batchSize;
342
- this.reactTable.setPagination((t) => ({
343
- ...t,
344
- pageSize: e
346
+ const t = this.reactTable.getState().pagination.pageSize + this.batchSize;
347
+ this.reactTable.setPagination((e) => ({
348
+ ...e,
349
+ pageSize: t
345
350
  }));
346
351
  }
347
352
  }
348
353
  }
349
- const Qt = "$";
350
- class de {
354
+ const os = "$";
355
+ class gt {
351
356
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
352
- constructor(e, t) {
357
+ constructor(t, e) {
353
358
  r(this, "filter");
354
359
  r(this, "value");
355
- this.filter = e, this.value = t;
360
+ this.filter = t, this.value = e;
356
361
  }
357
- equals(e) {
358
- return We(this.value, e.value);
362
+ equals(t) {
363
+ return Qt(this.value, t.value);
359
364
  }
360
365
  get id() {
361
- return `${this.filter.property}@@${pe(this.value)}`;
366
+ return `${this.filter.property}@@${St(this.value)}`;
362
367
  }
363
368
  get isActive() {
364
369
  return this.filter.isValueActive(this);
@@ -373,9 +378,9 @@ class de {
373
378
  this.filter.deactivateValue(this);
374
379
  }
375
380
  }
376
- const Xt = (a, e) => a === e, Zt = (a) => String(a);
377
- class es {
378
- constructor(e, t) {
381
+ const ls = (a, t) => a === t, cs = (a) => String(a);
382
+ class P {
383
+ constructor(t, e) {
379
384
  r(this, "_values");
380
385
  r(this, "_valuesFromTableState");
381
386
  r(this, "list");
@@ -387,66 +392,72 @@ class es {
387
392
  r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
388
393
  r(this, "defaultSelectedValues");
389
394
  var s;
390
- this.list = e, this.property = t.property, this.mode = t.mode ?? "one", this._values = (s = t.values) == null ? void 0 : s.map((i) => new de(this, i)), this.matcher = t.matcher ?? Xt, this.renderItem = t.renderItem ?? Zt, this.name = t.name, this.defaultSelectedValues = t.defaultSelected ? this.values.filter(
391
- (i) => {
395
+ this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((n) => new gt(this, n)), this.matcher = e.matcher ?? ls, this.renderItem = e.renderItem ?? cs, this.name = e.name, this.defaultSelectedValues = e.defaultSelected ? this.values.filter(
396
+ (n) => {
392
397
  var o;
393
- return (o = t.defaultSelected) == null ? void 0 : o.some((l) => l === i.value);
398
+ return (o = e.defaultSelected) == null ? void 0 : o.some((c) => c === n.value);
394
399
  }
395
- ) : [];
400
+ ) : void 0;
396
401
  }
397
- updateInitialState(e) {
398
- e.columnFilters = [
399
- ...e.columnFilters ?? [],
400
- ...this.defaultSelectedValues.map((t) => ({
401
- id: t.filter.property,
402
- value: t
403
- }))
404
- ];
402
+ getStoredDefaultSelectedValues() {
403
+ var e;
404
+ const t = (e = this.list.getStoredFilterDefaultSettings()) == null ? void 0 : e[this.property];
405
+ return t ? this.values.filter((s) => t.includes(s.value)) : void 0;
405
406
  }
406
- updateTableColumnDef(e) {
407
- e.enableColumnFilter = !0, e.filterFn = this.getReactTableFilterFn();
407
+ updateInitialState(t) {
408
+ const e = this.getInitialValues();
409
+ e != null && e.length && (t.columnFilters = [
410
+ ...t.columnFilters ?? [],
411
+ {
412
+ id: this.property,
413
+ value: e
414
+ }
415
+ ]);
416
+ }
417
+ updateTableColumnDef(t) {
418
+ t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
408
419
  }
409
420
  getReactTableFilterFn() {
410
- return (e, t, s) => {
411
- const i = this.property, o = i.startsWith(Qt) ? e.original : ct(e.original, i);
421
+ return (t, e, s) => {
422
+ const n = this.property, o = n.startsWith(os) ? t.original : be(t.original, n);
412
423
  return this.checkFilterMatches(o, s);
413
424
  };
414
425
  }
415
- checkFilterMatches(e, t) {
416
- if (t === null)
426
+ checkFilterMatches(t, e) {
427
+ if (e === null)
417
428
  return !0;
418
- const s = (o) => Array.isArray(o) ? o : [o], i = (o) => this.matcher(o.value, e);
429
+ const s = (o) => Array.isArray(o) ? o : [o], n = (o) => this.matcher(o.value, t);
419
430
  if (this.mode === "all")
420
- return s(t).every(i);
431
+ return s(e).every(n);
421
432
  if (this.mode === "some") {
422
- const o = s(t);
423
- return o.length === 0 || o.some(i);
433
+ const o = s(e);
434
+ return o.length === 0 || o.some(n);
424
435
  } else if (this.mode === "one")
425
- return i(t);
436
+ return n(e);
426
437
  throw new Error(`Unknown filter mode '${this.mode}'`);
427
438
  }
428
439
  getTableColumnFilter() {
429
- return this.list.reactTable.table.getState().columnFilters.find((e) => e.id === this.property);
440
+ return this.list.reactTable.table.getState().columnFilters.find((t) => t.id === this.property);
430
441
  }
431
442
  getTableColumn() {
432
443
  return this.list.reactTable.getTableColumn(this.property);
433
444
  }
434
445
  getValue() {
435
- var e;
436
- return ((e = this.getTableColumnFilter()) == null ? void 0 : e.value) ?? null;
446
+ var t;
447
+ return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
437
448
  }
438
449
  getValuesFromTableState() {
439
- return Je(
440
- Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((e) => e).filter((e) => e != null)
441
- ).map((e) => new de(this, e));
450
+ return Xt(
451
+ Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
452
+ ).map((t) => new gt(this, t));
442
453
  }
443
- checkIfValueIsUnknown(e) {
444
- return !this.values.some((s) => s.id === e.id);
454
+ checkIfValueIsUnknown(t) {
455
+ return !this.values.some((s) => s.id === t.id);
445
456
  }
446
457
  deleteUnknownFilterValues() {
447
458
  if (this.values !== this.valuesFromTableState)
448
- for (const e of this.getArrayValue())
449
- this.checkIfValueIsUnknown(e) && this.deactivateValue(e);
459
+ for (const t of this.getArrayValue())
460
+ this.checkIfValueIsUnknown(t) && this.deactivateValue(t);
450
461
  }
451
462
  get values() {
452
463
  return this._values ?? this.valuesFromTableState;
@@ -455,44 +466,53 @@ class es {
455
466
  return this._valuesFromTableState || (this._valuesFromTableState = this.getValuesFromTableState()), this._valuesFromTableState;
456
467
  }
457
468
  getArrayValue() {
458
- const e = this.getValue();
459
- return Array.isArray(e) ? e : e === null ? [] : [e];
469
+ const t = this.getValue();
470
+ return Array.isArray(t) ? t : t === null ? [] : [t];
460
471
  }
461
- isValueActive(e) {
462
- return this.getArrayValue().some((t) => t.equals(e));
472
+ isValueActive(t) {
473
+ return this.getArrayValue().some((e) => e.equals(t));
463
474
  }
464
475
  isActive() {
465
476
  return this.getArrayValue().length > 0;
466
477
  }
467
- deactivateValue(e) {
468
- const t = this.getArrayValue();
478
+ deactivateValue(t) {
479
+ const e = this.getArrayValue();
469
480
  let s;
470
- this.mode === "all" || this.mode === "some" ? s = t.filter((i) => !i.equals(e)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
481
+ this.mode === "all" || this.mode === "some" ? s = e.filter((n) => !n.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((n) => n());
482
+ }
483
+ hasChanged() {
484
+ const t = this.getArrayValue().map((s) => s.value), e = (this.getInitialValues() ?? []).map((s) => s.value);
485
+ return t.length !== e.length || Zt(t, e).length > 0;
486
+ }
487
+ getInitialValues() {
488
+ return this.getStoredDefaultSelectedValues() ?? this.defaultSelectedValues;
471
489
  }
472
- clearValues() {
473
- let e;
474
- this.mode === "all" || this.mode === "some" ? e = [] : e = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(e), this.onFilterUpdateCallbacks.forEach((t) => t());
490
+ resetValues() {
491
+ let t;
492
+ const e = this.getInitialValues();
493
+ e ? t = e : this.mode === "all" || this.mode === "some" ? t = [] : t = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(t), this.onFilterUpdateCallbacks.forEach((s) => s());
475
494
  }
476
- toggleValue(e) {
477
- const t = this.getArrayValue();
495
+ toggleValue(t) {
496
+ const e = this.getArrayValue();
478
497
  let s;
479
- this.mode === "all" || this.mode === "some" ? e.isActive ? s = t.filter((i) => !i.equals(e)) : s = [...t, e] : s = e.isActive ? null : e, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
498
+ this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((n) => !n.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((n) => n());
480
499
  }
481
- onFilterUpdated(e) {
482
- this.onFilterUpdateCallbacks.add(e);
500
+ onFilterUpdated(t) {
501
+ this.onFilterUpdateCallbacks.add(t);
483
502
  }
484
503
  }
485
- class ts {
486
- constructor(e, t) {
504
+ r(P, "settingsStorageSchema", O.record(O.array(O.unknown())).optional());
505
+ class us {
506
+ constructor(t, e) {
487
507
  r(this, "list");
488
508
  r(this, "property");
489
509
  r(this, "name");
490
510
  r(this, "direction");
491
511
  r(this, "defaultEnabled");
492
- this.list = e, this.property = t.property, this.name = t.name, this.direction = t.direction ?? "asc", this.defaultEnabled = t.defaultEnabled ?? !1;
512
+ this.list = t, this.property = e.property, this.name = e.name, this.direction = e.direction ?? "asc", this.defaultEnabled = e.defaultEnabled ?? !1;
493
513
  }
494
- updateTableColumnDef(e) {
495
- e.enableSorting = !0;
514
+ updateTableColumnDef(t) {
515
+ t.enableSorting = !0;
496
516
  }
497
517
  getReactTableColumnSort() {
498
518
  return {
@@ -516,150 +536,150 @@ class ts {
516
536
  return `${this.getTableColumn().id}:${this.direction}`;
517
537
  }
518
538
  }
519
- class j {
520
- constructor(e, t, s = {}) {
539
+ class J {
540
+ constructor(t, e, s = {}) {
521
541
  r(this, "list");
522
542
  r(this, "table");
523
543
  r(this, "sortingState");
524
544
  r(this, "updateSortingState");
525
- this.list = e;
526
- const i = this.list.sorting.filter(
527
- (c) => c.defaultEnabled !== !1
528
- ), [o, l] = O(
529
- i.map((c) => c.getReactTableColumnSort())
545
+ this.list = t;
546
+ const n = this.list.sorting.filter(
547
+ (l) => l.defaultEnabled !== !1
548
+ ), [o, c] = q(
549
+ n.map((l) => l.getReactTableColumnSort())
530
550
  );
531
- this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(t, s);
551
+ this.sortingState = o, this.updateSortingState = c, this.table = this.useReactTable(e, s);
532
552
  }
533
- static useNew(e, t, s = {}) {
534
- return new j(e, t, s);
553
+ static useNew(t, e, s = {}) {
554
+ return new J(t, e, s);
535
555
  }
536
- useReactTable(e, t = {}) {
537
- var l;
538
- const s = this.list.loader.useData(), i = {
556
+ useReactTable(t, e = {}) {
557
+ var c;
558
+ const s = this.list.loader.useData(), n = {
539
559
  pagination: {
540
560
  pageSize: this.list.batches.batchSize
541
561
  },
542
562
  columnFilters: []
543
563
  };
544
- for (const c of this.list.filters)
545
- c.updateInitialState(i);
546
- (l = this.list.search) == null || l.updateInitialState(i);
547
- const o = dt({
564
+ for (const l of this.list.filters)
565
+ l.updateInitialState(n);
566
+ (c = this.list.search) == null || c.updateInitialState(n);
567
+ const o = Se({
548
568
  data: s,
549
569
  state: {
550
570
  sorting: this.sortingState
551
571
  },
552
572
  getRowId: this.list.getItemId,
553
- initialState: i,
573
+ initialState: n,
554
574
  columns: this.getTableColumnDefs(),
555
- getCoreRowModel: ut(),
556
- getSortedRowModel: mt(),
557
- getFilteredRowModel: ht(),
558
- getPaginationRowModel: pt(),
559
- getFacetedUniqueValues: gt(),
560
- onSortingChange: (c) => {
561
- this.handleSortingStateUpdate(c);
575
+ getCoreRowModel: ve(),
576
+ getSortedRowModel: ye(),
577
+ getFilteredRowModel: we(),
578
+ getPaginationRowModel: Ee(),
579
+ getFacetedUniqueValues: Fe(),
580
+ onSortingChange: (l) => {
581
+ this.handleSortingStateUpdate(l);
562
582
  },
563
583
  globalFilterFn: "auto",
564
- ...t
584
+ ...e
565
585
  });
566
586
  return k(() => {
567
- e && e(this.list);
568
- }, [this.list, e, o]), o;
587
+ t && t(this.list);
588
+ }, [this.list, t, o]), o;
569
589
  }
570
- handleSortingStateUpdate(e) {
571
- const t = typeof e == "function" ? e(this.sortingState) : e, s = this.list.sorting.filter(
572
- (i) => i.defaultEnabled === "hidden" && !t.some((o) => o.id === i.property)
573
- ).map((i) => i.getReactTableColumnSort());
574
- this.updateSortingState([...s, ...t]);
590
+ handleSortingStateUpdate(t) {
591
+ const e = typeof t == "function" ? t(this.sortingState) : t, s = this.list.sorting.filter(
592
+ (n) => n.defaultEnabled === "hidden" && !e.some((o) => o.id === n.property)
593
+ ).map((n) => n.getReactTableColumnSort());
594
+ this.updateSortingState([...s, ...e]);
575
595
  }
576
596
  get searchString() {
577
597
  return this.table.getState().globalFilter;
578
598
  }
579
- getTableColumn(e) {
580
- const t = this.table.getColumn(e);
581
- return ge(!!t, `Column #${e} is not defined`), t;
599
+ getTableColumn(t) {
600
+ const e = this.table.getColumn(t);
601
+ return vt(!!e, `Column #${t} is not defined`), e;
582
602
  }
583
603
  getTableColumnDefs() {
584
- const e = /* @__PURE__ */ new Map(), t = (s) => {
585
- const i = e.get(s);
586
- if (i)
587
- return i;
604
+ const t = /* @__PURE__ */ new Map(), e = (s) => {
605
+ const n = t.get(s);
606
+ if (n)
607
+ return n;
588
608
  const o = {
589
609
  id: s,
590
610
  accessorKey: s,
591
611
  enableSorting: !1,
592
612
  enableColumnFilter: !1
593
613
  };
594
- return e.set(s, o), o;
614
+ return t.set(s, o), o;
595
615
  };
596
616
  return this.list.filters.forEach(
597
- (s) => s.updateTableColumnDef(t(s.property))
617
+ (s) => s.updateTableColumnDef(e(s.property))
598
618
  ), this.list.sorting.forEach(
599
- (s) => s.updateTableColumnDef(t(s.property))
600
- ), Array.from(e.values());
619
+ (s) => s.updateTableColumnDef(e(s.property))
620
+ ), Array.from(t.values());
601
621
  }
602
622
  }
603
- class _ {
623
+ class Y {
604
624
  constructor() {
605
625
  r(this, "dataBatches", []);
606
626
  r(this, "prevDataBatches", []);
607
627
  r(this, "batchLoadingStates", ["void"]);
608
- it(this, {
628
+ he(this, {
609
629
  prevDataBatches: !1,
610
630
  useMergedData: !1,
611
631
  useIsLoading: !1,
612
- dataBatches: ne.shallow,
613
- batchLoadingStates: ne.shallow,
614
- mergedData: re,
615
- isLoading: re,
616
- reset: D.bound,
617
- setDataBatch: D.bound,
618
- setBatchLoadingState: D.bound
632
+ dataBatches: ut.shallow,
633
+ batchLoadingStates: ut.shallow,
634
+ mergedData: dt,
635
+ isLoading: dt,
636
+ reset: U.bound,
637
+ setDataBatch: U.bound,
638
+ setBatchLoadingState: U.bound
619
639
  });
620
640
  }
621
641
  static useNew() {
622
- return Ke(new _()).current;
642
+ return _t(new Y()).current;
623
643
  }
624
644
  reset() {
625
645
  this.batchLoadingStates = [], this.dataBatches = [];
626
646
  }
627
- setDataBatch(e, t) {
628
- this.dataBatches.length === 0 && (this.prevDataBatches = []), this.dataBatches[e] !== t && (this.dataBatches[e] = t, this.prevDataBatches[e] = t);
647
+ setDataBatch(t, e) {
648
+ this.dataBatches.length === 0 && (this.prevDataBatches = []), this.dataBatches[t] !== e && (this.dataBatches[t] = e, this.prevDataBatches[t] = e);
629
649
  }
630
- setBatchLoadingState(e, t) {
631
- this.batchLoadingStates[e] !== t && (this.batchLoadingStates[e] = t);
650
+ setBatchLoadingState(t, e) {
651
+ this.batchLoadingStates[t] !== e && (this.batchLoadingStates[t] = e);
632
652
  }
633
653
  get mergedData() {
634
- return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((t) => t);
654
+ return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((e) => e);
635
655
  }
636
656
  useMergedData() {
637
- return le(() => this.mergedData);
657
+ return ht(() => this.mergedData);
638
658
  }
639
659
  get isLoading() {
640
- return this.batchLoadingStates.some((e) => e === "loading" || e === "void");
660
+ return this.batchLoadingStates.some((t) => t === "loading" || t === "void");
641
661
  }
642
662
  useIsLoading() {
643
- return le(() => this.isLoading);
663
+ return ht(() => this.isLoading);
644
664
  }
645
665
  }
646
- const ss = [];
647
- class W {
648
- constructor(e, t = {}) {
666
+ const ds = [];
667
+ class Q {
668
+ constructor(t, e = {}) {
649
669
  r(this, "list");
650
670
  r(this, "dataSource");
651
671
  r(this, "manualSorting");
652
672
  r(this, "manualFiltering");
653
673
  r(this, "manualPagination");
654
674
  r(this, "loaderState");
655
- var c;
656
- const { source: s } = t;
657
- this.dataSource = s ?? { staticData: ss };
658
- const i = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, o = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, l = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
659
- this.list = e, this.loaderState = _.useNew(), this.manualPagination = i ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((d) => d.onFilterUpdated(() => this.reset())), (c = this.list.search) == null || c.onUpdated(() => this.reset());
675
+ var l;
676
+ const { source: s } = e;
677
+ this.dataSource = s ?? { staticData: ds };
678
+ const n = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, o = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, c = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
679
+ this.list = t, this.loaderState = Y.useNew(), this.manualPagination = n ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = c ?? this.manualPagination, this.list.filters.forEach((u) => u.onFilterUpdated(() => this.reset())), (l = this.list.search) == null || l.onUpdated(() => this.reset());
660
680
  }
661
- static useNew(e, t = {}) {
662
- return new W(e, t);
681
+ static useNew(t, e = {}) {
682
+ return new Q(t, e);
663
683
  }
664
684
  reset() {
665
685
  this.loaderState.reset();
@@ -674,85 +694,85 @@ class W {
674
694
  return this.loaderState.useMergedData();
675
695
  }
676
696
  getLoaderInvocationHooks() {
677
- return Ye(this.list.batches.getBatchIndex() + 1, (t) => t).map((t) => () => {
678
- this.useLoadBatch(t);
697
+ return te(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
698
+ this.useLoadBatch(e);
679
699
  });
680
700
  }
681
- useLoadBatch(e) {
682
- const t = this.getBatchDataAsyncResource(e);
683
- t.use({
701
+ useLoadBatch(t) {
702
+ const e = this.getBatchDataAsyncResource(t);
703
+ e.use({
684
704
  useSuspense: !1
685
- }), this.useObserveBatchData(t, e), this.useObserveBatchLoadingState(t, e);
705
+ }), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
686
706
  }
687
- useObserveBatchLoadingState(e, t) {
707
+ useObserveBatchLoadingState(t, e) {
688
708
  k(() => (this.loaderState.setBatchLoadingState(
689
- t,
690
- e.state.value
691
- ), e.state.observe((s) => {
692
- this.loaderState.setBatchLoadingState(t, s);
693
- })), [e, t]);
694
- }
695
- useObserveBatchData(e, t) {
696
- const s = (i) => {
697
- const { data: o, itemTotalCount: l } = i;
698
- this.loaderState.setDataBatch(t, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
709
+ e,
710
+ t.state.value
711
+ ), t.state.observe((s) => {
712
+ this.loaderState.setBatchLoadingState(e, s);
713
+ })), [t, e]);
714
+ }
715
+ useObserveBatchData(t, e) {
716
+ const s = (n) => {
717
+ const { data: o, itemTotalCount: c } = n;
718
+ this.loaderState.setDataBatch(e, o), c !== void 0 && this.list.batches.updateItemTotalCount(c);
699
719
  };
700
- k(() => (e.value.value.isSet && s(e.value.value.value), e.value.observe((i) => {
701
- i.isSet && s(i.value);
702
- })), [e, t]);
720
+ k(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((n) => {
721
+ n.isSet && s(n.value);
722
+ })), [t, e]);
703
723
  }
704
- getDataLoaderOptions(e) {
724
+ getDataLoaderOptions(t) {
705
725
  return {
706
726
  pagination: this.manualPagination ? {
707
727
  limit: this.list.batches.batchSize,
708
- offset: this.list.batches.batchSize * e
728
+ offset: this.list.batches.batchSize * t
709
729
  } : void 0,
710
730
  sorting: this.manualSorting ? Object.fromEntries(
711
- this.list.sorting.filter((t) => t.isSorted()).map((t) => [t.property, t.direction])
731
+ this.list.sorting.filter((e) => e.isSorted()).map((e) => [e.property, e.direction])
712
732
  ) : void 0,
713
733
  filtering: this.manualFiltering ? Object.fromEntries(
714
- this.list.filters.filter((t) => t.getValue() !== null).map((t) => [
715
- t.property,
734
+ this.list.filters.filter((e) => e.getValue() !== null).map((e) => [
735
+ e.property,
716
736
  {
717
- mode: t.mode,
718
- values: t.getArrayValue().map((s) => s.value)
737
+ mode: e.mode,
738
+ values: e.getArrayValue().map((s) => s.value)
719
739
  }
720
740
  ])
721
741
  ) : void 0,
722
742
  searchString: this.manualFiltering ? this.list.reactTable.searchString : void 0
723
743
  };
724
744
  }
725
- getBatchDataAsyncResource(e) {
726
- const t = this.dataSource, s = this.getDataLoaderOptions(e);
727
- if ("staticData" in t)
728
- return oe(
729
- async (i) => ({
730
- data: i,
731
- itemTotalCount: i.length
745
+ getBatchDataAsyncResource(t) {
746
+ const e = this.dataSource, s = this.getDataLoaderOptions(t);
747
+ if ("staticData" in e)
748
+ return mt(
749
+ async (n) => ({
750
+ data: n,
751
+ itemTotalCount: n.length
732
752
  }),
733
- [t.staticData]
753
+ [e.staticData]
734
754
  );
735
- if ("asyncLoader" in t) {
736
- const i = t.asyncLoader, o = t.dependencies, l = o ? pe(o).toString() : void 0;
737
- return oe(i, [s], {
738
- loaderId: l
755
+ if ("asyncLoader" in e) {
756
+ const n = e.asyncLoader, o = e.dependencies, c = o ? St(o).toString() : void 0;
757
+ return mt(n, [s], {
758
+ loaderId: c
739
759
  });
740
760
  }
741
- if ("asyncResourceFactory" in t) {
742
- const i = t.asyncResourceFactory;
743
- return i(s);
761
+ if ("asyncResourceFactory" in e) {
762
+ const n = e.asyncResourceFactory;
763
+ return n(s);
744
764
  }
745
765
  throw new Error("Unknown data source");
746
766
  }
747
767
  }
748
- class as {
749
- constructor(e, t) {
768
+ class ms {
769
+ constructor(t, e) {
750
770
  r(this, "list");
751
771
  r(this, "render");
752
772
  r(this, "textFieldProps");
753
773
  r(this, "onUpdateCallbacks", /* @__PURE__ */ new Set());
754
774
  r(this, "defaultValue");
755
- this.list = e, this.render = t.render, this.textFieldProps = t.textFieldProps, this.defaultValue = t.defaultValue;
775
+ this.list = t, this.render = e.render, this.textFieldProps = e.textFieldProps, this.defaultValue = e.defaultValue;
756
776
  }
757
777
  get value() {
758
778
  return this.list.reactTable.searchString;
@@ -761,85 +781,89 @@ class as {
761
781
  return this.value !== void 0;
762
782
  }
763
783
  callOnUpdateCallbacks() {
764
- this.onUpdateCallbacks.forEach((e) => e());
784
+ this.onUpdateCallbacks.forEach((t) => t());
765
785
  }
766
- updateInitialState(e) {
767
- e.globalFilter = this.defaultValue;
786
+ updateInitialState(t) {
787
+ t.globalFilter = this.defaultValue;
768
788
  }
769
- setValue(e) {
770
- e === void 0 || e.trim() === "" ? this.list.reactTable.table.getState().globalFilter && (this.list.reactTable.table.setGlobalFilter(void 0), this.callOnUpdateCallbacks()) : (this.list.reactTable.table.setGlobalFilter(e), this.callOnUpdateCallbacks());
789
+ setValue(t) {
790
+ t === void 0 || t.trim() === "" ? this.list.reactTable.table.getState().globalFilter && (this.list.reactTable.table.setGlobalFilter(void 0), this.callOnUpdateCallbacks()) : (this.list.reactTable.table.setGlobalFilter(t), this.callOnUpdateCallbacks());
771
791
  }
772
792
  clear() {
773
793
  this.setValue(void 0);
774
794
  }
775
- onUpdated(e) {
776
- this.onUpdateCallbacks.add(e);
795
+ onUpdated(t) {
796
+ this.onUpdateCallbacks.add(t);
777
797
  }
778
798
  }
779
- const V = class V {
780
- constructor(e, t = {}) {
799
+ const M = class M {
800
+ constructor(t, e = {}) {
781
801
  r(this, "list");
782
802
  r(this, "textValue");
783
803
  r(this, "href");
784
804
  r(this, "fallback");
785
805
  r(this, "renderFn");
786
- const { fallback: s, textValue: i, href: o, renderFn: l } = t;
787
- this.list = e, this.textValue = i, this.renderFn = l, this.href = o, this.fallback = s;
806
+ const { fallback: s, textValue: n, href: o, renderFn: c } = e;
807
+ this.list = t, this.textValue = n, this.renderFn = c, this.href = o, this.fallback = s;
788
808
  }
789
- render(e) {
790
- return (this.renderFn ?? V.fallbackRenderItemFn)(e);
809
+ render(t) {
810
+ return (this.renderFn ?? M.fallbackRenderItemFn)(t);
791
811
  }
792
812
  };
793
- r(V, "fallbackRenderItemFn", (e) => me("pre", void 0, JSON.stringify(e)));
794
- let z = V, is = class {
795
- constructor(e, t = {}) {
813
+ r(M, "fallbackRenderItemFn", (t) => ft("pre", void 0, JSON.stringify(t)));
814
+ let K = M, hs = class {
815
+ constructor(t, e = {}) {
796
816
  r(this, "tableHeader");
797
817
  r(this, "componentProps");
798
- this.tableHeader = e, this.componentProps = t;
818
+ this.tableHeader = t, this.componentProps = e;
799
819
  }
800
- }, ns = class {
801
- constructor(e, t = {}) {
820
+ }, gs = class {
821
+ constructor(t, e = {}) {
802
822
  r(this, "table");
803
823
  r(this, "componentProps");
804
824
  r(this, "columns");
805
- const { columns: s = [], ...i } = t;
806
- this.table = e, this.columns = s.map((o) => new is(this, o)), this.componentProps = i;
825
+ const { columns: s = [], ...n } = e;
826
+ this.table = t, this.columns = s.map((o) => new hs(this, o)), this.componentProps = n;
807
827
  }
808
- }, rs = class {
809
- constructor(e, t = {}) {
828
+ }, ps = class {
829
+ constructor(t, e = {}) {
810
830
  r(this, "row");
811
831
  r(this, "renderFn");
812
832
  r(this, "componentProps");
813
- const { renderFn: s, ...i } = t;
814
- this.row = e, this.renderFn = s, this.componentProps = i;
833
+ const { renderFn: s, ...n } = e;
834
+ this.row = t, this.renderFn = s, this.componentProps = n;
815
835
  }
816
- }, os = class {
817
- constructor(e, t = {}) {
836
+ }, fs = class {
837
+ constructor(t, e = {}) {
818
838
  r(this, "tableBody");
819
839
  r(this, "cells");
820
840
  r(this, "componentProps");
821
- const { cells: s = [], ...i } = t;
822
- this.tableBody = e, this.cells = s.map((o) => new rs(this, o)), this.componentProps = i;
841
+ const { cells: s = [], ...n } = e;
842
+ this.tableBody = t, this.cells = s.map((o) => new ps(this, o)), this.componentProps = n;
823
843
  }
824
- }, ls = class {
825
- constructor(e, t = {}) {
844
+ }, bs = class {
845
+ constructor(t, e = {}) {
826
846
  r(this, "table");
827
847
  r(this, "componentProps");
828
848
  r(this, "row");
829
- const { row: s, ...i } = t;
830
- this.table = e, this.row = new os(this, s), this.componentProps = i;
849
+ const { row: s, ...n } = e;
850
+ this.table = t, this.row = new fs(this, s), this.componentProps = n;
831
851
  }
832
- }, cs = class {
833
- constructor(e, t = {}) {
852
+ }, Ss = class {
853
+ constructor(t, e = {}) {
834
854
  r(this, "list");
835
855
  r(this, "header");
836
856
  r(this, "body");
837
857
  r(this, "componentProps");
838
- const { header: s, body: i, ...o } = t;
839
- this.list = e, this.header = new ns(this, s), this.body = new ls(this, i), this.componentProps = o;
840
- }
841
- }, ds = class Ce {
842
- constructor(e) {
858
+ const { header: s, body: n, ...o } = e;
859
+ this.list = t, this.header = new gs(this, s), this.body = new bs(this, n), this.componentProps = o;
860
+ }
861
+ }, vs = class Vt {
862
+ constructor(t) {
863
+ r(this, "settingStorageKey");
864
+ r(this, "supportsSettingsStorage");
865
+ r(this, "filterSettingsStorageKey");
866
+ r(this, "defaultSettings");
843
867
  r(this, "filters");
844
868
  r(this, "itemView");
845
869
  r(this, "table");
@@ -855,291 +879,315 @@ let z = V, is = class {
855
879
  r(this, "viewMode");
856
880
  r(this, "setViewMode");
857
881
  const {
858
- itemView: t,
859
- table: s,
860
- filters: i = [],
861
- sorting: o = [],
882
+ settingStorageKey: e,
883
+ itemView: s,
884
+ table: n,
885
+ filters: o = [],
886
+ sorting: c = [],
862
887
  batchesController: l,
863
- onChange: c,
888
+ onChange: u,
864
889
  loader: d,
865
- search: u,
866
- onAction: p,
867
- getItemId: T,
868
- defaultViewMode: M,
869
- ...C
870
- } = e;
871
- this.items = new Jt(this), this.filters = i.map((S) => new es(this, S)), this.sorting = o.map((S) => new ts(this, S)), this.search = u ? new as(this, u) : void 0, this.itemView = t ? new z(this, t) : void 0, this.table = s ? new cs(this, s) : void 0, this.batches = new Yt(this, l), this.componentProps = C, this.loader = W.useNew(this, d), this.onAction = p, this.getItemId = T, this.reactTable = j.useNew(this, c, {
890
+ search: h,
891
+ onAction: F,
892
+ getItemId: x,
893
+ defaultViewMode: C,
894
+ ...R
895
+ } = t;
896
+ this.defaultSettings = Te(), this.settingStorageKey = e, this.filterSettingsStorageKey = e ? `${e}.activeFilters` : void 0, this.supportsSettingsStorage = !!this.settingStorageKey, this.items = new ns(this), this.filters = o.map((v) => new P(this, v)), this.sorting = c.map((v) => new us(this, v)), this.search = h ? new ms(this, h) : void 0, this.itemView = s ? new K(this, s) : void 0, this.table = n ? new Ss(this, n) : void 0, this.batches = new rs(this, l), this.componentProps = R, this.loader = Q.useNew(this, d), this.onAction = F, this.getItemId = x, this.reactTable = J.useNew(this, u, {
872
897
  manualFiltering: this.loader.manualFiltering,
873
898
  manualPagination: this.loader.manualPagination,
874
899
  manualSorting: this.loader.manualSorting
875
900
  });
876
- const [x, R] = O(M ?? "list");
877
- this.viewMode = x, this.setViewMode = R, k(() => {
878
- this.filters.forEach((S) => S.deleteUnknownFilterValues());
901
+ const [N, $] = q(C ?? "list");
902
+ this.viewMode = N, this.setViewMode = $, k(() => {
903
+ this.filters.forEach((v) => v.deleteUnknownFilterValues());
879
904
  }, [this.filters]);
880
905
  }
881
- static useNew(e) {
882
- return new Ce(e);
906
+ static useNew(t) {
907
+ return new Vt(t);
883
908
  }
884
909
  get isFiltered() {
885
- return this.filters.some((e) => e.isActive()) || !!this.search && this.search.isSet;
910
+ return this.filters.some((t) => t.isActive()) || !!this.search && this.search.isSet;
886
911
  }
887
912
  get visibleSorting() {
888
- return this.sorting.filter((e) => e.defaultEnabled !== "hidden");
913
+ return this.sorting.filter((t) => t.defaultEnabled !== "hidden");
914
+ }
915
+ storeFilterDefaultSettings() {
916
+ if (this.defaultSettings && this.filterSettingsStorageKey) {
917
+ const t = Object.fromEntries(
918
+ this.filters.map((e) => [
919
+ e.property,
920
+ e.getArrayValue().filter((s) => s.isActive).map((s) => s.value)
921
+ ])
922
+ );
923
+ this.defaultSettings.set(
924
+ "List",
925
+ this.filterSettingsStorageKey,
926
+ P.settingsStorageSchema,
927
+ t
928
+ );
929
+ }
889
930
  }
890
- getSorting(e) {
891
- const t = this.sorting.find((s) => s.id === e);
892
- return ge(!!t, `Could not get Sorting (ID: ${e})`), t;
931
+ getStoredFilterDefaultSettings() {
932
+ if (this.defaultSettings && this.filterSettingsStorageKey)
933
+ return this.defaultSettings.get(
934
+ "List",
935
+ this.filterSettingsStorageKey,
936
+ P.settingsStorageSchema
937
+ );
938
+ }
939
+ getSorting(t) {
940
+ const e = this.sorting.find((s) => s.id === t);
941
+ return vt(!!e, `Could not get Sorting (ID: ${t})`), e;
893
942
  }
894
943
  clearSorting() {
895
- return this.sorting.forEach((e) => e.clear());
944
+ return this.sorting.forEach((t) => t.clear());
896
945
  }
897
- clearFilters() {
898
- var e;
899
- return (e = this.search) == null || e.clear(), this.filters.forEach((t) => t.clearValues());
946
+ resetFilters() {
947
+ return this.filters.forEach((t) => t.resetValues());
900
948
  }
901
949
  useIsEmpty() {
902
950
  return !this.loader.useIsLoading() && this.items.entries.length === 0;
903
951
  }
904
952
  };
905
- const us = "flow--list--items", ms = "flow--list--items--is-loading", ue = {
906
- items: us,
907
- isLoading: ms
908
- }, hs = "flow--list--items--item", ps = "flow--list--items--item--is-selected", gs = "flow--list--items--item--has-action", P = {
909
- item: hs,
910
- isSelected: ps,
911
- hasAction: gs
912
- }, Ie = () => /* @__PURE__ */ n.createElement(Ee, null, /* @__PURE__ */ n.createElement(K, null, /* @__PURE__ */ n.createElement(A, { width: "200px" })), /* @__PURE__ */ n.createElement(E, null, /* @__PURE__ */ n.createElement(A, { width: "300px" }))), fs = (a) => {
913
- const { id: e, data: t, children: s } = a, o = h().itemView;
953
+ const ys = "flow--list--items", ws = "flow--list--items--is-loading", pt = {
954
+ items: ys,
955
+ isLoading: ws
956
+ }, Es = "flow--list--items--item", Fs = "flow--list--items--item--is-selected", Ts = "flow--list--items--item--has-action", V = {
957
+ item: Es,
958
+ isSelected: Fs,
959
+ hasAction: Ts
960
+ }, kt = () => /* @__PURE__ */ i.createElement(It, null, /* @__PURE__ */ i.createElement(_, null, /* @__PURE__ */ i.createElement(A, { width: "200px" })), /* @__PURE__ */ i.createElement(E, null, /* @__PURE__ */ i.createElement(A, { width: "300px" }))), Cs = (a) => {
961
+ const { id: t, data: e, children: s } = a, o = g().itemView;
914
962
  if (!o)
915
963
  return null;
916
- const l = o.list.onAction, c = o.textValue ? o.textValue(t) : void 0, d = o.href ? o.href(t) : void 0, u = !!l || !!d;
917
- return /* @__PURE__ */ n.createElement(
918
- G.GridListItem,
964
+ const c = o.list.onAction, l = o.textValue ? o.textValue(e) : void 0, u = o.href ? o.href(e) : void 0, d = !!c || !!u;
965
+ return /* @__PURE__ */ i.createElement(
966
+ W.GridListItem,
919
967
  {
920
- id: e,
921
- className: (p) => v(
922
- P.item,
923
- u && P.hasAction,
924
- p.isSelected && P.isSelected
968
+ id: t,
969
+ className: (h) => w(
970
+ V.item,
971
+ d && V.hasAction,
972
+ h.isSelected && V.isSelected
925
973
  ),
926
- onAction: () => l && l(t),
927
- textValue: c,
928
- href: d
974
+ onAction: () => c && c(e),
975
+ textValue: l,
976
+ href: u
929
977
  },
930
- /* @__PURE__ */ n.createElement(Ge, { fallback: /* @__PURE__ */ n.createElement(Ie, null) }, s ?? o.render(t))
978
+ /* @__PURE__ */ i.createElement(Wt, { fallback: /* @__PURE__ */ i.createElement(kt, null) }, s ?? o.render(e))
931
979
  );
932
- }, bs = (a) => /* @__PURE__ */ n.createElement(G.GridListItem, { textValue: "-", className: P.item }, a.children), U = () => {
933
- const a = y(b);
934
- return /* @__PURE__ */ n.createElement(ft, null, /* @__PURE__ */ n.createElement(bt, null), /* @__PURE__ */ n.createElement(K, null, a.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(E, null, a.format("list.noResult.text")));
935
- }, Ss = () => {
936
- var t;
937
- const e = ((t = h().itemView) == null ? void 0 : t.fallback) ?? /* @__PURE__ */ n.createElement(Ie, null);
938
- return Array.from(Array(5)).map((s, i) => /* @__PURE__ */ n.createElement(bs, { key: i }, je(e)));
939
- }, ws = () => {
940
- const a = h(), e = a.loader.useIsLoading(), t = a.loader.useIsInitiallyLoading();
980
+ }, Is = (a) => /* @__PURE__ */ i.createElement(W.GridListItem, { textValue: "-", className: V.item }, a.children), H = () => {
981
+ const a = y(f);
982
+ return /* @__PURE__ */ i.createElement(Ce, null, /* @__PURE__ */ i.createElement(Ie, null), /* @__PURE__ */ i.createElement(_, null, a.format("list.noResult.heading")), /* @__PURE__ */ i.createElement(E, null, a.format("list.noResult.text")));
983
+ }, Ls = () => {
984
+ var e;
985
+ const t = ((e = g().itemView) == null ? void 0 : e.fallback) ?? /* @__PURE__ */ i.createElement(kt, null);
986
+ return Array.from(Array(5)).map((s, n) => /* @__PURE__ */ i.createElement(Is, { key: n }, Jt(t)));
987
+ }, Ps = () => {
988
+ const a = g(), t = a.loader.useIsLoading(), e = a.loader.useIsInitiallyLoading();
941
989
  if (!a.itemView)
942
990
  return null;
943
- const s = a.items.entries.map((o) => /* @__PURE__ */ n.createElement(fs, { key: o.id, data: o.data, id: o.id })), i = v(ue.items, e && ue.isLoading);
944
- return /* @__PURE__ */ n.createElement("div", { "aria-hidden": t, "aria-busy": e }, /* @__PURE__ */ n.createElement(
945
- G.GridList,
991
+ const s = a.items.entries.map((o) => /* @__PURE__ */ i.createElement(Cs, { key: o.id, data: o.data, id: o.id })), n = w(pt.items, t && pt.isLoading);
992
+ return /* @__PURE__ */ i.createElement("div", { "aria-hidden": e, "aria-busy": t }, /* @__PURE__ */ i.createElement(
993
+ W.GridList,
946
994
  {
947
- className: i,
995
+ className: n,
948
996
  ...a.componentProps,
949
- renderEmptyState: () => /* @__PURE__ */ n.createElement(U, null)
997
+ renderEmptyState: () => /* @__PURE__ */ i.createElement(H, null)
950
998
  },
951
- t ? /* @__PURE__ */ n.createElement(Ss, null) : s
999
+ e ? /* @__PURE__ */ i.createElement(Ls, null) : s
952
1000
  ));
953
- }, Le = (a) => null, vs = () => Le, Pe = (a) => null, ys = () => Pe, ke = (a) => null, Es = () => ke, Ae = (a) => null, Ts = () => Ae, Ve = (a) => null, Fs = () => Ve, Cs = "flow--list--footer", Is = {
954
- footer: Cs
955
- }, Ls = (a) => {
956
- const e = y(b), t = h(), s = t.batches, i = t.loader.useIsInitiallyLoading(), o = t.useIsEmpty(), l = s.getTotalItemsCount(), c = s.getVisibleItemsCount();
1001
+ }, At = (a) => null, Vs = () => At, Bt = (a) => null, ks = () => Bt, Mt = (a) => null, As = () => Mt, Dt = (a) => null, Bs = () => Dt, xt = (a) => null, Ms = () => xt, Ds = "flow--list--footer", xs = {
1002
+ footer: Ds
1003
+ }, Rs = (a) => {
1004
+ const t = y(f), e = g(), s = e.batches, n = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), c = s.getTotalItemsCount(), l = s.getVisibleItemsCount();
957
1005
  if (o)
958
1006
  return null;
959
- const d = i ? /* @__PURE__ */ n.createElement(vt, { width: "200px" }) : e.format("list.paginationInfo", {
960
- visibleItemsCount: c,
961
- totalItemsCount: l
1007
+ const u = n ? /* @__PURE__ */ i.createElement(Ve, { width: "200px" }) : t.format("list.paginationInfo", {
1008
+ visibleItemsCount: l,
1009
+ totalItemsCount: c
962
1010
  });
963
- return /* @__PURE__ */ n.createElement(E, { ...a }, d);
964
- }, Ps = (a) => {
965
- const e = y(b), t = h(), s = t.loader.useIsLoading(), i = t.loader.useIsInitiallyLoading();
966
- return !t.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ n.createElement(
967
- w,
1011
+ return /* @__PURE__ */ i.createElement(E, { ...a }, u);
1012
+ }, Ns = (a) => {
1013
+ const t = y(f), e = g(), s = e.loader.useIsLoading(), n = e.loader.useIsInitiallyLoading();
1014
+ return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ i.createElement(
1015
+ S,
968
1016
  {
969
- isPending: s && !i,
970
- isDisabled: i,
1017
+ isPending: s && !n,
1018
+ isDisabled: n,
971
1019
  ...a,
972
- onPress: () => t.batches.nextBatch(),
1020
+ onPress: () => e.batches.nextBatch(),
973
1021
  variant: "plain",
974
1022
  size: "s"
975
1023
  },
976
- e.format("list.showMore")
1024
+ t.format("list.showMore")
977
1025
  );
978
- }, ks = () => /* @__PURE__ */ n.createElement("div", { className: Is.footer }, /* @__PURE__ */ n.createElement(Ls, null), /* @__PURE__ */ n.createElement(Ps, null));
979
- function Be(a) {
1026
+ }, $s = () => /* @__PURE__ */ i.createElement("div", { className: xs.footer }, /* @__PURE__ */ i.createElement(Rs, null), /* @__PURE__ */ i.createElement(Ns, null));
1027
+ function Rt(a) {
980
1028
  return null;
981
1029
  }
982
- const As = () => Be, Me = (a) => null, xe = (a) => null, Re = (a) => null, Vs = (a) => /* @__PURE__ */ n.createElement(fe, { ...a }, /* @__PURE__ */ n.createElement(be, null, /* @__PURE__ */ n.createElement(Se, null, /* @__PURE__ */ n.createElement(A, { width: "100%" }))), /* @__PURE__ */ n.createElement(we, null, Array.from(Array(5)).map((e, t) => /* @__PURE__ */ n.createElement(ve, { key: t }, /* @__PURE__ */ n.createElement(ye, null, /* @__PURE__ */ n.createElement(A, { width: "100%" })))))), Bs = "flow--list--table", Ms = "flow--list--table--is-loading", xs = "flow--list--table--row", Rs = "flow--list--table--is-selected", Ns = "flow--list--table--has-action", F = {
983
- table: Bs,
984
- isLoading: Ms,
985
- row: xs,
986
- isSelected: Rs,
987
- hasAction: Ns
988
- }, Ds = () => {
989
- const a = h(), e = a.table, t = a.useIsEmpty(), s = a.loader.useIsLoading(), i = a.loader.useIsInitiallyLoading();
990
- if (!e)
1030
+ const zs = () => Rt, Nt = (a) => null, $t = (a) => null, zt = (a) => null, Us = (a) => /* @__PURE__ */ i.createElement(yt, { ...a }, /* @__PURE__ */ i.createElement(wt, null, /* @__PURE__ */ i.createElement(Et, null, /* @__PURE__ */ i.createElement(A, { width: "100%" }))), /* @__PURE__ */ i.createElement(Ft, null, Array.from(Array(5)).map((t, e) => /* @__PURE__ */ i.createElement(Tt, { key: e }, /* @__PURE__ */ i.createElement(Ct, null, /* @__PURE__ */ i.createElement(A, { width: "100%" })))))), Os = "flow--list--table", Ks = "flow--list--table--is-loading", Hs = "flow--list--table--row", qs = "flow--list--table--is-selected", Gs = "flow--list--table--has-action", T = {
1031
+ table: Os,
1032
+ isLoading: Ks,
1033
+ row: Hs,
1034
+ isSelected: qs,
1035
+ hasAction: Gs
1036
+ }, js = () => {
1037
+ const a = g(), t = a.table, e = a.useIsEmpty(), s = a.loader.useIsLoading(), n = a.loader.useIsInitiallyLoading();
1038
+ if (!t)
991
1039
  return null;
992
- if (i)
993
- return /* @__PURE__ */ n.createElement(Vs, { ...e.componentProps });
994
- if (t)
995
- return /* @__PURE__ */ n.createElement(U, null);
996
- const o = e.list.onAction, l = v(
997
- F.table,
998
- s && F.isLoading,
999
- e.componentProps.className
1040
+ if (n)
1041
+ return /* @__PURE__ */ i.createElement(Us, { ...t.componentProps });
1042
+ if (e)
1043
+ return /* @__PURE__ */ i.createElement(H, null);
1044
+ const o = t.list.onAction, c = w(
1045
+ T.table,
1046
+ s && T.isLoading,
1047
+ t.componentProps.className
1000
1048
  );
1001
- return /* @__PURE__ */ n.createElement(
1002
- fe,
1049
+ return /* @__PURE__ */ i.createElement(
1050
+ yt,
1003
1051
  {
1004
1052
  ...a.componentProps,
1005
- ...e.componentProps,
1006
- className: l
1053
+ ...t.componentProps,
1054
+ className: c
1007
1055
  },
1008
- /* @__PURE__ */ n.createElement(be, { ...e.header.componentProps }, e.header.columns.map((c, d) => /* @__PURE__ */ n.createElement(Se, { key: d, ...c.componentProps }))),
1009
- /* @__PURE__ */ n.createElement(
1010
- we,
1056
+ /* @__PURE__ */ i.createElement(wt, { ...t.header.componentProps }, t.header.columns.map((l, u) => /* @__PURE__ */ i.createElement(Et, { key: u, ...l.componentProps }))),
1057
+ /* @__PURE__ */ i.createElement(
1058
+ Ft,
1011
1059
  {
1012
- ...e.body.componentProps,
1013
- renderEmptyState: () => /* @__PURE__ */ n.createElement(U, null)
1060
+ ...t.body.componentProps,
1061
+ renderEmptyState: () => /* @__PURE__ */ i.createElement(H, null)
1014
1062
  },
1015
- a.items.entries.map((c) => {
1016
- var d;
1017
- return /* @__PURE__ */ n.createElement(
1018
- ve,
1063
+ a.items.entries.map((l) => {
1064
+ var u;
1065
+ return /* @__PURE__ */ i.createElement(
1066
+ Tt,
1019
1067
  {
1020
- className: (u) => v(
1021
- F.row,
1022
- o && F.hasAction,
1023
- e.body.row.componentProps.className,
1024
- u.isSelected && F.isSelected
1068
+ className: (d) => w(
1069
+ T.row,
1070
+ o && T.hasAction,
1071
+ t.body.row.componentProps.className,
1072
+ d.isSelected && T.isSelected
1025
1073
  ),
1026
- key: c.id,
1027
- id: c.id,
1028
- onAction: o ? () => o(c.data) : void 0,
1029
- ...e.body.row.componentProps
1074
+ key: l.id,
1075
+ id: l.id,
1076
+ onAction: o ? () => o(l.data) : void 0,
1077
+ ...t.body.row.componentProps
1030
1078
  },
1031
- (d = e.body.row) == null ? void 0 : d.cells.map((u, p) => /* @__PURE__ */ n.createElement(ye, { key: p, ...u.componentProps }, u.renderFn ? u.renderFn(c.data) : void 0))
1079
+ (u = t.body.row) == null ? void 0 : u.cells.map((d, h) => /* @__PURE__ */ i.createElement(Ct, { key: h, ...d.componentProps }, d.renderFn ? d.renderFn(l.data) : void 0))
1032
1080
  );
1033
1081
  })
1034
1082
  )
1035
1083
  );
1036
- }, Ne = (a) => null, De = (a) => null, $e = (a) => null, $s = tt("List", (a) => {
1037
- var J, Y, Q, X, Z, ee, te, se, ae;
1038
- const { children: e, batchSize: t, onChange: s, refProp: i, ...o } = a, l = (J = f(
1039
- e,
1084
+ }, Ut = (a) => null, Ot = (a) => null, Kt = (a) => null, _s = oe("List", (a) => {
1085
+ var X, Z, tt, et, st, it, at, nt, rt;
1086
+ const { children: t, batchSize: e, onChange: s, refProp: n, ...o } = a, c = (X = b(
1087
+ t,
1088
+ At
1089
+ )) == null ? void 0 : X.props, l = (Z = b(
1090
+ t,
1040
1091
  Le
1041
- )) == null ? void 0 : J.props, c = (Y = f(
1042
- e,
1043
- St
1044
- )) == null ? void 0 : Y.props, d = (Q = f(e, Ve)) == null ? void 0 : Q.props, u = {
1045
- source: l ? {
1046
- ...l,
1047
- asyncLoader: l.children
1048
- } : c ? {
1092
+ )) == null ? void 0 : Z.props, u = (tt = b(t, xt)) == null ? void 0 : tt.props, d = {
1093
+ source: c ? {
1049
1094
  ...c,
1050
- asyncResourceFactory: c.children
1051
- } : d ? {
1052
- staticData: d.data
1095
+ asyncLoader: c.children
1096
+ } : l ? {
1097
+ ...l,
1098
+ asyncResourceFactory: l.children
1099
+ } : u ? {
1100
+ staticData: u.data
1053
1101
  } : void 0
1054
- }, p = (X = f(e, Be)) == null ? void 0 : X.props, T = (Z = f(e, Ae)) == null ? void 0 : Z.props, M = (ee = f(e, Ne)) == null ? void 0 : ee.props, C = I(e, Me).map(
1055
- (g) => ({
1056
- ...g.props,
1057
- name: g.props.children
1102
+ }, h = (et = b(t, Rt)) == null ? void 0 : et.props, F = (st = b(t, Dt)) == null ? void 0 : st.props, x = (it = b(t, Ut)) == null ? void 0 : it.props, C = I(t, Nt).map(
1103
+ (p) => ({
1104
+ ...p.props,
1105
+ name: p.props.children
1058
1106
  })
1059
- ), x = I(e, Re).map(
1060
- (g) => ({
1061
- ...g.props,
1062
- renderFn: g.props.children
1107
+ ), R = I(t, zt).map(
1108
+ (p) => ({
1109
+ ...p.props,
1110
+ renderFn: p.props.children
1063
1111
  })
1064
- ), R = (te = f(e, xe)) == null ? void 0 : te.props, S = (se = f(e, De)) == null ? void 0 : se.props, ze = (ae = f(e, $e)) == null ? void 0 : ae.props, N = ds.useNew({
1112
+ ), N = (at = b(t, $t)) == null ? void 0 : at.props, $ = (nt = b(t, Ot)) == null ? void 0 : nt.props, v = (rt = b(t, Kt)) == null ? void 0 : rt.props, z = vs.useNew({
1065
1113
  onChange: s,
1066
- loader: u,
1067
- filters: I(e, Pe).map(
1068
- (g) => ({
1069
- ...g.props,
1070
- renderItem: g.props.children
1114
+ loader: d,
1115
+ filters: I(t, Bt).map(
1116
+ (p) => ({
1117
+ ...p.props,
1118
+ renderItem: p.props.children
1071
1119
  })
1072
1120
  ),
1073
- search: p ? {
1074
- render: p.children,
1075
- textFieldProps: p,
1076
- defaultValue: p.defaultValue
1121
+ search: h ? {
1122
+ render: h.children,
1123
+ textFieldProps: h,
1124
+ defaultValue: h.defaultValue
1077
1125
  } : void 0,
1078
- sorting: I(e, ke).map((g) => g.props),
1079
- itemView: T ? {
1080
- ...T,
1081
- renderFn: T.children
1126
+ sorting: I(t, Mt).map((p) => p.props),
1127
+ itemView: F ? {
1128
+ ...F,
1129
+ renderFn: F.children
1082
1130
  } : void 0,
1083
1131
  table: C.length > 0 ? {
1084
1132
  header: {
1085
- ...S,
1133
+ ...$,
1086
1134
  columns: C
1087
1135
  },
1088
1136
  body: {
1089
- ...ze,
1137
+ ...v,
1090
1138
  row: {
1091
- ...R,
1092
- cells: x
1139
+ ...N,
1140
+ cells: R
1093
1141
  }
1094
1142
  },
1095
- ...M
1143
+ ...x
1096
1144
  } : void 0,
1097
1145
  batchesController: {
1098
- batchSize: t
1146
+ batchSize: e
1099
1147
  },
1100
1148
  ...o
1101
1149
  });
1102
- return /* @__PURE__ */ n.createElement(
1103
- Te.Provider,
1150
+ return /* @__PURE__ */ i.createElement(
1151
+ Lt.Provider,
1104
1152
  {
1105
1153
  value: {
1106
- list: N
1154
+ list: z
1107
1155
  }
1108
1156
  },
1109
- /* @__PURE__ */ n.createElement(Vt, null),
1110
- /* @__PURE__ */ n.createElement("div", { className: _t.list, ref: i }, /* @__PURE__ */ n.createElement(Gt, null), N.viewMode === "list" && /* @__PURE__ */ n.createElement(ws, null), N.viewMode === "table" && /* @__PURE__ */ n.createElement(Ds, null), /* @__PURE__ */ n.createElement(ks, null))
1157
+ /* @__PURE__ */ i.createElement(Ue, null),
1158
+ /* @__PURE__ */ i.createElement("div", { className: is.list, ref: n }, /* @__PURE__ */ i.createElement(es, null), z.viewMode === "list" && /* @__PURE__ */ i.createElement(Ps, null), z.viewMode === "table" && /* @__PURE__ */ i.createElement(js, null), /* @__PURE__ */ i.createElement($s, null))
1111
1159
  );
1112
- }), zs = () => $s, xa = () => ({
1113
- List: zs(),
1114
- Filter: ys(),
1115
- Search: As(),
1116
- Sorting: Es(),
1117
- Item: Ts(),
1118
- ItemView: Ee,
1119
- TableHeader: De,
1120
- TableColumn: Me,
1121
- TableBody: $e,
1122
- TableRow: xe,
1123
- TableCell: Re,
1124
- Table: Ne,
1125
- StaticData: Fs(),
1126
- LoaderAsync: vs(),
1127
- LoaderAsyncResource: wt()
1160
+ }), Ws = () => _s, _i = () => ({
1161
+ List: Ws(),
1162
+ Filter: ks(),
1163
+ Search: zs(),
1164
+ Sorting: As(),
1165
+ Item: Bs(),
1166
+ ItemView: It,
1167
+ TableHeader: Ot,
1168
+ TableColumn: Nt,
1169
+ TableBody: Kt,
1170
+ TableRow: $t,
1171
+ TableCell: zt,
1172
+ Table: Ut,
1173
+ StaticData: Ms(),
1174
+ LoaderAsync: Vs(),
1175
+ LoaderAsyncResource: Pe()
1128
1176
  });
1129
1177
  export {
1130
- $s as List,
1131
- Pe as ListFilter,
1132
- Ae as ListItem,
1133
- Ee as ListItemView,
1134
- Le as ListLoaderAsync,
1135
- ke as ListSorting,
1136
- Ve as ListStaticData,
1137
- zs as TypedList,
1138
- ys as TypedListFilter,
1139
- Ts as TypedListItem,
1140
- vs as TypedListLoaderAsync,
1141
- Es as TypedListSorting,
1142
- Fs as TypedListStaticData,
1143
- xa as typedList,
1144
- h as useList
1178
+ _s as List,
1179
+ Bt as ListFilter,
1180
+ Dt as ListItem,
1181
+ It as ListItemView,
1182
+ At as ListLoaderAsync,
1183
+ Mt as ListSorting,
1184
+ xt as ListStaticData,
1185
+ Ws as TypedList,
1186
+ ks as TypedListFilter,
1187
+ Bs as TypedListItem,
1188
+ Vs as TypedListLoaderAsync,
1189
+ As as TypedListSorting,
1190
+ Ms as TypedListStaticData,
1191
+ _i as typedList,
1192
+ g as useList
1145
1193
  };