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

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.
Files changed (32) hide show
  1. package/dist/IconSettings-CisOFpPV.js +9 -0
  2. package/dist/Icons.js +100 -99
  3. package/dist/List.js +504 -337
  4. package/dist/Section-DTR9rFAc.js +55 -0
  5. package/dist/Section.js +3 -52
  6. package/dist/Table.js +9 -36
  7. package/dist/TableRow-BAVeHa5X.js +39 -0
  8. package/dist/styles.css +1 -1
  9. package/dist/types/components/List/components/Header/components/SettingsMenu/SettingsMenu.d.ts +3 -0
  10. package/dist/types/components/List/components/Items/components/Item/Item.d.ts +1 -1
  11. package/dist/types/components/List/components/Table/Table.d.ts +3 -0
  12. package/dist/types/components/List/components/Table/components/TableLoadingView.d.ts +4 -0
  13. package/dist/types/components/List/components/Table/index.d.ts +1 -0
  14. package/dist/types/components/List/model/List.d.ts +7 -3
  15. package/dist/types/components/List/model/table/Table.d.ts +12 -0
  16. package/dist/types/components/List/model/table/TableBody.d.ts +10 -0
  17. package/dist/types/components/List/model/table/TableCell.d.ts +9 -0
  18. package/dist/types/components/List/model/table/TableColumn.d.ts +8 -0
  19. package/dist/types/components/List/model/table/TableHeader.d.ts +10 -0
  20. package/dist/types/components/List/model/table/TableRow.d.ts +11 -0
  21. package/dist/types/components/List/model/table/types.d.ts +35 -0
  22. package/dist/types/components/List/model/types.d.ts +3 -0
  23. package/dist/types/components/List/setupComponents/Table.d.ts +7 -0
  24. package/dist/types/components/List/setupComponents/TableBody.d.ts +7 -0
  25. package/dist/types/components/List/setupComponents/TableCell.d.ts +9 -0
  26. package/dist/types/components/List/setupComponents/TableColumn.d.ts +7 -0
  27. package/dist/types/components/List/setupComponents/TableHeader.d.ts +7 -0
  28. package/dist/types/components/List/setupComponents/TableRow.d.ts +7 -0
  29. package/dist/types/components/List/stories/Default.stories.d.ts +1 -0
  30. package/dist/types/components/List/typedList.d.ts +60 -0
  31. package/package.json +4 -4
  32. /package/dist/types/components/List/components/{Items/components/EmptyView → EmptyView}/EmptyView.d.ts +0 -0
package/dist/List.js CHANGED
@@ -1,68 +1,76 @@
1
1
  "use client"
2
2
  /* */
3
- var mt = Object.defineProperty;
4
- var gt = (i, t, e) => t in i ? mt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
5
- var n = (i, t, e) => gt(i, typeof t != "symbol" ? t + "" : t, e);
6
- import r, { createContext as pt, useContext as ft, createElement as J, useState as Y, useEffect as E, useRef as bt, cloneElement as St } from "react";
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";
7
7
  import "./propsContext-DzAKlmhS.js";
8
- import { P as vt } from "./PropsContextProvider-C6Z4XGp6.js";
8
+ import { P as Kt } from "./PropsContextProvider-C6Z4XGp6.js";
9
9
  import "@react-aria/utils";
10
- import { isShallowEqual as yt, unique as wt, times as Et } from "remeda";
11
- import { d as Ft } from "./dynamic-ClpUSmEt.js";
12
- import { B as p } from "./Button-DQtavSbo.js";
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";
13
13
  import "@tabler/icons-react";
14
14
  import "./Icon-DPoIVASu.js";
15
- import { I as Ct } from "./IconContextMenu-jwoVcLvd.js";
16
- import { a as A, C as Q } from "./ContextMenuTrigger-DOCNHDwJ.js";
17
- import { M as X } from "./MenuItem-DcfYvfPJ.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
18
  import { useLocalizedStringFormatter as v } from "react-aria";
19
- import { TunnelProvider as Lt, TunnelExit as U } from "@mittwald/react-tunnel";
20
- import C from "clsx";
21
- import { g as Tt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
- import { f as It } from "./flowComponent-DHPUcYyM.js";
23
- import { R as kt } from "./Render-BdlTa7Qb.js";
24
- import { T as f } from "./Text-Sd5q3Yme.js";
25
- import { I as Z } from "./IconChevronDown--OxZLX8L.js";
26
- import { I as At } from "./IconClose-BFwPT_IX.js";
27
- import { makeObservable as Vt, observable as $, computed as O, action as L } from "mobx";
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";
28
28
  import "./context-Cf7tqFtF.js";
29
- import { u as Bt } from "./useOnChange-C1Quwyuz.js";
30
- import { S as Pt } from "./SearchField-DstUFmq4.js";
31
- import { getProperty as xt } from "dot-prop";
32
- import { hash as Dt } from "object-code";
33
- import { useReactTable as Nt, getCoreRowModel as Rt, getSortedRowModel as Mt, getFilteredRowModel as zt, getPaginationRowModel as Ut, getFacetedUniqueValues as $t } from "@tanstack/react-table";
34
- import tt from "invariant";
35
- import { getAsyncResource as q } from "@mittwald/react-use-promise";
36
- import { u as H } from "./useSelector-DpU7_HMO.js";
37
- import * as V from "react-aria-components";
38
- import { I as Ot } from "./IllustratedMessage-B3MHD01M.js";
39
- import { I as qt } from "./IconSearch-C7VQTAqK.js";
40
- import { H as et } from "./Heading-BEC6iPfF.js";
41
- import { S as K } from "./SkeletonText-B5ZghZhO.js";
42
- import { d as S, a as G } from "./deepFindOfType-6pG0fH7S.js";
43
- import { ListLoaderAsyncResource as Ht, TypedListLoaderAsyncResource as Kt } from "./List/ListLoaderAsyncResource.js";
44
- import { S as Gt } from "./Skeleton-CKLaTmDR.js";
45
- const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title", _t = "flow--list--items--item--view--top-content", Jt = "flow--list--items--item--view--content", Yt = "flow--list--items--item--view--action", Qt = "flow--list--items--item--view--avatar", Xt = "flow--list--items--item--view--text", Zt = "flow--list--items--item--view--heading", d = {
46
- view: jt,
47
- title: Wt,
48
- topContent: _t,
49
- content: Jt,
50
- action: Yt,
51
- avatar: Qt,
52
- text: Xt,
53
- heading: Zt,
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,
54
58
  "container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
55
59
  "container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
56
60
  "container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
57
61
  "container-breakpoint-size-l": "flow--list--items--item--view--container-breakpoint-size-l",
58
62
  "container-breakpoint-size-xl": "flow--list--items--item--view--container-breakpoint-size-xl"
59
- }, g = { "de-DE": {
63
+ }, f = { "de-DE": {
60
64
  "list.noResult.heading": "Keine Suchergebnisse gefunden",
61
65
  "list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
62
66
  "list.options": "Optionen",
63
67
  "list.paginationInfo": (i) => `${i.visibleItemsCount} von insgesamt ${i.totalItemsCount} angezeigt`,
64
68
  "list.resetAll": "Alles zurücksetzen",
65
69
  "list.setSorting": (i) => `Sortierung: ${i.property}`,
70
+ "list.settings": "Einstellungen",
71
+ "list.settings.viewMode": "Ansicht",
72
+ "list.settings.viewMode.list": "Liste",
73
+ "list.settings.viewMode.table": "Tabelle",
66
74
  "list.showMore": "Mehr anzeigen",
67
75
  "list.sorting": "Sortierung"
68
76
  }, "en-EN": {
@@ -72,23 +80,27 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
72
80
  "list.paginationInfo": (i) => `Showing ${i.visibleItemsCount} of ${i.totalItemsCount}`,
73
81
  "list.resetAll": "Reset filters",
74
82
  "list.setSorting": (i) => `Sorting: ${i.property}`,
83
+ "list.settings": "Settings",
84
+ "list.settings.viewMode": "View",
85
+ "list.settings.viewMode.list": "List",
86
+ "list.settings.viewMode.table": "Table",
75
87
  "list.showMore": "Show more",
76
88
  "list.sorting": "Sorting"
77
- } }, te = (i) => {
78
- const { className: t, children: e } = i, s = v(g);
79
- return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(
80
- p,
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,
81
93
  {
82
94
  variant: "plain",
83
95
  className: t,
84
96
  "aria-label": s.format("list.options")
85
97
  },
86
- /* @__PURE__ */ r.createElement(Ct, null)
98
+ /* @__PURE__ */ n.createElement(Jt, null)
87
99
  ), e);
88
- }, ee = (i) => i === "top" ? d.topContent : i === "bottom" ? d.content : d.topContent, st = (i) => {
100
+ }, Pe = (i) => i === "top" ? d.topContent : i === "bottom" ? d.content : d.topContent, St = (i) => {
89
101
  const { children: t, className: e, containerBreakpointSize: s = "m" } = i, a = {
90
102
  ContextMenu: {
91
- wrapWith: /* @__PURE__ */ r.createElement(te, { className: d.action }),
103
+ wrapWith: /* @__PURE__ */ n.createElement(Ae, { className: d.action }),
92
104
  placement: "bottom end"
93
105
  },
94
106
  Button: {
@@ -99,7 +111,7 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
99
111
  ignoreBreakpoint: !0
100
112
  },
101
113
  Content: {
102
- className: Ft((l) => ee(l.slot)),
114
+ className: Wt((l) => Pe(l.slot)),
103
115
  tunnelId: "topContent"
104
116
  },
105
117
  Avatar: {
@@ -118,36 +130,36 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
118
130
  Link: {
119
131
  unstyled: !0
120
132
  }
121
- }, o = C(
133
+ }, o = w(
122
134
  d.view,
123
135
  e,
124
- d[Tt(s)]
136
+ d[Qt(s)]
125
137
  );
126
- return /* @__PURE__ */ r.createElement("div", { className: o }, /* @__PURE__ */ r.createElement(vt, { props: a }, /* @__PURE__ */ r.createElement(Lt, null, t, /* @__PURE__ */ r.createElement("div", { className: d.title }, /* @__PURE__ */ r.createElement(U, { id: "title" })), /* @__PURE__ */ r.createElement(U, { id: "topContent" }))));
127
- }, at = pt({}), m = () => ft(at).list, se = () => m().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(kt, { key: e }, () => {
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 }, () => {
128
140
  t();
129
- })), ae = (i) => {
141
+ })), Ve = (i) => {
130
142
  const { sorting: t } = i;
131
- return /* @__PURE__ */ r.createElement(X, { id: t.id }, t.name);
132
- }, T = (i) => {
143
+ return /* @__PURE__ */ n.createElement(R, { id: t.id }, t.name);
144
+ }, B = (i) => {
133
145
  const { children: t, locales: e, variables: s } = i;
134
146
  return v(e).format(t, s);
135
- }, ie = () => {
136
- const i = m(), t = i.visibleSorting.map((a) => /* @__PURE__ */ r.createElement(ae, { sorting: a, key: a.id }));
147
+ }, Be = () => {
148
+ const i = h(), t = i.visibleSorting.map((a) => /* @__PURE__ */ n.createElement(Ve, { sorting: a, key: a.id }));
137
149
  if (t.length === 0)
138
150
  return null;
139
- const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ r.createElement(f, null, e ? /* @__PURE__ */ r.createElement(
140
- T,
151
+ const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ n.createElement(y, null, e ? /* @__PURE__ */ n.createElement(
152
+ B,
141
153
  {
142
- locales: g,
154
+ locales: f,
143
155
  variables: {
144
156
  property: e.name ?? e.property
145
157
  }
146
158
  },
147
159
  "list.setSorting"
148
- ) : /* @__PURE__ */ r.createElement(T, { locales: g }, "list.sorting"));
149
- return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
150
- Q,
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,
151
163
  {
152
164
  selectionMode: "single",
153
165
  selectedKeys: e ? [e.id] : [],
@@ -157,9 +169,9 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
157
169
  },
158
170
  t
159
171
  ));
160
- }, re = (i) => {
161
- const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */ r.createElement(
162
- X,
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,
163
175
  {
164
176
  id: c.id,
165
177
  key: c.id,
@@ -169,108 +181,129 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
169
181
  },
170
182
  c.render()
171
183
  )), u = e.filter((c) => c.isActive).map((c) => c.id);
172
- return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ r.createElement(f, null, a ?? o), /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
173
- Q,
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,
174
186
  {
175
187
  selectionMode: s === "one" ? "single" : "multiple",
176
188
  selectedKeys: u
177
189
  },
178
190
  l
179
191
  ));
180
- }, ne = "flow--list--header", oe = "flow--list--header--picker-list-and-search", le = "flow--list--header--picker-list", ce = "flow--list--header--search-field", w = {
181
- header: ne,
182
- pickerListAndSearch: oe,
183
- pickerList: le,
184
- searchField: ce
185
- }, ue = "flow--list--header--active-filters", he = "flow--list--header--active-filters--clear-button", j = {
186
- activeFilters: ue,
187
- clearButton: he
188
- }, de = () => {
189
- const i = m(), t = i.filters.flatMap(
190
- (e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ r.createElement(
191
- p,
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
204
  {
193
205
  variant: "soft",
194
206
  size: "s",
195
207
  key: s.id,
196
208
  onPress: () => s.deactivate()
197
209
  },
198
- /* @__PURE__ */ r.createElement(f, null, s.render()),
199
- /* @__PURE__ */ r.createElement(At, null)
210
+ /* @__PURE__ */ n.createElement(y, null, s.render()),
211
+ /* @__PURE__ */ n.createElement(te, null)
200
212
  ))
201
213
  );
202
- return t.length <= 0 ? null : /* @__PURE__ */ r.createElement("div", { className: j.activeFilters }, t, /* @__PURE__ */ r.createElement(
203
- p,
214
+ return t.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className: at.activeFilters }, t, /* @__PURE__ */ n.createElement(
215
+ S,
204
216
  {
205
- className: j.clearButton,
217
+ className: at.clearButton,
206
218
  size: "s",
207
219
  variant: "plain",
208
220
  onPress: () => i.clearFilters()
209
221
  },
210
- /* @__PURE__ */ r.createElement(T, { locales: g }, "list.resetAll")
222
+ /* @__PURE__ */ n.createElement(B, { locales: f }, "list.resetAll")
211
223
  ));
212
- }, me = (i) => {
213
- const { className: t, onChange: e, value: s, ...a } = i, [o, l] = Y(s ?? "");
214
- Bt(s, () => {
224
+ }, Oe = (i) => {
225
+ const { className: t, onChange: e, value: s, ...a } = i, [o, l] = ot(s ?? "");
226
+ ae(s, () => {
215
227
  l(s ?? "");
216
228
  }, [o]);
217
229
  const u = () => {
218
230
  e(void 0), l("");
219
- }, c = (h) => {
220
- h.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : h.key === "Escape" && u();
231
+ }, c = (m) => {
232
+ m.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : m.key === "Escape" && u();
221
233
  };
222
- return /* @__PURE__ */ r.createElement(
223
- Pt,
234
+ return /* @__PURE__ */ n.createElement(
235
+ ie,
224
236
  {
225
237
  className: t,
226
238
  value: o,
227
239
  onKeyUp: c,
228
- onChange: (h) => l(h),
240
+ onChange: (m) => l(m),
229
241
  onClear: u,
230
242
  ...a
231
243
  }
232
244
  );
233
- }, ge = (i) => {
234
- const { className: t, search: e } = i, s = e.render ?? me;
235
- return J(s, {
245
+ }, He = (i) => {
246
+ const { className: t, search: e } = i, s = e.render ?? Oe;
247
+ return rt(s, {
236
248
  className: t,
237
249
  value: e.value,
238
250
  onChange: e.setValue.bind(e),
239
251
  ...e.textFieldProps
240
252
  });
241
- }, pe = (i) => {
242
- const { className: t } = i, e = m();
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,
257
+ {
258
+ variant: "plain",
259
+ color: "secondary",
260
+ "aria-label": i.format("list.settings")
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,
265
+ {
266
+ id: a,
267
+ key: a,
268
+ onAction: () => {
269
+ t.setViewMode(a);
270
+ }
271
+ },
272
+ i.format(`list.settings.viewMode.${a}`)
273
+ )))));
274
+ }), Ke = (i) => {
275
+ const { className: t } = i, e = h();
243
276
  if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
244
277
  return null;
245
- const s = e.filters.map((a) => /* @__PURE__ */ r.createElement(re, { key: a.property, filter: a }));
246
- return /* @__PURE__ */ r.createElement("div", { className: C(t, w.header) }, /* @__PURE__ */ r.createElement("div", { className: w.pickerListAndSearch }, /* @__PURE__ */ r.createElement("div", { className: w.pickerList }, /* @__PURE__ */ r.createElement(ie, null), s), e.search && /* @__PURE__ */ r.createElement(ge, { className: w.searchField, search: e.search })), /* @__PURE__ */ r.createElement(de, null));
247
- }, fe = "flow--list", be = {
248
- list: fe
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
249
282
  };
250
- let Se = class it {
283
+ let _e = class vt {
251
284
  constructor(t, e, s) {
252
- n(this, "id");
253
- n(this, "data");
254
- n(this, "collection");
285
+ r(this, "id");
286
+ r(this, "data");
287
+ r(this, "collection");
255
288
  this.collection = t, this.id = e, this.data = s;
256
289
  }
257
290
  static fromRow(t, e) {
258
- return new it(t, e.id, e.original);
291
+ return new vt(t, e.id, e.original);
259
292
  }
260
293
  };
261
- class ve {
294
+ class We {
262
295
  constructor(t) {
263
- n(this, "list");
296
+ r(this, "list");
264
297
  this.list = t;
265
298
  }
266
299
  get entries() {
267
- return this.list.reactTable.table.getRowModel().rows.map((t) => Se.fromRow(this, t));
300
+ return this.list.reactTable.table.getRowModel().rows.map((t) => _e.fromRow(this, t));
268
301
  }
269
302
  }
270
- class ye {
303
+ class Je {
271
304
  constructor(t, e = {}) {
272
- n(this, "batchSize");
273
- n(this, "list");
305
+ r(this, "batchSize");
306
+ r(this, "list");
274
307
  var a;
275
308
  const { batchSize: s = 20 } = e;
276
309
  this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (a = t.search) == null || a.onUpdated(() => this.reset());
@@ -314,19 +347,19 @@ class ye {
314
347
  }
315
348
  }
316
349
  }
317
- const we = "$";
318
- class W {
350
+ const Ye = "$";
351
+ class it {
319
352
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
320
353
  constructor(t, e) {
321
- n(this, "filter");
322
- n(this, "value");
354
+ r(this, "filter");
355
+ r(this, "value");
323
356
  this.filter = t, this.value = e;
324
357
  }
325
358
  equals(t) {
326
- return yt(this.value, t.value);
359
+ return Gt(this.value, t.value);
327
360
  }
328
361
  get id() {
329
- return `${this.filter.property}@@${Dt(this.value)}`;
362
+ return `${this.filter.property}@@${le(this.value)}`;
330
363
  }
331
364
  get isActive() {
332
365
  return this.filter.isValueActive(this);
@@ -341,27 +374,27 @@ class W {
341
374
  this.filter.deactivateValue(this);
342
375
  }
343
376
  }
344
- const Ee = (i, t) => i === t, Fe = (i) => String(i);
345
- class Ce {
377
+ const Qe = (i, t) => i === t, Xe = (i) => String(i);
378
+ class Ze {
346
379
  constructor(t, e) {
347
- n(this, "_values");
348
- n(this, "_valuesFromTableState");
349
- n(this, "list");
350
- n(this, "property");
351
- n(this, "mode");
352
- n(this, "matcher");
353
- n(this, "renderItem");
354
- n(this, "name");
355
- n(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
380
+ r(this, "_values");
381
+ r(this, "_valuesFromTableState");
382
+ r(this, "list");
383
+ r(this, "property");
384
+ r(this, "mode");
385
+ r(this, "matcher");
386
+ r(this, "renderItem");
387
+ r(this, "name");
388
+ r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
356
389
  var s;
357
- this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((a) => new W(this, a)), this.matcher = e.matcher ?? Ee, this.renderItem = e.renderItem ?? Fe, 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((a) => new it(this, a)), this.matcher = e.matcher ?? Qe, this.renderItem = e.renderItem ?? Xe, this.name = e.name;
358
391
  }
359
392
  updateTableColumnDef(t) {
360
393
  t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
361
394
  }
362
395
  getReactTableFilterFn() {
363
396
  return (t, e, s) => {
364
- const a = this.property, o = a.startsWith(we) ? t.original : xt(t.original, a);
397
+ const a = this.property, o = a.startsWith(Ye) ? t.original : oe(t.original, a);
365
398
  return this.checkFilterMatches(o, s);
366
399
  };
367
400
  }
@@ -389,9 +422,9 @@ class Ce {
389
422
  return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
390
423
  }
391
424
  getValuesFromTableState() {
392
- return wt(
425
+ return jt(
393
426
  Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
394
- ).map((t) => new W(this, t));
427
+ ).map((t) => new it(this, t));
395
428
  }
396
429
  checkIfValueIsUnknown(t) {
397
430
  return !this.values.some((s) => s.id === t.id);
@@ -435,13 +468,13 @@ class Ce {
435
468
  this.onFilterUpdateCallbacks.add(t);
436
469
  }
437
470
  }
438
- class Le {
471
+ class ts {
439
472
  constructor(t, e) {
440
- n(this, "list");
441
- n(this, "property");
442
- n(this, "name");
443
- n(this, "direction");
444
- n(this, "defaultEnabled");
473
+ r(this, "list");
474
+ r(this, "property");
475
+ r(this, "name");
476
+ r(this, "direction");
477
+ r(this, "defaultEnabled");
445
478
  this.list = t, this.property = e.property, this.name = e.name, this.direction = e.direction ?? "asc", this.defaultEnabled = e.defaultEnabled ?? !1;
446
479
  }
447
480
  updateTableColumnDef(t) {
@@ -469,25 +502,25 @@ class Le {
469
502
  return `${this.getTableColumn().id}:${this.direction}`;
470
503
  }
471
504
  }
472
- class B {
505
+ class z {
473
506
  constructor(t, e, s = {}) {
474
- n(this, "list");
475
- n(this, "table");
476
- n(this, "sortingState");
477
- n(this, "updateSortingState");
507
+ r(this, "list");
508
+ r(this, "table");
509
+ r(this, "sortingState");
510
+ r(this, "updateSortingState");
478
511
  this.list = t;
479
512
  const a = this.list.sorting.filter(
480
513
  (u) => u.defaultEnabled !== !1
481
- ), [o, l] = Y(
514
+ ), [o, l] = ot(
482
515
  a.map((u) => u.getReactTableColumnSort())
483
516
  );
484
517
  this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(e, s);
485
518
  }
486
519
  static useNew(t, e, s = {}) {
487
- return new B(t, e, s);
520
+ return new z(t, e, s);
488
521
  }
489
522
  useReactTable(t, e = {}) {
490
- const s = this.list.loader.useData(), a = Nt({
523
+ const s = this.list.loader.useData(), a = ce({
491
524
  data: s,
492
525
  state: {
493
526
  sorting: this.sortingState
@@ -498,18 +531,18 @@ class B {
498
531
  }
499
532
  },
500
533
  columns: this.getTableColumnDefs(),
501
- getCoreRowModel: Rt(),
502
- getSortedRowModel: Mt(),
503
- getFilteredRowModel: zt(),
504
- getPaginationRowModel: Ut(),
505
- getFacetedUniqueValues: $t(),
534
+ getCoreRowModel: ue(),
535
+ getSortedRowModel: me(),
536
+ getFilteredRowModel: de(),
537
+ getPaginationRowModel: he(),
538
+ getFacetedUniqueValues: pe(),
506
539
  onSortingChange: (o) => {
507
540
  this.handleSortingStateUpdate(o);
508
541
  },
509
542
  globalFilterFn: "auto",
510
543
  ...e
511
544
  });
512
- return E(() => {
545
+ return F(() => {
513
546
  t && t(this.list);
514
547
  }, [this.list, t, a]), a;
515
548
  }
@@ -524,7 +557,7 @@ class B {
524
557
  }
525
558
  getTableColumn(t) {
526
559
  const e = this.table.getColumn(t);
527
- return tt(!!e, `Column #${t} is not defined`), e;
560
+ return mt(!!e, `Column #${t} is not defined`), e;
528
561
  }
529
562
  getTableColumnDefs() {
530
563
  const t = /* @__PURE__ */ new Map(), e = (s) => {
@@ -546,26 +579,26 @@ class B {
546
579
  ), Array.from(t.values());
547
580
  }
548
581
  }
549
- class P {
582
+ class U {
550
583
  constructor() {
551
- n(this, "dataBatches", []);
552
- n(this, "prevDataBatches", []);
553
- n(this, "batchLoadingStates", ["void"]);
554
- Vt(this, {
584
+ r(this, "dataBatches", []);
585
+ r(this, "prevDataBatches", []);
586
+ r(this, "batchLoadingStates", ["void"]);
587
+ ee(this, {
555
588
  prevDataBatches: !1,
556
589
  useMergedData: !1,
557
590
  useIsLoading: !1,
558
- dataBatches: $.shallow,
559
- batchLoadingStates: $.shallow,
560
- mergedData: O,
561
- isLoading: O,
562
- reset: L.bound,
563
- setDataBatch: L.bound,
564
- setBatchLoadingState: L.bound
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
565
598
  });
566
599
  }
567
600
  static useNew() {
568
- return bt(new P()).current;
601
+ return lt(new U()).current;
569
602
  }
570
603
  reset() {
571
604
  this.batchLoadingStates = [], this.dataBatches = [];
@@ -580,32 +613,32 @@ class P {
580
613
  return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((e) => e);
581
614
  }
582
615
  useMergedData() {
583
- return H(() => this.mergedData);
616
+ return st(() => this.mergedData);
584
617
  }
585
618
  get isLoading() {
586
619
  return this.batchLoadingStates.some((t) => t === "loading" || t === "void");
587
620
  }
588
621
  useIsLoading() {
589
- return H(() => this.isLoading);
622
+ return st(() => this.isLoading);
590
623
  }
591
624
  }
592
- const Te = [];
593
- class x {
625
+ const es = [];
626
+ class O {
594
627
  constructor(t, e = {}) {
595
- n(this, "list");
596
- n(this, "dataSource");
597
- n(this, "manualSorting");
598
- n(this, "manualFiltering");
599
- n(this, "manualPagination");
600
- n(this, "loaderState");
628
+ r(this, "list");
629
+ r(this, "dataSource");
630
+ r(this, "manualSorting");
631
+ r(this, "manualFiltering");
632
+ r(this, "manualPagination");
633
+ r(this, "loaderState");
601
634
  var u;
602
635
  const { source: s } = e;
603
- this.dataSource = s ?? { staticData: Te };
636
+ this.dataSource = s ?? { staticData: es };
604
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;
605
- this.list = t, this.loaderState = P.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());
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());
606
639
  }
607
640
  static useNew(t, e = {}) {
608
- return new x(t, e);
641
+ return new O(t, e);
609
642
  }
610
643
  reset() {
611
644
  this.loaderState.reset();
@@ -620,7 +653,7 @@ class x {
620
653
  return this.loaderState.useMergedData();
621
654
  }
622
655
  getLoaderInvocationHooks() {
623
- return Et(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
656
+ return _t(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
624
657
  this.useLoadBatch(e);
625
658
  });
626
659
  }
@@ -631,7 +664,7 @@ class x {
631
664
  }), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
632
665
  }
633
666
  useObserveBatchLoadingState(t, e) {
634
- E(() => (this.loaderState.setBatchLoadingState(
667
+ F(() => (this.loaderState.setBatchLoadingState(
635
668
  e,
636
669
  t.state.value
637
670
  ), t.state.observe((s) => {
@@ -643,7 +676,7 @@ class x {
643
676
  const { data: o, itemTotalCount: l } = a;
644
677
  this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
645
678
  };
646
- E(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
679
+ F(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
647
680
  a.isSet && s(a.value);
648
681
  })), [t, e]);
649
682
  }
@@ -671,7 +704,7 @@ class x {
671
704
  getBatchDataAsyncResource(t) {
672
705
  const e = this.dataSource, s = this.getDataLoaderOptions(t);
673
706
  if ("staticData" in e)
674
- return q(
707
+ return et(
675
708
  async (a) => ({
676
709
  data: a,
677
710
  itemTotalCount: a.length
@@ -680,7 +713,7 @@ class x {
680
713
  );
681
714
  if ("asyncLoader" in e) {
682
715
  const a = e.asyncLoader;
683
- return q(a, [s]);
716
+ return et(a, [s]);
684
717
  }
685
718
  if ("asyncResourceFactory" in e) {
686
719
  const a = e.asyncResourceFactory;
@@ -689,12 +722,12 @@ class x {
689
722
  throw new Error("Unknown data source");
690
723
  }
691
724
  }
692
- class Ie {
725
+ class ss {
693
726
  constructor(t, e) {
694
- n(this, "list");
695
- n(this, "render");
696
- n(this, "textFieldProps");
697
- n(this, "onUpdateCallbacks", /* @__PURE__ */ new Set());
727
+ r(this, "list");
728
+ r(this, "render");
729
+ r(this, "textFieldProps");
730
+ r(this, "onUpdateCallbacks", /* @__PURE__ */ new Set());
698
731
  this.list = t, this.render = e.render, this.textFieldProps = e.textFieldProps;
699
732
  }
700
733
  get value() {
@@ -716,51 +749,102 @@ class Ie {
716
749
  this.onUpdateCallbacks.add(t);
717
750
  }
718
751
  }
719
- const F = class F {
752
+ const I = class I {
720
753
  constructor(t, e = {}) {
721
- n(this, "list");
722
- n(this, "textValue");
723
- n(this, "href");
724
- n(this, "onAction");
725
- n(this, "fallback");
726
- n(this, "renderFn");
754
+ r(this, "list");
755
+ r(this, "textValue");
756
+ r(this, "href");
757
+ r(this, "onAction");
758
+ r(this, "fallback");
759
+ r(this, "renderFn");
727
760
  const { onAction: s, fallback: a, textValue: o, href: l, renderFn: u } = e;
728
761
  this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = a;
729
762
  }
730
763
  render(t) {
731
- return (this.renderFn ?? F.fallbackRenderItemFn)(t);
764
+ return (this.renderFn ?? I.fallbackRenderItemFn)(t);
732
765
  }
733
766
  };
734
- n(F, "fallbackRenderItemFn", (t) => J("pre", void 0, JSON.stringify(t)));
735
- let I = F, ke = class rt {
767
+ r(I, "fallbackRenderItemFn", (t) => rt("pre", void 0, JSON.stringify(t)));
768
+ let M = I, as = class {
769
+ constructor(t, e = {}) {
770
+ r(this, "tableHeader");
771
+ r(this, "componentProps");
772
+ this.tableHeader = t, this.componentProps = e;
773
+ }
774
+ }, is = class {
775
+ constructor(t, e = {}) {
776
+ r(this, "table");
777
+ r(this, "componentProps");
778
+ 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
+ }
782
+ }, ns = class {
783
+ constructor(t, e = {}) {
784
+ r(this, "row");
785
+ r(this, "renderFn");
786
+ r(this, "componentProps");
787
+ const { renderFn: s, ...a } = e;
788
+ this.row = t, this.renderFn = s, this.componentProps = a;
789
+ }
790
+ }, rs = class {
791
+ constructor(t, e = {}) {
792
+ r(this, "tableBody");
793
+ r(this, "onAction");
794
+ r(this, "cells");
795
+ 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;
798
+ }
799
+ }, os = class {
800
+ constructor(t, e = {}) {
801
+ r(this, "table");
802
+ r(this, "componentProps");
803
+ r(this, "row");
804
+ const { row: s, ...a } = e;
805
+ this.table = t, this.row = new rs(this, s), this.componentProps = a;
806
+ }
807
+ }, ls = class {
808
+ constructor(t, e = {}) {
809
+ r(this, "list");
810
+ r(this, "header");
811
+ r(this, "body");
812
+ 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;
815
+ }
816
+ }, cs = class yt {
736
817
  constructor(t) {
737
- n(this, "filters");
738
- n(this, "itemView");
739
- n(this, "search");
740
- n(this, "sorting");
741
- n(this, "items");
742
- n(this, "reactTable");
743
- n(this, "batches");
744
- n(this, "loader");
745
- n(this, "hasAction");
818
+ r(this, "filters");
819
+ r(this, "itemView");
820
+ r(this, "table");
821
+ r(this, "search");
822
+ r(this, "sorting");
823
+ r(this, "items");
824
+ r(this, "reactTable");
825
+ r(this, "batches");
826
+ r(this, "loader");
827
+ r(this, "hasAction");
828
+ r(this, "viewMode", "list");
746
829
  const {
747
830
  itemView: e,
748
- filters: s = [],
749
- sorting: a = [],
750
- batchesController: o,
751
- hasAction: l,
752
- onChange: u
831
+ table: s,
832
+ filters: a = [],
833
+ sorting: o = [],
834
+ batchesController: l,
835
+ hasAction: u,
836
+ onChange: c
753
837
  } = t;
754
- this.items = new ve(this), this.filters = s.map((c) => new Ce(this, c)), this.sorting = a.map((c) => new Le(this, c)), this.search = t.search ? new Ie(this, t.search) : void 0, this.itemView = new I(this, e), this.batches = new ye(this, o), this.loader = x.useNew(this, t.loader), this.reactTable = B.useNew(this, u, {
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, {
755
839
  manualFiltering: this.loader.manualFiltering,
756
840
  manualPagination: this.loader.manualPagination,
757
841
  manualSorting: this.loader.manualSorting
758
- }), E(() => {
759
- this.filters.forEach((c) => c.deleteUnknownFilterValues());
760
- }, [this.filters]), this.hasAction = l;
842
+ }), F(() => {
843
+ this.filters.forEach((m) => m.deleteUnknownFilterValues());
844
+ }, [this.filters]), this.hasAction = u, se(this, { viewMode: !0, setViewMode: !0 });
761
845
  }
762
846
  static useNew(t) {
763
- return new rt(t);
847
+ return lt(new yt(t)).current;
764
848
  }
765
849
  get isFiltered() {
766
850
  return this.filters.some((t) => t.isActive()) || !!this.search && this.search.isSet;
@@ -770,7 +854,7 @@ let I = F, ke = class rt {
770
854
  }
771
855
  getSorting(t) {
772
856
  const e = this.sorting.find((s) => s.id === t);
773
- return tt(!!e, `Could not get Sorting (ID: ${t})`), e;
857
+ return mt(!!e, `Could not get Sorting (ID: ${t})`), e;
774
858
  }
775
859
  clearSorting() {
776
860
  return this.sorting.forEach((t) => t.clear());
@@ -782,53 +866,63 @@ let I = F, ke = class rt {
782
866
  useIsEmpty() {
783
867
  return !this.loader.useIsLoading() && this.items.entries.length === 0;
784
868
  }
869
+ setViewMode(t) {
870
+ this.viewMode = t;
871
+ }
785
872
  };
786
- const Ae = "flow--list--items", Ve = "flow--list--items--is-loading", _ = {
787
- items: Ae,
788
- isLoading: Ve
789
- }, Be = "flow--list--items--item", Pe = "flow--list--items--item--has-action", k = {
790
- item: Be,
791
- hasAction: Pe
792
- }, xe = (i) => {
793
- const { data: t, children: e } = i, s = m(), a = s.itemView, 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, h = s.hasAction || !!u || !!c, b = C(k.item, h && k.hasAction);
794
- return /* @__PURE__ */ r.createElement(
795
- V.GridListItem,
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)
882
+ 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);
884
+ return /* @__PURE__ */ n.createElement(
885
+ $.GridListItem,
796
886
  {
797
- className: b,
887
+ className: g,
798
888
  onAction: u,
799
889
  textValue: l,
800
890
  href: c
801
891
  },
802
892
  e ?? a.render(t)
803
893
  );
804
- }, De = (i) => /* @__PURE__ */ r.createElement(V.GridListItem, { textValue: "-", className: k.item }, i.children), Ne = () => {
805
- const i = v(g);
806
- return /* @__PURE__ */ r.createElement(Ot, null, /* @__PURE__ */ r.createElement(qt, null), /* @__PURE__ */ r.createElement(et, null, i.format("list.noResult.heading")), /* @__PURE__ */ r.createElement(f, null, i.format("list.noResult.text")));
807
- }, Re = () => /* @__PURE__ */ r.createElement(st, null, /* @__PURE__ */ r.createElement(et, null, /* @__PURE__ */ r.createElement(K, { width: "200px" })), /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(K, { width: "300px" }))), Me = () => {
808
- const t = m().itemView.fallback ?? /* @__PURE__ */ r.createElement(Re, null);
809
- return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ r.createElement(De, { key: s }, St(t)));
810
- }, ze = (i) => {
811
- const { className: t, ...e } = i, s = m(), a = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), u = s.items.entries.map((h) => /* @__PURE__ */ r.createElement(xe, { key: h.id, data: h.data })), c = C(
812
- _.items,
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)
904
+ 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,
813
907
  t,
814
- a && _.isLoading
908
+ a && nt.isLoading
815
909
  );
816
- return l ? /* @__PURE__ */ r.createElement(Ne, null) : /* @__PURE__ */ r.createElement("div", { "aria-hidden": o, "aria-busy": a }, /* @__PURE__ */ r.createElement(V.GridList, { className: c, ...e }, o ? /* @__PURE__ */ r.createElement(Me, null) : u));
817
- }, nt = (i) => null, Ue = () => nt, ot = (i) => null, $e = () => ot, lt = (i) => null, Oe = () => lt, ct = (i) => null, qe = () => ct, ut = (i) => null, He = () => ut, Ke = "flow--list--footer", Ge = {
818
- footer: Ke
819
- }, je = (i) => {
820
- const t = v(g), e = m(), s = e.batches, a = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
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();
821
915
  if (o)
822
916
  return null;
823
- const c = a ? /* @__PURE__ */ r.createElement(Gt, { width: "200px" }) : t.format("list.paginationInfo", {
917
+ const c = a ? /* @__PURE__ */ n.createElement(we, { width: "200px" }) : t.format("list.paginationInfo", {
824
918
  visibleItemsCount: u,
825
919
  totalItemsCount: l
826
920
  });
827
- return /* @__PURE__ */ r.createElement(f, { ...i }, c);
828
- }, We = (i) => {
829
- const t = v(g), e = m(), s = e.loader.useIsLoading(), a = e.loader.useIsInitiallyLoading();
830
- return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ r.createElement(
831
- p,
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,
832
926
  {
833
927
  isPending: s && !a,
834
928
  isDisabled: a,
@@ -839,86 +933,159 @@ const Ae = "flow--list--items", Ve = "flow--list--items--is-loading", _ = {
839
933
  },
840
934
  t.format("list.showMore")
841
935
  );
842
- }, _e = () => /* @__PURE__ */ r.createElement("div", { className: Ge.footer }, /* @__PURE__ */ r.createElement(je, null), /* @__PURE__ */ r.createElement(We, null));
843
- function ht(i) {
936
+ }, As = () => /* @__PURE__ */ n.createElement("div", { className: Fs.footer }, /* @__PURE__ */ n.createElement(Ls, null), /* @__PURE__ */ n.createElement(Is, null));
937
+ function At(i) {
844
938
  return null;
845
939
  }
846
- const Je = () => ht, Ye = It("List", (i) => {
847
- var D, N, R, M, z;
848
- const { children: t, batchSize: e, onChange: s, ...a } = i, o = (D = S(
849
- t,
850
- nt
851
- )) == null ? void 0 : D.props, l = (N = S(
852
- t,
853
- Ht
854
- )) == null ? void 0 : N.props, u = (R = S(t, ut)) == null ? void 0 : R.props, c = {
855
- source: o ? {
856
- ...o,
857
- asyncLoader: o.children
858
- } : l ? {
859
- ...l,
860
- asyncResourceFactory: l.children
861
- } : u ? {
862
- staticData: u.data
863
- } : void 0
864
- }, h = (M = S(t, ht)) == null ? void 0 : M.props, b = (z = S(t, ct)) == null ? void 0 : z.props, dt = ke.useNew({
865
- onChange: s,
866
- loader: c,
867
- filters: G(t, ot).map(
868
- (y) => ({
869
- ...y.props,
870
- renderItem: y.props.children
871
- })
872
- ),
873
- search: h ? {
874
- render: h.children,
875
- textFieldProps: h
876
- } : void 0,
877
- sorting: G(t, lt).map((y) => y.props),
878
- itemView: b ? {
879
- ...b,
880
- renderFn: b.children
881
- } : void 0,
882
- batchesController: {
883
- batchSize: e
884
- },
885
- hasAction: !!i.onAction
886
- });
887
- return /* @__PURE__ */ r.createElement(
888
- at.Provider,
889
- {
890
- value: {
891
- list: dt
892
- }
893
- },
894
- /* @__PURE__ */ r.createElement(se, null),
895
- /* @__PURE__ */ r.createElement("div", { className: be.list }, /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ze, { ...a }), /* @__PURE__ */ r.createElement(_e, null))
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)
948
+ 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
896
961
  );
897
- }), Qe = () => Ye, Ms = () => ({
898
- List: Qe(),
899
- Filter: $e(),
900
- Search: Je(),
901
- Sorting: Oe(),
902
- Item: qe(),
903
- ItemView: st,
904
- StaticData: He(),
905
- LoaderAsync: Ue(),
906
- LoaderAsyncResource: Kt()
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(
976
+ "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 ? {
993
+ ...l,
994
+ asyncResourceFactory: l.children
995
+ } : u ? {
996
+ staticData: u.data
997
+ } : 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(
999
+ (p) => ({
1000
+ ...p.props,
1001
+ name: p.props.children
1002
+ })
1003
+ ), xt = E(t, Vt).map(
1004
+ (p) => ({
1005
+ ...p.props,
1006
+ renderFn: p.props.children
1007
+ })
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({
1009
+ onChange: s,
1010
+ loader: c,
1011
+ filters: E(t, Ct).map(
1012
+ (p) => ({
1013
+ ...p.props,
1014
+ renderItem: p.props.children
1015
+ })
1016
+ ),
1017
+ search: m ? {
1018
+ render: m.children,
1019
+ textFieldProps: m
1020
+ } : void 0,
1021
+ sorting: E(t, Ft).map(
1022
+ (p) => p.props
1023
+ ),
1024
+ itemView: g ? {
1025
+ ...g,
1026
+ renderFn: g.children
1027
+ } : void 0,
1028
+ table: H.length > 0 ? {
1029
+ header: {
1030
+ ...Dt,
1031
+ columns: H
1032
+ },
1033
+ body: {
1034
+ ...$t,
1035
+ row: {
1036
+ ...Rt,
1037
+ cells: xt
1038
+ }
1039
+ },
1040
+ ...P
1041
+ } : void 0,
1042
+ batchesController: {
1043
+ batchSize: e
1044
+ },
1045
+ hasAction: !!i.onAction
1046
+ });
1047
+ return /* @__PURE__ */ n.createElement(
1048
+ wt.Provider,
1049
+ {
1050
+ value: {
1051
+ list: k
1052
+ }
1053
+ },
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))
1056
+ );
1057
+ })
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()
907
1074
  });
908
1075
  export {
909
- Ye as List,
910
- ot as ListFilter,
911
- ct as ListItem,
912
- st as ListItemView,
913
- nt as ListLoaderAsync,
914
- lt as ListSorting,
915
- ut as ListStaticData,
916
- Qe as TypedList,
917
- $e as TypedListFilter,
918
- qe as TypedListItem,
919
- Ue as TypedListLoaderAsync,
920
- Oe as TypedListSorting,
921
- He as TypedListStaticData,
922
- Ms as typedList,
923
- m as useList
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,
1090
+ h as useList
924
1091
  };