@zat-design/sisyphus-react 3.13.19-beta.6 → 3.13.19-beta.7
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/.claude/CLAUDE.md +44 -0
- package/.claude/settings.local.json +17 -0
- package/PROJECT_GUIDE.md +250 -0
- package/dist/sisyphus-react.min.css +2 -0
- package/dist/sisyphus-react.min.js +1 -0
- package/es/FormsProvider/index.js +9 -7
- package/es/ProAction/components/CheckModalContent/index.js +14 -14
- package/es/ProAction/index.js +46 -47
- package/es/ProConfigProvider/index.js +25 -19
- package/es/ProDownload/index.js +66 -73
- package/es/ProDownload/utils.js +26 -23
- package/es/ProDrawerForm/components/ProDrawer/index.js +43 -39
- package/es/ProDrawerForm/components/ProModal/index.js +25 -23
- package/es/ProDrawerForm/components/index.js +2 -2
- package/es/ProDrawerForm/index.js +19 -21
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +30 -26
- package/es/ProEditLabel/index.js +49 -36
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +83 -76
- package/es/ProEditTable/components/RcTable/BaseTable.js +24 -24
- package/es/ProEditTable/components/RcTable/DraggableTable.js +34 -41
- package/es/ProEditTable/components/RcTable/VirtualTable.js +4 -3
- package/es/ProEditTable/components/RcTable/index.js +3 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +61 -57
- package/es/ProEditTable/components/RenderField/index.js +151 -145
- package/es/ProEditTable/components/RenderToolbar/index.js +37 -42
- package/es/ProEditTable/components/Summary/index.js +22 -21
- package/es/ProEditTable/components/Validator/index.js +11 -10
- package/es/ProEditTable/components/index.js +5 -5
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +170 -173
- package/es/ProEditTable/utils/config.js +42 -46
- package/es/ProEditTable/utils/diffOriginal.js +34 -19
- package/es/ProEditTable/utils/getDefaultProps.js +12 -13
- package/es/ProEditTable/utils/index.js +102 -99
- package/es/ProEditTable/utils/tools.js +88 -91
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +22 -13
- package/es/ProEnum/components/Group.js +23 -27
- package/es/ProEnum/components/Tag.js +14 -16
- package/es/ProEnum/hooks/useEnum.js +32 -14
- package/es/ProEnum/hooks/useEnumRequest.js +42 -42
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +16 -16
- package/es/ProEnum/index.js +80 -89
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.js +15 -4
- package/es/ProEnum/utils/getEnumLabel.js +16 -21
- package/es/ProEnum/utils/index.js +12 -7
- package/es/ProForm/components/Container.js +8 -6
- package/es/ProForm/components/FormFooter/index.js +21 -19
- package/es/ProForm/components/base/Checkbox/index.js +16 -15
- package/es/ProForm/components/base/DatePicker/index.js +23 -20
- package/es/ProForm/components/base/Input/index.js +20 -18
- package/es/ProForm/components/base/InputNumber/index.js +57 -53
- package/es/ProForm/components/base/Radio/index.js +15 -15
- package/es/ProForm/components/base/RangePicker/index.js +24 -29
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +17 -15
- package/es/ProForm/components/base/Switch/index.js +16 -15
- package/es/ProForm/components/base/SwitchCheckbox/index.js +19 -18
- package/es/ProForm/components/base/TextArea/index.js +18 -17
- package/es/ProForm/components/base/TimePicker/index.js +10 -9
- package/es/ProForm/components/combination/Container/index.js +25 -23
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +80 -92
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +21 -19
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/es/ProForm/components/combination/FormList/components/Empty.js +21 -20
- package/es/ProForm/components/combination/FormList/components/LineFields.js +19 -18
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +45 -51
- package/es/ProForm/components/combination/FormList/index.js +43 -51
- package/es/ProForm/components/combination/FormList/utils.js +9 -9
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +8 -6
- package/es/ProForm/components/combination/Group/component/ComRender.js +33 -29
- package/es/ProForm/components/combination/Group/hooks/index.js +49 -47
- package/es/ProForm/components/combination/Group/index.js +38 -37
- package/es/ProForm/components/combination/Group/utils.js +56 -50
- package/es/ProForm/components/combination/ProCascader/index.js +81 -85
- package/es/ProForm/components/combination/ProCascader/utils/index.js +6 -6
- package/es/ProForm/components/combination/ProCombination/index.js +41 -37
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +31 -25
- package/es/ProForm/components/combination/ProModalSelect/index.js +166 -173
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +46 -51
- package/es/ProForm/components/combination/ProRangeLimit/index.js +39 -39
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +43 -40
- package/es/ProForm/components/index.d.ts +1 -0
- package/es/ProForm/components/index.js +40 -35
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +30 -28
- package/es/ProForm/components/old/EnumSelect/index.js +55 -62
- package/es/ProForm/components/old/InputRange/index.js +17 -16
- package/es/ProForm/components/old/InputWithSuffix/index.js +6 -5
- package/es/ProForm/components/old/ProAddress/index.js +53 -75
- package/es/ProForm/components/old/ProCertNo/index.js +17 -17
- package/es/ProForm/components/old/ProCertValidity/index.js +19 -21
- package/es/ProForm/components/old/ProRangeBox/index.js +25 -24
- package/es/ProForm/components/render/ChangedWrapper.js +34 -33
- package/es/ProForm/components/render/ConfirmWrapper.js +16 -18
- package/es/ProForm/components/render/Render.js +150 -135
- package/es/ProForm/components/render/RenderFields.js +65 -50
- package/es/ProForm/components/render/propsType.js +25 -0
- package/es/ProForm/index.js +83 -70
- package/es/ProForm/propsType.d.ts +1 -1
- package/es/ProForm/propsType.js +5 -1
- package/es/ProForm/utils/diffOriginal.js +30 -16
- package/es/ProForm/utils/getDefaultProps.js +10 -10
- package/es/ProForm/utils/index.js +105 -110
- package/es/ProForm/utils/processDependencies.js +15 -5
- package/es/ProForm/utils/rulesCreator.js +21 -22
- package/es/ProForm/utils/transformNames.js +7 -6
- package/es/ProForm/utils/transformValue.js +16 -13
- package/es/ProForm/utils/useDeepCompareMemo.js +6 -4
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +36 -34
- package/es/ProForm/utils/useRules.js +28 -31
- package/es/ProForm/utils/useShouldUpdate.js +83 -86
- package/es/ProForm/utils/useWatch.js +36 -14
- package/es/ProForm/utils/valueType.js +51 -52
- package/es/ProIcon/config/index.js +2 -0
- package/es/ProIcon/index.js +53 -49
- package/es/ProIcon/utils/index.js +8 -9
- package/es/ProLayout/components/Layout/Header/index.js +13 -11
- package/es/ProLayout/components/Layout/Icon/Icon.js +7 -7
- package/es/ProLayout/components/Layout/Icon/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +42 -40
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +51 -52
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +10 -9
- package/es/ProLayout/components/Layout/Menu/index.js +20 -18
- package/es/ProLayout/components/Layout/Notice/index.js +12 -11
- package/es/ProLayout/components/Layout/index.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +35 -32
- package/es/ProLayout/components/ProFooter/index.js +13 -15
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +9 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +8 -7
- package/es/ProLayout/components/ProHeader/components/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +129 -118
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/components/index.js +3 -3
- package/es/ProLayout/index.d.ts +1 -1
- package/es/ProLayout/index.js +28 -25
- package/es/ProLayout/utils/index.js +37 -35
- package/es/ProSelect/components/AdaptiveTooltip.js +10 -11
- package/es/ProSelect/index.js +87 -99
- package/es/ProSelect/utils/index.js +27 -33
- package/es/ProStep/components/Anchor/index.d.ts +1 -0
- package/es/ProStep/components/Anchor/index.js +26 -25
- package/es/ProStep/components/Item/index.d.ts +1 -0
- package/es/ProStep/components/Item/index.js +26 -22
- package/es/ProStep/components/Listener/index.js +11 -15
- package/es/ProStep/components/Step/index.js +24 -25
- package/es/ProStep/index.js +51 -53
- package/es/ProStep/utils/index.js +13 -12
- package/es/ProStepTab/index.js +59 -37
- package/es/ProTable/components/FormatColumn/index.js +106 -110
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -50
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +24 -24
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +8 -10
- package/es/ProTable/components/RcTable/index.js +2 -2
- package/es/ProTable/components/RenderColumn/index.js +51 -51
- package/es/ProTable/components/RenderEmptyText/index.js +8 -7
- package/es/ProTable/components/RenderFooter/index.js +3 -3
- package/es/ProTable/components/RenderSummary/index.js +13 -13
- package/es/ProTable/components/RenderTableHeader/index.js +16 -14
- package/es/ProTable/components/RenderTabs/index.js +28 -33
- package/es/ProTable/components/TableResizable/index.js +17 -16
- package/es/ProTable/components/TooltipTitle/index.js +7 -6
- package/es/ProTable/components/index.js +11 -6
- package/es/ProTable/hooks/useAntdTable.js +106 -119
- package/es/ProTable/index.js +158 -176
- package/es/ProTable/utils/index.js +25 -21
- package/es/ProTabs/components/Card/index.js +15 -14
- package/es/ProTabs/components/index.js +1 -1
- package/es/ProTabs/index.js +24 -25
- package/es/ProThemeTools/component/ProTools/index.js +69 -68
- package/es/ProThemeTools/component/index.js +1 -1
- package/es/ProThemeTools/index.js +47 -33
- package/es/ProThemeTools/utils/index.js +20 -17
- package/es/ProTooltip/index.js +44 -46
- package/es/ProTree/components/AdaptiveTooltip.js +5 -7
- package/es/ProTree/components/CloseIcon.js +5 -5
- package/es/ProTree/components/List.js +22 -24
- package/es/ProTree/components/ProTree.js +84 -102
- package/es/ProTree/components/ProTreeSelect/index.js +128 -119
- package/es/ProTree/components/SearchTitle.js +10 -9
- package/es/ProTree/components/Tree.js +57 -58
- package/es/ProTree/components/index.js +4 -4
- package/es/ProTree/index.js +6 -6
- package/es/ProTree/utils.js +29 -22
- package/es/ProTreeModal/components/Cascader.js +31 -33
- package/es/ProTreeModal/components/CloseIcon.js +5 -5
- package/es/ProTreeModal/components/List.js +74 -93
- package/es/ProTreeModal/components/SearchTitle.js +5 -4
- package/es/ProTreeModal/components/SortableItem.js +14 -14
- package/es/ProTreeModal/components/Tree.js +49 -53
- package/es/ProTreeModal/components/Trigger.js +29 -28
- package/es/ProTreeModal/components/index.js +6 -6
- package/es/ProTreeModal/index.js +166 -206
- package/es/ProTreeModal/utils.js +37 -33
- package/es/ProUpload/components/ButtonRender.js +33 -36
- package/es/ProUpload/components/DragRender.js +54 -51
- package/es/ProUpload/components/DraggableUploadListItem.js +5 -4
- package/es/ProUpload/components/Example.js +13 -12
- package/es/ProUpload/components/FileItem.js +63 -58
- package/es/ProUpload/components/ImageRender.js +98 -100
- package/es/ProUpload/index.js +75 -82
- package/es/ProUpload/uitls.js +3 -3
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +29 -25
- package/es/ProViewer/propsType.js +0 -1
- package/es/ProWaterMark/index.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +38 -29
- package/es/locale/index.js +7 -4
- package/es/old/ProCertValidity/index.js +19 -21
- package/es/old/ProEditableTable/index.js +156 -156
- package/es/old/ProEditableTable/utils.js +61 -63
- package/es/tokens.js +1 -0
- package/es/utils/index.js +12 -12
- package/lib/FormsProvider/index.js +11 -7
- package/lib/ProAction/components/CheckModalContent/index.js +11 -13
- package/lib/ProAction/index.js +40 -43
- package/lib/ProConfigProvider/index.js +23 -16
- package/lib/ProDownload/index.js +65 -71
- package/lib/ProDownload/utils.js +25 -22
- package/lib/ProDrawerForm/components/ProDrawer/index.js +39 -38
- package/lib/ProDrawerForm/components/ProModal/index.js +23 -22
- package/lib/ProDrawerForm/index.js +18 -18
- package/lib/ProDrawerForm/utils/index.js +3 -2
- package/lib/ProEditLabel/components/RenderProForm.js +26 -24
- package/lib/ProEditLabel/index.js +46 -35
- package/lib/ProEditLabel/utils/index.js +6 -5
- package/lib/ProEditTable/components/ActionButton/index.js +79 -74
- package/lib/ProEditTable/components/RcTable/BaseTable.js +21 -23
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +32 -40
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +3 -3
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +62 -59
- package/lib/ProEditTable/components/RenderField/index.js +137 -132
- package/lib/ProEditTable/components/RenderToolbar/index.js +34 -41
- package/lib/ProEditTable/components/Summary/index.js +20 -20
- package/lib/ProEditTable/components/Validator/index.js +10 -10
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +159 -164
- package/lib/ProEditTable/utils/config.js +40 -44
- package/lib/ProEditTable/utils/diffOriginal.js +36 -21
- package/lib/ProEditTable/utils/getDefaultProps.js +14 -15
- package/lib/ProEditTable/utils/index.js +97 -97
- package/lib/ProEditTable/utils/tools.js +96 -91
- package/lib/ProEditTable/utils/transform.js +7 -11
- package/lib/ProEditTable/utils/useEditTableError.js +22 -13
- package/lib/ProEnum/components/Group.js +23 -27
- package/lib/ProEnum/components/Tag.js +14 -16
- package/lib/ProEnum/hooks/useEnum.js +30 -12
- package/lib/ProEnum/hooks/useEnumRequest.js +39 -39
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +15 -15
- package/lib/ProEnum/index.js +68 -78
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.js +13 -3
- package/lib/ProEnum/utils/getEnumLabel.js +15 -21
- package/lib/ProEnum/utils/index.js +12 -7
- package/lib/ProForm/components/Container.js +7 -5
- package/lib/ProForm/components/FormFooter/index.js +19 -17
- package/lib/ProForm/components/base/Checkbox/index.js +14 -13
- package/lib/ProForm/components/base/DatePicker/index.js +20 -17
- package/lib/ProForm/components/base/Input/index.js +15 -15
- package/lib/ProForm/components/base/InputNumber/index.js +51 -48
- package/lib/ProForm/components/base/Radio/index.js +13 -13
- package/lib/ProForm/components/base/RangePicker/index.js +19 -22
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +5 -4
- package/lib/ProForm/components/base/Select/index.js +14 -12
- package/lib/ProForm/components/base/Switch/index.js +11 -11
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +16 -15
- package/lib/ProForm/components/base/TextArea/index.js +14 -13
- package/lib/ProForm/components/base/TimePicker/index.js +6 -5
- package/lib/ProForm/components/combination/Container/index.js +22 -21
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +77 -89
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +17 -15
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -18
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +14 -14
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +43 -48
- package/lib/ProForm/components/combination/FormList/index.js +35 -43
- package/lib/ProForm/components/combination/FormList/utils.js +11 -10
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
- package/lib/ProForm/components/combination/Group/component/ComRender.js +30 -28
- package/lib/ProForm/components/combination/Group/hooks/index.js +48 -45
- package/lib/ProForm/components/combination/Group/index.js +34 -35
- package/lib/ProForm/components/combination/Group/utils.js +62 -50
- package/lib/ProForm/components/combination/ProCascader/index.js +75 -80
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +8 -7
- package/lib/ProForm/components/combination/ProCombination/index.js +35 -31
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +30 -24
- package/lib/ProForm/components/combination/ProModalSelect/index.js +171 -180
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +42 -48
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +35 -35
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +37 -34
- package/lib/ProForm/components/index.d.ts +1 -0
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +35 -33
- package/lib/ProForm/components/old/EnumSelect/index.js +50 -58
- package/lib/ProForm/components/old/InputRange/index.js +16 -16
- package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -4
- package/lib/ProForm/components/old/ProAddress/index.js +53 -75
- package/lib/ProForm/components/old/ProCertNo/index.js +16 -17
- package/lib/ProForm/components/old/ProCertValidity/index.js +17 -18
- package/lib/ProForm/components/old/ProRangeBox/index.js +24 -24
- package/lib/ProForm/components/render/ChangedWrapper.js +35 -35
- package/lib/ProForm/components/render/ConfirmWrapper.js +14 -17
- package/lib/ProForm/components/render/Render.js +138 -125
- package/lib/ProForm/components/render/RenderFields.js +57 -43
- package/lib/ProForm/components/render/propsType.js +26 -1
- package/lib/ProForm/index.js +74 -61
- package/lib/ProForm/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.js +5 -1
- package/lib/ProForm/utils/diffOriginal.js +30 -17
- package/lib/ProForm/utils/getDefaultProps.js +12 -12
- package/lib/ProForm/utils/index.js +127 -106
- package/lib/ProForm/utils/processDependencies.js +15 -6
- package/lib/ProForm/utils/rulesCreator.js +21 -21
- package/lib/ProForm/utils/transformNames.js +6 -6
- package/lib/ProForm/utils/transformValue.js +14 -11
- package/lib/ProForm/utils/useDeepCompareMemo.js +7 -6
- package/lib/ProForm/utils/useFieldProps.js +2 -3
- package/lib/ProForm/utils/useForm.js +33 -31
- package/lib/ProForm/utils/useRules.js +25 -28
- package/lib/ProForm/utils/useShouldUpdate.js +82 -85
- package/lib/ProForm/utils/useWatch.js +36 -14
- package/lib/ProForm/utils/valueType.js +52 -52
- package/lib/ProIcon/config/index.js +2 -0
- package/lib/ProIcon/index.js +47 -44
- package/lib/ProIcon/utils/index.js +10 -8
- package/lib/ProLayout/components/Layout/Header/index.js +10 -10
- package/lib/ProLayout/components/Layout/Icon/Icon.js +8 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +37 -36
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +49 -52
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +8 -8
- package/lib/ProLayout/components/Layout/Menu/index.js +17 -16
- package/lib/ProLayout/components/Layout/Notice/index.js +8 -8
- package/lib/ProLayout/components/ProCollapse/index.js +32 -30
- package/lib/ProLayout/components/ProFooter/index.js +14 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +7 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -7
- package/lib/ProLayout/components/ProHeader/index.js +131 -120
- package/lib/ProLayout/components/ProHeader/utils/index.js +3 -2
- package/lib/ProLayout/index.d.ts +1 -1
- package/lib/ProLayout/index.js +22 -21
- package/lib/ProLayout/utils/index.js +42 -33
- package/lib/ProSelect/components/AdaptiveTooltip.js +9 -11
- package/lib/ProSelect/index.js +82 -93
- package/lib/ProSelect/utils/index.js +29 -34
- package/lib/ProStep/components/Anchor/index.d.ts +1 -0
- package/lib/ProStep/components/Anchor/index.js +25 -24
- package/lib/ProStep/components/Item/index.d.ts +1 -0
- package/lib/ProStep/components/Item/index.js +24 -20
- package/lib/ProStep/components/Listener/index.js +9 -13
- package/lib/ProStep/components/Step/index.js +20 -21
- package/lib/ProStep/index.js +45 -49
- package/lib/ProStep/utils/index.js +16 -12
- package/lib/ProStepTab/index.js +60 -38
- package/lib/ProTable/components/FormatColumn/index.js +100 -104
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +5 -7
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +34 -48
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +25 -23
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +5 -7
- package/lib/ProTable/components/RenderColumn/index.js +46 -48
- package/lib/ProTable/components/RenderEmptyText/index.js +6 -6
- package/lib/ProTable/components/RenderFooter/index.js +3 -3
- package/lib/ProTable/components/RenderSummary/index.js +11 -12
- package/lib/ProTable/components/RenderTableHeader/index.js +14 -13
- package/lib/ProTable/components/RenderTabs/index.js +27 -32
- package/lib/ProTable/components/TableResizable/index.js +16 -15
- package/lib/ProTable/components/TooltipTitle/index.js +5 -5
- package/lib/ProTable/hooks/useAntdTable.js +103 -116
- package/lib/ProTable/index.js +149 -169
- package/lib/ProTable/utils/index.js +33 -22
- package/lib/ProTabs/components/Card/index.js +14 -14
- package/lib/ProTabs/index.js +24 -24
- package/lib/ProThemeTools/component/ProTools/index.js +66 -65
- package/lib/ProThemeTools/index.js +43 -29
- package/lib/ProThemeTools/utils/index.js +25 -18
- package/lib/ProTooltip/index.js +44 -46
- package/lib/ProTree/components/AdaptiveTooltip.js +5 -7
- package/lib/ProTree/components/CloseIcon.js +5 -5
- package/lib/ProTree/components/List.js +18 -22
- package/lib/ProTree/components/ProTree.js +77 -96
- package/lib/ProTree/components/ProTreeSelect/index.js +126 -116
- package/lib/ProTree/components/SearchTitle.js +8 -8
- package/lib/ProTree/components/Tree.js +53 -55
- package/lib/ProTree/index.js +4 -4
- package/lib/ProTree/utils.js +34 -25
- package/lib/ProTreeModal/components/Cascader.js +28 -32
- package/lib/ProTreeModal/components/CloseIcon.js +5 -5
- package/lib/ProTreeModal/components/List.js +69 -89
- package/lib/ProTreeModal/components/SearchTitle.js +4 -4
- package/lib/ProTreeModal/components/SortableItem.js +11 -12
- package/lib/ProTreeModal/components/Tree.js +44 -49
- package/lib/ProTreeModal/components/Trigger.js +26 -26
- package/lib/ProTreeModal/index.js +157 -199
- package/lib/ProTreeModal/utils.js +43 -35
- package/lib/ProUpload/components/ButtonRender.js +29 -33
- package/lib/ProUpload/components/DragRender.js +50 -48
- package/lib/ProUpload/components/DraggableUploadListItem.js +7 -5
- package/lib/ProUpload/components/Example.js +13 -11
- package/lib/ProUpload/components/FileItem.js +58 -50
- package/lib/ProUpload/components/ImageRender.js +89 -93
- package/lib/ProUpload/index.js +68 -76
- package/lib/ProUpload/uitls.js +5 -3
- package/lib/ProUtils/utils/index.js +10 -14
- package/lib/ProViewer/index.js +26 -24
- package/lib/ProViewer/propsType.js +1 -5
- package/lib/ProWaterMark/index.js +5 -4
- package/lib/index.d.ts +1 -1
- package/lib/locale/index.js +6 -2
- package/lib/old/ProCertValidity/index.js +17 -18
- package/lib/old/ProEditableTable/index.js +153 -156
- package/lib/old/ProEditableTable/utils.js +61 -62
- package/lib/tokens.js +1 -0
- package/lib/utils/index.js +16 -13
- package/package.json +8 -8
- package/dist/index.esm.css +0 -6344
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5768
- package/dist/less.esm.js +0 -3
@@ -1,44 +1,51 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
|
1
|
+
import { isEqual, isFunction, isObject } from 'lodash';
|
2
|
+
import { isEmpty } from "../../utils";
|
3
|
+
|
4
|
+
// 比较策略接口
|
5
|
+
|
5
6
|
// 数字类型标准化函数
|
6
|
-
var normalizeNumberValue =
|
7
|
+
var normalizeNumberValue = value => {
|
7
8
|
if (value === null || value === undefined || value === '') return null;
|
8
9
|
var num = Number(value);
|
9
10
|
return Number.isNaN(num) ? null : num;
|
10
11
|
};
|
12
|
+
|
11
13
|
// InputNumber 比较策略
|
12
14
|
var inputNumberStrategy = {
|
13
|
-
compare:
|
15
|
+
compare: (val1, val2) => {
|
14
16
|
var num1 = normalizeNumberValue(val1);
|
15
17
|
var num2 = normalizeNumberValue(val2);
|
16
18
|
return num1 === num2;
|
17
19
|
}
|
18
20
|
};
|
21
|
+
|
19
22
|
// ProNumberRange 比较策略
|
20
23
|
var proNumberRangeStrategy = {
|
21
|
-
compare:
|
24
|
+
compare: (val1, val2) => {
|
22
25
|
if (!Array.isArray(val1) || !Array.isArray(val2)) return false;
|
23
26
|
if (val1.length !== val2.length) return false;
|
24
|
-
return val1.every(
|
27
|
+
return val1.every((item, index) => {
|
25
28
|
var num1 = normalizeNumberValue(item);
|
26
29
|
var num2 = normalizeNumberValue(val2[index]);
|
27
30
|
return num1 === num2;
|
28
31
|
});
|
29
32
|
}
|
30
33
|
};
|
34
|
+
|
31
35
|
// 数字类型处理函数
|
32
|
-
var handleNumberTypeDiff =
|
36
|
+
var handleNumberTypeDiff = params => {
|
33
37
|
var originalValue = params.originalValue,
|
34
38
|
value = params.value,
|
35
39
|
type = params.type;
|
36
40
|
var isEmptyVal = isEmpty(value);
|
37
41
|
var isEmptyOrg = isEmpty(originalValue);
|
42
|
+
|
38
43
|
// 都为空视为相等
|
39
44
|
if (isEmptyOrg && isEmptyVal) return 'same';
|
45
|
+
|
40
46
|
// 如果原始值为空 且当前有值的话 视为新增
|
41
47
|
if (isEmptyOrg && !isEmptyVal) return 'add';
|
48
|
+
|
42
49
|
// 根据类型选择对应的比较策略
|
43
50
|
var compareStrategy;
|
44
51
|
if (type === 'InputNumber') {
|
@@ -50,15 +57,17 @@ var handleNumberTypeDiff = function handleNumberTypeDiff(params) {
|
|
50
57
|
}
|
51
58
|
return compareStrategy.compare(value, originalValue) ? 'same' : 'changed';
|
52
59
|
};
|
60
|
+
|
53
61
|
// 过滤对象中undefined字段
|
54
62
|
// 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
|
55
|
-
var filterObject =
|
56
|
-
if (!
|
63
|
+
var filterObject = data => {
|
64
|
+
if (!isObject(data) || data === null) return data;
|
65
|
+
|
57
66
|
// ['1', undefined] ['1', ''] 视为相等
|
58
67
|
if (Array.isArray(data)) {
|
59
68
|
// 数组中全是empty值的话 视为null
|
60
69
|
var isFillNull = true;
|
61
|
-
var arr = data.map(
|
70
|
+
var arr = data.map(item => {
|
62
71
|
if (isEmpty(item)) {
|
63
72
|
return null;
|
64
73
|
}
|
@@ -68,22 +77,24 @@ var filterObject = function filterObject(data) {
|
|
68
77
|
return isFillNull ? null : arr;
|
69
78
|
}
|
70
79
|
var resData = {};
|
71
|
-
Object.keys(data).forEach(
|
80
|
+
Object.keys(data).forEach(key => {
|
72
81
|
if (!isEmpty(data[key])) {
|
73
82
|
resData[key] = data[key];
|
74
83
|
}
|
75
84
|
});
|
85
|
+
|
76
86
|
// 空对象视为null 比较时 null undefined {} [] '' 视为相等
|
77
87
|
if (!Object.keys(resData).length) return null;
|
78
88
|
return resData;
|
79
89
|
};
|
80
|
-
export var diffOriginal =
|
90
|
+
export var diffOriginal = params => {
|
81
91
|
var originalValue = params.originalValue,
|
82
92
|
value = params.value,
|
83
93
|
onDiff = params.onDiff,
|
84
94
|
type = params.type;
|
95
|
+
|
85
96
|
// 支持传入自定义比较事件
|
86
|
-
if (
|
97
|
+
if (isFunction(onDiff)) {
|
87
98
|
var diffRes = onDiff(originalValue, value);
|
88
99
|
// 如果返回undefined走内置比较逻辑
|
89
100
|
if (diffRes !== undefined) {
|
@@ -96,14 +107,17 @@ export var diffOriginal = function diffOriginal(params) {
|
|
96
107
|
if (['InputNumber', 'ProNumberRange'].includes(type)) {
|
97
108
|
return handleNumberTypeDiff(params);
|
98
109
|
}
|
110
|
+
|
99
111
|
// 其他类型使用原有逻辑
|
100
112
|
var _value = filterObject(value);
|
101
113
|
var _originalValue = filterObject(originalValue);
|
102
114
|
var isEmptyVal = isEmpty(_value);
|
103
115
|
var isEmptyOrg = isEmpty(_originalValue);
|
116
|
+
|
104
117
|
// 都为空视为相等
|
105
118
|
if (isEmptyOrg && isEmptyVal) return 'same';
|
119
|
+
|
106
120
|
// 如果原始值为空 且当前有值的话 视为新增
|
107
121
|
if (isEmptyOrg && !isEmptyVal) return 'add';
|
108
|
-
return
|
122
|
+
return isEqual(_value, _originalValue) ? 'same' : 'changed';
|
109
123
|
};
|
@@ -1,31 +1,31 @@
|
|
1
|
-
import
|
2
|
-
import _get from "lodash/get";
|
1
|
+
import { get, isEqual } from 'lodash';
|
3
2
|
var defaultPropsMap = {
|
4
|
-
ProSelect:
|
3
|
+
ProSelect: props => {
|
5
4
|
var fieldProps = props.fieldProps,
|
6
5
|
name = props.name,
|
7
6
|
namePath = props.namePath;
|
8
7
|
var _ref = fieldProps || {},
|
9
8
|
filterInList = _ref.filterInList;
|
10
9
|
var defaultProps = {};
|
10
|
+
|
11
11
|
// formList场景传入列表过滤时
|
12
12
|
if (filterInList && namePath && name) {
|
13
13
|
var _listName = namePath.slice(0, -1);
|
14
14
|
var _namePath = name.slice(1);
|
15
|
-
defaultProps.shouldUpdate =
|
16
|
-
var preListValue =
|
17
|
-
return
|
15
|
+
defaultProps.shouldUpdate = (preValues, curValues) => {
|
16
|
+
var preListValue = get(preValues, _listName).map(item => {
|
17
|
+
return get(item, _namePath);
|
18
18
|
});
|
19
|
-
var curListValue =
|
20
|
-
return
|
19
|
+
var curListValue = get(curValues, _listName).map(item => {
|
20
|
+
return get(item, _namePath);
|
21
21
|
});
|
22
|
-
return !
|
22
|
+
return !isEqual(preListValue, curListValue);
|
23
23
|
};
|
24
24
|
}
|
25
25
|
return defaultProps;
|
26
26
|
}
|
27
27
|
};
|
28
|
-
export var getDefaultProps =
|
28
|
+
export var getDefaultProps = props => {
|
29
29
|
var _defaultPropsMap$type;
|
30
30
|
var type = props.type;
|
31
31
|
return (_defaultPropsMap$type = defaultPropsMap[type]) === null || _defaultPropsMap$type === void 0 ? void 0 : _defaultPropsMap$type.call(defaultPropsMap, props);
|
@@ -1,16 +1,11 @@
|
|
1
1
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
2
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
3
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
4
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
|
-
|
6
|
-
|
7
|
-
import _set from "lodash/set";
|
8
|
-
import _get from "lodash/get";
|
9
|
-
import _isFunction from "lodash/isFunction";
|
10
|
-
import _isObject from "lodash/isObject";
|
3
|
+
/* eslint-disable no-restricted-syntax */
|
4
|
+
|
11
5
|
import React, { useState } from 'react';
|
12
6
|
import moment from 'moment';
|
13
|
-
|
7
|
+
import _, { isObject, isFunction, get, set, omit, isNaN } from 'lodash';
|
8
|
+
export var getLayout = params => {
|
14
9
|
var _params$span = params.span,
|
15
10
|
span = _params$span === void 0 ? 8 : _params$span,
|
16
11
|
form = params.form;
|
@@ -23,16 +18,17 @@ export var getLayout = function getLayout(params) {
|
|
23
18
|
colProps: {
|
24
19
|
span: span || 8
|
25
20
|
},
|
26
|
-
onCancel:
|
21
|
+
onCancel: () => {
|
27
22
|
form.resetFields();
|
28
23
|
},
|
29
|
-
onOk:
|
24
|
+
onOk: () => {
|
30
25
|
form.submit();
|
31
26
|
}
|
32
27
|
};
|
33
28
|
};
|
29
|
+
|
34
30
|
// 受控状态
|
35
|
-
export var useControlled =
|
31
|
+
export var useControlled = props => {
|
36
32
|
var value = props.value,
|
37
33
|
onChange = props.onChange;
|
38
34
|
var _useState = useState(value || false),
|
@@ -44,65 +40,66 @@ export var useControlled = function useControlled(props) {
|
|
44
40
|
}
|
45
41
|
return [state, setState];
|
46
42
|
};
|
47
|
-
export var isSelect =
|
43
|
+
export var isSelect = props => {
|
48
44
|
var dataSource = props.dataSource,
|
49
45
|
type = props.type;
|
50
46
|
return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', 'ProCascader', 'ProTimeLimit', 'ProModalSelect', 'ProTreeModal', 'ProUpload', 'TimePicker'].includes(type);
|
51
47
|
};
|
48
|
+
|
52
49
|
/**
|
53
50
|
* Input TextArea 移除前后空格
|
54
51
|
* @param type 组件类型
|
55
52
|
* @param trim 是否移除前后空格
|
56
53
|
* @returns {}
|
57
54
|
*/
|
58
|
-
export var isTrim =
|
55
|
+
export var isTrim = (type, trim, configData) => {
|
59
56
|
var _state$type;
|
60
57
|
var result = {};
|
61
58
|
var _ref = configData || {},
|
62
59
|
_ref$state = _ref.state,
|
63
60
|
state = _ref$state === void 0 ? {} : _ref$state;
|
64
|
-
var _trim = trim || (state === null || state === void 0
|
61
|
+
var _trim = trim || (state === null || state === void 0 || (_state$type = state[type]) === null || _state$type === void 0 ? void 0 : _state$type.trim);
|
65
62
|
if (['Input', 'ProCombination'].includes(type) && _trim) {
|
66
|
-
result.getValueFromEvent =
|
63
|
+
result.getValueFromEvent = event => {
|
67
64
|
var _event$target$value;
|
68
65
|
if (Array.isArray(event)) {
|
69
|
-
return event.map(
|
70
|
-
return (value === null || value === void 0 ? void 0 : value.trim()) || '';
|
71
|
-
});
|
66
|
+
return event.map(value => (value === null || value === void 0 ? void 0 : value.trim()) || '');
|
72
67
|
}
|
73
68
|
return ((_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.trim()) || '';
|
74
69
|
};
|
75
70
|
}
|
76
71
|
return result;
|
77
72
|
};
|
73
|
+
|
78
74
|
/**
|
79
75
|
* Input TextArea 小写自动转大写
|
80
76
|
* @param type 组件类型
|
81
77
|
* @param upperCase 是否小写转大写
|
82
78
|
* @returns {}
|
83
79
|
*/
|
84
|
-
export var isUpperCase =
|
80
|
+
export var isUpperCase = (type, upperCase) => {
|
85
81
|
var result = {};
|
86
82
|
if (['Input', 'ProCombination'].includes(type) && upperCase) {
|
87
|
-
result.getValueFromEvent =
|
88
|
-
var _event$target
|
83
|
+
result.getValueFromEvent = event => {
|
84
|
+
var _event$target;
|
89
85
|
if (Array.isArray(event)) {
|
90
|
-
return event.map(
|
86
|
+
return event.map(value => {
|
91
87
|
var newValue = value === null || value === void 0 ? void 0 : value.replace(/[^a-zA-Z]/g, '');
|
92
88
|
return (newValue === null || newValue === void 0 ? void 0 : newValue.toUpperCase()) || '';
|
93
89
|
});
|
94
90
|
}
|
95
|
-
var newValue = (_event$target = event.target) === null || _event$target === void 0
|
91
|
+
var newValue = (_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.value) === null || _event$target === void 0 ? void 0 : _event$target.replace(/[^a-zA-Z]/g, '');
|
96
92
|
return newValue.toUpperCase() || '';
|
97
93
|
};
|
98
94
|
}
|
99
95
|
return result;
|
100
96
|
};
|
97
|
+
|
101
98
|
// 剔除otherProps 组成对象返回
|
102
|
-
export var weedOutProps =
|
99
|
+
export var weedOutProps = (data, keys) => {
|
103
100
|
var obj = {};
|
104
101
|
var weedOut = {};
|
105
|
-
Object.keys(data).forEach(
|
102
|
+
Object.keys(data).forEach(key => {
|
106
103
|
var included = keys.includes(key);
|
107
104
|
if (included) {
|
108
105
|
weedOut[key] = data[key];
|
@@ -112,89 +109,88 @@ export var weedOutProps = function weedOutProps(data, keys) {
|
|
112
109
|
});
|
113
110
|
return [obj, weedOut];
|
114
111
|
};
|
112
|
+
|
115
113
|
// 对比字段变化
|
116
|
-
export var diffField =
|
117
|
-
return names.some(
|
118
|
-
return
|
114
|
+
export var diffField = (prevValues, curValues, names) => {
|
115
|
+
return names.some(name => {
|
116
|
+
return _.get(prevValues, name) !== _.get(curValues, name);
|
119
117
|
});
|
120
118
|
};
|
119
|
+
|
121
120
|
// 表单name展开
|
122
|
-
export var splitNameStr =
|
123
|
-
return name.split('-').map(
|
124
|
-
return keyStr.split('_');
|
125
|
-
});
|
121
|
+
export var splitNameStr = name => {
|
122
|
+
return name.split('-').map(keyStr => keyStr.split('_'));
|
126
123
|
};
|
124
|
+
|
127
125
|
// 过滤掉字段名中包含 '-' 的字段
|
128
|
-
var
|
126
|
+
export var filterInternalFields = (values, optimize) => {
|
129
127
|
if (optimize) {
|
130
128
|
return values;
|
131
129
|
}
|
132
130
|
var nextValues = values;
|
133
131
|
// fix: braft-editor对象不可遍历 Moment不过滤
|
134
|
-
if (
|
132
|
+
if (values !== null && values !== void 0 && values._immutable || moment.isMoment(values)) {
|
135
133
|
return nextValues;
|
136
134
|
}
|
137
135
|
if (values instanceof File) {
|
138
136
|
return nextValues;
|
139
137
|
}
|
140
138
|
if (Array.isArray(nextValues)) {
|
141
|
-
return nextValues.map(
|
142
|
-
return
|
139
|
+
return nextValues.map(item => {
|
140
|
+
return filterInternalFields(item);
|
143
141
|
});
|
144
142
|
}
|
145
|
-
if (
|
143
|
+
if (isObject(nextValues)) {
|
146
144
|
var result = {};
|
147
|
-
Object.keys(nextValues).forEach(
|
145
|
+
Object.keys(nextValues).forEach(key => {
|
148
146
|
if (key.includes('-') || key.startsWith('__')) return;
|
149
|
-
result[key] =
|
147
|
+
result[key] = filterInternalFields(nextValues[key]);
|
150
148
|
});
|
151
149
|
return result;
|
152
150
|
}
|
153
151
|
return nextValues;
|
154
152
|
};
|
155
|
-
export
|
156
|
-
var _getAllNamePath = function getAllNamePath(object) {
|
153
|
+
export var getAllNamePath = function getAllNamePath(object) {
|
157
154
|
var currentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
158
155
|
var keys = Object.keys(object);
|
159
156
|
var resultKeys = [];
|
160
|
-
keys.forEach(
|
157
|
+
keys.forEach(key => {
|
161
158
|
var value = object[key];
|
159
|
+
|
162
160
|
// 拆开组合key (组合key只可能存在于最外层)
|
163
161
|
if (key.includes('-')) {
|
164
|
-
resultKeys.concat(key.split('-').map(
|
165
|
-
return keyStr.split('_');
|
166
|
-
}));
|
162
|
+
resultKeys.concat(key.split('-').map(keyStr => keyStr.split('_')));
|
167
163
|
}
|
164
|
+
|
168
165
|
// 深度获取对象key
|
169
|
-
if (
|
170
|
-
resultKeys.concat(
|
166
|
+
if (isObject(value)) {
|
167
|
+
resultKeys.concat(getAllNamePath(value, [...currentPath, key]));
|
171
168
|
}
|
172
|
-
resultKeys.push([
|
169
|
+
resultKeys.push([...currentPath, key]);
|
173
170
|
});
|
174
171
|
return resultKeys;
|
175
172
|
};
|
173
|
+
|
176
174
|
// 判断一个字段值是否算空
|
177
|
-
export { _getAllNamePath as getAllNamePath };
|
178
175
|
var nullList = [undefined, 'null', '""', '[]'];
|
179
|
-
export var isNullValue =
|
176
|
+
export var isNullValue = value => {
|
180
177
|
return nullList.includes(JSON.stringify(value));
|
181
178
|
};
|
179
|
+
|
182
180
|
/**
|
183
181
|
* 判断数组中是否包含空值 一个为空则为true
|
184
182
|
* @param arr 值
|
185
183
|
* @returns boole
|
186
184
|
*/
|
187
|
-
export var isNotFullArray =
|
185
|
+
export var isNotFullArray = (arr, length, required) => {
|
188
186
|
if (!Array.isArray(arr)) {
|
189
187
|
return false;
|
190
188
|
}
|
191
|
-
if (Array.isArray(required) && required.some(
|
192
|
-
return item === false;
|
193
|
-
})) {
|
189
|
+
if (Array.isArray(required) && required.some(item => item === false)) {
|
194
190
|
return false;
|
195
191
|
}
|
196
192
|
if (arr.length < length) return true;
|
197
|
-
return arr.some(
|
193
|
+
return arr.some(item => {
|
198
194
|
if (item === undefined || item === null) {
|
199
195
|
return true;
|
200
196
|
}
|
@@ -207,14 +203,15 @@ export var isNotFullArray = function isNotFullArray(arr, length, required) {
|
|
207
203
|
return false;
|
208
204
|
});
|
209
205
|
};
|
206
|
+
|
210
207
|
/**
|
211
208
|
* 判断数组中值是否都为空 全部为空则为true
|
212
209
|
* @param arr 值
|
213
210
|
* @returns boole
|
214
211
|
*/
|
215
|
-
export var isNullArray =
|
212
|
+
export var isNullArray = arr => {
|
216
213
|
if (!Array.isArray(arr)) return !arr;
|
217
|
-
return arr.every(
|
214
|
+
return arr.every(item => {
|
218
215
|
if (item === undefined || item === null) {
|
219
216
|
return true;
|
220
217
|
}
|
@@ -227,14 +224,15 @@ export var isNullArray = function isNullArray(arr) {
|
|
227
224
|
return false;
|
228
225
|
});
|
229
226
|
};
|
227
|
+
|
230
228
|
/**
|
231
229
|
* 判断数组中值是否全部为空 如果值不是数组返回false
|
232
230
|
* @param arr 值
|
233
231
|
* @returns boole
|
234
232
|
*/
|
235
|
-
export var isEmptyArray =
|
233
|
+
export var isEmptyArray = arr => {
|
236
234
|
if (!Array.isArray(arr)) return false;
|
237
|
-
return arr.every(
|
235
|
+
return arr.every(item => {
|
238
236
|
if (item === undefined || item === null) {
|
239
237
|
return true;
|
240
238
|
}
|
@@ -253,6 +251,7 @@ export function toArray(value) {
|
|
253
251
|
}
|
254
252
|
return Array.isArray(value) ? value : [value];
|
255
253
|
}
|
254
|
+
|
256
255
|
/**
|
257
256
|
* 初始化值names值合并
|
258
257
|
* @param obj AnyObject
|
@@ -265,50 +264,50 @@ export function initialValuesToNames() {
|
|
265
264
|
if (!Array.isArray(columns)) {
|
266
265
|
return result;
|
267
266
|
}
|
268
|
-
columns.forEach(
|
267
|
+
columns.forEach(item => {
|
269
268
|
if (Array.isArray(item === null || item === void 0 ? void 0 : item.names)) {
|
270
269
|
var _item$names;
|
271
|
-
var
|
270
|
+
var _key = (_item$names = item.names) === null || _item$names === void 0 ? void 0 : _item$names.map(name => {
|
272
271
|
return Array.isArray(name) ? name.join('_') : name;
|
273
272
|
}).join('-');
|
274
|
-
var formInitialValue = item.names.map(
|
273
|
+
var formInitialValue = item.names.map((name, index) => {
|
275
274
|
if (item.initialValue) {
|
276
|
-
|
275
|
+
set(values, name, item.initialValue[index]);
|
277
276
|
}
|
278
|
-
return
|
277
|
+
return get(values, name);
|
279
278
|
});
|
279
|
+
|
280
280
|
// 过滤掉不存在的初始值 防止names字段值为空数组
|
281
|
-
var namesInitialValue = formInitialValue.filter(
|
282
|
-
return item !== undefined;
|
283
|
-
});
|
281
|
+
var namesInitialValue = formInitialValue.filter(item => item !== undefined);
|
284
282
|
if (namesInitialValue.length) {
|
285
|
-
values[
|
283
|
+
values[_key] = formInitialValue;
|
286
284
|
}
|
287
285
|
}
|
288
286
|
});
|
289
287
|
return values;
|
290
288
|
}
|
289
|
+
|
291
290
|
/**
|
292
291
|
* 获取数组含数字的新数组
|
293
292
|
* @returns ['group-7x19no', 0, 'abc'] =>['group-7x19no', 0]
|
294
293
|
*/
|
295
294
|
export function getArrayBeforeNumber(arr) {
|
296
|
-
var index = arr.findIndex(
|
297
|
-
return typeof item === 'number';
|
298
|
-
});
|
295
|
+
var index = arr.findIndex(item => typeof item === 'number');
|
299
296
|
return index !== -1 ? arr.slice(0, index + 1) : arr;
|
300
297
|
}
|
298
|
+
|
301
299
|
// 自定义深比对 如果两边都是函数类型则认为相等
|
302
|
-
export var customEqualForFun =
|
303
|
-
if (
|
300
|
+
export var customEqualForFun = (value, other) => {
|
301
|
+
if (isFunction(value) && isFunction(other) || /*#__PURE__*/React.isValidElement(value) && /*#__PURE__*/React.isValidElement(other)) {
|
304
302
|
return true;
|
305
303
|
}
|
306
304
|
};
|
305
|
+
|
307
306
|
/**
|
308
307
|
* 查询数据中是否包含rowKey
|
309
308
|
*/
|
310
|
-
var
|
311
|
-
if (
|
309
|
+
export var hasRowKey = obj => {
|
310
|
+
if (typeof obj !== 'object' || obj === null) {
|
312
311
|
return false;
|
313
312
|
}
|
314
313
|
var keys = Object.keys(obj);
|
@@ -316,16 +315,14 @@ var _hasRowKey = function hasRowKey(obj) {
|
|
316
315
|
if (rowKeyExists) {
|
317
316
|
return true;
|
318
317
|
}
|
319
|
-
return keys.some(
|
320
|
-
return _hasRowKey(obj[key]);
|
321
|
-
});
|
318
|
+
return keys.some(key => hasRowKey(obj[key]));
|
322
319
|
};
|
320
|
+
|
323
321
|
/**
|
324
322
|
* 查询数据中是否包含rowKey
|
325
323
|
*/
|
326
|
-
export
|
327
|
-
|
328
|
-
if (_typeof(obj) !== 'object' || obj === null) {
|
324
|
+
export var view = obj => {
|
325
|
+
if (typeof obj !== 'object' || obj === null) {
|
329
326
|
return false;
|
330
327
|
}
|
331
328
|
var keys = Object.keys(obj);
|
@@ -333,28 +330,27 @@ export var view = function view(obj) {
|
|
333
330
|
if (rowKeyExists) {
|
334
331
|
return true;
|
335
332
|
}
|
336
|
-
return keys.some(
|
337
|
-
return _hasRowKey(obj[key]);
|
338
|
-
});
|
333
|
+
return keys.some(key => hasRowKey(obj[key]));
|
339
334
|
};
|
335
|
+
|
340
336
|
/**
|
341
337
|
* 获取小数点后的位数
|
342
338
|
* @param num 数字
|
343
339
|
* @returns 位数
|
344
340
|
*/
|
345
|
-
export var getDecimalDigits =
|
341
|
+
export var getDecimalDigits = num => {
|
346
342
|
var match = num.toString().match(/\.(\d+)/);
|
347
343
|
return match ? match[1].length : 0;
|
348
344
|
};
|
349
|
-
export var deleteForPath =
|
345
|
+
export var deleteForPath = (values, namePath) => {
|
350
346
|
if (Array.isArray(namePath)) {
|
351
347
|
var current = values;
|
352
|
-
namePath.every(
|
348
|
+
namePath.every((nameItem, index) => {
|
353
349
|
if (index === namePath.length - 1) {
|
354
350
|
delete current[nameItem];
|
355
351
|
return false;
|
356
352
|
}
|
357
|
-
if (
|
353
|
+
if (typeof current[nameItem] !== 'object') {
|
358
354
|
return false;
|
359
355
|
}
|
360
356
|
current = current[nameItem];
|
@@ -364,70 +360,69 @@ export var deleteForPath = function deleteForPath(values, namePath) {
|
|
364
360
|
}
|
365
361
|
delete values[namePath];
|
366
362
|
};
|
363
|
+
|
367
364
|
/**
|
368
365
|
* 获取树状结构option
|
369
366
|
* @param treeData 树数据源
|
370
367
|
* @param value 选中值
|
371
368
|
* @returns {}
|
372
369
|
*/
|
373
|
-
var
|
374
|
-
if (
|
370
|
+
export var findOptionByValue = (treeData, value, fieldNames) => {
|
371
|
+
if (isObject(value)) {
|
375
372
|
return value;
|
376
373
|
}
|
377
374
|
for (var i = 0; i < (treeData === null || treeData === void 0 ? void 0 : treeData.length); i++) {
|
378
375
|
var node = treeData[i];
|
379
376
|
if (node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value'] === value) {
|
380
|
-
return
|
377
|
+
return omit(node, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
381
378
|
}
|
382
379
|
if (node.children) {
|
383
|
-
var foundNode =
|
380
|
+
var foundNode = findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
|
384
381
|
if (foundNode) {
|
385
|
-
return
|
382
|
+
return omit(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
386
383
|
}
|
387
384
|
}
|
388
385
|
}
|
389
386
|
};
|
387
|
+
|
390
388
|
/**
|
391
389
|
* 对比依赖列表中的 值是否变更
|
392
390
|
*/
|
393
|
-
export
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
var
|
398
|
-
var currentValue = _get(currentValues, namePath);
|
391
|
+
export var equalDependencies = (dependencies, prevValues, currentValues) => {
|
392
|
+
if (dependencies !== null && dependencies !== void 0 && dependencies.length) {
|
393
|
+
return dependencies.some(namePath => {
|
394
|
+
var prevValue = get(prevValues, namePath);
|
395
|
+
var currentValue = get(currentValues, namePath);
|
399
396
|
return prevValue !== currentValue;
|
400
397
|
});
|
401
398
|
}
|
402
399
|
return false;
|
403
400
|
};
|
401
|
+
|
404
402
|
/** 解析namePath */
|
405
|
-
export var parseNamePath =
|
403
|
+
export var parseNamePath = input => {
|
406
404
|
var parts = input.split('_');
|
407
|
-
if (parts.every(
|
408
|
-
return _isNaN(Number(item));
|
409
|
-
})) {
|
405
|
+
if (parts.every(item => isNaN(Number(item)))) {
|
410
406
|
return [input];
|
411
407
|
}
|
412
|
-
var result = parts.map(
|
413
|
-
return
|
408
|
+
var result = parts.map(item => {
|
409
|
+
return isNaN(Number(item)) ? item : Number(item);
|
414
410
|
});
|
415
411
|
return [result];
|
416
412
|
};
|
413
|
+
|
417
414
|
/**
|
418
415
|
* 获取表单所有字段路径的简化函数
|
419
416
|
* @param form 表单实例
|
420
417
|
* @returns 所有字段路径数组
|
421
418
|
*/
|
422
|
-
export var getFormFieldPaths =
|
419
|
+
export var getFormFieldPaths = form => {
|
423
420
|
try {
|
424
421
|
// @ts-ignore
|
425
422
|
var _form$getInternalHook = form.getInternalHooks('RC_FORM_INTERNAL_HOOKS'),
|
426
423
|
getFields = _form$getInternalHook.getFields;
|
427
424
|
var allFields = getFields();
|
428
|
-
return allFields.map(
|
429
|
-
return field.name;
|
430
|
-
});
|
425
|
+
return allFields.map(field => field.name);
|
431
426
|
} catch (error) {
|
432
427
|
console.error('获取表单字段失败:', error);
|
433
428
|
return [];
|