@mittwald/flow-react-components 0.1.0-alpha.264 → 0.1.0-alpha.265
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 +423 -434
- package/package.json +4 -4
package/dist/List.js
CHANGED
|
@@ -1,76 +1,75 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var r = (a,
|
|
6
|
-
import i, { createContext as
|
|
3
|
+
var je = Object.defineProperty;
|
|
4
|
+
var We = (a, e, t) => e in a ? je(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
5
|
+
var r = (a, e, t) => We(a, typeof e != "symbol" ? e + "" : e, t);
|
|
6
|
+
import i, { createContext as Je, useContext as Ye, createElement as Se, useState as j, useEffect as M, useRef as _e, Suspense as Qe, cloneElement as Xe } from "react";
|
|
7
7
|
import "./propsContext-DzAKlmhS.js";
|
|
8
|
-
import { P as
|
|
8
|
+
import { P as be } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
|
-
import { isShallowEqual as
|
|
11
|
-
import { d as
|
|
10
|
+
import { isShallowEqual as Ze, unique as et, difference as tt, times as st } from "remeda";
|
|
11
|
+
import { d as it } from "./dynamic-ClpUSmEt.js";
|
|
12
12
|
import { B as w } from "./Button-D1ALxYux.js";
|
|
13
|
-
import { IconArrowBackUp as
|
|
14
|
-
import { I as
|
|
15
|
-
import { I as
|
|
16
|
-
import { a as
|
|
13
|
+
import { IconArrowBackUp as at } from "@tabler/icons-react";
|
|
14
|
+
import { I as nt } from "./Icon-cEgH3ZXQ.js";
|
|
15
|
+
import { I as rt } from "./IconContextMenu-DLHXM1Ph.js";
|
|
16
|
+
import { a as x, C as W } from "./ContextMenuTrigger-5-EjHDtY.js";
|
|
17
17
|
import { M as J } from "./MenuItem-CFE7SA5J.js";
|
|
18
18
|
import { useLocalizedStringFormatter as y } from "react-aria";
|
|
19
|
-
import { TunnelProvider as
|
|
19
|
+
import { TunnelProvider as ve, TunnelExit as O } from "@mittwald/react-tunnel";
|
|
20
20
|
import T from "clsx";
|
|
21
|
-
import { g as
|
|
22
|
-
import { f as
|
|
23
|
-
import { R as
|
|
21
|
+
import { g as ot } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
|
|
22
|
+
import { f as lt } from "./flowComponent-CY2oW3O9.js";
|
|
23
|
+
import { R as ct } from "./Render-BdlTa7Qb.js";
|
|
24
24
|
import { T as E } from "./Text-T_kNKeFe.js";
|
|
25
|
-
import { b as
|
|
26
|
-
import { observer as
|
|
27
|
-
import { a as
|
|
28
|
-
import { B as
|
|
29
|
-
import { makeObservable as
|
|
25
|
+
import { b as dt, I as ut, a as mt, c as ht } from "./IconView-B0kOF1Eh.js";
|
|
26
|
+
import { observer as gt } from "mobx-react-lite";
|
|
27
|
+
import { a as ce, T as de } from "./TooltipTrigger-TslkLN5s.js";
|
|
28
|
+
import { B as pt } from "./Badge-BcAQAMkd.js";
|
|
29
|
+
import { makeObservable as ft, observable as ue, computed as me, action as K } from "mobx";
|
|
30
30
|
import "./context-Cf7tqFtF.js";
|
|
31
|
-
import { u as
|
|
32
|
-
import { S as
|
|
31
|
+
import { u as St } from "./useOnChange-C1Quwyuz.js";
|
|
32
|
+
import { S as bt } from "./SearchField-vN6YciFA.js";
|
|
33
33
|
import { H as Y } from "./Heading-FRIQlW19.js";
|
|
34
|
-
import { S as
|
|
35
|
-
import { getProperty as
|
|
36
|
-
import { hash as
|
|
34
|
+
import { S as vt } from "./Section-DsyCp0AH.js";
|
|
35
|
+
import { getProperty as wt } from "dot-prop";
|
|
36
|
+
import { hash as we } from "object-code";
|
|
37
37
|
import V from "zod";
|
|
38
|
-
import { useReactTable as
|
|
39
|
-
import
|
|
40
|
-
import { getAsyncResource as
|
|
41
|
-
import { u as
|
|
42
|
-
import { u as
|
|
38
|
+
import { useReactTable as yt, getCoreRowModel as Et, getSortedRowModel as Ft, getFilteredRowModel as Tt, getPaginationRowModel as Ct, getFacetedUniqueValues as It } from "@tanstack/react-table";
|
|
39
|
+
import ye from "invariant";
|
|
40
|
+
import { getAsyncResource as he } from "@mittwald/react-use-promise";
|
|
41
|
+
import { u as ge } from "./useSelector-DpU7_HMO.js";
|
|
42
|
+
import { u as Lt } from "./SettingsProvider-Ckj9VyMJ.js";
|
|
43
43
|
import * as _ from "react-aria-components";
|
|
44
44
|
import { S as B } from "./SkeletonText-B5ZghZhO.js";
|
|
45
|
-
import { I as
|
|
46
|
-
import { I as
|
|
45
|
+
import { I as Pt } from "./IllustratedMessage-B3MHD01M.js";
|
|
46
|
+
import { I as Vt } from "./IconSearch-a4VYepNE.js";
|
|
47
47
|
import { d as S, a as P } from "./deepFindOfType-6pG0fH7S.js";
|
|
48
|
-
import { ListLoaderAsyncResource as
|
|
49
|
-
import { S as
|
|
50
|
-
import { T as
|
|
51
|
-
import { A as
|
|
52
|
-
const
|
|
53
|
-
view:
|
|
54
|
-
title:
|
|
55
|
-
topContent:
|
|
56
|
-
content:
|
|
57
|
-
action: $
|
|
58
|
-
avatar:
|
|
59
|
-
text:
|
|
60
|
-
heading:
|
|
48
|
+
import { ListLoaderAsyncResource as kt, TypedListLoaderAsyncResource as At } from "./List/ListLoaderAsyncResource.js";
|
|
49
|
+
import { S as Mt } from "./Skeleton-CKLaTmDR.js";
|
|
50
|
+
import { T as Ee, d as Fe, c as Te, a as Ce, e as Ie, b as Le } from "./TableRow-BsPgWqkU.js";
|
|
51
|
+
import { A as Bt } from "./ActionGroup-CX4_8oFU.js";
|
|
52
|
+
const Dt = "flow--list--items--item--view", xt = "flow--list--items--item--view--title", Nt = "flow--list--items--item--view--top-content", Rt = "flow--list--items--item--view--content", $t = "flow--list--items--item--view--action", zt = "flow--list--items--item--view--avatar", Ut = "flow--list--items--item--view--text", Kt = "flow--list--items--item--view--heading", m = {
|
|
53
|
+
view: Dt,
|
|
54
|
+
title: xt,
|
|
55
|
+
topContent: Nt,
|
|
56
|
+
content: Rt,
|
|
57
|
+
action: $t,
|
|
58
|
+
avatar: zt,
|
|
59
|
+
text: Ut,
|
|
60
|
+
heading: Kt,
|
|
61
61
|
"container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
|
|
62
62
|
"container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
|
|
63
63
|
"container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
|
|
64
64
|
"container-breakpoint-size-l": "flow--list--items--item--view--container-breakpoint-size-l",
|
|
65
65
|
"container-breakpoint-size-xl": "flow--list--items--item--view--container-breakpoint-size-xl"
|
|
66
|
-
},
|
|
66
|
+
}, v = { "de-DE": {
|
|
67
67
|
"list.filters.reset": "Filter zurücksetzen",
|
|
68
68
|
"list.filters.store": "Filter speichern",
|
|
69
69
|
"list.noResult.heading": "Keine Suchergebnisse gefunden",
|
|
70
70
|
"list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
|
|
71
71
|
"list.options": "Optionen",
|
|
72
72
|
"list.paginationInfo": (a) => `${a.visibleItemsCount} von insgesamt ${a.totalItemsCount} angezeigt`,
|
|
73
|
-
"list.setSorting": (a) => `Sortierung: ${a.property}`,
|
|
74
73
|
"list.settings": "Einstellungen",
|
|
75
74
|
"list.settings.viewMode": "Ansicht",
|
|
76
75
|
"list.settings.viewMode.list": "Liste",
|
|
@@ -84,28 +83,27 @@ const De = "flow--list--items--item--view", xe = "flow--list--items--item--view-
|
|
|
84
83
|
"list.noResult.text": "Your search did not return any results. Please adjust the search query or your filters.",
|
|
85
84
|
"list.options": "Options",
|
|
86
85
|
"list.paginationInfo": (a) => `Showing ${a.visibleItemsCount} of ${a.totalItemsCount}`,
|
|
87
|
-
"list.setSorting": (a) => `Sorting: ${a.property}`,
|
|
88
86
|
"list.settings": "Settings",
|
|
89
87
|
"list.settings.viewMode": "View",
|
|
90
88
|
"list.settings.viewMode.list": "List",
|
|
91
89
|
"list.settings.viewMode.table": "Table",
|
|
92
90
|
"list.showMore": "Show more",
|
|
93
91
|
"list.sorting": "Sorting"
|
|
94
|
-
} },
|
|
95
|
-
const { className:
|
|
96
|
-
return /* @__PURE__ */ i.createElement(
|
|
92
|
+
} }, Ot = (a) => {
|
|
93
|
+
const { className: e, children: t } = a, s = y(v);
|
|
94
|
+
return /* @__PURE__ */ i.createElement(x, null, /* @__PURE__ */ i.createElement(
|
|
97
95
|
w,
|
|
98
96
|
{
|
|
99
97
|
variant: "plain",
|
|
100
|
-
className:
|
|
98
|
+
className: e,
|
|
101
99
|
"aria-label": s.format("list.options")
|
|
102
100
|
},
|
|
103
|
-
/* @__PURE__ */ i.createElement(
|
|
104
|
-
),
|
|
105
|
-
},
|
|
106
|
-
const { children:
|
|
101
|
+
/* @__PURE__ */ i.createElement(rt, null)
|
|
102
|
+
), t);
|
|
103
|
+
}, Ht = (a) => a === "top" ? m.topContent : a === "bottom" ? m.content : m.topContent, Pe = (a) => {
|
|
104
|
+
const { children: e, className: t, containerBreakpointSize: s = "m" } = a, n = {
|
|
107
105
|
ContextMenu: {
|
|
108
|
-
wrapWith: /* @__PURE__ */ i.createElement(
|
|
106
|
+
wrapWith: /* @__PURE__ */ i.createElement(Ot, { className: m.action }),
|
|
109
107
|
placement: "bottom end"
|
|
110
108
|
},
|
|
111
109
|
Button: {
|
|
@@ -116,7 +114,7 @@ const De = "flow--list--items--item--view", xe = "flow--list--items--item--view-
|
|
|
116
114
|
ignoreBreakpoint: !0
|
|
117
115
|
},
|
|
118
116
|
Content: {
|
|
119
|
-
className:
|
|
117
|
+
className: it((c) => Ht(c.slot)),
|
|
120
118
|
tunnelId: "topContent"
|
|
121
119
|
},
|
|
122
120
|
Avatar: {
|
|
@@ -137,45 +135,36 @@ const De = "flow--list--items--item--view", xe = "flow--list--items--item--view-
|
|
|
137
135
|
}
|
|
138
136
|
}, o = T(
|
|
139
137
|
m.view,
|
|
140
|
-
|
|
141
|
-
m[
|
|
138
|
+
t,
|
|
139
|
+
m[ot(s)]
|
|
142
140
|
);
|
|
143
|
-
return /* @__PURE__ */ i.createElement("div", { className: o }, /* @__PURE__ */ i.createElement(
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
})),
|
|
147
|
-
const { sorting:
|
|
148
|
-
return /* @__PURE__ */ i.createElement(J, { id:
|
|
149
|
-
},
|
|
150
|
-
const { children:
|
|
151
|
-
return y(
|
|
152
|
-
},
|
|
153
|
-
const a = g(),
|
|
154
|
-
if (
|
|
141
|
+
return /* @__PURE__ */ i.createElement("div", { className: o }, /* @__PURE__ */ i.createElement(be, { props: n }, /* @__PURE__ */ i.createElement(ve, null, e, /* @__PURE__ */ i.createElement("div", { className: m.title }, /* @__PURE__ */ i.createElement(O, { id: "title" })), /* @__PURE__ */ i.createElement(O, { id: "topContent" }))));
|
|
142
|
+
}, Ve = Je({}), g = () => Ye(Ve).list, qt = () => g().loader.getLoaderInvocationHooks().map((e, t) => /* @__PURE__ */ i.createElement(ct, { key: t }, () => {
|
|
143
|
+
e();
|
|
144
|
+
})), Gt = (a) => {
|
|
145
|
+
const { sorting: e } = a;
|
|
146
|
+
return /* @__PURE__ */ i.createElement(J, { id: e.id }, e.name);
|
|
147
|
+
}, H = (a) => {
|
|
148
|
+
const { children: e, locales: t, variables: s } = a;
|
|
149
|
+
return y(t).format(e, s);
|
|
150
|
+
}, jt = () => {
|
|
151
|
+
const a = g(), e = a.visibleSorting.map((n) => /* @__PURE__ */ i.createElement(Gt, { sorting: n, key: n.id }));
|
|
152
|
+
if (e.length === 0)
|
|
155
153
|
return null;
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
locales: b,
|
|
160
|
-
variables: {
|
|
161
|
-
property: e.name ?? e.property
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
"list.setSorting"
|
|
165
|
-
) : /* @__PURE__ */ i.createElement(D, { locales: b }, "list.sorting"));
|
|
166
|
-
return /* @__PURE__ */ i.createElement(N, null, /* @__PURE__ */ i.createElement(w, { variant: "outline", color: "secondary" }, s, /* @__PURE__ */ i.createElement(de, null)), /* @__PURE__ */ i.createElement(
|
|
154
|
+
const t = a.visibleSorting.find((n) => n.isSorted()), s = /* @__PURE__ */ i.createElement(E, null, t ? /* @__PURE__ */ i.createElement(i.Fragment, null, t.name ?? t.property) : /* @__PURE__ */ i.createElement(H, { locales: v }, "list.sorting"));
|
|
155
|
+
return /* @__PURE__ */ i.createElement(x, null, /* @__PURE__ */ i.createElement(w, { variant: "outline", color: "secondary" }, s, /* @__PURE__ */ i.createElement(dt, null)), /* @__PURE__ */ i.createElement(
|
|
167
156
|
W,
|
|
168
157
|
{
|
|
169
158
|
selectionMode: "single",
|
|
170
|
-
selectedKeys:
|
|
159
|
+
selectedKeys: t ? [t.id] : [],
|
|
171
160
|
onAction: (n) => {
|
|
172
161
|
a.getSorting(String(n)).enable();
|
|
173
162
|
}
|
|
174
163
|
},
|
|
175
|
-
|
|
164
|
+
e
|
|
176
165
|
));
|
|
177
|
-
},
|
|
178
|
-
const { filter:
|
|
166
|
+
}, Wt = (a) => {
|
|
167
|
+
const { filter: e } = a, { values: t, mode: s, name: n, property: o } = e, c = t.map((d) => /* @__PURE__ */ i.createElement(
|
|
179
168
|
J,
|
|
180
169
|
{
|
|
181
170
|
id: d.id,
|
|
@@ -185,8 +174,8 @@ const De = "flow--list--items--item--view", xe = "flow--list--items--item--view-
|
|
|
185
174
|
}
|
|
186
175
|
},
|
|
187
176
|
d.render()
|
|
188
|
-
)), l =
|
|
189
|
-
return /* @__PURE__ */ i.createElement(
|
|
177
|
+
)), l = t.filter((d) => d.isActive).map((d) => d.id);
|
|
178
|
+
return /* @__PURE__ */ i.createElement(x, null, /* @__PURE__ */ i.createElement(w, { variant: "outline", color: "secondary" }, /* @__PURE__ */ i.createElement(E, null, n ?? o), /* @__PURE__ */ i.createElement(ut, null)), /* @__PURE__ */ i.createElement(
|
|
190
179
|
W,
|
|
191
180
|
{
|
|
192
181
|
selectionMode: s === "one" ? "single" : "multiple",
|
|
@@ -194,53 +183,53 @@ const De = "flow--list--items--item--view", xe = "flow--list--items--item--view-
|
|
|
194
183
|
},
|
|
195
184
|
c
|
|
196
185
|
));
|
|
197
|
-
},
|
|
198
|
-
header:
|
|
199
|
-
pickerListAndSearch:
|
|
200
|
-
pickerList:
|
|
201
|
-
searchAndActions:
|
|
202
|
-
searchField:
|
|
203
|
-
actions:
|
|
204
|
-
},
|
|
205
|
-
activeFilters:
|
|
206
|
-
clearButton:
|
|
207
|
-
}, is =
|
|
208
|
-
const a = g(),
|
|
186
|
+
}, Jt = "flow--list--header", Yt = "flow--list--header--picker-list-and-search", _t = "flow--list--header--picker-list", Qt = "flow--list--header--search-and-actions", Xt = "flow--list--header--search-field", Zt = "flow--list--header--actions", F = {
|
|
187
|
+
header: Jt,
|
|
188
|
+
pickerListAndSearch: Yt,
|
|
189
|
+
pickerList: _t,
|
|
190
|
+
searchAndActions: Qt,
|
|
191
|
+
searchField: Xt,
|
|
192
|
+
actions: Zt
|
|
193
|
+
}, es = "flow--list--header--active-filters", ts = "flow--list--header--active-filters--clear-button", ss = {
|
|
194
|
+
activeFilters: es,
|
|
195
|
+
clearButton: ts
|
|
196
|
+
}, is = gt(() => {
|
|
197
|
+
const a = g(), e = y(v), s = a.filters.flatMap((l) => l.values).filter((l) => l.isActive).map((l) => /* @__PURE__ */ i.createElement(pt, { key: l.id, onClose: () => l.deactivate() }, /* @__PURE__ */ i.createElement(E, null, l.render()))), n = a.filters.filter((l) => l.hasChanged()).length > 0, o = a.supportsSettingsStorage && n && /* @__PURE__ */ i.createElement(ce, null, /* @__PURE__ */ i.createElement(de, null, /* @__PURE__ */ i.createElement(H, { locales: v }, "list.filters.store")), /* @__PURE__ */ i.createElement(
|
|
209
198
|
w,
|
|
210
199
|
{
|
|
211
200
|
size: "s",
|
|
212
201
|
variant: "plain",
|
|
213
202
|
color: "secondary",
|
|
214
203
|
onPress: () => a.storeFilterDefaultSettings(),
|
|
215
|
-
"aria-label":
|
|
204
|
+
"aria-label": e.format("list.filters.store")
|
|
216
205
|
},
|
|
217
|
-
/* @__PURE__ */ i.createElement(
|
|
218
|
-
)), c = n ? /* @__PURE__ */ i.createElement(
|
|
206
|
+
/* @__PURE__ */ i.createElement(mt, null)
|
|
207
|
+
)), c = n ? /* @__PURE__ */ i.createElement(ce, null, /* @__PURE__ */ i.createElement(de, null, /* @__PURE__ */ i.createElement(H, { locales: v }, "list.filters.reset")), /* @__PURE__ */ i.createElement(
|
|
219
208
|
w,
|
|
220
209
|
{
|
|
221
210
|
size: "s",
|
|
222
211
|
variant: "plain",
|
|
223
212
|
color: "secondary",
|
|
224
213
|
onPress: () => a.resetFilters(),
|
|
225
|
-
"aria-label":
|
|
214
|
+
"aria-label": e.format("list.filters.reset")
|
|
226
215
|
},
|
|
227
|
-
/* @__PURE__ */ i.createElement(
|
|
216
|
+
/* @__PURE__ */ i.createElement(nt, null, /* @__PURE__ */ i.createElement(at, null))
|
|
228
217
|
)) : void 0;
|
|
229
218
|
return s.length === 0 && !o && !c ? null : /* @__PURE__ */ i.createElement("div", { className: ss.activeFilters }, s, o, c);
|
|
230
219
|
}), as = (a) => {
|
|
231
|
-
const { className:
|
|
232
|
-
|
|
220
|
+
const { className: e, onChange: t, value: s, ...n } = a, [o, c] = j(s ?? "");
|
|
221
|
+
St(s, () => {
|
|
233
222
|
c(s ?? "");
|
|
234
223
|
}, [o]);
|
|
235
224
|
const l = () => {
|
|
236
|
-
|
|
225
|
+
t(void 0), c("");
|
|
237
226
|
}, d = (u) => {
|
|
238
|
-
u.key === "Enter" ? o.trim() === "" ?
|
|
227
|
+
u.key === "Enter" ? o.trim() === "" ? t(void 0) : t(o) : u.key === "Escape" && l();
|
|
239
228
|
};
|
|
240
229
|
return /* @__PURE__ */ i.createElement(
|
|
241
|
-
|
|
230
|
+
bt,
|
|
242
231
|
{
|
|
243
|
-
className:
|
|
232
|
+
className: e,
|
|
244
233
|
value: o,
|
|
245
234
|
onKeyUp: d,
|
|
246
235
|
onChange: (u) => c(u),
|
|
@@ -249,71 +238,71 @@ const De = "flow--list--items--item--view", xe = "flow--list--items--item--view-
|
|
|
249
238
|
}
|
|
250
239
|
);
|
|
251
240
|
}, ns = (a) => {
|
|
252
|
-
const { className:
|
|
253
|
-
return
|
|
254
|
-
className:
|
|
255
|
-
value:
|
|
256
|
-
onChange:
|
|
257
|
-
...
|
|
241
|
+
const { className: e, search: t } = a, s = t.render ?? as;
|
|
242
|
+
return Se(s, {
|
|
243
|
+
className: e,
|
|
244
|
+
value: t.value,
|
|
245
|
+
onChange: t.setValue.bind(t),
|
|
246
|
+
...t.textFieldProps
|
|
258
247
|
});
|
|
259
248
|
}, rs = () => {
|
|
260
|
-
const a = y(
|
|
261
|
-
return
|
|
249
|
+
const a = y(v), e = g(), t = e.viewMode, s = [];
|
|
250
|
+
return e.itemView && s.push("list"), e.table && s.push("table"), s.length <= 1 ? null : /* @__PURE__ */ i.createElement(x, null, /* @__PURE__ */ i.createElement(
|
|
262
251
|
w,
|
|
263
252
|
{
|
|
264
253
|
variant: "outline",
|
|
265
254
|
color: "secondary",
|
|
266
255
|
"aria-label": a.format("list.settings")
|
|
267
256
|
},
|
|
268
|
-
/* @__PURE__ */ i.createElement(E, null, a.format(`list.settings.viewMode.${
|
|
269
|
-
/* @__PURE__ */ i.createElement(
|
|
270
|
-
), /* @__PURE__ */ i.createElement(W, { selectionMode: "single", selectedKeys: [
|
|
257
|
+
/* @__PURE__ */ i.createElement(E, null, a.format(`list.settings.viewMode.${t}`)),
|
|
258
|
+
/* @__PURE__ */ i.createElement(ht, null)
|
|
259
|
+
), /* @__PURE__ */ i.createElement(W, { selectionMode: "single", selectedKeys: [t] }, /* @__PURE__ */ i.createElement(vt, null, /* @__PURE__ */ i.createElement(Y, null, a.format("list.settings.viewMode")), s.map((n) => /* @__PURE__ */ i.createElement(
|
|
271
260
|
J,
|
|
272
261
|
{
|
|
273
262
|
id: n,
|
|
274
263
|
key: n,
|
|
275
264
|
onAction: () => {
|
|
276
|
-
|
|
265
|
+
e.setViewMode(n);
|
|
277
266
|
}
|
|
278
267
|
},
|
|
279
268
|
a.format(`list.settings.viewMode.${n}`)
|
|
280
269
|
)))));
|
|
281
270
|
}, os = (a) => {
|
|
282
|
-
const { className:
|
|
283
|
-
if (s.filters.length === 0 && s.visibleSorting.length === 0 && !s.search && !s.table && !
|
|
271
|
+
const { className: e, hasActionGroup: t } = a, s = g();
|
|
272
|
+
if (s.filters.length === 0 && s.visibleSorting.length === 0 && !s.search && !s.table && !t)
|
|
284
273
|
return null;
|
|
285
|
-
const n = s.filters.map((o) => /* @__PURE__ */ i.createElement(
|
|
286
|
-
return /* @__PURE__ */ i.createElement("div", { className: T(
|
|
274
|
+
const n = s.filters.map((o) => /* @__PURE__ */ i.createElement(Wt, { key: o.property, filter: o }));
|
|
275
|
+
return /* @__PURE__ */ i.createElement("div", { className: T(e, F.header) }, /* @__PURE__ */ i.createElement("div", { className: F.pickerListAndSearch }, /* @__PURE__ */ i.createElement("div", { className: F.pickerList }, /* @__PURE__ */ i.createElement(rs, null), /* @__PURE__ */ i.createElement(jt, null), n), /* @__PURE__ */ i.createElement("div", { className: F.searchAndActions }, s.search && /* @__PURE__ */ i.createElement(ns, { className: F.searchField, search: s.search }), /* @__PURE__ */ i.createElement(O, { id: "actions" }))), /* @__PURE__ */ i.createElement(is, null));
|
|
287
276
|
}, ls = "flow--list", cs = {
|
|
288
277
|
list: ls
|
|
289
278
|
};
|
|
290
|
-
let ds = class
|
|
291
|
-
constructor(
|
|
279
|
+
let ds = class ke {
|
|
280
|
+
constructor(e, t, s) {
|
|
292
281
|
r(this, "id");
|
|
293
282
|
r(this, "data");
|
|
294
283
|
r(this, "collection");
|
|
295
|
-
this.collection =
|
|
284
|
+
this.collection = e, this.id = t, this.data = s;
|
|
296
285
|
}
|
|
297
|
-
static fromRow(
|
|
298
|
-
return new
|
|
286
|
+
static fromRow(e, t) {
|
|
287
|
+
return new ke(e, t.id, t.original);
|
|
299
288
|
}
|
|
300
289
|
};
|
|
301
290
|
class us {
|
|
302
|
-
constructor(
|
|
291
|
+
constructor(e) {
|
|
303
292
|
r(this, "list");
|
|
304
|
-
this.list =
|
|
293
|
+
this.list = e;
|
|
305
294
|
}
|
|
306
295
|
get entries() {
|
|
307
|
-
return this.list.reactTable.table.getRowModel().rows.map((
|
|
296
|
+
return this.list.reactTable.table.getRowModel().rows.map((e) => ds.fromRow(this, e));
|
|
308
297
|
}
|
|
309
298
|
}
|
|
310
299
|
class ms {
|
|
311
|
-
constructor(
|
|
300
|
+
constructor(e, t = {}) {
|
|
312
301
|
r(this, "batchSize");
|
|
313
302
|
r(this, "list");
|
|
314
303
|
var n;
|
|
315
|
-
const { batchSize: s = 20 } =
|
|
316
|
-
this.list =
|
|
304
|
+
const { batchSize: s = 20 } = t;
|
|
305
|
+
this.list = e, this.batchSize = s, e.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (n = e.search) == null || n.onUpdated(() => this.reset());
|
|
317
306
|
}
|
|
318
307
|
get reactTable() {
|
|
319
308
|
return this.list.reactTable.table;
|
|
@@ -330,10 +319,10 @@ class ms {
|
|
|
330
319
|
getVisibleItemsCount() {
|
|
331
320
|
return this.reactTable.getRowModel().rows.length ?? 0;
|
|
332
321
|
}
|
|
333
|
-
updateItemTotalCount(
|
|
334
|
-
this.reactTable.setOptions((
|
|
335
|
-
...
|
|
336
|
-
rowCount:
|
|
322
|
+
updateItemTotalCount(e) {
|
|
323
|
+
this.reactTable.setOptions((t) => ({
|
|
324
|
+
...t,
|
|
325
|
+
rowCount: e
|
|
337
326
|
}));
|
|
338
327
|
}
|
|
339
328
|
reset() {
|
|
@@ -346,27 +335,27 @@ class ms {
|
|
|
346
335
|
if (this.list.loader.manualPagination)
|
|
347
336
|
this.reactTable.nextPage();
|
|
348
337
|
else {
|
|
349
|
-
const
|
|
350
|
-
this.reactTable.setPagination((
|
|
351
|
-
...
|
|
352
|
-
pageSize:
|
|
338
|
+
const e = this.reactTable.getState().pagination.pageSize + this.batchSize;
|
|
339
|
+
this.reactTable.setPagination((t) => ({
|
|
340
|
+
...t,
|
|
341
|
+
pageSize: e
|
|
353
342
|
}));
|
|
354
343
|
}
|
|
355
344
|
}
|
|
356
345
|
}
|
|
357
346
|
const hs = "$";
|
|
358
|
-
class
|
|
347
|
+
class pe {
|
|
359
348
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
360
|
-
constructor(
|
|
349
|
+
constructor(e, t) {
|
|
361
350
|
r(this, "filter");
|
|
362
351
|
r(this, "value");
|
|
363
|
-
this.filter =
|
|
352
|
+
this.filter = e, this.value = t;
|
|
364
353
|
}
|
|
365
|
-
equals(
|
|
366
|
-
return
|
|
354
|
+
equals(e) {
|
|
355
|
+
return Ze(this.value, e.value);
|
|
367
356
|
}
|
|
368
357
|
get id() {
|
|
369
|
-
return `${this.filter.property}@@${
|
|
358
|
+
return `${this.filter.property}@@${we(this.value)}`;
|
|
370
359
|
}
|
|
371
360
|
get isActive() {
|
|
372
361
|
return this.filter.isValueActive(this);
|
|
@@ -381,9 +370,9 @@ class pt {
|
|
|
381
370
|
this.filter.deactivateValue(this);
|
|
382
371
|
}
|
|
383
372
|
}
|
|
384
|
-
const gs = (a,
|
|
373
|
+
const gs = (a, e) => a === e, ps = (a) => String(a);
|
|
385
374
|
class k {
|
|
386
|
-
constructor(
|
|
375
|
+
constructor(e, t) {
|
|
387
376
|
r(this, "_values");
|
|
388
377
|
r(this, "_valuesFromTableState");
|
|
389
378
|
r(this, "list");
|
|
@@ -395,72 +384,72 @@ class k {
|
|
|
395
384
|
r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
396
385
|
r(this, "defaultSelectedValues");
|
|
397
386
|
var s;
|
|
398
|
-
this.list =
|
|
387
|
+
this.list = e, this.property = t.property, this.mode = t.mode ?? "one", this._values = (s = t.values) == null ? void 0 : s.map((n) => new pe(this, n)), this.matcher = t.matcher ?? gs, this.renderItem = t.renderItem ?? ps, this.name = t.name, this.defaultSelectedValues = t.defaultSelected ? this.values.filter(
|
|
399
388
|
(n) => {
|
|
400
389
|
var o;
|
|
401
|
-
return (o =
|
|
390
|
+
return (o = t.defaultSelected) == null ? void 0 : o.some((c) => c === n.value);
|
|
402
391
|
}
|
|
403
392
|
) : void 0;
|
|
404
393
|
}
|
|
405
394
|
getStoredDefaultSelectedValues() {
|
|
406
|
-
var
|
|
407
|
-
const
|
|
408
|
-
return
|
|
395
|
+
var t;
|
|
396
|
+
const e = (t = this.list.getStoredFilterDefaultSettings()) == null ? void 0 : t[this.property];
|
|
397
|
+
return e ? this.values.filter((s) => e.includes(s.value)) : void 0;
|
|
409
398
|
}
|
|
410
|
-
updateInitialState(
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
...
|
|
399
|
+
updateInitialState(e) {
|
|
400
|
+
const t = this.getInitialValues();
|
|
401
|
+
t != null && t.length && (e.columnFilters = [
|
|
402
|
+
...e.columnFilters ?? [],
|
|
414
403
|
{
|
|
415
404
|
id: this.property,
|
|
416
|
-
value:
|
|
405
|
+
value: t
|
|
417
406
|
}
|
|
418
407
|
]);
|
|
419
408
|
}
|
|
420
|
-
updateTableColumnDef(
|
|
421
|
-
|
|
409
|
+
updateTableColumnDef(e) {
|
|
410
|
+
e.enableColumnFilter = !0, e.filterFn = this.getReactTableFilterFn();
|
|
422
411
|
}
|
|
423
412
|
getReactTableFilterFn() {
|
|
424
|
-
return (
|
|
425
|
-
const n = this.property, o = n.startsWith(hs) ?
|
|
413
|
+
return (e, t, s) => {
|
|
414
|
+
const n = this.property, o = n.startsWith(hs) ? e.original : wt(e.original, n);
|
|
426
415
|
return this.checkFilterMatches(o, s);
|
|
427
416
|
};
|
|
428
417
|
}
|
|
429
|
-
checkFilterMatches(
|
|
430
|
-
if (
|
|
418
|
+
checkFilterMatches(e, t) {
|
|
419
|
+
if (t === null)
|
|
431
420
|
return !0;
|
|
432
|
-
const s = (o) => Array.isArray(o) ? o : [o], n = (o) => this.matcher(o.value,
|
|
421
|
+
const s = (o) => Array.isArray(o) ? o : [o], n = (o) => this.matcher(o.value, e);
|
|
433
422
|
if (this.mode === "all")
|
|
434
|
-
return s(
|
|
423
|
+
return s(t).every(n);
|
|
435
424
|
if (this.mode === "some") {
|
|
436
|
-
const o = s(
|
|
425
|
+
const o = s(t);
|
|
437
426
|
return o.length === 0 || o.some(n);
|
|
438
427
|
} else if (this.mode === "one")
|
|
439
|
-
return n(
|
|
428
|
+
return n(t);
|
|
440
429
|
throw new Error(`Unknown filter mode '${this.mode}'`);
|
|
441
430
|
}
|
|
442
431
|
getTableColumnFilter() {
|
|
443
|
-
return this.list.reactTable.table.getState().columnFilters.find((
|
|
432
|
+
return this.list.reactTable.table.getState().columnFilters.find((e) => e.id === this.property);
|
|
444
433
|
}
|
|
445
434
|
getTableColumn() {
|
|
446
435
|
return this.list.reactTable.getTableColumn(this.property);
|
|
447
436
|
}
|
|
448
437
|
getValue() {
|
|
449
|
-
var
|
|
450
|
-
return ((
|
|
438
|
+
var e;
|
|
439
|
+
return ((e = this.getTableColumnFilter()) == null ? void 0 : e.value) ?? null;
|
|
451
440
|
}
|
|
452
441
|
getValuesFromTableState() {
|
|
453
|
-
return
|
|
454
|
-
Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((
|
|
455
|
-
).map((
|
|
442
|
+
return et(
|
|
443
|
+
Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((e) => e).filter((e) => e != null)
|
|
444
|
+
).map((e) => new pe(this, e));
|
|
456
445
|
}
|
|
457
|
-
checkIfValueIsUnknown(
|
|
458
|
-
return !this.values.some((s) => s.id ===
|
|
446
|
+
checkIfValueIsUnknown(e) {
|
|
447
|
+
return !this.values.some((s) => s.id === e.id);
|
|
459
448
|
}
|
|
460
449
|
deleteUnknownFilterValues() {
|
|
461
450
|
if (this.values !== this.valuesFromTableState)
|
|
462
|
-
for (const
|
|
463
|
-
this.checkIfValueIsUnknown(
|
|
451
|
+
for (const e of this.getArrayValue())
|
|
452
|
+
this.checkIfValueIsUnknown(e) && this.deactivateValue(e);
|
|
464
453
|
}
|
|
465
454
|
get values() {
|
|
466
455
|
return this._values ?? this.valuesFromTableState;
|
|
@@ -469,53 +458,53 @@ class k {
|
|
|
469
458
|
return this._valuesFromTableState || (this._valuesFromTableState = this.getValuesFromTableState()), this._valuesFromTableState;
|
|
470
459
|
}
|
|
471
460
|
getArrayValue() {
|
|
472
|
-
const
|
|
473
|
-
return Array.isArray(
|
|
461
|
+
const e = this.getValue();
|
|
462
|
+
return Array.isArray(e) ? e : e === null ? [] : [e];
|
|
474
463
|
}
|
|
475
|
-
isValueActive(
|
|
476
|
-
return this.getArrayValue().some((
|
|
464
|
+
isValueActive(e) {
|
|
465
|
+
return this.getArrayValue().some((t) => t.equals(e));
|
|
477
466
|
}
|
|
478
467
|
isActive() {
|
|
479
468
|
return this.getArrayValue().length > 0;
|
|
480
469
|
}
|
|
481
|
-
deactivateValue(
|
|
482
|
-
const
|
|
470
|
+
deactivateValue(e) {
|
|
471
|
+
const t = this.getArrayValue();
|
|
483
472
|
let s;
|
|
484
|
-
this.mode === "all" || this.mode === "some" ? s =
|
|
473
|
+
this.mode === "all" || this.mode === "some" ? s = t.filter((n) => !n.equals(e)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((n) => n());
|
|
485
474
|
}
|
|
486
475
|
hasChanged() {
|
|
487
|
-
const
|
|
488
|
-
return
|
|
476
|
+
const e = this.getArrayValue().map((s) => s.value), t = (this.getInitialValues() ?? []).map((s) => s.value);
|
|
477
|
+
return e.length !== t.length || tt(e, t).length > 0;
|
|
489
478
|
}
|
|
490
479
|
getInitialValues() {
|
|
491
480
|
return this.getStoredDefaultSelectedValues() ?? this.defaultSelectedValues;
|
|
492
481
|
}
|
|
493
482
|
resetValues() {
|
|
494
|
-
let
|
|
495
|
-
const
|
|
496
|
-
|
|
483
|
+
let e;
|
|
484
|
+
const t = this.getInitialValues();
|
|
485
|
+
t ? e = t : this.mode === "all" || this.mode === "some" ? e = [] : e = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(e), this.onFilterUpdateCallbacks.forEach((s) => s());
|
|
497
486
|
}
|
|
498
|
-
toggleValue(
|
|
499
|
-
const
|
|
487
|
+
toggleValue(e) {
|
|
488
|
+
const t = this.getArrayValue();
|
|
500
489
|
let s;
|
|
501
|
-
this.mode === "all" || this.mode === "some" ?
|
|
490
|
+
this.mode === "all" || this.mode === "some" ? e.isActive ? s = t.filter((n) => !n.equals(e)) : s = [...t, e] : s = e.isActive ? null : e, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((n) => n());
|
|
502
491
|
}
|
|
503
|
-
onFilterUpdated(
|
|
504
|
-
this.onFilterUpdateCallbacks.add(
|
|
492
|
+
onFilterUpdated(e) {
|
|
493
|
+
this.onFilterUpdateCallbacks.add(e);
|
|
505
494
|
}
|
|
506
495
|
}
|
|
507
496
|
r(k, "settingsStorageSchema", V.record(V.array(V.unknown())).optional());
|
|
508
497
|
class fs {
|
|
509
|
-
constructor(
|
|
498
|
+
constructor(e, t) {
|
|
510
499
|
r(this, "list");
|
|
511
500
|
r(this, "property");
|
|
512
501
|
r(this, "name");
|
|
513
502
|
r(this, "direction");
|
|
514
503
|
r(this, "defaultEnabled");
|
|
515
|
-
this.list =
|
|
504
|
+
this.list = e, this.property = t.property, this.name = t.name, this.direction = t.direction ?? "asc", this.defaultEnabled = t.defaultEnabled ?? !1;
|
|
516
505
|
}
|
|
517
|
-
updateTableColumnDef(
|
|
518
|
-
|
|
506
|
+
updateTableColumnDef(e) {
|
|
507
|
+
e.enableSorting = !0;
|
|
519
508
|
}
|
|
520
509
|
getReactTableColumnSort() {
|
|
521
510
|
return {
|
|
@@ -540,23 +529,23 @@ class fs {
|
|
|
540
529
|
}
|
|
541
530
|
}
|
|
542
531
|
class Q {
|
|
543
|
-
constructor(
|
|
532
|
+
constructor(e, t, s = {}) {
|
|
544
533
|
r(this, "list");
|
|
545
534
|
r(this, "table");
|
|
546
535
|
r(this, "sortingState");
|
|
547
536
|
r(this, "updateSortingState");
|
|
548
|
-
this.list =
|
|
537
|
+
this.list = e;
|
|
549
538
|
const n = this.list.sorting.filter(
|
|
550
539
|
(l) => l.defaultEnabled !== !1
|
|
551
540
|
), [o, c] = j(
|
|
552
541
|
n.map((l) => l.getReactTableColumnSort())
|
|
553
542
|
);
|
|
554
|
-
this.sortingState = o, this.updateSortingState = c, this.table = this.useReactTable(
|
|
543
|
+
this.sortingState = o, this.updateSortingState = c, this.table = this.useReactTable(t, s);
|
|
555
544
|
}
|
|
556
|
-
static useNew(
|
|
557
|
-
return new Q(
|
|
545
|
+
static useNew(e, t, s = {}) {
|
|
546
|
+
return new Q(e, t, s);
|
|
558
547
|
}
|
|
559
|
-
useReactTable(
|
|
548
|
+
useReactTable(e, t = {}) {
|
|
560
549
|
var c;
|
|
561
550
|
const s = this.list.loader.useData(), n = {
|
|
562
551
|
pagination: {
|
|
@@ -567,7 +556,7 @@ class Q {
|
|
|
567
556
|
for (const l of this.list.filters)
|
|
568
557
|
l.updateInitialState(n);
|
|
569
558
|
(c = this.list.search) == null || c.updateInitialState(n);
|
|
570
|
-
const o =
|
|
559
|
+
const o = yt({
|
|
571
560
|
data: s,
|
|
572
561
|
state: {
|
|
573
562
|
sorting: this.sortingState
|
|
@@ -575,37 +564,37 @@ class Q {
|
|
|
575
564
|
getRowId: this.list.getItemId,
|
|
576
565
|
initialState: n,
|
|
577
566
|
columns: this.getTableColumnDefs(),
|
|
578
|
-
getCoreRowModel:
|
|
579
|
-
getSortedRowModel:
|
|
580
|
-
getFilteredRowModel:
|
|
581
|
-
getPaginationRowModel:
|
|
582
|
-
getFacetedUniqueValues:
|
|
567
|
+
getCoreRowModel: Et(),
|
|
568
|
+
getSortedRowModel: Ft(),
|
|
569
|
+
getFilteredRowModel: Tt(),
|
|
570
|
+
getPaginationRowModel: Ct(),
|
|
571
|
+
getFacetedUniqueValues: It(),
|
|
583
572
|
onSortingChange: (l) => {
|
|
584
573
|
this.handleSortingStateUpdate(l);
|
|
585
574
|
},
|
|
586
575
|
globalFilterFn: "auto",
|
|
587
|
-
...
|
|
576
|
+
...t
|
|
588
577
|
});
|
|
589
578
|
return M(() => {
|
|
590
|
-
|
|
591
|
-
}, [this.list,
|
|
579
|
+
e && e(this.list);
|
|
580
|
+
}, [this.list, e, o]), o;
|
|
592
581
|
}
|
|
593
|
-
handleSortingStateUpdate(
|
|
594
|
-
const
|
|
595
|
-
(n) => n.defaultEnabled === "hidden" && !
|
|
582
|
+
handleSortingStateUpdate(e) {
|
|
583
|
+
const t = typeof e == "function" ? e(this.sortingState) : e, s = this.list.sorting.filter(
|
|
584
|
+
(n) => n.defaultEnabled === "hidden" && !t.some((o) => o.id === n.property)
|
|
596
585
|
).map((n) => n.getReactTableColumnSort());
|
|
597
|
-
this.updateSortingState([...s, ...
|
|
586
|
+
this.updateSortingState([...s, ...t]);
|
|
598
587
|
}
|
|
599
588
|
get searchString() {
|
|
600
589
|
return this.table.getState().globalFilter;
|
|
601
590
|
}
|
|
602
|
-
getTableColumn(
|
|
603
|
-
const
|
|
604
|
-
return
|
|
591
|
+
getTableColumn(e) {
|
|
592
|
+
const t = this.table.getColumn(e);
|
|
593
|
+
return ye(!!t, `Column #${e} is not defined`), t;
|
|
605
594
|
}
|
|
606
595
|
getTableColumnDefs() {
|
|
607
|
-
const
|
|
608
|
-
const n =
|
|
596
|
+
const e = /* @__PURE__ */ new Map(), t = (s) => {
|
|
597
|
+
const n = e.get(s);
|
|
609
598
|
if (n)
|
|
610
599
|
return n;
|
|
611
600
|
const o = {
|
|
@@ -614,13 +603,13 @@ class Q {
|
|
|
614
603
|
enableSorting: !1,
|
|
615
604
|
enableColumnFilter: !1
|
|
616
605
|
};
|
|
617
|
-
return
|
|
606
|
+
return e.set(s, o), o;
|
|
618
607
|
};
|
|
619
608
|
return this.list.filters.forEach(
|
|
620
|
-
(s) => s.updateTableColumnDef(
|
|
609
|
+
(s) => s.updateTableColumnDef(t(s.property))
|
|
621
610
|
), this.list.sorting.forEach(
|
|
622
|
-
(s) => s.updateTableColumnDef(
|
|
623
|
-
), Array.from(
|
|
611
|
+
(s) => s.updateTableColumnDef(t(s.property))
|
|
612
|
+
), Array.from(e.values());
|
|
624
613
|
}
|
|
625
614
|
}
|
|
626
615
|
class X {
|
|
@@ -628,47 +617,47 @@ class X {
|
|
|
628
617
|
r(this, "dataBatches", []);
|
|
629
618
|
r(this, "prevDataBatches", []);
|
|
630
619
|
r(this, "batchLoadingStates", ["void"]);
|
|
631
|
-
|
|
620
|
+
ft(this, {
|
|
632
621
|
prevDataBatches: !1,
|
|
633
622
|
useMergedData: !1,
|
|
634
623
|
useIsLoading: !1,
|
|
635
|
-
dataBatches:
|
|
636
|
-
batchLoadingStates:
|
|
637
|
-
mergedData:
|
|
638
|
-
isLoading:
|
|
639
|
-
reset:
|
|
640
|
-
setDataBatch:
|
|
641
|
-
setBatchLoadingState:
|
|
624
|
+
dataBatches: ue.shallow,
|
|
625
|
+
batchLoadingStates: ue.shallow,
|
|
626
|
+
mergedData: me,
|
|
627
|
+
isLoading: me,
|
|
628
|
+
reset: K.bound,
|
|
629
|
+
setDataBatch: K.bound,
|
|
630
|
+
setBatchLoadingState: K.bound
|
|
642
631
|
});
|
|
643
632
|
}
|
|
644
633
|
static useNew() {
|
|
645
|
-
return
|
|
634
|
+
return _e(new X()).current;
|
|
646
635
|
}
|
|
647
636
|
reset() {
|
|
648
637
|
this.batchLoadingStates = [], this.dataBatches = [];
|
|
649
638
|
}
|
|
650
|
-
setDataBatch(
|
|
651
|
-
this.dataBatches.length === 0 && (this.prevDataBatches = []), this.dataBatches[
|
|
639
|
+
setDataBatch(e, t) {
|
|
640
|
+
this.dataBatches.length === 0 && (this.prevDataBatches = []), this.dataBatches[e] !== t && (this.dataBatches[e] = t, this.prevDataBatches[e] = t);
|
|
652
641
|
}
|
|
653
|
-
setBatchLoadingState(
|
|
654
|
-
this.batchLoadingStates[
|
|
642
|
+
setBatchLoadingState(e, t) {
|
|
643
|
+
this.batchLoadingStates[e] !== t && (this.batchLoadingStates[e] = t);
|
|
655
644
|
}
|
|
656
645
|
get mergedData() {
|
|
657
|
-
return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((
|
|
646
|
+
return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((t) => t);
|
|
658
647
|
}
|
|
659
648
|
useMergedData() {
|
|
660
|
-
return
|
|
649
|
+
return ge(() => this.mergedData);
|
|
661
650
|
}
|
|
662
651
|
get isLoading() {
|
|
663
|
-
return this.batchLoadingStates.some((
|
|
652
|
+
return this.batchLoadingStates.some((e) => e === "loading" || e === "void");
|
|
664
653
|
}
|
|
665
654
|
useIsLoading() {
|
|
666
|
-
return
|
|
655
|
+
return ge(() => this.isLoading);
|
|
667
656
|
}
|
|
668
657
|
}
|
|
669
658
|
const Ss = [];
|
|
670
659
|
class Z {
|
|
671
|
-
constructor(
|
|
660
|
+
constructor(e, t = {}) {
|
|
672
661
|
r(this, "list");
|
|
673
662
|
r(this, "dataSource");
|
|
674
663
|
r(this, "manualSorting");
|
|
@@ -676,13 +665,13 @@ class Z {
|
|
|
676
665
|
r(this, "manualPagination");
|
|
677
666
|
r(this, "loaderState");
|
|
678
667
|
var l;
|
|
679
|
-
const { source: s } =
|
|
668
|
+
const { source: s } = t;
|
|
680
669
|
this.dataSource = s ?? { staticData: Ss };
|
|
681
670
|
const n = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, o = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, c = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
|
|
682
|
-
this.list =
|
|
671
|
+
this.list = e, this.loaderState = X.useNew(), this.manualPagination = n ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = c ?? this.manualPagination, this.list.filters.forEach((d) => d.onFilterUpdated(() => this.reset())), (l = this.list.search) == null || l.onUpdated(() => this.reset());
|
|
683
672
|
}
|
|
684
|
-
static useNew(
|
|
685
|
-
return new Z(
|
|
673
|
+
static useNew(e, t = {}) {
|
|
674
|
+
return new Z(e, t);
|
|
686
675
|
}
|
|
687
676
|
reset() {
|
|
688
677
|
this.loaderState.reset();
|
|
@@ -697,85 +686,85 @@ class Z {
|
|
|
697
686
|
return this.loaderState.useMergedData();
|
|
698
687
|
}
|
|
699
688
|
getLoaderInvocationHooks() {
|
|
700
|
-
return
|
|
701
|
-
this.useLoadBatch(
|
|
689
|
+
return st(this.list.batches.getBatchIndex() + 1, (t) => t).map((t) => () => {
|
|
690
|
+
this.useLoadBatch(t);
|
|
702
691
|
});
|
|
703
692
|
}
|
|
704
|
-
useLoadBatch(
|
|
705
|
-
const
|
|
706
|
-
|
|
693
|
+
useLoadBatch(e) {
|
|
694
|
+
const t = this.getBatchDataAsyncResource(e);
|
|
695
|
+
t.use({
|
|
707
696
|
useSuspense: !1
|
|
708
|
-
}), this.useObserveBatchData(
|
|
697
|
+
}), this.useObserveBatchData(t, e), this.useObserveBatchLoadingState(t, e);
|
|
709
698
|
}
|
|
710
|
-
useObserveBatchLoadingState(
|
|
699
|
+
useObserveBatchLoadingState(e, t) {
|
|
711
700
|
M(() => (this.loaderState.setBatchLoadingState(
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
),
|
|
715
|
-
this.loaderState.setBatchLoadingState(
|
|
716
|
-
})), [
|
|
701
|
+
t,
|
|
702
|
+
e.state.value
|
|
703
|
+
), e.state.observe((s) => {
|
|
704
|
+
this.loaderState.setBatchLoadingState(t, s);
|
|
705
|
+
})), [e, t]);
|
|
717
706
|
}
|
|
718
|
-
useObserveBatchData(
|
|
707
|
+
useObserveBatchData(e, t) {
|
|
719
708
|
const s = (n) => {
|
|
720
709
|
const { data: o, itemTotalCount: c } = n;
|
|
721
|
-
this.loaderState.setDataBatch(
|
|
710
|
+
this.loaderState.setDataBatch(t, o), c !== void 0 && this.list.batches.updateItemTotalCount(c);
|
|
722
711
|
};
|
|
723
|
-
M(() => (
|
|
712
|
+
M(() => (e.value.value.isSet && s(e.value.value.value), e.value.observe((n) => {
|
|
724
713
|
n.isSet && s(n.value);
|
|
725
|
-
})), [
|
|
714
|
+
})), [e, t]);
|
|
726
715
|
}
|
|
727
|
-
getDataLoaderOptions(
|
|
716
|
+
getDataLoaderOptions(e) {
|
|
728
717
|
return {
|
|
729
718
|
pagination: this.manualPagination ? {
|
|
730
719
|
limit: this.list.batches.batchSize,
|
|
731
|
-
offset: this.list.batches.batchSize *
|
|
720
|
+
offset: this.list.batches.batchSize * e
|
|
732
721
|
} : void 0,
|
|
733
722
|
sorting: this.manualSorting ? Object.fromEntries(
|
|
734
|
-
this.list.sorting.filter((
|
|
723
|
+
this.list.sorting.filter((t) => t.isSorted()).map((t) => [t.property, t.direction])
|
|
735
724
|
) : void 0,
|
|
736
725
|
filtering: this.manualFiltering ? Object.fromEntries(
|
|
737
|
-
this.list.filters.filter((
|
|
738
|
-
|
|
726
|
+
this.list.filters.filter((t) => t.getValue() !== null).map((t) => [
|
|
727
|
+
t.property,
|
|
739
728
|
{
|
|
740
|
-
mode:
|
|
741
|
-
values:
|
|
729
|
+
mode: t.mode,
|
|
730
|
+
values: t.getArrayValue().map((s) => s.value)
|
|
742
731
|
}
|
|
743
732
|
])
|
|
744
733
|
) : void 0,
|
|
745
734
|
searchString: this.manualFiltering ? this.list.reactTable.searchString : void 0
|
|
746
735
|
};
|
|
747
736
|
}
|
|
748
|
-
getBatchDataAsyncResource(
|
|
749
|
-
const
|
|
750
|
-
if ("staticData" in
|
|
751
|
-
return
|
|
737
|
+
getBatchDataAsyncResource(e) {
|
|
738
|
+
const t = this.dataSource, s = this.getDataLoaderOptions(e);
|
|
739
|
+
if ("staticData" in t)
|
|
740
|
+
return he(
|
|
752
741
|
async (n) => ({
|
|
753
742
|
data: n,
|
|
754
743
|
itemTotalCount: n.length
|
|
755
744
|
}),
|
|
756
|
-
[
|
|
745
|
+
[t.staticData]
|
|
757
746
|
);
|
|
758
|
-
if ("asyncLoader" in
|
|
759
|
-
const n =
|
|
760
|
-
return
|
|
747
|
+
if ("asyncLoader" in t) {
|
|
748
|
+
const n = t.asyncLoader, o = t.dependencies, c = o ? we(o).toString() : void 0;
|
|
749
|
+
return he(n, [s], {
|
|
761
750
|
loaderId: c
|
|
762
751
|
});
|
|
763
752
|
}
|
|
764
|
-
if ("asyncResourceFactory" in
|
|
765
|
-
const n =
|
|
753
|
+
if ("asyncResourceFactory" in t) {
|
|
754
|
+
const n = t.asyncResourceFactory;
|
|
766
755
|
return n(s);
|
|
767
756
|
}
|
|
768
757
|
throw new Error("Unknown data source");
|
|
769
758
|
}
|
|
770
759
|
}
|
|
771
760
|
class bs {
|
|
772
|
-
constructor(
|
|
761
|
+
constructor(e, t) {
|
|
773
762
|
r(this, "list");
|
|
774
763
|
r(this, "render");
|
|
775
764
|
r(this, "textFieldProps");
|
|
776
765
|
r(this, "onUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
777
766
|
r(this, "defaultValue");
|
|
778
|
-
this.list =
|
|
767
|
+
this.list = e, this.render = t.render, this.textFieldProps = t.textFieldProps, this.defaultValue = t.defaultValue;
|
|
779
768
|
}
|
|
780
769
|
get value() {
|
|
781
770
|
return this.list.reactTable.searchString;
|
|
@@ -784,87 +773,87 @@ class bs {
|
|
|
784
773
|
return this.value !== void 0;
|
|
785
774
|
}
|
|
786
775
|
callOnUpdateCallbacks() {
|
|
787
|
-
this.onUpdateCallbacks.forEach((
|
|
776
|
+
this.onUpdateCallbacks.forEach((e) => e());
|
|
788
777
|
}
|
|
789
|
-
updateInitialState(
|
|
790
|
-
|
|
778
|
+
updateInitialState(e) {
|
|
779
|
+
e.globalFilter = this.defaultValue;
|
|
791
780
|
}
|
|
792
|
-
setValue(
|
|
793
|
-
|
|
781
|
+
setValue(e) {
|
|
782
|
+
e === void 0 || e.trim() === "" ? this.list.reactTable.table.getState().globalFilter && (this.list.reactTable.table.setGlobalFilter(void 0), this.callOnUpdateCallbacks()) : (this.list.reactTable.table.setGlobalFilter(e), this.callOnUpdateCallbacks());
|
|
794
783
|
}
|
|
795
784
|
clear() {
|
|
796
785
|
this.setValue(void 0);
|
|
797
786
|
}
|
|
798
|
-
onUpdated(
|
|
799
|
-
this.onUpdateCallbacks.add(
|
|
787
|
+
onUpdated(e) {
|
|
788
|
+
this.onUpdateCallbacks.add(e);
|
|
800
789
|
}
|
|
801
790
|
}
|
|
802
|
-
const
|
|
803
|
-
constructor(
|
|
791
|
+
const D = class D {
|
|
792
|
+
constructor(e, t = {}) {
|
|
804
793
|
r(this, "list");
|
|
805
794
|
r(this, "textValue");
|
|
806
795
|
r(this, "href");
|
|
807
796
|
r(this, "fallback");
|
|
808
797
|
r(this, "renderFn");
|
|
809
|
-
const { fallback: s, textValue: n, href: o, renderFn: c } =
|
|
810
|
-
this.list =
|
|
798
|
+
const { fallback: s, textValue: n, href: o, renderFn: c } = t;
|
|
799
|
+
this.list = e, this.textValue = n, this.renderFn = c, this.href = o, this.fallback = s;
|
|
811
800
|
}
|
|
812
|
-
render(
|
|
813
|
-
return (this.renderFn ??
|
|
801
|
+
render(e) {
|
|
802
|
+
return (this.renderFn ?? D.fallbackRenderItemFn)(e, this.list);
|
|
814
803
|
}
|
|
815
804
|
};
|
|
816
|
-
r(
|
|
817
|
-
let q =
|
|
818
|
-
constructor(
|
|
805
|
+
r(D, "fallbackRenderItemFn", (e) => Se("pre", void 0, JSON.stringify(e)));
|
|
806
|
+
let q = D, vs = class {
|
|
807
|
+
constructor(e, t = {}) {
|
|
819
808
|
r(this, "tableHeader");
|
|
820
809
|
r(this, "componentProps");
|
|
821
|
-
this.tableHeader =
|
|
810
|
+
this.tableHeader = e, this.componentProps = t;
|
|
822
811
|
}
|
|
823
812
|
}, ws = class {
|
|
824
|
-
constructor(
|
|
813
|
+
constructor(e, t = {}) {
|
|
825
814
|
r(this, "table");
|
|
826
815
|
r(this, "componentProps");
|
|
827
816
|
r(this, "columns");
|
|
828
|
-
const { columns: s = [], ...n } =
|
|
829
|
-
this.table =
|
|
817
|
+
const { columns: s = [], ...n } = t;
|
|
818
|
+
this.table = e, this.columns = s.map((o) => new vs(this, o)), this.componentProps = n;
|
|
830
819
|
}
|
|
831
820
|
}, ys = class {
|
|
832
|
-
constructor(
|
|
821
|
+
constructor(e, t = {}) {
|
|
833
822
|
r(this, "row");
|
|
834
823
|
r(this, "renderFn");
|
|
835
824
|
r(this, "componentProps");
|
|
836
|
-
const { renderFn: s, ...n } =
|
|
837
|
-
this.row =
|
|
825
|
+
const { renderFn: s, ...n } = t;
|
|
826
|
+
this.row = e, this.renderFn = s, this.componentProps = n;
|
|
838
827
|
}
|
|
839
828
|
}, Es = class {
|
|
840
|
-
constructor(
|
|
829
|
+
constructor(e, t = {}) {
|
|
841
830
|
r(this, "tableBody");
|
|
842
831
|
r(this, "cells");
|
|
843
832
|
r(this, "componentProps");
|
|
844
|
-
const { cells: s = [], ...n } =
|
|
845
|
-
this.tableBody =
|
|
833
|
+
const { cells: s = [], ...n } = t;
|
|
834
|
+
this.tableBody = e, this.cells = s.map((o) => new ys(this, o)), this.componentProps = n;
|
|
846
835
|
}
|
|
847
836
|
}, Fs = class {
|
|
848
|
-
constructor(
|
|
837
|
+
constructor(e, t = {}) {
|
|
849
838
|
r(this, "table");
|
|
850
839
|
r(this, "componentProps");
|
|
851
840
|
r(this, "row");
|
|
852
|
-
const { row: s, ...n } =
|
|
853
|
-
this.table =
|
|
841
|
+
const { row: s, ...n } = t;
|
|
842
|
+
this.table = e, this.row = new Es(this, s), this.componentProps = n;
|
|
854
843
|
}
|
|
855
844
|
}, Ts = class {
|
|
856
|
-
constructor(
|
|
845
|
+
constructor(e, t = {}) {
|
|
857
846
|
r(this, "list");
|
|
858
847
|
r(this, "header");
|
|
859
848
|
r(this, "body");
|
|
860
849
|
r(this, "componentProps");
|
|
861
|
-
const { header: s, body: n, ...o } =
|
|
862
|
-
this.list =
|
|
850
|
+
const { header: s, body: n, ...o } = t;
|
|
851
|
+
this.list = e, this.header = new ws(this, s), this.body = new Fs(this, n), this.componentProps = o;
|
|
863
852
|
}
|
|
864
853
|
};
|
|
865
|
-
var
|
|
866
|
-
let Cs = (
|
|
867
|
-
constructor(
|
|
854
|
+
var b;
|
|
855
|
+
let Cs = (b = class {
|
|
856
|
+
constructor(e) {
|
|
868
857
|
r(this, "filters");
|
|
869
858
|
r(this, "itemView");
|
|
870
859
|
r(this, "table");
|
|
@@ -885,7 +874,7 @@ let Cs = (v = class {
|
|
|
885
874
|
r(this, "viewModeStorageKey");
|
|
886
875
|
r(this, "filterSettingsStorageKey");
|
|
887
876
|
const {
|
|
888
|
-
settingStorageKey:
|
|
877
|
+
settingStorageKey: t,
|
|
889
878
|
itemView: s,
|
|
890
879
|
table: n,
|
|
891
880
|
filters: o = [],
|
|
@@ -895,23 +884,23 @@ let Cs = (v = class {
|
|
|
895
884
|
loader: u,
|
|
896
885
|
search: h,
|
|
897
886
|
onAction: C,
|
|
898
|
-
getItemId:
|
|
887
|
+
getItemId: N,
|
|
899
888
|
defaultViewMode: L,
|
|
900
|
-
|
|
901
|
-
} =
|
|
902
|
-
this.defaultSettings =
|
|
889
|
+
...R
|
|
890
|
+
} = e;
|
|
891
|
+
this.defaultSettings = Lt(), this.settingStorageKey = t, this.filterSettingsStorageKey = t ? `${t}.activeFilters` : void 0, this.viewModeStorageKey = t ? `${t}.viewMode` : void 0, this.supportsSettingsStorage = !!this.settingStorageKey, this.items = new us(this), this.filters = o.map((p) => new k(this, p)), this.sorting = c.map((p) => new fs(this, p)), this.search = h ? new bs(this, h) : void 0, this.itemView = s ? new q(this, s) : void 0, this.table = n ? new Ts(this, n) : void 0, this.batches = new ms(this, l), this.componentProps = R, this.loader = Z.useNew(this, u), this.onAction = C, this.getItemId = N, this.reactTable = Q.useNew(this, d, {
|
|
903
892
|
manualFiltering: this.loader.manualFiltering,
|
|
904
893
|
manualPagination: this.loader.manualPagination,
|
|
905
894
|
manualSorting: this.loader.manualSorting
|
|
906
895
|
});
|
|
907
|
-
const [z
|
|
896
|
+
const [$, z] = j(
|
|
908
897
|
L ?? this.getStoredViewModeDefaultSetting() ?? "list"
|
|
909
898
|
);
|
|
910
|
-
this.viewMode =
|
|
911
|
-
|
|
899
|
+
this.viewMode = $, this.setViewMode = (p) => {
|
|
900
|
+
z(p), this.defaultSettings && this.viewModeStorageKey && this.defaultSettings.set(
|
|
912
901
|
"List",
|
|
913
902
|
this.viewModeStorageKey,
|
|
914
|
-
|
|
903
|
+
b.viewModeSettingsStorageSchema,
|
|
915
904
|
p
|
|
916
905
|
);
|
|
917
906
|
}, M(() => {
|
|
@@ -919,27 +908,27 @@ let Cs = (v = class {
|
|
|
919
908
|
}, [this.filters]);
|
|
920
909
|
}
|
|
921
910
|
get isFiltered() {
|
|
922
|
-
return this.filters.some((
|
|
911
|
+
return this.filters.some((e) => e.isActive()) || !!this.search && this.search.isSet;
|
|
923
912
|
}
|
|
924
913
|
get visibleSorting() {
|
|
925
|
-
return this.sorting.filter((
|
|
914
|
+
return this.sorting.filter((e) => e.defaultEnabled !== "hidden");
|
|
926
915
|
}
|
|
927
|
-
static useNew(
|
|
928
|
-
return new
|
|
916
|
+
static useNew(e) {
|
|
917
|
+
return new b(e);
|
|
929
918
|
}
|
|
930
919
|
storeFilterDefaultSettings() {
|
|
931
920
|
if (this.defaultSettings && this.filterSettingsStorageKey) {
|
|
932
|
-
const
|
|
933
|
-
this.filters.map((
|
|
934
|
-
|
|
935
|
-
|
|
921
|
+
const e = Object.fromEntries(
|
|
922
|
+
this.filters.map((t) => [
|
|
923
|
+
t.property,
|
|
924
|
+
t.getArrayValue().filter((s) => s.isActive).map((s) => s.value)
|
|
936
925
|
])
|
|
937
926
|
);
|
|
938
927
|
this.defaultSettings.set(
|
|
939
928
|
"List",
|
|
940
929
|
this.filterSettingsStorageKey,
|
|
941
930
|
k.settingsStorageSchema,
|
|
942
|
-
|
|
931
|
+
e
|
|
943
932
|
);
|
|
944
933
|
}
|
|
945
934
|
}
|
|
@@ -956,163 +945,163 @@ let Cs = (v = class {
|
|
|
956
945
|
return this.defaultSettings.get(
|
|
957
946
|
"List",
|
|
958
947
|
this.viewModeStorageKey,
|
|
959
|
-
|
|
948
|
+
b.viewModeSettingsStorageSchema
|
|
960
949
|
);
|
|
961
950
|
}
|
|
962
|
-
getSorting(
|
|
963
|
-
const
|
|
964
|
-
return
|
|
951
|
+
getSorting(e) {
|
|
952
|
+
const t = this.sorting.find((s) => s.id === e);
|
|
953
|
+
return ye(!!t, `Could not get Sorting (ID: ${e})`), t;
|
|
965
954
|
}
|
|
966
955
|
clearSorting() {
|
|
967
|
-
return this.sorting.forEach((
|
|
956
|
+
return this.sorting.forEach((e) => e.clear());
|
|
968
957
|
}
|
|
969
958
|
resetFilters() {
|
|
970
|
-
return this.filters.forEach((
|
|
959
|
+
return this.filters.forEach((e) => e.resetValues());
|
|
971
960
|
}
|
|
972
961
|
useIsEmpty() {
|
|
973
962
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
974
963
|
}
|
|
975
|
-
}, r(
|
|
976
|
-
const Is = "flow--list--items", Ls = "flow--list--items--is-loading",
|
|
964
|
+
}, r(b, "viewModeSettingsStorageSchema", V.enum(["list", "table"]).optional()), b);
|
|
965
|
+
const Is = "flow--list--items", Ls = "flow--list--items--is-loading", fe = {
|
|
977
966
|
items: Is,
|
|
978
967
|
isLoading: Ls
|
|
979
968
|
}, Ps = "flow--list--items--item", Vs = "flow--list--items--item--is-selected", ks = "flow--list--items--item--has-action", A = {
|
|
980
969
|
item: Ps,
|
|
981
970
|
isSelected: Vs,
|
|
982
971
|
hasAction: ks
|
|
983
|
-
},
|
|
984
|
-
const { id:
|
|
972
|
+
}, Ae = () => /* @__PURE__ */ i.createElement(Pe, null, /* @__PURE__ */ i.createElement(Y, null, /* @__PURE__ */ i.createElement(B, { width: "200px" })), /* @__PURE__ */ i.createElement(E, null, /* @__PURE__ */ i.createElement(B, { width: "300px" }))), As = (a) => {
|
|
973
|
+
const { id: e, data: t, children: s } = a, o = g().itemView;
|
|
985
974
|
if (!o)
|
|
986
975
|
return null;
|
|
987
|
-
const c = o.list.onAction, l = o.textValue ? o.textValue(
|
|
976
|
+
const c = o.list.onAction, l = o.textValue ? o.textValue(t) : void 0, d = o.href ? o.href(t) : void 0, u = !!c || !!d;
|
|
988
977
|
return /* @__PURE__ */ i.createElement(
|
|
989
978
|
_.GridListItem,
|
|
990
979
|
{
|
|
991
|
-
id:
|
|
980
|
+
id: e,
|
|
992
981
|
className: (h) => T(
|
|
993
982
|
A.item,
|
|
994
983
|
u && A.hasAction,
|
|
995
984
|
h.isSelected && A.isSelected
|
|
996
985
|
),
|
|
997
|
-
onAction: () => c && c(
|
|
986
|
+
onAction: () => c && c(t),
|
|
998
987
|
textValue: l,
|
|
999
988
|
href: d
|
|
1000
989
|
},
|
|
1001
|
-
/* @__PURE__ */ i.createElement(
|
|
990
|
+
/* @__PURE__ */ i.createElement(Qe, { fallback: /* @__PURE__ */ i.createElement(Ae, null) }, s ?? o.render(t))
|
|
1002
991
|
);
|
|
1003
992
|
}, Ms = (a) => /* @__PURE__ */ i.createElement(_.GridListItem, { textValue: "-", className: A.item }, a.children), G = () => {
|
|
1004
|
-
const a = y(
|
|
1005
|
-
return /* @__PURE__ */ i.createElement(
|
|
993
|
+
const a = y(v);
|
|
994
|
+
return /* @__PURE__ */ i.createElement(Pt, null, /* @__PURE__ */ i.createElement(Vt, null), /* @__PURE__ */ i.createElement(Y, null, a.format("list.noResult.heading")), /* @__PURE__ */ i.createElement(E, null, a.format("list.noResult.text")));
|
|
1006
995
|
}, Bs = () => {
|
|
1007
|
-
var
|
|
1008
|
-
const
|
|
1009
|
-
return Array.from(Array(5)).map((s, n) => /* @__PURE__ */ i.createElement(Ms, { key: n },
|
|
996
|
+
var t;
|
|
997
|
+
const e = ((t = g().itemView) == null ? void 0 : t.fallback) ?? /* @__PURE__ */ i.createElement(Ae, null);
|
|
998
|
+
return Array.from(Array(5)).map((s, n) => /* @__PURE__ */ i.createElement(Ms, { key: n }, Xe(e)));
|
|
1010
999
|
}, Ds = () => {
|
|
1011
|
-
const a = g(),
|
|
1000
|
+
const a = g(), e = a.loader.useIsLoading(), t = a.loader.useIsInitiallyLoading();
|
|
1012
1001
|
if (!a.itemView)
|
|
1013
1002
|
return null;
|
|
1014
|
-
const s = a.items.entries.map((o) => /* @__PURE__ */ i.createElement(As, { key: o.id, data: o.data, id: o.id })), n = T(
|
|
1015
|
-
return /* @__PURE__ */ i.createElement("div", { "aria-hidden":
|
|
1003
|
+
const s = a.items.entries.map((o) => /* @__PURE__ */ i.createElement(As, { key: o.id, data: o.data, id: o.id })), n = T(fe.items, e && fe.isLoading);
|
|
1004
|
+
return /* @__PURE__ */ i.createElement("div", { "aria-hidden": t, "aria-busy": e }, /* @__PURE__ */ i.createElement(
|
|
1016
1005
|
_.GridList,
|
|
1017
1006
|
{
|
|
1018
1007
|
className: n,
|
|
1019
1008
|
...a.componentProps,
|
|
1020
1009
|
renderEmptyState: () => /* @__PURE__ */ i.createElement(G, null)
|
|
1021
1010
|
},
|
|
1022
|
-
|
|
1011
|
+
t ? /* @__PURE__ */ i.createElement(Bs, null) : s
|
|
1023
1012
|
));
|
|
1024
|
-
},
|
|
1013
|
+
}, Me = (a) => null, xs = () => Me, Be = (a) => null, Ns = () => Be, De = (a) => null, Rs = () => De, xe = (a) => null, $s = () => xe, Ne = (a) => null, zs = () => Ne, Us = "flow--list--footer", Ks = {
|
|
1025
1014
|
footer: Us
|
|
1026
1015
|
}, Os = (a) => {
|
|
1027
|
-
const
|
|
1016
|
+
const e = y(v), t = g(), s = t.batches, n = t.loader.useIsInitiallyLoading(), o = t.useIsEmpty(), c = s.getTotalItemsCount(), l = s.getVisibleItemsCount();
|
|
1028
1017
|
if (o)
|
|
1029
1018
|
return null;
|
|
1030
|
-
const d = n ? /* @__PURE__ */ i.createElement(
|
|
1019
|
+
const d = n ? /* @__PURE__ */ i.createElement(Mt, { width: "200px" }) : e.format("list.paginationInfo", {
|
|
1031
1020
|
visibleItemsCount: l,
|
|
1032
1021
|
totalItemsCount: c
|
|
1033
1022
|
});
|
|
1034
1023
|
return /* @__PURE__ */ i.createElement(E, { ...a }, d);
|
|
1035
1024
|
}, Hs = (a) => {
|
|
1036
|
-
const
|
|
1037
|
-
return !
|
|
1025
|
+
const e = y(v), t = g(), s = t.loader.useIsLoading(), n = t.loader.useIsInitiallyLoading();
|
|
1026
|
+
return !t.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ i.createElement(
|
|
1038
1027
|
w,
|
|
1039
1028
|
{
|
|
1040
1029
|
isPending: s && !n,
|
|
1041
1030
|
isDisabled: n,
|
|
1042
1031
|
...a,
|
|
1043
|
-
onPress: () =>
|
|
1032
|
+
onPress: () => t.batches.nextBatch(),
|
|
1044
1033
|
variant: "plain",
|
|
1045
1034
|
size: "s"
|
|
1046
1035
|
},
|
|
1047
|
-
|
|
1036
|
+
e.format("list.showMore")
|
|
1048
1037
|
);
|
|
1049
1038
|
}, qs = () => /* @__PURE__ */ i.createElement("div", { className: Ks.footer }, /* @__PURE__ */ i.createElement(Os, null), /* @__PURE__ */ i.createElement(Hs, null));
|
|
1050
|
-
function
|
|
1039
|
+
function Re(a) {
|
|
1051
1040
|
return null;
|
|
1052
1041
|
}
|
|
1053
|
-
const Gs = () =>
|
|
1042
|
+
const Gs = () => Re, $e = (a) => null, ze = (a) => null, Ue = (a) => null, js = (a) => /* @__PURE__ */ i.createElement(Ee, { ...a }, /* @__PURE__ */ i.createElement(Fe, null, /* @__PURE__ */ i.createElement(Te, null, /* @__PURE__ */ i.createElement(B, { width: "100%" }))), /* @__PURE__ */ i.createElement(Ce, null, Array.from(Array(5)).map((e, t) => /* @__PURE__ */ i.createElement(Ie, { key: t }, /* @__PURE__ */ i.createElement(Le, null, /* @__PURE__ */ i.createElement(B, { width: "100%" })))))), Ws = "flow--list--table", Js = "flow--list--table--is-loading", Ys = "flow--list--table--row", _s = "flow--list--table--is-selected", Qs = "flow--list--table--has-action", I = {
|
|
1054
1043
|
table: Ws,
|
|
1055
1044
|
isLoading: Js,
|
|
1056
1045
|
row: Ys,
|
|
1057
1046
|
isSelected: _s,
|
|
1058
1047
|
hasAction: Qs
|
|
1059
1048
|
}, Xs = () => {
|
|
1060
|
-
const a = g(),
|
|
1061
|
-
if (!
|
|
1049
|
+
const a = g(), e = a.table, t = a.useIsEmpty(), s = a.loader.useIsLoading(), n = a.loader.useIsInitiallyLoading();
|
|
1050
|
+
if (!e)
|
|
1062
1051
|
return null;
|
|
1063
1052
|
if (n)
|
|
1064
|
-
return /* @__PURE__ */ i.createElement(js, { ...
|
|
1065
|
-
if (
|
|
1053
|
+
return /* @__PURE__ */ i.createElement(js, { ...e.componentProps });
|
|
1054
|
+
if (t)
|
|
1066
1055
|
return /* @__PURE__ */ i.createElement(G, null);
|
|
1067
|
-
const o =
|
|
1056
|
+
const o = e.list.onAction, c = T(
|
|
1068
1057
|
I.table,
|
|
1069
1058
|
s && I.isLoading,
|
|
1070
|
-
|
|
1059
|
+
e.componentProps.className
|
|
1071
1060
|
);
|
|
1072
1061
|
return /* @__PURE__ */ i.createElement(
|
|
1073
|
-
|
|
1062
|
+
Ee,
|
|
1074
1063
|
{
|
|
1075
1064
|
...a.componentProps,
|
|
1076
|
-
...
|
|
1065
|
+
...e.componentProps,
|
|
1077
1066
|
className: c
|
|
1078
1067
|
},
|
|
1079
|
-
/* @__PURE__ */ i.createElement(
|
|
1068
|
+
/* @__PURE__ */ i.createElement(Fe, { ...e.header.componentProps }, e.header.columns.map((l, d) => /* @__PURE__ */ i.createElement(Te, { key: d, ...l.componentProps }))),
|
|
1080
1069
|
/* @__PURE__ */ i.createElement(
|
|
1081
|
-
|
|
1070
|
+
Ce,
|
|
1082
1071
|
{
|
|
1083
|
-
...
|
|
1072
|
+
...e.body.componentProps,
|
|
1084
1073
|
renderEmptyState: () => /* @__PURE__ */ i.createElement(G, null)
|
|
1085
1074
|
},
|
|
1086
1075
|
a.items.entries.map((l) => {
|
|
1087
1076
|
var d;
|
|
1088
1077
|
return /* @__PURE__ */ i.createElement(
|
|
1089
|
-
|
|
1078
|
+
Ie,
|
|
1090
1079
|
{
|
|
1091
1080
|
className: (u) => T(
|
|
1092
1081
|
I.row,
|
|
1093
1082
|
o && I.hasAction,
|
|
1094
|
-
|
|
1083
|
+
e.body.row.componentProps.className,
|
|
1095
1084
|
u.isSelected && I.isSelected
|
|
1096
1085
|
),
|
|
1097
1086
|
key: l.id,
|
|
1098
1087
|
id: l.id,
|
|
1099
1088
|
onAction: o ? () => o(l.data) : void 0,
|
|
1100
|
-
...
|
|
1089
|
+
...e.body.row.componentProps
|
|
1101
1090
|
},
|
|
1102
|
-
(d =
|
|
1091
|
+
(d = e.body.row) == null ? void 0 : d.cells.map((u, h) => /* @__PURE__ */ i.createElement(Le, { key: h, ...u.componentProps }, u.renderFn ? u.renderFn(l.data, a) : void 0))
|
|
1103
1092
|
);
|
|
1104
1093
|
})
|
|
1105
1094
|
)
|
|
1106
1095
|
);
|
|
1107
|
-
},
|
|
1108
|
-
var
|
|
1109
|
-
const { children:
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
)) == null ? void 0 :
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
)) == null ? void 0 :
|
|
1096
|
+
}, Ke = (a) => null, Oe = (a) => null, He = (a) => null, Zs = lt("List", (a) => {
|
|
1097
|
+
var ee, te, se, ie, ae, ne, re, oe, le;
|
|
1098
|
+
const { children: e, batchSize: t, onChange: s, refProp: n, ...o } = a, c = (ee = S(
|
|
1099
|
+
e,
|
|
1100
|
+
Me
|
|
1101
|
+
)) == null ? void 0 : ee.props, l = (te = S(
|
|
1102
|
+
e,
|
|
1103
|
+
kt
|
|
1104
|
+
)) == null ? void 0 : te.props, d = (se = S(e, Ne)) == null ? void 0 : se.props, u = {
|
|
1116
1105
|
source: c ? {
|
|
1117
1106
|
...c,
|
|
1118
1107
|
asyncLoader: c.children
|
|
@@ -1122,20 +1111,20 @@ const Gs = () => Rt, $t = (a) => null, zt = (a) => null, Ut = (a) => null, js =
|
|
|
1122
1111
|
} : d ? {
|
|
1123
1112
|
staticData: d.data
|
|
1124
1113
|
} : void 0
|
|
1125
|
-
}, h = (
|
|
1114
|
+
}, h = (ie = S(e, Re)) == null ? void 0 : ie.props, C = (ae = S(e, xe)) == null ? void 0 : ae.props, N = (ne = S(e, Ke)) == null ? void 0 : ne.props, L = P(e, $e).map(
|
|
1126
1115
|
(f) => ({
|
|
1127
1116
|
...f.props,
|
|
1128
1117
|
name: f.props.children
|
|
1129
1118
|
})
|
|
1130
|
-
),
|
|
1119
|
+
), R = P(e, Ue).map(
|
|
1131
1120
|
(f) => ({
|
|
1132
1121
|
...f.props,
|
|
1133
1122
|
renderFn: f.props.children
|
|
1134
1123
|
})
|
|
1135
|
-
),
|
|
1124
|
+
), $ = (re = S(e, ze)) == null ? void 0 : re.props, z = (oe = S(e, Oe)) == null ? void 0 : oe.props, p = (le = S(e, He)) == null ? void 0 : le.props, U = Cs.useNew({
|
|
1136
1125
|
onChange: s,
|
|
1137
1126
|
loader: u,
|
|
1138
|
-
filters: P(
|
|
1127
|
+
filters: P(e, Be).map(
|
|
1139
1128
|
(f) => ({
|
|
1140
1129
|
...f.props,
|
|
1141
1130
|
renderItem: f.props.children
|
|
@@ -1146,72 +1135,72 @@ const Gs = () => Rt, $t = (a) => null, zt = (a) => null, Ut = (a) => null, js =
|
|
|
1146
1135
|
textFieldProps: h,
|
|
1147
1136
|
defaultValue: h.defaultValue
|
|
1148
1137
|
} : void 0,
|
|
1149
|
-
sorting: P(
|
|
1138
|
+
sorting: P(e, De).map((f) => f.props),
|
|
1150
1139
|
itemView: C ? {
|
|
1151
1140
|
...C,
|
|
1152
1141
|
renderFn: C.children
|
|
1153
1142
|
} : void 0,
|
|
1154
1143
|
table: L.length > 0 ? {
|
|
1155
1144
|
header: {
|
|
1156
|
-
...
|
|
1145
|
+
...z,
|
|
1157
1146
|
columns: L
|
|
1158
1147
|
},
|
|
1159
1148
|
body: {
|
|
1160
1149
|
...p,
|
|
1161
1150
|
row: {
|
|
1162
|
-
|
|
1163
|
-
cells:
|
|
1151
|
+
...$,
|
|
1152
|
+
cells: R
|
|
1164
1153
|
}
|
|
1165
1154
|
},
|
|
1166
|
-
...
|
|
1155
|
+
...N
|
|
1167
1156
|
} : void 0,
|
|
1168
1157
|
batchesController: {
|
|
1169
|
-
batchSize:
|
|
1158
|
+
batchSize: t
|
|
1170
1159
|
},
|
|
1171
1160
|
...o
|
|
1172
|
-
}),
|
|
1161
|
+
}), qe = {
|
|
1173
1162
|
ActionGroup: {
|
|
1174
1163
|
className: F.actions,
|
|
1175
1164
|
tunnelId: "actions",
|
|
1176
1165
|
ignoreBreakpoint: !0
|
|
1177
1166
|
}
|
|
1178
|
-
},
|
|
1179
|
-
return /* @__PURE__ */ i.createElement(
|
|
1180
|
-
|
|
1167
|
+
}, Ge = !!S(e, Bt);
|
|
1168
|
+
return /* @__PURE__ */ i.createElement(be, { props: qe }, /* @__PURE__ */ i.createElement(ve, null, /* @__PURE__ */ i.createElement(
|
|
1169
|
+
Ve.Provider,
|
|
1181
1170
|
{
|
|
1182
1171
|
value: {
|
|
1183
|
-
list:
|
|
1172
|
+
list: U
|
|
1184
1173
|
}
|
|
1185
1174
|
},
|
|
1186
|
-
/* @__PURE__ */ i.createElement(
|
|
1187
|
-
/* @__PURE__ */ i.createElement("div", { className: cs.list, ref: n },
|
|
1175
|
+
/* @__PURE__ */ i.createElement(qt, null),
|
|
1176
|
+
/* @__PURE__ */ i.createElement("div", { className: cs.list, ref: n }, e, /* @__PURE__ */ i.createElement(os, { hasActionGroup: Ge }), U.viewMode === "list" && /* @__PURE__ */ i.createElement(Ds, null), U.viewMode === "table" && /* @__PURE__ */ i.createElement(Xs, null), /* @__PURE__ */ i.createElement(qs, null))
|
|
1188
1177
|
)));
|
|
1189
|
-
}),
|
|
1190
|
-
List:
|
|
1178
|
+
}), ei = () => Zs, Zi = () => ({
|
|
1179
|
+
List: ei(),
|
|
1191
1180
|
Filter: Ns(),
|
|
1192
1181
|
Search: Gs(),
|
|
1193
1182
|
Sorting: Rs(),
|
|
1194
1183
|
Item: $s(),
|
|
1195
|
-
ItemView:
|
|
1196
|
-
TableHeader:
|
|
1197
|
-
TableColumn: $
|
|
1198
|
-
TableBody:
|
|
1199
|
-
TableRow:
|
|
1200
|
-
TableCell:
|
|
1201
|
-
Table:
|
|
1184
|
+
ItemView: Pe,
|
|
1185
|
+
TableHeader: Oe,
|
|
1186
|
+
TableColumn: $e,
|
|
1187
|
+
TableBody: He,
|
|
1188
|
+
TableRow: ze,
|
|
1189
|
+
TableCell: Ue,
|
|
1190
|
+
Table: Ke,
|
|
1202
1191
|
StaticData: zs(),
|
|
1203
1192
|
LoaderAsync: xs(),
|
|
1204
|
-
LoaderAsyncResource:
|
|
1193
|
+
LoaderAsyncResource: At()
|
|
1205
1194
|
});
|
|
1206
1195
|
export {
|
|
1207
1196
|
Zs as List,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1197
|
+
Be as ListFilter,
|
|
1198
|
+
xe as ListItem,
|
|
1199
|
+
Pe as ListItemView,
|
|
1200
|
+
Me as ListLoaderAsync,
|
|
1201
|
+
De as ListSorting,
|
|
1202
|
+
Ne as ListStaticData,
|
|
1203
|
+
ei as TypedList,
|
|
1215
1204
|
Ns as TypedListFilter,
|
|
1216
1205
|
$s as TypedListItem,
|
|
1217
1206
|
xs as TypedListLoaderAsync,
|