@zat-design/sisyphus-react 4.5.1 → 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/es/ProEditTable/components/Summary/index.js +3 -2
- package/es/ProEditTable/utils/tools.js +1 -1
- 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 +1 -1
- 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 +74 -187
- package/es/ProSelect/utils/index.js +174 -0
- package/es/ProTree/components/ProTreeSelect/index.js +17 -3
- package/es/ProUpload/components/DragRender.js +2 -1
- package/es/ProUpload/index.js +1 -1
- package/package.json +1 -1
- 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/hooks/useConfirmClose.d.ts +0 -25
- package/es/ProDrawerForm/index.d.ts +0 -6
- package/es/ProDrawerForm/propsType.d.ts +0 -111
- package/es/ProDrawerForm/utils/index.d.ts +0 -25
- 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/ProModalSelect/utils/mergeSelectedRows.d.ts +0 -14
- 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 -162
- 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 -445
- 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 -818
- package/es/ProTree/utils.d.ts +0 -62
- 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 -37
- 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 -58
- 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
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _difference from "lodash/difference";
|
|
2
|
+
import _isString from "lodash/isString";
|
|
3
|
+
import _isObject from "lodash/isObject";
|
|
2
4
|
import _isNumber from "lodash/isNumber";
|
|
3
5
|
/* eslint-disable no-restricted-syntax */
|
|
4
6
|
/**
|
|
@@ -109,4 +111,176 @@ export const getSelectList = ({
|
|
|
109
111
|
fieldNames,
|
|
110
112
|
mode
|
|
111
113
|
});
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** 将 selectList(扁平或分组)转为扁平选项列表,用于查找、回显、defaultOne */
|
|
117
|
+
export const flattenOptions = list => {
|
|
118
|
+
if (!Array.isArray(list) || !list.length) return [];
|
|
119
|
+
const out = [];
|
|
120
|
+
list.forEach(item => {
|
|
121
|
+
if (Array.isArray(item.options)) {
|
|
122
|
+
out.push(...item.options);
|
|
123
|
+
} else {
|
|
124
|
+
out.push(item);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return out;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 根据 code 在扁平选项中查找对应的数据对象
|
|
132
|
+
* @param flatOptions 扁平选项列表
|
|
133
|
+
* @param code 值字段名
|
|
134
|
+
* @param input 单个值或值数组
|
|
135
|
+
*/
|
|
136
|
+
export const findValueObject = (flatOptions, code, input) => {
|
|
137
|
+
if (Array.isArray(input) && input.length) {
|
|
138
|
+
return input.map(i => flatOptions.find(item => item[code] === i)).filter(item => !!item);
|
|
139
|
+
}
|
|
140
|
+
return flatOptions.find(item => item[code] === input);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/** 默认搜索过滤:在 searchText/title/label 中做大小写不敏感的包含匹配 */
|
|
144
|
+
export const defaultFilterOption = (input, option) => {
|
|
145
|
+
if (option?.value == null) return false;
|
|
146
|
+
const optionLabel = option?.searchText ?? option?.title ?? option?.label;
|
|
147
|
+
return String(optionLabel ?? '').toLowerCase().includes(input.toLowerCase());
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/** 取选项上挂载的原始 record(兼容 option.record / option.data.record) */
|
|
151
|
+
export const getInnerRecord = option => {
|
|
152
|
+
if (!option) return undefined;
|
|
153
|
+
if (option.record) return option.record;
|
|
154
|
+
if (option.data?.record) return option.data.record;
|
|
155
|
+
return undefined;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* 计算单个选项的展示文本
|
|
160
|
+
* @param optionRender 自定义渲染函数,返回字符串时直接使用
|
|
161
|
+
* @param showCodeName 是否以 code-label 形式展示
|
|
162
|
+
*/
|
|
163
|
+
export const getOptionText = ({
|
|
164
|
+
item,
|
|
165
|
+
optionRender,
|
|
166
|
+
showCodeName,
|
|
167
|
+
code,
|
|
168
|
+
label
|
|
169
|
+
}) => {
|
|
170
|
+
if (optionRender) {
|
|
171
|
+
const rendered = optionRender(item);
|
|
172
|
+
return _isString(rendered) ? rendered : String(item[label] ?? '');
|
|
173
|
+
}
|
|
174
|
+
const text = showCodeName ? `${item[code]}-${item[label]}` : item[label];
|
|
175
|
+
return _isString(text) ? text : String(text ?? '');
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/** 构建单个 antd Select option 对象 */
|
|
179
|
+
export const buildOptionItem = (item, index, config) => {
|
|
180
|
+
const text = getOptionText({
|
|
181
|
+
item,
|
|
182
|
+
...config
|
|
183
|
+
});
|
|
184
|
+
return {
|
|
185
|
+
key: item[config.code] != null ? `${item[config.code]}-${index}` : `option-${index}`,
|
|
186
|
+
label: text,
|
|
187
|
+
value: item[config.code] != null ? item[config.code] : undefined,
|
|
188
|
+
disabled: !!item.disabled,
|
|
189
|
+
title: text,
|
|
190
|
+
searchText: text,
|
|
191
|
+
record: item
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 构建 antd Select 的 options(支持分组)
|
|
197
|
+
* @param list 当前数据源(可能含 options 分组项)
|
|
198
|
+
*/
|
|
199
|
+
export const buildSelectOptions = (list, config) => {
|
|
200
|
+
if (!Array.isArray(list)) {
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
return list.map((item, index) => {
|
|
204
|
+
const groupOptions = item.options;
|
|
205
|
+
if (Array.isArray(groupOptions)) {
|
|
206
|
+
return {
|
|
207
|
+
key: item[config.label] ?? `group-${index}`,
|
|
208
|
+
label: item[config.label],
|
|
209
|
+
options: groupOptions.map((opt, optIndex) => buildOptionItem(opt, optIndex, config))
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return buildOptionItem(item, index, config);
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* labelInValue 模式下解析 onChange 回调拿到的 option:
|
|
218
|
+
* 多选模式下将 record 合并进每项并清理临时字段,单选直接透传
|
|
219
|
+
*/
|
|
220
|
+
export const resolveChangeOption = (rawOption, {
|
|
221
|
+
mode,
|
|
222
|
+
isReactNode
|
|
223
|
+
}) => {
|
|
224
|
+
let option = rawOption;
|
|
225
|
+
if (isReactNode) {
|
|
226
|
+
option = getInnerRecord(rawOption);
|
|
227
|
+
}
|
|
228
|
+
if (mode === 'multiple' && Array.isArray(option)) {
|
|
229
|
+
option.forEach(item => {
|
|
230
|
+
const currentRecord = getInnerRecord(item);
|
|
231
|
+
if (currentRecord) {
|
|
232
|
+
Object.assign(item, currentRecord);
|
|
233
|
+
}
|
|
234
|
+
delete item.record;
|
|
235
|
+
delete item.children;
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
return option;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* 计算 onChange 第一个参数(值):根据 labelInValue/getChangeValue 决定透传原始值还是值对象
|
|
243
|
+
*/
|
|
244
|
+
export const computeChangeValue = (value, {
|
|
245
|
+
labelInValue,
|
|
246
|
+
mode,
|
|
247
|
+
getChangeValue,
|
|
248
|
+
flatOptions,
|
|
249
|
+
code
|
|
250
|
+
}) => {
|
|
251
|
+
const useValueObject = labelInValue && (mode === 'multiple' || !mode);
|
|
252
|
+
const resolved = useValueObject ? findValueObject(flatOptions, code, value) : value;
|
|
253
|
+
return getChangeValue ? getChangeValue(resolved) : resolved;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* 处理 labelInValue 模式及 defaultOne 下值的回填(只返回值,不触发状态更新)
|
|
258
|
+
*/
|
|
259
|
+
export const computeTransformValue = ({
|
|
260
|
+
value,
|
|
261
|
+
labelInValue,
|
|
262
|
+
mode,
|
|
263
|
+
defaultOne,
|
|
264
|
+
isDefaultOne,
|
|
265
|
+
selectList,
|
|
266
|
+
flatOptions,
|
|
267
|
+
code
|
|
268
|
+
}) => {
|
|
269
|
+
if (labelInValue && !mode) {
|
|
270
|
+
if (!_isObject(value)) return undefined;
|
|
271
|
+
return value?.[code] || value?.value;
|
|
272
|
+
}
|
|
273
|
+
if (labelInValue && mode) {
|
|
274
|
+
if (!Array.isArray(value)) return [];
|
|
275
|
+
return value.map(item => item?.[code]);
|
|
276
|
+
}
|
|
277
|
+
// 兼容多选下显式传 null 的极端场景
|
|
278
|
+
if (mode && value === null) return undefined;
|
|
279
|
+
// 仅当 dataSource 只有一项时默认回填
|
|
280
|
+
if (defaultOne && !value && !isDefaultOne && selectList?.length === 1) {
|
|
281
|
+
return flatOptions[0]?.[code];
|
|
282
|
+
}
|
|
283
|
+
// 修复空字符 placeholder 不显示
|
|
284
|
+
if (value === '') return undefined;
|
|
285
|
+
return value;
|
|
112
286
|
};
|
|
@@ -441,6 +441,22 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
441
441
|
});
|
|
442
442
|
};
|
|
443
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
|
+
|
|
444
460
|
/**
|
|
445
461
|
* 自定义渲染子树
|
|
446
462
|
* 注意:此时数据已经是标准格式(label, value, children)
|
|
@@ -472,9 +488,7 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
472
488
|
key = node?.value;
|
|
473
489
|
}
|
|
474
490
|
const titleHtml = /*#__PURE__*/_jsx("span", {
|
|
475
|
-
|
|
476
|
-
__html: labelText
|
|
477
|
-
}
|
|
491
|
+
children: renderHighlightLabel(labelText)
|
|
478
492
|
});
|
|
479
493
|
let searchKey = '';
|
|
480
494
|
if (showCodeName) {
|
|
@@ -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/package.json
CHANGED
|
@@ -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
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export interface PropsWithMakeFilePropsType {
|
|
2
|
-
blob?: Blob;
|
|
3
|
-
fileName: string;
|
|
4
|
-
url?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface IDownloadRequestPropsType {
|
|
7
|
-
/**
|
|
8
|
-
* @description 下载请求的地址
|
|
9
|
-
* @default (必选)
|
|
10
|
-
*/
|
|
11
|
-
url: string;
|
|
12
|
-
/**
|
|
13
|
-
* @description 下载请求的类型
|
|
14
|
-
* @default post
|
|
15
|
-
*/
|
|
16
|
-
method?: 'post' | 'get';
|
|
17
|
-
/**
|
|
18
|
-
* @description 下载所需额外参数或返回上传额外参数的方法
|
|
19
|
-
* @default -
|
|
20
|
-
*/
|
|
21
|
-
params?: any;
|
|
22
|
-
headers?: any;
|
|
23
|
-
/** 格式化数据 */
|
|
24
|
-
transformResponse?: (data: any) => any;
|
|
25
|
-
/**
|
|
26
|
-
* @description service 执行完成时触发
|
|
27
|
-
* @default -
|
|
28
|
-
*/
|
|
29
|
-
onFinish?: (response: object, params: object) => void;
|
|
30
|
-
/**
|
|
31
|
-
* @description 下载保存的文件名
|
|
32
|
-
* @default (必选)
|
|
33
|
-
*/
|
|
34
|
-
fileName?: string;
|
|
35
|
-
/**
|
|
36
|
-
* @description 下载出错的回调
|
|
37
|
-
* @default -
|
|
38
|
-
*/
|
|
39
|
-
onError?: (response: object) => void;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* 下载Blob
|
|
43
|
-
*
|
|
44
|
-
* @param response
|
|
45
|
-
* @param fileName
|
|
46
|
-
* @param extendName
|
|
47
|
-
* @constructor
|
|
48
|
-
*/
|
|
49
|
-
export declare function BlobMakeFile({ blob, fileName, url }: PropsWithMakeFilePropsType): void;
|
|
50
|
-
export type DownloadRequestProps = (props: IDownloadRequestPropsType) => Promise<Response>;
|
|
51
|
-
type convertBase64ToBlobType = (base64: string, fileType?: string, slice?: number) => Blob;
|
|
52
|
-
export declare const convertBase64ToBlob: convertBase64ToBlobType;
|
|
53
|
-
/**
|
|
54
|
-
* 从Content-Disposition获取filename
|
|
55
|
-
* @param contentDisposition string
|
|
56
|
-
* @returns string
|
|
57
|
-
*/
|
|
58
|
-
export declare function getFilenameFromContentDisposition(contentDisposition: any): string;
|
|
59
|
-
export declare const DownloadRequest: DownloadRequestProps;
|
|
60
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { ProDrawerFormType } from '../propsType';
|
|
3
|
-
interface UseConfirmCloseParams {
|
|
4
|
-
open?: boolean;
|
|
5
|
-
isView?: boolean;
|
|
6
|
-
isConfirmClose?: boolean;
|
|
7
|
-
isConfirmCloseModalProps?: ProDrawerFormType['isConfirmCloseModalProps'];
|
|
8
|
-
onCancel?: ProDrawerFormType['onCancel'];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* 关闭抽屉/弹窗时的二次确认逻辑
|
|
12
|
-
*
|
|
13
|
-
* - markInteracted:绑定到内容容器的 input / change 事件,标记用户真实交互过。
|
|
14
|
-
* setFieldsValue 等程序回填不会派发用户输入事件,因此异步回填不会误触发二次确认。
|
|
15
|
-
* - onConfirm:组件自带关闭入口(右上角 × / 遮罩)的关闭处理。未交互、查看模式或
|
|
16
|
-
* 未开启二次确认时直接关闭;否则弹出二次确认。底部取消按钮不走此逻辑。
|
|
17
|
-
* - contextHolder:Modal.useModal 的上下文占位,需渲染进组件,使二次确认弹框能继承
|
|
18
|
-
* ConfigProvider 的主题 / 国际化(替代静态 Modal.confirm,消除上下文告警)。
|
|
19
|
-
*/
|
|
20
|
-
export declare const useConfirmClose: ({ open, isView, isConfirmClose, isConfirmCloseModalProps, onCancel, }: UseConfirmCloseParams) => {
|
|
21
|
-
markInteracted: () => void;
|
|
22
|
-
onConfirm: () => void;
|
|
23
|
-
contextHolder: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormInstance } from 'antd/es/form/Form';
|
|
3
|
-
import { ProDrawerFormType } from './propsType';
|
|
4
|
-
export declare const useProDrawerFormContext: () => any;
|
|
5
|
-
declare const ProDrawerForm: React.ForwardRefExoticComponent<ProDrawerFormType & React.RefAttributes<FormInstance<any>>>;
|
|
6
|
-
export default ProDrawerForm;
|