@zat-design/sisyphus-react 4.0.0-beta.4 → 4.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +1 -0
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -0
- package/dist/less.min.js +1 -0
- package/es/FormsProvider/index.js +5 -5
- package/es/ProAction/components/CheckModalContent/index.js +5 -7
- package/es/ProAction/index.js +16 -16
- package/es/ProConfigProvider/index.js +31 -17
- package/es/ProDownload/index.js +13 -12
- package/es/ProDownload/utils.js +15 -15
- package/es/ProDrawerForm/components/ProDrawer/index.js +22 -19
- package/es/ProDrawerForm/components/ProModal/index.js +14 -9
- package/es/ProDrawerForm/index.js +6 -10
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +10 -9
- package/es/ProEditLabel/index.js +36 -24
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +58 -56
- package/es/ProEditTable/components/RcTable/BaseTable.js +21 -20
- package/es/ProEditTable/components/RcTable/DraggableTable.js +27 -34
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +40 -46
- package/es/ProEditTable/components/RenderField/index.js +98 -121
- package/es/ProEditTable/components/RenderToolbar/index.js +27 -33
- package/es/ProEditTable/components/Summary/index.js +16 -14
- package/es/ProEditTable/components/Validator/index.js +9 -6
- package/es/ProEditTable/index.js +130 -147
- package/es/ProEditTable/utils/config.js +29 -36
- package/es/ProEditTable/utils/diffOriginal.js +13 -13
- package/es/ProEditTable/utils/getDefaultProps.js +6 -7
- package/es/ProEditTable/utils/index.js +52 -58
- package/es/ProEditTable/utils/tools.js +32 -41
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +10 -12
- package/es/ProEnum/components/Group.js +18 -22
- package/es/ProEnum/components/Tag.js +10 -14
- package/es/ProEnum/hooks/useEnum.js +6 -10
- package/es/ProEnum/hooks/useEnumRequest.js +23 -25
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +76 -0
- package/es/ProEnum/index.js +50 -52
- package/es/ProEnum/propsType.d.ts +29 -0
- package/es/ProEnum/utils/eventCenter.js +20 -31
- package/es/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/es/ProEnum/utils/frequentEnum.js +91 -0
- package/es/ProEnum/utils/getEnumLabel.js +8 -12
- package/es/ProEnum/utils/index.js +6 -6
- package/es/ProForm/components/Container.js +4 -3
- package/es/ProForm/components/FormFooter/index.js +16 -13
- package/es/ProForm/components/base/Checkbox/index.js +10 -11
- package/es/ProForm/components/base/DatePicker/index.js +8 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +2 -4
- package/es/ProForm/components/base/Input/index.js +24 -20
- package/es/ProForm/components/base/InputNumber/index.js +21 -18
- package/es/ProForm/components/base/Radio/index.js +11 -12
- package/es/ProForm/components/base/RangePicker/index.js +9 -12
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +9 -8
- package/es/ProForm/components/base/Switch/index.js +7 -6
- package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -6
- package/es/ProForm/components/base/TextArea/index.js +9 -8
- package/es/ProForm/components/base/TimePicker/index.js +5 -4
- package/es/ProForm/components/combination/Container/index.js +12 -12
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +60 -70
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +11 -7
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/Empty.js +9 -10
- package/es/ProForm/components/combination/FormList/components/LineFields.js +10 -9
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +32 -36
- package/es/ProForm/components/combination/FormList/index.js +25 -33
- package/es/ProForm/components/combination/FormList/utils.js +5 -7
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +14 -14
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +30 -35
- package/es/ProForm/components/combination/Group/index.js +35 -29
- package/es/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/Group/style/index.less +7 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/es/ProForm/components/combination/Group/utils.js +38 -39
- package/es/ProForm/components/combination/ProCascader/index.js +43 -52
- package/es/ProForm/components/combination/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +16 -16
- package/es/ProForm/components/combination/ProModalSelect/index.js +102 -108
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +73 -47
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +20 -18
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +17 -15
- package/es/ProForm/components/render/ChangedWrapper.js +24 -26
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -11
- package/es/ProForm/components/render/Render.js +107 -102
- package/es/ProForm/components/render/RenderFields.d.ts +0 -1
- package/es/ProForm/components/render/RenderFields.js +22 -24
- package/es/ProForm/index.js +44 -45
- package/es/ProForm/propsType.d.ts +1 -4
- package/es/ProForm/utils/diffOriginal.js +9 -9
- package/es/ProForm/utils/getDefaultProps.js +5 -5
- package/es/ProForm/utils/index.js +62 -90
- package/es/ProForm/utils/processDependencies.js +4 -5
- package/es/ProForm/utils/rulesCreator.js +12 -12
- package/es/ProForm/utils/transformNames.js +2 -2
- package/es/ProForm/utils/transformValue.js +6 -8
- package/es/ProForm/utils/useDeepCompareMemo.js +1 -1
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +19 -21
- package/es/ProForm/utils/useRules.js +17 -22
- package/es/ProForm/utils/useShouldUpdate.js +79 -83
- package/es/ProForm/utils/useWatch.js +12 -12
- package/es/ProForm/utils/valueType.js +46 -50
- package/es/ProIcon/index.js +30 -31
- package/es/ProIcon/utils/index.js +5 -5
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Icon/Icon.js +4 -4
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +19 -22
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +23 -30
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -3
- package/es/ProLayout/components/Layout/Menu/index.js +9 -9
- package/es/ProLayout/components/Layout/Notice/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.js +23 -18
- package/es/ProLayout/components/ProFooter/index.js +13 -14
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +6 -5
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -5
- package/es/ProLayout/components/ProHeader/index.js +68 -59
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/index.js +33 -32
- package/es/ProLayout/utils/index.js +17 -18
- package/es/ProSelect/components/AdaptiveTooltip.js +8 -9
- package/es/ProSelect/index.js +57 -64
- package/es/ProSelect/utils/index.js +17 -28
- package/es/ProStep/components/Anchor/index.js +10 -9
- package/es/ProStep/components/Item/index.js +11 -11
- package/es/ProStep/components/Listener/index.js +6 -10
- package/es/ProStep/components/Step/index.js +9 -11
- package/es/ProStep/index.js +24 -30
- package/es/ProStep/utils/index.js +8 -8
- package/es/ProStepTab/index.js +27 -28
- package/es/ProTable/components/FormatColumn/index.js +54 -59
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +6 -7
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +21 -37
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +16 -17
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +5 -6
- package/es/ProTable/components/RenderColumn/index.js +36 -35
- package/es/ProTable/components/RenderEmptyText/index.js +1 -1
- package/es/ProTable/components/RenderFooter/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +13 -12
- package/es/ProTable/components/RenderTableHeader/index.js +5 -4
- package/es/ProTable/components/RenderTabs/index.js +26 -29
- package/es/ProTable/components/TableResizable/index.js +8 -8
- package/es/ProTable/components/TooltipTitle/index.js +4 -3
- package/es/ProTable/hooks/useAntdTable.js +80 -95
- package/es/ProTable/index.js +110 -133
- package/es/ProTable/propsType.d.ts +9 -3
- package/es/ProTable/utils/index.js +13 -16
- package/es/ProTabs/components/Card/index.js +14 -8
- package/es/ProTabs/index.js +30 -20
- package/es/ProTabs/propType.d.ts +5 -0
- package/es/ProTabs/style/index.less +40 -3
- package/es/ProThemeTools/component/ProTools/index.js +46 -39
- package/es/ProThemeTools/context/ThemeContext.js +13 -13
- package/es/ProThemeTools/index.js +18 -19
- package/es/ProThemeTools/utils/index.js +14 -18
- package/es/ProTooltip/index.js +24 -27
- package/es/ProTree/components/AdaptiveTooltip.js +5 -6
- package/es/ProTree/components/List.js +10 -13
- package/es/ProTree/components/ProTree.js +47 -64
- package/es/ProTree/components/ProTreeSelect/index.js +77 -76
- package/es/ProTree/components/Tree.js +23 -22
- package/es/ProTree/index.js +1 -1
- package/es/ProTree/utils.js +14 -14
- package/es/ProTreeModal/components/Cascader.js +13 -16
- package/es/ProTreeModal/components/List.js +49 -70
- package/es/ProTreeModal/components/SortableItem.js +7 -8
- package/es/ProTreeModal/components/Tree.js +18 -23
- package/es/ProTreeModal/components/Trigger.js +15 -10
- package/es/ProTreeModal/index.js +98 -151
- package/es/ProTreeModal/utils.js +21 -21
- package/es/ProUpload/components/ButtonRender.js +11 -12
- package/es/ProUpload/components/DragRender.js +17 -20
- package/es/ProUpload/components/DraggableUploadListItem.js +2 -2
- package/es/ProUpload/components/Example.js +3 -3
- package/es/ProUpload/components/FileItem.js +30 -25
- package/es/ProUpload/components/ImageRender.js +29 -22
- package/es/ProUpload/index.js +55 -66
- package/es/ProUpload/uitls.js +2 -2
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +22 -19
- package/es/ProViewer/propsType.js +0 -3
- package/es/ProWaterMark/index.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/locale/index.js +2 -2
- package/es/style/index.less +1 -1
- package/es/style/theme/base.less +1 -0
- package/es/utils/index.js +11 -13
- package/lib/FormsProvider/index.js +30 -50
- package/lib/ProAction/components/CheckModalContent/index.js +31 -27
- package/lib/ProAction/index.js +194 -151
- package/lib/ProAction/propsType.js +4 -16
- package/lib/ProConfigProvider/index.js +136 -136
- package/lib/ProDownload/index.js +192 -124
- package/lib/ProDownload/propsType.js +4 -16
- package/lib/ProDownload/utils.js +189 -143
- package/lib/ProDrawerForm/components/ProDrawer/index.js +243 -169
- package/lib/ProDrawerForm/components/ProModal/index.js +194 -134
- package/lib/ProDrawerForm/components/index.js +17 -39
- package/lib/ProDrawerForm/index.js +79 -88
- package/lib/ProDrawerForm/propsType.js +4 -16
- package/lib/ProDrawerForm/utils/index.js +13 -30
- package/lib/ProEditLabel/components/RenderProForm.js +58 -57
- package/lib/ProEditLabel/index.js +251 -178
- package/lib/ProEditLabel/propsType.js +4 -16
- package/lib/ProEditLabel/utils/index.js +11 -26
- package/lib/ProEditTable/components/ActionButton/index.js +144 -155
- package/lib/ProEditTable/components/RcTable/BaseTable.js +97 -96
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +172 -151
- package/lib/ProEditTable/components/RcTable/index.js +17 -39
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +177 -176
- package/lib/ProEditTable/components/RenderField/index.js +628 -539
- package/lib/ProEditTable/components/RenderToolbar/index.js +119 -105
- package/lib/ProEditTable/components/Summary/index.js +70 -61
- package/lib/ProEditTable/components/Validator/index.js +30 -47
- package/lib/ProEditTable/components/index.js +38 -48
- package/lib/ProEditTable/index.js +379 -324
- package/lib/ProEditTable/propsType.js +4 -16
- package/lib/ProEditTable/utils/config.js +225 -170
- package/lib/ProEditTable/utils/diffOriginal.js +93 -80
- package/lib/ProEditTable/utils/getDefaultProps.js +26 -42
- package/lib/ProEditTable/utils/index.js +318 -244
- package/lib/ProEditTable/utils/tools.js +438 -243
- package/lib/ProEditTable/utils/transform.js +15 -28
- package/lib/ProEditTable/utils/useEditTableError.js +65 -54
- package/lib/ProEnum/components/Group.js +53 -81
- package/lib/ProEnum/components/Tag.js +37 -54
- package/lib/ProEnum/hooks/useEnum.js +72 -52
- package/lib/ProEnum/hooks/useEnumRequest.js +267 -194
- package/lib/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +83 -0
- package/lib/ProEnum/index.js +239 -234
- package/lib/ProEnum/propsType.d.ts +29 -0
- package/lib/ProEnum/propsType.js +4 -16
- package/lib/ProEnum/utils/eventCenter.js +15 -12
- package/lib/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/lib/ProEnum/utils/frequentEnum.js +99 -0
- package/lib/ProEnum/utils/getEnumLabel.js +57 -65
- package/lib/ProEnum/utils/index.js +98 -68
- package/lib/ProForm/components/Container.js +35 -45
- package/lib/ProForm/components/FormFooter/index.js +67 -80
- package/lib/ProForm/components/FormFooter/propsType.js +4 -16
- package/lib/ProForm/components/base/Checkbox/index.js +67 -62
- package/lib/ProForm/components/base/DatePicker/index.js +63 -74
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +13 -29
- package/lib/ProForm/components/base/Input/index.js +65 -73
- package/lib/ProForm/components/base/Input/propsType.js +4 -16
- package/lib/ProForm/components/base/InputNumber/index.js +230 -176
- package/lib/ProForm/components/base/Radio/index.js +60 -69
- package/lib/ProForm/components/base/RangePicker/index.js +73 -88
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +28 -45
- package/lib/ProForm/components/base/Select/index.js +63 -69
- package/lib/ProForm/components/base/Switch/index.js +43 -59
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +63 -62
- package/lib/ProForm/components/base/TextArea/index.js +52 -65
- package/lib/ProForm/components/base/TimePicker/index.js +45 -59
- package/lib/ProForm/components/combination/Container/index.js +58 -72
- package/lib/ProForm/components/combination/Container/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +240 -195
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +85 -107
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +25 -44
- package/lib/ProForm/components/combination/FormList/components/Empty.js +92 -55
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +92 -117
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +133 -101
- package/lib/ProForm/components/combination/FormList/index.js +131 -164
- package/lib/ProForm/components/combination/FormList/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/utils.js +32 -52
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +23 -38
- package/lib/ProForm/components/combination/Group/component/ComRender.js +78 -74
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +123 -123
- package/lib/ProForm/components/combination/Group/index.js +99 -104
- package/lib/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/propsType.js +4 -16
- package/lib/ProForm/components/combination/Group/style/index.less +7 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/utils.js +132 -104
- package/lib/ProForm/components/combination/ProCascader/index.js +271 -226
- package/lib/ProForm/components/combination/ProCascader/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +23 -33
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +113 -114
- package/lib/ProForm/components/combination/ProModalSelect/index.js +651 -472
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +21 -43
- package/lib/ProForm/components/combination/ProNumberRange/index.js +207 -160
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +169 -139
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +28 -49
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +150 -127
- package/lib/ProForm/components/index.js +192 -115
- package/lib/ProForm/components/render/ChangedWrapper.js +130 -141
- package/lib/ProForm/components/render/ConfirmWrapper.js +120 -78
- package/lib/ProForm/components/render/Render.js +445 -346
- package/lib/ProForm/components/render/RenderFields.d.ts +0 -1
- package/lib/ProForm/components/render/RenderFields.js +195 -181
- package/lib/ProForm/components/render/propsType.js +31 -17
- package/lib/ProForm/index.js +282 -235
- package/lib/ProForm/propsType.d.ts +1 -4
- package/lib/ProForm/propsType.js +9 -38
- package/lib/ProForm/utils/diffOriginal.js +88 -81
- package/lib/ProForm/utils/getDefaultProps.js +26 -42
- package/lib/ProForm/utils/index.js +330 -254
- package/lib/ProForm/utils/processDependencies.js +61 -44
- package/lib/ProForm/utils/rulesCreator.js +58 -81
- package/lib/ProForm/utils/transformNames.js +26 -37
- package/lib/ProForm/utils/transformValue.js +47 -47
- package/lib/ProForm/utils/useDeepCompareMemo.js +15 -34
- package/lib/ProForm/utils/useFieldProps.js +10 -42
- package/lib/ProForm/utils/useForm.js +226 -118
- package/lib/ProForm/utils/useRules.js +50 -60
- package/lib/ProForm/utils/useShouldUpdate.js +233 -126
- package/lib/ProForm/utils/useWatch.js +122 -93
- package/lib/ProForm/utils/valueType.js +222 -155
- package/lib/ProIcon/config/index.js +278 -365
- package/lib/ProIcon/index.js +217 -184
- package/lib/ProIcon/propsTypes.js +4 -16
- package/lib/ProIcon/symbolIcon.js +30 -23
- package/lib/ProIcon/utils/index.js +53 -60
- package/lib/ProLayout/components/Layout/Header/index.js +42 -59
- package/lib/ProLayout/components/Layout/Icon/Icon.js +31 -49
- package/lib/ProLayout/components/Layout/Icon/index.js +7 -34
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +170 -139
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +135 -117
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +4 -16
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +44 -60
- package/lib/ProLayout/components/Layout/Menu/index.js +52 -71
- package/lib/ProLayout/components/Layout/Notice/index.js +31 -39
- package/lib/ProLayout/components/Layout/index.js +31 -45
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProCollapse/index.js +159 -148
- package/lib/ProLayout/components/ProFooter/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProFooter/index.js +41 -56
- package/lib/ProLayout/components/ProHeader/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +26 -53
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +27 -48
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/index.js +17 -39
- package/lib/ProLayout/components/ProHeader/index.js +466 -268
- package/lib/ProLayout/components/ProHeader/utils/index.js +14 -31
- package/lib/ProLayout/components/index.js +24 -42
- package/lib/ProLayout/index.js +139 -130
- package/lib/ProLayout/propTypes.js +4 -16
- package/lib/ProLayout/utils/index.js +120 -86
- package/lib/ProSelect/components/AdaptiveTooltip.js +38 -45
- package/lib/ProSelect/index.js +240 -213
- package/lib/ProSelect/propsType.js +4 -16
- package/lib/ProSelect/utils/index.js +114 -93
- package/lib/ProStep/components/Anchor/index.js +102 -107
- package/lib/ProStep/components/Item/index.js +71 -75
- package/lib/ProStep/components/Listener/index.js +69 -62
- package/lib/ProStep/components/Step/index.js +65 -75
- package/lib/ProStep/index.js +227 -165
- package/lib/ProStep/propsType.js +4 -16
- package/lib/ProStep/utils/index.js +54 -57
- package/lib/ProStepTab/index.js +307 -166
- package/lib/ProStepTab/propsType.js +4 -16
- package/lib/ProTable/components/FormatColumn/index.js +472 -425
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +39 -53
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +183 -135
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +85 -104
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +4 -16
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +58 -80
- package/lib/ProTable/components/RcTable/index.js +17 -39
- package/lib/ProTable/components/RenderColumn/index.js +203 -194
- package/lib/ProTable/components/RenderEmptyText/index.js +25 -27
- package/lib/ProTable/components/RenderFooter/index.js +17 -33
- package/lib/ProTable/components/RenderSummary/index.js +57 -46
- package/lib/ProTable/components/RenderTableHeader/index.js +62 -68
- package/lib/ProTable/components/RenderTabs/index.js +67 -80
- package/lib/ProTable/components/TableResizable/index.js +87 -87
- package/lib/ProTable/components/TooltipTitle/index.js +27 -40
- package/lib/ProTable/components/index.js +45 -51
- package/lib/ProTable/hooks/useAntdTable.js +351 -304
- package/lib/ProTable/index.js +354 -333
- package/lib/ProTable/propsType.d.ts +9 -3
- package/lib/ProTable/propsType.js +4 -16
- package/lib/ProTable/utils/index.js +89 -78
- package/lib/ProTabs/components/Card/index.js +57 -30
- package/lib/ProTabs/components/index.js +10 -36
- package/lib/ProTabs/index.js +94 -89
- package/lib/ProTabs/propType.d.ts +5 -0
- package/lib/ProTabs/propType.js +4 -16
- package/lib/ProTabs/style/index.less +40 -3
- package/lib/ProThemeTools/component/ProTools/index.js +246 -198
- package/lib/ProThemeTools/component/index.js +10 -36
- package/lib/ProThemeTools/context/ThemeContext.js +99 -89
- package/lib/ProThemeTools/index.js +207 -172
- package/lib/ProThemeTools/propsType.js +4 -16
- package/lib/ProThemeTools/utils/index.js +84 -80
- package/lib/ProTooltip/index.js +217 -214
- package/lib/ProTooltip/propsType.js +4 -16
- package/lib/ProTree/components/AdaptiveTooltip.js +22 -33
- package/lib/ProTree/components/CloseIcon.js +31 -36
- package/lib/ProTree/components/List.js +69 -68
- package/lib/ProTree/components/ProTree.js +346 -258
- package/lib/ProTree/components/ProTreeSelect/index.js +460 -336
- package/lib/ProTree/components/ProTreeSelect/propsType.js +4 -16
- package/lib/ProTree/components/SearchTitle.js +50 -47
- package/lib/ProTree/components/Tree.js +300 -227
- package/lib/ProTree/components/index.js +31 -45
- package/lib/ProTree/index.js +22 -45
- package/lib/ProTree/propsType.js +4 -16
- package/lib/ProTree/utils.js +140 -79
- package/lib/ProTreeModal/components/Cascader.js +90 -97
- package/lib/ProTreeModal/components/CloseIcon.js +31 -36
- package/lib/ProTreeModal/components/List.js +246 -192
- package/lib/ProTreeModal/components/SearchTitle.js +22 -30
- package/lib/ProTreeModal/components/SortableItem.js +59 -60
- package/lib/ProTreeModal/components/Tree.js +171 -157
- package/lib/ProTreeModal/components/Trigger.js +131 -108
- package/lib/ProTreeModal/components/index.js +45 -51
- package/lib/ProTreeModal/index.js +523 -448
- package/lib/ProTreeModal/propsType.js +4 -16
- package/lib/ProTreeModal/utils.js +160 -99
- package/lib/ProUpload/components/ButtonRender.js +106 -85
- package/lib/ProUpload/components/DragRender.js +167 -117
- package/lib/ProUpload/components/DraggableUploadListItem.js +32 -48
- package/lib/ProUpload/components/Example.js +39 -55
- package/lib/ProUpload/components/FileItem.js +215 -113
- package/lib/ProUpload/components/ImageRender.js +250 -175
- package/lib/ProUpload/index.js +185 -181
- package/lib/ProUpload/propsType.js +4 -16
- package/lib/ProUpload/uitls.js +9 -31
- package/lib/ProUtils/utils/index.js +20 -36
- package/lib/ProViewer/index.js +210 -175
- package/lib/ProViewer/propsType.js +1 -17
- package/lib/ProWaterMark/index.js +20 -38
- package/lib/ProWaterMark/propsType.js +4 -16
- package/lib/index.d.ts +1 -1
- package/lib/index.js +272 -123
- package/lib/locale/en_US.js +127 -145
- package/lib/locale/index.js +40 -55
- package/lib/locale/zh_CN.js +128 -146
- package/lib/style/index.less +1 -1
- package/lib/style/theme/base.less +1 -0
- package/lib/tokens.js +87 -103
- package/lib/utils/index.js +66 -88
- package/package.json +7 -7
- package/dist/esm/index.d.ts +0 -5
- package/dist/esm/index.js +0 -5
- package/dist/esm/regExp/index.d.ts +0 -19
- package/dist/esm/regExp/index.js +0 -73
- package/dist/esm/tools/calc/index.d.ts +0 -4
- package/dist/esm/tools/calc/index.js +0 -67
- package/dist/esm/tools/dateUtils.d.ts +0 -7
- package/dist/esm/tools/dateUtils.js +0 -23
- package/dist/esm/tools/disableDate/index.d.ts +0 -9
- package/dist/esm/tools/disableDate/index.js +0 -43
- package/dist/esm/tools/disableTimeRange/index.d.ts +0 -9
- package/dist/esm/tools/disableTimeRange/index.js +0 -121
- package/dist/esm/tools/formatAmount/index.d.ts +0 -7
- package/dist/esm/tools/formatAmount/index.js +0 -14
- package/dist/esm/tools/formatPerMill/index.d.ts +0 -7
- package/dist/esm/tools/formatPerMill/index.js +0 -11
- package/dist/esm/tools/formatPercent/index.d.ts +0 -7
- package/dist/esm/tools/formatPercent/index.js +0 -11
- package/dist/esm/tools/getDataByIdCard/index.d.ts +0 -16
- package/dist/esm/tools/getDataByIdCard/index.js +0 -65
- package/dist/esm/tools/index.d.ts +0 -12
- package/dist/esm/tools/index.js +0 -14
- package/dist/esm/tools/sumAmount/index.d.ts +0 -16
- package/dist/esm/tools/sumAmount/index.js +0 -40
- package/dist/esm/tools/toChineseNum/index.d.ts +0 -7
- package/dist/esm/tools/toChineseNum/index.js +0 -103
- package/dist/esm/tools/toFixed/index.d.ts +0 -2
- package/dist/esm/tools/toFixed/index.js +0 -5
- package/dist/esm/tools/transformDataName/index.d.ts +0 -12
- package/dist/esm/tools/transformDataName/index.js +0 -37
- package/dist/esm/transforms/dateTransformer/index.d.ts +0 -24
- package/dist/esm/transforms/dateTransformer/index.js +0 -67
- package/dist/esm/transforms/index.d.ts +0 -6
- package/dist/esm/transforms/index.js +0 -6
- package/dist/esm/transforms/propTypes.d.ts +0 -7
- package/dist/esm/transforms/propTypes.js +0 -1
- package/dist/esm/transforms/transformDate/index.d.ts +0 -21
- package/dist/esm/transforms/transformDate/index.js +0 -141
- package/dist/esm/transforms/transformDatePicker/index.d.ts +0 -12
- package/dist/esm/transforms/transformDatePicker/index.js +0 -24
- package/dist/esm/transforms/transformRangePicker/index.d.ts +0 -29
- package/dist/esm/transforms/transformRangePicker/index.js +0 -61
- package/dist/esm/transforms/transformSwitch/index.d.ts +0 -13
- package/dist/esm/transforms/transformSwitch/index.js +0 -35
- package/dist/esm/transforms/utils.d.ts +0 -2
- package/dist/esm/transforms/utils.js +0 -8
- package/dist/esm/validate/index.d.ts +0 -107
- package/dist/esm/validate/index.js +0 -284
- package/tests/__mocks__/fileMock.js +0 -1
- package/tests/__mocks__/zatUtils.js +0 -27
- package/tests/setup.ts +0 -484
- package/tests/test-utils.tsx +0 -81
@@ -1,317 +1,480 @@
|
|
1
|
-
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
-
};
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
-
for (let key of __getOwnPropNames(from))
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
-
}
|
17
|
-
return to;
|
18
|
-
};
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
-
mod
|
26
|
-
));
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
1
|
+
"use strict";
|
28
2
|
|
29
|
-
|
30
|
-
var
|
31
|
-
|
32
|
-
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
33
7
|
});
|
34
|
-
|
35
|
-
|
36
|
-
var
|
37
|
-
var
|
38
|
-
|
39
|
-
var
|
40
|
-
var
|
41
|
-
|
42
|
-
var
|
43
|
-
|
44
|
-
var
|
45
|
-
|
46
|
-
var
|
47
|
-
var
|
48
|
-
var
|
49
|
-
var
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
8
|
+
exports.default = void 0;
|
9
|
+
require("antd/es/breadcrumb/style");
|
10
|
+
var _breadcrumb = _interopRequireDefault(require("antd/es/breadcrumb"));
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
12
|
+
require("antd/es/modal/style");
|
13
|
+
var _modal = _interopRequireDefault(require("antd/es/modal"));
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15
|
+
require("antd/es/divider/style");
|
16
|
+
var _divider = _interopRequireDefault(require("antd/es/divider"));
|
17
|
+
require("antd/es/tooltip/style");
|
18
|
+
var _tooltip = _interopRequireDefault(require("antd/es/tooltip"));
|
19
|
+
require("antd/es/space/style");
|
20
|
+
var _space = _interopRequireDefault(require("antd/es/space"));
|
21
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
22
|
+
var _react = _interopRequireWildcard(require("react"));
|
23
|
+
var _utils = require("@zat-design/utils");
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
25
|
+
var _dayjs3 = _interopRequireDefault(require("dayjs"));
|
26
|
+
var _ahooks = require("ahooks");
|
27
|
+
var _lodash = require("lodash");
|
28
|
+
var _reactSvg = require("react-svg");
|
29
|
+
var _arrow = _interopRequireDefault(require("../../../assets/arrow.svg"));
|
30
|
+
var _components = require("./components");
|
31
|
+
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
32
|
+
var _locale = _interopRequireDefault(require("../../../locale"));
|
33
|
+
var _utils2 = require("./utils");
|
34
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
35
|
+
var _excluded = ["width"];
|
36
|
+
/* eslint-disable react/no-array-index-key */
|
37
|
+
var formatAmount = _utils.tools.formatAmount;
|
38
|
+
var ProHeader = props => {
|
39
|
+
var breadcrumbColumns = props.breadcrumbColumns,
|
40
|
+
actionRender = props.actionRender,
|
41
|
+
describeColumns = props.describeColumns,
|
42
|
+
subDescribeColumns = props.subDescribeColumns,
|
43
|
+
onBack = props.onBack,
|
44
|
+
className = props.className,
|
45
|
+
_props$bodyOverFlowHi = props.bodyOverFlowHidden,
|
46
|
+
bodyOverFlowHidden = _props$bodyOverFlowHi === void 0 ? false : _props$bodyOverFlowHi,
|
47
|
+
fixedTop = props.fixedTop,
|
48
|
+
_props$showBack = props.showBack,
|
49
|
+
showBack = _props$showBack === void 0 ? true : _props$showBack,
|
50
|
+
_props$showShadow = props.showShadow,
|
51
|
+
showShadow = _props$showShadow === void 0 ? false : _props$showShadow,
|
52
|
+
_props$zIndex = props.zIndex,
|
53
|
+
zIndex = _props$zIndex === void 0 ? 98 : _props$zIndex,
|
54
|
+
title = props.title,
|
55
|
+
_props$autoBack = props.autoBack,
|
56
|
+
autoBack = _props$autoBack === void 0 ? 2 : _props$autoBack,
|
57
|
+
_props$collapsed = props.collapsed,
|
58
|
+
collapsed = _props$collapsed === void 0 ? true : _props$collapsed,
|
59
|
+
style = props.style,
|
60
|
+
_props$isConfirmBack = props.isConfirmBack,
|
61
|
+
isConfirmBack = _props$isConfirmBack === void 0 ? false : _props$isConfirmBack,
|
62
|
+
_props$isConfirmBackM = props.isConfirmBackModalProps,
|
63
|
+
isConfirmBackModalProps = _props$isConfirmBackM === void 0 ? {} : _props$isConfirmBackM;
|
64
|
+
var _useState = (0, _react.useState)(showBack),
|
65
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
66
|
+
backState = _useState2[0],
|
67
|
+
setBackState = _useState2[1];
|
68
|
+
var _useToggle = (0, _ahooks.useToggle)(collapsed),
|
69
|
+
_useToggle2 = (0, _slicedToArray2.default)(_useToggle, 2),
|
70
|
+
fold = _useToggle2[0],
|
71
|
+
toggle = _useToggle2[1].toggle;
|
72
|
+
var ref = (0, _react.useRef)(null);
|
73
|
+
var size = (0, _ahooks.useSize)(ref);
|
74
|
+
var _title = title;
|
75
|
+
|
76
|
+
// 面包屑配置数据源
|
77
|
+
var _breadcrumbColumns = breadcrumbColumns || [];
|
78
|
+
|
79
|
+
// 次级配置数据源
|
80
|
+
var _subDescribeColumns = subDescribeColumns || [];
|
81
|
+
(0, _react.useEffect)(() => {
|
77
82
|
if (bodyOverFlowHidden) {
|
78
|
-
|
79
|
-
bodyElement.style.overflow =
|
83
|
+
var bodyElement = document.querySelector('body');
|
84
|
+
bodyElement.style.overflow = 'hidden';
|
80
85
|
}
|
81
86
|
return () => {
|
82
|
-
|
83
|
-
bodyElement.style.overflow =
|
87
|
+
var bodyElement = document.querySelector('body');
|
88
|
+
bodyElement.style.overflow = '';
|
84
89
|
};
|
85
90
|
}, [bodyOverFlowHidden]);
|
86
|
-
(0,
|
87
|
-
|
91
|
+
(0, _react.useEffect)(() => {
|
92
|
+
var isNewPage = window.history.length;
|
93
|
+
// history的记录,默认2,代办新开页面
|
88
94
|
if (isNewPage <= autoBack) {
|
89
95
|
setBackState(false);
|
90
96
|
}
|
91
97
|
}, []);
|
92
|
-
|
98
|
+
|
99
|
+
/**
|
100
|
+
* 主级描述数据渲染
|
101
|
+
*/
|
102
|
+
var describeRender = describeData => {
|
93
103
|
if (!Array.isArray(describeData)) {
|
94
104
|
return null;
|
95
105
|
}
|
96
|
-
return
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
106
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
107
|
+
className: (0, _classnames.default)({
|
108
|
+
'pro-header-describe': true,
|
109
|
+
'pro-header-describe-open': fold,
|
110
|
+
'pro-header-describe-hidden': !fold
|
111
|
+
}),
|
112
|
+
children: describeData.map((item, index) => {
|
113
|
+
var value = item.value,
|
114
|
+
copyable = item.copyable,
|
115
|
+
_item$show = item.show,
|
116
|
+
show = _item$show === void 0 ? true : _item$show,
|
117
|
+
tag = item.tag,
|
118
|
+
label = item.label,
|
119
|
+
link = item.link,
|
120
|
+
_item$items = item.items,
|
121
|
+
items = _item$items === void 0 ? [] : _item$items,
|
122
|
+
width = item.width;
|
123
|
+
// show为false直接隐藏¸
|
107
124
|
if (show === false || !show) {
|
108
125
|
return null;
|
109
126
|
}
|
110
|
-
|
111
|
-
|
112
|
-
if (Array.isArray(parmas
|
113
|
-
return
|
114
|
-
|
115
|
-
|
127
|
+
var onlyTag = tag && !label && !value;
|
128
|
+
var tagRender = parmas => {
|
129
|
+
if (Array.isArray(parmas === null || parmas === void 0 ? void 0 : parmas.tag) && parmas !== null && parmas !== void 0 && parmas.tag.length) {
|
130
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_space.default, {
|
131
|
+
size: 4,
|
132
|
+
children: parmas.tag.map((tagItem, index) => {
|
133
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
134
|
+
className: "pro-header-tag",
|
135
|
+
children: tagItem
|
136
|
+
}, index);
|
137
|
+
})
|
138
|
+
});
|
116
139
|
}
|
117
|
-
return
|
140
|
+
return parmas !== null && parmas !== void 0 && parmas.tag ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
141
|
+
className: "pro-header-tag",
|
142
|
+
children: parmas === null || parmas === void 0 ? void 0 : parmas.tag
|
143
|
+
}) : null;
|
118
144
|
};
|
119
|
-
|
120
|
-
|
145
|
+
|
146
|
+
/** 单行渲染 */
|
147
|
+
var valueRender = parmas => {
|
148
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
149
|
+
size: 4,
|
150
|
+
align: parmas !== null && parmas !== void 0 && parmas.tag ? 'baseline' : 'center',
|
151
|
+
children: [parmas !== null && parmas !== void 0 && parmas.link ? /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
152
|
+
href: parmas.link,
|
153
|
+
rel: "noopener noreferrer",
|
154
|
+
target: "_blank",
|
155
|
+
children: parmas === null || parmas === void 0 ? void 0 : parmas.value
|
156
|
+
}) : parmas === null || parmas === void 0 ? void 0 : parmas.value, parmas !== null && parmas !== void 0 && parmas.copyable && (0, _lodash.isString)(parmas === null || parmas === void 0 ? void 0 : parmas.value) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Copy, {
|
157
|
+
text: parmas.value
|
158
|
+
}) : null, tagRender({
|
159
|
+
tag: parmas === null || parmas === void 0 ? void 0 : parmas.tag
|
160
|
+
})]
|
161
|
+
});
|
121
162
|
};
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
},
|
133
|
-
(items
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
163
|
+
|
164
|
+
/** 多行渲染 */
|
165
|
+
var itemsRender = () => {
|
166
|
+
// items配置是否超长,超长配置... + tip 提示
|
167
|
+
var itemsHidden = (0, _utils2.checkDescribeItemsHidden)(ref === null || ref === void 0 ? void 0 : ref.current);
|
168
|
+
var result = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
169
|
+
ref: ref,
|
170
|
+
className: (0, _classnames.default)({
|
171
|
+
'pro-header-describe-items': true,
|
172
|
+
'pro-header-describe-items-more': items.length >= 2
|
173
|
+
}),
|
174
|
+
children: [(items === null || items === void 0 ? void 0 : items.length) > 3 ? `共${items === null || items === void 0 ? void 0 : items.length}个,` : null, items.map((item, index) => {
|
175
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
176
|
+
children: [valueRender(item), (items === null || items === void 0 ? void 0 : items.length) !== index + 1 ? ' 、' : null]
|
177
|
+
}, index);
|
178
|
+
}), itemsHidden ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
179
|
+
className: "pro-header-describe-items-omit",
|
180
|
+
children: "..."
|
181
|
+
}) : null]
|
182
|
+
});
|
141
183
|
if (itemsHidden) {
|
142
|
-
|
143
|
-
(
|
144
|
-
return
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
title: tipResult
|
184
|
+
var tipResult = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
185
|
+
children: items.map((item, index) => {
|
186
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
187
|
+
className: "pro-header-describe-items-tip-value",
|
188
|
+
children: valueRender(item)
|
189
|
+
}, index);
|
190
|
+
})
|
191
|
+
});
|
192
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
|
193
|
+
placement: "bottomLeft",
|
194
|
+
classNames: {
|
195
|
+
root: 'pro-header-describe-items-tip'
|
155
196
|
},
|
156
|
-
|
157
|
-
|
197
|
+
title: tipResult,
|
198
|
+
children: result
|
199
|
+
});
|
158
200
|
}
|
159
201
|
return result;
|
160
202
|
};
|
161
|
-
|
162
|
-
|
163
|
-
|
203
|
+
var tagCls = (0, _classnames.default)({
|
204
|
+
'pro-header-only-tag': onlyTag,
|
205
|
+
'pro-header-describe-items-calc': (0, _lodash.isString)(width) ? width.includes('calc') : false
|
164
206
|
});
|
165
|
-
return
|
207
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
208
|
+
className: tagCls,
|
209
|
+
style: {
|
210
|
+
width
|
211
|
+
},
|
212
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
213
|
+
size: 4,
|
214
|
+
children: [label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
215
|
+
className: "pro-header-describe-label",
|
216
|
+
children: label
|
217
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
218
|
+
className: "pro-header-describe-value",
|
219
|
+
children: items !== null && items !== void 0 && items.length ? itemsRender() : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
220
|
+
children: valueRender({
|
221
|
+
value,
|
222
|
+
copyable,
|
223
|
+
tag,
|
224
|
+
link
|
225
|
+
})
|
226
|
+
})
|
227
|
+
})]
|
228
|
+
})
|
229
|
+
}, index);
|
166
230
|
})
|
167
|
-
);
|
231
|
+
});
|
168
232
|
};
|
169
|
-
|
170
|
-
|
171
|
-
|
233
|
+
|
234
|
+
/**
|
235
|
+
* 次级描述数据渲染
|
236
|
+
*/
|
237
|
+
var subDescribeRender = describeData => {
|
238
|
+
var _dayjs, _dayjs2;
|
239
|
+
var value = describeData.value,
|
240
|
+
type = describeData.type,
|
241
|
+
valueType = describeData.valueType,
|
242
|
+
label = describeData.label,
|
243
|
+
_describeData$show = describeData.show,
|
244
|
+
show = _describeData$show === void 0 ? true : _describeData$show,
|
245
|
+
_describeData$precisi = describeData.precision,
|
246
|
+
precision = _describeData$precisi === void 0 ? 2 : _describeData$precisi,
|
247
|
+
code = describeData.code;
|
248
|
+
// show为false直接隐藏
|
172
249
|
if (!show) {
|
173
|
-
return
|
250
|
+
return '';
|
174
251
|
}
|
175
|
-
|
252
|
+
var result;
|
176
253
|
switch (valueType || type) {
|
177
|
-
case
|
178
|
-
case
|
179
|
-
|
254
|
+
case 'thousandth':
|
255
|
+
case 'money':
|
256
|
+
// 千分位
|
257
|
+
result = value || (0, _lodash.isNumber)(value) ? formatAmount(value, precision) : '-';
|
180
258
|
break;
|
181
|
-
case
|
182
|
-
|
259
|
+
case 'enumName':
|
260
|
+
// 枚举-展示name
|
261
|
+
result = (0, _getEnumLabel.default)(code, value);
|
183
262
|
break;
|
184
|
-
case
|
185
|
-
|
263
|
+
case 'enumCodeName':
|
264
|
+
// 枚举-展示code-name
|
265
|
+
result = (0, _getEnumLabel.default)(code, value, true);
|
186
266
|
break;
|
187
|
-
case
|
188
|
-
|
267
|
+
case 'date':
|
268
|
+
// 年月日
|
269
|
+
result = value ? (_dayjs = (0, _dayjs3.default)(value)) === null || _dayjs === void 0 ? void 0 : _dayjs.format('YYYY-MM-DD') : '-';
|
189
270
|
break;
|
190
|
-
case
|
191
|
-
|
271
|
+
case 'dateTime':
|
272
|
+
// 年月日 时分秒
|
273
|
+
result = value ? (_dayjs2 = (0, _dayjs3.default)(value)) === null || _dayjs2 === void 0 ? void 0 : _dayjs2.format('YYYY-MM-DD HH:mm:ss') : '-';
|
192
274
|
break;
|
193
275
|
default:
|
194
|
-
result = String(value).includes(
|
276
|
+
result = String(value).includes('undefined') || !value ? '-' : value;
|
195
277
|
break;
|
196
278
|
}
|
197
|
-
return
|
279
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
280
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
281
|
+
children: label
|
282
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
283
|
+
className: "describe-value",
|
284
|
+
children: result
|
285
|
+
})]
|
286
|
+
});
|
198
287
|
};
|
199
|
-
|
288
|
+
|
289
|
+
/**
|
290
|
+
* 头部右侧按钮面板渲染
|
291
|
+
*/
|
292
|
+
var actionsRender = () => {
|
200
293
|
if (Array.isArray(actionRender) && actionRender.length) {
|
201
|
-
return
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
294
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_space.default, {
|
295
|
+
split: /*#__PURE__*/(0, _jsxRuntime.jsx)(_divider.default, {
|
296
|
+
type: "vertical"
|
297
|
+
}),
|
298
|
+
children: actionRender.map((item, index) => {
|
299
|
+
var _item$props;
|
300
|
+
if ((0, _lodash.isFunction)(item === null || item === void 0 ? void 0 : item.type)) {
|
301
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
302
|
+
children: item
|
303
|
+
}, index);
|
304
|
+
}
|
305
|
+
// 判断第一层dom节点为空
|
306
|
+
if (item !== null && item !== void 0 && item.type && !(item !== null && item !== void 0 && (_item$props = item.props) !== null && _item$props !== void 0 && _item$props.children)) {
|
307
|
+
return null;
|
308
|
+
}
|
309
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
310
|
+
children: item
|
311
|
+
}, index);
|
312
|
+
})
|
313
|
+
});
|
211
314
|
}
|
212
315
|
return actionRender;
|
213
316
|
};
|
214
|
-
|
317
|
+
|
318
|
+
/**
|
319
|
+
* 总结信息面板渲染
|
320
|
+
*/
|
321
|
+
var breadcrumbRender = () => {
|
215
322
|
if (Array.isArray(_breadcrumbColumns) && !_breadcrumbColumns.length) {
|
216
323
|
return [];
|
217
324
|
}
|
218
|
-
|
219
|
-
return item.type ===
|
325
|
+
var list = _breadcrumbColumns === null || _breadcrumbColumns === void 0 ? void 0 : _breadcrumbColumns.filter(item => {
|
326
|
+
return item.type === 'breadcrumb';
|
220
327
|
});
|
221
328
|
return list.map((item, index) => {
|
222
|
-
var
|
223
|
-
|
224
|
-
|
329
|
+
var _value$props;
|
330
|
+
var value = item.value,
|
331
|
+
_item$show2 = item.show,
|
332
|
+
show = _item$show2 === void 0 ? true : _item$show2,
|
333
|
+
tag = item.tag;
|
334
|
+
var tagRender = () => {
|
225
335
|
if (Array.isArray(tag) && tag.length) {
|
226
|
-
return
|
227
|
-
|
228
|
-
|
336
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_space.default, {
|
337
|
+
size: 8,
|
338
|
+
children: tag.map((tagItem, index) => {
|
339
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
340
|
+
className: "pro-header-tag",
|
341
|
+
children: tagItem
|
342
|
+
}, index);
|
343
|
+
})
|
344
|
+
});
|
229
345
|
}
|
230
|
-
return tag ?
|
346
|
+
return tag ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
347
|
+
className: "pro-header-tag",
|
348
|
+
children: tag
|
349
|
+
}) : null;
|
231
350
|
};
|
351
|
+
|
352
|
+
// show或者值不存在为false直接隐藏¸
|
232
353
|
if (!show || !value) {
|
233
354
|
return null;
|
234
355
|
}
|
235
|
-
|
356
|
+
// 判断第一层dom节点为空
|
357
|
+
if (value !== null && value !== void 0 && value.type && !(value !== null && value !== void 0 && (_value$props = value.props) !== null && _value$props !== void 0 && _value$props.children)) {
|
236
358
|
return null;
|
237
359
|
}
|
238
360
|
return {
|
239
361
|
key: index,
|
240
|
-
title:
|
362
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
363
|
+
size: 4,
|
364
|
+
children: [value, " ", tagRender()]
|
365
|
+
})
|
241
366
|
};
|
242
|
-
}).filter(Boolean);
|
367
|
+
}).filter(Boolean); // 过滤掉null值
|
243
368
|
};
|
244
|
-
|
369
|
+
|
370
|
+
/**
|
371
|
+
* 头部左侧导航栏后业务信息
|
372
|
+
*/
|
373
|
+
var infoRender = () => {
|
245
374
|
if (!Array.isArray(_breadcrumbColumns)) {
|
246
|
-
return
|
375
|
+
return '';
|
247
376
|
}
|
248
|
-
|
249
|
-
return item.type !==
|
377
|
+
var list = _breadcrumbColumns === null || _breadcrumbColumns === void 0 ? void 0 : _breadcrumbColumns.filter(item => {
|
378
|
+
return item.type !== 'breadcrumb';
|
250
379
|
});
|
251
380
|
if (!list.length) {
|
252
381
|
return null;
|
253
382
|
}
|
254
|
-
return
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
"breadcrumb-value": true,
|
269
|
-
omit: width
|
270
|
-
});
|
271
|
-
const valueRender = (type2) => {
|
272
|
-
let valRender = /* @__PURE__ */ import_react.default.createElement("div", { className: breadcrumbCls, style: { width } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, val, " ", tag ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pro-header-tag" }, tag) : null));
|
273
|
-
if (type2 === "copy") {
|
274
|
-
return valRender = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, width ? /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: val }, valRender) : valRender, /* @__PURE__ */ import_react.default.createElement(import_components.Copy, { text: val }));
|
383
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
384
|
+
className: "pro-header-info",
|
385
|
+
children: list.map((item, index) => {
|
386
|
+
var _value$props2;
|
387
|
+
var value = item.value,
|
388
|
+
_item$type = item.type,
|
389
|
+
type = _item$type === void 0 ? 'info' : _item$type,
|
390
|
+
_item$show3 = item.show,
|
391
|
+
show = _item$show3 === void 0 ? true : _item$show3,
|
392
|
+
width = item.width,
|
393
|
+
tag = item.tag;
|
394
|
+
// show或者值不存在为false直接隐藏¸
|
395
|
+
if (!show || !value) {
|
396
|
+
return '';
|
275
397
|
}
|
276
|
-
|
277
|
-
|
398
|
+
// 判断第一层dom节点为空
|
399
|
+
if (value !== null && value !== void 0 && value.type && !(value !== null && value !== void 0 && (_value$props2 = value.props) !== null && _value$props2 !== void 0 && _value$props2.children)) {
|
400
|
+
return '';
|
278
401
|
}
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
}
|
290
|
-
|
291
|
-
|
292
|
-
|
402
|
+
// value为null或者undefined返回'-'
|
403
|
+
var val = String(value).includes('undefined') || !value ? '-' : value;
|
404
|
+
if (type === 'version' && val) {
|
405
|
+
val = `${_locale.default.ProHeader.versionTitle}${val}`;
|
406
|
+
}
|
407
|
+
|
408
|
+
// 面包屑样式
|
409
|
+
var breadcrumbCls = (0, _classnames.default)({
|
410
|
+
'breadcrumb-value': true,
|
411
|
+
omit: width
|
412
|
+
});
|
413
|
+
var valueRender = type => {
|
414
|
+
var valRender = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
415
|
+
className: breadcrumbCls,
|
416
|
+
style: {
|
417
|
+
width
|
418
|
+
},
|
419
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
420
|
+
size: 4,
|
421
|
+
children: [val, " ", tag ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
422
|
+
className: "pro-header-tag",
|
423
|
+
children: tag
|
424
|
+
}) : null]
|
425
|
+
})
|
426
|
+
});
|
427
|
+
if (type === 'copy') {
|
428
|
+
return valRender = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
429
|
+
children: [width ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
|
430
|
+
title: val,
|
431
|
+
children: valRender
|
432
|
+
}) : valRender, /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Copy, {
|
433
|
+
text: val
|
434
|
+
})]
|
435
|
+
});
|
436
|
+
}
|
437
|
+
if (width) {
|
438
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
|
439
|
+
title: val,
|
440
|
+
children: valRender
|
441
|
+
});
|
442
|
+
}
|
443
|
+
return valRender;
|
444
|
+
};
|
445
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
446
|
+
className: (0, _classnames.default)({
|
447
|
+
version: ['version', 'tag'].includes(type),
|
448
|
+
hidden: ['version', 'tag'].includes(type) && !val
|
449
|
+
}),
|
450
|
+
children: type === 'copy' ? valueRender('copy') : valueRender()
|
451
|
+
}, index);
|
452
|
+
})
|
453
|
+
});
|
293
454
|
};
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
455
|
+
var cls = (0, _classnames.default)({
|
456
|
+
'pro-header': true,
|
457
|
+
'pro-header-fixed': fixedTop,
|
458
|
+
'pro-header-shadow': showShadow,
|
298
459
|
// 内部窗口滚动自带阴影场景
|
299
|
-
|
300
|
-
|
301
|
-
|
460
|
+
'pro-header-no-back': !backState,
|
461
|
+
'pro-header-has-describe': !(0, _lodash.isEmpty)(_subDescribeColumns) || !(0, _lodash.isEmpty)(describeColumns) || !(0, _lodash.isEmpty)(describeColumns),
|
462
|
+
'pro-header-no-describe': (0, _lodash.isEmpty)(_subDescribeColumns) && (0, _lodash.isEmpty)(describeColumns) || (0, _lodash.isEmpty)(describeColumns),
|
302
463
|
[`${className}`]: className
|
303
464
|
});
|
304
|
-
if (title && !(0,
|
305
|
-
console.error(
|
465
|
+
if (title && !(0, _lodash.isEmpty)(_breadcrumbColumns)) {
|
466
|
+
console.error('warning: The title and the breadcrumbList cannot be used together');
|
306
467
|
}
|
468
|
+
|
469
|
+
// title默认不显示返回按钮,只有showBack设置为true时才显示
|
307
470
|
if (title && props.showBack) {
|
308
471
|
_title = null;
|
309
472
|
_breadcrumbColumns.push({
|
310
|
-
type:
|
473
|
+
type: 'breadcrumb',
|
311
474
|
value: title
|
312
475
|
});
|
313
476
|
}
|
314
|
-
|
477
|
+
var onConfirm = () => {
|
315
478
|
if (!isConfirmBack) {
|
316
479
|
onBack && onBack();
|
317
480
|
if (!onBack) {
|
@@ -319,41 +482,76 @@ var ProHeader = (props) => {
|
|
319
482
|
}
|
320
483
|
return false;
|
321
484
|
}
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
485
|
+
// 处理 Modal.confirm 的 width 类型兼容性问题
|
486
|
+
var _ref = isConfirmBackModalProps || {},
|
487
|
+
width = _ref.width,
|
488
|
+
restModalProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
489
|
+
_modal.default.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
490
|
+
title: `${_locale.default.ProHeader.confirmTitle}`,
|
491
|
+
okText: `${_locale.default.ProHeader.confirm}`,
|
492
|
+
cancelText: `${_locale.default.ProHeader.cancel}`,
|
327
493
|
onOk: () => {
|
328
494
|
onBack && onBack();
|
329
|
-
}
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
});
|
495
|
+
}
|
496
|
+
}, width && (typeof width === 'string' || typeof width === 'number') ? {
|
497
|
+
width
|
498
|
+
} : {}), restModalProps));
|
334
499
|
};
|
335
|
-
return
|
336
|
-
|
337
|
-
{
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
500
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
501
|
+
className: cls,
|
502
|
+
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, style), {}, {
|
503
|
+
top: fixedTop,
|
504
|
+
zIndex
|
505
|
+
}),
|
506
|
+
children: _title ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
507
|
+
className: "pro-header-title",
|
508
|
+
children: _title
|
509
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
510
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
511
|
+
className: "pro-header-top",
|
512
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
513
|
+
className: (0, _classnames.default)({
|
514
|
+
'pro-header-left': true,
|
515
|
+
'pro-header-left-space': !backState
|
516
|
+
}),
|
517
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
518
|
+
size: backState ? 4 : 0,
|
519
|
+
children: [backState ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ProBackBtn, {
|
520
|
+
onBack: onConfirm
|
521
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_breadcrumb.default, {
|
522
|
+
separator: ">",
|
523
|
+
items: breadcrumbRender()
|
524
|
+
}), infoRender()]
|
525
|
+
})
|
526
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
527
|
+
className: "pro-header-right",
|
528
|
+
children: actionsRender()
|
529
|
+
})]
|
530
|
+
}), describeRender(describeColumns), !(0, _lodash.isEmpty)(_subDescribeColumns) ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
531
|
+
className: (0, _classnames.default)({
|
532
|
+
'pro-header-nav': true,
|
533
|
+
'pro-header-nav-open': fold,
|
534
|
+
'pro-header-nav-hidden': !fold
|
535
|
+
}),
|
536
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
537
|
+
children: _subDescribeColumns.map((item, index) => {
|
538
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
539
|
+
children: subDescribeRender(item)
|
540
|
+
}, index);
|
541
|
+
})
|
542
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
543
|
+
className: "pro-header-fold",
|
544
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
545
|
+
className: "pro-header-fold-bg",
|
546
|
+
onClick: toggle,
|
547
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
548
|
+
className: "fold-icon",
|
549
|
+
src: _arrow.default
|
550
|
+
}, "copy-icon")
|
551
|
+
})
|
552
|
+
})]
|
553
|
+
}) : null]
|
554
|
+
})
|
555
|
+
});
|
358
556
|
};
|
359
|
-
var
|
557
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ProHeader);
|