@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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ComputedRef } from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/components/AppPage/context.d.ts
|
|
4
|
-
interface
|
|
4
|
+
interface ProAppPageContext {
|
|
5
|
+
/** 应用壳全局 loading 状态,供后代按需消费 */
|
|
5
6
|
spinning: ComputedRef<boolean | undefined>;
|
|
6
7
|
}
|
|
7
|
-
declare const
|
|
8
|
+
declare const provideAppPageContext: (ctx: ProAppPageContext) => ProAppPageContext, useAppPageContext: () => ProAppPageContext;
|
|
8
9
|
//#endregion
|
|
9
|
-
export {
|
|
10
|
+
export { ProAppPageContext, provideAppPageContext, useAppPageContext };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { createInjectionState } from "@vueuse/core";
|
|
3
2
|
//#region src/components/AppPage/context.ts
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const [provideAppPageContext, useAppPageContext] = createInjectionState((ctx) => ctx);
|
|
6
4
|
//#endregion
|
|
7
|
-
export { provideAppPageContext, useAppPageContext };
|
|
5
|
+
export { provideAppPageContext, useAppPageContext };
|
|
@@ -1,73 +1,50 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AppPageSpinning } from "../../interface.js";
|
|
2
2
|
import { CSSProperties, PropType, SlotsType } from "vue";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { CustomRender } from "@gx-design-vue/pro-utils";
|
|
4
|
+
import { ConfigOptions } from "antdv-next/dist/message/interface";
|
|
5
|
+
import { NotificationConfig } from "antdv-next/dist/notification/interface";
|
|
5
6
|
|
|
6
7
|
//#region src/components/AppPage/index.d.ts
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* GProAppPage —— 应用级顶层壳。
|
|
10
|
+
* 包裹整个应用内容(通常为 router-view),提供:
|
|
11
|
+
* ① 全局滚动容器;② 全局 loading 遮罩;
|
|
12
|
+
* ③ 经 GProApp context 向后代下发 emptyText / indicator(供 pro-table 等空态/加载态复用)。
|
|
13
|
+
*/
|
|
14
|
+
declare const ProAppPage: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
class: PropType<string>;
|
|
16
|
+
style: PropType<CSSProperties>;
|
|
17
|
+
prefixCls: PropType<string>;
|
|
8
18
|
spinning: {
|
|
9
|
-
type: PropType<
|
|
10
|
-
loading?: boolean;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
blur?: boolean;
|
|
13
|
-
}>;
|
|
19
|
+
type: PropType<AppPageSpinning>;
|
|
14
20
|
default: () => {};
|
|
15
21
|
};
|
|
16
|
-
class: {
|
|
17
|
-
type: StringConstructor;
|
|
18
|
-
default: any;
|
|
19
|
-
};
|
|
20
|
-
style: {
|
|
21
|
-
type: PropType<CSSProperties>;
|
|
22
|
-
default: any;
|
|
23
|
-
};
|
|
24
|
-
emptyText: {
|
|
25
|
-
type: PropType<_gx_design_vue_pro_utils9.WithFalse<_gx_design_vue_pro_utils9.CustomRender>>;
|
|
26
|
-
default: any;
|
|
27
|
-
};
|
|
28
22
|
indicator: {
|
|
29
|
-
type: PropType<
|
|
23
|
+
type: PropType<CustomRender>;
|
|
30
24
|
default: any;
|
|
31
25
|
};
|
|
32
|
-
|
|
26
|
+
message: PropType<ConfigOptions>;
|
|
27
|
+
notification: PropType<NotificationConfig>;
|
|
28
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
class: PropType<string>;
|
|
30
|
+
style: PropType<CSSProperties>;
|
|
31
|
+
prefixCls: PropType<string>;
|
|
33
32
|
spinning: {
|
|
34
|
-
type: PropType<
|
|
35
|
-
loading?: boolean;
|
|
36
|
-
style?: CSSProperties;
|
|
37
|
-
blur?: boolean;
|
|
38
|
-
}>;
|
|
33
|
+
type: PropType<AppPageSpinning>;
|
|
39
34
|
default: () => {};
|
|
40
35
|
};
|
|
41
|
-
class: {
|
|
42
|
-
type: StringConstructor;
|
|
43
|
-
default: any;
|
|
44
|
-
};
|
|
45
|
-
style: {
|
|
46
|
-
type: PropType<CSSProperties>;
|
|
47
|
-
default: any;
|
|
48
|
-
};
|
|
49
|
-
emptyText: {
|
|
50
|
-
type: PropType<_gx_design_vue_pro_utils9.WithFalse<_gx_design_vue_pro_utils9.CustomRender>>;
|
|
51
|
-
default: any;
|
|
52
|
-
};
|
|
53
36
|
indicator: {
|
|
54
|
-
type: PropType<
|
|
37
|
+
type: PropType<CustomRender>;
|
|
55
38
|
default: any;
|
|
56
39
|
};
|
|
40
|
+
message: PropType<ConfigOptions>;
|
|
41
|
+
notification: PropType<NotificationConfig>;
|
|
57
42
|
}>> & Readonly<{}>, {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
spinning: {
|
|
61
|
-
loading?: boolean;
|
|
62
|
-
style?: CSSProperties;
|
|
63
|
-
blur?: boolean;
|
|
64
|
-
};
|
|
65
|
-
emptyText: _gx_design_vue_pro_utils9.CustomRender;
|
|
66
|
-
indicator: _gx_design_vue_pro_utils9.CustomRender;
|
|
43
|
+
indicator: CustomRender;
|
|
44
|
+
spinning: AppPageSpinning;
|
|
67
45
|
}, SlotsType<{
|
|
68
46
|
default: () => any;
|
|
69
|
-
emptyText: () => any;
|
|
70
47
|
indicator: () => any;
|
|
71
|
-
}>, {}, {}, string,
|
|
48
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
49
|
//#endregion
|
|
73
50
|
export { ProAppPage as default };
|
|
@@ -1,71 +1,88 @@
|
|
|
1
|
-
import { layout } from "../../utils/style/index.js";
|
|
2
1
|
import { provideAppPageContext } from "./context.js";
|
|
3
|
-
import
|
|
2
|
+
import style_default from "./style.js";
|
|
4
3
|
import { computed, createVNode, defineComponent } from "vue";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
4
|
+
import { useProConfigContext } from "@gx-design-vue/pro-provider";
|
|
5
|
+
import { classNames, getSlotVNode } from "@gx-design-vue/pro-utils";
|
|
6
|
+
import { App, Spin } from "antdv-next";
|
|
7
|
+
import { useBaseConfig } from "antdv-next/config-provider/context";
|
|
8
|
+
import useCSSVarCls from "antdv-next/config-provider/hooks/useCSSVarCls";
|
|
9
|
+
import { GScrollbar } from "@gx-design-vue/scrollbar";
|
|
11
10
|
//#region src/components/AppPage/index.tsx
|
|
11
|
+
const SCROLLBAR_BAR_STYLE = {
|
|
12
|
+
x: { zIndex: 998 },
|
|
13
|
+
y: { zIndex: 998 }
|
|
14
|
+
};
|
|
15
|
+
const SCROLLBAR_VIEW_STYLE = {
|
|
16
|
+
position: "relative",
|
|
17
|
+
height: "100%",
|
|
18
|
+
minHeight: "100%"
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* GProAppPage —— 应用级顶层壳。
|
|
22
|
+
* 包裹整个应用内容(通常为 router-view),提供:
|
|
23
|
+
* ① 全局滚动容器;② 全局 loading 遮罩;
|
|
24
|
+
* ③ 经 GProApp context 向后代下发 emptyText / indicator(供 pro-table 等空态/加载态复用)。
|
|
25
|
+
*/
|
|
12
26
|
const ProAppPage = /* @__PURE__ */ defineComponent({
|
|
13
27
|
name: "GProAppPage",
|
|
28
|
+
inheritAttrs: false,
|
|
14
29
|
props: {
|
|
15
|
-
|
|
30
|
+
class: String,
|
|
31
|
+
style: Object,
|
|
32
|
+
prefixCls: String,
|
|
16
33
|
spinning: {
|
|
17
34
|
type: Object,
|
|
18
35
|
default: () => ({})
|
|
19
|
-
}
|
|
36
|
+
},
|
|
37
|
+
indicator: {
|
|
38
|
+
type: [
|
|
39
|
+
Object,
|
|
40
|
+
Function,
|
|
41
|
+
Boolean,
|
|
42
|
+
Array,
|
|
43
|
+
String
|
|
44
|
+
],
|
|
45
|
+
default: void 0
|
|
46
|
+
},
|
|
47
|
+
message: Object,
|
|
48
|
+
notification: Object
|
|
20
49
|
},
|
|
21
|
-
inheritAttrs: false,
|
|
22
50
|
slots: Object,
|
|
23
|
-
setup(props, { slots
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const { hashId, wrapSSR } = useStyle(baseClass);
|
|
51
|
+
setup(props, { slots }) {
|
|
52
|
+
const { prefixCls } = useBaseConfig("pro-app-page", props);
|
|
53
|
+
const rootCls = useCSSVarCls(prefixCls);
|
|
54
|
+
const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
|
|
55
|
+
const configContext = useProConfigContext();
|
|
56
|
+
const loading = computed(() => props.spinning?.loading ?? false);
|
|
30
57
|
provideAppPageContext({ spinning: computed(() => props.spinning?.loading) });
|
|
31
|
-
|
|
32
|
-
const
|
|
58
|
+
const resolvedIndicator = computed(() => {
|
|
59
|
+
const indicator = getSlotVNode({
|
|
33
60
|
slots,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
render: true
|
|
61
|
+
key: "indicator",
|
|
62
|
+
props
|
|
37
63
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
}, [createVNode("div", { "class": classNames(`${baseClass}-spin`) }, [slotsProps.indicator ?? createVNode(GIcon, {
|
|
61
|
-
"type": "spinning",
|
|
62
|
-
"spin": true,
|
|
63
|
-
"class": `${baseClass}-spin-dot ${hashId.value}`
|
|
64
|
-
}, null)])])] }));
|
|
65
|
-
};
|
|
64
|
+
if (indicator) return indicator;
|
|
65
|
+
return typeof configContext?.indicator?.value === "function" ? configContext?.indicator?.value?.() : configContext?.indicator?.value || createVNode(Spin, { "class": `${prefixCls.value}-spin-dot` }, null);
|
|
66
|
+
});
|
|
67
|
+
const rootClassNames = computed(() => classNames(prefixCls.value, hashId.value, cssVarCls.value, rootCls.value, loading.value && `${prefixCls.value}-loading`, props.class));
|
|
68
|
+
const maskStyle = computed(() => ({
|
|
69
|
+
zIndex: props.spinning?.blur ? 999 : void 0,
|
|
70
|
+
backgroundColor: props.spinning?.blur ? void 0 : "unset",
|
|
71
|
+
...props.spinning?.style || {}
|
|
72
|
+
}));
|
|
73
|
+
return () => createVNode(App, {
|
|
74
|
+
"class": rootClassNames.value,
|
|
75
|
+
"style": props.style,
|
|
76
|
+
"message": props.message,
|
|
77
|
+
"notification": props.notification
|
|
78
|
+
}, { default: () => [createVNode(GScrollbar, {
|
|
79
|
+
"barStyle": SCROLLBAR_BAR_STYLE,
|
|
80
|
+
"viewStyle": SCROLLBAR_VIEW_STYLE
|
|
81
|
+
}, { default: () => [slots.default?.()] }), loading.value && createVNode("div", {
|
|
82
|
+
"class": classNames(`${prefixCls.value}-blur`),
|
|
83
|
+
"style": maskStyle.value
|
|
84
|
+
}, [createVNode("div", { "class": `${prefixCls.value}-spin` }, [resolvedIndicator.value])])] });
|
|
66
85
|
}
|
|
67
86
|
});
|
|
68
|
-
var AppPage_default = ProAppPage;
|
|
69
|
-
|
|
70
87
|
//#endregion
|
|
71
|
-
export {
|
|
88
|
+
export { ProAppPage as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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";
|
|
3
4
|
|
|
4
5
|
//#region src/components/AppPage/style.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
type ComponentToken = Record<string, any>;
|
|
7
|
+
/** GProAppPage 样式:应用壳容器 + loading 遮罩。 */
|
|
8
|
+
declare const genAppPageStyle: GenerateStyle<ProFullToken<'ProAppPage'>, CSSObject>;
|
|
9
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
9
10
|
//#endregion
|
|
10
|
-
export {
|
|
11
|
+
export { ComponentToken, _default as default, genAppPageStyle };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { proGenStyleHooks } from "@gx-design-vue/pro-provider";
|
|
3
2
|
//#region src/components/AppPage/style.ts
|
|
4
|
-
|
|
5
|
-
return {
|
|
3
|
+
function withAlpha(color, alpha) {
|
|
4
|
+
return `color-mix(in srgb, ${color} ${alpha * 100}%, transparent)`;
|
|
5
|
+
}
|
|
6
|
+
/** GProAppPage 样式:应用壳容器 + loading 遮罩。 */
|
|
7
|
+
const genAppPageStyle = (token) => {
|
|
8
|
+
const { componentCls, colorBgContainer, colorPrimary } = token;
|
|
9
|
+
return { [componentCls]: {
|
|
6
10
|
height: "100%",
|
|
7
|
-
[`&${
|
|
11
|
+
[`&${componentCls}-loading`]: {
|
|
8
12
|
position: "relative",
|
|
9
13
|
height: "100%",
|
|
10
14
|
overflow: "hidden"
|
|
@@ -15,26 +19,21 @@ const pageLoadingStyle = (token) => {
|
|
|
15
19
|
left: 0,
|
|
16
20
|
width: "100%",
|
|
17
21
|
height: "100%",
|
|
18
|
-
backgroundColor:
|
|
19
|
-
[`& > ${
|
|
22
|
+
backgroundColor: withAlpha(colorBgContainer, .5),
|
|
23
|
+
[`& > ${componentCls}-spin`]: {
|
|
20
24
|
position: "absolute",
|
|
21
25
|
top: "50%",
|
|
22
26
|
left: "50%",
|
|
23
27
|
transform: "translate(-50%, -50%)",
|
|
24
|
-
[
|
|
28
|
+
[`${componentCls}-spin-dot,.anticon`]: {
|
|
25
29
|
fontSize: 32,
|
|
26
|
-
|
|
30
|
+
[`${token.antCls}-spin-dot,.gx-spin-icon`]: { animationDuration: "0.75s" }
|
|
27
31
|
},
|
|
28
|
-
"> *": { color:
|
|
32
|
+
"> *": { color: colorPrimary }
|
|
29
33
|
}
|
|
30
34
|
}
|
|
31
35
|
} };
|
|
32
36
|
};
|
|
33
|
-
|
|
34
|
-
return useStyle$1("AppPage", (token) => {
|
|
35
|
-
return [pageLoadingStyle(token)];
|
|
36
|
-
}, componentCls);
|
|
37
|
-
}
|
|
38
|
-
|
|
37
|
+
var style_default = proGenStyleHooks("ProAppPage", genAppPageStyle);
|
|
39
38
|
//#endregion
|
|
40
|
-
export {
|
|
39
|
+
export { style_default as default, genAppPageStyle };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LayoutBreadcrumbProps, LayoutBreadcrumbSlots } from "./interface.js";
|
|
2
|
+
import { SlotsType } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Breadcrumb/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* LayoutBreadcrumb —— 自定义面包屑组件。
|
|
7
|
+
*
|
|
8
|
+
* 直接从 layoutContext 读取面包屑路由链、查找表、导航函数和配置,
|
|
9
|
+
* 无需通过 props 透传数据。支持:
|
|
10
|
+
* - 图标展示(来自 meta.icon)
|
|
11
|
+
* - 首页图标(homeIcon 配置)
|
|
12
|
+
* - 下拉子菜单(有子节点的层级鼠标悬停展示)
|
|
13
|
+
* - 点击导航(非当前页层级可点击跳转)
|
|
14
|
+
*/
|
|
15
|
+
declare const Breadcrumb: import("vue").DefineSetupFnComponent<LayoutBreadcrumbProps, Record<string, never>, SlotsType<LayoutBreadcrumbSlots>, LayoutBreadcrumbProps & {
|
|
16
|
+
[x: `on${Capitalize<string>}`]: (...args: unknown[]) => any;
|
|
17
|
+
}, import("vue").PublicProps>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Breadcrumb as default };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { useLayoutBase } from "../../hooks/useLayoutBase.js";
|
|
2
|
+
import { renderMenuIcon } from "../Menu/iconRender.js";
|
|
3
|
+
import { Fragment, computed, createTextVNode, createVNode, defineComponent } from "vue";
|
|
4
|
+
import { classNames } from "@gx-design-vue/pro-utils";
|
|
5
|
+
import { Dropdown } from "antdv-next";
|
|
6
|
+
import { useRouter } from "vue-router";
|
|
7
|
+
import { GIcon } from "@gx-design-vue/icon";
|
|
8
|
+
//#region src/components/Breadcrumb/index.tsx
|
|
9
|
+
/** 首页占位路由名 */
|
|
10
|
+
const BREADCRUMB_HOME_KEY = "__breadcrumb_home__";
|
|
11
|
+
/** 渲染默认面包屑项内容(图标 + 标题) */
|
|
12
|
+
function renderBreadcrumbItemContent(prefixCls, route) {
|
|
13
|
+
const iconNode = renderMenuIcon(route.meta?.icon);
|
|
14
|
+
const isHomeItem = route.name === BREADCRUMB_HOME_KEY;
|
|
15
|
+
return createVNode(Fragment, null, [iconNode && createVNode("span", { "class": `${prefixCls}-item-icon` }, [iconNode]), !isHomeItem && createVNode("span", null, [route.meta?.title])]);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* LayoutBreadcrumb —— 自定义面包屑组件。
|
|
19
|
+
*
|
|
20
|
+
* 直接从 layoutContext 读取面包屑路由链、查找表、导航函数和配置,
|
|
21
|
+
* 无需通过 props 透传数据。支持:
|
|
22
|
+
* - 图标展示(来自 meta.icon)
|
|
23
|
+
* - 首页图标(homeIcon 配置)
|
|
24
|
+
* - 下拉子菜单(有子节点的层级鼠标悬停展示)
|
|
25
|
+
* - 点击导航(非当前页层级可点击跳转)
|
|
26
|
+
*/
|
|
27
|
+
const Breadcrumb = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
28
|
+
const { navigate, prefixCls, menuState, breadcrumbConfig } = useLayoutBase();
|
|
29
|
+
const router = useRouter();
|
|
30
|
+
const breadcrumbRoutes = computed(() => props.routes ?? menuState?.breadcrumbRoutes.value ?? []);
|
|
31
|
+
const homeIconConfig = computed(() => {
|
|
32
|
+
if (props.homeIcon !== void 0) return props.homeIcon;
|
|
33
|
+
return breadcrumbConfig ? breadcrumbConfig.value?.showHome : void 0;
|
|
34
|
+
});
|
|
35
|
+
const homePath = computed(() => {
|
|
36
|
+
if (props.homePath !== void 0) return props.homePath;
|
|
37
|
+
return breadcrumbConfig?.value?.homePath ?? "/";
|
|
38
|
+
});
|
|
39
|
+
const lookup = computed(() => menuState?.lookup.value);
|
|
40
|
+
const selectedKeys = computed(() => menuState?.selectedKeys.value ?? []);
|
|
41
|
+
const displayRoutes = computed(() => {
|
|
42
|
+
const routes = breadcrumbRoutes.value;
|
|
43
|
+
if (homeIconConfig.value && routes.length > 0) return [{
|
|
44
|
+
name: BREADCRUMB_HOME_KEY,
|
|
45
|
+
path: "/",
|
|
46
|
+
meta: {
|
|
47
|
+
title: "首页",
|
|
48
|
+
icon: "House"
|
|
49
|
+
}
|
|
50
|
+
}, ...routes];
|
|
51
|
+
return routes;
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* 获取某路由在完整菜单树中的可见子节点,用于构建 dropdown。
|
|
55
|
+
* 首页占位项本身没有子节点,不展示 dropdown。
|
|
56
|
+
*/
|
|
57
|
+
function getDropdownChildren(route) {
|
|
58
|
+
if (route.name === BREADCRUMB_HOME_KEY) {
|
|
59
|
+
const visibleTopMenus = (menuState?.headerMenus.value ?? menuState?.menus.value ?? []).filter((menu) => !menu.meta?.hideInMenu);
|
|
60
|
+
return visibleTopMenus.length ? visibleTopMenus : void 0;
|
|
61
|
+
}
|
|
62
|
+
const visibleChildren = ((lookup.value?.get(route.name))?.route)?.children?.filter((child) => !child.meta?.hideInMenu);
|
|
63
|
+
return visibleChildren?.length ? visibleChildren : void 0;
|
|
64
|
+
}
|
|
65
|
+
/** 点击面包屑项导航 */
|
|
66
|
+
function handleItemClick(route, isLast) {
|
|
67
|
+
if (isLast) return;
|
|
68
|
+
if (route.name === BREADCRUMB_HOME_KEY) {
|
|
69
|
+
const targetPath = homePath.value;
|
|
70
|
+
if (router.currentRoute.value.fullPath !== targetPath) router.push(targetPath);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
navigate?.(route.name);
|
|
74
|
+
}
|
|
75
|
+
/** 点击 dropdown 子菜单项导航 */
|
|
76
|
+
function handleDropdownMenuClick(menuRouteName) {
|
|
77
|
+
navigate?.(menuRouteName);
|
|
78
|
+
}
|
|
79
|
+
return () => {
|
|
80
|
+
const routes = displayRoutes.value;
|
|
81
|
+
if (routes.length === 0) return null;
|
|
82
|
+
const breadcrumbCls = `${prefixCls.value}-breadcrumb`;
|
|
83
|
+
return createVNode("nav", { "class": classNames(breadcrumbCls) }, [createVNode("ol", null, [routes.map((route, index) => {
|
|
84
|
+
const isLast = index === routes.length - 1;
|
|
85
|
+
const dropdownChildren = !isLast ? getDropdownChildren(route) : void 0;
|
|
86
|
+
const itemContent = slots.itemRender?.({
|
|
87
|
+
route,
|
|
88
|
+
index,
|
|
89
|
+
isLast
|
|
90
|
+
}) ?? renderBreadcrumbItemContent(breadcrumbCls, route);
|
|
91
|
+
const dropdownSelectedKeys = dropdownChildren ? dropdownChildren.filter((child) => selectedKeys.value.includes(child.name)).map((child) => child.name) : [];
|
|
92
|
+
return createVNode(Fragment, null, [createVNode("li", null, [dropdownChildren ? createVNode(Dropdown, { "menu": {
|
|
93
|
+
items: dropdownChildren.map((child) => ({
|
|
94
|
+
key: child.name,
|
|
95
|
+
label: child.meta?.title ?? child.name,
|
|
96
|
+
icon: renderMenuIcon(child.meta?.icon)
|
|
97
|
+
})),
|
|
98
|
+
selectedKeys: dropdownSelectedKeys,
|
|
99
|
+
onClick: ({ key }) => handleDropdownMenuClick(String(key))
|
|
100
|
+
} }, { default: () => [createVNode("span", {
|
|
101
|
+
"class": `${breadcrumbCls}-overlay-link`,
|
|
102
|
+
"onClick": route.name === BREADCRUMB_HOME_KEY ? () => handleItemClick(route, isLast) : void 0
|
|
103
|
+
}, [itemContent, createVNode(GIcon, { "type": "DownOutlined" }, null)])] }) : createVNode("span", {
|
|
104
|
+
"class": classNames(`${breadcrumbCls}-link`, isLast && `${breadcrumbCls}-link-last`),
|
|
105
|
+
"onClick": () => handleItemClick(route, isLast)
|
|
106
|
+
}, [itemContent])]), !isLast && createVNode("li", { "class": `${breadcrumbCls}-separator` }, [createTextVNode("/")])]);
|
|
107
|
+
})])]);
|
|
108
|
+
};
|
|
109
|
+
}, {
|
|
110
|
+
props: {
|
|
111
|
+
routes: {
|
|
112
|
+
type: Array,
|
|
113
|
+
required: false
|
|
114
|
+
},
|
|
115
|
+
homeIcon: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
required: false,
|
|
118
|
+
default: void 0
|
|
119
|
+
},
|
|
120
|
+
homePath: {
|
|
121
|
+
type: String,
|
|
122
|
+
required: false
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
name: "LayoutBreadcrumb",
|
|
126
|
+
inheritAttrs: false
|
|
127
|
+
});
|
|
128
|
+
//#endregion
|
|
129
|
+
export { Breadcrumb as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LayoutMenuRoute } from "../../interface.js";
|
|
2
|
+
import { WithFalse } from "@gx-design-vue/pro-utils";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Breadcrumb/interface.d.ts
|
|
5
|
+
interface LayoutBreadcrumbProps {
|
|
6
|
+
/**
|
|
7
|
+
* 覆盖 context 的面包屑路由(脱离 ProLayout 独立使用时)。
|
|
8
|
+
* 默认从 layoutContext.menuState.breadcrumbRoutes 读取。
|
|
9
|
+
*/
|
|
10
|
+
routes?: LayoutMenuRoute[];
|
|
11
|
+
/**
|
|
12
|
+
* 覆盖 context 的首页图标配置。
|
|
13
|
+
* 默认从 layoutContext.breadcrumb.homeIcon 读取。
|
|
14
|
+
* - `true`:只显示 lucide House 图标(不展示「首页」文字)
|
|
15
|
+
* - `false`:不显示首页项
|
|
16
|
+
*/
|
|
17
|
+
homeIcon?: WithFalse<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* 覆盖 context 的首页点击跳转路径。
|
|
20
|
+
* 默认从 layoutContext.breadcrumbConfig.homePath 读取,缺省 '/'。
|
|
21
|
+
*/
|
|
22
|
+
homePath?: string;
|
|
23
|
+
}
|
|
24
|
+
interface LayoutBreadcrumbSlots {
|
|
25
|
+
/** 自定义每个面包屑项的渲染 */
|
|
26
|
+
itemRender?: (props: {
|
|
27
|
+
route: LayoutMenuRoute;
|
|
28
|
+
index: number;
|
|
29
|
+
isLast: boolean;
|
|
30
|
+
}) => any;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { LayoutBreadcrumbProps, LayoutBreadcrumbSlots };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createVNode } from "vue";
|
|
2
|
-
|
|
3
|
-
//#region src/components/SiderMenu/Arrow.tsx
|
|
2
|
+
//#region src/components/CollapseButton/Arrow.tsx
|
|
4
3
|
function ArrowSvgIcon() {
|
|
5
4
|
return createVNode("svg", {
|
|
6
5
|
"width": "1em",
|
|
@@ -10,6 +9,5 @@ function ArrowSvgIcon() {
|
|
|
10
9
|
"aria-hidden": "true"
|
|
11
10
|
}, [createVNode("path", { "d": "M6.432 7.967a.448.448 0 01-.318.133h-.228a.46.46 0 01-.318-.133L2.488 4.85a.305.305 0 010-.43l.427-.43a.293.293 0 01.42 0L6 6.687l2.665-2.699a.299.299 0 01.426 0l.42.431a.305.305 0 010 .43L6.432 7.967z" }, null)]);
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
|
-
export { ArrowSvgIcon };
|
|
13
|
+
export { ArrowSvgIcon };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LayoutCollapseButtonEmits, LayoutCollapseButtonProps, LayoutCollapseButtonSlots } from "./interface.js";
|
|
2
|
+
import { SlotsType } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/CollapseButton/index.d.ts
|
|
5
|
+
declare const LayoutCollapseButton: import("vue").DefineSetupFnComponent<LayoutCollapseButtonProps, LayoutCollapseButtonEmits, SlotsType<LayoutCollapseButtonSlots>, LayoutCollapseButtonProps, import("vue").PublicProps>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { LayoutCollapseButton as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useLayoutBase } from "../../hooks/useLayoutBase.js";
|
|
2
|
+
import { ArrowSvgIcon } from "./Arrow.js";
|
|
3
|
+
import { computed, createVNode, defineComponent } from "vue";
|
|
4
|
+
import { classNames } from "@gx-design-vue/pro-utils";
|
|
5
|
+
import { GIcon } from "@gx-design-vue/icon";
|
|
6
|
+
//#region src/components/CollapseButton/index.tsx
|
|
7
|
+
const LayoutCollapseButton = /* @__PURE__ */ defineComponent((props, { emit, slots }) => {
|
|
8
|
+
const { prefixCls, collapseConfig } = useLayoutBase();
|
|
9
|
+
const placement = computed(() => props.placement ?? collapseConfig?.value?.placement ?? "sider");
|
|
10
|
+
const collapseButtonClassNames = computed(() => classNames(`${prefixCls.value}-collapse-button`, `${prefixCls.value}-collapse-button-${placement.value}`, props.collapsed && `${prefixCls.value}-collapse-button-${placement.value}-collapsed`));
|
|
11
|
+
function handleClick(event) {
|
|
12
|
+
emit("click", event);
|
|
13
|
+
}
|
|
14
|
+
return () => {
|
|
15
|
+
return createVNode("div", {
|
|
16
|
+
"class": collapseButtonClassNames.value,
|
|
17
|
+
"role": "button",
|
|
18
|
+
"tabindex": 0,
|
|
19
|
+
"aria-label": props.collapsed ? "展开侧边栏" : "收起侧边栏",
|
|
20
|
+
"onClick": handleClick,
|
|
21
|
+
"onKeydown": (event) => {
|
|
22
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
handleClick(event);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, [slots.icon?.({ collapsed: props.collapsed }) || placement.value === "sider" ? createVNode(ArrowSvgIcon, null, null) : createVNode(GIcon, { "type": props.collapsed ? "MenuUnfoldOutlined" : "MenuFoldOutlined" }, null)]);
|
|
28
|
+
};
|
|
29
|
+
}, {
|
|
30
|
+
props: {
|
|
31
|
+
collapsed: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
placement: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
emits: ["click"],
|
|
41
|
+
name: "LayoutCollapseButton",
|
|
42
|
+
inheritAttrs: false
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
export { LayoutCollapseButton as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/components/CollapseButton/interface.d.ts
|
|
2
|
+
interface LayoutCollapseButtonEmits {
|
|
3
|
+
'click': (e: MouseEvent) => void;
|
|
4
|
+
}
|
|
5
|
+
interface LayoutCollapseButtonEmitsProps {
|
|
6
|
+
onClick?: LayoutCollapseButtonEmits['click'];
|
|
7
|
+
}
|
|
8
|
+
interface LayoutCollapseButtonProps extends LayoutCollapseButtonEmitsProps {
|
|
9
|
+
collapsed: boolean;
|
|
10
|
+
/** 折叠按钮位置:优先于 context 的 collapseConfig.placement */
|
|
11
|
+
placement?: 'sider' | 'header' | 'floating';
|
|
12
|
+
}
|
|
13
|
+
interface LayoutCollapseButtonSlots {
|
|
14
|
+
icon?: (props: {
|
|
15
|
+
collapsed: boolean;
|
|
16
|
+
}) => any;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { LayoutCollapseButtonEmits, LayoutCollapseButtonEmitsProps, LayoutCollapseButtonProps, LayoutCollapseButtonSlots };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LayoutFooterProps, LayoutFooterSlots } from "./interface.js";
|
|
2
|
+
import { EmptyEmits } from "../../interface.js";
|
|
3
|
+
import { SlotsType } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Footer/index.d.ts
|
|
6
|
+
declare const LayoutFooter: import("vue").DefineSetupFnComponent<LayoutFooterProps, EmptyEmits, SlotsType<LayoutFooterSlots>, LayoutFooterProps & {
|
|
7
|
+
[x: `on${Capitalize<string>}`]: (...args: unknown[]) => any;
|
|
8
|
+
}, import("vue").PublicProps>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { LayoutFooter as default };
|