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