@lablup/ui-common 0.2.0-alpha.17 → 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.
Files changed (97) hide show
  1. package/README.md +1 -0
  2. package/astryx/components/Board.doc.mjs +122 -0
  3. package/astryx/components/Board.tsx +3 -0
  4. package/astryx/docs/ui-common.doc.mjs +1 -1
  5. package/dist/assets/components/Board/Board.css +2 -0
  6. package/dist/components/Board/Board.d.ts +102 -0
  7. package/dist/components/Board/Board.messages.d.ts +62 -0
  8. package/dist/components/Board/Board.messages.js +68 -0
  9. package/dist/components/Board/Board.messages.js.map +1 -0
  10. package/dist/components/Board/Board2.js +607 -0
  11. package/dist/components/Board/Board2.js.map +1 -0
  12. package/dist/components/Board/engine.d.ts +60 -0
  13. package/dist/components/Board/engine.js +397 -0
  14. package/dist/components/Board/engine.js.map +1 -0
  15. package/dist/components/Board/index.d.ts +4 -0
  16. package/dist/components/Board/index.js +3 -0
  17. package/dist/components/Board/layout.d.ts +81 -0
  18. package/dist/components/Board/layout.js +67 -0
  19. package/dist/components/Board/layout.js.map +1 -0
  20. package/dist/components/Board/scroll.d.ts +38 -0
  21. package/dist/components/Board/scroll.js +42 -0
  22. package/dist/components/Board/scroll.js.map +1 -0
  23. package/dist/components/DataGrid/DataGrid2.js +128 -128
  24. package/dist/components/DataGrid/DataGrid2.js.map +1 -1
  25. package/dist/components/Form/FormItem.d.ts +1 -1
  26. package/dist/components/PageHeader/PageHeader2.js +4 -4
  27. package/dist/components/PagedSelector/PagedSelector2.js +37 -37
  28. package/dist/components/PagedSelector/PagedSelector2.js.map +1 -1
  29. package/dist/components/SelectionLabel/SelectionLabel.js +4 -4
  30. package/dist/i18n/catalog.js +27 -25
  31. package/dist/i18n/catalog.js.map +1 -1
  32. package/dist/i18n/locales/de-DE.js +60 -0
  33. package/dist/i18n/locales/de-DE.js.map +1 -1
  34. package/dist/i18n/locales/el-GR.js +60 -0
  35. package/dist/i18n/locales/el-GR.js.map +1 -1
  36. package/dist/i18n/locales/es-ES.js +60 -0
  37. package/dist/i18n/locales/es-ES.js.map +1 -1
  38. package/dist/i18n/locales/fi-FI.js +60 -0
  39. package/dist/i18n/locales/fi-FI.js.map +1 -1
  40. package/dist/i18n/locales/fr-FR.js +60 -0
  41. package/dist/i18n/locales/fr-FR.js.map +1 -1
  42. package/dist/i18n/locales/id-ID.js +60 -0
  43. package/dist/i18n/locales/id-ID.js.map +1 -1
  44. package/dist/i18n/locales/it-IT.js +60 -0
  45. package/dist/i18n/locales/it-IT.js.map +1 -1
  46. package/dist/i18n/locales/ja-JP.js +60 -0
  47. package/dist/i18n/locales/ja-JP.js.map +1 -1
  48. package/dist/i18n/locales/ko-KR.js +60 -0
  49. package/dist/i18n/locales/ko-KR.js.map +1 -1
  50. package/dist/i18n/locales/mn-MN.js +60 -0
  51. package/dist/i18n/locales/mn-MN.js.map +1 -1
  52. package/dist/i18n/locales/ms-MY.js +60 -0
  53. package/dist/i18n/locales/ms-MY.js.map +1 -1
  54. package/dist/i18n/locales/pl-PL.js +60 -0
  55. package/dist/i18n/locales/pl-PL.js.map +1 -1
  56. package/dist/i18n/locales/pt-BR.js +60 -0
  57. package/dist/i18n/locales/pt-BR.js.map +1 -1
  58. package/dist/i18n/locales/pt-PT.js +60 -0
  59. package/dist/i18n/locales/pt-PT.js.map +1 -1
  60. package/dist/i18n/locales/ru-RU.js +60 -0
  61. package/dist/i18n/locales/ru-RU.js.map +1 -1
  62. package/dist/i18n/locales/th-TH.js +60 -0
  63. package/dist/i18n/locales/th-TH.js.map +1 -1
  64. package/dist/i18n/locales/tr-TR.js +60 -0
  65. package/dist/i18n/locales/tr-TR.js.map +1 -1
  66. package/dist/i18n/locales/vi-VN.js +60 -0
  67. package/dist/i18n/locales/vi-VN.js.map +1 -1
  68. package/dist/i18n/locales/zh-CN.js +60 -0
  69. package/dist/i18n/locales/zh-CN.js.map +1 -1
  70. package/dist/i18n/locales/zh-TW.js +60 -0
  71. package/dist/i18n/locales/zh-TW.js.map +1 -1
  72. package/dist/index.d.ts +2 -0
  73. package/dist/index.js +61 -59
  74. package/dist/instance.js +1 -1
  75. package/dist/ui-common-locales/de-DE.json +60 -0
  76. package/dist/ui-common-locales/el-GR.json +60 -0
  77. package/dist/ui-common-locales/en.json +60 -0
  78. package/dist/ui-common-locales/es-ES.json +60 -0
  79. package/dist/ui-common-locales/fi-FI.json +60 -0
  80. package/dist/ui-common-locales/fr-FR.json +60 -0
  81. package/dist/ui-common-locales/id-ID.json +60 -0
  82. package/dist/ui-common-locales/it-IT.json +60 -0
  83. package/dist/ui-common-locales/ja-JP.json +60 -0
  84. package/dist/ui-common-locales/ko-KR.json +60 -0
  85. package/dist/ui-common-locales/mn-MN.json +60 -0
  86. package/dist/ui-common-locales/ms-MY.json +60 -0
  87. package/dist/ui-common-locales/pl-PL.json +60 -0
  88. package/dist/ui-common-locales/pt-BR.json +60 -0
  89. package/dist/ui-common-locales/pt-PT.json +60 -0
  90. package/dist/ui-common-locales/ru-RU.json +60 -0
  91. package/dist/ui-common-locales/th-TH.json +60 -0
  92. package/dist/ui-common-locales/tr-TR.json +60 -0
  93. package/dist/ui-common-locales/vi-VN.json +60 -0
  94. package/dist/ui-common-locales/zh-CN.json +60 -0
  95. package/dist/ui-common-locales/zh-TW.json +60 -0
  96. package/exports.customs.json +1 -0
  97. 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 { Icon as f } from "@astryxdesign/core/Icon";
12
- import { ChevronDown as ne, ChevronRight as re, FileDown as ie, Inbox as p, Settings as ae } from "lucide-react";
13
- import { EmptyState as oe } from "@astryxdesign/core/EmptyState";
14
- import { IconButton as m } from "@astryxdesign/core/IconButton";
15
- import { Pagination as se } from "@astryxdesign/core/Pagination";
16
- import { Table as ce, pixel as h, proportional as le, useTableColumnResize as ue, useTableColumnSettings as de, useTableSelection as fe, useTableSortable as pe, useTableStickyColumns as me } from "@astryxdesign/core/Table";
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 g = "__uic_expand__", he = "__xds_selection", ge = 52, _e = 56, ve = 40, ye = 60, _ = "__uic_detail_for__", be = 10, xe = [
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
- ], Se = /* @__PURE__ */ u(f, {
23
- icon: p,
22
+ ], Ce = /* @__PURE__ */ u(p, {
23
+ icon: ae,
24
24
  size: "lg",
25
25
  color: "secondary"
26
- }), Ce = {
26
+ }), we = {
27
27
  width: "auto",
28
28
  maxWidth: "none"
29
- }, we = { maxWidth: "none" }, Te = { zIndex: 3 }, v = (e) => !!e && typeof e == "object" && _ in e, Ee = (e) => typeof e == "number" ? `${e}px` : e;
30
- function y(e, t) {
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 De(e, t, n) {
42
+ function Oe(e, t, n) {
43
43
  return Math.min(Math.max(e, t), n);
44
44
  }
45
- function b(e) {
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 Oe({ columns: e, result: t, defaultOverrides: n = {}, overrides: r, isReorderable: i }) {
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 ke(e, t) {
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 x(e, t) {
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 Ae({ data: r, columns: i = [], idKey: f = "id", isLoading: p = !1, isResizable: Ae = !0, sort: Me, defaultSort: Ne, onSortChange: Pe, selection: S, pagination: Fe, columnSettings: C, csvExport: w, expansion: T, emptyState: E, getRowProps: Ie, scrollWidth: Le, maxHeight: Re, isHeaderHidden: ze = !1, expandRowLabel: Be, invalidPageText: Ve, goToFirstPageLabel: He, paginationLabel: Ue, renderRange: We, settingsLabel: Ge, exportLabel: Ke, density: qe = "compact", dividers: Je = "rows", hasHover: Ye = !0, textOverflow: Xe = "truncate", className: Ze, style: Qe, ...$e }) {
75
- let D = e(), O = Le !== void 0, k = Re !== void 0, [et, tt] = o(!1), [nt, rt] = o(!1), [it, at] = o(() => C?.defaultOverrides ?? {}), ot = C?.overrides !== void 0, st = ot ? C?.overrides ?? {} : it, ct = (e) => {
76
- ot || at(e), C?.onOverridesChange?.(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
- ...C?.defaultOverrides ?? {},
78
+ ...S?.defaultOverrides ?? {},
79
79
  ...st
80
- }, lt = !!C && C.isReorderable !== !1, [ut, dt] = o({}), j = {};
81
- if (C) for (let [e, t] of Object.entries(A)) typeof t?.width == "number" && (j[e] = t.width);
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 (!C) {
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 !== g && (t[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 f == "function") return String(f(e));
99
- let t = e, n = t[f];
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] = x(Me, () => Ne ?? null), P = (() => {
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 = Fe === !1 ? void 0 : Fe ?? {}, [I, L] = x(F?.page, () => F?.defaultPage ?? 1), [R, mt] = x(F?.pageSize, () => F?.defaultPageSize ?? be), z = a(!1), B = F?.totalItems ?? P.length, ht = Math.max(1, Math.ceil(B / R)), V = De(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(() => [...T?.defaultExpandedKeys ?? []]), U = T?.expandedKeys ?? yt, W = new Set(U.map(String)), G = !!T, xt = T?.columnWidth ?? (S ? ve : _e), St = (S ? ge : 0) + xt, Ct = (e) => {
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
- T?.expandedKeys || bt(t), T?.onExpandedKeysChange?.(t);
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) && (T?.getIsRowExpandable?.(e) ?? !0) && q.push({
120
- [_]: t,
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: g,
129
- header: T?.columnHeader ?? "",
130
- width: h(xt),
128
+ key: h,
129
+ header: w?.columnHeader ?? "",
130
+ width: m(xt),
131
131
  resizable: !1,
132
132
  renderCell: (e) => {
133
- if (v(e)) return null;
133
+ if (_(e)) return null;
134
134
  let t = e;
135
- if (!(T?.getIsRowExpandable?.(t) ?? !0)) return null;
135
+ if (!(w?.getIsRowExpandable?.(t) ?? !0)) return null;
136
136
  let n = M(t);
137
- return /* @__PURE__ */ u(m, {
138
- label: Be ?? D("uic.DataGrid.expandRow"),
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: Ae,
165
- width: t == null ? O ? void 0 : le(1, typeof e.minWidth == "number" ? { minWidth: e.minWidth } : void 0) : h(t),
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 (v(t)) return null;
168
- let n = t, r = e.renderCell ? e.renderCell(n, K.get(M(n)) ?? 0) : je(t[e.key]);
169
- return Xe !== "truncate" || r == null ? r : /* @__PURE__ */ u("span", {
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 = C ? i.filter((e) => ke(e, A)) : [...i], Y = lt ? Tt.map((e, t) => ({
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 ? [g] : [], ...Y.map((e) => e.key)], Dt = de({
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: g,
181
+ key: h,
182
182
  label: "",
183
183
  isAlwaysVisible: !0
184
184
  }] : [], ...i.map((e) => ({
185
185
  key: e.key,
186
- label: b(e),
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
- ...S ? [he] : [],
200
- ...G ? [g] : [],
199
+ ...x ? [ge] : [],
200
+ ...G ? [h] : [],
201
201
  ...Ot
202
202
  ],
203
203
  endKeys: kt.length === 0 ? void 0 : kt
204
- }, At = me(X.startKeys || X.endKeys ? X : {}), jt = new Map(i.map((e) => [e.key, e])), Mt = {
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 (v(n)) return e;
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 (!Ie || v(t)) return e;
222
- let n = t, r = Ie(n, K.get(M(n)));
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 ? y(e, Ce) : e,
237
- transformBodyCell: (e, t) => t.width == null ? y(e, we) : e
238
- }, Pt = /* @__PURE__ */ new Set([...X.startKeys ?? [], ...X.endKeys ?? []]), Ft = { transformHeaderCell: (e, t) => Pt.has(t.key) ? y(e, Te) : e }, It = N ? [{
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 = pe({
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), Pe?.(n);
249
+ pt(n), Fe?.(n);
250
250
  }
251
- }), Rt = new Set((S?.selectedKeys ?? []).map(String)), zt = (e) => {
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
- S?.onChange?.(e, t);
254
- }, Z = (e) => Rt.has(M(e)), Bt = (e) => S?.getIsItemEnabled?.(e) ?? !0, Q = H.filter(Bt), Vt = fe({
255
- getIsItemSelectable: (e) => !v(e),
256
- getIsItemSelected: (e) => !v(e) && Z(e),
257
- getIsItemEnabled: (e) => !v(e) && Bt(e),
258
- getRowLabel: (e) => v(e) ? "" : S?.getRowLabel?.(e) ?? M(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 (v(e)) return;
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(S?.isPreservingOtherPages ? Rt : []);
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 === he ? {
274
+ }), Ht = { transformColumns: (e) => e.map((e) => e.key === ge ? {
275
275
  ...e,
276
- width: h(ge)
277
- } : e) }, Ut = ue({
276
+ width: m(_e)
277
+ } : e) }, Ut = de({
278
278
  columns: J,
279
279
  columnWidths: j,
280
- minWidth: ye,
280
+ minWidth: be,
281
281
  onColumnResizeEnd: ft
282
- }), Wt = Et.length + +!!S, Gt = { transformBodyRow: (e, t) => {
283
- if (!v(t)) return e;
284
- let n = String(t[_]), r = wt.get(n);
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: T?.renderExpandedRow(r, K.get(n) ?? 0)
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
- S && ($.selection = Vt, $.selectionWidth = Ht), Ae && ($.resize = Ut), $.sticky = At, O && ($.scrollX = Nt), k && 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 || !!C || !!w, cn = gt ? /* @__PURE__ */ u(oe, {
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: Se,
302
- title: Ve ?? D("uic.DataGrid.invalidPage"),
301
+ icon: Ce,
302
+ title: He ?? E("uic.DataGrid.invalidPage"),
303
303
  actions: /* @__PURE__ */ u(ee, {
304
304
  variant: "primary",
305
- label: He ?? D("uic.DataGrid.goToFirstPage"),
305
+ label: Ue ?? E("uic.DataGrid.goToFirstPage"),
306
306
  onClick: () => {
307
307
  L(1), F?.onChange?.(1, R);
308
308
  }
309
309
  })
310
- }) : E === !1 ? !1 : E == null || typeof E == "string" ? /* @__PURE__ */ u(oe, {
310
+ }) : T === !1 ? !1 : T == null || typeof T == "string" ? /* @__PURE__ */ u(se, {
311
311
  isCompact: !0,
312
- icon: Se,
313
- title: E ?? D("uic.DataGrid.noData")
314
- }) : E, ln = (e) => {
315
- tt(!1), ct(Oe({
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: C?.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", Ze].filter(Boolean).join(" "),
325
- style: Qe,
324
+ className: ["uic-data-grid", Qe].filter(Boolean).join(" "),
325
+ style: $e,
326
326
  children: [
327
327
  /* @__PURE__ */ u("div", {
328
- "aria-busy": p || void 0,
328
+ "aria-busy": ae || void 0,
329
329
  className: [
330
330
  "uic-data-grid__body",
331
- p && "uic-data-grid__body--loading",
332
- ze && "uic-data-grid__body--no-header",
333
- Je !== "grid" && "uic-data-grid__body--header-split",
334
- O && "uic-data-grid__body--scroll-x",
335
- k && "uic-data-grid__body--scroll-y"
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
- ...O ? { "--data-grid-scroll-width": Ee(Le) } : null,
339
- ...k ? { "--data-grid-max-height": Ee(Re) } : null
338
+ ...D ? { "--data-grid-scroll-width": De(Re) } : null,
339
+ ...O ? { "--data-grid-max-height": De(ze) } : null
340
340
  },
341
- children: /* @__PURE__ */ u(ce, {
342
- ...$e,
341
+ children: /* @__PURE__ */ u(le, {
342
+ ...et,
343
343
  data: q,
344
344
  columns: J,
345
- idKey: (e) => v(e) ? `${String(e[_])}__detail` : M(e),
346
- density: qe,
347
- dividers: Je,
348
- hasHover: Ye,
349
- textOverflow: Xe,
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: We ? We({
365
+ children: Ge ? Ge({
366
366
  start: rn,
367
367
  end: an,
368
368
  total: B
369
- }) : D("uic.DataGrid.range", {
369
+ }) : E("uic.DataGrid.range", {
370
370
  start: rn,
371
371
  end: an,
372
372
  total: B
373
373
  })
374
- }), /* @__PURE__ */ u(se, {
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 ?? xe : void 0,
380
+ pageSizeOptions: Zt ? en ?? Se : void 0,
381
381
  size: tn,
382
- label: Ue ?? D("uic.DataGrid.pagination"),
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
- C ? /* @__PURE__ */ u(m, {
393
- label: Ge ?? D("uic.DataGrid.settings"),
394
- icon: /* @__PURE__ */ u(ae, {}),
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: () => tt(!0)
397
+ onClick: () => k(!0)
398
398
  }) : null,
399
- w ? /* @__PURE__ */ u(m, {
400
- label: Ke ?? D("uic.DataGrid.exportCsv"),
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
- C ? /* @__PURE__ */ u(n, {
410
- ...C.modalProps,
411
- isOpen: et,
412
- onOpenChange: tt,
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: b(e),
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
- w ? /* @__PURE__ */ u(t, {
423
- ...w.modalProps,
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: b(e),
428
+ label: y(e),
429
429
  exportKeys: e.exportKeys ?? []
430
430
  })),
431
- supportedKeys: w.supportedKeys,
432
- notice: w.notice,
431
+ supportedKeys: C.supportedKeys,
432
+ notice: C.notice,
433
433
  onExport: async (e) => {
434
- await w.onExport(e), rt(!1);
434
+ await C.onExport(e), rt(!1);
435
435
  }
436
436
  }) : null
437
437
  ]
438
438
  });
439
439
  }
440
- function je(e) {
440
+ function Me(e) {
441
441
  return e == null || e === "" ? null : i(e) ? e : String(e);
442
442
  }
443
443
  //#endregion
444
- export { Ae as DataGrid, b as dataGridColumnLabel, Oe as dataGridSettingsToOverrides, ke as isDataGridColumnVisible };
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";