@mittwald/flow-react-components 0.1.0-alpha.385 → 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
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.1.0-alpha.386](https://github.com/mittwald/flow/compare/0.1.0-alpha.385...0.1.0-alpha.386) (2024-12-18)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **List:** add auto submit to search
|
|
11
|
+
([#1069](https://github.com/mittwald/flow/issues/1069))
|
|
12
|
+
([93bb0d6](https://github.com/mittwald/flow/commit/93bb0d6d8f6b87347e7aad1e61e5a99ad2556b4c))
|
|
13
|
+
|
|
14
|
+
# Change Log
|
|
15
|
+
|
|
16
|
+
All notable changes to this project will be documented in this file. See
|
|
17
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
18
|
+
|
|
6
19
|
# [0.1.0-alpha.385](https://github.com/mittwald/flow/compare/0.1.0-alpha.384...0.1.0-alpha.385) (2024-12-18)
|
|
7
20
|
|
|
8
21
|
### Features
|
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",
|
|
@@ -205,8 +205,8 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
205
205
|
activeFilters: ls,
|
|
206
206
|
clearButton: cs
|
|
207
207
|
}, us = fe(() => {
|
|
208
|
-
const n =
|
|
209
|
-
|
|
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,
|
|
210
210
|
{
|
|
211
211
|
size: "s",
|
|
212
212
|
variant: "plain",
|
|
@@ -215,8 +215,8 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
215
215
|
"aria-label": t.format("list.filters.store")
|
|
216
216
|
},
|
|
217
217
|
/* @__PURE__ */ a.createElement(he, null)
|
|
218
|
-
)), c = i ? /* @__PURE__ */ a.createElement(G, null, /* @__PURE__ */ a.createElement(W, null, /* @__PURE__ */ a.createElement(R, { locales:
|
|
219
|
-
|
|
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,
|
|
220
220
|
{
|
|
221
221
|
size: "s",
|
|
222
222
|
variant: "plain",
|
|
@@ -225,8 +225,8 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
225
225
|
"aria-label": t.format("list.filters.reset")
|
|
226
226
|
},
|
|
227
227
|
/* @__PURE__ */ a.createElement(pt, null, /* @__PURE__ */ a.createElement(le, null))
|
|
228
|
-
)) : void 0, d = s.length > 0 ? /* @__PURE__ */ a.createElement(G, null, /* @__PURE__ */ a.createElement(W, null, /* @__PURE__ */ a.createElement(R, { locales:
|
|
229
|
-
|
|
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,
|
|
230
230
|
{
|
|
231
231
|
size: "s",
|
|
232
232
|
variant: "plain",
|
|
@@ -236,39 +236,46 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
236
236
|
/* @__PURE__ */ a.createElement(pt, null, /* @__PURE__ */ a.createElement(ge, null))
|
|
237
237
|
)) : void 0;
|
|
238
238
|
return s.length === 0 && !o && !c ? null : /* @__PURE__ */ a.createElement("div", { className: ds.activeFilters }, s, o, c, d);
|
|
239
|
-
}), ms = (n) => {
|
|
240
|
-
const { className: t, onChange: e, value: s,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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();
|
|
248
255
|
};
|
|
249
256
|
return /* @__PURE__ */ a.createElement(
|
|
250
257
|
ye,
|
|
251
258
|
{
|
|
252
259
|
className: t,
|
|
253
|
-
value:
|
|
254
|
-
onKeyUp:
|
|
255
|
-
onChange: (
|
|
256
|
-
onClear:
|
|
257
|
-
...
|
|
260
|
+
value: c,
|
|
261
|
+
onKeyUp: m,
|
|
262
|
+
onChange: (h) => d(h),
|
|
263
|
+
onClear: u,
|
|
264
|
+
...o
|
|
258
265
|
}
|
|
259
266
|
);
|
|
260
|
-
},
|
|
261
|
-
const { className: t, search: e } = n, s = e.render ??
|
|
267
|
+
}, gs = (n) => {
|
|
268
|
+
const { className: t, search: e } = n, s = e.render ?? hs;
|
|
262
269
|
return Et(s, {
|
|
263
270
|
className: t,
|
|
264
271
|
value: e.value,
|
|
265
272
|
onChange: e.setValue.bind(e),
|
|
266
273
|
...e.textFieldProps
|
|
267
274
|
});
|
|
268
|
-
},
|
|
269
|
-
const n = I(
|
|
275
|
+
}, ps = () => {
|
|
276
|
+
const n = I(S), t = b(), e = t.viewMode, s = [];
|
|
270
277
|
return t.itemView && s.push("list"), t.table && s.push("table"), s.length <= 1 ? null : /* @__PURE__ */ a.createElement(H, null, /* @__PURE__ */ a.createElement(
|
|
271
|
-
|
|
278
|
+
w,
|
|
272
279
|
{
|
|
273
280
|
variant: "outline",
|
|
274
281
|
color: "secondary",
|
|
@@ -287,16 +294,16 @@ const Ue = "flow--list--items--item--view", ze = "flow--list--items--item--view-
|
|
|
287
294
|
},
|
|
288
295
|
n.format(`list.settings.viewMode.${i}`)
|
|
289
296
|
)))));
|
|
290
|
-
},
|
|
291
|
-
const { className: t, hasActionGroup: e } = n, s =
|
|
297
|
+
}, fs = (n) => {
|
|
298
|
+
const { className: t, hasActionGroup: e } = n, s = b();
|
|
292
299
|
if (s.filters.length === 0 && s.visibleSorting.length === 0 && !s.search && !s.table && !e)
|
|
293
300
|
return null;
|
|
294
301
|
const i = s.filters.map((o) => /* @__PURE__ */ a.createElement(ss, { key: o.property, filter: o }));
|
|
295
|
-
return /* @__PURE__ */ a.createElement("div", { className:
|
|
296
|
-
},
|
|
297
|
-
list:
|
|
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));
|
|
303
|
+
}, bs = "flow--list", Ss = {
|
|
304
|
+
list: bs
|
|
298
305
|
};
|
|
299
|
-
let
|
|
306
|
+
let vs = class Dt {
|
|
300
307
|
constructor(t, e, s) {
|
|
301
308
|
r(this, "id");
|
|
302
309
|
r(this, "data");
|
|
@@ -307,16 +314,16 @@ let Ss = class Dt {
|
|
|
307
314
|
return new Dt(t, e.id, e.original);
|
|
308
315
|
}
|
|
309
316
|
};
|
|
310
|
-
class
|
|
317
|
+
class ys {
|
|
311
318
|
constructor(t) {
|
|
312
319
|
r(this, "list");
|
|
313
320
|
this.list = t;
|
|
314
321
|
}
|
|
315
322
|
get entries() {
|
|
316
|
-
return this.list.reactTable.table.getRowModel().rows.map((t) =>
|
|
323
|
+
return this.list.reactTable.table.getRowModel().rows.map((t) => vs.fromRow(this, t));
|
|
317
324
|
}
|
|
318
325
|
}
|
|
319
|
-
class
|
|
326
|
+
class Es {
|
|
320
327
|
constructor(t, e = {}) {
|
|
321
328
|
r(this, "batchSize");
|
|
322
329
|
r(this, "list");
|
|
@@ -363,7 +370,7 @@ class ys {
|
|
|
363
370
|
}
|
|
364
371
|
}
|
|
365
372
|
}
|
|
366
|
-
const
|
|
373
|
+
const ws = "$";
|
|
367
374
|
class F {
|
|
368
375
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
369
376
|
constructor(t, e) {
|
|
@@ -393,7 +400,7 @@ class F {
|
|
|
393
400
|
this.filter.deactivateValue(this);
|
|
394
401
|
}
|
|
395
402
|
}
|
|
396
|
-
const J = (n) => Array.isArray(n) ? n : [n],
|
|
403
|
+
const J = (n) => Array.isArray(n) ? n : [n], Fs = (n, t) => n === t, Is = (n) => String(n);
|
|
397
404
|
class $ {
|
|
398
405
|
constructor(t, e) {
|
|
399
406
|
r(this, "_values");
|
|
@@ -407,7 +414,7 @@ class $ {
|
|
|
407
414
|
r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
408
415
|
r(this, "defaultSelectedValues");
|
|
409
416
|
var s;
|
|
410
|
-
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((i) => F.create(this, i)), this.matcher = e.matcher ??
|
|
417
|
+
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((i) => F.create(this, i)), this.matcher = e.matcher ?? Fs, this.renderItem = e.renderItem ?? Is, this.name = e.name, this.defaultSelectedValues = e.defaultSelected;
|
|
411
418
|
}
|
|
412
419
|
getStoredSelectedIds() {
|
|
413
420
|
var t;
|
|
@@ -428,7 +435,7 @@ class $ {
|
|
|
428
435
|
}
|
|
429
436
|
getReactTableFilterFn() {
|
|
430
437
|
return (t, e, s) => {
|
|
431
|
-
const i = this.property, o = i.startsWith(
|
|
438
|
+
const i = this.property, o = i.startsWith(ws) ? t.original : we(t.original, i);
|
|
432
439
|
return this.checkFilterMatches(o, s);
|
|
433
440
|
};
|
|
434
441
|
}
|
|
@@ -519,7 +526,7 @@ class $ {
|
|
|
519
526
|
}
|
|
520
527
|
}
|
|
521
528
|
r($, "settingsStorageSchema", N.record(N.array(N.string())).optional());
|
|
522
|
-
class
|
|
529
|
+
class Ts {
|
|
523
530
|
constructor(t, e) {
|
|
524
531
|
r(this, "list");
|
|
525
532
|
r(this, "property");
|
|
@@ -600,7 +607,7 @@ class at {
|
|
|
600
607
|
globalFilterFn: "auto",
|
|
601
608
|
...e
|
|
602
609
|
});
|
|
603
|
-
return
|
|
610
|
+
return k(() => {
|
|
604
611
|
t && t(this.list);
|
|
605
612
|
}, [this.list, t, o]), o;
|
|
606
613
|
}
|
|
@@ -683,7 +690,7 @@ class it {
|
|
|
683
690
|
return t in this.dataBatches;
|
|
684
691
|
}
|
|
685
692
|
}
|
|
686
|
-
const
|
|
693
|
+
const Cs = [];
|
|
687
694
|
class nt {
|
|
688
695
|
constructor(t, e = {}) {
|
|
689
696
|
r(this, "list");
|
|
@@ -694,7 +701,7 @@ class nt {
|
|
|
694
701
|
r(this, "loaderState");
|
|
695
702
|
var d;
|
|
696
703
|
const { source: s } = e;
|
|
697
|
-
this.dataSource = s ?? { staticData:
|
|
704
|
+
this.dataSource = s ?? { staticData: Cs };
|
|
698
705
|
const i = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, o = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, c = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
|
|
699
706
|
this.list = t, this.loaderState = it.useNew(), this.manualPagination = i ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = c ?? this.manualPagination, this.list.filters.forEach((l) => l.onFilterUpdated(() => this.reset())), (d = this.list.search) == null || d.onUpdated(() => this.reset());
|
|
700
707
|
}
|
|
@@ -731,14 +738,14 @@ class nt {
|
|
|
731
738
|
this.loaderState.isBatchLoaded(e) ? "loaded" : i
|
|
732
739
|
);
|
|
733
740
|
};
|
|
734
|
-
|
|
741
|
+
k(() => (s(t.state.value), t.state.observe(s)), [t, e]);
|
|
735
742
|
}
|
|
736
743
|
useObserveBatchData(t, e) {
|
|
737
744
|
const s = (i) => {
|
|
738
745
|
const { data: o, itemTotalCount: c } = i;
|
|
739
746
|
this.loaderState.setDataBatch(e, o), c !== void 0 && this.list.batches.updateItemTotalCount(c);
|
|
740
747
|
};
|
|
741
|
-
|
|
748
|
+
k(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((i) => {
|
|
742
749
|
i.isSet && s(i.value);
|
|
743
750
|
})), [t, e]);
|
|
744
751
|
}
|
|
@@ -786,7 +793,7 @@ class nt {
|
|
|
786
793
|
throw new Error("Unknown data source");
|
|
787
794
|
}
|
|
788
795
|
}
|
|
789
|
-
class
|
|
796
|
+
class Ls {
|
|
790
797
|
constructor(t, e) {
|
|
791
798
|
r(this, "list");
|
|
792
799
|
r(this, "render");
|
|
@@ -833,21 +840,21 @@ const K = class K {
|
|
|
833
840
|
}
|
|
834
841
|
};
|
|
835
842
|
r(K, "fallbackRenderItemFn", (t) => Et("pre", void 0, JSON.stringify(t)));
|
|
836
|
-
let Q = K,
|
|
843
|
+
let Q = K, Ps = class {
|
|
837
844
|
constructor(t, e = {}) {
|
|
838
845
|
r(this, "tableHeader");
|
|
839
846
|
r(this, "componentProps");
|
|
840
847
|
this.tableHeader = t, this.componentProps = e;
|
|
841
848
|
}
|
|
842
|
-
},
|
|
849
|
+
}, As = class {
|
|
843
850
|
constructor(t, e = {}) {
|
|
844
851
|
r(this, "table");
|
|
845
852
|
r(this, "componentProps");
|
|
846
853
|
r(this, "columns");
|
|
847
854
|
const { columns: s = [], ...i } = e;
|
|
848
|
-
this.table = t, this.columns = s.map((o) => new
|
|
855
|
+
this.table = t, this.columns = s.map((o) => new Ps(this, o)), this.componentProps = i;
|
|
849
856
|
}
|
|
850
|
-
},
|
|
857
|
+
}, Vs = class {
|
|
851
858
|
constructor(t, e = {}) {
|
|
852
859
|
r(this, "row");
|
|
853
860
|
r(this, "renderFn");
|
|
@@ -855,34 +862,34 @@ let Q = K, Ls = class {
|
|
|
855
862
|
const { renderFn: s, ...i } = e;
|
|
856
863
|
this.row = t, this.renderFn = s, this.componentProps = i;
|
|
857
864
|
}
|
|
858
|
-
},
|
|
865
|
+
}, ks = class {
|
|
859
866
|
constructor(t, e = {}) {
|
|
860
867
|
r(this, "tableBody");
|
|
861
868
|
r(this, "cells");
|
|
862
869
|
r(this, "componentProps");
|
|
863
870
|
const { cells: s = [], ...i } = e;
|
|
864
|
-
this.tableBody = t, this.cells = s.map((o) => new
|
|
871
|
+
this.tableBody = t, this.cells = s.map((o) => new Vs(this, o)), this.componentProps = i;
|
|
865
872
|
}
|
|
866
|
-
},
|
|
873
|
+
}, Bs = class {
|
|
867
874
|
constructor(t, e = {}) {
|
|
868
875
|
r(this, "table");
|
|
869
876
|
r(this, "componentProps");
|
|
870
877
|
r(this, "row");
|
|
871
878
|
const { row: s, ...i } = e;
|
|
872
|
-
this.table = t, this.row = new
|
|
879
|
+
this.table = t, this.row = new ks(this, s), this.componentProps = i;
|
|
873
880
|
}
|
|
874
|
-
},
|
|
881
|
+
}, Ms = class {
|
|
875
882
|
constructor(t, e = {}) {
|
|
876
883
|
r(this, "list");
|
|
877
884
|
r(this, "header");
|
|
878
885
|
r(this, "body");
|
|
879
886
|
r(this, "componentProps");
|
|
880
887
|
const { header: s, body: i, ...o } = e;
|
|
881
|
-
this.list = t, this.header = new
|
|
888
|
+
this.list = t, this.header = new As(this, s), this.body = new Bs(this, i), this.componentProps = o;
|
|
882
889
|
}
|
|
883
890
|
};
|
|
884
|
-
var
|
|
885
|
-
let
|
|
891
|
+
var E;
|
|
892
|
+
let xs = (E = class {
|
|
886
893
|
constructor(t) {
|
|
887
894
|
r(this, "filters");
|
|
888
895
|
r(this, "itemView");
|
|
@@ -914,13 +921,13 @@ let Ms = (y = class {
|
|
|
914
921
|
onChange: l,
|
|
915
922
|
loader: u,
|
|
916
923
|
search: m,
|
|
917
|
-
onAction:
|
|
924
|
+
onAction: h,
|
|
918
925
|
getItemId: C,
|
|
919
926
|
defaultViewMode: L,
|
|
920
927
|
accordion: P = !1,
|
|
921
|
-
...
|
|
928
|
+
...f
|
|
922
929
|
} = t;
|
|
923
|
-
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
|
|
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, {
|
|
924
931
|
manualFiltering: this.loader.manualFiltering,
|
|
925
932
|
manualPagination: this.loader.manualPagination,
|
|
926
933
|
manualSorting: this.loader.manualSorting
|
|
@@ -928,15 +935,15 @@ let Ms = (y = class {
|
|
|
928
935
|
const [A, q] = O(
|
|
929
936
|
L ?? this.getStoredViewModeDefaultSetting() ?? "list"
|
|
930
937
|
);
|
|
931
|
-
this.viewMode = A, this.setViewMode = (
|
|
932
|
-
q(
|
|
938
|
+
this.viewMode = A, this.setViewMode = (g) => {
|
|
939
|
+
q(g), this.settingsStore && this.viewModeStorageKey && this.settingsStore.set(
|
|
933
940
|
"List",
|
|
934
941
|
this.viewModeStorageKey,
|
|
935
|
-
|
|
936
|
-
|
|
942
|
+
E.viewModeSettingsStorageSchema,
|
|
943
|
+
g
|
|
937
944
|
);
|
|
938
|
-
},
|
|
939
|
-
this.filters.forEach((
|
|
945
|
+
}, k(() => {
|
|
946
|
+
this.filters.forEach((g) => g.deleteUnknownFilterValues());
|
|
940
947
|
}, [this.filters]);
|
|
941
948
|
}
|
|
942
949
|
get isFiltered() {
|
|
@@ -946,7 +953,7 @@ let Ms = (y = class {
|
|
|
946
953
|
return this.sorting.filter((t) => t.defaultEnabled !== "hidden");
|
|
947
954
|
}
|
|
948
955
|
static useNew(t) {
|
|
949
|
-
return new
|
|
956
|
+
return new E(t);
|
|
950
957
|
}
|
|
951
958
|
storeFilterDefaultSettings() {
|
|
952
959
|
if (this.settingsStore && this.filterSettingsStorageKey) {
|
|
@@ -977,7 +984,7 @@ let Ms = (y = class {
|
|
|
977
984
|
return this.settingsStore.get(
|
|
978
985
|
"List",
|
|
979
986
|
this.viewModeStorageKey,
|
|
980
|
-
|
|
987
|
+
E.viewModeSettingsStorageSchema
|
|
981
988
|
);
|
|
982
989
|
}
|
|
983
990
|
getSorting(t) {
|
|
@@ -996,18 +1003,18 @@ let Ms = (y = class {
|
|
|
996
1003
|
useIsEmpty() {
|
|
997
1004
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
998
1005
|
}
|
|
999
|
-
}, r(
|
|
1000
|
-
const
|
|
1001
|
-
items:
|
|
1002
|
-
isLoading:
|
|
1003
|
-
},
|
|
1004
|
-
item:
|
|
1005
|
-
isSelected:
|
|
1006
|
-
hasAction:
|
|
1007
|
-
}, 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" }))),
|
|
1008
|
-
const { isExpanded: t, toggle: e, children: s, contentElementId: i } = n, o = I(
|
|
1006
|
+
}, r(E, "viewModeSettingsStorageSchema", N.enum(["list", "table"]).optional()), E);
|
|
1007
|
+
const Ds = "flow--list--items", Ns = "flow--list--items--is-loading", yt = {
|
|
1008
|
+
items: Ds,
|
|
1009
|
+
isLoading: Ns
|
|
1010
|
+
}, Rs = "flow--list--items--item", $s = "flow--list--items--item--is-selected", Us = "flow--list--items--item--has-action", U = {
|
|
1011
|
+
item: Rs,
|
|
1012
|
+
isSelected: $s,
|
|
1013
|
+
hasAction: Us
|
|
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) => {
|
|
1015
|
+
const { isExpanded: t, toggle: e, children: s, contentElementId: i } = n, o = I(S);
|
|
1009
1016
|
return /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement(
|
|
1010
|
-
|
|
1017
|
+
w,
|
|
1011
1018
|
{
|
|
1012
1019
|
variant: "plain",
|
|
1013
1020
|
color: "secondary",
|
|
@@ -1020,14 +1027,14 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1020
1027
|
},
|
|
1021
1028
|
t ? /* @__PURE__ */ a.createElement(ke, null) : /* @__PURE__ */ a.createElement(Ve, null)
|
|
1022
1029
|
), t && s);
|
|
1023
|
-
},
|
|
1030
|
+
}, Ks = (n) => {
|
|
1024
1031
|
var P;
|
|
1025
|
-
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(
|
|
1026
1033
|
((P = i == null ? void 0 : i.defaultExpanded) == null ? void 0 : P.call(i, t)) ?? !1
|
|
1027
|
-
), l = ee(), u = wt(null), m = s.accordion,
|
|
1028
|
-
if (
|
|
1029
|
-
var
|
|
1030
|
-
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));
|
|
1031
1038
|
}, [c, l, u.current, m]), !m)
|
|
1032
1039
|
return {
|
|
1033
1040
|
gridItemProps: {
|
|
@@ -1035,16 +1042,16 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1035
1042
|
o == null || o(t);
|
|
1036
1043
|
} : void 0
|
|
1037
1044
|
},
|
|
1038
|
-
children:
|
|
1045
|
+
children: h
|
|
1039
1046
|
};
|
|
1040
1047
|
const C = () => {
|
|
1041
|
-
d((
|
|
1048
|
+
d((f) => !f), o == null || o(t);
|
|
1042
1049
|
}, L = {
|
|
1043
1050
|
Content: {
|
|
1044
|
-
id: Y((
|
|
1051
|
+
id: Y((f) => f.slot === "bottom" ? l : void 0),
|
|
1045
1052
|
wrapWith: Y(
|
|
1046
|
-
(
|
|
1047
|
-
|
|
1053
|
+
(f) => f.slot === "bottom" ? /* @__PURE__ */ a.createElement(
|
|
1054
|
+
zs,
|
|
1048
1055
|
{
|
|
1049
1056
|
contentElementId: l,
|
|
1050
1057
|
toggle: C,
|
|
@@ -1065,11 +1072,11 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1065
1072
|
props: L,
|
|
1066
1073
|
dependencies: [l, c]
|
|
1067
1074
|
},
|
|
1068
|
-
|
|
1075
|
+
h
|
|
1069
1076
|
)
|
|
1070
1077
|
};
|
|
1071
|
-
},
|
|
1072
|
-
const { id: t, data: e } = n, i =
|
|
1078
|
+
}, Os = (n) => {
|
|
1079
|
+
const { id: t, data: e } = n, i = b().itemView, { gridItemProps: o, children: c } = Ks(n);
|
|
1073
1080
|
if (!i)
|
|
1074
1081
|
return null;
|
|
1075
1082
|
const d = i.textValue ? i.textValue(e) : void 0, l = i.href ? i.href(e) : void 0, u = !!o.onAction || !!l;
|
|
@@ -1077,7 +1084,7 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1077
1084
|
st.GridListItem,
|
|
1078
1085
|
{
|
|
1079
1086
|
id: t,
|
|
1080
|
-
className: (m) =>
|
|
1087
|
+
className: (m) => B(
|
|
1081
1088
|
U.item,
|
|
1082
1089
|
u && U.hasAction,
|
|
1083
1090
|
m.isSelected && U.isSelected
|
|
@@ -1088,18 +1095,18 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1088
1095
|
},
|
|
1089
1096
|
/* @__PURE__ */ a.createElement(se, { fallback: /* @__PURE__ */ a.createElement(Nt, null) }, c)
|
|
1090
1097
|
);
|
|
1091
|
-
},
|
|
1092
|
-
const n = I(
|
|
1098
|
+
}, Hs = (n) => /* @__PURE__ */ a.createElement(st.GridListItem, { textValue: "-", className: U.item }, n.children), X = () => {
|
|
1099
|
+
const n = I(S);
|
|
1093
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")));
|
|
1094
|
-
}, Hs = () => {
|
|
1095
|
-
var e;
|
|
1096
|
-
const t = ((e = f().itemView) == null ? void 0 : e.fallback) ?? /* @__PURE__ */ a.createElement(Nt, null);
|
|
1097
|
-
return Array.from(Array(5)).map((s, i) => /* @__PURE__ */ a.createElement(Os, { key: i }, ae(t)));
|
|
1098
1101
|
}, qs = () => {
|
|
1099
|
-
|
|
1102
|
+
var e;
|
|
1103
|
+
const t = ((e = b().itemView) == null ? void 0 : e.fallback) ?? /* @__PURE__ */ a.createElement(Nt, null);
|
|
1104
|
+
return Array.from(Array(5)).map((s, i) => /* @__PURE__ */ a.createElement(Hs, { key: i }, ae(t)));
|
|
1105
|
+
}, Gs = () => {
|
|
1106
|
+
const n = b(), t = n.loader.useIsLoading(), e = n.loader.useIsInitiallyLoading();
|
|
1100
1107
|
if (!n.itemView)
|
|
1101
1108
|
return null;
|
|
1102
|
-
const s = n.items.entries.map((o) => /* @__PURE__ */ a.createElement(
|
|
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);
|
|
1103
1110
|
return /* @__PURE__ */ a.createElement("div", { "aria-hidden": e, "aria-busy": t }, /* @__PURE__ */ a.createElement(
|
|
1104
1111
|
st.GridList,
|
|
1105
1112
|
{
|
|
@@ -1107,12 +1114,12 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1107
1114
|
...n.componentProps,
|
|
1108
1115
|
renderEmptyState: () => /* @__PURE__ */ a.createElement(X, null)
|
|
1109
1116
|
},
|
|
1110
|
-
e ? /* @__PURE__ */ a.createElement(
|
|
1117
|
+
e ? /* @__PURE__ */ a.createElement(qs, null) : s
|
|
1111
1118
|
));
|
|
1112
|
-
}, Rt = (n) => null,
|
|
1113
|
-
footer:
|
|
1114
|
-
},
|
|
1115
|
-
const t = I(
|
|
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 = {
|
|
1120
|
+
footer: Xs
|
|
1121
|
+
}, _s = (n) => {
|
|
1122
|
+
const t = I(S), e = b(), s = e.batches, i = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), c = s.getTotalItemsCount(), d = s.getVisibleItemsCount();
|
|
1116
1123
|
if (o)
|
|
1117
1124
|
return null;
|
|
1118
1125
|
const l = i ? /* @__PURE__ */ a.createElement(Re, { width: "200px" }) : t.format("list.paginationInfo", {
|
|
@@ -1120,10 +1127,10 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1120
1127
|
totalItemsCount: c
|
|
1121
1128
|
});
|
|
1122
1129
|
return /* @__PURE__ */ a.createElement(T, { ...n }, l);
|
|
1123
|
-
},
|
|
1124
|
-
const t = I(
|
|
1130
|
+
}, ta = (n) => {
|
|
1131
|
+
const t = I(S), e = b(), s = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading();
|
|
1125
1132
|
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ a.createElement(
|
|
1126
|
-
|
|
1133
|
+
w,
|
|
1127
1134
|
{
|
|
1128
1135
|
isPending: s && !i,
|
|
1129
1136
|
isDisabled: i,
|
|
@@ -1134,27 +1141,27 @@ const xs = "flow--list--items", Ds = "flow--list--items--is-loading", yt = {
|
|
|
1134
1141
|
},
|
|
1135
1142
|
t.format("list.showMore")
|
|
1136
1143
|
);
|
|
1137
|
-
},
|
|
1144
|
+
}, ea = () => /* @__PURE__ */ a.createElement("div", { className: Zs.footer }, /* @__PURE__ */ a.createElement(_s, null), /* @__PURE__ */ a.createElement(ta, null));
|
|
1138
1145
|
function Ot(n) {
|
|
1139
1146
|
return null;
|
|
1140
1147
|
}
|
|
1141
|
-
const
|
|
1142
|
-
table:
|
|
1143
|
-
isLoading:
|
|
1144
|
-
row:
|
|
1145
|
-
isSelected:
|
|
1146
|
-
hasAction:
|
|
1147
|
-
},
|
|
1148
|
-
const n =
|
|
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 = {
|
|
1149
|
+
table: ia,
|
|
1150
|
+
isLoading: na,
|
|
1151
|
+
row: ra,
|
|
1152
|
+
isSelected: oa,
|
|
1153
|
+
hasAction: la
|
|
1154
|
+
}, ca = () => {
|
|
1155
|
+
const n = b(), t = n.table, e = n.useIsEmpty(), s = n.loader.useIsLoading(), i = n.loader.useIsInitiallyLoading();
|
|
1149
1156
|
if (!t)
|
|
1150
1157
|
return null;
|
|
1151
1158
|
if (i)
|
|
1152
|
-
return /* @__PURE__ */ a.createElement(
|
|
1159
|
+
return /* @__PURE__ */ a.createElement(aa, { ...t.componentProps });
|
|
1153
1160
|
if (e)
|
|
1154
1161
|
return /* @__PURE__ */ a.createElement(X, null);
|
|
1155
|
-
const o = t.list.onAction, c =
|
|
1156
|
-
|
|
1157
|
-
s &&
|
|
1162
|
+
const o = t.list.onAction, c = B(
|
|
1163
|
+
M.table,
|
|
1164
|
+
s && M.isLoading,
|
|
1158
1165
|
t.componentProps.className
|
|
1159
1166
|
);
|
|
1160
1167
|
return /* @__PURE__ */ a.createElement(
|
|
@@ -1176,11 +1183,11 @@ const ea = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, sa =
|
|
|
1176
1183
|
return /* @__PURE__ */ a.createElement(
|
|
1177
1184
|
kt,
|
|
1178
1185
|
{
|
|
1179
|
-
className: (u) =>
|
|
1180
|
-
|
|
1181
|
-
o &&
|
|
1186
|
+
className: (u) => B(
|
|
1187
|
+
M.row,
|
|
1188
|
+
o && M.hasAction,
|
|
1182
1189
|
t.body.row.componentProps.className,
|
|
1183
|
-
u.isSelected &&
|
|
1190
|
+
u.isSelected && M.isSelected
|
|
1184
1191
|
),
|
|
1185
1192
|
key: d.id,
|
|
1186
1193
|
id: d.id,
|
|
@@ -1192,15 +1199,15 @@ const ea = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, sa =
|
|
|
1192
1199
|
})
|
|
1193
1200
|
)
|
|
1194
1201
|
);
|
|
1195
|
-
}, Wt = (n) => null, jt = (n) => null, Jt = (n) => null,
|
|
1202
|
+
}, Wt = (n) => null, jt = (n) => null, Jt = (n) => null, da = It("List", (n) => {
|
|
1196
1203
|
var rt, ot, lt, ct, dt, ut, mt, ht, gt;
|
|
1197
|
-
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(
|
|
1198
1205
|
t,
|
|
1199
1206
|
Rt
|
|
1200
|
-
)) == null ? void 0 : rt.props, d = (ot =
|
|
1207
|
+
)) == null ? void 0 : rt.props, d = (ot = y(
|
|
1201
1208
|
t,
|
|
1202
1209
|
De
|
|
1203
|
-
)) == null ? void 0 : ot.props, l = (lt =
|
|
1210
|
+
)) == null ? void 0 : ot.props, l = (lt = y(t, Kt)) == null ? void 0 : lt.props, u = {
|
|
1204
1211
|
source: c ? {
|
|
1205
1212
|
...c,
|
|
1206
1213
|
asyncLoader: c.children
|
|
@@ -1210,23 +1217,23 @@ const ea = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, sa =
|
|
|
1210
1217
|
} : l ? {
|
|
1211
1218
|
staticData: l.data
|
|
1212
1219
|
} : void 0
|
|
1213
|
-
}, m = (ct =
|
|
1214
|
-
(
|
|
1215
|
-
...
|
|
1216
|
-
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
|
|
1217
1224
|
})
|
|
1218
1225
|
), P = D(t, Gt).map(
|
|
1219
|
-
(
|
|
1220
|
-
...
|
|
1221
|
-
renderFn:
|
|
1226
|
+
(v) => ({
|
|
1227
|
+
...v.props,
|
|
1228
|
+
renderFn: v.props.children
|
|
1222
1229
|
})
|
|
1223
|
-
),
|
|
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({
|
|
1224
1231
|
onChange: s,
|
|
1225
1232
|
loader: u,
|
|
1226
1233
|
filters: D(t, $t).map(
|
|
1227
|
-
(
|
|
1228
|
-
...
|
|
1229
|
-
renderItem:
|
|
1234
|
+
(v) => ({
|
|
1235
|
+
...v.props,
|
|
1236
|
+
renderItem: v.props.children
|
|
1230
1237
|
})
|
|
1231
1238
|
),
|
|
1232
1239
|
search: m ? {
|
|
@@ -1234,10 +1241,10 @@ const ea = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, sa =
|
|
|
1234
1241
|
textFieldProps: m,
|
|
1235
1242
|
defaultValue: m.defaultValue
|
|
1236
1243
|
} : void 0,
|
|
1237
|
-
sorting: D(t, Ut).map((
|
|
1238
|
-
itemView:
|
|
1239
|
-
...
|
|
1240
|
-
renderFn:
|
|
1244
|
+
sorting: D(t, Ut).map((v) => v.props),
|
|
1245
|
+
itemView: h ? {
|
|
1246
|
+
...h,
|
|
1247
|
+
renderFn: h.children
|
|
1241
1248
|
} : void 0,
|
|
1242
1249
|
table: L.length > 0 ? {
|
|
1243
1250
|
header: {
|
|
@@ -1247,7 +1254,7 @@ const ea = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, sa =
|
|
|
1247
1254
|
body: {
|
|
1248
1255
|
...q,
|
|
1249
1256
|
row: {
|
|
1250
|
-
...
|
|
1257
|
+
...f,
|
|
1251
1258
|
cells: P
|
|
1252
1259
|
}
|
|
1253
1260
|
},
|
|
@@ -1271,18 +1278,18 @@ const ea = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, sa =
|
|
|
1271
1278
|
xt.Provider,
|
|
1272
1279
|
{
|
|
1273
1280
|
value: {
|
|
1274
|
-
list:
|
|
1281
|
+
list: g
|
|
1275
1282
|
}
|
|
1276
1283
|
},
|
|
1277
1284
|
/* @__PURE__ */ a.createElement(_e, null),
|
|
1278
|
-
/* @__PURE__ */ a.createElement("div", { className:
|
|
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))
|
|
1279
1286
|
)));
|
|
1280
|
-
}),
|
|
1281
|
-
List:
|
|
1282
|
-
Filter:
|
|
1283
|
-
Search:
|
|
1284
|
-
Sorting:
|
|
1285
|
-
Item:
|
|
1287
|
+
}), ua = () => da, mi = () => ({
|
|
1288
|
+
List: ua(),
|
|
1289
|
+
Filter: js(),
|
|
1290
|
+
Search: sa(),
|
|
1291
|
+
Sorting: Js(),
|
|
1292
|
+
Item: Ys(),
|
|
1286
1293
|
ItemView: Mt,
|
|
1287
1294
|
TableHeader: jt,
|
|
1288
1295
|
TableColumn: Ht,
|
|
@@ -1290,25 +1297,25 @@ const ea = () => Ot, Ht = (n) => null, qt = (n) => null, Gt = (n) => null, sa =
|
|
|
1290
1297
|
TableRow: qt,
|
|
1291
1298
|
TableCell: Gt,
|
|
1292
1299
|
Table: Wt,
|
|
1293
|
-
StaticData:
|
|
1294
|
-
LoaderAsync:
|
|
1300
|
+
StaticData: Qs(),
|
|
1301
|
+
LoaderAsync: Ws(),
|
|
1295
1302
|
LoaderAsyncResource: Ne()
|
|
1296
1303
|
});
|
|
1297
1304
|
export {
|
|
1298
|
-
|
|
1305
|
+
da as List,
|
|
1299
1306
|
$t as ListFilter,
|
|
1300
1307
|
zt as ListItem,
|
|
1301
1308
|
Mt as ListItemView,
|
|
1302
1309
|
Rt as ListLoaderAsync,
|
|
1303
1310
|
Ut as ListSorting,
|
|
1304
1311
|
Kt as ListStaticData,
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1312
|
+
ni as ListSummary,
|
|
1313
|
+
ua as TypedList,
|
|
1314
|
+
js as TypedListFilter,
|
|
1315
|
+
Ys as TypedListItem,
|
|
1316
|
+
Ws as TypedListLoaderAsync,
|
|
1317
|
+
Js as TypedListSorting,
|
|
1318
|
+
Qs as TypedListStaticData,
|
|
1319
|
+
mi as typedList,
|
|
1320
|
+
b as useList
|
|
1314
1321
|
};
|
|
@@ -4,6 +4,7 @@ type SupportedSearchFieldProps = Pick<SearchFieldProps, "className" | "autoFocus
|
|
|
4
4
|
interface SearchFieldRenderProps extends SupportedSearchFieldProps {
|
|
5
5
|
onChange: (value: SearchValue) => unknown;
|
|
6
6
|
value: SearchValue;
|
|
7
|
+
autoSubmit?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export type SearchFieldRenderComponent = ComponentType<SearchFieldRenderProps>;
|
|
9
10
|
export type SearchValue = string | undefined;
|
|
@@ -2,6 +2,7 @@ import { SearchFieldRenderComponent, SearchShape } from '../model/search/types';
|
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
type Props<T> = Omit<SearchShape<T>, "render" | "textFieldProps"> & {
|
|
4
4
|
children?: SearchFieldRenderComponent;
|
|
5
|
+
autoSubmit?: boolean;
|
|
5
6
|
} & SearchShape<T>["textFieldProps"];
|
|
6
7
|
export declare function ListSearch<T = never>(ignoredProps: Props<T>): null;
|
|
7
8
|
export declare const TypedListSearch: <T>() => ComponentType<Props<T>>;
|
|
@@ -8,6 +8,7 @@ export declare const typedList: <T>() => {
|
|
|
8
8
|
}) => import('react').ReactNode;
|
|
9
9
|
Search: ComponentType<Omit<import('./model/search/types').SearchShape<T>, "render" | "textFieldProps"> & {
|
|
10
10
|
children?: import('./model/search/types').SearchFieldRenderComponent;
|
|
11
|
+
autoSubmit?: boolean;
|
|
11
12
|
} & {
|
|
12
13
|
className?: string | ((values: import('react-aria-components').SearchFieldRenderProps & {
|
|
13
14
|
defaultClassName: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.386",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -425,7 +425,7 @@
|
|
|
425
425
|
"@chakra-ui/live-region": "^2.1.0",
|
|
426
426
|
"@internationalized/date": "^3.6.0",
|
|
427
427
|
"@internationalized/string-compiler": "^3.2.6",
|
|
428
|
-
"@mittwald/react-tunnel": "^0.1.0-alpha.
|
|
428
|
+
"@mittwald/react-tunnel": "^0.1.0-alpha.386",
|
|
429
429
|
"@mittwald/react-use-promise": "^2.6.0",
|
|
430
430
|
"@react-aria/form": "^3.0.11",
|
|
431
431
|
"@react-aria/utils": "^3.26.0",
|
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
},
|
|
457
457
|
"devDependencies": {
|
|
458
458
|
"@faker-js/faker": "^9.2.0",
|
|
459
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
459
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.386",
|
|
460
460
|
"@mittwald/react-use-promise": "^2.6.0",
|
|
461
461
|
"@nx/storybook": "^20.1.3",
|
|
462
462
|
"@storybook/addon-a11y": "^8.4.5",
|
|
@@ -551,5 +551,5 @@
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
},
|
|
554
|
-
"gitHead": "
|
|
554
|
+
"gitHead": "e8946b32b3d3df919b62b2a50bf4bae41e1d752c"
|
|
555
555
|
}
|