@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.
- package/dist/ButtonGroup.js +13 -13
- package/dist/{Checkbox-DBT4VBSr.js → Checkbox-gCtHl4pE.js} +8 -7
- package/dist/Checkbox.js +1 -1
- package/dist/{CheckboxButton-CoEvnLRt.js → CheckboxButton-CW6TfZFj.js} +1 -1
- package/dist/CheckboxButton.js +1 -1
- package/dist/CheckboxGroup.js +1 -1
- package/dist/ContextMenu.js +7 -24
- package/dist/ContextMenuItem-DDPBrwII.js +67 -0
- package/dist/IconCheckboxEmpty-BNFRkCm2.js +10 -0
- package/dist/IconCheckboxIndeterminate-Bsk1h92j.js +9 -0
- package/dist/IconChevronDown-C3dBD472.js +9 -0
- package/dist/IconPlus-DXNLmWa2.js +11 -0
- package/dist/Icons.js +69 -67
- package/dist/List.js +366 -276
- package/dist/NumberField.js +7 -7
- package/dist/styles.css +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Content/Content.d.ts +1 -1
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +2 -2
- package/dist/types/components/ContextMenu/components/ContextMenuItem/ContextMenuItem.d.ts +2 -2
- package/dist/types/components/ContextMenu/components/ContextMenuItem/ContextMenuItemContent.d.ts +6 -0
- package/dist/types/components/ContextMenu/stories/Default.stories.d.ts +2 -0
- package/dist/types/components/CopyButton/CopyButton.d.ts +1 -1
- package/dist/types/components/FieldError/FieldError.d.ts +1 -1
- package/dist/types/components/Header/Header.d.ts +1 -1
- package/dist/types/components/Icon/Icon.d.ts +1 -1
- package/dist/types/components/Icon/components/icons/IconSubdomain.d.ts +5 -0
- package/dist/types/components/Icon/components/icons/index.d.ts +1 -0
- package/dist/types/components/Image/Image.d.ts +1 -1
- package/dist/types/components/Initials/Initials.d.ts +1 -1
- package/dist/types/components/InlineAlert/InlineAlert.d.ts +1 -1
- package/dist/types/components/Label/Label.d.ts +1 -1
- package/dist/types/components/LayoutCard/LayoutCard.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +1 -2
- package/dist/types/components/List/List.d.ts +3 -4
- package/dist/types/components/List/components/Footer/Footer/Footer.d.ts +4 -0
- package/dist/types/components/List/components/Footer/Footer/index.d.ts +4 -0
- package/dist/types/components/List/components/{PaginationInfos → Footer/PaginationInfos}/PaginationInfos.d.ts +1 -1
- package/dist/types/components/List/components/Footer/ShowNextBatchButton/ShowNextBatchButton.d.ts +5 -0
- package/dist/types/components/List/components/Footer/ShowNextBatchButton/index.d.ts +4 -0
- package/dist/types/components/List/components/Header/ActiveFilters/ActiveFilters.d.ts +4 -0
- package/dist/types/components/List/components/Header/ActiveFilters/index.d.ts +4 -0
- package/dist/types/components/List/components/Header/FilterPicker/FilterPicker.d.ts +9 -0
- package/dist/types/components/List/components/{Items/Items.d.ts → Header/Header/Header.d.ts} +2 -2
- package/dist/types/components/List/components/Header/Header/index.d.ts +4 -0
- package/dist/types/components/List/components/{ListFilter.d.ts → Header/ListFilter.d.ts} +1 -1
- package/dist/types/components/List/components/{ListSorting.d.ts → Header/ListSorting.d.ts} +1 -1
- package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPickerItem/SortingPickerItem.d.ts +2 -2
- package/dist/types/components/List/components/{Item → Items/Item}/FallbackRenderer.d.ts +1 -1
- package/dist/types/components/List/components/{Item → Items/Item}/Item.d.ts +1 -1
- package/dist/types/components/List/components/{Item → Items/Item}/index.d.ts +1 -0
- package/dist/types/components/List/components/{FilterBar/FilterBar.d.ts → Items/ItemList/ItemList.d.ts} +2 -2
- package/dist/types/components/List/components/Items/ItemList/index.d.ts +4 -0
- package/dist/types/components/List/components/{ListItemView.d.ts → Items/ListItemView.d.ts} +1 -1
- package/dist/types/components/List/index.d.ts +3 -3
- package/dist/types/components/List/model/List.d.ts +6 -3
- package/dist/types/components/List/model/filter/Filter.d.ts +4 -0
- package/dist/types/components/List/model/filter/types.d.ts +1 -0
- package/dist/types/components/List/model/loading/IncrementalLoader.d.ts +2 -3
- package/dist/types/components/List/model/pagination/BatchesController.d.ts +17 -0
- package/dist/types/components/List/model/pagination/types.d.ts +2 -2
- package/dist/types/components/List/model/sorting/Sorting.d.ts +5 -0
- package/dist/types/components/List/model/sorting/types.d.ts +3 -0
- package/dist/types/components/List/model/types.d.ts +2 -3
- package/dist/types/components/List/testData/domainApi.d.ts +25 -0
- package/dist/types/components/RadioGroup/components/Radio/Radio.d.ts +1 -2
- package/dist/types/components/StatusBadge/StatusBadge.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Text/Text.d.ts +1 -1
- package/dist/types/lib/react/components/Translate/Translate.d.ts +10 -0
- package/dist/types/lib/react/components/Translate/index.d.ts +4 -0
- package/dist/types/lib/types/props.d.ts +1 -3
- package/package.json +4 -4
- package/dist/IconCheckboxIndeterminate-B6FOeb87.js +0 -11
- package/dist/IconChevronUp-DJu_PD8w.js +0 -10
- package/dist/IconPlus-BZwxakYk.js +0 -10
- package/dist/types/components/List/components/FilterBar/components/FilterPicker/FilterPicker.d.ts +0 -3
- package/dist/types/components/List/components/FilterBar/components/FilterPickerItem/FilterPickerItem.d.ts +0 -9
- package/dist/types/components/List/components/FilterBar/components/FilterPickerItem/index.d.ts +0 -4
- package/dist/types/components/List/components/FilterBar/index.d.ts +0 -4
- package/dist/types/components/List/components/Items/index.d.ts +0 -4
- package/dist/types/components/List/components/ShowMoreItemsButton/ShowMoreItemsButton.d.ts +0 -5
- package/dist/types/components/List/components/ShowMoreItemsButton/index.d.ts +0 -4
- package/dist/types/components/List/model/pagination/Pagination.d.ts +0 -17
- package/dist/types/components/List/testData/userApi.d.ts +0 -57
- /package/dist/types/components/List/components/{PaginationInfos → Footer/PaginationInfos}/index.d.ts +0 -0
- /package/dist/types/components/List/components/{FilterBar/components → Header}/FilterPicker/index.d.ts +0 -0
- /package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPicker/SortingPicker.d.ts +0 -0
- /package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPicker/index.d.ts +0 -0
- /package/dist/types/components/List/components/{FilterBar/components → Header}/SortingPickerItem/index.d.ts +0 -0
- /package/dist/types/components/List/components/{OptionsButton → Items/OptionsButton}/OptionsButton.d.ts +0 -0
- /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
|
|
4
|
-
var
|
|
5
|
-
var o = (
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
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
|
|
11
|
+
import { times as rt } from "remeda";
|
|
16
12
|
import "@mittwald/react-tunnel";
|
|
17
|
-
import { a as
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
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
|
-
})),
|
|
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
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
68
|
-
|
|
73
|
+
selectionMode: "single",
|
|
74
|
+
selectedKeys: e,
|
|
75
|
+
onAction: (a) => {
|
|
76
|
+
n.getSorting(String(a)).toggle();
|
|
77
|
+
}
|
|
69
78
|
},
|
|
70
|
-
t
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
onAction: s,
|
|
89
|
+
selectionMode: "multiple",
|
|
90
|
+
selectedKeys: a
|
|
89
91
|
},
|
|
90
|
-
|
|
92
|
+
e
|
|
91
93
|
));
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
|
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) =>
|
|
120
|
-
class
|
|
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
|
|
163
|
+
return new F(t);
|
|
127
164
|
}
|
|
128
165
|
get entries() {
|
|
129
|
-
return this.list.reactTable.table.getRowModel().rows.map((t) =>
|
|
166
|
+
return this.list.reactTable.table.getRowModel().rows.map((t) => Nt.fromRow(this, t));
|
|
130
167
|
}
|
|
131
168
|
}
|
|
132
|
-
class
|
|
169
|
+
class zt {
|
|
133
170
|
constructor(t, e = {}) {
|
|
171
|
+
o(this, "batchSize");
|
|
134
172
|
o(this, "list");
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
140
|
-
return this.list.reactTable.table
|
|
176
|
+
get reactTable() {
|
|
177
|
+
return this.list.reactTable.table;
|
|
141
178
|
}
|
|
142
|
-
|
|
143
|
-
return this.
|
|
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
|
-
|
|
155
|
-
return this.
|
|
182
|
+
hasNextBatch() {
|
|
183
|
+
return this.reactTable.getCanNextPage();
|
|
156
184
|
}
|
|
157
185
|
getTotalItemsCount() {
|
|
158
|
-
return this.
|
|
186
|
+
return this.reactTable.getRowCount();
|
|
159
187
|
}
|
|
160
188
|
getFilteredItemsCount() {
|
|
161
|
-
return this.
|
|
189
|
+
return this.reactTable.getFilteredRowModel().rows.length;
|
|
162
190
|
}
|
|
163
191
|
getVisibleItemsCount() {
|
|
164
|
-
return this.
|
|
192
|
+
return this.reactTable.getRowModel().rows.length;
|
|
165
193
|
}
|
|
166
194
|
updateItemTotalCount(t) {
|
|
167
|
-
this.
|
|
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
|
|
174
|
-
class
|
|
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 ??
|
|
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
|
-
|
|
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 = (
|
|
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(
|
|
244
|
+
return a(e).every(s);
|
|
199
245
|
if (this.mode === "some") {
|
|
200
|
-
const
|
|
201
|
-
return
|
|
246
|
+
const i = a(e);
|
|
247
|
+
return i.length === 0 || i.some(s);
|
|
202
248
|
} else if (this.mode === "one")
|
|
203
|
-
return
|
|
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
|
|
235
|
-
this.mode === "all" || this.mode === "some" ? e ?
|
|
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
|
|
301
|
+
class Ot {
|
|
242
302
|
constructor(t, e) {
|
|
243
303
|
o(this, "list");
|
|
244
304
|
o(this, "property");
|
|
245
|
-
this
|
|
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
|
|
258
|
-
class
|
|
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
|
-
|
|
339
|
+
pt(() => {
|
|
269
340
|
this.tableState.value = this.getUpdatedTableState(e, a);
|
|
270
341
|
});
|
|
271
342
|
});
|
|
272
|
-
this.list = t, this.tableState =
|
|
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
|
|
346
|
+
return new T(t, e);
|
|
276
347
|
}
|
|
277
348
|
useReactTable(t = {}) {
|
|
278
|
-
const e = this.list.loader.useData(), a =
|
|
349
|
+
const e = this.list.loader.useData(), a = ot({
|
|
279
350
|
data: e,
|
|
280
351
|
initialState: {
|
|
281
352
|
pagination: {
|
|
282
|
-
pageSize: this.list.
|
|
353
|
+
pageSize: this.list.batches.batchSize
|
|
283
354
|
}
|
|
284
355
|
},
|
|
285
356
|
columns: this.getTableColumnDefs(),
|
|
286
|
-
getCoreRowModel:
|
|
287
|
-
getSortedRowModel:
|
|
288
|
-
getFilteredRowModel:
|
|
289
|
-
getPaginationRowModel:
|
|
290
|
-
getFacetedUniqueValues:
|
|
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
|
-
|
|
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
|
|
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
|
|
315
|
-
if (
|
|
316
|
-
return
|
|
317
|
-
const
|
|
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,
|
|
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
|
|
403
|
+
class E {
|
|
333
404
|
constructor() {
|
|
334
405
|
o(this, "dataBatches", []);
|
|
335
406
|
o(this, "prevDataBatches", []);
|
|
336
407
|
o(this, "batchLoadingStates", []);
|
|
337
|
-
|
|
408
|
+
ft(this, {
|
|
338
409
|
dataBatches: k,
|
|
339
410
|
batchLoadingStates: k,
|
|
340
|
-
mergedData:
|
|
341
|
-
isLoading:
|
|
342
|
-
reset:
|
|
343
|
-
setDataBatch:
|
|
344
|
-
setBatchLoadingState:
|
|
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
|
|
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
|
|
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
|
|
440
|
+
return V(() => this.isLoading);
|
|
370
441
|
}
|
|
371
442
|
}
|
|
372
|
-
const
|
|
373
|
-
class
|
|
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:
|
|
383
|
-
const
|
|
384
|
-
this.list = t, this.loaderState =
|
|
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
|
|
458
|
+
return new w(t, e);
|
|
388
459
|
}
|
|
389
460
|
reset() {
|
|
390
|
-
this.loaderState.reset()
|
|
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
|
|
403
|
-
this.
|
|
470
|
+
return rt(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
|
|
471
|
+
this.useLoadBatch(e);
|
|
404
472
|
});
|
|
405
473
|
}
|
|
406
|
-
|
|
407
|
-
const e = this.
|
|
474
|
+
useLoadBatch(t) {
|
|
475
|
+
const e = this.getBatchDataAsyncResource(t), a = e.use({
|
|
408
476
|
useSuspense: !1
|
|
409
477
|
});
|
|
410
|
-
|
|
478
|
+
C(() => {
|
|
411
479
|
if (!a.hasValue)
|
|
412
480
|
return;
|
|
413
|
-
const { data:
|
|
414
|
-
this.loaderState.setDataBatch(t,
|
|
415
|
-
}, [t, a.maybeValue]),
|
|
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((
|
|
419
|
-
this.loaderState.setBatchLoadingState(t,
|
|
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.
|
|
426
|
-
offset: this.list.
|
|
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
|
-
|
|
507
|
+
getBatchDataAsyncResource(t) {
|
|
440
508
|
const e = this.dataSource, a = this.getDataLoaderOptions(t);
|
|
441
509
|
if ("staticData" in e) {
|
|
442
|
-
const
|
|
443
|
-
return
|
|
510
|
+
const s = e.staticData;
|
|
511
|
+
return R(
|
|
444
512
|
async () => ({
|
|
445
|
-
data:
|
|
446
|
-
itemTotalCount:
|
|
513
|
+
data: s,
|
|
514
|
+
itemTotalCount: s.length
|
|
447
515
|
}),
|
|
448
516
|
[]
|
|
449
517
|
);
|
|
450
518
|
}
|
|
451
519
|
if ("asyncLoader" in e) {
|
|
452
|
-
const
|
|
453
|
-
return
|
|
520
|
+
const s = e.asyncLoader;
|
|
521
|
+
return R(s, [a]);
|
|
454
522
|
}
|
|
455
523
|
if ("asyncResourceFactory" in e) {
|
|
456
|
-
const
|
|
457
|
-
return
|
|
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
|
|
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, "
|
|
537
|
+
o(this, "batches");
|
|
475
538
|
o(this, "loader");
|
|
476
|
-
const {
|
|
477
|
-
|
|
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
|
|
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 =
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
);
|
|
510
|
-
|
|
511
|
-
|
|
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__ */
|
|
583
|
+
/* @__PURE__ */ r.createElement(Ct, null)
|
|
530
584
|
), e);
|
|
531
|
-
},
|
|
532
|
-
const { children: t } =
|
|
585
|
+
}, te = (n) => {
|
|
586
|
+
const { children: t } = n, e = nt(t, yt), a = {
|
|
533
587
|
Avatar: {
|
|
534
|
-
className:
|
|
588
|
+
className: c.avatar
|
|
535
589
|
},
|
|
536
590
|
Heading: {
|
|
537
|
-
className:
|
|
591
|
+
className: c.heading,
|
|
592
|
+
level: 3
|
|
538
593
|
},
|
|
539
594
|
Text: {
|
|
540
|
-
className:
|
|
595
|
+
className: c.text
|
|
596
|
+
},
|
|
597
|
+
StatusBadge: {
|
|
598
|
+
className: c.statusBadge
|
|
541
599
|
},
|
|
542
600
|
Content: {
|
|
543
|
-
className:
|
|
601
|
+
className: c.content
|
|
544
602
|
},
|
|
545
603
|
ContextMenu: {
|
|
546
604
|
placement: "bottom end",
|
|
547
|
-
hoc: (
|
|
605
|
+
hoc: (i) => /* @__PURE__ */ r.createElement(_t, { className: c.optionsButton }, i)
|
|
548
606
|
}
|
|
549
|
-
},
|
|
607
|
+
}, s = {
|
|
550
608
|
...a,
|
|
551
609
|
Link: {
|
|
552
|
-
className:
|
|
610
|
+
className: c.item,
|
|
553
611
|
unstyled: !0,
|
|
554
612
|
...a
|
|
555
613
|
}
|
|
556
614
|
};
|
|
557
|
-
return /* @__PURE__ */
|
|
558
|
-
},
|
|
559
|
-
const { className: t } =
|
|
560
|
-
|
|
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 &&
|
|
620
|
+
a && x.isLoading
|
|
563
621
|
);
|
|
564
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ r.createElement("div", { className: i }, s);
|
|
565
623
|
};
|
|
566
|
-
function
|
|
624
|
+
function se(n) {
|
|
567
625
|
return null;
|
|
568
626
|
}
|
|
569
|
-
function re(
|
|
627
|
+
function re(n) {
|
|
570
628
|
return null;
|
|
571
629
|
}
|
|
572
|
-
function
|
|
630
|
+
function ne(n) {
|
|
573
631
|
return null;
|
|
574
632
|
}
|
|
575
|
-
function
|
|
633
|
+
function ie(n) {
|
|
576
634
|
return null;
|
|
577
635
|
}
|
|
578
|
-
function
|
|
636
|
+
function oe(n) {
|
|
579
637
|
return null;
|
|
580
638
|
}
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
const
|
|
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
|
-
|
|
587
|
-
)) == null ? void 0 :
|
|
588
|
-
source:
|
|
589
|
-
...
|
|
590
|
-
asyncLoader:
|
|
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
|
-
} :
|
|
595
|
-
staticData:
|
|
681
|
+
} : l ? {
|
|
682
|
+
staticData: l.data
|
|
596
683
|
} : void 0
|
|
597
|
-
},
|
|
598
|
-
loader:
|
|
599
|
-
filters:
|
|
600
|
-
sorting:
|
|
601
|
-
render: ((
|
|
602
|
-
...
|
|
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__ */
|
|
605
|
-
|
|
694
|
+
return /* @__PURE__ */ r.createElement(
|
|
695
|
+
W.Provider,
|
|
606
696
|
{
|
|
607
697
|
value: {
|
|
608
|
-
list:
|
|
698
|
+
list: Q
|
|
609
699
|
}
|
|
610
700
|
},
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
706
|
+
je as List,
|
|
617
707
|
re as ListFilter,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
708
|
+
ie as ListItemView,
|
|
709
|
+
se as ListLoaderAsync,
|
|
710
|
+
ne as ListSorting,
|
|
711
|
+
oe as ListStaticData,
|
|
712
|
+
je as default
|
|
623
713
|
};
|