@mci-ui/mci-ui 0.0.93 → 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.
Files changed (43) hide show
  1. package/dist/assets/png/empty.png.js +4 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +54 -50
  4. package/dist/shared/lib/uploadLanguage.js +6 -3
  5. package/dist/shared/ui/MciModal/MciModal.js +1 -1
  6. package/dist/shared/ui/mciAccordion/MciAccordion.js +4 -4
  7. package/dist/shared/ui/mciButton/MciButton.js +12 -10
  8. package/dist/shared/ui/mciCollapse/MciCollapse.js +1 -1
  9. package/dist/shared/ui/mciDrawer/MciDrawer.js +1 -1
  10. package/dist/shared/ui/mciEmpty/MciEmpty.js +41 -0
  11. package/dist/shared/ui/mciInput/MciInput.js +32 -32
  12. package/dist/shared/ui/mciPagination/MciPagination.js +32 -32
  13. package/dist/shared/ui/mciPhone/MciPhone.js +23 -23
  14. package/dist/shared/ui/mciPicker/MciPicker.js +2 -2
  15. package/dist/shared/ui/mciTable/MciTable.js +317 -165
  16. package/dist/shared/ui/mciTable/MciTableClamp2.js +5 -5
  17. package/dist/shared/ui/mciTabs/FilledTabs.js +38 -36
  18. package/dist/shared/ui/mciTabs/OutlinedTabs.js +28 -24
  19. package/dist/shared/ui/mciTabs/TabCountBadge.js +19 -0
  20. package/dist/shared/ui/mciTag/MciTag.js +17 -17
  21. package/dist/shared/ui/mciTextarea/MciTextarea.js +5 -5
  22. package/dist/shared/ui/mciTimePicker/MciTimePicker.js +368 -217
  23. package/dist/shared/ui/mciUpload/MciUpload.js +102 -352
  24. package/dist/shared/ui/mciUpload/MciUploadButton.js +143 -0
  25. package/dist/shared/ui/mciUpload/MciUploadFileList.js +167 -0
  26. package/dist/shared/ui/mciUpload/mci-upload.theme.js +103 -0
  27. package/dist/shared/ui/mciUpload/mci-upload.utils.js +90 -41
  28. package/dist/shared/ui/mciUpload/useMciUpload.js +183 -0
  29. package/dist/types/index.d.ts +4 -0
  30. package/dist/types/shared/lib/uploadLanguage.d.ts +2 -0
  31. package/dist/types/shared/types/ui/empty.types.d.ts +11 -0
  32. package/dist/types/shared/types/ui/index.d.ts +2 -1
  33. package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
  34. package/dist/types/shared/types/ui/time-picker.types.d.ts +7 -1
  35. package/dist/types/shared/types/ui/upload.types.d.ts +25 -1
  36. package/dist/types/shared/ui/mciEmpty/MciEmpty.d.ts +2 -0
  37. package/dist/types/shared/ui/mciTabs/TabCountBadge.d.ts +5 -0
  38. package/dist/types/shared/ui/mciUpload/MciUploadButton.d.ts +4 -0
  39. package/dist/types/shared/ui/mciUpload/MciUploadFileList.d.ts +18 -0
  40. package/dist/types/shared/ui/mciUpload/mci-upload.theme.d.ts +101 -0
  41. package/dist/types/shared/ui/mciUpload/mci-upload.utils.d.ts +7 -0
  42. package/dist/types/shared/ui/mciUpload/useMciUpload.d.ts +131 -0
  43. package/package.json +1 -1
@@ -1,199 +1,351 @@
1
- import { jsx as t, jsxs as c } from "react/jsx-runtime";
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
- 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 z from "../mciCheck/MciCheck.js";
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");
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 ae({
15
- columns: o,
16
- data: b = [],
17
- loading: d = !1,
18
- skeletonRows: D = 5,
19
- noDataText: P = "",
20
- sort: n,
21
- onSortChange: N,
22
- className: F,
23
- headerClassName: C,
24
- bodyClassName: R,
25
- darkMode: i = !1,
26
- variant: j = "orange",
27
- rowKey: p = "id",
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 [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);
33
- }, [n]);
34
- const f = v(
35
- () => d ? [] : n ? x : L,
36
- [d, n, x, L]
37
- ), q = U(
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 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);
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
- [h, n, N]
44
- ), E = (e) => {
101
+ [g, u, D]
102
+ ), te = (e) => {
45
103
  if (!l) return;
46
- const { onChange: s, getCheckboxProps: m } = l;
104
+ const { onChange: t, getCheckboxProps: n } = l;
47
105
  if (e.target.checked) {
48
- const r = f.filter((u) => !m?.(u)?.disabled).map((u) => u[p]);
49
- s(r);
106
+ const a = m.filter((i) => !n?.(i)?.disabled).map((i) => i[k]);
107
+ t(a);
50
108
  } else
51
- s([]);
52
- }, G = (e, s) => {
109
+ t([]);
110
+ }, re = (e, t) => {
53
111
  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);
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
- (s) => l.selectedRowKeys.includes(s[p])
120
+ (t) => l.selectedRowKeys.includes(t[k])
61
121
  );
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;
65
- }, T = () => /* @__PURE__ */ c("colgroup", { children: [
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))
68
- ] });
69
- return /* @__PURE__ */ t(
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
- className: a(
73
- "w-full overflow-x-auto pb-0.5",
74
- "[&::-webkit-scrollbar]:h-1",
75
- "[&::-webkit-scrollbar-track]:bg-transparent",
76
- i ? "[&::-webkit-scrollbar-thumb]:bg-neutral-200" : "[&::-webkit-scrollbar-thumb]:bg-slate-200",
77
- "[&::-webkit-scrollbar-thumb]:rounded-full",
78
- i ? "hover:[&::-webkit-scrollbar-thumb]:bg-neutral-100" : "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
79
- F
80
- ),
81
- children: /* @__PURE__ */ c("div", { className: "inline-block min-w-full align-middle", children: [
82
- /* @__PURE__ */ t(
83
- "div",
84
- {
85
- className: a(
86
- "overflow-hidden rounded-xl border",
87
- i ? "border-neutral-200 bg-neutral-300" : "border-slate-200 bg-slate-100"
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: I,
96
- onChange: E,
97
- variant: j,
98
- darkMode: i,
99
- disabled: d || f.length === 0
181
+ checked: se,
182
+ onChange: te,
183
+ variant: H,
184
+ darkMode: d,
185
+ disabled: b || m.length === 0
100
186
  }
101
- ) }) }),
102
- o.map((e) => /* @__PURE__ */ t(
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
- children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
141
- T(),
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: [
146
- /* @__PURE__ */ t("div", { className: "relative mb-4", children: /* @__PURE__ */ t(
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
- weight: "Bold",
150
- size: 64,
151
- className: a("animate-float", i ? "text-neutral-100" : "text-slate-400")
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
- /* @__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(
159
- z,
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
- checked: y,
162
- disabled: g,
163
- variant: j,
164
- darkMode: i,
165
- onChange: (r) => G(e, r.target.checked)
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
- o.map((r) => {
169
- const u = e[r.key], k = r.render ? r.render(u, e) : String(u ?? "-");
170
- return /* @__PURE__ */ t(
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: a(
174
- "align-top px-4 py-3 text-sm font-normal overflow-visible",
175
- i ? "text-neutral-50" : "text-black",
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
- w(r) && "w-px whitespace-nowrap",
178
- r.align === "center" && "text-center",
179
- r.align === "right" && "text-right",
180
- R,
181
- r.className
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__ */ t(X, { title: typeof k == "string" ? k : void 0, children: k })
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
- r.key
336
+ i.key
186
337
  );
187
338
  })
188
- ] }, s);
189
- }) })
190
- ] })
191
- }
192
- )
339
+ ]
340
+ },
341
+ t
342
+ );
343
+ }) })
344
+ ] }) }) })
193
345
  ] })
194
346
  }
195
- );
347
+ ) });
196
348
  }
197
349
  export {
198
- ae as default
350
+ Ee as default
199
351
  };
@@ -1,8 +1,8 @@
1
- import { jsx as e } from "react/jsx-runtime";
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 }) });
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
- o as default
7
+ l as default
8
8
  };