@mittwald/flow-react-components 0.1.0-alpha.56 → 0.1.0-alpha.58

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 (92) hide show
  1. package/dist/ButtonGroup.js +13 -13
  2. package/dist/{Checkbox-DBT4VBSr.js → Checkbox-gCtHl4pE.js} +8 -7
  3. package/dist/Checkbox.js +1 -1
  4. package/dist/{CheckboxButton-CoEvnLRt.js → CheckboxButton-CW6TfZFj.js} +1 -1
  5. package/dist/CheckboxButton.js +1 -1
  6. package/dist/CheckboxGroup.js +1 -1
  7. package/dist/ContextMenu.js +7 -24
  8. package/dist/ContextMenuItem-DDPBrwII.js +67 -0
  9. package/dist/IconCheckboxEmpty-BNFRkCm2.js +10 -0
  10. package/dist/IconCheckboxIndeterminate-Bsk1h92j.js +9 -0
  11. package/dist/IconChevronDown-C3dBD472.js +9 -0
  12. package/dist/IconPlus-DXNLmWa2.js +11 -0
  13. package/dist/Icons.js +69 -67
  14. package/dist/List.js +366 -276
  15. package/dist/NumberField.js +7 -7
  16. package/dist/styles.css +1 -1
  17. package/dist/types/components/Button/Button.d.ts +1 -1
  18. package/dist/types/components/Content/Content.d.ts +1 -1
  19. package/dist/types/components/ContextMenu/ContextMenu.d.ts +2 -2
  20. package/dist/types/components/ContextMenu/components/ContextMenuItem/ContextMenuItem.d.ts +2 -2
  21. package/dist/types/components/ContextMenu/components/ContextMenuItem/ContextMenuItemContent.d.ts +6 -0
  22. package/dist/types/components/ContextMenu/stories/Default.stories.d.ts +2 -0
  23. package/dist/types/components/CopyButton/CopyButton.d.ts +1 -1
  24. package/dist/types/components/FieldError/FieldError.d.ts +1 -1
  25. package/dist/types/components/Header/Header.d.ts +1 -1
  26. package/dist/types/components/Icon/Icon.d.ts +1 -1
  27. package/dist/types/components/Icon/components/icons/IconSubdomain.d.ts +5 -0
  28. package/dist/types/components/Icon/components/icons/index.d.ts +1 -0
  29. package/dist/types/components/Image/Image.d.ts +1 -1
  30. package/dist/types/components/Initials/Initials.d.ts +1 -1
  31. package/dist/types/components/InlineAlert/InlineAlert.d.ts +1 -1
  32. package/dist/types/components/Label/Label.d.ts +1 -1
  33. package/dist/types/components/LayoutCard/LayoutCard.d.ts +1 -1
  34. package/dist/types/components/Link/Link.d.ts +1 -2
  35. package/dist/types/components/List/List.d.ts +3 -4
  36. package/dist/types/components/List/components/Footer/Footer/Footer.d.ts +4 -0
  37. package/dist/types/components/List/components/Footer/Footer/index.d.ts +4 -0
  38. package/dist/types/components/List/components/{PaginationInfos → Footer/PaginationInfos}/PaginationInfos.d.ts +1 -1
  39. package/dist/types/components/List/components/Footer/ShowNextBatchButton/ShowNextBatchButton.d.ts +5 -0
  40. package/dist/types/components/List/components/Footer/ShowNextBatchButton/index.d.ts +4 -0
  41. package/dist/types/components/List/components/Header/ActiveFilters/ActiveFilters.d.ts +4 -0
  42. package/dist/types/components/List/components/Header/ActiveFilters/index.d.ts +4 -0
  43. package/dist/types/components/List/components/Header/FilterPicker/FilterPicker.d.ts +9 -0
  44. package/dist/types/components/List/components/{Items/Items.d.ts → Header/Header/Header.d.ts} +2 -2
  45. package/dist/types/components/List/components/Header/Header/index.d.ts +4 -0
  46. package/dist/types/components/List/components/{ListFilter.d.ts → Header/ListFilter.d.ts} +1 -1
  47. package/dist/types/components/List/components/{ListSorting.d.ts → Header/ListSorting.d.ts} +1 -1
  48. package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPickerItem/SortingPickerItem.d.ts +2 -2
  49. package/dist/types/components/List/components/{Item → Items/Item}/FallbackRenderer.d.ts +1 -1
  50. package/dist/types/components/List/components/{Item → Items/Item}/Item.d.ts +1 -1
  51. package/dist/types/components/List/components/{Item → Items/Item}/index.d.ts +1 -0
  52. package/dist/types/components/List/components/{FilterBar/FilterBar.d.ts → Items/ItemList/ItemList.d.ts} +2 -2
  53. package/dist/types/components/List/components/Items/ItemList/index.d.ts +4 -0
  54. package/dist/types/components/List/components/{ListItemView.d.ts → Items/ListItemView.d.ts} +1 -1
  55. package/dist/types/components/List/index.d.ts +3 -3
  56. package/dist/types/components/List/model/List.d.ts +6 -3
  57. package/dist/types/components/List/model/filter/Filter.d.ts +4 -0
  58. package/dist/types/components/List/model/filter/types.d.ts +1 -0
  59. package/dist/types/components/List/model/loading/IncrementalLoader.d.ts +2 -3
  60. package/dist/types/components/List/model/pagination/BatchesController.d.ts +17 -0
  61. package/dist/types/components/List/model/pagination/types.d.ts +2 -2
  62. package/dist/types/components/List/model/sorting/Sorting.d.ts +5 -0
  63. package/dist/types/components/List/model/sorting/types.d.ts +3 -0
  64. package/dist/types/components/List/model/types.d.ts +2 -3
  65. package/dist/types/components/List/testData/domainApi.d.ts +25 -0
  66. package/dist/types/components/RadioGroup/components/Radio/Radio.d.ts +1 -2
  67. package/dist/types/components/StatusBadge/StatusBadge.d.ts +1 -1
  68. package/dist/types/components/Switch/Switch.d.ts +1 -1
  69. package/dist/types/components/Text/Text.d.ts +1 -1
  70. package/dist/types/lib/react/components/Translate/Translate.d.ts +10 -0
  71. package/dist/types/lib/react/components/Translate/index.d.ts +4 -0
  72. package/dist/types/lib/types/props.d.ts +1 -3
  73. package/package.json +4 -4
  74. package/dist/IconCheckboxIndeterminate-B6FOeb87.js +0 -11
  75. package/dist/IconChevronUp-DJu_PD8w.js +0 -10
  76. package/dist/IconPlus-BZwxakYk.js +0 -10
  77. package/dist/types/components/List/components/FilterBar/components/FilterPicker/FilterPicker.d.ts +0 -3
  78. package/dist/types/components/List/components/FilterBar/components/FilterPickerItem/FilterPickerItem.d.ts +0 -9
  79. package/dist/types/components/List/components/FilterBar/components/FilterPickerItem/index.d.ts +0 -4
  80. package/dist/types/components/List/components/FilterBar/index.d.ts +0 -4
  81. package/dist/types/components/List/components/Items/index.d.ts +0 -4
  82. package/dist/types/components/List/components/ShowMoreItemsButton/ShowMoreItemsButton.d.ts +0 -5
  83. package/dist/types/components/List/components/ShowMoreItemsButton/index.d.ts +0 -4
  84. package/dist/types/components/List/model/pagination/Pagination.d.ts +0 -17
  85. package/dist/types/components/List/testData/userApi.d.ts +0 -57
  86. /package/dist/types/components/List/components/{PaginationInfos → Footer/PaginationInfos}/index.d.ts +0 -0
  87. /package/dist/types/components/List/components/{FilterBar/components → Header}/FilterPicker/index.d.ts +0 -0
  88. /package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPicker/SortingPicker.d.ts +0 -0
  89. /package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPicker/index.d.ts +0 -0
  90. /package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPickerItem/index.d.ts +0 -0
  91. /package/dist/types/components/List/components/{OptionsButton → Items/OptionsButton}/OptionsButton.d.ts +0 -0
  92. /package/dist/types/components/List/components/{OptionsButton → Items/OptionsButton}/index.d.ts +0 -0
package/dist/List.js CHANGED
@@ -1,109 +1,146 @@
1
1
  "use client"
2
2
  /* */
3
- var $ = Object.defineProperty;
4
- var H = (s, t, e) => t in s ? $(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
5
- var o = (s, t, e) => (H(s, typeof t != "symbol" ? t + "" : t, e), e);
6
- import n, { createContext as q, useContext as j, createElement as J, useEffect as y, useState as W, Suspense as K } from "react";
7
- import { useMessageFormatter as G, useLocalizedStringFormatter as V } from "react-aria";
8
- import { T as Q } from "./Text-Dc6eN_n2.js";
9
- import { B as f } from "./Button-h6RkBrWE.js";
10
- import "@tabler/icons-react";
11
- import x from "clsx";
12
- import "html-react-parser";
3
+ var X = Object.defineProperty;
4
+ var Y = (n, t, e) => t in n ? X(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
5
+ var o = (n, t, e) => (Y(n, typeof t != "symbol" ? t + "" : t, e), e);
6
+ import r, { createContext as Z, useContext as _, createElement as tt, useEffect as C, useState as et, Suspense as at } from "react";
7
+ import * as U from "react-aria-components";
8
+ import { MenuTrigger as st } from "react-aria-components";
13
9
  import "./propsContext-Dx7WKmmM.js";
14
10
  import "@react-aria/utils";
15
- import { times as X } from "remeda";
11
+ import { times as rt } from "remeda";
16
12
  import "@mittwald/react-tunnel";
17
- import { a as Y, I as Z } from "./IconChevronUp-DJu_PD8w.js";
18
- import { L as _ } from "./Label-Bjdbr72t.js";
19
- import { getProperty as tt } from "dot-prop";
20
- import { useReactTable as et, getCoreRowModel as at, getSortedRowModel as st, getFilteredRowModel as it, getPaginationRowModel as nt, getFacetedUniqueValues as ot } from "@tanstack/react-table";
21
- import rt from "invariant";
22
- import { useLocalObservable as lt } from "mobx-react-lite";
23
- import { autorun as ct, runInAction as ut, makeObservable as mt, observable as k, computed as B, action as S } from "mobx";
24
- import { getAsyncResource as D } from "@mittwald/react-use-promise";
25
- import { u as N } from "./useSelector-DpU7_HMO.js";
26
- import { P as gt } from "./PropsContextProvider-BsrVIv1a.js";
27
- import { W as dt } from "./Wrap-DGT1h1o3.js";
28
- import { d as p, a as R } from "./deepFindOfType-6pG0fH7S.js";
29
- import { L as ht } from "./Link-DtSY1xrt.js";
30
- import { I as pt } from "./IconContextMenu-BF-N2Mtz.js";
31
- import { MenuTrigger as ft } from "react-aria-components";
32
- import { I as bt } from "./InlineCode-DZzyKdCm.js";
33
- import { ListLoaderAsyncResource as St } from "./List/ListLoaderAsyncResource.js";
34
- const O = q({}), g = () => j(O).list, yt = (s) => /* @__PURE__ */ n.createElement(n.Fragment, null, s.children()), wt = () => g().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(yt, { key: e }, () => {
13
+ import { a as O, C as $, d as nt } from "./ContextMenuItem-DDPBrwII.js";
14
+ import { T as f } from "./Text-Dc6eN_n2.js";
15
+ import "@tabler/icons-react";
16
+ import H from "clsx";
17
+ import "html-react-parser";
18
+ import { I as q } from "./IconChevronDown-C3dBD472.js";
19
+ import { B as u } from "./Button-h6RkBrWE.js";
20
+ import "react-children-utilities";
21
+ import { useMessageFormatter as K, useLocalizedStringFormatter as j } from "react-aria";
22
+ import { I as D } from "./IconClose-DIMx1m3Z.js";
23
+ import { getProperty as it } from "dot-prop";
24
+ import { useReactTable as ot, getCoreRowModel as lt, getSortedRowModel as ct, getFilteredRowModel as ut, getPaginationRowModel as mt, getFacetedUniqueValues as dt } from "@tanstack/react-table";
25
+ import J from "invariant";
26
+ import { useLocalObservable as ht } from "mobx-react-lite";
27
+ import { autorun as gt, runInAction as pt, makeObservable as ft, observable as k, computed as P, action as y } from "mobx";
28
+ import { getAsyncResource as R } from "@mittwald/react-use-promise";
29
+ import { u as V } from "./useSelector-DpU7_HMO.js";
30
+ import { P as bt } from "./PropsContextProvider-BsrVIv1a.js";
31
+ import { W as St } from "./Wrap-DGT1h1o3.js";
32
+ import { L as yt } from "./Link-DtSY1xrt.js";
33
+ import { I as Ct } from "./IconContextMenu-BF-N2Mtz.js";
34
+ import { d as b, a as M } from "./deepFindOfType-6pG0fH7S.js";
35
+ import "./context-BlNV7smK.js";
36
+ import { I as vt } from "./InlineCode-DZzyKdCm.js";
37
+ import { ListLoaderAsyncResource as Ft } from "./List/ListLoaderAsyncResource.js";
38
+ const W = Z({}), d = () => _(W).list, Tt = (n) => /* @__PURE__ */ r.createElement(r.Fragment, null, n.children()), Et = () => d().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(Tt, { key: e }, () => {
35
39
  t();
36
- })), w = {
40
+ })), wt = (n) => {
41
+ const { sorting: t } = n;
42
+ return /* @__PURE__ */ r.createElement(O, { id: t.getTableColumn().id }, t.name);
43
+ }, g = {
37
44
  "de-DE": {
38
45
  options: "Optionen",
39
46
  paginationInfo: "{visibleItemsCount} von insgesamt {totalItemsCount} angezeigt",
40
47
  paginationInfoFiltered: "{visibleItemsCount} von insgesamt {filteredItemsCount} (gefiltert aus {totalItemsCount}) angezeigt",
41
- showMore: "Mehr anzeigen"
48
+ resetAll: "Alles zurücksetzen",
49
+ showMore: "Mehr anzeigen",
50
+ sortedBy: "Sortiert nach: {property}",
51
+ sorting: "Sortierung"
42
52
  },
43
53
  "en-EN": {
44
54
  options: "Options",
45
55
  paginationInfo: "Showing {visibleRows} of {totalRows}",
46
56
  paginationInfoFiltered: "Showing {visibleItemsCount} of {filteredItemsCount} (unfiltered total count {totalItemsCount})",
47
- showMore: "Show more"
48
- }
49
- }, vt = (s) => {
50
- const t = G(w), e = g(), a = e.pagination, i = e.isFiltered() && !e.loader.manualFiltering, r = a.getTotalItemsCount(), l = a.getFilteredItemsCount(), c = a.getVisibleItemsCount();
51
- if (r === 0)
57
+ resetAll: "Reset filters",
58
+ showMore: "Show more",
59
+ sortedBy: "Sorted by: {property}",
60
+ sorting: "Sorting"
61
+ }
62
+ }, v = (n) => {
63
+ const { children: t, locales: e, variables: a } = n;
64
+ return K(e)(t, a);
65
+ }, Lt = () => {
66
+ const n = d(), t = n.sorting.map((a) => /* @__PURE__ */ r.createElement(wt, { sorting: a, key: a.getTableColumn().id }));
67
+ if (n.sorting.length === 0)
52
68
  return null;
53
- const b = i ? t("paginationInfoFiltered", {
54
- visibleItemsCount: c,
55
- filteredItemsCount: l,
56
- totalItemsCount: r
57
- }) : t("paginationInfo", {
58
- visibleItemsCount: c,
59
- totalItemsCount: r
60
- });
61
- return /* @__PURE__ */ n.createElement(Q, { ...s }, b);
62
- }, Ct = () => null, Pt = (s) => {
63
- const { sorting: t } = s, e = t.direction, a = e === "asc" ? Y : e === "desc" ? Z : Ct, i = e !== !1;
64
- return /* @__PURE__ */ n.createElement(
65
- f,
69
+ const e = n.sorting.filter((a) => a.enabled).map((a) => a.property);
70
+ return /* @__PURE__ */ r.createElement(U.MenuTrigger, null, /* @__PURE__ */ r.createElement(u, { style: "soft", size: "s", variant: "secondary" }, /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(v, { locales: g }, "sorting")), /* @__PURE__ */ r.createElement(q, null)), /* @__PURE__ */ r.createElement(
71
+ $,
66
72
  {
67
- variant: i ? "primary" : "secondary",
68
- onPress: t.getTableColumn().getToggleSortingHandler()
73
+ selectionMode: "single",
74
+ selectedKeys: e,
75
+ onAction: (a) => {
76
+ n.getSorting(String(a)).toggle();
77
+ }
69
78
  },
70
- t.getTableColumn().id,
71
- /* @__PURE__ */ n.createElement(a, { size: "s" })
72
- );
73
- }, Ft = "flow--list--filter-bar--sorting-picker", It = "flow--list--filter-bar--sorting-picker--items", M = {
74
- sortingPicker: Ft,
75
- items: It
76
- }, Tt = () => {
77
- const { sorting: s } = g(), t = s.map((e) => /* @__PURE__ */ n.createElement(Pt, { sorting: e, key: e.getTableColumn().id }));
78
- return /* @__PURE__ */ n.createElement("div", { className: M.sortingPicker }, /* @__PURE__ */ n.createElement("div", { className: M.items }, t));
79
- }, Lt = "flow--list--filter-bar--filter-picker-item", Et = "flow--list--filter-bar--filter-picker-item--items", A = {
80
- filterPickerItem: Lt,
81
- items: Et
82
- }, kt = (s) => {
83
- const { filter: t } = s, a = t.values.map((i) => /* @__PURE__ */ n.createElement(
84
- f,
79
+ t
80
+ ));
81
+ }, It = (n) => {
82
+ const { filter: t } = n, e = t.values.map((i) => /* @__PURE__ */ r.createElement(O, { key: t.getValueId(i), id: String(i) }, String(i))), a = t.values.filter((i) => t.isValueActive(i)).map((i) => String(i)), s = (i) => {
83
+ t.toggleValue(i);
84
+ };
85
+ return /* @__PURE__ */ r.createElement(U.MenuTrigger, null, /* @__PURE__ */ r.createElement(u, { style: "soft", size: "s", variant: "secondary" }, /* @__PURE__ */ r.createElement(f, null, t.name ?? t.property), /* @__PURE__ */ r.createElement(q, null)), /* @__PURE__ */ r.createElement(
86
+ $,
85
87
  {
86
- variant: t.isValueActive(i) ? "primary" : "secondary",
87
- key: t.getValueId(i),
88
- onPress: () => t.toggleValue(i)
88
+ onAction: s,
89
+ selectionMode: "multiple",
90
+ selectedKeys: a
89
91
  },
90
- String(i)
92
+ e
91
93
  ));
92
- return /* @__PURE__ */ n.createElement("div", { className: A.filterPickerItem }, /* @__PURE__ */ n.createElement(_, null, t.property), /* @__PURE__ */ n.createElement("div", { className: A.items }, a));
93
- }, Bt = () => g().filters.map((t) => /* @__PURE__ */ n.createElement(kt, { key: t.property, filter: t })), Dt = "flow--list--filter-bar", Nt = {
94
- filterBar: Dt
95
- }, Rt = (s) => {
96
- const { className: t } = s;
97
- return /* @__PURE__ */ n.createElement("div", { className: x(t, Nt.filterBar) }, /* @__PURE__ */ n.createElement(Tt, null), /* @__PURE__ */ n.createElement(Bt, null));
98
- }, Mt = "flow--list", At = "flow--list--filter-bar", zt = "flow--list--items", Vt = "flow--list--pagination-infos", xt = "flow--list--show-more-button", h = {
99
- list: Mt,
100
- filterBar: At,
101
- items: zt,
102
- paginationInfos: Vt,
103
- showMoreButton: xt
94
+ }, Bt = "flow--list--header", At = "flow--list--header--picker-list", N = {
95
+ header: Bt,
96
+ pickerList: At
97
+ }, Dt = "flow--list--header--active-filters", kt = "flow--list--header--clear-button", z = {
98
+ activeFilters: Dt,
99
+ clearButton: kt
100
+ }, Pt = () => {
101
+ const n = d(), t = n.filters.flatMap(
102
+ (s) => s.values.filter((i) => s.isValueActive(i)).map((i) => /* @__PURE__ */ r.createElement(
103
+ u,
104
+ {
105
+ style: "soft",
106
+ size: "s",
107
+ key: String(i),
108
+ onPress: () => s.deactivateValue(i)
109
+ },
110
+ /* @__PURE__ */ r.createElement(f, null, String(i)),
111
+ /* @__PURE__ */ r.createElement(D, null)
112
+ ))
113
+ ), e = n.sorting.filter((s) => s.enabled).map((s) => /* @__PURE__ */ r.createElement(u, { style: "soft", size: "s", key: s.property, onPress: () => s.clear() }, /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(
114
+ v,
115
+ {
116
+ locales: g,
117
+ variables: { property: s.name ?? s.property }
118
+ },
119
+ "sortedBy"
120
+ )), /* @__PURE__ */ r.createElement(D, null)));
121
+ if (t.length <= 0 && e.length <= 0)
122
+ return null;
123
+ const a = () => {
124
+ n.clearSorting(), n.clearFilters();
125
+ };
126
+ return /* @__PURE__ */ r.createElement("div", { className: z.activeFilters }, e, t, /* @__PURE__ */ r.createElement(
127
+ u,
128
+ {
129
+ className: z.clearButton,
130
+ size: "s",
131
+ style: "plain",
132
+ onPress: a
133
+ },
134
+ /* @__PURE__ */ r.createElement(v, { locales: g }, "resetAll")
135
+ ));
136
+ }, Rt = (n) => {
137
+ const { className: t } = n, a = d().filters.map((s) => /* @__PURE__ */ r.createElement(It, { key: s.property, filter: s }));
138
+ return /* @__PURE__ */ r.createElement("div", { className: H(t, N.header) }, /* @__PURE__ */ r.createElement("div", { className: N.pickerList }, /* @__PURE__ */ r.createElement(Lt, null), a), /* @__PURE__ */ r.createElement(Pt, null));
139
+ }, Vt = "flow--list", Mt = {
140
+ list: Vt
104
141
  };
105
142
  var m;
106
- let Ot = (m = class {
143
+ let Nt = (m = class {
107
144
  constructor(t, e, a) {
108
145
  o(this, "id");
109
146
  o(this, "data");
@@ -116,91 +153,100 @@ let Ot = (m = class {
116
153
  static fromRow(t, e) {
117
154
  return new m(t, e.id, e.original);
118
155
  }
119
- }, o(m, "fallbackRenderItemFn", (t) => J("pre", void 0, JSON.stringify(t))), m);
120
- class v {
156
+ }, o(m, "fallbackRenderItemFn", (t) => tt("pre", void 0, JSON.stringify(t))), m);
157
+ class F {
121
158
  constructor(t) {
122
159
  o(this, "list");
123
160
  this.list = t;
124
161
  }
125
162
  static useNew(t) {
126
- return new v(t);
163
+ return new F(t);
127
164
  }
128
165
  get entries() {
129
- return this.list.reactTable.table.getRowModel().rows.map((t) => Ot.fromRow(this, t));
166
+ return this.list.reactTable.table.getRowModel().rows.map((t) => Nt.fromRow(this, t));
130
167
  }
131
168
  }
132
- class Ut {
169
+ class zt {
133
170
  constructor(t, e = {}) {
171
+ o(this, "batchSize");
134
172
  o(this, "list");
135
- o(this, "initialPageSize");
136
- const { pageSize: a = 20 } = e;
137
- this.list = t, this.initialPageSize = a;
173
+ const { batchSize: a = 20 } = e;
174
+ this.list = t, this.batchSize = a, t.filters.forEach((s) => s.onFilterUpdated(() => this.reset()));
138
175
  }
139
- getPageIndex() {
140
- return this.list.reactTable.table.getState().pagination.pageIndex;
176
+ get reactTable() {
177
+ return this.list.reactTable.table;
141
178
  }
142
- hasNextPage() {
143
- return this.list.reactTable.table.getCanNextPage();
144
- }
145
- nextPage() {
146
- this.list.reactTable.table.nextPage();
147
- }
148
- updatePageSize(t) {
149
- this.list.reactTable.table.setPagination((e) => ({
150
- ...e,
151
- pageSize: t
152
- }));
179
+ getBatchIndex() {
180
+ return this.reactTable.getState().pagination.pageIndex;
153
181
  }
154
- getPageSize() {
155
- return this.list.reactTable.table.getState().pagination.pageSize;
182
+ hasNextBatch() {
183
+ return this.reactTable.getCanNextPage();
156
184
  }
157
185
  getTotalItemsCount() {
158
- return this.list.reactTable.table.getRowCount();
186
+ return this.reactTable.getRowCount();
159
187
  }
160
188
  getFilteredItemsCount() {
161
- return this.list.reactTable.table.getFilteredRowModel().rows.length;
189
+ return this.reactTable.getFilteredRowModel().rows.length;
162
190
  }
163
191
  getVisibleItemsCount() {
164
- return this.list.reactTable.table.getRowModel().rows.length;
192
+ return this.reactTable.getRowModel().rows.length;
165
193
  }
166
194
  updateItemTotalCount(t) {
167
- this.list.reactTable.table.setOptions((e) => ({
195
+ this.reactTable.setOptions((e) => ({
168
196
  ...e,
169
197
  rowCount: t
170
198
  }));
171
199
  }
200
+ reset() {
201
+ this.updateItemTotalCount(0), this.reactTable.setPagination(() => ({
202
+ pageIndex: 0,
203
+ pageSize: this.batchSize
204
+ }));
205
+ }
206
+ nextBatch() {
207
+ if (this.list.loader.manualPagination)
208
+ this.reactTable.nextPage();
209
+ else {
210
+ const t = this.reactTable.getState().pagination.pageSize + this.batchSize;
211
+ this.reactTable.setPagination((e) => ({
212
+ ...e,
213
+ pageSize: t
214
+ }));
215
+ }
216
+ }
172
217
  }
173
- const $t = (s, t) => s === t;
174
- class Ht {
218
+ const xt = (n, t) => n === t;
219
+ class Ut {
175
220
  constructor(t, e) {
176
221
  o(this, "_values");
177
222
  o(this, "list");
178
223
  o(this, "property");
179
224
  o(this, "mode");
180
225
  o(this, "matcher");
226
+ o(this, "name");
181
227
  o(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
182
- this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = e.values, this.matcher = e.matcher ?? $t;
228
+ this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = e.values, this.matcher = e.matcher ?? xt, this.name = e.name;
183
229
  }
184
230
  updateTableColumnDef(t) {
185
231
  t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
186
232
  }
187
233
  getReactTableFilterFn() {
188
234
  return (t, e, a) => this.checkFilterMatches(
189
- tt(t.original, this.property),
235
+ it(t.original, this.property),
190
236
  a
191
237
  );
192
238
  }
193
239
  checkFilterMatches(t, e) {
194
240
  if (e === null)
195
241
  return !0;
196
- const a = (r) => Array.isArray(r) ? r : [r], i = (r) => this.matcher(r, t);
242
+ const a = (i) => Array.isArray(i) ? i : [i], s = (i) => this.matcher(i, t);
197
243
  if (this.mode === "all")
198
- return a(e).every(i);
244
+ return a(e).every(s);
199
245
  if (this.mode === "some") {
200
- const r = a(e);
201
- return r.length === 0 || r.some(i);
246
+ const i = a(e);
247
+ return i.length === 0 || i.some(s);
202
248
  } else if (this.mode === "one")
203
- return i(e);
249
+ return s(e);
204
250
  throw new Error(`Unknown filter mode '${this.mode}'`);
205
251
  }
206
252
  getTableColumnFilter() {
@@ -229,20 +275,36 @@ class Ht {
229
275
  isActive() {
230
276
  return this.getArrayValue().length > 0;
231
277
  }
278
+ activateValue(t) {
279
+ const e = this.getArrayValue();
280
+ let a;
281
+ this.mode === "all" || this.mode === "some" ? a = [...e, t] : a = t, this.list.reactTable.getTableColumn(this.property).setFilterValue(a), this.onFilterUpdateCallbacks.forEach((s) => s());
282
+ }
283
+ deactivateValue(t) {
284
+ const e = this.getArrayValue();
285
+ let a;
286
+ this.mode === "all" || this.mode === "some" ? a = e.filter((s) => s !== t) : a = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(a), this.onFilterUpdateCallbacks.forEach((s) => s());
287
+ }
288
+ clearValues() {
289
+ let t;
290
+ this.mode === "all" || this.mode === "some" ? t = [] : t = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(t), this.onFilterUpdateCallbacks.forEach((e) => e());
291
+ }
232
292
  toggleValue(t) {
233
293
  const e = this.isValueActive(t), a = this.getArrayValue();
234
- let i;
235
- this.mode === "all" || this.mode === "some" ? e ? i = a.filter((r) => r !== t) : i = [...a, t] : i = e ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(i), this.onFilterUpdateCallbacks.forEach((r) => r());
294
+ let s;
295
+ this.mode === "all" || this.mode === "some" ? e ? s = a.filter((i) => i !== t) : s = [...a, t] : s = e ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
236
296
  }
237
297
  onFilterUpdated(t) {
238
298
  this.onFilterUpdateCallbacks.add(t);
239
299
  }
240
300
  }
241
- class qt {
301
+ class Ot {
242
302
  constructor(t, e) {
243
303
  o(this, "list");
244
304
  o(this, "property");
245
- this.list = t, this.property = e.property;
305
+ o(this, "name");
306
+ o(this, "enabledDirection");
307
+ this.list = t, this.property = e.property, this.name = e.name, this.enabledDirection = e.direction ?? "asc";
246
308
  }
247
309
  updateTableColumnDef(t) {
248
310
  t.enableSorting = !0;
@@ -253,9 +315,18 @@ class qt {
253
315
  getTableColumn() {
254
316
  return this.list.reactTable.getTableColumn(this.property);
255
317
  }
318
+ toggle() {
319
+ this.list.reactTable.getTableColumn(this.property).toggleSorting(this.enabledDirection === "desc", !1);
320
+ }
321
+ clear() {
322
+ this.list.reactTable.getTableColumn(this.property).clearSorting();
323
+ }
324
+ get enabled() {
325
+ return this.direction !== !1;
326
+ }
256
327
  }
257
- const jt = (s) => y(ct(s));
258
- class C {
328
+ const $t = (n) => C(gt(n));
329
+ class T {
259
330
  constructor(t, e = {}) {
260
331
  o(this, "list");
261
332
  o(this, "table");
@@ -265,36 +336,36 @@ class C {
265
336
  if (!e)
266
337
  return;
267
338
  const a = typeof t == "function" ? t(e) : t;
268
- ut(() => {
339
+ pt(() => {
269
340
  this.tableState.value = this.getUpdatedTableState(e, a);
270
341
  });
271
342
  });
272
- this.list = t, this.tableState = lt(() => ({ value: void 0 })), this.table = this.useReactTable(e);
343
+ this.list = t, this.tableState = ht(() => ({ value: void 0 })), this.table = this.useReactTable(e);
273
344
  }
274
345
  static useNew(t, e = {}) {
275
- return new C(t, e);
346
+ return new T(t, e);
276
347
  }
277
348
  useReactTable(t = {}) {
278
- const e = this.list.loader.useData(), a = et({
349
+ const e = this.list.loader.useData(), a = ot({
279
350
  data: e,
280
351
  initialState: {
281
352
  pagination: {
282
- pageSize: this.list.pagination.initialPageSize
353
+ pageSize: this.list.batches.batchSize
283
354
  }
284
355
  },
285
356
  columns: this.getTableColumnDefs(),
286
- getCoreRowModel: at(),
287
- getSortedRowModel: st(),
288
- getFilteredRowModel: it(),
289
- getPaginationRowModel: nt(),
290
- getFacetedUniqueValues: ot(),
357
+ getCoreRowModel: lt(),
358
+ getSortedRowModel: ct(),
359
+ getFilteredRowModel: ut(),
360
+ getPaginationRowModel: mt(),
361
+ getFacetedUniqueValues: dt(),
291
362
  onStateChange: this.onTableStateChange,
292
363
  ...t
293
364
  });
294
365
  return this.useUpdateTableState(a), a;
295
366
  }
296
367
  useUpdateTableState(t) {
297
- jt(() => {
368
+ $t(() => {
298
369
  const e = this.tableState.value;
299
370
  e ? t.setOptions((a) => ({
300
371
  ...a,
@@ -307,20 +378,20 @@ class C {
307
378
  }
308
379
  getTableColumn(t) {
309
380
  const e = this.table.getColumn(t);
310
- return rt(!!e, `Column #${t} is not defined`), e;
381
+ return J(!!e, `Column #${t} is not defined`), e;
311
382
  }
312
383
  getTableColumnDefs() {
313
384
  const t = /* @__PURE__ */ new Map(), e = (a) => {
314
- const i = t.get(a);
315
- if (i)
316
- return i;
317
- const r = {
385
+ const s = t.get(a);
386
+ if (s)
387
+ return s;
388
+ const i = {
318
389
  id: a,
319
390
  accessorKey: a,
320
391
  enableSorting: !1,
321
392
  enableColumnFilter: !1
322
393
  };
323
- return t.set(a, r), r;
394
+ return t.set(a, i), i;
324
395
  };
325
396
  return this.list.filters.forEach(
326
397
  (a) => a.updateTableColumnDef(e(a.property))
@@ -329,23 +400,23 @@ class C {
329
400
  ), Array.from(t.values());
330
401
  }
331
402
  }
332
- class P {
403
+ class E {
333
404
  constructor() {
334
405
  o(this, "dataBatches", []);
335
406
  o(this, "prevDataBatches", []);
336
407
  o(this, "batchLoadingStates", []);
337
- mt(this, {
408
+ ft(this, {
338
409
  dataBatches: k,
339
410
  batchLoadingStates: k,
340
- mergedData: B,
341
- isLoading: B,
342
- reset: S.bound,
343
- setDataBatch: S.bound,
344
- setBatchLoadingState: S.bound
411
+ mergedData: P,
412
+ isLoading: P,
413
+ reset: y.bound,
414
+ setDataBatch: y.bound,
415
+ setBatchLoadingState: y.bound
345
416
  });
346
417
  }
347
418
  static useNew() {
348
- return W(new P())[0];
419
+ return et(new E())[0];
349
420
  }
350
421
  reset() {
351
422
  this.batchLoadingStates = [], this.dataBatches = [];
@@ -360,17 +431,17 @@ class P {
360
431
  return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((e) => e);
361
432
  }
362
433
  useMergedData() {
363
- return N(() => this.mergedData);
434
+ return V(() => this.mergedData);
364
435
  }
365
436
  get isLoading() {
366
437
  return this.batchLoadingStates.some((t) => t === "loading");
367
438
  }
368
439
  useIsLoading() {
369
- return N(() => this.isLoading);
440
+ return V(() => this.isLoading);
370
441
  }
371
442
  }
372
- const Jt = [];
373
- class F {
443
+ const Ht = [];
444
+ class w {
374
445
  constructor(t, e = {}) {
375
446
  o(this, "list");
376
447
  o(this, "dataSource");
@@ -379,18 +450,15 @@ class F {
379
450
  o(this, "manualPagination");
380
451
  o(this, "loaderState");
381
452
  const { source: a } = e;
382
- this.dataSource = a ?? { staticData: Jt };
383
- const i = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, r = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, l = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
384
- this.list = t, this.loaderState = P.useNew(), this.manualPagination = i ?? !1, this.manualFiltering = r ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((c) => c.onFilterUpdated(() => this.reset()));
453
+ this.dataSource = a ?? { staticData: Ht };
454
+ const s = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, i = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, l = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
455
+ this.list = t, this.loaderState = E.useNew(), this.manualPagination = s ?? !1, this.manualFiltering = i ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((h) => h.onFilterUpdated(() => this.reset()));
385
456
  }
386
457
  static useNew(t, e = {}) {
387
- return new F(t, e);
458
+ return new w(t, e);
388
459
  }
389
460
  reset() {
390
- this.loaderState.reset(), this.list.pagination.updateItemTotalCount(0), this.list.reactTable.table.setPagination(() => ({
391
- pageIndex: 0,
392
- pageSize: this.list.pagination.initialPageSize
393
- }));
461
+ this.loaderState.reset();
394
462
  }
395
463
  useIsLoading() {
396
464
  return this.loaderState.useIsLoading();
@@ -399,31 +467,31 @@ class F {
399
467
  return this.loaderState.useMergedData();
400
468
  }
401
469
  getLoaderInvocationHooks() {
402
- return X(this.list.pagination.getPageIndex() + 1, (e) => e).map((e) => () => {
403
- this.useLoadPage(e);
470
+ return rt(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
471
+ this.useLoadBatch(e);
404
472
  });
405
473
  }
406
- useLoadPage(t) {
407
- const e = this.getPageDataAsyncResource(t), a = e.use({
474
+ useLoadBatch(t) {
475
+ const e = this.getBatchDataAsyncResource(t), a = e.use({
408
476
  useSuspense: !1
409
477
  });
410
- y(() => {
478
+ C(() => {
411
479
  if (!a.hasValue)
412
480
  return;
413
- const { data: i, itemTotalCount: r } = a.value;
414
- this.loaderState.setDataBatch(t, i), r !== void 0 && this.list.pagination.updateItemTotalCount(r);
415
- }, [t, a.maybeValue]), y(() => (this.loaderState.setBatchLoadingState(
481
+ const { data: s, itemTotalCount: i } = a.value;
482
+ this.loaderState.setDataBatch(t, s), i !== void 0 && this.list.batches.updateItemTotalCount(i);
483
+ }, [t, a.maybeValue]), C(() => (this.loaderState.setBatchLoadingState(
416
484
  t,
417
485
  e.state.value
418
- ), e.state.observe((i) => {
419
- this.loaderState.setBatchLoadingState(t, i);
486
+ ), e.state.observe((s) => {
487
+ this.loaderState.setBatchLoadingState(t, s);
420
488
  })), [e, t]);
421
489
  }
422
490
  getDataLoaderOptions(t) {
423
491
  return {
424
492
  pagination: this.manualPagination ? {
425
- limit: this.list.pagination.initialPageSize,
426
- offset: this.list.pagination.initialPageSize * t
493
+ limit: this.list.batches.batchSize,
494
+ offset: this.list.batches.batchSize * t
427
495
  } : void 0,
428
496
  sorting: this.manualSorting ? Object.fromEntries(
429
497
  this.list.sorting.filter((e) => e.direction !== !1).map((e) => [e.property, e.direction])
@@ -436,188 +504,210 @@ class F {
436
504
  ) : void 0
437
505
  };
438
506
  }
439
- getPageDataAsyncResource(t) {
507
+ getBatchDataAsyncResource(t) {
440
508
  const e = this.dataSource, a = this.getDataLoaderOptions(t);
441
509
  if ("staticData" in e) {
442
- const i = e.staticData;
443
- return D(
510
+ const s = e.staticData;
511
+ return R(
444
512
  async () => ({
445
- data: i,
446
- itemTotalCount: i.length
513
+ data: s,
514
+ itemTotalCount: s.length
447
515
  }),
448
516
  []
449
517
  );
450
518
  }
451
519
  if ("asyncLoader" in e) {
452
- const i = e.asyncLoader;
453
- return D(i, [a]);
520
+ const s = e.asyncLoader;
521
+ return R(s, [a]);
454
522
  }
455
523
  if ("asyncResourceFactory" in e) {
456
- const i = e.asyncResourceFactory;
457
- return i(a);
524
+ const s = e.asyncResourceFactory;
525
+ return s(a);
458
526
  }
459
527
  throw new Error("Unknown data source");
460
528
  }
461
- loadMore() {
462
- this.manualPagination ? this.list.pagination.nextPage() : this.list.pagination.updatePageSize(
463
- this.list.pagination.getPageSize() + this.list.pagination.initialPageSize
464
- );
465
- }
466
529
  }
467
- let Wt = class U {
530
+ let qt = class G {
468
531
  constructor(t) {
469
532
  o(this, "filters");
470
533
  o(this, "sorting");
471
534
  o(this, "items");
472
535
  o(this, "render");
473
536
  o(this, "reactTable");
474
- o(this, "pagination");
537
+ o(this, "batches");
475
538
  o(this, "loader");
476
- const {
477
- render: e,
478
- filters: a = [],
479
- sorting: i = [],
480
- pagination: r,
481
- enableMultiSort: l = !1
482
- } = t;
483
- this.render = e, this.items = v.useNew(this), this.filters = a.map((c) => new Ht(this, c)), this.sorting = i.map((c) => new qt(this, c)), this.pagination = new Ut(this, r), this.loader = F.useNew(this, t.loader), this.reactTable = C.useNew(this, {
484
- enableMultiSort: l,
539
+ const { render: e, filters: a = [], sorting: s = [], batchesController: i } = t;
540
+ this.render = e, this.items = F.useNew(this), this.filters = a.map((l) => new Ut(this, l)), this.sorting = s.map((l) => new Ot(this, l)), this.batches = new zt(this, i), this.loader = w.useNew(this, t.loader), this.reactTable = T.useNew(this, {
485
541
  manualFiltering: this.loader.manualFiltering,
486
542
  manualPagination: this.loader.manualPagination,
487
543
  manualSorting: this.loader.manualSorting
488
544
  });
489
545
  }
490
546
  static useNew(t) {
491
- return new U(t);
547
+ return new G(t);
492
548
  }
493
549
  isFiltered() {
494
550
  return this.filters.some((t) => t.isActive());
495
551
  }
552
+ getSorting(t) {
553
+ const e = this.sorting.find((a) => a.property === t);
554
+ return J(!!e, `Could not get Sorting (property: ${t})`), e;
555
+ }
556
+ clearSorting() {
557
+ return this.sorting.forEach((t) => t.clear());
558
+ }
559
+ clearFilters() {
560
+ return this.filters.forEach((t) => t.clearValues());
561
+ }
496
562
  };
497
- const Kt = (s) => {
498
- const t = V(w), e = g(), a = e.loader.useIsLoading(), r = e.pagination.hasNextPage();
499
- return /* @__PURE__ */ n.createElement(
500
- f,
501
- {
502
- isPending: a,
503
- ...s,
504
- onPress: () => e.loader.loadMore(),
505
- style: "plain",
506
- isDisabled: !r
507
- },
508
- t.format("showMore")
509
- );
510
- }, Gt = "flow--list--items", Qt = "flow--list--items--is-loading", z = {
511
- items: Gt,
512
- isLoading: Qt
513
- }, Xt = "flow--list--item", Yt = "flow--list--item--options-button", Zt = "flow--list--item--avatar", _t = "flow--list--item--text", te = "flow--list--item--heading", ee = "flow--list--item--content", u = {
514
- item: Xt,
515
- optionsButton: Yt,
516
- avatar: Zt,
517
- text: _t,
518
- heading: te,
519
- content: ee
520
- }, ae = (s, t) => !!p(s, t), se = (s) => {
521
- const { className: t, children: e } = s, a = V(w);
522
- return /* @__PURE__ */ n.createElement(ft, null, /* @__PURE__ */ n.createElement(
523
- f,
563
+ const Kt = "flow--list--items--item-list", jt = "flow--list--items--is-loading", x = {
564
+ itemList: Kt,
565
+ isLoading: jt
566
+ }, Jt = "flow--list--items--item", Wt = "flow--list--items--options-button", Gt = "flow--list--items--avatar", Qt = "flow--list--items--text", Xt = "flow--list--items--status-badge", Yt = "flow--list--items--heading", Zt = "flow--list--items--content", c = {
567
+ item: Jt,
568
+ optionsButton: Wt,
569
+ avatar: Gt,
570
+ text: Qt,
571
+ statusBadge: Xt,
572
+ heading: Yt,
573
+ content: Zt
574
+ }, _t = (n) => {
575
+ const { className: t, children: e } = n, a = j(g);
576
+ return /* @__PURE__ */ r.createElement(st, null, /* @__PURE__ */ r.createElement(
577
+ u,
524
578
  {
525
579
  style: "plain",
526
580
  className: t,
527
581
  "aria-label": a.format("options")
528
582
  },
529
- /* @__PURE__ */ n.createElement(pt, null)
583
+ /* @__PURE__ */ r.createElement(Ct, null)
530
584
  ), e);
531
- }, ie = (s) => {
532
- const { children: t } = s, e = ae(t, ht), a = {
585
+ }, te = (n) => {
586
+ const { children: t } = n, e = nt(t, yt), a = {
533
587
  Avatar: {
534
- className: u.avatar
588
+ className: c.avatar
535
589
  },
536
590
  Heading: {
537
- className: u.heading
591
+ className: c.heading,
592
+ level: 3
538
593
  },
539
594
  Text: {
540
- className: u.text
595
+ className: c.text
596
+ },
597
+ StatusBadge: {
598
+ className: c.statusBadge
541
599
  },
542
600
  Content: {
543
- className: u.content
601
+ className: c.content
544
602
  },
545
603
  ContextMenu: {
546
604
  placement: "bottom end",
547
- hoc: (r) => /* @__PURE__ */ n.createElement(se, { className: u.optionsButton }, r)
605
+ hoc: (i) => /* @__PURE__ */ r.createElement(_t, { className: c.optionsButton }, i)
548
606
  }
549
- }, i = {
607
+ }, s = {
550
608
  ...a,
551
609
  Link: {
552
- className: u.item,
610
+ className: c.item,
553
611
  unstyled: !0,
554
612
  ...a
555
613
  }
556
614
  };
557
- return /* @__PURE__ */ n.createElement(dt, { if: !e }, /* @__PURE__ */ n.createElement("div", { className: u.item }, /* @__PURE__ */ n.createElement(gt, { props: i }, t)));
558
- }, ne = (s) => {
559
- const { className: t } = s, e = g(), a = e.loader.useIsLoading(), i = e.items.entries.map((l) => /* @__PURE__ */ n.createElement(ie, { key: l.id }, /* @__PURE__ */ n.createElement(K, null, l.render()))), r = x(
560
- z.items,
615
+ return /* @__PURE__ */ r.createElement(St, { if: !e }, /* @__PURE__ */ r.createElement("div", { className: c.item }, /* @__PURE__ */ r.createElement(bt, { props: s }, t)));
616
+ }, ee = (n) => /* @__PURE__ */ r.createElement(vt, null, JSON.stringify(n.data)), ae = (n) => {
617
+ const { className: t } = n, e = d(), a = e.loader.useIsLoading(), s = e.items.entries.map((l) => /* @__PURE__ */ r.createElement(te, { key: l.id }, /* @__PURE__ */ r.createElement(at, null, l.render()))), i = H(
618
+ x.itemList,
561
619
  t,
562
- a && z.isLoading
620
+ a && x.isLoading
563
621
  );
564
- return /* @__PURE__ */ n.createElement("div", { className: r }, i);
622
+ return /* @__PURE__ */ r.createElement("div", { className: i }, s);
565
623
  };
566
- function oe(s) {
624
+ function se(n) {
567
625
  return null;
568
626
  }
569
- function re(s) {
627
+ function re(n) {
570
628
  return null;
571
629
  }
572
- function le(s) {
630
+ function ne(n) {
573
631
  return null;
574
632
  }
575
- function ce(s) {
633
+ function ie(n) {
576
634
  return null;
577
635
  }
578
- function ue(s) {
636
+ function oe(n) {
579
637
  return null;
580
638
  }
581
- const me = (s) => /* @__PURE__ */ n.createElement(bt, null, JSON.stringify(s.data));
582
- function $e(s) {
583
- var I, T, L, E;
584
- const { children: t, ...e } = s, a = (I = p(t, oe)) == null ? void 0 : I.props, i = (T = p(
639
+ const le = "flow--list--footer", ce = {
640
+ footer: le
641
+ }, ue = (n) => {
642
+ const t = K(g), e = d(), a = e.batches, s = e.isFiltered() && !e.loader.manualFiltering, i = a.getTotalItemsCount(), l = a.getFilteredItemsCount(), h = a.getVisibleItemsCount();
643
+ if (i === 0)
644
+ return null;
645
+ const S = s ? t("paginationInfoFiltered", {
646
+ visibleItemsCount: h,
647
+ filteredItemsCount: l,
648
+ totalItemsCount: i
649
+ }) : t("paginationInfo", {
650
+ visibleItemsCount: h,
651
+ totalItemsCount: i
652
+ });
653
+ return /* @__PURE__ */ r.createElement(f, { ...n }, S);
654
+ }, me = (n) => {
655
+ const t = j(g), e = d(), a = e.loader.useIsLoading(), i = e.batches.hasNextBatch();
656
+ return /* @__PURE__ */ r.createElement(
657
+ u,
658
+ {
659
+ isPending: a,
660
+ ...n,
661
+ onPress: () => e.batches.nextBatch(),
662
+ style: "plain",
663
+ isDisabled: !i,
664
+ size: "s"
665
+ },
666
+ t.format("showMore")
667
+ );
668
+ }, de = () => /* @__PURE__ */ r.createElement("div", { className: ce.footer }, /* @__PURE__ */ r.createElement(ue, null), /* @__PURE__ */ r.createElement(me, null));
669
+ function je(n) {
670
+ var L, I, B, A;
671
+ const { children: t, batchSize: e, ...a } = n, s = (L = b(t, se)) == null ? void 0 : L.props, i = (I = b(
585
672
  t,
586
- St
587
- )) == null ? void 0 : T.props, r = (L = p(t, ue)) == null ? void 0 : L.props, l = {
588
- source: a ? {
589
- ...a,
590
- asyncLoader: a.children
673
+ Ft
674
+ )) == null ? void 0 : I.props, l = (B = b(t, oe)) == null ? void 0 : B.props, h = {
675
+ source: s ? {
676
+ ...s,
677
+ asyncLoader: s.children
591
678
  } : i ? {
592
679
  ...i,
593
680
  asyncResourceFactory: i.children
594
- } : r ? {
595
- staticData: r.data
681
+ } : l ? {
682
+ staticData: l.data
596
683
  } : void 0
597
- }, c = (d) => /* @__PURE__ */ n.createElement(me, { data: d }), b = Wt.useNew({
598
- loader: l,
599
- filters: R(t, re).map((d) => d.props),
600
- sorting: R(t, le).map((d) => d.props),
601
- render: ((E = p(t, ce)) == null ? void 0 : E.props.children) ?? c,
602
- ...e
684
+ }, S = (p) => /* @__PURE__ */ r.createElement(ee, { data: p }), Q = qt.useNew({
685
+ loader: h,
686
+ filters: M(t, re).map((p) => p.props),
687
+ sorting: M(t, ne).map((p) => p.props),
688
+ render: ((A = b(t, ie)) == null ? void 0 : A.props.children) ?? S,
689
+ ...a,
690
+ batchesController: {
691
+ batchSize: e
692
+ }
603
693
  });
604
- return /* @__PURE__ */ n.createElement(
605
- O.Provider,
694
+ return /* @__PURE__ */ r.createElement(
695
+ W.Provider,
606
696
  {
607
697
  value: {
608
- list: b
698
+ list: Q
609
699
  }
610
700
  },
611
- /* @__PURE__ */ n.createElement(wt, null),
612
- /* @__PURE__ */ n.createElement("div", { className: h.list }, /* @__PURE__ */ n.createElement(Rt, { className: h.filterBar }), /* @__PURE__ */ n.createElement(ne, { className: h.rows }), /* @__PURE__ */ n.createElement(vt, { className: h.paginationInfos }), /* @__PURE__ */ n.createElement(Kt, { className: h.showMoreButton }))
701
+ /* @__PURE__ */ r.createElement(Et, null),
702
+ /* @__PURE__ */ r.createElement("div", { className: Mt.list }, /* @__PURE__ */ r.createElement(Rt, null), /* @__PURE__ */ r.createElement(ae, null), /* @__PURE__ */ r.createElement(de, null))
613
703
  );
614
704
  }
615
705
  export {
616
- $e as List,
706
+ je as List,
617
707
  re as ListFilter,
618
- ce as ListItemView,
619
- oe as ListLoaderAsync,
620
- le as ListSorting,
621
- ue as ListStaticData,
622
- $e as default
708
+ ie as ListItemView,
709
+ se as ListLoaderAsync,
710
+ ne as ListSorting,
711
+ oe as ListStaticData,
712
+ je as default
623
713
  };