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