@mittwald/flow-react-components 0.1.0-alpha.204 → 0.1.0-alpha.206
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/Activity.js +7 -0
- package/dist/List.js +314 -302
- package/dist/SkeletonText-B5ZghZhO.js +13 -0
- package/dist/SkeletonText.js +7 -0
- package/dist/Tabs.js +50 -51
- package/dist/styles.css +1 -1
- package/dist/types/components/List/model/filter/Filter.d.ts +6 -1
- package/dist/types/components/List/model/loading/types.d.ts +1 -1
- package/dist/types/components/SkeletonText/SkeletonText.d.ts +3 -3
- package/dist/types/components/SkeletonText/index.d.ts +3 -3
- package/package.json +12 -4
package/dist/List.js
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
var mt = Object.defineProperty;
|
|
4
|
-
var gt = (
|
|
5
|
-
var
|
|
6
|
-
import
|
|
4
|
+
var gt = (i, t, e) => t in i ? mt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
5
|
+
var n = (i, t, e) => gt(i, typeof t != "symbol" ? t + "" : t, e);
|
|
6
|
+
import r, { createContext as pt, useContext as ft, createElement as J, useState as Y, useEffect as E, useRef as bt, cloneElement as St } from "react";
|
|
7
7
|
import "./propsContext-DzAKlmhS.js";
|
|
8
8
|
import { P as vt } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
10
|
import { isShallowEqual as yt, unique as wt, times as Et } from "remeda";
|
|
11
|
-
import { d as
|
|
11
|
+
import { d as Ft } from "./dynamic-ClpUSmEt.js";
|
|
12
12
|
import { B as p } from "./Button-DQtavSbo.js";
|
|
13
13
|
import "@tabler/icons-react";
|
|
14
14
|
import "./Icon-DPoIVASu.js";
|
|
15
|
-
import { I as
|
|
16
|
-
import { a as A, C as
|
|
17
|
-
import { M as
|
|
15
|
+
import { I as Ct } from "./IconContextMenu-jwoVcLvd.js";
|
|
16
|
+
import { a as A, C as Q } from "./ContextMenuTrigger-BdJf5T8A.js";
|
|
17
|
+
import { M as X } from "./MenuItem-DcfYvfPJ.js";
|
|
18
18
|
import { useLocalizedStringFormatter as v } from "react-aria";
|
|
19
|
-
import { TunnelProvider as Lt, TunnelExit as
|
|
19
|
+
import { TunnelProvider as Lt, TunnelExit as U } from "@mittwald/react-tunnel";
|
|
20
20
|
import C from "clsx";
|
|
21
21
|
import { g as Tt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
|
|
22
22
|
import { f as It } from "./flowComponent-DHPUcYyM.js";
|
|
23
23
|
import { R as kt } from "./Render-BdlTa7Qb.js";
|
|
24
24
|
import { T as f } from "./Text-Sd5q3Yme.js";
|
|
25
|
-
import { I as
|
|
25
|
+
import { I as Z } from "./IconChevronDown--OxZLX8L.js";
|
|
26
26
|
import { I as At } from "./IconClose-BFwPT_IX.js";
|
|
27
|
-
import { makeObservable as
|
|
27
|
+
import { makeObservable as Bt, observable as $, computed as O, action as L } from "mobx";
|
|
28
28
|
import "./context-BB3_MApL.js";
|
|
29
|
-
import { u as
|
|
29
|
+
import { u as Vt } from "./useOnChange-C1Quwyuz.js";
|
|
30
30
|
import { S as Pt } from "./SearchField-DstUFmq4.js";
|
|
31
|
-
import { getProperty as
|
|
32
|
-
import { hash as
|
|
33
|
-
import { useReactTable as
|
|
31
|
+
import { getProperty as xt } from "dot-prop";
|
|
32
|
+
import { hash as Dt } from "object-code";
|
|
33
|
+
import { useReactTable as Nt, getCoreRowModel as Rt, getSortedRowModel as Mt, getFilteredRowModel as zt, getPaginationRowModel as Ut, getFacetedUniqueValues as $t } from "@tanstack/react-table";
|
|
34
34
|
import tt from "invariant";
|
|
35
35
|
import { getAsyncResource as q } from "@mittwald/react-use-promise";
|
|
36
36
|
import { u as H } from "./useSelector-DpU7_HMO.js";
|
|
37
|
-
import * as
|
|
37
|
+
import * as B from "react-aria-components";
|
|
38
38
|
import { I as Ot } from "./IllustratedMessage-B3MHD01M.js";
|
|
39
39
|
import { I as qt } from "./IconSearch-C7VQTAqK.js";
|
|
40
40
|
import { H as et } from "./Heading-BEC6iPfF.js";
|
|
41
|
-
import {
|
|
41
|
+
import { S as K } from "./SkeletonText-B5ZghZhO.js";
|
|
42
|
+
import { d as S, a as G } from "./deepFindOfType-6pG0fH7S.js";
|
|
42
43
|
import { ListLoaderAsyncResource as Ht, TypedListLoaderAsyncResource as Kt } from "./List/ListLoaderAsyncResource.js";
|
|
43
44
|
import { S as Gt } from "./Skeleton-CKLaTmDR.js";
|
|
44
|
-
const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title",
|
|
45
|
+
const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title", _t = "flow--list--items--item--view--top-content", Jt = "flow--list--items--item--view--content", Yt = "flow--list--items--item--view--action", Qt = "flow--list--items--item--view--avatar", Xt = "flow--list--items--item--view--text", Zt = "flow--list--items--item--view--heading", d = {
|
|
45
46
|
view: jt,
|
|
46
47
|
title: Wt,
|
|
47
|
-
topContent:
|
|
48
|
-
content:
|
|
49
|
-
action:
|
|
50
|
-
avatar:
|
|
51
|
-
text:
|
|
52
|
-
heading:
|
|
48
|
+
topContent: _t,
|
|
49
|
+
content: Jt,
|
|
50
|
+
action: Yt,
|
|
51
|
+
avatar: Qt,
|
|
52
|
+
text: Xt,
|
|
53
|
+
heading: Zt,
|
|
53
54
|
"container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
|
|
54
55
|
"container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
|
|
55
56
|
"container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
|
|
@@ -59,83 +60,83 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
59
60
|
"list.noResult.heading": "Keine Suchergebnisse gefunden",
|
|
60
61
|
"list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
|
|
61
62
|
"list.options": "Optionen",
|
|
62
|
-
"list.paginationInfo": (
|
|
63
|
+
"list.paginationInfo": (i) => `${i.visibleItemsCount} von insgesamt ${i.totalItemsCount} angezeigt`,
|
|
63
64
|
"list.resetAll": "Alles zurücksetzen",
|
|
64
|
-
"list.setSorting": (
|
|
65
|
+
"list.setSorting": (i) => `Sortierung: ${i.property}`,
|
|
65
66
|
"list.showMore": "Mehr anzeigen",
|
|
66
67
|
"list.sorting": "Sortierung"
|
|
67
68
|
}, "en-EN": {
|
|
68
69
|
"list.noResult.heading": "No search results found",
|
|
69
70
|
"list.noResult.text": "Your search did not return any results. Please adjust the search query or your filters.",
|
|
70
71
|
"list.options": "Options",
|
|
71
|
-
"list.paginationInfo": (
|
|
72
|
+
"list.paginationInfo": (i) => `Showing ${i.visibleItemsCount} of ${i.totalItemsCount}`,
|
|
72
73
|
"list.resetAll": "Reset filters",
|
|
73
|
-
"list.setSorting": (
|
|
74
|
+
"list.setSorting": (i) => `Sorting: ${i.property}`,
|
|
74
75
|
"list.showMore": "Show more",
|
|
75
76
|
"list.sorting": "Sorting"
|
|
76
|
-
} }, te = (
|
|
77
|
-
const { className: t, children: e } =
|
|
78
|
-
return /* @__PURE__ */
|
|
77
|
+
} }, te = (i) => {
|
|
78
|
+
const { className: t, children: e } = i, s = v(g);
|
|
79
|
+
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(
|
|
79
80
|
p,
|
|
80
81
|
{
|
|
81
82
|
variant: "plain",
|
|
82
83
|
className: t,
|
|
83
84
|
"aria-label": s.format("list.options")
|
|
84
85
|
},
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ r.createElement(Ct, null)
|
|
86
87
|
), e);
|
|
87
|
-
}, ee = (
|
|
88
|
-
const { children: t, className: e, containerBreakpointSize: s = "m" } =
|
|
88
|
+
}, ee = (i) => i === "top" ? d.topContent : i === "bottom" ? d.content : d.topContent, st = (i) => {
|
|
89
|
+
const { children: t, className: e, containerBreakpointSize: s = "m" } = i, a = {
|
|
89
90
|
ContextMenu: {
|
|
90
|
-
wrapWith: /* @__PURE__ */
|
|
91
|
+
wrapWith: /* @__PURE__ */ r.createElement(te, { className: d.action }),
|
|
91
92
|
placement: "bottom end"
|
|
92
93
|
},
|
|
93
94
|
Button: {
|
|
94
|
-
className:
|
|
95
|
+
className: d.action
|
|
95
96
|
},
|
|
96
97
|
ActionGroup: {
|
|
97
|
-
className:
|
|
98
|
+
className: d.action,
|
|
98
99
|
ignoreBreakpoint: !0
|
|
99
100
|
},
|
|
100
101
|
Content: {
|
|
101
|
-
className:
|
|
102
|
+
className: Ft((l) => ee(l.slot)),
|
|
102
103
|
tunnelId: "topContent"
|
|
103
104
|
},
|
|
104
105
|
Avatar: {
|
|
105
|
-
className:
|
|
106
|
+
className: d.avatar,
|
|
106
107
|
tunnelId: "title"
|
|
107
108
|
},
|
|
108
109
|
Heading: {
|
|
109
|
-
className:
|
|
110
|
+
className: d.heading,
|
|
110
111
|
level: 5,
|
|
111
112
|
tunnelId: "title"
|
|
112
113
|
},
|
|
113
114
|
Text: {
|
|
114
|
-
className:
|
|
115
|
+
className: d.text,
|
|
115
116
|
tunnelId: "title"
|
|
116
117
|
},
|
|
117
118
|
Link: {
|
|
118
119
|
unstyled: !0
|
|
119
120
|
}
|
|
120
121
|
}, o = C(
|
|
121
|
-
|
|
122
|
+
d.view,
|
|
122
123
|
e,
|
|
123
|
-
|
|
124
|
+
d[Tt(s)]
|
|
124
125
|
);
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
},
|
|
126
|
+
return /* @__PURE__ */ r.createElement("div", { className: o }, /* @__PURE__ */ r.createElement(vt, { props: a }, /* @__PURE__ */ r.createElement(Lt, null, t, /* @__PURE__ */ r.createElement("div", { className: d.title }, /* @__PURE__ */ r.createElement(U, { id: "title" })), /* @__PURE__ */ r.createElement(U, { id: "topContent" }))));
|
|
127
|
+
}, at = pt({}), m = () => ft(at).list, se = () => m().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(kt, { key: e }, () => {
|
|
127
128
|
t();
|
|
128
|
-
})),
|
|
129
|
-
const { sorting: t } =
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
}, T = (
|
|
132
|
-
const { children: t, locales: e, variables: s } =
|
|
129
|
+
})), ae = (i) => {
|
|
130
|
+
const { sorting: t } = i;
|
|
131
|
+
return /* @__PURE__ */ r.createElement(X, { id: t.id }, t.name);
|
|
132
|
+
}, T = (i) => {
|
|
133
|
+
const { children: t, locales: e, variables: s } = i;
|
|
133
134
|
return v(e).format(t, s);
|
|
134
|
-
},
|
|
135
|
-
const
|
|
135
|
+
}, ie = () => {
|
|
136
|
+
const i = m(), t = i.visibleSorting.map((a) => /* @__PURE__ */ r.createElement(ae, { sorting: a, key: a.id }));
|
|
136
137
|
if (t.length === 0)
|
|
137
138
|
return null;
|
|
138
|
-
const e =
|
|
139
|
+
const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ r.createElement(f, null, e ? /* @__PURE__ */ r.createElement(
|
|
139
140
|
T,
|
|
140
141
|
{
|
|
141
142
|
locales: g,
|
|
@@ -144,49 +145,49 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
144
145
|
}
|
|
145
146
|
},
|
|
146
147
|
"list.setSorting"
|
|
147
|
-
) : /* @__PURE__ */
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
|
|
148
|
+
) : /* @__PURE__ */ r.createElement(T, { locales: g }, "list.sorting"));
|
|
149
|
+
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
|
|
150
|
+
Q,
|
|
150
151
|
{
|
|
151
152
|
selectionMode: "single",
|
|
152
153
|
selectedKeys: e ? [e.id] : [],
|
|
153
|
-
onAction: (
|
|
154
|
-
|
|
154
|
+
onAction: (a) => {
|
|
155
|
+
i.getSorting(String(a)).enable();
|
|
155
156
|
}
|
|
156
157
|
},
|
|
157
158
|
t
|
|
158
159
|
));
|
|
159
|
-
},
|
|
160
|
-
const { filter: t } =
|
|
161
|
-
|
|
160
|
+
}, re = (i) => {
|
|
161
|
+
const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */ r.createElement(
|
|
162
|
+
X,
|
|
162
163
|
{
|
|
163
|
-
id:
|
|
164
|
-
key:
|
|
164
|
+
id: c.id,
|
|
165
|
+
key: c.id,
|
|
165
166
|
onAction: () => {
|
|
166
|
-
|
|
167
|
+
c.toggle();
|
|
167
168
|
}
|
|
168
169
|
},
|
|
169
|
-
|
|
170
|
-
)),
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
|
|
170
|
+
c.render()
|
|
171
|
+
)), u = e.filter((c) => c.isActive).map((c) => c.id);
|
|
172
|
+
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ r.createElement(f, null, a ?? o), /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
|
|
173
|
+
Q,
|
|
173
174
|
{
|
|
174
175
|
selectionMode: s === "one" ? "single" : "multiple",
|
|
175
|
-
selectedKeys:
|
|
176
|
+
selectedKeys: u
|
|
176
177
|
},
|
|
177
178
|
l
|
|
178
179
|
));
|
|
179
|
-
},
|
|
180
|
-
header:
|
|
180
|
+
}, ne = "flow--list--header", oe = "flow--list--header--picker-list-and-search", le = "flow--list--header--picker-list", ce = "flow--list--header--search-field", w = {
|
|
181
|
+
header: ne,
|
|
181
182
|
pickerListAndSearch: oe,
|
|
182
183
|
pickerList: le,
|
|
183
184
|
searchField: ce
|
|
184
|
-
}, ue = "flow--list--header--active-filters",
|
|
185
|
+
}, ue = "flow--list--header--active-filters", he = "flow--list--header--active-filters--clear-button", j = {
|
|
185
186
|
activeFilters: ue,
|
|
186
|
-
clearButton:
|
|
187
|
-
},
|
|
188
|
-
const
|
|
189
|
-
(e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */
|
|
187
|
+
clearButton: he
|
|
188
|
+
}, de = () => {
|
|
189
|
+
const i = m(), t = i.filters.flatMap(
|
|
190
|
+
(e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ r.createElement(
|
|
190
191
|
p,
|
|
191
192
|
{
|
|
192
193
|
variant: "soft",
|
|
@@ -194,72 +195,72 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
194
195
|
key: s.id,
|
|
195
196
|
onPress: () => s.deactivate()
|
|
196
197
|
},
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ r.createElement(f, null, s.render()),
|
|
199
|
+
/* @__PURE__ */ r.createElement(At, null)
|
|
199
200
|
))
|
|
200
201
|
);
|
|
201
|
-
return t.length <= 0 ? null : /* @__PURE__ */
|
|
202
|
+
return t.length <= 0 ? null : /* @__PURE__ */ r.createElement("div", { className: j.activeFilters }, t, /* @__PURE__ */ r.createElement(
|
|
202
203
|
p,
|
|
203
204
|
{
|
|
204
|
-
className:
|
|
205
|
+
className: j.clearButton,
|
|
205
206
|
size: "s",
|
|
206
207
|
variant: "plain",
|
|
207
|
-
onPress: () =>
|
|
208
|
+
onPress: () => i.clearFilters()
|
|
208
209
|
},
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ r.createElement(T, { locales: g }, "list.resetAll")
|
|
210
211
|
));
|
|
211
|
-
}, me = (
|
|
212
|
-
const { className: t, onChange: e, value: s, ...
|
|
213
|
-
|
|
212
|
+
}, me = (i) => {
|
|
213
|
+
const { className: t, onChange: e, value: s, ...a } = i, [o, l] = Y(s ?? "");
|
|
214
|
+
Vt(s, () => {
|
|
214
215
|
l(s ?? "");
|
|
215
216
|
}, [o]);
|
|
216
|
-
const
|
|
217
|
+
const u = () => {
|
|
217
218
|
e(void 0), l("");
|
|
218
|
-
},
|
|
219
|
-
|
|
219
|
+
}, c = (h) => {
|
|
220
|
+
h.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : h.key === "Escape" && u();
|
|
220
221
|
};
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ r.createElement(
|
|
222
223
|
Pt,
|
|
223
224
|
{
|
|
224
225
|
className: t,
|
|
225
226
|
value: o,
|
|
226
|
-
onKeyUp:
|
|
227
|
-
onChange: (
|
|
228
|
-
onClear:
|
|
229
|
-
...
|
|
227
|
+
onKeyUp: c,
|
|
228
|
+
onChange: (h) => l(h),
|
|
229
|
+
onClear: u,
|
|
230
|
+
...a
|
|
230
231
|
}
|
|
231
232
|
);
|
|
232
|
-
}, ge = (
|
|
233
|
-
const { className: t, search: e } =
|
|
234
|
-
return
|
|
233
|
+
}, ge = (i) => {
|
|
234
|
+
const { className: t, search: e } = i, s = e.render ?? me;
|
|
235
|
+
return J(s, {
|
|
235
236
|
className: t,
|
|
236
237
|
value: e.value,
|
|
237
238
|
onChange: e.setValue.bind(e),
|
|
238
239
|
...e.textFieldProps
|
|
239
240
|
});
|
|
240
|
-
}, pe = (
|
|
241
|
-
const { className: t } =
|
|
241
|
+
}, pe = (i) => {
|
|
242
|
+
const { className: t } = i, e = m();
|
|
242
243
|
if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
|
|
243
244
|
return null;
|
|
244
|
-
const s = e.filters.map((
|
|
245
|
-
return /* @__PURE__ */
|
|
245
|
+
const s = e.filters.map((a) => /* @__PURE__ */ r.createElement(re, { key: a.property, filter: a }));
|
|
246
|
+
return /* @__PURE__ */ r.createElement("div", { className: C(t, w.header) }, /* @__PURE__ */ r.createElement("div", { className: w.pickerListAndSearch }, /* @__PURE__ */ r.createElement("div", { className: w.pickerList }, /* @__PURE__ */ r.createElement(ie, null), s), e.search && /* @__PURE__ */ r.createElement(ge, { className: w.searchField, search: e.search })), /* @__PURE__ */ r.createElement(de, null));
|
|
246
247
|
}, fe = "flow--list", be = {
|
|
247
248
|
list: fe
|
|
248
249
|
};
|
|
249
|
-
let Se = class
|
|
250
|
+
let Se = class it {
|
|
250
251
|
constructor(t, e, s) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
n(this, "id");
|
|
253
|
+
n(this, "data");
|
|
254
|
+
n(this, "collection");
|
|
254
255
|
this.collection = t, this.id = e, this.data = s;
|
|
255
256
|
}
|
|
256
257
|
static fromRow(t, e) {
|
|
257
|
-
return new
|
|
258
|
+
return new it(t, e.id, e.original);
|
|
258
259
|
}
|
|
259
260
|
};
|
|
260
261
|
class ve {
|
|
261
262
|
constructor(t) {
|
|
262
|
-
|
|
263
|
+
n(this, "list");
|
|
263
264
|
this.list = t;
|
|
264
265
|
}
|
|
265
266
|
get entries() {
|
|
@@ -268,11 +269,11 @@ class ve {
|
|
|
268
269
|
}
|
|
269
270
|
class ye {
|
|
270
271
|
constructor(t, e = {}) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
var
|
|
272
|
+
n(this, "batchSize");
|
|
273
|
+
n(this, "list");
|
|
274
|
+
var a;
|
|
274
275
|
const { batchSize: s = 20 } = e;
|
|
275
|
-
this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (
|
|
276
|
+
this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (a = t.search) == null || a.onUpdated(() => this.reset());
|
|
276
277
|
}
|
|
277
278
|
get reactTable() {
|
|
278
279
|
return this.list.reactTable.table;
|
|
@@ -314,18 +315,18 @@ class ye {
|
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
const we = "$";
|
|
317
|
-
class
|
|
318
|
+
class W {
|
|
318
319
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
319
320
|
constructor(t, e) {
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
n(this, "filter");
|
|
322
|
+
n(this, "value");
|
|
322
323
|
this.filter = t, this.value = e;
|
|
323
324
|
}
|
|
324
325
|
equals(t) {
|
|
325
326
|
return yt(this.value, t.value);
|
|
326
327
|
}
|
|
327
328
|
get id() {
|
|
328
|
-
return `${this.filter.property}@@${
|
|
329
|
+
return `${this.filter.property}@@${Dt(this.value)}`;
|
|
329
330
|
}
|
|
330
331
|
get isActive() {
|
|
331
332
|
return this.filter.isValueActive(this);
|
|
@@ -340,40 +341,41 @@ class j {
|
|
|
340
341
|
this.filter.deactivateValue(this);
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
|
-
const Ee = (
|
|
344
|
-
class
|
|
344
|
+
const Ee = (i, t) => i === t, Fe = (i) => String(i);
|
|
345
|
+
class Ce {
|
|
345
346
|
constructor(t, e) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
347
|
+
n(this, "_values");
|
|
348
|
+
n(this, "_valuesFromTableState");
|
|
349
|
+
n(this, "list");
|
|
350
|
+
n(this, "property");
|
|
351
|
+
n(this, "mode");
|
|
352
|
+
n(this, "matcher");
|
|
353
|
+
n(this, "renderItem");
|
|
354
|
+
n(this, "name");
|
|
355
|
+
n(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
354
356
|
var s;
|
|
355
|
-
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((
|
|
357
|
+
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((a) => new W(this, a)), this.matcher = e.matcher ?? Ee, this.renderItem = e.renderItem ?? Fe, this.name = e.name;
|
|
356
358
|
}
|
|
357
359
|
updateTableColumnDef(t) {
|
|
358
360
|
t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
|
|
359
361
|
}
|
|
360
362
|
getReactTableFilterFn() {
|
|
361
363
|
return (t, e, s) => {
|
|
362
|
-
const
|
|
364
|
+
const a = this.property, o = a.startsWith(we) ? t.original : xt(t.original, a);
|
|
363
365
|
return this.checkFilterMatches(o, s);
|
|
364
366
|
};
|
|
365
367
|
}
|
|
366
368
|
checkFilterMatches(t, e) {
|
|
367
369
|
if (e === null)
|
|
368
370
|
return !0;
|
|
369
|
-
const s = (o) => Array.isArray(o) ? o : [o],
|
|
371
|
+
const s = (o) => Array.isArray(o) ? o : [o], a = (o) => this.matcher(o.value, t);
|
|
370
372
|
if (this.mode === "all")
|
|
371
|
-
return s(e).every(
|
|
373
|
+
return s(e).every(a);
|
|
372
374
|
if (this.mode === "some") {
|
|
373
375
|
const o = s(e);
|
|
374
|
-
return o.length === 0 || o.some(
|
|
376
|
+
return o.length === 0 || o.some(a);
|
|
375
377
|
} else if (this.mode === "one")
|
|
376
|
-
return
|
|
378
|
+
return a(e);
|
|
377
379
|
throw new Error(`Unknown filter mode '${this.mode}'`);
|
|
378
380
|
}
|
|
379
381
|
getTableColumnFilter() {
|
|
@@ -386,10 +388,24 @@ class Fe {
|
|
|
386
388
|
var t;
|
|
387
389
|
return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
|
|
388
390
|
}
|
|
389
|
-
|
|
390
|
-
return
|
|
391
|
+
getValuesFromTableState() {
|
|
392
|
+
return wt(
|
|
391
393
|
Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
|
|
392
|
-
).map((t) => new
|
|
394
|
+
).map((t) => new W(this, t));
|
|
395
|
+
}
|
|
396
|
+
checkIfValueIsUnknown(t) {
|
|
397
|
+
return !this.values.some((s) => s.id === t.id);
|
|
398
|
+
}
|
|
399
|
+
deleteUnknownFilterValues() {
|
|
400
|
+
if (this.values !== this.valuesFromTableState)
|
|
401
|
+
for (const t of this.valuesFromTableState)
|
|
402
|
+
this.checkIfValueIsUnknown(t) && this.deactivateValue(t);
|
|
403
|
+
}
|
|
404
|
+
get values() {
|
|
405
|
+
return this._values ?? this.valuesFromTableState;
|
|
406
|
+
}
|
|
407
|
+
get valuesFromTableState() {
|
|
408
|
+
return this._valuesFromTableState || (this._valuesFromTableState = this.getValuesFromTableState()), this._valuesFromTableState;
|
|
393
409
|
}
|
|
394
410
|
getArrayValue() {
|
|
395
411
|
const t = this.getValue();
|
|
@@ -404,7 +420,7 @@ class Fe {
|
|
|
404
420
|
deactivateValue(t) {
|
|
405
421
|
const e = this.getArrayValue();
|
|
406
422
|
let s;
|
|
407
|
-
this.mode === "all" || this.mode === "some" ? s = e.filter((
|
|
423
|
+
this.mode === "all" || this.mode === "some" ? s = e.filter((a) => !a.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
|
|
408
424
|
}
|
|
409
425
|
clearValues() {
|
|
410
426
|
let t;
|
|
@@ -413,7 +429,7 @@ class Fe {
|
|
|
413
429
|
toggleValue(t) {
|
|
414
430
|
const e = this.getArrayValue();
|
|
415
431
|
let s;
|
|
416
|
-
this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((
|
|
432
|
+
this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((a) => !a.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
|
|
417
433
|
}
|
|
418
434
|
onFilterUpdated(t) {
|
|
419
435
|
this.onFilterUpdateCallbacks.add(t);
|
|
@@ -421,11 +437,11 @@ class Fe {
|
|
|
421
437
|
}
|
|
422
438
|
class Le {
|
|
423
439
|
constructor(t, e) {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
440
|
+
n(this, "list");
|
|
441
|
+
n(this, "property");
|
|
442
|
+
n(this, "name");
|
|
443
|
+
n(this, "direction");
|
|
444
|
+
n(this, "defaultEnabled");
|
|
429
445
|
this.list = t, this.property = e.property, this.name = e.name, this.direction = e.direction ?? "asc", this.defaultEnabled = e.defaultEnabled ?? !1;
|
|
430
446
|
}
|
|
431
447
|
updateTableColumnDef(t) {
|
|
@@ -453,25 +469,25 @@ class Le {
|
|
|
453
469
|
return `${this.getTableColumn().id}:${this.direction}`;
|
|
454
470
|
}
|
|
455
471
|
}
|
|
456
|
-
class
|
|
472
|
+
class V {
|
|
457
473
|
constructor(t, e, s = {}) {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
474
|
+
n(this, "list");
|
|
475
|
+
n(this, "table");
|
|
476
|
+
n(this, "sortingState");
|
|
477
|
+
n(this, "updateSortingState");
|
|
462
478
|
this.list = t;
|
|
463
|
-
const
|
|
464
|
-
(
|
|
465
|
-
), [o, l] =
|
|
466
|
-
|
|
479
|
+
const a = this.list.sorting.filter(
|
|
480
|
+
(u) => u.defaultEnabled !== !1
|
|
481
|
+
), [o, l] = Y(
|
|
482
|
+
a.map((u) => u.getReactTableColumnSort())
|
|
467
483
|
);
|
|
468
484
|
this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(e, s);
|
|
469
485
|
}
|
|
470
486
|
static useNew(t, e, s = {}) {
|
|
471
|
-
return new
|
|
487
|
+
return new V(t, e, s);
|
|
472
488
|
}
|
|
473
489
|
useReactTable(t, e = {}) {
|
|
474
|
-
const s = this.list.loader.useData(),
|
|
490
|
+
const s = this.list.loader.useData(), a = Nt({
|
|
475
491
|
data: s,
|
|
476
492
|
state: {
|
|
477
493
|
sorting: this.sortingState
|
|
@@ -485,22 +501,22 @@ class B {
|
|
|
485
501
|
getCoreRowModel: Rt(),
|
|
486
502
|
getSortedRowModel: Mt(),
|
|
487
503
|
getFilteredRowModel: zt(),
|
|
488
|
-
getPaginationRowModel:
|
|
489
|
-
getFacetedUniqueValues:
|
|
504
|
+
getPaginationRowModel: Ut(),
|
|
505
|
+
getFacetedUniqueValues: $t(),
|
|
490
506
|
onSortingChange: (o) => {
|
|
491
507
|
this.handleSortingStateUpdate(o);
|
|
492
508
|
},
|
|
493
509
|
globalFilterFn: "auto",
|
|
494
510
|
...e
|
|
495
511
|
});
|
|
496
|
-
return
|
|
512
|
+
return E(() => {
|
|
497
513
|
t && t(this.list);
|
|
498
|
-
}, [this.list, t,
|
|
514
|
+
}, [this.list, t, a]), a;
|
|
499
515
|
}
|
|
500
516
|
handleSortingStateUpdate(t) {
|
|
501
517
|
const e = typeof t == "function" ? t(this.sortingState) : t, s = this.list.sorting.filter(
|
|
502
|
-
(
|
|
503
|
-
).map((
|
|
518
|
+
(a) => a.defaultEnabled === "hidden" && !e.some((o) => o.id === a.property)
|
|
519
|
+
).map((a) => a.getReactTableColumnSort());
|
|
504
520
|
this.updateSortingState([...s, ...e]);
|
|
505
521
|
}
|
|
506
522
|
get searchString() {
|
|
@@ -512,9 +528,9 @@ class B {
|
|
|
512
528
|
}
|
|
513
529
|
getTableColumnDefs() {
|
|
514
530
|
const t = /* @__PURE__ */ new Map(), e = (s) => {
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
517
|
-
return
|
|
531
|
+
const a = t.get(s);
|
|
532
|
+
if (a)
|
|
533
|
+
return a;
|
|
518
534
|
const o = {
|
|
519
535
|
id: s,
|
|
520
536
|
accessorKey: s,
|
|
@@ -532,20 +548,20 @@ class B {
|
|
|
532
548
|
}
|
|
533
549
|
class P {
|
|
534
550
|
constructor() {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
551
|
+
n(this, "dataBatches", []);
|
|
552
|
+
n(this, "prevDataBatches", []);
|
|
553
|
+
n(this, "batchLoadingStates", ["void"]);
|
|
554
|
+
Bt(this, {
|
|
539
555
|
prevDataBatches: !1,
|
|
540
556
|
useMergedData: !1,
|
|
541
557
|
useIsLoading: !1,
|
|
542
|
-
dataBatches:
|
|
543
|
-
batchLoadingStates:
|
|
558
|
+
dataBatches: $.shallow,
|
|
559
|
+
batchLoadingStates: $.shallow,
|
|
544
560
|
mergedData: O,
|
|
545
561
|
isLoading: O,
|
|
546
|
-
reset:
|
|
547
|
-
setDataBatch:
|
|
548
|
-
setBatchLoadingState:
|
|
562
|
+
reset: L.bound,
|
|
563
|
+
setDataBatch: L.bound,
|
|
564
|
+
setBatchLoadingState: L.bound
|
|
549
565
|
});
|
|
550
566
|
}
|
|
551
567
|
static useNew() {
|
|
@@ -574,22 +590,22 @@ class P {
|
|
|
574
590
|
}
|
|
575
591
|
}
|
|
576
592
|
const Te = [];
|
|
577
|
-
class
|
|
593
|
+
class x {
|
|
578
594
|
constructor(t, e = {}) {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
var
|
|
595
|
+
n(this, "list");
|
|
596
|
+
n(this, "dataSource");
|
|
597
|
+
n(this, "manualSorting");
|
|
598
|
+
n(this, "manualFiltering");
|
|
599
|
+
n(this, "manualPagination");
|
|
600
|
+
n(this, "loaderState");
|
|
601
|
+
var u;
|
|
586
602
|
const { source: s } = e;
|
|
587
603
|
this.dataSource = s ?? { staticData: Te };
|
|
588
|
-
const
|
|
589
|
-
this.list = t, this.loaderState = P.useNew(), this.manualPagination =
|
|
604
|
+
const a = "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;
|
|
605
|
+
this.list = t, this.loaderState = P.useNew(), this.manualPagination = a ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((c) => c.onFilterUpdated(() => this.reset())), (u = this.list.search) == null || u.onUpdated(() => this.reset());
|
|
590
606
|
}
|
|
591
607
|
static useNew(t, e = {}) {
|
|
592
|
-
return new
|
|
608
|
+
return new x(t, e);
|
|
593
609
|
}
|
|
594
610
|
reset() {
|
|
595
611
|
this.loaderState.reset();
|
|
@@ -615,7 +631,7 @@ class D {
|
|
|
615
631
|
}), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
|
|
616
632
|
}
|
|
617
633
|
useObserveBatchLoadingState(t, e) {
|
|
618
|
-
|
|
634
|
+
E(() => (this.loaderState.setBatchLoadingState(
|
|
619
635
|
e,
|
|
620
636
|
t.state.value
|
|
621
637
|
), t.state.observe((s) => {
|
|
@@ -623,12 +639,12 @@ class D {
|
|
|
623
639
|
})), [t, e]);
|
|
624
640
|
}
|
|
625
641
|
useObserveBatchData(t, e) {
|
|
626
|
-
const s = (
|
|
627
|
-
const { data: o, itemTotalCount: l } =
|
|
642
|
+
const s = (a) => {
|
|
643
|
+
const { data: o, itemTotalCount: l } = a;
|
|
628
644
|
this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
|
|
629
645
|
};
|
|
630
|
-
|
|
631
|
-
|
|
646
|
+
E(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
|
|
647
|
+
a.isSet && s(a.value);
|
|
632
648
|
})), [t, e]);
|
|
633
649
|
}
|
|
634
650
|
getDataLoaderOptions(t) {
|
|
@@ -656,29 +672,29 @@ class D {
|
|
|
656
672
|
const e = this.dataSource, s = this.getDataLoaderOptions(t);
|
|
657
673
|
if ("staticData" in e)
|
|
658
674
|
return q(
|
|
659
|
-
async (
|
|
660
|
-
data:
|
|
661
|
-
itemTotalCount:
|
|
675
|
+
async (a) => ({
|
|
676
|
+
data: a,
|
|
677
|
+
itemTotalCount: a.length
|
|
662
678
|
}),
|
|
663
679
|
[e.staticData]
|
|
664
680
|
);
|
|
665
681
|
if ("asyncLoader" in e) {
|
|
666
|
-
const
|
|
667
|
-
return q(
|
|
682
|
+
const a = e.asyncLoader;
|
|
683
|
+
return q(a, [s]);
|
|
668
684
|
}
|
|
669
685
|
if ("asyncResourceFactory" in e) {
|
|
670
|
-
const
|
|
671
|
-
return
|
|
686
|
+
const a = e.asyncResourceFactory;
|
|
687
|
+
return a(s);
|
|
672
688
|
}
|
|
673
689
|
throw new Error("Unknown data source");
|
|
674
690
|
}
|
|
675
691
|
}
|
|
676
692
|
class Ie {
|
|
677
693
|
constructor(t, e) {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
694
|
+
n(this, "list");
|
|
695
|
+
n(this, "render");
|
|
696
|
+
n(this, "textFieldProps");
|
|
697
|
+
n(this, "onUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
682
698
|
this.list = t, this.render = e.render, this.textFieldProps = e.textFieldProps;
|
|
683
699
|
}
|
|
684
700
|
get value() {
|
|
@@ -700,49 +716,51 @@ class Ie {
|
|
|
700
716
|
this.onUpdateCallbacks.add(t);
|
|
701
717
|
}
|
|
702
718
|
}
|
|
703
|
-
const
|
|
719
|
+
const F = class F {
|
|
704
720
|
constructor(t, e = {}) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
const { onAction: s, fallback:
|
|
712
|
-
this.list = t, this.textValue = o, this.renderFn =
|
|
721
|
+
n(this, "list");
|
|
722
|
+
n(this, "textValue");
|
|
723
|
+
n(this, "href");
|
|
724
|
+
n(this, "onAction");
|
|
725
|
+
n(this, "fallback");
|
|
726
|
+
n(this, "renderFn");
|
|
727
|
+
const { onAction: s, fallback: a, textValue: o, href: l, renderFn: u } = e;
|
|
728
|
+
this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = a;
|
|
713
729
|
}
|
|
714
730
|
render(t) {
|
|
715
|
-
return (this.renderFn ??
|
|
731
|
+
return (this.renderFn ?? F.fallbackRenderItemFn)(t);
|
|
716
732
|
}
|
|
717
733
|
};
|
|
718
|
-
|
|
719
|
-
let I =
|
|
734
|
+
n(F, "fallbackRenderItemFn", (t) => J("pre", void 0, JSON.stringify(t)));
|
|
735
|
+
let I = F, ke = class rt {
|
|
720
736
|
constructor(t) {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
737
|
+
n(this, "filters");
|
|
738
|
+
n(this, "itemView");
|
|
739
|
+
n(this, "search");
|
|
740
|
+
n(this, "sorting");
|
|
741
|
+
n(this, "items");
|
|
742
|
+
n(this, "reactTable");
|
|
743
|
+
n(this, "batches");
|
|
744
|
+
n(this, "loader");
|
|
745
|
+
n(this, "hasAction");
|
|
730
746
|
const {
|
|
731
747
|
itemView: e,
|
|
732
748
|
filters: s = [],
|
|
733
|
-
sorting:
|
|
749
|
+
sorting: a = [],
|
|
734
750
|
batchesController: o,
|
|
735
751
|
hasAction: l,
|
|
736
|
-
onChange:
|
|
752
|
+
onChange: u
|
|
737
753
|
} = t;
|
|
738
|
-
this.items = new ve(this), this.filters = s.map((
|
|
754
|
+
this.items = new ve(this), this.filters = s.map((c) => new Ce(this, c)), this.sorting = a.map((c) => new Le(this, c)), this.search = t.search ? new Ie(this, t.search) : void 0, this.itemView = new I(this, e), this.batches = new ye(this, o), this.loader = x.useNew(this, t.loader), this.reactTable = V.useNew(this, u, {
|
|
739
755
|
manualFiltering: this.loader.manualFiltering,
|
|
740
756
|
manualPagination: this.loader.manualPagination,
|
|
741
757
|
manualSorting: this.loader.manualSorting
|
|
742
|
-
}),
|
|
758
|
+
}), E(() => {
|
|
759
|
+
this.filters.forEach((c) => c.deleteUnknownFilterValues());
|
|
760
|
+
}, [this.filters]), this.hasAction = l;
|
|
743
761
|
}
|
|
744
762
|
static useNew(t) {
|
|
745
|
-
return new
|
|
763
|
+
return new rt(t);
|
|
746
764
|
}
|
|
747
765
|
get isFiltered() {
|
|
748
766
|
return this.filters.some((t) => t.isActive()) || !!this.search && this.search.isSet;
|
|
@@ -765,104 +783,98 @@ let I = E, ke = class nt {
|
|
|
765
783
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
766
784
|
}
|
|
767
785
|
};
|
|
768
|
-
const Ae = "flow--list--items",
|
|
786
|
+
const Ae = "flow--list--items", Be = "flow--list--items--is-loading", _ = {
|
|
769
787
|
items: Ae,
|
|
770
|
-
isLoading:
|
|
771
|
-
},
|
|
772
|
-
item:
|
|
788
|
+
isLoading: Be
|
|
789
|
+
}, Ve = "flow--list--items--item", Pe = "flow--list--items--item--has-action", k = {
|
|
790
|
+
item: Ve,
|
|
773
791
|
hasAction: Pe
|
|
774
|
-
},
|
|
775
|
-
const { data: t, children: e } =
|
|
776
|
-
return /* @__PURE__ */
|
|
777
|
-
|
|
792
|
+
}, xe = (i) => {
|
|
793
|
+
const { data: t, children: e } = i, s = m(), a = s.itemView, o = a.onAction, l = a.textValue ? a.textValue(t) : void 0, u = o ? () => o(t) : void 0, c = a.href ? a.href(t) : void 0, h = s.hasAction || !!u || !!c, b = C(k.item, h && k.hasAction);
|
|
794
|
+
return /* @__PURE__ */ r.createElement(
|
|
795
|
+
B.GridListItem,
|
|
778
796
|
{
|
|
779
797
|
className: b,
|
|
780
|
-
onAction:
|
|
798
|
+
onAction: u,
|
|
781
799
|
textValue: l,
|
|
782
|
-
href:
|
|
800
|
+
href: c
|
|
783
801
|
},
|
|
784
|
-
e ??
|
|
802
|
+
e ?? a.render(t)
|
|
785
803
|
);
|
|
786
|
-
},
|
|
787
|
-
const
|
|
788
|
-
return /* @__PURE__ */
|
|
789
|
-
}, Re = "
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
},
|
|
793
|
-
const {
|
|
794
|
-
|
|
795
|
-
}, $e = () => /* @__PURE__ */ n.createElement(st, null, /* @__PURE__ */ n.createElement(et, null, /* @__PURE__ */ n.createElement(J, { width: "200px" })), /* @__PURE__ */ n.createElement(f, null, /* @__PURE__ */ n.createElement(J, { width: "300px" }))), Ue = () => {
|
|
796
|
-
const t = m().itemView.fallback ?? /* @__PURE__ */ n.createElement($e, null);
|
|
797
|
-
return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ n.createElement(Ne, { key: s }, St(t)));
|
|
798
|
-
}, Oe = (a) => {
|
|
799
|
-
const { className: t, ...e } = a, s = m(), i = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), c = s.items.entries.map((d) => /* @__PURE__ */ n.createElement(De, { key: d.id, data: d.data })), u = C(
|
|
800
|
-
W.items,
|
|
804
|
+
}, De = (i) => /* @__PURE__ */ r.createElement(B.GridListItem, { textValue: "-", className: k.item }, i.children), Ne = () => {
|
|
805
|
+
const i = v(g);
|
|
806
|
+
return /* @__PURE__ */ r.createElement(Ot, null, /* @__PURE__ */ r.createElement(qt, null), /* @__PURE__ */ r.createElement(et, null, i.format("list.noResult.heading")), /* @__PURE__ */ r.createElement(f, null, i.format("list.noResult.text")));
|
|
807
|
+
}, Re = () => /* @__PURE__ */ r.createElement(st, null, /* @__PURE__ */ r.createElement(et, null, /* @__PURE__ */ r.createElement(K, { width: "200px" })), /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(K, { width: "300px" }))), Me = () => {
|
|
808
|
+
const t = m().itemView.fallback ?? /* @__PURE__ */ r.createElement(Re, null);
|
|
809
|
+
return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ r.createElement(De, { key: s }, St(t)));
|
|
810
|
+
}, ze = (i) => {
|
|
811
|
+
const { className: t, ...e } = i, s = m(), a = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), u = s.items.entries.map((h) => /* @__PURE__ */ r.createElement(xe, { key: h.id, data: h.data })), c = C(
|
|
812
|
+
_.items,
|
|
801
813
|
t,
|
|
802
|
-
|
|
814
|
+
a && _.isLoading
|
|
803
815
|
);
|
|
804
|
-
return l ? /* @__PURE__ */
|
|
805
|
-
},
|
|
806
|
-
footer:
|
|
807
|
-
},
|
|
808
|
-
const t = v(g), e = m(), s = e.batches,
|
|
816
|
+
return l ? /* @__PURE__ */ r.createElement(Ne, null) : /* @__PURE__ */ r.createElement("div", { "aria-hidden": o, "aria-busy": a }, /* @__PURE__ */ r.createElement(B.GridList, { className: c, ...e }, o ? /* @__PURE__ */ r.createElement(Me, null) : u));
|
|
817
|
+
}, nt = (i) => null, Ue = () => nt, ot = (i) => null, $e = () => ot, lt = (i) => null, Oe = () => lt, ct = (i) => null, qe = () => ct, ut = (i) => null, He = () => ut, Ke = "flow--list--footer", Ge = {
|
|
818
|
+
footer: Ke
|
|
819
|
+
}, je = (i) => {
|
|
820
|
+
const t = v(g), e = m(), s = e.batches, a = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
|
|
809
821
|
if (o)
|
|
810
822
|
return null;
|
|
811
|
-
const
|
|
812
|
-
visibleItemsCount:
|
|
823
|
+
const c = a ? /* @__PURE__ */ r.createElement(Gt, { width: "200px" }) : t.format("list.paginationInfo", {
|
|
824
|
+
visibleItemsCount: u,
|
|
813
825
|
totalItemsCount: l
|
|
814
826
|
});
|
|
815
|
-
return /* @__PURE__ */
|
|
816
|
-
},
|
|
817
|
-
const t = v(g), e = m(), s = e.loader.useIsLoading(),
|
|
818
|
-
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ r.createElement(f, { ...i }, c);
|
|
828
|
+
}, We = (i) => {
|
|
829
|
+
const t = v(g), e = m(), s = e.loader.useIsLoading(), a = e.loader.useIsInitiallyLoading();
|
|
830
|
+
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ r.createElement(
|
|
819
831
|
p,
|
|
820
832
|
{
|
|
821
|
-
isPending: s && !
|
|
822
|
-
isDisabled:
|
|
823
|
-
...
|
|
833
|
+
isPending: s && !a,
|
|
834
|
+
isDisabled: a,
|
|
835
|
+
...i,
|
|
824
836
|
onPress: () => e.batches.nextBatch(),
|
|
825
837
|
variant: "plain",
|
|
826
838
|
size: "s"
|
|
827
839
|
},
|
|
828
840
|
t.format("list.showMore")
|
|
829
841
|
);
|
|
830
|
-
},
|
|
831
|
-
function
|
|
842
|
+
}, _e = () => /* @__PURE__ */ r.createElement("div", { className: Ge.footer }, /* @__PURE__ */ r.createElement(je, null), /* @__PURE__ */ r.createElement(We, null));
|
|
843
|
+
function ht(i) {
|
|
832
844
|
return null;
|
|
833
845
|
}
|
|
834
|
-
const
|
|
835
|
-
var
|
|
836
|
-
const { children: t, batchSize: e, onChange: s, ...
|
|
846
|
+
const Je = () => ht, Ye = It("List", (i) => {
|
|
847
|
+
var D, N, R, M, z;
|
|
848
|
+
const { children: t, batchSize: e, onChange: s, ...a } = i, o = (D = S(
|
|
837
849
|
t,
|
|
838
|
-
|
|
839
|
-
)) == null ? void 0 :
|
|
850
|
+
nt
|
|
851
|
+
)) == null ? void 0 : D.props, l = (N = S(
|
|
840
852
|
t,
|
|
841
853
|
Ht
|
|
842
|
-
)) == null ? void 0 :
|
|
854
|
+
)) == null ? void 0 : N.props, u = (R = S(t, ut)) == null ? void 0 : R.props, c = {
|
|
843
855
|
source: o ? {
|
|
844
856
|
...o,
|
|
845
857
|
asyncLoader: o.children
|
|
846
858
|
} : l ? {
|
|
847
859
|
...l,
|
|
848
860
|
asyncResourceFactory: l.children
|
|
849
|
-
} :
|
|
850
|
-
staticData:
|
|
861
|
+
} : u ? {
|
|
862
|
+
staticData: u.data
|
|
851
863
|
} : void 0
|
|
852
|
-
},
|
|
864
|
+
}, h = (M = S(t, ht)) == null ? void 0 : M.props, b = (z = S(t, ct)) == null ? void 0 : z.props, dt = ke.useNew({
|
|
853
865
|
onChange: s,
|
|
854
|
-
loader:
|
|
855
|
-
filters:
|
|
866
|
+
loader: c,
|
|
867
|
+
filters: G(t, ot).map(
|
|
856
868
|
(y) => ({
|
|
857
869
|
...y.props,
|
|
858
870
|
renderItem: y.props.children
|
|
859
871
|
})
|
|
860
872
|
),
|
|
861
|
-
search:
|
|
862
|
-
render:
|
|
863
|
-
textFieldProps:
|
|
873
|
+
search: h ? {
|
|
874
|
+
render: h.children,
|
|
875
|
+
textFieldProps: h
|
|
864
876
|
} : void 0,
|
|
865
|
-
sorting:
|
|
877
|
+
sorting: G(t, lt).map((y) => y.props),
|
|
866
878
|
itemView: b ? {
|
|
867
879
|
...b,
|
|
868
880
|
renderFn: b.children
|
|
@@ -870,43 +882,43 @@ const Ze = () => dt, _e = It("List", (a) => {
|
|
|
870
882
|
batchesController: {
|
|
871
883
|
batchSize: e
|
|
872
884
|
},
|
|
873
|
-
hasAction: !!
|
|
885
|
+
hasAction: !!i.onAction
|
|
874
886
|
});
|
|
875
|
-
return /* @__PURE__ */
|
|
876
|
-
|
|
887
|
+
return /* @__PURE__ */ r.createElement(
|
|
888
|
+
at.Provider,
|
|
877
889
|
{
|
|
878
890
|
value: {
|
|
879
|
-
list:
|
|
891
|
+
list: dt
|
|
880
892
|
}
|
|
881
893
|
},
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ r.createElement(se, null),
|
|
895
|
+
/* @__PURE__ */ r.createElement("div", { className: be.list }, /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ze, { ...a }), /* @__PURE__ */ r.createElement(_e, null))
|
|
884
896
|
);
|
|
885
|
-
}),
|
|
886
|
-
List:
|
|
887
|
-
Filter:
|
|
888
|
-
Search:
|
|
889
|
-
Sorting:
|
|
890
|
-
Item:
|
|
897
|
+
}), Qe = () => Ye, Ms = () => ({
|
|
898
|
+
List: Qe(),
|
|
899
|
+
Filter: $e(),
|
|
900
|
+
Search: Je(),
|
|
901
|
+
Sorting: Oe(),
|
|
902
|
+
Item: qe(),
|
|
891
903
|
ItemView: st,
|
|
892
|
-
StaticData:
|
|
893
|
-
LoaderAsync:
|
|
904
|
+
StaticData: He(),
|
|
905
|
+
LoaderAsync: Ue(),
|
|
894
906
|
LoaderAsyncResource: Kt()
|
|
895
907
|
});
|
|
896
908
|
export {
|
|
897
|
-
|
|
909
|
+
Ye as List,
|
|
898
910
|
ot as ListFilter,
|
|
899
911
|
ct as ListItem,
|
|
900
912
|
st as ListItemView,
|
|
901
|
-
|
|
913
|
+
nt as ListLoaderAsync,
|
|
902
914
|
lt as ListSorting,
|
|
903
915
|
ut as ListStaticData,
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
916
|
+
Qe as TypedList,
|
|
917
|
+
$e as TypedListFilter,
|
|
918
|
+
qe as TypedListItem,
|
|
919
|
+
Ue as TypedListLoaderAsync,
|
|
920
|
+
Oe as TypedListSorting,
|
|
921
|
+
He as TypedListStaticData,
|
|
922
|
+
Ms as typedList,
|
|
911
923
|
m as useList
|
|
912
924
|
};
|