@gx-design-vue/pro-layout 0.1.0-alpha.3 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppPage/index.d.ts +1 -1
- package/dist/components/Breadcrumb/index.js +1 -1
- package/dist/components/CollapseButton/index.js +12 -6
- package/dist/components/CollapseButton/interface.d.ts +2 -0
- package/dist/components/Logo/index.js +3 -3
- package/dist/components/PageTransition/index.d.ts +1 -1
- package/dist/components/Sider/style.js +1 -2
- package/dist/hooks/useLayoutBase.d.ts +5 -5
- package/dist/hooks/useLayoutBase.js +17 -17
- package/dist/pro-layout.esm.js +729 -735
- package/dist/pro-layout.js +1 -1
- package/package.json +8 -8
|
@@ -64,9 +64,9 @@ declare const ProAppPage: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
64
64
|
}>> & Readonly<{}>, {
|
|
65
65
|
emptyText: _$_gx_design_vue_pro_utils0.CustomRender;
|
|
66
66
|
indicator: _$_gx_design_vue_pro_utils0.CustomRender;
|
|
67
|
+
prefixCls: string;
|
|
67
68
|
spinning: AppPageSpinning;
|
|
68
69
|
class: string;
|
|
69
|
-
prefixCls: string;
|
|
70
70
|
style: CSSProperties;
|
|
71
71
|
}, SlotsType<{
|
|
72
72
|
default: () => any;
|
|
@@ -43,7 +43,7 @@ const Breadcrumb = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
43
43
|
const breadcrumbRoutes = computed(() => props.routes ?? menuState?.breadcrumbRoutes.value ?? []);
|
|
44
44
|
const homeIconConfig = computed(() => {
|
|
45
45
|
if (props.homeIcon !== void 0) return props.homeIcon;
|
|
46
|
-
return breadcrumbConfig ? breadcrumbConfig.value
|
|
46
|
+
return breadcrumbConfig ? breadcrumbConfig.value?.showHome : void 0;
|
|
47
47
|
});
|
|
48
48
|
const lookup = computed(() => menuState?.lookup.value);
|
|
49
49
|
const selectedKeys = computed(() => menuState?.selectedKeys.value ?? []);
|
|
@@ -5,7 +5,7 @@ import { MenuFoldOutlined, MenuUnfoldOutlined } from "@antdv-next/icons";
|
|
|
5
5
|
//#region src/components/CollapseButton/index.tsx
|
|
6
6
|
const LayoutCollapseButton = /* @__PURE__ */ defineComponent((props, { emit, slots }) => {
|
|
7
7
|
const { prefixCls, collapseConfig } = useLayoutBase();
|
|
8
|
-
const placement = computed(() => collapseConfig
|
|
8
|
+
const placement = computed(() => props.placement ?? collapseConfig?.value?.placement ?? "sider");
|
|
9
9
|
const collapseButtonClassNames = computed(() => classNames(`${prefixCls.value}-collapse-button`, `${prefixCls.value}-collapse-button-${placement.value}`, props.collapsed && `${prefixCls.value}-collapse-button-${placement.value}-collapsed`));
|
|
10
10
|
function handleClick(event) {
|
|
11
11
|
emit("click", event);
|
|
@@ -24,13 +24,19 @@ const LayoutCollapseButton = /* @__PURE__ */ defineComponent((props, { emit, slo
|
|
|
24
24
|
handleClick(event);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
}, [collapseConfig
|
|
27
|
+
}, [collapseConfig?.value ? slots.icon?.({ collapsed: props.collapsed }) : props.collapsed ? createVNode(MenuUnfoldOutlined, null, null) : createVNode(MenuFoldOutlined, null, null)]);
|
|
28
28
|
};
|
|
29
29
|
}, {
|
|
30
|
-
props: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
props: {
|
|
31
|
+
collapsed: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
placement: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
34
40
|
emits: ["click"],
|
|
35
41
|
name: "LayoutCollapseButton",
|
|
36
42
|
inheritAttrs: false
|
|
@@ -7,6 +7,8 @@ interface LayoutCollapseButtonEmitsProps {
|
|
|
7
7
|
}
|
|
8
8
|
interface LayoutCollapseButtonProps extends LayoutCollapseButtonEmitsProps {
|
|
9
9
|
collapsed: boolean;
|
|
10
|
+
/** 折叠按钮位置:优先于 context 的 collapseConfig.placement */
|
|
11
|
+
placement?: 'sider' | 'header' | 'floating';
|
|
10
12
|
}
|
|
11
13
|
interface LayoutCollapseButtonSlots {
|
|
12
14
|
icon?: (props: {
|
|
@@ -15,10 +15,10 @@ const LayoutLogo = /* @__PURE__ */ defineComponent((_props, { emit, slots }) =>
|
|
|
15
15
|
const { layout, isMobile, prefixCls, collapsed, logoConfig, proClasses, proStyles, collapseConfig } = useLayoutBase();
|
|
16
16
|
const collapsedWidth = computed(() => collapseConfig?.value?.width);
|
|
17
17
|
const title = computed(() => {
|
|
18
|
-
if (!logoConfig
|
|
19
|
-
return logoConfig
|
|
18
|
+
if (!logoConfig?.value) return "";
|
|
19
|
+
return logoConfig?.value.title;
|
|
20
20
|
});
|
|
21
|
-
const logoSource = computed(() => !logoConfig
|
|
21
|
+
const logoSource = computed(() => !logoConfig?.value ? false : logoConfig?.value.logo);
|
|
22
22
|
const hideTitle = computed(() => collapsed.value && ["side", "simple"].includes(layout.value ?? ""));
|
|
23
23
|
const showLogo = computed(() => !collapsed.value || !!collapsedWidth.value);
|
|
24
24
|
const logoClassNames = computed(() => classNames(`${prefixCls.value}-logo`, proClasses.value.logo, {
|
|
@@ -50,8 +50,8 @@ declare const GPageTransition: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
50
50
|
};
|
|
51
51
|
}>> & Readonly<{}>, {
|
|
52
52
|
reverse: boolean;
|
|
53
|
-
name: string;
|
|
54
53
|
direction: string;
|
|
54
|
+
name: string;
|
|
55
55
|
disabled: boolean;
|
|
56
56
|
}, SlotsType<GPageTransitionSlots>, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
57
57
|
//#endregion
|
|
@@ -99,8 +99,7 @@ const genSiderMenuStyle = (token) => {
|
|
|
99
99
|
const siderMenuPaddingWithArrow = token.calc(siderMenuArrowSize).add(token.padding).add(token.marginXS).equal();
|
|
100
100
|
const siderMenuTitleGap = token.iconMarginInlineEnd ?? token.marginSM;
|
|
101
101
|
const activeBarWidth = token.activeBarWidth ?? 0;
|
|
102
|
-
const
|
|
103
|
-
const itemWidth = activeBarWidth ? `calc(100% + ${unit$1(activeBarBorderWidth)})` : `calc(100% - ${unit$1(token.calc(siderMenuItemMarginInline).mul(2).equal())})`;
|
|
102
|
+
const itemWidth = token.itemWidth || `calc(100% - ${unit$1(token.calc(siderMenuItemMarginInline).mul(2).equal())})`;
|
|
104
103
|
return {
|
|
105
104
|
[`${componentCls}`]: {
|
|
106
105
|
boxSizing: "border-box",
|
|
@@ -17,7 +17,7 @@ declare function useLayoutBase(props?: {
|
|
|
17
17
|
collapsed?: boolean;
|
|
18
18
|
}): {
|
|
19
19
|
layoutContext: LayoutContextProps;
|
|
20
|
-
layout: _$vue.ComputedRef<"
|
|
20
|
+
layout: _$vue.ComputedRef<"top" | "side" | "mix" | "wide" | "simple">;
|
|
21
21
|
sider: _$vue.ComputedRef<Required<LayoutSiderConfig>>;
|
|
22
22
|
header: _$vue.ComputedRef<Required<LayoutHeaderConfig>>;
|
|
23
23
|
zIndex: _$vue.Ref<number, number>;
|
|
@@ -43,12 +43,12 @@ declare function useLayoutBase(props?: {
|
|
|
43
43
|
breadcrumb?: string;
|
|
44
44
|
footer?: string;
|
|
45
45
|
header?: string;
|
|
46
|
-
|
|
46
|
+
content?: string;
|
|
47
47
|
sider?: string;
|
|
48
|
+
root?: string;
|
|
48
49
|
siderChildren?: string;
|
|
49
50
|
logo?: string;
|
|
50
51
|
logoImage?: string;
|
|
51
|
-
content?: string;
|
|
52
52
|
menu?: string;
|
|
53
53
|
tabs?: string;
|
|
54
54
|
}>;
|
|
@@ -58,12 +58,12 @@ declare function useLayoutBase(props?: {
|
|
|
58
58
|
breadcrumb?: _$vue.CSSProperties;
|
|
59
59
|
footer?: _$vue.CSSProperties;
|
|
60
60
|
header?: _$vue.CSSProperties;
|
|
61
|
-
|
|
61
|
+
content?: _$vue.CSSProperties;
|
|
62
62
|
sider?: _$vue.CSSProperties;
|
|
63
|
+
root?: _$vue.CSSProperties;
|
|
63
64
|
siderChildren?: _$vue.CSSProperties;
|
|
64
65
|
logo?: _$vue.CSSProperties;
|
|
65
66
|
logoImage?: _$vue.CSSProperties;
|
|
66
|
-
content?: _$vue.CSSProperties;
|
|
67
67
|
menu?: _$vue.CSSProperties;
|
|
68
68
|
tabs?: _$vue.CSSProperties;
|
|
69
69
|
}>;
|
|
@@ -7,23 +7,23 @@ import { computed } from "vue";
|
|
|
7
7
|
*/
|
|
8
8
|
function useLayoutBase(props) {
|
|
9
9
|
const layoutContext = useInjectLayoutContext();
|
|
10
|
-
const sider = layoutContext
|
|
11
|
-
const header = layoutContext
|
|
12
|
-
const zIndex = layoutContext
|
|
13
|
-
const prefixCls = layoutContext
|
|
14
|
-
const hashId = layoutContext
|
|
15
|
-
const cssVarCls = layoutContext
|
|
16
|
-
const rootCls = layoutContext
|
|
17
|
-
const watermark = layoutContext
|
|
18
|
-
const menuState = layoutContext
|
|
19
|
-
const breadcrumbRender = layoutContext
|
|
20
|
-
const breadcrumbConfig = layoutContext
|
|
21
|
-
const pageContainerConfig = layoutContext
|
|
22
|
-
const collapseConfig = layoutContext
|
|
23
|
-
const contentFullscreen = layoutContext
|
|
24
|
-
const renderRouterView = layoutContext
|
|
25
|
-
const navigate = layoutContext
|
|
26
|
-
const setHasFooterToolbar = layoutContext
|
|
10
|
+
const sider = layoutContext?.sider;
|
|
11
|
+
const header = layoutContext?.header;
|
|
12
|
+
const zIndex = layoutContext?.zIndex;
|
|
13
|
+
const prefixCls = layoutContext?.prefixCls;
|
|
14
|
+
const hashId = layoutContext?.hashId;
|
|
15
|
+
const cssVarCls = layoutContext?.cssVarCls;
|
|
16
|
+
const rootCls = layoutContext?.rootCls;
|
|
17
|
+
const watermark = layoutContext?.watermark;
|
|
18
|
+
const menuState = layoutContext?.menuState;
|
|
19
|
+
const breadcrumbRender = layoutContext?.breadcrumbRender;
|
|
20
|
+
const breadcrumbConfig = layoutContext?.breadcrumbConfig;
|
|
21
|
+
const pageContainerConfig = layoutContext?.pageContainerConfig;
|
|
22
|
+
const collapseConfig = layoutContext?.collapseConfig;
|
|
23
|
+
const contentFullscreen = layoutContext?.contentFullscreen;
|
|
24
|
+
const renderRouterView = layoutContext?.renderRouterView;
|
|
25
|
+
const navigate = layoutContext?.navigate;
|
|
26
|
+
const setHasFooterToolbar = layoutContext?.setHasFooterToolbar;
|
|
27
27
|
const layout = computed(() => layoutContext?.layout.value);
|
|
28
28
|
const collapsed = computed(() => props?.collapsed ?? layoutContext?.collapsed.value ?? false);
|
|
29
29
|
const isMobile = computed(() => layoutContext?.isMobile.value ?? false);
|