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

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