@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/dist/index.js CHANGED
@@ -1,11 +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
- import { MoreVertical as de, Plus as fe, Search as me, ChevronLeft as xe, ChevronRight as he } from "lucide-react";
5
- function _e(...a) {
6
- 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));
7
7
  }
8
- var Z = { exports: {} }, B = {};
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 B;
20
+ if (re) return U;
21
21
  re = 1;
22
- var a = Symbol.for("react.transitional.element"), h = Symbol.for("react.fragment");
23
- function d(p, c, f) {
24
- var x = null;
25
- if (f !== void 0 && (x = "" + f), c.key !== void 0 && (x = "" + c.key), "key" in c) {
26
- f = {};
27
- for (var o in c)
28
- o !== "key" && (f[o] = c[o]);
29
- } else f = c;
30
- return c = f.ref, {
31
- $$typeof: a,
32
- type: p,
33
- key: x,
34
- ref: c !== void 0 ? c : null,
35
- 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
36
36
  };
37
37
  }
38
- return B.Fragment = h, B.jsx = d, B.jsxs = d, B;
38
+ return U.Fragment = h, U.jsx = c, U.jsxs = c, U;
39
39
  }
40
- var L = {};
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 a(e) {
54
- if (e == null) return null;
55
- if (typeof e == "function")
56
- return e.$$typeof === K ? null : e.displayName || e.name || null;
57
- if (typeof e == "string") return e;
58
- switch (e) {
59
- case y:
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 D:
61
+ case O:
62
62
  return "Profiler";
63
- case w:
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 Q:
69
+ case L:
70
70
  return "Activity";
71
71
  }
72
- if (typeof e == "object")
73
- switch (typeof e.tag == "number" && console.error(
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
- ), e.$$typeof) {
76
- case O:
75
+ ), r.$$typeof) {
76
+ case M:
77
77
  return "Portal";
78
- case R:
79
- return e.displayName || "Context";
78
+ case y:
79
+ return r.displayName || "Context";
80
80
  case S:
81
- return (e._context.displayName || "Context") + ".Consumer";
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
- var t = e.render;
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 a(e(t));
90
+ return n(r(s));
91
91
  } catch {
92
92
  }
93
93
  }
94
94
  return null;
95
95
  }
96
- function h(e) {
97
- return "" + e;
96
+ function h(r) {
97
+ return "" + r;
98
98
  }
99
- function d(e) {
99
+ function c(r) {
100
100
  try {
101
- h(e);
102
- var t = !1;
101
+ h(r);
102
+ var s = !1;
103
103
  } catch {
104
- t = !0;
104
+ s = !0;
105
105
  }
106
- if (t) {
107
- t = console;
108
- var n = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
109
- return n.call(
110
- 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,
111
111
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
112
- i
113
- ), h(e);
112
+ m
113
+ ), h(r);
114
114
  }
115
115
  }
116
- function p(e) {
117
- if (e === y) return "<>";
118
- if (typeof e == "object" && e !== null && e.$$typeof === I)
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 t = a(e);
122
- return t ? "<" + t + ">" : "<...>";
121
+ var s = n(r);
122
+ return s ? "<" + s + ">" : "<...>";
123
123
  } catch {
124
124
  return "<...>";
125
125
  }
126
126
  }
127
- function c() {
128
- var e = z.A;
129
- return e === null ? null : e.getOwner();
127
+ function a() {
128
+ var r = Y.A;
129
+ return r === null ? null : r.getOwner();
130
130
  }
131
- function f() {
131
+ function i() {
132
132
  return Error("react-stack-top-frame");
133
133
  }
134
- function x(e) {
135
- if (W.call(e, "key")) {
136
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
137
- 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;
138
138
  }
139
- return e.key !== void 0;
139
+ return r.key !== void 0;
140
140
  }
141
- function o(e, t) {
142
- function n() {
143
- q || (q = !0, console.error(
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
- t
145
+ s
146
146
  ));
147
147
  }
148
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
149
- get: n,
148
+ u.isReactWarning = !0, Object.defineProperty(r, "key", {
149
+ get: u,
150
150
  configurable: !0
151
151
  });
152
152
  }
153
- function T() {
154
- var e = a(this.type);
155
- 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(
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
- )), e = this.props.ref, e !== void 0 ? e : null;
157
+ )), r = this.props.ref, r !== void 0 ? r : null;
158
158
  }
159
- function m(e, t, n, i, $, M) {
160
- var u = n.ref;
161
- return e = {
162
- $$typeof: E,
163
- type: e,
164
- key: t,
165
- props: n,
166
- _owner: i
167
- }, (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", {
168
168
  enumerable: !1,
169
- get: T
170
- }) : 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", {
171
171
  configurable: !1,
172
172
  enumerable: !1,
173
173
  writable: !0,
174
174
  value: 0
175
- }), Object.defineProperty(e, "_debugInfo", {
175
+ }), Object.defineProperty(r, "_debugInfo", {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
179
  value: null
180
- }), Object.defineProperty(e, "_debugStack", {
180
+ }), Object.defineProperty(r, "_debugStack", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
184
  value: $
185
- }), Object.defineProperty(e, "_debugTask", {
185
+ }), Object.defineProperty(r, "_debugTask", {
186
186
  configurable: !1,
187
187
  enumerable: !1,
188
188
  writable: !0,
189
- value: M
190
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
189
+ value: W
190
+ }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
191
191
  }
192
- function s(e, t, n, i, $, M) {
193
- var u = t.children;
194
- if (u !== void 0)
195
- if (i)
196
- if (H(u)) {
197
- for (i = 0; i < u.length; i++)
198
- k(u[i]);
199
- 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);
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 k(u);
205
- if (W.call(t, "key")) {
206
- u = a(e);
207
- var C = Object.keys(t).filter(function(j) {
208
- return j !== "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";
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
+ 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
- i,
218
- u,
219
- C,
220
- u
221
- ), G[u + i] = !0);
217
+ m,
218
+ p,
219
+ D,
220
+ p
221
+ ), X[p + m] = !0);
222
222
  }
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;
228
- return u && o(
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
- n,
235
- c(),
230
+ typeof r == "function" ? r.displayName || r.name || "Unknown" : r
231
+ ), f(
232
+ r,
233
+ p,
234
+ u,
235
+ a(),
236
236
  $,
237
- M
237
+ W
238
238
  );
239
239
  }
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));
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 N(e) {
244
- return typeof e == "object" && e !== null && e.$$typeof === E;
243
+ function b(r) {
244
+ return typeof r == "object" && r !== null && r.$$typeof === T;
245
245
  }
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
+ 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
- b = {
250
- react_stack_bottom_frame: function(e) {
251
- return e();
249
+ v = {
250
+ react_stack_bottom_frame: function(r) {
251
+ return r();
252
252
  }
253
253
  };
254
- var q, J = {}, U = b.react_stack_bottom_frame.bind(
255
- b,
256
- f
257
- )(), A = F(p(f)), G = {};
258
- L.Fragment = y, L.jsx = function(e, t, n) {
259
- var i = 1e4 > z.recentlyCreatedOwnerStacks++;
260
- return s(
261
- e,
262
- t,
263
- n,
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
- i ? Error("react-stack-top-frame") : U,
266
- i ? F(p(e)) : A
265
+ m ? Error("react-stack-top-frame") : z,
266
+ m ? F(x(r)) : I
267
267
  );
268
- }, L.jsxs = function(e, t, n) {
269
- var i = 1e4 > z.recentlyCreatedOwnerStacks++;
270
- return s(
271
- e,
272
- t,
273
- n,
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
- i ? Error("react-stack-top-frame") : U,
276
- i ? F(p(e)) : A
275
+ m ? Error("react-stack-top-frame") : z,
276
+ m ? F(x(r)) : I
277
277
  );
278
278
  };
279
- })()), L;
279
+ })()), V;
280
280
  }
281
281
  var se;
282
282
  function ve() {
283
- return se || (se = 1, process.env.NODE_ENV === "production" ? Z.exports = pe() : Z.exports = je()), Z.exports;
283
+ return se || (se = 1, process.env.NODE_ENV === "production" ? Q.exports = pe() : Q.exports = je()), Q.exports;
284
284
  }
285
- var r = ve();
286
- function Te({
287
- data: a,
285
+ var e = ve();
286
+ function Ee({
287
+ data: n,
288
288
  loading: h = !1,
289
- columns: d,
290
- rowKey: p,
291
- emptyText: c = "暂无数据",
292
- searchActiveEmptyText: f = "未找到匹配的记录",
293
- header: x,
289
+ columns: c,
290
+ rowKey: x,
291
+ emptyText: a = "暂无数据",
292
+ searchActiveEmptyText: i = "未找到匹配的记录",
293
+ header: d,
294
294
  pagination: o,
295
- rowClassName: T,
296
- onRow: m,
297
- actions: s,
298
- components: k,
299
- renderCard: N,
300
- renderTable: b,
301
- renderActions: E
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 u, C;
304
- if (!k)
305
- 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: [
306
306
  "错误:请通过 components prop 注入 UI 组件",
307
- /* @__PURE__ */ r.jsx("br", {}),
308
- /* @__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"' })
309
309
  ] });
310
310
  const {
311
- Card: O,
312
- CardContent: y,
313
- CardFooter: w,
314
- Table: D,
311
+ Card: M,
312
+ CardContent: C,
313
+ CardFooter: R,
314
+ Table: O,
315
315
  TableBody: S,
316
- TableCell: R,
317
- TableHead: P,
318
- TableHeader: _,
316
+ TableCell: y,
317
+ TableHead: A,
318
+ TableHeader: E,
319
319
  TableRow: g,
320
- Button: V,
321
- DropdownMenu: I,
322
- DropdownMenuTrigger: Q,
320
+ Button: _,
321
+ DropdownMenu: P,
322
+ DropdownMenuTrigger: L,
323
323
  DropdownMenuContent: K,
324
- DropdownMenuItem: z,
325
- DropdownMenuSeparator: W,
326
- Skeleton: H,
324
+ DropdownMenuItem: Y,
325
+ DropdownMenuSeparator: H,
326
+ Skeleton: q,
327
327
  TableHeaderComponent: F,
328
- TablePaginationComponent: q
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: [
335
- /* @__PURE__ */ r.jsx(Q, { asChild: !0, children: /* @__PURE__ */ r.jsx(
336
- V,
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__ */ r.jsx(de, { className: "h-4 w-4" })
341
+ children: /* @__PURE__ */ e.jsx(de, { className: "h-4 w-4" })
342
342
  }
343
343
  ) }),
344
- /* @__PURE__ */ r.jsx(K, { align: "end", children: s.items.map(
345
- (v, X) => e(v) ? /* @__PURE__ */ r.jsx(W, {}, `separator-${X}`) : /* @__PURE__ */ r.jsxs(
346
- 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,
347
347
  {
348
- onClick: () => v.onClick(l, j),
349
- className: v.className,
348
+ onClick: () => k.onClick(l, N),
349
+ className: k.className,
350
350
  children: [
351
- v.icon && /* @__PURE__ */ r.jsx("span", { className: "mr-2 h-4 w-4", children: v.icon }),
352
- v.label
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-${X}`
355
+ `action-${Z}`
356
356
  )
357
357
  ) })
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(
360
- 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,
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
- A && /* @__PURE__ */ r.jsx(P, { className: "text-right font-semibold text-foreground", children: (s == null ? void 0 : s.title) || "操作" })
369
- ] }) }), i = () => h ? /* @__PURE__ */ r.jsx(S, { children: Array.from({ length: 5 }).map((l, j) => /* @__PURE__ */ r.jsxs(g, { children: [
370
- d.map((v) => /* @__PURE__ */ r.jsx(
371
- 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,
372
372
  {
373
- style: { width: v.width },
374
- className: v.align === "center" ? "text-center" : v.align === "right" ? "text-right" : "",
375
- 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" })
376
376
  },
377
- String(v.key)
377
+ String(k.key)
378
378
  )),
379
- A && /* @__PURE__ */ r.jsx(R, { children: /* @__PURE__ */ r.jsx(H, { className: "ml-auto h-4 w-8" }) })
380
- ] }, j)) }) : a.length === 0 ? /* @__PURE__ */ r.jsx(S, { children: /* @__PURE__ */ r.jsx(g, { children: /* @__PURE__ */ r.jsx(
381
- 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,
382
382
  {
383
- colSpan: d.length + (A ? 1 : 0),
383
+ colSpan: c.length + (I ? 1 : 0),
384
384
  className: "py-8 text-center text-muted-foreground",
385
- children: U ? f : c
385
+ children: z ? i : a
386
386
  }
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);
389
- return /* @__PURE__ */ r.jsxs(
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: `${le || ""} hover:bg-muted/50`,
393
- ...X,
392
+ className: `${ae || ""} hover:bg-muted/50`,
393
+ ...Z,
394
394
  children: [
395
- d.map((Y) => {
396
- const ee = l[Y.key], ne = Y.render ? Y.render(ee, l, j) : ee;
397
- return /* @__PURE__ */ r.jsx(
398
- 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,
399
399
  {
400
- className: Y.align === "center" ? "text-center" : Y.align === "right" ? "text-right" : "",
401
- children: ne
400
+ className: B.align === "center" ? "text-center" : B.align === "right" ? "text-right" : "",
401
+ children: oe
402
402
  },
403
- String(Y.key)
403
+ String(B.key)
404
404
  );
405
405
  }),
406
- A && /* @__PURE__ */ r.jsx(R, { className: "text-right", children: E ? E(l, j) : t(l, j) })
406
+ I && /* @__PURE__ */ e.jsx(y, { className: "text-right", children: T ? T(l, N) : s(l, N) })
407
407
  ]
408
408
  },
409
- v
409
+ k
410
410
  );
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 }),
414
- (o == null ? void 0 : o.show) !== !1 && o && /* @__PURE__ */ r.jsx(w, { className: "border-t py-4", children: /* @__PURE__ */ r.jsx(
415
- 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,
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: U
425
+ searchActive: z
426
426
  }
427
427
  ) })
428
- ] }), M = (l, j) => /* @__PURE__ */ r.jsxs(D, { children: [
428
+ ] }), W = (l, N) => /* @__PURE__ */ e.jsxs(O, { children: [
429
429
  l,
430
- j
430
+ N
431
431
  ] });
432
- return N ? N(
433
- b ? b(n(), i()) : M(n(), i())
432
+ return b ? b(
433
+ v ? v(u(), m()) : W(u(), m())
434
434
  ) : $(
435
- b ? b(n(), i()) : M(n(), i())
435
+ v ? v(u(), m()) : W(u(), m())
436
436
  );
437
437
  }
438
- function Re({
439
- open: a,
438
+ function _e({
439
+ open: n,
440
440
  onOpenChange: h,
441
- title: d,
442
- description: p,
443
- onConfirm: c,
444
- loading: f = !1,
445
- confirmText: x = "确认删除",
441
+ title: c,
442
+ description: x,
443
+ onConfirm: a,
444
+ loading: i = !1,
445
+ confirmText: d = "确认删除",
446
446
  cancelText: o = "取消",
447
- confirmButtonVariant: T = "destructive",
448
- verification: m,
449
- components: s,
450
- loadingIcon: k
447
+ confirmButtonVariant: w = "destructive",
448
+ verification: f,
449
+ components: t,
450
+ loadingIcon: j
451
451
  }) {
452
- const [N, b] = ie("");
453
- if (ue(() => {
454
- a && b("");
455
- }, [a, m == null ? void 0 : m.targetValue]), !s)
456
- 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 组件" });
457
457
  const {
458
- Dialog: E,
459
- DialogContent: O,
460
- DialogHeader: y,
461
- DialogFooter: w,
462
- DialogTitle: D,
458
+ Dialog: T,
459
+ DialogContent: M,
460
+ DialogHeader: C,
461
+ DialogFooter: R,
462
+ DialogTitle: O,
463
463
  DialogDescription: S,
464
- Button: R,
465
- Input: P,
466
- Label: _
467
- } = s, g = m ? N !== m.targetValue : !1, V = () => {
468
- g || c();
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__ */ 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 }) })
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
- m && /* @__PURE__ */ r.jsx("div", { className: "space-y-4 py-2", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-2", children: [
476
- /* @__PURE__ */ r.jsx(_, { htmlFor: "confirm-input", children: m.label || "请输入以确认" }),
477
- /* @__PURE__ */ r.jsx(
478
- P,
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: N,
482
- onChange: (I) => b(I.target.value),
483
- placeholder: m.placeholder,
484
- disabled: f
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__ */ r.jsxs(w, { children: [
489
- /* @__PURE__ */ r.jsx(
490
- R,
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: f,
494
+ disabled: i,
495
495
  children: o
496
496
  }
497
497
  ),
498
- /* @__PURE__ */ r.jsxs(
499
- R,
498
+ /* @__PURE__ */ e.jsxs(
499
+ y,
500
500
  {
501
- variant: T,
502
- onClick: V,
503
- disabled: g || f,
501
+ variant: w,
502
+ onClick: _,
503
+ disabled: g || i,
504
504
  children: [
505
- f && /* @__PURE__ */ r.jsx("span", { className: "mr-2", children: k || /* @__PURE__ */ r.jsxs(
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__ */ r.jsx(
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__ */ r.jsx(
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
- x
534
+ d
535
535
  ]
536
536
  }
537
537
  )
538
538
  ] })
539
539
  ] }) });
540
540
  }
541
- function ke({
542
- title: a,
541
+ function Re({
542
+ title: n,
543
543
  searchPlaceholder: h = "搜索...",
544
- searchValue: d = "",
545
- onSearchChange: p,
546
- onSearch: c,
547
- showSearch: f = !0,
548
- action: x,
544
+ searchValue: c = "",
545
+ onSearchChange: x,
546
+ onSearch: a,
547
+ showSearch: i = !0,
548
+ action: d,
549
549
  actionLabel: o,
550
- onActionClick: T,
551
- loading: m = !1,
552
- components: s
550
+ onActionClick: w,
551
+ loading: f = !1,
552
+ components: t
553
553
  }) {
554
- if (!s)
555
- return /* @__PURE__ */ r.jsx("div", { className: "p-4 text-center text-destructive", children: "错误:请通过 components prop 注入 UI 组件" });
556
- const { Input: k, Button: N } = s, b = (E) => {
557
- 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();
558
558
  };
559
- return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-4 p-1", children: [
560
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-between", children: [
561
- /* @__PURE__ */ r.jsx("div", { className: "text-lg font-semibold leading-none tracking-tight", children: a }),
562
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
563
- x && /* @__PURE__ */ r.jsx("div", { className: "flex items-center gap-2", children: x }),
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" }),
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
- f && /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
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" }),
573
- /* @__PURE__ */ r.jsx(
574
- k,
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: d,
578
- onChange: (E) => p == null ? void 0 : p(E.target.value),
579
- onKeyPress: b,
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: m
581
+ disabled: f
582
582
  }
583
583
  )
584
584
  ] }),
585
- c && /* @__PURE__ */ r.jsx(
586
- N,
585
+ a && /* @__PURE__ */ e.jsx(
586
+ b,
587
587
  {
588
- onClick: c,
589
- disabled: m,
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 we({
599
- currentPage: a,
598
+ function Ce({
599
+ currentPage: n,
600
600
  pageSize: h,
601
- total: d,
602
- onPageChange: p,
603
- onPageSizeChange: c,
604
- pageSizeOptions: f = [10, 20, 50],
605
- showPageSizeSelector: x = !0,
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: T = !1,
608
- components: m
607
+ searchActive: w = !1,
608
+ components: f
609
609
  }) {
610
- if (!m)
611
- 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 组件" });
612
612
  const {
613
- Button: s,
614
- Select: k,
615
- SelectTrigger: N,
616
- SelectContent: b,
617
- SelectItem: E,
618
- SelectValue: O
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(
620
- /* @__PURE__ */ new Set([...f, h])
621
- ).sort((_, g) => _ - g), P = x && !!c;
622
- return d === 0 ? null : /* @__PURE__ */ r.jsxs("div", { className: "flex w-full items-center justify-between", children: [
623
- o && /* @__PURE__ */ r.jsx("div", { className: "text-sm text-muted-foreground", children: T ? `找到 ${d} 条匹配记录` : d > 0 ? `显示 ${D} - ${S} 条,共 ${d} 条记录` : "暂无数据" }),
624
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
625
- P && /* @__PURE__ */ r.jsxs("div", { className: "mr-2 flex items-center gap-2", children: [
626
- /* @__PURE__ */ r.jsx("span", { className: "text-sm text-muted-foreground", children: "每页" }),
627
- /* @__PURE__ */ r.jsxs(
628
- k,
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 || !c || c(g);
631
+ onValueChange: (E) => {
632
+ const g = Number(E);
633
+ Number.isNaN(g) || g === h || !a || a(g);
634
634
  },
635
635
  children: [
636
- /* @__PURE__ */ r.jsx(N, { className: "h-8 w-[90px]", children: /* @__PURE__ */ r.jsx(O, {}) }),
637
- /* @__PURE__ */ r.jsx(b, { children: R.map((_) => /* @__PURE__ */ r.jsx(E, { value: String(_), children: _ }, _)) })
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__ */ r.jsx("span", { className: "text-sm text-muted-foreground", children: "条" })
641
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "条" })
642
642
  ] }),
643
- /* @__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: [
644
644
  "第 ",
645
- a + 1,
645
+ n + 1,
646
646
  " 页,共 ",
647
- w,
647
+ R,
648
648
  " 页"
649
649
  ] }),
650
- /* @__PURE__ */ r.jsxs(
651
- s,
650
+ /* @__PURE__ */ e.jsxs(
651
+ t,
652
652
  {
653
653
  variant: "outline",
654
654
  size: "sm",
655
- onClick: () => p(a - 1),
656
- disabled: a === 0 || w <= 1,
655
+ onClick: () => x(n - 1),
656
+ disabled: n === 0 || R <= 1,
657
657
  children: [
658
- /* @__PURE__ */ r.jsx(xe, { className: "h-4 w-4" }),
658
+ /* @__PURE__ */ e.jsx(me, { className: "h-4 w-4" }),
659
659
  "上一页"
660
660
  ]
661
661
  }
662
662
  ),
663
- /* @__PURE__ */ r.jsxs(
664
- s,
663
+ /* @__PURE__ */ e.jsxs(
664
+ t,
665
665
  {
666
666
  variant: "outline",
667
667
  size: "sm",
668
- onClick: () => p(a + 1),
669
- disabled: a >= w - 1 || w <= 1,
668
+ onClick: () => x(n + 1),
669
+ disabled: n >= R - 1 || R <= 1,
670
670
  children: [
671
671
  "下一页",
672
- /* @__PURE__ */ r.jsx(he, { className: "h-4 w-4" })
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
- Te as DataTable,
681
- Re as DeleteConfirmDialog,
682
- ke as TableHeader,
683
- we as TablePagination,
684
- _e 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
685
919
  };
686
920
  //# sourceMappingURL=index.js.map