@turinhub/atomix-common-ui 0.1.0 → 0.1.1

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