@zat-design/sisyphus-react 4.5.5 → 4.5.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/FormsProvider/index.d.ts +18 -0
- package/es/ProAction/components/CheckModalContent/index.d.ts +8 -0
- package/es/ProAction/index.d.ts +7 -0
- package/es/ProAction/propsType.d.ts +45 -0
- package/es/ProConfigProvider/index.d.ts +9 -0
- package/es/ProConfigProvider/propsType.d.ts +82 -0
- package/es/ProDownload/index.d.ts +6 -0
- package/es/ProDownload/propsType.d.ts +71 -0
- package/es/ProDownload/utils.d.ts +60 -0
- package/es/ProDrawerForm/components/ProDrawer/index.d.ts +7 -0
- package/es/ProDrawerForm/components/ProModal/index.d.ts +7 -0
- package/es/ProDrawerForm/components/index.d.ts +2 -0
- package/es/ProDrawerForm/hooks/useConfirmClose.d.ts +24 -0
- package/es/ProDrawerForm/index.d.ts +6 -0
- package/es/ProDrawerForm/propsType.d.ts +111 -0
- package/es/ProDrawerForm/utils/index.d.ts +25 -0
- package/es/ProEditLabel/components/RenderProForm.d.ts +4 -0
- package/es/ProEditLabel/index.d.ts +4 -0
- package/es/ProEditLabel/propsType.d.ts +163 -0
- package/es/ProEditLabel/utils/index.d.ts +7 -0
- package/es/ProEditTable/components/ActionButton/index.d.ts +2 -0
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +5 -0
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +7 -0
- package/es/ProEditTable/components/RcTable/index.d.ts +4 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +4 -0
- package/es/ProEditTable/components/RenderField/index.d.ts +3 -0
- package/es/ProEditTable/components/RenderField/propsType.d.ts +30 -0
- package/es/ProEditTable/components/RenderField/tools.d.ts +22 -0
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +2 -0
- package/es/ProEditTable/components/Summary/index.d.ts +12 -0
- package/es/ProEditTable/components/Validator/index.d.ts +18 -0
- package/es/ProEditTable/components/index.d.ts +5 -0
- package/es/ProEditTable/index.d.ts +4 -0
- package/es/ProEditTable/propsType.d.ts +437 -0
- package/es/ProEditTable/utils/config.d.ts +25 -0
- package/es/ProEditTable/utils/diffOriginal.d.ts +22 -0
- package/es/ProEditTable/utils/getDefaultProps.d.ts +1 -0
- package/es/ProEditTable/utils/index.d.ts +23 -0
- package/es/ProEditTable/utils/tools.d.ts +133 -0
- package/es/ProEditTable/utils/transform.d.ts +13 -0
- package/es/ProEditTable/utils/useEditTableError.d.ts +7 -0
- package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +16 -0
- package/es/ProEditTable/utils/validateAll.d.ts +89 -0
- package/es/ProEnum/components/Group.d.ts +10 -0
- package/es/ProEnum/components/Tag.d.ts +7 -0
- package/es/ProEnum/hooks/useEnum.d.ts +29 -0
- package/es/ProEnum/hooks/useEnumRequest.d.ts +4 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/es/ProEnum/index.d.ts +10 -0
- package/es/ProEnum/index.js +1 -1
- package/es/ProEnum/propsType.d.ts +320 -0
- package/es/ProEnum/utils/eventCenter.d.ts +1 -0
- package/es/ProEnum/utils/frequentEnum.d.ts +39 -0
- package/es/ProEnum/utils/getEnum.d.ts +47 -0
- package/es/ProEnum/utils/getEnumLabel.d.ts +2 -0
- package/es/ProEnum/utils/index.d.ts +98 -0
- package/es/ProForm/components/Container.d.ts +9 -0
- package/es/ProForm/components/FormFooter/index.d.ts +5 -0
- package/es/ProForm/components/FormFooter/propsType.d.ts +21 -0
- package/es/ProForm/components/base/Checkbox/index.d.ts +14 -0
- package/es/ProForm/components/base/DatePicker/index.d.ts +11 -0
- package/es/ProForm/components/base/Input/index.d.ts +3 -0
- package/es/ProForm/components/base/Input/propsType.d.ts +21 -0
- package/es/ProForm/components/base/InputNumber/index.d.ts +11 -0
- package/es/ProForm/components/base/Radio/index.d.ts +15 -0
- package/es/ProForm/components/base/RangePicker/index.d.ts +19 -0
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +15 -0
- package/es/ProForm/components/base/Select/index.d.ts +11 -0
- package/es/ProForm/components/base/Switch/index.d.ts +10 -0
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +10 -0
- package/es/ProForm/components/base/TextArea/index.d.ts +11 -0
- package/es/ProForm/components/base/TimePicker/index.d.ts +13 -0
- package/es/ProForm/components/combination/Container/index.d.ts +4 -0
- package/es/ProForm/components/combination/Container/propsType.d.ts +13 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +24 -0
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +23 -0
- package/es/ProForm/components/combination/FormList/components/Empty.d.ts +13 -0
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +20 -0
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +12 -0
- package/es/ProForm/components/combination/FormList/index.d.ts +4 -0
- package/es/ProForm/components/combination/FormList/propsType.d.ts +69 -0
- package/es/ProForm/components/combination/FormList/utils.d.ts +18 -0
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +9 -0
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +28 -0
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +34 -0
- package/es/ProForm/components/combination/Group/index.d.ts +9 -0
- package/es/ProForm/components/combination/Group/propsType.d.ts +99 -0
- package/es/ProForm/components/combination/Group/utils/index.d.ts +153 -0
- package/es/ProForm/components/combination/ProCascader/index.d.ts +3 -0
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +48 -0
- package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.d.ts +33 -0
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +4 -0
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +106 -0
- package/es/ProForm/components/combination/ProModalSelect/utils/index.d.ts +15 -0
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +3 -0
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +85 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +4 -0
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +8 -0
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +33 -0
- package/es/ProForm/components/index.d.ts +29 -0
- package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/es/ProForm/components/render/ConfirmWrapper.d.ts +10 -0
- package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
- package/es/ProForm/components/render/Render.d.ts +4 -0
- package/es/ProForm/components/render/RenderFields.d.ts +26 -0
- package/es/ProForm/components/render/propsType.d.ts +279 -0
- package/es/ProForm/hooks/useControlled.d.ts +1 -0
- package/es/ProForm/hooks/useDeepCompareMemo.d.ts +2 -0
- package/es/ProForm/hooks/useFieldProps.d.ts +4 -0
- package/es/ProForm/hooks/useForm.d.ts +8 -0
- package/es/ProForm/hooks/useRules.d.ts +16 -0
- package/es/ProForm/hooks/useShouldUpdate.d.ts +31 -0
- package/es/ProForm/hooks/useWatch.d.ts +22 -0
- package/es/ProForm/index.d.ts +6 -0
- package/es/ProForm/propsType.d.ts +143 -0
- package/es/ProForm/utils/buildFormItemProps.d.ts +25 -0
- package/es/ProForm/utils/diffOriginal.d.ts +10 -0
- package/es/ProForm/utils/getDefaultProps.d.ts +1 -0
- package/es/ProForm/utils/index.d.ts +109 -0
- package/es/ProForm/utils/processDependencies.d.ts +29 -0
- package/es/ProForm/utils/reactiveValues.d.ts +33 -0
- package/es/ProForm/utils/rulesCreator.d.ts +7 -0
- package/es/ProForm/utils/transformNames.d.ts +10 -0
- package/es/ProForm/utils/transformValue.d.ts +6 -0
- package/es/ProForm/utils/valueType.d.ts +70 -0
- package/es/ProIcon/config/index.d.ts +19 -0
- package/es/ProIcon/index.d.ts +4 -0
- package/es/ProIcon/propsTypes.d.ts +175 -0
- package/es/ProIcon/utils/index.d.ts +6 -0
- package/es/ProLayout/components/Layout/Header/index.d.ts +4 -0
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +3 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +3 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +15 -0
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.d.ts +3 -0
- package/es/ProLayout/components/Layout/Menu/index.d.ts +4 -0
- package/es/ProLayout/components/Layout/Notice/index.d.ts +4 -0
- package/es/ProLayout/components/Layout/index.d.ts +3 -0
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +98 -0
- package/es/ProLayout/components/ProCollapse/index.d.ts +3 -0
- package/es/ProLayout/components/ProFooter/PropTypes.d.ts +27 -0
- package/es/ProLayout/components/ProFooter/index.d.ts +3 -0
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +206 -0
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +4 -0
- package/es/ProLayout/components/ProHeader/components/Describe/index.d.ts +26 -0
- package/es/ProLayout/components/ProHeader/components/Describe/index.js +106 -0
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.d.ts +9 -0
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.d.ts +4 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +2 -0
- package/es/ProLayout/components/ProHeader/index.d.ts +4 -0
- package/es/ProLayout/components/ProHeader/index.js +54 -118
- package/es/ProLayout/components/ProHeader/utils/index.d.ts +20 -0
- package/es/ProLayout/components/ProHeader/utils/index.js +23 -1
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
- package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +5 -0
- package/es/ProLayout/components/TabsManager/components/TabsHeader.d.ts +10 -0
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.d.ts +25 -0
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
- package/es/ProLayout/components/TabsManager/index.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/index.js +87 -3
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +89 -0
- package/es/ProLayout/components/TabsManager/style/index.less +6 -3
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +47 -0
- package/es/ProLayout/components/index.d.ts +3 -0
- package/es/ProLayout/index.d.ts +19 -0
- package/es/ProLayout/index.js +28 -10
- package/es/ProLayout/propTypes.d.ts +550 -0
- package/es/ProLayout/style/index.less +32 -0
- package/es/ProLayout/utils/index.d.ts +43 -0
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProSelect/index.d.ts +5 -0
- package/es/ProSelect/propsType.d.ts +162 -0
- package/es/ProSelect/utils/index.d.ts +86 -0
- package/es/ProStep/components/Anchor/index.d.ts +4 -0
- package/es/ProStep/components/Item/index.d.ts +4 -0
- package/es/ProStep/components/LazyLoad/index.d.ts +19 -0
- package/es/ProStep/components/Listener/index.d.ts +4 -0
- package/es/ProStep/components/Step/index.d.ts +5 -0
- package/es/ProStep/index.d.ts +11 -0
- package/es/ProStep/propsType.d.ts +224 -0
- package/es/ProStep/utils/index.d.ts +22 -0
- package/es/ProStepTab/index.d.ts +22 -0
- package/es/ProStepTab/propsType.d.ts +114 -0
- package/es/ProTable/components/EditableCell/EditIcon.d.ts +6 -0
- package/es/ProTable/components/EditableCell/index.d.ts +4 -0
- package/es/ProTable/components/EditableCell/propsType.d.ts +24 -0
- package/es/ProTable/components/FormatColumn/index.d.ts +22 -0
- package/es/ProTable/components/FormatColumn/propsType.d.ts +29 -0
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +2 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +18 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.d.ts +8 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.d.ts +61 -0
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +2 -0
- package/es/ProTable/components/RcTable/index.d.ts +4 -0
- package/es/ProTable/components/RenderColumn/index.d.ts +22 -0
- package/es/ProTable/components/RenderEmptyText/index.d.ts +3 -0
- package/es/ProTable/components/RenderFooter/index.d.ts +2 -0
- package/es/ProTable/components/RenderSummary/index.d.ts +3 -0
- package/es/ProTable/components/RenderTableHeader/index.d.ts +2 -0
- package/es/ProTable/components/RenderTabs/index.d.ts +3 -0
- package/es/ProTable/components/TableResizable/index.d.ts +13 -0
- package/es/ProTable/components/TooltipTitle/index.d.ts +11 -0
- package/es/ProTable/components/index.d.ts +31 -0
- package/es/ProTable/hooks/useAntdTable.d.ts +7 -0
- package/es/ProTable/index.d.ts +17 -0
- package/es/ProTable/propsType.d.ts +805 -0
- package/es/ProTable/utils/columnStorage.d.ts +35 -0
- package/es/ProTable/utils/index.d.ts +52 -0
- package/es/ProTabs/components/Card/index.d.ts +3 -0
- package/es/ProTabs/components/index.d.ts +1 -0
- package/es/ProTabs/index.d.ts +4 -0
- package/es/ProTabs/propType.d.ts +94 -0
- package/es/ProThemeTools/component/ProTools/index.d.ts +3 -0
- package/es/ProThemeTools/component/index.d.ts +1 -0
- package/es/ProThemeTools/context/ThemeContext.d.ts +43 -0
- package/es/ProThemeTools/index.d.ts +9 -0
- package/es/ProThemeTools/propsType.d.ts +170 -0
- package/es/ProThemeTools/utils/index.d.ts +51 -0
- package/es/ProTooltip/index.d.ts +3 -0
- package/es/ProTooltip/propsType.d.ts +57 -0
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/CloseIcon.d.ts +2 -0
- package/es/ProTree/components/List.d.ts +17 -0
- package/es/ProTree/components/ProTree.d.ts +3 -0
- package/es/ProTree/components/ProTreeSelect/index.d.ts +5 -0
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +445 -0
- package/es/ProTree/components/SearchTitle.d.ts +10 -0
- package/es/ProTree/components/Tree.d.ts +27 -0
- package/es/ProTree/components/index.d.ts +4 -0
- package/es/ProTree/index.d.ts +3 -0
- package/es/ProTree/propsType.d.ts +818 -0
- package/es/ProTree/utils.d.ts +62 -0
- package/es/ProTreeModal/components/Cascader.d.ts +14 -0
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -0
- package/es/ProTreeModal/components/List.d.ts +21 -0
- package/es/ProTreeModal/components/SearchTitle.d.ts +6 -0
- package/es/ProTreeModal/components/SortableItem.d.ts +12 -0
- package/es/ProTreeModal/components/Tree.d.ts +25 -0
- package/es/ProTreeModal/components/Trigger.d.ts +21 -0
- package/es/ProTreeModal/components/index.d.ts +6 -0
- package/es/ProTreeModal/index.d.ts +4 -0
- package/es/ProTreeModal/propsType.d.ts +298 -0
- package/es/ProTreeModal/utils.d.ts +39 -0
- package/es/ProUpload/components/ButtonRender.d.ts +20 -0
- package/es/ProUpload/components/DragRender.d.ts +21 -0
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +2 -0
- package/es/ProUpload/components/Example.d.ts +10 -0
- package/es/ProUpload/components/FileItem.d.ts +33 -0
- package/es/ProUpload/components/ImageRender.d.ts +19 -0
- package/es/ProUpload/index.d.ts +4 -0
- package/es/ProUpload/propsType.d.ts +264 -0
- package/es/ProUpload/uitls.d.ts +3 -0
- package/es/ProUtils/utils/index.d.ts +6 -0
- package/es/ProViewer/index.d.ts +4 -0
- package/es/ProViewer/propsType.d.ts +37 -0
- package/es/ProWaterMark/index.d.ts +4 -0
- package/es/ProWaterMark/propsType.d.ts +6 -0
- package/es/hooks/useDraggableRow.d.ts +34 -0
- package/es/index.d.ts +57 -0
- package/es/index.js +0 -2
- package/es/locale/en_US.d.ts +176 -0
- package/es/locale/index.d.ts +15 -0
- package/es/locale/zh_CN.d.ts +176 -0
- package/es/tokens.d.ts +83 -0
- package/es/utils/index.d.ts +24 -0
- package/package.json +12 -2
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { MenuProps } from 'antd';
|
|
3
|
+
import { TabsState, MenusType, DataSourceType, TabsConfig, AddTabOptions, TabItem, UpdateTabParams } from '../../propTypes';
|
|
4
|
+
export interface TabsManagerProps {
|
|
5
|
+
/** 标签页配置 */
|
|
6
|
+
config: TabsConfig;
|
|
7
|
+
/** 子元素内容 */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** 菜单数据源 */
|
|
10
|
+
dataSource: DataSourceType | Partial<MenusType>;
|
|
11
|
+
/** 原始菜单点击处理 */
|
|
12
|
+
originalOnMenuClick?: (params: {
|
|
13
|
+
item: MenusType | null;
|
|
14
|
+
key: string;
|
|
15
|
+
keyPath: string[];
|
|
16
|
+
}) => void;
|
|
17
|
+
/** Tab 栏的 Portal 挂载目标(由 ProLayout 提供),不传则原位渲染 */
|
|
18
|
+
tabsBarContainer?: HTMLElement | null;
|
|
19
|
+
/** Tab 有无变化回调,供 ProLayout 控制 wrapper 动画 */
|
|
20
|
+
onTabsChange?: (hasTabs: boolean) => void;
|
|
21
|
+
/** iframe pure 模式变化回调,供 ProLayout 决定是否隐藏外壳 */
|
|
22
|
+
onIframePureChange?: (pure: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface TabContextMenuProps {
|
|
25
|
+
tabId: string;
|
|
26
|
+
children: React.ReactElement;
|
|
27
|
+
closable?: boolean;
|
|
28
|
+
onClose: (tabId: string) => void;
|
|
29
|
+
onCloseOthers: (tabId: string) => void;
|
|
30
|
+
onCloseRight: (tabId: string) => void;
|
|
31
|
+
onCloseAll: () => void;
|
|
32
|
+
/** 自定义菜单项,会与默认菜单项合并 */
|
|
33
|
+
menuItems?: MenuProps['items'];
|
|
34
|
+
/** 自定义菜单项点击回调 */
|
|
35
|
+
tabMenuClick?: (params: {
|
|
36
|
+
key: string;
|
|
37
|
+
tab: TabItem;
|
|
38
|
+
tabs: TabItem[];
|
|
39
|
+
}) => void;
|
|
40
|
+
/** 当前标签页信息 */
|
|
41
|
+
tab?: TabItem;
|
|
42
|
+
/** 所有标签页列表 */
|
|
43
|
+
tabs?: TabItem[];
|
|
44
|
+
}
|
|
45
|
+
export interface UseTabsStateOptions {
|
|
46
|
+
/** 初始状态 */
|
|
47
|
+
initialState?: Partial<TabsState>;
|
|
48
|
+
/** 配置 */
|
|
49
|
+
config: TabsManagerProps['config'];
|
|
50
|
+
/** 数据源 */
|
|
51
|
+
dataSource?: TabsManagerProps['dataSource'];
|
|
52
|
+
/** 是否启用缓存(读+写),默认 true。iframe pure 模式下传 false */
|
|
53
|
+
cacheEnabled?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface UseTabsStateReturn {
|
|
56
|
+
/** 当前状态 */
|
|
57
|
+
state: TabsState;
|
|
58
|
+
/** 缓存是否已恢复完成 */
|
|
59
|
+
isInitialized: boolean;
|
|
60
|
+
/** 添加标签页 */
|
|
61
|
+
addTab: (menuItem: MenusType, options?: AddTabOptions) => void;
|
|
62
|
+
/** 检查是否可以添加标签页 */
|
|
63
|
+
canAddTab: (menuItem: MenusType, options?: AddTabOptions) => boolean;
|
|
64
|
+
/** 移除标签页 */
|
|
65
|
+
removeTab: (tabId: string) => void;
|
|
66
|
+
/** 更新指定 id 的标签页字段(替换语义;找不到时 no-op) */
|
|
67
|
+
updateTab: (tabId: string, updates: UpdateTabParams) => void;
|
|
68
|
+
/** 切换标签页 */
|
|
69
|
+
switchTab: (tabId: string) => void;
|
|
70
|
+
/** 关闭其他标签页 */
|
|
71
|
+
closeOtherTabs: (currentTabId: string) => void;
|
|
72
|
+
/** 关闭右侧标签页 */
|
|
73
|
+
closeRightTabs: (currentTabId: string) => void;
|
|
74
|
+
/** 关闭全部标签页 */
|
|
75
|
+
closeAllTabs: () => void;
|
|
76
|
+
/** 重置状态 */
|
|
77
|
+
resetTabs: () => void;
|
|
78
|
+
/** 重排标签页顺序 */
|
|
79
|
+
reorderTabs: (activeId: string, overId: string) => void;
|
|
80
|
+
}
|
|
81
|
+
export interface TabsCacheManager {
|
|
82
|
+
save: (state: TabsState) => void;
|
|
83
|
+
restore: () => TabsState | null;
|
|
84
|
+
clear: () => void;
|
|
85
|
+
}
|
|
86
|
+
export declare const DEFAULT_TABS_CONFIG: {
|
|
87
|
+
storage: "localStorage";
|
|
88
|
+
cacheKey: string;
|
|
89
|
+
};
|
|
@@ -84,10 +84,13 @@
|
|
|
84
84
|
margin: 0;
|
|
85
85
|
padding: 0;
|
|
86
86
|
border-bottom: none;
|
|
87
|
+
}
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
// 横线右端缩短,空出圆角半径,让横线在圆弧起点处结束
|
|
90
|
+
// 用属性选择器提升权重,确保覆盖 antd :where() 规则
|
|
91
|
+
.@{ant-prefix}-tabs-nav[class]::before {
|
|
92
|
+
right: var(--zaui-border-radius, 8px) !important;
|
|
93
|
+
left: 0 !important;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
// 覆盖 nav-list 样式,使其匹配 pro-layout-tab-list
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { TabItem, MenusType } from '../../../propTypes';
|
|
2
|
+
/**
|
|
3
|
+
* 获取菜单实际用于路由/签页的路径
|
|
4
|
+
* 约定优先使用 redirectUrl,其次回退 url
|
|
5
|
+
*/
|
|
6
|
+
export declare const getMenuRoute: (menuItem: MenusType) => string;
|
|
7
|
+
/**
|
|
8
|
+
* 根据菜单项生成TabItem
|
|
9
|
+
*/
|
|
10
|
+
export declare const createTabFromMenu: (menuItem: MenusType, index?: number) => TabItem;
|
|
11
|
+
/**
|
|
12
|
+
* 生成唯一的tab ID
|
|
13
|
+
*/
|
|
14
|
+
export declare const generateTabId: (menuItem: MenusType, existingIds: string[]) => string;
|
|
15
|
+
/**
|
|
16
|
+
* 检查菜单项是否应该外部跳转
|
|
17
|
+
*/
|
|
18
|
+
export declare const shouldOpenExternal: (menuItem: MenusType, target?: string) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 处理外部跳转
|
|
21
|
+
*/
|
|
22
|
+
export declare const handleExternalOpen: (menuItem: MenusType) => void;
|
|
23
|
+
/**
|
|
24
|
+
* 检查是否超出最大标签页限制
|
|
25
|
+
* @param currentTabs 当前标签页列表
|
|
26
|
+
* @param maxTabs 最大标签页数量,如果为 undefined 或 null,表示无限制
|
|
27
|
+
* @returns 如果超出限制返回 true,否则返回 false
|
|
28
|
+
*/
|
|
29
|
+
export declare const checkTabLimit: (currentTabs: TabItem[], maxTabs?: number | null) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 获取右侧标签页
|
|
32
|
+
*/
|
|
33
|
+
export declare const getRightTabs: (tabs: TabItem[], currentTabId: string) => TabItem[];
|
|
34
|
+
/**
|
|
35
|
+
* 扁平化菜单数据
|
|
36
|
+
*/
|
|
37
|
+
export declare const flattenMenuData: (menus?: MenusType[]) => MenusType[];
|
|
38
|
+
/**
|
|
39
|
+
* 判断菜单项是否为最后一级(叶子节点)
|
|
40
|
+
* 只有当菜单项没有子菜单或子菜单为空时,才认为是叶子节点
|
|
41
|
+
*/
|
|
42
|
+
export declare const isLeafMenuItem: (menuItem: MenusType) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 判断菜单项是否可以在 Tabs 模式下打开
|
|
45
|
+
* 规则:只有叶子节点(无 children)才可打开
|
|
46
|
+
*/
|
|
47
|
+
export declare const canOpenAsTab: (menuItem: MenusType) => boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProLayoutStatesType, ProLayoutType } from './propTypes';
|
|
2
|
+
import { useProLayoutTabs } from './components/TabsManager/hooks/useProLayoutTabs';
|
|
3
|
+
import { useActiveTab } from './components/TabsManager/hooks/useActiveTab';
|
|
4
|
+
interface LayoutContextValue {
|
|
5
|
+
selectedPath: string;
|
|
6
|
+
onSelected: (params: Partial<ProLayoutStatesType>) => void;
|
|
7
|
+
target: '_blank' | '_parent' | '_self' | '_top';
|
|
8
|
+
}
|
|
9
|
+
export declare const LayoutContext: import("react").Context<LayoutContextValue>;
|
|
10
|
+
declare const ProLayout: {
|
|
11
|
+
(props: ProLayoutType): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
ProCollapse: (props: import("../index").ProCollapseType) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
ProFooter: import("react").MemoExoticComponent<(props: import("../index").ProFooterType) => import("react/jsx-runtime").JSX.Element>;
|
|
14
|
+
ProHeader: import("react").MemoExoticComponent<(props: import("../index").ProHeaderType) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
useProLayoutTabs: typeof useProLayoutTabs;
|
|
16
|
+
useActiveTab: () => import("./propTypes").TabItem | undefined;
|
|
17
|
+
};
|
|
18
|
+
export { useProLayoutTabs, useActiveTab };
|
|
19
|
+
export default ProLayout;
|
package/es/ProLayout/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable func-call-spacing */
|
|
2
2
|
/* eslint-disable no-spaced-func */
|
|
3
|
-
import { createContext, useMemo, useRef, useCallback
|
|
3
|
+
import { createContext, useMemo, useRef, useCallback } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import { useSetState, useToggle, useDeepCompareEffect } from 'ahooks';
|
|
5
|
+
import { useSetState, useToggle, useDeepCompareEffect, useScroll } from 'ahooks';
|
|
6
6
|
import { ProWaterMark } from "../index";
|
|
7
7
|
import { ProCollapse, ProFooter, ProHeader } from "./components";
|
|
8
8
|
import { Header, Notice, Menu } from "./components/Layout/index";
|
|
@@ -53,10 +53,24 @@ const ProLayout = props => {
|
|
|
53
53
|
const tabsManagerRef = useRef(null);
|
|
54
54
|
|
|
55
55
|
// Tab 栏 Portal 挂载目标及动画状态
|
|
56
|
-
const [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
const [{
|
|
57
|
+
tabsBarEl,
|
|
58
|
+
hasTabs,
|
|
59
|
+
isIframePure
|
|
60
|
+
}, setTabsState] = useSetState({
|
|
61
|
+
tabsBarEl: null,
|
|
62
|
+
hasTabs: false,
|
|
63
|
+
isIframePure: false
|
|
64
|
+
});
|
|
65
|
+
// 稳定的 ref 回调,避免内联函数每次渲染都触发 setState 导致无限循环
|
|
66
|
+
const setTabsBarElRef = useCallback(el => setTabsState({
|
|
67
|
+
tabsBarEl: el
|
|
68
|
+
}), []);
|
|
69
|
+
|
|
70
|
+
// 仅 tabs 模式需要感知滚动位置(用于控制右上角圆弧伪元素的显隐)
|
|
71
|
+
// 非 tabs 模式传 null,useScroll 不挂载监听器
|
|
72
|
+
const scrollPos = useScroll(isTabsLayout ? document : null);
|
|
73
|
+
const isAtTop = (scrollPos?.top ?? 0) === 0;
|
|
60
74
|
const [{
|
|
61
75
|
notice,
|
|
62
76
|
menus,
|
|
@@ -136,8 +150,12 @@ const ProLayout = props => {
|
|
|
136
150
|
dataSource: menuDataSource,
|
|
137
151
|
originalOnMenuClick: onMenuClick,
|
|
138
152
|
tabsBarContainer: tabsBarEl,
|
|
139
|
-
onTabsChange:
|
|
140
|
-
|
|
153
|
+
onTabsChange: v => setTabsState({
|
|
154
|
+
hasTabs: v
|
|
155
|
+
}),
|
|
156
|
+
onIframePureChange: v => setTabsState({
|
|
157
|
+
isIframePure: v
|
|
158
|
+
}),
|
|
141
159
|
children: children
|
|
142
160
|
});
|
|
143
161
|
};
|
|
@@ -263,8 +281,8 @@ const ProLayout = props => {
|
|
|
263
281
|
}), /*#__PURE__*/_jsx(Notice, {
|
|
264
282
|
...noticeProps
|
|
265
283
|
}), /*#__PURE__*/_jsx("div", {
|
|
266
|
-
ref:
|
|
267
|
-
className: `pro-layout-tabs-bar-wrapper${hasTabs ? ' tabs-visible' : ''}${collapsed ? ' tabs-menu-open' : ''}`,
|
|
284
|
+
ref: setTabsBarElRef,
|
|
285
|
+
className: `pro-layout-tabs-bar-wrapper${hasTabs ? ' tabs-visible' : ''}${collapsed ? ' tabs-menu-open' : ''}${isAtTop ? ' tabs-at-top' : ''}`,
|
|
268
286
|
style: {
|
|
269
287
|
marginTop: effectiveHeaderHeight + noticeHeight
|
|
270
288
|
}
|