@mittwald/flow-react-components 0.1.0-alpha.209 → 0.1.0-alpha.210
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/IconSettings-CisOFpPV.js +9 -0
- package/dist/Icons.js +100 -99
- package/dist/List.js +504 -337
- package/dist/Section-DTR9rFAc.js +55 -0
- package/dist/Section.js +3 -52
- package/dist/Table.js +9 -36
- package/dist/TableRow-BAVeHa5X.js +39 -0
- package/dist/styles.css +1 -1
- package/dist/types/components/List/components/Header/components/SettingsMenu/SettingsMenu.d.ts +3 -0
- package/dist/types/components/List/components/Items/components/Item/Item.d.ts +1 -1
- package/dist/types/components/List/components/Table/Table.d.ts +3 -0
- package/dist/types/components/List/components/Table/components/TableLoadingView.d.ts +4 -0
- package/dist/types/components/List/components/Table/index.d.ts +1 -0
- package/dist/types/components/List/model/List.d.ts +7 -3
- package/dist/types/components/List/model/table/Table.d.ts +12 -0
- package/dist/types/components/List/model/table/TableBody.d.ts +10 -0
- package/dist/types/components/List/model/table/TableCell.d.ts +9 -0
- package/dist/types/components/List/model/table/TableColumn.d.ts +8 -0
- package/dist/types/components/List/model/table/TableHeader.d.ts +10 -0
- package/dist/types/components/List/model/table/TableRow.d.ts +11 -0
- package/dist/types/components/List/model/table/types.d.ts +35 -0
- package/dist/types/components/List/model/types.d.ts +3 -0
- package/dist/types/components/List/setupComponents/Table.d.ts +7 -0
- package/dist/types/components/List/setupComponents/TableBody.d.ts +7 -0
- package/dist/types/components/List/setupComponents/TableCell.d.ts +9 -0
- package/dist/types/components/List/setupComponents/TableColumn.d.ts +7 -0
- package/dist/types/components/List/setupComponents/TableHeader.d.ts +7 -0
- package/dist/types/components/List/setupComponents/TableRow.d.ts +7 -0
- package/dist/types/components/List/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/List/typedList.d.ts +60 -0
- package/package.json +4 -4
- /package/dist/types/components/List/components/{Items/components/EmptyView → EmptyView}/EmptyView.d.ts +0 -0
package/dist/List.js
CHANGED
|
@@ -1,68 +1,76 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import
|
|
3
|
+
var zt = Object.defineProperty;
|
|
4
|
+
var Ut = (i, t, e) => t in i ? zt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
5
|
+
var r = (i, t, e) => Ut(i, typeof t != "symbol" ? t + "" : t, e);
|
|
6
|
+
import n, { createContext as Ot, useContext as Ht, createElement as rt, useState as ot, useEffect as F, useRef as lt, cloneElement as qt } from "react";
|
|
7
7
|
import "./propsContext-DzAKlmhS.js";
|
|
8
|
-
import { P as
|
|
8
|
+
import { P as Kt } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
|
-
import { isShallowEqual as
|
|
11
|
-
import { d as
|
|
12
|
-
import { B as
|
|
10
|
+
import { isShallowEqual as Gt, unique as jt, times as _t } from "remeda";
|
|
11
|
+
import { d as Wt } from "./dynamic-ClpUSmEt.js";
|
|
12
|
+
import { B as S } from "./Button-DQtavSbo.js";
|
|
13
13
|
import "@tabler/icons-react";
|
|
14
14
|
import "./Icon-DPoIVASu.js";
|
|
15
|
-
import { I as
|
|
16
|
-
import { a as A, C as
|
|
17
|
-
import { M as
|
|
15
|
+
import { I as Jt } from "./IconContextMenu-jwoVcLvd.js";
|
|
16
|
+
import { a as A, C as x } from "./ContextMenuTrigger-DOCNHDwJ.js";
|
|
17
|
+
import { M as R } from "./MenuItem-DcfYvfPJ.js";
|
|
18
18
|
import { useLocalizedStringFormatter as v } from "react-aria";
|
|
19
|
-
import { TunnelProvider as
|
|
20
|
-
import
|
|
21
|
-
import { g as
|
|
22
|
-
import { f as
|
|
23
|
-
import { R as
|
|
24
|
-
import { T as
|
|
25
|
-
import { I as
|
|
26
|
-
import { I as
|
|
27
|
-
import { makeObservable as
|
|
19
|
+
import { TunnelProvider as Yt, TunnelExit as X } from "@mittwald/react-tunnel";
|
|
20
|
+
import w from "clsx";
|
|
21
|
+
import { g as Qt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
|
|
22
|
+
import { f as Xt } from "./flowComponent-DHPUcYyM.js";
|
|
23
|
+
import { R as Zt } from "./Render-BdlTa7Qb.js";
|
|
24
|
+
import { T as y } from "./Text-Sd5q3Yme.js";
|
|
25
|
+
import { I as ct } from "./IconChevronDown--OxZLX8L.js";
|
|
26
|
+
import { I as te } from "./IconClose-BFwPT_IX.js";
|
|
27
|
+
import { makeObservable as ee, observable as Z, computed as tt, action as V, makeAutoObservable as se } from "mobx";
|
|
28
28
|
import "./context-Cf7tqFtF.js";
|
|
29
|
-
import { u as
|
|
30
|
-
import { S as
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import { S as
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
import { u as ae } from "./useOnChange-C1Quwyuz.js";
|
|
30
|
+
import { S as ie } from "./SearchField-DstUFmq4.js";
|
|
31
|
+
import { H as D } from "./Heading-BEC6iPfF.js";
|
|
32
|
+
import { S as ne } from "./Section-DTR9rFAc.js";
|
|
33
|
+
import { I as re } from "./IconSettings-CisOFpPV.js";
|
|
34
|
+
import { getProperty as oe } from "dot-prop";
|
|
35
|
+
import { observer as ut } from "mobx-react-lite";
|
|
36
|
+
import { hash as le } from "object-code";
|
|
37
|
+
import { useReactTable as ce, getCoreRowModel as ue, getSortedRowModel as me, getFilteredRowModel as de, getPaginationRowModel as he, getFacetedUniqueValues as pe } from "@tanstack/react-table";
|
|
38
|
+
import mt from "invariant";
|
|
39
|
+
import { getAsyncResource as et } from "@mittwald/react-use-promise";
|
|
40
|
+
import { u as st } from "./useSelector-DpU7_HMO.js";
|
|
41
|
+
import * as $ from "react-aria-components";
|
|
42
|
+
import { I as ge } from "./IllustratedMessage-B3MHD01M.js";
|
|
43
|
+
import { I as be } from "./IconSearch-C7VQTAqK.js";
|
|
44
|
+
import { S as L } from "./SkeletonText-B5ZghZhO.js";
|
|
45
|
+
import { d as b, a as E } from "./deepFindOfType-6pG0fH7S.js";
|
|
46
|
+
import { ListLoaderAsyncResource as fe, TypedListLoaderAsyncResource as Se } from "./List/ListLoaderAsyncResource.js";
|
|
47
|
+
import { S as we } from "./Skeleton-CKLaTmDR.js";
|
|
48
|
+
import { T as dt, d as ht, c as pt, a as gt, e as bt, b as ft } from "./TableRow-BAVeHa5X.js";
|
|
49
|
+
const ve = "flow--list--items--item--view", ye = "flow--list--items--item--view--title", Ee = "flow--list--items--item--view--top-content", Te = "flow--list--items--item--view--content", Ce = "flow--list--items--item--view--action", Fe = "flow--list--items--item--view--avatar", Le = "flow--list--items--item--view--text", Ie = "flow--list--items--item--view--heading", d = {
|
|
50
|
+
view: ve,
|
|
51
|
+
title: ye,
|
|
52
|
+
topContent: Ee,
|
|
53
|
+
content: Te,
|
|
54
|
+
action: Ce,
|
|
55
|
+
avatar: Fe,
|
|
56
|
+
text: Le,
|
|
57
|
+
heading: Ie,
|
|
54
58
|
"container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
|
|
55
59
|
"container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
|
|
56
60
|
"container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
|
|
57
61
|
"container-breakpoint-size-l": "flow--list--items--item--view--container-breakpoint-size-l",
|
|
58
62
|
"container-breakpoint-size-xl": "flow--list--items--item--view--container-breakpoint-size-xl"
|
|
59
|
-
},
|
|
63
|
+
}, f = { "de-DE": {
|
|
60
64
|
"list.noResult.heading": "Keine Suchergebnisse gefunden",
|
|
61
65
|
"list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
|
|
62
66
|
"list.options": "Optionen",
|
|
63
67
|
"list.paginationInfo": (i) => `${i.visibleItemsCount} von insgesamt ${i.totalItemsCount} angezeigt`,
|
|
64
68
|
"list.resetAll": "Alles zurücksetzen",
|
|
65
69
|
"list.setSorting": (i) => `Sortierung: ${i.property}`,
|
|
70
|
+
"list.settings": "Einstellungen",
|
|
71
|
+
"list.settings.viewMode": "Ansicht",
|
|
72
|
+
"list.settings.viewMode.list": "Liste",
|
|
73
|
+
"list.settings.viewMode.table": "Tabelle",
|
|
66
74
|
"list.showMore": "Mehr anzeigen",
|
|
67
75
|
"list.sorting": "Sortierung"
|
|
68
76
|
}, "en-EN": {
|
|
@@ -72,23 +80,27 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
72
80
|
"list.paginationInfo": (i) => `Showing ${i.visibleItemsCount} of ${i.totalItemsCount}`,
|
|
73
81
|
"list.resetAll": "Reset filters",
|
|
74
82
|
"list.setSorting": (i) => `Sorting: ${i.property}`,
|
|
83
|
+
"list.settings": "Settings",
|
|
84
|
+
"list.settings.viewMode": "View",
|
|
85
|
+
"list.settings.viewMode.list": "List",
|
|
86
|
+
"list.settings.viewMode.table": "Table",
|
|
75
87
|
"list.showMore": "Show more",
|
|
76
88
|
"list.sorting": "Sorting"
|
|
77
|
-
} },
|
|
78
|
-
const { className: t, children: e } = i, s = v(
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
89
|
+
} }, Ae = (i) => {
|
|
90
|
+
const { className: t, children: e } = i, s = v(f);
|
|
91
|
+
return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(
|
|
92
|
+
S,
|
|
81
93
|
{
|
|
82
94
|
variant: "plain",
|
|
83
95
|
className: t,
|
|
84
96
|
"aria-label": s.format("list.options")
|
|
85
97
|
},
|
|
86
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ n.createElement(Jt, null)
|
|
87
99
|
), e);
|
|
88
|
-
},
|
|
100
|
+
}, Pe = (i) => i === "top" ? d.topContent : i === "bottom" ? d.content : d.topContent, St = (i) => {
|
|
89
101
|
const { children: t, className: e, containerBreakpointSize: s = "m" } = i, a = {
|
|
90
102
|
ContextMenu: {
|
|
91
|
-
wrapWith: /* @__PURE__ */
|
|
103
|
+
wrapWith: /* @__PURE__ */ n.createElement(Ae, { className: d.action }),
|
|
92
104
|
placement: "bottom end"
|
|
93
105
|
},
|
|
94
106
|
Button: {
|
|
@@ -99,7 +111,7 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
99
111
|
ignoreBreakpoint: !0
|
|
100
112
|
},
|
|
101
113
|
Content: {
|
|
102
|
-
className:
|
|
114
|
+
className: Wt((l) => Pe(l.slot)),
|
|
103
115
|
tunnelId: "topContent"
|
|
104
116
|
},
|
|
105
117
|
Avatar: {
|
|
@@ -118,36 +130,36 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
118
130
|
Link: {
|
|
119
131
|
unstyled: !0
|
|
120
132
|
}
|
|
121
|
-
}, o =
|
|
133
|
+
}, o = w(
|
|
122
134
|
d.view,
|
|
123
135
|
e,
|
|
124
|
-
d[
|
|
136
|
+
d[Qt(s)]
|
|
125
137
|
);
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
-
},
|
|
138
|
+
return /* @__PURE__ */ n.createElement("div", { className: o }, /* @__PURE__ */ n.createElement(Kt, { props: a }, /* @__PURE__ */ n.createElement(Yt, null, t, /* @__PURE__ */ n.createElement("div", { className: d.title }, /* @__PURE__ */ n.createElement(X, { id: "title" })), /* @__PURE__ */ n.createElement(X, { id: "topContent" }))));
|
|
139
|
+
}, wt = Ot({}), h = () => Ht(wt).list, ke = () => h().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ n.createElement(Zt, { key: e }, () => {
|
|
128
140
|
t();
|
|
129
|
-
})),
|
|
141
|
+
})), Ve = (i) => {
|
|
130
142
|
const { sorting: t } = i;
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
},
|
|
143
|
+
return /* @__PURE__ */ n.createElement(R, { id: t.id }, t.name);
|
|
144
|
+
}, B = (i) => {
|
|
133
145
|
const { children: t, locales: e, variables: s } = i;
|
|
134
146
|
return v(e).format(t, s);
|
|
135
|
-
},
|
|
136
|
-
const i =
|
|
147
|
+
}, Be = () => {
|
|
148
|
+
const i = h(), t = i.visibleSorting.map((a) => /* @__PURE__ */ n.createElement(Ve, { sorting: a, key: a.id }));
|
|
137
149
|
if (t.length === 0)
|
|
138
150
|
return null;
|
|
139
|
-
const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */
|
|
140
|
-
|
|
151
|
+
const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ n.createElement(y, null, e ? /* @__PURE__ */ n.createElement(
|
|
152
|
+
B,
|
|
141
153
|
{
|
|
142
|
-
locales:
|
|
154
|
+
locales: f,
|
|
143
155
|
variables: {
|
|
144
156
|
property: e.name ?? e.property
|
|
145
157
|
}
|
|
146
158
|
},
|
|
147
159
|
"list.setSorting"
|
|
148
|
-
) : /* @__PURE__ */
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
|
|
160
|
+
) : /* @__PURE__ */ n.createElement(B, { locales: f }, "list.sorting"));
|
|
161
|
+
return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(S, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ n.createElement(ct, null)), /* @__PURE__ */ n.createElement(
|
|
162
|
+
x,
|
|
151
163
|
{
|
|
152
164
|
selectionMode: "single",
|
|
153
165
|
selectedKeys: e ? [e.id] : [],
|
|
@@ -157,9 +169,9 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
157
169
|
},
|
|
158
170
|
t
|
|
159
171
|
));
|
|
160
|
-
},
|
|
161
|
-
const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */
|
|
162
|
-
|
|
172
|
+
}, Me = (i) => {
|
|
173
|
+
const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */ n.createElement(
|
|
174
|
+
R,
|
|
163
175
|
{
|
|
164
176
|
id: c.id,
|
|
165
177
|
key: c.id,
|
|
@@ -169,108 +181,129 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
169
181
|
},
|
|
170
182
|
c.render()
|
|
171
183
|
)), u = e.filter((c) => c.isActive).map((c) => c.id);
|
|
172
|
-
return /* @__PURE__ */
|
|
173
|
-
|
|
184
|
+
return /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(S, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ n.createElement(y, null, a ?? o), /* @__PURE__ */ n.createElement(ct, null)), /* @__PURE__ */ n.createElement(
|
|
185
|
+
x,
|
|
174
186
|
{
|
|
175
187
|
selectionMode: s === "one" ? "single" : "multiple",
|
|
176
188
|
selectedKeys: u
|
|
177
189
|
},
|
|
178
190
|
l
|
|
179
191
|
));
|
|
180
|
-
},
|
|
181
|
-
header:
|
|
182
|
-
pickerListAndSearch:
|
|
183
|
-
pickerList:
|
|
184
|
-
searchField:
|
|
185
|
-
},
|
|
186
|
-
activeFilters:
|
|
187
|
-
clearButton:
|
|
188
|
-
},
|
|
189
|
-
const i =
|
|
190
|
-
(e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */
|
|
191
|
-
|
|
192
|
+
}, Ne = "flow--list--header", xe = "flow--list--header--picker-list-and-search", Re = "flow--list--header--picker-list", De = "flow--list--header--search-field", T = {
|
|
193
|
+
header: Ne,
|
|
194
|
+
pickerListAndSearch: xe,
|
|
195
|
+
pickerList: Re,
|
|
196
|
+
searchField: De
|
|
197
|
+
}, $e = "flow--list--header--active-filters", ze = "flow--list--header--active-filters--clear-button", at = {
|
|
198
|
+
activeFilters: $e,
|
|
199
|
+
clearButton: ze
|
|
200
|
+
}, Ue = () => {
|
|
201
|
+
const i = h(), t = i.filters.flatMap(
|
|
202
|
+
(e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ n.createElement(
|
|
203
|
+
S,
|
|
192
204
|
{
|
|
193
205
|
variant: "soft",
|
|
194
206
|
size: "s",
|
|
195
207
|
key: s.id,
|
|
196
208
|
onPress: () => s.deactivate()
|
|
197
209
|
},
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ n.createElement(y, null, s.render()),
|
|
211
|
+
/* @__PURE__ */ n.createElement(te, null)
|
|
200
212
|
))
|
|
201
213
|
);
|
|
202
|
-
return t.length <= 0 ? null : /* @__PURE__ */
|
|
203
|
-
|
|
214
|
+
return t.length <= 0 ? null : /* @__PURE__ */ n.createElement("div", { className: at.activeFilters }, t, /* @__PURE__ */ n.createElement(
|
|
215
|
+
S,
|
|
204
216
|
{
|
|
205
|
-
className:
|
|
217
|
+
className: at.clearButton,
|
|
206
218
|
size: "s",
|
|
207
219
|
variant: "plain",
|
|
208
220
|
onPress: () => i.clearFilters()
|
|
209
221
|
},
|
|
210
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ n.createElement(B, { locales: f }, "list.resetAll")
|
|
211
223
|
));
|
|
212
|
-
},
|
|
213
|
-
const { className: t, onChange: e, value: s, ...a } = i, [o, l] =
|
|
214
|
-
|
|
224
|
+
}, Oe = (i) => {
|
|
225
|
+
const { className: t, onChange: e, value: s, ...a } = i, [o, l] = ot(s ?? "");
|
|
226
|
+
ae(s, () => {
|
|
215
227
|
l(s ?? "");
|
|
216
228
|
}, [o]);
|
|
217
229
|
const u = () => {
|
|
218
230
|
e(void 0), l("");
|
|
219
|
-
}, c = (
|
|
220
|
-
|
|
231
|
+
}, c = (m) => {
|
|
232
|
+
m.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : m.key === "Escape" && u();
|
|
221
233
|
};
|
|
222
|
-
return /* @__PURE__ */
|
|
223
|
-
|
|
234
|
+
return /* @__PURE__ */ n.createElement(
|
|
235
|
+
ie,
|
|
224
236
|
{
|
|
225
237
|
className: t,
|
|
226
238
|
value: o,
|
|
227
239
|
onKeyUp: c,
|
|
228
|
-
onChange: (
|
|
240
|
+
onChange: (m) => l(m),
|
|
229
241
|
onClear: u,
|
|
230
242
|
...a
|
|
231
243
|
}
|
|
232
244
|
);
|
|
233
|
-
},
|
|
234
|
-
const { className: t, search: e } = i, s = e.render ??
|
|
235
|
-
return
|
|
245
|
+
}, He = (i) => {
|
|
246
|
+
const { className: t, search: e } = i, s = e.render ?? Oe;
|
|
247
|
+
return rt(s, {
|
|
236
248
|
className: t,
|
|
237
249
|
value: e.value,
|
|
238
250
|
onChange: e.setValue.bind(e),
|
|
239
251
|
...e.textFieldProps
|
|
240
252
|
});
|
|
241
|
-
},
|
|
242
|
-
const
|
|
253
|
+
}, qe = ut(() => {
|
|
254
|
+
const i = v(f), t = h(), e = t.viewMode, s = [];
|
|
255
|
+
return t.itemView && s.push("list"), t.table && s.push("table"), s.length <= 1 ? null : /* @__PURE__ */ n.createElement(A, null, /* @__PURE__ */ n.createElement(
|
|
256
|
+
S,
|
|
257
|
+
{
|
|
258
|
+
variant: "plain",
|
|
259
|
+
color: "secondary",
|
|
260
|
+
"aria-label": i.format("list.settings")
|
|
261
|
+
},
|
|
262
|
+
/* @__PURE__ */ n.createElement(re, null)
|
|
263
|
+
), /* @__PURE__ */ n.createElement(x, { selectionMode: "single", selectedKeys: [e] }, /* @__PURE__ */ n.createElement(ne, null, /* @__PURE__ */ n.createElement(D, null, i.format("list.settings.viewMode")), s.map((a) => /* @__PURE__ */ n.createElement(
|
|
264
|
+
R,
|
|
265
|
+
{
|
|
266
|
+
id: a,
|
|
267
|
+
key: a,
|
|
268
|
+
onAction: () => {
|
|
269
|
+
t.setViewMode(a);
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
i.format(`list.settings.viewMode.${a}`)
|
|
273
|
+
)))));
|
|
274
|
+
}), Ke = (i) => {
|
|
275
|
+
const { className: t } = i, e = h();
|
|
243
276
|
if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
|
|
244
277
|
return null;
|
|
245
|
-
const s = e.filters.map((a) => /* @__PURE__ */
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
},
|
|
248
|
-
list:
|
|
278
|
+
const s = e.filters.map((a) => /* @__PURE__ */ n.createElement(Me, { key: a.property, filter: a }));
|
|
279
|
+
return /* @__PURE__ */ n.createElement("div", { className: w(t, T.header) }, /* @__PURE__ */ n.createElement("div", { className: T.pickerListAndSearch }, /* @__PURE__ */ n.createElement("div", { className: T.pickerList }, /* @__PURE__ */ n.createElement(Be, null), s), e.search && /* @__PURE__ */ n.createElement(He, { className: T.searchField, search: e.search }), /* @__PURE__ */ n.createElement(qe, null)), /* @__PURE__ */ n.createElement(Ue, null));
|
|
280
|
+
}, Ge = "flow--list", je = {
|
|
281
|
+
list: Ge
|
|
249
282
|
};
|
|
250
|
-
let
|
|
283
|
+
let _e = class vt {
|
|
251
284
|
constructor(t, e, s) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
285
|
+
r(this, "id");
|
|
286
|
+
r(this, "data");
|
|
287
|
+
r(this, "collection");
|
|
255
288
|
this.collection = t, this.id = e, this.data = s;
|
|
256
289
|
}
|
|
257
290
|
static fromRow(t, e) {
|
|
258
|
-
return new
|
|
291
|
+
return new vt(t, e.id, e.original);
|
|
259
292
|
}
|
|
260
293
|
};
|
|
261
|
-
class
|
|
294
|
+
class We {
|
|
262
295
|
constructor(t) {
|
|
263
|
-
|
|
296
|
+
r(this, "list");
|
|
264
297
|
this.list = t;
|
|
265
298
|
}
|
|
266
299
|
get entries() {
|
|
267
|
-
return this.list.reactTable.table.getRowModel().rows.map((t) =>
|
|
300
|
+
return this.list.reactTable.table.getRowModel().rows.map((t) => _e.fromRow(this, t));
|
|
268
301
|
}
|
|
269
302
|
}
|
|
270
|
-
class
|
|
303
|
+
class Je {
|
|
271
304
|
constructor(t, e = {}) {
|
|
272
|
-
|
|
273
|
-
|
|
305
|
+
r(this, "batchSize");
|
|
306
|
+
r(this, "list");
|
|
274
307
|
var a;
|
|
275
308
|
const { batchSize: s = 20 } = e;
|
|
276
309
|
this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (a = t.search) == null || a.onUpdated(() => this.reset());
|
|
@@ -314,19 +347,19 @@ class ye {
|
|
|
314
347
|
}
|
|
315
348
|
}
|
|
316
349
|
}
|
|
317
|
-
const
|
|
318
|
-
class
|
|
350
|
+
const Ye = "$";
|
|
351
|
+
class it {
|
|
319
352
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
320
353
|
constructor(t, e) {
|
|
321
|
-
|
|
322
|
-
|
|
354
|
+
r(this, "filter");
|
|
355
|
+
r(this, "value");
|
|
323
356
|
this.filter = t, this.value = e;
|
|
324
357
|
}
|
|
325
358
|
equals(t) {
|
|
326
|
-
return
|
|
359
|
+
return Gt(this.value, t.value);
|
|
327
360
|
}
|
|
328
361
|
get id() {
|
|
329
|
-
return `${this.filter.property}@@${
|
|
362
|
+
return `${this.filter.property}@@${le(this.value)}`;
|
|
330
363
|
}
|
|
331
364
|
get isActive() {
|
|
332
365
|
return this.filter.isValueActive(this);
|
|
@@ -341,27 +374,27 @@ class W {
|
|
|
341
374
|
this.filter.deactivateValue(this);
|
|
342
375
|
}
|
|
343
376
|
}
|
|
344
|
-
const
|
|
345
|
-
class
|
|
377
|
+
const Qe = (i, t) => i === t, Xe = (i) => String(i);
|
|
378
|
+
class Ze {
|
|
346
379
|
constructor(t, e) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
380
|
+
r(this, "_values");
|
|
381
|
+
r(this, "_valuesFromTableState");
|
|
382
|
+
r(this, "list");
|
|
383
|
+
r(this, "property");
|
|
384
|
+
r(this, "mode");
|
|
385
|
+
r(this, "matcher");
|
|
386
|
+
r(this, "renderItem");
|
|
387
|
+
r(this, "name");
|
|
388
|
+
r(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
356
389
|
var s;
|
|
357
|
-
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((a) => new
|
|
390
|
+
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((a) => new it(this, a)), this.matcher = e.matcher ?? Qe, this.renderItem = e.renderItem ?? Xe, this.name = e.name;
|
|
358
391
|
}
|
|
359
392
|
updateTableColumnDef(t) {
|
|
360
393
|
t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
|
|
361
394
|
}
|
|
362
395
|
getReactTableFilterFn() {
|
|
363
396
|
return (t, e, s) => {
|
|
364
|
-
const a = this.property, o = a.startsWith(
|
|
397
|
+
const a = this.property, o = a.startsWith(Ye) ? t.original : oe(t.original, a);
|
|
365
398
|
return this.checkFilterMatches(o, s);
|
|
366
399
|
};
|
|
367
400
|
}
|
|
@@ -389,9 +422,9 @@ class Ce {
|
|
|
389
422
|
return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
|
|
390
423
|
}
|
|
391
424
|
getValuesFromTableState() {
|
|
392
|
-
return
|
|
425
|
+
return jt(
|
|
393
426
|
Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
|
|
394
|
-
).map((t) => new
|
|
427
|
+
).map((t) => new it(this, t));
|
|
395
428
|
}
|
|
396
429
|
checkIfValueIsUnknown(t) {
|
|
397
430
|
return !this.values.some((s) => s.id === t.id);
|
|
@@ -435,13 +468,13 @@ class Ce {
|
|
|
435
468
|
this.onFilterUpdateCallbacks.add(t);
|
|
436
469
|
}
|
|
437
470
|
}
|
|
438
|
-
class
|
|
471
|
+
class ts {
|
|
439
472
|
constructor(t, e) {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
473
|
+
r(this, "list");
|
|
474
|
+
r(this, "property");
|
|
475
|
+
r(this, "name");
|
|
476
|
+
r(this, "direction");
|
|
477
|
+
r(this, "defaultEnabled");
|
|
445
478
|
this.list = t, this.property = e.property, this.name = e.name, this.direction = e.direction ?? "asc", this.defaultEnabled = e.defaultEnabled ?? !1;
|
|
446
479
|
}
|
|
447
480
|
updateTableColumnDef(t) {
|
|
@@ -469,25 +502,25 @@ class Le {
|
|
|
469
502
|
return `${this.getTableColumn().id}:${this.direction}`;
|
|
470
503
|
}
|
|
471
504
|
}
|
|
472
|
-
class
|
|
505
|
+
class z {
|
|
473
506
|
constructor(t, e, s = {}) {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
507
|
+
r(this, "list");
|
|
508
|
+
r(this, "table");
|
|
509
|
+
r(this, "sortingState");
|
|
510
|
+
r(this, "updateSortingState");
|
|
478
511
|
this.list = t;
|
|
479
512
|
const a = this.list.sorting.filter(
|
|
480
513
|
(u) => u.defaultEnabled !== !1
|
|
481
|
-
), [o, l] =
|
|
514
|
+
), [o, l] = ot(
|
|
482
515
|
a.map((u) => u.getReactTableColumnSort())
|
|
483
516
|
);
|
|
484
517
|
this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(e, s);
|
|
485
518
|
}
|
|
486
519
|
static useNew(t, e, s = {}) {
|
|
487
|
-
return new
|
|
520
|
+
return new z(t, e, s);
|
|
488
521
|
}
|
|
489
522
|
useReactTable(t, e = {}) {
|
|
490
|
-
const s = this.list.loader.useData(), a =
|
|
523
|
+
const s = this.list.loader.useData(), a = ce({
|
|
491
524
|
data: s,
|
|
492
525
|
state: {
|
|
493
526
|
sorting: this.sortingState
|
|
@@ -498,18 +531,18 @@ class B {
|
|
|
498
531
|
}
|
|
499
532
|
},
|
|
500
533
|
columns: this.getTableColumnDefs(),
|
|
501
|
-
getCoreRowModel:
|
|
502
|
-
getSortedRowModel:
|
|
503
|
-
getFilteredRowModel:
|
|
504
|
-
getPaginationRowModel:
|
|
505
|
-
getFacetedUniqueValues:
|
|
534
|
+
getCoreRowModel: ue(),
|
|
535
|
+
getSortedRowModel: me(),
|
|
536
|
+
getFilteredRowModel: de(),
|
|
537
|
+
getPaginationRowModel: he(),
|
|
538
|
+
getFacetedUniqueValues: pe(),
|
|
506
539
|
onSortingChange: (o) => {
|
|
507
540
|
this.handleSortingStateUpdate(o);
|
|
508
541
|
},
|
|
509
542
|
globalFilterFn: "auto",
|
|
510
543
|
...e
|
|
511
544
|
});
|
|
512
|
-
return
|
|
545
|
+
return F(() => {
|
|
513
546
|
t && t(this.list);
|
|
514
547
|
}, [this.list, t, a]), a;
|
|
515
548
|
}
|
|
@@ -524,7 +557,7 @@ class B {
|
|
|
524
557
|
}
|
|
525
558
|
getTableColumn(t) {
|
|
526
559
|
const e = this.table.getColumn(t);
|
|
527
|
-
return
|
|
560
|
+
return mt(!!e, `Column #${t} is not defined`), e;
|
|
528
561
|
}
|
|
529
562
|
getTableColumnDefs() {
|
|
530
563
|
const t = /* @__PURE__ */ new Map(), e = (s) => {
|
|
@@ -546,26 +579,26 @@ class B {
|
|
|
546
579
|
), Array.from(t.values());
|
|
547
580
|
}
|
|
548
581
|
}
|
|
549
|
-
class
|
|
582
|
+
class U {
|
|
550
583
|
constructor() {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
584
|
+
r(this, "dataBatches", []);
|
|
585
|
+
r(this, "prevDataBatches", []);
|
|
586
|
+
r(this, "batchLoadingStates", ["void"]);
|
|
587
|
+
ee(this, {
|
|
555
588
|
prevDataBatches: !1,
|
|
556
589
|
useMergedData: !1,
|
|
557
590
|
useIsLoading: !1,
|
|
558
|
-
dataBatches:
|
|
559
|
-
batchLoadingStates:
|
|
560
|
-
mergedData:
|
|
561
|
-
isLoading:
|
|
562
|
-
reset:
|
|
563
|
-
setDataBatch:
|
|
564
|
-
setBatchLoadingState:
|
|
591
|
+
dataBatches: Z.shallow,
|
|
592
|
+
batchLoadingStates: Z.shallow,
|
|
593
|
+
mergedData: tt,
|
|
594
|
+
isLoading: tt,
|
|
595
|
+
reset: V.bound,
|
|
596
|
+
setDataBatch: V.bound,
|
|
597
|
+
setBatchLoadingState: V.bound
|
|
565
598
|
});
|
|
566
599
|
}
|
|
567
600
|
static useNew() {
|
|
568
|
-
return
|
|
601
|
+
return lt(new U()).current;
|
|
569
602
|
}
|
|
570
603
|
reset() {
|
|
571
604
|
this.batchLoadingStates = [], this.dataBatches = [];
|
|
@@ -580,32 +613,32 @@ class P {
|
|
|
580
613
|
return (this.dataBatches.length === 0 ? this.prevDataBatches : this.dataBatches).flatMap((e) => e);
|
|
581
614
|
}
|
|
582
615
|
useMergedData() {
|
|
583
|
-
return
|
|
616
|
+
return st(() => this.mergedData);
|
|
584
617
|
}
|
|
585
618
|
get isLoading() {
|
|
586
619
|
return this.batchLoadingStates.some((t) => t === "loading" || t === "void");
|
|
587
620
|
}
|
|
588
621
|
useIsLoading() {
|
|
589
|
-
return
|
|
622
|
+
return st(() => this.isLoading);
|
|
590
623
|
}
|
|
591
624
|
}
|
|
592
|
-
const
|
|
593
|
-
class
|
|
625
|
+
const es = [];
|
|
626
|
+
class O {
|
|
594
627
|
constructor(t, e = {}) {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
628
|
+
r(this, "list");
|
|
629
|
+
r(this, "dataSource");
|
|
630
|
+
r(this, "manualSorting");
|
|
631
|
+
r(this, "manualFiltering");
|
|
632
|
+
r(this, "manualPagination");
|
|
633
|
+
r(this, "loaderState");
|
|
601
634
|
var u;
|
|
602
635
|
const { source: s } = e;
|
|
603
|
-
this.dataSource = s ?? { staticData:
|
|
636
|
+
this.dataSource = s ?? { staticData: es };
|
|
604
637
|
const a = "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;
|
|
605
|
-
this.list = t, this.loaderState =
|
|
638
|
+
this.list = t, this.loaderState = U.useNew(), this.manualPagination = a ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((c) => c.onFilterUpdated(() => this.reset())), (u = this.list.search) == null || u.onUpdated(() => this.reset());
|
|
606
639
|
}
|
|
607
640
|
static useNew(t, e = {}) {
|
|
608
|
-
return new
|
|
641
|
+
return new O(t, e);
|
|
609
642
|
}
|
|
610
643
|
reset() {
|
|
611
644
|
this.loaderState.reset();
|
|
@@ -620,7 +653,7 @@ class x {
|
|
|
620
653
|
return this.loaderState.useMergedData();
|
|
621
654
|
}
|
|
622
655
|
getLoaderInvocationHooks() {
|
|
623
|
-
return
|
|
656
|
+
return _t(this.list.batches.getBatchIndex() + 1, (e) => e).map((e) => () => {
|
|
624
657
|
this.useLoadBatch(e);
|
|
625
658
|
});
|
|
626
659
|
}
|
|
@@ -631,7 +664,7 @@ class x {
|
|
|
631
664
|
}), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
|
|
632
665
|
}
|
|
633
666
|
useObserveBatchLoadingState(t, e) {
|
|
634
|
-
|
|
667
|
+
F(() => (this.loaderState.setBatchLoadingState(
|
|
635
668
|
e,
|
|
636
669
|
t.state.value
|
|
637
670
|
), t.state.observe((s) => {
|
|
@@ -643,7 +676,7 @@ class x {
|
|
|
643
676
|
const { data: o, itemTotalCount: l } = a;
|
|
644
677
|
this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
|
|
645
678
|
};
|
|
646
|
-
|
|
679
|
+
F(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
|
|
647
680
|
a.isSet && s(a.value);
|
|
648
681
|
})), [t, e]);
|
|
649
682
|
}
|
|
@@ -671,7 +704,7 @@ class x {
|
|
|
671
704
|
getBatchDataAsyncResource(t) {
|
|
672
705
|
const e = this.dataSource, s = this.getDataLoaderOptions(t);
|
|
673
706
|
if ("staticData" in e)
|
|
674
|
-
return
|
|
707
|
+
return et(
|
|
675
708
|
async (a) => ({
|
|
676
709
|
data: a,
|
|
677
710
|
itemTotalCount: a.length
|
|
@@ -680,7 +713,7 @@ class x {
|
|
|
680
713
|
);
|
|
681
714
|
if ("asyncLoader" in e) {
|
|
682
715
|
const a = e.asyncLoader;
|
|
683
|
-
return
|
|
716
|
+
return et(a, [s]);
|
|
684
717
|
}
|
|
685
718
|
if ("asyncResourceFactory" in e) {
|
|
686
719
|
const a = e.asyncResourceFactory;
|
|
@@ -689,12 +722,12 @@ class x {
|
|
|
689
722
|
throw new Error("Unknown data source");
|
|
690
723
|
}
|
|
691
724
|
}
|
|
692
|
-
class
|
|
725
|
+
class ss {
|
|
693
726
|
constructor(t, e) {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
727
|
+
r(this, "list");
|
|
728
|
+
r(this, "render");
|
|
729
|
+
r(this, "textFieldProps");
|
|
730
|
+
r(this, "onUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
698
731
|
this.list = t, this.render = e.render, this.textFieldProps = e.textFieldProps;
|
|
699
732
|
}
|
|
700
733
|
get value() {
|
|
@@ -716,51 +749,102 @@ class Ie {
|
|
|
716
749
|
this.onUpdateCallbacks.add(t);
|
|
717
750
|
}
|
|
718
751
|
}
|
|
719
|
-
const
|
|
752
|
+
const I = class I {
|
|
720
753
|
constructor(t, e = {}) {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
754
|
+
r(this, "list");
|
|
755
|
+
r(this, "textValue");
|
|
756
|
+
r(this, "href");
|
|
757
|
+
r(this, "onAction");
|
|
758
|
+
r(this, "fallback");
|
|
759
|
+
r(this, "renderFn");
|
|
727
760
|
const { onAction: s, fallback: a, textValue: o, href: l, renderFn: u } = e;
|
|
728
761
|
this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = a;
|
|
729
762
|
}
|
|
730
763
|
render(t) {
|
|
731
|
-
return (this.renderFn ??
|
|
764
|
+
return (this.renderFn ?? I.fallbackRenderItemFn)(t);
|
|
732
765
|
}
|
|
733
766
|
};
|
|
734
|
-
|
|
735
|
-
let
|
|
767
|
+
r(I, "fallbackRenderItemFn", (t) => rt("pre", void 0, JSON.stringify(t)));
|
|
768
|
+
let M = I, as = class {
|
|
769
|
+
constructor(t, e = {}) {
|
|
770
|
+
r(this, "tableHeader");
|
|
771
|
+
r(this, "componentProps");
|
|
772
|
+
this.tableHeader = t, this.componentProps = e;
|
|
773
|
+
}
|
|
774
|
+
}, is = class {
|
|
775
|
+
constructor(t, e = {}) {
|
|
776
|
+
r(this, "table");
|
|
777
|
+
r(this, "componentProps");
|
|
778
|
+
r(this, "columns");
|
|
779
|
+
const { columns: s = [], ...a } = e;
|
|
780
|
+
this.table = t, this.columns = s.map((o) => new as(this, o)), this.componentProps = a;
|
|
781
|
+
}
|
|
782
|
+
}, ns = class {
|
|
783
|
+
constructor(t, e = {}) {
|
|
784
|
+
r(this, "row");
|
|
785
|
+
r(this, "renderFn");
|
|
786
|
+
r(this, "componentProps");
|
|
787
|
+
const { renderFn: s, ...a } = e;
|
|
788
|
+
this.row = t, this.renderFn = s, this.componentProps = a;
|
|
789
|
+
}
|
|
790
|
+
}, rs = class {
|
|
791
|
+
constructor(t, e = {}) {
|
|
792
|
+
r(this, "tableBody");
|
|
793
|
+
r(this, "onAction");
|
|
794
|
+
r(this, "cells");
|
|
795
|
+
r(this, "componentProps");
|
|
796
|
+
const { onAction: s, cells: a = [], ...o } = e;
|
|
797
|
+
this.tableBody = t, this.onAction = s, this.cells = a.map((l) => new ns(this, l)), this.componentProps = o;
|
|
798
|
+
}
|
|
799
|
+
}, os = class {
|
|
800
|
+
constructor(t, e = {}) {
|
|
801
|
+
r(this, "table");
|
|
802
|
+
r(this, "componentProps");
|
|
803
|
+
r(this, "row");
|
|
804
|
+
const { row: s, ...a } = e;
|
|
805
|
+
this.table = t, this.row = new rs(this, s), this.componentProps = a;
|
|
806
|
+
}
|
|
807
|
+
}, ls = class {
|
|
808
|
+
constructor(t, e = {}) {
|
|
809
|
+
r(this, "list");
|
|
810
|
+
r(this, "header");
|
|
811
|
+
r(this, "body");
|
|
812
|
+
r(this, "componentProps");
|
|
813
|
+
const { header: s, body: a, ...o } = e;
|
|
814
|
+
this.list = t, this.header = new is(this, s), this.body = new os(this, a), this.componentProps = o;
|
|
815
|
+
}
|
|
816
|
+
}, cs = class yt {
|
|
736
817
|
constructor(t) {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
818
|
+
r(this, "filters");
|
|
819
|
+
r(this, "itemView");
|
|
820
|
+
r(this, "table");
|
|
821
|
+
r(this, "search");
|
|
822
|
+
r(this, "sorting");
|
|
823
|
+
r(this, "items");
|
|
824
|
+
r(this, "reactTable");
|
|
825
|
+
r(this, "batches");
|
|
826
|
+
r(this, "loader");
|
|
827
|
+
r(this, "hasAction");
|
|
828
|
+
r(this, "viewMode", "list");
|
|
746
829
|
const {
|
|
747
830
|
itemView: e,
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
831
|
+
table: s,
|
|
832
|
+
filters: a = [],
|
|
833
|
+
sorting: o = [],
|
|
834
|
+
batchesController: l,
|
|
835
|
+
hasAction: u,
|
|
836
|
+
onChange: c
|
|
753
837
|
} = t;
|
|
754
|
-
this.items = new
|
|
838
|
+
this.items = new We(this), this.filters = a.map((m) => new Ze(this, m)), this.sorting = o.map((m) => new ts(this, m)), this.search = t.search ? new ss(this, t.search) : void 0, this.itemView = e ? new M(this, e) : void 0, this.table = s ? new ls(this, s) : void 0, this.batches = new Je(this, l), this.loader = O.useNew(this, t.loader), this.reactTable = z.useNew(this, c, {
|
|
755
839
|
manualFiltering: this.loader.manualFiltering,
|
|
756
840
|
manualPagination: this.loader.manualPagination,
|
|
757
841
|
manualSorting: this.loader.manualSorting
|
|
758
|
-
}),
|
|
759
|
-
this.filters.forEach((
|
|
760
|
-
}, [this.filters]), this.hasAction =
|
|
842
|
+
}), F(() => {
|
|
843
|
+
this.filters.forEach((m) => m.deleteUnknownFilterValues());
|
|
844
|
+
}, [this.filters]), this.hasAction = u, se(this, { viewMode: !0, setViewMode: !0 });
|
|
761
845
|
}
|
|
762
846
|
static useNew(t) {
|
|
763
|
-
return new
|
|
847
|
+
return lt(new yt(t)).current;
|
|
764
848
|
}
|
|
765
849
|
get isFiltered() {
|
|
766
850
|
return this.filters.some((t) => t.isActive()) || !!this.search && this.search.isSet;
|
|
@@ -770,7 +854,7 @@ let I = F, ke = class rt {
|
|
|
770
854
|
}
|
|
771
855
|
getSorting(t) {
|
|
772
856
|
const e = this.sorting.find((s) => s.id === t);
|
|
773
|
-
return
|
|
857
|
+
return mt(!!e, `Could not get Sorting (ID: ${t})`), e;
|
|
774
858
|
}
|
|
775
859
|
clearSorting() {
|
|
776
860
|
return this.sorting.forEach((t) => t.clear());
|
|
@@ -782,53 +866,63 @@ let I = F, ke = class rt {
|
|
|
782
866
|
useIsEmpty() {
|
|
783
867
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
784
868
|
}
|
|
869
|
+
setViewMode(t) {
|
|
870
|
+
this.viewMode = t;
|
|
871
|
+
}
|
|
785
872
|
};
|
|
786
|
-
const
|
|
787
|
-
items:
|
|
788
|
-
isLoading:
|
|
789
|
-
},
|
|
790
|
-
item:
|
|
791
|
-
hasAction:
|
|
792
|
-
},
|
|
793
|
-
const { data: t, children: e } = i, s =
|
|
794
|
-
|
|
795
|
-
|
|
873
|
+
const us = "flow--list--items", ms = "flow--list--items--is-loading", nt = {
|
|
874
|
+
items: us,
|
|
875
|
+
isLoading: ms
|
|
876
|
+
}, ds = "flow--list--items--item", hs = "flow--list--items--item--has-action", N = {
|
|
877
|
+
item: ds,
|
|
878
|
+
hasAction: hs
|
|
879
|
+
}, ps = (i) => {
|
|
880
|
+
const { data: t, children: e } = i, s = h(), a = s.itemView;
|
|
881
|
+
if (!a)
|
|
882
|
+
return null;
|
|
883
|
+
const o = a.onAction, l = a.textValue ? a.textValue(t) : void 0, u = o ? () => o(t) : void 0, c = a.href ? a.href(t) : void 0, m = s.hasAction || !!u || !!c, g = w(N.item, m && N.hasAction);
|
|
884
|
+
return /* @__PURE__ */ n.createElement(
|
|
885
|
+
$.GridListItem,
|
|
796
886
|
{
|
|
797
|
-
className:
|
|
887
|
+
className: g,
|
|
798
888
|
onAction: u,
|
|
799
889
|
textValue: l,
|
|
800
890
|
href: c
|
|
801
891
|
},
|
|
802
892
|
e ?? a.render(t)
|
|
803
893
|
);
|
|
804
|
-
},
|
|
805
|
-
const i = v(
|
|
806
|
-
return /* @__PURE__ */
|
|
807
|
-
},
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
894
|
+
}, gs = (i) => /* @__PURE__ */ n.createElement($.GridListItem, { textValue: "-", className: N.item }, i.children), Et = () => {
|
|
895
|
+
const i = v(f);
|
|
896
|
+
return /* @__PURE__ */ n.createElement(ge, null, /* @__PURE__ */ n.createElement(be, null), /* @__PURE__ */ n.createElement(D, null, i.format("list.noResult.heading")), /* @__PURE__ */ n.createElement(y, null, i.format("list.noResult.text")));
|
|
897
|
+
}, bs = () => /* @__PURE__ */ n.createElement(St, null, /* @__PURE__ */ n.createElement(D, null, /* @__PURE__ */ n.createElement(L, { width: "200px" })), /* @__PURE__ */ n.createElement(y, null, /* @__PURE__ */ n.createElement(L, { width: "300px" }))), fs = () => {
|
|
898
|
+
var e;
|
|
899
|
+
const t = ((e = h().itemView) == null ? void 0 : e.fallback) ?? /* @__PURE__ */ n.createElement(bs, null);
|
|
900
|
+
return Array.from(Array(5)).map((s, a) => /* @__PURE__ */ n.createElement(gs, { key: a }, qt(t)));
|
|
901
|
+
}, Ss = (i) => {
|
|
902
|
+
const { className: t, ...e } = i, s = h(), a = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty();
|
|
903
|
+
if (!s.itemView)
|
|
904
|
+
return null;
|
|
905
|
+
const u = s.items.entries.map((m) => /* @__PURE__ */ n.createElement(ps, { key: m.id, data: m.data })), c = w(
|
|
906
|
+
nt.items,
|
|
813
907
|
t,
|
|
814
|
-
a &&
|
|
908
|
+
a && nt.isLoading
|
|
815
909
|
);
|
|
816
|
-
return l ? /* @__PURE__ */
|
|
817
|
-
},
|
|
818
|
-
footer:
|
|
819
|
-
},
|
|
820
|
-
const t = v(
|
|
910
|
+
return l ? /* @__PURE__ */ n.createElement(Et, null) : /* @__PURE__ */ n.createElement("div", { "aria-hidden": o, "aria-busy": a }, /* @__PURE__ */ n.createElement($.GridList, { className: c, ...e }, o ? /* @__PURE__ */ n.createElement(fs, null) : u));
|
|
911
|
+
}, Tt = (i) => null, ws = () => Tt, Ct = (i) => null, vs = () => Ct, Ft = (i) => null, ys = () => Ft, Lt = (i) => null, Es = () => Lt, It = (i) => null, Ts = () => It, Cs = "flow--list--footer", Fs = {
|
|
912
|
+
footer: Cs
|
|
913
|
+
}, Ls = (i) => {
|
|
914
|
+
const t = v(f), e = h(), s = e.batches, a = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
|
|
821
915
|
if (o)
|
|
822
916
|
return null;
|
|
823
|
-
const c = a ? /* @__PURE__ */
|
|
917
|
+
const c = a ? /* @__PURE__ */ n.createElement(we, { width: "200px" }) : t.format("list.paginationInfo", {
|
|
824
918
|
visibleItemsCount: u,
|
|
825
919
|
totalItemsCount: l
|
|
826
920
|
});
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
},
|
|
829
|
-
const t = v(
|
|
830
|
-
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */
|
|
831
|
-
|
|
921
|
+
return /* @__PURE__ */ n.createElement(y, { ...i }, c);
|
|
922
|
+
}, Is = (i) => {
|
|
923
|
+
const t = v(f), e = h(), s = e.loader.useIsLoading(), a = e.loader.useIsInitiallyLoading();
|
|
924
|
+
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ n.createElement(
|
|
925
|
+
S,
|
|
832
926
|
{
|
|
833
927
|
isPending: s && !a,
|
|
834
928
|
isDisabled: a,
|
|
@@ -839,86 +933,159 @@ const Ae = "flow--list--items", Ve = "flow--list--items--is-loading", _ = {
|
|
|
839
933
|
},
|
|
840
934
|
t.format("list.showMore")
|
|
841
935
|
);
|
|
842
|
-
},
|
|
843
|
-
function
|
|
936
|
+
}, As = () => /* @__PURE__ */ n.createElement("div", { className: Fs.footer }, /* @__PURE__ */ n.createElement(Ls, null), /* @__PURE__ */ n.createElement(Is, null));
|
|
937
|
+
function At(i) {
|
|
844
938
|
return null;
|
|
845
939
|
}
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
filters: G(t, ot).map(
|
|
868
|
-
(y) => ({
|
|
869
|
-
...y.props,
|
|
870
|
-
renderItem: y.props.children
|
|
871
|
-
})
|
|
872
|
-
),
|
|
873
|
-
search: h ? {
|
|
874
|
-
render: h.children,
|
|
875
|
-
textFieldProps: h
|
|
876
|
-
} : void 0,
|
|
877
|
-
sorting: G(t, lt).map((y) => y.props),
|
|
878
|
-
itemView: b ? {
|
|
879
|
-
...b,
|
|
880
|
-
renderFn: b.children
|
|
881
|
-
} : void 0,
|
|
882
|
-
batchesController: {
|
|
883
|
-
batchSize: e
|
|
884
|
-
},
|
|
885
|
-
hasAction: !!i.onAction
|
|
886
|
-
});
|
|
887
|
-
return /* @__PURE__ */ r.createElement(
|
|
888
|
-
at.Provider,
|
|
889
|
-
{
|
|
890
|
-
value: {
|
|
891
|
-
list: dt
|
|
892
|
-
}
|
|
893
|
-
},
|
|
894
|
-
/* @__PURE__ */ r.createElement(se, null),
|
|
895
|
-
/* @__PURE__ */ r.createElement("div", { className: be.list }, /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ze, { ...a }), /* @__PURE__ */ r.createElement(_e, null))
|
|
940
|
+
const Ps = () => At, Pt = (i) => null, kt = (i) => null, Vt = (i) => null, ks = (i) => /* @__PURE__ */ n.createElement(dt, { ...i }, /* @__PURE__ */ n.createElement(ht, null, /* @__PURE__ */ n.createElement(pt, null, /* @__PURE__ */ n.createElement(L, { width: "100%" }))), /* @__PURE__ */ n.createElement(gt, null, Array.from(Array(5)).map((t, e) => /* @__PURE__ */ n.createElement(bt, { key: e }, /* @__PURE__ */ n.createElement(ft, null, /* @__PURE__ */ n.createElement(L, { width: "100%" })))))), Vs = "flow--list--table", Bs = "flow--list--table--is-loading", Ms = "flow--list--table--row", Ns = "flow--list--table--has-action", C = {
|
|
941
|
+
table: Vs,
|
|
942
|
+
isLoading: Bs,
|
|
943
|
+
row: Ms,
|
|
944
|
+
hasAction: Ns
|
|
945
|
+
}, xs = () => {
|
|
946
|
+
const i = h(), t = i.table, e = i.useIsEmpty(), s = i.loader.useIsLoading(), a = i.loader.useIsInitiallyLoading();
|
|
947
|
+
if (!t)
|
|
948
|
+
return null;
|
|
949
|
+
if (a)
|
|
950
|
+
return /* @__PURE__ */ n.createElement(ks, { ...t.componentProps });
|
|
951
|
+
if (e)
|
|
952
|
+
return /* @__PURE__ */ n.createElement(Et, null);
|
|
953
|
+
const o = t.body.row.onAction, l = w(
|
|
954
|
+
C.row,
|
|
955
|
+
o && C.hasAction,
|
|
956
|
+
t.body.row.componentProps.className
|
|
957
|
+
), u = w(
|
|
958
|
+
C.table,
|
|
959
|
+
s && C.isLoading,
|
|
960
|
+
t.componentProps.className
|
|
896
961
|
);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
962
|
+
return /* @__PURE__ */ n.createElement(dt, { ...t.componentProps, className: u }, /* @__PURE__ */ n.createElement(ht, { ...t.header.componentProps }, t.header.columns.map((c, m) => /* @__PURE__ */ n.createElement(pt, { key: m, ...c.componentProps }))), /* @__PURE__ */ n.createElement(gt, { ...t.body.componentProps }, i.items.entries.map((c) => {
|
|
963
|
+
var m;
|
|
964
|
+
return /* @__PURE__ */ n.createElement(
|
|
965
|
+
bt,
|
|
966
|
+
{
|
|
967
|
+
className: l,
|
|
968
|
+
key: c.id,
|
|
969
|
+
onAction: o ? () => o(c.data) : void 0,
|
|
970
|
+
...t.body.row.componentProps
|
|
971
|
+
},
|
|
972
|
+
(m = t.body.row) == null ? void 0 : m.cells.map((g, P) => /* @__PURE__ */ n.createElement(ft, { key: P, ...g.componentProps }, g.renderFn ? g.renderFn(c.data) : void 0))
|
|
973
|
+
);
|
|
974
|
+
})));
|
|
975
|
+
}, Bt = (i) => null, Mt = (i) => null, Nt = (i) => null, Rs = Xt(
|
|
976
|
+
"List",
|
|
977
|
+
ut((i) => {
|
|
978
|
+
var q, K, G, j, _, W, J, Y, Q;
|
|
979
|
+
const { children: t, batchSize: e, onChange: s, ...a } = i, o = (q = b(
|
|
980
|
+
t,
|
|
981
|
+
Tt
|
|
982
|
+
)) == null ? void 0 : q.props, l = (K = b(
|
|
983
|
+
t,
|
|
984
|
+
fe
|
|
985
|
+
)) == null ? void 0 : K.props, u = (G = b(
|
|
986
|
+
t,
|
|
987
|
+
It
|
|
988
|
+
)) == null ? void 0 : G.props, c = {
|
|
989
|
+
source: o ? {
|
|
990
|
+
...o,
|
|
991
|
+
asyncLoader: o.children
|
|
992
|
+
} : l ? {
|
|
993
|
+
...l,
|
|
994
|
+
asyncResourceFactory: l.children
|
|
995
|
+
} : u ? {
|
|
996
|
+
staticData: u.data
|
|
997
|
+
} : void 0
|
|
998
|
+
}, m = (j = b(t, At)) == null ? void 0 : j.props, g = (_ = b(t, Lt)) == null ? void 0 : _.props, P = (W = b(t, Bt)) == null ? void 0 : W.props, H = E(t, Pt).map(
|
|
999
|
+
(p) => ({
|
|
1000
|
+
...p.props,
|
|
1001
|
+
name: p.props.children
|
|
1002
|
+
})
|
|
1003
|
+
), xt = E(t, Vt).map(
|
|
1004
|
+
(p) => ({
|
|
1005
|
+
...p.props,
|
|
1006
|
+
renderFn: p.props.children
|
|
1007
|
+
})
|
|
1008
|
+
), Rt = (J = b(t, kt)) == null ? void 0 : J.props, Dt = (Y = b(t, Mt)) == null ? void 0 : Y.props, $t = (Q = b(t, Nt)) == null ? void 0 : Q.props, k = cs.useNew({
|
|
1009
|
+
onChange: s,
|
|
1010
|
+
loader: c,
|
|
1011
|
+
filters: E(t, Ct).map(
|
|
1012
|
+
(p) => ({
|
|
1013
|
+
...p.props,
|
|
1014
|
+
renderItem: p.props.children
|
|
1015
|
+
})
|
|
1016
|
+
),
|
|
1017
|
+
search: m ? {
|
|
1018
|
+
render: m.children,
|
|
1019
|
+
textFieldProps: m
|
|
1020
|
+
} : void 0,
|
|
1021
|
+
sorting: E(t, Ft).map(
|
|
1022
|
+
(p) => p.props
|
|
1023
|
+
),
|
|
1024
|
+
itemView: g ? {
|
|
1025
|
+
...g,
|
|
1026
|
+
renderFn: g.children
|
|
1027
|
+
} : void 0,
|
|
1028
|
+
table: H.length > 0 ? {
|
|
1029
|
+
header: {
|
|
1030
|
+
...Dt,
|
|
1031
|
+
columns: H
|
|
1032
|
+
},
|
|
1033
|
+
body: {
|
|
1034
|
+
...$t,
|
|
1035
|
+
row: {
|
|
1036
|
+
...Rt,
|
|
1037
|
+
cells: xt
|
|
1038
|
+
}
|
|
1039
|
+
},
|
|
1040
|
+
...P
|
|
1041
|
+
} : void 0,
|
|
1042
|
+
batchesController: {
|
|
1043
|
+
batchSize: e
|
|
1044
|
+
},
|
|
1045
|
+
hasAction: !!i.onAction
|
|
1046
|
+
});
|
|
1047
|
+
return /* @__PURE__ */ n.createElement(
|
|
1048
|
+
wt.Provider,
|
|
1049
|
+
{
|
|
1050
|
+
value: {
|
|
1051
|
+
list: k
|
|
1052
|
+
}
|
|
1053
|
+
},
|
|
1054
|
+
/* @__PURE__ */ n.createElement(ke, null),
|
|
1055
|
+
/* @__PURE__ */ n.createElement("div", { className: je.list }, /* @__PURE__ */ n.createElement(Ke, null), k.viewMode === "list" && /* @__PURE__ */ n.createElement(Ss, { ...a }), k.viewMode === "table" && /* @__PURE__ */ n.createElement(xs, null), /* @__PURE__ */ n.createElement(As, null))
|
|
1056
|
+
);
|
|
1057
|
+
})
|
|
1058
|
+
), Ds = () => Rs, Ma = () => ({
|
|
1059
|
+
List: Ds(),
|
|
1060
|
+
Filter: vs(),
|
|
1061
|
+
Search: Ps(),
|
|
1062
|
+
Sorting: ys(),
|
|
1063
|
+
Item: Es(),
|
|
1064
|
+
ItemView: St,
|
|
1065
|
+
TableHeader: Mt,
|
|
1066
|
+
TableColumn: Pt,
|
|
1067
|
+
TableBody: Nt,
|
|
1068
|
+
TableRow: kt,
|
|
1069
|
+
TableCell: Vt,
|
|
1070
|
+
Table: Bt,
|
|
1071
|
+
StaticData: Ts(),
|
|
1072
|
+
LoaderAsync: ws(),
|
|
1073
|
+
LoaderAsyncResource: Se()
|
|
907
1074
|
});
|
|
908
1075
|
export {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1076
|
+
Rs as List,
|
|
1077
|
+
Ct as ListFilter,
|
|
1078
|
+
Lt as ListItem,
|
|
1079
|
+
St as ListItemView,
|
|
1080
|
+
Tt as ListLoaderAsync,
|
|
1081
|
+
Ft as ListSorting,
|
|
1082
|
+
It as ListStaticData,
|
|
1083
|
+
Ds as TypedList,
|
|
1084
|
+
vs as TypedListFilter,
|
|
1085
|
+
Es as TypedListItem,
|
|
1086
|
+
ws as TypedListLoaderAsync,
|
|
1087
|
+
ys as TypedListSorting,
|
|
1088
|
+
Ts as TypedListStaticData,
|
|
1089
|
+
Ma as typedList,
|
|
1090
|
+
h as useList
|
|
924
1091
|
};
|