openxiangda 1.0.18 → 1.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -46195,6 +46195,17 @@ var StandardFormPage = ({
46195
46195
 
46196
46196
  // packages/sdk/src/components/modules/DataManagementList.tsx
46197
46197
  var import_jsx_runtime101 = require("react/jsx-runtime");
46198
+ var DEFAULT_MAX_VISIBLE_ROW_ACTIONS = 4;
46199
+ var ACTION_COLUMN_MIN_WIDTH = 96;
46200
+ var ACTION_BUTTON_ESTIMATED_WIDTH = 56;
46201
+ var ACTION_MORE_BUTTON_WIDTH = 36;
46202
+ var ACTION_COLUMN_HORIZONTAL_PADDING = 24;
46203
+ function normalizeMaxVisibleRowActions(maxVisibleRowActions) {
46204
+ if (typeof maxVisibleRowActions !== "number" || !Number.isFinite(maxVisibleRowActions)) {
46205
+ return DEFAULT_MAX_VISIBLE_ROW_ACTIONS;
46206
+ }
46207
+ return Math.max(0, Math.floor(maxVisibleRowActions));
46208
+ }
46198
46209
  var createGroup = () => ({
46199
46210
  id: `group_${Date.now()}_${Math.random().toString(36).slice(2)}`,
46200
46211
  logic: "AND",
@@ -47127,7 +47138,8 @@ var DataManagementList = ({
47127
47138
  detailPageUrlBuilder,
47128
47139
  submitRenderer,
47129
47140
  requestOverride,
47130
- rowActions = []
47141
+ rowActions = [],
47142
+ maxVisibleRowActions
47131
47143
  }) => {
47132
47144
  const rootRef = (0, import_react279.useRef)(null);
47133
47145
  const api = (0, import_react279.useMemo)(() => {
@@ -47557,6 +47569,12 @@ var DataManagementList = ({
47557
47569
  setImportBase64("");
47558
47570
  await loadData({ current: 1, pageSize });
47559
47571
  };
47572
+ const visibleRowActionLimit = normalizeMaxVisibleRowActions(maxVisibleRowActions);
47573
+ const rowActionCount = 1 + rowActions.length + (readonly ? 0 : 1) + (isProcessForm ? 1 : 0);
47574
+ const actionColumnWidth = Math.max(
47575
+ ACTION_COLUMN_MIN_WIDTH,
47576
+ Math.min(rowActionCount, visibleRowActionLimit) * ACTION_BUTTON_ESTIMATED_WIDTH + (rowActionCount > visibleRowActionLimit ? ACTION_MORE_BUTTON_WIDTH : 0) + ACTION_COLUMN_HORIZONTAL_PADDING
47577
+ );
47560
47578
  const columns = (0, import_react279.useMemo)(() => {
47561
47579
  const baseColumns = visibleFields.map((field) => {
47562
47580
  const columnWidth = widths[field.fieldId] || field.width || 160;
@@ -47583,53 +47601,88 @@ var DataManagementList = ({
47583
47601
  {
47584
47602
  title: "\u64CD\u4F5C",
47585
47603
  key: "__actions",
47586
- width: 136,
47604
+ width: actionColumnWidth,
47587
47605
  fixed: "right",
47588
- render: (_, record2) => /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_antd39.Space, { size: 4, children: [
47589
- /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_antd39.Button, { type: "link", size: "small", onClick: () => handleDetail(record2), children: "\u8BE6\u60C5" }),
47590
- /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
47591
- import_antd39.Dropdown,
47606
+ render: (_, record2) => {
47607
+ const actions = [
47592
47608
  {
47593
- trigger: ["click"],
47594
- getPopupContainer,
47595
- menu: {
47596
- items: [
47597
- ...!readonly ? [
47598
- {
47599
- key: "delete",
47600
- label: "\u5220\u9664",
47601
- danger: true,
47602
- icon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_icons16.DeleteOutlined, {}),
47603
- onClick: () => confirmDanger(
47604
- "\u786E\u8BA4\u5220\u9664",
47605
- "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
47606
- () => handleDelete([String(getRecordId(record2))])
47607
- )
47608
- }
47609
- ] : [],
47610
- ...rowActions.map((action) => ({
47609
+ key: "detail",
47610
+ label: "\u8BE6\u60C5",
47611
+ onClick: () => handleDetail(record2)
47612
+ },
47613
+ ...rowActions.map((action) => ({
47614
+ key: action.key,
47615
+ label: action.label,
47616
+ danger: action.danger,
47617
+ onClick: () => action.onClick(record2)
47618
+ })),
47619
+ ...!readonly ? [
47620
+ {
47621
+ key: "delete",
47622
+ label: "\u5220\u9664",
47623
+ danger: true,
47624
+ icon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_icons16.DeleteOutlined, {}),
47625
+ onClick: () => confirmDanger(
47626
+ "\u786E\u8BA4\u5220\u9664",
47627
+ "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
47628
+ () => handleDelete([String(getRecordId(record2))])
47629
+ )
47630
+ }
47631
+ ] : [],
47632
+ ...isProcessForm ? [
47633
+ {
47634
+ key: "workflow",
47635
+ label: "\u6D41\u7A0B\u65E5\u5FD7",
47636
+ icon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_icons16.HistoryOutlined, {}),
47637
+ onClick: () => import_antd39.message.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
47638
+ }
47639
+ ] : []
47640
+ ];
47641
+ const visibleActions = actions.slice(0, visibleRowActionLimit);
47642
+ const moreActions = actions.slice(visibleRowActionLimit);
47643
+ return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_antd39.Space, { size: 4, children: [
47644
+ visibleActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
47645
+ import_antd39.Button,
47646
+ {
47647
+ type: "link",
47648
+ size: "small",
47649
+ danger: action.danger,
47650
+ onClick: action.onClick,
47651
+ children: action.label
47652
+ },
47653
+ action.key
47654
+ )),
47655
+ moreActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
47656
+ import_antd39.Dropdown,
47657
+ {
47658
+ trigger: ["click"],
47659
+ getPopupContainer,
47660
+ menu: {
47661
+ items: moreActions.map((action) => ({
47611
47662
  key: action.key,
47612
47663
  label: action.label,
47613
47664
  danger: action.danger,
47614
- onClick: () => action.onClick(record2)
47615
- })),
47616
- ...isProcessForm ? [
47617
- {
47618
- key: "workflow",
47619
- label: "\u6D41\u7A0B\u65E5\u5FD7",
47620
- icon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_icons16.HistoryOutlined, {}),
47621
- onClick: () => import_antd39.message.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
47622
- }
47623
- ] : []
47624
- ]
47625
- },
47626
- children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_antd39.Button, { type: "text", size: "small", icon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_icons16.MoreOutlined, {}) })
47627
- }
47628
- )
47629
- ] })
47665
+ icon: action.icon,
47666
+ onClick: action.onClick
47667
+ }))
47668
+ },
47669
+ children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
47670
+ import_antd39.Button,
47671
+ {
47672
+ type: "text",
47673
+ size: "small",
47674
+ icon: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_icons16.MoreOutlined, {}),
47675
+ "aria-label": "\u66F4\u591A\u64CD\u4F5C"
47676
+ }
47677
+ )
47678
+ }
47679
+ )
47680
+ ] });
47681
+ }
47630
47682
  }
47631
47683
  ];
47632
47684
  }, [
47685
+ actionColumnWidth,
47633
47686
  confirmDanger,
47634
47687
  commitColumnWidth,
47635
47688
  getPopupContainer,
@@ -47640,13 +47693,17 @@ var DataManagementList = ({
47640
47693
  readonly,
47641
47694
  rowActions,
47642
47695
  updateColumnWidth,
47696
+ visibleRowActionLimit,
47643
47697
  visibleFields,
47644
47698
  widths
47645
47699
  ]);
47646
47700
  const tableSize = density === "compact" ? "small" : density === "loose" ? "large" : "middle";
47647
47701
  const tableScrollX = Math.max(
47648
47702
  900,
47649
- visibleFields.reduce((sum, field) => sum + (widths[field.fieldId] || field.width || 160), 136)
47703
+ visibleFields.reduce(
47704
+ (sum, field) => sum + (widths[field.fieldId] || field.width || 160),
47705
+ actionColumnWidth
47706
+ )
47650
47707
  );
47651
47708
  const importPreviewColumns = (0, import_react279.useMemo)(() => {
47652
47709
  const keys2 = Array.from(
@@ -48298,6 +48355,7 @@ function LowcodePageRenderer({ schema, context }) {
48298
48355
  configScope: "personal",
48299
48356
  forcedConfig: props.forcedConfig,
48300
48357
  showForcedConfig: props.showForcedConfig,
48358
+ maxVisibleRowActions: props.maxVisibleRowActions,
48301
48359
  requestOverride
48302
48360
  },
48303
48361
  node.id