@zat-design/sisyphus-react 4.0.0-beta.3 → 4.0.0-beta.5
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/babel.config.js +7 -30
- package/dist/index.esm.css +1 -6445
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -5871
- package/dist/less.min.js +1 -0
- package/es/FormsProvider/index.js +5 -5
- package/es/ProAction/components/CheckModalContent/index.js +5 -7
- package/es/ProAction/index.js +16 -16
- package/es/ProAction/index.less +0 -2
- package/es/ProConfigProvider/index.d.ts +1 -0
- package/es/ProConfigProvider/index.js +34 -21
- package/es/ProDownload/index.js +13 -12
- package/es/ProDownload/style/index.less +0 -2
- package/es/ProDownload/utils.js +15 -15
- package/es/ProDrawerForm/components/ProDrawer/index.js +22 -19
- package/es/ProDrawerForm/components/ProModal/index.js +14 -9
- package/es/ProDrawerForm/index.js +39 -39
- package/es/ProDrawerForm/style/index.less +0 -2
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +10 -9
- package/es/ProEditLabel/index.js +36 -24
- package/es/ProEditLabel/style/index.less +0 -2
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +58 -56
- package/es/ProEditTable/components/RcTable/BaseTable.js +21 -20
- package/es/ProEditTable/components/RcTable/DraggableTable.js +27 -34
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +49 -43
- package/es/ProEditTable/components/RenderField/index.js +98 -121
- package/es/ProEditTable/components/RenderToolbar/index.js +27 -33
- package/es/ProEditTable/components/Summary/index.js +16 -14
- package/es/ProEditTable/components/Validator/index.js +9 -6
- package/es/ProEditTable/index.js +130 -147
- package/es/ProEditTable/propsType.d.ts +1 -1
- package/es/ProEditTable/style/index.less +2 -4
- package/es/ProEditTable/utils/config.js +29 -36
- package/es/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/es/ProEditTable/utils/diffOriginal.js +76 -9
- package/es/ProEditTable/utils/getDefaultProps.js +6 -7
- package/es/ProEditTable/utils/index.js +52 -58
- package/es/ProEditTable/utils/tools.js +32 -41
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +10 -12
- package/es/ProEnum/components/Group.js +18 -22
- package/es/ProEnum/components/Tag.js +10 -14
- package/es/ProEnum/hooks/useEnum.js +11 -10
- package/es/ProEnum/hooks/useEnumRequest.js +23 -25
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +76 -0
- package/es/ProEnum/index.js +50 -52
- package/es/ProEnum/propsType.d.ts +29 -0
- package/es/ProEnum/style/index.less +0 -2
- package/es/ProEnum/utils/eventCenter.js +20 -31
- package/es/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/es/ProEnum/utils/frequentEnum.js +91 -0
- package/es/ProEnum/utils/getEnumLabel.js +8 -12
- package/es/ProEnum/utils/index.js +6 -6
- package/es/ProForm/components/Container.js +4 -3
- package/es/ProForm/components/FormFooter/index.js +19 -16
- package/es/ProForm/components/base/Checkbox/index.js +10 -11
- package/es/ProForm/components/base/DatePicker/index.js +25 -39
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +2 -4
- package/es/ProForm/components/base/Input/index.js +24 -20
- package/es/ProForm/components/base/InputNumber/index.js +21 -18
- package/es/ProForm/components/base/Radio/index.js +11 -12
- package/es/ProForm/components/base/RangePicker/index.js +9 -12
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +9 -8
- package/es/ProForm/components/base/Switch/index.js +7 -6
- package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -6
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/es/ProForm/components/base/TextArea/index.js +9 -8
- package/es/ProForm/components/base/TextArea/index.less +0 -2
- package/es/ProForm/components/base/TimePicker/index.js +5 -4
- package/es/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/es/ProForm/components/combination/Container/index.js +12 -12
- package/es/ProForm/components/combination/Container/style/index.less +0 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +60 -70
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +11 -7
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/Empty.js +9 -10
- package/es/ProForm/components/combination/FormList/components/LineFields.js +10 -9
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +32 -36
- package/es/ProForm/components/combination/FormList/index.js +25 -33
- package/es/ProForm/components/combination/FormList/style/index.less +0 -2
- package/es/ProForm/components/combination/FormList/utils.js +5 -7
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +22 -21
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +47 -39
- package/es/ProForm/components/combination/Group/index.d.ts +8 -2
- package/es/ProForm/components/combination/Group/index.js +42 -42
- package/es/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/Group/style/index.less +7 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/es/ProForm/components/combination/Group/utils.js +38 -39
- package/es/ProForm/components/combination/ProCascader/index.js +139 -94
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/es/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/es/ProForm/components/combination/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +18 -20
- package/es/ProForm/components/combination/ProModalSelect/index.js +136 -168
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +73 -47
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/es/ProForm/components/combination/ProRangeLimit/index.js +20 -18
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +17 -15
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/es/ProForm/components/render/ChangedWrapper.js +25 -27
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -11
- package/es/ProForm/components/render/Render.js +118 -101
- package/es/ProForm/components/render/RenderFields.d.ts +1 -1
- package/es/ProForm/components/render/RenderFields.js +25 -25
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/index.js +47 -45
- package/es/ProForm/propsType.d.ts +3 -4
- package/es/ProForm/style/index.less +0 -2
- package/es/ProForm/utils/diffOriginal.d.ts +1 -0
- package/es/ProForm/utils/diffOriginal.js +70 -5
- package/es/ProForm/utils/getDefaultProps.js +5 -5
- package/es/ProForm/utils/index.js +63 -91
- package/es/ProForm/utils/processDependencies.js +4 -5
- package/es/ProForm/utils/rulesCreator.js +12 -12
- package/es/ProForm/utils/transformNames.js +2 -2
- package/es/ProForm/utils/transformValue.js +6 -8
- package/es/ProForm/utils/useDeepCompareMemo.js +1 -1
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +19 -21
- package/es/ProForm/utils/useRules.js +17 -22
- package/es/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/es/ProForm/utils/useShouldUpdate.js +146 -64
- package/es/ProForm/utils/useWatch.js +12 -12
- package/es/ProForm/utils/valueType.js +46 -50
- package/es/ProIcon/index.js +30 -31
- package/es/ProIcon/style/index.less +0 -2
- package/es/ProIcon/utils/index.js +5 -5
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Icon/Icon.js +4 -4
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +68 -19
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +44 -29
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +6 -4
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/index.js +13 -10
- package/es/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Notice/index.js +3 -3
- package/es/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/es/ProLayout/components/ProCollapse/index.js +49 -20
- package/es/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/es/ProLayout/components/ProFooter/index.js +13 -14
- package/es/ProLayout/components/ProFooter/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +6 -5
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -5
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/index.js +68 -59
- package/es/ProLayout/components/ProHeader/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/index.d.ts +0 -11
- package/es/ProLayout/index.js +73 -44
- package/es/ProLayout/propTypes.d.ts +9 -0
- package/es/ProLayout/style/index.less +0 -2
- package/es/ProLayout/utils/index.d.ts +7 -0
- package/es/ProLayout/utils/index.js +46 -17
- package/es/ProSelect/components/AdaptiveTooltip.js +8 -9
- package/es/ProSelect/index.js +57 -64
- package/es/ProSelect/index.less +0 -2
- package/es/ProSelect/utils/index.js +67 -17
- package/es/ProStep/components/Anchor/index.js +10 -9
- package/es/ProStep/components/Item/index.js +12 -13
- package/es/ProStep/components/Listener/index.js +6 -10
- package/es/ProStep/components/Step/index.js +9 -11
- package/es/ProStep/index.js +24 -30
- package/es/ProStep/style/index.less +0 -2
- package/es/ProStep/utils/index.js +8 -8
- package/es/ProStepTab/index.js +27 -28
- package/es/ProTable/components/FormatColumn/index.js +54 -59
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +6 -7
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +21 -37
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +16 -17
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +5 -6
- package/es/ProTable/components/RenderColumn/index.js +36 -35
- package/es/ProTable/components/RenderEmptyText/index.js +1 -1
- package/es/ProTable/components/RenderFooter/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +13 -12
- package/es/ProTable/components/RenderTableHeader/index.js +5 -4
- package/es/ProTable/components/RenderTabs/index.js +26 -29
- package/es/ProTable/components/TableResizable/index.js +8 -8
- package/es/ProTable/components/TooltipTitle/index.js +4 -3
- package/es/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/es/ProTable/hooks/useAntdTable.js +164 -151
- package/es/ProTable/index.d.ts +3 -7
- package/es/ProTable/index.js +124 -147
- package/es/ProTable/propsType.d.ts +12 -5
- package/es/ProTable/style/index.less +4 -6
- package/es/ProTable/utils/index.js +13 -16
- package/es/ProTabs/components/Card/index.js +14 -8
- package/es/ProTabs/index.js +30 -20
- package/es/ProTabs/propType.d.ts +5 -0
- package/es/ProTabs/style/index.less +40 -5
- package/es/ProThemeTools/component/ProTools/index.js +46 -39
- package/es/ProThemeTools/context/ThemeContext.js +13 -13
- package/es/ProThemeTools/index.d.ts +0 -7
- package/es/ProThemeTools/index.js +28 -31
- package/es/ProThemeTools/style/index.less +0 -2
- package/es/ProThemeTools/utils/index.js +14 -18
- package/es/ProTooltip/index.js +24 -27
- package/es/ProTooltip/style/index.less +0 -2
- package/es/ProTree/components/AdaptiveTooltip.js +5 -6
- package/es/ProTree/components/List.js +10 -13
- package/es/ProTree/components/ProTree.js +47 -64
- package/es/ProTree/components/ProTreeSelect/index.js +77 -76
- package/es/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/es/ProTree/components/Tree.js +23 -22
- package/es/ProTree/index.js +1 -1
- package/es/ProTree/style/index.less +0 -2
- package/es/ProTree/utils.js +14 -14
- package/es/ProTreeModal/components/Cascader.js +13 -16
- package/es/ProTreeModal/components/List.js +49 -70
- package/es/ProTreeModal/components/SortableItem.js +7 -8
- package/es/ProTreeModal/components/Tree.js +18 -23
- package/es/ProTreeModal/components/Trigger.js +15 -10
- package/es/ProTreeModal/index.js +98 -151
- package/es/ProTreeModal/style/index.less +0 -2
- package/es/ProTreeModal/utils.js +21 -21
- package/es/ProUpload/components/ButtonRender.js +11 -12
- package/es/ProUpload/components/DragRender.js +17 -20
- package/es/ProUpload/components/DraggableUploadListItem.js +2 -2
- package/es/ProUpload/components/Example.js +3 -3
- package/es/ProUpload/components/FileItem.js +30 -25
- package/es/ProUpload/components/ImageRender.js +29 -22
- package/es/ProUpload/index.js +55 -66
- package/es/ProUpload/style/index.less +0 -2
- package/es/ProUpload/uitls.js +2 -2
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +22 -19
- package/es/ProViewer/propsType.js +0 -3
- package/es/ProViewer/style/index.less +0 -2
- package/es/ProWaterMark/index.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/locale/index.js +2 -2
- package/es/style/index.less +1 -1
- package/es/style/theme/antd.less +0 -2
- package/es/style/theme/base.less +1 -0
- package/es/utils/index.js +11 -13
- package/jest.config.js +46 -4
- package/lib/FormsProvider/index.js +30 -50
- package/lib/ProAction/components/CheckModalContent/index.js +31 -27
- package/lib/ProAction/index.js +194 -151
- package/lib/ProAction/index.less +0 -2
- package/lib/ProAction/propsType.js +4 -16
- package/lib/ProConfigProvider/index.d.ts +1 -0
- package/lib/ProConfigProvider/index.js +137 -136
- package/lib/ProDownload/index.js +192 -124
- package/lib/ProDownload/propsType.js +4 -16
- package/lib/ProDownload/style/index.less +0 -2
- package/lib/ProDownload/utils.js +189 -143
- package/lib/ProDrawerForm/components/ProDrawer/index.js +243 -169
- package/lib/ProDrawerForm/components/ProModal/index.js +194 -134
- package/lib/ProDrawerForm/components/index.js +17 -39
- package/lib/ProDrawerForm/index.js +83 -95
- package/lib/ProDrawerForm/propsType.js +4 -16
- package/lib/ProDrawerForm/style/index.less +0 -2
- package/lib/ProDrawerForm/utils/index.js +13 -30
- package/lib/ProEditLabel/components/RenderProForm.js +58 -57
- package/lib/ProEditLabel/index.js +251 -178
- package/lib/ProEditLabel/propsType.js +4 -16
- package/lib/ProEditLabel/style/index.less +0 -2
- package/lib/ProEditLabel/utils/index.js +11 -26
- package/lib/ProEditTable/components/ActionButton/index.js +144 -155
- package/lib/ProEditTable/components/RcTable/BaseTable.js +97 -96
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +172 -151
- package/lib/ProEditTable/components/RcTable/index.js +17 -39
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +183 -174
- package/lib/ProEditTable/components/RenderField/index.js +628 -539
- package/lib/ProEditTable/components/RenderToolbar/index.js +119 -105
- package/lib/ProEditTable/components/Summary/index.js +70 -61
- package/lib/ProEditTable/components/Validator/index.js +30 -47
- package/lib/ProEditTable/components/index.js +38 -48
- package/lib/ProEditTable/index.js +379 -324
- package/lib/ProEditTable/propsType.d.ts +1 -1
- package/lib/ProEditTable/propsType.js +4 -16
- package/lib/ProEditTable/style/index.less +2 -4
- package/lib/ProEditTable/utils/config.js +225 -170
- package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/lib/ProEditTable/utils/diffOriginal.js +112 -52
- package/lib/ProEditTable/utils/getDefaultProps.js +26 -42
- package/lib/ProEditTable/utils/index.js +318 -244
- package/lib/ProEditTable/utils/tools.js +438 -243
- package/lib/ProEditTable/utils/transform.js +15 -28
- package/lib/ProEditTable/utils/useEditTableError.js +65 -54
- package/lib/ProEnum/components/Group.js +53 -81
- package/lib/ProEnum/components/Tag.js +37 -54
- package/lib/ProEnum/hooks/useEnum.js +74 -51
- package/lib/ProEnum/hooks/useEnumRequest.js +267 -194
- package/lib/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +83 -0
- package/lib/ProEnum/index.js +239 -234
- package/lib/ProEnum/propsType.d.ts +29 -0
- package/lib/ProEnum/propsType.js +4 -16
- package/lib/ProEnum/style/index.less +0 -2
- package/lib/ProEnum/utils/eventCenter.js +15 -12
- package/lib/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/lib/ProEnum/utils/frequentEnum.js +99 -0
- package/lib/ProEnum/utils/getEnumLabel.js +57 -65
- package/lib/ProEnum/utils/index.js +98 -68
- package/lib/ProForm/components/Container.js +35 -45
- package/lib/ProForm/components/FormFooter/index.js +68 -80
- package/lib/ProForm/components/FormFooter/propsType.js +4 -16
- package/lib/ProForm/components/base/Checkbox/index.js +67 -62
- package/lib/ProForm/components/base/DatePicker/index.js +66 -89
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +13 -29
- package/lib/ProForm/components/base/Input/index.js +65 -73
- package/lib/ProForm/components/base/Input/propsType.js +4 -16
- package/lib/ProForm/components/base/InputNumber/index.js +230 -176
- package/lib/ProForm/components/base/Radio/index.js +60 -69
- package/lib/ProForm/components/base/RangePicker/index.js +73 -88
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +28 -45
- package/lib/ProForm/components/base/Select/index.js +63 -69
- package/lib/ProForm/components/base/Switch/index.js +43 -59
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +63 -62
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/lib/ProForm/components/base/TextArea/index.js +52 -65
- package/lib/ProForm/components/base/TextArea/index.less +0 -2
- package/lib/ProForm/components/base/TimePicker/index.js +45 -59
- package/lib/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/lib/ProForm/components/combination/Container/index.js +58 -72
- package/lib/ProForm/components/combination/Container/propsType.js +4 -16
- package/lib/ProForm/components/combination/Container/style/index.less +0 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +240 -195
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +85 -107
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +25 -44
- package/lib/ProForm/components/combination/FormList/components/Empty.js +92 -55
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +92 -117
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +133 -101
- package/lib/ProForm/components/combination/FormList/index.js +131 -164
- package/lib/ProForm/components/combination/FormList/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/style/index.less +0 -2
- package/lib/ProForm/components/combination/FormList/utils.js +32 -52
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +23 -38
- package/lib/ProForm/components/combination/Group/component/ComRender.js +79 -74
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +127 -121
- package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
- package/lib/ProForm/components/combination/Group/index.js +100 -110
- package/lib/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/propsType.js +4 -16
- package/lib/ProForm/components/combination/Group/style/index.less +7 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/utils.js +132 -104
- package/lib/ProForm/components/combination/ProCascader/index.js +289 -187
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/lib/ProForm/components/combination/ProCascader/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +23 -33
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +115 -116
- package/lib/ProForm/components/combination/ProModalSelect/index.js +656 -503
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +21 -43
- package/lib/ProForm/components/combination/ProNumberRange/index.js +207 -160
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +169 -139
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +28 -49
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +150 -127
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/lib/ProForm/components/index.js +192 -115
- package/lib/ProForm/components/render/ChangedWrapper.js +132 -143
- package/lib/ProForm/components/render/ConfirmWrapper.js +120 -78
- package/lib/ProForm/components/render/Render.js +446 -339
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -1
- package/lib/ProForm/components/render/RenderFields.js +195 -179
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/components/render/propsType.js +31 -17
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/index.js +282 -233
- package/lib/ProForm/propsType.d.ts +3 -4
- package/lib/ProForm/propsType.js +9 -38
- package/lib/ProForm/style/index.less +0 -2
- package/lib/ProForm/utils/diffOriginal.d.ts +1 -0
- package/lib/ProForm/utils/diffOriginal.js +107 -53
- package/lib/ProForm/utils/getDefaultProps.js +26 -42
- package/lib/ProForm/utils/index.js +330 -254
- package/lib/ProForm/utils/processDependencies.js +61 -44
- package/lib/ProForm/utils/rulesCreator.js +58 -81
- package/lib/ProForm/utils/transformNames.js +26 -37
- package/lib/ProForm/utils/transformValue.js +47 -47
- package/lib/ProForm/utils/useDeepCompareMemo.js +15 -34
- package/lib/ProForm/utils/useFieldProps.js +10 -42
- package/lib/ProForm/utils/useForm.js +226 -118
- package/lib/ProForm/utils/useRules.js +50 -60
- package/lib/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/lib/ProForm/utils/useShouldUpdate.js +259 -103
- package/lib/ProForm/utils/useWatch.js +122 -93
- package/lib/ProForm/utils/valueType.js +222 -155
- package/lib/ProIcon/config/index.js +278 -365
- package/lib/ProIcon/index.js +217 -184
- package/lib/ProIcon/propsTypes.js +4 -16
- package/lib/ProIcon/style/index.less +0 -2
- package/lib/ProIcon/symbolIcon.js +30 -23
- package/lib/ProIcon/utils/index.js +53 -60
- package/lib/ProLayout/components/Layout/Header/index.js +42 -59
- package/lib/ProLayout/components/Layout/Icon/Icon.js +31 -49
- package/lib/ProLayout/components/Layout/Icon/index.js +7 -34
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +173 -113
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +137 -114
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +4 -16
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +44 -59
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/index.js +52 -68
- package/lib/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Notice/index.js +31 -39
- package/lib/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/index.js +31 -45
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProCollapse/index.js +163 -128
- package/lib/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/lib/ProLayout/components/ProFooter/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProFooter/index.js +41 -56
- package/lib/ProLayout/components/ProFooter/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +26 -53
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +27 -48
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/components/index.js +17 -39
- package/lib/ProLayout/components/ProHeader/index.js +466 -268
- package/lib/ProLayout/components/ProHeader/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/utils/index.js +14 -31
- package/lib/ProLayout/components/index.js +24 -42
- package/lib/ProLayout/index.d.ts +0 -11
- package/lib/ProLayout/index.js +166 -138
- package/lib/ProLayout/propTypes.d.ts +9 -0
- package/lib/ProLayout/propTypes.js +4 -16
- package/lib/ProLayout/style/index.less +0 -2
- package/lib/ProLayout/utils/index.d.ts +7 -0
- package/lib/ProLayout/utils/index.js +125 -76
- package/lib/ProSelect/components/AdaptiveTooltip.js +38 -45
- package/lib/ProSelect/index.js +240 -213
- package/lib/ProSelect/index.less +0 -2
- package/lib/ProSelect/propsType.js +4 -16
- package/lib/ProSelect/utils/index.js +123 -73
- package/lib/ProStep/components/Anchor/index.js +102 -107
- package/lib/ProStep/components/Item/index.js +71 -76
- package/lib/ProStep/components/Listener/index.js +69 -62
- package/lib/ProStep/components/Step/index.js +65 -75
- package/lib/ProStep/index.js +227 -165
- package/lib/ProStep/propsType.js +4 -16
- package/lib/ProStep/style/index.less +0 -2
- package/lib/ProStep/utils/index.js +54 -57
- package/lib/ProStepTab/index.js +307 -166
- package/lib/ProStepTab/propsType.js +4 -16
- package/lib/ProTable/components/FormatColumn/index.js +472 -425
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +39 -53
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +183 -135
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +85 -104
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +4 -16
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +58 -80
- package/lib/ProTable/components/RcTable/index.js +17 -39
- package/lib/ProTable/components/RenderColumn/index.js +203 -194
- package/lib/ProTable/components/RenderEmptyText/index.js +25 -27
- package/lib/ProTable/components/RenderFooter/index.js +17 -33
- package/lib/ProTable/components/RenderSummary/index.js +57 -46
- package/lib/ProTable/components/RenderTableHeader/index.js +62 -68
- package/lib/ProTable/components/RenderTabs/index.js +67 -80
- package/lib/ProTable/components/TableResizable/index.js +87 -87
- package/lib/ProTable/components/TooltipTitle/index.js +27 -40
- package/lib/ProTable/components/index.js +45 -51
- package/lib/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/lib/ProTable/hooks/useAntdTable.js +373 -291
- package/lib/ProTable/index.d.ts +3 -7
- package/lib/ProTable/index.js +354 -338
- package/lib/ProTable/propsType.d.ts +12 -5
- package/lib/ProTable/propsType.js +4 -16
- package/lib/ProTable/style/index.less +4 -6
- package/lib/ProTable/utils/index.js +89 -78
- package/lib/ProTabs/components/Card/index.js +57 -30
- package/lib/ProTabs/components/index.js +10 -36
- package/lib/ProTabs/index.js +94 -89
- package/lib/ProTabs/propType.d.ts +5 -0
- package/lib/ProTabs/propType.js +4 -16
- package/lib/ProTabs/style/index.less +40 -5
- package/lib/ProThemeTools/component/ProTools/index.js +246 -198
- package/lib/ProThemeTools/component/index.js +10 -36
- package/lib/ProThemeTools/context/ThemeContext.js +99 -89
- package/lib/ProThemeTools/index.d.ts +0 -7
- package/lib/ProThemeTools/index.js +207 -179
- package/lib/ProThemeTools/propsType.js +4 -16
- package/lib/ProThemeTools/style/index.less +0 -2
- package/lib/ProThemeTools/utils/index.js +84 -80
- package/lib/ProTooltip/index.js +217 -214
- package/lib/ProTooltip/propsType.js +4 -16
- package/lib/ProTooltip/style/index.less +0 -2
- package/lib/ProTree/components/AdaptiveTooltip.js +22 -33
- package/lib/ProTree/components/CloseIcon.js +31 -36
- package/lib/ProTree/components/List.js +69 -68
- package/lib/ProTree/components/ProTree.js +346 -258
- package/lib/ProTree/components/ProTreeSelect/index.js +460 -336
- package/lib/ProTree/components/ProTreeSelect/propsType.js +4 -16
- package/lib/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/lib/ProTree/components/SearchTitle.js +50 -47
- package/lib/ProTree/components/Tree.js +300 -227
- package/lib/ProTree/components/index.js +31 -45
- package/lib/ProTree/index.js +22 -45
- package/lib/ProTree/propsType.js +4 -16
- package/lib/ProTree/style/index.less +0 -2
- package/lib/ProTree/utils.js +140 -79
- package/lib/ProTreeModal/components/Cascader.js +90 -97
- package/lib/ProTreeModal/components/CloseIcon.js +31 -36
- package/lib/ProTreeModal/components/List.js +246 -192
- package/lib/ProTreeModal/components/SearchTitle.js +22 -30
- package/lib/ProTreeModal/components/SortableItem.js +59 -60
- package/lib/ProTreeModal/components/Tree.js +171 -157
- package/lib/ProTreeModal/components/Trigger.js +131 -108
- package/lib/ProTreeModal/components/index.js +45 -51
- package/lib/ProTreeModal/index.js +523 -448
- package/lib/ProTreeModal/propsType.js +4 -16
- package/lib/ProTreeModal/style/index.less +0 -2
- package/lib/ProTreeModal/utils.js +160 -99
- package/lib/ProUpload/components/ButtonRender.js +106 -85
- package/lib/ProUpload/components/DragRender.js +167 -117
- package/lib/ProUpload/components/DraggableUploadListItem.js +32 -48
- package/lib/ProUpload/components/Example.js +39 -55
- package/lib/ProUpload/components/FileItem.js +215 -113
- package/lib/ProUpload/components/ImageRender.js +250 -175
- package/lib/ProUpload/index.js +185 -181
- package/lib/ProUpload/propsType.js +4 -16
- package/lib/ProUpload/style/index.less +0 -2
- package/lib/ProUpload/uitls.js +9 -31
- package/lib/ProUtils/utils/index.js +20 -36
- package/lib/ProViewer/index.js +210 -175
- package/lib/ProViewer/propsType.js +1 -17
- package/lib/ProViewer/style/index.less +0 -2
- package/lib/ProWaterMark/index.js +20 -38
- package/lib/ProWaterMark/propsType.js +4 -16
- package/lib/index.d.ts +1 -1
- package/lib/index.js +272 -123
- package/lib/locale/en_US.js +127 -145
- package/lib/locale/index.js +40 -55
- package/lib/locale/zh_CN.js +128 -146
- package/lib/style/index.less +1 -1
- package/lib/style/theme/antd.less +0 -2
- package/lib/style/theme/base.less +1 -0
- package/lib/tokens.js +87 -103
- package/lib/utils/index.js +66 -88
- package/package.json +12 -11
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.js +0 -3
package/es/ProSelect/index.js
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
+
import "antd/es/space/style";
|
2
|
+
import _Space from "antd/es/space";
|
3
|
+
import "antd/es/input/style";
|
4
|
+
import _Input from "antd/es/input";
|
1
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
6
|
+
import "antd/es/message/style";
|
7
|
+
import _message from "antd/es/message";
|
2
8
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
10
|
+
import "antd/es/select/style";
|
11
|
+
import _Select from "antd/es/select";
|
4
12
|
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "filterInList", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse", "getValueProps", "isView"];
|
5
13
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
6
|
-
import { Input, message, Select, Space } from 'antd';
|
7
14
|
import React, { useImperativeHandle, useState, forwardRef, isValidElement, useCallback } from 'react';
|
8
15
|
import { isFunction, isObject, isString, omit, isNumber } from 'lodash';
|
9
16
|
import { useProConfig } from "../ProConfigProvider";
|
@@ -14,8 +21,8 @@ import locale from "../locale";
|
|
14
21
|
import { getSelectList } from "./utils";
|
15
22
|
import "./index.less";
|
16
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
17
|
-
var Option =
|
18
|
-
export var ProSelect =
|
24
|
+
var Option = _Select.Option;
|
25
|
+
export var ProSelect = (props, ref) => {
|
19
26
|
var _selectProps$showCode, _useRequest$options3, _locale$ProSelect;
|
20
27
|
var _ref = useProConfig('ProSelect') || {},
|
21
28
|
_ref$fieldNames = _ref.fieldNames,
|
@@ -71,18 +78,18 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
71
78
|
isDefaultOne = _useState4[0],
|
72
79
|
setIsDefaultOne = _useState4[1];
|
73
80
|
var OptionRender = optionRender;
|
74
|
-
var defaultOnSuccessFun =
|
81
|
+
var defaultOnSuccessFun = res => {
|
75
82
|
var _res$status = res.status,
|
76
83
|
status = _res$status === void 0 ? 200 : _res$status,
|
77
84
|
msg = res.message,
|
78
85
|
data = res.data;
|
79
86
|
if (status !== 200) {
|
80
|
-
|
87
|
+
_message.error(msg);
|
81
88
|
return;
|
82
89
|
}
|
83
90
|
setSelectList(data || []);
|
84
91
|
};
|
85
|
-
var successTransformDataHandle = useCallback(
|
92
|
+
var successTransformDataHandle = useCallback(res => {
|
86
93
|
if (transformResponse && typeof transformResponse === 'function') {
|
87
94
|
return transformResponse(res);
|
88
95
|
}
|
@@ -92,7 +99,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
92
99
|
msg = _ref3.message,
|
93
100
|
data = _ref3.data;
|
94
101
|
if (status !== 200) {
|
95
|
-
|
102
|
+
_message.error(msg);
|
96
103
|
return;
|
97
104
|
}
|
98
105
|
return data;
|
@@ -101,7 +108,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
101
108
|
manual: true,
|
102
109
|
debounceWait: 300
|
103
110
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
104
|
-
onSuccess:
|
111
|
+
onSuccess: data => {
|
105
112
|
var _useRequest$options, _useRequest$options$o, _useRequest$options2;
|
106
113
|
if (transformResponse && typeof transformResponse === 'function') {
|
107
114
|
var responseData = transformResponse(data);
|
@@ -115,31 +122,25 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
115
122
|
}
|
116
123
|
}));
|
117
124
|
var cacheList = useRequest !== null && useRequest !== void 0 && (_useRequest$options3 = useRequest.options) !== null && _useRequest$options3 !== void 0 && _useRequest$options3.cacheKey ? successTransformDataHandle(fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data) : [];
|
118
|
-
var getValueObject =
|
125
|
+
var getValueObject = input => {
|
119
126
|
if (Array.isArray(input) && input.length) {
|
120
127
|
var resArr = [];
|
121
|
-
input.forEach(
|
122
|
-
var res = selectList.find(
|
123
|
-
return item[code] === i;
|
124
|
-
});
|
128
|
+
input.forEach(i => {
|
129
|
+
var res = selectList.find(item => item[code] === i);
|
125
130
|
if (res) resArr.push(res);
|
126
131
|
});
|
127
132
|
return resArr;
|
128
133
|
}
|
129
|
-
return selectList.find(
|
130
|
-
return item[code] === input;
|
131
|
-
});
|
134
|
+
return selectList.find(item => item[code] === input);
|
132
135
|
};
|
133
|
-
useImperativeHandle(ref,
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
});
|
139
|
-
useDeepCompareEffect(function () {
|
136
|
+
useImperativeHandle(ref, () => ({
|
137
|
+
getValueObject,
|
138
|
+
useRequestRef: fetchFunction
|
139
|
+
}));
|
140
|
+
useDeepCompareEffect(() => {
|
140
141
|
setSelectList(dataSource);
|
141
142
|
}, [dataSource]);
|
142
|
-
useDeepCompareEffect(
|
143
|
+
useDeepCompareEffect(() => {
|
143
144
|
var _useRequest$options4;
|
144
145
|
// 设置cacheKey后使用缓存的数据
|
145
146
|
if (!(selectList !== null && selectList !== void 0 && selectList.length) && useRequest !== null && useRequest !== void 0 && (_useRequest$options4 = useRequest.options) !== null && _useRequest$options4 !== void 0 && _useRequest$options4.cacheKey) {
|
@@ -148,7 +149,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
148
149
|
}
|
149
150
|
}
|
150
151
|
}, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
|
151
|
-
useDeepCompareEffect(
|
152
|
+
useDeepCompareEffect(() => {
|
152
153
|
// 默认disable值时,不查询接口
|
153
154
|
if (defaultDisableValue || !useRequest) {
|
154
155
|
return;
|
@@ -167,57 +168,53 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
167
168
|
if (defaultDisableValue) {
|
168
169
|
return /*#__PURE__*/_jsx("span", {
|
169
170
|
title: defaultDisableValue,
|
170
|
-
children: /*#__PURE__*/_jsx(
|
171
|
+
children: /*#__PURE__*/_jsx(_Input, {
|
171
172
|
disabled: true,
|
172
173
|
defaultValue: defaultDisableValue,
|
173
174
|
style: props === null || props === void 0 ? void 0 : props.style
|
174
175
|
})
|
175
176
|
});
|
176
177
|
}
|
177
|
-
var transToLabel =
|
178
|
+
var transToLabel = value => {
|
178
179
|
if (!Array.isArray(selectList) || !selectList.length) {
|
179
180
|
return viewEmpty;
|
180
181
|
}
|
181
|
-
var labelList = value.map(
|
182
|
-
var option = selectList.find(
|
182
|
+
var labelList = value.map(v => {
|
183
|
+
var option = selectList.find(item => {
|
183
184
|
if (labelInValue) {
|
184
185
|
return item[code] === v[code];
|
185
186
|
}
|
186
187
|
return item[code] === v;
|
187
188
|
});
|
188
189
|
if (option) {
|
189
|
-
return selectProps.showCodeName ?
|
190
|
+
return selectProps.showCodeName ? `${option[code]}-${option[label]}` : option === null || option === void 0 ? void 0 : option[label];
|
190
191
|
}
|
191
192
|
return '-';
|
192
193
|
});
|
193
|
-
var record = value.map(
|
194
|
-
return selectList.find(
|
194
|
+
var record = value.map(v => {
|
195
|
+
return selectList.find(item => {
|
195
196
|
if (labelInValue) {
|
196
197
|
return item[code] === v[code];
|
197
198
|
}
|
198
199
|
return item[code] === v;
|
199
200
|
});
|
200
|
-
}).filter(
|
201
|
-
return !!v;
|
202
|
-
});
|
201
|
+
}).filter(v => !!v);
|
203
202
|
|
204
203
|
// 自定义option时,默认取optionRender的值
|
205
|
-
var _optionRender =
|
204
|
+
var _optionRender = () => {
|
206
205
|
if (!record.length) {
|
207
206
|
return viewEmpty;
|
208
207
|
}
|
209
208
|
var arr = [];
|
210
|
-
record.forEach(
|
209
|
+
record.forEach(item => {
|
211
210
|
arr.push(props.optionRender(item));
|
212
211
|
});
|
213
|
-
return /*#__PURE__*/_jsx(
|
212
|
+
return /*#__PURE__*/_jsx(_Space, {
|
214
213
|
direction: "vertical",
|
215
214
|
size: 4,
|
216
|
-
children: arr.map(
|
217
|
-
|
218
|
-
|
219
|
-
}, item);
|
220
|
-
})
|
215
|
+
children: arr.map(item => /*#__PURE__*/_jsx(React.Fragment, {
|
216
|
+
children: item
|
217
|
+
}, item))
|
221
218
|
});
|
222
219
|
};
|
223
220
|
return isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
@@ -235,7 +232,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
235
232
|
children: value || isNumber(value) ? transToLabel([value]) : null
|
236
233
|
});
|
237
234
|
}
|
238
|
-
var TooltipOption =
|
235
|
+
var TooltipOption = props => {
|
239
236
|
if (tooltip) {
|
240
237
|
return /*#__PURE__*/_jsx(AdaptiveTooltip, {
|
241
238
|
children: props.children
|
@@ -243,10 +240,8 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
243
240
|
}
|
244
241
|
return props.children;
|
245
242
|
};
|
246
|
-
var isReactElement =
|
247
|
-
|
248
|
-
};
|
249
|
-
var handleChange = function handleChange(value, _option) {
|
243
|
+
var isReactElement = element => /*#__PURE__*/isValidElement(element);
|
244
|
+
var handleChange = (value, _option) => {
|
250
245
|
// option/其第一层子节点是react节点且是labelInValue就拿record
|
251
246
|
var option = _option;
|
252
247
|
if (labelInValue && (isReactElement(_option) || isReactElement(_option === null || _option === void 0 ? void 0 : _option.children))) {
|
@@ -255,7 +250,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
255
250
|
var getChangeValue = selectProps.getChangeValue;
|
256
251
|
if (selectProps.mode && selectProps.mode === 'multiple') {
|
257
252
|
if (Array.isArray(option)) {
|
258
|
-
option.forEach(
|
253
|
+
option.forEach(item => {
|
259
254
|
Object.assign(item, item.record);
|
260
255
|
delete item.record;
|
261
256
|
delete item.children;
|
@@ -277,7 +272,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
277
272
|
* 处理 labelInValue 模式下值的回填
|
278
273
|
* @returns
|
279
274
|
*/
|
280
|
-
var transformValue =
|
275
|
+
var transformValue = () => {
|
281
276
|
if (labelInValue && !selectProps.mode) {
|
282
277
|
if (!isObject(value)) {
|
283
278
|
return undefined;
|
@@ -289,9 +284,7 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
289
284
|
if (!Array.isArray(value)) {
|
290
285
|
return [];
|
291
286
|
}
|
292
|
-
return value.map(
|
293
|
-
return item === null || item === void 0 ? void 0 : item[code];
|
294
|
-
});
|
287
|
+
return value.map(item => item === null || item === void 0 ? void 0 : item[code]);
|
295
288
|
}
|
296
289
|
// Handling Jialuo's Extreme Demands
|
297
290
|
if (selectProps.mode && value === null) {
|
@@ -315,48 +308,48 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
315
308
|
var newSelectList = selectList;
|
316
309
|
if (otherProps !== null && otherProps !== void 0 && otherProps.listName && filterInList) {
|
317
310
|
newSelectList = getSelectList({
|
318
|
-
otherProps
|
319
|
-
value
|
311
|
+
otherProps,
|
312
|
+
value,
|
320
313
|
dataSource: selectList,
|
321
|
-
labelInValue
|
322
|
-
fieldNames
|
314
|
+
labelInValue,
|
315
|
+
fieldNames,
|
323
316
|
mode: selectProps.mode
|
324
317
|
});
|
325
318
|
}
|
326
319
|
return /*#__PURE__*/_jsx("div", {
|
327
320
|
style: props.style,
|
328
321
|
className: "pro-select",
|
329
|
-
children: /*#__PURE__*/_jsx(
|
322
|
+
children: /*#__PURE__*/_jsx(_Select, _objectSpread(_objectSpread({
|
330
323
|
placeholder: locale === null || locale === void 0 || (_locale$ProSelect = locale.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
|
331
324
|
allowClear: true,
|
332
325
|
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
333
326
|
onChange: handleChange,
|
334
327
|
showSearch: true,
|
335
|
-
filterOption: isFunction(_onSearch) ? false :
|
328
|
+
filterOption: isFunction(_onSearch) ? false : (input, option) => {
|
336
329
|
var _option$children;
|
337
330
|
var value = isString(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 || (_option$children = option.children) === null || _option$children === void 0 || (_option$children = _option$children.props) === null || _option$children === void 0 ? void 0 : _option$children.title;
|
338
331
|
return value.toLowerCase().includes(input.toLowerCase());
|
339
332
|
},
|
340
|
-
onSearch:
|
333
|
+
onSearch: value => {
|
341
334
|
_onSearch && _onSearch(value, _objectSpread({}, fetchFunction));
|
342
335
|
},
|
343
|
-
getPopupContainer:
|
336
|
+
getPopupContainer: trigger => {
|
344
337
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
345
338
|
}
|
346
339
|
}, omit(_objectSpread({}, selectProps), ['isView', 'showCodeName', 'form', 'name', 'style', 'onFieldChange'])), {}, {
|
347
340
|
value: transformValue(),
|
348
|
-
children: Array.isArray(newSelectList) && newSelectList.map(
|
341
|
+
children: Array.isArray(newSelectList) && newSelectList.map(item => {
|
349
342
|
return /*#__PURE__*/_jsx(Option, {
|
350
343
|
label: item[label],
|
351
344
|
value: item[code],
|
352
345
|
record: item,
|
353
346
|
disabled: !!item.disabled,
|
354
347
|
children: /*#__PURE__*/_jsx(TooltipOption, {
|
355
|
-
title: OptionRender ? OptionRender(item) : selectProps.showCodeName ?
|
348
|
+
title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? `${item[code]}-${item[label]}` : item[label],
|
356
349
|
children: OptionRender ? /*#__PURE__*/_jsx("span", {
|
357
350
|
children: OptionRender(item)
|
358
351
|
}) : /*#__PURE__*/_jsx("span", {
|
359
|
-
children: selectProps.showCodeName ?
|
352
|
+
children: selectProps.showCodeName ? `${item[code]}-${item[label]}` : item[label]
|
360
353
|
})
|
361
354
|
}, item[code])
|
362
355
|
}, item[code]);
|
package/es/ProSelect/index.less
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
2
1
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
3
2
|
/* eslint-disable no-restricted-syntax */
|
4
3
|
|
@@ -14,7 +13,7 @@ import _, { isNumber } from 'lodash';
|
|
14
13
|
* @param fieldNames 字段名
|
15
14
|
* @param mode 模式
|
16
15
|
*/
|
17
|
-
var findSelectNameValues =
|
16
|
+
var findSelectNameValues = _ref => {
|
18
17
|
var _ref$list = _ref.list,
|
19
18
|
list = _ref$list === void 0 ? [] : _ref$list,
|
20
19
|
selectName = _ref.selectName,
|
@@ -24,7 +23,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
24
23
|
fieldNames = _ref.fieldNames,
|
25
24
|
mode = _ref.mode;
|
26
25
|
var selectValues = [];
|
27
|
-
list.forEach(
|
26
|
+
list.forEach(item => {
|
28
27
|
var result = item;
|
29
28
|
if (!item || !Object.keys(item).length || Object.keys(item).length === 1 && 'rowKey' in item) {
|
30
29
|
return false;
|
@@ -42,21 +41,74 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
42
41
|
_iterator.f();
|
43
42
|
}
|
44
43
|
if (mode === 'multiple') {
|
45
|
-
selectValues = [
|
44
|
+
selectValues = [...selectValues, ...(result || [])];
|
46
45
|
} else {
|
47
46
|
selectValues.push(result);
|
48
47
|
}
|
49
48
|
});
|
50
49
|
var diffList = _.difference(selectValues, mode === 'multiple' ? value : [value]);
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
var result = dataSource.filter(item => !diffList.includes(labelInValue ? item : item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] || (item === null || item === void 0 ? void 0 : item.value)));
|
51
|
+
var isSingle = list === null || list === void 0 ? void 0 : list.find(item => item === null || item === void 0 ? void 0 : item._isEditing);
|
52
|
+
|
53
|
+
// 修复单行编辑模式下,选择器无法过滤的问题
|
54
|
+
if (mode === 'multiple' && isSingle) {
|
55
|
+
// 找到当前编辑行
|
56
|
+
var editingRow = list.find(item => item === null || item === void 0 ? void 0 : item._isEditing);
|
57
|
+
|
58
|
+
// 收集其他行的已选择值
|
59
|
+
var otherRowsValues = [];
|
60
|
+
list.forEach(item => {
|
61
|
+
if (item !== editingRow) {
|
62
|
+
// 排除当前编辑行
|
63
|
+
var _result = item;
|
64
|
+
var _iterator2 = _createForOfIteratorHelper(selectName),
|
65
|
+
_step2;
|
66
|
+
try {
|
67
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
68
|
+
var key = _step2.value;
|
69
|
+
_result = _result[key];
|
70
|
+
}
|
71
|
+
} catch (err) {
|
72
|
+
_iterator2.e(err);
|
73
|
+
} finally {
|
74
|
+
_iterator2.f();
|
75
|
+
}
|
76
|
+
if (_result) {
|
77
|
+
otherRowsValues.push(...(Array.isArray(_result) ? _result : [_result]));
|
78
|
+
}
|
79
|
+
}
|
80
|
+
});
|
81
|
+
|
82
|
+
// 获取当前编辑行的已选择值
|
83
|
+
var currentRowValues = [];
|
84
|
+
if (editingRow) {
|
85
|
+
var _result2 = editingRow;
|
86
|
+
var _iterator3 = _createForOfIteratorHelper(selectName),
|
87
|
+
_step3;
|
88
|
+
try {
|
89
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
90
|
+
var key = _step3.value;
|
91
|
+
_result2 = _result2[key];
|
92
|
+
}
|
93
|
+
} catch (err) {
|
94
|
+
_iterator3.e(err);
|
95
|
+
} finally {
|
96
|
+
_iterator3.f();
|
97
|
+
}
|
98
|
+
currentRowValues = Array.isArray(_result2) ? _result2 : _result2 ? [_result2] : [];
|
99
|
+
}
|
100
|
+
|
101
|
+
// 从dataSource中过滤掉其他行的值,但保留当前行的值
|
102
|
+
var _diffList = _.difference(otherRowsValues, currentRowValues);
|
103
|
+
return dataSource.filter(item => !_diffList.includes(labelInValue ? item : item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] || (item === null || item === void 0 ? void 0 : item.value)));
|
104
|
+
}
|
105
|
+
return result;
|
54
106
|
};
|
55
107
|
|
56
108
|
/**
|
57
109
|
* 返回当前组件可以显示的数据源
|
58
110
|
*/
|
59
|
-
export var getSelectList =
|
111
|
+
export var getSelectList = _ref2 => {
|
60
112
|
var otherProps = _ref2.otherProps,
|
61
113
|
value = _ref2.value,
|
62
114
|
dataSource = _ref2.dataSource,
|
@@ -71,18 +123,16 @@ export var getSelectList = function getSelectList(_ref2) {
|
|
71
123
|
form = otherProps.form;
|
72
124
|
// 修复formlist无法过滤的问题
|
73
125
|
var _name = Array.isArray(name) && isNumber(name[0]) ? listName : name;
|
74
|
-
var firstNumberIndex = listName.lastIndexOf(listName.findLast(
|
75
|
-
return typeof item === 'number';
|
76
|
-
}));
|
126
|
+
var firstNumberIndex = listName.lastIndexOf(listName.findLast(item => typeof item === 'number'));
|
77
127
|
var fatherName = (_name || listName).slice(0, firstNumberIndex);
|
78
128
|
var selectName = (_name || listName).slice(firstNumberIndex + 1);
|
79
129
|
return findSelectNameValues({
|
80
130
|
list: form.getFieldValue(fatherName) || [],
|
81
|
-
selectName
|
82
|
-
value
|
83
|
-
dataSource
|
84
|
-
labelInValue
|
85
|
-
fieldNames
|
86
|
-
mode
|
131
|
+
selectName,
|
132
|
+
value,
|
133
|
+
dataSource,
|
134
|
+
labelInValue,
|
135
|
+
fieldNames,
|
136
|
+
mode
|
87
137
|
});
|
88
138
|
};
|
@@ -1,9 +1,10 @@
|
|
1
|
+
import "antd/es/badge/style";
|
2
|
+
import _Badge from "antd/es/badge";
|
1
3
|
import cn from 'classnames';
|
2
|
-
import { Badge } from 'antd';
|
3
4
|
import { handleScroll } from "../../utils";
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
6
|
-
var AnchorSvg =
|
7
|
+
var AnchorSvg = _ref => {
|
7
8
|
var color = _ref.color;
|
8
9
|
return /*#__PURE__*/_jsxs("svg", {
|
9
10
|
viewBox: "0 0 1097 1024",
|
@@ -19,7 +20,7 @@ var AnchorSvg = function AnchorSvg(_ref) {
|
|
19
20
|
})]
|
20
21
|
});
|
21
22
|
};
|
22
|
-
var SuccessSvg =
|
23
|
+
var SuccessSvg = () => {
|
23
24
|
return /*#__PURE__*/_jsx("svg", {
|
24
25
|
viewBox: "0 0 1408 1024",
|
25
26
|
width: "18",
|
@@ -29,7 +30,7 @@ var SuccessSvg = function SuccessSvg() {
|
|
29
30
|
})
|
30
31
|
});
|
31
32
|
};
|
32
|
-
export var MenuItem =
|
33
|
+
export var MenuItem = props => {
|
33
34
|
var name = props.name,
|
34
35
|
code = props.code,
|
35
36
|
onOff = props.onOff,
|
@@ -43,7 +44,7 @@ export var MenuItem = function MenuItem(props) {
|
|
43
44
|
targetOffset = props.targetOffset,
|
44
45
|
_props$scrollToError = props.scrollToError,
|
45
46
|
scrollToError = _props$scrollToError === void 0 ? true : _props$scrollToError;
|
46
|
-
var renderMenuIcon =
|
47
|
+
var renderMenuIcon = () => {
|
47
48
|
if (isCurrentStep) {
|
48
49
|
return /*#__PURE__*/_jsx("span", {
|
49
50
|
className: cn('pro-step-dot-icon', {
|
@@ -79,10 +80,10 @@ export var MenuItem = function MenuItem(props) {
|
|
79
80
|
disabled: isDisabled,
|
80
81
|
current: isCurrentStep && onOff
|
81
82
|
}),
|
82
|
-
onClick:
|
83
|
+
onClick: () => {
|
83
84
|
handleScroll(code, {
|
84
|
-
targetOffset
|
85
|
-
scrollToError
|
85
|
+
targetOffset,
|
86
|
+
scrollToError
|
86
87
|
});
|
87
88
|
},
|
88
89
|
children: [/*#__PURE__*/_jsxs("div", {
|
@@ -100,7 +101,7 @@ export var MenuItem = function MenuItem(props) {
|
|
100
101
|
className: "pro-step-checked-status",
|
101
102
|
children: [isChecked && /*#__PURE__*/_jsx(SuccessSvg, {}), errorNum > 0 && /*#__PURE__*/_jsx("div", {
|
102
103
|
className: "pro-step-error-dot",
|
103
|
-
children: /*#__PURE__*/_jsx(
|
104
|
+
children: /*#__PURE__*/_jsx(_Badge, {
|
104
105
|
count: errorNum
|
105
106
|
})
|
106
107
|
})]
|
@@ -15,7 +15,7 @@ var defaultLazyLoadConfig = {
|
|
15
15
|
// Start loading when the target is 100px from the viewport
|
16
16
|
once: true // Load only once upon first entry into the viewport
|
17
17
|
};
|
18
|
-
var ProStepItem =
|
18
|
+
var ProStepItem = _ref => {
|
19
19
|
var id = _ref.id,
|
20
20
|
title = _ref.title,
|
21
21
|
_ref$collapse = _ref.collapse,
|
@@ -30,25 +30,24 @@ var ProStepItem = function ProStepItem(_ref) {
|
|
30
30
|
collapse = _useStep.collapse,
|
31
31
|
globalLazyLoad = _useStep.lazyLoad;
|
32
32
|
var lazyLoad = stepLazyLoad !== null && stepLazyLoad !== void 0 ? stepLazyLoad : globalLazyLoad;
|
33
|
-
useEffect(
|
33
|
+
useEffect(() => {
|
34
34
|
// Schedule registration to avoid re-render issues
|
35
|
-
var timeoutId = setTimeout(
|
35
|
+
var timeoutId = setTimeout(() => {
|
36
36
|
register === null || register === void 0 || register(_objectSpread({
|
37
|
-
id
|
38
|
-
title
|
39
|
-
order
|
40
|
-
lazyLoad
|
37
|
+
id,
|
38
|
+
title,
|
39
|
+
order,
|
40
|
+
lazyLoad
|
41
41
|
}, restProps));
|
42
42
|
}, 0);
|
43
|
-
return
|
43
|
+
return () => {
|
44
44
|
clearTimeout(timeoutId);
|
45
45
|
};
|
46
46
|
}, [id, title, order, lazyLoad, restProps, register]);
|
47
|
-
var renderChildren =
|
47
|
+
var renderChildren = () => {
|
48
48
|
if (lazyLoad) {
|
49
49
|
var lazyLoadProps = isBoolean(lazyLoad) ? defaultLazyLoadConfig : lazyLoad;
|
50
|
-
|
51
|
-
return /*#__PURE__*/_jsx(LazyLoadComponent, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
|
50
|
+
return /*#__PURE__*/_jsx(LazyLoad, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
|
52
51
|
classNamePrefix: id,
|
53
52
|
children: children
|
54
53
|
}));
|
@@ -65,11 +64,11 @@ var ProStepItem = function ProStepItem(_ref) {
|
|
65
64
|
title: title,
|
66
65
|
icon: true
|
67
66
|
}, restProps), {}, {
|
68
|
-
onChange:
|
67
|
+
onChange: e => {
|
69
68
|
var _restProps$onChange;
|
70
69
|
if (lazyLoad) {
|
71
70
|
// 延时执行, 避免在折叠时, 懒加载的元素没有高度
|
72
|
-
setTimeout(
|
71
|
+
setTimeout(() => {
|
73
72
|
forceCheck();
|
74
73
|
}, 100);
|
75
74
|
}
|
@@ -13,12 +13,10 @@ import { getLoadedMap } from "../../utils";
|
|
13
13
|
* @param data 模块加载数据
|
14
14
|
* @returns 是否所有模块都已加载
|
15
15
|
*/
|
16
|
-
var areAllModulesLoaded =
|
17
|
-
return data.every(
|
18
|
-
return (item === null || item === void 0 ? void 0 : item.loaded) === true;
|
19
|
-
});
|
16
|
+
var areAllModulesLoaded = data => {
|
17
|
+
return data.every(item => (item === null || item === void 0 ? void 0 : item.loaded) === true);
|
20
18
|
};
|
21
|
-
var Listener =
|
19
|
+
var Listener = _ref => {
|
22
20
|
var children = _ref.children,
|
23
21
|
delayTime = _ref.delayTime,
|
24
22
|
excludes = _ref.excludes,
|
@@ -42,17 +40,15 @@ var Listener = function Listener(_ref) {
|
|
42
40
|
forceVisible();
|
43
41
|
// 等待0.2秒,让dom渲染做form校验
|
44
42
|
_context.next = 7;
|
45
|
-
return new Promise(
|
46
|
-
return setTimeout(resolve, 200);
|
47
|
-
});
|
43
|
+
return new Promise(resolve => setTimeout(resolve, 200));
|
48
44
|
case 7:
|
49
45
|
_context.next = 9;
|
50
46
|
return notify === null || notify === void 0 ? void 0 : notify({
|
51
|
-
excludes
|
47
|
+
excludes
|
52
48
|
});
|
53
49
|
case 9:
|
54
50
|
values = _context.sent;
|
55
|
-
setTimeout(
|
51
|
+
setTimeout(() => {
|
56
52
|
var localData = localStorage.getItem('cache-pro-step');
|
57
53
|
if (localData !== 'false') {
|
58
54
|
var _children$props, _children$props$onCli;
|
@@ -8,7 +8,7 @@ import Anchor from "../Anchor";
|
|
8
8
|
import locale from "../../../locale";
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
-
export var Step =
|
11
|
+
export var Step = _ref => {
|
12
12
|
var _locale$ProStep;
|
13
13
|
var fixedTop = _ref.fixedTop,
|
14
14
|
_ref$dataSource = _ref.dataSource,
|
@@ -22,17 +22,15 @@ export var Step = function Step(_ref) {
|
|
22
22
|
_useState2 = _slicedToArray(_useState, 2),
|
23
23
|
onOff = _useState2[0],
|
24
24
|
setOnOff = _useState2[1];
|
25
|
-
var options = useMemo(
|
25
|
+
var options = useMemo(() => {
|
26
26
|
var nextDataSource = cloneDeep(dataSource);
|
27
27
|
var activeIndex;
|
28
28
|
if (activeKey) {
|
29
|
-
activeIndex = nextDataSource.findIndex(
|
30
|
-
return item.code === activeKey;
|
31
|
-
});
|
29
|
+
activeIndex = nextDataSource.findIndex(item => item.code === activeKey);
|
32
30
|
} else {
|
33
31
|
activeIndex = nextDataSource.length - 1;
|
34
32
|
}
|
35
|
-
nextDataSource.forEach(
|
33
|
+
nextDataSource.forEach((item, index) => {
|
36
34
|
var errorNum = errorCollection === null || errorCollection === void 0 ? void 0 : errorCollection[item.code];
|
37
35
|
item.isStart = index === 0;
|
38
36
|
item.isEnd = index === dataSource.length - 1;
|
@@ -45,17 +43,17 @@ export var Step = function Step(_ref) {
|
|
45
43
|
});
|
46
44
|
return nextDataSource;
|
47
45
|
}, [dataSource, activeKey, errorCollection]);
|
48
|
-
var handleMouseEnter =
|
46
|
+
var handleMouseEnter = () => {
|
49
47
|
setOnOff(true);
|
50
48
|
};
|
51
|
-
var handleMouseLeave =
|
49
|
+
var handleMouseLeave = () => {
|
52
50
|
setOnOff(false);
|
53
51
|
};
|
54
52
|
return /*#__PURE__*/_jsxs("div", {
|
55
|
-
className:
|
53
|
+
className: `pro-step ${onOff ? 'open' : 'closed'}`,
|
56
54
|
style: _objectSpread({
|
57
55
|
top: fixedTop !== null && fixedTop !== void 0 ? fixedTop : 0,
|
58
|
-
maxHeight:
|
56
|
+
maxHeight: `calc(100vh - ${fixedTop}px)`
|
59
57
|
}, style),
|
60
58
|
onMouseEnter: handleMouseEnter,
|
61
59
|
onMouseLeave: handleMouseLeave,
|
@@ -69,7 +67,7 @@ export var Step = function Step(_ref) {
|
|
69
67
|
}), onOff && /*#__PURE__*/_jsx("div", {
|
70
68
|
children: locale === null || locale === void 0 || (_locale$ProStep = locale.ProStep) === null || _locale$ProStep === void 0 ? void 0 : _locale$ProStep.catalogue
|
71
69
|
})]
|
72
|
-
}), options.map(
|
70
|
+
}), options.map(item => {
|
73
71
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
74
72
|
children: /*#__PURE__*/_jsx(Anchor, _objectSpread(_objectSpread({}, item), {}, {
|
75
73
|
scrollToError: scrollToError,
|