openxiangda 1.0.18 → 1.0.20

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.
@@ -1975,6 +1975,7 @@ interface DataManagementListProps {
1975
1975
  submitRenderer?: SubmitRenderer;
1976
1976
  requestOverride?: FormRuntimeApi['request'] | FormRuntimeApiConfig;
1977
1977
  rowActions?: DataManagementRowAction[];
1978
+ maxVisibleRowActions?: number;
1978
1979
  }
1979
1980
  declare const DataManagementList: React__default.FC<DataManagementListProps>;
1980
1981
 
@@ -1975,6 +1975,7 @@ interface DataManagementListProps {
1975
1975
  submitRenderer?: SubmitRenderer;
1976
1976
  requestOverride?: FormRuntimeApi['request'] | FormRuntimeApiConfig;
1977
1977
  rowActions?: DataManagementRowAction[];
1978
+ maxVisibleRowActions?: number;
1978
1979
  }
1979
1980
  declare const DataManagementList: React__default.FC<DataManagementListProps>;
1980
1981
 
@@ -45196,6 +45196,17 @@ var StandardFormPage = ({
45196
45196
 
45197
45197
  // packages/sdk/src/components/modules/DataManagementList.tsx
45198
45198
  import { jsx as jsx101, jsxs as jsxs55 } from "react/jsx-runtime";
45199
+ var DEFAULT_MAX_VISIBLE_ROW_ACTIONS = 4;
45200
+ var ACTION_COLUMN_MIN_WIDTH = 96;
45201
+ var ACTION_BUTTON_ESTIMATED_WIDTH = 56;
45202
+ var ACTION_MORE_BUTTON_WIDTH = 36;
45203
+ var ACTION_COLUMN_HORIZONTAL_PADDING = 24;
45204
+ function normalizeMaxVisibleRowActions(maxVisibleRowActions) {
45205
+ if (typeof maxVisibleRowActions !== "number" || !Number.isFinite(maxVisibleRowActions)) {
45206
+ return DEFAULT_MAX_VISIBLE_ROW_ACTIONS;
45207
+ }
45208
+ return Math.max(0, Math.floor(maxVisibleRowActions));
45209
+ }
45199
45210
  var createGroup = () => ({
45200
45211
  id: `group_${Date.now()}_${Math.random().toString(36).slice(2)}`,
45201
45212
  logic: "AND",
@@ -46128,7 +46139,8 @@ var DataManagementList = ({
46128
46139
  detailPageUrlBuilder,
46129
46140
  submitRenderer,
46130
46141
  requestOverride,
46131
- rowActions = []
46142
+ rowActions = [],
46143
+ maxVisibleRowActions
46132
46144
  }) => {
46133
46145
  const rootRef = useRef96(null);
46134
46146
  const api = useMemo61(() => {
@@ -46558,6 +46570,12 @@ var DataManagementList = ({
46558
46570
  setImportBase64("");
46559
46571
  await loadData({ current: 1, pageSize });
46560
46572
  };
46573
+ const visibleRowActionLimit = normalizeMaxVisibleRowActions(maxVisibleRowActions);
46574
+ const rowActionCount = 1 + rowActions.length + (readonly ? 0 : 1) + (isProcessForm ? 1 : 0);
46575
+ const actionColumnWidth = Math.max(
46576
+ ACTION_COLUMN_MIN_WIDTH,
46577
+ Math.min(rowActionCount, visibleRowActionLimit) * ACTION_BUTTON_ESTIMATED_WIDTH + (rowActionCount > visibleRowActionLimit ? ACTION_MORE_BUTTON_WIDTH : 0) + ACTION_COLUMN_HORIZONTAL_PADDING
46578
+ );
46561
46579
  const columns = useMemo61(() => {
46562
46580
  const baseColumns = visibleFields.map((field) => {
46563
46581
  const columnWidth = widths[field.fieldId] || field.width || 160;
@@ -46584,53 +46602,88 @@ var DataManagementList = ({
46584
46602
  {
46585
46603
  title: "\u64CD\u4F5C",
46586
46604
  key: "__actions",
46587
- width: 136,
46605
+ width: actionColumnWidth,
46588
46606
  fixed: "right",
46589
- render: (_, record2) => /* @__PURE__ */ jsxs55(Space10, { size: 4, children: [
46590
- /* @__PURE__ */ jsx101(Button18, { type: "link", size: "small", onClick: () => handleDetail(record2), children: "\u8BE6\u60C5" }),
46591
- /* @__PURE__ */ jsx101(
46592
- Dropdown4,
46607
+ render: (_, record2) => {
46608
+ const actions = [
46593
46609
  {
46594
- trigger: ["click"],
46595
- getPopupContainer,
46596
- menu: {
46597
- items: [
46598
- ...!readonly ? [
46599
- {
46600
- key: "delete",
46601
- label: "\u5220\u9664",
46602
- danger: true,
46603
- icon: /* @__PURE__ */ jsx101(DeleteOutlined, {}),
46604
- onClick: () => confirmDanger(
46605
- "\u786E\u8BA4\u5220\u9664",
46606
- "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
46607
- () => handleDelete([String(getRecordId(record2))])
46608
- )
46609
- }
46610
- ] : [],
46611
- ...rowActions.map((action) => ({
46610
+ key: "detail",
46611
+ label: "\u8BE6\u60C5",
46612
+ onClick: () => handleDetail(record2)
46613
+ },
46614
+ ...rowActions.map((action) => ({
46615
+ key: action.key,
46616
+ label: action.label,
46617
+ danger: action.danger,
46618
+ onClick: () => action.onClick(record2)
46619
+ })),
46620
+ ...!readonly ? [
46621
+ {
46622
+ key: "delete",
46623
+ label: "\u5220\u9664",
46624
+ danger: true,
46625
+ icon: /* @__PURE__ */ jsx101(DeleteOutlined, {}),
46626
+ onClick: () => confirmDanger(
46627
+ "\u786E\u8BA4\u5220\u9664",
46628
+ "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u7EE7\u7EED\u5417\uFF1F",
46629
+ () => handleDelete([String(getRecordId(record2))])
46630
+ )
46631
+ }
46632
+ ] : [],
46633
+ ...isProcessForm ? [
46634
+ {
46635
+ key: "workflow",
46636
+ label: "\u6D41\u7A0B\u65E5\u5FD7",
46637
+ icon: /* @__PURE__ */ jsx101(HistoryOutlined2, {}),
46638
+ onClick: () => message5.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
46639
+ }
46640
+ ] : []
46641
+ ];
46642
+ const visibleActions = actions.slice(0, visibleRowActionLimit);
46643
+ const moreActions = actions.slice(visibleRowActionLimit);
46644
+ return /* @__PURE__ */ jsxs55(Space10, { size: 4, children: [
46645
+ visibleActions.map((action) => /* @__PURE__ */ jsx101(
46646
+ Button18,
46647
+ {
46648
+ type: "link",
46649
+ size: "small",
46650
+ danger: action.danger,
46651
+ onClick: action.onClick,
46652
+ children: action.label
46653
+ },
46654
+ action.key
46655
+ )),
46656
+ moreActions.length > 0 && /* @__PURE__ */ jsx101(
46657
+ Dropdown4,
46658
+ {
46659
+ trigger: ["click"],
46660
+ getPopupContainer,
46661
+ menu: {
46662
+ items: moreActions.map((action) => ({
46612
46663
  key: action.key,
46613
46664
  label: action.label,
46614
46665
  danger: action.danger,
46615
- onClick: () => action.onClick(record2)
46616
- })),
46617
- ...isProcessForm ? [
46618
- {
46619
- key: "workflow",
46620
- label: "\u6D41\u7A0B\u65E5\u5FD7",
46621
- icon: /* @__PURE__ */ jsx101(HistoryOutlined2, {}),
46622
- onClick: () => message5.info("\u8BF7\u901A\u8FC7 detailRenderer \u63A5\u5165\u6D41\u7A0B\u65E5\u5FD7\u6216\u6D41\u7A0B\u56FE\u5165\u53E3")
46623
- }
46624
- ] : []
46625
- ]
46626
- },
46627
- children: /* @__PURE__ */ jsx101(Button18, { type: "text", size: "small", icon: /* @__PURE__ */ jsx101(MoreOutlined3, {}) })
46628
- }
46629
- )
46630
- ] })
46666
+ icon: action.icon,
46667
+ onClick: action.onClick
46668
+ }))
46669
+ },
46670
+ children: /* @__PURE__ */ jsx101(
46671
+ Button18,
46672
+ {
46673
+ type: "text",
46674
+ size: "small",
46675
+ icon: /* @__PURE__ */ jsx101(MoreOutlined3, {}),
46676
+ "aria-label": "\u66F4\u591A\u64CD\u4F5C"
46677
+ }
46678
+ )
46679
+ }
46680
+ )
46681
+ ] });
46682
+ }
46631
46683
  }
46632
46684
  ];
46633
46685
  }, [
46686
+ actionColumnWidth,
46634
46687
  confirmDanger,
46635
46688
  commitColumnWidth,
46636
46689
  getPopupContainer,
@@ -46641,13 +46694,17 @@ var DataManagementList = ({
46641
46694
  readonly,
46642
46695
  rowActions,
46643
46696
  updateColumnWidth,
46697
+ visibleRowActionLimit,
46644
46698
  visibleFields,
46645
46699
  widths
46646
46700
  ]);
46647
46701
  const tableSize = density === "compact" ? "small" : density === "loose" ? "large" : "middle";
46648
46702
  const tableScrollX = Math.max(
46649
46703
  900,
46650
- visibleFields.reduce((sum, field) => sum + (widths[field.fieldId] || field.width || 160), 136)
46704
+ visibleFields.reduce(
46705
+ (sum, field) => sum + (widths[field.fieldId] || field.width || 160),
46706
+ actionColumnWidth
46707
+ )
46651
46708
  );
46652
46709
  const importPreviewColumns = useMemo61(() => {
46653
46710
  const keys2 = Array.from(
@@ -47295,6 +47352,7 @@ function LowcodePageRenderer({ schema, context }) {
47295
47352
  configScope: "personal",
47296
47353
  forcedConfig: props.forcedConfig,
47297
47354
  showForcedConfig: props.showForcedConfig,
47355
+ maxVisibleRowActions: props.maxVisibleRowActions,
47298
47356
  requestOverride
47299
47357
  },
47300
47358
  node.id