@zat-design/sisyphus-react 3.13.13 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +34 -1
- package/dist/index.esm.css +557 -341
- package/dist/less.esm.css +527 -309
- package/es/FormsProvider/index.d.ts +4 -1
- package/es/ProAction/components/CheckModalContent/index.js +0 -8
- package/es/ProAction/index.js +45 -48
- package/es/ProAction/index.less +2 -2
- package/es/ProConfigProvider/index.d.ts +21 -4
- package/es/ProConfigProvider/index.js +51 -22
- package/es/ProDownload/index.js +62 -65
- package/es/ProDownload/style/index.less +2 -2
- package/es/ProDownload/utils.js +45 -51
- package/es/ProDrawerForm/components/ProDrawer/index.js +64 -69
- package/es/ProDrawerForm/components/ProModal/index.js +59 -67
- package/es/ProDrawerForm/index.d.ts +2 -1
- package/es/ProDrawerForm/index.js +4 -6
- package/es/ProDrawerForm/propsType.d.ts +7 -18
- package/es/ProDrawerForm/style/index.less +8 -14
- package/es/ProEditLabel/components/RenderProForm.js +2 -3
- package/es/ProEditLabel/index.js +40 -45
- package/es/ProEditLabel/propsType.d.ts +1 -6
- package/es/ProEditLabel/style/index.less +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +5 -8
- package/es/ProEditTable/components/RcTable/BaseTable.js +73 -55
- package/es/ProEditTable/components/RcTable/DraggableTable.js +66 -47
- package/es/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/es/ProEditTable/components/RcTable/index.js +1 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +9 -12
- package/es/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/es/ProEditTable/components/RenderField/index.js +377 -253
- package/es/ProEditTable/components/RenderToolbar/index.js +19 -19
- package/es/ProEditTable/components/Summary/index.js +5 -8
- package/es/ProEditTable/components/Validator/index.js +3 -6
- package/es/ProEditTable/index.js +128 -131
- package/es/ProEditTable/propsType.d.ts +1 -7
- package/es/ProEditTable/style/index.less +3 -7
- package/es/ProEditTable/utils/config.js +31 -35
- package/es/ProEditTable/utils/index.js +44 -41
- package/es/ProEditTable/utils/tools.js +107 -110
- package/es/ProEditTable/utils/useEditTableError.js +12 -4
- package/es/ProEnum/hooks/useEnumRequest.js +44 -47
- package/es/ProEnum/index.js +10 -17
- package/es/ProEnum/style/index.less +2 -2
- package/es/ProEnum/utils/index.d.ts +1 -0
- package/es/ProEnum/utils/index.js +2 -1
- package/es/ProForm/components/Container.d.ts +1 -0
- package/es/ProForm/components/Container.js +2 -3
- package/es/ProForm/components/FormFooter/index.js +13 -13
- package/es/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/es/ProForm/components/base/Checkbox/index.js +3 -4
- package/es/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/es/ProForm/components/base/DatePicker/index.js +7 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.d.ts +1 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +1 -3
- package/es/ProForm/components/base/Input/index.js +6 -13
- package/es/ProForm/components/base/InputNumber/index.js +3 -6
- package/es/ProForm/components/base/Radio/index.js +3 -4
- package/es/ProForm/components/base/RangePicker/index.js +6 -7
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/es/ProForm/components/base/Select/index.js +2 -3
- package/es/ProForm/components/base/Switch/index.js +2 -3
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/es/ProForm/components/base/TextArea/index.js +3 -4
- package/es/ProForm/components/base/TextArea/index.less +12 -2
- package/es/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/es/ProForm/components/base/TimePicker/index.js +6 -7
- package/es/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/es/ProForm/components/combination/Container/style/index.less +2 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +28 -26
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +3 -6
- package/es/ProForm/components/combination/FormList/components/Empty.js +18 -19
- package/es/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +17 -21
- package/es/ProForm/components/combination/FormList/index.js +2 -3
- package/es/ProForm/components/combination/FormList/style/index.less +38 -2
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/es/ProForm/components/combination/Group/index.d.ts +2 -8
- package/es/ProForm/components/combination/Group/index.js +12 -6
- package/es/ProForm/components/combination/Group/style/index.less +7 -87
- package/es/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/es/ProForm/components/combination/Group/utils.js +4 -5
- package/es/ProForm/components/combination/ProCascader/index.js +21 -20
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/style/index.less +2 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -8
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +97 -116
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +13 -14
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/index.js +17 -16
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -52
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/es/ProForm/components/combination/ProRangeLimit/index.js +44 -28
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +14 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/es/ProForm/components/combination/ProTimeLimit/index.js +23 -20
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/es/ProForm/components/index.d.ts +0 -8
- package/es/ProForm/components/index.js +1 -10
- package/es/ProForm/components/render/ChangedWrapper.js +8 -9
- package/es/ProForm/components/render/ConfirmWrapper.js +28 -29
- package/es/ProForm/components/render/Render.js +37 -40
- package/es/ProForm/components/render/propsType.d.ts +2 -6
- package/es/ProForm/index.js +9 -39
- package/es/ProForm/style/index.less +6 -16
- package/es/ProForm/utils/index.d.ts +15 -1
- package/es/ProForm/utils/index.js +63 -14
- package/es/ProForm/utils/useDeepCompareMemo.js +4 -4
- package/es/ProForm/utils/useForm.js +84 -74
- package/es/ProForm/utils/useShouldUpdate.js +14 -14
- package/es/ProForm/utils/valueType.js +8 -8
- package/es/ProIcon/index.js +10 -13
- package/es/ProIcon/style/index.less +2 -2
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +11 -10
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -4
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/es/ProLayout/components/Layout/Menu/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/es/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/es/ProLayout/components/ProCollapse/index.js +20 -36
- package/es/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/es/ProLayout/components/ProFooter/index.js +3 -4
- package/es/ProLayout/components/ProFooter/style/index.less +2 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/es/ProLayout/components/ProHeader/index.js +43 -46
- package/es/ProLayout/components/ProHeader/style/index.less +2 -2
- package/es/ProLayout/index.js +7 -6
- package/es/ProLayout/style/index.less +4 -3
- package/es/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/es/ProSelect/index.js +7 -17
- package/es/ProSelect/index.less +2 -2
- package/es/ProSelect/propsType.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.js +2 -3
- package/es/ProStep/components/Item/index.js +2 -1
- package/es/ProStep/components/Listener/index.js +12 -14
- package/es/ProStep/components/Step/index.js +1 -0
- package/es/ProStep/index.js +39 -47
- package/es/ProStep/style/index.less +4 -4
- package/es/ProStepTab/index.js +72 -83
- package/es/ProTable/components/FormatColumn/index.js +32 -31
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +2 -4
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +39 -37
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +2 -4
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +15 -18
- package/es/ProTable/components/RenderSummary/index.js +4 -5
- package/es/ProTable/components/RenderTableHeader/index.js +3 -4
- package/es/ProTable/components/RenderTabs/index.js +3 -6
- package/es/ProTable/components/TableResizable/index.js +2 -1
- package/es/ProTable/components/TooltipTitle/index.js +2 -3
- package/es/ProTable/hooks/useAntdTable.js +21 -26
- package/es/ProTable/index.js +15 -16
- package/es/ProTable/propsType.d.ts +1 -3
- package/es/ProTable/style/index.less +5 -5
- package/es/ProTabs/components/Card/index.js +5 -10
- package/es/ProTabs/index.js +2 -3
- package/es/ProTabs/style/index.less +2 -2
- package/es/ProThemeTools/component/ProTools/index.js +18 -22
- package/es/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/es/ProThemeTools/context/ThemeContext.js +120 -0
- package/es/ProThemeTools/index.d.ts +4 -1
- package/es/ProThemeTools/index.js +60 -37
- package/es/ProThemeTools/style/index.less +3 -3
- package/es/ProThemeTools/utils/index.d.ts +16 -6
- package/es/ProThemeTools/utils/index.js +28 -24
- package/es/ProTooltip/index.js +14 -9
- package/es/ProTooltip/style/index.less +2 -2
- package/es/ProTree/components/AdaptiveTooltip.js +2 -3
- package/es/ProTree/components/List.js +3 -4
- package/es/ProTree/components/ProTree.js +19 -26
- package/es/ProTree/components/ProTreeSelect/index.js +38 -37
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/Tree.js +18 -25
- package/es/ProTree/index.js +0 -7
- package/es/ProTree/propsType.d.ts +1 -1
- package/es/ProTree/style/index.less +10 -6
- package/es/ProTreeModal/components/Cascader.js +3 -4
- package/es/ProTreeModal/components/List.js +11 -17
- package/es/ProTreeModal/components/SortableItem.js +2 -3
- package/es/ProTreeModal/components/Tree.js +3 -4
- package/es/ProTreeModal/components/Trigger.js +6 -11
- package/es/ProTreeModal/index.d.ts +0 -1
- package/es/ProTreeModal/index.js +14 -24
- package/es/ProTreeModal/style/index.less +14 -3
- package/es/ProUpload/components/ButtonRender.js +17 -20
- package/es/ProUpload/components/DragRender.js +2 -3
- package/es/ProUpload/components/FileItem.d.ts +0 -1
- package/es/ProUpload/components/FileItem.js +15 -21
- package/es/ProUpload/components/ImageRender.js +34 -43
- package/es/ProUpload/index.js +3 -4
- package/es/ProUpload/style/index.less +173 -12
- package/es/ProViewer/index.js +38 -45
- package/es/ProViewer/style/index.less +2 -2
- package/es/ProWaterMark/index.js +2 -3
- package/es/ProWaterMark/propsType.d.ts +5 -24
- package/es/global.less +2 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +2 -3
- package/es/locale/en_US.js +1 -1
- package/es/locale/index.d.ts +2 -0
- package/es/locale/index.js +11 -2
- package/es/locale/zh_CN.js +1 -1
- package/es/style/components.less +0 -3
- package/es/style/theme/antd.less +38 -48
- package/es/style/theme/base.less +89 -0
- package/es/style/theme/index.less +2 -89
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +23 -1
- package/lib/FormsProvider/index.d.ts +4 -1
- package/lib/ProAction/components/CheckModalContent/index.js +0 -9
- package/lib/ProAction/index.js +45 -48
- package/lib/ProAction/index.less +2 -2
- package/lib/ProConfigProvider/index.d.ts +21 -4
- package/lib/ProConfigProvider/index.js +60 -31
- package/lib/ProDownload/index.js +62 -65
- package/lib/ProDownload/style/index.less +2 -2
- package/lib/ProDownload/utils.js +45 -54
- package/lib/ProDrawerForm/components/ProDrawer/index.js +64 -69
- package/lib/ProDrawerForm/components/ProModal/index.js +59 -67
- package/lib/ProDrawerForm/index.d.ts +2 -1
- package/lib/ProDrawerForm/index.js +4 -6
- package/lib/ProDrawerForm/propsType.d.ts +7 -18
- package/lib/ProDrawerForm/style/index.less +8 -14
- package/lib/ProEditLabel/components/RenderProForm.js +2 -3
- package/lib/ProEditLabel/index.js +40 -45
- package/lib/ProEditLabel/propsType.d.ts +1 -6
- package/lib/ProEditLabel/style/index.less +4 -3
- package/lib/ProEditTable/components/ActionButton/index.js +5 -8
- package/lib/ProEditTable/components/RcTable/BaseTable.js +72 -54
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +65 -46
- package/lib/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/lib/ProEditTable/components/RcTable/index.js +1 -8
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +9 -12
- package/lib/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +378 -254
- package/lib/ProEditTable/components/RenderToolbar/index.js +19 -19
- package/lib/ProEditTable/components/Summary/index.js +5 -8
- package/lib/ProEditTable/components/Validator/index.js +3 -7
- package/lib/ProEditTable/index.js +126 -129
- package/lib/ProEditTable/propsType.d.ts +1 -7
- package/lib/ProEditTable/style/index.less +3 -7
- package/lib/ProEditTable/utils/config.js +31 -35
- package/lib/ProEditTable/utils/index.js +44 -41
- package/lib/ProEditTable/utils/tools.js +107 -113
- package/lib/ProEditTable/utils/useEditTableError.js +12 -4
- package/lib/ProEnum/hooks/useEnumRequest.js +43 -46
- package/lib/ProEnum/index.js +10 -17
- package/lib/ProEnum/style/index.less +2 -2
- package/lib/ProEnum/utils/index.d.ts +1 -0
- package/lib/ProEnum/utils/index.js +3 -1
- package/lib/ProForm/components/Container.d.ts +1 -0
- package/lib/ProForm/components/Container.js +2 -3
- package/lib/ProForm/components/FormFooter/index.js +13 -13
- package/lib/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/lib/ProForm/components/base/Checkbox/index.js +3 -4
- package/lib/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/lib/ProForm/components/base/DatePicker/index.js +7 -7
- package/lib/ProForm/components/base/DatePicker/useDateLimit.d.ts +1 -7
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +1 -3
- package/lib/ProForm/components/base/Input/index.js +6 -13
- package/lib/ProForm/components/base/InputNumber/index.js +3 -6
- package/lib/ProForm/components/base/Radio/index.js +3 -4
- package/lib/ProForm/components/base/RangePicker/index.js +6 -6
- package/lib/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/lib/ProForm/components/base/Select/index.js +2 -3
- package/lib/ProForm/components/base/Switch/index.js +2 -3
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/lib/ProForm/components/base/TextArea/index.js +3 -4
- package/lib/ProForm/components/base/TextArea/index.less +12 -2
- package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/lib/ProForm/components/base/TimePicker/index.js +6 -7
- package/lib/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/lib/ProForm/components/combination/Container/style/index.less +2 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +28 -26
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +3 -6
- package/lib/ProForm/components/combination/FormList/components/Empty.js +18 -19
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +17 -21
- package/lib/ProForm/components/combination/FormList/index.js +2 -3
- package/lib/ProForm/components/combination/FormList/style/index.less +38 -2
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/index.d.ts +2 -8
- package/lib/ProForm/components/combination/Group/index.js +13 -6
- package/lib/ProForm/components/combination/Group/style/index.less +7 -87
- package/lib/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +4 -5
- package/lib/ProForm/components/combination/ProCascader/index.js +23 -22
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/style/index.less +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -8
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +97 -116
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +13 -14
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +17 -16
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -52
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +44 -28
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +14 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +23 -20
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/lib/ProForm/components/index.d.ts +0 -8
- package/lib/ProForm/components/index.js +1 -63
- package/lib/ProForm/components/render/ChangedWrapper.js +8 -9
- package/lib/ProForm/components/render/ConfirmWrapper.js +28 -29
- package/lib/ProForm/components/render/Render.js +37 -39
- package/lib/ProForm/components/render/propsType.d.ts +2 -6
- package/lib/ProForm/index.js +8 -38
- package/lib/ProForm/style/index.less +6 -16
- package/lib/ProForm/utils/index.d.ts +15 -1
- package/lib/ProForm/utils/index.js +65 -17
- package/lib/ProForm/utils/useDeepCompareMemo.js +4 -4
- package/lib/ProForm/utils/useForm.js +83 -73
- package/lib/ProForm/utils/useShouldUpdate.js +14 -14
- package/lib/ProForm/utils/valueType.js +8 -8
- package/lib/ProIcon/index.js +10 -13
- package/lib/ProIcon/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/Header/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +11 -10
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -4
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/lib/ProLayout/components/Layout/Menu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/lib/ProLayout/components/ProCollapse/index.js +20 -36
- package/lib/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/lib/ProLayout/components/ProFooter/index.js +3 -4
- package/lib/ProLayout/components/ProFooter/style/index.less +2 -2
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/lib/ProLayout/components/ProHeader/index.js +43 -46
- package/lib/ProLayout/components/ProHeader/style/index.less +2 -2
- package/lib/ProLayout/index.js +7 -6
- package/lib/ProLayout/style/index.less +4 -3
- package/lib/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/lib/ProSelect/index.js +7 -17
- package/lib/ProSelect/index.less +2 -2
- package/lib/ProSelect/propsType.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.js +2 -3
- package/lib/ProStep/components/Item/index.js +2 -1
- package/lib/ProStep/components/Listener/index.js +12 -14
- package/lib/ProStep/components/Step/index.js +1 -0
- package/lib/ProStep/index.js +39 -47
- package/lib/ProStep/style/index.less +4 -4
- package/lib/ProStepTab/index.js +72 -83
- package/lib/ProTable/components/FormatColumn/index.js +32 -31
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +2 -4
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +38 -36
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +2 -4
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +15 -18
- package/lib/ProTable/components/RenderSummary/index.js +4 -5
- package/lib/ProTable/components/RenderTableHeader/index.js +3 -5
- package/lib/ProTable/components/RenderTabs/index.js +3 -6
- package/lib/ProTable/components/TableResizable/index.js +2 -1
- package/lib/ProTable/components/TooltipTitle/index.js +2 -3
- package/lib/ProTable/hooks/useAntdTable.js +21 -26
- package/lib/ProTable/index.js +15 -16
- package/lib/ProTable/propsType.d.ts +1 -3
- package/lib/ProTable/style/index.less +5 -5
- package/lib/ProTabs/components/Card/index.js +5 -11
- package/lib/ProTabs/index.js +2 -3
- package/lib/ProTabs/style/index.less +2 -2
- package/lib/ProThemeTools/component/ProTools/index.js +18 -22
- package/lib/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/lib/ProThemeTools/context/ThemeContext.js +126 -0
- package/lib/ProThemeTools/index.d.ts +4 -1
- package/lib/ProThemeTools/index.js +69 -35
- package/lib/ProThemeTools/style/index.less +3 -3
- package/lib/ProThemeTools/utils/index.d.ts +16 -6
- package/lib/ProThemeTools/utils/index.js +29 -25
- package/lib/ProTooltip/index.js +14 -9
- package/lib/ProTooltip/style/index.less +2 -2
- package/lib/ProTree/components/AdaptiveTooltip.js +2 -4
- package/lib/ProTree/components/List.js +3 -4
- package/lib/ProTree/components/ProTree.js +19 -26
- package/lib/ProTree/components/ProTreeSelect/index.js +38 -37
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/Tree.js +18 -25
- package/lib/ProTree/index.js +0 -8
- package/lib/ProTree/propsType.d.ts +1 -1
- package/lib/ProTree/style/index.less +10 -6
- package/lib/ProTreeModal/components/Cascader.js +3 -4
- package/lib/ProTreeModal/components/List.js +11 -17
- package/lib/ProTreeModal/components/SortableItem.js +2 -3
- package/lib/ProTreeModal/components/Tree.js +3 -4
- package/lib/ProTreeModal/components/Trigger.js +6 -11
- package/lib/ProTreeModal/index.d.ts +0 -1
- package/lib/ProTreeModal/index.js +14 -24
- package/lib/ProTreeModal/style/index.less +14 -3
- package/lib/ProUpload/components/ButtonRender.js +17 -20
- package/lib/ProUpload/components/DragRender.js +2 -3
- package/lib/ProUpload/components/FileItem.d.ts +0 -1
- package/lib/ProUpload/components/FileItem.js +15 -21
- package/lib/ProUpload/components/ImageRender.js +34 -43
- package/lib/ProUpload/index.js +3 -4
- package/lib/ProUpload/style/index.less +173 -12
- package/lib/ProViewer/index.js +39 -47
- package/lib/ProViewer/style/index.less +2 -2
- package/lib/ProWaterMark/index.js +3 -4
- package/lib/ProWaterMark/propsType.d.ts +5 -24
- package/lib/global.less +2 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +36 -16
- package/lib/locale/en_US.js +1 -1
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/index.js +12 -2
- package/lib/locale/zh_CN.js +1 -1
- package/lib/style/components.less +0 -3
- package/lib/style/theme/antd.less +38 -48
- package/lib/style/theme/base.less +89 -0
- package/lib/style/theme/index.less +2 -89
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +26 -2
- package/package.json +31 -18
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/es/ProEditTable/components/RcTable/VirtualTable.js +0 -8
- package/es/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/es/ProForm/components/combination/ProCombination/index.js +0 -204
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/es/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -108
- package/es/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/es/ProForm/components/old/EnumSelect/index.js +0 -272
- package/es/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/es/ProForm/components/old/EnumSelect/interface.js +0 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/es/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/es/ProForm/components/old/InputRange/index.js +0 -100
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/es/ProForm/components/old/InputWithSuffix/index.js +0 -46
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/es/ProForm/components/old/ProAddress/index.js +0 -298
- package/es/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/es/ProForm/components/old/ProAddress/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/es/ProForm/components/old/ProCertNo/index.js +0 -66
- package/es/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/es/ProForm/components/old/ProCertNo/propsType.js +0 -1
- package/es/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/es/ProForm/components/old/ProCertValidity/index.js +0 -188
- package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/ProForm/components/old/ProCertValidity/propsType.js +0 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/es/ProForm/components/old/ProRangeBox/index.js +0 -97
- package/es/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/es/ProForm/components/old/ProRangeBox/propsType.js +0 -1
- package/es/ProForm/utils/_useChanged.d.ts +0 -8
- package/es/ProForm/utils/_useChanged.js +0 -25
- package/es/ProForm/utils/_useListChanged.d.ts +0 -16
- package/es/ProForm/utils/_useListChanged.js +0 -93
- package/es/ProUpload/style/fileItem.less +0 -159
- package/es/old/ProCertValidity/index.d.ts +0 -9
- package/es/old/ProCertValidity/index.js +0 -188
- package/es/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/old/ProCertValidity/propsType.js +0 -1
- package/es/old/ProEditableTable/index.d.ts +0 -4
- package/es/old/ProEditableTable/index.js +0 -594
- package/es/old/ProEditableTable/propsType.d.ts +0 -68
- package/es/old/ProEditableTable/propsType.js +0 -1
- package/es/old/ProEditableTable/style/index.less +0 -75
- package/es/old/ProEditableTable/utils.d.ts +0 -29
- package/es/old/ProEditableTable/utils.js +0 -323
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +0 -14
- package/lib/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/lib/ProForm/components/combination/ProCombination/index.js +0 -213
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/lib/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -115
- package/lib/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/lib/ProForm/components/old/EnumSelect/index.js +0 -279
- package/lib/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/lib/ProForm/components/old/EnumSelect/interface.js +0 -5
- package/lib/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/lib/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/lib/ProForm/components/old/InputRange/index.js +0 -108
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/lib/ProForm/components/old/InputWithSuffix/index.js +0 -53
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/lib/ProForm/components/old/ProAddress/index.js +0 -306
- package/lib/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/lib/ProForm/components/old/ProAddress/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/lib/ProForm/components/old/ProCertNo/index.js +0 -73
- package/lib/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/lib/ProForm/components/old/ProCertNo/propsType.js +0 -5
- package/lib/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/lib/ProForm/components/old/ProCertValidity/index.js +0 -193
- package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/ProForm/components/old/ProCertValidity/propsType.js +0 -5
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/lib/ProForm/components/old/ProRangeBox/index.js +0 -105
- package/lib/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/lib/ProForm/components/old/ProRangeBox/propsType.js +0 -5
- package/lib/ProForm/utils/_useChanged.d.ts +0 -8
- package/lib/ProForm/utils/_useChanged.js +0 -32
- package/lib/ProForm/utils/_useListChanged.d.ts +0 -16
- package/lib/ProForm/utils/_useListChanged.js +0 -100
- package/lib/ProUpload/style/fileItem.less +0 -159
- package/lib/old/ProCertValidity/index.d.ts +0 -9
- package/lib/old/ProCertValidity/index.js +0 -193
- package/lib/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/old/ProCertValidity/propsType.js +0 -5
- package/lib/old/ProEditableTable/index.d.ts +0 -4
- package/lib/old/ProEditableTable/index.js +0 -601
- package/lib/old/ProEditableTable/propsType.d.ts +0 -68
- package/lib/old/ProEditableTable/propsType.js +0 -5
- package/lib/old/ProEditableTable/style/index.less +0 -75
- package/lib/old/ProEditableTable/utils.d.ts +0 -29
- package/lib/old/ProEditableTable/utils.js +0 -330
- /package/es/ProForm/components/combination/{ProCombination → ProRangeLimit}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProCombination → ProRangeLimit}/propsType.js +0 -0
@@ -1,204 +0,0 @@
|
|
1
|
-
import "antd/es/button/style";
|
2
|
-
import _Button from "antd/es/button";
|
3
|
-
import "antd/es/input/style";
|
4
|
-
import _Input from "antd/es/input";
|
5
|
-
import "antd/es/space/style";
|
6
|
-
import _Space from "antd/es/space";
|
7
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
8
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
9
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
10
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
-
// @ts-nocheck
|
12
|
-
import { useMemo, useState } from 'react';
|
13
|
-
import classNames from 'classnames';
|
14
|
-
import Container from '../../Container';
|
15
|
-
import * as componentMap from '../../index';
|
16
|
-
import { isNullValue, weedOutProps } from '../../../utils';
|
17
|
-
import { otherKeys } from '../../../propsType';
|
18
|
-
import ProForm from '../../../../ProForm';
|
19
|
-
import './style/index.less';
|
20
|
-
var useControlled = function useControlled(props) {
|
21
|
-
var value = props.value,
|
22
|
-
onChange = props.onChange;
|
23
|
-
var _useState = useState(value || []),
|
24
|
-
_useState2 = _slicedToArray(_useState, 2),
|
25
|
-
_values = _useState2[0],
|
26
|
-
setValues = _useState2[1];
|
27
|
-
var handleChange = function handleChange() {
|
28
|
-
for (var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++) {
|
29
|
-
rest[_key] = arguments[_key];
|
30
|
-
}
|
31
|
-
setValues(rest[0]);
|
32
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, rest);
|
33
|
-
};
|
34
|
-
if ('value' in props) {
|
35
|
-
return [value, function () {
|
36
|
-
for (var _len2 = arguments.length, rest = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
37
|
-
rest[_key2] = arguments[_key2];
|
38
|
-
}
|
39
|
-
return onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, rest);
|
40
|
-
}];
|
41
|
-
}
|
42
|
-
return [_values, handleChange];
|
43
|
-
};
|
44
|
-
export var ProCombination = function ProCombination(props) {
|
45
|
-
var _childProps$, _childProps$2;
|
46
|
-
var disabled = props.disabled,
|
47
|
-
_props$childProps = props.childProps,
|
48
|
-
childProps = _props$childProps === void 0 ? [{
|
49
|
-
renderType: 'Input'
|
50
|
-
}, {
|
51
|
-
renderType: 'Input'
|
52
|
-
}] : _props$childProps,
|
53
|
-
separator = props.separator,
|
54
|
-
id = props.id;
|
55
|
-
var _ref = ProForm.useFieldProps() || {},
|
56
|
-
_ref$isView = _ref.isView,
|
57
|
-
isView = _ref$isView === void 0 ? false : _ref$isView,
|
58
|
-
viewEmpty = _ref.viewEmpty,
|
59
|
-
form = _ref.form;
|
60
|
-
// 取到对应组件
|
61
|
-
var _ref2 = [componentMap[((_childProps$ = childProps[0]) === null || _childProps$ === void 0 ? void 0 : _childProps$.renderType) || 'Input'], componentMap[((_childProps$2 = childProps[1]) === null || _childProps$2 === void 0 ? void 0 : _childProps$2.renderType) || 'Input']],
|
62
|
-
BeforeCom = _ref2[0],
|
63
|
-
AfterCom = _ref2[1];
|
64
|
-
var _useControlled = useControlled(props),
|
65
|
-
_useControlled2 = _slicedToArray(_useControlled, 2),
|
66
|
-
values = _useControlled2[0],
|
67
|
-
_handleChange = _useControlled2[1];
|
68
|
-
var handleChange = function handleChange(value, rest, index) {
|
69
|
-
var _value, _value$target, _values2, _values3, _childProps$index, _childProps$index$onC;
|
70
|
-
if (((_value = value) === null || _value === void 0 ? void 0 : (_value$target = _value.target) === null || _value$target === void 0 ? void 0 : _value$target.value) !== undefined) {
|
71
|
-
value = value.target.value;
|
72
|
-
}
|
73
|
-
var _values;
|
74
|
-
if (index === 0) {
|
75
|
-
_values = [value, values === null || values === void 0 ? void 0 : values[1]];
|
76
|
-
}
|
77
|
-
if (index === 1) {
|
78
|
-
_values = [values === null || values === void 0 ? void 0 : values[0], value];
|
79
|
-
}
|
80
|
-
// 如果两个值都不存在 则values置为[] 防止必填校验无效
|
81
|
-
if (isNullValue((_values2 = _values) === null || _values2 === void 0 ? void 0 : _values2[0]) && isNullValue((_values3 = _values) === null || _values3 === void 0 ? void 0 : _values3[1])) {
|
82
|
-
_values = [];
|
83
|
-
}
|
84
|
-
_handleChange(_values, rest === null || rest === void 0 ? void 0 : rest[0], form);
|
85
|
-
(_childProps$index = childProps[index]) === null || _childProps$index === void 0 ? void 0 : (_childProps$index$onC = _childProps$index.onChange) === null || _childProps$index$onC === void 0 ? void 0 : _childProps$index$onC.call(_childProps$index, value, rest === null || rest === void 0 ? void 0 : rest[0], form); // 支持子组件分别传入onChange
|
86
|
-
};
|
87
|
-
var className = classNames({
|
88
|
-
'pro-combination': true,
|
89
|
-
'pro-combination-view': isView
|
90
|
-
});
|
91
|
-
var addedOtherKeys = useMemo(function () {
|
92
|
-
return [].concat(_toConsumableArray(otherKeys), ['renderType']);
|
93
|
-
}, [otherKeys]);
|
94
|
-
// 剔除其他参数
|
95
|
-
var _useMemo = useMemo(function () {
|
96
|
-
return weedOutProps(childProps[0] || {}, addedOtherKeys);
|
97
|
-
}, [childProps[0]]),
|
98
|
-
_useMemo2 = _slicedToArray(_useMemo, 2),
|
99
|
-
beforeProps = _useMemo2[0],
|
100
|
-
beforeOtherProps = _useMemo2[1];
|
101
|
-
var _useMemo3 = useMemo(function () {
|
102
|
-
return weedOutProps(childProps[1] || {}, addedOtherKeys);
|
103
|
-
}, [childProps[1]]),
|
104
|
-
_useMemo4 = _slicedToArray(_useMemo3, 2),
|
105
|
-
afterProps = _useMemo4[0],
|
106
|
-
afterOtherProps = _useMemo4[1];
|
107
|
-
// 查看模式
|
108
|
-
if (isView) {
|
109
|
-
if (!values || !Array.isArray(values)) {
|
110
|
-
return viewEmpty;
|
111
|
-
}
|
112
|
-
var childData = childProps;
|
113
|
-
if (!childData || Array.isArray(childData) && !childData.length) {
|
114
|
-
childData.push({
|
115
|
-
renderType: 'Input'
|
116
|
-
});
|
117
|
-
childData.push({
|
118
|
-
renderType: 'Input'
|
119
|
-
});
|
120
|
-
}
|
121
|
-
if (childData.length === 1) {
|
122
|
-
childData.push({
|
123
|
-
renderType: 'Input'
|
124
|
-
});
|
125
|
-
}
|
126
|
-
// 第一个值
|
127
|
-
var oneValue = '';
|
128
|
-
// 第二个值
|
129
|
-
var twoValue = '';
|
130
|
-
childData.forEach(function (item, index) {
|
131
|
-
if (index === 0 && (values === null || values === void 0 ? void 0 : values[0])) {
|
132
|
-
if (['ProEnum', 'ProSelect', 'Select'].includes(item.renderType)) {
|
133
|
-
oneValue = _jsx(BeforeCom, _objectSpread(_objectSpread({}, beforeProps), {}, {
|
134
|
-
value: values === null || values === void 0 ? void 0 : values[0],
|
135
|
-
otherProps: _objectSpread(_objectSpread({}, beforeOtherProps), {}, {
|
136
|
-
isView: isView
|
137
|
-
})
|
138
|
-
}));
|
139
|
-
} else {
|
140
|
-
oneValue = values === null || values === void 0 ? void 0 : values[0];
|
141
|
-
}
|
142
|
-
}
|
143
|
-
if (index === 1 && (values === null || values === void 0 ? void 0 : values[1])) {
|
144
|
-
if (['ProEnum', 'ProSelect', 'Select'].includes(item.renderType)) {
|
145
|
-
twoValue = _jsx(AfterCom, _objectSpread(_objectSpread({}, afterProps), {}, {
|
146
|
-
value: values === null || values === void 0 ? void 0 : values[1],
|
147
|
-
otherProps: _objectSpread(_objectSpread({}, afterOtherProps), {}, {
|
148
|
-
isView: isView
|
149
|
-
})
|
150
|
-
}));
|
151
|
-
} else {
|
152
|
-
twoValue = values === null || values === void 0 ? void 0 : values[1];
|
153
|
-
}
|
154
|
-
}
|
155
|
-
});
|
156
|
-
return _jsx(Container, {
|
157
|
-
viewEmpty: viewEmpty,
|
158
|
-
children: _jsx(_Space, {
|
159
|
-
size: 8,
|
160
|
-
children: !oneValue && !twoValue ? viewEmpty : _jsxs(_Fragment, {
|
161
|
-
children: [oneValue, separator, twoValue]
|
162
|
-
})
|
163
|
-
})
|
164
|
-
});
|
165
|
-
}
|
166
|
-
return _jsxs(_Input.Group, {
|
167
|
-
compact: true,
|
168
|
-
className: className,
|
169
|
-
id: id,
|
170
|
-
children: [_jsx(BeforeCom, _objectSpread(_objectSpread({
|
171
|
-
disabled: disabled
|
172
|
-
}, beforeProps), {}, {
|
173
|
-
value: values === null || values === void 0 ? void 0 : values[0],
|
174
|
-
onChange: function onChange(value) {
|
175
|
-
for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
176
|
-
rest[_key3 - 1] = arguments[_key3];
|
177
|
-
}
|
178
|
-
return handleChange(value, rest, 0);
|
179
|
-
},
|
180
|
-
otherProps: beforeOtherProps
|
181
|
-
})), isView ? separator : separator && _jsx(_Button, {
|
182
|
-
disabled: true,
|
183
|
-
children: separator
|
184
|
-
}), _jsx(AfterCom, _objectSpread(_objectSpread({
|
185
|
-
disabled: disabled
|
186
|
-
}, afterProps), {}, {
|
187
|
-
value: values === null || values === void 0 ? void 0 : values[1],
|
188
|
-
onChange: function onChange(value) {
|
189
|
-
for (var _len4 = arguments.length, rest = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
190
|
-
rest[_key4 - 1] = arguments[_key4];
|
191
|
-
}
|
192
|
-
return handleChange(value, rest, 1);
|
193
|
-
},
|
194
|
-
otherProps: afterOtherProps
|
195
|
-
}))]
|
196
|
-
});
|
197
|
-
};
|
198
|
-
ProCombination.defaultProps = {
|
199
|
-
disabled: false
|
200
|
-
};
|
201
|
-
export var childPropsItemProps = function childPropsItemProps(props) {
|
202
|
-
return null;
|
203
|
-
};
|
204
|
-
export default ProCombination;
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { FieldNames } from 'rc-select/lib/Select';
|
2
|
-
import { FormInstance } from 'antd';
|
3
|
-
import React from 'react';
|
4
|
-
import * as componentMap from '../../index';
|
5
|
-
import type { ProFormOtherType } from '../../../propsType';
|
6
|
-
export interface ChildPropsItemType {
|
7
|
-
/**
|
8
|
-
* @description 要显示什么组件,支持Input/Select
|
9
|
-
* @default Input
|
10
|
-
*/
|
11
|
-
renderType?: keyof typeof componentMap;
|
12
|
-
/**
|
13
|
-
* @description 如果type为Select时,dataSource为下拉数据的数组
|
14
|
-
* @default []
|
15
|
-
*/
|
16
|
-
dataSource?: Array<object>;
|
17
|
-
/**
|
18
|
-
* @description 如果type为Select时,fieldNames可以设置对应dataSource下拉属性名
|
19
|
-
* @default {label:'label',value:'value'}
|
20
|
-
*/
|
21
|
-
fieldNames?: FieldNames;
|
22
|
-
onChange?: (value: any, option: any, form: FormInstance) => void;
|
23
|
-
[name: string]: any;
|
24
|
-
}
|
25
|
-
export interface ProCombinationType {
|
26
|
-
/**
|
27
|
-
* @description 组件的值,[第一个组件的值,第二个组件的值,]
|
28
|
-
* @default []
|
29
|
-
*/
|
30
|
-
value: Array<any>;
|
31
|
-
/**
|
32
|
-
* @description onChange
|
33
|
-
* @default ()=>{}
|
34
|
-
*/
|
35
|
-
onChange: (values: Array<string>) => void;
|
36
|
-
/**
|
37
|
-
* @description 禁用状态
|
38
|
-
* @default false
|
39
|
-
*/
|
40
|
-
disabled?: boolean;
|
41
|
-
/**
|
42
|
-
* @description 子组件内部组件可配置属性,按照数组顺序注入到内部组件中
|
43
|
-
* @default [{},{}]
|
44
|
-
*/
|
45
|
-
childProps?: Array<ChildPropsItemType>;
|
46
|
-
/**
|
47
|
-
* @description 是否视图模式
|
48
|
-
* @default false
|
49
|
-
*/
|
50
|
-
isView?: boolean;
|
51
|
-
/**
|
52
|
-
* @description 查看空值时默认展示
|
53
|
-
* @default '-'
|
54
|
-
*/
|
55
|
-
viewEmpty?: React.ReactNode;
|
56
|
-
/**
|
57
|
-
* @description 分隔符 不传则不显示分割组件
|
58
|
-
* @default '-'
|
59
|
-
*/
|
60
|
-
separator?: string;
|
61
|
-
otherProps?: ProFormOtherType;
|
62
|
-
id?: string;
|
63
|
-
}
|
64
|
-
/**
|
65
|
-
* 兼容旧命名导出
|
66
|
-
*/
|
67
|
-
export type ChildPropsItemProps = ChildPropsItemType;
|
68
|
-
export type ProCombinationProps = ProCombinationType;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
@root-entry-name: 'default';
|
2
|
-
@import (reference) '~antd/es/style/themes/index.less';
|
3
|
-
|
4
|
-
.pro-combination.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact {
|
5
|
-
display: flex;
|
6
|
-
|
7
|
-
& > * {
|
8
|
-
max-width: 50%;
|
9
|
-
}
|
10
|
-
|
11
|
-
div.pro-form-view-container {
|
12
|
-
flex: none;
|
13
|
-
}
|
14
|
-
|
15
|
-
& > *:not(.@{ant-prefix}-btn) {
|
16
|
-
flex: 1;
|
17
|
-
}
|
18
|
-
}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import { useRequest } from 'ahooks';
|
2
|
-
declare interface PaginationProp {
|
3
|
-
pageNum: number;
|
4
|
-
pageSize: number;
|
5
|
-
}
|
6
|
-
declare interface IListReq<T = any> extends PaginationProp {
|
7
|
-
defaultParams?: T;
|
8
|
-
[key: string]: any;
|
9
|
-
}
|
10
|
-
declare interface IRes<T = any> {
|
11
|
-
data: T;
|
12
|
-
status: number;
|
13
|
-
message: string;
|
14
|
-
}
|
15
|
-
declare interface IListProp<T> {
|
16
|
-
pageNum: number;
|
17
|
-
pageSize: number;
|
18
|
-
total: number;
|
19
|
-
list: T[];
|
20
|
-
}
|
21
|
-
declare type IResList<T> = IRes<IListProp<T>>;
|
22
|
-
declare type IListService<Req, Res> = (params?: IListReq<Req>) => Promise<IResList<Res>>;
|
23
|
-
export interface RequestListOptions<T, R> {
|
24
|
-
defaultParams?: Partial<T>;
|
25
|
-
page?: PaginationProp;
|
26
|
-
customizePage?: PaginationProp;
|
27
|
-
withPagination?: boolean;
|
28
|
-
conditionKey: any;
|
29
|
-
onPageChange?: (page: PaginationProp) => any;
|
30
|
-
handleFormatDataSource?: (data: any) => R[];
|
31
|
-
}
|
32
|
-
export default function useRequestList<I, R extends Record<string, any>, S extends IListService<I, R>>(service: S, options?: RequestListOptions<I, R>, useRequestOptions?: Parameters<typeof useRequest>[1]): any;
|
33
|
-
export {};
|
@@ -1,108 +0,0 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
4
|
-
import _isEqual from "lodash/isEqual";
|
5
|
-
import { usePrevious, useRequest } from 'ahooks';
|
6
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
7
|
-
var defaultTransform = function defaultTransform(data) {
|
8
|
-
return data === null || data === void 0 ? void 0 : data.list;
|
9
|
-
};
|
10
|
-
var defaultPage = {
|
11
|
-
pageNum: 1,
|
12
|
-
pageSize: 10
|
13
|
-
};
|
14
|
-
var useDefaultOptions = function useDefaultOptions(options) {
|
15
|
-
var _options$withPaginati, _options$handleFormat;
|
16
|
-
var customizePage = options === null || options === void 0 ? void 0 : options.customizePage;
|
17
|
-
var _useState = useState(customizePage || defaultPage),
|
18
|
-
_useState2 = _slicedToArray(_useState, 2),
|
19
|
-
page = _useState2[0],
|
20
|
-
onPageChange = _useState2[1];
|
21
|
-
return _objectSpread(_objectSpread({}, options), {}, {
|
22
|
-
withPagination: (_options$withPaginati = options === null || options === void 0 ? void 0 : options.withPagination) !== null && _options$withPaginati !== void 0 ? _options$withPaginati : true,
|
23
|
-
page: (options === null || options === void 0 ? void 0 : options.page) || page,
|
24
|
-
onPageChange: (options === null || options === void 0 ? void 0 : options.onPageChange) || onPageChange,
|
25
|
-
handleFormatDataSource: (_options$handleFormat = options === null || options === void 0 ? void 0 : options.handleFormatDataSource) !== null && _options$handleFormat !== void 0 ? _options$handleFormat : defaultTransform
|
26
|
-
});
|
27
|
-
};
|
28
|
-
export default function useRequestList(service, options, useRequestOptions) {
|
29
|
-
var _data$data;
|
30
|
-
var _useDefaultOptions = useDefaultOptions(options),
|
31
|
-
page = _useDefaultOptions.page,
|
32
|
-
withPagination = _useDefaultOptions.withPagination,
|
33
|
-
onPageChange = _useDefaultOptions.onPageChange,
|
34
|
-
defaultParams = _useDefaultOptions.defaultParams,
|
35
|
-
conditionKey = _useDefaultOptions.conditionKey,
|
36
|
-
handleFormatDataSource = _useDefaultOptions.handleFormatDataSource;
|
37
|
-
// 搜索表单里的值
|
38
|
-
var _useState3 = useState(),
|
39
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
40
|
-
searchValues = _useState4[0],
|
41
|
-
setSearchValues = _useState4[1];
|
42
|
-
// 当次执行service的请求,包括page参数
|
43
|
-
var params = useMemo(function () {
|
44
|
-
var _condition = _objectSpread(_objectSpread({}, defaultParams), searchValues);
|
45
|
-
return withPagination ? _objectSpread(_objectSpread({}, page), {}, _defineProperty({}, conditionKey, _condition !== null && _condition !== void 0 ? _condition : {})) : _condition;
|
46
|
-
}, [defaultParams, page, searchValues]);
|
47
|
-
// 调接口
|
48
|
-
// @ts-ignore
|
49
|
-
var result = useRequest(service, _objectSpread(_objectSpread({}, useRequestOptions), {}, {
|
50
|
-
// @ts-ignore
|
51
|
-
defaultParams: [params]
|
52
|
-
}));
|
53
|
-
var data = result.data,
|
54
|
-
run = result.run,
|
55
|
-
loading = result.loading;
|
56
|
-
// 搜索条件变化时触发
|
57
|
-
var prevParams = usePrevious(params);
|
58
|
-
var prevSearchValues = usePrevious(searchValues);
|
59
|
-
useEffect(function () {
|
60
|
-
if (prevParams && !_isEqual(prevParams, params)) {
|
61
|
-
// @ts-ignore
|
62
|
-
run(params);
|
63
|
-
}
|
64
|
-
}, [params]);
|
65
|
-
// 分页变更
|
66
|
-
var onChange = useCallback(function (current, pageSize) {
|
67
|
-
onPageChange({
|
68
|
-
pageNum: current,
|
69
|
-
pageSize: pageSize
|
70
|
-
});
|
71
|
-
}, [onPageChange]);
|
72
|
-
var onSearch = useCallback(function (values) {
|
73
|
-
if (!_isEqual(prevSearchValues, values)) {
|
74
|
-
setSearchValues(function (p) {
|
75
|
-
return _objectSpread(_objectSpread(_objectSpread({}, p), values), {}, {
|
76
|
-
timestamp: Date.now()
|
77
|
-
});
|
78
|
-
});
|
79
|
-
onChange(defaultPage.pageNum, defaultPage.pageSize);
|
80
|
-
}
|
81
|
-
}, [onChange, prevSearchValues]);
|
82
|
-
// 重置查询条件
|
83
|
-
var onReset = useCallback(function () {
|
84
|
-
setSearchValues(undefined);
|
85
|
-
onChange(defaultPage.pageNum, defaultPage.pageSize);
|
86
|
-
}, [onChange]);
|
87
|
-
return _objectSpread(_objectSpread({}, result), {}, {
|
88
|
-
loading: loading,
|
89
|
-
data: handleFormatDataSource(data === null || data === void 0 ? void 0 : data.data),
|
90
|
-
onReset: onReset,
|
91
|
-
onSearch: onSearch,
|
92
|
-
params: params,
|
93
|
-
pagination: withPagination ? {
|
94
|
-
current: page.pageNum,
|
95
|
-
pageSize: page.pageSize,
|
96
|
-
onPaginationChange: true,
|
97
|
-
total: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.total,
|
98
|
-
onChange: onChange,
|
99
|
-
pageSizeOptions: [10, 20, 50, 100],
|
100
|
-
showQuickJumper: true,
|
101
|
-
showSizeChanger: true,
|
102
|
-
onShowSizeChange: onChange,
|
103
|
-
showTotal: function showTotal(total) {
|
104
|
-
return "\u5171".concat(total, "\u6761");
|
105
|
-
}
|
106
|
-
} : false
|
107
|
-
});
|
108
|
-
}
|