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