@meethive/components 0.0.1
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/es/AutoComplete/AutoComplete.js +84 -0
- package/es/AutoComplete/index.js +7 -0
- package/es/BadgeStatus/Badge.js +51 -0
- package/es/BadgeStatus/color.js +14 -0
- package/es/BadgeStatus/index.js +8 -0
- package/es/CardSelect/CardSelect.js +141 -0
- package/es/CardSelect/index.js +7 -0
- package/es/CardSelect/style/index.js +29 -0
- package/es/CheckButton/CheckButton.js +122 -0
- package/es/CheckButton/index.js +7 -0
- package/es/CheckButton/style/index.js +44 -0
- package/es/ConfigProvider/ConfigProvider.js +73 -0
- package/es/ConfigProvider/context.js +26 -0
- package/es/ConfigProvider/index.js +9 -0
- package/es/DragModal/DragModal.js +212 -0
- package/es/DragModal/index.js +7 -0
- package/es/DragModal/style/index.js +86 -0
- package/es/EditTable/Body.js +189 -0
- package/es/EditTable/CellRender.js +12 -0
- package/es/EditTable/EditTable.js +434 -0
- package/es/EditTable/FormItem.js +169 -0
- package/es/EditTable/Group.js +204 -0
- package/es/EditTable/Header.js +63 -0
- package/es/EditTable/HeaderRender.js +12 -0
- package/es/EditTable/components/ContextMenu/Menu.js +86 -0
- package/es/EditTable/components/ContextMenu/index.js +96 -0
- package/es/EditTable/components/Search/Search.js +163 -0
- package/es/EditTable/components/Search/Sort.js +119 -0
- package/es/EditTable/components/Search/index.js +2 -0
- package/es/EditTable/consts.js +13 -0
- package/es/EditTable/context.js +88 -0
- package/es/EditTable/hooks/index.js +19 -0
- package/es/EditTable/hooks/useGroup.js +48 -0
- package/es/EditTable/hooks/useResizeObserver.js +27 -0
- package/es/EditTable/hooks/useValidate.js +112 -0
- package/es/EditTable/index.js +25 -0
- package/es/EditTable/props.js +60 -0
- package/es/EditTable/style/body.js +63 -0
- package/es/EditTable/style/form.js +33 -0
- package/es/EditTable/style/group.js +33 -0
- package/es/EditTable/style/header.js +72 -0
- package/es/EditTable/style/index.js +52 -0
- package/es/EditTable/style/menu.js +27 -0
- package/es/EditTable/style/table.js +46 -0
- package/es/EditTable/utils.js +110 -0
- package/es/Ellipsis/Ellipsis.js +148 -0
- package/es/Ellipsis/index.js +7 -0
- package/es/Ellipsis/style/index.js +26 -0
- package/es/Empty/Empty.js +63 -0
- package/es/Empty/image.js +3 -0
- package/es/Empty/index.js +7 -0
- package/es/FullPage/FullPage.js +19 -0
- package/es/FullPage/index.js +7 -0
- package/es/Icon/Icon.js +49 -0
- package/es/Icon/index.js +7 -0
- package/es/LocaleProvider/LocaleProvider.js +31 -0
- package/es/LocaleProvider/index.js +7 -0
- package/es/LocaleReciver/index.js +24 -0
- package/es/Markdown/Markdown.js +118 -0
- package/es/Markdown/index.js +7 -0
- package/es/PermissionButton/PermissionButton.js +118 -0
- package/es/PermissionButton/confirm.js +94 -0
- package/es/PermissionButton/index.js +9 -0
- package/es/PermissionButton/shared.js +1 -0
- package/es/ProLayout/Basic/BasicLayout.js +422 -0
- package/es/ProLayout/Basic/BasicLayoutStyle.js +51 -0
- package/es/ProLayout/Basic/Header.js +111 -0
- package/es/ProLayout/Basic/HeaderStyle.js +10 -0
- package/es/ProLayout/PageContainer/index.js +354 -0
- package/es/ProLayout/PageContainer/style.js +85 -0
- package/es/ProLayout/RouteContext.js +28 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +241 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +274 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/style.js +204 -0
- package/es/ProLayout/TopHeader/index.js +170 -0
- package/es/ProLayout/TopHeader/style.js +154 -0
- package/es/ProLayout/defaultSettings.js +113 -0
- package/es/ProLayout/index.js +10 -0
- package/es/ProLayout/style/index.js +14 -0
- package/es/ProLayout/util.js +58 -0
- package/es/ProTable/Alert.js +40 -0
- package/es/ProTable/Content.js +97 -0
- package/es/ProTable/Header.js +33 -0
- package/es/ProTable/Pagination.js +55 -0
- package/es/ProTable/ProTable.js +279 -0
- package/es/ProTable/hooks/index.js +2 -0
- package/es/ProTable/hooks/useTableInject.js +6 -0
- package/es/ProTable/hooks/useTableSelection.js +115 -0
- package/es/ProTable/index.js +8 -0
- package/es/ProTable/setting.js +138 -0
- package/es/ProTable/style/index.js +113 -0
- package/es/RadioButton/RadioButton.js +53 -0
- package/es/RadioButton/index.js +8 -0
- package/es/RadioButton/style/index.js +25 -0
- package/es/Scrollbar/Bar.js +76 -0
- package/es/Scrollbar/Scrollbar.js +161 -0
- package/es/Scrollbar/Thumb.js +150 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +7 -0
- package/es/Scrollbar/scrollbarProps.js +100 -0
- package/es/Scrollbar/style/index.js +85 -0
- package/es/Scrollbar/thumbProps.js +10 -0
- package/es/Scrollbar/util.js +39 -0
- package/es/Search/Item.js +239 -0
- package/es/Search/Search.js +90 -0
- package/es/Search/hooks/index.js +117 -0
- package/es/Search/hooks/useRouteQuery.js +86 -0
- package/es/Search/hooks/useSearchItems.js +50 -0
- package/es/Search/hooks/useTermOptions.js +29 -0
- package/es/Search/index.js +10 -0
- package/es/Search/setting.js +245 -0
- package/es/Search/style/index.js +5 -0
- package/es/Search/style/item.js +40 -0
- package/es/Search/style/search.js +177 -0
- package/es/Search/util.js +270 -0
- package/es/Skeleton/Skeleton.js +27 -0
- package/es/Skeleton/components/DashBoardCard.js +27 -0
- package/es/Skeleton/components/DashBoardChart.js +27 -0
- package/es/Skeleton/components/Detail.js +27 -0
- package/es/Skeleton/components/Drawer.js +27 -0
- package/es/Skeleton/components/Item.js +54 -0
- package/es/Skeleton/components/List.js +27 -0
- package/es/Skeleton/components/ListCard.js +28 -0
- package/es/Skeleton/components/ListCardItem.js +20 -0
- package/es/Skeleton/components/ListTable.js +27 -0
- package/es/Skeleton/components/Page.js +26 -0
- package/es/Skeleton/components/Search.js +16 -0
- package/es/Skeleton/components/Tree.js +27 -0
- package/es/Skeleton/index.js +28 -0
- package/es/Skeleton/style/index.js +195 -0
- package/es/TimeFormat/TimeFormat.js +36 -0
- package/es/TimeFormat/index.js +7 -0
- package/es/Title/Title.js +26 -0
- package/es/Title/index.js +7 -0
- package/es/Title/style/index.js +34 -0
- package/es/ValueItem/ValueItem.js +113 -0
- package/es/ValueItem/index.js +7 -0
- package/es/ValueItem/util.js +17 -0
- package/es/VirtualTable/VirtualTable.js +271 -0
- package/es/VirtualTable/data.js +60 -0
- package/es/VirtualTable/index.js +7 -0
- package/es/VirtualTable/style/index.js +34 -0
- package/es/components.js +21 -0
- package/es/index.js +17 -0
- package/es/locale/en-US.js +120 -0
- package/es/locale/zh-CN.js +120 -0
- package/es/style/styleRegister.js +19 -0
- package/es/style/variable.js +4 -0
- package/es/style.js +1 -0
- package/es/utils/constants.js +10 -0
- package/lib/AutoComplete/AutoComplete.js +84 -0
- package/lib/AutoComplete/index.js +7 -0
- package/lib/BadgeStatus/Badge.js +51 -0
- package/lib/BadgeStatus/color.js +14 -0
- package/lib/BadgeStatus/index.js +8 -0
- package/lib/CardSelect/CardSelect.js +141 -0
- package/lib/CardSelect/index.js +7 -0
- package/lib/CardSelect/style/index.js +29 -0
- package/lib/CheckButton/CheckButton.js +122 -0
- package/lib/CheckButton/index.js +7 -0
- package/lib/CheckButton/style/index.js +44 -0
- package/lib/ConfigProvider/ConfigProvider.js +73 -0
- package/lib/ConfigProvider/context.js +26 -0
- package/lib/ConfigProvider/index.js +9 -0
- package/lib/DragModal/DragModal.js +212 -0
- package/lib/DragModal/index.js +7 -0
- package/lib/DragModal/style/index.js +86 -0
- package/lib/EditTable/Body.js +189 -0
- package/lib/EditTable/CellRender.js +12 -0
- package/lib/EditTable/EditTable.js +434 -0
- package/lib/EditTable/FormItem.js +169 -0
- package/lib/EditTable/Group.js +204 -0
- package/lib/EditTable/Header.js +63 -0
- package/lib/EditTable/HeaderRender.js +12 -0
- package/lib/EditTable/components/ContextMenu/Menu.js +86 -0
- package/lib/EditTable/components/ContextMenu/index.js +96 -0
- package/lib/EditTable/components/Search/Search.js +163 -0
- package/lib/EditTable/components/Search/Sort.js +119 -0
- package/lib/EditTable/components/Search/index.js +2 -0
- package/lib/EditTable/consts.js +13 -0
- package/lib/EditTable/context.js +88 -0
- package/lib/EditTable/hooks/index.js +19 -0
- package/lib/EditTable/hooks/useGroup.js +48 -0
- package/lib/EditTable/hooks/useResizeObserver.js +27 -0
- package/lib/EditTable/hooks/useValidate.js +112 -0
- package/lib/EditTable/index.js +25 -0
- package/lib/EditTable/props.js +60 -0
- package/lib/EditTable/style/body.js +63 -0
- package/lib/EditTable/style/form.js +33 -0
- package/lib/EditTable/style/group.js +33 -0
- package/lib/EditTable/style/header.js +72 -0
- package/lib/EditTable/style/index.js +52 -0
- package/lib/EditTable/style/menu.js +27 -0
- package/lib/EditTable/style/table.js +46 -0
- package/lib/EditTable/utils.js +110 -0
- package/lib/Ellipsis/Ellipsis.js +148 -0
- package/lib/Ellipsis/index.js +7 -0
- package/lib/Ellipsis/style/index.js +26 -0
- package/lib/Empty/Empty.js +63 -0
- package/lib/Empty/image.js +3 -0
- package/lib/Empty/index.js +7 -0
- package/lib/FullPage/FullPage.js +19 -0
- package/lib/FullPage/index.js +7 -0
- package/lib/Icon/Icon.js +49 -0
- package/lib/Icon/index.js +7 -0
- package/lib/LocaleProvider/LocaleProvider.js +31 -0
- package/lib/LocaleProvider/index.js +7 -0
- package/lib/LocaleReciver/index.js +24 -0
- package/lib/Markdown/Markdown.js +118 -0
- package/lib/Markdown/index.js +7 -0
- package/lib/PermissionButton/PermissionButton.js +118 -0
- package/lib/PermissionButton/confirm.js +94 -0
- package/lib/PermissionButton/index.js +9 -0
- package/lib/PermissionButton/shared.js +1 -0
- package/lib/ProLayout/Basic/BasicLayout.js +422 -0
- package/lib/ProLayout/Basic/BasicLayoutStyle.js +51 -0
- package/lib/ProLayout/Basic/Header.js +111 -0
- package/lib/ProLayout/Basic/HeaderStyle.js +10 -0
- package/lib/ProLayout/PageContainer/index.js +354 -0
- package/lib/ProLayout/PageContainer/style.js +85 -0
- package/lib/ProLayout/RouteContext.js +28 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +241 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +274 -0
- package/lib/ProLayout/SiderMenu/index.js +2 -0
- package/lib/ProLayout/SiderMenu/style.js +204 -0
- package/lib/ProLayout/TopHeader/index.js +170 -0
- package/lib/ProLayout/TopHeader/style.js +154 -0
- package/lib/ProLayout/defaultSettings.js +113 -0
- package/lib/ProLayout/index.js +10 -0
- package/lib/ProLayout/style/index.js +14 -0
- package/lib/ProLayout/util.js +58 -0
- package/lib/ProTable/Alert.js +40 -0
- package/lib/ProTable/Content.js +97 -0
- package/lib/ProTable/Header.js +33 -0
- package/lib/ProTable/Pagination.js +55 -0
- package/lib/ProTable/ProTable.js +279 -0
- package/lib/ProTable/hooks/index.js +2 -0
- package/lib/ProTable/hooks/useTableInject.js +6 -0
- package/lib/ProTable/hooks/useTableSelection.js +115 -0
- package/lib/ProTable/index.js +8 -0
- package/lib/ProTable/setting.js +138 -0
- package/lib/ProTable/style/index.js +113 -0
- package/lib/RadioButton/RadioButton.js +53 -0
- package/lib/RadioButton/index.js +8 -0
- package/lib/RadioButton/style/index.js +25 -0
- package/lib/Scrollbar/Bar.js +76 -0
- package/lib/Scrollbar/Scrollbar.js +161 -0
- package/lib/Scrollbar/Thumb.js +150 -0
- package/lib/Scrollbar/constants.js +1 -0
- package/lib/Scrollbar/index.js +7 -0
- package/lib/Scrollbar/scrollbarProps.js +100 -0
- package/lib/Scrollbar/style/index.js +85 -0
- package/lib/Scrollbar/thumbProps.js +10 -0
- package/lib/Scrollbar/util.js +39 -0
- package/lib/Search/Item.js +239 -0
- package/lib/Search/Search.js +90 -0
- package/lib/Search/hooks/index.js +117 -0
- package/lib/Search/hooks/useRouteQuery.js +86 -0
- package/lib/Search/hooks/useSearchItems.js +50 -0
- package/lib/Search/hooks/useTermOptions.js +29 -0
- package/lib/Search/index.js +10 -0
- package/lib/Search/setting.js +245 -0
- package/lib/Search/style/index.js +5 -0
- package/lib/Search/style/item.js +40 -0
- package/lib/Search/style/search.js +177 -0
- package/lib/Search/util.js +270 -0
- package/lib/Skeleton/Skeleton.js +27 -0
- package/lib/Skeleton/components/DashBoardCard.js +27 -0
- package/lib/Skeleton/components/DashBoardChart.js +27 -0
- package/lib/Skeleton/components/Detail.js +27 -0
- package/lib/Skeleton/components/Drawer.js +27 -0
- package/lib/Skeleton/components/Item.js +54 -0
- package/lib/Skeleton/components/List.js +27 -0
- package/lib/Skeleton/components/ListCard.js +28 -0
- package/lib/Skeleton/components/ListCardItem.js +20 -0
- package/lib/Skeleton/components/ListTable.js +27 -0
- package/lib/Skeleton/components/Page.js +26 -0
- package/lib/Skeleton/components/Search.js +16 -0
- package/lib/Skeleton/components/Tree.js +27 -0
- package/lib/Skeleton/index.js +28 -0
- package/lib/Skeleton/style/index.js +195 -0
- package/lib/TimeFormat/TimeFormat.js +36 -0
- package/lib/TimeFormat/index.js +7 -0
- package/lib/Title/Title.js +26 -0
- package/lib/Title/index.js +7 -0
- package/lib/Title/style/index.js +34 -0
- package/lib/ValueItem/ValueItem.js +113 -0
- package/lib/ValueItem/index.js +7 -0
- package/lib/ValueItem/util.js +17 -0
- package/lib/VirtualTable/VirtualTable.js +271 -0
- package/lib/VirtualTable/data.js +60 -0
- package/lib/VirtualTable/index.js +7 -0
- package/lib/VirtualTable/style/index.js +34 -0
- package/lib/components.js +21 -0
- package/lib/index.js +17 -0
- package/lib/locale/en-US.js +120 -0
- package/lib/locale/zh-CN.js +120 -0
- package/lib/style/styleRegister.js +19 -0
- package/lib/style/variable.js +4 -0
- package/lib/style.js +1 -0
- package/lib/utils/constants.js +10 -0
- package/package.json +164 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { computed, unref, createVNode as _createVNode, createTextVNode as _createTextVNode, Fragment as _Fragment } from 'vue';
|
|
2
|
+
import { LayoutSider as Sider, Menu, Tooltip } from 'ant-design-vue';
|
|
3
|
+
import BaseMenu, { baseMenuProps } from './BaseMenu.js';
|
|
4
|
+
import { defaultSettingProps, LayoutType } from '../defaultSettings';
|
|
5
|
+
import PropTypes from 'ant-design-vue/es/_util/vue-types';
|
|
6
|
+
import IconFont from '../../Icon';
|
|
7
|
+
import { useRouteContext } from '../RouteContext';
|
|
8
|
+
import useProLayoutStyle from '../style';
|
|
9
|
+
export const siderMenuProps = {
|
|
10
|
+
...defaultSettingProps,
|
|
11
|
+
...baseMenuProps,
|
|
12
|
+
logo: {
|
|
13
|
+
type: [Object, String, Function],
|
|
14
|
+
default: () => undefined
|
|
15
|
+
},
|
|
16
|
+
logoStyle: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default: () => undefined
|
|
19
|
+
},
|
|
20
|
+
siderWidth: PropTypes.number.def(208),
|
|
21
|
+
headerHeight: PropTypes.number.def(48),
|
|
22
|
+
collapsedWidth: PropTypes.number.def(48),
|
|
23
|
+
menuHeaderRender: {
|
|
24
|
+
type: [Function, Object, Boolean],
|
|
25
|
+
default: () => undefined
|
|
26
|
+
},
|
|
27
|
+
menuContentRender: {
|
|
28
|
+
type: [Function, Object, Boolean],
|
|
29
|
+
default: () => undefined
|
|
30
|
+
},
|
|
31
|
+
menuExtraRender: {
|
|
32
|
+
type: [Function, Object, Boolean],
|
|
33
|
+
default: () => undefined
|
|
34
|
+
},
|
|
35
|
+
collapsedButtonRender: {
|
|
36
|
+
type: [Function, Object, Boolean],
|
|
37
|
+
default: () => undefined
|
|
38
|
+
},
|
|
39
|
+
linksRender: {
|
|
40
|
+
type: [Function, Object, Boolean],
|
|
41
|
+
default: () => undefined
|
|
42
|
+
},
|
|
43
|
+
breakpoint: {
|
|
44
|
+
type: [Object, Boolean],
|
|
45
|
+
default: () => false
|
|
46
|
+
},
|
|
47
|
+
splitMenus: PropTypes.looseBool,
|
|
48
|
+
fixed: PropTypes.looseBool,
|
|
49
|
+
hide: PropTypes.looseBool,
|
|
50
|
+
matchMenuKeys: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => []
|
|
53
|
+
},
|
|
54
|
+
// events
|
|
55
|
+
onMenuHeaderClick: PropTypes.func,
|
|
56
|
+
onMenuClick: PropTypes.func,
|
|
57
|
+
onCollapse: {
|
|
58
|
+
type: Function
|
|
59
|
+
},
|
|
60
|
+
onOpenKeys: {
|
|
61
|
+
type: Function
|
|
62
|
+
},
|
|
63
|
+
onSelect: {
|
|
64
|
+
type: Function
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
export const defaultRenderLogo = (logo, logoStyle, application, props) => {
|
|
68
|
+
if (!logo) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
if (typeof logo === 'function') {
|
|
72
|
+
// @ts-ignore
|
|
73
|
+
return logo();
|
|
74
|
+
}
|
|
75
|
+
if (typeof logo === 'string') {
|
|
76
|
+
return application.length ? _createVNode(Tooltip, {
|
|
77
|
+
"placement": "rightTop",
|
|
78
|
+
"color": "#fff",
|
|
79
|
+
"arrowPointAtCenter": true
|
|
80
|
+
}, {
|
|
81
|
+
default: () => [_createVNode("img", {
|
|
82
|
+
"src": logo,
|
|
83
|
+
"alt": "logo",
|
|
84
|
+
"style": logoStyle
|
|
85
|
+
}, null)],
|
|
86
|
+
title: () => application.map(item => _createVNode("div", {
|
|
87
|
+
"class": "sider-app-menus"
|
|
88
|
+
}, [_createVNode("div", {
|
|
89
|
+
"class": "sider-app-menus-item",
|
|
90
|
+
"onClick": () => props.onAppMenuClick(item)
|
|
91
|
+
}, [item.label])]))
|
|
92
|
+
}) : _createVNode("img", {
|
|
93
|
+
"src": logo,
|
|
94
|
+
"alt": "logo",
|
|
95
|
+
"style": logoStyle
|
|
96
|
+
}, null);
|
|
97
|
+
}
|
|
98
|
+
return logo;
|
|
99
|
+
};
|
|
100
|
+
export const defaultRenderLogoAndTitle = (props, renderKey = 'menuHeaderRender') => {
|
|
101
|
+
const {
|
|
102
|
+
logo = 'http://demo.jetlinks.cn/static/logo.760eb65c.png',
|
|
103
|
+
logoStyle,
|
|
104
|
+
title,
|
|
105
|
+
layout,
|
|
106
|
+
apps,
|
|
107
|
+
baseClassName
|
|
108
|
+
} = props;
|
|
109
|
+
const logoDom = defaultRenderLogo(logo, logoStyle, apps, props);
|
|
110
|
+
if (props.layoutType === LayoutType.CARD) {
|
|
111
|
+
return _createVNode("a", null, [_createTextVNode(" "), logoDom]);
|
|
112
|
+
}
|
|
113
|
+
const renderFunction = props[renderKey || ''];
|
|
114
|
+
if (layout === 'mix' && renderFunction === false) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const titleDom = _createVNode("h1", null, [title]);
|
|
118
|
+
if (renderKey === 'menuHeaderRender') {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
// call menuHeaderRender
|
|
122
|
+
if (typeof renderFunction === 'function') {
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
return renderFunction(logoDom, props.collapsed ? null : titleDom, props);
|
|
125
|
+
}
|
|
126
|
+
if (Array.isArray(renderFunction)) {
|
|
127
|
+
return _createVNode(_Fragment, null, [renderFunction]);
|
|
128
|
+
}
|
|
129
|
+
return _createVNode("a", null, [logoDom, props.collapsed ? null : titleDom]);
|
|
130
|
+
};
|
|
131
|
+
export const defaultRenderCollapsedButton = collapsed => {
|
|
132
|
+
return collapsed ? _createVNode(IconFont, {
|
|
133
|
+
"type": "MenuUnfoldOutlined"
|
|
134
|
+
}, null) : _createVNode(IconFont, {
|
|
135
|
+
"type": "MenuFoldOutlined"
|
|
136
|
+
}, null);
|
|
137
|
+
};
|
|
138
|
+
const SiderMenu = props => {
|
|
139
|
+
const {
|
|
140
|
+
collapsed,
|
|
141
|
+
siderWidth,
|
|
142
|
+
breakpoint,
|
|
143
|
+
collapsedWidth = 48,
|
|
144
|
+
menuExtraRender = false,
|
|
145
|
+
menuContentRender = false,
|
|
146
|
+
collapsedButtonRender = defaultRenderCollapsedButton,
|
|
147
|
+
linksRender,
|
|
148
|
+
theme
|
|
149
|
+
} = props;
|
|
150
|
+
const prefixCls = computed(() => 'pro-layout');
|
|
151
|
+
const [wrapSSR, hashId] = useProLayoutStyle(prefixCls);
|
|
152
|
+
const context = useRouteContext();
|
|
153
|
+
const getPrefixCls = context.getPrefixCls;
|
|
154
|
+
const baseClassName = getPrefixCls('sider');
|
|
155
|
+
const hasSplitMenu = computed(() => {
|
|
156
|
+
return props.layout === 'mix' && props.splitMenus;
|
|
157
|
+
});
|
|
158
|
+
const sSideWidth = computed(() => {
|
|
159
|
+
return props.collapsed ? props.collapsedWidth : props.siderWidth;
|
|
160
|
+
});
|
|
161
|
+
const classNames = computed(() => ({
|
|
162
|
+
[baseClassName]: true,
|
|
163
|
+
[`${baseClassName}-fixed`]: context.fixSiderbar,
|
|
164
|
+
[`${baseClassName}-${theme}`]: true,
|
|
165
|
+
[`${baseClassName}-layout-${props.layout}`]: props.layout,
|
|
166
|
+
[hashId.value]: true
|
|
167
|
+
}));
|
|
168
|
+
const logCls = computed(() => ({
|
|
169
|
+
[`${baseClassName}-logo`]: true,
|
|
170
|
+
[`${baseClassName}-logo-card`]: props.layoutType === LayoutType.CARD
|
|
171
|
+
}));
|
|
172
|
+
const handleSelect = $event => {
|
|
173
|
+
if (props.onSelect) {
|
|
174
|
+
if (unref(hasSplitMenu)) {
|
|
175
|
+
props.onSelect([context.selectedKeys[0], ...$event]);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
props.onSelect($event);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const headerDom = defaultRenderLogoAndTitle({
|
|
182
|
+
...props,
|
|
183
|
+
baseClassName
|
|
184
|
+
});
|
|
185
|
+
const extraDom = menuExtraRender && menuExtraRender(props);
|
|
186
|
+
if (props.layoutType !== LayoutType.CARD && hasSplitMenu.value && unref(context.flatMenuData).length === 0) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
const defaultMenuDom = _createVNode(BaseMenu, {
|
|
190
|
+
"prefixCls": getPrefixCls(),
|
|
191
|
+
"locale": props.locale || context.locale,
|
|
192
|
+
"theme": theme,
|
|
193
|
+
"mode": "inline",
|
|
194
|
+
"menuData": hasSplitMenu.value ? context.flatMenuData : context.menuData,
|
|
195
|
+
"collapsed": props.collapsed,
|
|
196
|
+
"openKeys": context.openKeys,
|
|
197
|
+
"selectedKeys": context.selectedKeys,
|
|
198
|
+
"menuItemRender": props.menuItemRender,
|
|
199
|
+
"subMenuItemRender": props.subMenuItemRender,
|
|
200
|
+
"iconfontUrl": props.iconfontUrl,
|
|
201
|
+
"onClick": props.onMenuClick,
|
|
202
|
+
"style": {
|
|
203
|
+
width: '100%'
|
|
204
|
+
},
|
|
205
|
+
"class": `${baseClassName}-menu`,
|
|
206
|
+
"onUpdate:openKeys": $event => props.onOpenKeys && props.onOpenKeys($event),
|
|
207
|
+
"onUpdate:selectedKeys": handleSelect
|
|
208
|
+
}, null);
|
|
209
|
+
return _createVNode(_Fragment, null, [context.fixSiderbar && _createVNode("div", {
|
|
210
|
+
"style": {
|
|
211
|
+
width: `${sSideWidth.value}px`,
|
|
212
|
+
overflow: 'hidden',
|
|
213
|
+
flex: `0 0 ${sSideWidth.value}px`,
|
|
214
|
+
maxWidth: `${sSideWidth.value}px`,
|
|
215
|
+
minWidth: `${sSideWidth.value}px`,
|
|
216
|
+
transition: 'background-color 0.3s, min-width 0.3s, max-width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
217
|
+
}
|
|
218
|
+
}, null), _createVNode(Sider, {
|
|
219
|
+
"collapsible": true,
|
|
220
|
+
"trigger": null,
|
|
221
|
+
"collapsed": collapsed,
|
|
222
|
+
"breakpoint": breakpoint || undefined,
|
|
223
|
+
"onCollapse": collapse => {
|
|
224
|
+
props.onCollapse?.(collapse);
|
|
225
|
+
},
|
|
226
|
+
"collapsedWidth": collapsedWidth,
|
|
227
|
+
"style": {
|
|
228
|
+
overflow: 'hidden',
|
|
229
|
+
paddingTop: `${props.headerHeight}px`,
|
|
230
|
+
zIndex: props.layoutType === LayoutType.PAD ? 200 : 1
|
|
231
|
+
},
|
|
232
|
+
"width": siderWidth,
|
|
233
|
+
"theme": theme,
|
|
234
|
+
"class": classNames.value
|
|
235
|
+
}, {
|
|
236
|
+
default: () => [headerDom && _createVNode("div", {
|
|
237
|
+
"class": logCls.value,
|
|
238
|
+
"onClick": props.layout !== 'mix' ? props.onMenuHeaderClick : undefined,
|
|
239
|
+
"id": "logo",
|
|
240
|
+
"style": props?.logoStyle
|
|
241
|
+
}, [headerDom]), extraDom && _createVNode("div", {
|
|
242
|
+
"class": {
|
|
243
|
+
[`${baseClassName}-extra`]: true,
|
|
244
|
+
[`${baseClassName}-extra-no-logo`]: !headerDom
|
|
245
|
+
}
|
|
246
|
+
}, [extraDom]), _createVNode("div", {
|
|
247
|
+
"class": `${baseClassName}-body`,
|
|
248
|
+
"style": "flex: 1; overflow: hidden auto;"
|
|
249
|
+
}, [props.layoutType !== LayoutType.CARD ? menuContentRender && menuContentRender(props, defaultMenuDom) || defaultMenuDom : null]), _createVNode("div", {
|
|
250
|
+
"class": `${baseClassName}-links`
|
|
251
|
+
}, [linksRender ? linksRender() : collapsedButtonRender !== false ? _createVNode(Menu, {
|
|
252
|
+
"class": `${baseClassName}-link-menu`,
|
|
253
|
+
"inlineIndent": 16,
|
|
254
|
+
"theme": theme,
|
|
255
|
+
"selectedKeys": [],
|
|
256
|
+
"openKeys": [],
|
|
257
|
+
"mode": "inline",
|
|
258
|
+
"onClick": () => {
|
|
259
|
+
if (props.onCollapse) {
|
|
260
|
+
props.onCollapse(!props.collapsed);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}, {
|
|
264
|
+
default: () => [_createVNode(Menu.Item, {
|
|
265
|
+
"key": "collapsed-button",
|
|
266
|
+
"class": `${baseClassName}-collapsed-button`,
|
|
267
|
+
"title": false
|
|
268
|
+
}, {
|
|
269
|
+
default: () => [collapsedButtonRender && typeof collapsedButtonRender === 'function' ? collapsedButtonRender(collapsed) : collapsedButtonRender]
|
|
270
|
+
})]
|
|
271
|
+
}) : null])]
|
|
272
|
+
})]);
|
|
273
|
+
};
|
|
274
|
+
export default SiderMenu;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Keyframes } from 'ant-design-vue'
|
|
2
|
+
|
|
3
|
+
export const genSiderMenuStyle = (config) => {
|
|
4
|
+
const { token } = config
|
|
5
|
+
const proLayoutSiderMenuCls = `${token.antCls}-pro-sider`
|
|
6
|
+
const proLayoutHeaderHeight = '48px'
|
|
7
|
+
const proLayoutTitleHideKeyframes = new Keyframes('pro-layout-title-hide', {
|
|
8
|
+
'0%': {
|
|
9
|
+
display: 'none',
|
|
10
|
+
opacity: 0
|
|
11
|
+
},
|
|
12
|
+
'80%': {
|
|
13
|
+
display: 'none',
|
|
14
|
+
opacity: 0
|
|
15
|
+
},
|
|
16
|
+
'100%': {
|
|
17
|
+
display: 'unset',
|
|
18
|
+
opacity: 1
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
[`${proLayoutSiderMenuCls}`]: {
|
|
24
|
+
position: 'relative',
|
|
25
|
+
backgroundColor: '#001529',
|
|
26
|
+
borderRight: 0,
|
|
27
|
+
// FIXME: 临时修正(可能不会做兼容)
|
|
28
|
+
zIndex: 20,
|
|
29
|
+
[`${token.antCls}-menu`]: {
|
|
30
|
+
background: 'transparent'
|
|
31
|
+
},
|
|
32
|
+
[`&${token.antCls}-layout-sider-light`]: {
|
|
33
|
+
[`${token.antCls}-menu-item a`]: {
|
|
34
|
+
color: token.colorTextHeading
|
|
35
|
+
},
|
|
36
|
+
[`${token.antCls}-menu-item-selected a, ${token.antCls}-menu-item a:hover`]: {
|
|
37
|
+
color: token.colorPrimary
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[`${proLayoutSiderMenuCls}-logo`]: {
|
|
41
|
+
position: 'relative',
|
|
42
|
+
display: 'flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
padding: '16px 16px',
|
|
45
|
+
cursor: 'pointer',
|
|
46
|
+
transition: 'padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)',
|
|
47
|
+
'> a': {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
minHeight: 32
|
|
52
|
+
},
|
|
53
|
+
'img': {
|
|
54
|
+
display: 'inline-block',
|
|
55
|
+
height: 32,
|
|
56
|
+
verticalAlign: 'middle'
|
|
57
|
+
},
|
|
58
|
+
'h1': {
|
|
59
|
+
display: 'inline-block',
|
|
60
|
+
height: '32px',
|
|
61
|
+
margin: '0 0 0 12px',
|
|
62
|
+
color: 'white',
|
|
63
|
+
fontWeight: 600,
|
|
64
|
+
fontSize: '18px',
|
|
65
|
+
lineHeight: '32px',
|
|
66
|
+
verticalAlign: 'middle',
|
|
67
|
+
animationName: proLayoutTitleHideKeyframes,
|
|
68
|
+
animationDuration: '0.3s'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
[`${proLayoutSiderMenuCls}-logo-card`]: {
|
|
72
|
+
padding: '16px 0',
|
|
73
|
+
justifyContent: 'center'
|
|
74
|
+
},
|
|
75
|
+
[`${proLayoutSiderMenuCls}-extra`]: {
|
|
76
|
+
marginBottom: '16px',
|
|
77
|
+
padding: '0 16px',
|
|
78
|
+
[`${proLayoutSiderMenuCls}-extra-no-logo`]: {
|
|
79
|
+
marginTop: '16px'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[`${proLayoutSiderMenuCls}-menu`]: {
|
|
83
|
+
position: 'relative',
|
|
84
|
+
zIndex: 10,
|
|
85
|
+
minHeight: '100%',
|
|
86
|
+
boxShadow: '2px 0 6px rgba(0, 21, 41, 0.35)'
|
|
87
|
+
},
|
|
88
|
+
[`${token.antCls}-layout-sider-children`]: {
|
|
89
|
+
display: 'flex',
|
|
90
|
+
flexDirection: 'column',
|
|
91
|
+
height: '100%',
|
|
92
|
+
'::-webkit-scrollbar': {
|
|
93
|
+
width: '6px',
|
|
94
|
+
height: '6px'
|
|
95
|
+
},
|
|
96
|
+
'::webkit-scrollbar-track': {
|
|
97
|
+
background: 'rgba(255, 255, 255, 0.15)',
|
|
98
|
+
borderRadius: '3px',
|
|
99
|
+
boxShadow: 'inset 0 0 5px rgba(37, 37, 37, 0.05)'
|
|
100
|
+
},
|
|
101
|
+
/* 滚动条滑块 */
|
|
102
|
+
'::-webkit-scrollbar-thumb': {
|
|
103
|
+
background: 'rgba(255, 255, 255, 0.2)',
|
|
104
|
+
borderRadius: '3px',
|
|
105
|
+
boxShadow: 'inset 0 0 5px rgba(255, 255, 255, 0.05)'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
[`&${token.antCls}-layout-sider-collapsed`]: {
|
|
109
|
+
[`${token.antCls}-menu-inline-collapsed`]: {
|
|
110
|
+
width: '48px'
|
|
111
|
+
},
|
|
112
|
+
[`${proLayoutSiderMenuCls}`]: {
|
|
113
|
+
[`${proLayoutSiderMenuCls}-logo`]: {
|
|
114
|
+
padding: '16px 24px'
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
[`&${token.antCls}-layout-sider${proLayoutSiderMenuCls}-fixed`]: {
|
|
119
|
+
position: 'fixed',
|
|
120
|
+
top: 0,
|
|
121
|
+
left: 0,
|
|
122
|
+
zIndex: 99,
|
|
123
|
+
height: '100%',
|
|
124
|
+
overflow: 'auto',
|
|
125
|
+
overflowX: 'hidden',
|
|
126
|
+
boxShadow: '2px 0 8px 0 rgba(29, 35, 41, 0.05)',
|
|
127
|
+
[`> ${token.antCls}-menu-root`]: {
|
|
128
|
+
[`:not${proLayoutSiderMenuCls}-link-menu`]: {
|
|
129
|
+
height: `calc(100vh - ${proLayoutHeaderHeight})`,
|
|
130
|
+
overflowY: 'auto'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
[`${proLayoutSiderMenuCls}-light`]: {
|
|
135
|
+
backgroundColor: token.colorBgContainer,
|
|
136
|
+
boxShadow: '2px 0 8px 0 rgba(29, 35, 41, 0.05)',
|
|
137
|
+
[`${token.antCls}-layout-sider-children`]: {
|
|
138
|
+
'::webkit-scrollbar-track': {
|
|
139
|
+
background: 'rgba(0, 0, 0, 0.06)',
|
|
140
|
+
borderRadius: '3px',
|
|
141
|
+
boxShadow: 'inset 0 0 5px rgba(0, 21, 41, 0.05)',
|
|
142
|
+
/* 滚动条滑块 */
|
|
143
|
+
'::-webkit-scrollbar-thumb': {
|
|
144
|
+
background: 'rgba(0, 0, 0, 0.12)',
|
|
145
|
+
borderRadius: '3px',
|
|
146
|
+
boxShadow: 'inset 0 0 5px rgba(0, 21, 41, 0.05)'
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
[`${proLayoutSiderMenuCls}-logo`]: {
|
|
151
|
+
'h1': {
|
|
152
|
+
color: token.colorPrimary
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
[`${token.antCls}-menu-light`]: {
|
|
156
|
+
borderRightColor: 'transparent'
|
|
157
|
+
},
|
|
158
|
+
[`${proLayoutSiderMenuCls}-collapsed-button`]: {
|
|
159
|
+
borderTop: `${token.lineWidth} solid ${token.colorSplit}`
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
[`${proLayoutSiderMenuCls}-icon`]: {
|
|
163
|
+
width: '14px',
|
|
164
|
+
verticalAlign: 'baseline'
|
|
165
|
+
},
|
|
166
|
+
[`${proLayoutSiderMenuCls}-link`]: {
|
|
167
|
+
width: '100%',
|
|
168
|
+
[`ul${token.antCls}-menu-root`]: {
|
|
169
|
+
height: 'auto'
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
[`${proLayoutSiderMenuCls}-collapsed-button`]: {
|
|
173
|
+
borderTop: `${token.lineWidth} solid rgba(0, 0, 0, 0.25)`,
|
|
174
|
+
'.anticon': {
|
|
175
|
+
fontSize: '16px'
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
[`.top-nav-menu li${token.antCls}-menu-item`]: {
|
|
179
|
+
height: '100%',
|
|
180
|
+
lineHeight: 1
|
|
181
|
+
},
|
|
182
|
+
'.drawer .drawer-content': {
|
|
183
|
+
background: '#001529'
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
[`${token.antCls}-pro-menu-item`]: {
|
|
187
|
+
[`.anticon${token.antCls}-pro-menu-item-title`]: {
|
|
188
|
+
marginLeft: '10px'
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
'.sider-app-menus': {
|
|
192
|
+
width: '100px',
|
|
193
|
+
backgroundColor: '#fff',
|
|
194
|
+
cursor: 'pointer',
|
|
195
|
+
padding: '6px',
|
|
196
|
+
transition: 'all .3s',
|
|
197
|
+
borderRadius: '4px',
|
|
198
|
+
color: '#333',
|
|
199
|
+
'&:hover': {
|
|
200
|
+
backgroundColor: '#efefef'
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { computed, ref, createVNode as _createVNode, mergeProps as _mergeProps } from 'vue';
|
|
2
|
+
import { default as ResizeObserver } from 'ant-design-vue/es/vc-resize-observer';
|
|
3
|
+
import { defaultRenderLogoAndTitle, siderMenuProps } from '../SiderMenu/SiderMenu';
|
|
4
|
+
import PropTypes from 'ant-design-vue/es/_util/vue-types';
|
|
5
|
+
import { defaultSettingProps, LayoutType } from '../defaultSettings';
|
|
6
|
+
import { defaultPrefixCls, useRouteContext } from '../RouteContext';
|
|
7
|
+
import BaseMenu from '../SiderMenu/BaseMenu.js';
|
|
8
|
+
import { clearMenuItem } from '../util';
|
|
9
|
+
import useProLayoutStyle from '../style';
|
|
10
|
+
export const baseHeaderProps = {
|
|
11
|
+
...defaultSettingProps,
|
|
12
|
+
prefixCls: PropTypes.string.def('ant-pro'),
|
|
13
|
+
collapsed: PropTypes.looseBool,
|
|
14
|
+
logo: siderMenuProps.logo,
|
|
15
|
+
logoStyle: siderMenuProps.logoStyle,
|
|
16
|
+
headerTheme: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'dark'
|
|
19
|
+
},
|
|
20
|
+
menuData: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => []
|
|
23
|
+
},
|
|
24
|
+
splitMenus: siderMenuProps.splitMenus,
|
|
25
|
+
menuRender: {
|
|
26
|
+
type: [Object, Function],
|
|
27
|
+
default: () => undefined
|
|
28
|
+
},
|
|
29
|
+
menuHeaderRender: siderMenuProps.menuHeaderRender,
|
|
30
|
+
menuItemRender: siderMenuProps.menuItemRender,
|
|
31
|
+
topHeaderMenuRender: {
|
|
32
|
+
type: [Function, Object, Boolean],
|
|
33
|
+
default: () => undefined
|
|
34
|
+
},
|
|
35
|
+
subMenuItemRender: siderMenuProps.subMenuItemRender,
|
|
36
|
+
rightContentRender: {
|
|
37
|
+
type: [Object, Function],
|
|
38
|
+
default: () => undefined
|
|
39
|
+
},
|
|
40
|
+
collapsedButtonRender: siderMenuProps.collapsedButtonRender,
|
|
41
|
+
matchMenuKeys: siderMenuProps.matchMenuKeys,
|
|
42
|
+
// events
|
|
43
|
+
onMenuHeaderClick: PropTypes.func,
|
|
44
|
+
onCollapse: siderMenuProps.onCollapse,
|
|
45
|
+
onOpenKeys: siderMenuProps.onOpenKeys,
|
|
46
|
+
onSelect: siderMenuProps.onSelect,
|
|
47
|
+
headerLeftWidth: Number
|
|
48
|
+
};
|
|
49
|
+
export const topNavHeaderProps = {
|
|
50
|
+
...siderMenuProps,
|
|
51
|
+
...baseHeaderProps
|
|
52
|
+
};
|
|
53
|
+
const RightContent = ({
|
|
54
|
+
rightContentRender,
|
|
55
|
+
...props
|
|
56
|
+
}) => {
|
|
57
|
+
const rightSize = ref('auto');
|
|
58
|
+
return _createVNode("div", {
|
|
59
|
+
"style": {
|
|
60
|
+
minWidth: rightSize.value
|
|
61
|
+
}
|
|
62
|
+
}, [_createVNode("div", {
|
|
63
|
+
"style": {
|
|
64
|
+
paddingRight: 8
|
|
65
|
+
}
|
|
66
|
+
}, [_createVNode(ResizeObserver, {
|
|
67
|
+
"onResize": ({
|
|
68
|
+
width
|
|
69
|
+
}) => {
|
|
70
|
+
rightSize.value = width;
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
default: () => [rightContentRender && typeof rightContentRender === 'function' ? _createVNode("div", null, [rightContentRender({
|
|
74
|
+
...props
|
|
75
|
+
})]) : rightContentRender]
|
|
76
|
+
})])]);
|
|
77
|
+
};
|
|
78
|
+
export const TopNavHeader = props => {
|
|
79
|
+
const headerRef = ref();
|
|
80
|
+
const {
|
|
81
|
+
prefixCls: propPrefixCls,
|
|
82
|
+
onMenuHeaderClick,
|
|
83
|
+
onOpenKeys,
|
|
84
|
+
onSelect,
|
|
85
|
+
contentWidth,
|
|
86
|
+
rightContentRender,
|
|
87
|
+
topHeaderMenuRender,
|
|
88
|
+
layout,
|
|
89
|
+
menuData,
|
|
90
|
+
mode
|
|
91
|
+
} = props;
|
|
92
|
+
const context = useRouteContext();
|
|
93
|
+
const prefixCls = `${propPrefixCls || defaultPrefixCls}-top-nav-header`;
|
|
94
|
+
const stylePrefixCls = computed(() => 'pro-layout');
|
|
95
|
+
const [wrapSSR, hashId] = useProLayoutStyle(stylePrefixCls);
|
|
96
|
+
const headerDom = defaultRenderLogoAndTitle({
|
|
97
|
+
...props,
|
|
98
|
+
collapsed: false
|
|
99
|
+
},
|
|
100
|
+
// REMARK:: Any time render header title
|
|
101
|
+
// layout === 'mix' ? 'headerTitleRender' : undefined,
|
|
102
|
+
// layout !== 'side' ? 'headerTitleRender' : undefined,
|
|
103
|
+
'headerTitleRender');
|
|
104
|
+
|
|
105
|
+
//
|
|
106
|
+
let MenusData = props.layout === 'side' ? [] : menuData;
|
|
107
|
+
if (props.layout === 'mix' && props.splitMenus) {
|
|
108
|
+
const noChildrenMenuData = (menuData || []).map(item => {
|
|
109
|
+
return {
|
|
110
|
+
...item,
|
|
111
|
+
children: undefined,
|
|
112
|
+
component: undefined
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
MenusData = clearMenuItem(noChildrenMenuData);
|
|
116
|
+
}
|
|
117
|
+
const _mode = computed(() => {
|
|
118
|
+
return props.layout === 'mix' && props.splitMenus ? 'horizontal' : mode;
|
|
119
|
+
});
|
|
120
|
+
const className = computed(() => ({
|
|
121
|
+
[prefixCls]: true,
|
|
122
|
+
[hashId.value]: true,
|
|
123
|
+
'light': props.theme === 'light',
|
|
124
|
+
'dark': props.theme === 'dark'
|
|
125
|
+
}));
|
|
126
|
+
const paddingLeft = computed(() => {
|
|
127
|
+
return context.layoutType === LayoutType.PAD && props.collapsed ? context.headerLeftWidth + 'px' : 0;
|
|
128
|
+
});
|
|
129
|
+
return _createVNode("div", {
|
|
130
|
+
"class": className.value,
|
|
131
|
+
"style": {
|
|
132
|
+
paddingLeft: paddingLeft.value
|
|
133
|
+
}
|
|
134
|
+
}, [_createVNode("div", {
|
|
135
|
+
"ref": headerRef,
|
|
136
|
+
"class": `${prefixCls}-main ${contentWidth === 'Fixed' ? 'wide' : ''}`
|
|
137
|
+
}, [headerDom && _createVNode("div", {
|
|
138
|
+
"class": `${prefixCls}-main-left`,
|
|
139
|
+
"onClick": onMenuHeaderClick
|
|
140
|
+
}, [_createVNode("div", {
|
|
141
|
+
"class": `${prefixCls}-logo`,
|
|
142
|
+
"key": "logo",
|
|
143
|
+
"id": "logo"
|
|
144
|
+
}, [headerDom])]), _createVNode("div", {
|
|
145
|
+
"style": {
|
|
146
|
+
flex: 1
|
|
147
|
+
},
|
|
148
|
+
"class": `${prefixCls}-menu`
|
|
149
|
+
}, [topHeaderMenuRender ? topHeaderMenuRender() : _createVNode(BaseMenu, {
|
|
150
|
+
"prefixCls": propPrefixCls,
|
|
151
|
+
"locale": props.locale || context.locale,
|
|
152
|
+
"theme": props.theme,
|
|
153
|
+
"mode": _mode.value,
|
|
154
|
+
"collapsed": props.collapsed,
|
|
155
|
+
"iconfontUrl": props.iconfontUrl,
|
|
156
|
+
"menuData": MenusData,
|
|
157
|
+
"menuItemRender": props.menuItemRender,
|
|
158
|
+
"subMenuItemRender": props.subMenuItemRender,
|
|
159
|
+
"openKeys": context.openKeys,
|
|
160
|
+
"selectedKeys": context.selectedKeys,
|
|
161
|
+
"class": {
|
|
162
|
+
'top-nav-menu': props.mode === 'horizontal'
|
|
163
|
+
},
|
|
164
|
+
"onUpdate:openKeys": $event => onOpenKeys && onOpenKeys($event),
|
|
165
|
+
"onUpdate:selectedKeys": $event => onSelect && onSelect($event)
|
|
166
|
+
}, null)]), rightContentRender && _createVNode(RightContent, _mergeProps({
|
|
167
|
+
"rightContentRender": rightContentRender
|
|
168
|
+
}, props), null)])]);
|
|
169
|
+
};
|
|
170
|
+
export default TopNavHeader;
|