@mittwald/flow-react-components 0.1.0-alpha.210 → 0.1.0-alpha.211

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,60 +1,60 @@
1
1
  "use client"
2
2
  /* */
3
- var zt = Object.defineProperty;
4
- var Ut = (i, t, e) => t in i ? zt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
5
- var r = (i, t, e) => Ut(i, typeof t != "symbol" ? t + "" : t, e);
6
- import n, { createContext as Ot, useContext as Ht, createElement as rt, useState as ot, useEffect as F, useRef as lt, cloneElement as qt } from "react";
3
+ var Ot = Object.defineProperty;
4
+ var Ht = (a, t, e) => t in a ? Ot(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
5
+ var r = (a, t, e) => Ht(a, typeof t != "symbol" ? t + "" : t, e);
6
+ import n, { createContext as qt, useContext as Kt, createElement as ot, useState as lt, useEffect as I, useRef as ct, cloneElement as Gt } from "react";
7
7
  import "./propsContext-DzAKlmhS.js";
8
- import { P as Kt } from "./PropsContextProvider-C6Z4XGp6.js";
8
+ import { P as jt } from "./PropsContextProvider-C6Z4XGp6.js";
9
9
  import "@react-aria/utils";
10
- import { isShallowEqual as Gt, unique as jt, times as _t } from "remeda";
11
- import { d as Wt } from "./dynamic-ClpUSmEt.js";
12
- import { B as S } from "./Button-DQtavSbo.js";
10
+ import { isShallowEqual as _t, unique as Wt, times as Jt } from "remeda";
11
+ import { d as Yt } from "./dynamic-ClpUSmEt.js";
12
+ import { B as v } from "./Button-DQtavSbo.js";
13
13
  import "@tabler/icons-react";
14
14
  import "./Icon-DPoIVASu.js";
15
- import { I as Jt } from "./IconContextMenu-jwoVcLvd.js";
16
- import { a as A, C as x } from "./ContextMenuTrigger-DOCNHDwJ.js";
17
- import { M as R } from "./MenuItem-DcfYvfPJ.js";
18
- import { useLocalizedStringFormatter as v } from "react-aria";
19
- import { TunnelProvider as Yt, TunnelExit as X } from "@mittwald/react-tunnel";
20
- import w from "clsx";
21
- import { g as Qt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
- import { f as Xt } from "./flowComponent-DHPUcYyM.js";
23
- import { R as Zt } from "./Render-BdlTa7Qb.js";
24
- import { T as y } from "./Text-Sd5q3Yme.js";
25
- import { I as ct } from "./IconChevronDown--OxZLX8L.js";
26
- import { I as te } from "./IconClose-BFwPT_IX.js";
27
- import { makeObservable as ee, observable as Z, computed as tt, action as V, makeAutoObservable as se } from "mobx";
15
+ import { I as Qt } from "./IconContextMenu-jwoVcLvd.js";
16
+ import { a as A, C as R } from "./ContextMenuTrigger-DOCNHDwJ.js";
17
+ import { M as D } from "./MenuItem-DcfYvfPJ.js";
18
+ import { useLocalizedStringFormatter as E } from "react-aria";
19
+ import { TunnelProvider as Xt, TunnelExit as Z } from "@mittwald/react-tunnel";
20
+ import y from "clsx";
21
+ import { g as Zt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
+ import { f as te } from "./flowComponent-DHPUcYyM.js";
23
+ import { R as ee } from "./Render-BdlTa7Qb.js";
24
+ import { T } from "./Text-Sd5q3Yme.js";
25
+ import { I as dt } from "./IconChevronDown--OxZLX8L.js";
26
+ import { I as se } from "./IconClose-BFwPT_IX.js";
27
+ import { makeObservable as ae, observable as tt, computed as et, action as B, makeAutoObservable as ie } from "mobx";
28
28
  import "./context-Cf7tqFtF.js";
29
- import { u as ae } from "./useOnChange-C1Quwyuz.js";
30
- import { S as ie } from "./SearchField-DstUFmq4.js";
31
- import { H as D } from "./Heading-BEC6iPfF.js";
32
- import { S as ne } from "./Section-DTR9rFAc.js";
33
- import { I as re } from "./IconSettings-CisOFpPV.js";
34
- import { getProperty as oe } from "dot-prop";
29
+ import { u as ne } from "./useOnChange-C1Quwyuz.js";
30
+ import { S as re } from "./SearchField-DstUFmq4.js";
31
+ import { H as $ } from "./Heading-BEC6iPfF.js";
32
+ import { S as oe } from "./Section-DTR9rFAc.js";
33
+ import { I as le } from "./IconSettings-CisOFpPV.js";
34
+ import { getProperty as ce } from "dot-prop";
35
35
  import { observer as ut } from "mobx-react-lite";
36
- import { hash as le } from "object-code";
37
- import { useReactTable as ce, getCoreRowModel as ue, getSortedRowModel as me, getFilteredRowModel as de, getPaginationRowModel as he, getFacetedUniqueValues as pe } from "@tanstack/react-table";
38
- import mt from "invariant";
39
- import { getAsyncResource as et } from "@mittwald/react-use-promise";
40
- import { u as st } from "./useSelector-DpU7_HMO.js";
41
- import * as $ from "react-aria-components";
42
- import { I as ge } from "./IllustratedMessage-B3MHD01M.js";
43
- import { I as be } from "./IconSearch-C7VQTAqK.js";
44
- import { S as L } from "./SkeletonText-B5ZghZhO.js";
45
- import { d as b, a as E } from "./deepFindOfType-6pG0fH7S.js";
46
- import { ListLoaderAsyncResource as fe, TypedListLoaderAsyncResource as Se } from "./List/ListLoaderAsyncResource.js";
47
- import { S as we } from "./Skeleton-CKLaTmDR.js";
48
- import { T as dt, d as ht, c as pt, a as gt, e as bt, b as ft } from "./TableRow-BAVeHa5X.js";
49
- const ve = "flow--list--items--item--view", ye = "flow--list--items--item--view--title", Ee = "flow--list--items--item--view--top-content", Te = "flow--list--items--item--view--content", Ce = "flow--list--items--item--view--action", Fe = "flow--list--items--item--view--avatar", Le = "flow--list--items--item--view--text", Ie = "flow--list--items--item--view--heading", d = {
50
- view: ve,
51
- title: ye,
52
- topContent: Ee,
53
- content: Te,
54
- action: Ce,
55
- avatar: Fe,
56
- text: Le,
57
- heading: Ie,
36
+ import { hash as mt } from "object-code";
37
+ import { useReactTable as de, getCoreRowModel as ue, getSortedRowModel as me, getFilteredRowModel as he, getPaginationRowModel as pe, getFacetedUniqueValues as ge } from "@tanstack/react-table";
38
+ import ht from "invariant";
39
+ import { getAsyncResource as st } from "@mittwald/react-use-promise";
40
+ import { u as at } from "./useSelector-DpU7_HMO.js";
41
+ import * as z from "react-aria-components";
42
+ import { I as be } from "./IllustratedMessage-B3MHD01M.js";
43
+ import { I as fe } from "./IconSearch-C7VQTAqK.js";
44
+ import { S as P } from "./SkeletonText-B5ZghZhO.js";
45
+ import { d as b, a as C } from "./deepFindOfType-6pG0fH7S.js";
46
+ import { ListLoaderAsyncResource as Se, TypedListLoaderAsyncResource as we } from "./List/ListLoaderAsyncResource.js";
47
+ import { S as ve } from "./Skeleton-CKLaTmDR.js";
48
+ import { T as pt, d as gt, c as bt, a as ft, e as St, b as wt } from "./TableRow-BAVeHa5X.js";
49
+ const ye = "flow--list--items--item--view", Ee = "flow--list--items--item--view--title", Te = "flow--list--items--item--view--top-content", Ce = "flow--list--items--item--view--content", Fe = "flow--list--items--item--view--action", Le = "flow--list--items--item--view--avatar", Ie = "flow--list--items--item--view--text", Pe = "flow--list--items--item--view--heading", m = {
50
+ view: ye,
51
+ title: Ee,
52
+ topContent: Te,
53
+ content: Ce,
54
+ action: Fe,
55
+ avatar: Le,
56
+ text: Ie,
57
+ heading: Pe,
58
58
  "container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
59
59
  "container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
60
60
  "container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
@@ -64,9 +64,9 @@ const ve = "flow--list--items--item--view", ye = "flow--list--items--item--view-
64
64
  "list.noResult.heading": "Keine Suchergebnisse gefunden",
65
65
  "list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
66
66
  "list.options": "Optionen",
67
- "list.paginationInfo": (i) => `${i.visibleItemsCount} von insgesamt ${i.totalItemsCount} angezeigt`,
67
+ "list.paginationInfo": (a) => `${a.visibleItemsCount} von insgesamt ${a.totalItemsCount} angezeigt`,
68
68
  "list.resetAll": "Alles zurücksetzen",
69
- "list.setSorting": (i) => `Sortierung: ${i.property}`,
69
+ "list.setSorting": (a) => `Sortierung: ${a.property}`,
70
70
  "list.settings": "Einstellungen",
71
71
  "list.settings.viewMode": "Ansicht",
72
72
  "list.settings.viewMode.list": "Liste",
@@ -77,79 +77,79 @@ const ve = "flow--list--items--item--view", ye = "flow--list--items--item--view-
77
77
  "list.noResult.heading": "No search results found",
78
78
  "list.noResult.text": "Your search did not return any results. Please adjust the search query or your filters.",
79
79
  "list.options": "Options",
80
- "list.paginationInfo": (i) => `Showing ${i.visibleItemsCount} of ${i.totalItemsCount}`,
80
+ "list.paginationInfo": (a) => `Showing ${a.visibleItemsCount} of ${a.totalItemsCount}`,
81
81
  "list.resetAll": "Reset filters",
82
- "list.setSorting": (i) => `Sorting: ${i.property}`,
82
+ "list.setSorting": (a) => `Sorting: ${a.property}`,
83
83
  "list.settings": "Settings",
84
84
  "list.settings.viewMode": "View",
85
85
  "list.settings.viewMode.list": "List",
86
86
  "list.settings.viewMode.table": "Table",
87
87
  "list.showMore": "Show more",
88
88
  "list.sorting": "Sorting"
89
- } }, Ae = (i) => {
90
- const { className: t, children: e } = i, s = v(f);
89
+ } }, ke = (a) => {
90
+ const { className: t, children: e } = a, s = E(f);
91
91
  return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(
92
- S,
92
+ v,
93
93
  {
94
94
  variant: "plain",
95
95
  className: t,
96
96
  "aria-label": s.format("list.options")
97
97
  },
98
- /* @__PURE__ */ n.createElement(Jt, null)
98
+ /* @__PURE__ */ n.createElement(Qt, null)
99
99
  ), e);
100
- }, Pe = (i) => i === "top" ? d.topContent : i === "bottom" ? d.content : d.topContent, St = (i) => {
101
- const { children: t, className: e, containerBreakpointSize: s = "m" } = i, a = {
100
+ }, Ae = (a) => a === "top" ? m.topContent : a === "bottom" ? m.content : m.topContent, vt = (a) => {
101
+ const { children: t, className: e, containerBreakpointSize: s = "m" } = a, i = {
102
102
  ContextMenu: {
103
- wrapWith: /* @__PURE__ */ n.createElement(Ae, { className: d.action }),
103
+ wrapWith: /* @__PURE__ */ n.createElement(ke, { className: m.action }),
104
104
  placement: "bottom end"
105
105
  },
106
106
  Button: {
107
- className: d.action
107
+ className: m.action
108
108
  },
109
109
  ActionGroup: {
110
- className: d.action,
110
+ className: m.action,
111
111
  ignoreBreakpoint: !0
112
112
  },
113
113
  Content: {
114
- className: Wt((l) => Pe(l.slot)),
114
+ className: Yt((l) => Ae(l.slot)),
115
115
  tunnelId: "topContent"
116
116
  },
117
117
  Avatar: {
118
- className: d.avatar,
118
+ className: m.avatar,
119
119
  tunnelId: "title"
120
120
  },
121
121
  Heading: {
122
- className: d.heading,
122
+ className: m.heading,
123
123
  level: 5,
124
124
  tunnelId: "title"
125
125
  },
126
126
  Text: {
127
- className: d.text,
127
+ className: m.text,
128
128
  tunnelId: "title"
129
129
  },
130
130
  Link: {
131
131
  unstyled: !0
132
132
  }
133
- }, o = w(
134
- d.view,
133
+ }, o = y(
134
+ m.view,
135
135
  e,
136
- d[Qt(s)]
136
+ m[Zt(s)]
137
137
  );
138
- return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(Kt, { props: a }, /* @__PURE__ */ n.createElement(Yt, null, t, /* @__PURE__ */ n.createElement("div", { className: d.title }, /* @__PURE__ */ n.createElement(X, { id: "title" })), /* @__PURE__ */ n.createElement(X, { id: "topContent" }))));
139
- }, wt = Ot({}), h = () => Ht(wt).list, ke = () => h().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(Zt, { key: e }, () => {
138
+ return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(jt, { props: i }, /* @__PURE__ */ n.createElement(Xt, null, t, /* @__PURE__ */ n.createElement("div", { className: m.title }, /* @__PURE__ */ n.createElement(Z, { id: "title" })), /* @__PURE__ */ n.createElement(Z, { id: "topContent" }))));
139
+ }, yt = qt({}), h = () => Kt(yt).list, Ve = () => h().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(ee, { key: e }, () => {
140
140
  t();
141
- })), Ve = (i) => {
142
- const { sorting: t } = i;
143
- return /* @__PURE__ */ n.createElement(R, { id: t.id }, t.name);
144
- }, B = (i) => {
145
- const { children: t, locales: e, variables: s } = i;
146
- return v(e).format(t, s);
147
- }, Be = () => {
148
- const i = h(), t = i.visibleSorting.map((a) => /* @__PURE__ */ n.createElement(Ve, { sorting: a, key: a.id }));
141
+ })), Be = (a) => {
142
+ const { sorting: t } = a;
143
+ return /* @__PURE__ */ n.createElement(D, { id: t.id }, t.name);
144
+ }, M = (a) => {
145
+ const { children: t, locales: e, variables: s } = a;
146
+ return E(e).format(t, s);
147
+ }, Me = () => {
148
+ const a = h(), t = a.visibleSorting.map((i) => /* @__PURE__ */ n.createElement(Be, { sorting: i, key: i.id }));
149
149
  if (t.length === 0)
150
150
  return null;
151
- const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ n.createElement(y, null, e ? /* @__PURE__ */ n.createElement(
152
- B,
151
+ const e = a.visibleSorting.find((i) => i.isSorted()), s = /* @__PURE__ */ n.createElement(T, null, e ? /* @__PURE__ */ n.createElement(
152
+ M,
153
153
  {
154
154
  locales: f,
155
155
  variables: {
@@ -157,21 +157,21 @@ const ve = "flow--list--items--item--view", ye = "flow--list--items--item--view-
157
157
  }
158
158
  },
159
159
  "list.setSorting"
160
- ) : /* @__PURE__ */ n.createElement(B, { locales: f }, "list.sorting"));
161
- return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(S, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ n.createElement(ct, null)), /* @__PURE__ */ n.createElement(
162
- x,
160
+ ) : /* @__PURE__ */ n.createElement(M, { locales: f }, "list.sorting"));
161
+ return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(v, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ n.createElement(dt, null)), /* @__PURE__ */ n.createElement(
162
+ R,
163
163
  {
164
164
  selectionMode: "single",
165
165
  selectedKeys: e ? [e.id] : [],
166
- onAction: (a) => {
167
- i.getSorting(String(a)).enable();
166
+ onAction: (i) => {
167
+ a.getSorting(String(i)).enable();
168
168
  }
169
169
  },
170
170
  t
171
171
  ));
172
- }, Me = (i) => {
173
- const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */ n.createElement(
174
- R,
172
+ }, Ne = (a) => {
173
+ const { filter: t } = a, { values: e, mode: s, name: i, property: o } = t, l = e.map((c) => /* @__PURE__ */ n.createElement(
174
+ D,
175
175
  {
176
176
  id: c.id,
177
177
  key: c.id,
@@ -180,107 +180,107 @@ const ve = "flow--list--items--item--view", ye = "flow--list--items--item--view-
180
180
  }
181
181
  },
182
182
  c.render()
183
- )), u = e.filter((c) => c.isActive).map((c) => c.id);
184
- return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(S, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(y, null, a ?? o), /* @__PURE__ */ n.createElement(ct, null)), /* @__PURE__ */ n.createElement(
185
- x,
183
+ )), d = e.filter((c) => c.isActive).map((c) => c.id);
184
+ return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(v, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(T, null, i ?? o), /* @__PURE__ */ n.createElement(dt, null)), /* @__PURE__ */ n.createElement(
185
+ R,
186
186
  {
187
187
  selectionMode: s === "one" ? "single" : "multiple",
188
- selectedKeys: u
188
+ selectedKeys: d
189
189
  },
190
190
  l
191
191
  ));
192
- }, Ne = "flow--list--header", xe = "flow--list--header--picker-list-and-search", Re = "flow--list--header--picker-list", De = "flow--list--header--search-field", T = {
193
- header: Ne,
194
- pickerListAndSearch: xe,
195
- pickerList: Re,
196
- searchField: De
197
- }, $e = "flow--list--header--active-filters", ze = "flow--list--header--active-filters--clear-button", at = {
198
- activeFilters: $e,
199
- clearButton: ze
200
- }, Ue = () => {
201
- const i = h(), t = i.filters.flatMap(
192
+ }, xe = "flow--list--header", Re = "flow--list--header--picker-list-and-search", De = "flow--list--header--picker-list", $e = "flow--list--header--search-field", F = {
193
+ header: xe,
194
+ pickerListAndSearch: Re,
195
+ pickerList: De,
196
+ searchField: $e
197
+ }, ze = "flow--list--header--active-filters", Ue = "flow--list--header--active-filters--clear-button", it = {
198
+ activeFilters: ze,
199
+ clearButton: Ue
200
+ }, Oe = () => {
201
+ const a = h(), t = a.filters.flatMap(
202
202
  (e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ n.createElement(
203
- S,
203
+ v,
204
204
  {
205
205
  variant: "soft",
206
206
  size: "s",
207
207
  key: s.id,
208
208
  onPress: () => s.deactivate()
209
209
  },
210
- /* @__PURE__ */ n.createElement(y, null, s.render()),
211
- /* @__PURE__ */ n.createElement(te, null)
210
+ /* @__PURE__ */ n.createElement(T, null, s.render()),
211
+ /* @__PURE__ */ n.createElement(se, null)
212
212
  ))
213
213
  );
214
- return t.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className: at.activeFilters }, t, /* @__PURE__ */ n.createElement(
215
- S,
214
+ return t.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className: it.activeFilters }, t, /* @__PURE__ */ n.createElement(
215
+ v,
216
216
  {
217
- className: at.clearButton,
217
+ className: it.clearButton,
218
218
  size: "s",
219
219
  variant: "plain",
220
- onPress: () => i.clearFilters()
220
+ onPress: () => a.clearFilters()
221
221
  },
222
- /* @__PURE__ */ n.createElement(B, { locales: f }, "list.resetAll")
222
+ /* @__PURE__ */ n.createElement(M, { locales: f }, "list.resetAll")
223
223
  ));
224
- }, Oe = (i) => {
225
- const { className: t, onChange: e, value: s, ...a } = i, [o, l] = ot(s ?? "");
226
- ae(s, () => {
224
+ }, He = (a) => {
225
+ const { className: t, onChange: e, value: s, ...i } = a, [o, l] = lt(s ?? "");
226
+ ne(s, () => {
227
227
  l(s ?? "");
228
228
  }, [o]);
229
- const u = () => {
229
+ const d = () => {
230
230
  e(void 0), l("");
231
- }, c = (m) => {
232
- m.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : m.key === "Escape" && u();
231
+ }, c = (u) => {
232
+ u.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : u.key === "Escape" && d();
233
233
  };
234
234
  return /* @__PURE__ */ n.createElement(
235
- ie,
235
+ re,
236
236
  {
237
237
  className: t,
238
238
  value: o,
239
239
  onKeyUp: c,
240
- onChange: (m) => l(m),
241
- onClear: u,
242
- ...a
240
+ onChange: (u) => l(u),
241
+ onClear: d,
242
+ ...i
243
243
  }
244
244
  );
245
- }, He = (i) => {
246
- const { className: t, search: e } = i, s = e.render ?? Oe;
247
- return rt(s, {
245
+ }, qe = (a) => {
246
+ const { className: t, search: e } = a, s = e.render ?? He;
247
+ return ot(s, {
248
248
  className: t,
249
249
  value: e.value,
250
250
  onChange: e.setValue.bind(e),
251
251
  ...e.textFieldProps
252
252
  });
253
- }, qe = ut(() => {
254
- const i = v(f), t = h(), e = t.viewMode, s = [];
253
+ }, Ke = ut(() => {
254
+ const a = E(f), t = h(), e = t.viewMode, s = [];
255
255
  return t.itemView && s.push("list"), t.table && s.push("table"), s.length <= 1 ? null : /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(
256
- S,
256
+ v,
257
257
  {
258
258
  variant: "plain",
259
259
  color: "secondary",
260
- "aria-label": i.format("list.settings")
260
+ "aria-label": a.format("list.settings")
261
261
  },
262
- /* @__PURE__ */ n.createElement(re, null)
263
- ), /* @__PURE__ */ n.createElement(x, { selectionMode: "single", selectedKeys: [e] }, /* @__PURE__ */ n.createElement(ne, null, /* @__PURE__ */ n.createElement(D, null, i.format("list.settings.viewMode")), s.map((a) => /* @__PURE__ */ n.createElement(
264
- R,
262
+ /* @__PURE__ */ n.createElement(le, null)
263
+ ), /* @__PURE__ */ n.createElement(R, { selectionMode: "single", selectedKeys: [e] }, /* @__PURE__ */ n.createElement(oe, null, /* @__PURE__ */ n.createElement($, null, a.format("list.settings.viewMode")), s.map((i) => /* @__PURE__ */ n.createElement(
264
+ D,
265
265
  {
266
- id: a,
267
- key: a,
266
+ id: i,
267
+ key: i,
268
268
  onAction: () => {
269
- t.setViewMode(a);
269
+ t.setViewMode(i);
270
270
  }
271
271
  },
272
- i.format(`list.settings.viewMode.${a}`)
272
+ a.format(`list.settings.viewMode.${i}`)
273
273
  )))));
274
- }), Ke = (i) => {
275
- const { className: t } = i, e = h();
274
+ }), Ge = (a) => {
275
+ const { className: t } = a, e = h();
276
276
  if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
277
277
  return null;
278
- const s = e.filters.map((a) => /* @__PURE__ */ n.createElement(Me, { key: a.property, filter: a }));
279
- return /* @__PURE__ */ n.createElement("div", { className: w(t, T.header) }, /* @__PURE__ */ n.createElement("div", { className: T.pickerListAndSearch }, /* @__PURE__ */ n.createElement("div", { className: T.pickerList }, /* @__PURE__ */ n.createElement(Be, null), s), e.search && /* @__PURE__ */ n.createElement(He, { className: T.searchField, search: e.search }), /* @__PURE__ */ n.createElement(qe, null)), /* @__PURE__ */ n.createElement(Ue, null));
280
- }, Ge = "flow--list", je = {
281
- list: Ge
278
+ const s = e.filters.map((i) => /* @__PURE__ */ n.createElement(Ne, { key: i.property, filter: i }));
279
+ return /* @__PURE__ */ n.createElement("div", { className: y(t, F.header) }, /* @__PURE__ */ n.createElement("div", { className: F.pickerListAndSearch }, /* @__PURE__ */ n.createElement("div", { className: F.pickerList }, /* @__PURE__ */ n.createElement(Me, null), s), e.search && /* @__PURE__ */ n.createElement(qe, { className: F.searchField, search: e.search }), /* @__PURE__ */ n.createElement(Ke, null)), /* @__PURE__ */ n.createElement(Oe, null));
280
+ }, je = "flow--list", _e = {
281
+ list: je
282
282
  };
283
- let _e = class vt {
283
+ let We = class Et {
284
284
  constructor(t, e, s) {
285
285
  r(this, "id");
286
286
  r(this, "data");
@@ -288,25 +288,25 @@ let _e = class vt {
288
288
  this.collection = t, this.id = e, this.data = s;
289
289
  }
290
290
  static fromRow(t, e) {
291
- return new vt(t, e.id, e.original);
291
+ return new Et(t, e.id, e.original);
292
292
  }
293
293
  };
294
- class We {
294
+ class Je {
295
295
  constructor(t) {
296
296
  r(this, "list");
297
297
  this.list = t;
298
298
  }
299
299
  get entries() {
300
- return this.list.reactTable.table.getRowModel().rows.map((t) => _e.fromRow(this, t));
300
+ return this.list.reactTable.table.getRowModel().rows.map((t) => We.fromRow(this, t));
301
301
  }
302
302
  }
303
- class Je {
303
+ class Ye {
304
304
  constructor(t, e = {}) {
305
305
  r(this, "batchSize");
306
306
  r(this, "list");
307
- var a;
307
+ var i;
308
308
  const { batchSize: s = 20 } = e;
309
- this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (a = t.search) == null || a.onUpdated(() => this.reset());
309
+ this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (i = t.search) == null || i.onUpdated(() => this.reset());
310
310
  }
311
311
  get reactTable() {
312
312
  return this.list.reactTable.table;
@@ -347,8 +347,8 @@ class Je {
347
347
  }
348
348
  }
349
349
  }
350
- const Ye = "$";
351
- class it {
350
+ const Qe = "$";
351
+ class nt {
352
352
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
353
353
  constructor(t, e) {
354
354
  r(this, "filter");
@@ -356,10 +356,10 @@ class it {
356
356
  this.filter = t, this.value = e;
357
357
  }
358
358
  equals(t) {
359
- return Gt(this.value, t.value);
359
+ return _t(this.value, t.value);
360
360
  }
361
361
  get id() {
362
- return `${this.filter.property}@@${le(this.value)}`;
362
+ return `${this.filter.property}@@${mt(this.value)}`;
363
363
  }
364
364
  get isActive() {
365
365
  return this.filter.isValueActive(this);
@@ -374,8 +374,8 @@ class it {
374
374
  this.filter.deactivateValue(this);
375
375
  }
376
376
  }
377
- const Qe = (i, t) => i === t, Xe = (i) => String(i);
378
- class Ze {
377
+ const Xe = (a, t) => a === t, Ze = (a) => String(a);
378
+ class ts {
379
379
  constructor(t, e) {
380
380
  r(this, "_values");
381
381
  r(this, "_valuesFromTableState");
@@ -387,28 +387,28 @@ class Ze {
387
387
  r(this, "name");
388
388
  r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
389
389
  var s;
390
- this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((a) => new it(this, a)), this.matcher = e.matcher ?? Qe, this.renderItem = e.renderItem ?? Xe, this.name = e.name;
390
+ this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((i) => new nt(this, i)), this.matcher = e.matcher ?? Xe, this.renderItem = e.renderItem ?? Ze, this.name = e.name;
391
391
  }
392
392
  updateTableColumnDef(t) {
393
393
  t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
394
394
  }
395
395
  getReactTableFilterFn() {
396
396
  return (t, e, s) => {
397
- const a = this.property, o = a.startsWith(Ye) ? t.original : oe(t.original, a);
397
+ const i = this.property, o = i.startsWith(Qe) ? t.original : ce(t.original, i);
398
398
  return this.checkFilterMatches(o, s);
399
399
  };
400
400
  }
401
401
  checkFilterMatches(t, e) {
402
402
  if (e === null)
403
403
  return !0;
404
- const s = (o) => Array.isArray(o) ? o : [o], a = (o) => this.matcher(o.value, t);
404
+ const s = (o) => Array.isArray(o) ? o : [o], i = (o) => this.matcher(o.value, t);
405
405
  if (this.mode === "all")
406
- return s(e).every(a);
406
+ return s(e).every(i);
407
407
  if (this.mode === "some") {
408
408
  const o = s(e);
409
- return o.length === 0 || o.some(a);
409
+ return o.length === 0 || o.some(i);
410
410
  } else if (this.mode === "one")
411
- return a(e);
411
+ return i(e);
412
412
  throw new Error(`Unknown filter mode '${this.mode}'`);
413
413
  }
414
414
  getTableColumnFilter() {
@@ -422,9 +422,9 @@ class Ze {
422
422
  return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
423
423
  }
424
424
  getValuesFromTableState() {
425
- return jt(
425
+ return Wt(
426
426
  Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
427
- ).map((t) => new it(this, t));
427
+ ).map((t) => new nt(this, t));
428
428
  }
429
429
  checkIfValueIsUnknown(t) {
430
430
  return !this.values.some((s) => s.id === t.id);
@@ -453,7 +453,7 @@ class Ze {
453
453
  deactivateValue(t) {
454
454
  const e = this.getArrayValue();
455
455
  let s;
456
- this.mode === "all" || this.mode === "some" ? s = e.filter((a) => !a.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
456
+ this.mode === "all" || this.mode === "some" ? s = e.filter((i) => !i.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
457
457
  }
458
458
  clearValues() {
459
459
  let t;
@@ -462,13 +462,13 @@ class Ze {
462
462
  toggleValue(t) {
463
463
  const e = this.getArrayValue();
464
464
  let s;
465
- this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((a) => !a.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
465
+ this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((i) => !i.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
466
466
  }
467
467
  onFilterUpdated(t) {
468
468
  this.onFilterUpdateCallbacks.add(t);
469
469
  }
470
470
  }
471
- class ts {
471
+ class es {
472
472
  constructor(t, e) {
473
473
  r(this, "list");
474
474
  r(this, "property");
@@ -502,25 +502,25 @@ class ts {
502
502
  return `${this.getTableColumn().id}:${this.direction}`;
503
503
  }
504
504
  }
505
- class z {
505
+ class U {
506
506
  constructor(t, e, s = {}) {
507
507
  r(this, "list");
508
508
  r(this, "table");
509
509
  r(this, "sortingState");
510
510
  r(this, "updateSortingState");
511
511
  this.list = t;
512
- const a = this.list.sorting.filter(
513
- (u) => u.defaultEnabled !== !1
514
- ), [o, l] = ot(
515
- a.map((u) => u.getReactTableColumnSort())
512
+ const i = this.list.sorting.filter(
513
+ (d) => d.defaultEnabled !== !1
514
+ ), [o, l] = lt(
515
+ i.map((d) => d.getReactTableColumnSort())
516
516
  );
517
517
  this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(e, s);
518
518
  }
519
519
  static useNew(t, e, s = {}) {
520
- return new z(t, e, s);
520
+ return new U(t, e, s);
521
521
  }
522
522
  useReactTable(t, e = {}) {
523
- const s = this.list.loader.useData(), a = ce({
523
+ const s = this.list.loader.useData(), i = de({
524
524
  data: s,
525
525
  state: {
526
526
  sorting: this.sortingState
@@ -533,23 +533,23 @@ class z {
533
533
  columns: this.getTableColumnDefs(),
534
534
  getCoreRowModel: ue(),
535
535
  getSortedRowModel: me(),
536
- getFilteredRowModel: de(),
537
- getPaginationRowModel: he(),
538
- getFacetedUniqueValues: pe(),
536
+ getFilteredRowModel: he(),
537
+ getPaginationRowModel: pe(),
538
+ getFacetedUniqueValues: ge(),
539
539
  onSortingChange: (o) => {
540
540
  this.handleSortingStateUpdate(o);
541
541
  },
542
542
  globalFilterFn: "auto",
543
543
  ...e
544
544
  });
545
- return F(() => {
545
+ return I(() => {
546
546
  t && t(this.list);
547
- }, [this.list, t, a]), a;
547
+ }, [this.list, t, i]), i;
548
548
  }
549
549
  handleSortingStateUpdate(t) {
550
550
  const e = typeof t == "function" ? t(this.sortingState) : t, s = this.list.sorting.filter(
551
- (a) => a.defaultEnabled === "hidden" && !e.some((o) => o.id === a.property)
552
- ).map((a) => a.getReactTableColumnSort());
551
+ (i) => i.defaultEnabled === "hidden" && !e.some((o) => o.id === i.property)
552
+ ).map((i) => i.getReactTableColumnSort());
553
553
  this.updateSortingState([...s, ...e]);
554
554
  }
555
555
  get searchString() {
@@ -557,13 +557,13 @@ class z {
557
557
  }
558
558
  getTableColumn(t) {
559
559
  const e = this.table.getColumn(t);
560
- return mt(!!e, `Column #${t} is not defined`), e;
560
+ return ht(!!e, `Column #${t} is not defined`), e;
561
561
  }
562
562
  getTableColumnDefs() {
563
563
  const t = /* @__PURE__ */ new Map(), e = (s) => {
564
- const a = t.get(s);
565
- if (a)
566
- return a;
564
+ const i = t.get(s);
565
+ if (i)
566
+ return i;
567
567
  const o = {
568
568
  id: s,
569
569
  accessorKey: s,
@@ -579,26 +579,26 @@ class z {
579
579
  ), Array.from(t.values());
580
580
  }
581
581
  }
582
- class U {
582
+ class O {
583
583
  constructor() {
584
584
  r(this, "dataBatches", []);
585
585
  r(this, "prevDataBatches", []);
586
586
  r(this, "batchLoadingStates", ["void"]);
587
- ee(this, {
587
+ ae(this, {
588
588
  prevDataBatches: !1,
589
589
  useMergedData: !1,
590
590
  useIsLoading: !1,
591
- dataBatches: Z.shallow,
592
- batchLoadingStates: Z.shallow,
593
- mergedData: tt,
594
- isLoading: tt,
595
- reset: V.bound,
596
- setDataBatch: V.bound,
597
- setBatchLoadingState: V.bound
591
+ dataBatches: tt.shallow,
592
+ batchLoadingStates: tt.shallow,
593
+ mergedData: et,
594
+ isLoading: et,
595
+ reset: B.bound,
596
+ setDataBatch: B.bound,
597
+ setBatchLoadingState: B.bound
598
598
  });
599
599
  }
600
600
  static useNew() {
601
- return lt(new U()).current;
601
+ return ct(new O()).current;
602
602
  }
603
603
  reset() {
604
604
  this.batchLoadingStates = [], this.dataBatches = [];
@@ -613,17 +613,17 @@ class U {
613
613
  return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((e) => e);
614
614
  }
615
615
  useMergedData() {
616
- return st(() => this.mergedData);
616
+ return at(() => this.mergedData);
617
617
  }
618
618
  get isLoading() {
619
619
  return this.batchLoadingStates.some((t) => t === "loading" || t === "void");
620
620
  }
621
621
  useIsLoading() {
622
- return st(() => this.isLoading);
622
+ return at(() => this.isLoading);
623
623
  }
624
624
  }
625
- const es = [];
626
- class O {
625
+ const ss = [];
626
+ class H {
627
627
  constructor(t, e = {}) {
628
628
  r(this, "list");
629
629
  r(this, "dataSource");
@@ -631,14 +631,14 @@ class O {
631
631
  r(this, "manualFiltering");
632
632
  r(this, "manualPagination");
633
633
  r(this, "loaderState");
634
- var u;
634
+ var d;
635
635
  const { source: s } = e;
636
- this.dataSource = s ?? { staticData: es };
637
- const a = "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;
638
- this.list = t, this.loaderState = U.useNew(), this.manualPagination = a ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((c) => c.onFilterUpdated(() => this.reset())), (u = this.list.search) == null || u.onUpdated(() => this.reset());
636
+ this.dataSource = s ?? { staticData: ss };
637
+ 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;
638
+ this.list = t, this.loaderState = O.useNew(), this.manualPagination = i ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((c) => c.onFilterUpdated(() => this.reset())), (d = this.list.search) == null || d.onUpdated(() => this.reset());
639
639
  }
640
640
  static useNew(t, e = {}) {
641
- return new O(t, e);
641
+ return new H(t, e);
642
642
  }
643
643
  reset() {
644
644
  this.loaderState.reset();
@@ -653,7 +653,7 @@ class O {
653
653
  return this.loaderState.useMergedData();
654
654
  }
655
655
  getLoaderInvocationHooks() {
656
- return _t(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
656
+ return Jt(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
657
657
  this.useLoadBatch(e);
658
658
  });
659
659
  }
@@ -664,7 +664,7 @@ class O {
664
664
  }), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
665
665
  }
666
666
  useObserveBatchLoadingState(t, e) {
667
- F(() => (this.loaderState.setBatchLoadingState(
667
+ I(() => (this.loaderState.setBatchLoadingState(
668
668
  e,
669
669
  t.state.value
670
670
  ), t.state.observe((s) => {
@@ -672,12 +672,12 @@ class O {
672
672
  })), [t, e]);
673
673
  }
674
674
  useObserveBatchData(t, e) {
675
- const s = (a) => {
676
- const { data: o, itemTotalCount: l } = a;
675
+ const s = (i) => {
676
+ const { data: o, itemTotalCount: l } = i;
677
677
  this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
678
678
  };
679
- F(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
680
- a.isSet && s(a.value);
679
+ I(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((i) => {
680
+ i.isSet && s(i.value);
681
681
  })), [t, e]);
682
682
  }
683
683
  getDataLoaderOptions(t) {
@@ -704,25 +704,27 @@ class O {
704
704
  getBatchDataAsyncResource(t) {
705
705
  const e = this.dataSource, s = this.getDataLoaderOptions(t);
706
706
  if ("staticData" in e)
707
- return et(
708
- async (a) => ({
709
- data: a,
710
- itemTotalCount: a.length
707
+ return st(
708
+ async (i) => ({
709
+ data: i,
710
+ itemTotalCount: i.length
711
711
  }),
712
712
  [e.staticData]
713
713
  );
714
714
  if ("asyncLoader" in e) {
715
- const a = e.asyncLoader;
716
- return et(a, [s]);
715
+ const i = e.asyncLoader, o = e.dependencies, l = o ? mt(o).toString() : void 0;
716
+ return st(i, [s], {
717
+ loaderId: l
718
+ });
717
719
  }
718
720
  if ("asyncResourceFactory" in e) {
719
- const a = e.asyncResourceFactory;
720
- return a(s);
721
+ const i = e.asyncResourceFactory;
722
+ return i(s);
721
723
  }
722
724
  throw new Error("Unknown data source");
723
725
  }
724
726
  }
725
- class ss {
727
+ class as {
726
728
  constructor(t, e) {
727
729
  r(this, "list");
728
730
  r(this, "render");
@@ -749,71 +751,70 @@ class ss {
749
751
  this.onUpdateCallbacks.add(t);
750
752
  }
751
753
  }
752
- const I = class I {
754
+ const k = class k {
753
755
  constructor(t, e = {}) {
754
756
  r(this, "list");
755
757
  r(this, "textValue");
756
758
  r(this, "href");
757
- r(this, "onAction");
758
759
  r(this, "fallback");
759
760
  r(this, "renderFn");
760
- const { onAction: s, fallback: a, textValue: o, href: l, renderFn: u } = e;
761
- this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = a;
761
+ const { fallback: s, textValue: i, href: o, renderFn: l } = e;
762
+ this.list = t, this.textValue = i, this.renderFn = l, this.href = o, this.fallback = s;
762
763
  }
763
764
  render(t) {
764
- return (this.renderFn ?? I.fallbackRenderItemFn)(t);
765
+ return (this.renderFn ?? k.fallbackRenderItemFn)(t);
765
766
  }
766
767
  };
767
- r(I, "fallbackRenderItemFn", (t) => rt("pre", void 0, JSON.stringify(t)));
768
- let M = I, as = class {
768
+ r(k, "fallbackRenderItemFn", (t) => ot("pre", void 0, JSON.stringify(t)));
769
+ let N = k, is = class {
769
770
  constructor(t, e = {}) {
770
771
  r(this, "tableHeader");
771
772
  r(this, "componentProps");
772
773
  this.tableHeader = t, this.componentProps = e;
773
774
  }
774
- }, is = class {
775
+ }, ns = class {
775
776
  constructor(t, e = {}) {
776
777
  r(this, "table");
777
778
  r(this, "componentProps");
778
779
  r(this, "columns");
779
- const { columns: s = [], ...a } = e;
780
- this.table = t, this.columns = s.map((o) => new as(this, o)), this.componentProps = a;
780
+ const { columns: s = [], ...i } = e;
781
+ this.table = t, this.columns = s.map((o) => new is(this, o)), this.componentProps = i;
781
782
  }
782
- }, ns = class {
783
+ }, rs = class {
783
784
  constructor(t, e = {}) {
784
785
  r(this, "row");
785
786
  r(this, "renderFn");
786
787
  r(this, "componentProps");
787
- const { renderFn: s, ...a } = e;
788
- this.row = t, this.renderFn = s, this.componentProps = a;
788
+ const { renderFn: s, ...i } = e;
789
+ this.row = t, this.renderFn = s, this.componentProps = i;
789
790
  }
790
- }, rs = class {
791
+ }, os = class {
791
792
  constructor(t, e = {}) {
792
793
  r(this, "tableBody");
793
794
  r(this, "onAction");
794
795
  r(this, "cells");
795
796
  r(this, "componentProps");
796
- const { onAction: s, cells: a = [], ...o } = e;
797
- this.tableBody = t, this.onAction = s, this.cells = a.map((l) => new ns(this, l)), this.componentProps = o;
797
+ const { onAction: s, cells: i = [], ...o } = e;
798
+ this.tableBody = t, this.onAction = s, this.cells = i.map((l) => new rs(this, l)), this.componentProps = o;
798
799
  }
799
- }, os = class {
800
+ }, ls = class {
800
801
  constructor(t, e = {}) {
801
802
  r(this, "table");
802
803
  r(this, "componentProps");
803
804
  r(this, "row");
804
- const { row: s, ...a } = e;
805
- this.table = t, this.row = new rs(this, s), this.componentProps = a;
805
+ const { row: s, ...i } = e;
806
+ this.table = t, this.row = new os(this, s), this.componentProps = i;
806
807
  }
807
- }, ls = class {
808
+ }, cs = class {
808
809
  constructor(t, e = {}) {
809
810
  r(this, "list");
810
811
  r(this, "header");
811
812
  r(this, "body");
812
813
  r(this, "componentProps");
813
- const { header: s, body: a, ...o } = e;
814
- this.list = t, this.header = new is(this, s), this.body = new os(this, a), this.componentProps = o;
814
+ const { header: s, body: i, ...o } = e;
815
+ this.list = t, this.header = new ns(this, s), this.body = new ls(this, i), this.componentProps = o;
815
816
  }
816
- }, cs = class yt {
817
+ }, ds = class Tt {
817
818
  constructor(t) {
818
819
  r(this, "filters");
819
820
  r(this, "itemView");
@@ -824,27 +825,31 @@ let M = I, as = class {
824
825
  r(this, "reactTable");
825
826
  r(this, "batches");
826
827
  r(this, "loader");
827
- r(this, "hasAction");
828
+ r(this, "onAction");
829
+ r(this, "componentProps");
828
830
  r(this, "viewMode", "list");
829
831
  const {
830
832
  itemView: e,
831
833
  table: s,
832
- filters: a = [],
834
+ filters: i = [],
833
835
  sorting: o = [],
834
836
  batchesController: l,
835
- hasAction: u,
836
- onChange: c
837
+ onChange: d,
838
+ loader: c,
839
+ search: u,
840
+ onAction: g,
841
+ ...S
837
842
  } = t;
838
- this.items = new We(this), this.filters = a.map((m) => new Ze(this, m)), this.sorting = o.map((m) => new ts(this, m)), this.search = t.search ? new ss(this, t.search) : void 0, this.itemView = e ? new M(this, e) : void 0, this.table = s ? new ls(this, s) : void 0, this.batches = new Je(this, l), this.loader = O.useNew(this, t.loader), this.reactTable = z.useNew(this, c, {
843
+ this.items = new Je(this), this.filters = i.map((w) => new ts(this, w)), this.sorting = o.map((w) => new es(this, w)), this.search = u ? new as(this, u) : void 0, this.itemView = e ? new N(this, e) : void 0, this.table = s ? new cs(this, s) : void 0, this.batches = new Ye(this, l), this.componentProps = S, this.loader = H.useNew(this, c), this.onAction = g, this.reactTable = U.useNew(this, d, {
839
844
  manualFiltering: this.loader.manualFiltering,
840
845
  manualPagination: this.loader.manualPagination,
841
846
  manualSorting: this.loader.manualSorting
842
- }), F(() => {
843
- this.filters.forEach((m) => m.deleteUnknownFilterValues());
844
- }, [this.filters]), this.hasAction = u, se(this, { viewMode: !0, setViewMode: !0 });
847
+ }), I(() => {
848
+ this.filters.forEach((w) => w.deleteUnknownFilterValues());
849
+ }, [this.filters]), ie(this, { viewMode: !0, setViewMode: !0 });
845
850
  }
846
851
  static useNew(t) {
847
- return lt(new yt(t)).current;
852
+ return ct(new Tt(t)).current;
848
853
  }
849
854
  get isFiltered() {
850
855
  return this.filters.some((t) => t.isActive()) || !!this.search && this.search.isSet;
@@ -854,7 +859,7 @@ let M = I, as = class {
854
859
  }
855
860
  getSorting(t) {
856
861
  const e = this.sorting.find((s) => s.id === t);
857
- return mt(!!e, `Could not get Sorting (ID: ${t})`), e;
862
+ return ht(!!e, `Could not get Sorting (ID: ${t})`), e;
858
863
  }
859
864
  clearSorting() {
860
865
  return this.sorting.forEach((t) => t.clear());
@@ -870,222 +875,227 @@ let M = I, as = class {
870
875
  this.viewMode = t;
871
876
  }
872
877
  };
873
- const us = "flow--list--items", ms = "flow--list--items--is-loading", nt = {
878
+ const us = "flow--list--items", ms = "flow--list--items--is-loading", rt = {
874
879
  items: us,
875
880
  isLoading: ms
876
- }, ds = "flow--list--items--item", hs = "flow--list--items--item--has-action", N = {
877
- item: ds,
878
- hasAction: hs
879
- }, ps = (i) => {
880
- const { data: t, children: e } = i, s = h(), a = s.itemView;
881
- if (!a)
881
+ }, hs = "flow--list--items--item", ps = "flow--list--items--item--has-action", x = {
882
+ item: hs,
883
+ hasAction: ps
884
+ }, gs = (a) => {
885
+ const { data: t, children: e } = a, i = h().itemView;
886
+ if (!i)
882
887
  return null;
883
- const o = a.onAction, l = a.textValue ? a.textValue(t) : void 0, u = o ? () => o(t) : void 0, c = a.href ? a.href(t) : void 0, m = s.hasAction || !!u || !!c, g = w(N.item, m && N.hasAction);
888
+ const o = i.list.onAction, l = i.textValue ? i.textValue(t) : void 0, d = i.href ? i.href(t) : void 0, c = !!o || !!d, u = y(x.item, c && x.hasAction);
884
889
  return /* @__PURE__ */ n.createElement(
885
- $.GridListItem,
890
+ z.GridListItem,
886
891
  {
887
- className: g,
888
- onAction: u,
892
+ className: u,
893
+ onAction: () => o && o(t),
889
894
  textValue: l,
890
- href: c
895
+ href: d
891
896
  },
892
- e ?? a.render(t)
897
+ e ?? i.render(t)
893
898
  );
894
- }, gs = (i) => /* @__PURE__ */ n.createElement($.GridListItem, { textValue: "-", className: N.item }, i.children), Et = () => {
895
- const i = v(f);
896
- return /* @__PURE__ */ n.createElement(ge, null, /* @__PURE__ */ n.createElement(be, null), /* @__PURE__ */ n.createElement(D, null, i.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(y, null, i.format("list.noResult.text")));
897
- }, bs = () => /* @__PURE__ */ n.createElement(St, null, /* @__PURE__ */ n.createElement(D, null, /* @__PURE__ */ n.createElement(L, { width: "200px" })), /* @__PURE__ */ n.createElement(y, null, /* @__PURE__ */ n.createElement(L, { width: "300px" }))), fs = () => {
899
+ }, bs = (a) => /* @__PURE__ */ n.createElement(z.GridListItem, { textValue: "-", className: x.item }, a.children), Ct = () => {
900
+ const a = E(f);
901
+ return /* @__PURE__ */ n.createElement(be, null, /* @__PURE__ */ n.createElement(fe, null), /* @__PURE__ */ n.createElement($, null, a.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(T, null, a.format("list.noResult.text")));
902
+ }, fs = () => /* @__PURE__ */ n.createElement(vt, null, /* @__PURE__ */ n.createElement($, null, /* @__PURE__ */ n.createElement(P, { width: "200px" })), /* @__PURE__ */ n.createElement(T, null, /* @__PURE__ */ n.createElement(P, { width: "300px" }))), Ss = () => {
898
903
  var e;
899
- const t = ((e = h().itemView) == null ? void 0 : e.fallback) ?? /* @__PURE__ */ n.createElement(bs, null);
900
- return Array.from(Array(5)).map((s, a) => /* @__PURE__ */ n.createElement(gs, { key: a }, qt(t)));
901
- }, Ss = (i) => {
902
- const { className: t, ...e } = i, s = h(), a = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty();
903
- if (!s.itemView)
904
+ const t = ((e = h().itemView) == null ? void 0 : e.fallback) ?? /* @__PURE__ */ n.createElement(fs, null);
905
+ return Array.from(Array(5)).map((s, i) => /* @__PURE__ */ n.createElement(bs, { key: i }, Gt(t)));
906
+ }, ws = () => {
907
+ const a = h(), t = a.loader.useIsLoading(), e = a.loader.useIsInitiallyLoading(), s = a.useIsEmpty();
908
+ if (!a.itemView)
904
909
  return null;
905
- const u = s.items.entries.map((m) => /* @__PURE__ */ n.createElement(ps, { key: m.id, data: m.data })), c = w(
906
- nt.items,
907
- t,
908
- a && nt.isLoading
909
- );
910
- return l ? /* @__PURE__ */ n.createElement(Et, null) : /* @__PURE__ */ n.createElement("div", { "aria-hidden": o, "aria-busy": a }, /* @__PURE__ */ n.createElement($.GridList, { className: c, ...e }, o ? /* @__PURE__ */ n.createElement(fs, null) : u));
911
- }, Tt = (i) => null, ws = () => Tt, Ct = (i) => null, vs = () => Ct, Ft = (i) => null, ys = () => Ft, Lt = (i) => null, Es = () => Lt, It = (i) => null, Ts = () => It, Cs = "flow--list--footer", Fs = {
912
- footer: Cs
913
- }, Ls = (i) => {
914
- const t = v(f), e = h(), s = e.batches, a = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
910
+ const i = a.items.entries.map((l) => /* @__PURE__ */ n.createElement(gs, { key: l.id, data: l.data })), o = y(rt.items, t && rt.isLoading);
911
+ return s ? /* @__PURE__ */ n.createElement(Ct, null) : /* @__PURE__ */ n.createElement("div", { "aria-hidden": e, "aria-busy": t }, /* @__PURE__ */ n.createElement(z.GridList, { className: o, ...a.componentProps }, e ? /* @__PURE__ */ n.createElement(Ss, null) : i));
912
+ }, Ft = (a) => null, vs = () => Ft, Lt = (a) => null, ys = () => Lt, It = (a) => null, Es = () => It, Pt = (a) => null, Ts = () => Pt, kt = (a) => null, Cs = () => kt, Fs = "flow--list--footer", Ls = {
913
+ footer: Fs
914
+ }, Is = (a) => {
915
+ const t = E(f), e = h(), s = e.batches, i = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), d = s.getVisibleItemsCount();
915
916
  if (o)
916
917
  return null;
917
- const c = a ? /* @__PURE__ */ n.createElement(we, { width: "200px" }) : t.format("list.paginationInfo", {
918
- visibleItemsCount: u,
918
+ const c = i ? /* @__PURE__ */ n.createElement(ve, { width: "200px" }) : t.format("list.paginationInfo", {
919
+ visibleItemsCount: d,
919
920
  totalItemsCount: l
920
921
  });
921
- return /* @__PURE__ */ n.createElement(y, { ...i }, c);
922
- }, Is = (i) => {
923
- const t = v(f), e = h(), s = e.loader.useIsLoading(), a = e.loader.useIsInitiallyLoading();
922
+ return /* @__PURE__ */ n.createElement(T, { ...a }, c);
923
+ }, Ps = (a) => {
924
+ const t = E(f), e = h(), s = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading();
924
925
  return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ n.createElement(
925
- S,
926
+ v,
926
927
  {
927
- isPending: s && !a,
928
- isDisabled: a,
929
- ...i,
928
+ isPending: s && !i,
929
+ isDisabled: i,
930
+ ...a,
930
931
  onPress: () => e.batches.nextBatch(),
931
932
  variant: "plain",
932
933
  size: "s"
933
934
  },
934
935
  t.format("list.showMore")
935
936
  );
936
- }, As = () => /* @__PURE__ */ n.createElement("div", { className: Fs.footer }, /* @__PURE__ */ n.createElement(Ls, null), /* @__PURE__ */ n.createElement(Is, null));
937
- function At(i) {
937
+ }, ks = () => /* @__PURE__ */ n.createElement("div", { className: Ls.footer }, /* @__PURE__ */ n.createElement(Is, null), /* @__PURE__ */ n.createElement(Ps, null));
938
+ function At(a) {
938
939
  return null;
939
940
  }
940
- const Ps = () => At, Pt = (i) => null, kt = (i) => null, Vt = (i) => null, ks = (i) => /* @__PURE__ */ n.createElement(dt, { ...i }, /* @__PURE__ */ n.createElement(ht, null, /* @__PURE__ */ n.createElement(pt, null, /* @__PURE__ */ n.createElement(L, { width: "100%" }))), /* @__PURE__ */ n.createElement(gt, null, Array.from(Array(5)).map((t, e) => /* @__PURE__ */ n.createElement(bt, { key: e }, /* @__PURE__ */ n.createElement(ft, null, /* @__PURE__ */ n.createElement(L, { width: "100%" })))))), Vs = "flow--list--table", Bs = "flow--list--table--is-loading", Ms = "flow--list--table--row", Ns = "flow--list--table--has-action", C = {
941
- table: Vs,
942
- isLoading: Bs,
943
- row: Ms,
944
- hasAction: Ns
945
- }, xs = () => {
946
- const i = h(), t = i.table, e = i.useIsEmpty(), s = i.loader.useIsLoading(), a = i.loader.useIsInitiallyLoading();
941
+ const As = () => At, Vt = (a) => null, Bt = (a) => null, Mt = (a) => null, Vs = (a) => /* @__PURE__ */ n.createElement(pt, { ...a }, /* @__PURE__ */ n.createElement(gt, null, /* @__PURE__ */ n.createElement(bt, null, /* @__PURE__ */ n.createElement(P, { width: "100%" }))), /* @__PURE__ */ n.createElement(ft, null, Array.from(Array(5)).map((t, e) => /* @__PURE__ */ n.createElement(St, { key: e }, /* @__PURE__ */ n.createElement(wt, null, /* @__PURE__ */ n.createElement(P, { width: "100%" })))))), Bs = "flow--list--table", Ms = "flow--list--table--is-loading", Ns = "flow--list--table--row", xs = "flow--list--table--has-action", L = {
942
+ table: Bs,
943
+ isLoading: Ms,
944
+ row: Ns,
945
+ hasAction: xs
946
+ }, Rs = () => {
947
+ const a = h(), t = a.table, e = a.useIsEmpty(), s = a.loader.useIsLoading(), i = a.loader.useIsInitiallyLoading();
947
948
  if (!t)
948
949
  return null;
949
- if (a)
950
- return /* @__PURE__ */ n.createElement(ks, { ...t.componentProps });
950
+ if (i)
951
+ return /* @__PURE__ */ n.createElement(Vs, { ...t.componentProps });
951
952
  if (e)
952
- return /* @__PURE__ */ n.createElement(Et, null);
953
- const o = t.body.row.onAction, l = w(
954
- C.row,
955
- o && C.hasAction,
953
+ return /* @__PURE__ */ n.createElement(Ct, null);
954
+ const o = t.body.row.onAction, l = y(
955
+ L.row,
956
+ o && L.hasAction,
956
957
  t.body.row.componentProps.className
957
- ), u = w(
958
- C.table,
959
- s && C.isLoading,
958
+ ), d = y(
959
+ L.table,
960
+ s && L.isLoading,
960
961
  t.componentProps.className
961
962
  );
962
- return /* @__PURE__ */ n.createElement(dt, { ...t.componentProps, className: u }, /* @__PURE__ */ n.createElement(ht, { ...t.header.componentProps }, t.header.columns.map((c, m) => /* @__PURE__ */ n.createElement(pt, { key: m, ...c.componentProps }))), /* @__PURE__ */ n.createElement(gt, { ...t.body.componentProps }, i.items.entries.map((c) => {
963
- var m;
964
- return /* @__PURE__ */ n.createElement(
965
- bt,
966
- {
967
- className: l,
968
- key: c.id,
969
- onAction: o ? () => o(c.data) : void 0,
970
- ...t.body.row.componentProps
971
- },
972
- (m = t.body.row) == null ? void 0 : m.cells.map((g, P) => /* @__PURE__ */ n.createElement(ft, { key: P, ...g.componentProps }, g.renderFn ? g.renderFn(c.data) : void 0))
973
- );
974
- })));
975
- }, Bt = (i) => null, Mt = (i) => null, Nt = (i) => null, Rs = Xt(
963
+ return /* @__PURE__ */ n.createElement(
964
+ pt,
965
+ {
966
+ ...a.componentProps,
967
+ ...t.componentProps,
968
+ className: d
969
+ },
970
+ /* @__PURE__ */ n.createElement(gt, { ...t.header.componentProps }, t.header.columns.map((c, u) => /* @__PURE__ */ n.createElement(bt, { key: u, ...c.componentProps }))),
971
+ /* @__PURE__ */ n.createElement(ft, { ...t.body.componentProps }, a.items.entries.map((c) => {
972
+ var u;
973
+ return /* @__PURE__ */ n.createElement(
974
+ St,
975
+ {
976
+ className: l,
977
+ key: c.id,
978
+ onAction: o ? () => o(c.data) : void 0,
979
+ ...t.body.row.componentProps
980
+ },
981
+ (u = t.body.row) == null ? void 0 : u.cells.map((g, S) => /* @__PURE__ */ n.createElement(wt, { key: S, ...g.componentProps }, g.renderFn ? g.renderFn(c.data) : void 0))
982
+ );
983
+ }))
984
+ );
985
+ }, Nt = (a) => null, xt = (a) => null, Rt = (a) => null, Ds = te(
976
986
  "List",
977
- ut((i) => {
978
- var q, K, G, j, _, W, J, Y, Q;
979
- const { children: t, batchSize: e, onChange: s, ...a } = i, o = (q = b(
987
+ ut((a) => {
988
+ var K, G, j, _, W, J, Y, Q, X;
989
+ const { children: t, batchSize: e, onChange: s, refProp: i, ...o } = a, l = (K = b(
980
990
  t,
981
- Tt
982
- )) == null ? void 0 : q.props, l = (K = b(
991
+ Ft
992
+ )) == null ? void 0 : K.props, d = (G = b(
983
993
  t,
984
- fe
985
- )) == null ? void 0 : K.props, u = (G = b(
994
+ Se
995
+ )) == null ? void 0 : G.props, c = (j = b(
986
996
  t,
987
- It
988
- )) == null ? void 0 : G.props, c = {
989
- source: o ? {
990
- ...o,
991
- asyncLoader: o.children
992
- } : l ? {
997
+ kt
998
+ )) == null ? void 0 : j.props, u = {
999
+ source: l ? {
993
1000
  ...l,
994
- asyncResourceFactory: l.children
995
- } : u ? {
996
- staticData: u.data
1001
+ asyncLoader: l.children
1002
+ } : d ? {
1003
+ ...d,
1004
+ asyncResourceFactory: d.children
1005
+ } : c ? {
1006
+ staticData: c.data
997
1007
  } : void 0
998
- }, m = (j = b(t, At)) == null ? void 0 : j.props, g = (_ = b(t, Lt)) == null ? void 0 : _.props, P = (W = b(t, Bt)) == null ? void 0 : W.props, H = E(t, Pt).map(
1008
+ }, g = (_ = b(t, At)) == null ? void 0 : _.props, S = (W = b(t, Pt)) == null ? void 0 : W.props, w = (J = b(t, Nt)) == null ? void 0 : J.props, q = C(t, Vt).map(
999
1009
  (p) => ({
1000
1010
  ...p.props,
1001
1011
  name: p.props.children
1002
1012
  })
1003
- ), xt = E(t, Vt).map(
1013
+ ), Dt = C(t, Mt).map(
1004
1014
  (p) => ({
1005
1015
  ...p.props,
1006
1016
  renderFn: p.props.children
1007
1017
  })
1008
- ), Rt = (J = b(t, kt)) == null ? void 0 : J.props, Dt = (Y = b(t, Mt)) == null ? void 0 : Y.props, $t = (Q = b(t, Nt)) == null ? void 0 : Q.props, k = cs.useNew({
1018
+ ), $t = (Y = b(t, Bt)) == null ? void 0 : Y.props, zt = (Q = b(t, xt)) == null ? void 0 : Q.props, Ut = (X = b(t, Rt)) == null ? void 0 : X.props, V = ds.useNew({
1009
1019
  onChange: s,
1010
- loader: c,
1011
- filters: E(t, Ct).map(
1020
+ loader: u,
1021
+ filters: C(t, Lt).map(
1012
1022
  (p) => ({
1013
1023
  ...p.props,
1014
1024
  renderItem: p.props.children
1015
1025
  })
1016
1026
  ),
1017
- search: m ? {
1018
- render: m.children,
1019
- textFieldProps: m
1027
+ search: g ? {
1028
+ render: g.children,
1029
+ textFieldProps: g
1020
1030
  } : void 0,
1021
- sorting: E(t, Ft).map(
1031
+ sorting: C(t, It).map(
1022
1032
  (p) => p.props
1023
1033
  ),
1024
- itemView: g ? {
1025
- ...g,
1026
- renderFn: g.children
1034
+ itemView: S ? {
1035
+ ...S,
1036
+ renderFn: S.children
1027
1037
  } : void 0,
1028
- table: H.length > 0 ? {
1038
+ table: q.length > 0 ? {
1029
1039
  header: {
1030
- ...Dt,
1031
- columns: H
1040
+ ...zt,
1041
+ columns: q
1032
1042
  },
1033
1043
  body: {
1034
- ...$t,
1044
+ ...Ut,
1035
1045
  row: {
1036
- ...Rt,
1037
- cells: xt
1046
+ ...$t,
1047
+ cells: Dt
1038
1048
  }
1039
1049
  },
1040
- ...P
1050
+ ...w
1041
1051
  } : void 0,
1042
1052
  batchesController: {
1043
1053
  batchSize: e
1044
1054
  },
1045
- hasAction: !!i.onAction
1055
+ ...o
1046
1056
  });
1047
1057
  return /* @__PURE__ */ n.createElement(
1048
- wt.Provider,
1058
+ yt.Provider,
1049
1059
  {
1050
1060
  value: {
1051
- list: k
1061
+ list: V
1052
1062
  }
1053
1063
  },
1054
- /* @__PURE__ */ n.createElement(ke, null),
1055
- /* @__PURE__ */ n.createElement("div", { className: je.list }, /* @__PURE__ */ n.createElement(Ke, null), k.viewMode === "list" && /* @__PURE__ */ n.createElement(Ss, { ...a }), k.viewMode === "table" && /* @__PURE__ */ n.createElement(xs, null), /* @__PURE__ */ n.createElement(As, null))
1064
+ /* @__PURE__ */ n.createElement(Ve, null),
1065
+ /* @__PURE__ */ n.createElement("div", { className: _e.list, ref: i }, /* @__PURE__ */ n.createElement(Ge, null), V.viewMode === "list" && /* @__PURE__ */ n.createElement(ws, null), V.viewMode === "table" && /* @__PURE__ */ n.createElement(Rs, null), /* @__PURE__ */ n.createElement(ks, null))
1056
1066
  );
1057
1067
  })
1058
- ), Ds = () => Rs, Ma = () => ({
1059
- List: Ds(),
1060
- Filter: vs(),
1061
- Search: Ps(),
1062
- Sorting: ys(),
1063
- Item: Es(),
1064
- ItemView: St,
1065
- TableHeader: Mt,
1066
- TableColumn: Pt,
1067
- TableBody: Nt,
1068
- TableRow: kt,
1069
- TableCell: Vt,
1070
- Table: Bt,
1071
- StaticData: Ts(),
1072
- LoaderAsync: ws(),
1073
- LoaderAsyncResource: Se()
1068
+ ), $s = () => Ds, Na = () => ({
1069
+ List: $s(),
1070
+ Filter: ys(),
1071
+ Search: As(),
1072
+ Sorting: Es(),
1073
+ Item: Ts(),
1074
+ ItemView: vt,
1075
+ TableHeader: xt,
1076
+ TableColumn: Vt,
1077
+ TableBody: Rt,
1078
+ TableRow: Bt,
1079
+ TableCell: Mt,
1080
+ Table: Nt,
1081
+ StaticData: Cs(),
1082
+ LoaderAsync: vs(),
1083
+ LoaderAsyncResource: we()
1074
1084
  });
1075
1085
  export {
1076
- Rs as List,
1077
- Ct as ListFilter,
1078
- Lt as ListItem,
1079
- St as ListItemView,
1080
- Tt as ListLoaderAsync,
1081
- Ft as ListSorting,
1082
- It as ListStaticData,
1083
- Ds as TypedList,
1084
- vs as TypedListFilter,
1085
- Es as TypedListItem,
1086
- ws as TypedListLoaderAsync,
1087
- ys as TypedListSorting,
1088
- Ts as TypedListStaticData,
1089
- Ma as typedList,
1086
+ Ds as List,
1087
+ Lt as ListFilter,
1088
+ Pt as ListItem,
1089
+ vt as ListItemView,
1090
+ Ft as ListLoaderAsync,
1091
+ It as ListSorting,
1092
+ kt as ListStaticData,
1093
+ $s as TypedList,
1094
+ ys as TypedListFilter,
1095
+ Ts as TypedListItem,
1096
+ vs as TypedListLoaderAsync,
1097
+ Es as TypedListSorting,
1098
+ Cs as TypedListStaticData,
1099
+ Na as typedList,
1090
1100
  h as useList
1091
1101
  };