@turinhub/atomix-common-ui 0.1.1 → 0.1.2
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 +7 -0
- package/dist/components/ThemeSwitcher.d.ts +40 -0
- package/dist/components/ThemeSwitcher.d.ts.map +1 -0
- package/dist/components/ThemeSwitcherContent.d.ts +30 -0
- package/dist/components/ThemeSwitcherContent.d.ts.map +1 -0
- package/dist/index.c.js +4 -4
- package/dist/index.c.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +626 -392
- package/dist/index.js.map +1 -1
- package/dist/types/component-types.d.ts +19 -0
- package/dist/types/component-types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { clsx as
|
|
2
|
-
import { twMerge as
|
|
3
|
-
import
|
|
4
|
-
import { MoreVertical as de, Plus as fe, Search as
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
import { clsx as ce } from "clsx";
|
|
2
|
+
import { twMerge as ie } from "tailwind-merge";
|
|
3
|
+
import ue, { useState as ne, useEffect as le } from "react";
|
|
4
|
+
import { MoreVertical as de, Plus as fe, Search as xe, ChevronLeft as me, ChevronRight as he } from "lucide-react";
|
|
5
|
+
function ye(...n) {
|
|
6
|
+
return ie(ce(n));
|
|
7
7
|
}
|
|
8
|
-
var
|
|
8
|
+
var Q = { exports: {} }, U = {};
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.js
|
|
@@ -17,27 +17,27 @@ var Z = { exports: {} }, B = {};
|
|
|
17
17
|
*/
|
|
18
18
|
var re;
|
|
19
19
|
function pe() {
|
|
20
|
-
if (re) return
|
|
20
|
+
if (re) return U;
|
|
21
21
|
re = 1;
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
var
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
for (var o in
|
|
28
|
-
o !== "key" && (
|
|
29
|
-
} else
|
|
30
|
-
return
|
|
31
|
-
$$typeof:
|
|
32
|
-
type:
|
|
33
|
-
key:
|
|
34
|
-
ref:
|
|
35
|
-
props:
|
|
22
|
+
var n = Symbol.for("react.transitional.element"), h = Symbol.for("react.fragment");
|
|
23
|
+
function c(x, a, i) {
|
|
24
|
+
var d = null;
|
|
25
|
+
if (i !== void 0 && (d = "" + i), a.key !== void 0 && (d = "" + a.key), "key" in a) {
|
|
26
|
+
i = {};
|
|
27
|
+
for (var o in a)
|
|
28
|
+
o !== "key" && (i[o] = a[o]);
|
|
29
|
+
} else i = a;
|
|
30
|
+
return a = i.ref, {
|
|
31
|
+
$$typeof: n,
|
|
32
|
+
type: x,
|
|
33
|
+
key: d,
|
|
34
|
+
ref: a !== void 0 ? a : null,
|
|
35
|
+
props: i
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return U.Fragment = h, U.jsx = c, U.jsxs = c, U;
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var V = {};
|
|
41
41
|
/**
|
|
42
42
|
* @license React
|
|
43
43
|
* react-jsx-runtime.development.js
|
|
@@ -50,314 +50,314 @@ var L = {};
|
|
|
50
50
|
var te;
|
|
51
51
|
function je() {
|
|
52
52
|
return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
53
|
-
function
|
|
54
|
-
if (
|
|
55
|
-
if (typeof
|
|
56
|
-
return
|
|
57
|
-
if (typeof
|
|
58
|
-
switch (
|
|
59
|
-
case
|
|
53
|
+
function n(r) {
|
|
54
|
+
if (r == null) return null;
|
|
55
|
+
if (typeof r == "function")
|
|
56
|
+
return r.$$typeof === K ? null : r.displayName || r.name || null;
|
|
57
|
+
if (typeof r == "string") return r;
|
|
58
|
+
switch (r) {
|
|
59
|
+
case C:
|
|
60
60
|
return "Fragment";
|
|
61
|
-
case
|
|
61
|
+
case O:
|
|
62
62
|
return "Profiler";
|
|
63
|
-
case
|
|
63
|
+
case R:
|
|
64
64
|
return "StrictMode";
|
|
65
|
-
case
|
|
65
|
+
case E:
|
|
66
66
|
return "Suspense";
|
|
67
67
|
case g:
|
|
68
68
|
return "SuspenseList";
|
|
69
|
-
case
|
|
69
|
+
case L:
|
|
70
70
|
return "Activity";
|
|
71
71
|
}
|
|
72
|
-
if (typeof
|
|
73
|
-
switch (typeof
|
|
72
|
+
if (typeof r == "object")
|
|
73
|
+
switch (typeof r.tag == "number" && console.error(
|
|
74
74
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
75
|
-
),
|
|
76
|
-
case
|
|
75
|
+
), r.$$typeof) {
|
|
76
|
+
case M:
|
|
77
77
|
return "Portal";
|
|
78
|
-
case
|
|
79
|
-
return
|
|
78
|
+
case y:
|
|
79
|
+
return r.displayName || "Context";
|
|
80
80
|
case S:
|
|
81
|
-
return (
|
|
81
|
+
return (r._context.displayName || "Context") + ".Consumer";
|
|
82
|
+
case A:
|
|
83
|
+
var s = r.render;
|
|
84
|
+
return r = r.displayName, r || (r = s.displayName || s.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
|
|
85
|
+
case _:
|
|
86
|
+
return s = r.displayName || null, s !== null ? s : n(r.type) || "Memo";
|
|
82
87
|
case P:
|
|
83
|
-
|
|
84
|
-
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
85
|
-
case V:
|
|
86
|
-
return t = e.displayName || null, t !== null ? t : a(e.type) || "Memo";
|
|
87
|
-
case I:
|
|
88
|
-
t = e._payload, e = e._init;
|
|
88
|
+
s = r._payload, r = r._init;
|
|
89
89
|
try {
|
|
90
|
-
return
|
|
90
|
+
return n(r(s));
|
|
91
91
|
} catch {
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
|
-
function h(
|
|
97
|
-
return "" +
|
|
96
|
+
function h(r) {
|
|
97
|
+
return "" + r;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function c(r) {
|
|
100
100
|
try {
|
|
101
|
-
h(
|
|
102
|
-
var
|
|
101
|
+
h(r);
|
|
102
|
+
var s = !1;
|
|
103
103
|
} catch {
|
|
104
|
-
|
|
104
|
+
s = !0;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
-
return
|
|
110
|
-
|
|
106
|
+
if (s) {
|
|
107
|
+
s = console;
|
|
108
|
+
var u = s.error, m = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
109
|
+
return u.call(
|
|
110
|
+
s,
|
|
111
111
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
112
|
-
|
|
113
|
-
), h(
|
|
112
|
+
m
|
|
113
|
+
), h(r);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
if (
|
|
118
|
-
if (typeof
|
|
116
|
+
function x(r) {
|
|
117
|
+
if (r === C) return "<>";
|
|
118
|
+
if (typeof r == "object" && r !== null && r.$$typeof === P)
|
|
119
119
|
return "<...>";
|
|
120
120
|
try {
|
|
121
|
-
var
|
|
122
|
-
return
|
|
121
|
+
var s = n(r);
|
|
122
|
+
return s ? "<" + s + ">" : "<...>";
|
|
123
123
|
} catch {
|
|
124
124
|
return "<...>";
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
var
|
|
129
|
-
return
|
|
127
|
+
function a() {
|
|
128
|
+
var r = Y.A;
|
|
129
|
+
return r === null ? null : r.getOwner();
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function i() {
|
|
132
132
|
return Error("react-stack-top-frame");
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
if (
|
|
136
|
-
var
|
|
137
|
-
if (
|
|
134
|
+
function d(r) {
|
|
135
|
+
if (H.call(r, "key")) {
|
|
136
|
+
var s = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
137
|
+
if (s && s.isReactWarning) return !1;
|
|
138
138
|
}
|
|
139
|
-
return
|
|
139
|
+
return r.key !== void 0;
|
|
140
140
|
}
|
|
141
|
-
function o(
|
|
142
|
-
function
|
|
143
|
-
|
|
141
|
+
function o(r, s) {
|
|
142
|
+
function u() {
|
|
143
|
+
G || (G = !0, console.error(
|
|
144
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)",
|
|
145
|
-
|
|
145
|
+
s
|
|
146
146
|
));
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
get:
|
|
148
|
+
u.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
149
|
+
get: u,
|
|
150
150
|
configurable: !0
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
return J[
|
|
153
|
+
function w() {
|
|
154
|
+
var r = n(this.type);
|
|
155
|
+
return J[r] || (J[r] = !0, console.error(
|
|
156
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."
|
|
157
|
-
)),
|
|
157
|
+
)), r = this.props.ref, r !== void 0 ? r : null;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
var
|
|
161
|
-
return
|
|
162
|
-
$$typeof:
|
|
163
|
-
type:
|
|
164
|
-
key:
|
|
165
|
-
props:
|
|
166
|
-
_owner:
|
|
167
|
-
}, (
|
|
159
|
+
function f(r, s, u, m, $, W) {
|
|
160
|
+
var p = u.ref;
|
|
161
|
+
return r = {
|
|
162
|
+
$$typeof: T,
|
|
163
|
+
type: r,
|
|
164
|
+
key: s,
|
|
165
|
+
props: u,
|
|
166
|
+
_owner: m
|
|
167
|
+
}, (p !== void 0 ? p : null) !== null ? Object.defineProperty(r, "ref", {
|
|
168
168
|
enumerable: !1,
|
|
169
|
-
get:
|
|
170
|
-
}) : Object.defineProperty(
|
|
169
|
+
get: w
|
|
170
|
+
}) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
|
|
171
171
|
configurable: !1,
|
|
172
172
|
enumerable: !1,
|
|
173
173
|
writable: !0,
|
|
174
174
|
value: 0
|
|
175
|
-
}), Object.defineProperty(
|
|
175
|
+
}), Object.defineProperty(r, "_debugInfo", {
|
|
176
176
|
configurable: !1,
|
|
177
177
|
enumerable: !1,
|
|
178
178
|
writable: !0,
|
|
179
179
|
value: null
|
|
180
|
-
}), Object.defineProperty(
|
|
180
|
+
}), Object.defineProperty(r, "_debugStack", {
|
|
181
181
|
configurable: !1,
|
|
182
182
|
enumerable: !1,
|
|
183
183
|
writable: !0,
|
|
184
184
|
value: $
|
|
185
|
-
}), Object.defineProperty(
|
|
185
|
+
}), Object.defineProperty(r, "_debugTask", {
|
|
186
186
|
configurable: !1,
|
|
187
187
|
enumerable: !1,
|
|
188
188
|
writable: !0,
|
|
189
|
-
value:
|
|
190
|
-
}), Object.freeze && (Object.freeze(
|
|
189
|
+
value: W
|
|
190
|
+
}), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
var
|
|
194
|
-
if (
|
|
195
|
-
if (
|
|
196
|
-
if (
|
|
197
|
-
for (
|
|
198
|
-
|
|
199
|
-
Object.freeze && Object.freeze(
|
|
192
|
+
function t(r, s, u, m, $, W) {
|
|
193
|
+
var p = s.children;
|
|
194
|
+
if (p !== void 0)
|
|
195
|
+
if (m)
|
|
196
|
+
if (q(p)) {
|
|
197
|
+
for (m = 0; m < p.length; m++)
|
|
198
|
+
j(p[m]);
|
|
199
|
+
Object.freeze && Object.freeze(p);
|
|
200
200
|
} else
|
|
201
201
|
console.error(
|
|
202
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."
|
|
203
203
|
);
|
|
204
|
-
else
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
var
|
|
208
|
-
return
|
|
204
|
+
else j(p);
|
|
205
|
+
if (H.call(s, "key")) {
|
|
206
|
+
p = n(r);
|
|
207
|
+
var D = Object.keys(s).filter(function(N) {
|
|
208
|
+
return N !== "key";
|
|
209
209
|
});
|
|
210
|
-
|
|
210
|
+
m = 0 < D.length ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}", X[p + m] || (D = 0 < D.length ? "{" + D.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
211
211
|
`A props object containing a "key" prop is being spread into JSX:
|
|
212
212
|
let props = %s;
|
|
213
213
|
<%s {...props} />
|
|
214
214
|
React keys must be passed directly to JSX without using spread:
|
|
215
215
|
let props = %s;
|
|
216
216
|
<%s key={someKey} {...props} />`,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
),
|
|
217
|
+
m,
|
|
218
|
+
p,
|
|
219
|
+
D,
|
|
220
|
+
p
|
|
221
|
+
), X[p + m] = !0);
|
|
222
222
|
}
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
for (var l in
|
|
226
|
-
l !== "key" && (
|
|
227
|
-
} else
|
|
228
|
-
return
|
|
229
|
-
n,
|
|
230
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
231
|
-
), m(
|
|
232
|
-
e,
|
|
223
|
+
if (p = null, u !== void 0 && (c(u), p = "" + u), d(s) && (c(s.key), p = "" + s.key), "key" in s) {
|
|
224
|
+
u = {};
|
|
225
|
+
for (var l in s)
|
|
226
|
+
l !== "key" && (u[l] = s[l]);
|
|
227
|
+
} else u = s;
|
|
228
|
+
return p && o(
|
|
233
229
|
u,
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
typeof r == "function" ? r.displayName || r.name || "Unknown" : r
|
|
231
|
+
), f(
|
|
232
|
+
r,
|
|
233
|
+
p,
|
|
234
|
+
u,
|
|
235
|
+
a(),
|
|
236
236
|
$,
|
|
237
|
-
|
|
237
|
+
W
|
|
238
238
|
);
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
|
|
240
|
+
function j(r) {
|
|
241
|
+
b(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === P && (r._payload.status === "fulfilled" ? b(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
return typeof
|
|
243
|
+
function b(r) {
|
|
244
|
+
return typeof r == "object" && r !== null && r.$$typeof === T;
|
|
245
245
|
}
|
|
246
|
-
var
|
|
246
|
+
var v = ue, T = Symbol.for("react.transitional.element"), M = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), y = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), Y = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, q = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
247
247
|
return null;
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
react_stack_bottom_frame: function(
|
|
251
|
-
return
|
|
249
|
+
v = {
|
|
250
|
+
react_stack_bottom_frame: function(r) {
|
|
251
|
+
return r();
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
|
-
var
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
)(),
|
|
258
|
-
|
|
259
|
-
var
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
254
|
+
var G, J = {}, z = v.react_stack_bottom_frame.bind(
|
|
255
|
+
v,
|
|
256
|
+
i
|
|
257
|
+
)(), I = F(x(i)), X = {};
|
|
258
|
+
V.Fragment = C, V.jsx = function(r, s, u) {
|
|
259
|
+
var m = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
260
|
+
return t(
|
|
261
|
+
r,
|
|
262
|
+
s,
|
|
263
|
+
u,
|
|
264
264
|
!1,
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
m ? Error("react-stack-top-frame") : z,
|
|
266
|
+
m ? F(x(r)) : I
|
|
267
267
|
);
|
|
268
|
-
},
|
|
269
|
-
var
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
268
|
+
}, V.jsxs = function(r, s, u) {
|
|
269
|
+
var m = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
270
|
+
return t(
|
|
271
|
+
r,
|
|
272
|
+
s,
|
|
273
|
+
u,
|
|
274
274
|
!0,
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
m ? Error("react-stack-top-frame") : z,
|
|
276
|
+
m ? F(x(r)) : I
|
|
277
277
|
);
|
|
278
278
|
};
|
|
279
|
-
})()),
|
|
279
|
+
})()), V;
|
|
280
280
|
}
|
|
281
281
|
var se;
|
|
282
282
|
function ve() {
|
|
283
|
-
return se || (se = 1, process.env.NODE_ENV === "production" ?
|
|
283
|
+
return se || (se = 1, process.env.NODE_ENV === "production" ? Q.exports = pe() : Q.exports = je()), Q.exports;
|
|
284
284
|
}
|
|
285
|
-
var
|
|
286
|
-
function
|
|
287
|
-
data:
|
|
285
|
+
var e = ve();
|
|
286
|
+
function Ee({
|
|
287
|
+
data: n,
|
|
288
288
|
loading: h = !1,
|
|
289
|
-
columns:
|
|
290
|
-
rowKey:
|
|
291
|
-
emptyText:
|
|
292
|
-
searchActiveEmptyText:
|
|
293
|
-
header:
|
|
289
|
+
columns: c,
|
|
290
|
+
rowKey: x,
|
|
291
|
+
emptyText: a = "暂无数据",
|
|
292
|
+
searchActiveEmptyText: i = "未找到匹配的记录",
|
|
293
|
+
header: d,
|
|
294
294
|
pagination: o,
|
|
295
|
-
rowClassName:
|
|
296
|
-
onRow:
|
|
297
|
-
actions:
|
|
298
|
-
components:
|
|
299
|
-
renderCard:
|
|
300
|
-
renderTable:
|
|
301
|
-
renderActions:
|
|
295
|
+
rowClassName: w,
|
|
296
|
+
onRow: f,
|
|
297
|
+
actions: t,
|
|
298
|
+
components: j,
|
|
299
|
+
renderCard: b,
|
|
300
|
+
renderTable: v,
|
|
301
|
+
renderActions: T
|
|
302
302
|
}) {
|
|
303
|
-
var
|
|
304
|
-
if (!
|
|
305
|
-
return /* @__PURE__ */
|
|
303
|
+
var p, D;
|
|
304
|
+
if (!j)
|
|
305
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "p-4 text-center text-destructive", children: [
|
|
306
306
|
"错误:请通过 components prop 注入 UI 组件",
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
308
|
+
/* @__PURE__ */ e.jsx("code", { className: "text-sm", children: 'import { Card, Table, Button, ... } from "@/components/ui"' })
|
|
309
309
|
] });
|
|
310
310
|
const {
|
|
311
|
-
Card:
|
|
312
|
-
CardContent:
|
|
313
|
-
CardFooter:
|
|
314
|
-
Table:
|
|
311
|
+
Card: M,
|
|
312
|
+
CardContent: C,
|
|
313
|
+
CardFooter: R,
|
|
314
|
+
Table: O,
|
|
315
315
|
TableBody: S,
|
|
316
|
-
TableCell:
|
|
317
|
-
TableHead:
|
|
318
|
-
TableHeader:
|
|
316
|
+
TableCell: y,
|
|
317
|
+
TableHead: A,
|
|
318
|
+
TableHeader: E,
|
|
319
319
|
TableRow: g,
|
|
320
|
-
Button:
|
|
321
|
-
DropdownMenu:
|
|
322
|
-
DropdownMenuTrigger:
|
|
320
|
+
Button: _,
|
|
321
|
+
DropdownMenu: P,
|
|
322
|
+
DropdownMenuTrigger: L,
|
|
323
323
|
DropdownMenuContent: K,
|
|
324
|
-
DropdownMenuItem:
|
|
325
|
-
DropdownMenuSeparator:
|
|
326
|
-
Skeleton:
|
|
324
|
+
DropdownMenuItem: Y,
|
|
325
|
+
DropdownMenuSeparator: H,
|
|
326
|
+
Skeleton: q,
|
|
327
327
|
TableHeaderComponent: F,
|
|
328
|
-
TablePaginationComponent:
|
|
329
|
-
} =
|
|
330
|
-
if (typeof
|
|
331
|
-
return
|
|
332
|
-
const
|
|
333
|
-
return
|
|
334
|
-
},
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
|
|
328
|
+
TablePaginationComponent: G
|
|
329
|
+
} = j, J = (l, N) => {
|
|
330
|
+
if (typeof x == "function")
|
|
331
|
+
return x(l);
|
|
332
|
+
const k = l[x];
|
|
333
|
+
return k != null ? String(k) : `row-${N}`;
|
|
334
|
+
}, z = !!(d != null && d.searchValue && d.searchValue.trim().length > 0), I = !!(t != null && t.render || (p = t == null ? void 0 : t.items) != null && p.length), X = (t == null ? void 0 : t.mode) ?? ((D = t == null ? void 0 : t.items) != null && D.length ? "collapsed" : "expanded"), r = (l) => l.separator === !0, s = (l, N) => !t || !I ? null : X === "collapsed" && t.items && t.items.length > 0 ? /* @__PURE__ */ e.jsxs(P, { children: [
|
|
335
|
+
/* @__PURE__ */ e.jsx(L, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
336
|
+
_,
|
|
337
337
|
{
|
|
338
338
|
variant: "ghost",
|
|
339
339
|
className: "h-8 w-8 p-0",
|
|
340
340
|
"aria-label": "打开行操作菜单",
|
|
341
|
-
children: /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ e.jsx(de, { className: "h-4 w-4" })
|
|
342
342
|
}
|
|
343
343
|
) }),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
(
|
|
346
|
-
|
|
344
|
+
/* @__PURE__ */ e.jsx(K, { align: "end", children: t.items.map(
|
|
345
|
+
(k, Z) => r(k) ? /* @__PURE__ */ e.jsx(H, {}, `separator-${Z}`) : /* @__PURE__ */ e.jsxs(
|
|
346
|
+
Y,
|
|
347
347
|
{
|
|
348
|
-
onClick: () =>
|
|
349
|
-
className:
|
|
348
|
+
onClick: () => k.onClick(l, N),
|
|
349
|
+
className: k.className,
|
|
350
350
|
children: [
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
k.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 h-4 w-4", children: k.icon }),
|
|
352
|
+
k.label
|
|
353
353
|
]
|
|
354
354
|
},
|
|
355
|
-
`action-${
|
|
355
|
+
`action-${Z}`
|
|
356
356
|
)
|
|
357
357
|
) })
|
|
358
|
-
] }) :
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
] }) : t.render ? t.render(l, N) : null, u = () => /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsxs(g, { className: "bg-muted/50 hover:bg-muted/50", children: [
|
|
359
|
+
c.map((l) => /* @__PURE__ */ e.jsx(
|
|
360
|
+
A,
|
|
361
361
|
{
|
|
362
362
|
className: `font-semibold text-foreground ${l.align === "center" ? "text-center" : l.align === "right" ? "text-right" : "text-left"}`,
|
|
363
363
|
style: { width: l.width },
|
|
@@ -365,54 +365,54 @@ function Te({
|
|
|
365
365
|
},
|
|
366
366
|
String(l.key)
|
|
367
367
|
)),
|
|
368
|
-
|
|
369
|
-
] }) }),
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
I && /* @__PURE__ */ e.jsx(A, { className: "text-right font-semibold text-foreground", children: (t == null ? void 0 : t.title) || "操作" })
|
|
369
|
+
] }) }), m = () => h ? /* @__PURE__ */ e.jsx(S, { children: Array.from({ length: 5 }).map((l, N) => /* @__PURE__ */ e.jsxs(g, { children: [
|
|
370
|
+
c.map((k) => /* @__PURE__ */ e.jsx(
|
|
371
|
+
y,
|
|
372
372
|
{
|
|
373
|
-
style: { width:
|
|
374
|
-
className:
|
|
375
|
-
children: /* @__PURE__ */
|
|
373
|
+
style: { width: k.width },
|
|
374
|
+
className: k.align === "center" ? "text-center" : k.align === "right" ? "text-right" : "",
|
|
375
|
+
children: /* @__PURE__ */ e.jsx(q, { className: "h-4 w-full" })
|
|
376
376
|
},
|
|
377
|
-
String(
|
|
377
|
+
String(k.key)
|
|
378
378
|
)),
|
|
379
|
-
|
|
380
|
-
] },
|
|
381
|
-
|
|
379
|
+
I && /* @__PURE__ */ e.jsx(y, { children: /* @__PURE__ */ e.jsx(q, { className: "ml-auto h-4 w-8" }) })
|
|
380
|
+
] }, N)) }) : n.length === 0 ? /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsx(
|
|
381
|
+
y,
|
|
382
382
|
{
|
|
383
|
-
colSpan:
|
|
383
|
+
colSpan: c.length + (I ? 1 : 0),
|
|
384
384
|
className: "py-8 text-center text-muted-foreground",
|
|
385
|
-
children:
|
|
385
|
+
children: z ? i : a
|
|
386
386
|
}
|
|
387
|
-
) }) }) : /* @__PURE__ */
|
|
388
|
-
const
|
|
389
|
-
return /* @__PURE__ */
|
|
387
|
+
) }) }) : /* @__PURE__ */ e.jsx(S, { children: n.map((l, N) => {
|
|
388
|
+
const k = J(l, N), Z = f == null ? void 0 : f(l, N), ae = w == null ? void 0 : w(l, N);
|
|
389
|
+
return /* @__PURE__ */ e.jsxs(
|
|
390
390
|
g,
|
|
391
391
|
{
|
|
392
|
-
className: `${
|
|
393
|
-
...
|
|
392
|
+
className: `${ae || ""} hover:bg-muted/50`,
|
|
393
|
+
...Z,
|
|
394
394
|
children: [
|
|
395
|
-
|
|
396
|
-
const ee = l[
|
|
397
|
-
return /* @__PURE__ */
|
|
398
|
-
|
|
395
|
+
c.map((B) => {
|
|
396
|
+
const ee = l[B.key], oe = B.render ? B.render(ee, l, N) : ee;
|
|
397
|
+
return /* @__PURE__ */ e.jsx(
|
|
398
|
+
y,
|
|
399
399
|
{
|
|
400
|
-
className:
|
|
401
|
-
children:
|
|
400
|
+
className: B.align === "center" ? "text-center" : B.align === "right" ? "text-right" : "",
|
|
401
|
+
children: oe
|
|
402
402
|
},
|
|
403
|
-
String(
|
|
403
|
+
String(B.key)
|
|
404
404
|
);
|
|
405
405
|
}),
|
|
406
|
-
|
|
406
|
+
I && /* @__PURE__ */ e.jsx(y, { className: "text-right", children: T ? T(l, N) : s(l, N) })
|
|
407
407
|
]
|
|
408
408
|
},
|
|
409
|
-
|
|
409
|
+
k
|
|
410
410
|
);
|
|
411
|
-
}) }), $ = (l) => /* @__PURE__ */
|
|
412
|
-
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
(o == null ? void 0 : o.show) !== !1 && o && /* @__PURE__ */
|
|
415
|
-
|
|
411
|
+
}) }), $ = (l) => /* @__PURE__ */ e.jsxs(M, { children: [
|
|
412
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "p-6 pb-0", children: /* @__PURE__ */ e.jsx(F, { ...d }) }),
|
|
413
|
+
/* @__PURE__ */ e.jsx(C, { className: "p-0", children: l }),
|
|
414
|
+
(o == null ? void 0 : o.show) !== !1 && o && /* @__PURE__ */ e.jsx(R, { className: "border-t py-4", children: /* @__PURE__ */ e.jsx(
|
|
415
|
+
G,
|
|
416
416
|
{
|
|
417
417
|
currentPage: o.currentPage,
|
|
418
418
|
pageSize: o.pageSize,
|
|
@@ -422,94 +422,94 @@ function Te({
|
|
|
422
422
|
pageSizeOptions: o.pageSizeOptions,
|
|
423
423
|
showPageSizeSelector: o.showPageSizeSelector,
|
|
424
424
|
showTotal: o.showTotal,
|
|
425
|
-
searchActive:
|
|
425
|
+
searchActive: z
|
|
426
426
|
}
|
|
427
427
|
) })
|
|
428
|
-
] }),
|
|
428
|
+
] }), W = (l, N) => /* @__PURE__ */ e.jsxs(O, { children: [
|
|
429
429
|
l,
|
|
430
|
-
|
|
430
|
+
N
|
|
431
431
|
] });
|
|
432
|
-
return
|
|
433
|
-
|
|
432
|
+
return b ? b(
|
|
433
|
+
v ? v(u(), m()) : W(u(), m())
|
|
434
434
|
) : $(
|
|
435
|
-
|
|
435
|
+
v ? v(u(), m()) : W(u(), m())
|
|
436
436
|
);
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
open:
|
|
438
|
+
function _e({
|
|
439
|
+
open: n,
|
|
440
440
|
onOpenChange: h,
|
|
441
|
-
title:
|
|
442
|
-
description:
|
|
443
|
-
onConfirm:
|
|
444
|
-
loading:
|
|
445
|
-
confirmText:
|
|
441
|
+
title: c,
|
|
442
|
+
description: x,
|
|
443
|
+
onConfirm: a,
|
|
444
|
+
loading: i = !1,
|
|
445
|
+
confirmText: d = "确认删除",
|
|
446
446
|
cancelText: o = "取消",
|
|
447
|
-
confirmButtonVariant:
|
|
448
|
-
verification:
|
|
449
|
-
components:
|
|
450
|
-
loadingIcon:
|
|
447
|
+
confirmButtonVariant: w = "destructive",
|
|
448
|
+
verification: f,
|
|
449
|
+
components: t,
|
|
450
|
+
loadingIcon: j
|
|
451
451
|
}) {
|
|
452
|
-
const [
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
}, [
|
|
456
|
-
return /* @__PURE__ */
|
|
452
|
+
const [b, v] = ne("");
|
|
453
|
+
if (le(() => {
|
|
454
|
+
n && v("");
|
|
455
|
+
}, [n, f == null ? void 0 : f.targetValue]), !t)
|
|
456
|
+
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
457
457
|
const {
|
|
458
|
-
Dialog:
|
|
459
|
-
DialogContent:
|
|
460
|
-
DialogHeader:
|
|
461
|
-
DialogFooter:
|
|
462
|
-
DialogTitle:
|
|
458
|
+
Dialog: T,
|
|
459
|
+
DialogContent: M,
|
|
460
|
+
DialogHeader: C,
|
|
461
|
+
DialogFooter: R,
|
|
462
|
+
DialogTitle: O,
|
|
463
463
|
DialogDescription: S,
|
|
464
|
-
Button:
|
|
465
|
-
Input:
|
|
466
|
-
Label:
|
|
467
|
-
} =
|
|
468
|
-
g ||
|
|
464
|
+
Button: y,
|
|
465
|
+
Input: A,
|
|
466
|
+
Label: E
|
|
467
|
+
} = t, g = f ? b !== f.targetValue : !1, _ = () => {
|
|
468
|
+
g || a();
|
|
469
469
|
};
|
|
470
|
-
return /* @__PURE__ */
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ e.jsx(T, { open: n, onOpenChange: h, children: /* @__PURE__ */ e.jsxs(M, { children: [
|
|
471
|
+
/* @__PURE__ */ e.jsxs(C, { children: [
|
|
472
|
+
/* @__PURE__ */ e.jsx(O, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: c }) }),
|
|
473
|
+
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { children: x }) })
|
|
474
474
|
] }),
|
|
475
|
-
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
475
|
+
f && /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
476
|
+
/* @__PURE__ */ e.jsx(E, { htmlFor: "confirm-input", children: f.label || "请输入以确认" }),
|
|
477
|
+
/* @__PURE__ */ e.jsx(
|
|
478
|
+
A,
|
|
479
479
|
{
|
|
480
480
|
id: "confirm-input",
|
|
481
|
-
value:
|
|
482
|
-
onChange: (
|
|
483
|
-
placeholder:
|
|
484
|
-
disabled:
|
|
481
|
+
value: b,
|
|
482
|
+
onChange: (P) => v(P.target.value),
|
|
483
|
+
placeholder: f.placeholder,
|
|
484
|
+
disabled: i
|
|
485
485
|
}
|
|
486
486
|
)
|
|
487
487
|
] }) }),
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
|
|
488
|
+
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
489
|
+
/* @__PURE__ */ e.jsx(
|
|
490
|
+
y,
|
|
491
491
|
{
|
|
492
492
|
variant: "outline",
|
|
493
493
|
onClick: () => h(!1),
|
|
494
|
-
disabled:
|
|
494
|
+
disabled: i,
|
|
495
495
|
children: o
|
|
496
496
|
}
|
|
497
497
|
),
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
|
|
498
|
+
/* @__PURE__ */ e.jsxs(
|
|
499
|
+
y,
|
|
500
500
|
{
|
|
501
|
-
variant:
|
|
502
|
-
onClick:
|
|
503
|
-
disabled: g ||
|
|
501
|
+
variant: w,
|
|
502
|
+
onClick: _,
|
|
503
|
+
disabled: g || i,
|
|
504
504
|
children: [
|
|
505
|
-
|
|
505
|
+
i && /* @__PURE__ */ e.jsx("span", { className: "mr-2", children: j || /* @__PURE__ */ e.jsxs(
|
|
506
506
|
"svg",
|
|
507
507
|
{
|
|
508
508
|
className: "h-4 w-4 animate-spin",
|
|
509
509
|
fill: "none",
|
|
510
510
|
viewBox: "0 0 24 24",
|
|
511
511
|
children: [
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ e.jsx(
|
|
513
513
|
"circle",
|
|
514
514
|
{
|
|
515
515
|
className: "opacity-25",
|
|
@@ -520,7 +520,7 @@ function Re({
|
|
|
520
520
|
strokeWidth: "4"
|
|
521
521
|
}
|
|
522
522
|
),
|
|
523
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ e.jsx(
|
|
524
524
|
"path",
|
|
525
525
|
{
|
|
526
526
|
className: "opacity-75",
|
|
@@ -531,62 +531,62 @@ function Re({
|
|
|
531
531
|
]
|
|
532
532
|
}
|
|
533
533
|
) }),
|
|
534
|
-
|
|
534
|
+
d
|
|
535
535
|
]
|
|
536
536
|
}
|
|
537
537
|
)
|
|
538
538
|
] })
|
|
539
539
|
] }) });
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
title:
|
|
541
|
+
function Re({
|
|
542
|
+
title: n,
|
|
543
543
|
searchPlaceholder: h = "搜索...",
|
|
544
|
-
searchValue:
|
|
545
|
-
onSearchChange:
|
|
546
|
-
onSearch:
|
|
547
|
-
showSearch:
|
|
548
|
-
action:
|
|
544
|
+
searchValue: c = "",
|
|
545
|
+
onSearchChange: x,
|
|
546
|
+
onSearch: a,
|
|
547
|
+
showSearch: i = !0,
|
|
548
|
+
action: d,
|
|
549
549
|
actionLabel: o,
|
|
550
|
-
onActionClick:
|
|
551
|
-
loading:
|
|
552
|
-
components:
|
|
550
|
+
onActionClick: w,
|
|
551
|
+
loading: f = !1,
|
|
552
|
+
components: t
|
|
553
553
|
}) {
|
|
554
|
-
if (!
|
|
555
|
-
return /* @__PURE__ */
|
|
556
|
-
const { Input:
|
|
557
|
-
|
|
554
|
+
if (!t)
|
|
555
|
+
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
556
|
+
const { Input: j, Button: b } = t, v = (T) => {
|
|
557
|
+
T.key === "Enter" && a && a();
|
|
558
558
|
};
|
|
559
|
-
return /* @__PURE__ */
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
|
|
564
|
-
!
|
|
565
|
-
/* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-1", children: [
|
|
560
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
561
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-lg font-semibold leading-none tracking-tight", children: n }),
|
|
562
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
563
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: d }),
|
|
564
|
+
!d && o && w && /* @__PURE__ */ e.jsxs(b, { onClick: w, disabled: f, size: "sm", children: [
|
|
565
|
+
/* @__PURE__ */ e.jsx(fe, { className: "mr-2 h-4 w-4" }),
|
|
566
566
|
o
|
|
567
567
|
] })
|
|
568
568
|
] })
|
|
569
569
|
] }),
|
|
570
|
-
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
|
|
570
|
+
i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
571
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative max-w-sm flex-1", children: [
|
|
572
|
+
/* @__PURE__ */ e.jsx(xe, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
573
|
+
/* @__PURE__ */ e.jsx(
|
|
574
|
+
j,
|
|
575
575
|
{
|
|
576
576
|
placeholder: h,
|
|
577
|
-
value:
|
|
578
|
-
onChange: (
|
|
579
|
-
onKeyPress:
|
|
577
|
+
value: c,
|
|
578
|
+
onChange: (T) => x == null ? void 0 : x(T.target.value),
|
|
579
|
+
onKeyPress: v,
|
|
580
580
|
className: "h-9 pl-8",
|
|
581
|
-
disabled:
|
|
581
|
+
disabled: f
|
|
582
582
|
}
|
|
583
583
|
)
|
|
584
584
|
] }),
|
|
585
|
-
|
|
586
|
-
|
|
585
|
+
a && /* @__PURE__ */ e.jsx(
|
|
586
|
+
b,
|
|
587
587
|
{
|
|
588
|
-
onClick:
|
|
589
|
-
disabled:
|
|
588
|
+
onClick: a,
|
|
589
|
+
disabled: f,
|
|
590
590
|
variant: "secondary",
|
|
591
591
|
size: "sm",
|
|
592
592
|
children: "搜索"
|
|
@@ -595,92 +595,326 @@ function ke({
|
|
|
595
595
|
] })
|
|
596
596
|
] });
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
currentPage:
|
|
598
|
+
function Ce({
|
|
599
|
+
currentPage: n,
|
|
600
600
|
pageSize: h,
|
|
601
|
-
total:
|
|
602
|
-
onPageChange:
|
|
603
|
-
onPageSizeChange:
|
|
604
|
-
pageSizeOptions:
|
|
605
|
-
showPageSizeSelector:
|
|
601
|
+
total: c,
|
|
602
|
+
onPageChange: x,
|
|
603
|
+
onPageSizeChange: a,
|
|
604
|
+
pageSizeOptions: i = [10, 20, 50],
|
|
605
|
+
showPageSizeSelector: d = !0,
|
|
606
606
|
showTotal: o = !0,
|
|
607
|
-
searchActive:
|
|
608
|
-
components:
|
|
607
|
+
searchActive: w = !1,
|
|
608
|
+
components: f
|
|
609
609
|
}) {
|
|
610
|
-
if (!
|
|
611
|
-
return /* @__PURE__ */
|
|
610
|
+
if (!f)
|
|
611
|
+
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
612
612
|
const {
|
|
613
|
-
Button:
|
|
614
|
-
Select:
|
|
615
|
-
SelectTrigger:
|
|
616
|
-
SelectContent:
|
|
617
|
-
SelectItem:
|
|
618
|
-
SelectValue:
|
|
619
|
-
} =
|
|
620
|
-
/* @__PURE__ */ new Set([...
|
|
621
|
-
).sort((
|
|
622
|
-
return
|
|
623
|
-
o && /* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
|
|
613
|
+
Button: t,
|
|
614
|
+
Select: j,
|
|
615
|
+
SelectTrigger: b,
|
|
616
|
+
SelectContent: v,
|
|
617
|
+
SelectItem: T,
|
|
618
|
+
SelectValue: M
|
|
619
|
+
} = f, C = Math.ceil(c / h), R = Math.max(C, 1), O = n * h + 1, S = Math.min((n + 1) * h, c), y = Array.from(
|
|
620
|
+
/* @__PURE__ */ new Set([...i, h])
|
|
621
|
+
).sort((E, g) => E - g), A = d && !!a;
|
|
622
|
+
return c === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
623
|
+
o && /* @__PURE__ */ e.jsx("div", { className: "text-sm text-muted-foreground", children: w ? `找到 ${c} 条匹配记录` : c > 0 ? `显示 ${O} - ${S} 条,共 ${c} 条记录` : "暂无数据" }),
|
|
624
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
625
|
+
A && /* @__PURE__ */ e.jsxs("div", { className: "mr-2 flex items-center gap-2", children: [
|
|
626
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "每页" }),
|
|
627
|
+
/* @__PURE__ */ e.jsxs(
|
|
628
|
+
j,
|
|
629
629
|
{
|
|
630
630
|
value: String(h),
|
|
631
|
-
onValueChange: (
|
|
632
|
-
const g = Number(
|
|
633
|
-
Number.isNaN(g) || g === h || !
|
|
631
|
+
onValueChange: (E) => {
|
|
632
|
+
const g = Number(E);
|
|
633
|
+
Number.isNaN(g) || g === h || !a || a(g);
|
|
634
634
|
},
|
|
635
635
|
children: [
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
636
|
+
/* @__PURE__ */ e.jsx(b, { className: "h-8 w-[90px]", children: /* @__PURE__ */ e.jsx(M, {}) }),
|
|
637
|
+
/* @__PURE__ */ e.jsx(v, { children: y.map((E) => /* @__PURE__ */ e.jsx(T, { value: String(E), children: E }, E)) })
|
|
638
638
|
]
|
|
639
639
|
}
|
|
640
640
|
),
|
|
641
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "条" })
|
|
642
642
|
] }),
|
|
643
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mr-4 text-sm text-muted-foreground", children: [
|
|
644
644
|
"第 ",
|
|
645
|
-
|
|
645
|
+
n + 1,
|
|
646
646
|
" 页,共 ",
|
|
647
|
-
|
|
647
|
+
R,
|
|
648
648
|
" 页"
|
|
649
649
|
] }),
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
|
|
650
|
+
/* @__PURE__ */ e.jsxs(
|
|
651
|
+
t,
|
|
652
652
|
{
|
|
653
653
|
variant: "outline",
|
|
654
654
|
size: "sm",
|
|
655
|
-
onClick: () =>
|
|
656
|
-
disabled:
|
|
655
|
+
onClick: () => x(n - 1),
|
|
656
|
+
disabled: n === 0 || R <= 1,
|
|
657
657
|
children: [
|
|
658
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ e.jsx(me, { className: "h-4 w-4" }),
|
|
659
659
|
"上一页"
|
|
660
660
|
]
|
|
661
661
|
}
|
|
662
662
|
),
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
|
|
663
|
+
/* @__PURE__ */ e.jsxs(
|
|
664
|
+
t,
|
|
665
665
|
{
|
|
666
666
|
variant: "outline",
|
|
667
667
|
size: "sm",
|
|
668
|
-
onClick: () =>
|
|
669
|
-
disabled:
|
|
668
|
+
onClick: () => x(n + 1),
|
|
669
|
+
disabled: n >= R - 1 || R <= 1,
|
|
670
670
|
children: [
|
|
671
671
|
"下一页",
|
|
672
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ e.jsx(he, { className: "h-4 w-4" })
|
|
673
673
|
]
|
|
674
674
|
}
|
|
675
675
|
)
|
|
676
676
|
] })
|
|
677
677
|
] });
|
|
678
678
|
}
|
|
679
|
+
const be = [
|
|
680
|
+
{
|
|
681
|
+
value: "light",
|
|
682
|
+
label: "浅色",
|
|
683
|
+
icon: /* @__PURE__ */ e.jsxs(
|
|
684
|
+
"svg",
|
|
685
|
+
{
|
|
686
|
+
className: "h-4 w-4",
|
|
687
|
+
fill: "none",
|
|
688
|
+
viewBox: "0 0 24 24",
|
|
689
|
+
stroke: "currentColor",
|
|
690
|
+
children: [
|
|
691
|
+
/* @__PURE__ */ e.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", strokeWidth: "2" }),
|
|
692
|
+
/* @__PURE__ */ e.jsx(
|
|
693
|
+
"path",
|
|
694
|
+
{
|
|
695
|
+
className: "opacity-75",
|
|
696
|
+
d: "M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41",
|
|
697
|
+
strokeWidth: "2",
|
|
698
|
+
strokeLinecap: "round"
|
|
699
|
+
}
|
|
700
|
+
)
|
|
701
|
+
]
|
|
702
|
+
}
|
|
703
|
+
)
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
value: "dark",
|
|
707
|
+
label: "深色",
|
|
708
|
+
icon: /* @__PURE__ */ e.jsx(
|
|
709
|
+
"svg",
|
|
710
|
+
{
|
|
711
|
+
className: "h-4 w-4",
|
|
712
|
+
fill: "none",
|
|
713
|
+
viewBox: "0 0 24 24",
|
|
714
|
+
stroke: "currentColor",
|
|
715
|
+
children: /* @__PURE__ */ e.jsx(
|
|
716
|
+
"path",
|
|
717
|
+
{
|
|
718
|
+
d: "M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z",
|
|
719
|
+
strokeWidth: "2",
|
|
720
|
+
strokeLinecap: "round",
|
|
721
|
+
strokeLinejoin: "round"
|
|
722
|
+
}
|
|
723
|
+
)
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
value: "system",
|
|
729
|
+
label: "跟随系统",
|
|
730
|
+
icon: /* @__PURE__ */ e.jsxs(
|
|
731
|
+
"svg",
|
|
732
|
+
{
|
|
733
|
+
className: "h-4 w-4",
|
|
734
|
+
fill: "none",
|
|
735
|
+
viewBox: "0 0 24 24",
|
|
736
|
+
stroke: "currentColor",
|
|
737
|
+
children: [
|
|
738
|
+
/* @__PURE__ */ e.jsx(
|
|
739
|
+
"rect",
|
|
740
|
+
{
|
|
741
|
+
x: "2",
|
|
742
|
+
y: "3",
|
|
743
|
+
width: "20",
|
|
744
|
+
height: "14",
|
|
745
|
+
rx: "2",
|
|
746
|
+
ry: "2",
|
|
747
|
+
strokeWidth: "2"
|
|
748
|
+
}
|
|
749
|
+
),
|
|
750
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 21h8m-4-4v4", strokeWidth: "2", strokeLinecap: "round" })
|
|
751
|
+
]
|
|
752
|
+
}
|
|
753
|
+
)
|
|
754
|
+
}
|
|
755
|
+
];
|
|
756
|
+
function Se({
|
|
757
|
+
value: n,
|
|
758
|
+
onValueChange: h,
|
|
759
|
+
themes: c = be,
|
|
760
|
+
triggerVariant: x = "ghost",
|
|
761
|
+
triggerSize: a = "icon",
|
|
762
|
+
triggerClassName: i,
|
|
763
|
+
iconSize: d = 16,
|
|
764
|
+
showCurrentIcon: o = !0,
|
|
765
|
+
enableSSRHandling: w = !0,
|
|
766
|
+
triggerContent: f,
|
|
767
|
+
components: t,
|
|
768
|
+
themeIcons: j
|
|
769
|
+
}) {
|
|
770
|
+
const [b, v] = ne(!1);
|
|
771
|
+
if (le(() => {
|
|
772
|
+
v(!0);
|
|
773
|
+
}, []), w && !b)
|
|
774
|
+
return null;
|
|
775
|
+
if (!t)
|
|
776
|
+
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
777
|
+
const {
|
|
778
|
+
DropdownMenu: T,
|
|
779
|
+
DropdownMenuTrigger: M,
|
|
780
|
+
DropdownMenuContent: C,
|
|
781
|
+
DropdownMenuRadioGroup: R,
|
|
782
|
+
DropdownMenuRadioItem: O,
|
|
783
|
+
Button: S
|
|
784
|
+
} = t, y = (_) => {
|
|
785
|
+
if (j && j[_])
|
|
786
|
+
return j[_];
|
|
787
|
+
const P = c.find((L) => L.value === _);
|
|
788
|
+
return P == null ? void 0 : P.icon;
|
|
789
|
+
}, A = y(n), E = o ? A : null, g = d ? { width: d, height: d } : {};
|
|
790
|
+
return /* @__PURE__ */ e.jsxs(T, { children: [
|
|
791
|
+
/* @__PURE__ */ e.jsx(M, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
792
|
+
S,
|
|
793
|
+
{
|
|
794
|
+
variant: x,
|
|
795
|
+
size: a,
|
|
796
|
+
className: i,
|
|
797
|
+
children: f || /* @__PURE__ */ e.jsx(
|
|
798
|
+
"span",
|
|
799
|
+
{
|
|
800
|
+
style: g,
|
|
801
|
+
className: "inline-flex items-center justify-center",
|
|
802
|
+
children: E
|
|
803
|
+
}
|
|
804
|
+
)
|
|
805
|
+
}
|
|
806
|
+
) }),
|
|
807
|
+
/* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(R, { value: n, onValueChange: h, children: c.map((_) => /* @__PURE__ */ e.jsxs(O, { value: _.value, children: [
|
|
808
|
+
/* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: y(_.value) }),
|
|
809
|
+
/* @__PURE__ */ e.jsx("span", { children: _.label })
|
|
810
|
+
] }, _.value)) }) })
|
|
811
|
+
] });
|
|
812
|
+
}
|
|
813
|
+
const ge = [
|
|
814
|
+
{
|
|
815
|
+
value: "light",
|
|
816
|
+
label: "浅色",
|
|
817
|
+
icon: /* @__PURE__ */ e.jsxs(
|
|
818
|
+
"svg",
|
|
819
|
+
{
|
|
820
|
+
className: "h-4 w-4",
|
|
821
|
+
fill: "none",
|
|
822
|
+
viewBox: "0 0 24 24",
|
|
823
|
+
stroke: "currentColor",
|
|
824
|
+
children: [
|
|
825
|
+
/* @__PURE__ */ e.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", strokeWidth: "2" }),
|
|
826
|
+
/* @__PURE__ */ e.jsx(
|
|
827
|
+
"path",
|
|
828
|
+
{
|
|
829
|
+
className: "opacity-75",
|
|
830
|
+
d: "M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41",
|
|
831
|
+
strokeWidth: "2",
|
|
832
|
+
strokeLinecap: "round"
|
|
833
|
+
}
|
|
834
|
+
)
|
|
835
|
+
]
|
|
836
|
+
}
|
|
837
|
+
)
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
value: "dark",
|
|
841
|
+
label: "深色",
|
|
842
|
+
icon: /* @__PURE__ */ e.jsx(
|
|
843
|
+
"svg",
|
|
844
|
+
{
|
|
845
|
+
className: "h-4 w-4",
|
|
846
|
+
fill: "none",
|
|
847
|
+
viewBox: "0 0 24 24",
|
|
848
|
+
stroke: "currentColor",
|
|
849
|
+
children: /* @__PURE__ */ e.jsx(
|
|
850
|
+
"path",
|
|
851
|
+
{
|
|
852
|
+
d: "M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z",
|
|
853
|
+
strokeWidth: "2",
|
|
854
|
+
strokeLinecap: "round",
|
|
855
|
+
strokeLinejoin: "round"
|
|
856
|
+
}
|
|
857
|
+
)
|
|
858
|
+
}
|
|
859
|
+
)
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
value: "system",
|
|
863
|
+
label: "跟随系统",
|
|
864
|
+
icon: /* @__PURE__ */ e.jsxs(
|
|
865
|
+
"svg",
|
|
866
|
+
{
|
|
867
|
+
className: "h-4 w-4",
|
|
868
|
+
fill: "none",
|
|
869
|
+
viewBox: "0 0 24 24",
|
|
870
|
+
stroke: "currentColor",
|
|
871
|
+
children: [
|
|
872
|
+
/* @__PURE__ */ e.jsx(
|
|
873
|
+
"rect",
|
|
874
|
+
{
|
|
875
|
+
x: "2",
|
|
876
|
+
y: "3",
|
|
877
|
+
width: "20",
|
|
878
|
+
height: "14",
|
|
879
|
+
rx: "2",
|
|
880
|
+
ry: "2",
|
|
881
|
+
strokeWidth: "2"
|
|
882
|
+
}
|
|
883
|
+
),
|
|
884
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 21h8m-4-4v4", strokeWidth: "2", strokeLinecap: "round" })
|
|
885
|
+
]
|
|
886
|
+
}
|
|
887
|
+
)
|
|
888
|
+
}
|
|
889
|
+
];
|
|
890
|
+
function Pe({
|
|
891
|
+
value: n,
|
|
892
|
+
onValueChange: h,
|
|
893
|
+
themes: c = ge,
|
|
894
|
+
iconSize: x = 16,
|
|
895
|
+
components: a,
|
|
896
|
+
themeIcons: i
|
|
897
|
+
}) {
|
|
898
|
+
if (!a)
|
|
899
|
+
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
|
|
900
|
+
const { DropdownMenuRadioGroup: d, DropdownMenuRadioItem: o } = a, w = (t) => {
|
|
901
|
+
if (i && i[t])
|
|
902
|
+
return i[t];
|
|
903
|
+
const j = c.find((b) => b.value === t);
|
|
904
|
+
return j == null ? void 0 : j.icon;
|
|
905
|
+
}, f = x ? { width: x, height: x } : {};
|
|
906
|
+
return /* @__PURE__ */ e.jsx(d, { value: n, onValueChange: h, children: c.map((t) => /* @__PURE__ */ e.jsxs(o, { value: t.value, children: [
|
|
907
|
+
/* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", style: f, children: w(t.value) }),
|
|
908
|
+
/* @__PURE__ */ e.jsx("span", { children: t.label })
|
|
909
|
+
] }, t.value)) });
|
|
910
|
+
}
|
|
679
911
|
export {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
912
|
+
Ee as DataTable,
|
|
913
|
+
_e as DeleteConfirmDialog,
|
|
914
|
+
Re as TableHeader,
|
|
915
|
+
Ce as TablePagination,
|
|
916
|
+
Se as ThemeSwitcher,
|
|
917
|
+
Pe as ThemeSwitcherContent,
|
|
918
|
+
ye as cn
|
|
685
919
|
};
|
|
686
920
|
//# sourceMappingURL=index.js.map
|