@mittwald/flow-react-components 0.1.0-alpha.341 → 0.1.0-alpha.342
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 +9 -0
- package/dist/js/List.js +79 -78
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
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.342](https://github.com/mittwald/flow/compare/0.1.0-alpha.341...0.1.0-alpha.342) (2024-11-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @mittwald/flow-react-components
|
|
9
|
+
|
|
10
|
+
# Change Log
|
|
11
|
+
|
|
12
|
+
All notable changes to this project will be documented in this file. See
|
|
13
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
14
|
+
|
|
6
15
|
# [0.1.0-alpha.341](https://github.com/mittwald/flow/compare/0.1.0-alpha.340...0.1.0-alpha.341) (2024-11-12)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @mittwald/flow-react-components
|
package/dist/js/List.js
CHANGED
|
@@ -12,13 +12,13 @@ import { d as nt } from "./dynamic-ClpUSmEt.js";
|
|
|
12
12
|
import { B as y } from "./Button-tKo9ydZL.js";
|
|
13
13
|
import { IconArrowBackUp as rt } from "@tabler/icons-react";
|
|
14
14
|
import { I as ue } from "./Icon-DGqvukLZ.js";
|
|
15
|
-
import { I as
|
|
15
|
+
import { I as ot } from "./IconContextMenu-CZgbKH5A.js";
|
|
16
16
|
import { a as $, C as Y } from "./ContextMenuTrigger-BbYyy0an.js";
|
|
17
17
|
import { M as _ } from "./MenuItem-GX6Zh70q.js";
|
|
18
18
|
import { useLocalizedStringFormatter as w } from "react-aria";
|
|
19
19
|
import { TunnelProvider as ye, TunnelExit as x } from "@mittwald/react-tunnel";
|
|
20
20
|
import T from "clsx";
|
|
21
|
-
import { g as
|
|
21
|
+
import { g as lt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
|
|
22
22
|
import { f as we } from "./flowComponent-1wOIvUIq.js";
|
|
23
23
|
import { R as ct } from "./Render-BdlTa7Qb.js";
|
|
24
24
|
import { T as E } from "./Text-_cq3RnbD.js";
|
|
@@ -97,10 +97,11 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
97
97
|
y,
|
|
98
98
|
{
|
|
99
99
|
variant: "plain",
|
|
100
|
+
color: "secondary",
|
|
100
101
|
className: e,
|
|
101
102
|
"aria-label": s.format("list.options")
|
|
102
103
|
},
|
|
103
|
-
/* @__PURE__ */ i.createElement(
|
|
104
|
+
/* @__PURE__ */ i.createElement(ot, null)
|
|
104
105
|
), t);
|
|
105
106
|
}, Gt = (a) => a === "top" ? m.topContent : a === "bottom" ? m.content : m.topContent, ke = (a) => {
|
|
106
107
|
const { children: e, className: t, containerBreakpointSize: s = "m" } = a, n = {
|
|
@@ -116,7 +117,7 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
116
117
|
ignoreBreakpoint: !0
|
|
117
118
|
},
|
|
118
119
|
Content: {
|
|
119
|
-
className: nt((
|
|
120
|
+
className: nt((l) => Gt(l.slot)),
|
|
120
121
|
tunnelId: "topContent"
|
|
121
122
|
},
|
|
122
123
|
Avatar: {
|
|
@@ -135,12 +136,12 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
135
136
|
Link: {
|
|
136
137
|
unstyled: !0
|
|
137
138
|
}
|
|
138
|
-
},
|
|
139
|
+
}, o = T(
|
|
139
140
|
m.view,
|
|
140
141
|
t,
|
|
141
|
-
m[
|
|
142
|
+
m[lt(s)]
|
|
142
143
|
);
|
|
143
|
-
return /* @__PURE__ */ i.createElement("div", { className:
|
|
144
|
+
return /* @__PURE__ */ i.createElement("div", { className: o }, /* @__PURE__ */ i.createElement(ve, { props: n }, /* @__PURE__ */ i.createElement(ye, null, e, /* @__PURE__ */ i.createElement("div", { className: m.title }, /* @__PURE__ */ i.createElement(x, { id: "title" })), /* @__PURE__ */ i.createElement(x, { id: "topContent" }))));
|
|
144
145
|
}, jt = "flow--list--list-summary", Wt = {
|
|
145
146
|
listSummary: jt
|
|
146
147
|
}, Qi = we("ListSummary", (a) => {
|
|
@@ -171,7 +172,7 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
171
172
|
e
|
|
172
173
|
));
|
|
173
174
|
}, Qt = (a) => {
|
|
174
|
-
const { filter: e } = a, { values: t, mode: s, name: n, property:
|
|
175
|
+
const { filter: e } = a, { values: t, mode: s, name: n, property: o } = e, l = t.map((c) => /* @__PURE__ */ i.createElement(
|
|
175
176
|
_,
|
|
176
177
|
{
|
|
177
178
|
id: c.id,
|
|
@@ -182,13 +183,13 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
182
183
|
},
|
|
183
184
|
c.render()
|
|
184
185
|
)), d = t.filter((c) => c.isActive).map((c) => c.id);
|
|
185
|
-
return /* @__PURE__ */ i.createElement($, null, /* @__PURE__ */ i.createElement(y, { variant: "outline", color: "secondary" }, /* @__PURE__ */ i.createElement(E, null, n ??
|
|
186
|
+
return /* @__PURE__ */ i.createElement($, null, /* @__PURE__ */ i.createElement(y, { variant: "outline", color: "secondary" }, /* @__PURE__ */ i.createElement(E, null, n ?? o), /* @__PURE__ */ i.createElement(ut, null)), /* @__PURE__ */ i.createElement(
|
|
186
187
|
Y,
|
|
187
188
|
{
|
|
188
189
|
selectionMode: s === "one" ? "single" : "multiple",
|
|
189
190
|
selectedKeys: d
|
|
190
191
|
},
|
|
191
|
-
|
|
192
|
+
l
|
|
192
193
|
));
|
|
193
194
|
}, Xt = "flow--list--header", Zt = "flow--list--header--picker-list-and-search", es = "flow--list--header--picker-list", ts = "flow--list--header--search-and-actions", ss = "flow--list--header--search-field", is = "flow--list--header--actions", F = {
|
|
194
195
|
header: Xt,
|
|
@@ -200,8 +201,8 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
200
201
|
}, as = "flow--list--header--active-filters", ns = "flow--list--header--active-filters--clear-button", rs = {
|
|
201
202
|
activeFilters: as,
|
|
202
203
|
clearButton: ns
|
|
203
|
-
},
|
|
204
|
-
const a = g(), e = w(S), s = a.filters.flatMap((c) => c.values).filter((c) => c.isActive).map((c) => /* @__PURE__ */ i.createElement(ft, { key: c.id, onClose: () => c.deactivate() }, /* @__PURE__ */ i.createElement(E, null, c.render()))), n = a.filters.filter((c) => c.hasChanged()).length > 0,
|
|
204
|
+
}, os = pt(() => {
|
|
205
|
+
const a = g(), e = w(S), s = a.filters.flatMap((c) => c.values).filter((c) => c.isActive).map((c) => /* @__PURE__ */ i.createElement(ft, { key: c.id, onClose: () => c.deactivate() }, /* @__PURE__ */ i.createElement(E, null, c.render()))), n = a.filters.filter((c) => c.hasChanged()).length > 0, o = a.supportsSettingsStorage && n && /* @__PURE__ */ i.createElement(H, null, /* @__PURE__ */ i.createElement(q, null, /* @__PURE__ */ i.createElement(A, { locales: S }, "list.filters.store")), /* @__PURE__ */ i.createElement(
|
|
205
206
|
y,
|
|
206
207
|
{
|
|
207
208
|
size: "s",
|
|
@@ -211,7 +212,7 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
211
212
|
"aria-label": e.format("list.filters.store")
|
|
212
213
|
},
|
|
213
214
|
/* @__PURE__ */ i.createElement(mt, null)
|
|
214
|
-
)),
|
|
215
|
+
)), l = n ? /* @__PURE__ */ i.createElement(H, null, /* @__PURE__ */ i.createElement(q, null, /* @__PURE__ */ i.createElement(A, { locales: S }, "list.filters.reset")), /* @__PURE__ */ i.createElement(
|
|
215
216
|
y,
|
|
216
217
|
{
|
|
217
218
|
size: "s",
|
|
@@ -231,30 +232,30 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
231
232
|
},
|
|
232
233
|
/* @__PURE__ */ i.createElement(ue, null, /* @__PURE__ */ i.createElement(ht, null))
|
|
233
234
|
)) : void 0;
|
|
234
|
-
return s.length === 0 && !
|
|
235
|
-
}),
|
|
236
|
-
const { className: e, onChange: t, value: s, ...n } = a, [
|
|
235
|
+
return s.length === 0 && !o && !l ? null : /* @__PURE__ */ i.createElement("div", { className: rs.activeFilters }, s, o, l, d);
|
|
236
|
+
}), ls = (a) => {
|
|
237
|
+
const { className: e, onChange: t, value: s, ...n } = a, [o, l] = J(s ?? "");
|
|
237
238
|
bt(s, () => {
|
|
238
|
-
|
|
239
|
-
}, [
|
|
239
|
+
l(s ?? "");
|
|
240
|
+
}, [o]);
|
|
240
241
|
const d = () => {
|
|
241
|
-
t(void 0),
|
|
242
|
+
t(void 0), l("");
|
|
242
243
|
}, c = (u) => {
|
|
243
|
-
u.key === "Enter" ?
|
|
244
|
+
u.key === "Enter" ? o.trim() === "" ? t(void 0) : t(o) : u.key === "Escape" && d();
|
|
244
245
|
};
|
|
245
246
|
return /* @__PURE__ */ i.createElement(
|
|
246
247
|
vt,
|
|
247
248
|
{
|
|
248
249
|
className: e,
|
|
249
|
-
value:
|
|
250
|
+
value: o,
|
|
250
251
|
onKeyUp: c,
|
|
251
|
-
onChange: (u) =>
|
|
252
|
+
onChange: (u) => l(u),
|
|
252
253
|
onClear: d,
|
|
253
254
|
...n
|
|
254
255
|
}
|
|
255
256
|
);
|
|
256
257
|
}, cs = (a) => {
|
|
257
|
-
const { className: e, search: t } = a, s = t.render ??
|
|
258
|
+
const { className: e, search: t } = a, s = t.render ?? ls;
|
|
258
259
|
return be(s, {
|
|
259
260
|
className: e,
|
|
260
261
|
value: t.value,
|
|
@@ -287,8 +288,8 @@ const Nt = "flow--list--items--item--view", Rt = "flow--list--items--item--view-
|
|
|
287
288
|
const { className: e, hasActionGroup: t } = a, s = g();
|
|
288
289
|
if (s.filters.length === 0 && s.visibleSorting.length === 0 && !s.search && !s.table && !t)
|
|
289
290
|
return null;
|
|
290
|
-
const n = s.filters.map((
|
|
291
|
-
return /* @__PURE__ */ i.createElement("div", { className: T(e, F.header) }, /* @__PURE__ */ i.createElement("div", { className: F.pickerListAndSearch }, /* @__PURE__ */ i.createElement("div", { className: F.pickerList }, /* @__PURE__ */ i.createElement(ds, null), /* @__PURE__ */ i.createElement(_t, null), n), /* @__PURE__ */ i.createElement("div", { className: F.searchAndActions }, s.search && /* @__PURE__ */ i.createElement(cs, { className: F.searchField, search: s.search }), /* @__PURE__ */ i.createElement(x, { id: "actions" }))), /* @__PURE__ */ i.createElement(
|
|
291
|
+
const n = s.filters.map((o) => /* @__PURE__ */ i.createElement(Qt, { key: o.property, filter: o }));
|
|
292
|
+
return /* @__PURE__ */ i.createElement("div", { className: T(e, F.header) }, /* @__PURE__ */ i.createElement("div", { className: F.pickerListAndSearch }, /* @__PURE__ */ i.createElement("div", { className: F.pickerList }, /* @__PURE__ */ i.createElement(ds, null), /* @__PURE__ */ i.createElement(_t, null), n), /* @__PURE__ */ i.createElement("div", { className: F.searchAndActions }, s.search && /* @__PURE__ */ i.createElement(cs, { className: F.searchField, search: s.search }), /* @__PURE__ */ i.createElement(x, { id: "actions" }))), /* @__PURE__ */ i.createElement(os, null));
|
|
292
293
|
}, ms = "flow--list", hs = {
|
|
293
294
|
list: ms
|
|
294
295
|
};
|
|
@@ -318,7 +319,7 @@ class fs {
|
|
|
318
319
|
r(this, "list");
|
|
319
320
|
var n;
|
|
320
321
|
const { batchSize: s = 20 } = t;
|
|
321
|
-
this.list = e, this.batchSize = s, e.filters.forEach((
|
|
322
|
+
this.list = e, this.batchSize = s, e.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (n = e.search) == null || n.onUpdated(() => this.reset());
|
|
322
323
|
}
|
|
323
324
|
get reactTable() {
|
|
324
325
|
return this.list.reactTable.table;
|
|
@@ -402,8 +403,8 @@ class M {
|
|
|
402
403
|
var s;
|
|
403
404
|
this.list = e, this.property = t.property, this.mode = t.mode ?? "one", this._values = (s = t.values) == null ? void 0 : s.map((n) => new fe(this, n)), this.matcher = t.matcher ?? bs, this.renderItem = t.renderItem ?? vs, this.name = t.name, this.defaultSelectedValues = t.defaultSelected ? this.values.filter(
|
|
404
405
|
(n) => {
|
|
405
|
-
var
|
|
406
|
-
return (
|
|
406
|
+
var o;
|
|
407
|
+
return (o = t.defaultSelected) == null ? void 0 : o.some((l) => l === n.value);
|
|
407
408
|
}
|
|
408
409
|
) : void 0;
|
|
409
410
|
}
|
|
@@ -427,19 +428,19 @@ class M {
|
|
|
427
428
|
}
|
|
428
429
|
getReactTableFilterFn() {
|
|
429
430
|
return (e, t, s) => {
|
|
430
|
-
const n = this.property,
|
|
431
|
-
return this.checkFilterMatches(
|
|
431
|
+
const n = this.property, o = n.startsWith(Ss) ? e.original : wt(e.original, n);
|
|
432
|
+
return this.checkFilterMatches(o, s);
|
|
432
433
|
};
|
|
433
434
|
}
|
|
434
435
|
checkFilterMatches(e, t) {
|
|
435
436
|
if (t === null)
|
|
436
437
|
return !0;
|
|
437
|
-
const s = (
|
|
438
|
+
const s = (o) => Array.isArray(o) ? o : [o], n = (o) => this.matcher(o.value, e);
|
|
438
439
|
if (this.mode === "all")
|
|
439
440
|
return s(t).every(n);
|
|
440
441
|
if (this.mode === "some") {
|
|
441
|
-
const
|
|
442
|
-
return
|
|
442
|
+
const o = s(t);
|
|
443
|
+
return o.length === 0 || o.some(n);
|
|
443
444
|
} else if (this.mode === "one")
|
|
444
445
|
return n(t);
|
|
445
446
|
throw new Error(`Unknown filter mode '${this.mode}'`);
|
|
@@ -556,16 +557,16 @@ class Z {
|
|
|
556
557
|
this.list = e;
|
|
557
558
|
const n = this.list.sorting.filter(
|
|
558
559
|
(d) => d.defaultEnabled !== !1
|
|
559
|
-
), [
|
|
560
|
+
), [o, l] = J(
|
|
560
561
|
n.map((d) => d.getReactTableColumnSort())
|
|
561
562
|
);
|
|
562
|
-
this.sortingState =
|
|
563
|
+
this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(t, s);
|
|
563
564
|
}
|
|
564
565
|
static useNew(e, t, s = {}) {
|
|
565
566
|
return new Z(e, t, s);
|
|
566
567
|
}
|
|
567
568
|
useReactTable(e, t = {}) {
|
|
568
|
-
var
|
|
569
|
+
var l;
|
|
569
570
|
const s = this.list.loader.useData(), n = {
|
|
570
571
|
pagination: {
|
|
571
572
|
pageSize: this.list.batches.batchSize
|
|
@@ -574,8 +575,8 @@ class Z {
|
|
|
574
575
|
};
|
|
575
576
|
for (const d of this.list.filters)
|
|
576
577
|
d.updateInitialState(n);
|
|
577
|
-
(
|
|
578
|
-
const
|
|
578
|
+
(l = this.list.search) == null || l.updateInitialState(n);
|
|
579
|
+
const o = Et({
|
|
579
580
|
data: s,
|
|
580
581
|
state: {
|
|
581
582
|
sorting: this.sortingState
|
|
@@ -596,11 +597,11 @@ class Z {
|
|
|
596
597
|
});
|
|
597
598
|
return D(() => {
|
|
598
599
|
e && e(this.list);
|
|
599
|
-
}, [this.list, e,
|
|
600
|
+
}, [this.list, e, o]), o;
|
|
600
601
|
}
|
|
601
602
|
handleSortingStateUpdate(e) {
|
|
602
603
|
const t = typeof e == "function" ? e(this.sortingState) : e, s = this.list.sorting.filter(
|
|
603
|
-
(n) => n.defaultEnabled === "hidden" && !t.some((
|
|
604
|
+
(n) => n.defaultEnabled === "hidden" && !t.some((o) => o.id === n.property)
|
|
604
605
|
).map((n) => n.getReactTableColumnSort());
|
|
605
606
|
this.updateSortingState([...s, ...t]);
|
|
606
607
|
}
|
|
@@ -616,13 +617,13 @@ class Z {
|
|
|
616
617
|
const n = e.get(s);
|
|
617
618
|
if (n)
|
|
618
619
|
return n;
|
|
619
|
-
const
|
|
620
|
+
const o = {
|
|
620
621
|
id: s,
|
|
621
622
|
accessorKey: s,
|
|
622
623
|
enableSorting: !1,
|
|
623
624
|
enableColumnFilter: !1
|
|
624
625
|
};
|
|
625
|
-
return e.set(s,
|
|
626
|
+
return e.set(s, o), o;
|
|
626
627
|
};
|
|
627
628
|
return this.list.filters.forEach(
|
|
628
629
|
(s) => s.updateTableColumnDef(t(s.property))
|
|
@@ -686,8 +687,8 @@ class te {
|
|
|
686
687
|
var d;
|
|
687
688
|
const { source: s } = t;
|
|
688
689
|
this.dataSource = s ?? { staticData: ws };
|
|
689
|
-
const n = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0,
|
|
690
|
-
this.list = e, this.loaderState = ee.useNew(), this.manualPagination = n ?? !1, this.manualFiltering =
|
|
690
|
+
const n = "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;
|
|
691
|
+
this.list = e, this.loaderState = ee.useNew(), this.manualPagination = n ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((c) => c.onFilterUpdated(() => this.reset())), (d = this.list.search) == null || d.onUpdated(() => this.reset());
|
|
691
692
|
}
|
|
692
693
|
static useNew(e, t = {}) {
|
|
693
694
|
return new te(e, t);
|
|
@@ -725,8 +726,8 @@ class te {
|
|
|
725
726
|
}
|
|
726
727
|
useObserveBatchData(e, t) {
|
|
727
728
|
const s = (n) => {
|
|
728
|
-
const { data:
|
|
729
|
-
this.loaderState.setDataBatch(t,
|
|
729
|
+
const { data: o, itemTotalCount: l } = n;
|
|
730
|
+
this.loaderState.setDataBatch(t, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
|
|
730
731
|
};
|
|
731
732
|
D(() => (e.value.value.isSet && s(e.value.value.value), e.value.observe((n) => {
|
|
732
733
|
n.isSet && s(n.value);
|
|
@@ -764,9 +765,9 @@ class te {
|
|
|
764
765
|
[t.staticData]
|
|
765
766
|
);
|
|
766
767
|
if ("asyncLoader" in t) {
|
|
767
|
-
const n = t.asyncLoader,
|
|
768
|
+
const n = t.asyncLoader, o = t.dependencies, l = o ? Ee(o).toString() : void 0;
|
|
768
769
|
return ge(n, [s], {
|
|
769
|
-
loaderId:
|
|
770
|
+
loaderId: l
|
|
770
771
|
});
|
|
771
772
|
}
|
|
772
773
|
if ("asyncResourceFactory" in t) {
|
|
@@ -814,8 +815,8 @@ const R = class R {
|
|
|
814
815
|
r(this, "href");
|
|
815
816
|
r(this, "fallback");
|
|
816
817
|
r(this, "renderFn");
|
|
817
|
-
const { fallback: s, textValue: n, href:
|
|
818
|
-
this.list = e, this.textValue = n, this.renderFn =
|
|
818
|
+
const { fallback: s, textValue: n, href: o, renderFn: l } = t;
|
|
819
|
+
this.list = e, this.textValue = n, this.renderFn = l, this.href = o, this.fallback = s;
|
|
819
820
|
}
|
|
820
821
|
render(e) {
|
|
821
822
|
return (this.renderFn ?? R.fallbackRenderItemFn)(e, this.list);
|
|
@@ -834,7 +835,7 @@ let j = R, Fs = class {
|
|
|
834
835
|
r(this, "componentProps");
|
|
835
836
|
r(this, "columns");
|
|
836
837
|
const { columns: s = [], ...n } = t;
|
|
837
|
-
this.table = e, this.columns = s.map((
|
|
838
|
+
this.table = e, this.columns = s.map((o) => new Fs(this, o)), this.componentProps = n;
|
|
838
839
|
}
|
|
839
840
|
}, Cs = class {
|
|
840
841
|
constructor(e, t = {}) {
|
|
@@ -850,7 +851,7 @@ let j = R, Fs = class {
|
|
|
850
851
|
r(this, "cells");
|
|
851
852
|
r(this, "componentProps");
|
|
852
853
|
const { cells: s = [], ...n } = t;
|
|
853
|
-
this.tableBody = e, this.cells = s.map((
|
|
854
|
+
this.tableBody = e, this.cells = s.map((o) => new Cs(this, o)), this.componentProps = n;
|
|
854
855
|
}
|
|
855
856
|
}, Ls = class {
|
|
856
857
|
constructor(e, t = {}) {
|
|
@@ -866,8 +867,8 @@ let j = R, Fs = class {
|
|
|
866
867
|
r(this, "header");
|
|
867
868
|
r(this, "body");
|
|
868
869
|
r(this, "componentProps");
|
|
869
|
-
const { header: s, body: n, ...
|
|
870
|
-
this.list = e, this.header = new Ts(this, s), this.body = new Ls(this, n), this.componentProps =
|
|
870
|
+
const { header: s, body: n, ...o } = t;
|
|
871
|
+
this.list = e, this.header = new Ts(this, s), this.body = new Ls(this, n), this.componentProps = o;
|
|
871
872
|
}
|
|
872
873
|
};
|
|
873
874
|
var v;
|
|
@@ -896,8 +897,8 @@ let Vs = (v = class {
|
|
|
896
897
|
settingStorageKey: t,
|
|
897
898
|
itemView: s,
|
|
898
899
|
table: n,
|
|
899
|
-
filters:
|
|
900
|
-
sorting:
|
|
900
|
+
filters: o = [],
|
|
901
|
+
sorting: l = [],
|
|
901
902
|
batchesController: d,
|
|
902
903
|
onChange: c,
|
|
903
904
|
loader: u,
|
|
@@ -907,7 +908,7 @@ let Vs = (v = class {
|
|
|
907
908
|
defaultViewMode: L,
|
|
908
909
|
...U
|
|
909
910
|
} = e;
|
|
910
|
-
this.settingsStore = Pt(), this.settingStorageKey = t, this.filterSettingsStorageKey = t ? `${t}.activeFilters` : void 0, this.viewModeStorageKey = t ? `${t}.viewMode` : void 0, this.supportsSettingsStorage = !!this.settingStorageKey, this.items = new ps(this), this.filters =
|
|
911
|
+
this.settingsStore = Pt(), this.settingStorageKey = t, this.filterSettingsStorageKey = t ? `${t}.activeFilters` : void 0, this.viewModeStorageKey = t ? `${t}.viewMode` : void 0, this.supportsSettingsStorage = !!this.settingStorageKey, this.items = new ps(this), this.filters = o.map((p) => new M(this, p)), this.sorting = l.map((p) => new ys(this, p)), this.search = h ? new Es(this, h) : void 0, this.itemView = s ? new j(this, s) : void 0, this.table = n ? new Ps(this, n) : void 0, this.batches = new fs(this, d), this.componentProps = U, this.loader = te.useNew(this, u), this.onAction = C, this.getItemId = z, this.reactTable = Z.useNew(this, c, {
|
|
911
912
|
manualFiltering: this.loader.manualFiltering,
|
|
912
913
|
manualPagination: this.loader.manualPagination,
|
|
913
914
|
manualSorting: this.loader.manualSorting
|
|
@@ -992,10 +993,10 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
|
|
|
992
993
|
isSelected: Bs,
|
|
993
994
|
hasAction: Ds
|
|
994
995
|
}, Be = () => /* @__PURE__ */ i.createElement(ke, null, /* @__PURE__ */ i.createElement(Q, null, /* @__PURE__ */ i.createElement(N, { width: "200px" })), /* @__PURE__ */ i.createElement(E, null, /* @__PURE__ */ i.createElement(N, { width: "300px" }))), xs = (a) => {
|
|
995
|
-
const { id: e, data: t, children: s } = a,
|
|
996
|
-
if (!
|
|
996
|
+
const { id: e, data: t, children: s } = a, o = g().itemView;
|
|
997
|
+
if (!o)
|
|
997
998
|
return null;
|
|
998
|
-
const
|
|
999
|
+
const l = o.list.onAction, d = o.textValue ? o.textValue(t) : void 0, c = o.href ? o.href(t) : void 0, u = !!l || !!c;
|
|
999
1000
|
return /* @__PURE__ */ i.createElement(
|
|
1000
1001
|
X.GridListItem,
|
|
1001
1002
|
{
|
|
@@ -1005,11 +1006,11 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
|
|
|
1005
1006
|
u && B.hasAction,
|
|
1006
1007
|
h.isSelected && B.isSelected
|
|
1007
1008
|
),
|
|
1008
|
-
onAction: () =>
|
|
1009
|
+
onAction: () => l && l(t),
|
|
1009
1010
|
textValue: d,
|
|
1010
1011
|
href: c
|
|
1011
1012
|
},
|
|
1012
|
-
/* @__PURE__ */ i.createElement(Ze, { fallback: /* @__PURE__ */ i.createElement(Be, null) }, s ??
|
|
1013
|
+
/* @__PURE__ */ i.createElement(Ze, { fallback: /* @__PURE__ */ i.createElement(Be, null) }, s ?? o.render(t))
|
|
1013
1014
|
);
|
|
1014
1015
|
}, Ns = (a) => /* @__PURE__ */ i.createElement(X.GridListItem, { textValue: "-", className: B.item }, a.children), W = () => {
|
|
1015
1016
|
const a = w(S);
|
|
@@ -1022,7 +1023,7 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
|
|
|
1022
1023
|
const a = g(), e = a.loader.useIsLoading(), t = a.loader.useIsInitiallyLoading();
|
|
1023
1024
|
if (!a.itemView)
|
|
1024
1025
|
return null;
|
|
1025
|
-
const s = a.items.entries.map((
|
|
1026
|
+
const s = a.items.entries.map((o) => /* @__PURE__ */ i.createElement(xs, { key: o.id, data: o.data, id: o.id })), n = T(Se.items, e && Se.isLoading);
|
|
1026
1027
|
return /* @__PURE__ */ i.createElement("div", { "aria-hidden": t, "aria-busy": e }, /* @__PURE__ */ i.createElement(
|
|
1027
1028
|
X.GridList,
|
|
1028
1029
|
{
|
|
@@ -1035,12 +1036,12 @@ const ks = "flow--list--items", As = "flow--list--items--is-loading", Se = {
|
|
|
1035
1036
|
}, De = (a) => null, zs = () => De, xe = (a) => null, Us = () => xe, Ne = (a) => null, Ks = () => Ne, Re = (a) => null, Os = () => Re, $e = (a) => null, Hs = () => $e, qs = "flow--list--footer", Gs = {
|
|
1036
1037
|
footer: qs
|
|
1037
1038
|
}, js = (a) => {
|
|
1038
|
-
const e = w(S), t = g(), s = t.batches, n = t.loader.useIsInitiallyLoading(),
|
|
1039
|
-
if (
|
|
1039
|
+
const e = w(S), t = g(), s = t.batches, n = t.loader.useIsInitiallyLoading(), o = t.useIsEmpty(), l = s.getTotalItemsCount(), d = s.getVisibleItemsCount();
|
|
1040
|
+
if (o)
|
|
1040
1041
|
return null;
|
|
1041
1042
|
const c = n ? /* @__PURE__ */ i.createElement(Dt, { width: "200px" }) : e.format("list.paginationInfo", {
|
|
1042
1043
|
visibleItemsCount: d,
|
|
1043
|
-
totalItemsCount:
|
|
1044
|
+
totalItemsCount: l
|
|
1044
1045
|
});
|
|
1045
1046
|
return /* @__PURE__ */ i.createElement(E, { ...a }, c);
|
|
1046
1047
|
}, Ws = (a) => {
|
|
@@ -1075,7 +1076,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
|
|
|
1075
1076
|
return /* @__PURE__ */ i.createElement(_s, { ...e.componentProps });
|
|
1076
1077
|
if (t)
|
|
1077
1078
|
return /* @__PURE__ */ i.createElement(W, null);
|
|
1078
|
-
const
|
|
1079
|
+
const o = e.list.onAction, l = T(
|
|
1079
1080
|
I.table,
|
|
1080
1081
|
s && I.isLoading,
|
|
1081
1082
|
e.componentProps.className
|
|
@@ -1085,7 +1086,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
|
|
|
1085
1086
|
{
|
|
1086
1087
|
...a.componentProps,
|
|
1087
1088
|
...e.componentProps,
|
|
1088
|
-
className:
|
|
1089
|
+
className: l
|
|
1089
1090
|
},
|
|
1090
1091
|
/* @__PURE__ */ i.createElement(Ce, { ...e.header.componentProps }, e.header.columns.map((d, c) => /* @__PURE__ */ i.createElement(Ie, { key: c, ...d.componentProps }))),
|
|
1091
1092
|
/* @__PURE__ */ i.createElement(
|
|
@@ -1101,13 +1102,13 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
|
|
|
1101
1102
|
{
|
|
1102
1103
|
className: (u) => T(
|
|
1103
1104
|
I.row,
|
|
1104
|
-
|
|
1105
|
+
o && I.hasAction,
|
|
1105
1106
|
e.body.row.componentProps.className,
|
|
1106
1107
|
u.isSelected && I.isSelected
|
|
1107
1108
|
),
|
|
1108
1109
|
key: d.id,
|
|
1109
1110
|
id: d.id,
|
|
1110
|
-
onAction:
|
|
1111
|
+
onAction: o ? () => o(d.data) : void 0,
|
|
1111
1112
|
...e.body.row.componentProps
|
|
1112
1113
|
},
|
|
1113
1114
|
(c = e.body.row) == null ? void 0 : c.cells.map((u, h) => /* @__PURE__ */ i.createElement(Ve, { key: h, ...u.componentProps }, u.renderFn ? u.renderFn(d.data, a) : void 0))
|
|
@@ -1116,24 +1117,24 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
|
|
|
1116
1117
|
)
|
|
1117
1118
|
);
|
|
1118
1119
|
}, He = (a) => null, qe = (a) => null, Ge = (a) => null, ii = we("List", (a) => {
|
|
1119
|
-
var se, ie, ae, ne, re,
|
|
1120
|
-
const { children: e, batchSize: t, onChange: s, refProp: n, ...
|
|
1120
|
+
var se, ie, ae, ne, re, oe, le, ce, de;
|
|
1121
|
+
const { children: e, batchSize: t, onChange: s, refProp: n, ...o } = a, l = (se = b(
|
|
1121
1122
|
e,
|
|
1122
1123
|
De
|
|
1123
1124
|
)) == null ? void 0 : se.props, d = (ie = b(
|
|
1124
1125
|
e,
|
|
1125
1126
|
Mt
|
|
1126
1127
|
)) == null ? void 0 : ie.props, c = (ae = b(e, $e)) == null ? void 0 : ae.props, u = {
|
|
1127
|
-
source:
|
|
1128
|
-
...
|
|
1129
|
-
asyncLoader:
|
|
1128
|
+
source: l ? {
|
|
1129
|
+
...l,
|
|
1130
|
+
asyncLoader: l.children
|
|
1130
1131
|
} : d ? {
|
|
1131
1132
|
...d,
|
|
1132
1133
|
asyncResourceFactory: d.children
|
|
1133
1134
|
} : c ? {
|
|
1134
1135
|
staticData: c.data
|
|
1135
1136
|
} : void 0
|
|
1136
|
-
}, h = (ne = b(e, ze)) == null ? void 0 : ne.props, C = (re = b(e, Re)) == null ? void 0 : re.props, z = (
|
|
1137
|
+
}, h = (ne = b(e, ze)) == null ? void 0 : ne.props, C = (re = b(e, Re)) == null ? void 0 : re.props, z = (oe = b(e, He)) == null ? void 0 : oe.props, L = V(e, Ue).map(
|
|
1137
1138
|
(f) => ({
|
|
1138
1139
|
...f.props,
|
|
1139
1140
|
name: f.props.children
|
|
@@ -1143,7 +1144,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
|
|
|
1143
1144
|
...f.props,
|
|
1144
1145
|
renderFn: f.props.children
|
|
1145
1146
|
})
|
|
1146
|
-
), K = (
|
|
1147
|
+
), K = (le = b(e, Ke)) == null ? void 0 : le.props, O = (ce = b(e, qe)) == null ? void 0 : ce.props, p = (de = b(e, Ge)) == null ? void 0 : de.props, P = Vs.useNew({
|
|
1147
1148
|
onChange: s,
|
|
1148
1149
|
loader: u,
|
|
1149
1150
|
filters: V(e, xe).map(
|
|
@@ -1179,7 +1180,7 @@ const Ys = () => ze, Ue = (a) => null, Ke = (a) => null, Oe = (a) => null, _s =
|
|
|
1179
1180
|
batchesController: {
|
|
1180
1181
|
batchSize: t
|
|
1181
1182
|
},
|
|
1182
|
-
...
|
|
1183
|
+
...o
|
|
1183
1184
|
}), je = {
|
|
1184
1185
|
ActionGroup: {
|
|
1185
1186
|
className: F.actions,
|
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.342",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
"@chakra-ui/live-region": "^2.1.0",
|
|
406
406
|
"@internationalized/date": "^3.5.6",
|
|
407
407
|
"@internationalized/string-compiler": "^3.2.5",
|
|
408
|
-
"@mittwald/react-tunnel": "^0.1.0-alpha.
|
|
408
|
+
"@mittwald/react-tunnel": "^0.1.0-alpha.342",
|
|
409
409
|
"@mittwald/react-use-promise": "^2.5.0",
|
|
410
410
|
"@react-aria/form": "^3.0.10",
|
|
411
411
|
"@react-aria/utils": "^3.25.3",
|
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
},
|
|
436
436
|
"devDependencies": {
|
|
437
437
|
"@faker-js/faker": "^9.0.3",
|
|
438
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
438
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.342",
|
|
439
439
|
"@mittwald/react-use-promise": "^2.5.0",
|
|
440
440
|
"@nx/storybook": "^20.0.0",
|
|
441
441
|
"@storybook/addon-a11y": "^8.3.5",
|
|
@@ -530,5 +530,5 @@
|
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
},
|
|
533
|
-
"gitHead": "
|
|
533
|
+
"gitHead": "2f4246d657134c162ff078250c901c312804dfcc"
|
|
534
534
|
}
|