@zat-design/sisyphus-react 3.13.13-beta.6 → 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 +595 -341
- package/dist/less.esm.css +565 -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.d.ts +13 -0
- package/es/ProForm/components/combination/FormList/components/Empty.js +89 -0
- 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 +13 -5
- package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/style/index.less +61 -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 +27 -19
- 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 -18
- 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.d.ts +1 -0
- package/es/locale/en_US.js +4 -3
- package/es/locale/index.d.ts +2 -0
- package/es/locale/index.js +11 -2
- package/es/locale/zh_CN.d.ts +1 -0
- package/es/locale/zh_CN.js +4 -3
- 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.d.ts +13 -0
- package/lib/ProForm/components/combination/FormList/components/Empty.js +96 -0
- 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 +13 -5
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/style/index.less +61 -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 +27 -19
- 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 -21
- 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.d.ts +1 -0
- package/lib/locale/en_US.js +4 -3
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/index.js +12 -2
- package/lib/locale/zh_CN.d.ts +1 -0
- package/lib/locale/zh_CN.js +4 -3
- 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,10 +1,11 @@
|
|
1
|
-
@root-entry-name: 'default';
|
2
|
-
@import (reference) '~antd/es/style/themes/index.less';
|
1
|
+
/* @root-entry-name: 'default'; */
|
2
|
+
/* @import (reference) '~antd/es/style/themes/index.less'; */
|
3
3
|
|
4
4
|
.pro-number-range {
|
5
5
|
.range-split {
|
6
|
-
width: 32px
|
7
|
-
|
6
|
+
min-width: 32px;
|
7
|
+
max-width: 32px;
|
8
|
+
text-align: center;
|
8
9
|
|
9
10
|
pointer-events: none;
|
10
11
|
&.@{ant-prefix}-input[disabled] {
|
@@ -23,7 +24,6 @@
|
|
23
24
|
.range-split,
|
24
25
|
.range-addon-before,
|
25
26
|
.range-addon-after {
|
26
|
-
// color: @zaui-danger !important;
|
27
27
|
border-color: @zaui-danger;
|
28
28
|
}
|
29
29
|
}
|
@@ -32,56 +32,9 @@
|
|
32
32
|
margin-bottom: 0;
|
33
33
|
}
|
34
34
|
|
35
|
-
// .range-left,
|
36
|
-
// .range-right {
|
37
|
-
// text-align: center;
|
38
|
-
// }
|
39
|
-
|
40
|
-
// .range-left {
|
41
|
-
// .@{ant-prefix}-input-number {
|
42
|
-
// border-right: none;
|
43
|
-
// }
|
44
|
-
// }
|
45
|
-
|
46
|
-
// .range-right {
|
47
|
-
// .@{ant-prefix}-input-number {
|
48
|
-
// border-left: none;
|
49
|
-
// }
|
50
|
-
|
51
|
-
// .range-right {
|
52
|
-
// width: 100%;
|
53
|
-
// border-top-left-radius: 0;
|
54
|
-
// border-bottom-left-radius: 0;
|
55
|
-
// }
|
56
|
-
// }
|
57
|
-
|
58
35
|
.range-addon-before,
|
59
36
|
.range-addon-after {
|
60
37
|
color: var(--zaui-disabled-text);
|
61
38
|
pointer-events: none;
|
62
39
|
}
|
63
|
-
|
64
|
-
// &.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact > *:not(:last-child) {
|
65
|
-
// margin-right: 0;
|
66
|
-
// }
|
67
|
-
|
68
|
-
// > *:first-child {
|
69
|
-
// border-top-right-radius: 0 !important;
|
70
|
-
// border-bottom-right-radius: 0 !important;
|
71
|
-
|
72
|
-
// > .@{ant-prefix}-select-selector {
|
73
|
-
// border-top-right-radius: 0 !important;
|
74
|
-
// border-bottom-right-radius: 0 !important;
|
75
|
-
// }
|
76
|
-
// }
|
77
|
-
|
78
|
-
// > *:last-child {
|
79
|
-
// border-top-left-radius: 0 !important;
|
80
|
-
// border-bottom-left-radius: 0 !important;
|
81
|
-
|
82
|
-
// > .@{ant-prefix}-select-selector {
|
83
|
-
// border-top-left-radius: 0 !important;
|
84
|
-
// border-bottom-left-radius: 0 !important;
|
85
|
-
// }
|
86
|
-
// }
|
87
40
|
}
|
@@ -1,25 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
|
4
|
-
export type Props = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'separator' | 'mode'> & {
|
5
|
-
disabled?: boolean | [boolean, boolean];
|
6
|
-
foreverText?: string;
|
7
|
-
foreverDate?: string;
|
8
|
-
otherProps?: any;
|
9
|
-
onChange?: HandleChange;
|
10
|
-
value?: ValueStr;
|
11
|
-
format?: string;
|
12
|
-
separator?: any;
|
13
|
-
isView?: boolean;
|
14
|
-
showTime?: any;
|
15
|
-
valueType?: any;
|
16
|
-
/**
|
17
|
-
* 是否限制时间范围
|
18
|
-
*/
|
19
|
-
limit?: boolean;
|
20
|
-
};
|
21
|
-
type Value = [Moment?, Moment?, boolean?] | null;
|
22
|
-
type ValueStr = [string?, string?, string?] | null;
|
23
|
-
type HandleChange = (value: ValueStr | null, valueStr: Value | null) => void;
|
24
|
-
declare const ProRangeLimit: React.FC<Props>;
|
2
|
+
import type { ProRangeLimitType } from './propsType';
|
3
|
+
declare const ProRangeLimit: React.FC<ProRangeLimitType>;
|
25
4
|
export default ProRangeLimit;
|
@@ -5,15 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
|
-
require("antd/es/checkbox/style");
|
9
|
-
var _checkbox = _interopRequireDefault(require("antd/es/checkbox"));
|
10
|
-
require("antd/es/input/style");
|
11
|
-
var _input = _interopRequireDefault(require("antd/es/input"));
|
12
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
13
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
14
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15
|
-
require("antd/es/date-picker/style");
|
16
|
-
var _datePicker = _interopRequireDefault(require("antd/es/date-picker"));
|
17
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
18
12
|
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
|
19
13
|
var _uniq2 = _interopRequireDefault(require("lodash/uniq"));
|
@@ -21,14 +15,15 @@ var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
21
15
|
var _omit2 = _interopRequireDefault(require("lodash/omit"));
|
22
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
23
17
|
var _react = require("react");
|
18
|
+
var _antd = require("antd");
|
24
19
|
var _classnames = _interopRequireDefault(require("classnames"));
|
25
|
-
var
|
20
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
26
21
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
27
22
|
var _Container = _interopRequireDefault(require("../../Container"));
|
28
23
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
29
24
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
30
25
|
var _excluded = ["disabled", "foreverText", "foreverDate", "format", "otherProps", "separator", "limit"];
|
31
|
-
var defaultPickerValue = [(0,
|
26
|
+
var defaultPickerValue = [(0, _dayjs.default)(), (0, _dayjs.default)()];
|
32
27
|
var useControlled = function useControlled(props) {
|
33
28
|
var _useState = (0, _react.useState)(),
|
34
29
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
@@ -36,7 +31,7 @@ var useControlled = function useControlled(props) {
|
|
36
31
|
setValue = _useState2[1];
|
37
32
|
if ('value' in props) {
|
38
33
|
var _props$value, _props$value2;
|
39
|
-
var internalValue = [((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value[0]) && (0,
|
34
|
+
var internalValue = [((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value[0]) && (0, _dayjs.default)(props.value[0], props.format), ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2[1]) && (0, _dayjs.default)(props.value[1], props.format)];
|
40
35
|
var handleChange = function handleChange(value, other) {
|
41
36
|
if (!value) {
|
42
37
|
props === null || props === void 0 ? void 0 : props.onChange(value, other);
|
@@ -55,7 +50,7 @@ var useControlled = function useControlled(props) {
|
|
55
50
|
// @ts-ignore
|
56
51
|
return [value, setValue];
|
57
52
|
};
|
58
|
-
var RangePicker =
|
53
|
+
var RangePicker = _antd.DatePicker.RangePicker;
|
59
54
|
var ProRangeLimit = function ProRangeLimit(props) {
|
60
55
|
var disabled = props.disabled,
|
61
56
|
_props$foreverText = props.foreverText,
|
@@ -103,7 +98,6 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
103
98
|
_rest.showTime = false;
|
104
99
|
}
|
105
100
|
}
|
106
|
-
var _viewFormat = Array.isArray(format) ? format[0] : format;
|
107
101
|
var tempFormat = Array.isArray(format) ? format : [format];
|
108
102
|
if ((0, _isFunction2.default)(format)) {
|
109
103
|
tempFormat = [];
|
@@ -115,10 +109,31 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
115
109
|
format: 'HH:mm:ss'
|
116
110
|
};
|
117
111
|
var _isForever = (0, _react.useMemo)(function () {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
112
|
+
var foreverDayjs = function () {
|
113
|
+
// 使用健壮的日期解析方式
|
114
|
+
var result = (0, _dayjs.default)(_foreverDate);
|
115
|
+
if (!result.isValid()) {
|
116
|
+
result = (0, _dayjs.default)(_foreverDate, format);
|
117
|
+
}
|
118
|
+
if (!result.isValid()) {
|
119
|
+
// 如果还是无效,使用默认的长期日期
|
120
|
+
result = (0, _dayjs.default)('9999-01-01');
|
121
|
+
}
|
122
|
+
return result;
|
123
|
+
}();
|
124
|
+
return foreverDayjs.isSame(endDate);
|
125
|
+
}, [value, _foreverDate, format]);
|
126
|
+
var foreverDayjs = (0, _react.useMemo)(function () {
|
127
|
+
// 使用健壮的日期解析方式
|
128
|
+
var foreverDayjs = (0, _dayjs.default)(_foreverDate);
|
129
|
+
if (!foreverDayjs.isValid()) {
|
130
|
+
foreverDayjs = (0, _dayjs.default)(_foreverDate, format);
|
131
|
+
}
|
132
|
+
if (!foreverDayjs.isValid()) {
|
133
|
+
// 如果还是无效,使用默认的长期日期
|
134
|
+
foreverDayjs = (0, _dayjs.default)('9999-01-01');
|
135
|
+
}
|
136
|
+
return foreverDayjs;
|
122
137
|
}, [_foreverDate, format]);
|
123
138
|
if (isView) {
|
124
139
|
var _props$value3, _props$value4;
|
@@ -138,7 +153,7 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
138
153
|
// 时间范围change
|
139
154
|
var handleRangeChange = function handleRangeChange(date, dateStr) {
|
140
155
|
if (!date) {
|
141
|
-
onChange(
|
156
|
+
onChange(null, null);
|
142
157
|
return;
|
143
158
|
}
|
144
159
|
var _ref4 = date || [],
|
@@ -153,20 +168,22 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
153
168
|
};
|
154
169
|
// 长期选择框change
|
155
170
|
var handleForeverChange = function handleForeverChange(e) {
|
156
|
-
var foreverStr = e.target.checked ? 'Y' : 'N';
|
157
171
|
var _ref8 = value || [],
|
158
172
|
_ref9 = (0, _slicedToArray2.default)(_ref8, 1),
|
159
173
|
start = _ref9[0];
|
160
|
-
var
|
161
|
-
|
162
|
-
end =
|
174
|
+
var _ref0 = value || [],
|
175
|
+
_ref1 = (0, _slicedToArray2.default)(_ref0, 2),
|
176
|
+
end = _ref1[1];
|
163
177
|
if (e.target.checked) {
|
164
|
-
|
165
|
-
end
|
166
|
-
|
178
|
+
end = foreverDayjs;
|
179
|
+
// 确保 start 和 end 是有效的 dayjs 实例再调用 format
|
180
|
+
var startStr = start && _dayjs.default.isDayjs(start) ? start.format(format) : undefined;
|
181
|
+
var endStr = end && _dayjs.default.isDayjs(end) ? end.format(format) : undefined;
|
182
|
+
onChange([start, end], [startStr, endStr]);
|
167
183
|
} else {
|
168
|
-
//
|
169
|
-
|
184
|
+
// 不清除起期时间,只清除结束时间
|
185
|
+
var _startStr = start && _dayjs.default.isDayjs(start) ? start.format(format) : undefined;
|
186
|
+
onChange([start, null], [_startStr, undefined]);
|
170
187
|
}
|
171
188
|
};
|
172
189
|
if (_rest.showTime === true) {
|
@@ -175,8 +192,7 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
175
192
|
if ((0, _isObject2.default)(_rest.showTime)) {
|
176
193
|
_rest.showTime = Object.assign(_defaultShowTime, _rest.showTime);
|
177
194
|
}
|
178
|
-
return (0, _jsxRuntime.jsxs)(
|
179
|
-
compact: true,
|
195
|
+
return (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
|
180
196
|
className: "pro-range-limit",
|
181
197
|
children: [(0, _jsxRuntime.jsx)(RangePicker, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
182
198
|
allowClear: true,
|
@@ -188,7 +204,7 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
188
204
|
onChange: handleRangeChange
|
189
205
|
})), limit && (0, _jsxRuntime.jsx)("div", {
|
190
206
|
className: className,
|
191
|
-
children: (0, _jsxRuntime.jsx)(
|
207
|
+
children: (0, _jsxRuntime.jsx)(_antd.Checkbox, {
|
192
208
|
checked: _isForever,
|
193
209
|
disabled: _disabled === null || _disabled === void 0 ? void 0 : _disabled[1],
|
194
210
|
onChange: handleForeverChange,
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { RangePickerProps } from 'antd/es/date-picker';
|
2
|
+
import { Dayjs } from 'dayjs';
|
3
|
+
type Value = [Dayjs?, Dayjs?] | null;
|
4
|
+
type ValueStr = [string?, string?] | null;
|
5
|
+
type HandleChange = (valueStr: ValueStr | null, value: Value | null) => void;
|
6
|
+
export type ProRangeLimitType = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'separator' | 'mode'> & {
|
7
|
+
disabled?: boolean | [boolean, boolean];
|
8
|
+
foreverText?: string;
|
9
|
+
foreverDate?: string;
|
10
|
+
otherProps?: any;
|
11
|
+
onChange?: HandleChange;
|
12
|
+
value?: ValueStr;
|
13
|
+
format?: string;
|
14
|
+
separator?: any;
|
15
|
+
isView?: boolean;
|
16
|
+
showTime?: any;
|
17
|
+
valueType?: any;
|
18
|
+
/**
|
19
|
+
* 是否限制时间范围
|
20
|
+
*/
|
21
|
+
limit?: boolean;
|
22
|
+
};
|
23
|
+
export {};
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import
|
1
|
+
import dayjs from 'dayjs';
|
2
|
+
import type { Dayjs } from 'dayjs';
|
2
3
|
interface Props<T = any> {
|
3
4
|
value?: T;
|
4
5
|
onChange?: (value: T, ...rest: any[]) => void;
|
5
6
|
format?: string;
|
6
7
|
}
|
7
|
-
declare const useControlled: (props: Props) => [
|
8
|
+
declare const useControlled: (props: Props) => [dayjs.Dayjs, (value: Dayjs | undefined) => void];
|
8
9
|
export default useControlled;
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
|
-
var
|
9
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
10
10
|
var _react = require("react");
|
11
11
|
var useControlled = function useControlled(props) {
|
12
12
|
var value = props.value,
|
@@ -25,7 +25,19 @@ var useControlled = function useControlled(props) {
|
|
25
25
|
onChange(_value, value);
|
26
26
|
};
|
27
27
|
if ('value' in props) {
|
28
|
-
|
28
|
+
var parsedValue = null;
|
29
|
+
if (value) {
|
30
|
+
parsedValue = (0, _dayjs.default)(value, format);
|
31
|
+
if (!parsedValue.isValid()) {
|
32
|
+
parsedValue = (0, _dayjs.default)(value);
|
33
|
+
}
|
34
|
+
if (!parsedValue.isValid()) {
|
35
|
+
parsedValue = null;
|
36
|
+
} else {
|
37
|
+
parsedValue = parsedValue.startOf('day');
|
38
|
+
}
|
39
|
+
}
|
40
|
+
return [parsedValue, handleChange];
|
29
41
|
}
|
30
42
|
return [valueState, handleChange];
|
31
43
|
};
|
@@ -1,20 +1,19 @@
|
|
1
1
|
import { DatePickerProps, TimePickerProps } from 'antd';
|
2
|
-
import {
|
3
|
-
import { Moment } from 'moment';
|
2
|
+
import type { Dayjs } from 'dayjs';
|
4
3
|
import React from 'react';
|
5
4
|
import type { ProFormOtherType } from '../../../propsType';
|
6
|
-
import {
|
5
|
+
import type { ProRangeLimitType } from '../ProRangeLimit/propsType';
|
7
6
|
import type { DistributiveOmit } from '../../../../ProForm/propsType';
|
8
7
|
export type DateType = DatePickerProps['value'];
|
9
8
|
export type ProTimeLimitType = DistributiveOmit<DatePickerProps, 'value' | 'onChange' | 'mode'> & {
|
10
9
|
value?: string;
|
11
|
-
onChange?: (value: ProTimeLimitType['value'] | null, valueData:
|
10
|
+
onChange?: (value: ProTimeLimitType['value'] | null, valueData: Dayjs) => void;
|
12
11
|
disabled?: boolean;
|
13
12
|
foreverDate?: string;
|
14
13
|
foreverText?: string;
|
15
14
|
viewEmpty?: React.ReactNode;
|
16
15
|
format?: string;
|
17
|
-
valueType?: '
|
16
|
+
valueType?: 'dayjs' | 'format' | 'ISO' | 'dateTime' | 'dateStartEndTime';
|
18
17
|
otherProps?: ProFormOtherType;
|
19
18
|
mode?: 'DatePicker';
|
20
19
|
isView?: boolean;
|
@@ -23,7 +22,7 @@ export type ProTimeLimitType = DistributiveOmit<DatePickerProps, 'value' | 'onCh
|
|
23
22
|
*/
|
24
23
|
limit?: boolean;
|
25
24
|
} & TimePickerProps & {
|
26
|
-
showTime?:
|
25
|
+
showTime?: DatePickerProps['showTime'];
|
27
26
|
showNow?: boolean;
|
28
27
|
};
|
29
28
|
export declare const ProTimeLimit: React.FC<ProTimeLimitType>;
|
@@ -5,12 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.default = exports.ProTimeLimit = void 0;
|
8
|
-
require("antd/es/checkbox/style");
|
9
|
-
var _checkbox = _interopRequireDefault(require("antd/es/checkbox"));
|
10
|
-
require("antd/es/date-picker/style");
|
11
|
-
var _datePicker = _interopRequireDefault(require("antd/es/date-picker"));
|
12
|
-
require("antd/es/input/style");
|
13
|
-
var _input = _interopRequireDefault(require("antd/es/input"));
|
14
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
@@ -20,8 +14,9 @@ var _uniq2 = _interopRequireDefault(require("lodash/uniq"));
|
|
20
14
|
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
|
21
15
|
var _omit2 = _interopRequireDefault(require("lodash/omit"));
|
22
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
17
|
+
var _antd = require("antd");
|
23
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
24
|
-
var
|
19
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
25
20
|
var _react = require("react");
|
26
21
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
27
22
|
var _Container = _interopRequireDefault(require("../../Container"));
|
@@ -75,13 +70,21 @@ var ProTimeLimit = exports.ProTimeLimit = function ProTimeLimit(props) {
|
|
75
70
|
format: 'HH:mm:ss'
|
76
71
|
};
|
77
72
|
var _useMemo = (0, _react.useMemo)(function () {
|
78
|
-
|
79
|
-
var
|
80
|
-
|
73
|
+
// 使用健壮的日期解析方式
|
74
|
+
var foreverDayjs = (0, _dayjs.default)(_foreverDate);
|
75
|
+
if (!foreverDayjs.isValid()) {
|
76
|
+
foreverDayjs = (0, _dayjs.default)(_foreverDate, format);
|
77
|
+
}
|
78
|
+
if (!foreverDayjs.isValid()) {
|
79
|
+
// 如果还是无效,使用默认的长期日期
|
80
|
+
foreverDayjs = (0, _dayjs.default)('9999-01-01');
|
81
|
+
}
|
82
|
+
var foreverString = foreverDayjs.format(format);
|
83
|
+
return [foreverString, foreverDayjs];
|
81
84
|
}, [format, _foreverDate]),
|
82
85
|
_useMemo2 = (0, _slicedToArray2.default)(_useMemo, 2),
|
83
86
|
foreverString = _useMemo2[0],
|
84
|
-
|
87
|
+
foreverDayjs = _useMemo2[1];
|
85
88
|
// 管理value的受控状态
|
86
89
|
var _useControlled = (0, _useControlled3.default)((0, _objectSpread2.default)({
|
87
90
|
format: format
|
@@ -91,16 +94,21 @@ var ProTimeLimit = exports.ProTimeLimit = function ProTimeLimit(props) {
|
|
91
94
|
onChange = _useControlled2[1];
|
92
95
|
var isForever = (0, _react.useMemo)(function () {
|
93
96
|
if ((0, _isObject2.default)(value)) {
|
94
|
-
return
|
97
|
+
return foreverDayjs.format(format) === value.format(format);
|
95
98
|
}
|
96
99
|
return false;
|
97
|
-
}, [
|
100
|
+
}, [foreverDayjs, value]);
|
98
101
|
var foreverChange = function foreverChange(e) {
|
99
102
|
var checkedForever = e.target.checked;
|
100
103
|
if (checkedForever) {
|
101
|
-
|
104
|
+
// 直接使用计算好的 foreverDayjs,避免重新解析
|
105
|
+
onChange(foreverDayjs);
|
102
106
|
} else {
|
103
|
-
|
107
|
+
// 防止长期选择后,时间面板还是9999-01-01
|
108
|
+
onChange((0, _dayjs.default)());
|
109
|
+
setTimeout(function () {
|
110
|
+
onChange(null);
|
111
|
+
}, 0);
|
104
112
|
}
|
105
113
|
};
|
106
114
|
if (isView) {
|
@@ -132,10 +140,10 @@ var ProTimeLimit = exports.ProTimeLimit = function ProTimeLimit(props) {
|
|
132
140
|
'ant-input-disabled': disabled,
|
133
141
|
'forever-checkbox': true
|
134
142
|
});
|
135
|
-
return (0, _jsxRuntime.jsxs)(
|
136
|
-
compact: true,
|
143
|
+
return (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
|
137
144
|
className: "pro-time-limit",
|
138
|
-
children: [(0, _jsxRuntime.jsx)(
|
145
|
+
children: [(0, _jsxRuntime.jsx)(_antd.DatePicker, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
146
|
+
defaultPickerValue: (0, _dayjs.default)(),
|
139
147
|
disabled: disabled || isForever
|
140
148
|
}, initialConfig), (0, _omit2.default)(_rest, ['placeholder'])), {}, {
|
141
149
|
format: _format,
|
@@ -143,7 +151,7 @@ var ProTimeLimit = exports.ProTimeLimit = function ProTimeLimit(props) {
|
|
143
151
|
onChange: onChange
|
144
152
|
})), limit && (0, _jsxRuntime.jsx)("div", {
|
145
153
|
className: className,
|
146
|
-
children: (0, _jsxRuntime.jsx)(
|
154
|
+
children: (0, _jsxRuntime.jsx)(_antd.Checkbox, {
|
147
155
|
checked: isForever,
|
148
156
|
disabled: disabled,
|
149
157
|
onChange: foreverChange,
|
@@ -1,5 +1,5 @@
|
|
1
|
-
@root-entry-name: 'default';
|
2
|
-
@import (reference) '~antd/es/style/themes/index.less';
|
1
|
+
/* @root-entry-name: 'default'; */
|
2
|
+
/* @import (reference) '~antd/es/style/themes/index.less'; */
|
3
3
|
|
4
4
|
.@{ant-prefix}-form-item-has-error {
|
5
5
|
.@{ant-prefix}-picker-status-error
|
@@ -7,34 +7,94 @@
|
|
7
7
|
.@{ant-prefix}-input-borderless
|
8
8
|
).@{ant-prefix}-input {
|
9
9
|
// background: @zaui-base-bg;
|
10
|
-
border-color:
|
10
|
+
border-color: #ff4d4f;
|
11
11
|
}
|
12
12
|
.forever-checkbox:not(.@{ant-prefix}-input-disabled):not(
|
13
13
|
.@{ant-prefix}-input-borderless
|
14
14
|
).@{ant-prefix}-input:focus {
|
15
|
-
border-color: var(--ant-error-color-hover);
|
15
|
+
border-color: var(--ant-error-color-hover, #ff7875);
|
16
16
|
border-right-width: 1px;
|
17
17
|
outline: 0;
|
18
|
-
box-shadow: 0 0 0 2px var(--ant-error-color-outline);
|
18
|
+
box-shadow: 0 0 0 2px var(--ant-error-color-outline, rgba(255,77,79,0.2));
|
19
19
|
}
|
20
20
|
}
|
21
21
|
|
22
|
-
span.@{ant-prefix}-input-group-compact
|
22
|
+
span.@{ant-prefix}-input-group-compact,
|
23
|
+
.@{ant-prefix}-space-compact {
|
23
24
|
&.pro-time-limit,
|
24
25
|
&.pro-range-limit {
|
25
26
|
display: flex;
|
26
27
|
|
27
28
|
.@{ant-prefix}-picker {
|
28
29
|
flex: 1;
|
30
|
+
border-right: 0;
|
31
|
+
border-top-right-radius: 0 !important;
|
32
|
+
border-bottom-right-radius: 0 !important;
|
29
33
|
}
|
30
34
|
|
31
35
|
.@{ant-prefix}-picker-focused {
|
32
36
|
z-index: 1;
|
33
37
|
}
|
38
|
+
|
34
39
|
.forever-checkbox {
|
35
40
|
flex: 0;
|
36
41
|
min-width: unset;
|
37
42
|
white-space: nowrap;
|
43
|
+
border-left: 0;
|
44
|
+
border-top-left-radius: 0 !important;
|
45
|
+
border-bottom-left-radius: 0 !important;
|
46
|
+
|
47
|
+
&.@{ant-prefix}-input {
|
48
|
+
display: flex;
|
49
|
+
align-items: center;
|
50
|
+
min-height: 32px;
|
51
|
+
padding: 4px 11px;
|
52
|
+
background-color: #ffffff;
|
53
|
+
border: 1px solid #d9d9d9;
|
54
|
+
margin-left: 1px;
|
55
|
+
border-top-right-radius: 6px !important;
|
56
|
+
border-bottom-right-radius: 6px !important;
|
57
|
+
transition: all 0.2s;
|
58
|
+
|
59
|
+
&:hover {
|
60
|
+
border-color: #40a9ff;
|
61
|
+
}
|
62
|
+
|
63
|
+
&.@{ant-prefix}-input-disabled {
|
64
|
+
color: rgba(0, 0, 0, 0.25);
|
65
|
+
background-color: #f5f5f5;
|
66
|
+
border-color: #d9d9d9;
|
67
|
+
cursor: not-allowed;
|
68
|
+
}
|
69
|
+
|
70
|
+
.@{ant-prefix}-checkbox-wrapper {
|
71
|
+
display: flex;
|
72
|
+
align-items: center;
|
73
|
+
|
74
|
+
&.@{ant-prefix}-checkbox-wrapper-disabled {
|
75
|
+
color: rgba(0, 0, 0, 0.25);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// 确保焦点状态下的边框连接正确
|
82
|
+
.@{ant-prefix}-picker:focus {
|
83
|
+
z-index: 1;
|
84
|
+
border-right: 0;
|
85
|
+
}
|
86
|
+
|
87
|
+
.forever-checkbox.@{ant-prefix}-input:focus {
|
88
|
+
z-index: 1;
|
89
|
+
border-color: #40a9ff;
|
90
|
+
border-left: 0;
|
91
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
92
|
+
}
|
93
|
+
|
94
|
+
// 当日期选择器聚焦时,复选框也要有相应的样式
|
95
|
+
.@{ant-prefix}-picker-focused + .forever-checkbox.@{ant-prefix}-input {
|
96
|
+
border-color: #40a9ff;
|
97
|
+
border-left: 0;
|
38
98
|
}
|
39
99
|
}
|
40
100
|
}
|
@@ -12,8 +12,6 @@ export { default as TimePicker } from './base/TimePicker';
|
|
12
12
|
export { default as FormList } from './combination/FormList';
|
13
13
|
export { default as ProEditTable } from '../../ProEditTable';
|
14
14
|
export { default as ProCascader } from './combination/ProCascader';
|
15
|
-
export { default as ProAddressBar } from './combination/ProCascader';
|
16
|
-
export { default as ProCombination } from './combination/ProCombination';
|
17
15
|
export { default as ProNumberRange } from './combination/ProNumberRange';
|
18
16
|
export { default as ProModalSelect } from './combination/ProModalSelect';
|
19
17
|
export { default as ProTimeLimit } from './combination/ProTimeLimit';
|
@@ -27,9 +25,3 @@ export { default as ProUpload } from '../../ProUpload';
|
|
27
25
|
export { default as ProTreeModal } from '../../ProTreeModal';
|
28
26
|
export { default as ProTree } from '../../ProTree';
|
29
27
|
export { default as FormFooter } from './FormFooter';
|
30
|
-
export { default as ProAddress, transferAddressInfoToRegion } from './old/ProAddress';
|
31
|
-
export { default as EnumSelect } from './old/EnumSelect';
|
32
|
-
export { default as InputRange } from './old/InputRange';
|
33
|
-
export { default as ProRangeBox } from './old/ProRangeBox';
|
34
|
-
export { default as ProCertValidity } from './old/ProCertValidity';
|
35
|
-
export { default as ProCertNo } from './old/ProCertNo';
|