@mittwald/flow-react-components 0.1.0-alpha.153 → 0.1.0-alpha.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/List.js
CHANGED
|
@@ -5,10 +5,10 @@ var tt = (s, t, e) => t in s ? _(s, t, { enumerable: !0, configurable: !0, writa
|
|
|
5
5
|
var o = (s, t, e) => tt(s, typeof t != "symbol" ? t + "" : t, e);
|
|
6
6
|
import n, { createContext as et, useContext as at, createElement as st, useEffect as F, useRef as nt, Suspense as it } from "react";
|
|
7
7
|
import { R as rt } from "./Render-BdlTa7Qb.js";
|
|
8
|
-
import { a as w, C as
|
|
9
|
-
import { M as
|
|
8
|
+
import { a as w, C as j } from "./ContextMenuTrigger-DXPJlFQQ.js";
|
|
9
|
+
import { M as J } from "./MenuItem-CCEquV9i.js";
|
|
10
10
|
import "react-aria-components";
|
|
11
|
-
import { autorun as ot, runInAction as lt, makeObservable as ct, observable as
|
|
11
|
+
import { autorun as ot, runInAction as lt, makeObservable as ct, observable as V, computed as x, action as I } from "mobx";
|
|
12
12
|
import "./context-BB3_MApL.js";
|
|
13
13
|
import "./propsContext-DzAKlmhS.js";
|
|
14
14
|
import "@react-aria/utils";
|
|
@@ -17,35 +17,35 @@ import { getProperty as mt } from "dot-prop";
|
|
|
17
17
|
import { T as y } from "./Text-BgxTAtk1.js";
|
|
18
18
|
import "@tabler/icons-react";
|
|
19
19
|
import "./Icon-CvhSELPq.js";
|
|
20
|
-
import { I as
|
|
21
|
-
import { B as
|
|
20
|
+
import { I as W } from "./IconChevronDown-BjpRbARt.js";
|
|
21
|
+
import { B as p } from "./Button-Bs4J6es6.js";
|
|
22
22
|
import { useLocalizedStringFormatter as v } from "react-aria";
|
|
23
|
-
import
|
|
23
|
+
import B from "clsx";
|
|
24
24
|
import { I as dt } from "./IconClose-DVwhXp3R.js";
|
|
25
25
|
import { useReactTable as ht, getCoreRowModel as gt, getSortedRowModel as pt, getFilteredRowModel as ft, getPaginationRowModel as bt, getFacetedUniqueValues as St } from "@tanstack/react-table";
|
|
26
26
|
import Y from "invariant";
|
|
27
27
|
import { useLocalObservable as yt } from "mobx-react-lite";
|
|
28
|
-
import { getAsyncResource as
|
|
29
|
-
import { u as
|
|
28
|
+
import { getAsyncResource as z } from "@mittwald/react-use-promise";
|
|
29
|
+
import { u as $ } from "./useSelector-DpU7_HMO.js";
|
|
30
30
|
import { I as vt } from "./IllustratedMessage-DadLfPs9.js";
|
|
31
|
-
import { I as
|
|
32
|
-
import { H as
|
|
31
|
+
import { I as Ct } from "./IconSearch-DAPXXri4.js";
|
|
32
|
+
import { H as Et } from "./Heading-ob3LPLN8.js";
|
|
33
33
|
import { S as G } from "./Skeleton-CKLaTmDR.js";
|
|
34
34
|
import { P as It } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
35
35
|
import { d as Ft } from "./dynamic-ClpUSmEt.js";
|
|
36
36
|
import { I as Lt } from "./IconContextMenu-B7agrmqo.js";
|
|
37
|
-
import { TunnelProvider as Tt, TunnelExit as
|
|
37
|
+
import { TunnelProvider as Tt, TunnelExit as O } from "@mittwald/react-tunnel";
|
|
38
38
|
import { L as wt } from "./Link-Bal042NI.js";
|
|
39
|
-
import { d as
|
|
39
|
+
import { d as E, a as U } from "./deepFindOfType-6pG0fH7S.js";
|
|
40
40
|
import { ListLoaderAsyncResource as Bt } from "./List/ListLoaderAsyncResource.js";
|
|
41
41
|
import { I as At } from "./InlineCode-BT-PKxVv.js";
|
|
42
42
|
import "react-children-utilities";
|
|
43
|
-
const Q = et({}),
|
|
43
|
+
const Q = et({}), g = () => at(Q).list, kt = () => g().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(rt, { key: e }, () => {
|
|
44
44
|
t();
|
|
45
45
|
})), Dt = (s) => {
|
|
46
46
|
const { sorting: t } = s;
|
|
47
|
-
return /* @__PURE__ */ n.createElement(
|
|
48
|
-
},
|
|
47
|
+
return /* @__PURE__ */ n.createElement(J, { id: t.getTableColumn().id }, t.name);
|
|
48
|
+
}, h = { "de-DE": {
|
|
49
49
|
"list.noResult.heading": "Keine Suchergebnisse gefunden",
|
|
50
50
|
"list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
|
|
51
51
|
"list.options": "Optionen",
|
|
@@ -68,22 +68,22 @@ const Q = et({}), h = () => at(Q).list, kt = () => h().loader.getLoaderInvocatio
|
|
|
68
68
|
} }, L = (s) => {
|
|
69
69
|
const { children: t, locales: e, variables: a } = s;
|
|
70
70
|
return v(e).format(t, a);
|
|
71
|
-
},
|
|
72
|
-
const s =
|
|
71
|
+
}, Nt = () => {
|
|
72
|
+
const s = g(), t = s.sorting.map((i) => /* @__PURE__ */ n.createElement(Dt, { sorting: i, key: i.getTableColumn().id }));
|
|
73
73
|
if (s.sorting.length === 0)
|
|
74
74
|
return null;
|
|
75
75
|
const e = s.sorting.find((i) => i.isSorted()), a = /* @__PURE__ */ n.createElement(y, null, e ? /* @__PURE__ */ n.createElement(
|
|
76
76
|
L,
|
|
77
77
|
{
|
|
78
|
-
locales:
|
|
78
|
+
locales: h,
|
|
79
79
|
variables: {
|
|
80
80
|
property: e.name ?? e.property
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"list.setSorting"
|
|
84
|
-
) : /* @__PURE__ */ n.createElement(L, { locales:
|
|
85
|
-
return /* @__PURE__ */ n.createElement(w, null, /* @__PURE__ */ n.createElement(
|
|
86
|
-
|
|
84
|
+
) : /* @__PURE__ */ n.createElement(L, { locales: h }, "list.sorting"));
|
|
85
|
+
return /* @__PURE__ */ n.createElement(w, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, a, /* @__PURE__ */ n.createElement(W, null)), /* @__PURE__ */ n.createElement(
|
|
86
|
+
j,
|
|
87
87
|
{
|
|
88
88
|
selectionMode: "single",
|
|
89
89
|
selectedKeys: e ? [e.property] : [],
|
|
@@ -93,12 +93,12 @@ const Q = et({}), h = () => at(Q).list, kt = () => h().loader.getLoaderInvocatio
|
|
|
93
93
|
},
|
|
94
94
|
t
|
|
95
95
|
));
|
|
96
|
-
},
|
|
97
|
-
const { filter: t } = s, e = t.values.map((r) => /* @__PURE__ */ n.createElement(
|
|
96
|
+
}, Pt = (s) => {
|
|
97
|
+
const { filter: t } = s, e = t.values.map((r) => /* @__PURE__ */ n.createElement(J, { key: t.getValueId(r), id: String(r) }, String(r))), a = t.values.filter((r) => t.isValueActive(r)).map((r) => String(r)), i = (r) => {
|
|
98
98
|
t.toggleValue(r);
|
|
99
99
|
};
|
|
100
|
-
return /* @__PURE__ */ n.createElement(w, null, /* @__PURE__ */ n.createElement(
|
|
101
|
-
|
|
100
|
+
return /* @__PURE__ */ n.createElement(w, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(y, null, t.name ?? t.property), /* @__PURE__ */ n.createElement(W, null)), /* @__PURE__ */ n.createElement(
|
|
101
|
+
j,
|
|
102
102
|
{
|
|
103
103
|
onAction: i,
|
|
104
104
|
selectionMode: "multiple",
|
|
@@ -106,16 +106,16 @@ const Q = et({}), h = () => at(Q).list, kt = () => h().loader.getLoaderInvocatio
|
|
|
106
106
|
},
|
|
107
107
|
e
|
|
108
108
|
));
|
|
109
|
-
}, Rt = "flow--list--header", Mt = "flow--list--header--picker-list",
|
|
109
|
+
}, Rt = "flow--list--header", Mt = "flow--list--header--picker-list", H = {
|
|
110
110
|
header: Rt,
|
|
111
111
|
pickerList: Mt
|
|
112
|
-
}, Vt = "flow--list--header--active-filters", xt = "flow--list--header--clear-button",
|
|
112
|
+
}, Vt = "flow--list--header--active-filters", xt = "flow--list--header--clear-button", q = {
|
|
113
113
|
activeFilters: Vt,
|
|
114
114
|
clearButton: xt
|
|
115
115
|
}, zt = () => {
|
|
116
|
-
const s =
|
|
116
|
+
const s = g(), t = s.filters.flatMap(
|
|
117
117
|
(e) => e.values.filter((a) => e.isValueActive(a)).map((a) => /* @__PURE__ */ n.createElement(
|
|
118
|
-
|
|
118
|
+
p,
|
|
119
119
|
{
|
|
120
120
|
variant: "soft",
|
|
121
121
|
size: "s",
|
|
@@ -126,19 +126,19 @@ const Q = et({}), h = () => at(Q).list, kt = () => h().loader.getLoaderInvocatio
|
|
|
126
126
|
/* @__PURE__ */ n.createElement(dt, null)
|
|
127
127
|
))
|
|
128
128
|
);
|
|
129
|
-
return t.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className:
|
|
130
|
-
|
|
129
|
+
return t.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className: q.activeFilters }, t, /* @__PURE__ */ n.createElement(
|
|
130
|
+
p,
|
|
131
131
|
{
|
|
132
|
-
className:
|
|
132
|
+
className: q.clearButton,
|
|
133
133
|
size: "s",
|
|
134
134
|
variant: "plain",
|
|
135
135
|
onPress: () => s.clearFilters()
|
|
136
136
|
},
|
|
137
|
-
/* @__PURE__ */ n.createElement(L, { locales:
|
|
137
|
+
/* @__PURE__ */ n.createElement(L, { locales: h }, "list.resetAll")
|
|
138
138
|
));
|
|
139
139
|
}, $t = (s) => {
|
|
140
|
-
const { className: t } = s, a =
|
|
141
|
-
return /* @__PURE__ */ n.createElement("div", { className:
|
|
140
|
+
const { className: t } = s, a = g().filters.map((i) => /* @__PURE__ */ n.createElement(Pt, { key: i.property, filter: i }));
|
|
141
|
+
return /* @__PURE__ */ n.createElement("div", { className: B(t, H.header) }, /* @__PURE__ */ n.createElement("div", { className: H.pickerList }, /* @__PURE__ */ n.createElement(Nt, null), a), /* @__PURE__ */ n.createElement(zt, null));
|
|
142
142
|
}, Ot = "flow--list", Ut = {
|
|
143
143
|
list: Ot
|
|
144
144
|
}, S = class S {
|
|
@@ -157,13 +157,13 @@ const Q = et({}), h = () => at(Q).list, kt = () => h().loader.getLoaderInvocatio
|
|
|
157
157
|
};
|
|
158
158
|
o(S, "fallbackRenderItemFn", (t) => st("pre", void 0, JSON.stringify(t)));
|
|
159
159
|
let T = S;
|
|
160
|
-
class
|
|
160
|
+
class A {
|
|
161
161
|
constructor(t) {
|
|
162
162
|
o(this, "list");
|
|
163
163
|
this.list = t;
|
|
164
164
|
}
|
|
165
165
|
static useNew(t) {
|
|
166
|
-
return new
|
|
166
|
+
return new A(t);
|
|
167
167
|
}
|
|
168
168
|
get entries() {
|
|
169
169
|
return this.list.reactTable.table.getRowModel().rows.map((t) => T.fromRow(this, t));
|
|
@@ -327,7 +327,7 @@ class jt {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
const Jt = (s) => F(ot(s));
|
|
330
|
-
class
|
|
330
|
+
class k {
|
|
331
331
|
constructor(t, e = {}) {
|
|
332
332
|
o(this, "list");
|
|
333
333
|
o(this, "table");
|
|
@@ -344,7 +344,7 @@ class A {
|
|
|
344
344
|
this.list = t, this.tableState = yt(() => ({ value: void 0 })), this.table = this.useReactTable(e);
|
|
345
345
|
}
|
|
346
346
|
static useNew(t, e = {}) {
|
|
347
|
-
return new
|
|
347
|
+
return new k(t, e);
|
|
348
348
|
}
|
|
349
349
|
useReactTable(t = {}) {
|
|
350
350
|
const e = this.list.loader.useData(), a = this.list.sorting.filter((r) => r.defaultEnabled), i = ht({
|
|
@@ -405,23 +405,23 @@ class A {
|
|
|
405
405
|
), Array.from(t.values());
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
class
|
|
408
|
+
class D {
|
|
409
409
|
constructor() {
|
|
410
410
|
o(this, "dataBatches", []);
|
|
411
411
|
o(this, "prevDataBatches", []);
|
|
412
412
|
o(this, "batchLoadingStates", ["void"]);
|
|
413
413
|
ct(this, {
|
|
414
|
-
dataBatches:
|
|
415
|
-
batchLoadingStates:
|
|
416
|
-
mergedData:
|
|
417
|
-
isLoading:
|
|
414
|
+
dataBatches: V.shallow,
|
|
415
|
+
batchLoadingStates: V.shallow,
|
|
416
|
+
mergedData: x,
|
|
417
|
+
isLoading: x,
|
|
418
418
|
reset: I.bound,
|
|
419
419
|
setDataBatch: I.bound,
|
|
420
420
|
setBatchLoadingState: I.bound
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
static useNew() {
|
|
424
|
-
return nt(new
|
|
424
|
+
return nt(new D()).current;
|
|
425
425
|
}
|
|
426
426
|
reset() {
|
|
427
427
|
this.batchLoadingStates = [], this.dataBatches = [];
|
|
@@ -436,17 +436,17 @@ class k {
|
|
|
436
436
|
return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((e) => e);
|
|
437
437
|
}
|
|
438
438
|
useMergedData() {
|
|
439
|
-
return
|
|
439
|
+
return $(() => this.mergedData);
|
|
440
440
|
}
|
|
441
441
|
get isLoading() {
|
|
442
442
|
return this.batchLoadingStates.some((t) => t === "loading" || t === "void");
|
|
443
443
|
}
|
|
444
444
|
useIsLoading() {
|
|
445
|
-
return
|
|
445
|
+
return $(() => this.isLoading);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
const Wt = [];
|
|
449
|
-
class
|
|
449
|
+
class N {
|
|
450
450
|
constructor(t, e = {}) {
|
|
451
451
|
o(this, "list");
|
|
452
452
|
o(this, "dataSource");
|
|
@@ -457,10 +457,10 @@ class D {
|
|
|
457
457
|
const { source: a } = e;
|
|
458
458
|
this.dataSource = a ?? { staticData: Wt };
|
|
459
459
|
const i = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, r = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, l = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
|
|
460
|
-
this.list = t, this.loaderState =
|
|
460
|
+
this.list = t, this.loaderState = D.useNew(), this.manualPagination = i ?? !1, this.manualFiltering = r ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((u) => u.onFilterUpdated(() => this.reset()));
|
|
461
461
|
}
|
|
462
462
|
static useNew(t, e = {}) {
|
|
463
|
-
return new
|
|
463
|
+
return new N(t, e);
|
|
464
464
|
}
|
|
465
465
|
reset() {
|
|
466
466
|
this.loaderState.reset();
|
|
@@ -522,7 +522,7 @@ class D {
|
|
|
522
522
|
getBatchDataAsyncResource(t) {
|
|
523
523
|
const e = this.dataSource, a = this.getDataLoaderOptions(t);
|
|
524
524
|
if ("staticData" in e)
|
|
525
|
-
return
|
|
525
|
+
return z(
|
|
526
526
|
async (i) => ({
|
|
527
527
|
data: i,
|
|
528
528
|
itemTotalCount: i.length
|
|
@@ -531,7 +531,7 @@ class D {
|
|
|
531
531
|
);
|
|
532
532
|
if ("asyncLoader" in e) {
|
|
533
533
|
const i = e.asyncLoader;
|
|
534
|
-
return
|
|
534
|
+
return z(i, [a]);
|
|
535
535
|
}
|
|
536
536
|
if ("asyncResourceFactory" in e) {
|
|
537
537
|
const i = e.asyncResourceFactory;
|
|
@@ -550,7 +550,7 @@ let Yt = class X {
|
|
|
550
550
|
o(this, "batches");
|
|
551
551
|
o(this, "loader");
|
|
552
552
|
const { render: e, filters: a = [], sorting: i = [], batchesController: r } = t;
|
|
553
|
-
this.render = e, this.items =
|
|
553
|
+
this.render = e, this.items = A.useNew(this), this.filters = a.map((l) => new Kt(this, l)), this.sorting = i.map((l) => new jt(this, l)), this.batches = new Ht(this, r), this.loader = N.useNew(this, t.loader), this.reactTable = k.useNew(this, {
|
|
554
554
|
manualFiltering: this.loader.manualFiltering,
|
|
555
555
|
manualPagination: this.loader.manualPagination,
|
|
556
556
|
manualSorting: this.loader.manualSorting
|
|
@@ -576,7 +576,7 @@ let Yt = class X {
|
|
|
576
576
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
577
577
|
}
|
|
578
578
|
};
|
|
579
|
-
const Gt = "flow--list--items--item-list", Qt = "flow--list--items--is-loading",
|
|
579
|
+
const Gt = "flow--list--items--item-list", Qt = "flow--list--items--is-loading", K = {
|
|
580
580
|
itemList: Gt,
|
|
581
581
|
isLoading: Qt
|
|
582
582
|
}, Xt = "flow--list--items--item", Zt = "flow--list--items--title", _t = "flow--list--items--top-content", te = "flow--list--items--content", ee = "flow--list--items--action", ae = "flow--list--items--avatar", se = "flow--list--items--text", ne = "flow--list--items--status-badge", ie = "flow--list--items--heading", c = {
|
|
@@ -590,9 +590,9 @@ const Gt = "flow--list--items--item-list", Qt = "flow--list--items--is-loading",
|
|
|
590
590
|
statusBadge: ne,
|
|
591
591
|
heading: ie
|
|
592
592
|
}, re = (s) => {
|
|
593
|
-
const { className: t, children: e } = s, a = v(
|
|
593
|
+
const { className: t, children: e } = s, a = v(h);
|
|
594
594
|
return /* @__PURE__ */ n.createElement(w, null, /* @__PURE__ */ n.createElement(
|
|
595
|
-
|
|
595
|
+
p,
|
|
596
596
|
{
|
|
597
597
|
variant: "plain",
|
|
598
598
|
className: t,
|
|
@@ -601,7 +601,7 @@ const Gt = "flow--list--items--item-list", Qt = "flow--list--items--is-loading",
|
|
|
601
601
|
/* @__PURE__ */ n.createElement(Lt, null)
|
|
602
602
|
), e);
|
|
603
603
|
}, oe = (s) => s === "top" ? c.topContent : s === "bottom" ? c.content : c.topContent, Z = (s) => {
|
|
604
|
-
const { children: t, href: e,
|
|
604
|
+
const { children: t, href: e, className: a, ...i } = s, r = {
|
|
605
605
|
ContextMenu: {
|
|
606
606
|
wrapWith: /* @__PURE__ */ n.createElement(re, { className: c.action }),
|
|
607
607
|
placement: "bottom end"
|
|
@@ -610,7 +610,7 @@ const Gt = "flow--list--items--item-list", Qt = "flow--list--items--is-loading",
|
|
|
610
610
|
className: c.action
|
|
611
611
|
},
|
|
612
612
|
Content: {
|
|
613
|
-
className: Ft((
|
|
613
|
+
className: Ft((m) => oe(m.slot)),
|
|
614
614
|
tunnelId: "topContent"
|
|
615
615
|
},
|
|
616
616
|
Avatar: {
|
|
@@ -633,15 +633,15 @@ const Gt = "flow--list--items--item-list", Qt = "flow--list--items--is-loading",
|
|
|
633
633
|
Link: {
|
|
634
634
|
unstyled: !0
|
|
635
635
|
}
|
|
636
|
-
},
|
|
637
|
-
return /* @__PURE__ */ n.createElement(
|
|
636
|
+
}, l = B(c.item, a), u = (m) => e ? /* @__PURE__ */ n.createElement(wt, { unstyled: !0, ...i, className: l, href: e }, m.children) : /* @__PURE__ */ n.createElement("div", { className: l }, m.children);
|
|
637
|
+
return /* @__PURE__ */ n.createElement(u, null, /* @__PURE__ */ n.createElement(It, { props: r }, /* @__PURE__ */ n.createElement(Tt, null, t, /* @__PURE__ */ n.createElement("div", { className: c.title }, /* @__PURE__ */ n.createElement(O, { id: "title" })), /* @__PURE__ */ n.createElement(O, { id: "topContent" }))));
|
|
638
638
|
}, b = () => /* @__PURE__ */ n.createElement(Z, null, /* @__PURE__ */ n.createElement(G, { height: "3rem" })), le = (s) => {
|
|
639
|
-
const { className: t } = s, e =
|
|
640
|
-
|
|
639
|
+
const { className: t } = s, e = g(), a = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading(), r = e.useIsEmpty(), l = v(h), u = e.items.entries.map((d) => /* @__PURE__ */ n.createElement(it, { key: d.id }, d.render())), m = B(
|
|
640
|
+
K.itemList,
|
|
641
641
|
t,
|
|
642
|
-
a &&
|
|
642
|
+
a && K.isLoading
|
|
643
643
|
);
|
|
644
|
-
return r ? /* @__PURE__ */ n.createElement(vt, null, /* @__PURE__ */ n.createElement(
|
|
644
|
+
return r ? /* @__PURE__ */ n.createElement(vt, null, /* @__PURE__ */ n.createElement(Ct, null), /* @__PURE__ */ n.createElement(Et, null, l.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(y, null, l.format("list.noResult.text"))) : /* @__PURE__ */ n.createElement("div", { className: m }, i ? ce : u);
|
|
645
645
|
}, ce = /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(b, null), /* @__PURE__ */ n.createElement(b, null), /* @__PURE__ */ n.createElement(b, null), /* @__PURE__ */ n.createElement(b, null), /* @__PURE__ */ n.createElement(b, null));
|
|
646
646
|
function ue(s) {
|
|
647
647
|
return null;
|
|
@@ -661,22 +661,22 @@ function ge(s) {
|
|
|
661
661
|
const pe = "flow--list--footer", fe = {
|
|
662
662
|
footer: pe
|
|
663
663
|
}, be = (s) => {
|
|
664
|
-
const t = v(
|
|
664
|
+
const t = v(h), e = g(), a = e.batches, i = e.isFiltered() && !e.loader.manualFiltering, r = e.loader.useIsInitiallyLoading(), l = e.useIsEmpty(), u = a.getTotalItemsCount() ?? 0, m = a.getFilteredItemsCount() ?? 0, d = a.getVisibleItemsCount() ?? 0;
|
|
665
665
|
if (l)
|
|
666
666
|
return null;
|
|
667
|
-
const
|
|
668
|
-
visibleItemsCount:
|
|
669
|
-
filteredItemsCount:
|
|
667
|
+
const C = r ? /* @__PURE__ */ n.createElement(G, { width: "200px" }) : i ? t.format("list.paginationInfoFiltered", {
|
|
668
|
+
visibleItemsCount: d,
|
|
669
|
+
filteredItemsCount: m,
|
|
670
670
|
totalItemsCount: u
|
|
671
671
|
}) : t.format("list.paginationInfo", {
|
|
672
|
-
visibleItemsCount:
|
|
672
|
+
visibleItemsCount: d,
|
|
673
673
|
totalItemsCount: u
|
|
674
674
|
});
|
|
675
|
-
return /* @__PURE__ */ n.createElement(y, { ...s },
|
|
675
|
+
return /* @__PURE__ */ n.createElement(y, { ...s }, C);
|
|
676
676
|
}, Se = (s) => {
|
|
677
|
-
const t = v(
|
|
677
|
+
const t = v(h), e = g(), a = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading();
|
|
678
678
|
return !e.batches.hasNextBatch() && !a ? null : /* @__PURE__ */ n.createElement(
|
|
679
|
-
|
|
679
|
+
p,
|
|
680
680
|
{
|
|
681
681
|
isPending: a && !i,
|
|
682
682
|
isDisabled: i,
|
|
@@ -689,11 +689,11 @@ const pe = "flow--list--footer", fe = {
|
|
|
689
689
|
);
|
|
690
690
|
}, ye = () => /* @__PURE__ */ n.createElement("div", { className: fe.footer }, /* @__PURE__ */ n.createElement(be, null), /* @__PURE__ */ n.createElement(Se, null)), ve = (s) => /* @__PURE__ */ n.createElement(Z, null, /* @__PURE__ */ n.createElement(At, null, JSON.stringify(s.data)));
|
|
691
691
|
function ia(s) {
|
|
692
|
-
var
|
|
693
|
-
const { children: t, batchSize: e, ...a } = s, i = (
|
|
692
|
+
var C, P, R, M;
|
|
693
|
+
const { children: t, batchSize: e, ...a } = s, i = (C = E(t, ue)) == null ? void 0 : C.props, r = (P = E(
|
|
694
694
|
t,
|
|
695
695
|
Bt
|
|
696
|
-
)) == null ? void 0 : P.props, l = (
|
|
696
|
+
)) == null ? void 0 : P.props, l = (R = E(t, ge)) == null ? void 0 : R.props, u = {
|
|
697
697
|
source: i ? {
|
|
698
698
|
...i,
|
|
699
699
|
asyncLoader: i.children
|
|
@@ -703,11 +703,11 @@ function ia(s) {
|
|
|
703
703
|
} : l ? {
|
|
704
704
|
staticData: l.data
|
|
705
705
|
} : void 0
|
|
706
|
-
},
|
|
706
|
+
}, m = (f) => /* @__PURE__ */ n.createElement(ve, { data: f }), d = Yt.useNew({
|
|
707
707
|
loader: u,
|
|
708
|
-
filters:
|
|
709
|
-
sorting:
|
|
710
|
-
render: ((
|
|
708
|
+
filters: U(t, me).map((f) => f.props),
|
|
709
|
+
sorting: U(t, de).map((f) => f.props),
|
|
710
|
+
render: ((M = E(t, he)) == null ? void 0 : M.props.children) ?? m,
|
|
711
711
|
...a,
|
|
712
712
|
batchesController: {
|
|
713
713
|
batchSize: e
|
|
@@ -717,7 +717,7 @@ function ia(s) {
|
|
|
717
717
|
Q.Provider,
|
|
718
718
|
{
|
|
719
719
|
value: {
|
|
720
|
-
list:
|
|
720
|
+
list: d
|
|
721
721
|
}
|
|
722
722
|
},
|
|
723
723
|
/* @__PURE__ */ n.createElement(kt, null),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren, default as React } from 'react';
|
|
2
2
|
import { LinkDOMProps } from '@react-types/shared';
|
|
3
|
+
import { PropsWithClassName } from '../../../../../lib/types/props';
|
|
3
4
|
|
|
4
|
-
type Props = PropsWithChildren & LinkDOMProps;
|
|
5
|
+
type Props = PropsWithChildren & LinkDOMProps & PropsWithClassName;
|
|
5
6
|
export declare const ListItem: (props: Props) => React.JSX.Element;
|
|
6
7
|
export default ListItem;
|
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.155",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
"dependencies": {
|
|
281
281
|
"@chakra-ui/live-region": "^2.1.0",
|
|
282
282
|
"@internationalized/string-compiler": "^3.2.4",
|
|
283
|
-
"@mittwald/react-tunnel": "^0.1.0-alpha.
|
|
283
|
+
"@mittwald/react-tunnel": "^0.1.0-alpha.155",
|
|
284
284
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
285
285
|
"@react-aria/utils": "^3.24.1",
|
|
286
286
|
"@react-types/shared": "^3.23.1",
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
},
|
|
308
308
|
"devDependencies": {
|
|
309
309
|
"@faker-js/faker": "^8.4.1",
|
|
310
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
310
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.155",
|
|
311
311
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
312
312
|
"@nx/storybook": "^19.3.0",
|
|
313
313
|
"@storybook/addon-a11y": "^8.1.10",
|
|
@@ -383,5 +383,5 @@
|
|
|
383
383
|
"optional": true
|
|
384
384
|
}
|
|
385
385
|
},
|
|
386
|
-
"gitHead": "
|
|
386
|
+
"gitHead": "fd0bc14df7bf0a2a7fb8f007660267b0dea9eb8f"
|
|
387
387
|
}
|