@qq1948037137/adminsmart-ui 0.1.26 → 0.1.28

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
@@ -36,7 +36,8 @@ var Button = Object.assign(wrapAntComponent(AntButton, "Button"), {
36
36
 
37
37
  // src/components/ThemeModeButton.tsx
38
38
  import { MoonOutlined, SunOutlined } from "@ant-design/icons";
39
- import { forwardRef as forwardRef2 } from "react";
39
+ import { forwardRef as forwardRef2, useEffect, useRef, useState } from "react";
40
+ import { flushSync } from "react-dom";
40
41
 
41
42
  // src/components/overlay.ts
42
43
  import { Popover as AntPopover, Tooltip as AntTooltip } from "antd";
@@ -47,14 +48,136 @@ var Tooltip = Object.assign(wrapAntComponent(AntTooltip, "Tooltip"), {
47
48
 
48
49
  // src/components/ThemeModeButton.tsx
49
50
  import { jsx } from "react/jsx-runtime";
51
+ var documentTransitions = /* @__PURE__ */ new WeakMap();
52
+ var transitionAttribute = "data-adminsmart-theme-transition";
53
+ var transitionStyles = `
54
+ /* \u53EA\u6539\u53D8\u672C\u7EC4\u4EF6\u6301\u6709\u7684\u539F\u751F\u9875\u9762\u5FEB\u7167\uFF0C\u4E0D\u7ED9\u4E1A\u52A1\u63A7\u4EF6\u65BD\u52A0\u5168\u5C40\u52A8\u753B\u3002 */
55
+ html[${transitionAttribute}]::view-transition-old(root),
56
+ html[${transitionAttribute}]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
57
+ html[${transitionAttribute}='dark']::view-transition-old(root),
58
+ html[${transitionAttribute}='light']::view-transition-new(root) { z-index: 1; }
59
+ html[${transitionAttribute}='dark']::view-transition-new(root),
60
+ html[${transitionAttribute}='light']::view-transition-old(root) { z-index: 2; }
61
+ `;
62
+ function reportThemeError(view, error) {
63
+ if (typeof view.reportError === "function") view.reportError(error);
64
+ else view.setTimeout(() => {
65
+ throw error;
66
+ }, 0);
67
+ }
68
+ function waitForThemeCommit(view) {
69
+ return new Promise((resolve) => {
70
+ let frame;
71
+ let timer;
72
+ const finish = () => {
73
+ if (frame !== void 0) view.cancelAnimationFrame?.(frame);
74
+ if (timer !== void 0) view.clearTimeout(timer);
75
+ resolve();
76
+ };
77
+ timer = view.setTimeout(finish, 100);
78
+ frame = view.requestAnimationFrame(finish);
79
+ });
80
+ }
50
81
  var ThemeModeButton = forwardRef2(
51
- function ThemeModeButton2({ mode, onModeChange, tooltipProps, onClick, ...props }, ref) {
82
+ function ThemeModeButton2({ mode, onModeChange, transition = "reveal", transitionDuration = 500, tooltipProps, onClick, ...props }, ref) {
52
83
  const nextMode = mode === "dark" ? "light" : "dark";
53
84
  const actionLabel = nextMode === "dark" ? "\u5207\u6362\u5230\u591C\u95F4\u4E3B\u9898" : "\u5207\u6362\u5230\u65E5\u95F4\u4E3B\u9898";
54
85
  const nextModeIcon = nextMode === "dark" ? /* @__PURE__ */ jsx(MoonOutlined, { "aria-hidden": true }) : /* @__PURE__ */ jsx(SunOutlined, { "aria-hidden": true });
86
+ const activeCleanup = useRef(null);
87
+ const [transitioning, setTransitioning] = useState(false);
88
+ useEffect(() => () => activeCleanup.current?.(), []);
55
89
  const handleClick = (event) => {
56
90
  onClick?.(event);
57
- if (!event.defaultPrevented) onModeChange?.(nextMode);
91
+ if (event.defaultPrevented || !onModeChange || activeCleanup.current) return;
92
+ const ownerDocument = event.currentTarget.ownerDocument;
93
+ const view = ownerDocument.defaultView;
94
+ const root = ownerDocument.documentElement;
95
+ const duration = Number.isFinite(transitionDuration) ? transitionDuration : 500;
96
+ if (documentTransitions.has(ownerDocument)) return;
97
+ if (!view || transition === "none" || duration <= 0 || view.matchMedia?.("(prefers-reduced-motion: reduce)").matches || typeof ownerDocument.startViewTransition !== "function" || typeof root.animate !== "function") {
98
+ const result = onModeChange(nextMode);
99
+ if (view) void Promise.resolve(result).catch((error) => reportThemeError(view, error));
100
+ return;
101
+ }
102
+ const bounds = event.currentTarget.getBoundingClientRect();
103
+ const x = event.detail > 0 ? event.clientX : bounds.left + bounds.width / 2;
104
+ const y = event.detail > 0 ? event.clientY : bounds.top + bounds.height / 2;
105
+ const radius = Math.hypot(Math.max(x, view.innerWidth - x), Math.max(y, view.innerHeight - y));
106
+ const previousAttribute = root.getAttribute(transitionAttribute);
107
+ const style = ownerDocument.createElement("style");
108
+ let nativeTransition;
109
+ let animation;
110
+ let cancelled = false;
111
+ let applied = false;
112
+ const cleanup = () => {
113
+ if (cancelled) return;
114
+ cancelled = true;
115
+ animation?.cancel();
116
+ nativeTransition?.skipTransition();
117
+ style.remove();
118
+ if (documentTransitions.get(ownerDocument) === cleanup) {
119
+ documentTransitions.delete(ownerDocument);
120
+ if (previousAttribute === null) root.removeAttribute(transitionAttribute);
121
+ else root.setAttribute(transitionAttribute, previousAttribute);
122
+ }
123
+ if (activeCleanup.current === cleanup) {
124
+ activeCleanup.current = null;
125
+ setTransitioning(false);
126
+ }
127
+ };
128
+ activeCleanup.current = cleanup;
129
+ documentTransitions.set(ownerDocument, cleanup);
130
+ setTransitioning(true);
131
+ style.textContent = transitionStyles;
132
+ style.dataset.adminsmartThemeTransition = "";
133
+ ownerDocument.head.appendChild(style);
134
+ root.setAttribute(transitionAttribute, nextMode);
135
+ try {
136
+ nativeTransition = ownerDocument.startViewTransition(async () => {
137
+ if (cancelled) return;
138
+ applied = true;
139
+ let result = void 0;
140
+ try {
141
+ flushSync(() => {
142
+ result = onModeChange(nextMode);
143
+ });
144
+ await result;
145
+ if (!cancelled && typeof view.requestAnimationFrame === "function") {
146
+ await waitForThemeCommit(view);
147
+ }
148
+ } catch (error) {
149
+ reportThemeError(view, error);
150
+ throw error;
151
+ }
152
+ });
153
+ void nativeTransition.updateCallbackDone.catch(() => void 0);
154
+ void nativeTransition.ready.then(() => {
155
+ if (cancelled) return;
156
+ const clipPath = [`circle(0px at ${x}px ${y}px)`, `circle(${radius}px at ${x}px ${y}px)`];
157
+ animation = root.animate({ clipPath: nextMode === "dark" ? clipPath : clipPath.reverse() }, {
158
+ duration,
159
+ // 宿主可调整节奏,不替换主题算法。
160
+ easing: "ease-in",
161
+ // 与 Ant 官网圆形过渡保持同类节奏。
162
+ pseudoElement: nextMode === "dark" ? "::view-transition-new(root)" : "::view-transition-old(root)"
163
+ // 只处理深色快照。
164
+ });
165
+ return animation.finished;
166
+ }).catch(() => {
167
+ if (!cancelled && !applied) {
168
+ applied = true;
169
+ const result = onModeChange(nextMode);
170
+ void Promise.resolve(result).catch((error) => reportThemeError(view, error));
171
+ }
172
+ }).finally(cleanup).catch((error) => reportThemeError(view, error));
173
+ void nativeTransition.finished.catch(() => void 0).finally(cleanup);
174
+ } catch {
175
+ cleanup();
176
+ if (!applied) {
177
+ const result = onModeChange(nextMode);
178
+ void Promise.resolve(result).catch((error) => reportThemeError(view, error));
179
+ }
180
+ }
58
181
  };
59
182
  return /* @__PURE__ */ jsx(Tooltip, { title: actionLabel, ...tooltipProps, children: /* @__PURE__ */ jsx(
60
183
  Button,
@@ -64,8 +187,11 @@ var ThemeModeButton = forwardRef2(
64
187
  icon: nextModeIcon,
65
188
  "aria-label": actionLabel,
66
189
  "aria-pressed": mode === "dark",
190
+ "aria-busy": transitioning || void 0,
67
191
  ...props,
192
+ style: { minWidth: 44, minHeight: 44, ...props.style },
68
193
  ref,
194
+ disabled: transitioning ? true : props.disabled,
69
195
  onClick: handleClick
70
196
  }
71
197
  ) });
@@ -479,7 +605,7 @@ var BusinessDrawer = forwardRef3(function BusinessDrawer2({ sizeVariant = "stand
479
605
  });
480
606
 
481
607
  // src/composites/SessionReplay.tsx
482
- import { forwardRef as forwardRef4, useCallback as useCallback2, useEffect as useEffect2, useImperativeHandle, useRef as useRef2, useState as useState2 } from "react";
608
+ import { forwardRef as forwardRef4, useCallback as useCallback2, useEffect as useEffect3, useImperativeHandle, useRef as useRef3, useState as useState3 } from "react";
483
609
  import { FullscreenExitOutlined, FullscreenOutlined, PauseOutlined, PlayCircleOutlined, RedoOutlined, StepBackwardOutlined, StepForwardOutlined } from "@ant-design/icons";
484
610
  import { Alert as Alert2, Button as Button2, Empty as Empty2, Select as Select2, Slider as Slider2, Spin as Spin2, Tag as Tag2, Tooltip as Tooltip2, Typography as Typography2, theme } from "antd";
485
611
 
@@ -630,7 +756,7 @@ function replayClock(timeMs) {
630
756
  }
631
757
 
632
758
  // src/composites/useSessionReplay.ts
633
- import { useCallback, useEffect, useRef, useState } from "react";
759
+ import { useCallback, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
634
760
 
635
761
  // src/composites/sessionReplayEngine.ts
636
762
  async function loadReplayEngine() {
@@ -654,20 +780,20 @@ function initialState(status) {
654
780
  };
655
781
  }
656
782
  function useSessionReplay(options) {
657
- const [state, setState] = useState(() => initialState("idle"));
658
- const stateRef = useRef(state);
659
- const engineRef = useRef(null);
660
- const runtimeFailureRef = useRef(null);
661
- const rangeRef = useRef(replayRange(0));
662
- const replayEventsRef = useRef([]);
663
- const callbackRef = useRef(options);
783
+ const [state, setState] = useState2(() => initialState("idle"));
784
+ const stateRef = useRef2(state);
785
+ const engineRef = useRef2(null);
786
+ const runtimeFailureRef = useRef2(null);
787
+ const rangeRef = useRef2(replayRange(0));
788
+ const replayEventsRef = useRef2([]);
789
+ const callbackRef = useRef2(options);
664
790
  callbackRef.current = options;
665
791
  const publish = useCallback((next) => {
666
792
  stateRef.current = next;
667
793
  setState(next);
668
794
  callbackRef.current.onStateChange?.({ ...next });
669
795
  }, []);
670
- useEffect(() => {
796
+ useEffect2(() => {
671
797
  const { active, loading, error, events, stageRef, rootRef, startOffsetMs, endOffsetMs, autoPlay } = options;
672
798
  engineRef.current = null;
673
799
  runtimeFailureRef.current = null;
@@ -938,16 +1064,16 @@ import { jsx as jsx4, jsxs } from "react/jsx-runtime";
938
1064
  var playbackRates = [0.5, 1, 1.5, 2];
939
1065
  var SessionReplay = forwardRef4(function SessionReplay2({ events, active = true, loading = false, error, startOffsetMs, endOffsetMs, autoPlay = false, markers = [], extra, onStateChange, onError, className, style }, ref) {
940
1066
  const { token } = theme.useToken();
941
- const containerRef = useRef2(null);
942
- const stageRef = useRef2(null);
943
- const rootRef = useRef2(null);
944
- const [problem, setProblem] = useState2(null);
945
- const [fullscreen, setFullscreen] = useState2(false);
1067
+ const containerRef = useRef3(null);
1068
+ const stageRef = useRef3(null);
1069
+ const rootRef = useRef3(null);
1070
+ const [problem, setProblem] = useState3(null);
1071
+ const [fullscreen, setFullscreen] = useState3(false);
946
1072
  const reportError = useCallback2((value) => {
947
1073
  setProblem(value);
948
1074
  onError?.(value);
949
1075
  }, [onError]);
950
- useEffect2(() => {
1076
+ useEffect3(() => {
951
1077
  setProblem(null);
952
1078
  }, [events, active, loading, error, startOffsetMs, endOffsetMs]);
953
1079
  const controls = useSessionReplay({ events, active, loading, error, startOffsetMs, endOffsetMs, autoPlay, stageRef, rootRef, onStateChange, onError: reportError });
@@ -975,7 +1101,7 @@ var SessionReplay = forwardRef4(function SessionReplay2({ events, active = true,
975
1101
  ...style
976
1102
  };
977
1103
  useImperativeHandle(ref, () => ({ play, pause, seek, restart, getState }), [play, pause, seek, restart, getState]);
978
- useEffect2(() => {
1104
+ useEffect3(() => {
979
1105
  if (!active) return;
980
1106
  const container = containerRef.current;
981
1107
  const sync = () => setFullscreen(document.fullscreenElement === container);
@@ -1078,9 +1204,9 @@ import {
1078
1204
  Children,
1079
1205
  forwardRef as forwardRef5,
1080
1206
  isValidElement,
1081
- useEffect as useEffect3,
1082
- useRef as useRef3,
1083
- useState as useState3
1207
+ useEffect as useEffect4,
1208
+ useRef as useRef4,
1209
+ useState as useState4
1084
1210
  } from "react";
1085
1211
 
1086
1212
  // src/composites/searchPanelModel.ts
@@ -1094,15 +1220,15 @@ function collapsedSearchFieldLimit(columns) {
1094
1220
  // src/composites/SearchPanel.tsx
1095
1221
  import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
1096
1222
  var SearchPanel = forwardRef5(function SearchPanel2({ fields, actions, tools, trailingTools, searchVisible = true, defaultExpanded = false, role = "search", style, ...props }, ref) {
1097
- const rootRef = useRef3(null);
1098
- const [width, setWidth] = useState3(0);
1099
- const [expanded, setExpanded] = useState3(defaultExpanded);
1223
+ const rootRef = useRef4(null);
1224
+ const [width, setWidth] = useState4(0);
1225
+ const [expanded, setExpanded] = useState4(defaultExpanded);
1100
1226
  const items = Children.toArray(fields);
1101
1227
  const columns = searchColumnCount(width);
1102
1228
  const collapsedLimit = collapsedSearchFieldLimit(columns);
1103
1229
  const hasMore = items.length > collapsedLimit;
1104
1230
  const fieldWidth = Math.min(240, Math.max(0, width));
1105
- useEffect3(() => {
1231
+ useEffect4(() => {
1106
1232
  const element = rootRef.current;
1107
1233
  if (!element) return void 0;
1108
1234
  const update = () => {
@@ -1165,14 +1291,131 @@ var SearchPanel = forwardRef5(function SearchPanel2({ fields, actions, tools, tr
1165
1291
  ] });
1166
1292
  });
1167
1293
 
1294
+ // src/composites/TableControls.tsx
1295
+ import { ReloadOutlined, SearchOutlined, SettingOutlined } from "@ant-design/icons";
1296
+ import { useId, useRef as useRef5, useState as useState5 } from "react";
1297
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
1298
+ function TableControls({
1299
+ searchVisible = true,
1300
+ onSearchVisibleChange,
1301
+ onRefresh,
1302
+ refreshing = false,
1303
+ columns = [],
1304
+ visibleColumns,
1305
+ onVisibleColumnsChange,
1306
+ className,
1307
+ style
1308
+ }) {
1309
+ const [open, setOpen] = useState5(false);
1310
+ const triggerRef = useRef5(null);
1311
+ const panelRef = useRef5(null);
1312
+ const panelId = useId();
1313
+ const editable = columns.filter((column) => !column.disabled);
1314
+ const visible = new Set(visibleColumns ?? columns.map((column) => column.key));
1315
+ const checkedCount = editable.filter((column) => visible.has(column.key)).length;
1316
+ const canSetColumns = editable.length > 0 && Boolean(onVisibleColumnsChange);
1317
+ const searchLabel = searchVisible ? "\u9690\u85CF\u641C\u7D22" : "\u663E\u793A\u641C\u7D22";
1318
+ const setVisible = (keys, checked) => {
1319
+ const next = new Set(visible);
1320
+ for (const key of keys) {
1321
+ if (checked) next.add(key);
1322
+ else next.delete(key);
1323
+ }
1324
+ onVisibleColumnsChange?.(columns.filter((column) => next.has(column.key)).map((column) => column.key));
1325
+ };
1326
+ const closeOnEscape = (event) => {
1327
+ if (event.key !== "Escape") return;
1328
+ event.stopPropagation();
1329
+ setOpen(false);
1330
+ triggerRef.current?.focus();
1331
+ };
1332
+ const panelStyle = {
1333
+ display: "grid",
1334
+ gap: 8,
1335
+ minWidth: 120,
1336
+ maxWidth: "min(320px, calc(100vw - 32px))",
1337
+ maxHeight: "min(380px, 60vh)",
1338
+ overflow: "auto"
1339
+ };
1340
+ return /* @__PURE__ */ jsxs3("div", { className, style: { display: "inline-flex", alignItems: "center", flexShrink: 0, gap: 8, ...style }, children: [
1341
+ /* @__PURE__ */ jsx6(Tooltip, { title: searchLabel, children: /* @__PURE__ */ jsx6(
1342
+ Button,
1343
+ {
1344
+ icon: /* @__PURE__ */ jsx6(SearchOutlined, { "aria-hidden": "true" }),
1345
+ "aria-label": searchLabel,
1346
+ "aria-pressed": searchVisible,
1347
+ disabled: !onSearchVisibleChange,
1348
+ onClick: () => onSearchVisibleChange?.(!searchVisible)
1349
+ }
1350
+ ) }),
1351
+ /* @__PURE__ */ jsx6(Tooltip, { title: "\u5237\u65B0\u5217\u8868", children: /* @__PURE__ */ jsx6(
1352
+ Button,
1353
+ {
1354
+ icon: /* @__PURE__ */ jsx6(ReloadOutlined, { "aria-hidden": "true" }),
1355
+ "aria-label": "\u5237\u65B0\u5217\u8868",
1356
+ loading: refreshing,
1357
+ disabled: !onRefresh || refreshing,
1358
+ onClick: onRefresh
1359
+ }
1360
+ ) }),
1361
+ /* @__PURE__ */ jsx6(
1362
+ Popover,
1363
+ {
1364
+ trigger: "click",
1365
+ placement: "bottomRight",
1366
+ title: "\u8BBE\u7F6E\u663E\u793A\u5217",
1367
+ open: canSetColumns && open,
1368
+ onOpenChange: (next) => setOpen(canSetColumns && next),
1369
+ afterOpenChange: (opened) => {
1370
+ if (opened) panelRef.current?.querySelector("input:not(:disabled)")?.focus();
1371
+ },
1372
+ content: /* @__PURE__ */ jsxs3("div", { ref: panelRef, id: panelId, role: "dialog", "aria-label": "\u8BBE\u7F6E\u663E\u793A\u5217", onKeyDown: closeOnEscape, style: panelStyle, children: [
1373
+ /* @__PURE__ */ jsx6(
1374
+ Checkbox,
1375
+ {
1376
+ checked: checkedCount === editable.length,
1377
+ indeterminate: checkedCount > 0 && checkedCount < editable.length,
1378
+ onChange: (event) => setVisible(editable.map((column) => column.key), event.target.checked),
1379
+ children: "\u663E\u793A\u5168\u90E8\u53EF\u9009\u5217"
1380
+ }
1381
+ ),
1382
+ columns.map((column) => /* @__PURE__ */ jsx6(
1383
+ Checkbox,
1384
+ {
1385
+ checked: visible.has(column.key),
1386
+ disabled: column.disabled,
1387
+ onChange: (event) => setVisible([column.key], event.target.checked),
1388
+ children: column.label
1389
+ },
1390
+ column.key
1391
+ ))
1392
+ ] }),
1393
+ children: /* @__PURE__ */ jsx6(
1394
+ Button,
1395
+ {
1396
+ ref: triggerRef,
1397
+ icon: /* @__PURE__ */ jsx6(SettingOutlined, { "aria-hidden": "true" }),
1398
+ "aria-label": "\u8BBE\u7F6E\u663E\u793A\u5217",
1399
+ "aria-haspopup": "dialog",
1400
+ "aria-expanded": canSetColumns && open,
1401
+ "aria-controls": canSetColumns && open ? panelId : void 0,
1402
+ disabled: !canSetColumns,
1403
+ onKeyDown: open ? closeOnEscape : void 0
1404
+ }
1405
+ )
1406
+ }
1407
+ )
1408
+ ] });
1409
+ }
1410
+
1168
1411
  // src/composites/DataTable.tsx
1169
1412
  import {
1170
1413
  forwardRef as forwardRef6,
1171
1414
  useLayoutEffect,
1172
- useRef as useRef4,
1173
- useState as useState4
1415
+ useRef as useRef6,
1416
+ useState as useState6
1174
1417
  } from "react";
1175
- import { jsx as jsx6 } from "react/jsx-runtime";
1418
+ import { jsx as jsx7 } from "react/jsx-runtime";
1176
1419
  function tableBodyHeight(availableHeight, chromeHeight) {
1177
1420
  return Math.max(0, Math.floor(availableHeight - chromeHeight - 16));
1178
1421
  }
@@ -1193,8 +1436,8 @@ function DataTableInner({
1193
1436
  scroll,
1194
1437
  ...tableProps
1195
1438
  }, ref) {
1196
- const containerRef = useRef4(null);
1197
- const [bodyHeight, setBodyHeight] = useState4(360);
1439
+ const containerRef = useRef6(null);
1440
+ const [bodyHeight, setBodyHeight] = useState6(360);
1198
1441
  const hasExplicitHeight = containerHeight != null || containerStyle?.height != null;
1199
1442
  useLayoutEffect(() => {
1200
1443
  const container = containerRef.current;
@@ -1230,14 +1473,14 @@ function DataTableInner({
1230
1473
  y: scroll?.y ?? bodyHeight
1231
1474
  };
1232
1475
  const tablePagination = pagination === false ? false : pagination?.placement || pagination?.position ? pagination : { placement: ["bottomEnd"], ...pagination };
1233
- return /* @__PURE__ */ jsx6(
1476
+ return /* @__PURE__ */ jsx7(
1234
1477
  "div",
1235
1478
  {
1236
1479
  ref: containerRef,
1237
1480
  className: containerClassName,
1238
1481
  "data-adminsmart-data-table": "true",
1239
1482
  style: { width: "100%", minWidth: 0, overflowX: "hidden", ...containerHeight == null ? {} : { height: containerHeight, overflowY: "hidden" }, ...containerStyle },
1240
- children: /* @__PURE__ */ jsx6(
1483
+ children: /* @__PURE__ */ jsx7(
1241
1484
  Table,
1242
1485
  {
1243
1486
  ...tableProps,
@@ -1253,7 +1496,7 @@ var DataTable = forwardRef6(DataTableInner);
1253
1496
 
1254
1497
  // src/composites/WorkspaceLayout.tsx
1255
1498
  import { theme as theme2 } from "antd";
1256
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
1499
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1257
1500
  var LIGHT_WORKSPACE_BACKGROUND = "#f6f9fe";
1258
1501
  function WorkspaceLayout({
1259
1502
  header,
@@ -1285,10 +1528,10 @@ function WorkspaceLayout({
1285
1528
  "--adminsmart-workspace-bg": themeMode === "dark" ? token.colorBgLayout : LIGHT_WORKSPACE_BACKGROUND
1286
1529
  // 夜间不复用日间固定底色。
1287
1530
  };
1288
- return /* @__PURE__ */ jsxs3(Layout, { className: rootClassName, style: workspaceStyle, "data-theme-mode": themeMode, children: [
1289
- /* @__PURE__ */ jsx7("header", { className: "adminsmart-workspace__header", children: header }),
1290
- /* @__PURE__ */ jsxs3(Layout, { className: "adminsmart-workspace__body", children: [
1291
- /* @__PURE__ */ jsx7(
1531
+ return /* @__PURE__ */ jsxs4(Layout, { className: rootClassName, style: workspaceStyle, "data-theme-mode": themeMode, children: [
1532
+ /* @__PURE__ */ jsx8("header", { className: "adminsmart-workspace__header", children: header }),
1533
+ /* @__PURE__ */ jsxs4(Layout, { className: "adminsmart-workspace__body", children: [
1534
+ /* @__PURE__ */ jsx8(
1292
1535
  Layout.Sider,
1293
1536
  {
1294
1537
  theme: themeMode,
@@ -1300,9 +1543,9 @@ function WorkspaceLayout({
1300
1543
  children: sidebar
1301
1544
  }
1302
1545
  ),
1303
- /* @__PURE__ */ jsxs3(Layout, { className: "adminsmart-workspace__main", children: [
1546
+ /* @__PURE__ */ jsxs4(Layout, { className: "adminsmart-workspace__main", children: [
1304
1547
  tabs,
1305
- /* @__PURE__ */ jsx7(Layout.Content, { className: contentClasses, "data-content-mode": contentMode, children }),
1548
+ /* @__PURE__ */ jsx8(Layout.Content, { className: contentClasses, "data-content-mode": contentMode, children }),
1306
1549
  footer
1307
1550
  ] })
1308
1551
  ] })
@@ -1310,7 +1553,7 @@ function WorkspaceLayout({
1310
1553
  }
1311
1554
 
1312
1555
  // src/composites/CrudScaffold.tsx
1313
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1556
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
1314
1557
  function CrudScaffold({
1315
1558
  label,
1316
1559
  description,
@@ -1322,16 +1565,16 @@ function CrudScaffold({
1322
1565
  ...props
1323
1566
  }) {
1324
1567
  const classes = ["adminsmart-crud", className].filter(Boolean).join(" ");
1325
- return /* @__PURE__ */ jsxs4("main", { ...props, className: classes, "aria-label": label, "aria-description": description, children: [
1326
- /* @__PURE__ */ jsx8("div", { className: "adminsmart-crud__filters", children: filters }),
1327
- status ? /* @__PURE__ */ jsx8("div", { className: "adminsmart-crud__status", children: status }) : null,
1328
- /* @__PURE__ */ jsx8("div", { className: "adminsmart-crud__results", children: results }),
1568
+ return /* @__PURE__ */ jsxs5("main", { ...props, className: classes, "aria-label": label, "aria-description": description, children: [
1569
+ /* @__PURE__ */ jsx9("div", { className: "adminsmart-crud__filters", children: filters }),
1570
+ status ? /* @__PURE__ */ jsx9("div", { className: "adminsmart-crud__status", children: status }) : null,
1571
+ /* @__PURE__ */ jsx9("div", { className: "adminsmart-crud__results", children: results }),
1329
1572
  drawer
1330
1573
  ] });
1331
1574
  }
1332
1575
 
1333
1576
  // src/composites/EllipsisText.tsx
1334
- import { jsx as jsx9 } from "react/jsx-runtime";
1577
+ import { jsx as jsx10 } from "react/jsx-runtime";
1335
1578
  function EllipsisText({
1336
1579
  children,
1337
1580
  maxWidth = 240,
@@ -1343,7 +1586,7 @@ function EllipsisText({
1343
1586
  const classes = ["adminsmart-ellipsis-text", className].filter(Boolean).join(" ");
1344
1587
  const widthValue = typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth;
1345
1588
  const textStyle = { "--adminsmart-ellipsis-width": widthValue, ...style };
1346
- return /* @__PURE__ */ jsx9(
1589
+ return /* @__PURE__ */ jsx10(
1347
1590
  Typography.Text,
1348
1591
  {
1349
1592
  ...props,
@@ -1358,7 +1601,7 @@ function EllipsisText({
1358
1601
  // src/composites/RowActions.tsx
1359
1602
  import { EllipsisOutlined } from "@ant-design/icons";
1360
1603
  import { Children as Children2, Fragment, isValidElement as isValidElement2 } from "react";
1361
- import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
1604
+ import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
1362
1605
  function collectButtons(children) {
1363
1606
  const actions = [];
1364
1607
  Children2.forEach(children, (child) => {
@@ -1389,9 +1632,9 @@ function RowActions({ children, maxVisible = 2, moreLabel = "\u66F4\u591A\u64CD\
1389
1632
  // 菜单仍按官方语义标识需要确认的动作。
1390
1633
  }));
1391
1634
  const classes = ["adminsmart-row-action-group", className].filter(Boolean).join(" ");
1392
- return /* @__PURE__ */ jsxs5(Space, { ...props, className: classes, size, wrap, children: [
1635
+ return /* @__PURE__ */ jsxs6(Space, { ...props, className: classes, size, wrap, children: [
1393
1636
  direct,
1394
- overflow.length > 0 && /* @__PURE__ */ jsx10(
1637
+ overflow.length > 0 && /* @__PURE__ */ jsx11(
1395
1638
  Dropdown,
1396
1639
  {
1397
1640
  trigger: ["click"],
@@ -1403,12 +1646,12 @@ function RowActions({ children, maxVisible = 2, moreLabel = "\u66F4\u591A\u64CD\
1403
1646
  action.props.onClick?.(domEvent);
1404
1647
  }
1405
1648
  },
1406
- children: /* @__PURE__ */ jsx10(Tooltip, { title: moreLabel, children: /* @__PURE__ */ jsx10(
1649
+ children: /* @__PURE__ */ jsx11(Tooltip, { title: moreLabel, children: /* @__PURE__ */ jsx11(
1407
1650
  Button,
1408
1651
  {
1409
1652
  type: "text",
1410
1653
  size: "small",
1411
- icon: /* @__PURE__ */ jsx10(EllipsisOutlined, {}),
1654
+ icon: /* @__PURE__ */ jsx11(EllipsisOutlined, {}),
1412
1655
  "aria-label": moreLabel,
1413
1656
  "aria-haspopup": "menu",
1414
1657
  "data-adminsmart-row-more": "true",
@@ -1605,7 +1848,7 @@ function schemaInitialValues(schema) {
1605
1848
  }
1606
1849
 
1607
1850
  // src/schema/SchemaForm.tsx
1608
- import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
1851
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
1609
1852
  function fieldRules(field) {
1610
1853
  const rules = [];
1611
1854
  if (field.required) {
@@ -1650,32 +1893,32 @@ function dateItemProps(field) {
1650
1893
  function renderControl(field) {
1651
1894
  switch (field.type) {
1652
1895
  case "input":
1653
- return /* @__PURE__ */ jsx11(Input, { placeholder: field.placeholder });
1896
+ return /* @__PURE__ */ jsx12(Input, { placeholder: field.placeholder });
1654
1897
  case "password":
1655
- return /* @__PURE__ */ jsx11(Input.Password, { placeholder: field.placeholder });
1898
+ return /* @__PURE__ */ jsx12(Input.Password, { placeholder: field.placeholder });
1656
1899
  case "textarea":
1657
- return /* @__PURE__ */ jsx11(Input.TextArea, { placeholder: field.placeholder });
1900
+ return /* @__PURE__ */ jsx12(Input.TextArea, { placeholder: field.placeholder });
1658
1901
  case "number":
1659
- return /* @__PURE__ */ jsx11(InputNumber, { placeholder: field.placeholder, min: field.validation?.min, max: field.validation?.max, style: { width: "100%" } });
1902
+ return /* @__PURE__ */ jsx12(InputNumber, { placeholder: field.placeholder, min: field.validation?.min, max: field.validation?.max, style: { width: "100%" } });
1660
1903
  case "select":
1661
- return /* @__PURE__ */ jsx11(Select, { placeholder: field.placeholder, options: field.options });
1904
+ return /* @__PURE__ */ jsx12(Select, { placeholder: field.placeholder, options: field.options });
1662
1905
  case "radio":
1663
- return /* @__PURE__ */ jsx11(Radio.Group, { options: field.options });
1906
+ return /* @__PURE__ */ jsx12(Radio.Group, { options: field.options });
1664
1907
  case "checkbox":
1665
- return /* @__PURE__ */ jsx11(Checkbox, {});
1908
+ return /* @__PURE__ */ jsx12(Checkbox, {});
1666
1909
  case "switch":
1667
- return /* @__PURE__ */ jsx11(Switch, {});
1910
+ return /* @__PURE__ */ jsx12(Switch, {});
1668
1911
  case "date":
1669
- return /* @__PURE__ */ jsx11(DatePicker, { placeholder: field.placeholder, style: { width: "100%" } });
1912
+ return /* @__PURE__ */ jsx12(DatePicker, { placeholder: field.placeholder, style: { width: "100%" } });
1670
1913
  case "dateRange":
1671
- return /* @__PURE__ */ jsx11(DatePicker.RangePicker, { placeholder: field.placeholder ? [field.placeholder, field.placeholder] : void 0, style: { width: "100%" } });
1914
+ return /* @__PURE__ */ jsx12(DatePicker.RangePicker, { placeholder: field.placeholder ? [field.placeholder, field.placeholder] : void 0, style: { width: "100%" } });
1672
1915
  }
1673
1916
  }
1674
1917
  var SchemaForm = forwardRef7(function SchemaForm2({ schema, onSubmit, onChange, onFinish, onValuesChange, initialValues, layout = "vertical", ...formProps }, ref) {
1675
1918
  const result = validateSchemaForm(schema);
1676
1919
  if (!result.valid) throw new Error(`SchemaForm \u914D\u7F6E\u65E0\u6548\uFF1A${result.errors.map((issue) => `${issue.path} ${issue.message}`).join("\uFF1B")}`);
1677
1920
  const defaults = schemaInitialValues(schema);
1678
- return /* @__PURE__ */ jsxs6(
1921
+ return /* @__PURE__ */ jsxs7(
1679
1922
  Form,
1680
1923
  {
1681
1924
  ...formProps,
@@ -1693,7 +1936,7 @@ var SchemaForm = forwardRef7(function SchemaForm2({ schema, onSubmit, onChange,
1693
1936
  children: [
1694
1937
  schema.fields.map((field) => {
1695
1938
  const mapped = mapSchemaField(field);
1696
- return /* @__PURE__ */ jsx11(
1939
+ return /* @__PURE__ */ jsx12(
1697
1940
  Form.Item,
1698
1941
  {
1699
1942
  name: mapped.name,
@@ -1706,7 +1949,7 @@ var SchemaForm = forwardRef7(function SchemaForm2({ schema, onSubmit, onChange,
1706
1949
  mapped.name
1707
1950
  );
1708
1951
  }),
1709
- /* @__PURE__ */ jsx11(Form.Item, { children: /* @__PURE__ */ jsx11(Button, { type: "primary", htmlType: "submit", children: schema.submitText ?? "\u63D0\u4EA4" }) })
1952
+ /* @__PURE__ */ jsx12(Form.Item, { children: /* @__PURE__ */ jsx12(Button, { type: "primary", htmlType: "submit", children: schema.submitText ?? "\u63D0\u4EA4" }) })
1710
1953
  ]
1711
1954
  }
1712
1955
  );
@@ -1781,6 +2024,7 @@ export {
1781
2024
  Steps,
1782
2025
  Switch,
1783
2026
  Table,
2027
+ TableControls,
1784
2028
  TableEmpty,
1785
2029
  Tabs,
1786
2030
  Tag,