@mittwald/flow-react-components 0.1.0-alpha.384 → 0.1.0-alpha.386
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/CHANGELOG.md +26 -0
- package/dist/css/List.css +1 -1
- package/dist/js/List.js +130 -124
- package/dist/js/all.css +1 -1
- package/dist/js/types/components/List/model/search/types.d.ts +1 -0
- package/dist/js/types/components/List/setupComponents/ListSearch.d.ts +1 -0
- package/dist/js/types/components/List/typedList.d.ts +1 -0
- package/package.json +4 -4
package/dist/js/List.js
CHANGED
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
var Xt = Object.defineProperty;
|
|
4
4
|
var Zt = (n, t, e) => t in n ? Xt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
5
5
|
var r = (n, t, e) => Zt(n, typeof t != "symbol" ? t + "" : t, e);
|
|
6
|
-
import a, { createContext as _t, useContext as te, createElement as Et, useState as O, useEffect as
|
|
6
|
+
import a, { createContext as _t, useContext as te, createElement as Et, useState as O, useEffect as k, useRef as wt, useId as ee, Suspense as se, cloneElement as ae } from "react";
|
|
7
7
|
import "./propsContext-DzAKlmhS.js";
|
|
8
8
|
import { PropsContextProvider as Z } from "./PropsContextProvider.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
10
|
import { isShallowEqual as ie, unique as ne, difference as re, times as oe } from "remeda";
|
|
11
11
|
import { d as Y } from "./dynamic-ClpUSmEt.js";
|
|
12
|
-
import { B as
|
|
12
|
+
import { B as w } from "./Button-BTc_iJae.js";
|
|
13
13
|
import { IconArrowBackUp as le } from "@tabler/icons-react";
|
|
14
14
|
import { I as pt } from "./Icon--OEo4TjW.js";
|
|
15
15
|
import { I as ce } from "./IconContextMenu-x1p9NcUF.js";
|
|
16
16
|
import { a as H, C as _ } from "./ContextMenuTrigger-CsnzKkVf.js";
|
|
17
17
|
import { M as tt } from "./MenuItem-BhQ--5y5.js";
|
|
18
18
|
import { useLocalizedStringFormatter as I } from "react-aria";
|
|
19
|
-
import { TunnelProvider as Ft, TunnelExit as
|
|
20
|
-
import
|
|
19
|
+
import { TunnelProvider as Ft, TunnelExit as x } from "@mittwald/react-tunnel";
|
|
20
|
+
import B from "clsx";
|
|
21
21
|
import { f as It } from "./flowComponent-BQs9wMX_.js";
|
|
22
22
|
import { R as de } from "./Render-BOMk4emj.js";
|
|
23
23
|
import { T } from "./Text-Dh4iy9qD.js";
|
|
@@ -45,12 +45,12 @@ import { I as Ve } from "./IconChevronDown-wKRgAuyR.js";
|
|
|
45
45
|
import { I as ke } from "./IconChevronUp-C2rq4v--.js";
|
|
46
46
|
import { I as Be } from "./IllustratedMessage-DB1AH-Oq.js";
|
|
47
47
|
import { I as Me } from "./IconSearch-9xESFc33.js";
|
|
48
|
-
import { a as
|
|
48
|
+
import { a as y, b as D, d as xe } from "./deepHas-KHS5X1F_.js";
|
|
49
49
|
import { ListLoaderAsyncResource as De, TypedListLoaderAsyncResource as Ne } from "./List/ListLoaderAsyncResource.js";
|
|
50
50
|
import { S as Re } from "./Skeleton-CKLaTmDR.js";
|
|
51
51
|
import { a as Lt, e as Pt, d as At, b as Vt, T as kt, c as Bt } from "./Table-BdpXhsOd.js";
|
|
52
52
|
import { A as $e } from "./ActionGroup-Bd0aZvbX.js";
|
|
53
|
-
const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view--content", Ke = "flow--list--items--item--view--title", Oe = "flow--list--items--item--view--avatar", He = "flow--list--items--item--view--sub-title", qe = "flow--list--items--item--view--heading", Ge = "flow--list--items--item--view--text", We = "flow--list--items--item--view--top-content", je = "flow--list--items--item--view--action", Je = "flow--list--items--item--view--bottom-content",
|
|
53
|
+
const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view--content", Ke = "flow--list--items--item--view--title", Oe = "flow--list--items--item--view--avatar", He = "flow--list--items--item--view--sub-title", qe = "flow--list--items--item--view--heading", Ge = "flow--list--items--item--view--text", We = "flow--list--items--item--view--top-content", je = "flow--list--items--item--view--action", Je = "flow--list--items--item--view--bottom-content", p = {
|
|
54
54
|
view: Ue,
|
|
55
55
|
content: ze,
|
|
56
56
|
title: Ke,
|
|
@@ -61,7 +61,7 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
61
61
|
topContent: We,
|
|
62
62
|
action: je,
|
|
63
63
|
bottomContent: Je
|
|
64
|
-
},
|
|
64
|
+
}, S = { "de-DE": {
|
|
65
65
|
"list.filters.clear": "Filter entfernen",
|
|
66
66
|
"list.filters.reset": "Filter zurücksetzen",
|
|
67
67
|
"list.filters.store": "Filter speichern",
|
|
@@ -94,9 +94,9 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
94
94
|
"list.toggleExpandButton.collapse": "Show less",
|
|
95
95
|
"list.toggleExpandButton.expand": "Show more"
|
|
96
96
|
} }, Ye = (n) => {
|
|
97
|
-
const { className: t, children: e } = n, s = I(
|
|
97
|
+
const { className: t, children: e } = n, s = I(S);
|
|
98
98
|
return /* @__PURE__ */ a.createElement(H, null, /* @__PURE__ */ a.createElement(
|
|
99
|
-
|
|
99
|
+
w,
|
|
100
100
|
{
|
|
101
101
|
variant: "plain",
|
|
102
102
|
color: "secondary",
|
|
@@ -106,19 +106,19 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
106
106
|
},
|
|
107
107
|
/* @__PURE__ */ a.createElement(ce, null)
|
|
108
108
|
), e);
|
|
109
|
-
}, Qe = (n) => n === "top" ?
|
|
109
|
+
}, Qe = (n) => n === "top" ? p.topContent : n === "bottom" ? p.bottomContent : p.topContent, Mt = (n) => {
|
|
110
110
|
const { children: t, className: e } = n, s = {
|
|
111
111
|
ContextMenu: {
|
|
112
|
-
wrapWith: /* @__PURE__ */ a.createElement(Ye, { className:
|
|
112
|
+
wrapWith: /* @__PURE__ */ a.createElement(Ye, { className: p.action }),
|
|
113
113
|
placement: "bottom end",
|
|
114
114
|
tunnelId: "button"
|
|
115
115
|
},
|
|
116
116
|
Button: {
|
|
117
|
-
className:
|
|
117
|
+
className: p.action,
|
|
118
118
|
tunnelId: "button"
|
|
119
119
|
},
|
|
120
120
|
ActionGroup: {
|
|
121
|
-
className:
|
|
121
|
+
className: p.action,
|
|
122
122
|
ignoreBreakpoint: !0,
|
|
123
123
|
tunnelId: "button",
|
|
124
124
|
Button: {
|
|
@@ -129,29 +129,29 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
129
129
|
className: Y((o) => Qe(o.slot))
|
|
130
130
|
},
|
|
131
131
|
Avatar: {
|
|
132
|
-
className:
|
|
132
|
+
className: p.avatar,
|
|
133
133
|
tunnelId: "title"
|
|
134
134
|
},
|
|
135
135
|
Heading: {
|
|
136
|
-
className:
|
|
136
|
+
className: p.heading,
|
|
137
137
|
level: 5,
|
|
138
138
|
tunnelId: "title"
|
|
139
139
|
},
|
|
140
140
|
Text: {
|
|
141
|
-
className:
|
|
141
|
+
className: p.text,
|
|
142
142
|
tunnelId: "text"
|
|
143
143
|
},
|
|
144
144
|
Link: {
|
|
145
145
|
unstyled: !0
|
|
146
146
|
}
|
|
147
|
-
}, i =
|
|
148
|
-
return /* @__PURE__ */ a.createElement("div", { className: i }, /* @__PURE__ */ a.createElement(Z, { props: s, mergeInParentContext: !0 }, /* @__PURE__ */ a.createElement(Ft, null, /* @__PURE__ */ a.createElement("div", { className:
|
|
147
|
+
}, i = B(p.view, e);
|
|
148
|
+
return /* @__PURE__ */ a.createElement("div", { className: i }, /* @__PURE__ */ a.createElement(Z, { props: s, mergeInParentContext: !0 }, /* @__PURE__ */ a.createElement(Ft, null, /* @__PURE__ */ a.createElement("div", { className: p.content }, t, /* @__PURE__ */ a.createElement("div", { className: p.title }, /* @__PURE__ */ a.createElement(x, { id: "title" }), /* @__PURE__ */ a.createElement("div", { className: p.subTitle }, /* @__PURE__ */ a.createElement(x, { id: "text" })))), /* @__PURE__ */ a.createElement(x, { id: "button" }))));
|
|
149
149
|
}, Xe = "flow--list--list-summary", Ze = {
|
|
150
150
|
listSummary: Xe
|
|
151
151
|
}, ni = It("ListSummary", (n) => {
|
|
152
152
|
const { children: t } = n;
|
|
153
153
|
return /* @__PURE__ */ a.createElement("header", { className: Ze.listSummary, ...n }, t);
|
|
154
|
-
}), xt = _t({}),
|
|
154
|
+
}), xt = _t({}), b = () => te(xt).list, _e = () => b().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ a.createElement(de, { key: e }, () => {
|
|
155
155
|
t();
|
|
156
156
|
})), ts = (n) => {
|
|
157
157
|
const { sorting: t } = n;
|
|
@@ -160,11 +160,11 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
160
160
|
const { children: t, locales: e, variables: s } = n;
|
|
161
161
|
return I(e).format(t, s);
|
|
162
162
|
}, es = () => {
|
|
163
|
-
const n =
|
|
163
|
+
const n = b(), t = n.visibleSorting.map((i) => /* @__PURE__ */ a.createElement(ts, { sorting: i, key: i.id }));
|
|
164
164
|
if (t.length === 0)
|
|
165
165
|
return null;
|
|
166
|
-
const e = n.visibleSorting.find((i) => i.isSorted()), s = /* @__PURE__ */ a.createElement(T, null, e ? /* @__PURE__ */ a.createElement(a.Fragment, null, e.name ?? e.property) : /* @__PURE__ */ a.createElement(R, { locales:
|
|
167
|
-
return /* @__PURE__ */ a.createElement(H, null, /* @__PURE__ */ a.createElement(
|
|
166
|
+
const e = n.visibleSorting.find((i) => i.isSorted()), s = /* @__PURE__ */ a.createElement(T, null, e ? /* @__PURE__ */ a.createElement(a.Fragment, null, e.name ?? e.property) : /* @__PURE__ */ a.createElement(R, { locales: S }, "list.sorting"));
|
|
167
|
+
return /* @__PURE__ */ a.createElement(H, null, /* @__PURE__ */ a.createElement(w, { variant: "outline", color: "secondary" }, s, /* @__PURE__ */ a.createElement(ue, null)), /* @__PURE__ */ a.createElement(
|
|
168
168
|
_,
|
|
169
169
|
{
|
|
170
170
|
selectionMode: "single",
|
|
@@ -187,7 +187,7 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
187
187
|
},
|
|
188
188
|
l.render()
|
|
189
189
|
)), d = e.filter((l) => l.isActive).map((l) => l.id);
|
|
190
|
-
return /* @__PURE__ */ a.createElement(H, null, /* @__PURE__ */ a.createElement(
|
|
190
|
+
return /* @__PURE__ */ a.createElement(H, null, /* @__PURE__ */ a.createElement(w, { variant: "outline", color: "secondary" }, /* @__PURE__ */ a.createElement(T, null, i ?? o), /* @__PURE__ */ a.createElement(me, null)), /* @__PURE__ */ a.createElement(
|
|
191
191
|
_,
|
|
192
192
|
{
|
|
193
193
|
selectionMode: s === "one" ? "single" : "multiple",
|
|
@@ -195,19 +195,18 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
195
195
|
},
|
|
196
196
|
c
|
|
197
197
|
));
|
|
198
|
-
}, as = "flow--list--header", is = "flow--list--header--picker-list-and-search", ns = "flow--list--header--picker-list", rs = "flow--list--header--search-and-actions", os = "flow--list--header--search-field",
|
|
198
|
+
}, as = "flow--list--header", is = "flow--list--header--picker-list-and-search", ns = "flow--list--header--picker-list", rs = "flow--list--header--search-and-actions", os = "flow--list--header--search-field", V = {
|
|
199
199
|
header: as,
|
|
200
200
|
pickerListAndSearch: is,
|
|
201
201
|
pickerList: ns,
|
|
202
202
|
searchAndActions: rs,
|
|
203
|
-
searchField: os
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
E,
|
|
203
|
+
searchField: os
|
|
204
|
+
}, ls = "flow--list--header--active-filters", cs = "flow--list--header--active-filters--clear-button", ds = {
|
|
205
|
+
activeFilters: ls,
|
|
206
|
+
clearButton: cs
|
|
207
|
+
}, us = fe(() => {
|
|
208
|
+
const n = b(), t = I(S), s = n.filters.flatMap((l) => l.values).filter((l) => l.isActive).map((l) => /* @__PURE__ */ a.createElement(be, { key: l.id, onClose: () => l.deactivate() }, /* @__PURE__ */ a.createElement(T, null, l.render()))), i = n.filters.filter((l) => l.hasChanged()).length > 0, o = n.supportsSettingsStorage && i && /* @__PURE__ */ a.createElement(G, null, /* @__PURE__ */ a.createElement(W, null, /* @__PURE__ */ a.createElement(R, { locales: S }, "list.filters.store")), /* @__PURE__ */ a.createElement(
|
|
209
|
+
w,
|
|
211
210
|
{
|
|
212
211
|
size: "s",
|
|
213
212
|
variant: "plain",
|
|
@@ -216,8 +215,8 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
216
215
|
"aria-label": t.format("list.filters.store")
|
|
217
216
|
},
|
|
218
217
|
/* @__PURE__ */ a.createElement(he, null)
|
|
219
|
-
)), c = i ? /* @__PURE__ */ a.createElement(G, null, /* @__PURE__ */ a.createElement(W, null, /* @__PURE__ */ a.createElement(R, { locales:
|
|
220
|
-
|
|
218
|
+
)), c = i ? /* @__PURE__ */ a.createElement(G, null, /* @__PURE__ */ a.createElement(W, null, /* @__PURE__ */ a.createElement(R, { locales: S }, "list.filters.reset")), /* @__PURE__ */ a.createElement(
|
|
219
|
+
w,
|
|
221
220
|
{
|
|
222
221
|
size: "s",
|
|
223
222
|
variant: "plain",
|
|
@@ -226,8 +225,8 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
226
225
|
"aria-label": t.format("list.filters.reset")
|
|
227
226
|
},
|
|
228
227
|
/* @__PURE__ */ a.createElement(pt, null, /* @__PURE__ */ a.createElement(le, null))
|
|
229
|
-
)) : void 0, d = s.length > 0 ? /* @__PURE__ */ a.createElement(G, null, /* @__PURE__ */ a.createElement(W, null, /* @__PURE__ */ a.createElement(R, { locales:
|
|
230
|
-
|
|
228
|
+
)) : void 0, d = s.length > 0 ? /* @__PURE__ */ a.createElement(G, null, /* @__PURE__ */ a.createElement(W, null, /* @__PURE__ */ a.createElement(R, { locales: S }, "list.filters.clear")), /* @__PURE__ */ a.createElement(
|
|
229
|
+
w,
|
|
231
230
|
{
|
|
232
231
|
size: "s",
|
|
233
232
|
variant: "plain",
|
|
@@ -236,26 +235,33 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
236
235
|
},
|
|
237
236
|
/* @__PURE__ */ a.createElement(pt, null, /* @__PURE__ */ a.createElement(ge, null))
|
|
238
237
|
)) : void 0;
|
|
239
|
-
return s.length === 0 && !o && !c ? null : /* @__PURE__ */ a.createElement("div", { className:
|
|
240
|
-
}), hs = (n) => {
|
|
241
|
-
const { className: t, onChange: e, value: s,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
238
|
+
return s.length === 0 && !o && !c ? null : /* @__PURE__ */ a.createElement("div", { className: ds.activeFilters }, s, o, c, d);
|
|
239
|
+
}), ms = 800, hs = (n) => {
|
|
240
|
+
const { className: t, onChange: e, value: s, autoSubmit: i, ...o } = n, [c, d] = O(s ?? ""), l = () => {
|
|
241
|
+
c.trim() === "" ? e(void 0) : e(c);
|
|
242
|
+
};
|
|
243
|
+
k(() => {
|
|
244
|
+
if (i) {
|
|
245
|
+
const h = setTimeout(() => l(), ms);
|
|
246
|
+
return () => clearTimeout(h);
|
|
247
|
+
}
|
|
248
|
+
}, [c, i]), ve(s, () => {
|
|
249
|
+
d(s ?? "");
|
|
250
|
+
}, [c]);
|
|
251
|
+
const u = () => {
|
|
252
|
+
e(void 0), d("");
|
|
253
|
+
}, m = (h) => {
|
|
254
|
+
h.key === "Enter" ? l() : h.key === "Escape" && u();
|
|
249
255
|
};
|
|
250
256
|
return /* @__PURE__ */ a.createElement(
|
|
251
257
|
ye,
|
|
252
258
|
{
|
|
253
259
|
className: t,
|
|
254
|
-
value:
|
|
255
|
-
onKeyUp:
|
|
256
|
-
onChange: (
|
|
257
|
-
onClear:
|
|
258
|
-
...
|
|
260
|
+
value: c,
|
|
261
|
+
onKeyUp: m,
|
|
262
|
+
onChange: (h) => d(h),
|
|
263
|
+
onClear: u,
|
|
264
|
+
...o
|
|
259
265
|
}
|
|
260
266
|
);
|
|
261
267
|
}, gs = (n) => {
|
|
@@ -267,9 +273,9 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
267
273
|
...e.textFieldProps
|
|
268
274
|
});
|
|
269
275
|
}, ps = () => {
|
|
270
|
-
const n = I(
|
|
276
|
+
const n = I(S), t = b(), e = t.viewMode, s = [];
|
|
271
277
|
return t.itemView && s.push("list"), t.table && s.push("table"), s.length <= 1 ? null : /* @__PURE__ */ a.createElement(H, null, /* @__PURE__ */ a.createElement(
|
|
272
|
-
|
|
278
|
+
w,
|
|
273
279
|
{
|
|
274
280
|
variant: "outline",
|
|
275
281
|
color: "secondary",
|
|
@@ -289,11 +295,11 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
289
295
|
n.format(`list.settings.viewMode.${i}`)
|
|
290
296
|
)))));
|
|
291
297
|
}, fs = (n) => {
|
|
292
|
-
const { className: t, hasActionGroup: e } = n, s =
|
|
298
|
+
const { className: t, hasActionGroup: e } = n, s = b();
|
|
293
299
|
if (s.filters.length === 0 && s.visibleSorting.length === 0 && !s.search && !s.table && !e)
|
|
294
300
|
return null;
|
|
295
301
|
const i = s.filters.map((o) => /* @__PURE__ */ a.createElement(ss, { key: o.property, filter: o }));
|
|
296
|
-
return /* @__PURE__ */ a.createElement("div", { className:
|
|
302
|
+
return /* @__PURE__ */ a.createElement("div", { className: B(t, V.header) }, /* @__PURE__ */ a.createElement("div", { className: V.pickerListAndSearch }, /* @__PURE__ */ a.createElement("div", { className: V.pickerList }, /* @__PURE__ */ a.createElement(ps, null), /* @__PURE__ */ a.createElement(es, null), i), /* @__PURE__ */ a.createElement("div", { className: V.searchAndActions }, s.search && /* @__PURE__ */ a.createElement(gs, { className: V.searchField, search: s.search }), /* @__PURE__ */ a.createElement(x, { id: "actions" }))), /* @__PURE__ */ a.createElement(us, null));
|
|
297
303
|
}, bs = "flow--list", Ss = {
|
|
298
304
|
list: bs
|
|
299
305
|
};
|
|
@@ -601,7 +607,7 @@ class at {
|
|
|
601
607
|
globalFilterFn: "auto",
|
|
602
608
|
...e
|
|
603
609
|
});
|
|
604
|
-
return
|
|
610
|
+
return k(() => {
|
|
605
611
|
t && t(this.list);
|
|
606
612
|
}, [this.list, t, o]), o;
|
|
607
613
|
}
|
|
@@ -732,14 +738,14 @@ class nt {
|
|
|
732
738
|
this.loaderState.isBatchLoaded(e) ? "loaded" : i
|
|
733
739
|
);
|
|
734
740
|
};
|
|
735
|
-
|
|
741
|
+
k(() => (s(t.state.value), t.state.observe(s)), [t, e]);
|
|
736
742
|
}
|
|
737
743
|
useObserveBatchData(t, e) {
|
|
738
744
|
const s = (i) => {
|
|
739
745
|
const { data: o, itemTotalCount: c } = i;
|
|
740
746
|
this.loaderState.setDataBatch(e, o), c !== void 0 && this.list.batches.updateItemTotalCount(c);
|
|
741
747
|
};
|
|
742
|
-
|
|
748
|
+
k(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((i) => {
|
|
743
749
|
i.isSet && s(i.value);
|
|
744
750
|
})), [t, e]);
|
|
745
751
|
}
|
|
@@ -882,8 +888,8 @@ let Q = K, Ps = class {
|
|
|
882
888
|
this.list = t, this.header = new As(this, s), this.body = new Bs(this, i), this.componentProps = o;
|
|
883
889
|
}
|
|
884
890
|
};
|
|
885
|
-
var
|
|
886
|
-
let xs = (
|
|
891
|
+
var E;
|
|
892
|
+
let xs = (E = class {
|
|
887
893
|
constructor(t) {
|
|
888
894
|
r(this, "filters");
|
|
889
895
|
r(this, "itemView");
|
|
@@ -915,13 +921,13 @@ let xs = (y = class {
|
|
|
915
921
|
onChange: l,
|
|
916
922
|
loader: u,
|
|
917
923
|
search: m,
|
|
918
|
-
onAction:
|
|
924
|
+
onAction: h,
|
|
919
925
|
getItemId: C,
|
|
920
926
|
defaultViewMode: L,
|
|
921
927
|
accordion: P = !1,
|
|
922
|
-
...
|
|
928
|
+
...f
|
|
923
929
|
} = t;
|
|
924
|
-
this.settingsStore = Ae(), this.settingStorageKey = e, this.filterSettingsStorageKey = e ? `${e}.activeFilters` : void 0, this.viewModeStorageKey = e ? `${e}.viewMode` : void 0, this.supportsSettingsStorage = !!this.settingStorageKey, this.items = new ys(this), this.filters = o.map((
|
|
930
|
+
this.settingsStore = Ae(), this.settingStorageKey = e, this.filterSettingsStorageKey = e ? `${e}.activeFilters` : void 0, this.viewModeStorageKey = e ? `${e}.viewMode` : void 0, this.supportsSettingsStorage = !!this.settingStorageKey, this.items = new ys(this), this.filters = o.map((g) => new $(this, g)), this.sorting = c.map((g) => new Ts(this, g)), this.search = m ? new Ls(this, m) : void 0, this.itemView = s ? new Q(this, s) : void 0, this.accordion = P, this.table = i ? new Ms(this, i) : void 0, this.batches = new Es(this, d), this.componentProps = f, this.loader = nt.useNew(this, u), this.onAction = h, this.getItemId = C, this.reactTable = at.useNew(this, l, {
|
|
925
931
|
manualFiltering: this.loader.manualFiltering,
|
|
926
932
|
manualPagination: this.loader.manualPagination,
|
|
927
933
|
manualSorting: this.loader.manualSorting
|
|
@@ -929,15 +935,15 @@ let xs = (y = class {
|
|
|
929
935
|
const [A, q] = O(
|
|
930
936
|
L ?? this.getStoredViewModeDefaultSetting() ?? "list"
|
|
931
937
|
);
|
|
932
|
-
this.viewMode = A, this.setViewMode = (
|
|
933
|
-
q(
|
|
938
|
+
this.viewMode = A, this.setViewMode = (g) => {
|
|
939
|
+
q(g), this.settingsStore && this.viewModeStorageKey && this.settingsStore.set(
|
|
934
940
|
"List",
|
|
935
941
|
this.viewModeStorageKey,
|
|
936
|
-
|
|
937
|
-
|
|
942
|
+
E.viewModeSettingsStorageSchema,
|
|
943
|
+
g
|
|
938
944
|
);
|
|
939
|
-
},
|
|
940
|
-
this.filters.forEach((
|
|
945
|
+
}, k(() => {
|
|
946
|
+
this.filters.forEach((g) => g.deleteUnknownFilterValues());
|
|
941
947
|
}, [this.filters]);
|
|
942
948
|
}
|
|
943
949
|
get isFiltered() {
|
|
@@ -947,7 +953,7 @@ let xs = (y = class {
|
|
|
947
953
|
return this.sorting.filter((t) => t.defaultEnabled !== "hidden");
|
|
948
954
|
}
|
|
949
955
|
static useNew(t) {
|
|
950
|
-
return new
|
|
956
|
+
return new E(t);
|
|
951
957
|
}
|
|
952
958
|
storeFilterDefaultSettings() {
|
|
953
959
|
if (this.settingsStore && this.filterSettingsStorageKey) {
|
|
@@ -978,7 +984,7 @@ let xs = (y = class {
|
|
|
978
984
|
return this.settingsStore.get(
|
|
979
985
|
"List",
|
|
980
986
|
this.viewModeStorageKey,
|
|
981
|
-
|
|
987
|
+
E.viewModeSettingsStorageSchema
|
|
982
988
|
);
|
|
983
989
|
}
|
|
984
990
|
getSorting(t) {
|
|
@@ -997,7 +1003,7 @@ let xs = (y = class {
|
|
|
997
1003
|
useIsEmpty() {
|
|
998
1004
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
999
1005
|
}
|
|
1000
|
-
}, r(
|
|
1006
|
+
}, r(E, "viewModeSettingsStorageSchema", N.enum(["list", "table"]).optional()), E);
|
|
1001
1007
|
const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
1002
1008
|
items: Ds,
|
|
1003
1009
|
isLoading: Ns
|
|
@@ -1006,9 +1012,9 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1006
1012
|
isSelected: $s,
|
|
1007
1013
|
hasAction: Us
|
|
1008
1014
|
}, Nt = () => /* @__PURE__ */ a.createElement(Mt, null, /* @__PURE__ */ a.createElement(et, null, /* @__PURE__ */ a.createElement(z, { width: "200px" })), /* @__PURE__ */ a.createElement(T, null, /* @__PURE__ */ a.createElement(z, { width: "300px" }))), zs = (n) => {
|
|
1009
|
-
const { isExpanded: t, toggle: e, children: s, contentElementId: i } = n, o = I(
|
|
1015
|
+
const { isExpanded: t, toggle: e, children: s, contentElementId: i } = n, o = I(S);
|
|
1010
1016
|
return /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
|
|
1011
|
-
|
|
1017
|
+
w,
|
|
1012
1018
|
{
|
|
1013
1019
|
variant: "plain",
|
|
1014
1020
|
color: "secondary",
|
|
@@ -1023,12 +1029,12 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1023
1029
|
), t && s);
|
|
1024
1030
|
}, Ks = (n) => {
|
|
1025
1031
|
var P;
|
|
1026
|
-
const { data: t, children: e } = n, s =
|
|
1032
|
+
const { data: t, children: e } = n, s = b(), i = s.itemView, o = s.onAction, [c, d] = O(
|
|
1027
1033
|
((P = i == null ? void 0 : i.defaultExpanded) == null ? void 0 : P.call(i, t)) ?? !1
|
|
1028
|
-
), l = ee(), u = wt(null), m = s.accordion,
|
|
1029
|
-
if (
|
|
1030
|
-
var
|
|
1031
|
-
m && ((
|
|
1034
|
+
), l = ee(), u = wt(null), m = s.accordion, h = e ?? (i == null ? void 0 : i.render(t));
|
|
1035
|
+
if (k(() => {
|
|
1036
|
+
var f, A;
|
|
1037
|
+
m && ((f = u.current) == null || f.setAttribute("aria-expanded", String(c)), (A = u.current) == null || A.setAttribute("aria-controls", l));
|
|
1032
1038
|
}, [c, l, u.current, m]), !m)
|
|
1033
1039
|
return {
|
|
1034
1040
|
gridItemProps: {
|
|
@@ -1036,15 +1042,15 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1036
1042
|
o == null || o(t);
|
|
1037
1043
|
} : void 0
|
|
1038
1044
|
},
|
|
1039
|
-
children:
|
|
1045
|
+
children: h
|
|
1040
1046
|
};
|
|
1041
1047
|
const C = () => {
|
|
1042
|
-
d((
|
|
1048
|
+
d((f) => !f), o == null || o(t);
|
|
1043
1049
|
}, L = {
|
|
1044
1050
|
Content: {
|
|
1045
|
-
id: Y((
|
|
1051
|
+
id: Y((f) => f.slot === "bottom" ? l : void 0),
|
|
1046
1052
|
wrapWith: Y(
|
|
1047
|
-
(
|
|
1053
|
+
(f) => f.slot === "bottom" ? /* @__PURE__ */ a.createElement(
|
|
1048
1054
|
zs,
|
|
1049
1055
|
{
|
|
1050
1056
|
contentElementId: l,
|
|
@@ -1066,11 +1072,11 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1066
1072
|
props: L,
|
|
1067
1073
|
dependencies: [l, c]
|
|
1068
1074
|
},
|
|
1069
|
-
|
|
1075
|
+
h
|
|
1070
1076
|
)
|
|
1071
1077
|
};
|
|
1072
1078
|
}, Os = (n) => {
|
|
1073
|
-
const { id: t, data: e } = n, i =
|
|
1079
|
+
const { id: t, data: e } = n, i = b().itemView, { gridItemProps: o, children: c } = Ks(n);
|
|
1074
1080
|
if (!i)
|
|
1075
1081
|
return null;
|
|
1076
1082
|
const d = i.textValue ? i.textValue(e) : void 0, l = i.href ? i.href(e) : void 0, u = !!o.onAction || !!l;
|
|
@@ -1078,7 +1084,7 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1078
1084
|
st.GridListItem,
|
|
1079
1085
|
{
|
|
1080
1086
|
id: t,
|
|
1081
|
-
className: (m) =>
|
|
1087
|
+
className: (m) => B(
|
|
1082
1088
|
U.item,
|
|
1083
1089
|
u && U.hasAction,
|
|
1084
1090
|
m.isSelected && U.isSelected
|
|
@@ -1090,17 +1096,17 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1090
1096
|
/* @__PURE__ */ a.createElement(se, { fallback: /* @__PURE__ */ a.createElement(Nt, null) }, c)
|
|
1091
1097
|
);
|
|
1092
1098
|
}, Hs = (n) => /* @__PURE__ */ a.createElement(st.GridListItem, { textValue: "-", className: U.item }, n.children), X = () => {
|
|
1093
|
-
const n = I(
|
|
1099
|
+
const n = I(S);
|
|
1094
1100
|
return /* @__PURE__ */ a.createElement(Be, null, /* @__PURE__ */ a.createElement(Me, null), /* @__PURE__ */ a.createElement(et, null, n.format("list.noResult.heading")), /* @__PURE__ */ a.createElement(T, null, n.format("list.noResult.text")));
|
|
1095
1101
|
}, qs = () => {
|
|
1096
1102
|
var e;
|
|
1097
|
-
const t = ((e =
|
|
1103
|
+
const t = ((e = b().itemView) == null ? void 0 : e.fallback) ?? /* @__PURE__ */ a.createElement(Nt, null);
|
|
1098
1104
|
return Array.from(Array(5)).map((s, i) => /* @__PURE__ */ a.createElement(Hs, { key: i }, ae(t)));
|
|
1099
1105
|
}, Gs = () => {
|
|
1100
|
-
const n =
|
|
1106
|
+
const n = b(), t = n.loader.useIsLoading(), e = n.loader.useIsInitiallyLoading();
|
|
1101
1107
|
if (!n.itemView)
|
|
1102
1108
|
return null;
|
|
1103
|
-
const s = n.items.entries.map((o) => /* @__PURE__ */ a.createElement(Os, { key: o.id, data: o.data, id: o.id })), i =
|
|
1109
|
+
const s = n.items.entries.map((o) => /* @__PURE__ */ a.createElement(Os, { key: o.id, data: o.data, id: o.id })), i = B(yt.items, t && yt.isLoading);
|
|
1104
1110
|
return /* @__PURE__ */ a.createElement("div", { "aria-hidden": e, "aria-busy": t }, /* @__PURE__ */ a.createElement(
|
|
1105
1111
|
st.GridList,
|
|
1106
1112
|
{
|
|
@@ -1113,7 +1119,7 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1113
1119
|
}, Rt = (n) => null, Ws = () => Rt, $t = (n) => null, js = () => $t, Ut = (n) => null, Js = () => Ut, zt = (n) => null, Ys = () => zt, Kt = (n) => null, Qs = () => Kt, Xs = "flow--list--footer", Zs = {
|
|
1114
1120
|
footer: Xs
|
|
1115
1121
|
}, _s = (n) => {
|
|
1116
|
-
const t = I(
|
|
1122
|
+
const t = I(S), e = b(), s = e.batches, i = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), c = s.getTotalItemsCount(), d = s.getVisibleItemsCount();
|
|
1117
1123
|
if (o)
|
|
1118
1124
|
return null;
|
|
1119
1125
|
const l = i ? /* @__PURE__ */ a.createElement(Re, { width: "200px" }) : t.format("list.paginationInfo", {
|
|
@@ -1122,9 +1128,9 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1122
1128
|
});
|
|
1123
1129
|
return /* @__PURE__ */ a.createElement(T, { ...n }, l);
|
|
1124
1130
|
}, ta = (n) => {
|
|
1125
|
-
const t = I(
|
|
1131
|
+
const t = I(S), e = b(), s = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading();
|
|
1126
1132
|
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ a.createElement(
|
|
1127
|
-
|
|
1133
|
+
w,
|
|
1128
1134
|
{
|
|
1129
1135
|
isPending: s && !i,
|
|
1130
1136
|
isDisabled: i,
|
|
@@ -1139,23 +1145,23 @@ const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
|
1139
1145
|
function Ot(n) {
|
|
1140
1146
|
return null;
|
|
1141
1147
|
}
|
|
1142
|
-
const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa = (n) => /* @__PURE__ */ a.createElement(Lt, { ...n }, /* @__PURE__ */ a.createElement(Pt, null, /* @__PURE__ */ a.createElement(At, null, /* @__PURE__ */ a.createElement(z, { width: "100%" }))), /* @__PURE__ */ a.createElement(Vt, null, Array.from(Array(5)).map((t, e) => /* @__PURE__ */ a.createElement(kt, { key: e }, /* @__PURE__ */ a.createElement(Bt, null, /* @__PURE__ */ a.createElement(z, { width: "100%" })))))), ia = "flow--list--table", na = "flow--list--table--is-loading", ra = "flow--list--table--row", oa = "flow--list--table--is-selected", la = "flow--list--table--has-action",
|
|
1148
|
+
const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa = (n) => /* @__PURE__ */ a.createElement(Lt, { ...n }, /* @__PURE__ */ a.createElement(Pt, null, /* @__PURE__ */ a.createElement(At, null, /* @__PURE__ */ a.createElement(z, { width: "100%" }))), /* @__PURE__ */ a.createElement(Vt, null, Array.from(Array(5)).map((t, e) => /* @__PURE__ */ a.createElement(kt, { key: e }, /* @__PURE__ */ a.createElement(Bt, null, /* @__PURE__ */ a.createElement(z, { width: "100%" })))))), ia = "flow--list--table", na = "flow--list--table--is-loading", ra = "flow--list--table--row", oa = "flow--list--table--is-selected", la = "flow--list--table--has-action", M = {
|
|
1143
1149
|
table: ia,
|
|
1144
1150
|
isLoading: na,
|
|
1145
1151
|
row: ra,
|
|
1146
1152
|
isSelected: oa,
|
|
1147
1153
|
hasAction: la
|
|
1148
1154
|
}, ca = () => {
|
|
1149
|
-
const n =
|
|
1155
|
+
const n = b(), t = n.table, e = n.useIsEmpty(), s = n.loader.useIsLoading(), i = n.loader.useIsInitiallyLoading();
|
|
1150
1156
|
if (!t)
|
|
1151
1157
|
return null;
|
|
1152
1158
|
if (i)
|
|
1153
1159
|
return /* @__PURE__ */ a.createElement(aa, { ...t.componentProps });
|
|
1154
1160
|
if (e)
|
|
1155
1161
|
return /* @__PURE__ */ a.createElement(X, null);
|
|
1156
|
-
const o = t.list.onAction, c =
|
|
1157
|
-
|
|
1158
|
-
s &&
|
|
1162
|
+
const o = t.list.onAction, c = B(
|
|
1163
|
+
M.table,
|
|
1164
|
+
s && M.isLoading,
|
|
1159
1165
|
t.componentProps.className
|
|
1160
1166
|
);
|
|
1161
1167
|
return /* @__PURE__ */ a.createElement(
|
|
@@ -1177,11 +1183,11 @@ const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa =
|
|
|
1177
1183
|
return /* @__PURE__ */ a.createElement(
|
|
1178
1184
|
kt,
|
|
1179
1185
|
{
|
|
1180
|
-
className: (u) =>
|
|
1181
|
-
|
|
1182
|
-
o &&
|
|
1186
|
+
className: (u) => B(
|
|
1187
|
+
M.row,
|
|
1188
|
+
o && M.hasAction,
|
|
1183
1189
|
t.body.row.componentProps.className,
|
|
1184
|
-
u.isSelected &&
|
|
1190
|
+
u.isSelected && M.isSelected
|
|
1185
1191
|
),
|
|
1186
1192
|
key: d.id,
|
|
1187
1193
|
id: d.id,
|
|
@@ -1195,13 +1201,13 @@ const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa =
|
|
|
1195
1201
|
);
|
|
1196
1202
|
}, Wt = (n) => null, jt = (n) => null, Jt = (n) => null, da = It("List", (n) => {
|
|
1197
1203
|
var rt, ot, lt, ct, dt, ut, mt, ht, gt;
|
|
1198
|
-
const { children: t, batchSize: e, onChange: s, refProp: i, ...o } = n, c = (rt =
|
|
1204
|
+
const { children: t, batchSize: e, onChange: s, refProp: i, ...o } = n, c = (rt = y(
|
|
1199
1205
|
t,
|
|
1200
1206
|
Rt
|
|
1201
|
-
)) == null ? void 0 : rt.props, d = (ot =
|
|
1207
|
+
)) == null ? void 0 : rt.props, d = (ot = y(
|
|
1202
1208
|
t,
|
|
1203
1209
|
De
|
|
1204
|
-
)) == null ? void 0 : ot.props, l = (lt =
|
|
1210
|
+
)) == null ? void 0 : ot.props, l = (lt = y(t, Kt)) == null ? void 0 : lt.props, u = {
|
|
1205
1211
|
source: c ? {
|
|
1206
1212
|
...c,
|
|
1207
1213
|
asyncLoader: c.children
|
|
@@ -1211,23 +1217,23 @@ const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa =
|
|
|
1211
1217
|
} : l ? {
|
|
1212
1218
|
staticData: l.data
|
|
1213
1219
|
} : void 0
|
|
1214
|
-
}, m = (ct =
|
|
1215
|
-
(
|
|
1216
|
-
...
|
|
1217
|
-
name:
|
|
1220
|
+
}, m = (ct = y(t, Ot)) == null ? void 0 : ct.props, h = (dt = y(t, zt)) == null ? void 0 : dt.props, C = (ut = y(t, Wt)) == null ? void 0 : ut.props, L = D(t, Ht).map(
|
|
1221
|
+
(v) => ({
|
|
1222
|
+
...v.props,
|
|
1223
|
+
name: v.props.children
|
|
1218
1224
|
})
|
|
1219
1225
|
), P = D(t, Gt).map(
|
|
1220
|
-
(
|
|
1221
|
-
...
|
|
1222
|
-
renderFn:
|
|
1226
|
+
(v) => ({
|
|
1227
|
+
...v.props,
|
|
1228
|
+
renderFn: v.props.children
|
|
1223
1229
|
})
|
|
1224
|
-
),
|
|
1230
|
+
), f = (mt = y(t, qt)) == null ? void 0 : mt.props, A = (ht = y(t, jt)) == null ? void 0 : ht.props, q = (gt = y(t, Jt)) == null ? void 0 : gt.props, g = xs.useNew({
|
|
1225
1231
|
onChange: s,
|
|
1226
1232
|
loader: u,
|
|
1227
1233
|
filters: D(t, $t).map(
|
|
1228
|
-
(
|
|
1229
|
-
...
|
|
1230
|
-
renderItem:
|
|
1234
|
+
(v) => ({
|
|
1235
|
+
...v.props,
|
|
1236
|
+
renderItem: v.props.children
|
|
1231
1237
|
})
|
|
1232
1238
|
),
|
|
1233
1239
|
search: m ? {
|
|
@@ -1235,10 +1241,10 @@ const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa =
|
|
|
1235
1241
|
textFieldProps: m,
|
|
1236
1242
|
defaultValue: m.defaultValue
|
|
1237
1243
|
} : void 0,
|
|
1238
|
-
sorting: D(t, Ut).map((
|
|
1239
|
-
itemView:
|
|
1240
|
-
...
|
|
1241
|
-
renderFn:
|
|
1244
|
+
sorting: D(t, Ut).map((v) => v.props),
|
|
1245
|
+
itemView: h ? {
|
|
1246
|
+
...h,
|
|
1247
|
+
renderFn: h.children
|
|
1242
1248
|
} : void 0,
|
|
1243
1249
|
table: L.length > 0 ? {
|
|
1244
1250
|
header: {
|
|
@@ -1248,7 +1254,7 @@ const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa =
|
|
|
1248
1254
|
body: {
|
|
1249
1255
|
...q,
|
|
1250
1256
|
row: {
|
|
1251
|
-
...
|
|
1257
|
+
...f,
|
|
1252
1258
|
cells: P
|
|
1253
1259
|
}
|
|
1254
1260
|
},
|
|
@@ -1272,11 +1278,11 @@ const sa = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, aa =
|
|
|
1272
1278
|
xt.Provider,
|
|
1273
1279
|
{
|
|
1274
1280
|
value: {
|
|
1275
|
-
list:
|
|
1281
|
+
list: g
|
|
1276
1282
|
}
|
|
1277
1283
|
},
|
|
1278
1284
|
/* @__PURE__ */ a.createElement(_e, null),
|
|
1279
|
-
/* @__PURE__ */ a.createElement("div", { className: Ss.list, ref: i }, t, /* @__PURE__ */ a.createElement(fs, { hasActionGroup: Qt }), /* @__PURE__ */ a.createElement("div", null,
|
|
1285
|
+
/* @__PURE__ */ a.createElement("div", { className: Ss.list, ref: i }, t, /* @__PURE__ */ a.createElement(fs, { hasActionGroup: Qt }), /* @__PURE__ */ a.createElement("div", null, g.items.entries.length > 0 && /* @__PURE__ */ a.createElement(x, { id: "listSummary" }), g.viewMode === "list" && /* @__PURE__ */ a.createElement(Gs, null), g.viewMode === "table" && /* @__PURE__ */ a.createElement(ca, null)), /* @__PURE__ */ a.createElement(ea, null))
|
|
1280
1286
|
)));
|
|
1281
1287
|
}), ua = () => da, mi = () => ({
|
|
1282
1288
|
List: ua(),
|
|
@@ -1311,5 +1317,5 @@ export {
|
|
|
1311
1317
|
Js as TypedListSorting,
|
|
1312
1318
|
Qs as TypedListStaticData,
|
|
1313
1319
|
mi as typedList,
|
|
1314
|
-
|
|
1320
|
+
b as useList
|
|
1315
1321
|
};
|