@mittwald/flow-react-components 0.1.0-alpha.203 → 0.1.0-alpha.204
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 +238 -230
- package/dist/types/components/List/List.d.ts +4 -2
- package/dist/types/components/List/model/List.d.ts +1 -1
- package/dist/types/components/List/model/ReactTable.d.ts +2 -2
- package/dist/types/components/List/model/search/Search.d.ts +1 -0
- package/dist/types/components/List/model/types.d.ts +4 -1
- package/dist/types/components/List/typedList.d.ts +11 -7
- package/dist/types/components/propTypes/index.d.ts +1 -1
- package/package.json +4 -4
package/dist/List.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
var mt = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
var r = (a, t, e) =>
|
|
6
|
-
import n, { createContext as
|
|
4
|
+
var gt = (a, t, e) => t in a ? mt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
5
|
+
var r = (a, t, e) => gt(a, typeof t != "symbol" ? t + "" : t, e);
|
|
6
|
+
import n, { createContext as pt, useContext as ft, createElement as Y, useState as Q, useEffect as L, useRef as bt, cloneElement as St } from "react";
|
|
7
7
|
import "./propsContext-DzAKlmhS.js";
|
|
8
|
-
import { P as
|
|
8
|
+
import { P as vt } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
|
-
import { isShallowEqual as
|
|
11
|
-
import { d as
|
|
10
|
+
import { isShallowEqual as yt, unique as wt, times as Et } from "remeda";
|
|
11
|
+
import { d as Ct } from "./dynamic-ClpUSmEt.js";
|
|
12
12
|
import { B as p } from "./Button-DQtavSbo.js";
|
|
13
13
|
import "@tabler/icons-react";
|
|
14
14
|
import "./Icon-DPoIVASu.js";
|
|
15
|
-
import { I as
|
|
16
|
-
import { a as
|
|
15
|
+
import { I as Ft } from "./IconContextMenu-jwoVcLvd.js";
|
|
16
|
+
import { a as A, C as X } from "./ContextMenuTrigger-BdJf5T8A.js";
|
|
17
17
|
import { M as Z } from "./MenuItem-DcfYvfPJ.js";
|
|
18
|
-
import { useLocalizedStringFormatter as
|
|
19
|
-
import { TunnelProvider as
|
|
20
|
-
import
|
|
21
|
-
import { g as
|
|
22
|
-
import { f as
|
|
23
|
-
import { R as
|
|
18
|
+
import { useLocalizedStringFormatter as v } from "react-aria";
|
|
19
|
+
import { TunnelProvider as Lt, TunnelExit as $ } from "@mittwald/react-tunnel";
|
|
20
|
+
import C from "clsx";
|
|
21
|
+
import { g as Tt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
|
|
22
|
+
import { f as It } from "./flowComponent-DHPUcYyM.js";
|
|
23
|
+
import { R as kt } from "./Render-BdlTa7Qb.js";
|
|
24
24
|
import { T as f } from "./Text-Sd5q3Yme.js";
|
|
25
25
|
import { I as _ } from "./IconChevronDown--OxZLX8L.js";
|
|
26
|
-
import { I as
|
|
27
|
-
import { makeObservable as
|
|
26
|
+
import { I as At } from "./IconClose-BFwPT_IX.js";
|
|
27
|
+
import { makeObservable as xt, observable as U, computed as O, action as F } from "mobx";
|
|
28
28
|
import "./context-BB3_MApL.js";
|
|
29
|
-
import { u as
|
|
30
|
-
import { S as
|
|
31
|
-
import { getProperty as
|
|
32
|
-
import { hash as
|
|
33
|
-
import { useReactTable as
|
|
29
|
+
import { u as Bt } from "./useOnChange-C1Quwyuz.js";
|
|
30
|
+
import { S as Pt } from "./SearchField-DstUFmq4.js";
|
|
31
|
+
import { getProperty as Dt } from "dot-prop";
|
|
32
|
+
import { hash as Nt } from "object-code";
|
|
33
|
+
import { useReactTable as Vt, getCoreRowModel as Rt, getSortedRowModel as Mt, getFilteredRowModel as zt, getPaginationRowModel as $t, getFacetedUniqueValues as Ut } from "@tanstack/react-table";
|
|
34
34
|
import tt from "invariant";
|
|
35
35
|
import { getAsyncResource as q } from "@mittwald/react-use-promise";
|
|
36
36
|
import { u as H } from "./useSelector-DpU7_HMO.js";
|
|
37
|
-
import * as
|
|
38
|
-
import { I as
|
|
39
|
-
import { I as
|
|
37
|
+
import * as x from "react-aria-components";
|
|
38
|
+
import { I as Ot } from "./IllustratedMessage-B3MHD01M.js";
|
|
39
|
+
import { I as qt } from "./IconSearch-C7VQTAqK.js";
|
|
40
40
|
import { H as et } from "./Heading-BEC6iPfF.js";
|
|
41
|
-
import { d as
|
|
42
|
-
import { ListLoaderAsyncResource as
|
|
43
|
-
import { S as
|
|
44
|
-
const
|
|
45
|
-
view:
|
|
46
|
-
title:
|
|
47
|
-
topContent:
|
|
48
|
-
content:
|
|
49
|
-
action:
|
|
50
|
-
avatar:
|
|
51
|
-
text:
|
|
52
|
-
heading:
|
|
41
|
+
import { d as S, a as K } from "./deepFindOfType-6pG0fH7S.js";
|
|
42
|
+
import { ListLoaderAsyncResource as Ht, TypedListLoaderAsyncResource as Kt } from "./List/ListLoaderAsyncResource.js";
|
|
43
|
+
import { S as Gt } from "./Skeleton-CKLaTmDR.js";
|
|
44
|
+
const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title", Jt = "flow--list--items--item--view--top-content", Yt = "flow--list--items--item--view--content", Qt = "flow--list--items--item--view--action", Xt = "flow--list--items--item--view--avatar", Zt = "flow--list--items--item--view--text", _t = "flow--list--items--item--view--heading", h = {
|
|
45
|
+
view: jt,
|
|
46
|
+
title: Wt,
|
|
47
|
+
topContent: Jt,
|
|
48
|
+
content: Yt,
|
|
49
|
+
action: Qt,
|
|
50
|
+
avatar: Xt,
|
|
51
|
+
text: Zt,
|
|
52
|
+
heading: _t,
|
|
53
53
|
"container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
|
|
54
54
|
"container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
|
|
55
55
|
"container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
|
|
@@ -73,70 +73,70 @@ const Gt = "flow--list--items--item--view", jt = "flow--list--items--item--view-
|
|
|
73
73
|
"list.setSorting": (a) => `Sorting: ${a.property}`,
|
|
74
74
|
"list.showMore": "Show more",
|
|
75
75
|
"list.sorting": "Sorting"
|
|
76
|
-
} },
|
|
77
|
-
const { className: t, children: e } = a, s =
|
|
78
|
-
return /* @__PURE__ */ n.createElement(
|
|
76
|
+
} }, te = (a) => {
|
|
77
|
+
const { className: t, children: e } = a, s = v(g);
|
|
78
|
+
return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(
|
|
79
79
|
p,
|
|
80
80
|
{
|
|
81
81
|
variant: "plain",
|
|
82
82
|
className: t,
|
|
83
83
|
"aria-label": s.format("list.options")
|
|
84
84
|
},
|
|
85
|
-
/* @__PURE__ */ n.createElement(
|
|
85
|
+
/* @__PURE__ */ n.createElement(Ft, null)
|
|
86
86
|
), e);
|
|
87
|
-
},
|
|
87
|
+
}, ee = (a) => a === "top" ? h.topContent : a === "bottom" ? h.content : h.topContent, st = (a) => {
|
|
88
88
|
const { children: t, className: e, containerBreakpointSize: s = "m" } = a, i = {
|
|
89
89
|
ContextMenu: {
|
|
90
|
-
wrapWith: /* @__PURE__ */ n.createElement(
|
|
90
|
+
wrapWith: /* @__PURE__ */ n.createElement(te, { className: h.action }),
|
|
91
91
|
placement: "bottom end"
|
|
92
92
|
},
|
|
93
93
|
Button: {
|
|
94
|
-
className:
|
|
94
|
+
className: h.action
|
|
95
95
|
},
|
|
96
96
|
ActionGroup: {
|
|
97
|
-
className:
|
|
97
|
+
className: h.action,
|
|
98
98
|
ignoreBreakpoint: !0
|
|
99
99
|
},
|
|
100
100
|
Content: {
|
|
101
|
-
className:
|
|
101
|
+
className: Ct((l) => ee(l.slot)),
|
|
102
102
|
tunnelId: "topContent"
|
|
103
103
|
},
|
|
104
104
|
Avatar: {
|
|
105
|
-
className:
|
|
105
|
+
className: h.avatar,
|
|
106
106
|
tunnelId: "title"
|
|
107
107
|
},
|
|
108
108
|
Heading: {
|
|
109
|
-
className:
|
|
109
|
+
className: h.heading,
|
|
110
110
|
level: 5,
|
|
111
111
|
tunnelId: "title"
|
|
112
112
|
},
|
|
113
113
|
Text: {
|
|
114
|
-
className:
|
|
114
|
+
className: h.text,
|
|
115
115
|
tunnelId: "title"
|
|
116
116
|
},
|
|
117
117
|
Link: {
|
|
118
118
|
unstyled: !0
|
|
119
119
|
}
|
|
120
|
-
}, o =
|
|
121
|
-
|
|
120
|
+
}, o = C(
|
|
121
|
+
h.view,
|
|
122
122
|
e,
|
|
123
|
-
|
|
123
|
+
h[Tt(s)]
|
|
124
124
|
);
|
|
125
|
-
return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(
|
|
126
|
-
}, it =
|
|
125
|
+
return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(vt, { props: i }, /* @__PURE__ */ n.createElement(Lt, null, t, /* @__PURE__ */ n.createElement("div", { className: h.title }, /* @__PURE__ */ n.createElement($, { id: "title" })), /* @__PURE__ */ n.createElement($, { id: "topContent" }))));
|
|
126
|
+
}, it = pt({}), m = () => ft(it).list, se = () => m().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(kt, { key: e }, () => {
|
|
127
127
|
t();
|
|
128
|
-
})),
|
|
128
|
+
})), ie = (a) => {
|
|
129
129
|
const { sorting: t } = a;
|
|
130
130
|
return /* @__PURE__ */ n.createElement(Z, { id: t.id }, t.name);
|
|
131
|
-
},
|
|
131
|
+
}, T = (a) => {
|
|
132
132
|
const { children: t, locales: e, variables: s } = a;
|
|
133
|
-
return
|
|
134
|
-
},
|
|
135
|
-
const a =
|
|
133
|
+
return v(e).format(t, s);
|
|
134
|
+
}, ae = () => {
|
|
135
|
+
const a = m(), t = a.visibleSorting.map((i) => /* @__PURE__ */ n.createElement(ie, { sorting: i, key: i.id }));
|
|
136
136
|
if (t.length === 0)
|
|
137
137
|
return null;
|
|
138
138
|
const e = a.visibleSorting.find((i) => i.isSorted()), s = /* @__PURE__ */ n.createElement(f, null, e ? /* @__PURE__ */ n.createElement(
|
|
139
|
-
|
|
139
|
+
T,
|
|
140
140
|
{
|
|
141
141
|
locales: g,
|
|
142
142
|
variables: {
|
|
@@ -144,8 +144,8 @@ const Gt = "flow--list--items--item--view", jt = "flow--list--items--item--view-
|
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
"list.setSorting"
|
|
147
|
-
) : /* @__PURE__ */ n.createElement(
|
|
148
|
-
return /* @__PURE__ */ n.createElement(
|
|
147
|
+
) : /* @__PURE__ */ n.createElement(T, { locales: g }, "list.sorting"));
|
|
148
|
+
return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ n.createElement(_, null)), /* @__PURE__ */ n.createElement(
|
|
149
149
|
X,
|
|
150
150
|
{
|
|
151
151
|
selectionMode: "single",
|
|
@@ -156,36 +156,36 @@ const Gt = "flow--list--items--item--view", jt = "flow--list--items--item--view-
|
|
|
156
156
|
},
|
|
157
157
|
t
|
|
158
158
|
));
|
|
159
|
-
},
|
|
160
|
-
const { filter: t } = a, { values: e, mode: s, name: i, property: o } = t, l = e.map((
|
|
159
|
+
}, ne = (a) => {
|
|
160
|
+
const { filter: t } = a, { values: e, mode: s, name: i, property: o } = t, l = e.map((u) => /* @__PURE__ */ n.createElement(
|
|
161
161
|
Z,
|
|
162
162
|
{
|
|
163
|
-
id:
|
|
164
|
-
key:
|
|
163
|
+
id: u.id,
|
|
164
|
+
key: u.id,
|
|
165
165
|
onAction: () => {
|
|
166
|
-
|
|
166
|
+
u.toggle();
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
|
-
|
|
170
|
-
)),
|
|
171
|
-
return /* @__PURE__ */ n.createElement(
|
|
169
|
+
u.render()
|
|
170
|
+
)), c = e.filter((u) => u.isActive).map((u) => u.id);
|
|
171
|
+
return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(f, null, i ?? o), /* @__PURE__ */ n.createElement(_, null)), /* @__PURE__ */ n.createElement(
|
|
172
172
|
X,
|
|
173
173
|
{
|
|
174
174
|
selectionMode: s === "one" ? "single" : "multiple",
|
|
175
|
-
selectedKeys:
|
|
175
|
+
selectedKeys: c
|
|
176
176
|
},
|
|
177
177
|
l
|
|
178
178
|
));
|
|
179
|
-
},
|
|
180
|
-
header:
|
|
181
|
-
pickerListAndSearch:
|
|
182
|
-
pickerList:
|
|
183
|
-
searchField:
|
|
184
|
-
},
|
|
185
|
-
activeFilters:
|
|
186
|
-
clearButton:
|
|
187
|
-
},
|
|
188
|
-
const a =
|
|
179
|
+
}, re = "flow--list--header", oe = "flow--list--header--picker-list-and-search", le = "flow--list--header--picker-list", ce = "flow--list--header--search-field", w = {
|
|
180
|
+
header: re,
|
|
181
|
+
pickerListAndSearch: oe,
|
|
182
|
+
pickerList: le,
|
|
183
|
+
searchField: ce
|
|
184
|
+
}, ue = "flow--list--header--active-filters", de = "flow--list--header--active-filters--clear-button", G = {
|
|
185
|
+
activeFilters: ue,
|
|
186
|
+
clearButton: de
|
|
187
|
+
}, he = () => {
|
|
188
|
+
const a = m(), t = a.filters.flatMap(
|
|
189
189
|
(e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ n.createElement(
|
|
190
190
|
p,
|
|
191
191
|
{
|
|
@@ -195,7 +195,7 @@ const Gt = "flow--list--items--item--view", jt = "flow--list--items--item--view-
|
|
|
195
195
|
onPress: () => s.deactivate()
|
|
196
196
|
},
|
|
197
197
|
/* @__PURE__ */ n.createElement(f, null, s.render()),
|
|
198
|
-
/* @__PURE__ */ n.createElement(
|
|
198
|
+
/* @__PURE__ */ n.createElement(At, null)
|
|
199
199
|
))
|
|
200
200
|
);
|
|
201
201
|
return t.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className: G.activeFilters }, t, /* @__PURE__ */ n.createElement(
|
|
@@ -206,30 +206,30 @@ const Gt = "flow--list--items--item--view", jt = "flow--list--items--item--view-
|
|
|
206
206
|
variant: "plain",
|
|
207
207
|
onPress: () => a.clearFilters()
|
|
208
208
|
},
|
|
209
|
-
/* @__PURE__ */ n.createElement(
|
|
209
|
+
/* @__PURE__ */ n.createElement(T, { locales: g }, "list.resetAll")
|
|
210
210
|
));
|
|
211
211
|
}, me = (a) => {
|
|
212
212
|
const { className: t, onChange: e, value: s, ...i } = a, [o, l] = Q(s ?? "");
|
|
213
|
-
|
|
213
|
+
Bt(s, () => {
|
|
214
214
|
l(s ?? "");
|
|
215
215
|
}, [o]);
|
|
216
|
-
const
|
|
216
|
+
const c = () => {
|
|
217
217
|
e(void 0), l("");
|
|
218
|
-
},
|
|
219
|
-
d.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : d.key === "Escape" &&
|
|
218
|
+
}, u = (d) => {
|
|
219
|
+
d.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : d.key === "Escape" && c();
|
|
220
220
|
};
|
|
221
221
|
return /* @__PURE__ */ n.createElement(
|
|
222
|
-
|
|
222
|
+
Pt,
|
|
223
223
|
{
|
|
224
224
|
className: t,
|
|
225
225
|
value: o,
|
|
226
|
-
onKeyUp:
|
|
226
|
+
onKeyUp: u,
|
|
227
227
|
onChange: (d) => l(d),
|
|
228
|
-
onClear:
|
|
228
|
+
onClear: c,
|
|
229
229
|
...i
|
|
230
230
|
}
|
|
231
231
|
);
|
|
232
|
-
},
|
|
232
|
+
}, ge = (a) => {
|
|
233
233
|
const { className: t, search: e } = a, s = e.render ?? me;
|
|
234
234
|
return Y(s, {
|
|
235
235
|
className: t,
|
|
@@ -237,16 +237,16 @@ const Gt = "flow--list--items--item--view", jt = "flow--list--items--item--view-
|
|
|
237
237
|
onChange: e.setValue.bind(e),
|
|
238
238
|
...e.textFieldProps
|
|
239
239
|
});
|
|
240
|
-
},
|
|
241
|
-
const { className: t } = a, e =
|
|
240
|
+
}, pe = (a) => {
|
|
241
|
+
const { className: t } = a, e = m();
|
|
242
242
|
if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
|
|
243
243
|
return null;
|
|
244
|
-
const s = e.filters.map((i) => /* @__PURE__ */ n.createElement(
|
|
245
|
-
return /* @__PURE__ */ n.createElement("div", { className:
|
|
246
|
-
},
|
|
247
|
-
list:
|
|
244
|
+
const s = e.filters.map((i) => /* @__PURE__ */ n.createElement(ne, { key: i.property, filter: i }));
|
|
245
|
+
return /* @__PURE__ */ n.createElement("div", { className: C(t, w.header) }, /* @__PURE__ */ n.createElement("div", { className: w.pickerListAndSearch }, /* @__PURE__ */ n.createElement("div", { className: w.pickerList }, /* @__PURE__ */ n.createElement(ae, null), s), e.search && /* @__PURE__ */ n.createElement(ge, { className: w.searchField, search: e.search })), /* @__PURE__ */ n.createElement(he, null));
|
|
246
|
+
}, fe = "flow--list", be = {
|
|
247
|
+
list: fe
|
|
248
248
|
};
|
|
249
|
-
let
|
|
249
|
+
let Se = class at {
|
|
250
250
|
constructor(t, e, s) {
|
|
251
251
|
r(this, "id");
|
|
252
252
|
r(this, "data");
|
|
@@ -257,16 +257,16 @@ let be = class at {
|
|
|
257
257
|
return new at(t, e.id, e.original);
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
|
-
class
|
|
260
|
+
class ve {
|
|
261
261
|
constructor(t) {
|
|
262
262
|
r(this, "list");
|
|
263
263
|
this.list = t;
|
|
264
264
|
}
|
|
265
265
|
get entries() {
|
|
266
|
-
return this.list.reactTable.table.getRowModel().rows.map((t) =>
|
|
266
|
+
return this.list.reactTable.table.getRowModel().rows.map((t) => Se.fromRow(this, t));
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
class
|
|
269
|
+
class ye {
|
|
270
270
|
constructor(t, e = {}) {
|
|
271
271
|
r(this, "batchSize");
|
|
272
272
|
r(this, "list");
|
|
@@ -313,7 +313,7 @@ class ve {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
const
|
|
316
|
+
const we = "$";
|
|
317
317
|
class j {
|
|
318
318
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
319
319
|
constructor(t, e) {
|
|
@@ -322,10 +322,10 @@ class j {
|
|
|
322
322
|
this.filter = t, this.value = e;
|
|
323
323
|
}
|
|
324
324
|
equals(t) {
|
|
325
|
-
return
|
|
325
|
+
return yt(this.value, t.value);
|
|
326
326
|
}
|
|
327
327
|
get id() {
|
|
328
|
-
return `${this.filter.property}@@${
|
|
328
|
+
return `${this.filter.property}@@${Nt(this.value)}`;
|
|
329
329
|
}
|
|
330
330
|
get isActive() {
|
|
331
331
|
return this.filter.isValueActive(this);
|
|
@@ -340,8 +340,8 @@ class j {
|
|
|
340
340
|
this.filter.deactivateValue(this);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
class
|
|
343
|
+
const Ee = (a, t) => a === t, Ce = (a) => String(a);
|
|
344
|
+
class Fe {
|
|
345
345
|
constructor(t, e) {
|
|
346
346
|
r(this, "_values");
|
|
347
347
|
r(this, "list");
|
|
@@ -352,14 +352,14 @@ class Ce {
|
|
|
352
352
|
r(this, "name");
|
|
353
353
|
r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
354
354
|
var s;
|
|
355
|
-
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((i) => new j(this, i)), this.matcher = e.matcher ??
|
|
355
|
+
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((i) => new j(this, i)), this.matcher = e.matcher ?? Ee, this.renderItem = e.renderItem ?? Ce, this.name = e.name;
|
|
356
356
|
}
|
|
357
357
|
updateTableColumnDef(t) {
|
|
358
358
|
t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
|
|
359
359
|
}
|
|
360
360
|
getReactTableFilterFn() {
|
|
361
361
|
return (t, e, s) => {
|
|
362
|
-
const i = this.property, o = i.startsWith(
|
|
362
|
+
const i = this.property, o = i.startsWith(we) ? t.original : Dt(t.original, i);
|
|
363
363
|
return this.checkFilterMatches(o, s);
|
|
364
364
|
};
|
|
365
365
|
}
|
|
@@ -387,7 +387,7 @@ class Ce {
|
|
|
387
387
|
return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
|
|
388
388
|
}
|
|
389
389
|
get values() {
|
|
390
|
-
return this._values === void 0 && (this._values =
|
|
390
|
+
return this._values === void 0 && (this._values = wt(
|
|
391
391
|
Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
|
|
392
392
|
).map((t) => new j(this, t))), this._values;
|
|
393
393
|
}
|
|
@@ -419,7 +419,7 @@ class Ce {
|
|
|
419
419
|
this.onFilterUpdateCallbacks.add(t);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
class
|
|
422
|
+
class Le {
|
|
423
423
|
constructor(t, e) {
|
|
424
424
|
r(this, "list");
|
|
425
425
|
r(this, "property");
|
|
@@ -453,27 +453,26 @@ class Fe {
|
|
|
453
453
|
return `${this.getTableColumn().id}:${this.direction}`;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
class
|
|
457
|
-
constructor(t, e = {}) {
|
|
456
|
+
class B {
|
|
457
|
+
constructor(t, e, s = {}) {
|
|
458
458
|
r(this, "list");
|
|
459
459
|
r(this, "table");
|
|
460
460
|
r(this, "sortingState");
|
|
461
461
|
r(this, "updateSortingState");
|
|
462
462
|
this.list = t;
|
|
463
|
-
const
|
|
464
|
-
(
|
|
465
|
-
), [
|
|
466
|
-
|
|
463
|
+
const i = this.list.sorting.filter(
|
|
464
|
+
(c) => c.defaultEnabled !== !1
|
|
465
|
+
), [o, l] = Q(
|
|
466
|
+
i.map((c) => c.getReactTableColumnSort())
|
|
467
467
|
);
|
|
468
|
-
this.sortingState =
|
|
468
|
+
this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(e, s);
|
|
469
469
|
}
|
|
470
|
-
static useNew(t, e = {}) {
|
|
471
|
-
return new
|
|
470
|
+
static useNew(t, e, s = {}) {
|
|
471
|
+
return new B(t, e, s);
|
|
472
472
|
}
|
|
473
|
-
useReactTable(t = {}) {
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
data: e,
|
|
473
|
+
useReactTable(t, e = {}) {
|
|
474
|
+
const s = this.list.loader.useData(), i = Vt({
|
|
475
|
+
data: s,
|
|
477
476
|
state: {
|
|
478
477
|
sorting: this.sortingState
|
|
479
478
|
},
|
|
@@ -483,17 +482,20 @@ class x {
|
|
|
483
482
|
}
|
|
484
483
|
},
|
|
485
484
|
columns: this.getTableColumnDefs(),
|
|
486
|
-
getCoreRowModel:
|
|
487
|
-
getSortedRowModel:
|
|
488
|
-
getFilteredRowModel:
|
|
489
|
-
getPaginationRowModel:
|
|
490
|
-
getFacetedUniqueValues:
|
|
491
|
-
onSortingChange: (
|
|
492
|
-
this.handleSortingStateUpdate(
|
|
485
|
+
getCoreRowModel: Rt(),
|
|
486
|
+
getSortedRowModel: Mt(),
|
|
487
|
+
getFilteredRowModel: zt(),
|
|
488
|
+
getPaginationRowModel: $t(),
|
|
489
|
+
getFacetedUniqueValues: Ut(),
|
|
490
|
+
onSortingChange: (o) => {
|
|
491
|
+
this.handleSortingStateUpdate(o);
|
|
493
492
|
},
|
|
494
493
|
globalFilterFn: "auto",
|
|
495
|
-
...
|
|
494
|
+
...e
|
|
496
495
|
});
|
|
496
|
+
return L(() => {
|
|
497
|
+
t && t(this.list);
|
|
498
|
+
}, [this.list, t, i]), i;
|
|
497
499
|
}
|
|
498
500
|
handleSortingStateUpdate(t) {
|
|
499
501
|
const e = typeof t == "function" ? t(this.sortingState) : t, s = this.list.sorting.filter(
|
|
@@ -528,12 +530,12 @@ class x {
|
|
|
528
530
|
), Array.from(t.values());
|
|
529
531
|
}
|
|
530
532
|
}
|
|
531
|
-
class
|
|
533
|
+
class P {
|
|
532
534
|
constructor() {
|
|
533
535
|
r(this, "dataBatches", []);
|
|
534
536
|
r(this, "prevDataBatches", []);
|
|
535
537
|
r(this, "batchLoadingStates", ["void"]);
|
|
536
|
-
|
|
538
|
+
xt(this, {
|
|
537
539
|
prevDataBatches: !1,
|
|
538
540
|
useMergedData: !1,
|
|
539
541
|
useIsLoading: !1,
|
|
@@ -547,7 +549,7 @@ class B {
|
|
|
547
549
|
});
|
|
548
550
|
}
|
|
549
551
|
static useNew() {
|
|
550
|
-
return
|
|
552
|
+
return bt(new P()).current;
|
|
551
553
|
}
|
|
552
554
|
reset() {
|
|
553
555
|
this.batchLoadingStates = [], this.dataBatches = [];
|
|
@@ -571,8 +573,8 @@ class B {
|
|
|
571
573
|
return H(() => this.isLoading);
|
|
572
574
|
}
|
|
573
575
|
}
|
|
574
|
-
const
|
|
575
|
-
class
|
|
576
|
+
const Te = [];
|
|
577
|
+
class D {
|
|
576
578
|
constructor(t, e = {}) {
|
|
577
579
|
r(this, "list");
|
|
578
580
|
r(this, "dataSource");
|
|
@@ -580,14 +582,14 @@ class P {
|
|
|
580
582
|
r(this, "manualFiltering");
|
|
581
583
|
r(this, "manualPagination");
|
|
582
584
|
r(this, "loaderState");
|
|
583
|
-
var
|
|
585
|
+
var c;
|
|
584
586
|
const { source: s } = e;
|
|
585
|
-
this.dataSource = s ?? { staticData:
|
|
587
|
+
this.dataSource = s ?? { staticData: Te };
|
|
586
588
|
const i = "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;
|
|
587
|
-
this.list = t, this.loaderState =
|
|
589
|
+
this.list = t, this.loaderState = P.useNew(), this.manualPagination = i ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((u) => u.onFilterUpdated(() => this.reset())), (c = this.list.search) == null || c.onUpdated(() => this.reset());
|
|
588
590
|
}
|
|
589
591
|
static useNew(t, e = {}) {
|
|
590
|
-
return new
|
|
592
|
+
return new D(t, e);
|
|
591
593
|
}
|
|
592
594
|
reset() {
|
|
593
595
|
this.loaderState.reset();
|
|
@@ -602,7 +604,7 @@ class P {
|
|
|
602
604
|
return this.loaderState.useMergedData();
|
|
603
605
|
}
|
|
604
606
|
getLoaderInvocationHooks() {
|
|
605
|
-
return
|
|
607
|
+
return Et(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
|
|
606
608
|
this.useLoadBatch(e);
|
|
607
609
|
});
|
|
608
610
|
}
|
|
@@ -613,7 +615,7 @@ class P {
|
|
|
613
615
|
}), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
|
|
614
616
|
}
|
|
615
617
|
useObserveBatchLoadingState(t, e) {
|
|
616
|
-
|
|
618
|
+
L(() => (this.loaderState.setBatchLoadingState(
|
|
617
619
|
e,
|
|
618
620
|
t.state.value
|
|
619
621
|
), t.state.observe((s) => {
|
|
@@ -625,7 +627,7 @@ class P {
|
|
|
625
627
|
const { data: o, itemTotalCount: l } = i;
|
|
626
628
|
this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
|
|
627
629
|
};
|
|
628
|
-
|
|
630
|
+
L(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((i) => {
|
|
629
631
|
i.isSet && s(i.value);
|
|
630
632
|
})), [t, e]);
|
|
631
633
|
}
|
|
@@ -671,7 +673,7 @@ class P {
|
|
|
671
673
|
throw new Error("Unknown data source");
|
|
672
674
|
}
|
|
673
675
|
}
|
|
674
|
-
class
|
|
676
|
+
class Ie {
|
|
675
677
|
constructor(t, e) {
|
|
676
678
|
r(this, "list");
|
|
677
679
|
r(this, "render");
|
|
@@ -685,8 +687,11 @@ class Te {
|
|
|
685
687
|
get isSet() {
|
|
686
688
|
return this.value !== void 0;
|
|
687
689
|
}
|
|
690
|
+
callOnUpdateCallbacks() {
|
|
691
|
+
this.onUpdateCallbacks.forEach((t) => t());
|
|
692
|
+
}
|
|
688
693
|
setValue(t) {
|
|
689
|
-
t === void 0 || t.trim() === "" ? this.list.reactTable.table.resetGlobalFilter() : this.list.reactTable.table.setGlobalFilter(t), this.
|
|
694
|
+
t === void 0 || t.trim() === "" ? this.list.reactTable.table.getState().globalFilter && (this.list.reactTable.table.resetGlobalFilter(), this.callOnUpdateCallbacks()) : (this.list.reactTable.table.setGlobalFilter(t), this.callOnUpdateCallbacks());
|
|
690
695
|
}
|
|
691
696
|
clear() {
|
|
692
697
|
this.setValue(void 0);
|
|
@@ -695,7 +700,7 @@ class Te {
|
|
|
695
700
|
this.onUpdateCallbacks.add(t);
|
|
696
701
|
}
|
|
697
702
|
}
|
|
698
|
-
const
|
|
703
|
+
const E = class E {
|
|
699
704
|
constructor(t, e = {}) {
|
|
700
705
|
r(this, "list");
|
|
701
706
|
r(this, "textValue");
|
|
@@ -703,15 +708,15 @@ const w = class w {
|
|
|
703
708
|
r(this, "onAction");
|
|
704
709
|
r(this, "fallback");
|
|
705
710
|
r(this, "renderFn");
|
|
706
|
-
const { onAction: s, fallback: i, textValue: o, href: l, renderFn:
|
|
707
|
-
this.list = t, this.textValue = o, this.renderFn =
|
|
711
|
+
const { onAction: s, fallback: i, textValue: o, href: l, renderFn: c } = e;
|
|
712
|
+
this.list = t, this.textValue = o, this.renderFn = c, this.href = l, this.onAction = s, this.fallback = i;
|
|
708
713
|
}
|
|
709
714
|
render(t) {
|
|
710
|
-
return (this.renderFn ??
|
|
715
|
+
return (this.renderFn ?? E.fallbackRenderItemFn)(t);
|
|
711
716
|
}
|
|
712
717
|
};
|
|
713
|
-
r(
|
|
714
|
-
let
|
|
718
|
+
r(E, "fallbackRenderItemFn", (t) => Y("pre", void 0, JSON.stringify(t)));
|
|
719
|
+
let I = E, ke = class nt {
|
|
715
720
|
constructor(t) {
|
|
716
721
|
r(this, "filters");
|
|
717
722
|
r(this, "itemView");
|
|
@@ -727,9 +732,10 @@ let T = w, Ie = class nt {
|
|
|
727
732
|
filters: s = [],
|
|
728
733
|
sorting: i = [],
|
|
729
734
|
batchesController: o,
|
|
730
|
-
hasAction: l
|
|
735
|
+
hasAction: l,
|
|
736
|
+
onChange: c
|
|
731
737
|
} = t;
|
|
732
|
-
this.items = new
|
|
738
|
+
this.items = new ve(this), this.filters = s.map((u) => new Fe(this, u)), this.sorting = i.map((u) => new Le(this, u)), this.search = t.search ? new Ie(this, t.search) : void 0, this.itemView = new I(this, e), this.batches = new ye(this, o), this.loader = D.useNew(this, t.loader), this.reactTable = B.useNew(this, c, {
|
|
733
739
|
manualFiltering: this.loader.manualFiltering,
|
|
734
740
|
manualPagination: this.loader.manualPagination,
|
|
735
741
|
manualSorting: this.loader.manualSorting
|
|
@@ -759,56 +765,56 @@ let T = w, Ie = class nt {
|
|
|
759
765
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
760
766
|
}
|
|
761
767
|
};
|
|
762
|
-
const
|
|
763
|
-
items:
|
|
764
|
-
isLoading:
|
|
765
|
-
},
|
|
766
|
-
item:
|
|
767
|
-
hasAction:
|
|
768
|
-
},
|
|
769
|
-
const { data: t, children: e } = a, s =
|
|
768
|
+
const Ae = "flow--list--items", xe = "flow--list--items--is-loading", W = {
|
|
769
|
+
items: Ae,
|
|
770
|
+
isLoading: xe
|
|
771
|
+
}, Be = "flow--list--items--item", Pe = "flow--list--items--item--has-action", k = {
|
|
772
|
+
item: Be,
|
|
773
|
+
hasAction: Pe
|
|
774
|
+
}, De = (a) => {
|
|
775
|
+
const { data: t, children: e } = a, s = m(), i = s.itemView, o = i.onAction, l = i.textValue ? i.textValue(t) : void 0, c = o ? () => o(t) : void 0, u = i.href ? i.href(t) : void 0, d = s.hasAction || !!c || !!u, b = C(k.item, d && k.hasAction);
|
|
770
776
|
return /* @__PURE__ */ n.createElement(
|
|
771
|
-
|
|
777
|
+
x.GridListItem,
|
|
772
778
|
{
|
|
773
|
-
className:
|
|
774
|
-
onAction:
|
|
779
|
+
className: b,
|
|
780
|
+
onAction: c,
|
|
775
781
|
textValue: l,
|
|
776
|
-
href:
|
|
782
|
+
href: u
|
|
777
783
|
},
|
|
778
784
|
e ?? i.render(t)
|
|
779
785
|
);
|
|
780
|
-
},
|
|
781
|
-
const a =
|
|
782
|
-
return /* @__PURE__ */ n.createElement(
|
|
783
|
-
},
|
|
784
|
-
skeletonText:
|
|
785
|
-
shimmer:
|
|
786
|
+
}, Ne = (a) => /* @__PURE__ */ n.createElement(x.GridListItem, { textValue: "-", className: k.item }, a.children), Ve = () => {
|
|
787
|
+
const a = v(g);
|
|
788
|
+
return /* @__PURE__ */ n.createElement(Ot, null, /* @__PURE__ */ n.createElement(qt, null), /* @__PURE__ */ n.createElement(et, null, a.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(f, null, a.format("list.noResult.text")));
|
|
789
|
+
}, Re = "flow--skeleton-text", Me = "flow--skeleton-text--shimmer", ze = {
|
|
790
|
+
skeletonText: Re,
|
|
791
|
+
shimmer: Me
|
|
786
792
|
}, J = (a) => {
|
|
787
793
|
const { width: t, style: e = {}, ...s } = a;
|
|
788
|
-
return /* @__PURE__ */ n.createElement("div", { "aria-hidden": !0, style: { width: t, ...e }, ...s }, /* @__PURE__ */ n.createElement("div", { className:
|
|
789
|
-
},
|
|
790
|
-
const t =
|
|
791
|
-
return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ n.createElement(
|
|
792
|
-
},
|
|
793
|
-
const { className: t, ...e } = a, s =
|
|
794
|
+
return /* @__PURE__ */ n.createElement("div", { "aria-hidden": !0, style: { width: t, ...e }, ...s }, /* @__PURE__ */ n.createElement("div", { className: ze.skeletonText }));
|
|
795
|
+
}, $e = () => /* @__PURE__ */ n.createElement(st, null, /* @__PURE__ */ n.createElement(et, null, /* @__PURE__ */ n.createElement(J, { width: "200px" })), /* @__PURE__ */ n.createElement(f, null, /* @__PURE__ */ n.createElement(J, { width: "300px" }))), Ue = () => {
|
|
796
|
+
const t = m().itemView.fallback ?? /* @__PURE__ */ n.createElement($e, null);
|
|
797
|
+
return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ n.createElement(Ne, { key: s }, St(t)));
|
|
798
|
+
}, Oe = (a) => {
|
|
799
|
+
const { className: t, ...e } = a, s = m(), i = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), c = s.items.entries.map((d) => /* @__PURE__ */ n.createElement(De, { key: d.id, data: d.data })), u = C(
|
|
794
800
|
W.items,
|
|
795
801
|
t,
|
|
796
802
|
i && W.isLoading
|
|
797
803
|
);
|
|
798
|
-
return l ? /* @__PURE__ */ n.createElement(
|
|
799
|
-
}, rt = (a) => null,
|
|
800
|
-
footer:
|
|
801
|
-
},
|
|
802
|
-
const t =
|
|
804
|
+
return l ? /* @__PURE__ */ n.createElement(Ve, null) : /* @__PURE__ */ n.createElement("div", { "aria-hidden": o, "aria-busy": i }, /* @__PURE__ */ n.createElement(x.GridList, { className: u, ...e }, o ? /* @__PURE__ */ n.createElement(Ue, null) : c));
|
|
805
|
+
}, rt = (a) => null, qe = () => rt, ot = (a) => null, He = () => ot, lt = (a) => null, Ke = () => lt, ct = (a) => null, Ge = () => ct, ut = (a) => null, je = () => ut, We = "flow--list--footer", Je = {
|
|
806
|
+
footer: We
|
|
807
|
+
}, Ye = (a) => {
|
|
808
|
+
const t = v(g), e = m(), s = e.batches, i = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), c = s.getVisibleItemsCount();
|
|
803
809
|
if (o)
|
|
804
810
|
return null;
|
|
805
|
-
const
|
|
806
|
-
visibleItemsCount:
|
|
811
|
+
const u = i ? /* @__PURE__ */ n.createElement(Gt, { width: "200px" }) : t.format("list.paginationInfo", {
|
|
812
|
+
visibleItemsCount: c,
|
|
807
813
|
totalItemsCount: l
|
|
808
814
|
});
|
|
809
|
-
return /* @__PURE__ */ n.createElement(f, { ...a },
|
|
810
|
-
},
|
|
811
|
-
const t =
|
|
815
|
+
return /* @__PURE__ */ n.createElement(f, { ...a }, u);
|
|
816
|
+
}, Qe = (a) => {
|
|
817
|
+
const t = v(g), e = m(), s = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading();
|
|
812
818
|
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ n.createElement(
|
|
813
819
|
p,
|
|
814
820
|
{
|
|
@@ -821,44 +827,45 @@ const ke = "flow--list--items", Ae = "flow--list--items--is-loading", W = {
|
|
|
821
827
|
},
|
|
822
828
|
t.format("list.showMore")
|
|
823
829
|
);
|
|
824
|
-
},
|
|
830
|
+
}, Xe = () => /* @__PURE__ */ n.createElement("div", { className: Je.footer }, /* @__PURE__ */ n.createElement(Ye, null), /* @__PURE__ */ n.createElement(Qe, null));
|
|
825
831
|
function dt(a) {
|
|
826
832
|
return null;
|
|
827
833
|
}
|
|
828
|
-
const
|
|
829
|
-
var
|
|
830
|
-
const { children: t, batchSize: e,
|
|
834
|
+
const Ze = () => dt, _e = It("List", (a) => {
|
|
835
|
+
var N, V, R, M, z;
|
|
836
|
+
const { children: t, batchSize: e, onChange: s, ...i } = a, o = (N = S(
|
|
831
837
|
t,
|
|
832
838
|
rt
|
|
833
|
-
)) == null ? void 0 :
|
|
839
|
+
)) == null ? void 0 : N.props, l = (V = S(
|
|
834
840
|
t,
|
|
835
|
-
|
|
836
|
-
)) == null ? void 0 :
|
|
837
|
-
source:
|
|
838
|
-
...i,
|
|
839
|
-
asyncLoader: i.children
|
|
840
|
-
} : o ? {
|
|
841
|
+
Ht
|
|
842
|
+
)) == null ? void 0 : V.props, c = (R = S(t, ut)) == null ? void 0 : R.props, u = {
|
|
843
|
+
source: o ? {
|
|
841
844
|
...o,
|
|
842
|
-
|
|
845
|
+
asyncLoader: o.children
|
|
843
846
|
} : l ? {
|
|
844
|
-
|
|
847
|
+
...l,
|
|
848
|
+
asyncResourceFactory: l.children
|
|
849
|
+
} : c ? {
|
|
850
|
+
staticData: c.data
|
|
845
851
|
} : void 0
|
|
846
|
-
},
|
|
852
|
+
}, d = (M = S(t, dt)) == null ? void 0 : M.props, b = (z = S(t, ct)) == null ? void 0 : z.props, ht = ke.useNew({
|
|
853
|
+
onChange: s,
|
|
847
854
|
loader: u,
|
|
848
855
|
filters: K(t, ot).map(
|
|
849
|
-
(
|
|
850
|
-
...
|
|
851
|
-
renderItem:
|
|
856
|
+
(y) => ({
|
|
857
|
+
...y.props,
|
|
858
|
+
renderItem: y.props.children
|
|
852
859
|
})
|
|
853
860
|
),
|
|
854
|
-
search:
|
|
855
|
-
render:
|
|
856
|
-
textFieldProps:
|
|
861
|
+
search: d ? {
|
|
862
|
+
render: d.children,
|
|
863
|
+
textFieldProps: d
|
|
857
864
|
} : void 0,
|
|
858
|
-
sorting: K(t, lt).map((
|
|
859
|
-
itemView:
|
|
860
|
-
...
|
|
861
|
-
renderFn:
|
|
865
|
+
sorting: K(t, lt).map((y) => y.props),
|
|
866
|
+
itemView: b ? {
|
|
867
|
+
...b,
|
|
868
|
+
renderFn: b.children
|
|
862
869
|
} : void 0,
|
|
863
870
|
batchesController: {
|
|
864
871
|
batchSize: e
|
|
@@ -869,36 +876,37 @@ const Xe = () => dt, Ze = Tt("List", (a) => {
|
|
|
869
876
|
it.Provider,
|
|
870
877
|
{
|
|
871
878
|
value: {
|
|
872
|
-
list:
|
|
879
|
+
list: ht
|
|
873
880
|
}
|
|
874
881
|
},
|
|
875
|
-
/* @__PURE__ */ n.createElement(
|
|
876
|
-
/* @__PURE__ */ n.createElement("div", { className:
|
|
882
|
+
/* @__PURE__ */ n.createElement(se, null),
|
|
883
|
+
/* @__PURE__ */ n.createElement("div", { className: be.list }, /* @__PURE__ */ n.createElement(pe, null), /* @__PURE__ */ n.createElement(Oe, { ...i }), /* @__PURE__ */ n.createElement(Xe, null))
|
|
877
884
|
);
|
|
878
|
-
}),
|
|
879
|
-
List:
|
|
880
|
-
Filter:
|
|
881
|
-
Search:
|
|
882
|
-
Sorting:
|
|
883
|
-
Item:
|
|
885
|
+
}), ts = () => _e, $s = () => ({
|
|
886
|
+
List: ts(),
|
|
887
|
+
Filter: He(),
|
|
888
|
+
Search: Ze(),
|
|
889
|
+
Sorting: Ke(),
|
|
890
|
+
Item: Ge(),
|
|
884
891
|
ItemView: st,
|
|
885
|
-
StaticData:
|
|
886
|
-
LoaderAsync:
|
|
887
|
-
LoaderAsyncResource:
|
|
892
|
+
StaticData: je(),
|
|
893
|
+
LoaderAsync: qe(),
|
|
894
|
+
LoaderAsyncResource: Kt()
|
|
888
895
|
});
|
|
889
896
|
export {
|
|
890
|
-
|
|
897
|
+
_e as List,
|
|
891
898
|
ot as ListFilter,
|
|
892
899
|
ct as ListItem,
|
|
893
900
|
st as ListItemView,
|
|
894
901
|
rt as ListLoaderAsync,
|
|
895
902
|
lt as ListSorting,
|
|
896
903
|
ut as ListStaticData,
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
+
ts as TypedList,
|
|
905
|
+
He as TypedListFilter,
|
|
906
|
+
Ge as TypedListItem,
|
|
907
|
+
qe as TypedListLoaderAsync,
|
|
908
|
+
Ke as TypedListSorting,
|
|
909
|
+
je as TypedListStaticData,
|
|
910
|
+
$s as typedList,
|
|
911
|
+
m as useList
|
|
904
912
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { PropsWithChildren, default as React } from 'react';
|
|
2
2
|
import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
|
|
3
3
|
import { ItemListProps } from './components/Items/Items';
|
|
4
|
+
import { OnListChanged } from './model/types';
|
|
4
5
|
|
|
5
|
-
export interface ListProps extends PropsWithChildren, ItemListProps, FlowComponentProps {
|
|
6
|
+
export interface ListProps<T> extends PropsWithChildren, ItemListProps, FlowComponentProps {
|
|
6
7
|
batchSize?: number;
|
|
8
|
+
onChange?: OnListChanged<T>;
|
|
7
9
|
}
|
|
8
|
-
export declare const List: React.ForwardRefExoticComponent<ListProps & React.RefAttributes<never>>;
|
|
10
|
+
export declare const List: React.ForwardRefExoticComponent<ListProps<never> & React.RefAttributes<never>>;
|
|
9
11
|
export default List;
|
|
@@ -17,7 +17,7 @@ export declare class List<T> {
|
|
|
17
17
|
readonly reactTable: ReactTable<T>;
|
|
18
18
|
readonly batches: BatchesController<T>;
|
|
19
19
|
readonly loader: IncrementalLoader<T>;
|
|
20
|
-
readonly hasAction
|
|
20
|
+
readonly hasAction?: boolean;
|
|
21
21
|
private constructor();
|
|
22
22
|
static useNew<T>(shape: ListShape<T>): List<T>;
|
|
23
23
|
get isFiltered(): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Column, ColumnSort, Table, TableOptions } from '@tanstack/react-table';
|
|
2
2
|
import { default as List } from './List';
|
|
3
|
-
import { PropertyName } from './types';
|
|
3
|
+
import { OnListChanged, PropertyName } from './types';
|
|
4
4
|
import { SearchValue } from './search/types';
|
|
5
5
|
import { Dispatch, SetStateAction } from 'react';
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ export declare class ReactTable<T> {
|
|
|
10
10
|
readonly sortingState: ColumnSort[];
|
|
11
11
|
readonly updateSortingState: Dispatch<SetStateAction<ColumnSort[]>>;
|
|
12
12
|
private constructor();
|
|
13
|
-
static useNew<T>(list: List<T>, tableOptions?: Partial<TableOptions<T>>): ReactTable<T>;
|
|
13
|
+
static useNew<T>(list: List<T>, onChange?: OnListChanged<T>, tableOptions?: Partial<TableOptions<T>>): ReactTable<T>;
|
|
14
14
|
private useReactTable;
|
|
15
15
|
private handleSortingStateUpdate;
|
|
16
16
|
get searchString(): SearchValue;
|
|
@@ -9,6 +9,7 @@ export declare class Search<T> {
|
|
|
9
9
|
constructor(list: List<T>, searchShape: SearchShape<T>);
|
|
10
10
|
get value(): SearchValue;
|
|
11
11
|
get isSet(): boolean;
|
|
12
|
+
private callOnUpdateCallbacks;
|
|
12
13
|
setValue(value: SearchValue): void;
|
|
13
14
|
clear(): void;
|
|
14
15
|
onUpdated(cb: () => unknown): void;
|
|
@@ -7,12 +7,14 @@ import { SearchShape } from './search/types';
|
|
|
7
7
|
import { ItemViewShape } from './item/ItemView';
|
|
8
8
|
import { ReactNode } from 'react';
|
|
9
9
|
import { ItemType } from '../../../lib/types/array';
|
|
10
|
+
import { default as List } from './List';
|
|
10
11
|
|
|
11
12
|
export declare const customPropertyPrefix: "$";
|
|
12
13
|
export type CustomPropertyName = `${typeof customPropertyPrefix}${string}`;
|
|
13
14
|
export type PropertyName<T> = DeepKeys<T> | CustomPropertyName;
|
|
14
15
|
export type PropertyValue<T, TProp> = TProp extends CustomPropertyName ? T : DeepValue<T, TProp>;
|
|
15
16
|
export type PropertyValueRenderMethod<TMatcherValue> = (prop: NonNullable<ItemType<TMatcherValue>>) => ReactNode;
|
|
17
|
+
export type OnListChanged<T> = (list: List<T>) => void;
|
|
16
18
|
export interface ListShape<T> {
|
|
17
19
|
loader?: IncrementalLoaderShape<T>;
|
|
18
20
|
filters?: FilterShape<T, never, never>[];
|
|
@@ -20,6 +22,7 @@ export interface ListShape<T> {
|
|
|
20
22
|
search?: SearchShape<T>;
|
|
21
23
|
sorting?: SortingShape<T>[];
|
|
22
24
|
batchesController?: BatchesControllerShape;
|
|
23
|
-
hasAction
|
|
25
|
+
hasAction?: boolean;
|
|
26
|
+
onChange?: OnListChanged<T>;
|
|
24
27
|
}
|
|
25
28
|
export type PropertyRecord<T, TValue> = Partial<Record<PropertyName<T>, TValue>>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { ListProps } from './List';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare const TypedList: <T>() => ComponentType<ListProps<T>>;
|
|
1
5
|
export declare const typedList: <T>() => {
|
|
2
|
-
List:
|
|
6
|
+
List: ComponentType<ListProps<T>>;
|
|
3
7
|
Filter: <const TProp extends import('./model/types').PropertyName<T>, TMatcherValue = import('./model/types').PropertyValue<T, TProp>>(props: Omit<import('./model/filter/types').FilterShape<T, TProp, TMatcherValue>, "type" | "renderItem"> & {
|
|
4
8
|
children?: import('./model/types').PropertyValueRenderMethod<TMatcherValue> | undefined;
|
|
5
9
|
}) => import('react').ReactNode;
|
|
6
|
-
Search:
|
|
10
|
+
Search: ComponentType<Omit<import('./model/search/types').SearchShape<T>, "render" | "textFieldProps"> & {
|
|
7
11
|
children?: import('./model/search/types').SearchFieldRenderComponent;
|
|
8
12
|
} & {
|
|
9
13
|
className?: string | ((values: import('react-aria-components').SearchFieldRenderProps & {
|
|
@@ -11,20 +15,20 @@ export declare const typedList: <T>() => {
|
|
|
11
15
|
}) => string) | undefined;
|
|
12
16
|
autoFocus?: boolean | undefined;
|
|
13
17
|
}>;
|
|
14
|
-
Sorting:
|
|
15
|
-
Item:
|
|
18
|
+
Sorting: ComponentType<import('./model/sorting/types').SortingShape<T>>;
|
|
19
|
+
Item: ComponentType<Omit<import('./model/item/ItemView').ItemViewShape<T>, "renderFn"> & {
|
|
16
20
|
children: import('.').RenderItemFn<T>;
|
|
17
21
|
}>;
|
|
18
22
|
ItemView: (props: {
|
|
19
23
|
children?: import('react').ReactNode | undefined;
|
|
20
24
|
} & import('../../lib/types/props').PropsWithClassName & import('../../lib/types/props').PropsWithContainerBreakpointSize) => import("react").JSX.Element;
|
|
21
|
-
StaticData:
|
|
25
|
+
StaticData: ComponentType<{
|
|
22
26
|
data: readonly T[];
|
|
23
27
|
}>;
|
|
24
|
-
LoaderAsync:
|
|
28
|
+
LoaderAsync: ComponentType<Omit<import('./model/loading/types').AsyncDataLoaderShape<T>, "asyncLoader"> & {
|
|
25
29
|
children: import('./model/loading/types').AsyncDataLoader<T>;
|
|
26
30
|
}>;
|
|
27
|
-
LoaderAsyncResource:
|
|
31
|
+
LoaderAsyncResource: ComponentType<Omit<import('./model/loading/types').AsyncResourceFactoryDataLoaderShape<T>, "asyncResourceFactory"> & {
|
|
28
32
|
children: (options?: import('./model/loading/types').DataLoaderOptions<T> | undefined) => import('@mittwald/react-use-promise').AsyncResource<import('./model/loading/types').DataLoaderResult<T>>;
|
|
29
33
|
}>;
|
|
30
34
|
};
|
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.204",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
"dependencies": {
|
|
285
285
|
"@chakra-ui/live-region": "^2.1.0",
|
|
286
286
|
"@internationalized/string-compiler": "^3.2.4",
|
|
287
|
-
"@mittwald/react-tunnel": "^0.1.0-alpha.
|
|
287
|
+
"@mittwald/react-tunnel": "^0.1.0-alpha.204",
|
|
288
288
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
289
289
|
"@react-aria/utils": "^3.25.1",
|
|
290
290
|
"@react-types/shared": "^3.24.1",
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
},
|
|
311
311
|
"devDependencies": {
|
|
312
312
|
"@faker-js/faker": "^8.4.1",
|
|
313
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
313
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.204",
|
|
314
314
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
315
315
|
"@nx/storybook": "^19.5.6",
|
|
316
316
|
"@storybook/addon-a11y": "^8.2.7",
|
|
@@ -388,5 +388,5 @@
|
|
|
388
388
|
"optional": true
|
|
389
389
|
}
|
|
390
390
|
},
|
|
391
|
-
"gitHead": "
|
|
391
|
+
"gitHead": "3d8e2516a876b466d461cc20b9ef923688d3d9e4"
|
|
392
392
|
}
|