@zat-design/sisyphus-react 4.0.0-beta.9 → 4.0.0
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.backup +13 -0
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProAction/index.js +14 -4
- package/es/ProConfigProvider/index.js +11 -2
- package/es/ProDownload/index.js +16 -5
- package/es/ProDownload/utils.js +8 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +14 -4
- package/es/ProDrawerForm/components/ProModal/index.js +14 -4
- package/es/ProDrawerForm/index.js +13 -3
- package/es/ProEditLabel/components/RenderProForm.js +5 -1
- package/es/ProEditLabel/index.js +16 -5
- package/es/ProEditTable/components/ActionButton/index.js +5 -1
- package/es/ProEditTable/components/RcTable/BaseTable.js +13 -3
- package/es/ProEditTable/components/RcTable/DraggableTable.js +7 -2
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -2
- package/es/ProEditTable/components/RenderField/index.js +54 -29
- package/es/ProEditTable/components/RenderToolbar/index.js +10 -4
- package/es/ProEditTable/index.js +16 -5
- package/es/ProEditTable/propsType.d.ts +12 -6
- package/es/ProEditTable/style/index.less +22 -1
- package/es/ProEditTable/utils/config.js +8 -3
- package/es/ProEditTable/utils/index.js +13 -9
- package/es/ProEditTable/utils/tools.js +22 -10
- package/es/ProEditTable/utils/useEditTableError.js +6 -1
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +16 -7
- package/es/ProEnum/components/Group.js +6 -1
- package/es/ProEnum/components/Tag.js +6 -1
- package/es/ProEnum/hooks/useEnum.d.ts +8 -0
- package/es/ProEnum/hooks/useEnum.js +76 -4
- package/es/ProEnum/hooks/useEnumRequest.js +8 -3
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +8 -3
- package/es/ProEnum/index.js +25 -15
- package/es/ProEnum/utils/eventCenter.js +3 -1
- package/es/ProEnum/utils/frequentEnum.js +5 -1
- package/es/ProEnum/utils/index.js +2 -1
- package/es/ProForm/components/FormFooter/index.js +5 -1
- package/es/ProForm/components/base/Checkbox/index.js +7 -2
- package/es/ProForm/components/base/DatePicker/index.js +7 -2
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +6 -1
- package/es/ProForm/components/base/Input/index.js +7 -2
- package/es/ProForm/components/base/InputNumber/index.js +13 -3
- package/es/ProForm/components/base/Radio/index.js +7 -2
- package/es/ProForm/components/base/RangePicker/index.d.ts +7 -1
- package/es/ProForm/components/base/RangePicker/index.js +50 -4
- package/es/ProForm/components/base/RangePicker/useDateRange.js +6 -1
- package/es/ProForm/components/base/Select/index.js +7 -2
- package/es/ProForm/components/base/Switch/index.js +7 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -2
- package/es/ProForm/components/base/TextArea/index.js +7 -2
- package/es/ProForm/components/base/TimePicker/index.js +7 -2
- package/es/ProForm/components/combination/Container/index.js +5 -1
- package/es/ProForm/components/combination/Container/style/index.less +5 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +10 -4
- package/es/ProForm/components/combination/FormList/components/Empty.js +3 -2
- package/es/ProForm/components/combination/FormList/components/LineFields.js +5 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +10 -4
- package/es/ProForm/components/combination/FormList/index.js +41 -4
- package/es/ProForm/components/combination/FormList/style/index.less +1 -1
- package/es/ProForm/components/combination/FormList/utils.d.ts +6 -0
- package/es/ProForm/components/combination/FormList/utils.js +17 -0
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +70 -3
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +351 -0
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +107 -4
- package/es/ProForm/components/combination/Group/index.d.ts +3 -4
- package/es/ProForm/components/combination/Group/index.js +108 -24
- package/es/ProForm/components/combination/Group/propsType.d.ts +44 -1
- package/es/ProForm/components/combination/Group/style/index.less +425 -3
- package/es/ProForm/components/combination/Group/utils/index.d.ts +154 -0
- package/es/ProForm/components/combination/Group/utils/index.js +428 -0
- package/es/ProForm/components/combination/ProCascader/index.js +13 -3
- package/es/ProForm/components/combination/ProCascader/utils/index.js +7 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +14 -4
- package/es/ProForm/components/combination/ProModalSelect/index.js +16 -5
- package/es/ProForm/components/combination/ProNumberRange/index.js +24 -12
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
- package/es/ProForm/components/combination/ProRangeLimit/index.js +13 -3
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +6 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.js +13 -3
- package/es/ProForm/components/render/ChangedWrapper.js +7 -2
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -4
- package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
- package/es/ProForm/components/render/CustomComponentViewWrapper.js +120 -0
- package/es/ProForm/components/render/Render.js +71 -16
- package/es/ProForm/components/render/RenderFields.js +7 -2
- package/es/ProForm/index.js +13 -3
- package/es/ProForm/propsType.d.ts +7 -0
- package/es/ProForm/style/index.less +11 -2
- package/es/ProForm/utils/index.js +7 -2
- package/es/ProForm/utils/rulesCreator.js +5 -1
- package/es/ProForm/utils/transformValue.js +5 -1
- package/es/ProForm/utils/useForm.js +15 -5
- package/es/ProForm/utils/useShouldUpdate.js +93 -35
- package/es/ProForm/utils/useWatch.js +6 -1
- package/es/ProForm/utils/valueType.js +11 -2
- package/es/ProIcon/index.js +13 -3
- package/es/ProIcon/utils/index.js +5 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +27 -32
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +54 -35
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
- package/es/ProLayout/components/Layout/Notice/style/index.less +4 -0
- package/es/ProLayout/components/ProCollapse/index.js +5 -1
- package/es/ProLayout/components/ProCollapse/style/index.less +9 -9
- package/es/ProLayout/components/ProFooter/index.js +6 -2
- package/es/ProLayout/components/ProHeader/index.js +14 -4
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +100 -0
- package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
- package/es/ProLayout/components/TabsManager/components/TabItem.js +61 -0
- package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -0
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +14 -0
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +26 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +96 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +364 -0
- package/es/ProLayout/components/TabsManager/index.d.ts +8 -0
- package/es/ProLayout/components/TabsManager/index.js +180 -0
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
- package/es/ProLayout/components/TabsManager/propTypes.js +16 -0
- package/es/ProLayout/components/TabsManager/style/index.less +179 -0
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
- package/es/ProLayout/components/TabsManager/utils/index.js +106 -0
- package/es/ProLayout/index.d.ts +21 -4
- package/es/ProLayout/index.js +107 -14
- package/es/ProLayout/propTypes.d.ts +139 -1
- package/es/ProLayout/propTypes.js +37 -1
- package/es/ProLayout/utils/index.js +16 -7
- package/es/ProSelect/components/AdaptiveTooltip.js +6 -1
- package/es/ProSelect/index.js +13 -3
- package/es/ProSelect/utils/index.js +3 -1
- package/es/ProStep/components/Item/index.js +8 -2
- package/es/ProStep/components/Listener/index.js +10 -4
- package/es/ProStep/components/Step/index.js +11 -2
- package/es/ProStep/index.js +16 -5
- package/es/ProStep/utils/index.js +5 -1
- package/es/ProStepTab/index.js +19 -8
- package/es/ProTable/components/FormatColumn/index.js +7 -2
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +10 -4
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +5 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +7 -2
- package/es/ProTable/components/RenderColumn/index.js +11 -2
- package/es/ProTable/components/RenderTabs/index.js +11 -2
- package/es/ProTable/components/TableResizable/index.js +13 -3
- package/es/ProTable/components/TooltipTitle/index.js +3 -5
- package/es/ProTable/hooks/useAntdTable.js +17 -6
- package/es/ProTable/index.js +16 -5
- package/es/ProTable/style/index.less +3 -0
- package/es/ProTable/utils/index.js +6 -1
- package/es/ProTabs/index.js +13 -3
- package/es/ProThemeTools/component/ProTools/index.js +11 -2
- package/es/ProThemeTools/context/ThemeContext.js +11 -2
- package/es/ProThemeTools/index.js +13 -3
- package/es/ProThemeTools/utils/index.js +5 -1
- package/es/ProTooltip/index.js +13 -3
- package/es/ProTree/components/CloseIcon.js +5 -1
- package/es/ProTree/components/List.js +7 -2
- package/es/ProTree/components/ProTree.js +16 -5
- package/es/ProTree/components/ProTreeSelect/index.js +119 -75
- package/es/ProTree/components/Tree.js +16 -5
- package/es/ProTree/index.js +5 -1
- package/es/ProTree/utils.js +8 -2
- package/es/ProTreeModal/components/Cascader.js +11 -2
- package/es/ProTreeModal/components/CloseIcon.js +5 -1
- package/es/ProTreeModal/components/List.js +6 -1
- package/es/ProTreeModal/components/SortableItem.js +5 -1
- package/es/ProTreeModal/components/Tree.js +13 -3
- package/es/ProTreeModal/components/Trigger.js +11 -2
- package/es/ProTreeModal/index.js +11 -2
- package/es/ProTreeModal/style/index.less +6 -0
- package/es/ProTreeModal/utils.js +8 -2
- package/es/ProUpload/components/ButtonRender.js +8 -3
- package/es/ProUpload/components/DragRender.d.ts +1 -0
- package/es/ProUpload/components/DragRender.js +10 -2
- package/es/ProUpload/components/DraggableUploadListItem.js +5 -1
- package/es/ProUpload/components/Example.js +11 -2
- package/es/ProUpload/components/ImageRender.js +14 -4
- package/es/ProUpload/index.js +17 -5
- package/es/ProUpload/propsType.d.ts +5 -0
- package/es/ProViewer/index.js +14 -4
- package/es/ProWaterMark/index.js +5 -1
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +9 -0
- package/es/locale/en_US.js +9 -0
- package/es/locale/zh_CN.d.ts +9 -0
- package/es/locale/zh_CN.js +9 -0
- package/es/style/theme/antd.less +11 -35
- package/es/utils/index.js +6 -1
- package/jest.config.js +3 -1
- package/lib/FormsProvider/index.js +2 -1
- package/lib/ProAction/index.js +20 -10
- package/lib/ProConfigProvider/index.js +29 -19
- package/lib/ProDownload/index.js +29 -17
- package/lib/ProDownload/utils.js +14 -12
- package/lib/ProDrawerForm/components/ProDrawer/index.js +27 -16
- package/lib/ProDrawerForm/components/ProModal/index.js +21 -10
- package/lib/ProDrawerForm/components/index.js +2 -2
- package/lib/ProDrawerForm/index.js +20 -9
- package/lib/ProEditLabel/components/RenderProForm.js +9 -6
- package/lib/ProEditLabel/index.js +30 -18
- package/lib/ProEditTable/components/ActionButton/index.js +14 -11
- package/lib/ProEditTable/components/RcTable/BaseTable.js +19 -9
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +19 -13
- package/lib/ProEditTable/components/RcTable/index.js +2 -2
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +16 -10
- package/lib/ProEditTable/components/RenderField/index.js +76 -50
- package/lib/ProEditTable/components/RenderToolbar/index.js +18 -12
- package/lib/ProEditTable/components/index.js +2 -2
- package/lib/ProEditTable/index.js +33 -21
- package/lib/ProEditTable/propsType.d.ts +12 -6
- package/lib/ProEditTable/style/index.less +22 -1
- package/lib/ProEditTable/utils/config.js +20 -15
- package/lib/ProEditTable/utils/index.js +22 -18
- package/lib/ProEditTable/utils/tools.js +30 -21
- package/lib/ProEditTable/utils/useEditTableError.js +7 -3
- package/lib/ProEditTable/utils/useShouldUpdateForTable.js +17 -9
- package/lib/ProEnum/components/Group.js +8 -3
- package/lib/ProEnum/components/Tag.js +8 -3
- package/lib/ProEnum/hooks/useEnum.d.ts +8 -0
- package/lib/ProEnum/hooks/useEnum.js +76 -4
- package/lib/ProEnum/hooks/useEnumRequest.js +23 -18
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +12 -8
- package/lib/ProEnum/index.js +37 -26
- package/lib/ProEnum/utils/eventCenter.js +4 -3
- package/lib/ProEnum/utils/frequentEnum.js +6 -3
- package/lib/ProEnum/utils/index.js +3 -3
- package/lib/ProForm/components/Container.js +1 -1
- package/lib/ProForm/components/FormFooter/index.js +11 -6
- package/lib/ProForm/components/base/Checkbox/index.js +13 -7
- package/lib/ProForm/components/base/DatePicker/index.js +11 -6
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +7 -3
- package/lib/ProForm/components/base/Input/index.js +11 -6
- package/lib/ProForm/components/base/InputNumber/index.js +21 -10
- package/lib/ProForm/components/base/Radio/index.js +10 -5
- package/lib/ProForm/components/base/RangePicker/index.d.ts +7 -1
- package/lib/ProForm/components/base/RangePicker/index.js +55 -9
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +7 -3
- package/lib/ProForm/components/base/Select/index.js +10 -5
- package/lib/ProForm/components/base/Switch/index.js +10 -5
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +12 -6
- package/lib/ProForm/components/base/TextArea/index.js +10 -5
- package/lib/ProForm/components/base/TimePicker/index.js +10 -5
- package/lib/ProForm/components/combination/Container/index.js +11 -6
- package/lib/ProForm/components/combination/Container/style/index.less +5 -0
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +26 -19
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +3 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/Empty.js +6 -5
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +7 -3
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +20 -14
- package/lib/ProForm/components/combination/FormList/index.js +48 -10
- package/lib/ProForm/components/combination/FormList/style/index.less +1 -1
- package/lib/ProForm/components/combination/FormList/utils.d.ts +6 -0
- package/lib/ProForm/components/combination/FormList/utils.js +20 -2
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +79 -11
- package/lib/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
- package/lib/ProForm/components/combination/Group/component/FlexibleGroup.js +360 -0
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +111 -9
- package/lib/ProForm/components/combination/Group/index.d.ts +3 -4
- package/lib/ProForm/components/combination/Group/index.js +111 -27
- package/lib/ProForm/components/combination/Group/propsType.d.ts +44 -1
- package/lib/ProForm/components/combination/Group/style/index.less +425 -3
- package/lib/ProForm/components/combination/Group/utils/index.d.ts +154 -0
- package/lib/ProForm/components/combination/Group/utils/index.js +444 -0
- package/lib/ProForm/components/combination/ProCascader/index.js +20 -10
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +9 -5
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +25 -15
- package/lib/ProForm/components/combination/ProModalSelect/index.js +53 -41
- package/lib/ProForm/components/combination/ProNumberRange/index.js +28 -16
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +29 -18
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +8 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +26 -15
- package/lib/ProForm/components/index.js +2 -2
- package/lib/ProForm/components/render/ChangedWrapper.js +16 -10
- package/lib/ProForm/components/render/ConfirmWrapper.js +19 -13
- package/lib/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
- package/lib/ProForm/components/render/CustomComponentViewWrapper.js +127 -0
- package/lib/ProForm/components/render/Render.js +93 -37
- package/lib/ProForm/components/render/RenderFields.js +15 -9
- package/lib/ProForm/index.js +23 -12
- package/lib/ProForm/propsType.d.ts +7 -0
- package/lib/ProForm/style/index.less +11 -2
- package/lib/ProForm/utils/index.js +12 -8
- package/lib/ProForm/utils/rulesCreator.js +8 -4
- package/lib/ProForm/utils/transformValue.js +6 -3
- package/lib/ProForm/utils/useFieldProps.js +2 -1
- package/lib/ProForm/utils/useForm.js +21 -12
- package/lib/ProForm/utils/useRules.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.js +94 -37
- package/lib/ProForm/utils/useWatch.js +8 -3
- package/lib/ProForm/utils/valueType.js +15 -6
- package/lib/ProIcon/index.js +26 -16
- package/lib/ProIcon/utils/index.js +7 -4
- package/lib/ProLayout/components/Layout/Header/index.js +1 -1
- package/lib/ProLayout/components/Layout/Icon/Icon.js +2 -1
- package/lib/ProLayout/components/Layout/Icon/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +30 -35
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +55 -36
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Notice/index.js +1 -1
- package/lib/ProLayout/components/Layout/Notice/style/index.less +4 -0
- package/lib/ProLayout/components/Layout/index.js +2 -2
- package/lib/ProLayout/components/ProCollapse/index.js +10 -6
- package/lib/ProLayout/components/ProCollapse/style/index.less +9 -9
- package/lib/ProLayout/components/ProFooter/index.js +8 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +1 -1
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +1 -1
- package/lib/ProLayout/components/ProHeader/components/index.js +2 -2
- package/lib/ProLayout/components/ProHeader/index.js +22 -12
- package/lib/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
- package/lib/ProLayout/components/TabsManager/components/TabContextMenu.js +106 -0
- package/lib/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
- package/lib/ProLayout/components/TabsManager/components/TabItem.js +67 -0
- package/lib/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
- package/lib/ProLayout/components/TabsManager/components/TabsContext.js +11 -0
- package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
- package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.js +20 -0
- package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
- package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +31 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.js +103 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsState.js +370 -0
- package/lib/ProLayout/components/TabsManager/index.d.ts +8 -0
- package/lib/ProLayout/components/TabsManager/index.js +183 -0
- package/lib/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
- package/lib/ProLayout/components/TabsManager/propTypes.js +22 -0
- package/lib/ProLayout/components/TabsManager/style/index.less +179 -0
- package/lib/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
- package/lib/ProLayout/components/TabsManager/utils/index.js +119 -0
- package/lib/ProLayout/components/index.js +2 -2
- package/lib/ProLayout/index.d.ts +21 -4
- package/lib/ProLayout/index.js +122 -21
- package/lib/ProLayout/propTypes.d.ts +139 -1
- package/lib/ProLayout/propTypes.js +40 -1
- package/lib/ProLayout/utils/index.js +18 -13
- package/lib/ProSelect/components/AdaptiveTooltip.js +7 -3
- package/lib/ProSelect/index.js +23 -12
- package/lib/ProSelect/utils/index.js +8 -8
- package/lib/ProStep/components/Anchor/index.js +1 -1
- package/lib/ProStep/components/Item/index.js +15 -9
- package/lib/ProStep/components/Listener/index.js +15 -9
- package/lib/ProStep/components/Step/index.js +17 -7
- package/lib/ProStep/index.js +30 -19
- package/lib/ProStep/utils/index.js +6 -3
- package/lib/ProStepTab/index.js +33 -22
- package/lib/ProTable/components/FormatColumn/index.js +22 -16
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +9 -5
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +22 -16
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -5
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +11 -6
- package/lib/ProTable/components/RcTable/index.js +2 -2
- package/lib/ProTable/components/RenderColumn/index.js +17 -8
- package/lib/ProTable/components/RenderTabs/index.js +16 -7
- package/lib/ProTable/components/TableResizable/index.js +19 -9
- package/lib/ProTable/components/TooltipTitle/index.js +3 -6
- package/lib/ProTable/components/index.js +2 -2
- package/lib/ProTable/hooks/useAntdTable.js +42 -31
- package/lib/ProTable/index.js +41 -29
- package/lib/ProTable/style/index.less +3 -0
- package/lib/ProTable/utils/index.js +7 -3
- package/lib/ProTabs/components/index.js +2 -2
- package/lib/ProTabs/index.js +23 -12
- package/lib/ProThemeTools/component/ProTools/index.js +21 -11
- package/lib/ProThemeTools/component/index.js +2 -2
- package/lib/ProThemeTools/context/ThemeContext.js +20 -16
- package/lib/ProThemeTools/index.js +22 -12
- package/lib/ProThemeTools/utils/index.js +6 -3
- package/lib/ProTooltip/index.js +30 -20
- package/lib/ProTree/components/CloseIcon.js +6 -3
- package/lib/ProTree/components/List.js +10 -5
- package/lib/ProTree/components/ProTree.js +23 -12
- package/lib/ProTree/components/ProTreeSelect/index.js +138 -93
- package/lib/ProTree/components/SearchTitle.js +1 -1
- package/lib/ProTree/components/Tree.js +28 -16
- package/lib/ProTree/components/index.js +2 -2
- package/lib/ProTree/index.js +9 -5
- package/lib/ProTree/utils.js +16 -11
- package/lib/ProTreeModal/components/Cascader.js +14 -5
- package/lib/ProTreeModal/components/CloseIcon.js +6 -3
- package/lib/ProTreeModal/components/List.js +11 -7
- package/lib/ProTreeModal/components/SortableItem.js +10 -6
- package/lib/ProTreeModal/components/Tree.js +24 -13
- package/lib/ProTreeModal/components/Trigger.js +19 -9
- package/lib/ProTreeModal/components/index.js +2 -2
- package/lib/ProTreeModal/index.js +16 -6
- package/lib/ProTreeModal/style/index.less +6 -0
- package/lib/ProTreeModal/utils.js +17 -14
- package/lib/ProUpload/components/ButtonRender.js +14 -9
- package/lib/ProUpload/components/DragRender.d.ts +1 -0
- package/lib/ProUpload/components/DragRender.js +13 -5
- package/lib/ProUpload/components/DraggableUploadListItem.js +7 -3
- package/lib/ProUpload/components/Example.js +16 -6
- package/lib/ProUpload/components/FileItem.js +1 -1
- package/lib/ProUpload/components/ImageRender.js +20 -10
- package/lib/ProUpload/index.js +31 -18
- package/lib/ProUpload/propsType.d.ts +5 -0
- package/lib/ProViewer/index.js +22 -14
- package/lib/ProWaterMark/index.js +7 -3
- package/lib/index.d.ts +1 -2
- package/lib/index.js +4 -3
- package/lib/locale/en_US.d.ts +9 -0
- package/lib/locale/en_US.js +9 -0
- package/lib/locale/index.js +1 -1
- package/lib/locale/zh_CN.d.ts +9 -0
- package/lib/locale/zh_CN.js +9 -0
- package/lib/style/theme/antd.less +11 -35
- package/lib/utils/index.js +9 -4
- package/package.json +13 -16
- package/package.json.backup-antd5 +159 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -54
- package/es/ProForm/components/combination/Group/utils.js +0 -196
- package/es/assets/tip.svg +0 -1
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -54
- package/lib/ProForm/components/combination/Group/utils.js +0 -210
- package/lib/assets/tip.svg +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -31,4 +30,5 @@ Object.defineProperty(exports, "Notice", {
|
|
|
31
30
|
var _Header = _interopRequireDefault(require("./Header"));
|
|
32
31
|
var _Notice = _interopRequireDefault(require("./Notice"));
|
|
33
32
|
var _Menu = _interopRequireDefault(require("./Menu"));
|
|
34
|
-
var _Icon = _interopRequireDefault(require("./Icon"));
|
|
33
|
+
var _Icon = _interopRequireDefault(require("./Icon"));
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
7
|
var _react = require("react");
|
|
10
8
|
var _antd = require("antd");
|
|
11
9
|
var _icons = require("@ant-design/icons");
|
|
@@ -13,6 +11,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
11
|
var _fold = _interopRequireDefault(require("../../../assets/fold.svg"));
|
|
14
12
|
var _index = _interopRequireDefault(require("../../../ProIcon/index"));
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
20
|
var ProCollapse = props => {
|
|
17
21
|
var title = props.title,
|
|
18
22
|
id = props.id,
|
|
@@ -44,7 +48,7 @@ var ProCollapse = props => {
|
|
|
44
48
|
|
|
45
49
|
// 当同时设置了open和collapseProps.activeKey时,以collapseProps.activeKey为准
|
|
46
50
|
// 这样保证了与已有代码的兼容性,并提供了更简便的控制面板展开状态的方式
|
|
47
|
-
var finalCollapseProps = (
|
|
51
|
+
var finalCollapseProps = _objectSpread({}, collapseProps);
|
|
48
52
|
if (open !== undefined && !('activeKey' in finalCollapseProps)) {
|
|
49
53
|
finalCollapseProps.activeKey = open ? ['1'] : [];
|
|
50
54
|
}
|
|
@@ -88,7 +92,7 @@ var ProCollapse = props => {
|
|
|
88
92
|
if (!threeCollapse) {
|
|
89
93
|
hasCollapse.collapsible = 'disabled';
|
|
90
94
|
}
|
|
91
|
-
return [(
|
|
95
|
+
return [_objectSpread(_objectSpread({
|
|
92
96
|
key: '1',
|
|
93
97
|
label: _title,
|
|
94
98
|
children: content,
|
|
@@ -115,7 +119,7 @@ var ProCollapse = props => {
|
|
|
115
119
|
}), title]
|
|
116
120
|
});
|
|
117
121
|
}
|
|
118
|
-
return [(
|
|
122
|
+
return [_objectSpread(_objectSpread({
|
|
119
123
|
key: '1',
|
|
120
124
|
label: _title,
|
|
121
125
|
children: content,
|
|
@@ -174,7 +178,7 @@ var ProCollapse = props => {
|
|
|
174
178
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
175
179
|
id: id,
|
|
176
180
|
style: style,
|
|
177
|
-
children: Array.isArray(titleList) && titleList.length ? renderTitleList() : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Collapse, (
|
|
181
|
+
children: Array.isArray(titleList) && titleList.length ? renderTitleList() : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Collapse, _objectSpread({
|
|
178
182
|
className: cls,
|
|
179
183
|
bordered: false,
|
|
180
184
|
expandIcon: _ref => {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
border-radius: 8px !important;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.@{ant-prefix}-collapse-
|
|
38
|
+
.@{ant-prefix}-collapse-title {
|
|
39
39
|
color: var(--zaui-text, #343434);
|
|
40
40
|
font-weight: 500;
|
|
41
41
|
font-size: var(--zaui-font-size-lg, 16px);
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
&.@{ant-prefix}-collapse-borderless
|
|
49
49
|
.@{ant-prefix}-collapse-item
|
|
50
50
|
> .@{ant-prefix}-collapse-content
|
|
51
|
-
> .@{ant-prefix}-collapse-
|
|
51
|
+
> .@{ant-prefix}-collapse-body {
|
|
52
52
|
padding: 0;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.@{ant-prefix}-collapse-
|
|
56
|
-
padding: 0;
|
|
55
|
+
.@{ant-prefix}-collapse-body {
|
|
56
|
+
padding: 0 !important;
|
|
57
57
|
|
|
58
58
|
.pro-collapse-content {
|
|
59
59
|
padding: var(--zaui-space-size-md, 16px);
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
padding: 0 !important;
|
|
73
73
|
background: var(--zaui-base-bg, #ffffff);
|
|
74
74
|
|
|
75
|
-
.@{ant-prefix}-collapse-
|
|
75
|
+
.@{ant-prefix}-collapse-title {
|
|
76
76
|
position: relative;
|
|
77
77
|
padding-left: 15px;
|
|
78
78
|
font-size: var(--zaui-font-size, 14px);
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
&:hover{
|
|
220
220
|
background: #fff !important;
|
|
221
221
|
}
|
|
222
|
-
.@{ant-prefix}-collapse-
|
|
222
|
+
.@{ant-prefix}-collapse-title {
|
|
223
223
|
&:before{
|
|
224
224
|
display: block;
|
|
225
225
|
}
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
.@{ant-prefix}-collapse-content{
|
|
236
|
-
.@{ant-prefix}-collapse-
|
|
236
|
+
.@{ant-prefix}-collapse-body{
|
|
237
237
|
.pro-collapse-content{
|
|
238
238
|
padding: var(--zaui-space-size-sm, 8px) 0 !important;
|
|
239
239
|
}
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
margin: 0 !important;
|
|
275
275
|
border-bottom: none !important;
|
|
276
276
|
|
|
277
|
-
.@{ant-prefix}-collapse-
|
|
277
|
+
.@{ant-prefix}-collapse-title {
|
|
278
278
|
font-size: var(--zaui-font-size, 14px);
|
|
279
279
|
font-weight: 500;
|
|
280
280
|
color: var(--zaui-text, #343434);
|
|
@@ -293,7 +293,7 @@
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
.@{ant-prefix}-collapse-content {
|
|
296
|
-
.@{ant-prefix}-collapse-
|
|
296
|
+
.@{ant-prefix}-collapse-body {
|
|
297
297
|
.pro-collapse-content {
|
|
298
298
|
padding: var(--zaui-space-size-md, 16px) !important;
|
|
299
299
|
background: var(--zaui-base-bg, #ffffff);
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
7
|
var _ahooks = require("ahooks");
|
|
10
8
|
var _antd = require("antd");
|
|
11
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
10
|
var _react = require("react");
|
|
13
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
18
|
var ProFooter = props => {
|
|
15
19
|
var _props$visible = props.visible,
|
|
16
20
|
visible = _props$visible === void 0 ? true : _props$visible,
|
|
17
21
|
className = props.className,
|
|
18
22
|
children = props.children,
|
|
19
23
|
_props$zIndex = props.zIndex,
|
|
20
|
-
zIndex = _props$zIndex === void 0 ?
|
|
24
|
+
zIndex = _props$zIndex === void 0 ? 99 : _props$zIndex,
|
|
21
25
|
_props$sideDom = props.sideDom,
|
|
22
26
|
sideDom = _props$sideDom === void 0 ? '.pro-layout-sider-nav' : _props$sideDom,
|
|
23
27
|
_props$contentDom = props.contentDom,
|
|
@@ -43,7 +47,7 @@ var ProFooter = props => {
|
|
|
43
47
|
});
|
|
44
48
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
45
49
|
className: cls,
|
|
46
|
-
style: (
|
|
50
|
+
style: _objectSpread({
|
|
47
51
|
zIndex,
|
|
48
52
|
width: `calc(100% - ${size === null || size === void 0 ? void 0 : size.width}px)`
|
|
49
53
|
}, props.style),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,6 +10,7 @@ var _icons = require("@ant-design/icons");
|
|
|
11
10
|
var _copy = _interopRequireDefault(require("../../../../../assets/copy.svg"));
|
|
12
11
|
var _locale = _interopRequireDefault(require("../../../../../locale"));
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
var Paragraph = _antd.Typography.Paragraph;
|
|
15
15
|
var Copy = _ref => {
|
|
16
16
|
var text = _ref.text;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -9,6 +8,7 @@ var _icons = require("@ant-design/icons");
|
|
|
9
8
|
var _antd = require("antd");
|
|
10
9
|
var _locale = _interopRequireDefault(require("../../../../../locale"));
|
|
11
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
/**
|
|
13
13
|
* 页面返回按钮
|
|
14
14
|
* @param onBack 自定义返回方法
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -17,4 +16,5 @@ Object.defineProperty(exports, "ProBackBtn", {
|
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
18
|
var _Copy = _interopRequireDefault(require("./Copy"));
|
|
20
|
-
var _ProBackBtn = _interopRequireDefault(require("./ProBackBtn"));
|
|
19
|
+
var _ProBackBtn = _interopRequireDefault(require("./ProBackBtn"));
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
7
|
var _antd = require("antd");
|
|
13
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
9
|
var _utils = require("@zat-design/utils");
|
|
@@ -24,7 +19,22 @@ var _locale = _interopRequireDefault(require("../../../locale"));
|
|
|
24
19
|
var _utils2 = require("./utils");
|
|
25
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
21
|
var _excluded = ["width"];
|
|
27
|
-
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
29
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
36
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
37
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable react/no-array-index-key */
|
|
28
38
|
var formatAmount = _utils.tools.formatAmount;
|
|
29
39
|
var ProHeader = props => {
|
|
30
40
|
var breadcrumbColumns = props.breadcrumbColumns,
|
|
@@ -53,11 +63,11 @@ var ProHeader = props => {
|
|
|
53
63
|
_props$isConfirmBackM = props.isConfirmBackModalProps,
|
|
54
64
|
isConfirmBackModalProps = _props$isConfirmBackM === void 0 ? {} : _props$isConfirmBackM;
|
|
55
65
|
var _useState = (0, _react.useState)(showBack),
|
|
56
|
-
_useState2 = (
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
67
|
backState = _useState2[0],
|
|
58
68
|
setBackState = _useState2[1];
|
|
59
69
|
var _useToggle = (0, _ahooks.useToggle)(collapsed),
|
|
60
|
-
_useToggle2 = (
|
|
70
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
61
71
|
fold = _useToggle2[0],
|
|
62
72
|
toggle = _useToggle2[1].toggle;
|
|
63
73
|
var ref = (0, _react.useRef)(null);
|
|
@@ -287,7 +297,7 @@ var ProHeader = props => {
|
|
|
287
297
|
var actionsRender = () => {
|
|
288
298
|
if (Array.isArray(actionRender) && actionRender.length) {
|
|
289
299
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
290
|
-
|
|
300
|
+
separator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Divider, {
|
|
291
301
|
type: "vertical"
|
|
292
302
|
}),
|
|
293
303
|
children: actionRender.map((item, index) => {
|
|
@@ -480,8 +490,8 @@ var ProHeader = props => {
|
|
|
480
490
|
// 处理 Modal.confirm 的 width 类型兼容性问题
|
|
481
491
|
var _ref = isConfirmBackModalProps || {},
|
|
482
492
|
width = _ref.width,
|
|
483
|
-
restModalProps = (
|
|
484
|
-
_antd.Modal.confirm((
|
|
493
|
+
restModalProps = _objectWithoutProperties(_ref, _excluded);
|
|
494
|
+
_antd.Modal.confirm(_objectSpread(_objectSpread({
|
|
485
495
|
title: `${_locale.default.ProHeader.confirmTitle}`,
|
|
486
496
|
okText: `${_locale.default.ProHeader.confirm}`,
|
|
487
497
|
cancelText: `${_locale.default.ProHeader.cancel}`,
|
|
@@ -494,7 +504,7 @@ var ProHeader = props => {
|
|
|
494
504
|
};
|
|
495
505
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
496
506
|
className: cls,
|
|
497
|
-
style: (
|
|
507
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
498
508
|
top: fixedTop,
|
|
499
509
|
zIndex
|
|
500
510
|
}),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TabContextMenuProps } from '../propTypes';
|
|
2
|
+
/**
|
|
3
|
+
* 右键菜单组件 - 兼容Antd 4.x和5.x
|
|
4
|
+
*/
|
|
5
|
+
declare function TabContextMenu({ tabId, children, closable, onClose, onCloseOthers, onCloseRight, onCloseAll, menuItems: customMenuItems, tabMenuClick, tab, tabs, }: TabContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default TabContextMenu;
|
|
7
|
+
export { TabContextMenu };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TabContextMenu = TabContextMenu;
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
/**
|
|
18
|
+
* 右键菜单组件 - 兼容Antd 4.x和5.x
|
|
19
|
+
*/
|
|
20
|
+
function TabContextMenu(_ref) {
|
|
21
|
+
var tabId = _ref.tabId,
|
|
22
|
+
children = _ref.children,
|
|
23
|
+
_ref$closable = _ref.closable,
|
|
24
|
+
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
25
|
+
onClose = _ref.onClose,
|
|
26
|
+
onCloseOthers = _ref.onCloseOthers,
|
|
27
|
+
onCloseRight = _ref.onCloseRight,
|
|
28
|
+
onCloseAll = _ref.onCloseAll,
|
|
29
|
+
customMenuItems = _ref.menuItems,
|
|
30
|
+
tabMenuClick = _ref.tabMenuClick,
|
|
31
|
+
tab = _ref.tab,
|
|
32
|
+
_ref$tabs = _ref.tabs,
|
|
33
|
+
tabs = _ref$tabs === void 0 ? [] : _ref$tabs;
|
|
34
|
+
var _useState = (0, _react.useState)(false),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
visible = _useState2[0],
|
|
37
|
+
setVisible = _useState2[1];
|
|
38
|
+
var handleMenuClick = (0, _react.useCallback)(key => {
|
|
39
|
+
setVisible(false);
|
|
40
|
+
|
|
41
|
+
// 优先调用自定义回调
|
|
42
|
+
if (tabMenuClick && tab) {
|
|
43
|
+
tabMenuClick({
|
|
44
|
+
key,
|
|
45
|
+
tab,
|
|
46
|
+
tabs
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 处理默认菜单项
|
|
51
|
+
switch (key) {
|
|
52
|
+
case 'close':
|
|
53
|
+
if (!closable) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
onClose(tabId);
|
|
57
|
+
break;
|
|
58
|
+
case 'closeOthers':
|
|
59
|
+
onCloseOthers(tabId);
|
|
60
|
+
break;
|
|
61
|
+
case 'closeRight':
|
|
62
|
+
onCloseRight(tabId);
|
|
63
|
+
break;
|
|
64
|
+
case 'closeAll':
|
|
65
|
+
onCloseAll();
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}, [tabId, closable, onClose, onCloseOthers, onCloseRight, onCloseAll, tabMenuClick, tab, tabs]);
|
|
69
|
+
|
|
70
|
+
// 默认右键菜单配置 - 统一使用items方式(antd 4.20+都支持)
|
|
71
|
+
var defaultMenuItems = [{
|
|
72
|
+
key: 'close',
|
|
73
|
+
label: '关闭',
|
|
74
|
+
disabled: !closable
|
|
75
|
+
}, {
|
|
76
|
+
key: 'closeOthers',
|
|
77
|
+
label: '关闭其他'
|
|
78
|
+
}, {
|
|
79
|
+
key: 'closeRight',
|
|
80
|
+
label: '关闭右侧标签页'
|
|
81
|
+
}, {
|
|
82
|
+
key: 'closeAll',
|
|
83
|
+
label: '关闭全部'
|
|
84
|
+
}];
|
|
85
|
+
|
|
86
|
+
// 合并自定义菜单项和默认菜单项
|
|
87
|
+
// 如果提供了自定义菜单项,则追加到默认菜单项后面;否则使用默认菜单项
|
|
88
|
+
var menuItems = customMenuItems && customMenuItems.length > 0 ? [...defaultMenuItems, {
|
|
89
|
+
type: 'divider'
|
|
90
|
+
}, ...customMenuItems] : defaultMenuItems;
|
|
91
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, {
|
|
92
|
+
menu: {
|
|
93
|
+
items: menuItems,
|
|
94
|
+
onClick: _ref2 => {
|
|
95
|
+
var key = _ref2.key;
|
|
96
|
+
return handleMenuClick(key);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
trigger: ['contextMenu'],
|
|
100
|
+
open: visible,
|
|
101
|
+
onOpenChange: setVisible,
|
|
102
|
+
placement: "bottomLeft",
|
|
103
|
+
children: children
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
var _default = exports.default = TabContextMenu;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabItem } from '../../../propTypes';
|
|
3
|
+
interface TabItemComponentProps {
|
|
4
|
+
tab: TabItem;
|
|
5
|
+
active: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onCloseOthers: () => void;
|
|
9
|
+
onCloseRight: () => void;
|
|
10
|
+
onCloseAll: () => void;
|
|
11
|
+
/** 所有标签页列表 */
|
|
12
|
+
tabsList?: TabItem[];
|
|
13
|
+
/** 自定义菜单项 */
|
|
14
|
+
menuItems?: import('antd').MenuProps['items'];
|
|
15
|
+
/** 自定义菜单项点击回调 */
|
|
16
|
+
tabMenuClick?: (params: {
|
|
17
|
+
key: string;
|
|
18
|
+
tab: TabItem;
|
|
19
|
+
tabs: TabItem[];
|
|
20
|
+
}) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 单个标签页组件
|
|
24
|
+
*/
|
|
25
|
+
declare const TabItemComponent: React.FC<TabItemComponentProps>;
|
|
26
|
+
export { TabItemComponent };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TabItemComponent = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _icons = require("@ant-design/icons");
|
|
9
|
+
var _TabContextMenu = require("./TabContextMenu");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
/**
|
|
13
|
+
* 单个标签页组件
|
|
14
|
+
*/
|
|
15
|
+
var TabItemComponent = _ref => {
|
|
16
|
+
var tab = _ref.tab,
|
|
17
|
+
active = _ref.active,
|
|
18
|
+
onClick = _ref.onClick,
|
|
19
|
+
_onClose = _ref.onClose,
|
|
20
|
+
_onCloseOthers = _ref.onCloseOthers,
|
|
21
|
+
_onCloseRight = _ref.onCloseRight,
|
|
22
|
+
onCloseAll = _ref.onCloseAll,
|
|
23
|
+
_ref$tabsList = _ref.tabsList,
|
|
24
|
+
tabsList = _ref$tabsList === void 0 ? [] : _ref$tabsList,
|
|
25
|
+
menuItems = _ref.menuItems,
|
|
26
|
+
tabMenuClick = _ref.tabMenuClick;
|
|
27
|
+
var handleCloseClick = e => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
_onClose();
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabContextMenu.TabContextMenu, {
|
|
32
|
+
tabId: tab.id,
|
|
33
|
+
closable: tab.closable,
|
|
34
|
+
onClose: () => _onClose(),
|
|
35
|
+
onCloseOthers: () => _onCloseOthers(),
|
|
36
|
+
onCloseRight: () => _onCloseRight(),
|
|
37
|
+
onCloseAll: onCloseAll,
|
|
38
|
+
tab: tab,
|
|
39
|
+
tabs: tabsList,
|
|
40
|
+
menuItems: menuItems,
|
|
41
|
+
tabMenuClick: tabMenuClick,
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
43
|
+
className: `pro-layout-tab-item ${active ? 'active' : ''} ${tab.closable ? 'closable' : ''}`,
|
|
44
|
+
onClick: onClick,
|
|
45
|
+
"data-testid": `tab-${tab.id}`,
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
47
|
+
className: "pro-layout-tab-content",
|
|
48
|
+
children: [tab.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
49
|
+
className: "pro-layout-tab-icon",
|
|
50
|
+
children: typeof tab.icon === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
51
|
+
className: `iconfont ${tab.icon}`
|
|
52
|
+
}) : tab.icon
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
54
|
+
className: "pro-layout-tab-title",
|
|
55
|
+
title: tab.title,
|
|
56
|
+
children: tab.title
|
|
57
|
+
}), tab.closable && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
58
|
+
className: "pro-layout-tab-close",
|
|
59
|
+
onClick: handleCloseClick,
|
|
60
|
+
"data-testid": `tab-close-${tab.id}`,
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.CloseOutlined, {})
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.TabItemComponent = TabItemComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TabsContext = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* 标签页实例 Context,用于在 ProLayout children 中访问标签页 API
|
|
10
|
+
*/
|
|
11
|
+
var TabsContext = exports.TabsContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useActiveTab = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _TabsContext = require("../components/TabsContext");
|
|
9
|
+
/**
|
|
10
|
+
* 获取当前激活的 Tab 信息 Hook
|
|
11
|
+
* @returns 当前激活的 Tab 对象,如果没有激活则返回 undefined
|
|
12
|
+
*/
|
|
13
|
+
var useActiveTab = () => {
|
|
14
|
+
var tabsInstance = (0, _react.useContext)(_TabsContext.TabsContext);
|
|
15
|
+
return (0, _react.useMemo)(() => {
|
|
16
|
+
if (!tabsInstance) return undefined;
|
|
17
|
+
return tabsInstance.getTabInfo().activeTabInfo;
|
|
18
|
+
}, [tabsInstance]);
|
|
19
|
+
};
|
|
20
|
+
exports.useActiveTab = useActiveTab;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ProLayoutTabsInstance } from '../../../propTypes';
|
|
2
|
+
/**
|
|
3
|
+
* @description 获取 ProLayout 标签页实例的 Hook(类似 Form.useForm)
|
|
4
|
+
* @returns [ProLayoutTabsInstance] 标签页实例
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* // 在 ProLayout children 中使用
|
|
8
|
+
* const [layoutTabs] = useProLayoutTabs();
|
|
9
|
+
*
|
|
10
|
+
* // 使用实例方法
|
|
11
|
+
* layoutTabs.addTab({
|
|
12
|
+
* code: 'PolicyInput',
|
|
13
|
+
* name: '投保单录入',
|
|
14
|
+
* extra: { customData: '自定义数据' }
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useProLayoutTabs(): [ProLayoutTabsInstance];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useProLayoutTabs = useProLayoutTabs;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _TabsContext = require("../components/TabsContext");
|
|
9
|
+
/**
|
|
10
|
+
* @description 获取 ProLayout 标签页实例的 Hook(类似 Form.useForm)
|
|
11
|
+
* @returns [ProLayoutTabsInstance] 标签页实例
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // 在 ProLayout children 中使用
|
|
15
|
+
* const [layoutTabs] = useProLayoutTabs();
|
|
16
|
+
*
|
|
17
|
+
* // 使用实例方法
|
|
18
|
+
* layoutTabs.addTab({
|
|
19
|
+
* code: 'PolicyInput',
|
|
20
|
+
* name: '投保单录入',
|
|
21
|
+
* extra: { customData: '自定义数据' }
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
function useProLayoutTabs() {
|
|
26
|
+
var context = (0, _react.useContext)(_TabsContext.TabsContext);
|
|
27
|
+
if (!context) {
|
|
28
|
+
throw new Error('useProLayoutTabs must be used within ProLayout with mode="tabs"');
|
|
29
|
+
}
|
|
30
|
+
return [context];
|
|
31
|
+
}
|