@qq1948037137/adminsmart-ui 0.1.29 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -51,7 +51,7 @@ function Example() {
51
51
 
52
52
  `Pagination`、`Table`、`DataTable` 和显式启用分页的 `List` 默认显示 `共 N 条`,数量来自 Ant 的本地数据总数或业务传入的 `total`,不会把当前页行数当作完整数量。原生 `showTotal={(total, range) => ...}` 可自定义总数文案,显式 `showTotal={undefined}` 可隐藏;表格和列表仍可通过 `pagination={false}` 关闭分页。页码、每页条数、回调、ref 和原生公开类型继续保留,列表未配置分页时不会额外开启分页。
53
53
 
54
- 将 `TableControls` 放在 `SearchPanel.trailingTools`,将新增、导出等业务操作放在 `SearchPanel.tools`。右侧始终按搜索显隐、刷新、选择列排列。宿主控制搜索显隐、加载和可见列,并可声明不可切换的列。组件示例展示如何连接搜索状态和表格列。
54
+ 用 `ReportErrorProvider` 在应用入口绑定问题上报行为。`OperationToolbar` 将「问题上报」放在新增、导出等左侧业务操作之后,右侧的 `TableControls` 依次提供搜索显隐、刷新和选择列。`SearchPanel.tools/trailingTools` 和 `CrudWorkspace.actions/controls` 会使用同一个操作栏。没有列表工具栏的页面可使用 `ErrorReportButton`。上报中通过文字展示进度并阻止重复提交,`description` 供辅助技术读取。宿主负责采集范围、脱敏、请求和结果反馈。
55
55
 
56
56
  在 `WorkspaceLayout contentMode="table"` 的内容区嵌入 `CrudWorkspace`,可使用独立的筛选、操作栏、反馈与页脚插槽,`DataTable` 自动填满剩余区域。结果超出高度时在表体内滚动,分页仍保持可见。文档站的「CrudWorkspace 标准 CRUD 工作区」展示同一布局中的搜索、刷新、显隐列、新建、编辑和删除。
57
57
 
package/dist/index.cjs CHANGED
@@ -62,6 +62,7 @@ __export(src_exports, {
62
62
  Dropdown: () => Dropdown,
63
63
  EllipsisText: () => EllipsisText,
64
64
  Empty: () => Empty,
65
+ ErrorReportButton: () => ErrorReportButton,
65
66
  Flex: () => Flex,
66
67
  FloatButton: () => FloatButton,
67
68
  Form: () => Form,
@@ -76,6 +77,7 @@ __export(src_exports, {
76
77
  Mentions: () => Mentions,
77
78
  Menu: () => Menu,
78
79
  Modal: () => Modal,
80
+ OperationToolbar: () => OperationToolbar,
79
81
  Pagination: () => Pagination,
80
82
  Popconfirm: () => Popconfirm,
81
83
  Popover: () => Popover,
@@ -83,6 +85,7 @@ __export(src_exports, {
83
85
  QRCode: () => QRCode,
84
86
  Radio: () => Radio,
85
87
  Rate: () => Rate,
88
+ ReportErrorProvider: () => ReportErrorProvider,
86
89
  Result: () => Result,
87
90
  Row: () => Row,
88
91
  RowActions: () => RowActions,
@@ -1293,7 +1296,66 @@ var SessionReplay = (0, import_react6.forwardRef)(function SessionReplay2({ even
1293
1296
 
1294
1297
  // src/composites/SearchPanel.tsx
1295
1298
  var import_icons3 = require("@ant-design/icons");
1299
+ var import_react9 = require("react");
1300
+
1301
+ // src/composites/OperationToolbar.tsx
1302
+ var import_react8 = require("react");
1303
+
1304
+ // src/composites/ErrorReportButton.tsx
1296
1305
  var import_react7 = require("react");
1306
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1307
+ function ErrorReportButton({
1308
+ onReport,
1309
+ disabled = false,
1310
+ onReportFailure,
1311
+ description
1312
+ }) {
1313
+ const pending = (0, import_react7.useRef)(false);
1314
+ const [reporting, setReporting] = (0, import_react7.useState)(false);
1315
+ async function report() {
1316
+ if (disabled || pending.current) return;
1317
+ pending.current = true;
1318
+ setReporting(true);
1319
+ try {
1320
+ await onReport();
1321
+ } catch (error) {
1322
+ onReportFailure?.(error);
1323
+ } finally {
1324
+ pending.current = false;
1325
+ setReporting(false);
1326
+ }
1327
+ }
1328
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1329
+ Button,
1330
+ {
1331
+ "data-adminsmart-error-report": "true",
1332
+ "aria-description": description,
1333
+ "aria-busy": reporting || void 0,
1334
+ disabled: disabled || reporting,
1335
+ onClick: report,
1336
+ children: reporting ? "\u4E0A\u62A5\u4E2D\u2026" : "\u95EE\u9898\u4E0A\u62A5"
1337
+ }
1338
+ );
1339
+ }
1340
+
1341
+ // src/composites/OperationToolbar.tsx
1342
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1343
+ var ReportErrorContext = (0, import_react8.createContext)(void 0);
1344
+ function ReportErrorProvider({ children, ...config }) {
1345
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ReportErrorContext.Provider, { value: config, children });
1346
+ }
1347
+ function OperationToolbar({ actions, controls, errorReport, style, ...props }) {
1348
+ const providedReport = (0, import_react8.useContext)(ReportErrorContext);
1349
+ const report = errorReport === false ? void 0 : errorReport ?? providedReport;
1350
+ if (actions == null && controls == null && !report) return null;
1351
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Flex, { ...props, align: "center", wrap: true, gap: 12, "data-adminsmart-toolbar-row": "true", style: { width: "100%", minWidth: 0, ...style }, children: [
1352
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Flex, { align: "center", wrap: true, gap: 12, role: "group", "aria-label": "\u529F\u80FD\u64CD\u4F5C", "data-adminsmart-toolbar-actions": "true", style: { minWidth: 0, minHeight: 32 }, children: [
1353
+ actions,
1354
+ report && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorReportButton, { ...report })
1355
+ ] }),
1356
+ controls != null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Flex, { align: "center", wrap: true, gap: 12, role: "group", "aria-label": "\u8868\u683C\u5DE5\u5177", style: { minWidth: 0, marginInlineStart: "auto", minHeight: 32 }, children: controls })
1357
+ ] });
1358
+ }
1297
1359
 
1298
1360
  // src/composites/searchPanelModel.ts
1299
1361
  function searchColumnCount(width) {
@@ -1304,17 +1366,17 @@ function collapsedSearchFieldLimit(columns) {
1304
1366
  }
1305
1367
 
1306
1368
  // src/composites/SearchPanel.tsx
1307
- var import_jsx_runtime5 = require("react/jsx-runtime");
1308
- var SearchPanel = (0, import_react7.forwardRef)(function SearchPanel2({ fields, actions, tools, trailingTools, searchVisible = true, defaultExpanded = false, role = "search", style, ...props }, ref) {
1309
- const rootRef = (0, import_react7.useRef)(null);
1310
- const [width, setWidth] = (0, import_react7.useState)(0);
1311
- const [expanded, setExpanded] = (0, import_react7.useState)(defaultExpanded);
1312
- const items = import_react7.Children.toArray(fields);
1369
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1370
+ var SearchPanel = (0, import_react9.forwardRef)(function SearchPanel2({ fields, actions, tools, trailingTools, searchVisible = true, defaultExpanded = false, role = "search", style, ...props }, ref) {
1371
+ const rootRef = (0, import_react9.useRef)(null);
1372
+ const [width, setWidth] = (0, import_react9.useState)(0);
1373
+ const [expanded, setExpanded] = (0, import_react9.useState)(defaultExpanded);
1374
+ const items = import_react9.Children.toArray(fields);
1313
1375
  const columns = searchColumnCount(width);
1314
1376
  const collapsedLimit = collapsedSearchFieldLimit(columns);
1315
1377
  const hasMore = items.length > collapsedLimit;
1316
1378
  const fieldWidth = Math.min(240, Math.max(0, width));
1317
- (0, import_react7.useEffect)(() => {
1379
+ (0, import_react9.useEffect)(() => {
1318
1380
  const element = rootRef.current;
1319
1381
  if (!element) return void 0;
1320
1382
  const update = () => {
@@ -1343,10 +1405,10 @@ var SearchPanel = (0, import_react7.forwardRef)(function SearchPanel2({ fields,
1343
1405
  ...style
1344
1406
  };
1345
1407
  const hasToolbar = tools != null || trailingTools != null;
1346
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ...props, ref: setRootRef, role: hasToolbar ? "toolbar" : role, style: panelStyle, "data-adminsmart-search-panel": "true", children: [
1347
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: "[data-adminsmart-search-field] > .ant-form-item { margin-bottom: 0; }" }),
1348
- (items.length > 0 || actions != null) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { role: hasToolbar ? role : void 0, "aria-hidden": !searchVisible, style: { display: searchVisible ? "flex" : "none", width: "100%", flexWrap: "wrap", alignItems: "end", gap: "12px 16px" }, children: [
1349
- items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1408
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ...props, ref: setRootRef, role: hasToolbar ? "toolbar" : role, style: panelStyle, "data-adminsmart-search-panel": "true", children: [
1409
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("style", { children: "[data-adminsmart-search-field] > .ant-form-item { margin-bottom: 0; }" }),
1410
+ (items.length > 0 || actions != null) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { role: hasToolbar ? role : void 0, "aria-hidden": !searchVisible, style: { display: searchVisible ? "flex" : "none", width: "100%", flexWrap: "wrap", alignItems: "end", gap: "12px 16px" }, children: [
1411
+ items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1350
1412
  "div",
1351
1413
  {
1352
1414
  hidden: !expanded && index >= collapsedLimit,
@@ -1354,33 +1416,30 @@ var SearchPanel = (0, import_react7.forwardRef)(function SearchPanel2({ fields,
1354
1416
  style: { minWidth: 0, width: fieldWidth || "min(240px, 100%)", flex: "0 0 auto" },
1355
1417
  children: item
1356
1418
  },
1357
- (0, import_react7.isValidElement)(item) ? item.key ?? index : index
1419
+ (0, import_react9.isValidElement)(item) ? item.key ?? index : index
1358
1420
  )),
1359
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { "data-adminsmart-search-actions": "true", style: { display: "flex", alignItems: "center", gap: 8, minHeight: 32 }, children: [
1360
- hasMore ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1421
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "data-adminsmart-search-actions": "true", style: { display: "flex", alignItems: "center", gap: 8, minHeight: 32 }, children: [
1422
+ hasMore ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1361
1423
  Button,
1362
1424
  {
1363
1425
  type: "link",
1364
- icon: expanded ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons3.UpOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons3.DownOutlined, {}),
1426
+ icon: expanded ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons3.UpOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons3.DownOutlined, {}),
1365
1427
  "aria-expanded": expanded,
1366
1428
  onClick: () => setExpanded((value) => !value),
1367
1429
  children: expanded ? "\u6536\u8D77\u7B5B\u9009" : "\u5C55\u5F00\u7B5B\u9009"
1368
1430
  }
1369
1431
  ) : null,
1370
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { display: "inline-flex", alignItems: "center", gap: 8 }, children: actions })
1432
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { display: "inline-flex", alignItems: "center", gap: 8 }, children: actions })
1371
1433
  ] })
1372
1434
  ] }),
1373
- hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { "data-adminsmart-toolbar-row": "true", style: { display: "flex", width: "100%", minWidth: 0, alignItems: "center", justifyContent: "space-between", flexWrap: "wrap", gap: 12 }, children: [
1374
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "group", "aria-label": "\u529F\u80FD\u64CD\u4F5C", "data-adminsmart-toolbar-actions": "true", style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 12, minHeight: 32 }, children: tools }),
1375
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "group", "aria-label": "\u8868\u683C\u5DE5\u5177", style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 12, marginLeft: "auto", minHeight: 32 }, children: trailingTools })
1376
- ] })
1435
+ hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(OperationToolbar, { actions: tools, controls: trailingTools })
1377
1436
  ] });
1378
1437
  });
1379
1438
 
1380
1439
  // src/composites/TableControls.tsx
1381
1440
  var import_icons4 = require("@ant-design/icons");
1382
- var import_react8 = require("react");
1383
- var import_jsx_runtime6 = require("react/jsx-runtime");
1441
+ var import_react10 = require("react");
1442
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1384
1443
  function TableControls({
1385
1444
  searchVisible = true,
1386
1445
  onSearchVisibleChange,
@@ -1392,10 +1451,10 @@ function TableControls({
1392
1451
  className,
1393
1452
  style
1394
1453
  }) {
1395
- const [open, setOpen] = (0, import_react8.useState)(false);
1396
- const triggerRef = (0, import_react8.useRef)(null);
1397
- const panelRef = (0, import_react8.useRef)(null);
1398
- const panelId = (0, import_react8.useId)();
1454
+ const [open, setOpen] = (0, import_react10.useState)(false);
1455
+ const triggerRef = (0, import_react10.useRef)(null);
1456
+ const panelRef = (0, import_react10.useRef)(null);
1457
+ const panelId = (0, import_react10.useId)();
1399
1458
  const editable = columns.filter((column) => !column.disabled);
1400
1459
  const visible = new Set(visibleColumns ?? columns.map((column) => column.key));
1401
1460
  const checkedCount = editable.filter((column) => visible.has(column.key)).length;
@@ -1423,11 +1482,11 @@ function TableControls({
1423
1482
  maxHeight: "min(380px, 60vh)",
1424
1483
  overflow: "auto"
1425
1484
  };
1426
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className, style: { display: "inline-flex", alignItems: "center", flexShrink: 0, gap: 8, ...style }, children: [
1427
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Tooltip, { title: searchLabel, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1485
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className, style: { display: "inline-flex", alignItems: "center", flexShrink: 0, gap: 8, ...style }, children: [
1486
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Tooltip, { title: searchLabel, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1428
1487
  Button,
1429
1488
  {
1430
- icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons4.SearchOutlined, { "aria-hidden": "true" }),
1489
+ icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons4.SearchOutlined, { "aria-hidden": "true" }),
1431
1490
  "aria-label": searchLabel,
1432
1491
  "aria-pressed": searchVisible,
1433
1492
  "data-adminsmart-table-tool": "true",
@@ -1435,10 +1494,10 @@ function TableControls({
1435
1494
  onClick: () => onSearchVisibleChange?.(!searchVisible)
1436
1495
  }
1437
1496
  ) }),
1438
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Tooltip, { title: "\u5237\u65B0\u5217\u8868", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1497
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Tooltip, { title: "\u5237\u65B0\u5217\u8868", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1439
1498
  Button,
1440
1499
  {
1441
- icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons4.ReloadOutlined, { "aria-hidden": "true" }),
1500
+ icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons4.ReloadOutlined, { "aria-hidden": "true" }),
1442
1501
  "aria-label": "\u5237\u65B0\u5217\u8868",
1443
1502
  "data-adminsmart-table-tool": "true",
1444
1503
  loading: refreshing,
@@ -1446,7 +1505,7 @@ function TableControls({
1446
1505
  onClick: onRefresh
1447
1506
  }
1448
1507
  ) }),
1449
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1508
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1450
1509
  Popover,
1451
1510
  {
1452
1511
  trigger: "click",
@@ -1457,8 +1516,8 @@ function TableControls({
1457
1516
  afterOpenChange: (opened) => {
1458
1517
  if (opened) panelRef.current?.querySelector("input:not(:disabled)")?.focus();
1459
1518
  },
1460
- content: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: panelRef, id: panelId, role: "dialog", "aria-label": "\u8BBE\u7F6E\u663E\u793A\u5217", onKeyDown: closeOnEscape, style: panelStyle, children: [
1461
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1519
+ content: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref: panelRef, id: panelId, role: "dialog", "aria-label": "\u8BBE\u7F6E\u663E\u793A\u5217", onKeyDown: closeOnEscape, style: panelStyle, children: [
1520
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1462
1521
  Checkbox,
1463
1522
  {
1464
1523
  checked: checkedCount === editable.length,
@@ -1467,7 +1526,7 @@ function TableControls({
1467
1526
  children: "\u663E\u793A\u5168\u90E8\u53EF\u9009\u5217"
1468
1527
  }
1469
1528
  ),
1470
- columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1529
+ columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1471
1530
  Checkbox,
1472
1531
  {
1473
1532
  checked: visible.has(column.key),
@@ -1478,11 +1537,11 @@ function TableControls({
1478
1537
  column.key
1479
1538
  ))
1480
1539
  ] }),
1481
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1540
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1482
1541
  Button,
1483
1542
  {
1484
1543
  ref: triggerRef,
1485
- icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons4.SettingOutlined, { "aria-hidden": "true" }),
1544
+ icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons4.SettingOutlined, { "aria-hidden": "true" }),
1486
1545
  "aria-label": "\u8BBE\u7F6E\u663E\u793A\u5217",
1487
1546
  "data-adminsmart-table-tool": "true",
1488
1547
  "aria-haspopup": "dialog",
@@ -1498,25 +1557,26 @@ function TableControls({
1498
1557
  }
1499
1558
 
1500
1559
  // src/composites/DataTable.tsx
1501
- var import_react10 = require("react");
1560
+ var import_react12 = require("react");
1502
1561
 
1503
1562
  // src/composites/CrudWorkspace.tsx
1504
- var import_react9 = require("react");
1505
- var import_jsx_runtime7 = require("react/jsx-runtime");
1506
- var CrudTableHeightContext = (0, import_react9.createContext)(false);
1507
- function CrudWorkspace({ label, filters, toolbar, feedback, footer, children, className, ...props }) {
1563
+ var import_react11 = require("react");
1564
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1565
+ var CrudTableHeightContext = (0, import_react11.createContext)(false);
1566
+ function CrudWorkspace({ label, filters, toolbar, actions, controls, feedback, footer, children, className, ...props }) {
1508
1567
  const classes = ["adminsmart-crud-workspace", className].filter(Boolean).join(" ");
1509
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { ...props, className: classes, "aria-label": label, children: [
1510
- filters != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "adminsmart-crud-workspace__filters", children: filters }),
1511
- toolbar != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "adminsmart-crud-workspace__toolbar", children: toolbar }),
1512
- feedback != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "adminsmart-crud-workspace__feedback", children: feedback }),
1513
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "adminsmart-crud-workspace__results", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CrudTableHeightContext.Provider, { value: true, children }) }),
1514
- footer != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "adminsmart-crud-workspace__footer", children: footer })
1568
+ const listToolbar = toolbar ?? (actions != null || controls != null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(OperationToolbar, { actions, controls }) : null);
1569
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { ...props, className: classes, "aria-label": label, children: [
1570
+ filters != null && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "adminsmart-crud-workspace__filters", children: filters }),
1571
+ listToolbar != null && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "adminsmart-crud-workspace__toolbar", children: listToolbar }),
1572
+ feedback != null && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "adminsmart-crud-workspace__feedback", children: feedback }),
1573
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "adminsmart-crud-workspace__results", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CrudTableHeightContext.Provider, { value: true, children }) }),
1574
+ footer != null && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "adminsmart-crud-workspace__footer", children: footer })
1515
1575
  ] });
1516
1576
  }
1517
1577
 
1518
1578
  // src/composites/DataTable.tsx
1519
- var import_jsx_runtime8 = require("react/jsx-runtime");
1579
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1520
1580
  function tableBodyHeight(availableHeight, chromeHeight) {
1521
1581
  return Math.max(0, Math.floor(availableHeight - chromeHeight - 16));
1522
1582
  }
@@ -1537,12 +1597,12 @@ function DataTableInner({
1537
1597
  scroll,
1538
1598
  ...tableProps
1539
1599
  }, ref) {
1540
- const containerRef = (0, import_react10.useRef)(null);
1541
- const [bodyHeight, setBodyHeight] = (0, import_react10.useState)(360);
1542
- const inWorkspace = (0, import_react10.useContext)(CrudTableHeightContext);
1600
+ const containerRef = (0, import_react12.useRef)(null);
1601
+ const [bodyHeight, setBodyHeight] = (0, import_react12.useState)(360);
1602
+ const inWorkspace = (0, import_react12.useContext)(CrudTableHeightContext);
1543
1603
  const tableHeight = containerHeight ?? (inWorkspace && containerStyle?.height == null ? "100%" : void 0);
1544
1604
  const hasExplicitHeight = tableHeight != null || containerStyle?.height != null;
1545
- (0, import_react10.useLayoutEffect)(() => {
1605
+ (0, import_react12.useLayoutEffect)(() => {
1546
1606
  const container = containerRef.current;
1547
1607
  if (!container || scroll?.y != null) return void 0;
1548
1608
  const update = () => {
@@ -1586,7 +1646,7 @@ function DataTableInner({
1586
1646
  y: scroll?.y ?? bodyHeight
1587
1647
  };
1588
1648
  const tablePagination = pagination === false ? false : pagination?.placement || pagination?.position ? pagination : { placement: ["bottomEnd"], ...pagination };
1589
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1649
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1590
1650
  "div",
1591
1651
  {
1592
1652
  ref: containerRef,
@@ -1594,7 +1654,7 @@ function DataTableInner({
1594
1654
  "data-adminsmart-data-table": "true",
1595
1655
  "data-adminsmart-data-table-fill": inWorkspace || void 0,
1596
1656
  style: { width: "100%", minWidth: 0, overflowX: "hidden", ...tableHeight == null ? {} : { height: tableHeight, overflowY: "hidden" }, ...containerStyle },
1597
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1657
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1598
1658
  Table,
1599
1659
  {
1600
1660
  ...tableProps,
@@ -1606,11 +1666,11 @@ function DataTableInner({
1606
1666
  }
1607
1667
  );
1608
1668
  }
1609
- var DataTable = (0, import_react10.forwardRef)(DataTableInner);
1669
+ var DataTable = (0, import_react12.forwardRef)(DataTableInner);
1610
1670
 
1611
1671
  // src/composites/WorkspaceLayout.tsx
1612
1672
  var import_antd46 = require("antd");
1613
- var import_jsx_runtime9 = require("react/jsx-runtime");
1673
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1614
1674
  var LIGHT_WORKSPACE_BACKGROUND = "#f6f9fe";
1615
1675
  function WorkspaceLayout({
1616
1676
  header,
@@ -1642,10 +1702,10 @@ function WorkspaceLayout({
1642
1702
  "--adminsmart-workspace-bg": themeMode === "dark" ? token.colorBgLayout : LIGHT_WORKSPACE_BACKGROUND
1643
1703
  // 夜间不复用日间固定底色。
1644
1704
  };
1645
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Layout, { className: rootClassName, style: workspaceStyle, "data-theme-mode": themeMode, children: [
1646
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("header", { className: "adminsmart-workspace__header", children: header }),
1647
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Layout, { className: "adminsmart-workspace__body", children: [
1648
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1705
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Layout, { className: rootClassName, style: workspaceStyle, "data-theme-mode": themeMode, children: [
1706
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("header", { className: "adminsmart-workspace__header", children: header }),
1707
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Layout, { className: "adminsmart-workspace__body", children: [
1708
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1649
1709
  Layout.Sider,
1650
1710
  {
1651
1711
  theme: themeMode,
@@ -1657,9 +1717,9 @@ function WorkspaceLayout({
1657
1717
  children: sidebar
1658
1718
  }
1659
1719
  ),
1660
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Layout, { className: "adminsmart-workspace__main", children: [
1720
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Layout, { className: "adminsmart-workspace__main", children: [
1661
1721
  tabs,
1662
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Layout.Content, { className: contentClasses, "data-content-mode": contentMode, children }),
1722
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Layout.Content, { className: contentClasses, "data-content-mode": contentMode, children }),
1663
1723
  footer
1664
1724
  ] })
1665
1725
  ] })
@@ -1667,7 +1727,7 @@ function WorkspaceLayout({
1667
1727
  }
1668
1728
 
1669
1729
  // src/composites/CrudScaffold.tsx
1670
- var import_jsx_runtime10 = require("react/jsx-runtime");
1730
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1671
1731
  function CrudScaffold({
1672
1732
  label,
1673
1733
  description,
@@ -1679,16 +1739,16 @@ function CrudScaffold({
1679
1739
  ...props
1680
1740
  }) {
1681
1741
  const classes = ["adminsmart-crud", className].filter(Boolean).join(" ");
1682
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("main", { ...props, className: classes, "aria-label": label, "aria-description": description, children: [
1683
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "adminsmart-crud__filters", children: filters }),
1684
- status ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "adminsmart-crud__status", children: status }) : null,
1685
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "adminsmart-crud__results", children: results }),
1742
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("main", { ...props, className: classes, "aria-label": label, "aria-description": description, children: [
1743
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "adminsmart-crud__filters", children: filters }),
1744
+ status ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "adminsmart-crud__status", children: status }) : null,
1745
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "adminsmart-crud__results", children: results }),
1686
1746
  drawer
1687
1747
  ] });
1688
1748
  }
1689
1749
 
1690
1750
  // src/composites/EllipsisText.tsx
1691
- var import_jsx_runtime11 = require("react/jsx-runtime");
1751
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1692
1752
  function EllipsisText({
1693
1753
  children,
1694
1754
  maxWidth = 240,
@@ -1700,7 +1760,7 @@ function EllipsisText({
1700
1760
  const classes = ["adminsmart-ellipsis-text", className].filter(Boolean).join(" ");
1701
1761
  const widthValue = typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth;
1702
1762
  const textStyle = { "--adminsmart-ellipsis-width": widthValue, ...style };
1703
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1763
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1704
1764
  Typography.Text,
1705
1765
  {
1706
1766
  ...props,
@@ -1714,13 +1774,13 @@ function EllipsisText({
1714
1774
 
1715
1775
  // src/composites/RowActions.tsx
1716
1776
  var import_icons5 = require("@ant-design/icons");
1717
- var import_react11 = require("react");
1718
- var import_jsx_runtime12 = require("react/jsx-runtime");
1777
+ var import_react13 = require("react");
1778
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1719
1779
  function collectButtons(children) {
1720
1780
  const actions = [];
1721
- import_react11.Children.forEach(children, (child) => {
1722
- if (!(0, import_react11.isValidElement)(child)) return;
1723
- if (child.type === import_react11.Fragment) actions.push(...collectButtons(child.props.children));
1781
+ import_react13.Children.forEach(children, (child) => {
1782
+ if (!(0, import_react13.isValidElement)(child)) return;
1783
+ if (child.type === import_react13.Fragment) actions.push(...collectButtons(child.props.children));
1724
1784
  else {
1725
1785
  if (child.type !== Button && child.type !== "button") throw new TypeError("RowActions \u53EA\u63A5\u53D7\u5DF2\u6309\u6743\u9650\u7B5B\u9009\u7684 Button \u6216 Fragment");
1726
1786
  if (!child.props.hidden) actions.push(child);
@@ -1746,9 +1806,9 @@ function RowActions({ children, maxVisible = 2, moreLabel = "\u66F4\u591A\u64CD\
1746
1806
  // 菜单仍按官方语义标识需要确认的动作。
1747
1807
  }));
1748
1808
  const classes = ["adminsmart-row-action-group", className].filter(Boolean).join(" ");
1749
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Space, { ...props, className: classes, size, wrap, children: [
1809
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Space, { ...props, className: classes, size, wrap, children: [
1750
1810
  direct,
1751
- overflow.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1811
+ overflow.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1752
1812
  Dropdown,
1753
1813
  {
1754
1814
  trigger: ["click"],
@@ -1760,12 +1820,12 @@ function RowActions({ children, maxVisible = 2, moreLabel = "\u66F4\u591A\u64CD\
1760
1820
  action.props.onClick?.(domEvent);
1761
1821
  }
1762
1822
  },
1763
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Tooltip, { title: moreLabel, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1823
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Tooltip, { title: moreLabel, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1764
1824
  Button,
1765
1825
  {
1766
1826
  type: "text",
1767
1827
  size: "small",
1768
- icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons5.EllipsisOutlined, {}),
1828
+ icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons5.EllipsisOutlined, {}),
1769
1829
  "aria-label": moreLabel,
1770
1830
  "aria-haspopup": "menu",
1771
1831
  "data-adminsmart-row-more": "true",
@@ -1779,7 +1839,7 @@ function RowActions({ children, maxVisible = 2, moreLabel = "\u66F4\u591A\u64CD\
1779
1839
 
1780
1840
  // src/schema/SchemaForm.tsx
1781
1841
  var import_dayjs = __toESM(require("dayjs"), 1);
1782
- var import_react12 = require("react");
1842
+ var import_react14 = require("react");
1783
1843
 
1784
1844
  // src/schema/model.ts
1785
1845
  var FIELD_TYPES = /* @__PURE__ */ new Set([
@@ -1962,7 +2022,7 @@ function schemaInitialValues(schema) {
1962
2022
  }
1963
2023
 
1964
2024
  // src/schema/SchemaForm.tsx
1965
- var import_jsx_runtime13 = require("react/jsx-runtime");
2025
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1966
2026
  function fieldRules(field) {
1967
2027
  const rules = [];
1968
2028
  if (field.required) {
@@ -2007,32 +2067,32 @@ function dateItemProps(field) {
2007
2067
  function renderControl(field) {
2008
2068
  switch (field.type) {
2009
2069
  case "input":
2010
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Input, { placeholder: field.placeholder });
2070
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Input, { placeholder: field.placeholder });
2011
2071
  case "password":
2012
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Input.Password, { placeholder: field.placeholder });
2072
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Input.Password, { placeholder: field.placeholder });
2013
2073
  case "textarea":
2014
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Input.TextArea, { placeholder: field.placeholder });
2074
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Input.TextArea, { placeholder: field.placeholder });
2015
2075
  case "number":
2016
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(InputNumber, { placeholder: field.placeholder, min: field.validation?.min, max: field.validation?.max, style: { width: "100%" } });
2076
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(InputNumber, { placeholder: field.placeholder, min: field.validation?.min, max: field.validation?.max, style: { width: "100%" } });
2017
2077
  case "select":
2018
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Select, { placeholder: field.placeholder, options: field.options });
2078
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Select, { placeholder: field.placeholder, options: field.options });
2019
2079
  case "radio":
2020
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Radio.Group, { options: field.options });
2080
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Radio.Group, { options: field.options });
2021
2081
  case "checkbox":
2022
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Checkbox, {});
2082
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Checkbox, {});
2023
2083
  case "switch":
2024
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Switch, {});
2084
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Switch, {});
2025
2085
  case "date":
2026
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DatePicker, { placeholder: field.placeholder, style: { width: "100%" } });
2086
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DatePicker, { placeholder: field.placeholder, style: { width: "100%" } });
2027
2087
  case "dateRange":
2028
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DatePicker.RangePicker, { placeholder: field.placeholder ? [field.placeholder, field.placeholder] : void 0, style: { width: "100%" } });
2088
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DatePicker.RangePicker, { placeholder: field.placeholder ? [field.placeholder, field.placeholder] : void 0, style: { width: "100%" } });
2029
2089
  }
2030
2090
  }
2031
- var SchemaForm = (0, import_react12.forwardRef)(function SchemaForm2({ schema, onSubmit, onChange, onFinish, onValuesChange, initialValues, layout = "vertical", ...formProps }, ref) {
2091
+ var SchemaForm = (0, import_react14.forwardRef)(function SchemaForm2({ schema, onSubmit, onChange, onFinish, onValuesChange, initialValues, layout = "vertical", ...formProps }, ref) {
2032
2092
  const result = validateSchemaForm(schema);
2033
2093
  if (!result.valid) throw new Error(`SchemaForm \u914D\u7F6E\u65E0\u6548\uFF1A${result.errors.map((issue) => `${issue.path} ${issue.message}`).join("\uFF1B")}`);
2034
2094
  const defaults = schemaInitialValues(schema);
2035
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2095
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2036
2096
  Form,
2037
2097
  {
2038
2098
  ...formProps,
@@ -2050,7 +2110,7 @@ var SchemaForm = (0, import_react12.forwardRef)(function SchemaForm2({ schema, o
2050
2110
  children: [
2051
2111
  schema.fields.map((field) => {
2052
2112
  const mapped = mapSchemaField(field);
2053
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2113
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2054
2114
  Form.Item,
2055
2115
  {
2056
2116
  name: mapped.name,
@@ -2063,7 +2123,7 @@ var SchemaForm = (0, import_react12.forwardRef)(function SchemaForm2({ schema, o
2063
2123
  mapped.name
2064
2124
  );
2065
2125
  }),
2066
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { type: "primary", htmlType: "submit", children: schema.submitText ?? "\u63D0\u4EA4" }) })
2126
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { type: "primary", htmlType: "submit", children: schema.submitText ?? "\u63D0\u4EA4" }) })
2067
2127
  ]
2068
2128
  }
2069
2129
  );
@@ -2102,6 +2162,7 @@ var SchemaForm = (0, import_react12.forwardRef)(function SchemaForm2({ schema, o
2102
2162
  Dropdown,
2103
2163
  EllipsisText,
2104
2164
  Empty,
2165
+ ErrorReportButton,
2105
2166
  Flex,
2106
2167
  FloatButton,
2107
2168
  Form,
@@ -2116,6 +2177,7 @@ var SchemaForm = (0, import_react12.forwardRef)(function SchemaForm2({ schema, o
2116
2177
  Mentions,
2117
2178
  Menu,
2118
2179
  Modal,
2180
+ OperationToolbar,
2119
2181
  Pagination,
2120
2182
  Popconfirm,
2121
2183
  Popover,
@@ -2123,6 +2185,7 @@ var SchemaForm = (0, import_react12.forwardRef)(function SchemaForm2({ schema, o
2123
2185
  QRCode,
2124
2186
  Radio,
2125
2187
  Rate,
2188
+ ReportErrorProvider,
2126
2189
  Result,
2127
2190
  Row,
2128
2191
  RowActions,