@mittwald/flow-react-components 0.1.0-alpha.205 → 0.1.0-alpha.206
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/List.js +219 -202
- package/dist/Tabs.js +50 -51
- package/dist/types/components/List/model/filter/Filter.d.ts +6 -1
- package/package.json +4 -4
package/dist/List.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
var mt = Object.defineProperty;
|
|
4
|
-
var gt = (
|
|
5
|
-
var n = (
|
|
6
|
-
import r, { createContext as pt, useContext as ft, createElement as
|
|
4
|
+
var gt = (i, t, e) => t in i ? mt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
5
|
+
var n = (i, t, e) => gt(i, typeof t != "symbol" ? t + "" : t, e);
|
|
6
|
+
import r, { createContext as pt, useContext as ft, createElement as J, useState as Y, useEffect as E, useRef as bt, cloneElement as St } from "react";
|
|
7
7
|
import "./propsContext-DzAKlmhS.js";
|
|
8
8
|
import { P as vt } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
9
9
|
import "@react-aria/utils";
|
|
10
10
|
import { isShallowEqual as yt, unique as wt, times as Et } from "remeda";
|
|
11
|
-
import { d as
|
|
11
|
+
import { d as Ft } from "./dynamic-ClpUSmEt.js";
|
|
12
12
|
import { B as p } from "./Button-DQtavSbo.js";
|
|
13
13
|
import "@tabler/icons-react";
|
|
14
14
|
import "./Icon-DPoIVASu.js";
|
|
15
|
-
import { I as
|
|
16
|
-
import { a as A, C as
|
|
17
|
-
import { M as
|
|
15
|
+
import { I as Ct } from "./IconContextMenu-jwoVcLvd.js";
|
|
16
|
+
import { a as A, C as Q } from "./ContextMenuTrigger-BdJf5T8A.js";
|
|
17
|
+
import { M as X } from "./MenuItem-DcfYvfPJ.js";
|
|
18
18
|
import { useLocalizedStringFormatter as v } from "react-aria";
|
|
19
19
|
import { TunnelProvider as Lt, TunnelExit as U } from "@mittwald/react-tunnel";
|
|
20
20
|
import C from "clsx";
|
|
@@ -22,14 +22,14 @@ import { g as Tt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
|
|
|
22
22
|
import { f as It } from "./flowComponent-DHPUcYyM.js";
|
|
23
23
|
import { R as kt } from "./Render-BdlTa7Qb.js";
|
|
24
24
|
import { T as f } from "./Text-Sd5q3Yme.js";
|
|
25
|
-
import { I as
|
|
25
|
+
import { I as Z } from "./IconChevronDown--OxZLX8L.js";
|
|
26
26
|
import { I as At } from "./IconClose-BFwPT_IX.js";
|
|
27
|
-
import { makeObservable as Bt, observable as $, computed as O, action as
|
|
27
|
+
import { makeObservable as Bt, observable as $, computed as O, action as L } from "mobx";
|
|
28
28
|
import "./context-BB3_MApL.js";
|
|
29
|
-
import { u as
|
|
30
|
-
import { S as
|
|
31
|
-
import { getProperty as
|
|
32
|
-
import { hash as
|
|
29
|
+
import { u as Vt } from "./useOnChange-C1Quwyuz.js";
|
|
30
|
+
import { S as Pt } from "./SearchField-DstUFmq4.js";
|
|
31
|
+
import { getProperty as xt } from "dot-prop";
|
|
32
|
+
import { hash as Dt } from "object-code";
|
|
33
33
|
import { useReactTable as Nt, getCoreRowModel as Rt, getSortedRowModel as Mt, getFilteredRowModel as zt, getPaginationRowModel as Ut, getFacetedUniqueValues as $t } from "@tanstack/react-table";
|
|
34
34
|
import tt from "invariant";
|
|
35
35
|
import { getAsyncResource as q } from "@mittwald/react-use-promise";
|
|
@@ -42,15 +42,15 @@ import { S as K } from "./SkeletonText-B5ZghZhO.js";
|
|
|
42
42
|
import { d as S, a as G } from "./deepFindOfType-6pG0fH7S.js";
|
|
43
43
|
import { ListLoaderAsyncResource as Ht, TypedListLoaderAsyncResource as Kt } from "./List/ListLoaderAsyncResource.js";
|
|
44
44
|
import { S as Gt } from "./Skeleton-CKLaTmDR.js";
|
|
45
|
-
const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title",
|
|
45
|
+
const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title", _t = "flow--list--items--item--view--top-content", Jt = "flow--list--items--item--view--content", Yt = "flow--list--items--item--view--action", Qt = "flow--list--items--item--view--avatar", Xt = "flow--list--items--item--view--text", Zt = "flow--list--items--item--view--heading", d = {
|
|
46
46
|
view: jt,
|
|
47
47
|
title: Wt,
|
|
48
|
-
topContent:
|
|
49
|
-
content:
|
|
50
|
-
action:
|
|
51
|
-
avatar:
|
|
52
|
-
text:
|
|
53
|
-
heading:
|
|
48
|
+
topContent: _t,
|
|
49
|
+
content: Jt,
|
|
50
|
+
action: Yt,
|
|
51
|
+
avatar: Qt,
|
|
52
|
+
text: Xt,
|
|
53
|
+
heading: Zt,
|
|
54
54
|
"container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
|
|
55
55
|
"container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
|
|
56
56
|
"container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
|
|
@@ -60,22 +60,22 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
60
60
|
"list.noResult.heading": "Keine Suchergebnisse gefunden",
|
|
61
61
|
"list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
|
|
62
62
|
"list.options": "Optionen",
|
|
63
|
-
"list.paginationInfo": (
|
|
63
|
+
"list.paginationInfo": (i) => `${i.visibleItemsCount} von insgesamt ${i.totalItemsCount} angezeigt`,
|
|
64
64
|
"list.resetAll": "Alles zurücksetzen",
|
|
65
|
-
"list.setSorting": (
|
|
65
|
+
"list.setSorting": (i) => `Sortierung: ${i.property}`,
|
|
66
66
|
"list.showMore": "Mehr anzeigen",
|
|
67
67
|
"list.sorting": "Sortierung"
|
|
68
68
|
}, "en-EN": {
|
|
69
69
|
"list.noResult.heading": "No search results found",
|
|
70
70
|
"list.noResult.text": "Your search did not return any results. Please adjust the search query or your filters.",
|
|
71
71
|
"list.options": "Options",
|
|
72
|
-
"list.paginationInfo": (
|
|
72
|
+
"list.paginationInfo": (i) => `Showing ${i.visibleItemsCount} of ${i.totalItemsCount}`,
|
|
73
73
|
"list.resetAll": "Reset filters",
|
|
74
|
-
"list.setSorting": (
|
|
74
|
+
"list.setSorting": (i) => `Sorting: ${i.property}`,
|
|
75
75
|
"list.showMore": "Show more",
|
|
76
76
|
"list.sorting": "Sorting"
|
|
77
|
-
} }, te = (
|
|
78
|
-
const { className: t, children: e } =
|
|
77
|
+
} }, te = (i) => {
|
|
78
|
+
const { className: t, children: e } = i, s = v(g);
|
|
79
79
|
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(
|
|
80
80
|
p,
|
|
81
81
|
{
|
|
@@ -83,60 +83,60 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
83
83
|
className: t,
|
|
84
84
|
"aria-label": s.format("list.options")
|
|
85
85
|
},
|
|
86
|
-
/* @__PURE__ */ r.createElement(
|
|
86
|
+
/* @__PURE__ */ r.createElement(Ct, null)
|
|
87
87
|
), e);
|
|
88
|
-
}, ee = (
|
|
89
|
-
const { children: t, className: e, containerBreakpointSize: s = "m" } =
|
|
88
|
+
}, ee = (i) => i === "top" ? d.topContent : i === "bottom" ? d.content : d.topContent, st = (i) => {
|
|
89
|
+
const { children: t, className: e, containerBreakpointSize: s = "m" } = i, a = {
|
|
90
90
|
ContextMenu: {
|
|
91
|
-
wrapWith: /* @__PURE__ */ r.createElement(te, { className:
|
|
91
|
+
wrapWith: /* @__PURE__ */ r.createElement(te, { className: d.action }),
|
|
92
92
|
placement: "bottom end"
|
|
93
93
|
},
|
|
94
94
|
Button: {
|
|
95
|
-
className:
|
|
95
|
+
className: d.action
|
|
96
96
|
},
|
|
97
97
|
ActionGroup: {
|
|
98
|
-
className:
|
|
98
|
+
className: d.action,
|
|
99
99
|
ignoreBreakpoint: !0
|
|
100
100
|
},
|
|
101
101
|
Content: {
|
|
102
|
-
className:
|
|
102
|
+
className: Ft((l) => ee(l.slot)),
|
|
103
103
|
tunnelId: "topContent"
|
|
104
104
|
},
|
|
105
105
|
Avatar: {
|
|
106
|
-
className:
|
|
106
|
+
className: d.avatar,
|
|
107
107
|
tunnelId: "title"
|
|
108
108
|
},
|
|
109
109
|
Heading: {
|
|
110
|
-
className:
|
|
110
|
+
className: d.heading,
|
|
111
111
|
level: 5,
|
|
112
112
|
tunnelId: "title"
|
|
113
113
|
},
|
|
114
114
|
Text: {
|
|
115
|
-
className:
|
|
115
|
+
className: d.text,
|
|
116
116
|
tunnelId: "title"
|
|
117
117
|
},
|
|
118
118
|
Link: {
|
|
119
119
|
unstyled: !0
|
|
120
120
|
}
|
|
121
121
|
}, o = C(
|
|
122
|
-
|
|
122
|
+
d.view,
|
|
123
123
|
e,
|
|
124
|
-
|
|
124
|
+
d[Tt(s)]
|
|
125
125
|
);
|
|
126
|
-
return /* @__PURE__ */ r.createElement("div", { className: o }, /* @__PURE__ */ r.createElement(vt, { props:
|
|
127
|
-
},
|
|
126
|
+
return /* @__PURE__ */ r.createElement("div", { className: o }, /* @__PURE__ */ r.createElement(vt, { props: a }, /* @__PURE__ */ r.createElement(Lt, null, t, /* @__PURE__ */ r.createElement("div", { className: d.title }, /* @__PURE__ */ r.createElement(U, { id: "title" })), /* @__PURE__ */ r.createElement(U, { id: "topContent" }))));
|
|
127
|
+
}, at = pt({}), m = () => ft(at).list, se = () => m().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(kt, { key: e }, () => {
|
|
128
128
|
t();
|
|
129
|
-
})),
|
|
130
|
-
const { sorting: t } =
|
|
131
|
-
return /* @__PURE__ */ r.createElement(
|
|
132
|
-
}, T = (
|
|
133
|
-
const { children: t, locales: e, variables: s } =
|
|
129
|
+
})), ae = (i) => {
|
|
130
|
+
const { sorting: t } = i;
|
|
131
|
+
return /* @__PURE__ */ r.createElement(X, { id: t.id }, t.name);
|
|
132
|
+
}, T = (i) => {
|
|
133
|
+
const { children: t, locales: e, variables: s } = i;
|
|
134
134
|
return v(e).format(t, s);
|
|
135
|
-
},
|
|
136
|
-
const
|
|
135
|
+
}, ie = () => {
|
|
136
|
+
const i = m(), t = i.visibleSorting.map((a) => /* @__PURE__ */ r.createElement(ae, { sorting: a, key: a.id }));
|
|
137
137
|
if (t.length === 0)
|
|
138
138
|
return null;
|
|
139
|
-
const e =
|
|
139
|
+
const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ r.createElement(f, null, e ? /* @__PURE__ */ r.createElement(
|
|
140
140
|
T,
|
|
141
141
|
{
|
|
142
142
|
locales: g,
|
|
@@ -146,34 +146,34 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
146
146
|
},
|
|
147
147
|
"list.setSorting"
|
|
148
148
|
) : /* @__PURE__ */ r.createElement(T, { locales: g }, "list.sorting"));
|
|
149
|
-
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ r.createElement(
|
|
150
|
-
|
|
149
|
+
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
|
|
150
|
+
Q,
|
|
151
151
|
{
|
|
152
152
|
selectionMode: "single",
|
|
153
153
|
selectedKeys: e ? [e.id] : [],
|
|
154
|
-
onAction: (
|
|
155
|
-
|
|
154
|
+
onAction: (a) => {
|
|
155
|
+
i.getSorting(String(a)).enable();
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
158
|
t
|
|
159
159
|
));
|
|
160
|
-
}, re = (
|
|
161
|
-
const { filter: t } =
|
|
162
|
-
|
|
160
|
+
}, re = (i) => {
|
|
161
|
+
const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */ r.createElement(
|
|
162
|
+
X,
|
|
163
163
|
{
|
|
164
|
-
id:
|
|
165
|
-
key:
|
|
164
|
+
id: c.id,
|
|
165
|
+
key: c.id,
|
|
166
166
|
onAction: () => {
|
|
167
|
-
|
|
167
|
+
c.toggle();
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
|
-
|
|
171
|
-
)),
|
|
172
|
-
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ r.createElement(f, null,
|
|
173
|
-
|
|
170
|
+
c.render()
|
|
171
|
+
)), u = e.filter((c) => c.isActive).map((c) => c.id);
|
|
172
|
+
return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ r.createElement(f, null, a ?? o), /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
|
|
173
|
+
Q,
|
|
174
174
|
{
|
|
175
175
|
selectionMode: s === "one" ? "single" : "multiple",
|
|
176
|
-
selectedKeys:
|
|
176
|
+
selectedKeys: u
|
|
177
177
|
},
|
|
178
178
|
l
|
|
179
179
|
));
|
|
@@ -182,11 +182,11 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
182
182
|
pickerListAndSearch: oe,
|
|
183
183
|
pickerList: le,
|
|
184
184
|
searchField: ce
|
|
185
|
-
}, ue = "flow--list--header--active-filters",
|
|
185
|
+
}, ue = "flow--list--header--active-filters", he = "flow--list--header--active-filters--clear-button", j = {
|
|
186
186
|
activeFilters: ue,
|
|
187
|
-
clearButton:
|
|
188
|
-
},
|
|
189
|
-
const
|
|
187
|
+
clearButton: he
|
|
188
|
+
}, de = () => {
|
|
189
|
+
const i = m(), t = i.filters.flatMap(
|
|
190
190
|
(e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ r.createElement(
|
|
191
191
|
p,
|
|
192
192
|
{
|
|
@@ -205,49 +205,49 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
|
|
|
205
205
|
className: j.clearButton,
|
|
206
206
|
size: "s",
|
|
207
207
|
variant: "plain",
|
|
208
|
-
onPress: () =>
|
|
208
|
+
onPress: () => i.clearFilters()
|
|
209
209
|
},
|
|
210
210
|
/* @__PURE__ */ r.createElement(T, { locales: g }, "list.resetAll")
|
|
211
211
|
));
|
|
212
|
-
}, me = (
|
|
213
|
-
const { className: t, onChange: e, value: s, ...
|
|
214
|
-
|
|
212
|
+
}, me = (i) => {
|
|
213
|
+
const { className: t, onChange: e, value: s, ...a } = i, [o, l] = Y(s ?? "");
|
|
214
|
+
Vt(s, () => {
|
|
215
215
|
l(s ?? "");
|
|
216
216
|
}, [o]);
|
|
217
|
-
const
|
|
217
|
+
const u = () => {
|
|
218
218
|
e(void 0), l("");
|
|
219
|
-
},
|
|
220
|
-
|
|
219
|
+
}, c = (h) => {
|
|
220
|
+
h.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : h.key === "Escape" && u();
|
|
221
221
|
};
|
|
222
222
|
return /* @__PURE__ */ r.createElement(
|
|
223
|
-
|
|
223
|
+
Pt,
|
|
224
224
|
{
|
|
225
225
|
className: t,
|
|
226
226
|
value: o,
|
|
227
|
-
onKeyUp:
|
|
228
|
-
onChange: (
|
|
229
|
-
onClear:
|
|
230
|
-
...
|
|
227
|
+
onKeyUp: c,
|
|
228
|
+
onChange: (h) => l(h),
|
|
229
|
+
onClear: u,
|
|
230
|
+
...a
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
|
-
}, ge = (
|
|
234
|
-
const { className: t, search: e } =
|
|
235
|
-
return
|
|
233
|
+
}, ge = (i) => {
|
|
234
|
+
const { className: t, search: e } = i, s = e.render ?? me;
|
|
235
|
+
return J(s, {
|
|
236
236
|
className: t,
|
|
237
237
|
value: e.value,
|
|
238
238
|
onChange: e.setValue.bind(e),
|
|
239
239
|
...e.textFieldProps
|
|
240
240
|
});
|
|
241
|
-
}, pe = (
|
|
242
|
-
const { className: t } =
|
|
241
|
+
}, pe = (i) => {
|
|
242
|
+
const { className: t } = i, e = m();
|
|
243
243
|
if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
|
|
244
244
|
return null;
|
|
245
|
-
const s = e.filters.map((
|
|
246
|
-
return /* @__PURE__ */ r.createElement("div", { className: C(t, w.header) }, /* @__PURE__ */ r.createElement("div", { className: w.pickerListAndSearch }, /* @__PURE__ */ r.createElement("div", { className: w.pickerList }, /* @__PURE__ */ r.createElement(
|
|
245
|
+
const s = e.filters.map((a) => /* @__PURE__ */ r.createElement(re, { key: a.property, filter: a }));
|
|
246
|
+
return /* @__PURE__ */ r.createElement("div", { className: C(t, w.header) }, /* @__PURE__ */ r.createElement("div", { className: w.pickerListAndSearch }, /* @__PURE__ */ r.createElement("div", { className: w.pickerList }, /* @__PURE__ */ r.createElement(ie, null), s), e.search && /* @__PURE__ */ r.createElement(ge, { className: w.searchField, search: e.search })), /* @__PURE__ */ r.createElement(de, null));
|
|
247
247
|
}, fe = "flow--list", be = {
|
|
248
248
|
list: fe
|
|
249
249
|
};
|
|
250
|
-
let Se = class
|
|
250
|
+
let Se = class it {
|
|
251
251
|
constructor(t, e, s) {
|
|
252
252
|
n(this, "id");
|
|
253
253
|
n(this, "data");
|
|
@@ -255,7 +255,7 @@ let Se = class at {
|
|
|
255
255
|
this.collection = t, this.id = e, this.data = s;
|
|
256
256
|
}
|
|
257
257
|
static fromRow(t, e) {
|
|
258
|
-
return new
|
|
258
|
+
return new it(t, e.id, e.original);
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
class ve {
|
|
@@ -271,9 +271,9 @@ class ye {
|
|
|
271
271
|
constructor(t, e = {}) {
|
|
272
272
|
n(this, "batchSize");
|
|
273
273
|
n(this, "list");
|
|
274
|
-
var
|
|
274
|
+
var a;
|
|
275
275
|
const { batchSize: s = 20 } = e;
|
|
276
|
-
this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (
|
|
276
|
+
this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (a = t.search) == null || a.onUpdated(() => this.reset());
|
|
277
277
|
}
|
|
278
278
|
get reactTable() {
|
|
279
279
|
return this.list.reactTable.table;
|
|
@@ -326,7 +326,7 @@ class W {
|
|
|
326
326
|
return yt(this.value, t.value);
|
|
327
327
|
}
|
|
328
328
|
get id() {
|
|
329
|
-
return `${this.filter.property}@@${
|
|
329
|
+
return `${this.filter.property}@@${Dt(this.value)}`;
|
|
330
330
|
}
|
|
331
331
|
get isActive() {
|
|
332
332
|
return this.filter.isValueActive(this);
|
|
@@ -341,10 +341,11 @@ class W {
|
|
|
341
341
|
this.filter.deactivateValue(this);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
const Ee = (
|
|
345
|
-
class
|
|
344
|
+
const Ee = (i, t) => i === t, Fe = (i) => String(i);
|
|
345
|
+
class Ce {
|
|
346
346
|
constructor(t, e) {
|
|
347
347
|
n(this, "_values");
|
|
348
|
+
n(this, "_valuesFromTableState");
|
|
348
349
|
n(this, "list");
|
|
349
350
|
n(this, "property");
|
|
350
351
|
n(this, "mode");
|
|
@@ -353,28 +354,28 @@ class Fe {
|
|
|
353
354
|
n(this, "name");
|
|
354
355
|
n(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
|
|
355
356
|
var s;
|
|
356
|
-
this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((
|
|
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 W(this, a)), this.matcher = e.matcher ?? Ee, this.renderItem = e.renderItem ?? Fe, this.name = e.name;
|
|
357
358
|
}
|
|
358
359
|
updateTableColumnDef(t) {
|
|
359
360
|
t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
|
|
360
361
|
}
|
|
361
362
|
getReactTableFilterFn() {
|
|
362
363
|
return (t, e, s) => {
|
|
363
|
-
const
|
|
364
|
+
const a = this.property, o = a.startsWith(we) ? t.original : xt(t.original, a);
|
|
364
365
|
return this.checkFilterMatches(o, s);
|
|
365
366
|
};
|
|
366
367
|
}
|
|
367
368
|
checkFilterMatches(t, e) {
|
|
368
369
|
if (e === null)
|
|
369
370
|
return !0;
|
|
370
|
-
const s = (o) => Array.isArray(o) ? o : [o],
|
|
371
|
+
const s = (o) => Array.isArray(o) ? o : [o], a = (o) => this.matcher(o.value, t);
|
|
371
372
|
if (this.mode === "all")
|
|
372
|
-
return s(e).every(
|
|
373
|
+
return s(e).every(a);
|
|
373
374
|
if (this.mode === "some") {
|
|
374
375
|
const o = s(e);
|
|
375
|
-
return o.length === 0 || o.some(
|
|
376
|
+
return o.length === 0 || o.some(a);
|
|
376
377
|
} else if (this.mode === "one")
|
|
377
|
-
return
|
|
378
|
+
return a(e);
|
|
378
379
|
throw new Error(`Unknown filter mode '${this.mode}'`);
|
|
379
380
|
}
|
|
380
381
|
getTableColumnFilter() {
|
|
@@ -387,10 +388,24 @@ class Fe {
|
|
|
387
388
|
var t;
|
|
388
389
|
return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
|
|
389
390
|
}
|
|
390
|
-
|
|
391
|
-
return
|
|
391
|
+
getValuesFromTableState() {
|
|
392
|
+
return wt(
|
|
392
393
|
Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
|
|
393
|
-
).map((t) => new W(this, t))
|
|
394
|
+
).map((t) => new W(this, t));
|
|
395
|
+
}
|
|
396
|
+
checkIfValueIsUnknown(t) {
|
|
397
|
+
return !this.values.some((s) => s.id === t.id);
|
|
398
|
+
}
|
|
399
|
+
deleteUnknownFilterValues() {
|
|
400
|
+
if (this.values !== this.valuesFromTableState)
|
|
401
|
+
for (const t of this.valuesFromTableState)
|
|
402
|
+
this.checkIfValueIsUnknown(t) && this.deactivateValue(t);
|
|
403
|
+
}
|
|
404
|
+
get values() {
|
|
405
|
+
return this._values ?? this.valuesFromTableState;
|
|
406
|
+
}
|
|
407
|
+
get valuesFromTableState() {
|
|
408
|
+
return this._valuesFromTableState || (this._valuesFromTableState = this.getValuesFromTableState()), this._valuesFromTableState;
|
|
394
409
|
}
|
|
395
410
|
getArrayValue() {
|
|
396
411
|
const t = this.getValue();
|
|
@@ -405,7 +420,7 @@ class Fe {
|
|
|
405
420
|
deactivateValue(t) {
|
|
406
421
|
const e = this.getArrayValue();
|
|
407
422
|
let s;
|
|
408
|
-
this.mode === "all" || this.mode === "some" ? s = e.filter((
|
|
423
|
+
this.mode === "all" || this.mode === "some" ? s = e.filter((a) => !a.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
|
|
409
424
|
}
|
|
410
425
|
clearValues() {
|
|
411
426
|
let t;
|
|
@@ -414,7 +429,7 @@ class Fe {
|
|
|
414
429
|
toggleValue(t) {
|
|
415
430
|
const e = this.getArrayValue();
|
|
416
431
|
let s;
|
|
417
|
-
this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((
|
|
432
|
+
this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((a) => !a.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
|
|
418
433
|
}
|
|
419
434
|
onFilterUpdated(t) {
|
|
420
435
|
this.onFilterUpdateCallbacks.add(t);
|
|
@@ -454,25 +469,25 @@ class Le {
|
|
|
454
469
|
return `${this.getTableColumn().id}:${this.direction}`;
|
|
455
470
|
}
|
|
456
471
|
}
|
|
457
|
-
class
|
|
472
|
+
class V {
|
|
458
473
|
constructor(t, e, s = {}) {
|
|
459
474
|
n(this, "list");
|
|
460
475
|
n(this, "table");
|
|
461
476
|
n(this, "sortingState");
|
|
462
477
|
n(this, "updateSortingState");
|
|
463
478
|
this.list = t;
|
|
464
|
-
const
|
|
465
|
-
(
|
|
466
|
-
), [o, l] =
|
|
467
|
-
|
|
479
|
+
const a = this.list.sorting.filter(
|
|
480
|
+
(u) => u.defaultEnabled !== !1
|
|
481
|
+
), [o, l] = Y(
|
|
482
|
+
a.map((u) => u.getReactTableColumnSort())
|
|
468
483
|
);
|
|
469
484
|
this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(e, s);
|
|
470
485
|
}
|
|
471
486
|
static useNew(t, e, s = {}) {
|
|
472
|
-
return new
|
|
487
|
+
return new V(t, e, s);
|
|
473
488
|
}
|
|
474
489
|
useReactTable(t, e = {}) {
|
|
475
|
-
const s = this.list.loader.useData(),
|
|
490
|
+
const s = this.list.loader.useData(), a = Nt({
|
|
476
491
|
data: s,
|
|
477
492
|
state: {
|
|
478
493
|
sorting: this.sortingState
|
|
@@ -494,14 +509,14 @@ class P {
|
|
|
494
509
|
globalFilterFn: "auto",
|
|
495
510
|
...e
|
|
496
511
|
});
|
|
497
|
-
return
|
|
512
|
+
return E(() => {
|
|
498
513
|
t && t(this.list);
|
|
499
|
-
}, [this.list, t,
|
|
514
|
+
}, [this.list, t, a]), a;
|
|
500
515
|
}
|
|
501
516
|
handleSortingStateUpdate(t) {
|
|
502
517
|
const e = typeof t == "function" ? t(this.sortingState) : t, s = this.list.sorting.filter(
|
|
503
|
-
(
|
|
504
|
-
).map((
|
|
518
|
+
(a) => a.defaultEnabled === "hidden" && !e.some((o) => o.id === a.property)
|
|
519
|
+
).map((a) => a.getReactTableColumnSort());
|
|
505
520
|
this.updateSortingState([...s, ...e]);
|
|
506
521
|
}
|
|
507
522
|
get searchString() {
|
|
@@ -513,9 +528,9 @@ class P {
|
|
|
513
528
|
}
|
|
514
529
|
getTableColumnDefs() {
|
|
515
530
|
const t = /* @__PURE__ */ new Map(), e = (s) => {
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
518
|
-
return
|
|
531
|
+
const a = t.get(s);
|
|
532
|
+
if (a)
|
|
533
|
+
return a;
|
|
519
534
|
const o = {
|
|
520
535
|
id: s,
|
|
521
536
|
accessorKey: s,
|
|
@@ -531,7 +546,7 @@ class P {
|
|
|
531
546
|
), Array.from(t.values());
|
|
532
547
|
}
|
|
533
548
|
}
|
|
534
|
-
class
|
|
549
|
+
class P {
|
|
535
550
|
constructor() {
|
|
536
551
|
n(this, "dataBatches", []);
|
|
537
552
|
n(this, "prevDataBatches", []);
|
|
@@ -544,13 +559,13 @@ class x {
|
|
|
544
559
|
batchLoadingStates: $.shallow,
|
|
545
560
|
mergedData: O,
|
|
546
561
|
isLoading: O,
|
|
547
|
-
reset:
|
|
548
|
-
setDataBatch:
|
|
549
|
-
setBatchLoadingState:
|
|
562
|
+
reset: L.bound,
|
|
563
|
+
setDataBatch: L.bound,
|
|
564
|
+
setBatchLoadingState: L.bound
|
|
550
565
|
});
|
|
551
566
|
}
|
|
552
567
|
static useNew() {
|
|
553
|
-
return bt(new
|
|
568
|
+
return bt(new P()).current;
|
|
554
569
|
}
|
|
555
570
|
reset() {
|
|
556
571
|
this.batchLoadingStates = [], this.dataBatches = [];
|
|
@@ -575,7 +590,7 @@ class x {
|
|
|
575
590
|
}
|
|
576
591
|
}
|
|
577
592
|
const Te = [];
|
|
578
|
-
class
|
|
593
|
+
class x {
|
|
579
594
|
constructor(t, e = {}) {
|
|
580
595
|
n(this, "list");
|
|
581
596
|
n(this, "dataSource");
|
|
@@ -583,14 +598,14 @@ class D {
|
|
|
583
598
|
n(this, "manualFiltering");
|
|
584
599
|
n(this, "manualPagination");
|
|
585
600
|
n(this, "loaderState");
|
|
586
|
-
var
|
|
601
|
+
var u;
|
|
587
602
|
const { source: s } = e;
|
|
588
603
|
this.dataSource = s ?? { staticData: Te };
|
|
589
|
-
const
|
|
590
|
-
this.list = t, this.loaderState =
|
|
604
|
+
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 = P.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());
|
|
591
606
|
}
|
|
592
607
|
static useNew(t, e = {}) {
|
|
593
|
-
return new
|
|
608
|
+
return new x(t, e);
|
|
594
609
|
}
|
|
595
610
|
reset() {
|
|
596
611
|
this.loaderState.reset();
|
|
@@ -616,7 +631,7 @@ class D {
|
|
|
616
631
|
}), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
|
|
617
632
|
}
|
|
618
633
|
useObserveBatchLoadingState(t, e) {
|
|
619
|
-
|
|
634
|
+
E(() => (this.loaderState.setBatchLoadingState(
|
|
620
635
|
e,
|
|
621
636
|
t.state.value
|
|
622
637
|
), t.state.observe((s) => {
|
|
@@ -624,12 +639,12 @@ class D {
|
|
|
624
639
|
})), [t, e]);
|
|
625
640
|
}
|
|
626
641
|
useObserveBatchData(t, e) {
|
|
627
|
-
const s = (
|
|
628
|
-
const { data: o, itemTotalCount: l } =
|
|
642
|
+
const s = (a) => {
|
|
643
|
+
const { data: o, itemTotalCount: l } = a;
|
|
629
644
|
this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
|
|
630
645
|
};
|
|
631
|
-
|
|
632
|
-
|
|
646
|
+
E(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
|
|
647
|
+
a.isSet && s(a.value);
|
|
633
648
|
})), [t, e]);
|
|
634
649
|
}
|
|
635
650
|
getDataLoaderOptions(t) {
|
|
@@ -657,19 +672,19 @@ class D {
|
|
|
657
672
|
const e = this.dataSource, s = this.getDataLoaderOptions(t);
|
|
658
673
|
if ("staticData" in e)
|
|
659
674
|
return q(
|
|
660
|
-
async (
|
|
661
|
-
data:
|
|
662
|
-
itemTotalCount:
|
|
675
|
+
async (a) => ({
|
|
676
|
+
data: a,
|
|
677
|
+
itemTotalCount: a.length
|
|
663
678
|
}),
|
|
664
679
|
[e.staticData]
|
|
665
680
|
);
|
|
666
681
|
if ("asyncLoader" in e) {
|
|
667
|
-
const
|
|
668
|
-
return q(
|
|
682
|
+
const a = e.asyncLoader;
|
|
683
|
+
return q(a, [s]);
|
|
669
684
|
}
|
|
670
685
|
if ("asyncResourceFactory" in e) {
|
|
671
|
-
const
|
|
672
|
-
return
|
|
686
|
+
const a = e.asyncResourceFactory;
|
|
687
|
+
return a(s);
|
|
673
688
|
}
|
|
674
689
|
throw new Error("Unknown data source");
|
|
675
690
|
}
|
|
@@ -701,7 +716,7 @@ class Ie {
|
|
|
701
716
|
this.onUpdateCallbacks.add(t);
|
|
702
717
|
}
|
|
703
718
|
}
|
|
704
|
-
const
|
|
719
|
+
const F = class F {
|
|
705
720
|
constructor(t, e = {}) {
|
|
706
721
|
n(this, "list");
|
|
707
722
|
n(this, "textValue");
|
|
@@ -709,15 +724,15 @@ const E = class E {
|
|
|
709
724
|
n(this, "onAction");
|
|
710
725
|
n(this, "fallback");
|
|
711
726
|
n(this, "renderFn");
|
|
712
|
-
const { onAction: s, fallback:
|
|
713
|
-
this.list = t, this.textValue = o, this.renderFn =
|
|
727
|
+
const { onAction: s, fallback: a, textValue: o, href: l, renderFn: u } = e;
|
|
728
|
+
this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = a;
|
|
714
729
|
}
|
|
715
730
|
render(t) {
|
|
716
|
-
return (this.renderFn ??
|
|
731
|
+
return (this.renderFn ?? F.fallbackRenderItemFn)(t);
|
|
717
732
|
}
|
|
718
733
|
};
|
|
719
|
-
n(
|
|
720
|
-
let I =
|
|
734
|
+
n(F, "fallbackRenderItemFn", (t) => J("pre", void 0, JSON.stringify(t)));
|
|
735
|
+
let I = F, ke = class rt {
|
|
721
736
|
constructor(t) {
|
|
722
737
|
n(this, "filters");
|
|
723
738
|
n(this, "itemView");
|
|
@@ -731,16 +746,18 @@ let I = E, ke = class rt {
|
|
|
731
746
|
const {
|
|
732
747
|
itemView: e,
|
|
733
748
|
filters: s = [],
|
|
734
|
-
sorting:
|
|
749
|
+
sorting: a = [],
|
|
735
750
|
batchesController: o,
|
|
736
751
|
hasAction: l,
|
|
737
|
-
onChange:
|
|
752
|
+
onChange: u
|
|
738
753
|
} = t;
|
|
739
|
-
this.items = new ve(this), this.filters = s.map((
|
|
754
|
+
this.items = new ve(this), this.filters = s.map((c) => new Ce(this, c)), this.sorting = a.map((c) => new Le(this, c)), this.search = t.search ? new Ie(this, t.search) : void 0, this.itemView = new I(this, e), this.batches = new ye(this, o), this.loader = x.useNew(this, t.loader), this.reactTable = V.useNew(this, u, {
|
|
740
755
|
manualFiltering: this.loader.manualFiltering,
|
|
741
756
|
manualPagination: this.loader.manualPagination,
|
|
742
757
|
manualSorting: this.loader.manualSorting
|
|
743
|
-
}),
|
|
758
|
+
}), E(() => {
|
|
759
|
+
this.filters.forEach((c) => c.deleteUnknownFilterValues());
|
|
760
|
+
}, [this.filters]), this.hasAction = l;
|
|
744
761
|
}
|
|
745
762
|
static useNew(t) {
|
|
746
763
|
return new rt(t);
|
|
@@ -766,96 +783,96 @@ let I = E, ke = class rt {
|
|
|
766
783
|
return !this.loader.useIsLoading() && this.items.entries.length === 0;
|
|
767
784
|
}
|
|
768
785
|
};
|
|
769
|
-
const Ae = "flow--list--items", Be = "flow--list--items--is-loading",
|
|
786
|
+
const Ae = "flow--list--items", Be = "flow--list--items--is-loading", _ = {
|
|
770
787
|
items: Ae,
|
|
771
788
|
isLoading: Be
|
|
772
|
-
},
|
|
773
|
-
item:
|
|
774
|
-
hasAction:
|
|
775
|
-
},
|
|
776
|
-
const { data: t, children: e } =
|
|
789
|
+
}, Ve = "flow--list--items--item", Pe = "flow--list--items--item--has-action", k = {
|
|
790
|
+
item: Ve,
|
|
791
|
+
hasAction: Pe
|
|
792
|
+
}, xe = (i) => {
|
|
793
|
+
const { data: t, children: e } = i, s = m(), a = s.itemView, 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, h = s.hasAction || !!u || !!c, b = C(k.item, h && k.hasAction);
|
|
777
794
|
return /* @__PURE__ */ r.createElement(
|
|
778
795
|
B.GridListItem,
|
|
779
796
|
{
|
|
780
797
|
className: b,
|
|
781
|
-
onAction:
|
|
798
|
+
onAction: u,
|
|
782
799
|
textValue: l,
|
|
783
|
-
href:
|
|
800
|
+
href: c
|
|
784
801
|
},
|
|
785
|
-
e ??
|
|
802
|
+
e ?? a.render(t)
|
|
786
803
|
);
|
|
787
|
-
},
|
|
788
|
-
const
|
|
789
|
-
return /* @__PURE__ */ r.createElement(Ot, null, /* @__PURE__ */ r.createElement(qt, null), /* @__PURE__ */ r.createElement(et, null,
|
|
804
|
+
}, De = (i) => /* @__PURE__ */ r.createElement(B.GridListItem, { textValue: "-", className: k.item }, i.children), Ne = () => {
|
|
805
|
+
const i = v(g);
|
|
806
|
+
return /* @__PURE__ */ r.createElement(Ot, null, /* @__PURE__ */ r.createElement(qt, null), /* @__PURE__ */ r.createElement(et, null, i.format("list.noResult.heading")), /* @__PURE__ */ r.createElement(f, null, i.format("list.noResult.text")));
|
|
790
807
|
}, Re = () => /* @__PURE__ */ r.createElement(st, null, /* @__PURE__ */ r.createElement(et, null, /* @__PURE__ */ r.createElement(K, { width: "200px" })), /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(K, { width: "300px" }))), Me = () => {
|
|
791
808
|
const t = m().itemView.fallback ?? /* @__PURE__ */ r.createElement(Re, null);
|
|
792
|
-
return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ r.createElement(
|
|
793
|
-
}, ze = (
|
|
794
|
-
const { className: t, ...e } =
|
|
795
|
-
|
|
809
|
+
return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ r.createElement(De, { key: s }, St(t)));
|
|
810
|
+
}, ze = (i) => {
|
|
811
|
+
const { className: t, ...e } = i, s = m(), a = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), u = s.items.entries.map((h) => /* @__PURE__ */ r.createElement(xe, { key: h.id, data: h.data })), c = C(
|
|
812
|
+
_.items,
|
|
796
813
|
t,
|
|
797
|
-
|
|
814
|
+
a && _.isLoading
|
|
798
815
|
);
|
|
799
|
-
return l ? /* @__PURE__ */ r.createElement(Ne, null) : /* @__PURE__ */ r.createElement("div", { "aria-hidden": o, "aria-busy":
|
|
800
|
-
}, nt = (
|
|
816
|
+
return l ? /* @__PURE__ */ r.createElement(Ne, null) : /* @__PURE__ */ r.createElement("div", { "aria-hidden": o, "aria-busy": a }, /* @__PURE__ */ r.createElement(B.GridList, { className: c, ...e }, o ? /* @__PURE__ */ r.createElement(Me, null) : u));
|
|
817
|
+
}, nt = (i) => null, Ue = () => nt, ot = (i) => null, $e = () => ot, lt = (i) => null, Oe = () => lt, ct = (i) => null, qe = () => ct, ut = (i) => null, He = () => ut, Ke = "flow--list--footer", Ge = {
|
|
801
818
|
footer: Ke
|
|
802
|
-
}, je = (
|
|
803
|
-
const t = v(g), e = m(), s = e.batches,
|
|
819
|
+
}, je = (i) => {
|
|
820
|
+
const t = v(g), e = m(), s = e.batches, a = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
|
|
804
821
|
if (o)
|
|
805
822
|
return null;
|
|
806
|
-
const
|
|
807
|
-
visibleItemsCount:
|
|
823
|
+
const c = a ? /* @__PURE__ */ r.createElement(Gt, { width: "200px" }) : t.format("list.paginationInfo", {
|
|
824
|
+
visibleItemsCount: u,
|
|
808
825
|
totalItemsCount: l
|
|
809
826
|
});
|
|
810
|
-
return /* @__PURE__ */ r.createElement(f, { ...
|
|
811
|
-
}, We = (
|
|
812
|
-
const t = v(g), e = m(), s = e.loader.useIsLoading(),
|
|
827
|
+
return /* @__PURE__ */ r.createElement(f, { ...i }, c);
|
|
828
|
+
}, We = (i) => {
|
|
829
|
+
const t = v(g), e = m(), s = e.loader.useIsLoading(), a = e.loader.useIsInitiallyLoading();
|
|
813
830
|
return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ r.createElement(
|
|
814
831
|
p,
|
|
815
832
|
{
|
|
816
|
-
isPending: s && !
|
|
817
|
-
isDisabled:
|
|
818
|
-
...
|
|
833
|
+
isPending: s && !a,
|
|
834
|
+
isDisabled: a,
|
|
835
|
+
...i,
|
|
819
836
|
onPress: () => e.batches.nextBatch(),
|
|
820
837
|
variant: "plain",
|
|
821
838
|
size: "s"
|
|
822
839
|
},
|
|
823
840
|
t.format("list.showMore")
|
|
824
841
|
);
|
|
825
|
-
},
|
|
826
|
-
function
|
|
842
|
+
}, _e = () => /* @__PURE__ */ r.createElement("div", { className: Ge.footer }, /* @__PURE__ */ r.createElement(je, null), /* @__PURE__ */ r.createElement(We, null));
|
|
843
|
+
function ht(i) {
|
|
827
844
|
return null;
|
|
828
845
|
}
|
|
829
|
-
const
|
|
830
|
-
var
|
|
831
|
-
const { children: t, batchSize: e, onChange: s, ...
|
|
846
|
+
const Je = () => ht, Ye = It("List", (i) => {
|
|
847
|
+
var D, N, R, M, z;
|
|
848
|
+
const { children: t, batchSize: e, onChange: s, ...a } = i, o = (D = S(
|
|
832
849
|
t,
|
|
833
850
|
nt
|
|
834
|
-
)) == null ? void 0 :
|
|
851
|
+
)) == null ? void 0 : D.props, l = (N = S(
|
|
835
852
|
t,
|
|
836
853
|
Ht
|
|
837
|
-
)) == null ? void 0 : N.props,
|
|
854
|
+
)) == null ? void 0 : N.props, u = (R = S(t, ut)) == null ? void 0 : R.props, c = {
|
|
838
855
|
source: o ? {
|
|
839
856
|
...o,
|
|
840
857
|
asyncLoader: o.children
|
|
841
858
|
} : l ? {
|
|
842
859
|
...l,
|
|
843
860
|
asyncResourceFactory: l.children
|
|
844
|
-
} :
|
|
845
|
-
staticData:
|
|
861
|
+
} : u ? {
|
|
862
|
+
staticData: u.data
|
|
846
863
|
} : void 0
|
|
847
|
-
},
|
|
864
|
+
}, h = (M = S(t, ht)) == null ? void 0 : M.props, b = (z = S(t, ct)) == null ? void 0 : z.props, dt = ke.useNew({
|
|
848
865
|
onChange: s,
|
|
849
|
-
loader:
|
|
866
|
+
loader: c,
|
|
850
867
|
filters: G(t, ot).map(
|
|
851
868
|
(y) => ({
|
|
852
869
|
...y.props,
|
|
853
870
|
renderItem: y.props.children
|
|
854
871
|
})
|
|
855
872
|
),
|
|
856
|
-
search:
|
|
857
|
-
render:
|
|
858
|
-
textFieldProps:
|
|
873
|
+
search: h ? {
|
|
874
|
+
render: h.children,
|
|
875
|
+
textFieldProps: h
|
|
859
876
|
} : void 0,
|
|
860
877
|
sorting: G(t, lt).map((y) => y.props),
|
|
861
878
|
itemView: b ? {
|
|
@@ -865,22 +882,22 @@ const Ye = () => dt, Qe = It("List", (a) => {
|
|
|
865
882
|
batchesController: {
|
|
866
883
|
batchSize: e
|
|
867
884
|
},
|
|
868
|
-
hasAction: !!
|
|
885
|
+
hasAction: !!i.onAction
|
|
869
886
|
});
|
|
870
887
|
return /* @__PURE__ */ r.createElement(
|
|
871
|
-
|
|
888
|
+
at.Provider,
|
|
872
889
|
{
|
|
873
890
|
value: {
|
|
874
|
-
list:
|
|
891
|
+
list: dt
|
|
875
892
|
}
|
|
876
893
|
},
|
|
877
894
|
/* @__PURE__ */ r.createElement(se, null),
|
|
878
|
-
/* @__PURE__ */ r.createElement("div", { className: be.list }, /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ze, { ...
|
|
895
|
+
/* @__PURE__ */ r.createElement("div", { className: be.list }, /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ze, { ...a }), /* @__PURE__ */ r.createElement(_e, null))
|
|
879
896
|
);
|
|
880
|
-
}),
|
|
881
|
-
List:
|
|
897
|
+
}), Qe = () => Ye, Ms = () => ({
|
|
898
|
+
List: Qe(),
|
|
882
899
|
Filter: $e(),
|
|
883
|
-
Search:
|
|
900
|
+
Search: Je(),
|
|
884
901
|
Sorting: Oe(),
|
|
885
902
|
Item: qe(),
|
|
886
903
|
ItemView: st,
|
|
@@ -889,14 +906,14 @@ const Ye = () => dt, Qe = It("List", (a) => {
|
|
|
889
906
|
LoaderAsyncResource: Kt()
|
|
890
907
|
});
|
|
891
908
|
export {
|
|
892
|
-
|
|
909
|
+
Ye as List,
|
|
893
910
|
ot as ListFilter,
|
|
894
911
|
ct as ListItem,
|
|
895
912
|
st as ListItemView,
|
|
896
913
|
nt as ListLoaderAsync,
|
|
897
914
|
lt as ListSorting,
|
|
898
915
|
ut as ListStaticData,
|
|
899
|
-
|
|
916
|
+
Qe as TypedList,
|
|
900
917
|
$e as TypedListFilter,
|
|
901
918
|
qe as TypedListItem,
|
|
902
919
|
Ue as TypedListLoaderAsync,
|
package/dist/Tabs.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import e, { useRef as
|
|
3
|
+
import e, { useRef as g, useState as v, useEffect as M, useId as w, createContext as h, useContext as I } from "react";
|
|
4
4
|
import * as E from "react-aria-components";
|
|
5
5
|
import u from "clsx";
|
|
6
|
-
import { TunnelExit as C, TunnelProvider as
|
|
7
|
-
import { f as
|
|
6
|
+
import { TunnelExit as C, TunnelProvider as P, TunnelEntry as f } from "@mittwald/react-tunnel";
|
|
7
|
+
import { f as y } from "./flowComponent-DHPUcYyM.js";
|
|
8
8
|
import { useCallbackRef as O } from "use-callback-ref";
|
|
9
|
-
import { a as
|
|
10
|
-
import { M as
|
|
11
|
-
import { B as
|
|
9
|
+
import { a as S, C as A } from "./ContextMenuTrigger-BdJf5T8A.js";
|
|
10
|
+
import { M as B } from "./MenuItem-DcfYvfPJ.js";
|
|
11
|
+
import { B as K } from "./Button-DQtavSbo.js";
|
|
12
12
|
import "@tabler/icons-react";
|
|
13
13
|
import "./Icon-DPoIVASu.js";
|
|
14
|
-
import { I as
|
|
15
|
-
import { T as
|
|
14
|
+
import { I as L } from "./IconContextMenu-jwoVcLvd.js";
|
|
15
|
+
import { T as F } from "./Text-Sd5q3Yme.js";
|
|
16
16
|
import "./propsContext-DzAKlmhS.js";
|
|
17
|
-
import { P as
|
|
17
|
+
import { P as R } from "./PropsContextProvider-C6Z4XGp6.js";
|
|
18
18
|
import "@react-aria/utils";
|
|
19
19
|
import "remeda";
|
|
20
|
-
const
|
|
21
|
-
tabs:
|
|
22
|
-
list:
|
|
23
|
-
},
|
|
24
|
-
tabList:
|
|
25
|
-
contextMenuButton:
|
|
26
|
-
titles:
|
|
27
|
-
collapsed:
|
|
28
|
-
},
|
|
29
|
-
const s =
|
|
20
|
+
const W = "flow--tabs", $ = "flow--tabs--list", k = {
|
|
21
|
+
tabs: W,
|
|
22
|
+
list: $
|
|
23
|
+
}, j = "flow--tabs--tab-list", q = "flow--tabs--tab-list--context-menu-button", z = "flow--tabs--tab-list--titles", D = "flow--tabs--tab-list--collapsed", b = {
|
|
24
|
+
tabList: j,
|
|
25
|
+
contextMenuButton: q,
|
|
26
|
+
titles: z,
|
|
27
|
+
collapsed: D
|
|
28
|
+
}, G = () => {
|
|
29
|
+
const s = g(), [n, r] = v(!1), o = O(null, (t) => {
|
|
30
30
|
l(), c(t);
|
|
31
31
|
}), a = ([
|
|
32
32
|
t
|
|
@@ -49,38 +49,37 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
|
|
|
49
49
|
ref: o,
|
|
50
50
|
isOverflowing: n
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
tabTitle:
|
|
54
|
-
text:
|
|
55
|
-
menuItem:
|
|
56
|
-
},
|
|
52
|
+
}, H = "flow--tabs--tab-title", J = "flow--tabs--tab-title--text", Q = "flow--tabs--tab-title--menu-item", p = {
|
|
53
|
+
tabTitle: H,
|
|
54
|
+
text: J,
|
|
55
|
+
menuItem: Q
|
|
56
|
+
}, U = (s) => {
|
|
57
57
|
const { className: n, ...r } = s, o = u(n, p.tabTitle);
|
|
58
58
|
return /* @__PURE__ */ e.createElement("div", { ...r, className: o, "data-selected": !0 }, /* @__PURE__ */ e.createElement(C, { id: "ActiveTitle" }));
|
|
59
|
-
},
|
|
60
|
-
const { selection: n, disabledKeys: r, onContextMenuSelectionChange: o } = s, a =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
L,
|
|
59
|
+
}, V = (s) => {
|
|
60
|
+
const { selection: n, disabledKeys: r, onContextMenuSelectionChange: o } = s, a = w(), c = G(), l = c.isOverflowing, t = u(b.tabList, l && b.collapsed), i = (x) => {
|
|
61
|
+
o(x);
|
|
62
|
+
}, m = /* @__PURE__ */ e.createElement(E.TabList, { className: b.titles, ref: c.ref }, /* @__PURE__ */ e.createElement(C, { id: "Titles" })), d = l && /* @__PURE__ */ e.createElement(U, { id: a }), T = l && /* @__PURE__ */ e.createElement(S, null, /* @__PURE__ */ e.createElement(
|
|
63
|
+
K,
|
|
65
64
|
{
|
|
66
65
|
variant: "soft",
|
|
67
66
|
className: b.contextMenuButton,
|
|
68
67
|
color: "secondary",
|
|
69
68
|
"aria-labelledby": a
|
|
70
69
|
},
|
|
71
|
-
/* @__PURE__ */ e.createElement(
|
|
70
|
+
/* @__PURE__ */ e.createElement(L, null)
|
|
72
71
|
), /* @__PURE__ */ e.createElement(
|
|
73
|
-
|
|
72
|
+
A,
|
|
74
73
|
{
|
|
75
74
|
disabledKeys: r,
|
|
76
75
|
selectedKeys: n ? [n] : void 0,
|
|
77
76
|
selectionMode: "navigation",
|
|
78
|
-
|
|
77
|
+
onAction: (x) => i(x)
|
|
79
78
|
},
|
|
80
79
|
/* @__PURE__ */ e.createElement(C, { id: "ContextMenuItems" })
|
|
81
80
|
));
|
|
82
81
|
return /* @__PURE__ */ e.createElement("div", { className: t }, m, d, T);
|
|
83
|
-
},
|
|
82
|
+
}, Ce = y("Tabs", (s) => {
|
|
84
83
|
const {
|
|
85
84
|
children: n,
|
|
86
85
|
className: r,
|
|
@@ -88,10 +87,10 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
|
|
|
88
87
|
disabledKeys: a,
|
|
89
88
|
refProp: c,
|
|
90
89
|
...l
|
|
91
|
-
} = s, t = u(
|
|
90
|
+
} = s, t = u(k.tabs, r), [i, m] = v(
|
|
92
91
|
o
|
|
93
92
|
);
|
|
94
|
-
return /* @__PURE__ */ e.createElement(
|
|
93
|
+
return /* @__PURE__ */ e.createElement(P, null, n, /* @__PURE__ */ e.createElement(
|
|
95
94
|
E.Tabs,
|
|
96
95
|
{
|
|
97
96
|
slot: null,
|
|
@@ -103,7 +102,7 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
|
|
|
103
102
|
ref: c
|
|
104
103
|
},
|
|
105
104
|
/* @__PURE__ */ e.createElement(
|
|
106
|
-
|
|
105
|
+
V,
|
|
107
106
|
{
|
|
108
107
|
selection: i,
|
|
109
108
|
onContextMenuSelectionChange: m,
|
|
@@ -112,15 +111,15 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
|
|
|
112
111
|
),
|
|
113
112
|
/* @__PURE__ */ e.createElement(C, { id: "Panels" })
|
|
114
113
|
));
|
|
115
|
-
}),
|
|
114
|
+
}), N = h({
|
|
116
115
|
id: "undefined"
|
|
117
|
-
}),
|
|
118
|
-
const { children: n, className: r, ...o } = s, { id: a } =
|
|
119
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(f, { id: "Titles" }, /* @__PURE__ */ e.createElement(E.Tab, { ...o, id: a, className: c }, (l) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
120
|
-
},
|
|
121
|
-
tabPanel:
|
|
122
|
-
},
|
|
123
|
-
const { children: n, className: r, id: o, ...a } = s, c = u(
|
|
116
|
+
}), X = () => I(N), Y = N.Provider, Ee = (s) => {
|
|
117
|
+
const { children: n, className: r, ...o } = s, { id: a } = X(), c = u(p.tabTitle, r);
|
|
118
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(f, { id: "Titles" }, /* @__PURE__ */ e.createElement(E.Tab, { ...o, id: a, className: c }, (l) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(F, { emulateBoldWidth: !0 }, /* @__PURE__ */ e.createElement("span", { className: p.text }, n)), /* @__PURE__ */ e.createElement(f, { id: "ActiveTitle" }, l.isSelected && n)))), /* @__PURE__ */ e.createElement(f, { id: "ContextMenuItems" }, /* @__PURE__ */ e.createElement(B, { className: p.menuItem, id: a }, n)));
|
|
119
|
+
}, Z = "flow--tabs--tab--tab-panel", _ = {
|
|
120
|
+
tabPanel: Z
|
|
121
|
+
}, Te = (s) => {
|
|
122
|
+
const { children: n, className: r, id: o, ...a } = s, c = u(_.tabPanel, r), l = w(), t = o ?? l, i = (m) => {
|
|
124
123
|
const d = m.state.selectedKey === t, T = {
|
|
125
124
|
Content: {
|
|
126
125
|
isActive: d
|
|
@@ -130,7 +129,7 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
|
|
|
130
129
|
}
|
|
131
130
|
};
|
|
132
131
|
return /* @__PURE__ */ e.createElement(
|
|
133
|
-
|
|
132
|
+
R,
|
|
134
133
|
{
|
|
135
134
|
props: T,
|
|
136
135
|
dependencies: [d, n]
|
|
@@ -138,7 +137,7 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
|
|
|
138
137
|
n
|
|
139
138
|
);
|
|
140
139
|
};
|
|
141
|
-
return /* @__PURE__ */ e.createElement(f, { id: "Panels" }, /* @__PURE__ */ e.createElement(
|
|
140
|
+
return /* @__PURE__ */ e.createElement(f, { id: "Panels" }, /* @__PURE__ */ e.createElement(Y, { value: { id: t } }, /* @__PURE__ */ e.createElement(
|
|
142
141
|
E.TabPanel,
|
|
143
142
|
{
|
|
144
143
|
className: c,
|
|
@@ -150,8 +149,8 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
|
|
|
150
149
|
)));
|
|
151
150
|
};
|
|
152
151
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
Te as Tab,
|
|
153
|
+
Ee as TabTitle,
|
|
154
|
+
Ce as Tabs,
|
|
155
|
+
Ce as default
|
|
157
156
|
};
|
|
@@ -6,6 +6,7 @@ import { FilterValue } from './FilterValue';
|
|
|
6
6
|
|
|
7
7
|
export declare class Filter<T, TProp extends PropertyName<T>, TMatchValue> {
|
|
8
8
|
private _values?;
|
|
9
|
+
private _valuesFromTableState?;
|
|
9
10
|
readonly list: List<T>;
|
|
10
11
|
readonly property: PropertyName<T>;
|
|
11
12
|
readonly mode: FilterMode;
|
|
@@ -20,11 +21,15 @@ export declare class Filter<T, TProp extends PropertyName<T>, TMatchValue> {
|
|
|
20
21
|
protected getTableColumnFilter(): ColumnFilter | undefined;
|
|
21
22
|
private getTableColumn;
|
|
22
23
|
getValue(): unknown;
|
|
24
|
+
private getValuesFromTableState;
|
|
25
|
+
private checkIfValueIsUnknown;
|
|
26
|
+
deleteUnknownFilterValues(): void;
|
|
23
27
|
get values(): FilterValue[];
|
|
28
|
+
private get valuesFromTableState();
|
|
24
29
|
getArrayValue(): FilterValue[];
|
|
25
30
|
isValueActive(value: FilterValue): boolean;
|
|
26
31
|
isActive(): boolean;
|
|
27
|
-
deactivateValue(
|
|
32
|
+
deactivateValue(value: FilterValue): void;
|
|
28
33
|
clearValues(): void;
|
|
29
34
|
toggleValue(newValue: FilterValue): void;
|
|
30
35
|
onFilterUpdated(cb: () => unknown): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.206",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
"dependencies": {
|
|
293
293
|
"@chakra-ui/live-region": "^2.1.0",
|
|
294
294
|
"@internationalized/string-compiler": "^3.2.4",
|
|
295
|
-
"@mittwald/react-tunnel": "^0.1.0-alpha.
|
|
295
|
+
"@mittwald/react-tunnel": "^0.1.0-alpha.206",
|
|
296
296
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
297
297
|
"@react-aria/utils": "^3.25.1",
|
|
298
298
|
"@react-types/shared": "^3.24.1",
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
},
|
|
319
319
|
"devDependencies": {
|
|
320
320
|
"@faker-js/faker": "^8.4.1",
|
|
321
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
321
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.206",
|
|
322
322
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
323
323
|
"@nx/storybook": "^19.5.6",
|
|
324
324
|
"@storybook/addon-a11y": "^8.2.7",
|
|
@@ -396,5 +396,5 @@
|
|
|
396
396
|
"optional": true
|
|
397
397
|
}
|
|
398
398
|
},
|
|
399
|
-
"gitHead": "
|
|
399
|
+
"gitHead": "60ab89d3d123c93a5f70d25a6b547c0429df9a7a"
|
|
400
400
|
}
|