@mittwald/flow-react-components 0.1.0-alpha.190 → 0.1.0-alpha.191

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,9 +1,9 @@
1
1
  "use client"
2
2
  /* */
3
- var ht = Object.defineProperty;
4
- var mt = (i, t, e) => t in i ? ht(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
5
- var r = (i, t, e) => mt(i, typeof t != "symbol" ? t + "" : t, e);
6
- import n, { createContext as dt, useContext as gt, createElement as Y, useState as pt, useEffect as L, useRef as ft, cloneElement as bt } from "react";
3
+ var mt = Object.defineProperty;
4
+ var ht = (a, t, e) => t in a ? mt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
5
+ var r = (a, t, e) => ht(a, typeof t != "symbol" ? t + "" : t, e);
6
+ import n, { createContext as gt, useContext as pt, createElement as Y, useState as Q, useRef as ft, useEffect as z, cloneElement as bt } from "react";
7
7
  import "./propsContext-DzAKlmhS.js";
8
8
  import { P as St } from "./PropsContextProvider-C6Z4XGp6.js";
9
9
  import "@react-aria/utils";
@@ -13,8 +13,8 @@ import { B as p } from "./Button-CVDWL-od.js";
13
13
  import "@tabler/icons-react";
14
14
  import "./Icon-CUhvR1IT.js";
15
15
  import { I as Ct } from "./IconContextMenu-C9_95BDt.js";
16
- import { a as A, C as Q } from "./ContextMenuTrigger-CvljOFns.js";
17
- import { M as X } from "./MenuItem-DaY0bRCQ.js";
16
+ import { a as k, C as X } from "./ContextMenuTrigger-CvljOFns.js";
17
+ import { M as Z } from "./MenuItem-DaY0bRCQ.js";
18
18
  import { useLocalizedStringFormatter as S } from "react-aria";
19
19
  import { TunnelProvider as Ft, TunnelExit as $ } from "@mittwald/react-tunnel";
20
20
  import E from "clsx";
@@ -22,35 +22,34 @@ import { g as Lt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
22
  import { f as Tt } from "./flowComponent-COVzhVCB.js";
23
23
  import { R as It } from "./Render-BdlTa7Qb.js";
24
24
  import { T as f } from "./Text-DQmfbsPC.js";
25
- import { I as Z } from "./IconChevronDown-0Qm5hGlw.js";
25
+ import { I as _ } from "./IconChevronDown-0Qm5hGlw.js";
26
26
  import { I as kt } from "./IconClose-BHf4btna.js";
27
- import { autorun as At, runInAction as xt, toJS as Bt, makeObservable as Pt, observable as U, computed as O, action as F } from "mobx";
27
+ import { makeObservable as At, observable as U, computed as O, action as F } from "mobx";
28
28
  import "./context-BB3_MApL.js";
29
- import { u as Dt } from "./useOnChange-C1Quwyuz.js";
30
- import { S as Vt } from "./SearchField-Dbr_5Zy4.js";
31
- import { getProperty as Nt } from "dot-prop";
32
- import { hash as Rt } from "object-code";
33
- import { useReactTable as zt, getCoreRowModel as Mt, getSortedRowModel as $t, getFilteredRowModel as Ut, getPaginationRowModel as Ot, getFacetedUniqueValues as qt } from "@tanstack/react-table";
34
- import _ from "invariant";
35
- import { useLocalObservable as Ht } from "mobx-react-lite";
29
+ import { u as xt } from "./useOnChange-C1Quwyuz.js";
30
+ import { S as Bt } from "./SearchField-Dbr_5Zy4.js";
31
+ import { getProperty as Pt } from "dot-prop";
32
+ import { hash as Dt } from "object-code";
33
+ import { useReactTable as Vt, getCoreRowModel as Nt, getSortedRowModel as Rt, getFilteredRowModel as Mt, getPaginationRowModel as zt, getFacetedUniqueValues as $t } from "@tanstack/react-table";
34
+ import tt from "invariant";
36
35
  import { getAsyncResource as q } from "@mittwald/react-use-promise";
37
36
  import { u as H } from "./useSelector-DpU7_HMO.js";
38
- import * as x from "react-aria-components";
39
- import { I as Kt } from "./IllustratedMessage-B3MHD01M.js";
40
- import { I as Gt } from "./IconSearch-D6QHaNuF.js";
41
- import { H as tt } from "./Heading-BzwQly28.js";
37
+ import * as A from "react-aria-components";
38
+ import { I as Ut } from "./IllustratedMessage-B3MHD01M.js";
39
+ import { I as Ot } from "./IconSearch-D6QHaNuF.js";
40
+ import { H as et } from "./Heading-BzwQly28.js";
42
41
  import { d as b, a as K } from "./deepFindOfType-6pG0fH7S.js";
43
- import { ListLoaderAsyncResource as jt, TypedListLoaderAsyncResource as Jt } from "./List/ListLoaderAsyncResource.js";
44
- import { S as Wt } from "./Skeleton-CKLaTmDR.js";
45
- const Yt = "flow--list--items--item--view", Qt = "flow--list--items--item--view--title", Xt = "flow--list--items--item--view--top-content", Zt = "flow--list--items--item--view--content", _t = "flow--list--items--item--view--action", te = "flow--list--items--item--view--avatar", ee = "flow--list--items--item--view--text", se = "flow--list--items--item--view--heading", m = {
46
- view: Yt,
47
- title: Qt,
48
- topContent: Xt,
49
- content: Zt,
50
- action: _t,
51
- avatar: te,
52
- text: ee,
53
- heading: se,
42
+ import { ListLoaderAsyncResource as qt, TypedListLoaderAsyncResource as Ht } from "./List/ListLoaderAsyncResource.js";
43
+ import { S as Kt } from "./Skeleton-CKLaTmDR.js";
44
+ const Gt = "flow--list--items--item--view", jt = "flow--list--items--item--view--title", Wt = "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", m = {
45
+ view: Gt,
46
+ title: jt,
47
+ topContent: Wt,
48
+ content: Jt,
49
+ action: Yt,
50
+ avatar: Qt,
51
+ text: Xt,
52
+ heading: Zt,
54
53
  "container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
55
54
  "container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
56
55
  "container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
@@ -60,23 +59,23 @@ const Yt = "flow--list--items--item--view", Qt = "flow--list--items--item--view-
60
59
  "list.noResult.heading": "Keine Suchergebnisse gefunden",
61
60
  "list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
62
61
  "list.options": "Optionen",
63
- "list.paginationInfo": (i) => `${i.visibleItemsCount} von insgesamt ${i.totalItemsCount} angezeigt`,
62
+ "list.paginationInfo": (a) => `${a.visibleItemsCount} von insgesamt ${a.totalItemsCount} angezeigt`,
64
63
  "list.resetAll": "Alles zurücksetzen",
65
- "list.setSorting": (i) => `Sortierung: ${i.property}`,
64
+ "list.setSorting": (a) => `Sortierung: ${a.property}`,
66
65
  "list.showMore": "Mehr anzeigen",
67
66
  "list.sorting": "Sortierung"
68
67
  }, "en-EN": {
69
68
  "list.noResult.heading": "No search results found",
70
69
  "list.noResult.text": "Your search did not return any results. Please adjust the search query or your filters.",
71
70
  "list.options": "Options",
72
- "list.paginationInfo": (i) => `Showing ${i.visibleItemsCount} of ${i.totalItemsCount}`,
71
+ "list.paginationInfo": (a) => `Showing ${a.visibleItemsCount} of ${a.totalItemsCount}`,
73
72
  "list.resetAll": "Reset filters",
74
- "list.setSorting": (i) => `Sorting: ${i.property}`,
73
+ "list.setSorting": (a) => `Sorting: ${a.property}`,
75
74
  "list.showMore": "Show more",
76
75
  "list.sorting": "Sorting"
77
- } }, ae = (i) => {
78
- const { className: t, children: e } = i, s = S(g);
79
- return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(
76
+ } }, _t = (a) => {
77
+ const { className: t, children: e } = a, s = S(g);
78
+ return /* @__PURE__ */ n.createElement(k, null, /* @__PURE__ */ n.createElement(
80
79
  p,
81
80
  {
82
81
  variant: "plain",
@@ -85,17 +84,17 @@ const Yt = "flow--list--items--item--view", Qt = "flow--list--items--item--view-
85
84
  },
86
85
  /* @__PURE__ */ n.createElement(Ct, null)
87
86
  ), e);
88
- }, ie = (i) => i === "top" ? m.topContent : i === "bottom" ? m.content : m.topContent, et = (i) => {
89
- const { children: t, className: e, containerBreakpointSize: s = "m" } = i, a = {
87
+ }, te = (a) => a === "top" ? m.topContent : a === "bottom" ? m.content : m.topContent, st = (a) => {
88
+ const { children: t, className: e, containerBreakpointSize: s = "m" } = a, i = {
90
89
  ContextMenu: {
91
- wrapWith: /* @__PURE__ */ n.createElement(ae, { className: m.action }),
90
+ wrapWith: /* @__PURE__ */ n.createElement(_t, { className: m.action }),
92
91
  placement: "bottom end"
93
92
  },
94
93
  Button: {
95
94
  className: m.action
96
95
  },
97
96
  Content: {
98
- className: Et((l) => ie(l.slot)),
97
+ className: Et((l) => te(l.slot)),
99
98
  tunnelId: "topContent"
100
99
  },
101
100
  Avatar: {
@@ -119,21 +118,21 @@ const Yt = "flow--list--items--item--view", Qt = "flow--list--items--item--view-
119
118
  e,
120
119
  m[Lt(s)]
121
120
  );
122
- return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(St, { props: a }, /* @__PURE__ */ n.createElement(Ft, null, t, /* @__PURE__ */ n.createElement("div", { className: m.title }, /* @__PURE__ */ n.createElement($, { id: "title" })), /* @__PURE__ */ n.createElement($, { id: "topContent" }))));
123
- }, st = dt({}), d = () => gt(st).list, ne = () => d().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(It, { key: e }, () => {
121
+ return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(St, { props: i }, /* @__PURE__ */ n.createElement(Ft, null, t, /* @__PURE__ */ n.createElement("div", { className: m.title }, /* @__PURE__ */ n.createElement($, { id: "title" })), /* @__PURE__ */ n.createElement($, { id: "topContent" }))));
122
+ }, it = gt({}), h = () => pt(it).list, ee = () => h().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(It, { key: e }, () => {
124
123
  t();
125
- })), re = (i) => {
126
- const { sorting: t } = i;
127
- return /* @__PURE__ */ n.createElement(X, { id: t.id }, t.name);
128
- }, T = (i) => {
129
- const { children: t, locales: e, variables: s } = i;
124
+ })), se = (a) => {
125
+ const { sorting: t } = a;
126
+ return /* @__PURE__ */ n.createElement(Z, { id: t.id }, t.name);
127
+ }, L = (a) => {
128
+ const { children: t, locales: e, variables: s } = a;
130
129
  return S(e).format(t, s);
131
- }, oe = () => {
132
- const i = d(), t = i.visibleSorting.map((a) => /* @__PURE__ */ n.createElement(re, { sorting: a, key: a.id }));
130
+ }, ie = () => {
131
+ const a = h(), t = a.visibleSorting.map((i) => /* @__PURE__ */ n.createElement(se, { sorting: i, key: i.id }));
133
132
  if (t.length === 0)
134
133
  return null;
135
- const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ n.createElement(f, null, e ? /* @__PURE__ */ n.createElement(
136
- T,
134
+ const e = a.visibleSorting.find((i) => i.isSorted()), s = /* @__PURE__ */ n.createElement(f, null, e ? /* @__PURE__ */ n.createElement(
135
+ L,
137
136
  {
138
137
  locales: g,
139
138
  variables: {
@@ -141,21 +140,21 @@ const Yt = "flow--list--items--item--view", Qt = "flow--list--items--item--view-
141
140
  }
142
141
  },
143
142
  "list.setSorting"
144
- ) : /* @__PURE__ */ n.createElement(T, { locales: g }, "list.sorting"));
145
- return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ n.createElement(Z, null)), /* @__PURE__ */ n.createElement(
146
- Q,
143
+ ) : /* @__PURE__ */ n.createElement(L, { locales: g }, "list.sorting"));
144
+ return /* @__PURE__ */ n.createElement(k, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ n.createElement(_, null)), /* @__PURE__ */ n.createElement(
145
+ X,
147
146
  {
148
147
  selectionMode: "single",
149
148
  selectedKeys: e ? [e.id] : [],
150
- onAction: (a) => {
151
- i.getSorting(String(a)).enable();
149
+ onAction: (i) => {
150
+ a.getSorting(String(i)).enable();
152
151
  }
153
152
  },
154
153
  t
155
154
  ));
156
- }, le = (i) => {
157
- const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */ n.createElement(
158
- X,
155
+ }, ae = (a) => {
156
+ const { filter: t } = a, { values: e, mode: s, name: i, property: o } = t, l = e.map((c) => /* @__PURE__ */ n.createElement(
157
+ Z,
159
158
  {
160
159
  id: c.id,
161
160
  key: c.id,
@@ -165,24 +164,24 @@ const Yt = "flow--list--items--item--view", Qt = "flow--list--items--item--view-
165
164
  },
166
165
  c.render()
167
166
  )), u = e.filter((c) => c.isActive).map((c) => c.id);
168
- return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(f, null, a ?? o), /* @__PURE__ */ n.createElement(Z, null)), /* @__PURE__ */ n.createElement(
169
- Q,
167
+ return /* @__PURE__ */ n.createElement(k, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(f, null, i ?? o), /* @__PURE__ */ n.createElement(_, null)), /* @__PURE__ */ n.createElement(
168
+ X,
170
169
  {
171
170
  selectionMode: s === "one" ? "single" : "multiple",
172
171
  selectedKeys: u
173
172
  },
174
173
  l
175
174
  ));
176
- }, ce = "flow--list--header", ue = "flow--list--header--picker-list-and-search", he = "flow--list--header--picker-list", me = "flow--list--header--search-field", y = {
177
- header: ce,
178
- pickerListAndSearch: ue,
179
- pickerList: he,
180
- searchField: me
181
- }, de = "flow--list--header--active-filters", ge = "flow--list--header--active-filters--clear-button", G = {
182
- activeFilters: de,
183
- clearButton: ge
184
- }, pe = () => {
185
- const i = d(), t = i.filters.flatMap(
175
+ }, ne = "flow--list--header", re = "flow--list--header--picker-list-and-search", oe = "flow--list--header--picker-list", le = "flow--list--header--search-field", y = {
176
+ header: ne,
177
+ pickerListAndSearch: re,
178
+ pickerList: oe,
179
+ searchField: le
180
+ }, ce = "flow--list--header--active-filters", ue = "flow--list--header--active-filters--clear-button", G = {
181
+ activeFilters: ce,
182
+ clearButton: ue
183
+ }, de = () => {
184
+ const a = h(), t = a.filters.flatMap(
186
185
  (e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ n.createElement(
187
186
  p,
188
187
  {
@@ -201,49 +200,49 @@ const Yt = "flow--list--items--item--view", Qt = "flow--list--items--item--view-
201
200
  className: G.clearButton,
202
201
  size: "s",
203
202
  variant: "plain",
204
- onPress: () => i.clearFilters()
203
+ onPress: () => a.clearFilters()
205
204
  },
206
- /* @__PURE__ */ n.createElement(T, { locales: g }, "list.resetAll")
205
+ /* @__PURE__ */ n.createElement(L, { locales: g }, "list.resetAll")
207
206
  ));
208
- }, fe = (i) => {
209
- const { className: t, onChange: e, value: s, ...a } = i, [o, l] = pt(s ?? "");
210
- Dt(s, () => {
207
+ }, me = (a) => {
208
+ const { className: t, onChange: e, value: s, ...i } = a, [o, l] = Q(s ?? "");
209
+ xt(s, () => {
211
210
  l(s ?? "");
212
211
  }, [o]);
213
212
  const u = () => {
214
213
  e(void 0), l("");
215
- }, c = (h) => {
216
- h.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : h.key === "Escape" && u();
214
+ }, c = (d) => {
215
+ d.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : d.key === "Escape" && u();
217
216
  };
218
217
  return /* @__PURE__ */ n.createElement(
219
- Vt,
218
+ Bt,
220
219
  {
221
220
  className: t,
222
221
  value: o,
223
222
  onKeyUp: c,
224
- onChange: (h) => l(h),
223
+ onChange: (d) => l(d),
225
224
  onClear: u,
226
- ...a
225
+ ...i
227
226
  }
228
227
  );
229
- }, be = (i) => {
230
- const { className: t, search: e } = i, s = e.render ?? fe;
228
+ }, he = (a) => {
229
+ const { className: t, search: e } = a, s = e.render ?? me;
231
230
  return Y(s, {
232
231
  className: t,
233
232
  value: e.value,
234
233
  onChange: e.setValue.bind(e),
235
234
  ...e.textFieldProps
236
235
  });
237
- }, Se = (i) => {
238
- const { className: t } = i, e = d();
236
+ }, ge = (a) => {
237
+ const { className: t } = a, e = h();
239
238
  if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
240
239
  return null;
241
- const s = e.filters.map((a) => /* @__PURE__ */ n.createElement(le, { key: a.property, filter: a }));
242
- return /* @__PURE__ */ n.createElement("div", { className: E(t, y.header) }, /* @__PURE__ */ n.createElement("div", { className: y.pickerListAndSearch }, /* @__PURE__ */ n.createElement("div", { className: y.pickerList }, /* @__PURE__ */ n.createElement(oe, null), s), e.search && /* @__PURE__ */ n.createElement(be, { className: y.searchField, search: e.search })), /* @__PURE__ */ n.createElement(pe, null));
243
- }, ve = "flow--list", ye = {
244
- list: ve
240
+ const s = e.filters.map((i) => /* @__PURE__ */ n.createElement(ae, { key: i.property, filter: i }));
241
+ return /* @__PURE__ */ n.createElement("div", { className: E(t, y.header) }, /* @__PURE__ */ n.createElement("div", { className: y.pickerListAndSearch }, /* @__PURE__ */ n.createElement("div", { className: y.pickerList }, /* @__PURE__ */ n.createElement(ie, null), s), e.search && /* @__PURE__ */ n.createElement(he, { className: y.searchField, search: e.search })), /* @__PURE__ */ n.createElement(de, null));
242
+ }, pe = "flow--list", fe = {
243
+ list: pe
245
244
  };
246
- let we = class at {
245
+ let be = class at {
247
246
  constructor(t, e, s) {
248
247
  r(this, "id");
249
248
  r(this, "data");
@@ -254,22 +253,22 @@ let we = class at {
254
253
  return new at(t, e.id, e.original);
255
254
  }
256
255
  };
257
- class Ee {
256
+ class Se {
258
257
  constructor(t) {
259
258
  r(this, "list");
260
259
  this.list = t;
261
260
  }
262
261
  get entries() {
263
- return this.list.reactTable.table.getRowModel().rows.map((t) => we.fromRow(this, t));
262
+ return this.list.reactTable.table.getRowModel().rows.map((t) => be.fromRow(this, t));
264
263
  }
265
264
  }
266
- class Ce {
265
+ class ve {
267
266
  constructor(t, e = {}) {
268
267
  r(this, "batchSize");
269
268
  r(this, "list");
270
- var a;
269
+ var i;
271
270
  const { batchSize: s = 20 } = e;
272
- this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (a = t.search) == null || a.onUpdated(() => this.reset());
271
+ this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (i = t.search) == null || i.onUpdated(() => this.reset());
273
272
  }
274
273
  get reactTable() {
275
274
  return this.list.reactTable.table;
@@ -310,7 +309,7 @@ class Ce {
310
309
  }
311
310
  }
312
311
  }
313
- const Fe = "$";
312
+ const ye = "$";
314
313
  class j {
315
314
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
316
315
  constructor(t, e) {
@@ -322,7 +321,7 @@ class j {
322
321
  return vt(this.value, t.value);
323
322
  }
324
323
  get id() {
325
- return `${this.filter.property}@@${Rt(this.value)}`;
324
+ return `${this.filter.property}@@${Dt(this.value)}`;
326
325
  }
327
326
  get isActive() {
328
327
  return this.filter.isValueActive(this);
@@ -337,8 +336,8 @@ class j {
337
336
  this.filter.deactivateValue(this);
338
337
  }
339
338
  }
340
- const Le = (i, t) => i === t, Te = (i) => String(i);
341
- class Ie {
339
+ const we = (a, t) => a === t, Ee = (a) => String(a);
340
+ class Ce {
342
341
  constructor(t, e) {
343
342
  r(this, "_values");
344
343
  r(this, "list");
@@ -349,28 +348,28 @@ class Ie {
349
348
  r(this, "name");
350
349
  r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
351
350
  var s;
352
- this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((a) => new j(this, a)), this.matcher = e.matcher ?? Le, this.renderItem = e.renderItem ?? Te, this.name = e.name;
351
+ this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((i) => new j(this, i)), this.matcher = e.matcher ?? we, this.renderItem = e.renderItem ?? Ee, this.name = e.name;
353
352
  }
354
353
  updateTableColumnDef(t) {
355
354
  t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
356
355
  }
357
356
  getReactTableFilterFn() {
358
357
  return (t, e, s) => {
359
- const a = this.property, o = a.startsWith(Fe) ? t.original : Nt(t.original, a);
358
+ const i = this.property, o = i.startsWith(ye) ? t.original : Pt(t.original, i);
360
359
  return this.checkFilterMatches(o, s);
361
360
  };
362
361
  }
363
362
  checkFilterMatches(t, e) {
364
363
  if (e === null)
365
364
  return !0;
366
- const s = (o) => Array.isArray(o) ? o : [o], a = (o) => this.matcher(o.value, t);
365
+ const s = (o) => Array.isArray(o) ? o : [o], i = (o) => this.matcher(o.value, t);
367
366
  if (this.mode === "all")
368
- return s(e).every(a);
367
+ return s(e).every(i);
369
368
  if (this.mode === "some") {
370
369
  const o = s(e);
371
- return o.length === 0 || o.some(a);
370
+ return o.length === 0 || o.some(i);
372
371
  } else if (this.mode === "one")
373
- return a(e);
372
+ return i(e);
374
373
  throw new Error(`Unknown filter mode '${this.mode}'`);
375
374
  }
376
375
  getTableColumnFilter() {
@@ -401,7 +400,7 @@ class Ie {
401
400
  deactivateValue(t) {
402
401
  const e = this.getArrayValue();
403
402
  let s;
404
- 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());
403
+ this.mode === "all" || this.mode === "some" ? s = e.filter((i) => !i.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
405
404
  }
406
405
  clearValues() {
407
406
  let t;
@@ -410,13 +409,13 @@ class Ie {
410
409
  toggleValue(t) {
411
410
  const e = this.getArrayValue();
412
411
  let s;
413
- 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());
412
+ this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((i) => !i.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
414
413
  }
415
414
  onFilterUpdated(t) {
416
415
  this.onFilterUpdateCallbacks.add(t);
417
416
  }
418
417
  }
419
- class ke {
418
+ class Fe {
420
419
  constructor(t, e) {
421
420
  r(this, "list");
422
421
  r(this, "property");
@@ -450,77 +449,66 @@ class ke {
450
449
  return `${this.getTableColumn().id}:${this.direction}`;
451
450
  }
452
451
  }
453
- const Ae = (i) => L(At(i));
454
- class B {
452
+ class x {
455
453
  constructor(t, e = {}) {
456
454
  r(this, "list");
457
455
  r(this, "table");
458
- r(this, "tableState");
459
- r(this, "onTableStateChange", (t) => {
460
- const e = this.tableState.value;
461
- if (!e)
462
- return;
463
- const s = typeof t == "function" ? t(e) : t;
464
- xt(() => {
465
- this.finalizeTableState(s), this.tableState.value = s;
466
- });
467
- });
468
- this.list = t, this.tableState = Ht(() => ({ value: void 0 })), this.table = this.useReactTable(e);
456
+ r(this, "sortingState");
457
+ r(this, "updateSortingState");
458
+ this.list = t;
459
+ const s = this.list.sorting.filter(
460
+ (l) => l.defaultEnabled !== !1
461
+ ), [i, o] = Q(
462
+ s.map((l) => l.getReactTableColumnSort())
463
+ );
464
+ this.sortingState = i, this.updateSortingState = o, this.table = this.useReactTable(e);
469
465
  }
470
466
  static useNew(t, e = {}) {
471
- return new B(t, e);
467
+ return new x(t, e);
472
468
  }
473
469
  useReactTable(t = {}) {
474
- const e = this.list.loader.useData(), s = this.list.sorting.filter(
475
- (o) => o.defaultEnabled !== !1
476
- ), a = zt({
470
+ const e = this.list.loader.useData();
471
+ return Vt({
477
472
  data: e,
473
+ state: {
474
+ sorting: this.sortingState
475
+ },
478
476
  initialState: {
479
477
  pagination: {
480
478
  pageSize: this.list.batches.batchSize
481
- },
482
- sorting: s.map((o) => o.getReactTableColumnSort())
479
+ }
483
480
  },
484
481
  columns: this.getTableColumnDefs(),
485
- getCoreRowModel: Mt(),
486
- getSortedRowModel: $t(),
487
- getFilteredRowModel: Ut(),
488
- getPaginationRowModel: Ot(),
489
- getFacetedUniqueValues: qt(),
490
- onStateChange: this.onTableStateChange,
482
+ getCoreRowModel: Nt(),
483
+ getSortedRowModel: Rt(),
484
+ getFilteredRowModel: Mt(),
485
+ getPaginationRowModel: zt(),
486
+ getFacetedUniqueValues: $t(),
487
+ onSortingChange: (i) => {
488
+ this.handleSortingStateUpdate(i);
489
+ },
491
490
  globalFilterFn: "auto",
492
491
  ...t
493
492
  });
494
- return this.useUpdateTableState(a), a;
495
- }
496
- useUpdateTableState(t) {
497
- Ae(() => {
498
- const e = this.tableState.value;
499
- e ? t.setOptions((s) => ({
500
- ...s,
501
- state: Bt(e)
502
- })) : this.tableState.value = t.getState();
503
- });
504
493
  }
505
- finalizeTableState(t) {
506
- const e = this.list.sorting.filter(
507
- (s) => s.defaultEnabled === "hidden" && !t.sorting.some((a) => a.id === s.property)
508
- ).map((s) => s.getReactTableColumnSort());
509
- t.sorting.unshift(...e);
494
+ handleSortingStateUpdate(t) {
495
+ const e = typeof t == "function" ? t(this.sortingState) : t, s = this.list.sorting.filter(
496
+ (i) => i.defaultEnabled === "hidden" && !e.some((o) => o.id === i.property)
497
+ ).map((i) => i.getReactTableColumnSort());
498
+ this.updateSortingState([...s, ...e]);
510
499
  }
511
500
  get searchString() {
512
- var t;
513
- return (t = this.tableState.value) == null ? void 0 : t.globalFilter;
501
+ return this.table.getState().globalFilter;
514
502
  }
515
503
  getTableColumn(t) {
516
504
  const e = this.table.getColumn(t);
517
- return _(!!e, `Column #${t} is not defined`), e;
505
+ return tt(!!e, `Column #${t} is not defined`), e;
518
506
  }
519
507
  getTableColumnDefs() {
520
508
  const t = /* @__PURE__ */ new Map(), e = (s) => {
521
- const a = t.get(s);
522
- if (a)
523
- return a;
509
+ const i = t.get(s);
510
+ if (i)
511
+ return i;
524
512
  const o = {
525
513
  id: s,
526
514
  accessorKey: s,
@@ -536,12 +524,12 @@ class B {
536
524
  ), Array.from(t.values());
537
525
  }
538
526
  }
539
- class P {
527
+ class B {
540
528
  constructor() {
541
529
  r(this, "dataBatches", []);
542
530
  r(this, "prevDataBatches", []);
543
531
  r(this, "batchLoadingStates", ["void"]);
544
- Pt(this, {
532
+ At(this, {
545
533
  prevDataBatches: !1,
546
534
  useMergedData: !1,
547
535
  useIsLoading: !1,
@@ -555,7 +543,7 @@ class P {
555
543
  });
556
544
  }
557
545
  static useNew() {
558
- return ft(new P()).current;
546
+ return ft(new B()).current;
559
547
  }
560
548
  reset() {
561
549
  this.batchLoadingStates = [], this.dataBatches = [];
@@ -579,8 +567,8 @@ class P {
579
567
  return H(() => this.isLoading);
580
568
  }
581
569
  }
582
- const xe = [];
583
- class D {
570
+ const Le = [];
571
+ class P {
584
572
  constructor(t, e = {}) {
585
573
  r(this, "list");
586
574
  r(this, "dataSource");
@@ -590,12 +578,12 @@ class D {
590
578
  r(this, "loaderState");
591
579
  var u;
592
580
  const { source: s } = e;
593
- this.dataSource = s ?? { staticData: xe };
594
- 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;
595
- 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());
581
+ this.dataSource = s ?? { staticData: Le };
582
+ 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;
583
+ this.list = t, this.loaderState = B.useNew(), this.manualPagination = i ?? !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());
596
584
  }
597
585
  static useNew(t, e = {}) {
598
- return new D(t, e);
586
+ return new P(t, e);
599
587
  }
600
588
  reset() {
601
589
  this.loaderState.reset();
@@ -621,7 +609,7 @@ class D {
621
609
  }), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
622
610
  }
623
611
  useObserveBatchLoadingState(t, e) {
624
- L(() => (this.loaderState.setBatchLoadingState(
612
+ z(() => (this.loaderState.setBatchLoadingState(
625
613
  e,
626
614
  t.state.value
627
615
  ), t.state.observe((s) => {
@@ -629,12 +617,12 @@ class D {
629
617
  })), [t, e]);
630
618
  }
631
619
  useObserveBatchData(t, e) {
632
- const s = (a) => {
633
- const { data: o, itemTotalCount: l } = a;
620
+ const s = (i) => {
621
+ const { data: o, itemTotalCount: l } = i;
634
622
  this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
635
623
  };
636
- L(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
637
- a.isSet && s(a.value);
624
+ z(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((i) => {
625
+ i.isSet && s(i.value);
638
626
  })), [t, e]);
639
627
  }
640
628
  getDataLoaderOptions(t) {
@@ -662,24 +650,24 @@ class D {
662
650
  const e = this.dataSource, s = this.getDataLoaderOptions(t);
663
651
  if ("staticData" in e)
664
652
  return q(
665
- async (a) => ({
666
- data: a,
667
- itemTotalCount: a.length
653
+ async (i) => ({
654
+ data: i,
655
+ itemTotalCount: i.length
668
656
  }),
669
657
  [e.staticData]
670
658
  );
671
659
  if ("asyncLoader" in e) {
672
- const a = e.asyncLoader;
673
- return q(a, [s]);
660
+ const i = e.asyncLoader;
661
+ return q(i, [s]);
674
662
  }
675
663
  if ("asyncResourceFactory" in e) {
676
- const a = e.asyncResourceFactory;
677
- return a(s);
664
+ const i = e.asyncResourceFactory;
665
+ return i(s);
678
666
  }
679
667
  throw new Error("Unknown data source");
680
668
  }
681
669
  }
682
- class Be {
670
+ class Te {
683
671
  constructor(t, e) {
684
672
  r(this, "list");
685
673
  r(this, "render");
@@ -711,15 +699,15 @@ const w = class w {
711
699
  r(this, "onAction");
712
700
  r(this, "fallback");
713
701
  r(this, "renderFn");
714
- const { onAction: s, fallback: a, textValue: o, href: l, renderFn: u } = e;
715
- this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = a;
702
+ const { onAction: s, fallback: i, textValue: o, href: l, renderFn: u } = e;
703
+ this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = i;
716
704
  }
717
705
  render(t) {
718
706
  return (this.renderFn ?? w.fallbackRenderItemFn)(t);
719
707
  }
720
708
  };
721
709
  r(w, "fallbackRenderItemFn", (t) => Y("pre", void 0, JSON.stringify(t)));
722
- let I = w, Pe = class it {
710
+ let T = w, Ie = class nt {
723
711
  constructor(t) {
724
712
  r(this, "filters");
725
713
  r(this, "itemView");
@@ -733,18 +721,18 @@ let I = w, Pe = class it {
733
721
  const {
734
722
  itemView: e,
735
723
  filters: s = [],
736
- sorting: a = [],
724
+ sorting: i = [],
737
725
  batchesController: o,
738
726
  hasAction: l
739
727
  } = t;
740
- this.items = new Ee(this), this.filters = s.map((u) => new Ie(this, u)), this.sorting = a.map((u) => new ke(this, u)), this.search = t.search ? new Be(this, t.search) : void 0, this.itemView = new I(this, e), this.batches = new Ce(this, o), this.loader = D.useNew(this, t.loader), this.reactTable = B.useNew(this, {
728
+ this.items = new Se(this), this.filters = s.map((u) => new Ce(this, u)), this.sorting = i.map((u) => new Fe(this, u)), this.search = t.search ? new Te(this, t.search) : void 0, this.itemView = new T(this, e), this.batches = new ve(this, o), this.loader = P.useNew(this, t.loader), this.reactTable = x.useNew(this, {
741
729
  manualFiltering: this.loader.manualFiltering,
742
730
  manualPagination: this.loader.manualPagination,
743
731
  manualSorting: this.loader.manualSorting
744
732
  }), this.hasAction = l;
745
733
  }
746
734
  static useNew(t) {
747
- return new it(t);
735
+ return new nt(t);
748
736
  }
749
737
  get isFiltered() {
750
738
  return this.filters.some((t) => t.isActive()) || !!this.search && this.search.isSet;
@@ -754,7 +742,7 @@ let I = w, Pe = class it {
754
742
  }
755
743
  getSorting(t) {
756
744
  const e = this.sorting.find((s) => s.id === t);
757
- return _(!!e, `Could not get Sorting (ID: ${t})`), e;
745
+ return tt(!!e, `Could not get Sorting (ID: ${t})`), e;
758
746
  }
759
747
  clearSorting() {
760
748
  return this.sorting.forEach((t) => t.clear());
@@ -767,93 +755,93 @@ let I = w, Pe = class it {
767
755
  return !this.loader.useIsLoading() && this.items.entries.length === 0;
768
756
  }
769
757
  };
770
- const De = "flow--list--items", Ve = "flow--list--items--is-loading", J = {
771
- items: De,
772
- isLoading: Ve
773
- }, Ne = "flow--list--items--item", Re = "flow--list--items--item--has-action", k = {
774
- item: Ne,
775
- hasAction: Re
776
- }, ze = (i) => {
777
- const { data: t, children: e } = i, s = d(), 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, C = E(k.item, h && k.hasAction);
758
+ const ke = "flow--list--items", Ae = "flow--list--items--is-loading", W = {
759
+ items: ke,
760
+ isLoading: Ae
761
+ }, xe = "flow--list--items--item", Be = "flow--list--items--item--has-action", I = {
762
+ item: xe,
763
+ hasAction: Be
764
+ }, Pe = (a) => {
765
+ const { data: t, children: e } = a, s = h(), i = s.itemView, o = i.onAction, l = i.textValue ? i.textValue(t) : void 0, u = o ? () => o(t) : void 0, c = i.href ? i.href(t) : void 0, d = s.hasAction || !!u || !!c, C = E(I.item, d && I.hasAction);
778
766
  return /* @__PURE__ */ n.createElement(
779
- x.GridListItem,
767
+ A.GridListItem,
780
768
  {
781
769
  className: C,
782
770
  onAction: u,
783
771
  textValue: l,
784
772
  href: c
785
773
  },
786
- e ?? a.render(t)
774
+ e ?? i.render(t)
787
775
  );
788
- }, Me = (i) => /* @__PURE__ */ n.createElement(x.GridListItem, { textValue: "-", className: k.item }, i.children), $e = () => {
789
- const i = S(g);
790
- return /* @__PURE__ */ n.createElement(Kt, null, /* @__PURE__ */ n.createElement(Gt, null), /* @__PURE__ */ n.createElement(tt, null, i.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(f, null, i.format("list.noResult.text")));
791
- }, Ue = "flow--skeleton-text", Oe = "flow--skeleton-text--shimmer", qe = {
792
- skeletonText: Ue,
793
- shimmer: Oe
794
- }, W = (i) => {
795
- const { width: t, style: e = {}, ...s } = i;
796
- return /* @__PURE__ */ n.createElement("div", { "aria-hidden": !0, style: { width: t, ...e }, ...s }, /* @__PURE__ */ n.createElement("div", { className: qe.skeletonText }));
797
- }, He = () => /* @__PURE__ */ n.createElement(et, null, /* @__PURE__ */ n.createElement(tt, null, /* @__PURE__ */ n.createElement(W, { width: "200px" })), /* @__PURE__ */ n.createElement(f, null, /* @__PURE__ */ n.createElement(W, { width: "300px" }))), Ke = () => {
798
- const t = d().itemView.fallback ?? /* @__PURE__ */ n.createElement(He, null);
799
- return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ n.createElement(Me, { key: s }, bt(t)));
800
- }, Ge = (i) => {
801
- const { className: t, ...e } = i, s = d(), a = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), u = s.items.entries.map((h) => /* @__PURE__ */ n.createElement(ze, { key: h.id, data: h.data })), c = E(
802
- J.items,
776
+ }, De = (a) => /* @__PURE__ */ n.createElement(A.GridListItem, { textValue: "-", className: I.item }, a.children), Ve = () => {
777
+ const a = S(g);
778
+ return /* @__PURE__ */ n.createElement(Ut, null, /* @__PURE__ */ n.createElement(Ot, null), /* @__PURE__ */ n.createElement(et, null, a.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(f, null, a.format("list.noResult.text")));
779
+ }, Ne = "flow--skeleton-text", Re = "flow--skeleton-text--shimmer", Me = {
780
+ skeletonText: Ne,
781
+ shimmer: Re
782
+ }, J = (a) => {
783
+ const { width: t, style: e = {}, ...s } = a;
784
+ return /* @__PURE__ */ n.createElement("div", { "aria-hidden": !0, style: { width: t, ...e }, ...s }, /* @__PURE__ */ n.createElement("div", { className: Me.skeletonText }));
785
+ }, ze = () => /* @__PURE__ */ n.createElement(st, null, /* @__PURE__ */ n.createElement(et, null, /* @__PURE__ */ n.createElement(J, { width: "200px" })), /* @__PURE__ */ n.createElement(f, null, /* @__PURE__ */ n.createElement(J, { width: "300px" }))), $e = () => {
786
+ const t = h().itemView.fallback ?? /* @__PURE__ */ n.createElement(ze, null);
787
+ return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ n.createElement(De, { key: s }, bt(t)));
788
+ }, Ue = (a) => {
789
+ const { className: t, ...e } = a, s = h(), i = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), u = s.items.entries.map((d) => /* @__PURE__ */ n.createElement(Pe, { key: d.id, data: d.data })), c = E(
790
+ W.items,
803
791
  t,
804
- a && J.isLoading
792
+ i && W.isLoading
805
793
  );
806
- return l ? /* @__PURE__ */ n.createElement($e, null) : /* @__PURE__ */ n.createElement("div", { "aria-hidden": o, "aria-busy": a }, /* @__PURE__ */ n.createElement(x.GridList, { className: c, ...e }, o ? /* @__PURE__ */ n.createElement(Ke, null) : u));
807
- }, nt = (i) => null, je = () => nt, rt = (i) => null, Je = () => rt, ot = (i) => null, We = () => ot, lt = (i) => null, Ye = () => lt, ct = (i) => null, Qe = () => ct, Xe = "flow--list--footer", Ze = {
808
- footer: Xe
809
- }, _e = (i) => {
810
- const t = S(g), e = d(), s = e.batches, a = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
794
+ return l ? /* @__PURE__ */ n.createElement(Ve, null) : /* @__PURE__ */ n.createElement("div", { "aria-hidden": o, "aria-busy": i }, /* @__PURE__ */ n.createElement(A.GridList, { className: c, ...e }, o ? /* @__PURE__ */ n.createElement($e, null) : u));
795
+ }, rt = (a) => null, Oe = () => rt, ot = (a) => null, qe = () => ot, lt = (a) => null, He = () => lt, ct = (a) => null, Ke = () => ct, ut = (a) => null, Ge = () => ut, je = "flow--list--footer", We = {
796
+ footer: je
797
+ }, Je = (a) => {
798
+ const t = S(g), e = h(), s = e.batches, i = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
811
799
  if (o)
812
800
  return null;
813
- const c = a ? /* @__PURE__ */ n.createElement(Wt, { width: "200px" }) : t.format("list.paginationInfo", {
801
+ const c = i ? /* @__PURE__ */ n.createElement(Kt, { width: "200px" }) : t.format("list.paginationInfo", {
814
802
  visibleItemsCount: u,
815
803
  totalItemsCount: l
816
804
  });
817
- return /* @__PURE__ */ n.createElement(f, { ...i }, c);
818
- }, ts = (i) => {
819
- const t = S(g), e = d(), s = e.loader.useIsLoading(), a = e.loader.useIsInitiallyLoading();
805
+ return /* @__PURE__ */ n.createElement(f, { ...a }, c);
806
+ }, Ye = (a) => {
807
+ const t = S(g), e = h(), s = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading();
820
808
  return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ n.createElement(
821
809
  p,
822
810
  {
823
- isPending: s && !a,
824
- isDisabled: a,
825
- ...i,
811
+ isPending: s && !i,
812
+ isDisabled: i,
813
+ ...a,
826
814
  onPress: () => e.batches.nextBatch(),
827
815
  variant: "plain",
828
816
  size: "s"
829
817
  },
830
818
  t.format("list.showMore")
831
819
  );
832
- }, es = () => /* @__PURE__ */ n.createElement("div", { className: Ze.footer }, /* @__PURE__ */ n.createElement(_e, null), /* @__PURE__ */ n.createElement(ts, null));
833
- function ut(i) {
820
+ }, Qe = () => /* @__PURE__ */ n.createElement("div", { className: We.footer }, /* @__PURE__ */ n.createElement(Je, null), /* @__PURE__ */ n.createElement(Ye, null));
821
+ function dt(a) {
834
822
  return null;
835
823
  }
836
- const ss = () => ut, as = Tt("List", (i) => {
837
- var V, N, R, z, M;
838
- const { children: t, batchSize: e, ...s } = i, a = (V = b(
824
+ const Xe = () => dt, Ze = Tt("List", (a) => {
825
+ var D, V, N, R, M;
826
+ const { children: t, batchSize: e, ...s } = a, i = (D = b(
839
827
  t,
840
- nt
841
- )) == null ? void 0 : V.props, o = (N = b(
828
+ rt
829
+ )) == null ? void 0 : D.props, o = (V = b(
842
830
  t,
843
- jt
844
- )) == null ? void 0 : N.props, l = (R = b(t, ct)) == null ? void 0 : R.props, u = {
845
- source: a ? {
846
- ...a,
847
- asyncLoader: a.children
831
+ qt
832
+ )) == null ? void 0 : V.props, l = (N = b(t, ut)) == null ? void 0 : N.props, u = {
833
+ source: i ? {
834
+ ...i,
835
+ asyncLoader: i.children
848
836
  } : o ? {
849
837
  ...o,
850
838
  asyncResourceFactory: o.children
851
839
  } : l ? {
852
840
  staticData: l.data
853
841
  } : void 0
854
- }, c = (z = b(t, ut)) == null ? void 0 : z.props, h = (M = b(t, lt)) == null ? void 0 : M.props, C = Pe.useNew({
842
+ }, c = (R = b(t, dt)) == null ? void 0 : R.props, d = (M = b(t, ct)) == null ? void 0 : M.props, C = Ie.useNew({
855
843
  loader: u,
856
- filters: K(t, rt).map(
844
+ filters: K(t, ot).map(
857
845
  (v) => ({
858
846
  ...v.props,
859
847
  renderItem: v.props.children
@@ -863,49 +851,49 @@ const ss = () => ut, as = Tt("List", (i) => {
863
851
  render: c.children,
864
852
  textFieldProps: c
865
853
  } : void 0,
866
- sorting: K(t, ot).map((v) => v.props),
867
- itemView: h ? {
868
- ...h,
869
- renderFn: h.children
854
+ sorting: K(t, lt).map((v) => v.props),
855
+ itemView: d ? {
856
+ ...d,
857
+ renderFn: d.children
870
858
  } : void 0,
871
859
  batchesController: {
872
860
  batchSize: e
873
861
  },
874
- hasAction: !!i.onAction
862
+ hasAction: !!a.onAction
875
863
  });
876
864
  return /* @__PURE__ */ n.createElement(
877
- st.Provider,
865
+ it.Provider,
878
866
  {
879
867
  value: {
880
868
  list: C
881
869
  }
882
870
  },
883
- /* @__PURE__ */ n.createElement(ne, null),
884
- /* @__PURE__ */ n.createElement("div", { className: ye.list }, /* @__PURE__ */ n.createElement(Se, null), /* @__PURE__ */ n.createElement(Ge, { ...s }), /* @__PURE__ */ n.createElement(es, null))
871
+ /* @__PURE__ */ n.createElement(ee, null),
872
+ /* @__PURE__ */ n.createElement("div", { className: fe.list }, /* @__PURE__ */ n.createElement(ge, null), /* @__PURE__ */ n.createElement(Ue, { ...s }), /* @__PURE__ */ n.createElement(Qe, null))
885
873
  );
886
- }), Hs = () => ({
887
- List: as,
888
- Filter: Je(),
889
- Search: ss(),
890
- Sorting: We(),
891
- Item: Ye(),
892
- ItemView: et,
893
- StaticData: Qe(),
894
- LoaderAsync: je(),
895
- LoaderAsyncResource: Jt()
874
+ }), Ms = () => ({
875
+ List: Ze,
876
+ Filter: qe(),
877
+ Search: Xe(),
878
+ Sorting: He(),
879
+ Item: Ke(),
880
+ ItemView: st,
881
+ StaticData: Ge(),
882
+ LoaderAsync: Oe(),
883
+ LoaderAsyncResource: Ht()
896
884
  });
897
885
  export {
898
- as as List,
899
- rt as ListFilter,
900
- lt as ListItem,
901
- et as ListItemView,
902
- nt as ListLoaderAsync,
903
- ot as ListSorting,
904
- ct as ListStaticData,
905
- Je as TypedListFilter,
906
- Ye as TypedListItem,
907
- je as TypedListLoaderAsync,
908
- We as TypedListSorting,
909
- Qe as TypedListStaticData,
910
- Hs as typedList
886
+ Ze as List,
887
+ ot as ListFilter,
888
+ ct as ListItem,
889
+ st as ListItemView,
890
+ rt as ListLoaderAsync,
891
+ lt as ListSorting,
892
+ ut as ListStaticData,
893
+ qe as TypedListFilter,
894
+ Ke as TypedListItem,
895
+ Oe as TypedListLoaderAsync,
896
+ He as TypedListSorting,
897
+ Ge as TypedListStaticData,
898
+ Ms as typedList
911
899
  };
@@ -1,18 +1,18 @@
1
- import { Column, Table, TableOptions } from '@tanstack/react-table';
1
+ import { Column, ColumnSort, Table, TableOptions } from '@tanstack/react-table';
2
2
  import { default as List } from './List';
3
3
  import { PropertyName } from './types';
4
4
  import { SearchValue } from './search/types';
5
+ import { Dispatch, SetStateAction } from 'react';
5
6
 
6
7
  export declare class ReactTable<T> {
7
8
  readonly list: List<T>;
8
9
  readonly table: Table<T>;
9
- private readonly tableState;
10
+ readonly sortingState: ColumnSort[];
11
+ readonly updateSortingState: Dispatch<SetStateAction<ColumnSort[]>>;
10
12
  private constructor();
11
13
  static useNew<T>(list: List<T>, tableOptions?: Partial<TableOptions<T>>): ReactTable<T>;
12
14
  private useReactTable;
13
- private useUpdateTableState;
14
- private onTableStateChange;
15
- private finalizeTableState;
15
+ private handleSortingStateUpdate;
16
16
  get searchString(): SearchValue;
17
17
  getTableColumn(property: PropertyName<T>): Column<T>;
18
18
  private getTableColumnDefs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.190",
3
+ "version": "0.1.0-alpha.191",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -284,7 +284,7 @@
284
284
  "dependencies": {
285
285
  "@chakra-ui/live-region": "^2.1.0",
286
286
  "@internationalized/string-compiler": "^3.2.4",
287
- "@mittwald/react-tunnel": "^0.1.0-alpha.190",
287
+ "@mittwald/react-tunnel": "^0.1.0-alpha.191",
288
288
  "@mittwald/react-use-promise": "^2.3.13",
289
289
  "@react-aria/utils": "^3.25.1",
290
290
  "@react-types/shared": "^3.24.1",
@@ -310,7 +310,7 @@
310
310
  },
311
311
  "devDependencies": {
312
312
  "@faker-js/faker": "^8.4.1",
313
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.190",
313
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.191",
314
314
  "@mittwald/react-use-promise": "^2.3.13",
315
315
  "@nx/storybook": "^19.5.6",
316
316
  "@storybook/addon-a11y": "^8.2.7",
@@ -388,5 +388,5 @@
388
388
  "optional": true
389
389
  }
390
390
  },
391
- "gitHead": "f7d2dd8a0feae45eb9db273cee4c5a895839f8aa"
391
+ "gitHead": "975bf3995f0899aadcc79d3aaf84014f71ab6f1e"
392
392
  }