@zat-design/sisyphus-react 4.5.0 → 4.5.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/ProDrawerForm/components/ProDrawer/index.js +58 -86
- package/es/ProDrawerForm/components/ProModal/index.js +44 -20
- package/es/ProDrawerForm/hooks/useConfirmClose.js +70 -0
- package/es/ProDrawerForm/index.js +7 -11
- package/es/ProDrawerForm/utils/index.js +36 -0
- package/es/ProEditTable/components/RcTable/BaseTable.js +10 -0
- package/es/ProEditTable/components/Summary/index.js +3 -2
- package/es/ProEditTable/utils/tools.js +1 -1
- package/es/ProEnum/index.js +6 -3
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +7 -6
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +4 -3
- package/es/ProForm/components/combination/ProModalSelect/index.js +7 -2
- package/es/ProForm/components/combination/ProModalSelect/utils/mergeSelectedRows.js +26 -0
- package/es/ProForm/components/render/RenderFields.js +3 -1
- package/es/ProForm/hooks/useWatch.js +8 -10
- package/es/ProLayout/components/ProHeader/index.js +28 -15
- package/es/ProSelect/index.js +77 -178
- package/es/ProSelect/utils/index.js +174 -0
- package/es/ProTree/components/ProTreeSelect/index.js +41 -14
- package/es/ProTree/components/ProTreeSelect/style/index.less +13 -4
- package/es/ProTree/style/index.less +20 -9
- package/es/ProTree/utils.js +26 -0
- package/es/ProTreeModal/style/index.less +1 -1
- package/es/ProUpload/components/DragRender.js +2 -1
- package/es/ProUpload/index.js +1 -1
- package/es/ProViewer/propsType.js +3 -1
- package/es/index.js +10 -0
- package/package.json +7 -13
- package/es/FormsProvider/index.d.ts +0 -18
- package/es/ProAction/components/CheckModalContent/index.d.ts +0 -8
- package/es/ProAction/index.d.ts +0 -7
- package/es/ProAction/propsType.d.ts +0 -45
- package/es/ProConfigProvider/index.d.ts +0 -9
- package/es/ProConfigProvider/propsType.d.ts +0 -78
- package/es/ProDownload/index.d.ts +0 -6
- package/es/ProDownload/propsType.d.ts +0 -71
- package/es/ProDownload/utils.d.ts +0 -60
- package/es/ProDrawerForm/components/ProDrawer/index.d.ts +0 -7
- package/es/ProDrawerForm/components/ProModal/index.d.ts +0 -7
- package/es/ProDrawerForm/components/index.d.ts +0 -2
- package/es/ProDrawerForm/index.d.ts +0 -6
- package/es/ProDrawerForm/propsType.d.ts +0 -100
- package/es/ProDrawerForm/utils/index.d.ts +0 -6
- package/es/ProEditLabel/components/RenderProForm.d.ts +0 -4
- package/es/ProEditLabel/index.d.ts +0 -4
- package/es/ProEditLabel/propsType.d.ts +0 -163
- package/es/ProEditLabel/utils/index.d.ts +0 -7
- package/es/ProEditTable/components/ActionButton/index.d.ts +0 -2
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +0 -6
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +0 -7
- package/es/ProEditTable/components/RcTable/index.d.ts +0 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +0 -4
- package/es/ProEditTable/components/RenderField/index.d.ts +0 -3
- package/es/ProEditTable/components/RenderField/propsType.d.ts +0 -30
- package/es/ProEditTable/components/RenderField/tools.d.ts +0 -22
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +0 -2
- package/es/ProEditTable/components/Summary/index.d.ts +0 -12
- package/es/ProEditTable/components/Validator/index.d.ts +0 -19
- package/es/ProEditTable/components/index.d.ts +0 -5
- package/es/ProEditTable/index.d.ts +0 -4
- package/es/ProEditTable/propsType.d.ts +0 -437
- package/es/ProEditTable/utils/config.d.ts +0 -25
- package/es/ProEditTable/utils/diffOriginal.d.ts +0 -22
- package/es/ProEditTable/utils/getDefaultProps.d.ts +0 -1
- package/es/ProEditTable/utils/index.d.ts +0 -23
- package/es/ProEditTable/utils/tools.d.ts +0 -128
- package/es/ProEditTable/utils/transform.d.ts +0 -13
- package/es/ProEditTable/utils/useEditTableError.d.ts +0 -7
- package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +0 -16
- package/es/ProEditTable/utils/validateAll.d.ts +0 -89
- package/es/ProEnum/components/Group.d.ts +0 -10
- package/es/ProEnum/components/Tag.d.ts +0 -7
- package/es/ProEnum/hooks/useEnum.d.ts +0 -29
- package/es/ProEnum/hooks/useEnumRequest.d.ts +0 -4
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +0 -14
- package/es/ProEnum/index.d.ts +0 -10
- package/es/ProEnum/propsType.d.ts +0 -310
- package/es/ProEnum/utils/eventCenter.d.ts +0 -1
- package/es/ProEnum/utils/frequentEnum.d.ts +0 -39
- package/es/ProEnum/utils/getEnum.d.ts +0 -47
- package/es/ProEnum/utils/getEnumLabel.d.ts +0 -2
- package/es/ProEnum/utils/index.d.ts +0 -84
- package/es/ProForm/components/Container.d.ts +0 -9
- package/es/ProForm/components/FormFooter/index.d.ts +0 -5
- package/es/ProForm/components/FormFooter/propsType.d.ts +0 -22
- package/es/ProForm/components/base/Checkbox/index.d.ts +0 -14
- package/es/ProForm/components/base/DatePicker/index.d.ts +0 -11
- package/es/ProForm/components/base/Input/index.d.ts +0 -3
- package/es/ProForm/components/base/Input/propsType.d.ts +0 -21
- package/es/ProForm/components/base/InputNumber/index.d.ts +0 -11
- package/es/ProForm/components/base/Radio/index.d.ts +0 -15
- package/es/ProForm/components/base/RangePicker/index.d.ts +0 -19
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +0 -15
- package/es/ProForm/components/base/Select/index.d.ts +0 -11
- package/es/ProForm/components/base/Switch/index.d.ts +0 -10
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +0 -10
- package/es/ProForm/components/base/TextArea/index.d.ts +0 -11
- package/es/ProForm/components/base/TimePicker/index.d.ts +0 -13
- package/es/ProForm/components/combination/Container/index.d.ts +0 -4
- package/es/ProForm/components/combination/Container/propsType.d.ts +0 -13
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +0 -24
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +0 -23
- package/es/ProForm/components/combination/FormList/components/Empty.d.ts +0 -13
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +0 -20
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +0 -12
- package/es/ProForm/components/combination/FormList/index.d.ts +0 -4
- package/es/ProForm/components/combination/FormList/propsType.d.ts +0 -69
- package/es/ProForm/components/combination/FormList/utils.d.ts +0 -18
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +0 -9
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +0 -28
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +0 -10
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -34
- package/es/ProForm/components/combination/Group/index.d.ts +0 -9
- package/es/ProForm/components/combination/Group/propsType.d.ts +0 -99
- package/es/ProForm/components/combination/Group/utils/index.d.ts +0 -154
- package/es/ProForm/components/combination/ProCascader/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +0 -48
- package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +0 -14
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.d.ts +0 -33
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +0 -106
- package/es/ProForm/components/combination/ProModalSelect/utils/index.d.ts +0 -1
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -85
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +0 -4
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +0 -23
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +0 -9
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -33
- package/es/ProForm/components/index.d.ts +0 -29
- package/es/ProForm/components/render/ChangedWrapper.d.ts +0 -17
- package/es/ProForm/components/render/ConfirmWrapper.d.ts +0 -10
- package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +0 -30
- package/es/ProForm/components/render/Render.d.ts +0 -4
- package/es/ProForm/components/render/RenderFields.d.ts +0 -26
- package/es/ProForm/components/render/propsType.d.ts +0 -279
- package/es/ProForm/hooks/useControlled.d.ts +0 -1
- package/es/ProForm/hooks/useDeepCompareMemo.d.ts +0 -2
- package/es/ProForm/hooks/useFieldProps.d.ts +0 -4
- package/es/ProForm/hooks/useForm.d.ts +0 -8
- package/es/ProForm/hooks/useRules.d.ts +0 -16
- package/es/ProForm/hooks/useShouldUpdate.d.ts +0 -31
- package/es/ProForm/hooks/useWatch.d.ts +0 -22
- package/es/ProForm/index.d.ts +0 -6
- package/es/ProForm/propsType.d.ts +0 -143
- package/es/ProForm/utils/buildFormItemProps.d.ts +0 -25
- package/es/ProForm/utils/diffOriginal.d.ts +0 -10
- package/es/ProForm/utils/getDefaultProps.d.ts +0 -1
- package/es/ProForm/utils/index.d.ts +0 -109
- package/es/ProForm/utils/processDependencies.d.ts +0 -29
- package/es/ProForm/utils/reactiveValues.d.ts +0 -34
- package/es/ProForm/utils/rulesCreator.d.ts +0 -7
- package/es/ProForm/utils/transformNames.d.ts +0 -10
- package/es/ProForm/utils/transformValue.d.ts +0 -6
- package/es/ProForm/utils/valueType.d.ts +0 -70
- package/es/ProIcon/config/index.d.ts +0 -19
- package/es/ProIcon/index.d.ts +0 -4
- package/es/ProIcon/propsTypes.d.ts +0 -175
- package/es/ProIcon/utils/index.d.ts +0 -6
- package/es/ProLayout/components/Layout/Header/index.d.ts +0 -4
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +0 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +0 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +0 -15
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.d.ts +0 -3
- package/es/ProLayout/components/Layout/Menu/index.d.ts +0 -4
- package/es/ProLayout/components/Layout/Notice/index.d.ts +0 -4
- package/es/ProLayout/components/Layout/index.d.ts +0 -3
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +0 -98
- package/es/ProLayout/components/ProCollapse/index.d.ts +0 -3
- package/es/ProLayout/components/ProFooter/PropTypes.d.ts +0 -27
- package/es/ProLayout/components/ProFooter/index.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +0 -206
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.d.ts +0 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/components/index.d.ts +0 -2
- package/es/ProLayout/components/ProHeader/index.d.ts +0 -4
- package/es/ProLayout/components/ProHeader/utils/index.d.ts +0 -5
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +0 -7
- package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +0 -26
- package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +0 -6
- package/es/ProLayout/components/TabsManager/components/TabsHeader.d.ts +0 -10
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +0 -6
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.d.ts +0 -25
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +0 -18
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +0 -31
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +0 -5
- package/es/ProLayout/components/TabsManager/index.d.ts +0 -7
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +0 -89
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +0 -47
- package/es/ProLayout/components/index.d.ts +0 -3
- package/es/ProLayout/index.d.ts +0 -20
- package/es/ProLayout/propTypes.d.ts +0 -533
- package/es/ProLayout/utils/index.d.ts +0 -43
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +0 -4
- package/es/ProSelect/index.d.ts +0 -5
- package/es/ProSelect/propsType.d.ts +0 -160
- package/es/ProSelect/utils/index.d.ts +0 -4
- package/es/ProStep/components/Anchor/index.d.ts +0 -4
- package/es/ProStep/components/Item/index.d.ts +0 -3
- package/es/ProStep/components/LazyLoad/index.d.ts +0 -19
- package/es/ProStep/components/Listener/index.d.ts +0 -4
- package/es/ProStep/components/Step/index.d.ts +0 -5
- package/es/ProStep/index.d.ts +0 -11
- package/es/ProStep/propsType.d.ts +0 -224
- package/es/ProStep/utils/index.d.ts +0 -22
- package/es/ProStepTab/index.d.ts +0 -22
- package/es/ProStepTab/propsType.d.ts +0 -114
- package/es/ProTable/components/EditableCell/EditIcon.d.ts +0 -6
- package/es/ProTable/components/EditableCell/index.d.ts +0 -4
- package/es/ProTable/components/EditableCell/propsType.d.ts +0 -24
- package/es/ProTable/components/FormatColumn/index.d.ts +0 -22
- package/es/ProTable/components/FormatColumn/propsType.d.ts +0 -29
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -3
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +0 -18
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.d.ts +0 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.d.ts +0 -61
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -3
- package/es/ProTable/components/RcTable/index.d.ts +0 -4
- package/es/ProTable/components/RenderColumn/index.d.ts +0 -22
- package/es/ProTable/components/RenderEmptyText/index.d.ts +0 -3
- package/es/ProTable/components/RenderFooter/index.d.ts +0 -2
- package/es/ProTable/components/RenderSummary/index.d.ts +0 -3
- package/es/ProTable/components/RenderTableHeader/index.d.ts +0 -2
- package/es/ProTable/components/RenderTabs/index.d.ts +0 -4
- package/es/ProTable/components/TableResizable/index.d.ts +0 -13
- package/es/ProTable/components/TooltipTitle/index.d.ts +0 -11
- package/es/ProTable/components/index.d.ts +0 -31
- package/es/ProTable/hooks/useAntdTable.d.ts +0 -7
- package/es/ProTable/index.d.ts +0 -17
- package/es/ProTable/propsType.d.ts +0 -792
- package/es/ProTable/utils/columnStorage.d.ts +0 -35
- package/es/ProTable/utils/index.d.ts +0 -52
- package/es/ProTabs/components/Card/index.d.ts +0 -3
- package/es/ProTabs/components/index.d.ts +0 -1
- package/es/ProTabs/index.d.ts +0 -4
- package/es/ProTabs/propType.d.ts +0 -94
- package/es/ProThemeTools/component/ProTools/index.d.ts +0 -3
- package/es/ProThemeTools/component/index.d.ts +0 -1
- package/es/ProThemeTools/context/ThemeContext.d.ts +0 -43
- package/es/ProThemeTools/index.d.ts +0 -9
- package/es/ProThemeTools/propsType.d.ts +0 -170
- package/es/ProThemeTools/utils/index.d.ts +0 -51
- package/es/ProTooltip/index.d.ts +0 -3
- package/es/ProTooltip/propsType.d.ts +0 -57
- package/es/ProTree/components/AdaptiveTooltip.d.ts +0 -4
- package/es/ProTree/components/CloseIcon.d.ts +0 -2
- package/es/ProTree/components/List.d.ts +0 -17
- package/es/ProTree/components/ProTree.d.ts +0 -3
- package/es/ProTree/components/ProTreeSelect/index.d.ts +0 -5
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +0 -439
- package/es/ProTree/components/SearchTitle.d.ts +0 -11
- package/es/ProTree/components/Tree.d.ts +0 -27
- package/es/ProTree/components/index.d.ts +0 -4
- package/es/ProTree/index.d.ts +0 -3
- package/es/ProTree/propsType.d.ts +0 -812
- package/es/ProTree/utils.d.ts +0 -52
- package/es/ProTreeModal/components/Cascader.d.ts +0 -14
- package/es/ProTreeModal/components/CloseIcon.d.ts +0 -2
- package/es/ProTreeModal/components/List.d.ts +0 -21
- package/es/ProTreeModal/components/SearchTitle.d.ts +0 -7
- package/es/ProTreeModal/components/SortableItem.d.ts +0 -12
- package/es/ProTreeModal/components/Tree.d.ts +0 -25
- package/es/ProTreeModal/components/Trigger.d.ts +0 -21
- package/es/ProTreeModal/components/index.d.ts +0 -6
- package/es/ProTreeModal/index.d.ts +0 -4
- package/es/ProTreeModal/propsType.d.ts +0 -298
- package/es/ProTreeModal/utils.d.ts +0 -39
- package/es/ProUpload/components/ButtonRender.d.ts +0 -20
- package/es/ProUpload/components/DragRender.d.ts +0 -21
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +0 -2
- package/es/ProUpload/components/Example.d.ts +0 -10
- package/es/ProUpload/components/FileItem.d.ts +0 -33
- package/es/ProUpload/components/ImageRender.d.ts +0 -19
- package/es/ProUpload/index.d.ts +0 -4
- package/es/ProUpload/propsType.d.ts +0 -264
- package/es/ProUpload/uitls.d.ts +0 -3
- package/es/ProUtils/utils/index.d.ts +0 -6
- package/es/ProViewer/index.d.ts +0 -4
- package/es/ProViewer/propsType.d.ts +0 -35
- package/es/ProWaterMark/index.d.ts +0 -4
- package/es/ProWaterMark/propsType.d.ts +0 -6
- package/es/hooks/useDraggableRow.d.ts +0 -34
- package/es/index.d.ts +0 -47
- package/es/locale/en_US.d.ts +0 -176
- package/es/locale/index.d.ts +0 -15
- package/es/locale/zh_CN.d.ts +0 -176
- package/es/tokens.d.ts +0 -83
- package/es/utils/index.d.ts +0 -20
|
@@ -10,7 +10,7 @@ import locale from "../../../locale";
|
|
|
10
10
|
import { useProConfig } from "../../../ProConfigProvider";
|
|
11
11
|
import Container from "../../../ProForm/components/Container";
|
|
12
12
|
import AdaptiveTooltip from "../AdaptiveTooltip";
|
|
13
|
-
import { getFlatTreeData, restoreCodeNameLabel } from "../../utils";
|
|
13
|
+
import { getFlatTreeData, restoreCodeNameLabel, applyCheckLeaf } from "../../utils";
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
15
|
const {
|
|
16
16
|
SHOW_PARENT
|
|
@@ -63,6 +63,8 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
63
63
|
className,
|
|
64
64
|
checkStrictly,
|
|
65
65
|
checkable,
|
|
66
|
+
checkLeaf,
|
|
67
|
+
// 开启后只能选择叶子节点,非叶子节点置灰禁用
|
|
66
68
|
...selectProps
|
|
67
69
|
} = props;
|
|
68
70
|
const {
|
|
@@ -153,6 +155,17 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
153
155
|
loop(copyData);
|
|
154
156
|
return copyData;
|
|
155
157
|
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 统一数据后处理:先处理 code-name 展示,再按 checkLeaf 标记非叶子节点禁用
|
|
161
|
+
* 数据已是标准格式(label, value, children)
|
|
162
|
+
* @param dataArr 标准格式数据
|
|
163
|
+
* @returns 后处理结果
|
|
164
|
+
*/
|
|
165
|
+
const processData = dataArr => {
|
|
166
|
+
const result = transferDataSource(dataArr, showCodeName);
|
|
167
|
+
return checkLeaf ? applyCheckLeaf(result) : result;
|
|
168
|
+
};
|
|
156
169
|
const defaultOnSuccessFun = res => {
|
|
157
170
|
const {
|
|
158
171
|
status = 200,
|
|
@@ -163,9 +176,9 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
163
176
|
message.error(msg);
|
|
164
177
|
return;
|
|
165
178
|
}
|
|
166
|
-
// 先转换字段名,再处理 code-name
|
|
179
|
+
// 先转换字段名,再处理 code-name 展示与 checkLeaf 标记
|
|
167
180
|
const transformedData = transformFieldNames(data || []);
|
|
168
|
-
const resultData =
|
|
181
|
+
const resultData = processData(transformedData);
|
|
169
182
|
setState({
|
|
170
183
|
selectList: resultData || [],
|
|
171
184
|
origDataSource: resultData || []
|
|
@@ -194,9 +207,9 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
194
207
|
onSuccess: data => {
|
|
195
208
|
if (transformResponse && typeof transformResponse === 'function') {
|
|
196
209
|
const responseData = transformResponse(data);
|
|
197
|
-
// 先转换字段名,再处理 code-name
|
|
210
|
+
// 先转换字段名,再处理 code-name 展示与 checkLeaf 标记
|
|
198
211
|
const transformedData = transformFieldNames(responseData);
|
|
199
|
-
const resultData =
|
|
212
|
+
const resultData = processData(transformedData);
|
|
200
213
|
setState({
|
|
201
214
|
selectList: countChild(resultData),
|
|
202
215
|
origDataSource: resultData
|
|
@@ -217,9 +230,9 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
217
230
|
if (fetchFunction?.data, useRequest?.options?.cacheKey) {
|
|
218
231
|
if (transformResponse && typeof transformResponse === 'function') {
|
|
219
232
|
const responseData = transformResponse(fetchFunction.data);
|
|
220
|
-
// 先转换字段名,再处理 code-name
|
|
233
|
+
// 先转换字段名,再处理 code-name 展示与 checkLeaf 标记
|
|
221
234
|
const transformedData = transformFieldNames(responseData);
|
|
222
|
-
const resultData =
|
|
235
|
+
const resultData = processData(transformedData);
|
|
223
236
|
setState({
|
|
224
237
|
selectList: countChild(resultData),
|
|
225
238
|
origDataSource: resultData
|
|
@@ -232,18 +245,18 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
232
245
|
useDeepCompareEffect(() => {
|
|
233
246
|
if (enumCode) {
|
|
234
247
|
const dictEnum = dics[enumCode] || [];
|
|
235
|
-
// 先转换字段名,再处理 code-name
|
|
248
|
+
// 先转换字段名,再处理 code-name 展示与 checkLeaf 标记
|
|
236
249
|
const transformedData = transformFieldNames(dictEnum);
|
|
237
|
-
const resultData =
|
|
250
|
+
const resultData = processData(transformedData);
|
|
238
251
|
const processedList = countChild(resultData);
|
|
239
252
|
setState({
|
|
240
253
|
selectList: processedList,
|
|
241
254
|
origDataSource: resultData
|
|
242
255
|
});
|
|
243
256
|
} else if (dataSource) {
|
|
244
|
-
// 先转换字段名,再处理 code-name
|
|
257
|
+
// 先转换字段名,再处理 code-name 展示与 checkLeaf 标记
|
|
245
258
|
const transformedData = transformFieldNames(dataSource);
|
|
246
|
-
const resultData =
|
|
259
|
+
const resultData = processData(transformedData);
|
|
247
260
|
const processedList = countChild(resultData);
|
|
248
261
|
setState({
|
|
249
262
|
selectList: processedList,
|
|
@@ -428,6 +441,22 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
428
441
|
});
|
|
429
442
|
};
|
|
430
443
|
|
|
444
|
+
// 把 filterTree 写入的高亮标记(纯文本分隔)转成安全的 React 节点,避免 dangerouslySetInnerHTML
|
|
445
|
+
const renderHighlightLabel = text => {
|
|
446
|
+
if (!text || !text.includes('highlight-search-text')) return text;
|
|
447
|
+
const parts = text.split(/(<span class="highlight-search-text">.*?<\/span>)/g);
|
|
448
|
+
return parts.map((part, i) => {
|
|
449
|
+
const match = part.match(/^<span class="highlight-search-text">(.*?)<\/span>$/);
|
|
450
|
+
if (match) {
|
|
451
|
+
return /*#__PURE__*/_jsx("span", {
|
|
452
|
+
className: "highlight-search-text",
|
|
453
|
+
children: match[1]
|
|
454
|
+
}, i);
|
|
455
|
+
}
|
|
456
|
+
return part;
|
|
457
|
+
});
|
|
458
|
+
};
|
|
459
|
+
|
|
431
460
|
/**
|
|
432
461
|
* 自定义渲染子树
|
|
433
462
|
* 注意:此时数据已经是标准格式(label, value, children)
|
|
@@ -459,9 +488,7 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
459
488
|
key = node?.value;
|
|
460
489
|
}
|
|
461
490
|
const titleHtml = /*#__PURE__*/_jsx("span", {
|
|
462
|
-
|
|
463
|
-
__html: labelText
|
|
464
|
-
}
|
|
491
|
+
children: renderHighlightLabel(labelText)
|
|
465
492
|
});
|
|
466
493
|
let searchKey = '';
|
|
467
494
|
if (showCodeName) {
|
|
@@ -30,12 +30,21 @@
|
|
|
30
30
|
width: auto !important;
|
|
31
31
|
padding: 0px;
|
|
32
32
|
}
|
|
33
|
-
&.
|
|
33
|
+
&.signal-tree,
|
|
34
34
|
&.checkable-tree {
|
|
35
35
|
.@{ant-prefix}-select-tree {
|
|
36
36
|
.@{ant-prefix}-select-tree-treenode {
|
|
37
|
-
padding-top:
|
|
38
|
-
padding-bottom:
|
|
37
|
+
padding-top: 2px;
|
|
38
|
+
padding-bottom: 2px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.@{ant-prefix}-select-tree-node-content-wrapper {
|
|
42
|
+
min-height: 20px;
|
|
43
|
+
line-height: 20px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.@{ant-prefix}-select-tree-switcher {
|
|
47
|
+
line-height: 24px;
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
.highlight {
|
|
@@ -101,7 +110,7 @@
|
|
|
101
110
|
background-color: transparent;
|
|
102
111
|
}
|
|
103
112
|
.@{ant-prefix}-select-tree-checkbox {
|
|
104
|
-
margin-top:
|
|
113
|
+
margin-top: 2px;
|
|
105
114
|
align-self: stretch;
|
|
106
115
|
}
|
|
107
116
|
}
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
background-color: transparent;
|
|
77
77
|
}
|
|
78
78
|
.@{ant-prefix}-tree-checkbox {
|
|
79
|
-
margin-top:
|
|
79
|
+
margin-top: 7px;
|
|
80
80
|
align-self: flex-start;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
.@{ant-prefix}-tree-switcher {
|
|
117
|
-
line-height:
|
|
117
|
+
line-height: 32px;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
.@{ant-prefix}-tree-switcher-leaf-line {
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
&-tree-node {
|
|
162
162
|
display: flex;
|
|
163
163
|
flex-direction: row;
|
|
164
|
-
padding:
|
|
164
|
+
padding: 6px var(--zaui-space-size-sm);
|
|
165
165
|
margin-left: -8px;
|
|
166
166
|
border-radius: var(--zaui-space-size-xs);
|
|
167
167
|
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
.@{ant-prefix}-tree-switcher {
|
|
270
270
|
width: 20px;
|
|
271
271
|
align-self: flex-start;
|
|
272
|
-
margin-top:
|
|
272
|
+
margin-top: 0;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
.@{ant-prefix}-tree-show-line .@{ant-prefix}-tree-indent-unit::before {
|
|
@@ -316,6 +316,9 @@
|
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
.pro-tree-operate-btn-popover {
|
|
319
|
+
overflow: hidden;
|
|
320
|
+
border-radius: var(--zaui-border-radius);
|
|
321
|
+
|
|
319
322
|
.icon-item {
|
|
320
323
|
position: relative;
|
|
321
324
|
z-index: 1;
|
|
@@ -330,14 +333,22 @@
|
|
|
330
333
|
&:after {
|
|
331
334
|
position: absolute;
|
|
332
335
|
display: block;
|
|
333
|
-
z-index:
|
|
334
|
-
|
|
335
|
-
top: 0;
|
|
336
|
+
z-index: -1;
|
|
337
|
+
inset: 0;
|
|
336
338
|
content: '';
|
|
337
|
-
width: 120px;
|
|
338
|
-
height: 32px;
|
|
339
339
|
background-color: var(--zaui-brand);
|
|
340
340
|
opacity: 0.08;
|
|
341
|
+
border-radius: var(--zaui-border-radius-card);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
&:first-child:after {
|
|
345
|
+
border-top-left-radius: var(--zaui-border-radius);
|
|
346
|
+
border-top-right-radius: var(--zaui-border-radius);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
&:last-child:after {
|
|
350
|
+
border-bottom-left-radius: var(--zaui-border-radius);
|
|
351
|
+
border-bottom-right-radius: var(--zaui-border-radius);
|
|
341
352
|
}
|
|
342
353
|
}
|
|
343
354
|
}
|
package/es/ProTree/utils.js
CHANGED
|
@@ -201,4 +201,30 @@ export function getDefaultExpandKeys(isExpand, allKeys) {
|
|
|
201
201
|
return allKeys;
|
|
202
202
|
}
|
|
203
203
|
return [];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* checkLeaf 模式:只能选择叶子节点,非叶子节点设 disabled=true 整行置灰不可点
|
|
208
|
+
* 数据已是标准格式(label, value, children),仅单选 treeSelect 场景使用
|
|
209
|
+
* 不可变:返回全新数组,不修改入参
|
|
210
|
+
* @param data 标准格式树数据
|
|
211
|
+
* @returns 标记后的新树数据
|
|
212
|
+
*/
|
|
213
|
+
export function applyCheckLeaf(data) {
|
|
214
|
+
if (!Array.isArray(data)) {
|
|
215
|
+
return data;
|
|
216
|
+
}
|
|
217
|
+
return data.map(node => {
|
|
218
|
+
const hasChildren = Array.isArray(node.children) && node.children.length > 0;
|
|
219
|
+
if (!hasChildren) {
|
|
220
|
+
return {
|
|
221
|
+
...node
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
...node,
|
|
226
|
+
disabled: true,
|
|
227
|
+
children: applyCheckLeaf(node.children)
|
|
228
|
+
};
|
|
229
|
+
});
|
|
204
230
|
}
|
|
@@ -86,7 +86,8 @@ const DragRender = props => {
|
|
|
86
86
|
children: [/*#__PURE__*/_jsx("div", {
|
|
87
87
|
className: "file-type-icon",
|
|
88
88
|
children: /*#__PURE__*/_jsx("img", {
|
|
89
|
-
src: _fileIcon
|
|
89
|
+
src: _fileIcon,
|
|
90
|
+
alt: ""
|
|
90
91
|
})
|
|
91
92
|
}), /*#__PURE__*/_jsx(DragSingleFileItem, {
|
|
92
93
|
file: file,
|
package/es/ProUpload/index.js
CHANGED
package/es/index.js
CHANGED
|
@@ -45,6 +45,8 @@ export { default as ProBackBtn } from "./ProLayout/components/ProHeader/componen
|
|
|
45
45
|
|
|
46
46
|
// ProTable 相关类型
|
|
47
47
|
|
|
48
|
+
// ProSelect 类型
|
|
49
|
+
|
|
48
50
|
// ProUpload 类型
|
|
49
51
|
|
|
50
52
|
// ProTabs 类型
|
|
@@ -63,9 +65,17 @@ export { default as ProBackBtn } from "./ProLayout/components/ProHeader/componen
|
|
|
63
65
|
|
|
64
66
|
// ProDrawerForm 类型
|
|
65
67
|
|
|
68
|
+
// ProEditLabel 类型
|
|
69
|
+
|
|
66
70
|
// ProModalSelect 类型
|
|
67
71
|
|
|
68
72
|
// ProStepTab 类型
|
|
69
73
|
|
|
74
|
+
// ProEnum 类型
|
|
75
|
+
|
|
76
|
+
// ProAction / ProDownload / ProViewer 类型
|
|
77
|
+
|
|
78
|
+
// ProWaterMark / ProThemeTools 类型
|
|
79
|
+
|
|
70
80
|
// token导出
|
|
71
81
|
export * from "./tokens";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"es",
|
|
@@ -48,35 +48,29 @@
|
|
|
48
48
|
],
|
|
49
49
|
"scripts": {
|
|
50
50
|
"analyze": "ANALYZE=1 dumi build",
|
|
51
|
-
"build": "father build && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css",
|
|
52
|
-
"build-
|
|
53
|
-
"build-lib": "father build --format cjs",
|
|
54
|
-
"build-dist": "father build --format umd",
|
|
51
|
+
"build": "father build && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css && npm run build:ai-meta",
|
|
52
|
+
"build:ai-meta": "node ./scripts/build-ai-meta.mjs",
|
|
55
53
|
"docs": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" dumi build",
|
|
56
54
|
"docs:deploy": "gh-pages -d docs-dist",
|
|
57
55
|
"lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
|
|
58
|
-
"lint-staged": "lint-staged",
|
|
59
56
|
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx --ignore-pattern '**/__tests__/**' --ignore-pattern '**/*.test.*' --ignore-pattern '**/*.spec.*'",
|
|
60
57
|
"code-standards:check": "node ./scripts/code-standards-check.mjs",
|
|
58
|
+
"check:types": "node ./scripts/check-public-types.mjs",
|
|
61
59
|
"commit-msg:format": "node ./scripts/format-commit-msg.mjs",
|
|
62
|
-
"git:pull:dev_4": "git pull --tags --no-rebase origin dev_4",
|
|
63
60
|
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
|
|
64
61
|
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
|
|
65
62
|
"lint:prettier": "prettier --check \"**/*\" --end-of-line auto",
|
|
66
|
-
"lint:report": "eslint --ext .jsx,.js src -f checkstyle -o report_zacc_eslint_js.xml & exit 0; stylelint --custom-formatter node_modules/stylelint-checkstyle-formatter src/**/*.{css,scss,less} > report_zacc_stylelint_css.xml & exit 0",
|
|
67
63
|
"lint:style": "stylelint --fix \"src/**/*.less\"",
|
|
68
|
-
"precommit": "lint-staged",
|
|
69
64
|
"prepare": "husky && patch-package",
|
|
70
65
|
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
|
|
71
|
-
"
|
|
66
|
+
"pack:main": "npm pack --dry-run",
|
|
67
|
+
"pack:mcp": "npm run build:ai-meta && cd packages/sisyphus-react-mcp && npm pack --dry-run",
|
|
72
68
|
"release": "yarn build && npm publish",
|
|
69
|
+
"release:mcp": "npm run build:ai-meta && cd packages/sisyphus-react-mcp && npm publish",
|
|
73
70
|
"release:beta": "yarn build && npm publish --tag=beta",
|
|
74
71
|
"start": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" dumi dev",
|
|
75
72
|
"test": "umi-test",
|
|
76
73
|
"test:coverage": "umi-test --coverage",
|
|
77
|
-
"test:react18": "REACT_VERSION=18 npm run test",
|
|
78
|
-
"test:react19": "npm run test",
|
|
79
|
-
"test:all-versions": "npm run test:react18 && npm run test:react19",
|
|
80
74
|
"tsc": "tsc --noEmit"
|
|
81
75
|
},
|
|
82
76
|
"lint-staged": {
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ModifiedFormInstanceType } from '../ProForm/propsType';
|
|
3
|
-
type Forms = Record<string, ModifiedFormInstanceType<any>>;
|
|
4
|
-
export declare const FormsContext: React.Context<Forms>;
|
|
5
|
-
/**
|
|
6
|
-
* @param formKey 表单实例key
|
|
7
|
-
* @param formIst form实例, 如果传了会把传入的实例存入全局
|
|
8
|
-
* @returns 没有入参: 返回表单实例但是不存入全局
|
|
9
|
-
* 有formKey: 取全局中的表单实例返回, 如果不存在则创建后返回
|
|
10
|
-
*/
|
|
11
|
-
export declare const useForms: () => Forms;
|
|
12
|
-
/** 获取所有表单实例 */
|
|
13
|
-
export declare const useContextForms: () => Forms;
|
|
14
|
-
interface FormsProviderProps {
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
declare const FormsProvider: React.FC<FormsProviderProps>;
|
|
18
|
-
export default FormsProvider;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
|
2
|
-
interface propsWithCheckModal {
|
|
3
|
-
errorTitle?: string;
|
|
4
|
-
list?: string[];
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
declare const CheckModalContent: (props: propsWithCheckModal) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default CheckModalContent;
|
package/es/ProAction/index.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
|
3
|
-
export interface ProActionType {
|
|
4
|
-
/**
|
|
5
|
-
* @description 模式类型:check执行校验并解析错误信息展示,confirm确认提示
|
|
6
|
-
* @default -
|
|
7
|
-
*/
|
|
8
|
-
mode?: 'check' | 'confirm';
|
|
9
|
-
/**
|
|
10
|
-
* @description 标题
|
|
11
|
-
* @default -
|
|
12
|
-
*/
|
|
13
|
-
title?: string | ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* @description 操作回调函数
|
|
16
|
-
* @param previousData 接上一个 useRequest 返回的值
|
|
17
|
-
* @param args 接所有链式 useRequest 返回的值
|
|
18
|
-
* @param index 当前操作的索引
|
|
19
|
-
* @returns void或Promise<void>
|
|
20
|
-
* @default -
|
|
21
|
-
*/
|
|
22
|
-
onAction?: (previousData?: any, args?: any[], index?: number) => void | Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* @description 自定义请求
|
|
25
|
-
* @param previousData 接上一个 useRequest 返回的值
|
|
26
|
-
* @param args 接所有链式 useRequest 返回的值
|
|
27
|
-
* @returns 包含service、options和transformResponse的对象
|
|
28
|
-
* @default -
|
|
29
|
-
*/
|
|
30
|
-
useRequest?: (previousData: any, args: any) => {
|
|
31
|
-
service?: Service<any, any>;
|
|
32
|
-
options?: Options<any, any>;
|
|
33
|
-
transformResponse?: (data: any) => any;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* @description 是否中断链式操作
|
|
37
|
-
* @param previousData 上一个操作的返回数据
|
|
38
|
-
* @param args 所有链式的数据合集
|
|
39
|
-
* @returns 布尔值,返回true继续执行,返回false中断操作
|
|
40
|
-
* @default -
|
|
41
|
-
*/
|
|
42
|
-
continue?: (previousData: any, args: any[]) => boolean;
|
|
43
|
-
/** 自定义错误弹窗内容视图渲染 */
|
|
44
|
-
contextRender?: (data: any) => string | ReactNode;
|
|
45
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import 'dayjs/locale/zh-cn';
|
|
3
|
-
import type { ProConfigProviderProps, ConfigContext } from './propsType';
|
|
4
|
-
export declare const ProConfigContext: React.Context<ConfigContext>;
|
|
5
|
-
export declare function useProConfig(): ConfigContext;
|
|
6
|
-
export declare function useProConfig(name: keyof ConfigContext['state']): ConfigContext['state'][keyof ConfigContext['state']];
|
|
7
|
-
export declare const ProConfigProvider: FC<ProConfigProviderProps>;
|
|
8
|
-
export type { ProConfigProviderType, ProConfigProviderProps, GlobalConfig, ProTableGlobalConfig, StorageType, } from './propsType';
|
|
9
|
-
export default ProConfigProvider;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { FormInstance } from 'antd';
|
|
3
|
-
import type { PropSelectType } from '../ProSelect/propsType';
|
|
4
|
-
import type { ProModalSelectType } from '../ProForm/components/combination/ProModalSelect/propsType';
|
|
5
|
-
import type { ProCascaderType } from '../ProForm/components/combination/ProCascader/propsType';
|
|
6
|
-
import type { ProEnumConfigType } from '../ProEnum/propsType';
|
|
7
|
-
/** 浏览器缓存类型,与 ProEnum / ProTable 的 StorageType 定义一致 */
|
|
8
|
-
export type StorageType = 'localStorage' | 'sessionStorage' | 'indexedDB';
|
|
9
|
-
/** 项目级全局配置(一处配置,全局生效) */
|
|
10
|
-
export interface GlobalConfig {
|
|
11
|
-
/** 缓存存储位置,影响 ProTable 列配置缓存与 ProEnum 枚举缓存,默认由各组件自身决定 */
|
|
12
|
-
storage?: StorageType;
|
|
13
|
-
}
|
|
14
|
-
/** ProTable 组件全局默认配置,通过 ProConfigProvider 统一设置,无需每个实例单独声明 */
|
|
15
|
-
export interface ProTableGlobalConfig {
|
|
16
|
-
/** 是否开启可伸缩列功能,默认 false */
|
|
17
|
-
resizeColumn?: boolean;
|
|
18
|
-
/** 是否开启列配置功能,开启时默认同步开启缓存,默认 false */
|
|
19
|
-
columnConfig?: boolean | {
|
|
20
|
-
onColumnOk?: (catchColumns: any, columns: any[]) => Promise<void>;
|
|
21
|
-
};
|
|
22
|
-
/** 是否开启列配置缓存,单位为天,true 时缓存一天,默认 false */
|
|
23
|
-
cacheTime?: number | boolean;
|
|
24
|
-
}
|
|
25
|
-
/** 对外配置项类型(value、内部 state 均为此类型,字段均可选) */
|
|
26
|
-
export interface ProConfigProviderType {
|
|
27
|
-
locale?: string;
|
|
28
|
-
/** 项目级全局配置:缓存位置等跨组件通用配置 */
|
|
29
|
-
globalConfig?: GlobalConfig;
|
|
30
|
-
/** ProTable 组件全局默认配置 */
|
|
31
|
-
ProTable?: ProTableGlobalConfig;
|
|
32
|
-
ProEnum?: Partial<ProEnumConfigType>;
|
|
33
|
-
ProSelect?: Partial<PropSelectType> & Record<string, any>;
|
|
34
|
-
ProModalSelect?: Partial<ProModalSelectType> & Record<string, any>;
|
|
35
|
-
ProAddressBar?: Partial<ProCascaderType> & Record<string, any>;
|
|
36
|
-
ProCascader?: Partial<ProCascaderType> & Record<string, any>;
|
|
37
|
-
forms?: Record<string, FormInstance | undefined>;
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
}
|
|
40
|
-
/** ProConfigProvider 组件 Props(内部使用) */
|
|
41
|
-
export interface ProConfigProviderProps {
|
|
42
|
-
value?: ProConfigProviderType;
|
|
43
|
-
locale?: string;
|
|
44
|
-
onSuccess?: (data: any, params: any) => void;
|
|
45
|
-
children?: React.ReactNode;
|
|
46
|
-
}
|
|
47
|
-
/** Config 上下文 */
|
|
48
|
-
export interface ConfigContext {
|
|
49
|
-
state: ProConfigProviderType;
|
|
50
|
-
dispatch: React.Dispatch<ProConfigActions>;
|
|
51
|
-
}
|
|
52
|
-
/** ThemeAwareConfigProvider 内部组件 Props */
|
|
53
|
-
export interface ThemeAwareConfigProviderProps {
|
|
54
|
-
locale: any;
|
|
55
|
-
children: React.ReactNode;
|
|
56
|
-
}
|
|
57
|
-
/** Reducer Actions */
|
|
58
|
-
export type ProConfigActions = {
|
|
59
|
-
type: 'setFormRef';
|
|
60
|
-
name: string;
|
|
61
|
-
value: FormInstance;
|
|
62
|
-
} | {
|
|
63
|
-
type: 'deleteFormRef';
|
|
64
|
-
name: string;
|
|
65
|
-
} | {
|
|
66
|
-
type: 'set';
|
|
67
|
-
payload: ProConfigProviderType;
|
|
68
|
-
} | {
|
|
69
|
-
type: 'setProEnum';
|
|
70
|
-
payload: Record<string, any>;
|
|
71
|
-
} | {
|
|
72
|
-
type: 'setProEnumDic';
|
|
73
|
-
key: string;
|
|
74
|
-
payload: any;
|
|
75
|
-
} | {
|
|
76
|
-
type: 'setWithLocal';
|
|
77
|
-
payload: ProConfigProviderType;
|
|
78
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import type { ButtonProps } from 'antd';
|
|
3
|
-
import type { DownloadRequestProps, PropsWithMakeFilePropsType } from './utils';
|
|
4
|
-
export interface ProDownloadType extends ButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* @description 下载资源获取来源:api:通过接口获取,url:通过静态资源链接获取
|
|
7
|
-
* @default api
|
|
8
|
-
*/
|
|
9
|
-
source?: string;
|
|
10
|
-
/**
|
|
11
|
-
* @description 下载请求的地址
|
|
12
|
-
* @default (必选)
|
|
13
|
-
*/
|
|
14
|
-
url: string;
|
|
15
|
-
/**
|
|
16
|
-
* @description 下载请求的地址
|
|
17
|
-
* @deprecated 弃用,请使用url进行替换
|
|
18
|
-
* @default (非必选)
|
|
19
|
-
*/
|
|
20
|
-
action?: string;
|
|
21
|
-
/**
|
|
22
|
-
* @description 下载请求的类型
|
|
23
|
-
* @default post
|
|
24
|
-
*/
|
|
25
|
-
method?: 'post' | 'get';
|
|
26
|
-
/**
|
|
27
|
-
* @description 下载所需额外参数或返回上传额外参数的方法
|
|
28
|
-
* @default -
|
|
29
|
-
*/
|
|
30
|
-
params?: any;
|
|
31
|
-
/**
|
|
32
|
-
* @description 下载保存的文件名
|
|
33
|
-
* @default (必选)
|
|
34
|
-
*/
|
|
35
|
-
fileName?: string;
|
|
36
|
-
/**
|
|
37
|
-
* @description 设置上传的请求头部,IE10 以上有效
|
|
38
|
-
* @default -
|
|
39
|
-
*/
|
|
40
|
-
headers?: object;
|
|
41
|
-
/**
|
|
42
|
-
* @description 禁用状态
|
|
43
|
-
* @default false
|
|
44
|
-
*/
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
/** 格式化数据 */
|
|
47
|
-
transformResponse?: (data: any) => any;
|
|
48
|
-
/**
|
|
49
|
-
* @description 上传文件之前的钩子,若返回 false 则停止下载。支持返回一个 Promise 对象,Promise 对象 reject 时则停止下载
|
|
50
|
-
* @default -
|
|
51
|
-
*/
|
|
52
|
-
beforeDownload?: () => boolean | Promise<any>;
|
|
53
|
-
/**
|
|
54
|
-
* @description service 执行完成时触发
|
|
55
|
-
* @default -
|
|
56
|
-
*/
|
|
57
|
-
/**
|
|
58
|
-
* @description 下载出错的回调
|
|
59
|
-
* @default -
|
|
60
|
-
*/
|
|
61
|
-
onError?: (response: object) => void;
|
|
62
|
-
onFinish?: () => void;
|
|
63
|
-
/**
|
|
64
|
-
* @description 下载按钮的填充内容
|
|
65
|
-
* @default -
|
|
66
|
-
*/
|
|
67
|
-
downLoadRequest?: DownloadRequestProps;
|
|
68
|
-
downLoadBlobUrl?: PropsWithMakeFilePropsType;
|
|
69
|
-
children?: string | ReactNode;
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
}
|