@gx-design-vue/pro-layout 0.1.0-alpha.2 → 0.1.0-alpha.21
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/ProLayout.d.ts +4 -536
- package/dist/ProLayout.js +489 -358
- package/dist/components/AppPage/context.d.ts +4 -3
- package/dist/components/AppPage/context.js +3 -5
- package/dist/components/AppPage/index.d.ts +29 -52
- package/dist/components/AppPage/index.js +71 -54
- package/dist/components/AppPage/style.d.ts +8 -7
- package/dist/components/AppPage/style.js +16 -17
- package/dist/components/Breadcrumb/index.d.ts +19 -0
- package/dist/components/Breadcrumb/index.js +129 -0
- package/dist/components/Breadcrumb/interface.d.ts +33 -0
- package/dist/components/Breadcrumb/interface.js +1 -0
- package/dist/components/CollapseButton/Arrow.d.ts +4 -0
- package/dist/components/{SiderMenu → CollapseButton}/Arrow.js +2 -4
- package/dist/components/CollapseButton/index.d.ts +7 -0
- package/dist/components/CollapseButton/index.js +45 -0
- package/dist/components/CollapseButton/interface.d.ts +19 -0
- package/dist/components/CollapseButton/interface.js +1 -0
- package/dist/components/Footer/index.d.ts +10 -0
- package/dist/components/Footer/index.js +69 -0
- package/dist/components/Footer/interface.d.ts +22 -0
- package/dist/components/Footer/interface.js +1 -0
- package/dist/components/FooterToolbar/index.d.ts +5 -72
- package/dist/components/FooterToolbar/index.js +77 -90
- package/dist/components/FooterToolbar/style.d.ts +10 -0
- package/dist/components/FooterToolbar/style.js +34 -0
- package/dist/components/Header/index.d.ts +7 -0
- package/dist/components/Header/index.js +140 -0
- package/dist/components/Header/interface.d.ts +41 -0
- package/dist/components/Header/interface.js +1 -0
- package/dist/components/Logo/index.d.ts +9 -0
- package/dist/components/Logo/index.js +63 -0
- package/dist/components/Logo/interface.d.ts +13 -0
- package/dist/components/Logo/interface.js +1 -0
- package/dist/components/Menu/iconRender.d.ts +10 -0
- package/dist/components/Menu/iconRender.js +23 -0
- package/dist/components/Menu/index.d.ts +13 -0
- package/dist/components/Menu/index.js +778 -0
- package/dist/components/Menu/interface.d.ts +50 -0
- package/dist/components/Menu/interface.js +9 -0
- package/dist/components/Menu/overflow.d.ts +39 -0
- package/dist/components/Menu/overflow.js +81 -0
- package/dist/components/Menu/style/base.d.ts +12 -0
- package/dist/components/Menu/style/base.js +36 -0
- package/dist/components/Menu/style/horizontal.d.ts +19 -0
- package/dist/components/Menu/style/horizontal.js +303 -0
- package/dist/components/Menu/style/index.d.ts +356 -0
- package/dist/components/Menu/style/index.js +147 -0
- package/dist/components/Menu/style/inline.d.ts +13 -0
- package/dist/components/Menu/style/inline.js +292 -0
- package/dist/components/PageContainer/PageHeader.d.ts +30 -36
- package/dist/components/PageContainer/PageHeader.js +80 -46
- package/dist/components/PageContainer/index.d.ts +8 -194
- package/dist/components/PageContainer/index.js +297 -209
- package/dist/components/PageContainer/style.d.ts +5 -0
- package/dist/components/PageContainer/style.js +142 -0
- package/dist/components/PageTransition/animate.d.ts +41 -0
- package/dist/components/PageTransition/animate.js +106 -0
- package/dist/components/PageTransition/index.d.ts +57 -0
- package/dist/components/PageTransition/index.js +66 -0
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/back.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/back.js +2 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/bounce.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/bounce.js +2 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/fade.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/fade.js +2 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/flip.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/flip.js +2 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/lightSpeed.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/lightSpeed.js +2 -4
- package/dist/components/PageTransition/keyFrame/roll.d.ts +10 -0
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/roll.js +2 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/rotate.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/rotate.js +2 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/slide.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/slide.js +2 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/zoom.d.ts +4 -4
- package/dist/components/{PageTranstion → PageTransition}/keyFrame/zoom.js +2 -4
- package/dist/components/PageTransition/style.d.ts +11 -0
- package/dist/components/{PageTranstion → PageTransition}/style.js +9 -13
- package/dist/components/Sider/index.d.ts +7 -0
- package/dist/components/Sider/index.js +206 -0
- package/dist/components/Sider/interface.d.ts +39 -0
- package/dist/components/Sider/interface.js +1 -0
- package/dist/components/Tabs/InnerTabs.d.ts +7 -0
- package/dist/components/Tabs/InnerTabs.js +117 -0
- package/dist/components/Tabs/contextMenu.d.ts +41 -0
- package/dist/components/Tabs/contextMenu.js +89 -0
- package/dist/components/Tabs/hooks/flipAnimate.d.ts +24 -0
- package/dist/components/Tabs/hooks/flipAnimate.js +40 -0
- package/dist/components/Tabs/hooks/useAutoScroll.d.ts +27 -0
- package/dist/components/Tabs/hooks/useAutoScroll.js +122 -0
- package/dist/components/Tabs/hooks/useTabDrag.d.ts +31 -0
- package/dist/components/Tabs/hooks/useTabDrag.js +252 -0
- package/dist/components/Tabs/index.d.ts +13 -0
- package/dist/components/Tabs/index.js +181 -0
- package/dist/components/Tabs/interface.d.ts +74 -0
- package/dist/components/Tabs/interface.js +1 -0
- package/dist/components/Tabs/style/index.d.ts +35 -0
- package/dist/components/Tabs/style/index.js +161 -0
- package/dist/components/WrapContent/index.d.ts +9 -0
- package/dist/components/WrapContent/index.js +26 -0
- package/dist/components/WrapContent/interface.d.ts +15 -0
- package/dist/components/WrapContent/interface.js +1 -0
- package/dist/context/index.d.ts +53 -0
- package/dist/context/index.js +5 -0
- package/dist/defaultConfig.d.ts +10 -0
- package/dist/defaultConfig.js +38 -0
- package/dist/hooks/useLayoutBase.d.ts +78 -0
- package/dist/hooks/useLayoutBase.js +86 -0
- package/dist/hooks/useMenu.d.ts +77 -0
- package/dist/hooks/useMenu.js +166 -0
- package/dist/hooks/useTabs.d.ts +54 -0
- package/dist/hooks/useTabs.js +388 -0
- package/dist/index.d.ts +22 -27
- package/dist/index.js +15 -24
- package/dist/interface.d.ts +516 -0
- package/dist/interface.js +34 -0
- package/dist/pro-layout.esm.js +5848 -5075
- package/dist/pro-layout.js +16 -37
- package/dist/style/breadcrumb.d.ts +8 -0
- package/dist/style/breadcrumb.js +77 -0
- package/dist/style/collapseButton.d.ts +8 -0
- package/dist/style/collapseButton.js +57 -0
- package/dist/style/content.d.ts +8 -0
- package/dist/style/content.js +29 -0
- package/dist/style/footer.d.ts +8 -0
- package/dist/style/footer.js +33 -0
- package/dist/style/header.d.ts +8 -0
- package/dist/style/header.js +76 -0
- package/dist/style/index.d.ts +3 -22
- package/dist/style/index.js +51 -55
- package/dist/style/logo.d.ts +8 -0
- package/dist/style/logo.js +76 -0
- package/dist/style/menu.d.ts +15 -0
- package/dist/style/menu.js +49 -0
- package/dist/style/rightContent.d.ts +12 -0
- package/dist/style/rightContent.js +74 -0
- package/dist/style/search.d.ts +12 -0
- package/dist/style/search.js +94 -0
- package/dist/style/sider.d.ts +8 -0
- package/dist/style/sider.js +92 -0
- package/dist/style/tabs.d.ts +14 -0
- package/dist/style/tabs.js +97 -0
- package/dist/theme/augment.d.ts +20 -0
- package/dist/theme/augment.js +1 -0
- package/dist/theme/interface/components.d.ts +20 -0
- package/dist/theme/interface/components.js +1 -0
- package/dist/utils/config.d.ts +12 -0
- package/dist/utils/config.js +18 -0
- package/dist/utils/menu.d.ts +111 -20
- package/dist/utils/menu.js +263 -118
- package/dist/utils/style.d.ts +4 -0
- package/dist/utils/style.js +21 -0
- package/dist/utils/themeComponents.d.ts +28 -0
- package/dist/utils/themeComponents.js +89 -0
- package/package.json +24 -15
- package/dist/Context/expose.d.ts +0 -6
- package/dist/Context/expose.js +0 -7
- package/dist/Context/index.d.ts +0 -43
- package/dist/Context/index.js +0 -18
- package/dist/WrapContent.d.ts +0 -100
- package/dist/WrapContent.js +0 -45
- package/dist/components/BaseMenu/index.d.ts +0 -255
- package/dist/components/BaseMenu/index.js +0 -381
- package/dist/components/BaseMenu/props.d.ts +0 -105
- package/dist/components/BaseMenu/props.js +0 -94
- package/dist/components/BaseMenu/style.d.ts +0 -6
- package/dist/components/BaseMenu/style.js +0 -155
- package/dist/components/BreadCrumb/Breadcrumb.d.ts +0 -33
- package/dist/components/BreadCrumb/Breadcrumb.js +0 -75
- package/dist/components/BreadCrumb/index.d.ts +0 -7
- package/dist/components/BreadCrumb/index.js +0 -44
- package/dist/components/BreadCrumb/style.d.ts +0 -8
- package/dist/components/BreadCrumb/style.js +0 -87
- package/dist/components/CollapsedIcon/index.d.ts +0 -33
- package/dist/components/CollapsedIcon/index.js +0 -51
- package/dist/components/CollapsedIcon/style.d.ts +0 -9
- package/dist/components/CollapsedIcon/style.js +0 -34
- package/dist/components/FooterToolbar/props.d.ts +0 -47
- package/dist/components/FooterToolbar/props.js +0 -33
- package/dist/components/FooterToolbar/style/index.d.ts +0 -14
- package/dist/components/FooterToolbar/style/index.js +0 -48
- package/dist/components/FooterToolbar/style/stylish.d.ts +0 -18
- package/dist/components/FooterToolbar/style/stylish.js +0 -16
- package/dist/components/GlobalFooter/index.d.ts +0 -73
- package/dist/components/GlobalFooter/index.js +0 -77
- package/dist/components/GlobalFooter/style.d.ts +0 -6
- package/dist/components/GlobalFooter/style.js +0 -29
- package/dist/components/GlobalHeader/DefaultHeader.d.ts +0 -164
- package/dist/components/GlobalHeader/DefaultHeader.js +0 -149
- package/dist/components/GlobalHeader/index.d.ts +0 -164
- package/dist/components/GlobalHeader/index.js +0 -78
- package/dist/components/GlobalHeader/props.d.ts +0 -70
- package/dist/components/GlobalHeader/props.js +0 -56
- package/dist/components/GlobalHeader/style/defaultHeader.d.ts +0 -6
- package/dist/components/GlobalHeader/style/defaultHeader.js +0 -108
- package/dist/components/GlobalHeader/style/header.d.ts +0 -6
- package/dist/components/GlobalHeader/style/header.js +0 -41
- package/dist/components/LogoContent/index.d.ts +0 -80
- package/dist/components/LogoContent/index.js +0 -90
- package/dist/components/LogoContent/props.d.ts +0 -57
- package/dist/components/LogoContent/props.js +0 -37
- package/dist/components/LogoContent/style.d.ts +0 -6
- package/dist/components/LogoContent/style.js +0 -63
- package/dist/components/PageContainer/props.d.ts +0 -138
- package/dist/components/PageContainer/props.js +0 -103
- package/dist/components/PageContainer/style/index.d.ts +0 -14
- package/dist/components/PageContainer/style/index.js +0 -52
- package/dist/components/PageContainer/style/pageHeader.d.ts +0 -6
- package/dist/components/PageContainer/style/pageHeader.js +0 -44
- package/dist/components/PageTranstion/index.d.ts +0 -40
- package/dist/components/PageTranstion/index.js +0 -71
- package/dist/components/PageTranstion/keyFrame/roll.d.ts +0 -10
- package/dist/components/PageTranstion/style.d.ts +0 -10
- package/dist/components/SiderMenu/Arrow.d.ts +0 -6
- package/dist/components/SiderMenu/SiderMenu.d.ts +0 -180
- package/dist/components/SiderMenu/SiderMenu.js +0 -265
- package/dist/components/SiderMenu/index.d.ts +0 -193
- package/dist/components/SiderMenu/index.js +0 -51
- package/dist/components/SiderMenu/props.d.ts +0 -77
- package/dist/components/SiderMenu/props.js +0 -67
- package/dist/components/SiderMenu/style/index.d.ts +0 -12
- package/dist/components/SiderMenu/style/index.js +0 -162
- package/dist/components/SiderMenu/typings.d.ts +0 -38
- package/dist/components/SiderMenu/typings.js +0 -1
- package/dist/components/TabsRoute/index.d.ts +0 -95
- package/dist/components/TabsRoute/index.js +0 -405
- package/dist/components/TabsRoute/props.d.ts +0 -78
- package/dist/components/TabsRoute/props.js +0 -47
- package/dist/components/TabsRoute/style.d.ts +0 -15
- package/dist/components/TabsRoute/style.js +0 -133
- package/dist/components/TabsRoute/utils/config.d.ts +0 -18
- package/dist/components/TabsRoute/utils/config.js +0 -64
- package/dist/config/animate.d.ts +0 -11
- package/dist/config/animate.js +0 -76
- package/dist/config/index.d.ts +0 -34
- package/dist/config/index.js +0 -30
- package/dist/hooks/collapsed/index.d.ts +0 -15
- package/dist/hooks/collapsed/index.js +0 -50
- package/dist/hooks/layout/useLayoutExpose.d.ts +0 -15
- package/dist/hooks/layout/useLayoutExpose.js +0 -22
- package/dist/hooks/layout/usePageContent.d.ts +0 -6
- package/dist/hooks/layout/usePageContent.js +0 -28
- package/dist/hooks/menu/context.d.ts +0 -21
- package/dist/hooks/menu/context.js +0 -7
- package/dist/hooks/menu/index.d.ts +0 -29
- package/dist/hooks/menu/index.js +0 -118
- package/dist/hooks/theme/index.d.ts +0 -11
- package/dist/hooks/theme/index.js +0 -13
- package/dist/props/collapsedProps.d.ts +0 -39
- package/dist/props/collapsedProps.js +0 -45
- package/dist/props/defaultSettings.d.ts +0 -62
- package/dist/props/defaultSettings.js +0 -56
- package/dist/props/index.d.ts +0 -226
- package/dist/props/index.js +0 -109
- package/dist/props/themeProps.d.ts +0 -14
- package/dist/props/themeProps.js +0 -10
- package/dist/types/Breadcrumb.d.ts +0 -22
- package/dist/types/Breadcrumb.js +0 -1
- package/dist/types/MenuTypings.d.ts +0 -46
- package/dist/types/MenuTypings.js +0 -1
- package/dist/types/RouteTypings.d.ts +0 -96
- package/dist/types/RouteTypings.js +0 -1
- package/dist/types/SlotsTypings.d.ts +0 -124
- package/dist/types/SlotsTypings.js +0 -32
- package/dist/types/typings.d.ts +0 -73
- package/dist/types/typings.js +0 -3
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.js +0 -17
- package/dist/utils/style/index.d.ts +0 -44
- package/dist/utils/style/index.js +0 -103
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { setAlpha } from "@gx-design-vue/pro-provider";
|
|
2
|
+
//#region src/style/rightContent.ts
|
|
3
|
+
/**
|
|
4
|
+
* RightContent 操作区样式
|
|
5
|
+
* - 注册在 ProLayout 下,使用 ProLayout 扁平 token
|
|
6
|
+
*/
|
|
7
|
+
const genRightContentStyle = (token) => {
|
|
8
|
+
return { [`${token.componentCls}-right-content`]: {
|
|
9
|
+
height: "100%",
|
|
10
|
+
"&-header-actions": {
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "flex-end",
|
|
14
|
+
height: "100%",
|
|
15
|
+
gap: token.paddingXS,
|
|
16
|
+
"&-item": {
|
|
17
|
+
display: "inline-flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
paddingBlock: 0,
|
|
21
|
+
paddingInline: 2,
|
|
22
|
+
color: token.headerColorTextRightActionsItem,
|
|
23
|
+
fontSize: 14,
|
|
24
|
+
cursor: "pointer",
|
|
25
|
+
borderRadius: token.borderRadius,
|
|
26
|
+
[`.anticon`]: {
|
|
27
|
+
color: token.headerColorTextRightActionsItem,
|
|
28
|
+
transition: `color ${token.motionDurationMid}, background-color ${token.motionDurationMid}`,
|
|
29
|
+
"&:hover": { color: token.headerColorTextRightActionsItemHover }
|
|
30
|
+
},
|
|
31
|
+
[`&${token.componentCls}-right-content-header-actions-theme`]: { [`${token.componentCls}-right-content-header-actions-icon`]: {
|
|
32
|
+
paddingInline: 4,
|
|
33
|
+
paddingBlock: 4,
|
|
34
|
+
fontSize: 18
|
|
35
|
+
} },
|
|
36
|
+
"> *": {
|
|
37
|
+
paddingInline: 6,
|
|
38
|
+
paddingBlock: 6,
|
|
39
|
+
borderRadius: token.borderRadius,
|
|
40
|
+
transition: `color ${token.motionDurationMid}, background-color ${token.motionDurationMid}`,
|
|
41
|
+
"&:hover": {
|
|
42
|
+
color: token.headerColorTextRightActionsItemHover,
|
|
43
|
+
backgroundColor: token.headerColorBgRightActionsItemHover
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
[`&>${token.antCls}-dropdown-trigger`]: {
|
|
48
|
+
color: token.colorTextTertiary,
|
|
49
|
+
paddingInline: 8,
|
|
50
|
+
paddingBlock: 8,
|
|
51
|
+
cursor: "pointer",
|
|
52
|
+
display: "flex",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
height: 44,
|
|
55
|
+
lineHeight: "44px",
|
|
56
|
+
borderRadius: token.borderRadius,
|
|
57
|
+
"&:hover": { backgroundColor: setAlpha(token.colorTextBase, .03) }
|
|
58
|
+
},
|
|
59
|
+
"&-avatar": {
|
|
60
|
+
display: "inline-flex",
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
justifyContent: "center",
|
|
63
|
+
gap: token.paddingXS,
|
|
64
|
+
paddingInlineStart: token.padding,
|
|
65
|
+
paddingInlineEnd: token.padding,
|
|
66
|
+
cursor: "pointer",
|
|
67
|
+
color: token.headerColorTextRightActionsItem
|
|
68
|
+
},
|
|
69
|
+
"&-name": { color: token.headerColorTextRightActionsItem }
|
|
70
|
+
}
|
|
71
|
+
} };
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
export { genRightContentStyle as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProFullToken } from "@gx-design-vue/pro-provider";
|
|
2
|
+
import { CSSObject } from "@antdv-next/cssinjs";
|
|
3
|
+
import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
4
|
+
|
|
5
|
+
//#region src/style/search.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Search 搜索框样式(RightContent 子组件)
|
|
8
|
+
* - 注册在 ProLayout 下,使用 ProLayout 扁平 token
|
|
9
|
+
*/
|
|
10
|
+
declare const genSearchStyle: GenerateStyle<ProFullToken<'ProLayout'>, CSSObject>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { genSearchStyle as default };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//#region src/style/search.ts
|
|
2
|
+
/**
|
|
3
|
+
* Search 搜索框样式(RightContent 子组件)
|
|
4
|
+
* - 注册在 ProLayout 下,使用 ProLayout 扁平 token
|
|
5
|
+
*/
|
|
6
|
+
const genSearchStyle = (token) => {
|
|
7
|
+
const fontSize = token.menuItemIconSize || token.fontSize;
|
|
8
|
+
return { [`${token.componentCls}-page-search`]: {
|
|
9
|
+
display: "flex",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
height: 36,
|
|
13
|
+
gap: 12,
|
|
14
|
+
cursor: "pointer",
|
|
15
|
+
fontSize: token.fontSizeSM,
|
|
16
|
+
color: token.colorTextTertiary,
|
|
17
|
+
paddingBlock: token.paddingXXS / 2,
|
|
18
|
+
paddingInline: token.paddingXS,
|
|
19
|
+
borderRadius: token.borderRadiusLG * 2,
|
|
20
|
+
backgroundColor: token.headerColorBgRightActionsItemHover,
|
|
21
|
+
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
|
|
22
|
+
">.anticon": {
|
|
23
|
+
fontSize: token.fontSize,
|
|
24
|
+
color: token.colorTextTertiary
|
|
25
|
+
},
|
|
26
|
+
"&-word-icon": {
|
|
27
|
+
padding: "4px 6px",
|
|
28
|
+
lineHeight: `${token.fontSizeSM}px`,
|
|
29
|
+
borderTopLeftRadius: token.borderRadiusSM,
|
|
30
|
+
borderBottomLeftRadius: token.borderRadiusSM,
|
|
31
|
+
borderTopRightRadius: token.borderRadiusLG * 2,
|
|
32
|
+
borderBottomRightRadius: token.borderRadiusLG * 2,
|
|
33
|
+
backgroundColor: token.colorBgContainer
|
|
34
|
+
},
|
|
35
|
+
"&:hover": { color: token.colorTextSecondary },
|
|
36
|
+
"&-modal": {
|
|
37
|
+
"&-footer": {
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: token.marginXS,
|
|
41
|
+
fontSize: 12,
|
|
42
|
+
color: token.colorTextSecondary
|
|
43
|
+
},
|
|
44
|
+
"&-footer-icon": {
|
|
45
|
+
display: "flex",
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
gap: 4
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"&-panel": {
|
|
51
|
+
"&-title": {
|
|
52
|
+
color: token.colorTextQuaternary,
|
|
53
|
+
lineHeight: token.lineHeight,
|
|
54
|
+
marginBlockEnd: token.marginXS
|
|
55
|
+
},
|
|
56
|
+
"&-list": {
|
|
57
|
+
display: "flex",
|
|
58
|
+
flexDirection: "column",
|
|
59
|
+
gap: 12
|
|
60
|
+
},
|
|
61
|
+
"&-item": {
|
|
62
|
+
display: "flex",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
justifyContent: "space-between",
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
fontSize: token.fontSize,
|
|
67
|
+
lineHeight: token.lineHeight,
|
|
68
|
+
padding: token.paddingXS,
|
|
69
|
+
borderRadius: token.borderRadiusLG,
|
|
70
|
+
backgroundColor: token.colorBgContainer,
|
|
71
|
+
transition: `all ${token.motionDurationFast} ${token.motionEaseInOut}`,
|
|
72
|
+
"&-left": {
|
|
73
|
+
display: "flex",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
gap: token.sizeStep,
|
|
76
|
+
">.anticon": { fontSize: `${fontSize}px` }
|
|
77
|
+
},
|
|
78
|
+
"&.active": {
|
|
79
|
+
backgroundColor: token.colorPrimary,
|
|
80
|
+
color: token.colorTextLightSolid
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"&-result": {
|
|
85
|
+
display: "flex",
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
justifyContent: "center",
|
|
88
|
+
paddingBlockStart: 60,
|
|
89
|
+
color: token.colorTextQuaternary
|
|
90
|
+
}
|
|
91
|
+
} };
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { genSearchStyle as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ProFullToken } from "@gx-design-vue/pro-provider";
|
|
2
|
+
import { CSSObject } from "@antdv-next/cssinjs";
|
|
3
|
+
import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
4
|
+
|
|
5
|
+
//#region src/style/sider.d.ts
|
|
6
|
+
declare const genSiderStyle: GenerateStyle<ProFullToken<'ProLayout'>, CSSObject>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { genSiderStyle as default };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//#region src/style/sider.ts
|
|
2
|
+
const genSiderStyle = (token) => {
|
|
3
|
+
const { componentCls, antCls } = token;
|
|
4
|
+
return { [componentCls]: {
|
|
5
|
+
[`${componentCls}-sider`]: {
|
|
6
|
+
position: "relative",
|
|
7
|
+
borderRight: 0,
|
|
8
|
+
zIndex: 105,
|
|
9
|
+
background: token.siderColorMenuBackground || "transparent",
|
|
10
|
+
[`${antCls}-layout-sider-children`]: {
|
|
11
|
+
position: "relative",
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
borderInlineEnd: `1px solid ${token.colorSplit}`,
|
|
15
|
+
background: "transparent"
|
|
16
|
+
},
|
|
17
|
+
"&-children": {
|
|
18
|
+
position: "relative",
|
|
19
|
+
display: "flex",
|
|
20
|
+
flex: 1,
|
|
21
|
+
minHeight: 0,
|
|
22
|
+
height: "100%",
|
|
23
|
+
flexDirection: "column"
|
|
24
|
+
},
|
|
25
|
+
"&-header": {
|
|
26
|
+
paddingBlock: 0,
|
|
27
|
+
paddingInline: 0
|
|
28
|
+
},
|
|
29
|
+
"&-content": {
|
|
30
|
+
position: "relative",
|
|
31
|
+
display: "flex",
|
|
32
|
+
flex: "1 1 0%",
|
|
33
|
+
minHeight: 0,
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
overflow: "hidden"
|
|
36
|
+
},
|
|
37
|
+
[`${componentCls}-sider-content [data-top-shadow]`]: { flex: "1 1 0%" },
|
|
38
|
+
"&-menu-view": {
|
|
39
|
+
paddingInline: token.siderPaddingInlineLayoutMenu || 0,
|
|
40
|
+
paddingBlock: token.siderPaddingBlockLayoutMenu || 0
|
|
41
|
+
},
|
|
42
|
+
[`${componentCls}-sider-content [data-top-shadow="true"] ${componentCls}-sider-menu-container`]: {
|
|
43
|
+
WebkitMaskImage: `linear-gradient(0deg, ${token.colorBgContainer} calc(100% - var(--scroll-shadow-size, 5%)), transparent)`,
|
|
44
|
+
maskImage: `linear-gradient(0deg, ${token.colorBgContainer} calc(100% - var(--scroll-shadow-size, 5%)), transparent)`
|
|
45
|
+
},
|
|
46
|
+
[`${componentCls}-sider-content [data-bottom-shadow="true"] ${componentCls}-sider-menu-container`]: {
|
|
47
|
+
WebkitMaskImage: `linear-gradient(180deg, ${token.colorBgContainer} calc(100% - var(--scroll-shadow-size, 5%)), transparent)`,
|
|
48
|
+
maskImage: `linear-gradient(180deg, ${token.colorBgContainer} calc(100% - var(--scroll-shadow-size, 5%)), transparent)`
|
|
49
|
+
},
|
|
50
|
+
[`${componentCls}-sider-content [data-top-shadow="true"][data-bottom-shadow="true"] ${componentCls}-sider-menu-container`]: {
|
|
51
|
+
WebkitMaskImage: `linear-gradient(
|
|
52
|
+
${token.colorBgContainer},
|
|
53
|
+
${token.colorBgContainer},
|
|
54
|
+
transparent 0,
|
|
55
|
+
${token.colorBgContainer} var(--scroll-shadow-size, 5%),
|
|
56
|
+
${token.colorBgContainer} calc(100% - var(--scroll-shadow-size, 5%)),
|
|
57
|
+
transparent
|
|
58
|
+
)`,
|
|
59
|
+
maskImage: `linear-gradient(
|
|
60
|
+
${token.colorBgContainer},
|
|
61
|
+
${token.colorBgContainer},
|
|
62
|
+
transparent 0,
|
|
63
|
+
${token.colorBgContainer} var(--scroll-shadow-size, 5%),
|
|
64
|
+
${token.colorBgContainer} calc(100% - var(--scroll-shadow-size, 5%)),
|
|
65
|
+
transparent
|
|
66
|
+
)`
|
|
67
|
+
},
|
|
68
|
+
"&-fixed-menu": {
|
|
69
|
+
flexShrink: 0,
|
|
70
|
+
borderTop: `1px solid ${token.colorSplit}`
|
|
71
|
+
},
|
|
72
|
+
"&-footer": {
|
|
73
|
+
paddingBlock: token.paddingXS,
|
|
74
|
+
paddingInline: token.paddingSM,
|
|
75
|
+
flexShrink: 0
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
[`${componentCls}-sider-fixed`]: {
|
|
79
|
+
position: "fixed",
|
|
80
|
+
insetBlockStart: 0,
|
|
81
|
+
insetInlineStart: 0,
|
|
82
|
+
height: "100%"
|
|
83
|
+
},
|
|
84
|
+
[`${componentCls}-mix`]: { [`${componentCls}-sider`]: { borderBlockEnd: "none" } },
|
|
85
|
+
[`${componentCls}-wide`]: { [`${componentCls}-sider`]: {
|
|
86
|
+
position: "sticky",
|
|
87
|
+
borderRadius: token.pageContainerBorderRadius
|
|
88
|
+
} }
|
|
89
|
+
} };
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { genSiderStyle as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProFullToken } from "@gx-design-vue/pro-provider";
|
|
2
|
+
import { CSSObject } from "@antdv-next/cssinjs";
|
|
3
|
+
import { GenerateStyle } from "antdv-next/dist/theme/internal";
|
|
4
|
+
|
|
5
|
+
//#region src/style/tabs.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* LayoutTabs 上层容器样式(标签栏容器 / 标题 / 右侧操作区 / fixed 占位)。
|
|
8
|
+
*
|
|
9
|
+
* 卡片页签本身的样式由 `components/Tabs/style`(InnerTabs)承担;
|
|
10
|
+
* 本文件不再覆盖任何 antdv-next Tabs DOM。
|
|
11
|
+
*/
|
|
12
|
+
declare const genTabsStyle: GenerateStyle<ProFullToken<'ProLayout'>, CSSObject>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { genTabsStyle as default };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
//#region src/style/tabs.ts
|
|
2
|
+
/**
|
|
3
|
+
* LayoutTabs 上层容器样式(标签栏容器 / 标题 / 右侧操作区 / fixed 占位)。
|
|
4
|
+
*
|
|
5
|
+
* 卡片页签本身的样式由 `components/Tabs/style`(InnerTabs)承担;
|
|
6
|
+
* 本文件不再覆盖任何 antdv-next Tabs DOM。
|
|
7
|
+
*/
|
|
8
|
+
const genTabsStyle = (token) => {
|
|
9
|
+
const { componentCls, calc } = token;
|
|
10
|
+
const iconBtnSize = token.controlHeightSM;
|
|
11
|
+
const closeIconBoxSize = token.controlHeightXS;
|
|
12
|
+
const tabsCls = `${componentCls}-tabs`;
|
|
13
|
+
return { [tabsCls]: {
|
|
14
|
+
[`${tabsCls}-content`]: {
|
|
15
|
+
paddingBlock: token.paddingXXS,
|
|
16
|
+
paddingInline: token.paddingSM,
|
|
17
|
+
backgroundColor: token.colorBgContainer,
|
|
18
|
+
borderBlockEnd: `${token.lineWidth} solid ${token.colorBorderSecondary}`,
|
|
19
|
+
position: "relative",
|
|
20
|
+
zIndex: 99,
|
|
21
|
+
transition: `width ${token.motionDurationMid} ${token.motionEaseInOut}`
|
|
22
|
+
},
|
|
23
|
+
"&-title": {
|
|
24
|
+
display: "inline-flex",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
gap: token.marginXXS,
|
|
27
|
+
"&-text": {
|
|
28
|
+
maxWidth: 120,
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
textOverflow: "ellipsis",
|
|
31
|
+
whiteSpace: "nowrap",
|
|
32
|
+
fontSize: token.fontSizeSM
|
|
33
|
+
},
|
|
34
|
+
"&-pin": {
|
|
35
|
+
display: "inline-flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
width: 12,
|
|
39
|
+
height: 12,
|
|
40
|
+
fontSize: 10,
|
|
41
|
+
color: token.colorPrimary
|
|
42
|
+
},
|
|
43
|
+
"&-close": {
|
|
44
|
+
display: "inline-flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
flex: "0 0 auto",
|
|
48
|
+
width: closeIconBoxSize,
|
|
49
|
+
height: closeIconBoxSize,
|
|
50
|
+
padding: 0,
|
|
51
|
+
fontSize: calc(token.fontSizeSM).sub(2).equal(),
|
|
52
|
+
lineHeight: 1,
|
|
53
|
+
color: token.tabsColorCloseIcon,
|
|
54
|
+
borderRadius: token.borderRadiusSM,
|
|
55
|
+
transition: `all ${token.motionDurationMid}`,
|
|
56
|
+
"&:hover": {
|
|
57
|
+
color: token.tabsColorCloseIconHover,
|
|
58
|
+
backgroundColor: token.tabsColorCloseBgHover
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
[`.ant-pro-inner-tabs-tab-active &-close:hover`]: {
|
|
62
|
+
color: token.tabsColorCloseIconActive,
|
|
63
|
+
backgroundColor: token.tabsColorCloseBgActiveHover
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"&-extra": {
|
|
67
|
+
display: "inline-flex",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
gap: token.marginXS,
|
|
70
|
+
marginInlineStart: token.marginSM,
|
|
71
|
+
"&-btn": {
|
|
72
|
+
display: "inline-flex",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
justifyContent: "center",
|
|
75
|
+
width: iconBtnSize,
|
|
76
|
+
height: iconBtnSize,
|
|
77
|
+
fontSize: token.fontSize,
|
|
78
|
+
color: token.colorIcon,
|
|
79
|
+
cursor: "pointer",
|
|
80
|
+
borderRadius: token.borderRadiusSM,
|
|
81
|
+
transition: `all ${token.motionDurationMid}`,
|
|
82
|
+
"&:hover": {
|
|
83
|
+
color: token.colorIconHover,
|
|
84
|
+
backgroundColor: token.colorBgTextHover
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"&-fixed": { [`${tabsCls}-content`]: {
|
|
89
|
+
position: "fixed",
|
|
90
|
+
right: 0,
|
|
91
|
+
zIndex: 99,
|
|
92
|
+
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`
|
|
93
|
+
} }
|
|
94
|
+
} };
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { genTabsStyle as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentToken } from "../components/AppPage/style.js";
|
|
2
|
+
import { ComponentToken as ComponentToken$1 } from "../components/FooterToolbar/style.js";
|
|
3
|
+
import { ComponentToken as ComponentToken$2 } from "../components/Menu/style/index.js";
|
|
4
|
+
import { ComponentToken as ComponentToken$3 } from "../components/PageContainer/style.js";
|
|
5
|
+
import { ComponentToken as ComponentToken$4 } from "../components/PageTransition/style.js";
|
|
6
|
+
import { ComponentToken as ComponentToken$5 } from "../components/Tabs/style/index.js";
|
|
7
|
+
import { ComponentToken as ComponentToken$6 } from "../style/index.js";
|
|
8
|
+
|
|
9
|
+
//#region src/theme/augment.d.ts
|
|
10
|
+
declare module 'antdv-next/dist/theme/interface/components' {
|
|
11
|
+
interface ComponentTokenMap {
|
|
12
|
+
ProLayout?: ComponentToken$6;
|
|
13
|
+
InnerTabs?: ComponentToken$5;
|
|
14
|
+
ProAppPage?: ComponentToken;
|
|
15
|
+
ProMenu?: ComponentToken$2;
|
|
16
|
+
ProFooterToolbar?: ComponentToken$1;
|
|
17
|
+
ProPageContainer?: ComponentToken$3;
|
|
18
|
+
ProPageTransition?: ComponentToken$4;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentToken } from "../../components/AppPage/style.js";
|
|
2
|
+
import { ComponentToken as ComponentToken$1 } from "../../components/FooterToolbar/style.js";
|
|
3
|
+
import { ComponentToken as ComponentToken$2 } from "../../components/Menu/style/index.js";
|
|
4
|
+
import { ComponentToken as ComponentToken$3 } from "../../components/PageContainer/style.js";
|
|
5
|
+
import { ComponentToken as ComponentToken$4 } from "../../components/PageTransition/style.js";
|
|
6
|
+
import { ComponentToken as ComponentToken$5 } from "../../components/Tabs/style/index.js";
|
|
7
|
+
import { ComponentToken as ComponentToken$6 } from "../../style/index.js";
|
|
8
|
+
|
|
9
|
+
//#region src/theme/interface/components.d.ts
|
|
10
|
+
interface ComponentTokenMap {
|
|
11
|
+
ProLayout?: ComponentToken$6;
|
|
12
|
+
InnerTabs?: ComponentToken$5;
|
|
13
|
+
ProAppPage?: ComponentToken;
|
|
14
|
+
ProMenu?: ComponentToken$2;
|
|
15
|
+
ProFooterToolbar?: ComponentToken$1;
|
|
16
|
+
ProPageContainer?: ComponentToken$3;
|
|
17
|
+
ProPageTransition?: ComponentToken$4;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ComponentTokenMap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/utils/config.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize layout section config:
|
|
4
|
+
* - `false` disables the section and returns `null`.
|
|
5
|
+
* - `undefined` uses defaults.
|
|
6
|
+
* - objects are shallow-merged over defaults.
|
|
7
|
+
*
|
|
8
|
+
* This is layout-domain behavior, not a shared pro-utils primitive.
|
|
9
|
+
*/
|
|
10
|
+
declare function normalizeSectionConfig<T extends object>(config: Partial<T> | false | undefined, defaults: Partial<T>): T | null;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { normalizeSectionConfig };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/utils/config.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize layout section config:
|
|
4
|
+
* - `false` disables the section and returns `null`.
|
|
5
|
+
* - `undefined` uses defaults.
|
|
6
|
+
* - objects are shallow-merged over defaults.
|
|
7
|
+
*
|
|
8
|
+
* This is layout-domain behavior, not a shared pro-utils primitive.
|
|
9
|
+
*/
|
|
10
|
+
function normalizeSectionConfig(config, defaults) {
|
|
11
|
+
if (config === false) return null;
|
|
12
|
+
return {
|
|
13
|
+
...defaults,
|
|
14
|
+
...config ?? {}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { normalizeSectionConfig };
|
package/dist/utils/menu.d.ts
CHANGED
|
@@ -1,24 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RecordType } from "@gx-design-vue/pro-utils";
|
|
1
|
+
import { BreadcrumbItemType, LayoutMenuRoute, Meta } from "../interface.js";
|
|
3
2
|
|
|
4
3
|
//#region src/utils/menu.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 菜单数据层(纯函数)。
|
|
6
|
+
*
|
|
7
|
+
* 设计原则:
|
|
8
|
+
* - **不可变**:所有变换都返回新对象,绝不修改入参(源路由可被外部冻结)。
|
|
9
|
+
* - **零响应式**:`buildMenuLookup` 产出的路由用 `markRaw` 标记,避免大菜单树被 Vue 深度代理,
|
|
10
|
+
* 这是旧实现内存增长 / 卡顿的根因。
|
|
11
|
+
* - **查询 O(1)/O(depth)**:用 `Map<name, entry>` + `parentNames` 替代旧的 `key="0-1-2"` 字符串切割。
|
|
12
|
+
* - **只产路由分支**:数据层只输出清洗 / 排序 / 切分后的 `LayoutMenuRoute[]`;
|
|
13
|
+
* route → antdv-next `MenuItemType` 的转换交给 `ProMenu` 组件自洽完成。
|
|
14
|
+
*/
|
|
15
|
+
/** 扁平查找项:route 为 markRaw 的源路由,parentNames 为根→直接父(含序、不含自身)。 */
|
|
16
|
+
interface MenuLookupEntry {
|
|
17
|
+
route: LayoutMenuRoute;
|
|
18
|
+
parentNames: string[];
|
|
19
|
+
path: number[];
|
|
10
20
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/** 一次构建产出的菜单模型。 */
|
|
22
|
+
interface MenuModel {
|
|
23
|
+
/** 清洗 + 排序后的不可变菜单树 */
|
|
24
|
+
menus: LayoutMenuRoute[];
|
|
25
|
+
/** 深度优先、按 name 去重的扁平列表(markRaw) */
|
|
26
|
+
flatMenus: LayoutMenuRoute[];
|
|
27
|
+
/** name → 查找项 */
|
|
28
|
+
lookup: Map<string, MenuLookupEntry>;
|
|
29
|
+
}
|
|
30
|
+
/** `resolveRouteTarget` 的解析结果。 */
|
|
31
|
+
interface ResolveRouteResult {
|
|
32
|
+
type: 'internal' | 'external';
|
|
33
|
+
/** 内部跳转目标路径 */
|
|
34
|
+
path?: string;
|
|
35
|
+
/** 外链地址(linkStatus===1 且为合法 url) */
|
|
36
|
+
link?: string;
|
|
37
|
+
route?: LayoutMenuRoute;
|
|
38
|
+
}
|
|
39
|
+
type MenuRoutePatch = Partial<LayoutMenuRoute>;
|
|
40
|
+
type MenuMetaPatch = Partial<Meta>;
|
|
41
|
+
interface MenuTreeMutationOptions {
|
|
42
|
+
normalize?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 从 vue-router 的扁平路由表中提取菜单数据源:取根路由(`name==='root'` 或 `path==='/'`)的子级。
|
|
46
|
+
* 替代旧 `getMenuData` 内的 `childrenRoute` 提取逻辑。
|
|
47
|
+
*/
|
|
48
|
+
declare function routesToMenus(routerRoutes: readonly LayoutMenuRoute[]): LayoutMenuRoute[];
|
|
49
|
+
/**
|
|
50
|
+
* 清洗菜单树(不可变)。替代旧 `clearMenuItem` + `handleMenuData` 的隐藏继承块。
|
|
51
|
+
* - 丢弃无 `name` 的项;
|
|
52
|
+
* - 丢弃重复 `name`(保留首个,重复项汇总 `console.warn` 一次);
|
|
53
|
+
* - `meta.hideChildrenInMenu` 的节点剥掉 `children`;
|
|
54
|
+
* - `hideInMenu` 继承:父 `hideInMenu` / `hideChildrenInMenu` → 子项 `meta.hideInMenu = true`。
|
|
55
|
+
*/
|
|
56
|
+
declare function cleanMenus(menus: LayoutMenuRoute[]): LayoutMenuRoute[];
|
|
57
|
+
/**
|
|
58
|
+
* 按 `meta.order` 升序排序(不可变、稳定)。替代旧 `handleMenuData` 的 order 兜底 + `.sort`。
|
|
59
|
+
* 缺省 order 使用原始索引,保证未配置 order 时维持原顺序。
|
|
60
|
+
*/
|
|
61
|
+
declare function sortMenusByOrder(menus: LayoutMenuRoute[]): LayoutMenuRoute[];
|
|
62
|
+
declare function normalizeMenus(menus: LayoutMenuRoute[]): LayoutMenuRoute[];
|
|
63
|
+
/**
|
|
64
|
+
* 构建扁平列表 + name 查找表。替代旧 `getMenuData` 的 `flatMenus`/`menuMap`
|
|
65
|
+
* (去掉 `key="0-1-2"`、`omit`、`path.replace` 等副作用)。
|
|
66
|
+
* 每个 route 用 `markRaw` 标记,避免进入 Vue 响应式系统。
|
|
67
|
+
*/
|
|
68
|
+
declare function buildMenuLookup(menus: LayoutMenuRoute[]): {
|
|
69
|
+
flatMenus: LayoutMenuRoute[];
|
|
70
|
+
lookup: Map<string, MenuLookupEntry>;
|
|
71
|
+
};
|
|
72
|
+
declare function updateMenuAtPath(menus: LayoutMenuRoute[], path: number[], updater: MenuRoutePatch | ((route: LayoutMenuRoute) => LayoutMenuRoute)): LayoutMenuRoute[];
|
|
73
|
+
declare function updateMenuMetaAtPath(menus: LayoutMenuRoute[], path: number[], updater: MenuMetaPatch | ((meta: Meta) => Meta)): LayoutMenuRoute[];
|
|
74
|
+
declare function insertMenuAtPath(menus: LayoutMenuRoute[], parentPath: number[] | undefined, menu: LayoutMenuRoute, index?: number): LayoutMenuRoute[];
|
|
75
|
+
declare function removeMenuAtPath(menus: LayoutMenuRoute[], path: number[]): LayoutMenuRoute[];
|
|
76
|
+
declare function collectMenuNames(route: LayoutMenuRoute | undefined): string[];
|
|
77
|
+
/**
|
|
78
|
+
* 解析当前路由的匹配链(根→自身)。替代 `getMatchedList` + `getParentKeys` + `handlePathKey`,
|
|
79
|
+
* 用 `parentNames` 直接取链,无字符串切割。
|
|
80
|
+
* - `meta.menuSelectKey` 会把匹配目标重定向到指定菜单;
|
|
81
|
+
* - 过滤 `hideInMenu` 的祖先;
|
|
82
|
+
* - 未知 name 或目标自身 `hideInMenu` 返回 `[]`。
|
|
83
|
+
*/
|
|
84
|
+
declare function resolveMatchedChain(lookup: Map<string, MenuLookupEntry>, name: string | undefined): LayoutMenuRoute[];
|
|
85
|
+
/**
|
|
86
|
+
* 取第一个可见叶子的跳转路径(不可变、仅依据 `hideInMenu`)。
|
|
87
|
+
* 用于父级菜单 / 面包屑的默认跳转目标。
|
|
88
|
+
*/
|
|
89
|
+
declare function getLastPath(menus: LayoutMenuRoute[]): string;
|
|
90
|
+
/**
|
|
91
|
+
* 基于匹配链构建面包屑路由数组(仅保留有标题的项)。
|
|
92
|
+
* `menuSelectKey` 场景下把当前真实路由追加到链尾(对齐旧行为)。
|
|
93
|
+
*/
|
|
94
|
+
declare function buildBreadcrumbRoutes(chain: LayoutMenuRoute[], options?: {
|
|
95
|
+
current?: LayoutMenuRoute;
|
|
96
|
+
}): LayoutMenuRoute[];
|
|
97
|
+
/** 将面包屑路由数组转为 antdv-next 面包屑项(纯数据,`onClick` 由组件接)。 */
|
|
98
|
+
declare function toBreadcrumbItems(routes: LayoutMenuRoute[]): BreadcrumbItemType[];
|
|
99
|
+
/**
|
|
100
|
+
* 解析点击菜单后的跳转目标。替代旧 `BaseMenu` 的 `onClick` 取数逻辑。
|
|
101
|
+
* 外链(`linkStatus===1` 且 link 合法)走 `window.open`,否则内部 `router.push`。
|
|
102
|
+
*/
|
|
103
|
+
declare function resolveRouteTarget(lookup: Map<string, MenuLookupEntry>, name: string): ResolveRouteResult;
|
|
104
|
+
/**
|
|
105
|
+
* 取顶层菜单中 `name` 命中项的子级(mix 布局的侧边分支)。
|
|
106
|
+
* 替代旧 `menuData.find(name===selectedKeys[0])?.children` 与 `getMenuFirstChildren`。
|
|
107
|
+
*/
|
|
108
|
+
declare function selectMenuBranch(menus: LayoutMenuRoute[], name: string | undefined): LayoutMenuRoute[];
|
|
109
|
+
/** 按 `meta.fixed` 拆分菜单(fixed 项钉到侧边栏底部)。替代旧 ProMenu 的 `baseMenus`/`footerMenus`。 */
|
|
110
|
+
declare function partitionFixedMenus(menus: LayoutMenuRoute[]): {
|
|
111
|
+
baseMenus: LayoutMenuRoute[];
|
|
112
|
+
fixedMenus: LayoutMenuRoute[];
|
|
113
|
+
};
|
|
23
114
|
//#endregion
|
|
24
|
-
export {
|
|
115
|
+
export { MenuLookupEntry, MenuMetaPatch, MenuModel, MenuRoutePatch, MenuTreeMutationOptions, ResolveRouteResult, buildBreadcrumbRoutes, buildMenuLookup, cleanMenus, collectMenuNames, getLastPath, insertMenuAtPath, normalizeMenus, partitionFixedMenus, removeMenuAtPath, resolveMatchedChain, resolveRouteTarget, routesToMenus, selectMenuBranch, sortMenusByOrder, toBreadcrumbItems, updateMenuAtPath, updateMenuMetaAtPath };
|