@mci-ui/mci-ui 0.0.94 → 0.0.95
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/assets/png/empty.png.js +4 -0
- package/dist/index.css +1 -1
- package/dist/index.js +54 -50
- package/dist/shared/lib/uploadLanguage.js +6 -3
- package/dist/shared/ui/MciModal/MciModal.js +1 -1
- package/dist/shared/ui/mciAccordion/MciAccordion.js +4 -4
- package/dist/shared/ui/mciButton/MciButton.js +12 -10
- package/dist/shared/ui/mciCollapse/MciCollapse.js +1 -1
- package/dist/shared/ui/mciDrawer/MciDrawer.js +1 -1
- package/dist/shared/ui/mciEmpty/MciEmpty.js +41 -0
- package/dist/shared/ui/mciInput/MciInput.js +32 -32
- package/dist/shared/ui/mciPagination/MciPagination.js +32 -32
- package/dist/shared/ui/mciPhone/MciPhone.js +23 -23
- package/dist/shared/ui/mciPicker/MciPicker.js +2 -2
- package/dist/shared/ui/mciTable/MciTable.js +317 -165
- package/dist/shared/ui/mciTable/MciTableClamp2.js +5 -5
- package/dist/shared/ui/mciTabs/FilledTabs.js +38 -36
- package/dist/shared/ui/mciTabs/OutlinedTabs.js +28 -24
- package/dist/shared/ui/mciTabs/TabCountBadge.js +19 -0
- package/dist/shared/ui/mciTag/MciTag.js +17 -17
- package/dist/shared/ui/mciTextarea/MciTextarea.js +5 -5
- package/dist/shared/ui/mciTimePicker/MciTimePicker.js +205 -194
- package/dist/shared/ui/mciUpload/MciUpload.js +102 -352
- package/dist/shared/ui/mciUpload/MciUploadButton.js +143 -0
- package/dist/shared/ui/mciUpload/MciUploadFileList.js +167 -0
- package/dist/shared/ui/mciUpload/mci-upload.theme.js +103 -0
- package/dist/shared/ui/mciUpload/mci-upload.utils.js +90 -41
- package/dist/shared/ui/mciUpload/useMciUpload.js +183 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/shared/lib/uploadLanguage.d.ts +2 -0
- package/dist/types/shared/types/ui/empty.types.d.ts +11 -0
- package/dist/types/shared/types/ui/index.d.ts +2 -1
- package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
- package/dist/types/shared/types/ui/time-picker.types.d.ts +2 -0
- package/dist/types/shared/types/ui/upload.types.d.ts +25 -1
- package/dist/types/shared/ui/mciEmpty/MciEmpty.d.ts +2 -0
- package/dist/types/shared/ui/mciTabs/TabCountBadge.d.ts +5 -0
- package/dist/types/shared/ui/mciUpload/MciUploadButton.d.ts +4 -0
- package/dist/types/shared/ui/mciUpload/MciUploadFileList.d.ts +18 -0
- package/dist/types/shared/ui/mciUpload/mci-upload.theme.d.ts +101 -0
- package/dist/types/shared/ui/mciUpload/mci-upload.utils.d.ts +7 -0
- package/dist/types/shared/ui/mciUpload/useMciUpload.d.ts +131 -0
- package/package.json +1 -1
|
@@ -1,199 +1,351 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cn as a } from "../../lib/utils.js";
|
|
1
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { SortVertical as ce, SortFromTopToBottom as oe, SortFromBottomToTop as de } from "@solar-icons/react";
|
|
3
|
+
import { useRef as O, useState as he, useMemo as N, useEffect as $, useCallback as j } from "react";
|
|
5
4
|
/* empty css */
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import J from "../mciCheck/MciCheck.js";
|
|
6
|
+
import fe from "../mciEmpty/MciEmpty.js";
|
|
7
|
+
import K from "../mciSkeleton/MciSkeleton.js";
|
|
8
|
+
import { cn as c } from "../../lib/utils.js";
|
|
9
|
+
import ue from "./MciTableClamp2.js";
|
|
10
|
+
import { sortRows as me, normalizeColWidth as be } from "./mci-table.utils.js";
|
|
11
|
+
const ge = 160, pe = 72, ye = 48, E = (s) => {
|
|
12
|
+
const f = String(s.key).toLowerCase(), b = s.title.toLowerCase();
|
|
13
|
+
return f === "action" || f === "actions" || f.includes("action") || b === "action" || b === "actions" || b.includes("action");
|
|
14
|
+
}, Q = (s) => {
|
|
15
|
+
if (typeof s.width == "number") return s.width;
|
|
16
|
+
if (typeof s.width == "string" && s.width.endsWith("px")) {
|
|
17
|
+
const f = Number.parseFloat(s.width);
|
|
18
|
+
if (Number.isFinite(f)) return f;
|
|
19
|
+
}
|
|
20
|
+
return E(s) ? pe : ge;
|
|
13
21
|
};
|
|
14
|
-
function
|
|
15
|
-
columns:
|
|
16
|
-
data:
|
|
17
|
-
loading:
|
|
18
|
-
skeletonRows:
|
|
19
|
-
noDataText:
|
|
20
|
-
sort:
|
|
21
|
-
onSortChange:
|
|
22
|
-
className:
|
|
23
|
-
headerClassName:
|
|
24
|
-
bodyClassName:
|
|
25
|
-
darkMode:
|
|
26
|
-
variant:
|
|
27
|
-
rowKey:
|
|
22
|
+
function Ee({
|
|
23
|
+
columns: s,
|
|
24
|
+
data: f = [],
|
|
25
|
+
loading: b = !1,
|
|
26
|
+
skeletonRows: y = 5,
|
|
27
|
+
noDataText: X = "",
|
|
28
|
+
sort: u,
|
|
29
|
+
onSortChange: D,
|
|
30
|
+
className: Y,
|
|
31
|
+
headerClassName: F,
|
|
32
|
+
bodyClassName: B,
|
|
33
|
+
darkMode: d = !1,
|
|
34
|
+
variant: H = "orange",
|
|
35
|
+
rowKey: k = "id",
|
|
28
36
|
rowSelection: l
|
|
29
37
|
}) {
|
|
30
|
-
const [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
const
|
|
35
|
-
() =>
|
|
36
|
-
[
|
|
37
|
-
),
|
|
38
|
+
const v = O(null), w = O(null), T = O(!1), [Z, P] = he(null), g = u ?? Z, S = N(() => Array.isArray(f) ? f : [], [f]), U = N(() => me(S, g, !!u), [S, g, u]);
|
|
39
|
+
$(() => {
|
|
40
|
+
u !== void 0 && P(null);
|
|
41
|
+
}, [u]);
|
|
42
|
+
const m = N(
|
|
43
|
+
() => b ? [] : u ? S : U,
|
|
44
|
+
[b, u, S, U]
|
|
45
|
+
), R = N(
|
|
46
|
+
() => s.reduce(
|
|
47
|
+
(e, t) => e + Q(t),
|
|
48
|
+
l ? ye : 0
|
|
49
|
+
),
|
|
50
|
+
[s, l]
|
|
51
|
+
), W = j((e) => {
|
|
52
|
+
const t = v.current, n = w.current;
|
|
53
|
+
if (!t && !n) return;
|
|
54
|
+
const o = e?.scrollLeft ?? n?.scrollLeft ?? t?.scrollLeft ?? 0, h = Math.max(
|
|
55
|
+
t ? t.scrollWidth - t.clientWidth : 0,
|
|
56
|
+
n ? n.scrollWidth - n.clientWidth : 0
|
|
57
|
+
), a = h > 1 && o < h - 1;
|
|
58
|
+
for (const i of [t, n])
|
|
59
|
+
i && i.classList.toggle("mci-table-sticky-scrolled", a);
|
|
60
|
+
}, []), _ = j(
|
|
61
|
+
(e) => {
|
|
62
|
+
if (T.current) return;
|
|
63
|
+
T.current = !0;
|
|
64
|
+
const { scrollLeft: t } = e;
|
|
65
|
+
for (const n of [v.current, w.current])
|
|
66
|
+
!n || n === e || (n.scrollLeft = t);
|
|
67
|
+
W(e), requestAnimationFrame(() => {
|
|
68
|
+
T.current = !1;
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
[W]
|
|
72
|
+
);
|
|
73
|
+
$(() => {
|
|
74
|
+
const e = v.current, t = w.current;
|
|
75
|
+
if (!e && !t) return;
|
|
76
|
+
const n = () => {
|
|
77
|
+
v.current && _(v.current);
|
|
78
|
+
}, o = () => {
|
|
79
|
+
w.current && _(w.current);
|
|
80
|
+
}, h = () => {
|
|
81
|
+
const i = v.current, L = w.current, x = L ?? i;
|
|
82
|
+
if (!x) return;
|
|
83
|
+
const { scrollLeft: C } = x;
|
|
84
|
+
i && (i.scrollLeft = C), L && (L.scrollLeft = C), W(x);
|
|
85
|
+
};
|
|
86
|
+
if (h(), e?.addEventListener("scroll", n, { passive: !0 }), t?.addEventListener("scroll", o, { passive: !0 }), typeof ResizeObserver > "u")
|
|
87
|
+
return window.addEventListener("resize", h), () => {
|
|
88
|
+
window.removeEventListener("resize", h), e?.removeEventListener("scroll", n), t?.removeEventListener("scroll", o);
|
|
89
|
+
};
|
|
90
|
+
const a = new ResizeObserver(h);
|
|
91
|
+
return e && a.observe(e), t && a.observe(t), () => {
|
|
92
|
+
a.disconnect(), e?.removeEventListener("scroll", n), t?.removeEventListener("scroll", o);
|
|
93
|
+
};
|
|
94
|
+
}, [R, s.length, m.length, _, W]);
|
|
95
|
+
const ee = j(
|
|
38
96
|
(e) => {
|
|
39
97
|
if (!e.sortable) return;
|
|
40
|
-
let
|
|
41
|
-
|
|
98
|
+
let t = null;
|
|
99
|
+
g?.key !== e.key ? t = { key: e.key, direction: "asc" } : g.direction === "asc" && (t = { key: e.key, direction: "desc" }), u !== void 0 ? D?.(t) : P(t);
|
|
42
100
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
101
|
+
[g, u, D]
|
|
102
|
+
), te = (e) => {
|
|
45
103
|
if (!l) return;
|
|
46
|
-
const { onChange:
|
|
104
|
+
const { onChange: t, getCheckboxProps: n } = l;
|
|
47
105
|
if (e.target.checked) {
|
|
48
|
-
const
|
|
49
|
-
|
|
106
|
+
const a = m.filter((i) => !n?.(i)?.disabled).map((i) => i[k]);
|
|
107
|
+
t(a);
|
|
50
108
|
} else
|
|
51
|
-
|
|
52
|
-
},
|
|
109
|
+
t([]);
|
|
110
|
+
}, re = (e, t) => {
|
|
53
111
|
if (!l) return;
|
|
54
|
-
const { selectedRowKeys:
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
if (!l ||
|
|
58
|
-
const e =
|
|
112
|
+
const { selectedRowKeys: n, onChange: o } = l, h = e[k], a = t ? [...n, h] : n.filter((i) => i !== h);
|
|
113
|
+
o(a);
|
|
114
|
+
}, se = N(() => {
|
|
115
|
+
if (!l || m.length === 0) return !1;
|
|
116
|
+
const e = m.filter(
|
|
117
|
+
(t) => !l.getCheckboxProps?.(t)?.disabled
|
|
118
|
+
);
|
|
59
119
|
return e.length === 0 ? !1 : e.every(
|
|
60
|
-
(
|
|
120
|
+
(t) => l.selectedRowKeys.includes(t[k])
|
|
61
121
|
);
|
|
62
|
-
}, [l,
|
|
63
|
-
const
|
|
64
|
-
return e.sortable ? !
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
122
|
+
}, [l, m, k]), ne = (e) => {
|
|
123
|
+
const t = c(d ? "text-neutral-100" : "text-slate-base", "shrink-0");
|
|
124
|
+
return e.sortable ? !g || g.key !== e.key ? /* @__PURE__ */ r(ce, { weight: "Linear", size: 20, className: t }) : g.direction === "asc" ? /* @__PURE__ */ r(oe, { weight: "Linear", size: 20, className: t }) : /* @__PURE__ */ r(de, { weight: "Linear", size: 20, className: t }) : null;
|
|
125
|
+
}, I = N(
|
|
126
|
+
() => s.length > 0 ? Q(s[s.length - 1]) : 0,
|
|
127
|
+
[s]
|
|
128
|
+
), M = () => /* @__PURE__ */ p("colgroup", { children: [
|
|
129
|
+
l && /* @__PURE__ */ r("col", { style: { width: 48 } }),
|
|
130
|
+
s.map((e, t) => /* @__PURE__ */ r(
|
|
131
|
+
"col",
|
|
132
|
+
{
|
|
133
|
+
style: {
|
|
134
|
+
width: be(e.width) ?? (E(e) ? "1%" : "auto"),
|
|
135
|
+
...t === s.length - 1 ? { minWidth: I } : void 0
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
e.key
|
|
139
|
+
))
|
|
140
|
+
] }), z = d ? "border-neutral-200" : "border-slate-200", A = (e, t, n) => {
|
|
141
|
+
if (e === s.length - 1)
|
|
142
|
+
return c(
|
|
143
|
+
"sticky right-0 box-border min-w-[var(--mci-table-sticky-last-min-width)] transition-shadow duration-150",
|
|
144
|
+
t === "header" ? "z-30 rounded-tr-xl" : "z-20",
|
|
145
|
+
n?.isLastRow && "rounded-br-xl",
|
|
146
|
+
t === "header" ? d ? "bg-neutral-300" : "bg-slate-100" : d ? "bg-neutral-300 group-hover:bg-neutral-100/35" : "bg-white group-hover:bg-slate-50"
|
|
147
|
+
);
|
|
148
|
+
}, ie = "[&.mci-table-sticky-scrolled_th:last-child]:shadow-md [&.mci-table-sticky-scrolled_td:last-child]:shadow-md", V = d ? "border-neutral-200" : "border-slate-200", le = c(
|
|
149
|
+
"relative z-0 overflow-hidden rounded-xl border",
|
|
150
|
+
V,
|
|
151
|
+
d ? "bg-neutral-300" : "bg-slate-100"
|
|
152
|
+
), ae = c(
|
|
153
|
+
"relative z-[1] -mt-px overflow-hidden rounded-xl border",
|
|
154
|
+
V,
|
|
155
|
+
d ? "bg-neutral-300" : "bg-white"
|
|
156
|
+
), q = c(
|
|
157
|
+
"w-full min-w-0 overflow-x-auto",
|
|
158
|
+
ie,
|
|
159
|
+
"[scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
|
|
160
|
+
), G = "w-full table-fixed border-separate border-spacing-0";
|
|
161
|
+
return /* @__PURE__ */ r("div", { className: c("relative w-full min-w-0", Y), children: /* @__PURE__ */ r(
|
|
70
162
|
"div",
|
|
71
163
|
{
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
),
|
|
89
|
-
children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
|
|
90
|
-
T(),
|
|
91
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
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(
|
|
93
|
-
z,
|
|
164
|
+
style: {
|
|
165
|
+
"--mci-table-sticky-last-min-width": `${I}px`
|
|
166
|
+
},
|
|
167
|
+
children: /* @__PURE__ */ p("div", { className: "flex flex-col gap-0", children: [
|
|
168
|
+
/* @__PURE__ */ r("div", { className: le, children: /* @__PURE__ */ r("div", { ref: v, className: q, children: /* @__PURE__ */ p("table", { className: G, style: { minWidth: R }, children: [
|
|
169
|
+
M(),
|
|
170
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
|
171
|
+
l && /* @__PURE__ */ r(
|
|
172
|
+
"th",
|
|
173
|
+
{
|
|
174
|
+
className: c(
|
|
175
|
+
"w-12 px-4 py-3 align-middle",
|
|
176
|
+
F
|
|
177
|
+
),
|
|
178
|
+
children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r(
|
|
179
|
+
J,
|
|
94
180
|
{
|
|
95
|
-
checked:
|
|
96
|
-
onChange:
|
|
97
|
-
variant:
|
|
98
|
-
darkMode:
|
|
99
|
-
disabled:
|
|
181
|
+
checked: se,
|
|
182
|
+
onChange: te,
|
|
183
|
+
variant: H,
|
|
184
|
+
darkMode: d,
|
|
185
|
+
disabled: b || m.length === 0
|
|
100
186
|
}
|
|
101
|
-
) })
|
|
102
|
-
|
|
103
|
-
"th",
|
|
104
|
-
{
|
|
105
|
-
onClick: () => q(e),
|
|
106
|
-
className: a(
|
|
107
|
-
"px-4 py-3 text-left text-sm font-medium transition-colors",
|
|
108
|
-
i ? "text-neutral-50" : "text-slate-700",
|
|
109
|
-
"whitespace-nowrap overflow-hidden text-ellipsis",
|
|
110
|
-
w(e) && "w-px",
|
|
111
|
-
e.align === "center" && "text-center",
|
|
112
|
-
e.align === "right" && "text-right",
|
|
113
|
-
e.sortable && (i ? "cursor-pointer hover:bg-neutral-200" : "cursor-pointer hover:bg-slate-200"),
|
|
114
|
-
C
|
|
115
|
-
),
|
|
116
|
-
children: /* @__PURE__ */ c(
|
|
117
|
-
"div",
|
|
118
|
-
{
|
|
119
|
-
className: a("flex items-center gap-2 min-w-0", e.align === "right" && "justify-end"),
|
|
120
|
-
children: [
|
|
121
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", title: e.title, children: e.title }),
|
|
122
|
-
W(e)
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
},
|
|
127
|
-
e.key
|
|
128
|
-
))
|
|
129
|
-
] }) })
|
|
130
|
-
] })
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
/* @__PURE__ */ t(
|
|
134
|
-
"div",
|
|
135
|
-
{
|
|
136
|
-
className: a(
|
|
137
|
-
"overflow-hidden rounded-xl border border-t-0",
|
|
138
|
-
i ? "border-neutral-200 bg-transparent" : "border-slate-200 bg-white"
|
|
187
|
+
) })
|
|
188
|
+
}
|
|
139
189
|
),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
190
|
+
s.map((e, t) => /* @__PURE__ */ r(
|
|
191
|
+
"th",
|
|
192
|
+
{
|
|
193
|
+
onClick: () => ee(e),
|
|
194
|
+
className: c(
|
|
195
|
+
"px-4 py-3 text-left text-sm font-medium transition-colors align-middle",
|
|
196
|
+
d ? "text-neutral-50" : "text-slate-700",
|
|
197
|
+
"overflow-hidden text-ellipsis whitespace-nowrap",
|
|
198
|
+
t === s.length - 1 && "overflow-visible",
|
|
199
|
+
E(e) && "w-px",
|
|
200
|
+
e.align === "center" && "text-center",
|
|
201
|
+
e.align === "right" && "text-right",
|
|
202
|
+
e.sortable ? d ? "cursor-pointer hover:bg-neutral-200" : "cursor-pointer hover:bg-slate-200" : "cursor-default",
|
|
203
|
+
A(t, "header"),
|
|
204
|
+
F
|
|
205
|
+
),
|
|
206
|
+
children: /* @__PURE__ */ p(
|
|
207
|
+
"div",
|
|
148
208
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
209
|
+
className: c(
|
|
210
|
+
"flex min-w-0 items-center gap-1",
|
|
211
|
+
e.align === "center" && "justify-center",
|
|
212
|
+
e.align === "right" && "justify-end"
|
|
213
|
+
),
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 truncate", title: e.title, children: e.title }),
|
|
216
|
+
ne(e)
|
|
217
|
+
]
|
|
152
218
|
}
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
219
|
+
)
|
|
220
|
+
},
|
|
221
|
+
e.key
|
|
222
|
+
))
|
|
223
|
+
] }) })
|
|
224
|
+
] }) }) }),
|
|
225
|
+
/* @__PURE__ */ r("div", { className: ae, children: /* @__PURE__ */ r("div", { ref: w, className: q, children: /* @__PURE__ */ p("table", { className: G, style: { minWidth: R }, children: [
|
|
226
|
+
M(),
|
|
227
|
+
/* @__PURE__ */ r("tbody", { children: b ? Array.from({ length: y }).map((e, t) => /* @__PURE__ */ p("tr", { children: [
|
|
228
|
+
l && /* @__PURE__ */ r(
|
|
229
|
+
"td",
|
|
230
|
+
{
|
|
231
|
+
className: c(
|
|
232
|
+
"w-12 border-b px-4 py-3 align-middle",
|
|
233
|
+
z,
|
|
234
|
+
t === y - 1 && "rounded-bl-xl",
|
|
235
|
+
t === y - 1 && "border-b-0"
|
|
236
|
+
),
|
|
237
|
+
children: /* @__PURE__ */ r(K, { height: 20, width: 20, variant: "rounded" })
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
s.map((n, o) => /* @__PURE__ */ r(
|
|
241
|
+
"td",
|
|
242
|
+
{
|
|
243
|
+
className: c(
|
|
244
|
+
"border-b px-4 py-3 align-middle",
|
|
245
|
+
z,
|
|
246
|
+
!l && o === 0 && t === y - 1 && "rounded-bl-xl",
|
|
247
|
+
A(o, "body", {
|
|
248
|
+
isLastRow: t === y - 1
|
|
249
|
+
}),
|
|
250
|
+
o === s.length - 1 && t === y - 1 && "rounded-br-xl",
|
|
251
|
+
t === y - 1 && "border-b-0"
|
|
252
|
+
),
|
|
253
|
+
children: /* @__PURE__ */ r(K, { height: 30, variant: "rounded" })
|
|
254
|
+
},
|
|
255
|
+
n.key
|
|
256
|
+
))
|
|
257
|
+
] }, t)) : m.length === 0 ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
|
|
258
|
+
"td",
|
|
259
|
+
{
|
|
260
|
+
colSpan: s.length + (l ? 1 : 0),
|
|
261
|
+
className: "py-20 align-middle",
|
|
262
|
+
children: /* @__PURE__ */ r(fe, { title: X || void 0 })
|
|
263
|
+
}
|
|
264
|
+
) }) : m.map((e, t) => {
|
|
265
|
+
const n = e[k], o = l?.selectedRowKeys.includes(n), h = l?.getCheckboxProps?.(e)?.disabled, a = t === m.length - 1;
|
|
266
|
+
return /* @__PURE__ */ p(
|
|
267
|
+
"tr",
|
|
268
|
+
{
|
|
269
|
+
className: c(
|
|
270
|
+
"group transition-colors",
|
|
271
|
+
d ? "hover:bg-neutral-100/35" : "hover:bg-slate-50"
|
|
272
|
+
),
|
|
273
|
+
children: [
|
|
274
|
+
l && /* @__PURE__ */ r(
|
|
275
|
+
"td",
|
|
160
276
|
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
277
|
+
className: c(
|
|
278
|
+
"w-12 border-b px-4 py-3 align-middle",
|
|
279
|
+
z,
|
|
280
|
+
a && "rounded-bl-xl",
|
|
281
|
+
a && "border-b-0",
|
|
282
|
+
B
|
|
283
|
+
),
|
|
284
|
+
children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r(
|
|
285
|
+
J,
|
|
286
|
+
{
|
|
287
|
+
checked: o,
|
|
288
|
+
disabled: h,
|
|
289
|
+
variant: H,
|
|
290
|
+
darkMode: d,
|
|
291
|
+
onChange: (i) => re(e, i.target.checked)
|
|
292
|
+
}
|
|
293
|
+
) })
|
|
166
294
|
}
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
return /* @__PURE__ */
|
|
295
|
+
),
|
|
296
|
+
s.map((i, L) => {
|
|
297
|
+
const x = e[i.key], C = i.render ? i.render(x, e) : String(x ?? "-");
|
|
298
|
+
return /* @__PURE__ */ r(
|
|
171
299
|
"td",
|
|
172
300
|
{
|
|
173
|
-
className:
|
|
174
|
-
"
|
|
175
|
-
|
|
301
|
+
className: c(
|
|
302
|
+
"overflow-hidden border-b px-4 py-3 text-sm font-normal align-middle",
|
|
303
|
+
z,
|
|
304
|
+
d ? "text-neutral-50" : "text-black",
|
|
176
305
|
"min-w-0 whitespace-normal",
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
306
|
+
E(i) && "w-px whitespace-nowrap",
|
|
307
|
+
i.align === "center" && "text-center",
|
|
308
|
+
i.align === "right" && "text-right",
|
|
309
|
+
!l && L === 0 && a && "rounded-bl-xl",
|
|
310
|
+
A(L, "body", {
|
|
311
|
+
isLastRow: a
|
|
312
|
+
}),
|
|
313
|
+
L === s.length - 1 && a && "rounded-br-xl",
|
|
314
|
+
a && "border-b-0",
|
|
315
|
+
B,
|
|
316
|
+
i.className
|
|
182
317
|
),
|
|
183
|
-
children: /* @__PURE__ */
|
|
318
|
+
children: /* @__PURE__ */ r(
|
|
319
|
+
"div",
|
|
320
|
+
{
|
|
321
|
+
className: c(
|
|
322
|
+
"flex min-w-0 items-center",
|
|
323
|
+
i.align === "center" && "justify-center",
|
|
324
|
+
i.align === "right" && "justify-end"
|
|
325
|
+
),
|
|
326
|
+
children: /* @__PURE__ */ r(
|
|
327
|
+
ue,
|
|
328
|
+
{
|
|
329
|
+
title: typeof C == "string" ? C : void 0,
|
|
330
|
+
children: C
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
)
|
|
184
335
|
},
|
|
185
|
-
|
|
336
|
+
i.key
|
|
186
337
|
);
|
|
187
338
|
})
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
t
|
|
342
|
+
);
|
|
343
|
+
}) })
|
|
344
|
+
] }) }) })
|
|
193
345
|
] })
|
|
194
346
|
}
|
|
195
|
-
);
|
|
347
|
+
) });
|
|
196
348
|
}
|
|
197
349
|
export {
|
|
198
|
-
|
|
350
|
+
Ee as default
|
|
199
351
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
function
|
|
3
|
-
const a = typeof
|
|
4
|
-
return typeof
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
function l({ children: e, title: i }) {
|
|
3
|
+
const a = typeof e == "string" ? e : void 0;
|
|
4
|
+
return typeof e != "string" && typeof e != "number" ? /* @__PURE__ */ t("div", { className: "-m-1 inline-flex w-fit max-w-full items-center overflow-visible p-1 align-middle", children: e }) : /* @__PURE__ */ t("div", { className: "min-w-0", children: /* @__PURE__ */ t("div", { className: "clamp-2 break-words", title: i ?? a, children: e }) });
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
l as default
|
|
8
8
|
};
|