asterui 0.12.18 → 0.12.20
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/components/Code.d.ts +2 -0
- package/dist/components/CopyButton.d.ts +34 -0
- package/dist/components/Watermark.d.ts +40 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +205 -201
- package/dist/index.js.map +1 -1
- package/dist/index10.js +91 -121
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +5 -45
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +13 -12
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +44 -13
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +12 -7
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +13 -11
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +7 -30
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +11 -16
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +34 -0
- package/dist/index107.js.map +1 -0
- package/dist/index108.js +21 -0
- package/dist/index108.js.map +1 -0
- package/dist/index11.js +123 -30
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +28 -263
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +257 -105
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +108 -153
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +154 -146
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +150 -5
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +5 -71
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +70 -24
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +23 -194
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +188 -106
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +107 -177
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +181 -107
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +110 -19
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +17 -41
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +43 -32
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +30 -170
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +171 -40
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +41 -17
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +17 -33
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +33 -52
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +50 -61
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +60 -181
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +184 -18
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +15 -271
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +270 -1083
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +1086 -16
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +17 -17
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +15 -120
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +119 -37
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +40 -398
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +390 -89
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +91 -253
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +249 -145
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +155 -15
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +15 -17
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +16 -136
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +134 -10
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +13 -35
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +35 -34
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +34 -81
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +71 -166
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +167 -144
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +152 -11
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +10 -20
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +55 -12
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +14 -7
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +6 -333
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +334 -47
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +47 -122
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +120 -108
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +107 -167
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +167 -29
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +30 -120
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +116 -80
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +85 -19
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +19 -73
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +71 -54
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +56 -44
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +42 -49
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +50 -121
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +118 -102
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +105 -72
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +73 -67
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +66 -19
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +18 -55
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +55 -251
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +254 -22
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +22 -31
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +30 -93
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +89 -324
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +322 -73
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +79 -39
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +40 -23
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +21 -93
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +87 -148
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +147 -152
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +159 -63
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +65 -35
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +35 -234
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +231 -31
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +34 -210
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +195 -198
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +159 -241
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +283 -166
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +173 -253
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +258 -14
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +124 -31
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +13 -5
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +31 -12
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index80.js
CHANGED
|
@@ -1,332 +1,97 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
),
|
|
24
|
-
w && /* @__PURE__ */ f(
|
|
25
|
-
"div",
|
|
26
|
-
{
|
|
27
|
-
tabIndex: 0,
|
|
28
|
-
className: "dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52 border border-base-content/10",
|
|
29
|
-
children: [
|
|
30
|
-
/* @__PURE__ */ s("div", { className: "space-y-2", children: l.map((c) => /* @__PURE__ */ f("label", { className: "flex items-center gap-2 cursor-pointer p-2 hover:bg-base-200 rounded", children: [
|
|
31
|
-
/* @__PURE__ */ s(
|
|
32
|
-
"input",
|
|
33
|
-
{
|
|
34
|
-
type: "checkbox",
|
|
35
|
-
className: "checkbox checkbox-xs",
|
|
36
|
-
checked: p.includes(c.value),
|
|
37
|
-
onChange: () => I(c.value)
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ s("span", { className: "text-sm", children: c.text })
|
|
41
|
-
] }, String(c.value))) }),
|
|
42
|
-
/* @__PURE__ */ s("div", { className: "divider my-1" }),
|
|
43
|
-
/* @__PURE__ */ s(
|
|
44
|
-
"button",
|
|
45
|
-
{
|
|
46
|
-
className: "btn btn-ghost btn-xs w-full",
|
|
47
|
-
onClick: P,
|
|
48
|
-
children: "Clear"
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
] });
|
|
55
|
-
}
|
|
56
|
-
function ne({
|
|
57
|
-
columns: l,
|
|
58
|
-
dataSource: p,
|
|
59
|
-
rowKey: k = "id",
|
|
60
|
-
loading: w = !1,
|
|
61
|
-
size: m = "md",
|
|
62
|
-
bordered: I = !1,
|
|
63
|
-
hoverable: P = !0,
|
|
64
|
-
striped: c = !1,
|
|
65
|
-
pinRows: S = !1,
|
|
66
|
-
pinCols: $ = !1,
|
|
67
|
-
pagination: h,
|
|
68
|
-
rowSelection: o,
|
|
69
|
-
className: E = "",
|
|
70
|
-
onRow: W
|
|
1
|
+
import { jsx as i, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
|
+
const j = {
|
|
4
|
+
neutral: "step-neutral",
|
|
5
|
+
primary: "step-primary",
|
|
6
|
+
secondary: "step-secondary",
|
|
7
|
+
accent: "step-accent",
|
|
8
|
+
info: "step-info",
|
|
9
|
+
success: "step-success",
|
|
10
|
+
warning: "step-warning",
|
|
11
|
+
error: "step-error"
|
|
12
|
+
};
|
|
13
|
+
function N({
|
|
14
|
+
children: a,
|
|
15
|
+
items: l,
|
|
16
|
+
current: e,
|
|
17
|
+
direction: p,
|
|
18
|
+
vertical: d = !1,
|
|
19
|
+
onChange: t,
|
|
20
|
+
className: c = "",
|
|
21
|
+
...f
|
|
71
22
|
}) {
|
|
72
|
-
const [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (t.length > 0) {
|
|
91
|
-
const n = l.find((r) => r.key === e);
|
|
92
|
-
n?.onFilter && (y = y.filter(
|
|
93
|
-
(r) => t.some((i) => n.onFilter(i, r))
|
|
94
|
-
));
|
|
95
|
-
}
|
|
96
|
-
}), x.columnKey && x.order) {
|
|
97
|
-
const e = l.find((t) => t.key === x.columnKey);
|
|
98
|
-
e?.sorter && y.sort((t, n) => {
|
|
99
|
-
let r = 0;
|
|
100
|
-
if (typeof e.sorter == "function")
|
|
101
|
-
r = e.sorter(t, n);
|
|
102
|
-
else if (e.dataIndex) {
|
|
103
|
-
const i = t[e.dataIndex], d = n[e.dataIndex];
|
|
104
|
-
i < d && (r = -1), i > d && (r = 1);
|
|
105
|
-
}
|
|
106
|
-
return x.order === "ascend" ? r : -r;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
const L = Math.ceil(y.length / j), A = (N - 1) * j, q = A + j, C = R ? y.slice(A, q) : y, B = (e) => {
|
|
110
|
-
K(e), h !== !1 && h?.onChange && h.onChange(e, j);
|
|
111
|
-
}, G = (e) => {
|
|
112
|
-
T((t) => {
|
|
113
|
-
if (t.columnKey === e) {
|
|
114
|
-
if (t.order === "ascend") return { columnKey: e, order: "descend" };
|
|
115
|
-
if (t.order === "descend") return { columnKey: null, order: null };
|
|
116
|
-
}
|
|
117
|
-
return { columnKey: e, order: "ascend" };
|
|
118
|
-
}), K(1);
|
|
119
|
-
}, J = (e, t) => {
|
|
120
|
-
_((n) => ({
|
|
121
|
-
...n,
|
|
122
|
-
[e]: t
|
|
123
|
-
})), K(1);
|
|
124
|
-
}, Q = (e) => {
|
|
125
|
-
const t = e ? C.map((n, r) => F(n, r)) : [];
|
|
126
|
-
if (O(t), o?.onChange) {
|
|
127
|
-
const n = e ? C : [];
|
|
128
|
-
o.onChange(t, n);
|
|
129
|
-
}
|
|
130
|
-
}, U = (e, t, n) => {
|
|
131
|
-
const r = F(e, t), i = n ? [...z, r] : z.filter((d) => d !== r);
|
|
132
|
-
if (O(i), o?.onChange) {
|
|
133
|
-
const d = y.filter(
|
|
134
|
-
(u, a) => i.includes(F(u, a))
|
|
23
|
+
const n = ["steps", (p === "vertical" || d) && "steps-vertical", c].filter(Boolean).join(" ");
|
|
24
|
+
if (l && l.length > 0)
|
|
25
|
+
return /* @__PURE__ */ i("ul", { className: n, ...f, children: l.map((s, o) => {
|
|
26
|
+
const C = e !== void 0 && o < e, r = e !== void 0 && o === e, v = s.color || (C || r ? "primary" : void 0);
|
|
27
|
+
return /* @__PURE__ */ i(
|
|
28
|
+
k,
|
|
29
|
+
{
|
|
30
|
+
color: v,
|
|
31
|
+
icon: s.icon,
|
|
32
|
+
title: s.title,
|
|
33
|
+
description: s.description,
|
|
34
|
+
disabled: s.disabled,
|
|
35
|
+
_index: o,
|
|
36
|
+
_clickable: !!t && !s.disabled,
|
|
37
|
+
_onClick: t,
|
|
38
|
+
"aria-current": r ? "step" : void 0
|
|
39
|
+
},
|
|
40
|
+
s.key ?? o
|
|
135
41
|
);
|
|
136
|
-
|
|
42
|
+
}) });
|
|
43
|
+
const u = e !== void 0 ? y.Children.map(a, (s, o) => {
|
|
44
|
+
if (y.isValidElement(s)) {
|
|
45
|
+
const C = o < e, r = o === e, v = s.props.color || (C || r ? "primary" : void 0);
|
|
46
|
+
return y.cloneElement(s, {
|
|
47
|
+
color: v,
|
|
48
|
+
_index: o,
|
|
49
|
+
_clickable: !!t && !s.props.disabled,
|
|
50
|
+
_onClick: t,
|
|
51
|
+
"aria-current": r ? "step" : void 0
|
|
52
|
+
});
|
|
137
53
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
54
|
+
return s;
|
|
55
|
+
}) : a;
|
|
56
|
+
return /* @__PURE__ */ i("ul", { className: n, ...f, children: u });
|
|
57
|
+
}
|
|
58
|
+
function k({
|
|
59
|
+
children: a,
|
|
60
|
+
title: l,
|
|
61
|
+
description: e,
|
|
62
|
+
icon: p,
|
|
63
|
+
color: d,
|
|
64
|
+
dataContent: t,
|
|
65
|
+
disabled: c = !1,
|
|
66
|
+
className: f = "",
|
|
67
|
+
_index: m,
|
|
68
|
+
_clickable: n,
|
|
69
|
+
_onClick: u,
|
|
70
|
+
...s
|
|
71
|
+
}) {
|
|
72
|
+
const o = ["step", d && j[d], c && "step-disabled", f].filter(Boolean).join(" ");
|
|
73
|
+
return /* @__PURE__ */ b(
|
|
74
|
+
"li",
|
|
75
|
+
{
|
|
76
|
+
className: o,
|
|
77
|
+
"data-content": t,
|
|
78
|
+
onClick: () => {
|
|
79
|
+
n && u && m !== void 0 && !c && u(m);
|
|
80
|
+
},
|
|
81
|
+
style: n && !c ? { cursor: "pointer" } : void 0,
|
|
82
|
+
...s,
|
|
83
|
+
children: [
|
|
84
|
+
p && /* @__PURE__ */ i("span", { className: "step-icon", children: p }),
|
|
85
|
+
l ?? a,
|
|
86
|
+
e && /* @__PURE__ */ i("span", { className: "text-xs opacity-70 block", children: e })
|
|
87
|
+
]
|
|
172
88
|
}
|
|
173
|
-
|
|
174
|
-
className: r.filter(Boolean).join(" "),
|
|
175
|
-
style: Object.keys(d).length > 0 ? d : void 0
|
|
176
|
-
};
|
|
177
|
-
}, Y = [
|
|
178
|
-
"table",
|
|
179
|
-
"bg-base-100",
|
|
180
|
-
m === "xs" && "table-xs",
|
|
181
|
-
m === "sm" && "table-sm",
|
|
182
|
-
m === "lg" && "table-lg",
|
|
183
|
-
c && "table-zebra",
|
|
184
|
-
S && "table-pin-rows",
|
|
185
|
-
$ && "table-pin-cols",
|
|
186
|
-
E
|
|
187
|
-
].filter(Boolean).join(" "), Z = l.some((e) => e.fixed), H = [
|
|
188
|
-
(!S || Z) && "overflow-x-auto",
|
|
189
|
-
I && "rounded-box border border-base-content/5 bg-base-100"
|
|
190
|
-
].filter(Boolean).join(" ");
|
|
191
|
-
if (w)
|
|
192
|
-
return /* @__PURE__ */ s("div", { className: "flex justify-center items-center p-8", children: /* @__PURE__ */ s("span", { className: "loading loading-spinner loading-lg" }) });
|
|
193
|
-
const ee = C.length > 0 && z.length === C.length;
|
|
194
|
-
return /* @__PURE__ */ f("div", { className: "space-y-4", children: [
|
|
195
|
-
/* @__PURE__ */ s("div", { className: H, children: /* @__PURE__ */ f("table", { className: Y, style: { borderCollapse: "separate", borderSpacing: 0, tableLayout: "fixed" }, children: [
|
|
196
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ f("tr", { children: [
|
|
197
|
-
o && /* @__PURE__ */ s("th", { style: { width: 50 }, className: "sticky left-0 z-20 bg-base-100", children: o.type !== "radio" && /* @__PURE__ */ s(
|
|
198
|
-
"input",
|
|
199
|
-
{
|
|
200
|
-
type: "checkbox",
|
|
201
|
-
className: "checkbox checkbox-sm",
|
|
202
|
-
checked: ee,
|
|
203
|
-
onChange: (e) => Q(e.target.checked)
|
|
204
|
-
}
|
|
205
|
-
) }),
|
|
206
|
-
l.map((e, t) => {
|
|
207
|
-
const n = D(t, !0);
|
|
208
|
-
return /* @__PURE__ */ s(
|
|
209
|
-
"th",
|
|
210
|
-
{
|
|
211
|
-
className: `${M(e.align)} ${n.className}`,
|
|
212
|
-
style: {
|
|
213
|
-
...e.width ? { width: e.width } : {},
|
|
214
|
-
...n.style
|
|
215
|
-
},
|
|
216
|
-
children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
217
|
-
/* @__PURE__ */ s(
|
|
218
|
-
"span",
|
|
219
|
-
{
|
|
220
|
-
className: e.sorter ? "cursor-pointer select-none" : "",
|
|
221
|
-
onClick: () => e.sorter && G(e.key),
|
|
222
|
-
children: e.title
|
|
223
|
-
}
|
|
224
|
-
),
|
|
225
|
-
e.sorter && /* @__PURE__ */ f("div", { className: "flex flex-col", children: [
|
|
226
|
-
/* @__PURE__ */ s(
|
|
227
|
-
"svg",
|
|
228
|
-
{
|
|
229
|
-
className: `w-3 h-3 ${x.columnKey === e.key && x.order === "ascend" ? "text-primary" : "text-base-content/30"}`,
|
|
230
|
-
fill: "currentColor",
|
|
231
|
-
viewBox: "0 0 20 20",
|
|
232
|
-
children: /* @__PURE__ */ s("path", { d: "M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z" })
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
/* @__PURE__ */ s(
|
|
236
|
-
"svg",
|
|
237
|
-
{
|
|
238
|
-
className: `w-3 h-3 -mt-1 ${x.columnKey === e.key && x.order === "descend" ? "text-primary" : "text-base-content/30"}`,
|
|
239
|
-
fill: "currentColor",
|
|
240
|
-
viewBox: "0 0 20 20",
|
|
241
|
-
children: /* @__PURE__ */ s("path", { d: "M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z" })
|
|
242
|
-
}
|
|
243
|
-
)
|
|
244
|
-
] }),
|
|
245
|
-
e.filters && /* @__PURE__ */ s(
|
|
246
|
-
te,
|
|
247
|
-
{
|
|
248
|
-
filters: e.filters,
|
|
249
|
-
selectedValues: V[e.key] || [],
|
|
250
|
-
onChange: (r) => J(e.key, r)
|
|
251
|
-
}
|
|
252
|
-
)
|
|
253
|
-
] })
|
|
254
|
-
},
|
|
255
|
-
e.key
|
|
256
|
-
);
|
|
257
|
-
})
|
|
258
|
-
] }) }),
|
|
259
|
-
/* @__PURE__ */ s("tbody", { children: C.map((e, t) => {
|
|
260
|
-
const n = W?.(e, t) || {}, r = F(e, t), i = z.includes(r), d = [
|
|
261
|
-
P && "hover:bg-base-300",
|
|
262
|
-
i && "bg-primary/10"
|
|
263
|
-
].filter(Boolean).join(" "), u = o?.getCheckboxProps?.(e) || {};
|
|
264
|
-
return /* @__PURE__ */ f(
|
|
265
|
-
"tr",
|
|
266
|
-
{
|
|
267
|
-
className: d,
|
|
268
|
-
...n,
|
|
269
|
-
children: [
|
|
270
|
-
o && /* @__PURE__ */ s("td", { className: "sticky left-0 z-10 bg-base-100", children: /* @__PURE__ */ s(
|
|
271
|
-
"input",
|
|
272
|
-
{
|
|
273
|
-
type: o.type === "radio" ? "radio" : "checkbox",
|
|
274
|
-
className: o.type === "radio" ? "radio radio-sm" : "checkbox checkbox-sm",
|
|
275
|
-
checked: i,
|
|
276
|
-
onChange: (a) => U(e, t, a.target.checked),
|
|
277
|
-
...u
|
|
278
|
-
}
|
|
279
|
-
) }),
|
|
280
|
-
l.map((a, b) => {
|
|
281
|
-
const g = D(b, !1);
|
|
282
|
-
return /* @__PURE__ */ s(
|
|
283
|
-
"td",
|
|
284
|
-
{
|
|
285
|
-
className: `${M(a.align)} ${g.className}`,
|
|
286
|
-
style: g.style,
|
|
287
|
-
children: X(a, e, t)
|
|
288
|
-
},
|
|
289
|
-
a.key
|
|
290
|
-
);
|
|
291
|
-
})
|
|
292
|
-
]
|
|
293
|
-
},
|
|
294
|
-
r
|
|
295
|
-
);
|
|
296
|
-
}) })
|
|
297
|
-
] }) }),
|
|
298
|
-
R && L > 1 && /* @__PURE__ */ s("div", { className: "flex justify-end", children: /* @__PURE__ */ f("div", { className: "join", children: [
|
|
299
|
-
/* @__PURE__ */ s(
|
|
300
|
-
"button",
|
|
301
|
-
{
|
|
302
|
-
className: "join-item btn btn-sm",
|
|
303
|
-
onClick: () => B(N - 1),
|
|
304
|
-
disabled: N === 1,
|
|
305
|
-
children: "«"
|
|
306
|
-
}
|
|
307
|
-
),
|
|
308
|
-
Array.from({ length: L }, (e, t) => t + 1).map((e) => /* @__PURE__ */ s(
|
|
309
|
-
"button",
|
|
310
|
-
{
|
|
311
|
-
className: `join-item btn btn-sm ${N === e ? "btn-active" : ""}`,
|
|
312
|
-
onClick: () => B(e),
|
|
313
|
-
children: e
|
|
314
|
-
},
|
|
315
|
-
e
|
|
316
|
-
)),
|
|
317
|
-
/* @__PURE__ */ s(
|
|
318
|
-
"button",
|
|
319
|
-
{
|
|
320
|
-
className: "join-item btn btn-sm",
|
|
321
|
-
onClick: () => B(N + 1),
|
|
322
|
-
disabled: N === L,
|
|
323
|
-
children: "»"
|
|
324
|
-
}
|
|
325
|
-
)
|
|
326
|
-
] }) })
|
|
327
|
-
] });
|
|
89
|
+
);
|
|
328
90
|
}
|
|
91
|
+
const V = Object.assign(N, {
|
|
92
|
+
Step: k
|
|
93
|
+
});
|
|
329
94
|
export {
|
|
330
|
-
|
|
95
|
+
V as Steps
|
|
331
96
|
};
|
|
332
97
|
//# sourceMappingURL=index80.js.map
|
package/dist/index80.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index80.js","sources":["../src/components/Table.tsx"],"sourcesContent":["import React, { useState } from 'react'\n\nexport interface FilterConfig {\n text: string\n value: string | number | boolean\n}\n\nexport interface ColumnType<T = any> {\n key: string\n title: string\n dataIndex?: string\n render?: (value: any, record: T, index: number) => React.ReactNode\n width?: string | number\n align?: 'left' | 'center' | 'right'\n fixed?: 'left' | 'right'\n sorter?: boolean | ((a: T, b: T) => number)\n filters?: FilterConfig[]\n onFilter?: (value: string | number | boolean, record: T) => boolean\n defaultSortOrder?: 'ascend' | 'descend'\n defaultFilteredValue?: (string | number | boolean)[]\n}\n\nexport interface RowSelection<T = any> {\n type?: 'checkbox' | 'radio'\n selectedRowKeys?: React.Key[]\n onChange?: (selectedRowKeys: React.Key[], selectedRows: T[]) => void\n getCheckboxProps?: (record: T) => { disabled?: boolean; [key: string]: any }\n}\n\nexport interface PaginationConfig {\n current?: number\n pageSize?: number\n total?: number\n onChange?: (page: number, pageSize: number) => void\n}\n\nexport interface TableProps<T = any> {\n columns: ColumnType<T>[]\n dataSource: T[]\n rowKey?: string | ((record: T) => string)\n loading?: boolean\n size?: 'xs' | 'sm' | 'md' | 'lg'\n bordered?: boolean\n hoverable?: boolean\n striped?: boolean\n pinRows?: boolean\n pinCols?: boolean\n pagination?: false | PaginationConfig\n rowSelection?: RowSelection<T>\n className?: string\n onRow?: (record: T, index: number) => React.HTMLAttributes<HTMLTableRowElement>\n}\n\nfunction FilterDropdown({\n filters,\n selectedValues,\n onChange,\n}: {\n filters: FilterConfig[]\n selectedValues: (string | number | boolean)[]\n onChange: (values: (string | number | boolean)[]) => void\n}) {\n const [isOpen, setIsOpen] = useState(false)\n\n const handleToggle = (value: string | number | boolean) => {\n const newValues = selectedValues.includes(value)\n ? selectedValues.filter((v) => v !== value)\n : [...selectedValues, value]\n onChange(newValues)\n }\n\n const handleClear = () => {\n onChange([])\n setIsOpen(false)\n }\n\n return (\n <div className=\"dropdown dropdown-end\">\n <button\n tabIndex={0}\n className={`btn btn-ghost btn-xs ${selectedValues.length > 0 ? 'text-primary' : ''}`}\n onClick={() => setIsOpen(!isOpen)}\n >\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z\" />\n </svg>\n </button>\n {isOpen && (\n <div\n tabIndex={0}\n className=\"dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52 border border-base-content/10\"\n >\n <div className=\"space-y-2\">\n {filters.map((filter) => (\n <label key={String(filter.value)} className=\"flex items-center gap-2 cursor-pointer p-2 hover:bg-base-200 rounded\">\n <input\n type=\"checkbox\"\n className=\"checkbox checkbox-xs\"\n checked={selectedValues.includes(filter.value)}\n onChange={() => handleToggle(filter.value)}\n />\n <span className=\"text-sm\">{filter.text}</span>\n </label>\n ))}\n </div>\n <div className=\"divider my-1\"></div>\n <button\n className=\"btn btn-ghost btn-xs w-full\"\n onClick={handleClear}\n >\n Clear\n </button>\n </div>\n )}\n </div>\n )\n}\n\nexport function Table<T extends Record<string, any>>({\n columns,\n dataSource,\n rowKey = 'id',\n loading = false,\n size = 'md',\n bordered = false,\n hoverable = true,\n striped = false,\n pinRows = false,\n pinCols = false,\n pagination,\n rowSelection,\n className = '',\n onRow,\n}: TableProps<T>) {\n const defaultPageSize = 10\n const [currentPage, setCurrentPage] = useState(\n pagination !== false && pagination?.current ? pagination.current : 1\n )\n const pageSize = pagination !== false && pagination?.pageSize ? pagination.pageSize : defaultPageSize\n\n // Sorting state\n const [sortState, setSortState] = useState<{\n columnKey: string | null\n order: 'ascend' | 'descend' | null\n }>(() => {\n const defaultSortColumn = columns.find((col) => col.defaultSortOrder)\n return {\n columnKey: defaultSortColumn?.key || null,\n order: defaultSortColumn?.defaultSortOrder || null,\n }\n })\n\n // Filtering state\n const [filterState, setFilterState] = useState<Record<string, (string | number | boolean)[]>>(() => {\n const initial: Record<string, (string | number | boolean)[]> = {}\n columns.forEach((col) => {\n if (col.defaultFilteredValue) {\n initial[col.key] = col.defaultFilteredValue\n }\n })\n return initial\n })\n\n // Row selection state\n const [selectedKeys, setSelectedKeys] = useState<React.Key[]>(\n rowSelection?.selectedRowKeys || []\n )\n\n const isPaginationEnabled = pagination !== false\n\n // Apply filters\n let filteredData = [...dataSource]\n Object.entries(filterState).forEach(([columnKey, filterValues]) => {\n if (filterValues.length > 0) {\n const column = columns.find((col) => col.key === columnKey)\n if (column?.onFilter) {\n filteredData = filteredData.filter((record) =>\n filterValues.some((value) => column.onFilter!(value, record))\n )\n }\n }\n })\n\n // Apply sorting\n if (sortState.columnKey && sortState.order) {\n const column = columns.find((col) => col.key === sortState.columnKey)\n if (column?.sorter) {\n filteredData.sort((a, b) => {\n let result = 0\n if (typeof column.sorter === 'function') {\n result = column.sorter(a, b)\n } else if (column.dataIndex) {\n const aVal = a[column.dataIndex]\n const bVal = b[column.dataIndex]\n if (aVal < bVal) result = -1\n if (aVal > bVal) result = 1\n }\n return sortState.order === 'ascend' ? result : -result\n })\n }\n }\n\n const totalPages = Math.ceil(filteredData.length / pageSize)\n const startIndex = (currentPage - 1) * pageSize\n const endIndex = startIndex + pageSize\n const paginatedData = isPaginationEnabled ? filteredData.slice(startIndex, endIndex) : filteredData\n\n const handlePageChange = (page: number) => {\n setCurrentPage(page)\n if (pagination !== false && pagination?.onChange) {\n pagination.onChange(page, pageSize)\n }\n }\n\n const handleSort = (columnKey: string) => {\n setSortState((prev) => {\n if (prev.columnKey === columnKey) {\n // Cycle through: ascend -> descend -> null\n if (prev.order === 'ascend') return { columnKey, order: 'descend' }\n if (prev.order === 'descend') return { columnKey: null, order: null }\n }\n return { columnKey, order: 'ascend' }\n })\n setCurrentPage(1) // Reset to first page when sorting\n }\n\n const handleFilterChange = (columnKey: string, values: (string | number | boolean)[]) => {\n setFilterState((prev) => ({\n ...prev,\n [columnKey]: values,\n }))\n setCurrentPage(1) // Reset to first page when filtering\n }\n\n const handleSelectAll = (checked: boolean) => {\n const newSelectedKeys = checked\n ? paginatedData.map((record, index) => getRowKey(record, index))\n : []\n setSelectedKeys(newSelectedKeys)\n if (rowSelection?.onChange) {\n const selectedRecords = checked ? paginatedData : []\n rowSelection.onChange(newSelectedKeys, selectedRecords)\n }\n }\n\n const handleSelectRow = (record: T, index: number, checked: boolean) => {\n const key = getRowKey(record, index)\n const newSelectedKeys = checked\n ? [...selectedKeys, key]\n : selectedKeys.filter((k) => k !== key)\n setSelectedKeys(newSelectedKeys)\n if (rowSelection?.onChange) {\n const selectedRecords = filteredData.filter((r, i) =>\n newSelectedKeys.includes(getRowKey(r, i))\n )\n rowSelection.onChange(newSelectedKeys, selectedRecords)\n }\n }\n\n const getRowKey = (record: T, index: number): string => {\n if (typeof rowKey === 'function') {\n return rowKey(record)\n }\n return record[rowKey] ?? index.toString()\n }\n\n const getCellValue = (column: ColumnType<T>, record: T, index: number) => {\n if (column.render) {\n return column.render(\n column.dataIndex ? record[column.dataIndex] : undefined,\n record,\n index\n )\n }\n return column.dataIndex ? record[column.dataIndex] : ''\n }\n\n const getAlignClass = (align?: 'left' | 'center' | 'right') => {\n if (align === 'center') return 'text-center'\n if (align === 'right') return 'text-right'\n return 'text-left'\n }\n\n // Calculate fixed column offsets\n const getFixedColumnStyle = (columnIndex: number, isHeader = false): { className: string; style?: React.CSSProperties } => {\n const column = columns[columnIndex]\n if (!column.fixed) return { className: '' }\n\n const classes = ['sticky', 'bg-base-100']\n let offset = 0\n const style: React.CSSProperties = {\n boxSizing: 'border-box',\n }\n\n // Calculate cumulative width for left-fixed columns\n if (column.fixed === 'left') {\n for (let i = 0; i < columnIndex; i++) {\n if (columns[i].fixed === 'left' && columns[i].width) {\n const colWidth = columns[i].width!\n const width = typeof colWidth === 'number'\n ? colWidth\n : parseInt(String(colWidth))\n if (!isNaN(width)) {\n offset += width\n }\n }\n }\n if (offset === 0) {\n classes.push('left-0')\n } else {\n style.left = `${offset}px`\n }\n classes.push(isHeader ? 'z-30' : 'z-20')\n\n // Add shadow to the rightmost left-fixed column\n let lastLeftFixedIndex = -1\n for (let i = columns.length - 1; i >= 0; i--) {\n if (columns[i].fixed === 'left') {\n lastLeftFixedIndex = i\n break\n }\n }\n if (columnIndex === lastLeftFixedIndex) {\n style.boxShadow = '2px 0 4px rgba(0, 0, 0, 0.1)'\n }\n }\n\n // Calculate cumulative width for right-fixed columns\n if (column.fixed === 'right') {\n for (let i = columnIndex + 1; i < columns.length; i++) {\n if (columns[i].fixed === 'right' && columns[i].width) {\n const colWidth = columns[i].width!\n const width = typeof colWidth === 'number'\n ? colWidth\n : parseInt(String(colWidth))\n if (!isNaN(width)) {\n offset += width\n }\n }\n }\n if (offset === 0) {\n classes.push('right-0')\n } else {\n style.right = `${offset}px`\n }\n classes.push(isHeader ? 'z-30' : 'z-20')\n\n // Add shadow to the leftmost right-fixed column\n const isFirstRightFixed = columnIndex === columns.findIndex((col) => col.fixed === 'right')\n if (isFirstRightFixed) {\n style.boxShadow = '-2px 0 4px rgba(0, 0, 0, 0.1)'\n }\n }\n\n return {\n className: classes.filter(Boolean).join(' '),\n style: Object.keys(style).length > 0 ? style : undefined,\n }\n }\n\n const tableClasses = [\n 'table',\n 'bg-base-100',\n size === 'xs' && 'table-xs',\n size === 'sm' && 'table-sm',\n size === 'lg' && 'table-lg',\n striped && 'table-zebra',\n pinRows && 'table-pin-rows',\n pinCols && 'table-pin-cols',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // Check if any columns are fixed\n const hasFixedColumns = columns.some((col) => col.fixed)\n\n const wrapperClasses = [\n (!pinRows || hasFixedColumns) && 'overflow-x-auto',\n bordered && 'rounded-box border border-base-content/5 bg-base-100',\n ]\n .filter(Boolean)\n .join(' ')\n\n if (loading) {\n return (\n <div className=\"flex justify-center items-center p-8\">\n <span className=\"loading loading-spinner loading-lg\"></span>\n </div>\n )\n }\n\n const isAllSelected = paginatedData.length > 0 && selectedKeys.length === paginatedData.length\n\n return (\n <div className=\"space-y-4\">\n <div className={wrapperClasses}>\n <table className={tableClasses} style={{ borderCollapse: 'separate', borderSpacing: 0, tableLayout: 'fixed' }}>\n <thead>\n <tr>\n {rowSelection && (\n <th style={{ width: 50 }} className=\"sticky left-0 z-20 bg-base-100\">\n {rowSelection.type !== 'radio' && (\n <input\n type=\"checkbox\"\n className=\"checkbox checkbox-sm\"\n checked={isAllSelected}\n onChange={(e) => handleSelectAll(e.target.checked)}\n />\n )}\n </th>\n )}\n {columns.map((column, columnIndex) => {\n const fixedStyle = getFixedColumnStyle(columnIndex, true)\n return (\n <th\n key={column.key}\n className={`${getAlignClass(column.align)} ${fixedStyle.className}`}\n style={{\n ...(column.width ? { width: column.width } : {}),\n ...fixedStyle.style,\n }}\n >\n <div className=\"flex items-center gap-2\">\n <span\n className={column.sorter ? 'cursor-pointer select-none' : ''}\n onClick={() => column.sorter && handleSort(column.key)}\n >\n {column.title}\n </span>\n {column.sorter && (\n <div className=\"flex flex-col\">\n <svg\n className={`w-3 h-3 ${sortState.columnKey === column.key && sortState.order === 'ascend' ? 'text-primary' : 'text-base-content/30'}`}\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path d=\"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z\" />\n </svg>\n <svg\n className={`w-3 h-3 -mt-1 ${sortState.columnKey === column.key && sortState.order === 'descend' ? 'text-primary' : 'text-base-content/30'}`}\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path d=\"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z\" />\n </svg>\n </div>\n )}\n {column.filters && (\n <FilterDropdown\n filters={column.filters}\n selectedValues={filterState[column.key] || []}\n onChange={(values) => handleFilterChange(column.key, values)}\n />\n )}\n </div>\n </th>\n )\n })}\n </tr>\n </thead>\n <tbody>\n {paginatedData.map((record, index) => {\n const rowProps = onRow?.(record, index) || {}\n const key = getRowKey(record, index)\n const isSelected = selectedKeys.includes(key)\n const rowClasses = [\n hoverable && 'hover:bg-base-300',\n isSelected && 'bg-primary/10',\n ]\n .filter(Boolean)\n .join(' ')\n\n const checkboxProps = rowSelection?.getCheckboxProps?.(record) || {}\n\n return (\n <tr\n key={key}\n className={rowClasses}\n {...rowProps}\n >\n {rowSelection && (\n <td className=\"sticky left-0 z-10 bg-base-100\">\n <input\n type={rowSelection.type === 'radio' ? 'radio' : 'checkbox'}\n className={rowSelection.type === 'radio' ? 'radio radio-sm' : 'checkbox checkbox-sm'}\n checked={isSelected}\n onChange={(e) => handleSelectRow(record, index, e.target.checked)}\n {...checkboxProps}\n />\n </td>\n )}\n {columns.map((column, columnIndex) => {\n const fixedStyle = getFixedColumnStyle(columnIndex, false)\n return (\n <td\n key={column.key}\n className={`${getAlignClass(column.align)} ${fixedStyle.className}`}\n style={fixedStyle.style}\n >\n {getCellValue(column, record, index)}\n </td>\n )\n })}\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n\n {isPaginationEnabled && totalPages > 1 && (\n <div className=\"flex justify-end\">\n <div className=\"join\">\n <button\n className=\"join-item btn btn-sm\"\n onClick={() => handlePageChange(currentPage - 1)}\n disabled={currentPage === 1}\n >\n «\n </button>\n {Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => (\n <button\n key={page}\n className={`join-item btn btn-sm ${currentPage === page ? 'btn-active' : ''}`}\n onClick={() => handlePageChange(page)}\n >\n {page}\n </button>\n ))}\n <button\n className=\"join-item btn btn-sm\"\n onClick={() => handlePageChange(currentPage + 1)}\n disabled={currentPage === totalPages}\n >\n »\n </button>\n </div>\n </div>\n )}\n </div>\n )\n}\n"],"names":["FilterDropdown","filters","selectedValues","onChange","isOpen","setIsOpen","useState","handleToggle","value","newValues","v","handleClear","jsxs","jsx","filter","Table","columns","dataSource","rowKey","loading","size","bordered","hoverable","striped","pinRows","pinCols","pagination","rowSelection","className","onRow","currentPage","setCurrentPage","pageSize","sortState","setSortState","defaultSortColumn","col","filterState","setFilterState","initial","selectedKeys","setSelectedKeys","isPaginationEnabled","filteredData","columnKey","filterValues","column","record","a","b","result","aVal","bVal","totalPages","startIndex","endIndex","paginatedData","handlePageChange","page","handleSort","prev","handleFilterChange","values","handleSelectAll","checked","newSelectedKeys","index","getRowKey","selectedRecords","handleSelectRow","key","k","r","i","getCellValue","getAlignClass","align","getFixedColumnStyle","columnIndex","isHeader","classes","offset","style","colWidth","width","lastLeftFixedIndex","tableClasses","hasFixedColumns","wrapperClasses","isAllSelected","fixedStyle","rowProps","isSelected","rowClasses","checkboxProps","e","_"],"mappings":";;AAqDA,SAASA,GAAe;AAAA,EACtB,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AACF,GAIG;AACD,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAe,CAACC,MAAqC;AACzD,UAAMC,IAAYP,EAAe,SAASM,CAAK,IAC3CN,EAAe,OAAO,CAACQ,MAAMA,MAAMF,CAAK,IACxC,CAAC,GAAGN,GAAgBM,CAAK;AAC7B,IAAAL,EAASM,CAAS;AAAA,EACpB,GAEME,IAAc,MAAM;AACxB,IAAAR,EAAS,CAAA,CAAE,GACXE,EAAU,EAAK;AAAA,EACjB;AAEA,SACE,gBAAAO,EAAC,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAU;AAAA,QACV,WAAW,wBAAwBX,EAAe,SAAS,IAAI,iBAAiB,EAAE;AAAA,QAClF,SAAS,MAAMG,EAAU,CAACD,CAAM;AAAA,QAEhC,UAAA,gBAAAS,EAAC,SAAI,WAAU,WAAU,MAAK,QAAO,QAAO,gBAAe,SAAQ,aACjE,4BA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,UAC/C,UAAUA,MAAgBuB;AAAA,UAC3B,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index80.js","sources":["../src/components/Steps.tsx"],"sourcesContent":["import React from 'react'\n\nexport type StepsDirection = 'horizontal' | 'vertical'\n\nexport interface StepItem {\n key?: string\n title: React.ReactNode\n description?: React.ReactNode\n icon?: React.ReactNode\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n disabled?: boolean\n}\n\nexport interface StepsProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {\n /** Step items (compound pattern) */\n children?: React.ReactNode\n /** Step items (data-driven pattern) */\n items?: StepItem[]\n /** Current step index (0-based) */\n current?: number\n /** Layout direction */\n direction?: StepsDirection\n /** @deprecated Use direction=\"vertical\" instead */\n vertical?: boolean\n /** Callback when step is clicked */\n onChange?: (current: number) => void\n}\n\nexport interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'color' | 'title'> {\n /** Step title/label */\n children?: React.ReactNode\n /** Step title (alternative to children) */\n title?: React.ReactNode\n /** Step description */\n description?: React.ReactNode\n /** Step icon */\n icon?: React.ReactNode\n /** Step color */\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n /** Custom content for step indicator */\n dataContent?: string\n /** Whether step is disabled */\n disabled?: boolean\n /** Internal: step index */\n _index?: number\n /** Internal: whether step is clickable */\n _clickable?: boolean\n /** Internal: click handler */\n _onClick?: (index: number) => void\n}\n\nconst colorClasses: Record<string, string> = {\n neutral: 'step-neutral',\n primary: 'step-primary',\n secondary: 'step-secondary',\n accent: 'step-accent',\n info: 'step-info',\n success: 'step-success',\n warning: 'step-warning',\n error: 'step-error',\n}\n\nfunction StepsRoot({\n children,\n items,\n current,\n direction,\n vertical = false,\n onChange,\n className = '',\n ...rest\n}: StepsProps) {\n const isVertical = direction === 'vertical' || vertical\n\n const classes = ['steps', isVertical && 'steps-vertical', className]\n .filter(Boolean)\n .join(' ')\n\n // Render data-driven items if provided\n if (items && items.length > 0) {\n return (\n <ul className={classes} {...rest}>\n {items.map((item, index) => {\n const isCompleted = current !== undefined && index < current\n const isCurrent = current !== undefined && index === current\n const stepColor = item.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return (\n <Step\n key={item.key ?? index}\n color={stepColor}\n icon={item.icon}\n title={item.title}\n description={item.description}\n disabled={item.disabled}\n _index={index}\n _clickable={!!onChange && !item.disabled}\n _onClick={onChange}\n aria-current={isCurrent ? 'step' : undefined}\n />\n )\n })}\n </ul>\n )\n }\n\n // For compound pattern, inject props into children if current is provided\n const processedChildren =\n current !== undefined\n ? React.Children.map(children, (child, index) => {\n if (React.isValidElement<StepProps>(child)) {\n const isCompleted = index < current\n const isCurrent = index === current\n const childColor = child.props.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return React.cloneElement(child, {\n color: childColor,\n _index: index,\n _clickable: !!onChange && !child.props.disabled,\n _onClick: onChange,\n 'aria-current': isCurrent ? 'step' : undefined,\n } as Partial<StepProps>)\n }\n return child\n })\n : children\n\n return (\n <ul className={classes} {...rest}>\n {processedChildren}\n </ul>\n )\n}\n\nfunction Step({\n children,\n title,\n description,\n icon,\n color,\n dataContent,\n disabled = false,\n className = '',\n _index,\n _clickable,\n _onClick,\n ...rest\n}: StepProps) {\n const classes = ['step', color && colorClasses[color], disabled && 'step-disabled', className]\n .filter(Boolean)\n .join(' ')\n\n const handleClick = () => {\n if (_clickable && _onClick && _index !== undefined && !disabled) {\n _onClick(_index)\n }\n }\n\n const displayContent = title ?? children\n\n return (\n <li\n className={classes}\n data-content={dataContent}\n onClick={handleClick}\n style={_clickable && !disabled ? { cursor: 'pointer' } : undefined}\n {...rest}\n >\n {icon && <span className=\"step-icon\">{icon}</span>}\n {displayContent}\n {description && <span className=\"text-xs opacity-70 block\">{description}</span>}\n </li>\n )\n}\n\nexport const Steps = Object.assign(StepsRoot, {\n Step,\n})\n"],"names":["colorClasses","StepsRoot","children","items","current","direction","vertical","onChange","className","rest","classes","jsx","item","index","isCompleted","isCurrent","stepColor","Step","processedChildren","React","child","childColor","title","description","icon","color","dataContent","disabled","_index","_clickable","_onClick","jsxs","Steps"],"mappings":";;AAmDA,MAAMA,IAAuC;AAAA,EAC3C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;AAEA,SAASC,EAAU;AAAA,EACjB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAe;AAGb,QAAMC,IAAU,CAAC,UAFEL,MAAc,cAAcC,MAEP,kBAAkBE,CAAS,EAChE,OAAO,OAAO,EACd,KAAK,GAAG;AAGX,MAAIL,KAASA,EAAM,SAAS;AAC1B,WACE,gBAAAQ,EAAC,MAAA,EAAG,WAAWD,GAAU,GAAGD,GACzB,UAAAN,EAAM,IAAI,CAACS,GAAMC,MAAU;AAC1B,YAAMC,IAAcV,MAAY,UAAaS,IAAQT,GAC/CW,IAAYX,MAAY,UAAaS,MAAUT,GAC/CY,IAAYJ,EAAK,UAAWE,KAAeC,IAAa,YAAY;AAE1E,aACE,gBAAAJ;AAAA,QAACM;AAAA,QAAA;AAAA,UAEC,OAAOD;AAAA,UACP,MAAMJ,EAAK;AAAA,UACX,OAAOA,EAAK;AAAA,UACZ,aAAaA,EAAK;AAAA,UAClB,UAAUA,EAAK;AAAA,UACf,QAAQC;AAAA,UACR,YAAY,CAAC,CAACN,KAAY,CAACK,EAAK;AAAA,UAChC,UAAUL;AAAA,UACV,gBAAcQ,IAAY,SAAS;AAAA,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