@turinhub/atomix-common-ui 0.1.0 → 0.1.1
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/README.md +5 -8
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/components/DeleteConfirmDialog.d.ts +2 -1
- package/dist/components/DeleteConfirmDialog.d.ts.map +1 -1
- package/dist/components/TableHeader.d.ts.map +1 -1
- package/dist/components/TablePagination.d.ts.map +1 -1
- package/dist/index.c.js +4 -4
- package/dist/index.c.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +177 -256
- package/dist/index.js.map +1 -1
- package/dist/types/component-types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { clsx as ae } from "clsx";
|
|
2
2
|
import { twMerge as oe } from "tailwind-merge";
|
|
3
3
|
import ce, { useState as ie, useEffect as ue } from "react";
|
|
4
|
-
|
|
4
|
+
import { MoreVertical as de, Plus as fe, Search as me, ChevronLeft as xe, ChevronRight as he } from "lucide-react";
|
|
5
|
+
function _e(...a) {
|
|
5
6
|
return oe(ae(a));
|
|
6
7
|
}
|
|
7
|
-
var Z = { exports: {} },
|
|
8
|
+
var Z = { exports: {} }, B = {};
|
|
8
9
|
/**
|
|
9
10
|
* @license React
|
|
10
11
|
* react-jsx-runtime.production.js
|
|
@@ -15,11 +16,11 @@ var Z = { exports: {} }, F = {};
|
|
|
15
16
|
* LICENSE file in the root directory of this source tree.
|
|
16
17
|
*/
|
|
17
18
|
var re;
|
|
18
|
-
function
|
|
19
|
-
if (re) return
|
|
19
|
+
function pe() {
|
|
20
|
+
if (re) return B;
|
|
20
21
|
re = 1;
|
|
21
22
|
var a = Symbol.for("react.transitional.element"), h = Symbol.for("react.fragment");
|
|
22
|
-
function d(
|
|
23
|
+
function d(p, c, f) {
|
|
23
24
|
var x = null;
|
|
24
25
|
if (f !== void 0 && (x = "" + f), c.key !== void 0 && (x = "" + c.key), "key" in c) {
|
|
25
26
|
f = {};
|
|
@@ -28,15 +29,15 @@ function de() {
|
|
|
28
29
|
} else f = c;
|
|
29
30
|
return c = f.ref, {
|
|
30
31
|
$$typeof: a,
|
|
31
|
-
type:
|
|
32
|
+
type: p,
|
|
32
33
|
key: x,
|
|
33
34
|
ref: c !== void 0 ? c : null,
|
|
34
35
|
props: f
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
return
|
|
38
|
+
return B.Fragment = h, B.jsx = d, B.jsxs = d, B;
|
|
38
39
|
}
|
|
39
|
-
var
|
|
40
|
+
var L = {};
|
|
40
41
|
/**
|
|
41
42
|
* @license React
|
|
42
43
|
* react-jsx-runtime.development.js
|
|
@@ -47,7 +48,7 @@ var W = {};
|
|
|
47
48
|
* LICENSE file in the root directory of this source tree.
|
|
48
49
|
*/
|
|
49
50
|
var te;
|
|
50
|
-
function
|
|
51
|
+
function je() {
|
|
51
52
|
return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
52
53
|
function a(e) {
|
|
53
54
|
if (e == null) return null;
|
|
@@ -55,15 +56,15 @@ function fe() {
|
|
|
55
56
|
return e.$$typeof === K ? null : e.displayName || e.name || null;
|
|
56
57
|
if (typeof e == "string") return e;
|
|
57
58
|
switch (e) {
|
|
58
|
-
case
|
|
59
|
+
case y:
|
|
59
60
|
return "Fragment";
|
|
60
61
|
case D:
|
|
61
62
|
return "Profiler";
|
|
62
63
|
case w:
|
|
63
64
|
return "StrictMode";
|
|
64
|
-
case
|
|
65
|
+
case _:
|
|
65
66
|
return "Suspense";
|
|
66
|
-
case
|
|
67
|
+
case g:
|
|
67
68
|
return "SuspenseList";
|
|
68
69
|
case Q:
|
|
69
70
|
return "Activity";
|
|
@@ -76,14 +77,14 @@ function fe() {
|
|
|
76
77
|
return "Portal";
|
|
77
78
|
case R:
|
|
78
79
|
return e.displayName || "Context";
|
|
79
|
-
case
|
|
80
|
+
case S:
|
|
80
81
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
81
82
|
case P:
|
|
82
83
|
var t = e.render;
|
|
83
84
|
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
84
|
-
case
|
|
85
|
+
case V:
|
|
85
86
|
return t = e.displayName || null, t !== null ? t : a(e.type) || "Memo";
|
|
86
|
-
case
|
|
87
|
+
case I:
|
|
87
88
|
t = e._payload, e = e._init;
|
|
88
89
|
try {
|
|
89
90
|
return a(e(t));
|
|
@@ -104,17 +105,17 @@ function fe() {
|
|
|
104
105
|
}
|
|
105
106
|
if (t) {
|
|
106
107
|
t = console;
|
|
107
|
-
var
|
|
108
|
-
return
|
|
108
|
+
var n = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
109
|
+
return n.call(
|
|
109
110
|
t,
|
|
110
111
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
111
112
|
i
|
|
112
113
|
), h(e);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
-
if (e ===
|
|
117
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
116
|
+
function p(e) {
|
|
117
|
+
if (e === y) return "<>";
|
|
118
|
+
if (typeof e == "object" && e !== null && e.$$typeof === I)
|
|
118
119
|
return "<...>";
|
|
119
120
|
try {
|
|
120
121
|
var t = a(e);
|
|
@@ -131,41 +132,41 @@ function fe() {
|
|
|
131
132
|
return Error("react-stack-top-frame");
|
|
132
133
|
}
|
|
133
134
|
function x(e) {
|
|
134
|
-
if (
|
|
135
|
+
if (W.call(e, "key")) {
|
|
135
136
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
136
137
|
if (t && t.isReactWarning) return !1;
|
|
137
138
|
}
|
|
138
139
|
return e.key !== void 0;
|
|
139
140
|
}
|
|
140
141
|
function o(e, t) {
|
|
141
|
-
function
|
|
142
|
+
function n() {
|
|
142
143
|
q || (q = !0, console.error(
|
|
143
144
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
144
145
|
t
|
|
145
146
|
));
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
-
get:
|
|
148
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
149
|
+
get: n,
|
|
149
150
|
configurable: !0
|
|
150
151
|
});
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
+
function T() {
|
|
153
154
|
var e = a(this.type);
|
|
154
155
|
return J[e] || (J[e] = !0, console.error(
|
|
155
156
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
156
157
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
157
158
|
}
|
|
158
|
-
function m(e, t,
|
|
159
|
-
var u =
|
|
159
|
+
function m(e, t, n, i, $, M) {
|
|
160
|
+
var u = n.ref;
|
|
160
161
|
return e = {
|
|
161
162
|
$$typeof: E,
|
|
162
163
|
type: e,
|
|
163
164
|
key: t,
|
|
164
|
-
props:
|
|
165
|
+
props: n,
|
|
165
166
|
_owner: i
|
|
166
167
|
}, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
|
|
167
168
|
enumerable: !1,
|
|
168
|
-
get:
|
|
169
|
+
get: T
|
|
169
170
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
170
171
|
configurable: !1,
|
|
171
172
|
enumerable: !1,
|
|
@@ -180,7 +181,7 @@ function fe() {
|
|
|
180
181
|
configurable: !1,
|
|
181
182
|
enumerable: !1,
|
|
182
183
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
+
value: $
|
|
184
185
|
}), Object.defineProperty(e, "_debugTask", {
|
|
185
186
|
configurable: !1,
|
|
186
187
|
enumerable: !1,
|
|
@@ -188,23 +189,23 @@ function fe() {
|
|
|
188
189
|
value: M
|
|
189
190
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
190
191
|
}
|
|
191
|
-
function s(e, t,
|
|
192
|
+
function s(e, t, n, i, $, M) {
|
|
192
193
|
var u = t.children;
|
|
193
194
|
if (u !== void 0)
|
|
194
195
|
if (i)
|
|
195
196
|
if (H(u)) {
|
|
196
197
|
for (i = 0; i < u.length; i++)
|
|
197
|
-
|
|
198
|
+
k(u[i]);
|
|
198
199
|
Object.freeze && Object.freeze(u);
|
|
199
200
|
} else
|
|
200
201
|
console.error(
|
|
201
202
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
202
203
|
);
|
|
203
|
-
else
|
|
204
|
-
if (
|
|
204
|
+
else k(u);
|
|
205
|
+
if (W.call(t, "key")) {
|
|
205
206
|
u = a(e);
|
|
206
|
-
var C = Object.keys(t).filter(function(
|
|
207
|
-
return
|
|
207
|
+
var C = Object.keys(t).filter(function(j) {
|
|
208
|
+
return j !== "key";
|
|
208
209
|
});
|
|
209
210
|
i = 0 < C.length ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}", G[u + i] || (C = 0 < C.length ? "{" + C.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
210
211
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -219,30 +220,30 @@ React keys must be passed directly to JSX without using spread:
|
|
|
219
220
|
u
|
|
220
221
|
), G[u + i] = !0);
|
|
221
222
|
}
|
|
222
|
-
if (u = null,
|
|
223
|
-
|
|
224
|
-
for (var
|
|
225
|
-
|
|
226
|
-
} else
|
|
223
|
+
if (u = null, n !== void 0 && (d(n), u = "" + n), x(t) && (d(t.key), u = "" + t.key), "key" in t) {
|
|
224
|
+
n = {};
|
|
225
|
+
for (var l in t)
|
|
226
|
+
l !== "key" && (n[l] = t[l]);
|
|
227
|
+
} else n = t;
|
|
227
228
|
return u && o(
|
|
228
|
-
|
|
229
|
+
n,
|
|
229
230
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
230
231
|
), m(
|
|
231
232
|
e,
|
|
232
233
|
u,
|
|
233
|
-
|
|
234
|
+
n,
|
|
234
235
|
c(),
|
|
235
|
-
|
|
236
|
+
$,
|
|
236
237
|
M
|
|
237
238
|
);
|
|
238
239
|
}
|
|
239
|
-
function
|
|
240
|
-
N(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof ===
|
|
240
|
+
function k(e) {
|
|
241
|
+
N(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === I && (e._payload.status === "fulfilled" ? N(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
241
242
|
}
|
|
242
243
|
function N(e) {
|
|
243
244
|
return typeof e == "object" && e !== null && e.$$typeof === E;
|
|
244
245
|
}
|
|
245
|
-
var b = ce, E = Symbol.for("react.transitional.element"), O = Symbol.for("react.portal"),
|
|
246
|
+
var b = ce, E = Symbol.for("react.transitional.element"), O = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), R = Symbol.for("react.context"), P = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), V = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), z = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, H = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
246
247
|
return null;
|
|
247
248
|
};
|
|
248
249
|
b = {
|
|
@@ -250,57 +251,57 @@ React keys must be passed directly to JSX without using spread:
|
|
|
250
251
|
return e();
|
|
251
252
|
}
|
|
252
253
|
};
|
|
253
|
-
var q, J = {},
|
|
254
|
+
var q, J = {}, U = b.react_stack_bottom_frame.bind(
|
|
254
255
|
b,
|
|
255
256
|
f
|
|
256
|
-
)(), A =
|
|
257
|
-
|
|
257
|
+
)(), A = F(p(f)), G = {};
|
|
258
|
+
L.Fragment = y, L.jsx = function(e, t, n) {
|
|
258
259
|
var i = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
259
260
|
return s(
|
|
260
261
|
e,
|
|
261
262
|
t,
|
|
262
|
-
|
|
263
|
+
n,
|
|
263
264
|
!1,
|
|
264
|
-
i ? Error("react-stack-top-frame") :
|
|
265
|
-
i ?
|
|
265
|
+
i ? Error("react-stack-top-frame") : U,
|
|
266
|
+
i ? F(p(e)) : A
|
|
266
267
|
);
|
|
267
|
-
},
|
|
268
|
+
}, L.jsxs = function(e, t, n) {
|
|
268
269
|
var i = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
269
270
|
return s(
|
|
270
271
|
e,
|
|
271
272
|
t,
|
|
272
|
-
|
|
273
|
+
n,
|
|
273
274
|
!0,
|
|
274
|
-
i ? Error("react-stack-top-frame") :
|
|
275
|
-
i ?
|
|
275
|
+
i ? Error("react-stack-top-frame") : U,
|
|
276
|
+
i ? F(p(e)) : A
|
|
276
277
|
);
|
|
277
278
|
};
|
|
278
|
-
})()),
|
|
279
|
+
})()), L;
|
|
279
280
|
}
|
|
280
281
|
var se;
|
|
281
|
-
function
|
|
282
|
-
return se || (se = 1, process.env.NODE_ENV === "production" ? Z.exports =
|
|
282
|
+
function ve() {
|
|
283
|
+
return se || (se = 1, process.env.NODE_ENV === "production" ? Z.exports = pe() : Z.exports = je()), Z.exports;
|
|
283
284
|
}
|
|
284
|
-
var r =
|
|
285
|
-
function
|
|
285
|
+
var r = ve();
|
|
286
|
+
function Te({
|
|
286
287
|
data: a,
|
|
287
288
|
loading: h = !1,
|
|
288
289
|
columns: d,
|
|
289
|
-
rowKey:
|
|
290
|
+
rowKey: p,
|
|
290
291
|
emptyText: c = "暂无数据",
|
|
291
292
|
searchActiveEmptyText: f = "未找到匹配的记录",
|
|
292
293
|
header: x,
|
|
293
294
|
pagination: o,
|
|
294
|
-
rowClassName:
|
|
295
|
+
rowClassName: T,
|
|
295
296
|
onRow: m,
|
|
296
297
|
actions: s,
|
|
297
|
-
components:
|
|
298
|
+
components: k,
|
|
298
299
|
renderCard: N,
|
|
299
300
|
renderTable: b,
|
|
300
301
|
renderActions: E
|
|
301
302
|
}) {
|
|
302
303
|
var u, C;
|
|
303
|
-
if (!
|
|
304
|
+
if (!k)
|
|
304
305
|
return /* @__PURE__ */ r.jsxs("div", { className: "p-4 text-center text-destructive", children: [
|
|
305
306
|
"错误:请通过 components prop 注入 UI 组件",
|
|
306
307
|
/* @__PURE__ */ r.jsx("br", {}),
|
|
@@ -308,56 +309,43 @@ function ve({
|
|
|
308
309
|
] });
|
|
309
310
|
const {
|
|
310
311
|
Card: O,
|
|
311
|
-
CardContent:
|
|
312
|
+
CardContent: y,
|
|
312
313
|
CardFooter: w,
|
|
313
314
|
Table: D,
|
|
314
|
-
TableBody:
|
|
315
|
+
TableBody: S,
|
|
315
316
|
TableCell: R,
|
|
316
317
|
TableHead: P,
|
|
317
|
-
TableHeader:
|
|
318
|
-
TableRow:
|
|
319
|
-
Button:
|
|
320
|
-
DropdownMenu:
|
|
318
|
+
TableHeader: _,
|
|
319
|
+
TableRow: g,
|
|
320
|
+
Button: V,
|
|
321
|
+
DropdownMenu: I,
|
|
321
322
|
DropdownMenuTrigger: Q,
|
|
322
323
|
DropdownMenuContent: K,
|
|
323
324
|
DropdownMenuItem: z,
|
|
324
|
-
DropdownMenuSeparator:
|
|
325
|
+
DropdownMenuSeparator: W,
|
|
325
326
|
Skeleton: H,
|
|
326
|
-
TableHeaderComponent:
|
|
327
|
+
TableHeaderComponent: F,
|
|
327
328
|
TablePaginationComponent: q
|
|
328
|
-
} =
|
|
329
|
-
if (typeof
|
|
330
|
-
return
|
|
331
|
-
const v =
|
|
332
|
-
return v != null ? String(v) : `row-${
|
|
333
|
-
},
|
|
329
|
+
} = k, J = (l, j) => {
|
|
330
|
+
if (typeof p == "function")
|
|
331
|
+
return p(l);
|
|
332
|
+
const v = l[p];
|
|
333
|
+
return v != null ? String(v) : `row-${j}`;
|
|
334
|
+
}, U = !!(x != null && x.searchValue && x.searchValue.trim().length > 0), A = !!(s != null && s.render || (u = s == null ? void 0 : s.items) != null && u.length), G = (s == null ? void 0 : s.mode) ?? ((C = s == null ? void 0 : s.items) != null && C.length ? "collapsed" : "expanded"), e = (l) => l.separator === !0, t = (l, j) => !s || !A ? null : G === "collapsed" && s.items && s.items.length > 0 ? /* @__PURE__ */ r.jsxs(I, { children: [
|
|
334
335
|
/* @__PURE__ */ r.jsx(Q, { asChild: !0, children: /* @__PURE__ */ r.jsx(
|
|
335
|
-
|
|
336
|
+
V,
|
|
336
337
|
{
|
|
337
338
|
variant: "ghost",
|
|
338
339
|
className: "h-8 w-8 p-0",
|
|
339
340
|
"aria-label": "打开行操作菜单",
|
|
340
|
-
children: /* @__PURE__ */ r.
|
|
341
|
-
"svg",
|
|
342
|
-
{
|
|
343
|
-
className: "h-4 w-4",
|
|
344
|
-
fill: "none",
|
|
345
|
-
stroke: "currentColor",
|
|
346
|
-
viewBox: "0 0 24 24",
|
|
347
|
-
children: [
|
|
348
|
-
/* @__PURE__ */ r.jsx("circle", { cx: "12", cy: "12", r: "1" }),
|
|
349
|
-
/* @__PURE__ */ r.jsx("circle", { cx: "12", cy: "5", r: "1" }),
|
|
350
|
-
/* @__PURE__ */ r.jsx("circle", { cx: "12", cy: "19", r: "1" })
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
)
|
|
341
|
+
children: /* @__PURE__ */ r.jsx(de, { className: "h-4 w-4" })
|
|
354
342
|
}
|
|
355
343
|
) }),
|
|
356
344
|
/* @__PURE__ */ r.jsx(K, { align: "end", children: s.items.map(
|
|
357
|
-
(v, X) => e(v) ? /* @__PURE__ */ r.jsx(
|
|
345
|
+
(v, X) => e(v) ? /* @__PURE__ */ r.jsx(W, {}, `separator-${X}`) : /* @__PURE__ */ r.jsxs(
|
|
358
346
|
z,
|
|
359
347
|
{
|
|
360
|
-
onClick: () => v.onClick(
|
|
348
|
+
onClick: () => v.onClick(l, j),
|
|
361
349
|
className: v.className,
|
|
362
350
|
children: [
|
|
363
351
|
v.icon && /* @__PURE__ */ r.jsx("span", { className: "mr-2 h-4 w-4", children: v.icon }),
|
|
@@ -367,18 +355,18 @@ function ve({
|
|
|
367
355
|
`action-${X}`
|
|
368
356
|
)
|
|
369
357
|
) })
|
|
370
|
-
] }) : s.render ? s.render(
|
|
371
|
-
d.map((
|
|
358
|
+
] }) : s.render ? s.render(l, j) : null, n = () => /* @__PURE__ */ r.jsx(_, { children: /* @__PURE__ */ r.jsxs(g, { className: "bg-muted/50 hover:bg-muted/50", children: [
|
|
359
|
+
d.map((l) => /* @__PURE__ */ r.jsx(
|
|
372
360
|
P,
|
|
373
361
|
{
|
|
374
|
-
className: `font-semibold text-foreground ${
|
|
375
|
-
style: { width:
|
|
376
|
-
children:
|
|
362
|
+
className: `font-semibold text-foreground ${l.align === "center" ? "text-center" : l.align === "right" ? "text-right" : "text-left"}`,
|
|
363
|
+
style: { width: l.width },
|
|
364
|
+
children: l.title
|
|
377
365
|
},
|
|
378
|
-
String(
|
|
366
|
+
String(l.key)
|
|
379
367
|
)),
|
|
380
368
|
A && /* @__PURE__ */ r.jsx(P, { className: "text-right font-semibold text-foreground", children: (s == null ? void 0 : s.title) || "操作" })
|
|
381
|
-
] }) }), i = () => h ? /* @__PURE__ */ r.jsx(
|
|
369
|
+
] }) }), i = () => h ? /* @__PURE__ */ r.jsx(S, { children: Array.from({ length: 5 }).map((l, j) => /* @__PURE__ */ r.jsxs(g, { children: [
|
|
382
370
|
d.map((v) => /* @__PURE__ */ r.jsx(
|
|
383
371
|
R,
|
|
384
372
|
{
|
|
@@ -389,40 +377,40 @@ function ve({
|
|
|
389
377
|
String(v.key)
|
|
390
378
|
)),
|
|
391
379
|
A && /* @__PURE__ */ r.jsx(R, { children: /* @__PURE__ */ r.jsx(H, { className: "ml-auto h-4 w-8" }) })
|
|
392
|
-
] },
|
|
380
|
+
] }, j)) }) : a.length === 0 ? /* @__PURE__ */ r.jsx(S, { children: /* @__PURE__ */ r.jsx(g, { children: /* @__PURE__ */ r.jsx(
|
|
393
381
|
R,
|
|
394
382
|
{
|
|
395
383
|
colSpan: d.length + (A ? 1 : 0),
|
|
396
384
|
className: "py-8 text-center text-muted-foreground",
|
|
397
|
-
children:
|
|
385
|
+
children: U ? f : c
|
|
398
386
|
}
|
|
399
|
-
) }) }) : /* @__PURE__ */ r.jsx(
|
|
400
|
-
const v = J(
|
|
387
|
+
) }) }) : /* @__PURE__ */ r.jsx(S, { children: a.map((l, j) => {
|
|
388
|
+
const v = J(l, j), X = m == null ? void 0 : m(l, j), le = T == null ? void 0 : T(l, j);
|
|
401
389
|
return /* @__PURE__ */ r.jsxs(
|
|
402
|
-
|
|
390
|
+
g,
|
|
403
391
|
{
|
|
404
|
-
className: `${
|
|
392
|
+
className: `${le || ""} hover:bg-muted/50`,
|
|
405
393
|
...X,
|
|
406
394
|
children: [
|
|
407
|
-
d.map((
|
|
408
|
-
const ee =
|
|
395
|
+
d.map((Y) => {
|
|
396
|
+
const ee = l[Y.key], ne = Y.render ? Y.render(ee, l, j) : ee;
|
|
409
397
|
return /* @__PURE__ */ r.jsx(
|
|
410
398
|
R,
|
|
411
399
|
{
|
|
412
|
-
className:
|
|
413
|
-
children:
|
|
400
|
+
className: Y.align === "center" ? "text-center" : Y.align === "right" ? "text-right" : "",
|
|
401
|
+
children: ne
|
|
414
402
|
},
|
|
415
|
-
String(
|
|
403
|
+
String(Y.key)
|
|
416
404
|
);
|
|
417
405
|
}),
|
|
418
|
-
A && /* @__PURE__ */ r.jsx(R, { className: "text-right", children: E ? E(
|
|
406
|
+
A && /* @__PURE__ */ r.jsx(R, { className: "text-right", children: E ? E(l, j) : t(l, j) })
|
|
419
407
|
]
|
|
420
408
|
},
|
|
421
409
|
v
|
|
422
410
|
);
|
|
423
|
-
}) }),
|
|
424
|
-
x && /* @__PURE__ */ r.jsx("div", { className: "p-6 pb-0", children: /* @__PURE__ */ r.jsx(
|
|
425
|
-
/* @__PURE__ */ r.jsx(
|
|
411
|
+
}) }), $ = (l) => /* @__PURE__ */ r.jsxs(O, { children: [
|
|
412
|
+
x && /* @__PURE__ */ r.jsx("div", { className: "p-6 pb-0", children: /* @__PURE__ */ r.jsx(F, { ...x }) }),
|
|
413
|
+
/* @__PURE__ */ r.jsx(y, { className: "p-0", children: l }),
|
|
426
414
|
(o == null ? void 0 : o.show) !== !1 && o && /* @__PURE__ */ r.jsx(w, { className: "border-t py-4", children: /* @__PURE__ */ r.jsx(
|
|
427
415
|
q,
|
|
428
416
|
{
|
|
@@ -434,71 +422,72 @@ function ve({
|
|
|
434
422
|
pageSizeOptions: o.pageSizeOptions,
|
|
435
423
|
showPageSizeSelector: o.showPageSizeSelector,
|
|
436
424
|
showTotal: o.showTotal,
|
|
437
|
-
searchActive:
|
|
425
|
+
searchActive: U
|
|
438
426
|
}
|
|
439
427
|
) })
|
|
440
|
-
] }), M = (
|
|
441
|
-
|
|
442
|
-
|
|
428
|
+
] }), M = (l, j) => /* @__PURE__ */ r.jsxs(D, { children: [
|
|
429
|
+
l,
|
|
430
|
+
j
|
|
443
431
|
] });
|
|
444
432
|
return N ? N(
|
|
445
|
-
b ? b(
|
|
446
|
-
) :
|
|
447
|
-
b ? b(
|
|
433
|
+
b ? b(n(), i()) : M(n(), i())
|
|
434
|
+
) : $(
|
|
435
|
+
b ? b(n(), i()) : M(n(), i())
|
|
448
436
|
);
|
|
449
437
|
}
|
|
450
|
-
function
|
|
438
|
+
function Re({
|
|
451
439
|
open: a,
|
|
452
440
|
onOpenChange: h,
|
|
453
441
|
title: d,
|
|
454
|
-
description:
|
|
442
|
+
description: p,
|
|
455
443
|
onConfirm: c,
|
|
456
444
|
loading: f = !1,
|
|
457
445
|
confirmText: x = "确认删除",
|
|
458
446
|
cancelText: o = "取消",
|
|
459
|
-
confirmButtonVariant:
|
|
447
|
+
confirmButtonVariant: T = "destructive",
|
|
460
448
|
verification: m,
|
|
461
|
-
components: s
|
|
449
|
+
components: s,
|
|
450
|
+
loadingIcon: k
|
|
462
451
|
}) {
|
|
463
|
-
const [
|
|
452
|
+
const [N, b] = ie("");
|
|
464
453
|
if (ue(() => {
|
|
465
|
-
a &&
|
|
454
|
+
a && b("");
|
|
466
455
|
}, [a, m == null ? void 0 : m.targetValue]), !s)
|
|
467
456
|
return /* @__PURE__ */ r.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
468
457
|
const {
|
|
469
|
-
Dialog:
|
|
470
|
-
DialogContent:
|
|
471
|
-
DialogHeader:
|
|
472
|
-
DialogFooter:
|
|
473
|
-
DialogTitle:
|
|
474
|
-
DialogDescription:
|
|
475
|
-
Button:
|
|
476
|
-
Input:
|
|
477
|
-
Label:
|
|
478
|
-
} = s, g = m ?
|
|
458
|
+
Dialog: E,
|
|
459
|
+
DialogContent: O,
|
|
460
|
+
DialogHeader: y,
|
|
461
|
+
DialogFooter: w,
|
|
462
|
+
DialogTitle: D,
|
|
463
|
+
DialogDescription: S,
|
|
464
|
+
Button: R,
|
|
465
|
+
Input: P,
|
|
466
|
+
Label: _
|
|
467
|
+
} = s, g = m ? N !== m.targetValue : !1, V = () => {
|
|
479
468
|
g || c();
|
|
480
469
|
};
|
|
481
|
-
return /* @__PURE__ */ r.jsx(
|
|
482
|
-
/* @__PURE__ */ r.jsxs(
|
|
483
|
-
/* @__PURE__ */ r.jsx(
|
|
484
|
-
/* @__PURE__ */ r.jsx(
|
|
470
|
+
return /* @__PURE__ */ r.jsx(E, { open: a, onOpenChange: h, children: /* @__PURE__ */ r.jsxs(O, { children: [
|
|
471
|
+
/* @__PURE__ */ r.jsxs(y, { children: [
|
|
472
|
+
/* @__PURE__ */ r.jsx(D, { asChild: !0, children: /* @__PURE__ */ r.jsx("div", { className: "flex items-center gap-2", children: d }) }),
|
|
473
|
+
/* @__PURE__ */ r.jsx(S, { asChild: !0, children: /* @__PURE__ */ r.jsx("div", { children: p }) })
|
|
485
474
|
] }),
|
|
486
475
|
m && /* @__PURE__ */ r.jsx("div", { className: "space-y-4 py-2", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-2", children: [
|
|
487
|
-
/* @__PURE__ */ r.jsx(
|
|
476
|
+
/* @__PURE__ */ r.jsx(_, { htmlFor: "confirm-input", children: m.label || "请输入以确认" }),
|
|
488
477
|
/* @__PURE__ */ r.jsx(
|
|
489
|
-
|
|
478
|
+
P,
|
|
490
479
|
{
|
|
491
480
|
id: "confirm-input",
|
|
492
|
-
value:
|
|
493
|
-
onChange: (
|
|
481
|
+
value: N,
|
|
482
|
+
onChange: (I) => b(I.target.value),
|
|
494
483
|
placeholder: m.placeholder,
|
|
495
484
|
disabled: f
|
|
496
485
|
}
|
|
497
486
|
)
|
|
498
487
|
] }) }),
|
|
499
|
-
/* @__PURE__ */ r.jsxs(
|
|
488
|
+
/* @__PURE__ */ r.jsxs(w, { children: [
|
|
500
489
|
/* @__PURE__ */ r.jsx(
|
|
501
|
-
|
|
490
|
+
R,
|
|
502
491
|
{
|
|
503
492
|
variant: "outline",
|
|
504
493
|
onClick: () => h(!1),
|
|
@@ -507,16 +496,16 @@ function be({
|
|
|
507
496
|
}
|
|
508
497
|
),
|
|
509
498
|
/* @__PURE__ */ r.jsxs(
|
|
510
|
-
|
|
499
|
+
R,
|
|
511
500
|
{
|
|
512
|
-
variant:
|
|
513
|
-
onClick:
|
|
501
|
+
variant: T,
|
|
502
|
+
onClick: V,
|
|
514
503
|
disabled: g || f,
|
|
515
504
|
children: [
|
|
516
|
-
f && /* @__PURE__ */ r.jsxs(
|
|
505
|
+
f && /* @__PURE__ */ r.jsx("span", { className: "mr-2", children: k || /* @__PURE__ */ r.jsxs(
|
|
517
506
|
"svg",
|
|
518
507
|
{
|
|
519
|
-
className: "
|
|
508
|
+
className: "h-4 w-4 animate-spin",
|
|
520
509
|
fill: "none",
|
|
521
510
|
viewBox: "0 0 24 24",
|
|
522
511
|
children: [
|
|
@@ -541,7 +530,7 @@ function be({
|
|
|
541
530
|
)
|
|
542
531
|
]
|
|
543
532
|
}
|
|
544
|
-
),
|
|
533
|
+
) }),
|
|
545
534
|
x
|
|
546
535
|
]
|
|
547
536
|
}
|
|
@@ -549,22 +538,22 @@ function be({
|
|
|
549
538
|
] })
|
|
550
539
|
] }) });
|
|
551
540
|
}
|
|
552
|
-
function
|
|
541
|
+
function ke({
|
|
553
542
|
title: a,
|
|
554
543
|
searchPlaceholder: h = "搜索...",
|
|
555
544
|
searchValue: d = "",
|
|
556
|
-
onSearchChange:
|
|
545
|
+
onSearchChange: p,
|
|
557
546
|
onSearch: c,
|
|
558
547
|
showSearch: f = !0,
|
|
559
548
|
action: x,
|
|
560
549
|
actionLabel: o,
|
|
561
|
-
onActionClick:
|
|
550
|
+
onActionClick: T,
|
|
562
551
|
loading: m = !1,
|
|
563
552
|
components: s
|
|
564
553
|
}) {
|
|
565
554
|
if (!s)
|
|
566
555
|
return /* @__PURE__ */ r.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
567
|
-
const { Input:
|
|
556
|
+
const { Input: k, Button: N } = s, b = (E) => {
|
|
568
557
|
E.key === "Enter" && c && c();
|
|
569
558
|
};
|
|
570
559
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-4 p-1", children: [
|
|
@@ -572,55 +561,21 @@ function ge({
|
|
|
572
561
|
/* @__PURE__ */ r.jsx("div", { className: "text-lg font-semibold leading-none tracking-tight", children: a }),
|
|
573
562
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
574
563
|
x && /* @__PURE__ */ r.jsx("div", { className: "flex items-center gap-2", children: x }),
|
|
575
|
-
!x && o &&
|
|
576
|
-
/* @__PURE__ */ r.jsx(
|
|
577
|
-
"svg",
|
|
578
|
-
{
|
|
579
|
-
className: "mr-2 h-4 w-4",
|
|
580
|
-
fill: "none",
|
|
581
|
-
stroke: "currentColor",
|
|
582
|
-
viewBox: "0 0 24 24",
|
|
583
|
-
children: /* @__PURE__ */ r.jsx(
|
|
584
|
-
"path",
|
|
585
|
-
{
|
|
586
|
-
strokeLinecap: "round",
|
|
587
|
-
strokeLinejoin: "round",
|
|
588
|
-
strokeWidth: 2,
|
|
589
|
-
d: "M12 4v16m8-8H4"
|
|
590
|
-
}
|
|
591
|
-
)
|
|
592
|
-
}
|
|
593
|
-
),
|
|
564
|
+
!x && o && T && /* @__PURE__ */ r.jsxs(N, { onClick: T, disabled: m, size: "sm", children: [
|
|
565
|
+
/* @__PURE__ */ r.jsx(fe, { className: "mr-2 h-4 w-4" }),
|
|
594
566
|
o
|
|
595
567
|
] })
|
|
596
568
|
] })
|
|
597
569
|
] }),
|
|
598
570
|
f && /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
599
571
|
/* @__PURE__ */ r.jsxs("div", { className: "relative max-w-sm flex-1", children: [
|
|
572
|
+
/* @__PURE__ */ r.jsx(me, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
600
573
|
/* @__PURE__ */ r.jsx(
|
|
601
|
-
|
|
602
|
-
{
|
|
603
|
-
className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground",
|
|
604
|
-
fill: "none",
|
|
605
|
-
stroke: "currentColor",
|
|
606
|
-
viewBox: "0 0 24 24",
|
|
607
|
-
children: /* @__PURE__ */ r.jsx(
|
|
608
|
-
"path",
|
|
609
|
-
{
|
|
610
|
-
strokeLinecap: "round",
|
|
611
|
-
strokeLinejoin: "round",
|
|
612
|
-
strokeWidth: 2,
|
|
613
|
-
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
614
|
-
}
|
|
615
|
-
)
|
|
616
|
-
}
|
|
617
|
-
),
|
|
618
|
-
/* @__PURE__ */ r.jsx(
|
|
619
|
-
T,
|
|
574
|
+
k,
|
|
620
575
|
{
|
|
621
576
|
placeholder: h,
|
|
622
577
|
value: d,
|
|
623
|
-
onChange: (E) =>
|
|
578
|
+
onChange: (E) => p == null ? void 0 : p(E.target.value),
|
|
624
579
|
onKeyPress: b,
|
|
625
580
|
className: "h-9 pl-8",
|
|
626
581
|
disabled: m
|
|
@@ -640,46 +595,46 @@ function ge({
|
|
|
640
595
|
] })
|
|
641
596
|
] });
|
|
642
597
|
}
|
|
643
|
-
function
|
|
598
|
+
function we({
|
|
644
599
|
currentPage: a,
|
|
645
600
|
pageSize: h,
|
|
646
601
|
total: d,
|
|
647
|
-
onPageChange:
|
|
602
|
+
onPageChange: p,
|
|
648
603
|
onPageSizeChange: c,
|
|
649
604
|
pageSizeOptions: f = [10, 20, 50],
|
|
650
605
|
showPageSizeSelector: x = !0,
|
|
651
606
|
showTotal: o = !0,
|
|
652
|
-
searchActive:
|
|
607
|
+
searchActive: T = !1,
|
|
653
608
|
components: m
|
|
654
609
|
}) {
|
|
655
610
|
if (!m)
|
|
656
611
|
return /* @__PURE__ */ r.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
657
612
|
const {
|
|
658
613
|
Button: s,
|
|
659
|
-
Select:
|
|
614
|
+
Select: k,
|
|
660
615
|
SelectTrigger: N,
|
|
661
616
|
SelectContent: b,
|
|
662
617
|
SelectItem: E,
|
|
663
618
|
SelectValue: O
|
|
664
|
-
} = m,
|
|
619
|
+
} = m, y = Math.ceil(d / h), w = Math.max(y, 1), D = a * h + 1, S = Math.min((a + 1) * h, d), R = Array.from(
|
|
665
620
|
/* @__PURE__ */ new Set([...f, h])
|
|
666
|
-
).sort((
|
|
621
|
+
).sort((_, g) => _ - g), P = x && !!c;
|
|
667
622
|
return d === 0 ? null : /* @__PURE__ */ r.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
668
|
-
o && /* @__PURE__ */ r.jsx("div", { className: "text-sm text-muted-foreground", children:
|
|
623
|
+
o && /* @__PURE__ */ r.jsx("div", { className: "text-sm text-muted-foreground", children: T ? `找到 ${d} 条匹配记录` : d > 0 ? `显示 ${D} - ${S} 条,共 ${d} 条记录` : "暂无数据" }),
|
|
669
624
|
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
670
625
|
P && /* @__PURE__ */ r.jsxs("div", { className: "mr-2 flex items-center gap-2", children: [
|
|
671
626
|
/* @__PURE__ */ r.jsx("span", { className: "text-sm text-muted-foreground", children: "每页" }),
|
|
672
627
|
/* @__PURE__ */ r.jsxs(
|
|
673
|
-
|
|
628
|
+
k,
|
|
674
629
|
{
|
|
675
630
|
value: String(h),
|
|
676
|
-
onValueChange: (
|
|
677
|
-
const
|
|
678
|
-
Number.isNaN(
|
|
631
|
+
onValueChange: (_) => {
|
|
632
|
+
const g = Number(_);
|
|
633
|
+
Number.isNaN(g) || g === h || !c || c(g);
|
|
679
634
|
},
|
|
680
635
|
children: [
|
|
681
636
|
/* @__PURE__ */ r.jsx(N, { className: "h-8 w-[90px]", children: /* @__PURE__ */ r.jsx(O, {}) }),
|
|
682
|
-
/* @__PURE__ */ r.jsx(b, { children: R.map((
|
|
637
|
+
/* @__PURE__ */ r.jsx(b, { children: R.map((_) => /* @__PURE__ */ r.jsx(E, { value: String(_), children: _ }, _)) })
|
|
683
638
|
]
|
|
684
639
|
}
|
|
685
640
|
),
|
|
@@ -697,27 +652,10 @@ function ke({
|
|
|
697
652
|
{
|
|
698
653
|
variant: "outline",
|
|
699
654
|
size: "sm",
|
|
700
|
-
onClick: () =>
|
|
655
|
+
onClick: () => p(a - 1),
|
|
701
656
|
disabled: a === 0 || w <= 1,
|
|
702
657
|
children: [
|
|
703
|
-
/* @__PURE__ */ r.jsx(
|
|
704
|
-
"svg",
|
|
705
|
-
{
|
|
706
|
-
className: "h-4 w-4",
|
|
707
|
-
fill: "none",
|
|
708
|
-
stroke: "currentColor",
|
|
709
|
-
viewBox: "0 0 24 24",
|
|
710
|
-
children: /* @__PURE__ */ r.jsx(
|
|
711
|
-
"path",
|
|
712
|
-
{
|
|
713
|
-
strokeLinecap: "round",
|
|
714
|
-
strokeLinejoin: "round",
|
|
715
|
-
strokeWidth: 2,
|
|
716
|
-
d: "M15 19l-7-7 7-7"
|
|
717
|
-
}
|
|
718
|
-
)
|
|
719
|
-
}
|
|
720
|
-
),
|
|
658
|
+
/* @__PURE__ */ r.jsx(xe, { className: "h-4 w-4" }),
|
|
721
659
|
"上一页"
|
|
722
660
|
]
|
|
723
661
|
}
|
|
@@ -727,28 +665,11 @@ function ke({
|
|
|
727
665
|
{
|
|
728
666
|
variant: "outline",
|
|
729
667
|
size: "sm",
|
|
730
|
-
onClick: () =>
|
|
668
|
+
onClick: () => p(a + 1),
|
|
731
669
|
disabled: a >= w - 1 || w <= 1,
|
|
732
670
|
children: [
|
|
733
671
|
"下一页",
|
|
734
|
-
/* @__PURE__ */ r.jsx(
|
|
735
|
-
"svg",
|
|
736
|
-
{
|
|
737
|
-
className: "h-4 w-4",
|
|
738
|
-
fill: "none",
|
|
739
|
-
stroke: "currentColor",
|
|
740
|
-
viewBox: "0 0 24 24",
|
|
741
|
-
children: /* @__PURE__ */ r.jsx(
|
|
742
|
-
"path",
|
|
743
|
-
{
|
|
744
|
-
strokeLinecap: "round",
|
|
745
|
-
strokeLinejoin: "round",
|
|
746
|
-
strokeWidth: 2,
|
|
747
|
-
d: "M9 5l7 7-7 7"
|
|
748
|
-
}
|
|
749
|
-
)
|
|
750
|
-
}
|
|
751
|
-
)
|
|
672
|
+
/* @__PURE__ */ r.jsx(he, { className: "h-4 w-4" })
|
|
752
673
|
]
|
|
753
674
|
}
|
|
754
675
|
)
|
|
@@ -756,10 +677,10 @@ function ke({
|
|
|
756
677
|
] });
|
|
757
678
|
}
|
|
758
679
|
export {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
680
|
+
Te as DataTable,
|
|
681
|
+
Re as DeleteConfirmDialog,
|
|
682
|
+
ke as TableHeader,
|
|
683
|
+
we as TablePagination,
|
|
684
|
+
_e as cn
|
|
764
685
|
};
|
|
765
686
|
//# sourceMappingURL=index.js.map
|