@lablup/ui-common 0.2.0-alpha.16 → 0.2.0-alpha.18
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/README.md +1 -0
- package/astryx/components/Board.doc.mjs +122 -0
- package/astryx/components/Board.tsx +3 -0
- package/astryx/docs/ui-common.doc.mjs +1 -1
- package/dist/assets/components/Board/Board.css +2 -0
- package/dist/components/Board/Board.d.ts +102 -0
- package/dist/components/Board/Board.messages.d.ts +62 -0
- package/dist/components/Board/Board.messages.js +68 -0
- package/dist/components/Board/Board.messages.js.map +1 -0
- package/dist/components/Board/Board2.js +607 -0
- package/dist/components/Board/Board2.js.map +1 -0
- package/dist/components/Board/engine.d.ts +60 -0
- package/dist/components/Board/engine.js +397 -0
- package/dist/components/Board/engine.js.map +1 -0
- package/dist/components/Board/index.d.ts +4 -0
- package/dist/components/Board/index.js +3 -0
- package/dist/components/Board/layout.d.ts +81 -0
- package/dist/components/Board/layout.js +67 -0
- package/dist/components/Board/layout.js.map +1 -0
- package/dist/components/Board/scroll.d.ts +38 -0
- package/dist/components/Board/scroll.js +42 -0
- package/dist/components/Board/scroll.js.map +1 -0
- package/dist/components/DataGrid/DataGrid2.js +128 -128
- package/dist/components/DataGrid/DataGrid2.js.map +1 -1
- package/dist/components/Form/FormItem.d.ts +1 -1
- package/dist/components/Modal/modalStack.d.ts +9 -8
- package/dist/components/Modal/modalStack.js +29 -26
- package/dist/components/Modal/modalStack.js.map +1 -1
- package/dist/components/PageHeader/PageHeader2.js +4 -4
- package/dist/components/PagedSelector/PagedSelector2.js +37 -37
- package/dist/components/PagedSelector/PagedSelector2.js.map +1 -1
- package/dist/components/SelectionLabel/SelectionLabel.js +4 -4
- package/dist/forks/Drawer/Drawer.js +71 -53
- package/dist/forks/Drawer/Drawer.js.map +1 -1
- package/dist/forks/Drawer/useDrawerDialogPresence.d.ts +6 -6
- package/dist/forks/Drawer/useDrawerDialogPresence.js +19 -31
- package/dist/forks/Drawer/useDrawerDialogPresence.js.map +1 -1
- package/dist/i18n/catalog.js +27 -25
- package/dist/i18n/catalog.js.map +1 -1
- package/dist/i18n/locales/de-DE.js +60 -0
- package/dist/i18n/locales/de-DE.js.map +1 -1
- package/dist/i18n/locales/el-GR.js +60 -0
- package/dist/i18n/locales/el-GR.js.map +1 -1
- package/dist/i18n/locales/es-ES.js +60 -0
- package/dist/i18n/locales/es-ES.js.map +1 -1
- package/dist/i18n/locales/fi-FI.js +60 -0
- package/dist/i18n/locales/fi-FI.js.map +1 -1
- package/dist/i18n/locales/fr-FR.js +60 -0
- package/dist/i18n/locales/fr-FR.js.map +1 -1
- package/dist/i18n/locales/id-ID.js +60 -0
- package/dist/i18n/locales/id-ID.js.map +1 -1
- package/dist/i18n/locales/it-IT.js +60 -0
- package/dist/i18n/locales/it-IT.js.map +1 -1
- package/dist/i18n/locales/ja-JP.js +60 -0
- package/dist/i18n/locales/ja-JP.js.map +1 -1
- package/dist/i18n/locales/ko-KR.js +60 -0
- package/dist/i18n/locales/ko-KR.js.map +1 -1
- package/dist/i18n/locales/mn-MN.js +60 -0
- package/dist/i18n/locales/mn-MN.js.map +1 -1
- package/dist/i18n/locales/ms-MY.js +60 -0
- package/dist/i18n/locales/ms-MY.js.map +1 -1
- package/dist/i18n/locales/pl-PL.js +60 -0
- package/dist/i18n/locales/pl-PL.js.map +1 -1
- package/dist/i18n/locales/pt-BR.js +60 -0
- package/dist/i18n/locales/pt-BR.js.map +1 -1
- package/dist/i18n/locales/pt-PT.js +60 -0
- package/dist/i18n/locales/pt-PT.js.map +1 -1
- package/dist/i18n/locales/ru-RU.js +60 -0
- package/dist/i18n/locales/ru-RU.js.map +1 -1
- package/dist/i18n/locales/th-TH.js +60 -0
- package/dist/i18n/locales/th-TH.js.map +1 -1
- package/dist/i18n/locales/tr-TR.js +60 -0
- package/dist/i18n/locales/tr-TR.js.map +1 -1
- package/dist/i18n/locales/vi-VN.js +60 -0
- package/dist/i18n/locales/vi-VN.js.map +1 -1
- package/dist/i18n/locales/zh-CN.js +60 -0
- package/dist/i18n/locales/zh-CN.js.map +1 -1
- package/dist/i18n/locales/zh-TW.js +60 -0
- package/dist/i18n/locales/zh-TW.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +61 -59
- package/dist/instance.js +1 -1
- package/dist/ui-common-locales/de-DE.json +60 -0
- package/dist/ui-common-locales/el-GR.json +60 -0
- package/dist/ui-common-locales/en.json +60 -0
- package/dist/ui-common-locales/es-ES.json +60 -0
- package/dist/ui-common-locales/fi-FI.json +60 -0
- package/dist/ui-common-locales/fr-FR.json +60 -0
- package/dist/ui-common-locales/id-ID.json +60 -0
- package/dist/ui-common-locales/it-IT.json +60 -0
- package/dist/ui-common-locales/ja-JP.json +60 -0
- package/dist/ui-common-locales/ko-KR.json +60 -0
- package/dist/ui-common-locales/mn-MN.json +60 -0
- package/dist/ui-common-locales/ms-MY.json +60 -0
- package/dist/ui-common-locales/pl-PL.json +60 -0
- package/dist/ui-common-locales/pt-BR.json +60 -0
- package/dist/ui-common-locales/pt-PT.json +60 -0
- package/dist/ui-common-locales/ru-RU.json +60 -0
- package/dist/ui-common-locales/th-TH.json +60 -0
- package/dist/ui-common-locales/tr-TR.json +60 -0
- package/dist/ui-common-locales/vi-VN.json +60 -0
- package/dist/ui-common-locales/zh-CN.json +60 -0
- package/dist/ui-common-locales/zh-TW.json +60 -0
- package/exports.customs.json +1 -0
- package/package.json +1 -1
|
@@ -8,26 +8,26 @@ import { Button as ee } from "@astryxdesign/core/Button";
|
|
|
8
8
|
import { HStack as te, VStack as s } from "@astryxdesign/core/Stack";
|
|
9
9
|
import { Text as c } from "@astryxdesign/core/Text";
|
|
10
10
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { Pagination as
|
|
16
|
-
import { Table as
|
|
11
|
+
import { IconButton as f } from "@astryxdesign/core/IconButton";
|
|
12
|
+
import { Icon as p } from "@astryxdesign/core/Icon";
|
|
13
|
+
import { ChevronDown as ne, ChevronRight as re, FileDown as ie, Inbox as ae, Settings as oe } from "lucide-react";
|
|
14
|
+
import { EmptyState as se } from "@astryxdesign/core/EmptyState";
|
|
15
|
+
import { Pagination as ce } from "@astryxdesign/core/Pagination";
|
|
16
|
+
import { Table as le, pixel as m, proportional as ue, useTableColumnResize as de, useTableColumnSettings as fe, useTableSelection as pe, useTableSortable as me, useTableStickyColumns as he } from "@astryxdesign/core/Table";
|
|
17
17
|
//#region src/components/DataGrid/DataGrid.tsx
|
|
18
|
-
var
|
|
18
|
+
var h = "__uic_expand__", ge = "__xds_selection", _e = 52, ve = 56, ye = 40, be = 60, g = "__uic_detail_for__", xe = 10, Se = [
|
|
19
19
|
10,
|
|
20
20
|
20,
|
|
21
21
|
50
|
|
22
|
-
],
|
|
23
|
-
icon:
|
|
22
|
+
], Ce = /* @__PURE__ */ u(p, {
|
|
23
|
+
icon: ae,
|
|
24
24
|
size: "lg",
|
|
25
25
|
color: "secondary"
|
|
26
|
-
}),
|
|
26
|
+
}), we = {
|
|
27
27
|
width: "auto",
|
|
28
28
|
maxWidth: "none"
|
|
29
|
-
},
|
|
30
|
-
function
|
|
29
|
+
}, Te = { maxWidth: "none" }, Ee = { zIndex: 3 }, _ = (e) => !!e && typeof e == "object" && g in e, De = (e) => typeof e == "number" ? `${e}px` : e;
|
|
30
|
+
function v(e, t) {
|
|
31
31
|
return {
|
|
32
32
|
...e,
|
|
33
33
|
htmlProps: {
|
|
@@ -39,15 +39,15 @@ function y(e, t) {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Oe(e, t, n) {
|
|
43
43
|
return Math.min(Math.max(e, t), n);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function y(e) {
|
|
46
46
|
if (e.label) return e.label;
|
|
47
47
|
let t = r(e.header).trim(), n = r(e.groupHeader).trim();
|
|
48
48
|
return (n && t ? `${n} / ${t}` : t || n) || e.key;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function ke({ columns: e, result: t, defaultOverrides: n = {}, overrides: r, isReorderable: i }) {
|
|
51
51
|
let a = e.map((e) => e.key), o = i && (t.columnOrder.length !== a.length || t.columnOrder.some((e, t) => e !== a[t]) || e.some((e) => n[e.key]?.order !== void 0)), ee = {};
|
|
52
52
|
for (let i of e) {
|
|
53
53
|
let e = n[i.key], a = !!i.isHiddenByDefault, te = e?.hidden ?? a, s = !t.selectedColumnKeys.includes(i.key), c = {};
|
|
@@ -60,28 +60,28 @@ function Oe({ columns: e, result: t, defaultOverrides: n = {}, overrides: r, isR
|
|
|
60
60
|
}
|
|
61
61
|
return ee;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ae(e, t) {
|
|
64
64
|
if (e.isAlwaysVisible) return !0;
|
|
65
65
|
let n = t?.[e.key]?.hidden;
|
|
66
66
|
return n === void 0 ? !e.isHiddenByDefault : !n;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function b(e, t) {
|
|
69
69
|
let [n, r] = o(t), i = e !== void 0;
|
|
70
70
|
return [i ? e : n, (e) => {
|
|
71
71
|
i || r(e);
|
|
72
72
|
}];
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
let
|
|
76
|
-
ot || at(e),
|
|
74
|
+
function je({ data: r, columns: i = [], idKey: p = "id", isLoading: ae = !1, isResizable: je = !0, sort: Ne, defaultSort: Pe, onSortChange: Fe, selection: x, pagination: Ie, columnSettings: S, csvExport: C, expansion: w, emptyState: T, getRowProps: Le, scrollWidth: Re, maxHeight: ze, isHeaderHidden: Be = !1, expandRowLabel: Ve, invalidPageText: He, goToFirstPageLabel: Ue, paginationLabel: We, renderRange: Ge, settingsLabel: Ke, exportLabel: qe, density: Je = "compact", dividers: Ye = "rows", hasHover: Xe = !0, textOverflow: Ze = "truncate", className: Qe, style: $e, ...et }) {
|
|
75
|
+
let E = e(), D = Re !== void 0, O = ze !== void 0, [tt, k] = o(!1), [nt, rt] = o(!1), [it, at] = o(() => S?.defaultOverrides ?? {}), ot = S?.overrides !== void 0, st = ot ? S?.overrides ?? {} : it, ct = (e) => {
|
|
76
|
+
ot || at(e), S?.onOverridesChange?.(e);
|
|
77
77
|
}, A = {
|
|
78
|
-
...
|
|
78
|
+
...S?.defaultOverrides ?? {},
|
|
79
79
|
...st
|
|
80
|
-
}, lt = !!
|
|
81
|
-
if (
|
|
80
|
+
}, lt = !!S && S.isReorderable !== !1, [ut, dt] = o({}), j = {};
|
|
81
|
+
if (S) for (let [e, t] of Object.entries(A)) typeof t?.width == "number" && (j[e] = t.width);
|
|
82
82
|
else Object.assign(j, ut);
|
|
83
83
|
let ft = (e) => {
|
|
84
|
-
if (!
|
|
84
|
+
if (!S) {
|
|
85
85
|
dt((t) => ({
|
|
86
86
|
...t,
|
|
87
87
|
...e
|
|
@@ -89,35 +89,35 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
let t = { ...st };
|
|
92
|
-
for (let [n, r] of Object.entries(e)) n !==
|
|
92
|
+
for (let [n, r] of Object.entries(e)) n !== h && (t[n] = {
|
|
93
93
|
...t[n],
|
|
94
94
|
width: r
|
|
95
95
|
});
|
|
96
96
|
ct(t);
|
|
97
97
|
}, M = (e) => {
|
|
98
|
-
if (typeof
|
|
99
|
-
let t = e, n = t[
|
|
98
|
+
if (typeof p == "function") return String(p(e));
|
|
99
|
+
let t = e, n = t[p];
|
|
100
100
|
if (n != null) return String(n);
|
|
101
101
|
let i = t.key ?? t.id;
|
|
102
102
|
return i == null ? `__row_${r ? r.indexOf(e) : -1}` : String(i);
|
|
103
|
-
}, [N, pt] =
|
|
103
|
+
}, [N, pt] = b(Ne, () => Pe ?? null), P = (() => {
|
|
104
104
|
let e = r ? [...r] : [];
|
|
105
105
|
if (!N) return e;
|
|
106
106
|
let t = i.find((e) => e.sortKey === N.sortKey && e.compare)?.compare;
|
|
107
107
|
if (!t) return e;
|
|
108
108
|
let { direction: n } = N;
|
|
109
109
|
return e.sort((e, r) => n === "descending" ? -t(e, r, n) : t(e, r, n));
|
|
110
|
-
})(), F =
|
|
110
|
+
})(), F = Ie === !1 ? void 0 : Ie ?? {}, [I, L] = b(F?.page, () => F?.defaultPage ?? 1), [R, mt] = b(F?.pageSize, () => F?.defaultPageSize ?? xe), z = a(!1), B = F?.totalItems ?? P.length, ht = Math.max(1, Math.ceil(B / R)), V = Oe(I, 1, ht), gt = !!F && B > 0 && (I < 1 || I > ht), _t = B > P.length, vt = F && !_t && P.length > R ? P.slice((V - 1) * R, V * R) : P, H = gt ? [] : vt, [yt, bt] = o(() => [...w?.defaultExpandedKeys ?? []]), U = w?.expandedKeys ?? yt, W = new Set(U.map(String)), G = !!w, xt = w?.columnWidth ?? (x ? ye : ve), St = (x ? _e : 0) + xt, Ct = (e) => {
|
|
111
111
|
let t = W.has(e) ? U.filter((t) => String(t) !== e) : [...U, e];
|
|
112
|
-
|
|
112
|
+
w?.expandedKeys || bt(t), w?.onExpandedKeysChange?.(t);
|
|
113
113
|
}, K = /* @__PURE__ */ new Map();
|
|
114
114
|
H.forEach((e, t) => K.set(M(e), t));
|
|
115
115
|
let q = [];
|
|
116
116
|
for (let e of H) {
|
|
117
117
|
if (q.push(e), !G) continue;
|
|
118
118
|
let t = M(e);
|
|
119
|
-
W.has(t) && (
|
|
120
|
-
[
|
|
119
|
+
W.has(t) && (w?.getIsRowExpandable?.(e) ?? !0) && q.push({
|
|
120
|
+
[g]: t,
|
|
121
121
|
id: `${t}__detail`
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -125,17 +125,17 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
125
125
|
P.forEach((e) => wt.set(M(e), e));
|
|
126
126
|
let J = [];
|
|
127
127
|
G && J.push({
|
|
128
|
-
key:
|
|
129
|
-
header:
|
|
130
|
-
width:
|
|
128
|
+
key: h,
|
|
129
|
+
header: w?.columnHeader ?? "",
|
|
130
|
+
width: m(xt),
|
|
131
131
|
resizable: !1,
|
|
132
132
|
renderCell: (e) => {
|
|
133
|
-
if (
|
|
133
|
+
if (_(e)) return null;
|
|
134
134
|
let t = e;
|
|
135
|
-
if (!(
|
|
135
|
+
if (!(w?.getIsRowExpandable?.(t) ?? !0)) return null;
|
|
136
136
|
let n = M(t);
|
|
137
|
-
return /* @__PURE__ */ u(
|
|
138
|
-
label:
|
|
137
|
+
return /* @__PURE__ */ u(f, {
|
|
138
|
+
label: Ve ?? E("uic.DataGrid.expandRow"),
|
|
139
139
|
icon: W.has(n) ? /* @__PURE__ */ u(ne, {}) : /* @__PURE__ */ u(re, {}),
|
|
140
140
|
variant: "ghost",
|
|
141
141
|
size: "sm",
|
|
@@ -161,29 +161,29 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
161
161
|
header: n,
|
|
162
162
|
align: e.align === "start" ? void 0 : e.align,
|
|
163
163
|
sortable: e.sortKey ? { sortKey: e.sortKey } : !1,
|
|
164
|
-
resizable:
|
|
165
|
-
width: t == null ?
|
|
164
|
+
resizable: je,
|
|
165
|
+
width: t == null ? D ? void 0 : ue(1, typeof e.minWidth == "number" ? { minWidth: e.minWidth } : void 0) : m(t),
|
|
166
166
|
renderCell: (t) => {
|
|
167
|
-
if (
|
|
168
|
-
let n = t, r = e.renderCell ? e.renderCell(n, K.get(M(n)) ?? 0) :
|
|
169
|
-
return
|
|
167
|
+
if (_(t)) return null;
|
|
168
|
+
let n = t, r = e.renderCell ? e.renderCell(n, K.get(M(n)) ?? 0) : Me(t[e.key]);
|
|
169
|
+
return Ze !== "truncate" || r == null ? r : /* @__PURE__ */ u("span", {
|
|
170
170
|
className: "uic-data-grid__clip",
|
|
171
171
|
children: r
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
let Tt =
|
|
176
|
+
let Tt = S ? i.filter((e) => Ae(e, A)) : [...i], Y = lt ? Tt.map((e, t) => ({
|
|
177
177
|
column: e,
|
|
178
178
|
index: t
|
|
179
|
-
})).sort((e, t) => (A[e.column.key]?.order ?? 2 ** 53 - 1) - (A[t.column.key]?.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ column: e }) => e) : Tt, Et = [...G ? [
|
|
179
|
+
})).sort((e, t) => (A[e.column.key]?.order ?? 2 ** 53 - 1) - (A[t.column.key]?.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ column: e }) => e) : Tt, Et = [...G ? [h] : [], ...Y.map((e) => e.key)], Dt = fe({
|
|
180
180
|
columns: [...G ? [{
|
|
181
|
-
key:
|
|
181
|
+
key: h,
|
|
182
182
|
label: "",
|
|
183
183
|
isAlwaysVisible: !0
|
|
184
184
|
}] : [], ...i.map((e) => ({
|
|
185
185
|
key: e.key,
|
|
186
|
-
label:
|
|
186
|
+
label: y(e),
|
|
187
187
|
isAlwaysVisible: !!e.isAlwaysVisible
|
|
188
188
|
}))],
|
|
189
189
|
activeColumnKeys: Et,
|
|
@@ -196,14 +196,14 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
196
196
|
else break;
|
|
197
197
|
let X = {
|
|
198
198
|
startKeys: Ot.length === 0 ? void 0 : [
|
|
199
|
-
...
|
|
200
|
-
...G ? [
|
|
199
|
+
...x ? [ge] : [],
|
|
200
|
+
...G ? [h] : [],
|
|
201
201
|
...Ot
|
|
202
202
|
],
|
|
203
203
|
endKeys: kt.length === 0 ? void 0 : kt
|
|
204
|
-
}, At =
|
|
204
|
+
}, At = he(X.startKeys || X.endKeys ? X : {}), jt = new Map(i.map((e) => [e.key, e])), Mt = {
|
|
205
205
|
transformBodyCell: (e, t, n) => {
|
|
206
|
-
if (
|
|
206
|
+
if (_(n)) return e;
|
|
207
207
|
let r = n, i = jt.get(t.key)?.getCellProps?.(r, K.get(M(r)) ?? 0);
|
|
208
208
|
return i ? {
|
|
209
209
|
...e,
|
|
@@ -218,8 +218,8 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
218
218
|
} : e;
|
|
219
219
|
},
|
|
220
220
|
transformBodyRow: (e, t) => {
|
|
221
|
-
if (!
|
|
222
|
-
let n = t, r =
|
|
221
|
+
if (!Le || _(t)) return e;
|
|
222
|
+
let n = t, r = Le(n, K.get(M(n)));
|
|
223
223
|
return r ? {
|
|
224
224
|
...e,
|
|
225
225
|
htmlProps: {
|
|
@@ -233,12 +233,12 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
233
233
|
} : e;
|
|
234
234
|
}
|
|
235
235
|
}, Nt = {
|
|
236
|
-
transformHeaderCell: (e, t) => t.width == null ?
|
|
237
|
-
transformBodyCell: (e, t) => t.width == null ?
|
|
238
|
-
}, Pt = /* @__PURE__ */ new Set([...X.startKeys ?? [], ...X.endKeys ?? []]), Ft = { transformHeaderCell: (e, t) => Pt.has(t.key) ?
|
|
236
|
+
transformHeaderCell: (e, t) => t.width == null ? v(e, we) : e,
|
|
237
|
+
transformBodyCell: (e, t) => t.width == null ? v(e, Te) : e
|
|
238
|
+
}, Pt = /* @__PURE__ */ new Set([...X.startKeys ?? [], ...X.endKeys ?? []]), Ft = { transformHeaderCell: (e, t) => Pt.has(t.key) ? v(e, Ee) : e }, It = N ? [{
|
|
239
239
|
sortKey: N.sortKey,
|
|
240
240
|
direction: N.direction
|
|
241
|
-
}] : [], Lt =
|
|
241
|
+
}] : [], Lt = me({
|
|
242
242
|
sort: It,
|
|
243
243
|
allowUnsortedState: !0,
|
|
244
244
|
onSortChange: (e) => {
|
|
@@ -246,107 +246,107 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
246
246
|
sortKey: t.sortKey,
|
|
247
247
|
direction: t.direction
|
|
248
248
|
} : null;
|
|
249
|
-
pt(n),
|
|
249
|
+
pt(n), Fe?.(n);
|
|
250
250
|
}
|
|
251
|
-
}), Rt = new Set((
|
|
251
|
+
}), Rt = new Set((x?.selectedKeys ?? []).map(String)), zt = (e) => {
|
|
252
252
|
let t = e.map((e) => wt.get(e)).filter((e) => e !== void 0);
|
|
253
|
-
|
|
254
|
-
}, Z = (e) => Rt.has(M(e)), Bt = (e) =>
|
|
255
|
-
getIsItemSelectable: (e) => !
|
|
256
|
-
getIsItemSelected: (e) => !
|
|
257
|
-
getIsItemEnabled: (e) => !
|
|
258
|
-
getRowLabel: (e) =>
|
|
253
|
+
x?.onChange?.(e, t);
|
|
254
|
+
}, Z = (e) => Rt.has(M(e)), Bt = (e) => x?.getIsItemEnabled?.(e) ?? !0, Q = H.filter(Bt), Vt = pe({
|
|
255
|
+
getIsItemSelectable: (e) => !_(e),
|
|
256
|
+
getIsItemSelected: (e) => !_(e) && Z(e),
|
|
257
|
+
getIsItemEnabled: (e) => !_(e) && Bt(e),
|
|
258
|
+
getRowLabel: (e) => _(e) ? "" : x?.getRowLabel?.(e) ?? M(e),
|
|
259
259
|
getIsAllSelected: () => Q.length > 0 && Q.every(Z),
|
|
260
260
|
getIsIndeterminate: () => Q.some(Z) && !Q.every(Z),
|
|
261
261
|
onSelectItem: ({ item: e, isSelected: t }) => {
|
|
262
|
-
if (
|
|
262
|
+
if (_(e)) return;
|
|
263
263
|
let n = M(e), r = new Set(Rt);
|
|
264
264
|
t ? r.add(n) : r.delete(n), zt([...r]);
|
|
265
265
|
},
|
|
266
266
|
onSelectAll: ({ isAllSelected: e }) => {
|
|
267
|
-
let t = new Set(
|
|
267
|
+
let t = new Set(x?.isPreservingOtherPages ? Rt : []);
|
|
268
268
|
for (let n of H) {
|
|
269
269
|
let r = M(n);
|
|
270
270
|
(Bt(n) ? e : Z(n)) ? t.add(r) : t.delete(r);
|
|
271
271
|
}
|
|
272
272
|
zt([...t]);
|
|
273
273
|
}
|
|
274
|
-
}), Ht = { transformColumns: (e) => e.map((e) => e.key ===
|
|
274
|
+
}), Ht = { transformColumns: (e) => e.map((e) => e.key === ge ? {
|
|
275
275
|
...e,
|
|
276
|
-
width:
|
|
277
|
-
} : e) }, Ut =
|
|
276
|
+
width: m(_e)
|
|
277
|
+
} : e) }, Ut = de({
|
|
278
278
|
columns: J,
|
|
279
279
|
columnWidths: j,
|
|
280
|
-
minWidth:
|
|
280
|
+
minWidth: be,
|
|
281
281
|
onColumnResizeEnd: ft
|
|
282
|
-
}), Wt = Et.length + +!!
|
|
283
|
-
if (!
|
|
284
|
-
let n = String(t[
|
|
282
|
+
}), Wt = Et.length + +!!x, Gt = { transformBodyRow: (e, t) => {
|
|
283
|
+
if (!_(t)) return e;
|
|
284
|
+
let n = String(t[g]), r = wt.get(n);
|
|
285
285
|
return r ? {
|
|
286
286
|
...e,
|
|
287
287
|
children: /* @__PURE__ */ u("td", {
|
|
288
288
|
colSpan: Wt,
|
|
289
289
|
className: "uic-data-grid__detail",
|
|
290
290
|
style: { paddingInlineStart: St },
|
|
291
|
-
children:
|
|
291
|
+
children: w?.renderExpandedRow(r, K.get(n) ?? 0)
|
|
292
292
|
})
|
|
293
293
|
} : e;
|
|
294
294
|
} }, $ = {
|
|
295
295
|
columnSettings: Dt,
|
|
296
296
|
sort: Lt
|
|
297
297
|
};
|
|
298
|
-
|
|
299
|
-
let { page: Kt, defaultPage: qt, defaultPageSize: Jt, totalItems: Yt, onChange: Xt, hasPageSizeSelector: Zt = !0, isHiddenOnSinglePage: Qt = !1, endContent: $t, pageSizeOptions: en, size: tn = "sm", ...nn } = F ?? {}, rn = B === 0 ? 0 : (V - 1) * R + 1, an = Math.min(V * R, B), on = !!F && !(Qt && B <= R), sn = on || !!
|
|
298
|
+
x && ($.selection = Vt, $.selectionWidth = Ht), je && ($.resize = Ut), $.sticky = At, D && ($.scrollX = Nt), O && Pt.size > 0 && ($.scrollY = Ft), $.cellRow = Mt, G && ($.expansion = Gt);
|
|
299
|
+
let { page: Kt, defaultPage: qt, defaultPageSize: Jt, totalItems: Yt, onChange: Xt, hasPageSizeSelector: Zt = !0, isHiddenOnSinglePage: Qt = !1, endContent: $t, pageSizeOptions: en, size: tn = "sm", ...nn } = F ?? {}, rn = B === 0 ? 0 : (V - 1) * R + 1, an = Math.min(V * R, B), on = !!F && !(Qt && B <= R), sn = on || !!S || !!C, cn = gt ? /* @__PURE__ */ u(se, {
|
|
300
300
|
isCompact: !0,
|
|
301
|
-
icon:
|
|
302
|
-
title:
|
|
301
|
+
icon: Ce,
|
|
302
|
+
title: He ?? E("uic.DataGrid.invalidPage"),
|
|
303
303
|
actions: /* @__PURE__ */ u(ee, {
|
|
304
304
|
variant: "primary",
|
|
305
|
-
label:
|
|
305
|
+
label: Ue ?? E("uic.DataGrid.goToFirstPage"),
|
|
306
306
|
onClick: () => {
|
|
307
307
|
L(1), F?.onChange?.(1, R);
|
|
308
308
|
}
|
|
309
309
|
})
|
|
310
|
-
}) :
|
|
310
|
+
}) : T === !1 ? !1 : T == null || typeof T == "string" ? /* @__PURE__ */ u(se, {
|
|
311
311
|
isCompact: !0,
|
|
312
|
-
icon:
|
|
313
|
-
title:
|
|
314
|
-
}) :
|
|
315
|
-
|
|
312
|
+
icon: Ce,
|
|
313
|
+
title: T ?? E("uic.DataGrid.noData")
|
|
314
|
+
}) : T, ln = (e) => {
|
|
315
|
+
k(!1), ct(ke({
|
|
316
316
|
columns: i,
|
|
317
317
|
result: e,
|
|
318
|
-
defaultOverrides:
|
|
318
|
+
defaultOverrides: S?.defaultOverrides,
|
|
319
319
|
overrides: A,
|
|
320
320
|
isReorderable: lt
|
|
321
321
|
}));
|
|
322
322
|
};
|
|
323
323
|
return /* @__PURE__ */ d("div", {
|
|
324
|
-
className: ["uic-data-grid",
|
|
325
|
-
style:
|
|
324
|
+
className: ["uic-data-grid", Qe].filter(Boolean).join(" "),
|
|
325
|
+
style: $e,
|
|
326
326
|
children: [
|
|
327
327
|
/* @__PURE__ */ u("div", {
|
|
328
|
-
"aria-busy":
|
|
328
|
+
"aria-busy": ae || void 0,
|
|
329
329
|
className: [
|
|
330
330
|
"uic-data-grid__body",
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
331
|
+
ae && "uic-data-grid__body--loading",
|
|
332
|
+
Be && "uic-data-grid__body--no-header",
|
|
333
|
+
Ye !== "grid" && "uic-data-grid__body--header-split",
|
|
334
|
+
D && "uic-data-grid__body--scroll-x",
|
|
335
|
+
O && "uic-data-grid__body--scroll-y"
|
|
336
336
|
].filter(Boolean).join(" "),
|
|
337
337
|
style: {
|
|
338
|
-
...
|
|
339
|
-
...
|
|
338
|
+
...D ? { "--data-grid-scroll-width": De(Re) } : null,
|
|
339
|
+
...O ? { "--data-grid-max-height": De(ze) } : null
|
|
340
340
|
},
|
|
341
|
-
children: /* @__PURE__ */ u(
|
|
342
|
-
|
|
341
|
+
children: /* @__PURE__ */ u(le, {
|
|
342
|
+
...et,
|
|
343
343
|
data: q,
|
|
344
344
|
columns: J,
|
|
345
|
-
idKey: (e) =>
|
|
346
|
-
density:
|
|
347
|
-
dividers:
|
|
348
|
-
hasHover:
|
|
349
|
-
textOverflow:
|
|
345
|
+
idKey: (e) => _(e) ? `${String(e[g])}__detail` : M(e),
|
|
346
|
+
density: Je,
|
|
347
|
+
dividers: Ye,
|
|
348
|
+
hasHover: Xe,
|
|
349
|
+
textOverflow: Ze,
|
|
350
350
|
emptyState: cn,
|
|
351
351
|
rowCount: B || void 0,
|
|
352
352
|
rowIndexStart: F ? (V - 1) * R + 1 : void 0,
|
|
@@ -362,24 +362,24 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
362
362
|
on ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(c, {
|
|
363
363
|
type: "supporting",
|
|
364
364
|
color: "secondary",
|
|
365
|
-
children:
|
|
365
|
+
children: Ge ? Ge({
|
|
366
366
|
start: rn,
|
|
367
367
|
end: an,
|
|
368
368
|
total: B
|
|
369
|
-
}) :
|
|
369
|
+
}) : E("uic.DataGrid.range", {
|
|
370
370
|
start: rn,
|
|
371
371
|
end: an,
|
|
372
372
|
total: B
|
|
373
373
|
})
|
|
374
|
-
}), /* @__PURE__ */ u(
|
|
374
|
+
}), /* @__PURE__ */ u(ce, {
|
|
375
375
|
variant: "pages",
|
|
376
376
|
...nn,
|
|
377
377
|
page: V,
|
|
378
378
|
pageSize: R,
|
|
379
379
|
totalItems: B,
|
|
380
|
-
pageSizeOptions: Zt ? en ??
|
|
380
|
+
pageSizeOptions: Zt ? en ?? Se : void 0,
|
|
381
381
|
size: tn,
|
|
382
|
-
label:
|
|
382
|
+
label: We ?? E("uic.DataGrid.pagination"),
|
|
383
383
|
onChange: (e) => {
|
|
384
384
|
z.current || (L(e), F?.onChange?.(e, R));
|
|
385
385
|
},
|
|
@@ -389,15 +389,15 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
389
389
|
}), L(1), mt(e), F?.onChange?.(1, e);
|
|
390
390
|
}
|
|
391
391
|
})] }) : null,
|
|
392
|
-
|
|
393
|
-
label:
|
|
394
|
-
icon: /* @__PURE__ */ u(
|
|
392
|
+
S ? /* @__PURE__ */ u(f, {
|
|
393
|
+
label: Ke ?? E("uic.DataGrid.settings"),
|
|
394
|
+
icon: /* @__PURE__ */ u(oe, {}),
|
|
395
395
|
variant: "ghost",
|
|
396
396
|
size: "sm",
|
|
397
|
-
onClick: () =>
|
|
397
|
+
onClick: () => k(!0)
|
|
398
398
|
}) : null,
|
|
399
|
-
|
|
400
|
-
label:
|
|
399
|
+
C ? /* @__PURE__ */ u(f, {
|
|
400
|
+
label: qe ?? E("uic.DataGrid.exportCsv"),
|
|
401
401
|
icon: /* @__PURE__ */ u(ie, {}),
|
|
402
402
|
variant: "ghost",
|
|
403
403
|
size: "sm",
|
|
@@ -406,42 +406,42 @@ function Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isRe
|
|
|
406
406
|
F ? $t : null
|
|
407
407
|
]
|
|
408
408
|
}) : null,
|
|
409
|
-
|
|
410
|
-
...
|
|
411
|
-
isOpen:
|
|
412
|
-
onOpenChange:
|
|
409
|
+
S ? /* @__PURE__ */ u(n, {
|
|
410
|
+
...S.modalProps,
|
|
411
|
+
isOpen: tt,
|
|
412
|
+
onOpenChange: k,
|
|
413
413
|
columns: i.map((e) => ({
|
|
414
414
|
key: e.key,
|
|
415
|
-
label:
|
|
415
|
+
label: y(e),
|
|
416
416
|
isAlwaysVisible: !!e.isAlwaysVisible
|
|
417
417
|
})),
|
|
418
418
|
visibleColumnKeys: Y.map((e) => e.key),
|
|
419
419
|
isReorderable: lt,
|
|
420
420
|
onApply: ln
|
|
421
421
|
}) : null,
|
|
422
|
-
|
|
423
|
-
...
|
|
422
|
+
C ? /* @__PURE__ */ u(t, {
|
|
423
|
+
...C.modalProps,
|
|
424
424
|
isOpen: nt,
|
|
425
425
|
onOpenChange: rt,
|
|
426
426
|
columns: i.map((e) => ({
|
|
427
427
|
key: e.key,
|
|
428
|
-
label:
|
|
428
|
+
label: y(e),
|
|
429
429
|
exportKeys: e.exportKeys ?? []
|
|
430
430
|
})),
|
|
431
|
-
supportedKeys:
|
|
432
|
-
notice:
|
|
431
|
+
supportedKeys: C.supportedKeys,
|
|
432
|
+
notice: C.notice,
|
|
433
433
|
onExport: async (e) => {
|
|
434
|
-
await
|
|
434
|
+
await C.onExport(e), rt(!1);
|
|
435
435
|
}
|
|
436
436
|
}) : null
|
|
437
437
|
]
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Me(e) {
|
|
441
441
|
return e == null || e === "" ? null : i(e) ? e : String(e);
|
|
442
442
|
}
|
|
443
443
|
//#endregion
|
|
444
|
-
export {
|
|
444
|
+
export { je as DataGrid, y as dataGridColumnLabel, ke as dataGridSettingsToOverrides, Ae as isDataGridColumnVisible };
|
|
445
445
|
|
|
446
446
|
//# sourceMappingURL=DataGrid2.js.map
|
|
447
447
|
import "../../assets/components/DataGrid/DataGrid.css";
|