@zat-design/sisyphus-react 4.5.9 → 4.5.10-beta.2
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.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/FormsProvider/index.js +14 -21
- package/es/ProAction/components/CheckModalContent/index.js +12 -26
- package/es/ProAction/index.js +79 -83
- package/es/ProAction/propsType.js +0 -1
- package/es/ProConfigProvider/index.js +63 -110
- package/es/ProConfigProvider/propsType.js +0 -1
- package/es/ProDownload/index.d.ts +2 -1
- package/es/ProDownload/index.js +74 -69
- package/es/ProDownload/propsType.js +0 -1
- package/es/ProDownload/utils.d.ts +10 -5
- package/es/ProDownload/utils.js +63 -95
- package/es/ProDrawerForm/components/ProDrawer/index.js +83 -113
- package/es/ProDrawerForm/components/ProModal/index.js +77 -108
- package/es/ProDrawerForm/components/index.js +6 -2
- package/es/ProDrawerForm/hooks/useConfirmClose.js +20 -39
- package/es/ProDrawerForm/index.js +29 -38
- package/es/ProDrawerForm/propsType.js +0 -1
- package/es/ProDrawerForm/utils/index.js +18 -36
- package/es/ProEditLabel/components/RenderProForm.js +45 -49
- package/es/ProEditLabel/index.js +126 -163
- package/es/ProEditLabel/propsType.js +0 -1
- package/es/ProEditLabel/utils/index.js +5 -8
- package/es/ProEditTable/components/ActionButton/index.js +111 -119
- package/es/ProEditTable/components/RcTable/BaseTable.js +38 -51
- package/es/ProEditTable/components/RcTable/DraggableTable.js +97 -129
- package/es/ProEditTable/components/RcTable/index.js +6 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +77 -95
- package/es/ProEditTable/components/RenderField/index.js +490 -587
- package/es/ProEditTable/components/RenderField/propsType.js +0 -1
- package/es/ProEditTable/components/RenderField/tools.js +115 -112
- package/es/ProEditTable/components/RenderToolbar/index.js +47 -73
- package/es/ProEditTable/components/Summary/index.js +38 -64
- package/es/ProEditTable/components/Validator/index.js +46 -46
- package/es/ProEditTable/components/index.js +12 -5
- package/es/ProEditTable/index.js +456 -378
- package/es/ProEditTable/propsType.js +0 -1
- package/es/ProEditTable/utils/config.js +60 -122
- package/es/ProEditTable/utils/diffOriginal.js +45 -82
- package/es/ProEditTable/utils/getDefaultProps.js +19 -24
- package/es/ProEditTable/utils/index.js +154 -235
- package/es/ProEditTable/utils/tools.js +149 -286
- package/es/ProEditTable/utils/transform.js +25 -30
- package/es/ProEditTable/utils/useEditTableError.js +30 -43
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +42 -72
- package/es/ProEditTable/utils/validateAll.js +87 -154
- package/es/ProEnum/components/Group.js +38 -30
- package/es/ProEnum/components/Tag.js +22 -26
- package/es/ProEnum/hooks/useEnum.js +48 -116
- package/es/ProEnum/hooks/useEnumRequest.js +182 -212
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +40 -48
- package/es/ProEnum/index.js +162 -172
- package/es/ProEnum/propsType.js +0 -1
- package/es/ProEnum/utils/eventCenter.js +10 -12
- package/es/ProEnum/utils/frequentEnum.js +35 -92
- package/es/ProEnum/utils/getEnum.js +32 -90
- package/es/ProEnum/utils/getEnumLabel.js +44 -49
- package/es/ProEnum/utils/index.js +93 -207
- package/es/ProForm/components/Container.js +13 -28
- package/es/ProForm/components/FormFooter/index.js +36 -44
- package/es/ProForm/components/FormFooter/propsType.js +0 -1
- package/es/ProForm/components/base/Checkbox/index.js +32 -59
- package/es/ProForm/components/base/DatePicker/index.js +49 -71
- package/es/ProForm/components/base/Input/index.js +63 -97
- package/es/ProForm/components/base/Input/propsType.js +0 -1
- package/es/ProForm/components/base/InputNumber/index.js +118 -172
- package/es/ProForm/components/base/Radio/index.js +39 -52
- package/es/ProForm/components/base/RangePicker/index.js +109 -127
- package/es/ProForm/components/base/RangePicker/useDateRange.js +20 -17
- package/es/ProForm/components/base/Select/index.js +63 -89
- package/es/ProForm/components/base/Switch/index.js +27 -35
- package/es/ProForm/components/base/SwitchCheckbox/index.js +36 -54
- package/es/ProForm/components/base/TextArea/index.js +30 -41
- package/es/ProForm/components/base/TimePicker/index.js +27 -37
- package/es/ProForm/components/combination/Container/index.js +37 -47
- package/es/ProForm/components/combination/Container/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +165 -237
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +98 -102
- package/es/ProForm/components/combination/FormList/components/Empty.js +28 -55
- package/es/ProForm/components/combination/FormList/components/LineFields.js +57 -54
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +61 -109
- package/es/ProForm/components/combination/FormList/index.js +151 -161
- package/es/ProForm/components/combination/FormList/propsType.js +0 -1
- package/es/ProForm/components/combination/FormList/style/index.less +6 -0
- package/es/ProForm/components/combination/FormList/utils.js +22 -38
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +12 -28
- package/es/ProForm/components/combination/Group/component/ComRender.js +50 -111
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +106 -213
- package/es/ProForm/components/combination/Group/hooks/index.js +69 -129
- package/es/ProForm/components/combination/Group/index.js +87 -126
- package/es/ProForm/components/combination/Group/propsType.js +0 -1
- package/es/ProForm/components/combination/Group/utils/index.js +124 -239
- package/es/ProForm/components/combination/ProCascader/index.js +156 -199
- package/es/ProForm/components/combination/ProCascader/propsType.js +0 -1
- package/es/ProForm/components/combination/ProCascader/utils/index.js +12 -21
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +72 -70
- package/es/ProForm/components/combination/ProModalSelect/index.js +309 -347
- package/es/ProForm/components/combination/ProModalSelect/propsType.js +0 -1
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +32 -39
- package/es/ProForm/components/combination/ProNumberRange/index.js +100 -156
- package/es/ProForm/components/combination/ProNumberRange/propsType.js +0 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +104 -115
- package/es/ProForm/components/combination/ProRangeLimit/propsType.js +0 -1
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +16 -16
- package/es/ProForm/components/combination/ProTimeLimit/index.js +75 -109
- package/es/ProForm/components/index.js +56 -34
- package/es/ProForm/components/render/ChangedWrapper.js +85 -94
- package/es/ProForm/components/render/ConfirmWrapper.js +27 -39
- package/es/ProForm/components/render/CustomComponentViewWrapper.js +65 -82
- package/es/ProForm/components/render/Render.js +223 -329
- package/es/ProForm/components/render/RenderFields.js +76 -113
- package/es/ProForm/components/render/propsType.js +0 -1
- package/es/ProForm/hooks/useControlled.js +8 -10
- package/es/ProForm/hooks/useDeepCompareMemo.js +11 -11
- package/es/ProForm/hooks/useFieldProps.js +8 -4
- package/es/ProForm/hooks/useForm.js +50 -110
- package/es/ProForm/hooks/useRules.js +17 -33
- package/es/ProForm/hooks/useShouldUpdate.js +77 -152
- package/es/ProForm/hooks/useWatch.js +62 -134
- package/es/ProForm/index.js +157 -194
- package/es/ProForm/propsType.js +15 -7
- package/es/ProForm/utils/buildFormItemProps.js +51 -58
- package/es/ProForm/utils/diffOriginal.js +43 -73
- package/es/ProForm/utils/getDefaultProps.js +18 -24
- package/es/ProForm/utils/index.js +160 -235
- package/es/ProForm/utils/processDependencies.js +21 -60
- package/es/ProForm/utils/reactiveValues.js +20 -34
- package/es/ProForm/utils/rulesCreator.js +42 -40
- package/es/ProForm/utils/transformNames.js +10 -13
- package/es/ProForm/utils/transformValue.js +16 -29
- package/es/ProForm/utils/valueType.js +96 -178
- package/es/ProIcon/config/index.js +340 -274
- package/es/ProIcon/index.js +135 -209
- package/es/ProIcon/propsTypes.js +0 -1
- package/es/ProIcon/utils/index.js +24 -39
- package/es/ProLayout/components/Layout/Header/index.js +108 -141
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +134 -190
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +113 -139
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +0 -1
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +23 -31
- package/es/ProLayout/components/Layout/Menu/index.js +92 -89
- package/es/ProLayout/components/Layout/Notice/index.js +13 -27
- package/es/ProLayout/components/Layout/index.js +8 -3
- package/es/ProLayout/components/ProCollapse/PropTypes.js +0 -1
- package/es/ProLayout/components/ProCollapse/index.js +89 -111
- package/es/ProLayout/components/ProFooter/PropTypes.js +0 -1
- package/es/ProLayout/components/ProFooter/index.js +27 -24
- package/es/ProLayout/components/ProHeader/PropTypes.js +0 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +23 -21
- package/es/ProLayout/components/ProHeader/components/Describe/index.js +67 -84
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +18 -21
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +0 -1
- package/es/ProLayout/components/ProHeader/components/index.js +6 -2
- package/es/ProLayout/components/ProHeader/index.js +216 -356
- package/es/ProLayout/components/ProHeader/utils/index.js +19 -26
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +92 -85
- package/es/ProLayout/components/TabsManager/components/TabItem.js +53 -63
- package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -5
- package/es/ProLayout/components/TabsManager/components/TabsHeader.js +42 -52
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +8 -9
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.js +19 -32
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +6 -20
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +25 -42
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +320 -350
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.d.ts +19 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.js +332 -0
- package/es/ProLayout/components/TabsManager/index.js +407 -351
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +4 -0
- package/es/ProLayout/components/TabsManager/propTypes.js +7 -15
- package/es/ProLayout/components/TabsManager/style/index.less +1 -1
- package/es/ProLayout/components/TabsManager/utils/historyObserver.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/utils/historyObserver.js +65 -0
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +15 -2
- package/es/ProLayout/components/TabsManager/utils/index.js +156 -159
- package/es/ProLayout/components/index.js +8 -3
- package/es/ProLayout/index.js +173 -228
- package/es/ProLayout/propTypes.d.ts +28 -1
- package/es/ProLayout/propTypes.js +12 -52
- package/es/ProLayout/utils/index.js +48 -128
- package/es/ProSelect/components/AdaptiveTooltip.js +26 -25
- package/es/ProSelect/index.js +187 -223
- package/es/ProSelect/propsType.js +0 -1
- package/es/ProSelect/style/index.less +13 -0
- package/es/ProSelect/utils/index.js +100 -146
- package/es/ProStep/components/Anchor/index.js +71 -82
- package/es/ProStep/components/Item/index.js +49 -56
- package/es/ProStep/components/LazyLoad/index.js +23 -29
- package/es/ProStep/components/Listener/index.js +20 -33
- package/es/ProStep/components/Step/index.js +31 -38
- package/es/ProStep/constants.js +4 -1
- package/es/ProStep/index.js +166 -153
- package/es/ProStep/propsType.js +0 -1
- package/es/ProStep/style/index.less +1 -1
- package/es/ProStep/utils/index.js +29 -55
- package/es/ProStepTab/index.js +83 -138
- package/es/ProStepTab/propsType.js +0 -1
- package/es/ProTable/components/EditableCell/EditIcon.js +10 -14
- package/es/ProTable/components/EditableCell/index.js +37 -71
- package/es/ProTable/components/EditableCell/propsType.js +0 -1
- package/es/ProTable/components/FormatColumn/index.js +209 -340
- package/es/ProTable/components/FormatColumn/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +35 -39
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +80 -107
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +54 -48
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +47 -54
- package/es/ProTable/components/RcTable/index.js +6 -4
- package/es/ProTable/components/RenderColumn/index.js +158 -186
- package/es/ProTable/components/RenderEmptyText/index.js +12 -21
- package/es/ProTable/components/RenderFooter/index.js +15 -15
- package/es/ProTable/components/RenderSummary/index.js +33 -50
- package/es/ProTable/components/RenderTableHeader/index.js +44 -46
- package/es/ProTable/components/RenderTabs/index.js +47 -51
- package/es/ProTable/components/TableResizable/index.js +56 -72
- package/es/ProTable/components/TooltipTitle/index.js +13 -21
- package/es/ProTable/components/index.js +16 -36
- package/es/ProTable/hooks/useAntdTable.js +191 -224
- package/es/ProTable/index.js +232 -249
- package/es/ProTable/propsType.js +0 -1
- package/es/ProTable/utils/columnStorage.js +63 -88
- package/es/ProTable/utils/index.js +57 -90
- package/es/ProTabs/components/Card/index.js +20 -48
- package/es/ProTabs/components/index.js +4 -1
- package/es/ProTabs/index.js +41 -58
- package/es/ProTabs/propType.js +0 -1
- package/es/ProThemeTools/component/ProTools/index.js +106 -158
- package/es/ProThemeTools/component/index.js +4 -1
- package/es/ProThemeTools/context/ThemeContext.js +67 -146
- package/es/ProThemeTools/index.js +103 -156
- package/es/ProThemeTools/propsType.js +0 -1
- package/es/ProThemeTools/utils/index.js +60 -109
- package/es/ProTooltip/index.js +132 -168
- package/es/ProTooltip/propsType.js +0 -1
- package/es/ProTree/components/AdaptiveTooltip.js +15 -17
- package/es/ProTree/components/CloseIcon.js +18 -26
- package/es/ProTree/components/List.js +28 -47
- package/es/ProTree/components/ProTree.js +152 -211
- package/es/ProTree/components/ProTreeSelect/index.js +255 -459
- package/es/ProTree/components/ProTreeSelect/propsType.js +0 -1
- package/es/ProTree/components/SearchTitle.js +23 -42
- package/es/ProTree/components/Tree.js +147 -195
- package/es/ProTree/components/index.js +10 -5
- package/es/ProTree/index.js +12 -16
- package/es/ProTree/propsType.js +0 -1
- package/es/ProTree/utils.js +46 -118
- package/es/ProTreeModal/components/Cascader.js +56 -64
- package/es/ProTreeModal/components/CloseIcon.js +18 -26
- package/es/ProTreeModal/components/List.js +114 -180
- package/es/ProTreeModal/components/SearchTitle.js +15 -18
- package/es/ProTreeModal/components/SortableItem.js +29 -58
- package/es/ProTreeModal/components/Tree.js +99 -113
- package/es/ProTreeModal/components/Trigger.js +87 -121
- package/es/ProTreeModal/components/index.js +14 -6
- package/es/ProTreeModal/index.js +397 -438
- package/es/ProTreeModal/propsType.js +0 -1
- package/es/ProTreeModal/utils.js +52 -95
- package/es/ProUpload/components/ButtonRender.js +44 -54
- package/es/ProUpload/components/DragRender.js +94 -148
- package/es/ProUpload/components/DraggableUploadListItem.js +12 -25
- package/es/ProUpload/components/Example.js +27 -31
- package/es/ProUpload/components/FileItem.js +69 -163
- package/es/ProUpload/components/ImageRender.js +134 -170
- package/es/ProUpload/index.js +68 -100
- package/es/ProUpload/propsType.js +0 -1
- package/es/ProUpload/uitls.js +8 -4
- package/es/ProUtils/utils/index.js +17 -13
- package/es/ProViewer/index.js +154 -175
- package/es/ProViewer/propsType.js +0 -5
- package/es/ProWaterMark/index.js +9 -16
- package/es/ProWaterMark/propsType.js +0 -1
- package/es/hooks/useDraggableRow.js +25 -53
- package/es/index.js +57 -77
- package/es/locale/en_US.js +153 -142
- package/es/locale/index.js +23 -36
- package/es/locale/zh_CN.js +145 -142
- package/es/tokens.js +84 -83
- package/es/utils/index.js +24 -51
- package/package.json +4 -2
- package/es/ProConfigProvider/demo/locale.js +0 -58
package/es/ProTable/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState, createContext, useRef, forwardRef } from "react";
|
|
3
|
+
import keyBy from "lodash/keyBy";
|
|
4
|
+
import assign from "lodash/assign";
|
|
5
|
+
import isObject from "lodash/isObject";
|
|
6
|
+
import { useDebounceEffect, useDeepCompareEffect, useSetState } from "ahooks";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import { Form } from "antd";
|
|
8
9
|
import { useProConfig } from "../index";
|
|
9
10
|
import { RenderTableHeader, RenderFooter, RenderTabs } from "./components";
|
|
10
11
|
import useAntdTable, { SELECTION_ALL, CURRENT_PAGE, UNCHECK_ALL } from "./hooks/useAntdTable";
|
|
@@ -14,27 +15,28 @@ import empty from "../assets/empty.png";
|
|
|
14
15
|
import resetSvg from "../assets/reset.svg";
|
|
15
16
|
import customColumnSvg from "../assets/customColumn.svg";
|
|
16
17
|
import { filterVisibleColumns, getColumnDataIndex, getRowKey } from "./utils";
|
|
17
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
baseStorage,
|
|
20
|
+
getColumnCache,
|
|
21
|
+
getColumnCacheSync,
|
|
22
|
+
removeColumnCache,
|
|
23
|
+
setColumnCache
|
|
24
|
+
} from "./utils/columnStorage";
|
|
18
25
|
import locale from "../locale";
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
// 全局上下文
|
|
23
|
-
export const TableContext = /*#__PURE__*/createContext({});
|
|
24
|
-
export const defaultPage = {
|
|
26
|
+
const defaultCacheTime = 1;
|
|
27
|
+
const TableContext = createContext({});
|
|
28
|
+
const defaultPage = {
|
|
25
29
|
pageNum: 1,
|
|
26
30
|
pageSize: 10
|
|
27
31
|
};
|
|
28
|
-
const ProTable =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = useProConfig('globalConfig') || {}; // 获取全局缓存位置配置
|
|
32
|
-
|
|
32
|
+
const ProTable = forwardRef((props, tableRef) => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
const { storage: configStorage } = useProConfig("globalConfig") || {};
|
|
33
35
|
const {
|
|
34
36
|
resizeColumn: configResizeColumn,
|
|
35
37
|
columnConfig: configTColumnConfig,
|
|
36
38
|
cacheTime: configCacheTime
|
|
37
|
-
} = useProConfig(
|
|
39
|
+
} = useProConfig("ProTable") || {};
|
|
38
40
|
const {
|
|
39
41
|
tableId,
|
|
40
42
|
headerRender,
|
|
@@ -48,38 +50,26 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
48
50
|
isView = false,
|
|
49
51
|
rowDisabled,
|
|
50
52
|
summary,
|
|
51
|
-
emptyText = locale
|
|
53
|
+
emptyText = (_b = (_a = locale) == null ? void 0 : _a.ProTable) == null ? void 0 : _b.noData,
|
|
52
54
|
diffConfig,
|
|
53
55
|
onDragStart: onDragStartGuard,
|
|
54
56
|
onDragEnd: onDragEndGuard,
|
|
55
57
|
tabs,
|
|
56
|
-
editMode =
|
|
58
|
+
editMode = "per-cell-form",
|
|
57
59
|
...restProps
|
|
58
60
|
} = props;
|
|
59
|
-
|
|
60
|
-
// shared-form 模式下顶层创建一份 Form 实例,所有 EditableCell 复用;
|
|
61
|
-
// per-cell-form 默认模式下不消费此实例(antd 的 useForm 必须无条件调用以满足 hooks rule)
|
|
62
61
|
const [sharedForm] = Form.useForm();
|
|
63
|
-
const {
|
|
64
|
-
|
|
65
|
-
} = props;
|
|
66
|
-
let _scroll = props?.scroll ?? {
|
|
67
|
-
x: 'max-content'
|
|
68
|
-
};
|
|
62
|
+
const { scrollFollowParent = true } = props;
|
|
63
|
+
let _scroll = (props == null ? void 0 : props.scroll) ?? { x: "max-content" };
|
|
69
64
|
const wrapToolTipProps = {
|
|
70
|
-
getPopupContainer: scrollFollowParent ? triggerNode => triggerNode.parentNode : () => document.body
|
|
65
|
+
getPopupContainer: scrollFollowParent ? (triggerNode) => triggerNode.parentNode : () => document.body
|
|
71
66
|
};
|
|
72
|
-
const {
|
|
73
|
-
originalDataSource,
|
|
74
|
-
changeTipColor,
|
|
75
|
-
addTipColor,
|
|
76
|
-
toolTip
|
|
77
|
-
} = diffConfig || {};
|
|
67
|
+
const { originalDataSource, changeTipColor, addTipColor, toolTip } = diffConfig || {};
|
|
78
68
|
const quickTableConfig = quickConfig ? {
|
|
79
69
|
columnConfig: true,
|
|
80
70
|
cacheTime: true,
|
|
81
71
|
...restProps
|
|
82
|
-
} : restProps
|
|
72
|
+
} : (restProps == null ? void 0 : restProps.columnConfig) ? {
|
|
83
73
|
cacheTime: true,
|
|
84
74
|
...restProps
|
|
85
75
|
} : restProps;
|
|
@@ -90,20 +80,14 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
90
80
|
storage = configStorage,
|
|
91
81
|
...tableProps
|
|
92
82
|
} = quickTableConfig;
|
|
93
|
-
const {
|
|
94
|
-
|
|
95
|
-
dataSource,
|
|
96
|
-
rowKey
|
|
97
|
-
} = tableProps || {};
|
|
98
|
-
const initDataSource = dataSource?.map(item => {
|
|
83
|
+
const { pagination, dataSource, rowKey } = tableProps || {};
|
|
84
|
+
const initDataSource = dataSource == null ? void 0 : dataSource.map((item) => {
|
|
99
85
|
return {
|
|
100
86
|
...item,
|
|
101
87
|
rowKey: getRowKey(rowKey, item)
|
|
102
88
|
};
|
|
103
89
|
});
|
|
104
|
-
const [{
|
|
105
|
-
dataSource: _dataSource
|
|
106
|
-
}, setState] = useSetState({
|
|
90
|
+
const [{ dataSource: _dataSource }, setState] = useSetState({
|
|
107
91
|
dataSource: initDataSource
|
|
108
92
|
});
|
|
109
93
|
useDeepCompareEffect(() => {
|
|
@@ -111,57 +95,58 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
111
95
|
dataSource: initDataSource
|
|
112
96
|
});
|
|
113
97
|
}, [initDataSource]);
|
|
114
|
-
const _originalDataSource = originalDataSource
|
|
98
|
+
const _originalDataSource = originalDataSource == null ? void 0 : originalDataSource.map((item) => {
|
|
115
99
|
return {
|
|
116
100
|
...item,
|
|
117
101
|
rowKey: getRowKey(props.rowKey, item)
|
|
118
102
|
};
|
|
119
103
|
});
|
|
120
|
-
const originalObj = _originalDataSource ?
|
|
121
|
-
const propsColumnObj = useMemo(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} = window.location;
|
|
131
|
-
|
|
132
|
-
const pathKey = `${pathname}/${tableId || ''}`;
|
|
133
|
-
|
|
134
|
-
// 默认 storage 为 'indexedDB'(baseStorage),与 ProEnum 一致
|
|
104
|
+
const originalObj = _originalDataSource ? keyBy(_originalDataSource, "rowKey") : void 0;
|
|
105
|
+
const propsColumnObj = useMemo(
|
|
106
|
+
() => propsColumns.reduce((acc, cur) => {
|
|
107
|
+
acc[getColumnDataIndex(cur.dataIndex)] = {
|
|
108
|
+
...cur
|
|
109
|
+
};
|
|
110
|
+
return acc;
|
|
111
|
+
}, {}),
|
|
112
|
+
[propsColumns]
|
|
113
|
+
);
|
|
114
|
+
const { pathname } = window.location;
|
|
115
|
+
const pathKey = `${pathname}/${tableId || ""}`;
|
|
135
116
|
const effectiveStorage = storage ?? baseStorage;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
// indexedDB 模式:异步加载 + setState 平滑替换(不闪烁)
|
|
117
|
+
const [columnEntry, setColumnEntry] = useState(
|
|
118
|
+
() => getColumnCacheSync(effectiveStorage, pathKey)
|
|
119
|
+
);
|
|
141
120
|
useEffect(() => {
|
|
142
|
-
if (effectiveStorage !==
|
|
121
|
+
if (effectiveStorage !== "indexedDB")
|
|
122
|
+
return;
|
|
143
123
|
let cancelled = false;
|
|
144
|
-
Promise.resolve(getColumnCache(effectiveStorage, pathKey)).then(entry => {
|
|
145
|
-
if (cancelled)
|
|
146
|
-
|
|
124
|
+
Promise.resolve(getColumnCache(effectiveStorage, pathKey)).then((entry) => {
|
|
125
|
+
if (cancelled)
|
|
126
|
+
return;
|
|
127
|
+
if (entry)
|
|
128
|
+
setColumnEntry(entry);
|
|
147
129
|
});
|
|
148
130
|
return () => {
|
|
149
131
|
cancelled = true;
|
|
150
132
|
};
|
|
151
133
|
}, [effectiveStorage, pathKey]);
|
|
152
|
-
const startTime = columnEntry
|
|
134
|
+
const startTime = columnEntry == null ? void 0 : columnEntry.startTime;
|
|
153
135
|
const [curColumns, setCurColumns] = useState(propsColumns);
|
|
154
136
|
useDeepCompareEffect(() => {
|
|
137
|
+
var _a2;
|
|
155
138
|
let localColumns;
|
|
156
|
-
const duration = (typeof cacheTime ===
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
139
|
+
const duration = (typeof cacheTime === "number" ? cacheTime : defaultCacheTime) * 864e5;
|
|
140
|
+
if (cacheTime && startTime && (/* @__PURE__ */ new Date()).getTime() - startTime < duration) {
|
|
141
|
+
localColumns = (_a2 = columnEntry == null ? void 0 : columnEntry.columns) == null ? void 0 : _a2.map((item) => {
|
|
142
|
+
var _a3;
|
|
143
|
+
return {
|
|
144
|
+
...propsColumnObj[getColumnDataIndex(item.dataIndex)],
|
|
145
|
+
dataIndex: item.dataIndex,
|
|
146
|
+
width: resizeColumn ? item == null ? void 0 : item.width : (_a3 = propsColumnObj[getColumnDataIndex(item.dataIndex)]) == null ? void 0 : _a3.width
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
localColumns = (localColumns == null ? void 0 : localColumns.length) === 0 ? void 0 : localColumns;
|
|
165
150
|
setCurColumns(localColumns || propsColumns);
|
|
166
151
|
} else {
|
|
167
152
|
setCurColumns(propsColumns);
|
|
@@ -169,28 +154,22 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
169
154
|
}, [pathKey, cacheTime, propsColumns, columnEntry]);
|
|
170
155
|
useEffect(() => {
|
|
171
156
|
if (!cacheTime && columnEntry) {
|
|
172
|
-
// 关闭缓存时,清理对应 table 缓存
|
|
173
157
|
removeColumnCache(effectiveStorage, pathKey);
|
|
174
158
|
}
|
|
175
159
|
}, [cacheTime, columnEntry, effectiveStorage, pathKey]);
|
|
176
|
-
|
|
177
|
-
// 重置列宽,恢复至props的columns列宽
|
|
178
160
|
const resetColumnWidth = () => {
|
|
179
161
|
const nextColumns = [...curColumns];
|
|
180
|
-
nextColumns
|
|
181
|
-
|
|
182
|
-
|
|
162
|
+
nextColumns == null ? void 0 : nextColumns.forEach((item) => {
|
|
163
|
+
var _a2, _b2;
|
|
164
|
+
if ((_a2 = propsColumnObj[item.dataIndex]) == null ? void 0 : _a2.width) {
|
|
165
|
+
item.width = (_b2 = propsColumnObj[item.dataIndex]) == null ? void 0 : _b2.width;
|
|
183
166
|
} else {
|
|
184
167
|
delete item.width;
|
|
185
168
|
}
|
|
186
169
|
});
|
|
187
170
|
setCurColumns(nextColumns);
|
|
188
171
|
};
|
|
189
|
-
|
|
190
|
-
// 列宽resize函数
|
|
191
|
-
const handleResize = index => (e, {
|
|
192
|
-
size
|
|
193
|
-
}) => {
|
|
172
|
+
const handleResize = (index) => (e, { size }) => {
|
|
194
173
|
const nextColumns = [...curColumns];
|
|
195
174
|
nextColumns[index] = {
|
|
196
175
|
...nextColumns[index],
|
|
@@ -198,17 +177,17 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
198
177
|
};
|
|
199
178
|
setCurColumns(nextColumns);
|
|
200
179
|
};
|
|
201
|
-
const _isInNewRow = record => {
|
|
180
|
+
const _isInNewRow = (record) => {
|
|
202
181
|
const recordKey = getRowKey(props.rowKey, record);
|
|
203
182
|
return !!(originalDataSource && !originalObj.hasOwnProperty(recordKey));
|
|
204
183
|
};
|
|
205
184
|
const _rowClassName = (record, index) => {
|
|
206
185
|
if (_isInNewRow(record)) {
|
|
207
|
-
return
|
|
186
|
+
return "new-cell";
|
|
208
187
|
}
|
|
209
188
|
};
|
|
210
|
-
const formatColumns = nextColumns => {
|
|
211
|
-
nextColumns
|
|
189
|
+
const formatColumns = (nextColumns) => {
|
|
190
|
+
nextColumns == null ? void 0 : nextColumns.forEach((item) => {
|
|
212
191
|
formatColumn({
|
|
213
192
|
column: item,
|
|
214
193
|
originalObj,
|
|
@@ -218,7 +197,7 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
218
197
|
scroll: _scroll,
|
|
219
198
|
isInNewRow: _isInNewRow,
|
|
220
199
|
editMode,
|
|
221
|
-
sharedForm: editMode ===
|
|
200
|
+
sharedForm: editMode === "shared-form" ? sharedForm : void 0
|
|
222
201
|
});
|
|
223
202
|
if (item.children && Array.isArray(item.children)) {
|
|
224
203
|
formatColumns(item.children);
|
|
@@ -227,102 +206,111 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
227
206
|
return nextColumns;
|
|
228
207
|
};
|
|
229
208
|
const columns = useMemo(() => {
|
|
230
|
-
const newColumns = curColumns
|
|
231
|
-
|
|
209
|
+
const newColumns = curColumns == null ? void 0 : curColumns.map((item, index) => {
|
|
210
|
+
var _a2;
|
|
211
|
+
if ((_a2 = propsColumnObj[getColumnDataIndex(item.dataIndex)]) == null ? void 0 : _a2.render) {
|
|
232
212
|
item.render = propsColumnObj[getColumnDataIndex(item.dataIndex)].render;
|
|
233
213
|
}
|
|
234
214
|
return {
|
|
235
215
|
ellipsis: resizeColumn,
|
|
236
216
|
...item,
|
|
237
217
|
width: item.width,
|
|
238
|
-
onHeaderCell: column => ({
|
|
218
|
+
onHeaderCell: (column) => ({
|
|
239
219
|
width: column.width,
|
|
240
220
|
minwidth: column.minWidth,
|
|
241
221
|
onDrag: handleResize(index)
|
|
242
222
|
})
|
|
243
223
|
};
|
|
244
|
-
}).filter(item => !item
|
|
224
|
+
}).filter((item) => !(item == null ? void 0 : item.delete));
|
|
245
225
|
const nextColumns = formatColumns(newColumns);
|
|
246
226
|
return nextColumns;
|
|
247
227
|
}, [curColumns, handleResize, _scroll, originalDataSource, originalObj, _isInNewRow]);
|
|
248
|
-
|
|
249
|
-
// 仅在 dev 环境针对 column.show 提示一次(按实例去重)
|
|
250
228
|
const showDeprecationWarnedRef = useRef(false);
|
|
251
229
|
const _columns = useMemo(() => {
|
|
252
|
-
const {
|
|
253
|
-
columns
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (usedShow && process.env.NODE_ENV !== 'production' && !showDeprecationWarnedRef.current) {
|
|
230
|
+
const { columns: filtered, usedShow } = filterVisibleColumns(
|
|
231
|
+
columns || []
|
|
232
|
+
);
|
|
233
|
+
if (usedShow && true && !showDeprecationWarnedRef.current) {
|
|
257
234
|
showDeprecationWarnedRef.current = true;
|
|
258
|
-
|
|
259
|
-
|
|
235
|
+
console.warn(
|
|
236
|
+
"[ProTable] column.show is deprecated, please use column.hidden (antd 5.13+ native) instead. column.show 已废弃,请改用 column.hidden(antd 5.13+ 原生支持)。"
|
|
237
|
+
);
|
|
260
238
|
}
|
|
261
239
|
return filtered;
|
|
262
240
|
}, [columns]);
|
|
263
|
-
const isExistPercentWidth = !!_columns
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
241
|
+
const isExistPercentWidth = !!(_columns == null ? void 0 : _columns.find(
|
|
242
|
+
(item) => {
|
|
243
|
+
var _a2;
|
|
244
|
+
return (item == null ? void 0 : item.width) && typeof (item == null ? void 0 : item.width) === "string" && ((_a2 = item == null ? void 0 : item.width) == null ? void 0 : _a2.endsWith("%"));
|
|
245
|
+
}
|
|
246
|
+
));
|
|
267
247
|
const hasEditConfigColumn = useMemo(() => {
|
|
268
|
-
const walk = (cols = []) => cols.some(
|
|
248
|
+
const walk = (cols = []) => cols.some(
|
|
249
|
+
(c) => Boolean(c == null ? void 0 : c.editConfig) || Array.isArray(c == null ? void 0 : c.children) && walk(c.children)
|
|
250
|
+
);
|
|
269
251
|
return walk(propsColumns);
|
|
270
252
|
}, [propsColumns]);
|
|
271
|
-
const shouldWrapSharedForm = editMode ===
|
|
253
|
+
const shouldWrapSharedForm = editMode === "shared-form" && hasEditConfigColumn;
|
|
272
254
|
if (isExistPercentWidth) {
|
|
273
|
-
_scroll = props
|
|
255
|
+
_scroll = props == null ? void 0 : props.scroll;
|
|
274
256
|
}
|
|
275
|
-
const handleColumnConfig = async checkList => {
|
|
257
|
+
const handleColumnConfig = async (checkList) => {
|
|
258
|
+
var _a2;
|
|
276
259
|
let newColumns = [];
|
|
277
|
-
if (checkList ===
|
|
260
|
+
if (checkList === "all") {
|
|
278
261
|
newColumns = propsColumns;
|
|
279
262
|
} else {
|
|
280
|
-
newColumns = checkList
|
|
281
|
-
...propsColumnObj
|
|
263
|
+
newColumns = checkList == null ? void 0 : checkList.map((item) => ({
|
|
264
|
+
...propsColumnObj == null ? void 0 : propsColumnObj[item]
|
|
282
265
|
}));
|
|
283
266
|
}
|
|
284
|
-
if (
|
|
267
|
+
if (isObject(columnConfig)) {
|
|
285
268
|
const catchColumns = {
|
|
286
269
|
[pathKey]: {
|
|
287
|
-
columns: newColumns.map(item => ({
|
|
270
|
+
columns: newColumns.map((item) => ({
|
|
288
271
|
dataIndex: item.dataIndex,
|
|
289
|
-
width: typeof item.width ===
|
|
272
|
+
width: typeof item.width === "number" ? Math.round(Number(item.width)) : item.width
|
|
290
273
|
}))
|
|
291
274
|
}
|
|
292
275
|
};
|
|
293
|
-
await columnConfig
|
|
276
|
+
await ((_a2 = columnConfig == null ? void 0 : columnConfig.onColumnOk) == null ? void 0 : _a2.call(columnConfig, catchColumns, newColumns));
|
|
294
277
|
}
|
|
295
278
|
setCurColumns(newColumns);
|
|
296
279
|
};
|
|
297
|
-
useDebounceEffect(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
280
|
+
useDebounceEffect(
|
|
281
|
+
() => {
|
|
282
|
+
if (cacheTime) {
|
|
283
|
+
const newEntry = {
|
|
284
|
+
startTime: (/* @__PURE__ */ new Date()).getTime(),
|
|
285
|
+
columns: curColumns == null ? void 0 : curColumns.map((item) => ({
|
|
286
|
+
dataIndex: item.dataIndex,
|
|
287
|
+
width: typeof item.width === "number" ? Math.round(Number(item.width)) : item.width
|
|
288
|
+
}))
|
|
289
|
+
};
|
|
290
|
+
setColumnCache(effectiveStorage, pathKey, newEntry);
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
[cacheTime, effectiveStorage, pathKey, curColumns],
|
|
294
|
+
{
|
|
295
|
+
wait: 100
|
|
307
296
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
297
|
+
);
|
|
298
|
+
const customColumns = useMemo(
|
|
299
|
+
() => propsColumns.map((item) => ({
|
|
300
|
+
label: item == null ? void 0 : item.title,
|
|
301
|
+
value: item == null ? void 0 : item.dataIndex,
|
|
302
|
+
disabled: item.fixed,
|
|
303
|
+
fixed: item.fixed
|
|
304
|
+
})),
|
|
305
|
+
[propsColumns]
|
|
306
|
+
);
|
|
307
|
+
const checkColumns = useMemo(() => curColumns == null ? void 0 : curColumns.map((item) => item == null ? void 0 : item.dataIndex), [curColumns]);
|
|
318
308
|
const cls = classnames({
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
309
|
+
"pro-table": true,
|
|
310
|
+
"pro-table-no-stripe": !stripe,
|
|
311
|
+
"pro-table-draggable-only": draggable && !(tableProps == null ? void 0 : tableProps.rowSelection),
|
|
322
312
|
[className]: className
|
|
323
313
|
});
|
|
324
|
-
|
|
325
|
-
// 复选框
|
|
326
314
|
const _rowSelection = tableProps.rowSelection ? {
|
|
327
315
|
fixed: draggable,
|
|
328
316
|
getCheckboxProps(record) {
|
|
@@ -336,12 +324,7 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
336
324
|
},
|
|
337
325
|
hideSelectAll: disabled || isView,
|
|
338
326
|
...tableProps.rowSelection
|
|
339
|
-
} :
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* 渲染表格选择器
|
|
343
|
-
* @returns rowSelection
|
|
344
|
-
*/
|
|
327
|
+
} : void 0;
|
|
345
328
|
const renderRowSelection = () => {
|
|
346
329
|
if (disabled || isView) {
|
|
347
330
|
return null;
|
|
@@ -351,115 +334,115 @@ const ProTable = /*#__PURE__*/forwardRef((props, tableRef) => {
|
|
|
351
334
|
fixed: true,
|
|
352
335
|
hideSelectAll: true,
|
|
353
336
|
renderCell: () => {
|
|
354
|
-
return
|
|
337
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
355
338
|
}
|
|
356
339
|
};
|
|
357
340
|
}
|
|
358
341
|
return _rowSelection;
|
|
359
342
|
};
|
|
360
|
-
const onDataSourceChange = async nextDataSource => {
|
|
343
|
+
const onDataSourceChange = async (nextDataSource) => {
|
|
361
344
|
setState({
|
|
362
345
|
dataSource: nextDataSource
|
|
363
346
|
});
|
|
364
|
-
|
|
365
|
-
_assign(dataSource, nextDataSource);
|
|
347
|
+
assign(dataSource, nextDataSource);
|
|
366
348
|
};
|
|
367
349
|
const TableComponent = draggable ? DraggableTable : BaseTable;
|
|
368
|
-
|
|
369
|
-
// 标记样式
|
|
370
350
|
const tagStyle = {
|
|
371
|
-
|
|
372
|
-
|
|
351
|
+
"--zaui-contract-bg": changeTipColor,
|
|
352
|
+
"--zaui-contract-bg-add": addTipColor
|
|
373
353
|
};
|
|
374
|
-
const tableContent =
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
dataSource: {
|
|
381
|
-
headerRender,
|
|
382
|
-
columnConfig,
|
|
383
|
-
resizeColumn,
|
|
384
|
-
resetSvg,
|
|
385
|
-
resetColumnWidth,
|
|
386
|
-
locale,
|
|
387
|
-
customColumns,
|
|
388
|
-
checkColumns,
|
|
389
|
-
handleColumnConfig,
|
|
390
|
-
customColumnSvg
|
|
391
|
-
}
|
|
392
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
393
|
-
className: "pro-table-container",
|
|
394
|
-
style: tagStyle,
|
|
395
|
-
children: [/*#__PURE__*/_jsx(TableComponent, {
|
|
396
|
-
ref: tableRef,
|
|
397
|
-
...restProps,
|
|
398
|
-
draggableProps: {
|
|
399
|
-
onChange: onDataSourceChange,
|
|
400
|
-
draggable,
|
|
401
|
-
rowKey,
|
|
402
|
-
onDragStartGuard,
|
|
403
|
-
onDragEndGuard
|
|
404
|
-
},
|
|
405
|
-
tableProps: {
|
|
406
|
-
value: _dataSource,
|
|
354
|
+
const tableContent = /* @__PURE__ */ jsxs("div", { className: cls, children: [
|
|
355
|
+
tabs && /* @__PURE__ */ jsx(RenderTabs, { ...tabs, formTableProps: restProps == null ? void 0 : restProps.formTableProps }),
|
|
356
|
+
/* @__PURE__ */ jsx(
|
|
357
|
+
RenderTableHeader,
|
|
358
|
+
{
|
|
359
|
+
dataSource: {
|
|
407
360
|
headerRender,
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
resizeColumn
|
|
413
|
-
},
|
|
414
|
-
emptyTextProps: {
|
|
415
|
-
empty,
|
|
361
|
+
columnConfig,
|
|
362
|
+
resizeColumn,
|
|
363
|
+
resetSvg,
|
|
364
|
+
resetColumnWidth,
|
|
416
365
|
locale,
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
dataSource: _dataSource
|
|
422
|
-
},
|
|
423
|
-
dataSource: _dataSource,
|
|
424
|
-
scroll: _scroll
|
|
425
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
426
|
-
className: "pro-table-resizable-line",
|
|
427
|
-
style: {
|
|
428
|
-
display: 'none'
|
|
366
|
+
customColumns,
|
|
367
|
+
checkColumns,
|
|
368
|
+
handleColumnConfig,
|
|
369
|
+
customColumnSvg
|
|
429
370
|
}
|
|
430
|
-
})]
|
|
431
|
-
}), /*#__PURE__*/_jsx(RenderFooter, {
|
|
432
|
-
dataSource: {
|
|
433
|
-
footerRender,
|
|
434
|
-
pagination,
|
|
435
|
-
_dataSource
|
|
436
371
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
372
|
+
),
|
|
373
|
+
/* @__PURE__ */ jsxs("div", { className: "pro-table-container", style: tagStyle, children: [
|
|
374
|
+
/* @__PURE__ */ jsx(
|
|
375
|
+
TableComponent,
|
|
376
|
+
{
|
|
377
|
+
ref: tableRef,
|
|
378
|
+
...restProps,
|
|
379
|
+
draggableProps: {
|
|
380
|
+
onChange: onDataSourceChange,
|
|
381
|
+
draggable,
|
|
382
|
+
rowKey,
|
|
383
|
+
onDragStartGuard,
|
|
384
|
+
onDragEndGuard
|
|
385
|
+
},
|
|
386
|
+
tableProps: {
|
|
387
|
+
value: _dataSource,
|
|
388
|
+
headerRender,
|
|
389
|
+
columns: _columns,
|
|
390
|
+
renderRowSelection,
|
|
391
|
+
rowClassName: _rowClassName,
|
|
392
|
+
disabled,
|
|
393
|
+
resizeColumn
|
|
394
|
+
},
|
|
395
|
+
emptyTextProps: {
|
|
396
|
+
empty,
|
|
397
|
+
locale,
|
|
398
|
+
emptyText
|
|
399
|
+
},
|
|
400
|
+
summaryProps: {
|
|
401
|
+
summary,
|
|
402
|
+
dataSource: _dataSource
|
|
403
|
+
},
|
|
404
|
+
dataSource: _dataSource,
|
|
405
|
+
scroll: _scroll
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ jsx("span", { className: "pro-table-resizable-line", style: { display: "none" } })
|
|
409
|
+
] }),
|
|
410
|
+
/* @__PURE__ */ jsx(
|
|
411
|
+
RenderFooter,
|
|
412
|
+
{
|
|
413
|
+
dataSource: {
|
|
414
|
+
footerRender,
|
|
415
|
+
pagination,
|
|
416
|
+
_dataSource
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
] });
|
|
421
|
+
const legacyTableConfig = columnEntry ? { [pathKey]: columnEntry } : {};
|
|
422
|
+
const legacyStorage = effectiveStorage === "localStorage" ? window.localStorage : effectiveStorage === "sessionStorage" ? window.sessionStorage : null;
|
|
423
|
+
return /* @__PURE__ */ jsx(
|
|
424
|
+
TableContext.Provider,
|
|
425
|
+
{
|
|
426
|
+
value: {
|
|
427
|
+
pathKey,
|
|
428
|
+
tableConfig: legacyTableConfig,
|
|
429
|
+
Storage: legacyStorage
|
|
430
|
+
},
|
|
431
|
+
children: shouldWrapSharedForm ? /* @__PURE__ */ jsx(Form, { form: sharedForm, component: false, children: tableContent }) : tableContent
|
|
432
|
+
}
|
|
433
|
+
);
|
|
459
434
|
});
|
|
460
435
|
ProTable.useAntdTable = useAntdTable;
|
|
461
436
|
ProTable.SELECTION_ALL = SELECTION_ALL;
|
|
462
437
|
ProTable.CURRENT_PAGE = CURRENT_PAGE;
|
|
463
438
|
ProTable.UNCHECK_ALL = UNCHECK_ALL;
|
|
464
|
-
|
|
465
|
-
|
|
439
|
+
import { getColumnCache as getColumnCache2, setColumnCache as setColumnCache2, removeColumnCache as removeColumnCache2 } from "./utils/columnStorage";
|
|
440
|
+
var ProTable_default = ProTable;
|
|
441
|
+
export {
|
|
442
|
+
TableContext,
|
|
443
|
+
ProTable_default as default,
|
|
444
|
+
defaultPage,
|
|
445
|
+
getColumnCache2 as getColumnCache,
|
|
446
|
+
removeColumnCache2 as removeColumnCache,
|
|
447
|
+
setColumnCache2 as setColumnCache
|
|
448
|
+
};
|