@mci-ui/mci-ui 0.0.88 → 0.0.89
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/index.css +1 -1
- package/dist/shared/ui/MciModal/MciModal.js +30 -28
- package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +45 -25
- package/dist/shared/ui/mciButton/MciButton.js +39 -31
- package/dist/shared/ui/mciCheck/MciCheck.js +86 -76
- package/dist/shared/ui/mciDrawer/MciDrawer.js +78 -59
- package/dist/shared/ui/mciInput/MciInput.js +39 -40
- package/dist/shared/ui/mciLoader/MciLoader.js +14 -14
- package/dist/shared/ui/mciPagination/MciPagination.js +28 -18
- package/dist/shared/ui/mciPicker/MciPicker.js +53 -53
- package/dist/shared/ui/mciSelect/MciSelect.js +42 -41
- package/dist/shared/ui/mciTable/MciTable.js +97 -90
- package/dist/shared/ui/mciTable/MciTableClamp2.js +4 -3
- package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +100 -79
- package/dist/shared/ui/mciToggle/MciToggle.js +51 -43
- package/dist/shared/ui/mciUpload/MciUpload.js +129 -107
- package/dist/types/shared/types/mci-table.types.d.ts +2 -0
- package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -1
- package/dist/types/shared/types/ui/button.types.d.ts +1 -1
- package/dist/types/shared/types/ui/check.types.d.ts +1 -1
- package/dist/types/shared/types/ui/drawer.types.d.ts +1 -0
- package/dist/types/shared/types/ui/loader.types.d.ts +1 -1
- package/dist/types/shared/types/ui/pagination.types.d.ts +1 -1
- package/dist/types/shared/types/ui/toggle.types.d.ts +1 -1
- package/dist/types/shared/types/ui/upload.types.d.ts +1 -1
- package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as _, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { AltArrowDown as st } from "@solar-icons/react";
|
|
3
3
|
import ot from "../../../assets/icons/close.svg.js";
|
|
4
|
-
import { forwardRef as ct, useState as w, useRef as G, useMemo as O, useCallback as
|
|
4
|
+
import { forwardRef as ct, useState as w, useRef as G, useMemo as O, useCallback as p, useEffect as J } from "react";
|
|
5
5
|
import { useClickOutside as it, useEscapeKey as ut, cn as s } from "../../lib/utils.js";
|
|
6
|
-
import { getFilteredOptions as ft, getSelectStateStyles as mt, getSelectIconColor as
|
|
6
|
+
import { getFilteredOptions as ft, getSelectStateStyles as mt, getSelectIconColor as pt, SELECT_SIZES as ht } from "./mci-select.utils.js";
|
|
7
7
|
const xt = ct(
|
|
8
8
|
({
|
|
9
9
|
label: U,
|
|
@@ -14,7 +14,7 @@ const xt = ct(
|
|
|
14
14
|
size: l = "base",
|
|
15
15
|
darkMode: e = !1,
|
|
16
16
|
error: o,
|
|
17
|
-
disabled:
|
|
17
|
+
disabled: n = !1,
|
|
18
18
|
required: Q = !1,
|
|
19
19
|
value: m,
|
|
20
20
|
onChange: b,
|
|
@@ -22,45 +22,45 @@ const xt = ct(
|
|
|
22
22
|
onBlur: y,
|
|
23
23
|
className: X,
|
|
24
24
|
clearable: Y = !1,
|
|
25
|
-
searchable:
|
|
25
|
+
searchable: h = !1,
|
|
26
26
|
onSearch: N,
|
|
27
27
|
name: k
|
|
28
28
|
}, z) => {
|
|
29
|
-
const [
|
|
29
|
+
const [r, S] = w(!1), [i, F] = w(!1), [M, $] = w(""), [T, x] = w(""), [C, u] = w(-1), H = G(null), K = G(null), g = m !== void 0 ? m : M, Z = L.find((t) => t.value === g), E = g !== "" && g !== void 0, D = Y && E && !n, I = !!(v && R === "right"), c = ht[l], tt = O(() => I && D ? l === "sm" || l === "md" ? "pr-16" : "pr-20" : I || D ? l === "sm" ? "pr-11" : l === "md" ? "pr-12" : "pr-14" : l === "sm" ? "pr-8" : l === "md" ? "pr-9" : "pr-10", [I, D, l]), f = O(() => ft(L, T, h, !!N), [L, T, h, N]), q = p(() => {
|
|
30
30
|
S(!1), F(!1), x(""), u(-1), y?.();
|
|
31
31
|
}, [y]), { handleClick: V } = it(H, q), { handleEscape: j } = ut(q);
|
|
32
32
|
J(() => {
|
|
33
|
-
if (
|
|
33
|
+
if (r)
|
|
34
34
|
return document.addEventListener("mousedown", V), document.addEventListener("keydown", j), () => {
|
|
35
35
|
document.removeEventListener("mousedown", V), document.removeEventListener("keydown", j);
|
|
36
36
|
};
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
const et =
|
|
41
|
-
|
|
42
|
-
}, [
|
|
37
|
+
}, [r, V, j]), J(() => {
|
|
38
|
+
r && h && K.current && K.current.focus();
|
|
39
|
+
}, [r, h]);
|
|
40
|
+
const et = p(() => {
|
|
41
|
+
n || (S((t) => !t), r ? (x(""), u(-1)) : (F(!0), W?.()));
|
|
42
|
+
}, [n, r, W]), P = p(
|
|
43
43
|
(t) => {
|
|
44
44
|
m === void 0 && $(t), b?.(t), S(!1), F(!1), x(""), u(-1), y?.();
|
|
45
45
|
},
|
|
46
46
|
[m, b, y]
|
|
47
|
-
), nt =
|
|
47
|
+
), nt = p(
|
|
48
48
|
(t) => {
|
|
49
|
-
if (!
|
|
50
|
-
if (!
|
|
49
|
+
if (!n) {
|
|
50
|
+
if (!r && (t.key === "ArrowDown" || t.key === "ArrowUp" || t.key === "Enter")) {
|
|
51
51
|
t.preventDefault(), S(!0);
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
54
|
+
if (r)
|
|
55
55
|
switch (t.key) {
|
|
56
56
|
case "ArrowDown":
|
|
57
57
|
t.preventDefault(), u(
|
|
58
|
-
(
|
|
58
|
+
(d) => d < f.length - 1 ? d + 1 : 0
|
|
59
59
|
);
|
|
60
60
|
break;
|
|
61
61
|
case "ArrowUp":
|
|
62
62
|
t.preventDefault(), u(
|
|
63
|
-
(
|
|
63
|
+
(d) => d > 0 ? d - 1 : f.length - 1
|
|
64
64
|
);
|
|
65
65
|
break;
|
|
66
66
|
case "Enter":
|
|
@@ -69,23 +69,23 @@ const xt = ct(
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
[
|
|
73
|
-
), rt =
|
|
72
|
+
[r, f, C, n, P]
|
|
73
|
+
), rt = p(
|
|
74
74
|
(t) => {
|
|
75
|
-
t.stopPropagation(), !
|
|
75
|
+
t.stopPropagation(), !n && (m === void 0 && $(""), b?.(""), x(""), u(-1));
|
|
76
76
|
},
|
|
77
|
-
[m, b,
|
|
78
|
-
), lt =
|
|
77
|
+
[m, b, n]
|
|
78
|
+
), lt = p(
|
|
79
79
|
(t) => {
|
|
80
80
|
x(t), N?.(t), u(0);
|
|
81
81
|
},
|
|
82
82
|
[N]
|
|
83
83
|
), at = O(
|
|
84
|
-
() => mt(
|
|
85
|
-
[o,
|
|
84
|
+
() => mt(n, o, e),
|
|
85
|
+
[o, n, e]
|
|
86
86
|
), B = O(
|
|
87
|
-
() =>
|
|
88
|
-
[
|
|
87
|
+
() => pt(n, o, r, i, e),
|
|
88
|
+
[n, o, r, i, e]
|
|
89
89
|
);
|
|
90
90
|
return /* @__PURE__ */ _("div", { className: s("w-full", X), ref: z, children: [
|
|
91
91
|
U && /* @__PURE__ */ _(
|
|
@@ -114,22 +114,23 @@ const xt = ct(
|
|
|
114
114
|
"div",
|
|
115
115
|
{
|
|
116
116
|
role: "combobox",
|
|
117
|
-
"aria-expanded":
|
|
117
|
+
"aria-expanded": r,
|
|
118
118
|
"aria-haspopup": "listbox",
|
|
119
119
|
"aria-controls": `${k}-listbox`,
|
|
120
|
-
"aria-disabled":
|
|
121
|
-
tabIndex:
|
|
120
|
+
"aria-disabled": n,
|
|
121
|
+
tabIndex: n ? -1 : 0,
|
|
122
122
|
onClick: et,
|
|
123
123
|
className: s(
|
|
124
124
|
"flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
|
|
125
|
+
n ? "cursor-not-allowed" : "cursor-pointer",
|
|
125
126
|
l === "base" ? "rounded-xl" : "rounded-lg",
|
|
126
127
|
c.container,
|
|
127
128
|
v && R === "left" ? c.iconPaddingLeft : c.padding,
|
|
128
129
|
tt,
|
|
129
130
|
at,
|
|
130
|
-
e && !
|
|
131
|
-
e && !
|
|
132
|
-
!e && !
|
|
131
|
+
e && !n && (i || r) && !o && "border-blue-500 shadow-[0_0_0_2px_var(--opacity-25,rgba(21,93,252,0.25))] text-white",
|
|
132
|
+
e && !n && (i || r) && o && "border-red-500 shadow-[0_0_0_2px_rgba(231,0,11,0.25)]",
|
|
133
|
+
!e && !n && i && "shadow-blue border-blue-600"
|
|
133
134
|
),
|
|
134
135
|
children: [
|
|
135
136
|
v && /* @__PURE__ */ a(
|
|
@@ -143,7 +144,7 @@ const xt = ct(
|
|
|
143
144
|
children: v
|
|
144
145
|
}
|
|
145
146
|
),
|
|
146
|
-
|
|
147
|
+
h && r ? /* @__PURE__ */ a(
|
|
147
148
|
"input",
|
|
148
149
|
{
|
|
149
150
|
ref: K,
|
|
@@ -163,9 +164,9 @@ const xt = ct(
|
|
|
163
164
|
title: Z?.label || A,
|
|
164
165
|
className: s(
|
|
165
166
|
"block min-w-0 flex-1 truncate select-none",
|
|
166
|
-
!E && !
|
|
167
|
-
e && E && (i ||
|
|
168
|
-
e && E && !i && !
|
|
167
|
+
!E && !n && (e ? "text-neutral-100" : "text-slate-400"),
|
|
168
|
+
e && E && (i || r) && "text-white",
|
|
169
|
+
e && E && !i && !r && "text-neutral-50"
|
|
169
170
|
),
|
|
170
171
|
children: Z?.label || A
|
|
171
172
|
}
|
|
@@ -190,7 +191,7 @@ const xt = ct(
|
|
|
190
191
|
className: s(
|
|
191
192
|
"absolute top-1/2 -translate-y-1/2 pointer-events-none transition-all duration-300",
|
|
192
193
|
l === "sm" ? "right-2" : "right-3",
|
|
193
|
-
|
|
194
|
+
r && "rotate-180",
|
|
194
195
|
B
|
|
195
196
|
),
|
|
196
197
|
children: /* @__PURE__ */ a(st, { className: c.iconSize })
|
|
@@ -199,7 +200,7 @@ const xt = ct(
|
|
|
199
200
|
]
|
|
200
201
|
}
|
|
201
202
|
),
|
|
202
|
-
|
|
203
|
+
r && !n && /* @__PURE__ */ a(
|
|
203
204
|
"div",
|
|
204
205
|
{
|
|
205
206
|
id: `${k}-listbox`,
|
|
@@ -216,12 +217,12 @@ const xt = ct(
|
|
|
216
217
|
"div",
|
|
217
218
|
{
|
|
218
219
|
role: "option",
|
|
219
|
-
"aria-selected":
|
|
220
|
+
"aria-selected": g === t.value,
|
|
220
221
|
onClick: () => P(t.value),
|
|
221
222
|
title: t.label,
|
|
222
223
|
className: s(
|
|
223
224
|
"cursor-pointer truncate rounded-sm px-3 py-2 font-normal transition-colors",
|
|
224
|
-
|
|
225
|
+
g === t.value ? e ? "bg-neutral-300 text-white" : "bg-slate-100" : e ? "hover:bg-neutral-300 hover:text-white" : "hover:bg-slate-100"
|
|
225
226
|
),
|
|
226
227
|
children: t.label
|
|
227
228
|
},
|
|
@@ -1,65 +1,70 @@
|
|
|
1
1
|
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import { ConfoundedSquare as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { ConfoundedSquare as _, SortVertical as H, SortFromTopToBottom as J, SortFromBottomToTop as K } from "@solar-icons/react";
|
|
3
|
+
import { useState as O, useMemo as v, useEffect as Q, useCallback as U } from "react";
|
|
4
4
|
import { cn as a } from "../../lib/utils.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import z from "../mciCheck/MciCheck.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { sortRows as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import B from "../mciSkeleton/MciSkeleton.js";
|
|
8
|
+
import X from "./MciTableClamp2.js";
|
|
9
|
+
import { sortRows as Y, normalizeColWidth as Z } from "./mci-table.utils.js";
|
|
10
|
+
const w = (o) => {
|
|
11
|
+
const b = String(o.key).toLowerCase(), d = o.title.toLowerCase();
|
|
12
|
+
return b === "action" || b === "actions" || b.includes("action") || d === "action" || d === "actions" || d.includes("action");
|
|
13
|
+
};
|
|
14
|
+
function ae({
|
|
15
|
+
columns: o,
|
|
16
|
+
data: b = [],
|
|
17
|
+
loading: d = !1,
|
|
18
|
+
skeletonRows: D = 5,
|
|
19
|
+
noDataText: P = "",
|
|
16
20
|
sort: n,
|
|
17
21
|
onSortChange: N,
|
|
18
|
-
className:
|
|
19
|
-
headerClassName:
|
|
20
|
-
bodyClassName:
|
|
21
|
-
darkMode:
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
className: F,
|
|
23
|
+
headerClassName: C,
|
|
24
|
+
bodyClassName: R,
|
|
25
|
+
darkMode: i = !1,
|
|
26
|
+
variant: j = "orange",
|
|
27
|
+
rowKey: p = "id",
|
|
28
|
+
rowSelection: l
|
|
24
29
|
}) {
|
|
25
|
-
const [
|
|
26
|
-
|
|
27
|
-
n !== void 0 &&
|
|
30
|
+
const [V, A] = O(null), h = n ?? V, x = v(() => Array.isArray(b) ? b : [], [b]), L = v(() => Y(x, h, !!n), [x, h, n]);
|
|
31
|
+
Q(() => {
|
|
32
|
+
n !== void 0 && A(null);
|
|
28
33
|
}, [n]);
|
|
29
|
-
const
|
|
30
|
-
() =>
|
|
31
|
-
[
|
|
32
|
-
),
|
|
34
|
+
const f = v(
|
|
35
|
+
() => d ? [] : n ? x : L,
|
|
36
|
+
[d, n, x, L]
|
|
37
|
+
), q = U(
|
|
33
38
|
(e) => {
|
|
34
39
|
if (!e.sortable) return;
|
|
35
|
-
let
|
|
36
|
-
|
|
40
|
+
let s = null;
|
|
41
|
+
h?.key !== e.key ? s = { key: e.key, direction: "asc" } : h.direction === "asc" && (s = { key: e.key, direction: "desc" }), n !== void 0 ? N?.(s) : A(s);
|
|
37
42
|
},
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
if (!
|
|
41
|
-
const { onChange:
|
|
43
|
+
[h, n, N]
|
|
44
|
+
), E = (e) => {
|
|
45
|
+
if (!l) return;
|
|
46
|
+
const { onChange: s, getCheckboxProps: m } = l;
|
|
42
47
|
if (e.target.checked) {
|
|
43
|
-
const
|
|
44
|
-
|
|
48
|
+
const r = f.filter((u) => !m?.(u)?.disabled).map((u) => u[p]);
|
|
49
|
+
s(r);
|
|
45
50
|
} else
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
if (!
|
|
49
|
-
const { selectedRowKeys:
|
|
50
|
-
y(
|
|
51
|
-
},
|
|
52
|
-
if (!
|
|
53
|
-
const e =
|
|
51
|
+
s([]);
|
|
52
|
+
}, G = (e, s) => {
|
|
53
|
+
if (!l) return;
|
|
54
|
+
const { selectedRowKeys: m, onChange: y } = l, g = e[p], r = s ? [...m, g] : m.filter((u) => u !== g);
|
|
55
|
+
y(r);
|
|
56
|
+
}, I = v(() => {
|
|
57
|
+
if (!l || f.length === 0) return !1;
|
|
58
|
+
const e = f.filter((s) => !l.getCheckboxProps?.(s)?.disabled);
|
|
54
59
|
return e.length === 0 ? !1 : e.every(
|
|
55
|
-
(
|
|
60
|
+
(s) => l.selectedRowKeys.includes(s[p])
|
|
56
61
|
);
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
return e.sortable ? !
|
|
62
|
+
}, [l, f, p]), W = (e) => {
|
|
63
|
+
const s = a(i ? "text-neutral-100" : "text-slate-base", "shrink-0");
|
|
64
|
+
return e.sortable ? !h || h.key !== e.key ? /* @__PURE__ */ t(H, { weight: "Linear", size: 20, className: s }) : h.direction === "asc" ? /* @__PURE__ */ t(J, { weight: "Linear", size: 20, className: s }) : /* @__PURE__ */ t(K, { weight: "Linear", size: 20, className: s }) : null;
|
|
60
65
|
}, T = () => /* @__PURE__ */ c("colgroup", { children: [
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
l && /* @__PURE__ */ t("col", { style: { width: 48 } }),
|
|
67
|
+
o.map((e) => /* @__PURE__ */ t("col", { style: { width: Z(e.width) ?? (w(e) ? "1%" : "auto") } }, e.key))
|
|
63
68
|
] });
|
|
64
69
|
return /* @__PURE__ */ t(
|
|
65
70
|
"div",
|
|
@@ -68,10 +73,10 @@ function re({
|
|
|
68
73
|
"w-full overflow-x-auto pb-0.5",
|
|
69
74
|
"[&::-webkit-scrollbar]:h-1",
|
|
70
75
|
"[&::-webkit-scrollbar-track]:bg-transparent",
|
|
71
|
-
|
|
76
|
+
i ? "[&::-webkit-scrollbar-thumb]:bg-neutral-200" : "[&::-webkit-scrollbar-thumb]:bg-slate-200",
|
|
72
77
|
"[&::-webkit-scrollbar-thumb]:rounded-full",
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
i ? "hover:[&::-webkit-scrollbar-thumb]:bg-neutral-100" : "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
|
|
79
|
+
F
|
|
75
80
|
),
|
|
76
81
|
children: /* @__PURE__ */ c("div", { className: "inline-block min-w-full align-middle", children: [
|
|
77
82
|
/* @__PURE__ */ t(
|
|
@@ -79,33 +84,34 @@ function re({
|
|
|
79
84
|
{
|
|
80
85
|
className: a(
|
|
81
86
|
"overflow-hidden rounded-xl border",
|
|
82
|
-
|
|
87
|
+
i ? "border-neutral-200 bg-neutral-300" : "border-slate-200 bg-slate-100"
|
|
83
88
|
),
|
|
84
89
|
children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
|
|
85
90
|
T(),
|
|
86
91
|
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
87
|
-
|
|
92
|
+
l && /* @__PURE__ */ t("th", { className: a("w-12 px-4 py-3", C), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ t(
|
|
88
93
|
z,
|
|
89
94
|
{
|
|
90
|
-
checked:
|
|
91
|
-
onChange:
|
|
92
|
-
variant:
|
|
93
|
-
darkMode:
|
|
94
|
-
disabled:
|
|
95
|
+
checked: I,
|
|
96
|
+
onChange: E,
|
|
97
|
+
variant: j,
|
|
98
|
+
darkMode: i,
|
|
99
|
+
disabled: d || f.length === 0
|
|
95
100
|
}
|
|
96
101
|
) }) }),
|
|
97
|
-
|
|
102
|
+
o.map((e) => /* @__PURE__ */ t(
|
|
98
103
|
"th",
|
|
99
104
|
{
|
|
100
|
-
onClick: () =>
|
|
105
|
+
onClick: () => q(e),
|
|
101
106
|
className: a(
|
|
102
107
|
"px-4 py-3 text-left text-sm font-medium transition-colors",
|
|
103
|
-
|
|
108
|
+
i ? "text-neutral-50" : "text-slate-700",
|
|
104
109
|
"whitespace-nowrap overflow-hidden text-ellipsis",
|
|
110
|
+
w(e) && "w-px",
|
|
105
111
|
e.align === "center" && "text-center",
|
|
106
112
|
e.align === "right" && "text-right",
|
|
107
|
-
e.sortable && (
|
|
108
|
-
|
|
113
|
+
e.sortable && (i ? "cursor-pointer hover:bg-neutral-200" : "cursor-pointer hover:bg-slate-200"),
|
|
114
|
+
C
|
|
109
115
|
),
|
|
110
116
|
children: /* @__PURE__ */ c(
|
|
111
117
|
"div",
|
|
@@ -113,7 +119,7 @@ function re({
|
|
|
113
119
|
className: a("flex items-center gap-2 min-w-0", e.align === "right" && "justify-end"),
|
|
114
120
|
children: [
|
|
115
121
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", title: e.title, children: e.title }),
|
|
116
|
-
|
|
122
|
+
W(e)
|
|
117
123
|
]
|
|
118
124
|
}
|
|
119
125
|
)
|
|
@@ -129,56 +135,57 @@ function re({
|
|
|
129
135
|
{
|
|
130
136
|
className: a(
|
|
131
137
|
"overflow-hidden rounded-xl border border-t-0",
|
|
132
|
-
|
|
138
|
+
i ? "border-neutral-200 bg-transparent" : "border-slate-200 bg-white"
|
|
133
139
|
),
|
|
134
140
|
children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
|
|
135
141
|
T(),
|
|
136
|
-
/* @__PURE__ */ t("tbody", { className: a("divide-y",
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
] },
|
|
142
|
+
/* @__PURE__ */ t("tbody", { className: a("divide-y", i ? "divide-neutral-200" : "divide-slate-200"), children: d ? Array.from({ length: D }).map((e, s) => /* @__PURE__ */ c("tr", { children: [
|
|
143
|
+
l && /* @__PURE__ */ t("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ t(B, { height: 20, width: 20, variant: "rounded" }) }),
|
|
144
|
+
o.map((m) => /* @__PURE__ */ t("td", { className: "px-4 py-3", children: /* @__PURE__ */ t(B, { height: 30, variant: "rounded" }) }, m.key))
|
|
145
|
+
] }, s)) : f.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: o.length + (l ? 1 : 0), className: "py-20", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center", children: [
|
|
140
146
|
/* @__PURE__ */ t("div", { className: "relative mb-4", children: /* @__PURE__ */ t(
|
|
141
|
-
|
|
147
|
+
_,
|
|
142
148
|
{
|
|
143
149
|
weight: "Bold",
|
|
144
150
|
size: 64,
|
|
145
|
-
className: a("animate-float",
|
|
151
|
+
className: a("animate-float", i ? "text-neutral-100" : "text-slate-400")
|
|
146
152
|
}
|
|
147
153
|
) }),
|
|
148
|
-
/* @__PURE__ */ t("p", { className: a("text-sm font-medium",
|
|
149
|
-
] }) }) }) :
|
|
150
|
-
const
|
|
151
|
-
return /* @__PURE__ */ c("tr", { className: a("group transition-colors",
|
|
152
|
-
|
|
154
|
+
/* @__PURE__ */ t("p", { className: a("text-sm font-medium", i ? "text-neutral-100" : "text-slate-400"), children: P })
|
|
155
|
+
] }) }) }) : f.map((e, s) => {
|
|
156
|
+
const m = e[p], y = l?.selectedRowKeys.includes(m), g = l?.getCheckboxProps?.(e)?.disabled;
|
|
157
|
+
return /* @__PURE__ */ c("tr", { className: a("group transition-colors", i ? "hover:bg-neutral-100/35" : "hover:bg-slate-50"), children: [
|
|
158
|
+
l && /* @__PURE__ */ t("td", { className: a("w-12 px-4 py-3 align-top", R), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ t(
|
|
153
159
|
z,
|
|
154
160
|
{
|
|
155
161
|
checked: y,
|
|
156
|
-
disabled:
|
|
157
|
-
variant:
|
|
158
|
-
darkMode:
|
|
159
|
-
onChange: (
|
|
162
|
+
disabled: g,
|
|
163
|
+
variant: j,
|
|
164
|
+
darkMode: i,
|
|
165
|
+
onChange: (r) => G(e, r.target.checked)
|
|
160
166
|
}
|
|
161
167
|
) }) }),
|
|
162
|
-
|
|
163
|
-
const
|
|
168
|
+
o.map((r) => {
|
|
169
|
+
const u = e[r.key], k = r.render ? r.render(u, e) : String(u ?? "-");
|
|
164
170
|
return /* @__PURE__ */ t(
|
|
165
171
|
"td",
|
|
166
172
|
{
|
|
167
173
|
className: a(
|
|
168
|
-
"align-top px-4 py-3 text-sm font-normal",
|
|
169
|
-
|
|
174
|
+
"align-top px-4 py-3 text-sm font-normal overflow-visible",
|
|
175
|
+
i ? "text-neutral-50" : "text-black",
|
|
170
176
|
"min-w-0 whitespace-normal",
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
w(r) && "w-px whitespace-nowrap",
|
|
178
|
+
r.align === "center" && "text-center",
|
|
179
|
+
r.align === "right" && "text-right",
|
|
180
|
+
R,
|
|
181
|
+
r.className
|
|
175
182
|
),
|
|
176
|
-
children: /* @__PURE__ */ t(
|
|
183
|
+
children: /* @__PURE__ */ t(X, { title: typeof k == "string" ? k : void 0, children: k })
|
|
177
184
|
},
|
|
178
|
-
|
|
185
|
+
r.key
|
|
179
186
|
);
|
|
180
187
|
})
|
|
181
|
-
] },
|
|
188
|
+
] }, s);
|
|
182
189
|
}) })
|
|
183
190
|
] })
|
|
184
191
|
}
|
|
@@ -188,5 +195,5 @@ function re({
|
|
|
188
195
|
);
|
|
189
196
|
}
|
|
190
197
|
export {
|
|
191
|
-
|
|
198
|
+
ae as default
|
|
192
199
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
function
|
|
3
|
-
|
|
2
|
+
function o({ children: t, title: i }) {
|
|
3
|
+
const a = typeof t == "string" ? t : void 0;
|
|
4
|
+
return typeof t != "string" && typeof t != "number" ? /* @__PURE__ */ e("div", { className: "-m-1 inline-flex w-fit max-w-full items-start overflow-visible p-1 align-top", children: t }) : /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("div", { className: "clamp-2 break-words", title: i ?? a, children: t }) });
|
|
4
5
|
}
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
o as default
|
|
7
8
|
};
|