@mittwald/flow-react-components 0.1.0-alpha.211 → 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 +541 -515
- 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/components/Items/components/Item/Item.d.ts +2 -0
- package/dist/types/components/List/model/List.d.ts +2 -1
- package/dist/types/components/List/model/table/TableRow.d.ts +0 -2
- package/dist/types/components/List/model/table/types.d.ts +0 -2
- package/dist/types/components/List/model/types.d.ts +6 -1
- package/dist/types/components/List/testData/domainApi.d.ts +1 -0
- package/dist/types/components/List/typedList.d.ts +0 -1
- 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 = (a,
|
|
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 } from "./Text-Sd5q3Yme.js";
|
|
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",
|
|
@@ -86,227 +86,227 @@ const ye = "flow--list--items--item--view", Ee = "flow--list--items--item--view-
|
|
|
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 a = h(),
|
|
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:
|
|
165
|
+
selectedKeys: t ? [t.id] : [],
|
|
166
166
|
onAction: (i) => {
|
|
167
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 a = h(),
|
|
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
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
|
-
|
|
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:
|
|
240
|
-
onChange: (
|
|
241
|
-
onClear:
|
|
239
|
+
onKeyUp: d,
|
|
240
|
+
onChange: (m) => l(m),
|
|
241
|
+
onClear: c,
|
|
242
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 a =
|
|
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
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
266
|
id: i,
|
|
267
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
307
|
var i;
|
|
308
|
-
const { batchSize: s = 20 } =
|
|
309
|
-
this.list =
|
|
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 Ye {
|
|
|
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 Ye {
|
|
|
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 nt {
|
|
|
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 ts {
|
|
|
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 i = this.property, o = i.startsWith(
|
|
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], i = (o) => this.matcher(o.value,
|
|
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(
|
|
408
|
+
const o = s(t);
|
|
409
409
|
return o.length === 0 || o.some(i);
|
|
410
410
|
} else if (this.mode === "one")
|
|
411
|
-
return i(
|
|
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 ts {
|
|
|
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
|
-
class
|
|
472
|
-
constructor(
|
|
471
|
+
class ts {
|
|
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,66 +502,67 @@ class es {
|
|
|
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 =
|
|
511
|
+
this.list = e;
|
|
512
512
|
const i = this.list.sorting.filter(
|
|
513
|
-
(
|
|
514
|
-
), [o, l] =
|
|
515
|
-
i.map((
|
|
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(), i =
|
|
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
|
-
(i) => i.defaultEnabled === "hidden" && !
|
|
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)
|
|
552
553
|
).map((i) => i.getReactTableColumnSort());
|
|
553
|
-
this.updateSortingState([...s, ...
|
|
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 i =
|
|
564
|
+
const e = /* @__PURE__ */ new Map(), t = (s) => {
|
|
565
|
+
const i = e.get(s);
|
|
565
566
|
if (i)
|
|
566
567
|
return i;
|
|
567
568
|
const o = {
|
|
@@ -570,75 +571,75 @@ class U {
|
|
|
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
626
|
const ss = [];
|
|
626
|
-
class
|
|
627
|
-
constructor(
|
|
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 } =
|
|
635
|
+
var c;
|
|
636
|
+
const { source: s } = t;
|
|
636
637
|
this.dataSource = s ?? { staticData: ss };
|
|
637
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;
|
|
638
|
-
this.list =
|
|
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,84 +654,84 @@ class H {
|
|
|
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
|
-
})), [
|
|
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]);
|
|
673
674
|
}
|
|
674
|
-
useObserveBatchData(
|
|
675
|
+
useObserveBatchData(e, t) {
|
|
675
676
|
const s = (i) => {
|
|
676
677
|
const { data: o, itemTotalCount: l } = i;
|
|
677
|
-
this.loaderState.setDataBatch(
|
|
678
|
+
this.loaderState.setDataBatch(t, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
|
|
678
679
|
};
|
|
679
|
-
|
|
680
|
+
k(() => (e.value.value.isSet && s(e.value.value.value), e.value.observe((i) => {
|
|
680
681
|
i.isSet && s(i.value);
|
|
681
|
-
})), [
|
|
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
|
|
705
|
+
getBatchDataAsyncResource(e) {
|
|
706
|
+
const t = this.dataSource, s = this.getDataLoaderOptions(e);
|
|
707
|
+
if ("staticData" in t)
|
|
708
|
+
return ie(
|
|
708
709
|
async (i) => ({
|
|
709
710
|
data: i,
|
|
710
711
|
itemTotalCount: i.length
|
|
711
712
|
}),
|
|
712
|
-
[
|
|
713
|
+
[t.staticData]
|
|
713
714
|
);
|
|
714
|
-
if ("asyncLoader" in
|
|
715
|
-
const i =
|
|
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], {
|
|
717
718
|
loaderId: l
|
|
718
719
|
});
|
|
719
720
|
}
|
|
720
|
-
if ("asyncResourceFactory" in
|
|
721
|
-
const i =
|
|
721
|
+
if ("asyncResourceFactory" in t) {
|
|
722
|
+
const i = t.asyncResourceFactory;
|
|
722
723
|
return i(s);
|
|
723
724
|
}
|
|
724
725
|
throw new Error("Unknown data source");
|
|
725
726
|
}
|
|
726
727
|
}
|
|
727
728
|
class as {
|
|
728
|
-
constructor(
|
|
729
|
+
constructor(e, t) {
|
|
729
730
|
r(this, "list");
|
|
730
731
|
r(this, "render");
|
|
731
732
|
r(this, "textFieldProps");
|
|
732
733
|
r(this, "onUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
733
|
-
this.list =
|
|
734
|
+
this.list = e, this.render = t.render, this.textFieldProps = t.textFieldProps;
|
|
734
735
|
}
|
|
735
736
|
get value() {
|
|
736
737
|
return this.list.reactTable.searchString;
|
|
@@ -739,83 +740,82 @@ class as {
|
|
|
739
740
|
return this.value !== void 0;
|
|
740
741
|
}
|
|
741
742
|
callOnUpdateCallbacks() {
|
|
742
|
-
this.onUpdateCallbacks.forEach((
|
|
743
|
+
this.onUpdateCallbacks.forEach((e) => e());
|
|
743
744
|
}
|
|
744
|
-
setValue(
|
|
745
|
-
|
|
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());
|
|
746
747
|
}
|
|
747
748
|
clear() {
|
|
748
749
|
this.setValue(void 0);
|
|
749
750
|
}
|
|
750
|
-
onUpdated(
|
|
751
|
-
this.onUpdateCallbacks.add(
|
|
751
|
+
onUpdated(e) {
|
|
752
|
+
this.onUpdateCallbacks.add(e);
|
|
752
753
|
}
|
|
753
754
|
}
|
|
754
|
-
const
|
|
755
|
-
constructor(
|
|
755
|
+
const V = class V {
|
|
756
|
+
constructor(e, t = {}) {
|
|
756
757
|
r(this, "list");
|
|
757
758
|
r(this, "textValue");
|
|
758
759
|
r(this, "href");
|
|
759
760
|
r(this, "fallback");
|
|
760
761
|
r(this, "renderFn");
|
|
761
|
-
const { fallback: s, textValue: i, href: o, renderFn: l } =
|
|
762
|
-
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;
|
|
763
764
|
}
|
|
764
|
-
render(
|
|
765
|
-
return (this.renderFn ??
|
|
765
|
+
render(e) {
|
|
766
|
+
return (this.renderFn ?? V.fallbackRenderItemFn)(e);
|
|
766
767
|
}
|
|
767
768
|
};
|
|
768
|
-
r(
|
|
769
|
-
let
|
|
770
|
-
constructor(
|
|
769
|
+
r(V, "fallbackRenderItemFn", (e) => ce("pre", void 0, JSON.stringify(e)));
|
|
770
|
+
let D = V, is = class {
|
|
771
|
+
constructor(e, t = {}) {
|
|
771
772
|
r(this, "tableHeader");
|
|
772
773
|
r(this, "componentProps");
|
|
773
|
-
this.tableHeader =
|
|
774
|
+
this.tableHeader = e, this.componentProps = t;
|
|
774
775
|
}
|
|
775
776
|
}, ns = class {
|
|
776
|
-
constructor(
|
|
777
|
+
constructor(e, t = {}) {
|
|
777
778
|
r(this, "table");
|
|
778
779
|
r(this, "componentProps");
|
|
779
780
|
r(this, "columns");
|
|
780
|
-
const { columns: s = [], ...i } =
|
|
781
|
-
this.table =
|
|
781
|
+
const { columns: s = [], ...i } = t;
|
|
782
|
+
this.table = e, this.columns = s.map((o) => new is(this, o)), this.componentProps = i;
|
|
782
783
|
}
|
|
783
784
|
}, rs = class {
|
|
784
|
-
constructor(
|
|
785
|
+
constructor(e, t = {}) {
|
|
785
786
|
r(this, "row");
|
|
786
787
|
r(this, "renderFn");
|
|
787
788
|
r(this, "componentProps");
|
|
788
|
-
const { renderFn: s, ...i } =
|
|
789
|
-
this.row =
|
|
789
|
+
const { renderFn: s, ...i } = t;
|
|
790
|
+
this.row = e, this.renderFn = s, this.componentProps = i;
|
|
790
791
|
}
|
|
791
792
|
}, os = class {
|
|
792
|
-
constructor(
|
|
793
|
+
constructor(e, t = {}) {
|
|
793
794
|
r(this, "tableBody");
|
|
794
|
-
r(this, "onAction");
|
|
795
795
|
r(this, "cells");
|
|
796
796
|
r(this, "componentProps");
|
|
797
|
-
const {
|
|
798
|
-
this.tableBody =
|
|
797
|
+
const { cells: s = [], ...i } = t;
|
|
798
|
+
this.tableBody = e, this.cells = s.map((o) => new rs(this, o)), this.componentProps = i;
|
|
799
799
|
}
|
|
800
800
|
}, ls = class {
|
|
801
|
-
constructor(
|
|
801
|
+
constructor(e, t = {}) {
|
|
802
802
|
r(this, "table");
|
|
803
803
|
r(this, "componentProps");
|
|
804
804
|
r(this, "row");
|
|
805
|
-
const { row: s, ...i } =
|
|
806
|
-
this.table =
|
|
805
|
+
const { row: s, ...i } = t;
|
|
806
|
+
this.table = e, this.row = new os(this, s), this.componentProps = i;
|
|
807
807
|
}
|
|
808
808
|
}, cs = class {
|
|
809
|
-
constructor(
|
|
809
|
+
constructor(e, t = {}) {
|
|
810
810
|
r(this, "list");
|
|
811
811
|
r(this, "header");
|
|
812
812
|
r(this, "body");
|
|
813
813
|
r(this, "componentProps");
|
|
814
|
-
const { header: s, body: i, ...o } =
|
|
815
|
-
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;
|
|
816
816
|
}
|
|
817
|
-
}, ds = class
|
|
818
|
-
constructor(
|
|
817
|
+
}, ds = class Ce {
|
|
818
|
+
constructor(e) {
|
|
819
819
|
r(this, "filters");
|
|
820
820
|
r(this, "itemView");
|
|
821
821
|
r(this, "table");
|
|
@@ -826,199 +826,225 @@ let N = k, is = class {
|
|
|
826
826
|
r(this, "batches");
|
|
827
827
|
r(this, "loader");
|
|
828
828
|
r(this, "onAction");
|
|
829
|
+
r(this, "getItemId");
|
|
829
830
|
r(this, "componentProps");
|
|
830
|
-
r(this, "viewMode"
|
|
831
|
+
r(this, "viewMode");
|
|
831
832
|
const {
|
|
832
|
-
itemView:
|
|
833
|
+
itemView: t,
|
|
833
834
|
table: s,
|
|
834
835
|
filters: i = [],
|
|
835
836
|
sorting: o = [],
|
|
836
837
|
batchesController: l,
|
|
837
|
-
onChange:
|
|
838
|
-
loader:
|
|
839
|
-
search:
|
|
838
|
+
onChange: c,
|
|
839
|
+
loader: d,
|
|
840
|
+
search: m,
|
|
840
841
|
onAction: g,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
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, {
|
|
844
847
|
manualFiltering: this.loader.manualFiltering,
|
|
845
848
|
manualPagination: this.loader.manualPagination,
|
|
846
849
|
manualSorting: this.loader.manualSorting
|
|
847
|
-
}),
|
|
848
|
-
this.filters.forEach((
|
|
849
|
-
}, [this.filters]),
|
|
850
|
+
}), k(() => {
|
|
851
|
+
this.filters.forEach((S) => S.deleteUnknownFilterValues());
|
|
852
|
+
}, [this.filters]), it(this, { viewMode: !0, setViewMode: !0 });
|
|
850
853
|
}
|
|
851
|
-
static useNew(
|
|
852
|
-
return
|
|
854
|
+
static useNew(e) {
|
|
855
|
+
return me(new Ce(e)).current;
|
|
853
856
|
}
|
|
854
857
|
get isFiltered() {
|
|
855
|
-
return this.filters.some((
|
|
858
|
+
return this.filters.some((e) => e.isActive()) || !!this.search && this.search.isSet;
|
|
856
859
|
}
|
|
857
860
|
get visibleSorting() {
|
|
858
|
-
return this.sorting.filter((
|
|
861
|
+
return this.sorting.filter((e) => e.defaultEnabled !== "hidden");
|
|
859
862
|
}
|
|
860
|
-
getSorting(
|
|
861
|
-
const
|
|
862
|
-
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;
|
|
863
866
|
}
|
|
864
867
|
clearSorting() {
|
|
865
|
-
return this.sorting.forEach((
|
|
868
|
+
return this.sorting.forEach((e) => e.clear());
|
|
866
869
|
}
|
|
867
870
|
clearFilters() {
|
|
868
|
-
var
|
|
869
|
-
return (
|
|
871
|
+
var e;
|
|
872
|
+
return (e = this.search) == null || e.clear(), this.filters.forEach((t) => t.clearValues());
|
|
870
873
|
}
|
|
871
874
|
useIsEmpty() {
|
|
872
875
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
873
876
|
}
|
|
874
|
-
setViewMode(
|
|
875
|
-
this.viewMode =
|
|
877
|
+
setViewMode(e) {
|
|
878
|
+
this.viewMode = e;
|
|
876
879
|
}
|
|
877
880
|
};
|
|
878
|
-
const
|
|
879
|
-
items:
|
|
880
|
-
isLoading:
|
|
881
|
-
}, hs = "flow--list--items--item", ps = "flow--list--items--item--has-action",
|
|
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 = {
|
|
882
885
|
item: hs,
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
886
|
+
isSelected: ps,
|
|
887
|
+
hasAction: gs
|
|
888
|
+
}, bs = (a) => {
|
|
889
|
+
const { id: e, data: t, children: s } = a, o = h().itemView;
|
|
890
|
+
if (!o)
|
|
887
891
|
return null;
|
|
888
|
-
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;
|
|
889
893
|
return /* @__PURE__ */ n.createElement(
|
|
890
|
-
|
|
894
|
+
H.GridListItem,
|
|
891
895
|
{
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
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,
|
|
895
904
|
href: d
|
|
896
905
|
},
|
|
897
|
-
|
|
906
|
+
s ?? o.render(t)
|
|
898
907
|
);
|
|
899
|
-
},
|
|
900
|
-
const a =
|
|
901
|
-
return /* @__PURE__ */ n.createElement(
|
|
902
|
-
},
|
|
903
|
-
var
|
|
904
|
-
const
|
|
905
|
-
return Array.from(Array(5)).map((s, i) => /* @__PURE__ */ n.createElement(
|
|
906
|
-
},
|
|
907
|
-
const a = h(),
|
|
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();
|
|
908
917
|
if (!a.itemView)
|
|
909
918
|
return null;
|
|
910
|
-
const
|
|
911
|
-
return
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
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();
|
|
916
933
|
if (o)
|
|
917
934
|
return null;
|
|
918
|
-
const
|
|
919
|
-
visibleItemsCount:
|
|
935
|
+
const d = i ? /* @__PURE__ */ n.createElement(vt, { width: "200px" }) : e.format("list.paginationInfo", {
|
|
936
|
+
visibleItemsCount: c,
|
|
920
937
|
totalItemsCount: l
|
|
921
938
|
});
|
|
922
|
-
return /* @__PURE__ */ n.createElement(
|
|
923
|
-
},
|
|
924
|
-
const
|
|
925
|
-
return !
|
|
926
|
-
|
|
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,
|
|
927
944
|
{
|
|
928
945
|
isPending: s && !i,
|
|
929
946
|
isDisabled: i,
|
|
930
947
|
...a,
|
|
931
|
-
onPress: () =>
|
|
948
|
+
onPress: () => t.batches.nextBatch(),
|
|
932
949
|
variant: "plain",
|
|
933
950
|
size: "s"
|
|
934
951
|
},
|
|
935
|
-
|
|
952
|
+
e.format("list.showMore")
|
|
936
953
|
);
|
|
937
|
-
},
|
|
938
|
-
function
|
|
954
|
+
}, As = () => /* @__PURE__ */ n.createElement("div", { className: Is.footer }, /* @__PURE__ */ n.createElement(Ps, null), /* @__PURE__ */ n.createElement(ks, null));
|
|
955
|
+
function Ve(a) {
|
|
939
956
|
return null;
|
|
940
957
|
}
|
|
941
|
-
const
|
|
942
|
-
table:
|
|
943
|
-
isLoading:
|
|
944
|
-
row:
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
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)
|
|
949
967
|
return null;
|
|
950
968
|
if (i)
|
|
951
|
-
return /* @__PURE__ */ n.createElement(
|
|
952
|
-
if (
|
|
953
|
-
return /* @__PURE__ */ n.createElement(
|
|
954
|
-
const o =
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
), d = y(
|
|
959
|
-
L.table,
|
|
960
|
-
s && L.isLoading,
|
|
961
|
-
t.componentProps.className
|
|
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
|
|
962
976
|
);
|
|
963
977
|
return /* @__PURE__ */ n.createElement(
|
|
964
|
-
|
|
978
|
+
be,
|
|
965
979
|
{
|
|
966
980
|
...a.componentProps,
|
|
967
|
-
...
|
|
968
|
-
className:
|
|
981
|
+
...e.componentProps,
|
|
982
|
+
className: l
|
|
969
983
|
},
|
|
970
|
-
/* @__PURE__ */ n.createElement(
|
|
971
|
-
/* @__PURE__ */ n.createElement(
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
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,
|
|
987
|
+
{
|
|
988
|
+
...e.body.componentProps,
|
|
989
|
+
renderEmptyState: () => /* @__PURE__ */ n.createElement($, null)
|
|
990
|
+
},
|
|
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
|
+
)
|
|
984
1010
|
);
|
|
985
|
-
},
|
|
1011
|
+
}, Re = (a) => null, Ne = (a) => null, De = (a) => null, zs = et(
|
|
986
1012
|
"List",
|
|
987
|
-
|
|
988
|
-
var
|
|
989
|
-
const { children:
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
)) == null ? void 0 :
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
)) == null ? void 0 :
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
)) == null ? void 0 :
|
|
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 = {
|
|
999
1025
|
source: l ? {
|
|
1000
1026
|
...l,
|
|
1001
1027
|
asyncLoader: l.children
|
|
1002
|
-
} : d ? {
|
|
1003
|
-
...d,
|
|
1004
|
-
asyncResourceFactory: d.children
|
|
1005
1028
|
} : c ? {
|
|
1006
|
-
|
|
1029
|
+
...c,
|
|
1030
|
+
asyncResourceFactory: c.children
|
|
1031
|
+
} : d ? {
|
|
1032
|
+
staticData: d.data
|
|
1007
1033
|
} : void 0
|
|
1008
|
-
}, g = (
|
|
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(
|
|
1009
1035
|
(p) => ({
|
|
1010
1036
|
...p.props,
|
|
1011
1037
|
name: p.props.children
|
|
1012
1038
|
})
|
|
1013
|
-
),
|
|
1039
|
+
), S = L(e, xe).map(
|
|
1014
1040
|
(p) => ({
|
|
1015
1041
|
...p.props,
|
|
1016
1042
|
renderFn: p.props.children
|
|
1017
1043
|
})
|
|
1018
|
-
), $
|
|
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({
|
|
1019
1045
|
onChange: s,
|
|
1020
|
-
loader:
|
|
1021
|
-
filters:
|
|
1046
|
+
loader: m,
|
|
1047
|
+
filters: L(e, Ie).map(
|
|
1022
1048
|
(p) => ({
|
|
1023
1049
|
...p.props,
|
|
1024
1050
|
renderItem: p.props.children
|
|
@@ -1028,73 +1054,73 @@ const As = () => At, Vt = (a) => null, Bt = (a) => null, Mt = (a) => null, Vs =
|
|
|
1028
1054
|
render: g.children,
|
|
1029
1055
|
textFieldProps: g
|
|
1030
1056
|
} : void 0,
|
|
1031
|
-
sorting:
|
|
1057
|
+
sorting: L(e, Pe).map(
|
|
1032
1058
|
(p) => p.props
|
|
1033
1059
|
),
|
|
1034
|
-
itemView:
|
|
1035
|
-
...
|
|
1036
|
-
renderFn:
|
|
1060
|
+
itemView: T ? {
|
|
1061
|
+
...T,
|
|
1062
|
+
renderFn: T.children
|
|
1037
1063
|
} : void 0,
|
|
1038
|
-
table:
|
|
1064
|
+
table: C.length > 0 ? {
|
|
1039
1065
|
header: {
|
|
1040
|
-
...
|
|
1041
|
-
columns:
|
|
1066
|
+
...ze,
|
|
1067
|
+
columns: C
|
|
1042
1068
|
},
|
|
1043
1069
|
body: {
|
|
1044
|
-
...
|
|
1070
|
+
...Ue,
|
|
1045
1071
|
row: {
|
|
1046
|
-
...$
|
|
1047
|
-
cells:
|
|
1072
|
+
...$e,
|
|
1073
|
+
cells: S
|
|
1048
1074
|
}
|
|
1049
1075
|
},
|
|
1050
|
-
...
|
|
1076
|
+
...M
|
|
1051
1077
|
} : void 0,
|
|
1052
1078
|
batchesController: {
|
|
1053
|
-
batchSize:
|
|
1079
|
+
batchSize: t
|
|
1054
1080
|
},
|
|
1055
1081
|
...o
|
|
1056
1082
|
});
|
|
1057
1083
|
return /* @__PURE__ */ n.createElement(
|
|
1058
|
-
|
|
1084
|
+
Te.Provider,
|
|
1059
1085
|
{
|
|
1060
1086
|
value: {
|
|
1061
|
-
list:
|
|
1087
|
+
list: x
|
|
1062
1088
|
}
|
|
1063
1089
|
},
|
|
1064
|
-
/* @__PURE__ */ n.createElement(
|
|
1065
|
-
/* @__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))
|
|
1066
1092
|
);
|
|
1067
1093
|
})
|
|
1068
|
-
),
|
|
1069
|
-
List:
|
|
1070
|
-
Filter:
|
|
1071
|
-
Search:
|
|
1072
|
-
Sorting:
|
|
1073
|
-
Item:
|
|
1074
|
-
ItemView:
|
|
1075
|
-
TableHeader:
|
|
1076
|
-
TableColumn:
|
|
1077
|
-
TableBody:
|
|
1078
|
-
TableRow:
|
|
1079
|
-
TableCell:
|
|
1080
|
-
Table:
|
|
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,
|
|
1081
1107
|
StaticData: Cs(),
|
|
1082
|
-
LoaderAsync:
|
|
1083
|
-
LoaderAsyncResource:
|
|
1108
|
+
LoaderAsync: ys(),
|
|
1109
|
+
LoaderAsyncResource: wt()
|
|
1084
1110
|
});
|
|
1085
1111
|
export {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
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,
|
|
1098
1124
|
Cs as TypedListStaticData,
|
|
1099
1125
|
Na as typedList,
|
|
1100
1126
|
h as useList
|