@jetlinks-web/components 3.0.0-rc → 3.0.0
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 +13 -9
- package/es/BadgeStatus/Badge.js +1 -2
- package/es/BadgeStatus/color.js +3 -3
- package/es/CardSelect/CardSelect.js +23 -13
- package/es/CardSelect/style/index.js +25 -1
- package/es/CheckButton/CheckButton.js +12 -4
- package/es/CheckButton/style/index.js +41 -1
- package/es/DragModal/DragModal.js +14 -8
- package/es/DragModal/style/index.js +64 -1
- package/es/EditTable/Body.js +10 -3
- package/es/EditTable/EditTable.js +13 -7
- package/es/EditTable/FormItem.js +18 -19
- package/es/EditTable/Header.js +16 -6
- package/es/EditTable/components/ContextMenu/Menu.js +11 -5
- package/es/EditTable/components/Search/search.js +1 -2
- package/es/EditTable/components/Search/sort.js +1 -3
- package/es/EditTable/group.js +23 -18
- package/es/EditTable/hooks/useValidate.js +1 -1
- package/es/EditTable/style/body.js +53 -0
- package/es/EditTable/style/form.js +24 -0
- package/es/EditTable/style/group.js +25 -0
- package/es/EditTable/style/header.js +58 -0
- package/es/EditTable/style/index.js +42 -1
- package/es/EditTable/style/menu.js +27 -0
- package/es/EditTable/style/table.js +46 -0
- package/es/EditTable/utils.js +30 -3
- package/es/Ellipsis/Ellipsis.js +10 -2
- package/es/Ellipsis/style/index.js +24 -1
- package/es/FullPage/FullPage.js +1 -2
- package/es/LocaleProvider/index.js +1 -2
- package/es/PermissionButton/index.js +3 -4
- package/es/ProLayout/Basic/BasicLayout.js +45 -41
- package/es/ProLayout/Basic/BasicLayoutStyle.js +39 -0
- package/es/ProLayout/Basic/Header.js +3 -7
- package/es/ProLayout/Basic/HeaderStyle.js +10 -0
- package/es/ProLayout/PageContainer/index.js +21 -17
- package/es/ProLayout/PageContainer/style.js +46 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +13 -37
- package/es/ProLayout/SiderMenu/SiderMenu.js +24 -36
- package/es/ProLayout/SiderMenu/style.js +166 -0
- package/es/ProLayout/TopHeader/index.js +13 -12
- package/es/ProLayout/TopHeader/style.js +126 -0
- package/es/ProLayout/style/index.js +7 -1
- package/es/ProLayout/util.js +5 -5
- package/es/ProTable/Alert.js +12 -4
- package/es/ProTable/Content.js +108 -28
- package/es/ProTable/Header.js +21 -11
- package/es/ProTable/Pagination.js +12 -4
- package/es/ProTable/ProTable.js +42 -26
- package/es/ProTable/hooks/index.js +2 -0
- package/es/ProTable/hooks/useTableInject.js +5 -0
- package/es/ProTable/hooks/useTableSelection.js +95 -0
- package/es/ProTable/setting.js +1 -1
- package/es/ProTable/style/index.js +109 -1
- package/es/RadioButton/RadioButton.js +10 -4
- package/es/RadioButton/style/index.js +23 -1
- package/es/Scrollbar/Scrollbar.js +10 -3
- package/es/Scrollbar/Thumb.js +36 -25
- package/es/Scrollbar/style/index.js +63 -1
- package/es/Search/Advanced/History.js +23 -16
- package/es/Search/Advanced/SaveHistory.js +1 -2
- package/es/Search/Advanced/index.js +213 -292
- package/es/Search/Item.js +175 -415
- package/es/Search/Search.js +78 -172
- package/es/Search/hooks/index.js +108 -1
- package/es/Search/hooks/useRouteQuery.js +57 -0
- package/es/Search/setting.js +132 -14
- package/es/Search/style/index.js +4 -2
- package/es/Search/style/item.js +28 -0
- package/es/Search/style/search.js +133 -0
- package/es/Search/util.js +116 -124
- package/es/Skeleton/components/DashBoardCard.js +64 -0
- package/es/Skeleton/components/DashBoardChart.js +96 -0
- package/es/Skeleton/components/Detail.js +110 -0
- package/es/Skeleton/components/Drawer.js +91 -0
- package/es/Skeleton/components/Item.js +68 -0
- package/es/Skeleton/components/List.js +45 -0
- package/es/Skeleton/components/ListCard.js +63 -0
- package/es/Skeleton/components/ListCardItem.js +86 -0
- package/es/Skeleton/components/ListTable.js +76 -0
- package/es/Skeleton/components/Page.js +62 -0
- package/es/Skeleton/components/Search.js +54 -0
- package/es/Skeleton/components/Tree.js +72 -0
- package/es/Skeleton/index.js +15 -0
- package/es/Skeleton/skeleton.js +58 -0
- package/es/Skeleton/style/index.js +132 -0
- package/es/Title/style/index.js +29 -1
- package/es/Title/title.js +13 -5
- package/es/ValueItem/ValueItem.js +44 -39
- package/es/components.js +1 -4
- package/es/locale/en-US.js +3 -7
- package/es/locale/zh-CN.js +3 -7
- package/es/style/index.js +0 -3
- package/es/style/styleRegister.js +21 -0
- package/es/style/variable.js +4 -0
- package/es/style.js +0 -12
- package/lib/AutoComplete/AutoComplete.js +13 -9
- package/lib/BadgeStatus/Badge.js +1 -2
- package/lib/BadgeStatus/color.js +3 -3
- package/lib/CardSelect/CardSelect.js +23 -13
- package/lib/CardSelect/style/index.js +30 -1
- package/lib/CheckButton/CheckButton.js +12 -4
- package/lib/CheckButton/style/index.js +46 -1
- package/lib/DragModal/DragModal.js +14 -8
- package/lib/DragModal/style/index.js +69 -1
- package/lib/EditTable/Body.js +10 -3
- package/lib/EditTable/EditTable.js +13 -7
- package/lib/EditTable/FormItem.js +18 -19
- package/lib/EditTable/Header.js +16 -6
- package/lib/EditTable/components/ContextMenu/Menu.js +11 -5
- package/lib/EditTable/components/Search/search.js +1 -2
- package/lib/EditTable/components/Search/sort.js +1 -3
- package/lib/EditTable/group.js +23 -18
- package/lib/EditTable/hooks/useValidate.js +1 -1
- package/lib/EditTable/style/body.js +60 -0
- package/lib/EditTable/style/form.js +31 -0
- package/lib/EditTable/style/group.js +32 -0
- package/lib/EditTable/style/header.js +65 -0
- package/lib/EditTable/style/index.js +47 -1
- package/lib/EditTable/style/menu.js +33 -0
- package/lib/EditTable/style/table.js +52 -0
- package/lib/EditTable/utils.js +31 -3
- package/lib/Ellipsis/Ellipsis.js +10 -2
- package/lib/Ellipsis/style/index.js +29 -1
- package/lib/FullPage/FullPage.js +1 -2
- package/lib/LocaleProvider/index.js +1 -2
- package/lib/PermissionButton/index.js +3 -4
- package/lib/ProLayout/Basic/BasicLayout.js +44 -40
- package/lib/ProLayout/Basic/BasicLayoutStyle.js +46 -0
- package/lib/ProLayout/Basic/Header.js +2 -6
- package/lib/ProLayout/Basic/HeaderStyle.js +17 -0
- package/lib/ProLayout/PageContainer/index.js +19 -15
- package/lib/ProLayout/PageContainer/style.js +53 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +14 -37
- package/lib/ProLayout/SiderMenu/SiderMenu.js +23 -35
- package/lib/ProLayout/SiderMenu/style.js +173 -0
- package/lib/ProLayout/TopHeader/index.js +14 -12
- package/lib/ProLayout/TopHeader/style.js +133 -0
- package/lib/ProLayout/style/index.js +12 -1
- package/lib/ProLayout/util.js +5 -5
- package/lib/ProTable/Alert.js +12 -4
- package/lib/ProTable/Content.js +108 -28
- package/lib/ProTable/Header.js +21 -11
- package/lib/ProTable/Pagination.js +12 -4
- package/lib/ProTable/ProTable.js +42 -26
- package/lib/ProTable/hooks/index.js +27 -0
- package/lib/ProTable/hooks/useTableInject.js +11 -0
- package/lib/ProTable/hooks/useTableSelection.js +102 -0
- package/lib/ProTable/setting.js +1 -1
- package/lib/ProTable/style/index.js +114 -1
- package/lib/RadioButton/RadioButton.js +10 -4
- package/lib/RadioButton/style/index.js +28 -1
- package/lib/Scrollbar/Scrollbar.js +10 -3
- package/lib/Scrollbar/Thumb.js +36 -25
- package/lib/Scrollbar/style/index.js +68 -1
- package/lib/Search/Advanced/History.js +23 -16
- package/lib/Search/Advanced/SaveHistory.js +1 -2
- package/lib/Search/Advanced/index.js +213 -292
- package/lib/Search/Item.js +175 -415
- package/lib/Search/Search.js +78 -172
- package/lib/Search/hooks/index.js +130 -1
- package/lib/Search/hooks/useRouteQuery.js +64 -0
- package/lib/Search/setting.js +133 -15
- package/lib/Search/style/index.js +9 -2
- package/lib/Search/style/item.js +35 -0
- package/lib/Search/style/search.js +140 -0
- package/lib/Search/util.js +116 -124
- package/lib/Skeleton/components/DashBoardCard.js +64 -0
- package/lib/Skeleton/components/DashBoardChart.js +96 -0
- package/lib/Skeleton/components/Detail.js +110 -0
- package/lib/Skeleton/components/Drawer.js +91 -0
- package/lib/Skeleton/components/Item.js +68 -0
- package/lib/Skeleton/components/List.js +45 -0
- package/lib/Skeleton/components/ListCard.js +63 -0
- package/lib/Skeleton/components/ListCardItem.js +86 -0
- package/lib/Skeleton/components/ListTable.js +76 -0
- package/lib/Skeleton/components/Page.js +62 -0
- package/lib/Skeleton/components/Search.js +54 -0
- package/lib/Skeleton/components/Tree.js +72 -0
- package/lib/Skeleton/index.js +75 -0
- package/lib/Skeleton/skeleton.js +58 -0
- package/lib/Skeleton/style/index.js +139 -0
- package/lib/Title/style/index.js +34 -1
- package/lib/Title/title.js +13 -5
- package/lib/ValueItem/ValueItem.js +44 -39
- package/lib/components.js +0 -21
- package/lib/locale/en-US.js +3 -7
- package/lib/locale/zh-CN.js +3 -7
- package/lib/style/components.less +0 -1
- package/lib/style/index.js +1 -4
- package/lib/style/styleRegister.js +28 -0
- package/lib/style/variable.js +10 -0
- package/lib/style.js +1 -14
- package/package.json +10 -13
- package/es/AMap/Map.js +0 -133
- package/es/AMap/index.js +0 -5
- package/es/AMap/util.js +0 -56
- package/es/CardSelect/style/index.css +0 -24
- package/es/CardSelect/style/index.less +0 -26
- package/es/CheckButton/style/index.css +0 -37
- package/es/CheckButton/style/index.less +0 -40
- package/es/DragModal/style/index.css +0 -82
- package/es/DragModal/style/index.less +0 -97
- package/es/Echarts/Echarts.js +0 -48
- package/es/Echarts/index.js +0 -5
- package/es/EditTable/style/body.less +0 -66
- package/es/EditTable/style/form.less +0 -33
- package/es/EditTable/style/group.less +0 -32
- package/es/EditTable/style/header.less +0 -77
- package/es/EditTable/style/index.css +0 -267
- package/es/EditTable/style/index.less +0 -41
- package/es/EditTable/style/menu.less +0 -25
- package/es/EditTable/style/table.less +0 -47
- package/es/Ellipsis/style/index.css +0 -17
- package/es/Ellipsis/style/index.less +0 -20
- package/es/FlameGraph/FlameGraph.js +0 -136
- package/es/FlameGraph/index.js +0 -5
- package/es/FlameGraph/style/index.css +0 -43
- package/es/FlameGraph/style/index.js +0 -1
- package/es/FlameGraph/style/index.less +0 -52
- package/es/ProLayout/Basic/BasicLayout.less +0 -66
- package/es/ProLayout/Basic/Header.less +0 -8
- package/es/ProLayout/PageContainer/index.less +0 -103
- package/es/ProLayout/SiderMenu/index.less +0 -231
- package/es/ProLayout/TopHeader/index.less +0 -174
- package/es/ProLayout/style/default.less +0 -4
- package/es/ProLayout/style/style.less +0 -7
- package/es/ProTable/style/ProTable.less +0 -139
- package/es/RadioButton/style/index.css +0 -20
- package/es/RadioButton/style/index.less +0 -19
- package/es/Scrollbar/style/index.css +0 -65
- package/es/Scrollbar/style/index.less +0 -83
- package/es/Search/style/Item.less +0 -33
- package/es/Search/style/Search.less +0 -179
- package/es/Title/style/index.css +0 -23
- package/es/Title/style/index.less +0 -25
- package/es/style/index.css +0 -5234
- package/es/style/index.less +0 -13
- package/es/style/variable.css +0 -4
- package/es/style/variable.less +0 -4
- package/lib/AMap/Map.js +0 -133
- package/lib/AMap/index.js +0 -12
- package/lib/AMap/util.js +0 -62
- package/lib/CardSelect/style/index.css +0 -24
- package/lib/CardSelect/style/index.less +0 -26
- package/lib/CheckButton/style/index.css +0 -37
- package/lib/CheckButton/style/index.less +0 -40
- package/lib/DragModal/style/index.css +0 -82
- package/lib/DragModal/style/index.less +0 -97
- package/lib/Echarts/Echarts.js +0 -48
- package/lib/Echarts/index.js +0 -12
- package/lib/EditTable/style/body.less +0 -66
- package/lib/EditTable/style/form.less +0 -33
- package/lib/EditTable/style/group.less +0 -32
- package/lib/EditTable/style/header.less +0 -77
- package/lib/EditTable/style/index.css +0 -267
- package/lib/EditTable/style/index.less +0 -41
- package/lib/EditTable/style/menu.less +0 -25
- package/lib/EditTable/style/table.less +0 -47
- package/lib/Ellipsis/style/index.css +0 -17
- package/lib/Ellipsis/style/index.less +0 -20
- package/lib/FlameGraph/FlameGraph.js +0 -136
- package/lib/FlameGraph/index.js +0 -12
- package/lib/FlameGraph/style/index.css +0 -43
- package/lib/FlameGraph/style/index.js +0 -3
- package/lib/FlameGraph/style/index.less +0 -52
- package/lib/ProLayout/Basic/BasicLayout.less +0 -66
- package/lib/ProLayout/Basic/Header.less +0 -8
- package/lib/ProLayout/PageContainer/index.less +0 -103
- package/lib/ProLayout/SiderMenu/index.less +0 -231
- package/lib/ProLayout/TopHeader/index.less +0 -174
- package/lib/ProLayout/style/default.less +0 -4
- package/lib/ProLayout/style/style.less +0 -7
- package/lib/ProTable/style/ProTable.less +0 -139
- package/lib/RadioButton/style/index.css +0 -20
- package/lib/RadioButton/style/index.less +0 -19
- package/lib/Scrollbar/style/index.css +0 -65
- package/lib/Scrollbar/style/index.less +0 -83
- package/lib/Search/style/Item.less +0 -33
- package/lib/Search/style/Search.less +0 -179
- package/lib/Title/style/index.css +0 -23
- package/lib/Title/style/index.less +0 -25
- package/lib/style/index.css +0 -5234
- package/lib/style/index.less +0 -13
- package/lib/style/variable.css +0 -4
- package/lib/style/variable.less +0 -4
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { isVNode as _isVNode } from "vue";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
@@ -12,10 +11,6 @@ import IconFont from '../../Icon';
|
|
|
12
11
|
import { regular } from '@jetlinks-web/utils';
|
|
13
12
|
import { Menu } from 'ant-design-vue';
|
|
14
13
|
import { createFromIconfontCN } from '@ant-design/icons-vue';
|
|
15
|
-
import 'ant-design-vue/es/_util/vue-types';
|
|
16
|
-
function _isSlot(s) {
|
|
17
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
|
|
18
|
-
}
|
|
19
14
|
export var baseMenuProps = _objectSpread(_objectSpread({}, defaultSettingProps), {}, {
|
|
20
15
|
prefixCls: {
|
|
21
16
|
type: String,
|
|
@@ -119,8 +114,7 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(_props, ctx) {
|
|
|
119
114
|
});
|
|
120
115
|
_defineProperty(this, "getSubMenuOrItem", function (item) {
|
|
121
116
|
var _item$meta, _item$meta2, _item$meta7, _item$meta8;
|
|
122
|
-
if (Array.isArray(item.children) && item.children.length > 0 && !(item
|
|
123
|
-
var _slot;
|
|
117
|
+
if (Array.isArray(item.children) && item.children.length > 0 && !(item !== null && item !== void 0 && (_item$meta = item.meta) !== null && _item$meta !== void 0 && _item$meta.hideInMenu) && !(item !== null && item !== void 0 && (_item$meta2 = item.meta) !== null && _item$meta2 !== void 0 && _item$meta2.hideChildrenInMenu)) {
|
|
124
118
|
var _item$meta3, _item$meta4, _item$meta5, _item$meta6;
|
|
125
119
|
if (_this.props.subMenuItemRender) {
|
|
126
120
|
var subMenuItemRender = withCtx(_this.props.subMenuItemRender, _this.ctx);
|
|
@@ -133,21 +127,13 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(_props, ctx) {
|
|
|
133
127
|
prefixCls = _this$props.prefixCls,
|
|
134
128
|
locale = _this$props.locale;
|
|
135
129
|
var menuTitle = locale && locale((_item$meta3 = item.meta) === null || _item$meta3 === void 0 ? void 0 : _item$meta3.title) || ((_item$meta4 = item.meta) === null || _item$meta4 === void 0 ? void 0 : _item$meta4.title);
|
|
136
|
-
var defaultTitle = (
|
|
130
|
+
var defaultTitle = (_item$meta5 = item.meta) !== null && _item$meta5 !== void 0 && _item$meta5.icon ? _createVNode("span", {
|
|
137
131
|
"class": "".concat(prefixCls, "-menu-item")
|
|
138
132
|
}, [_createVNode("span", {
|
|
139
133
|
"class": "".concat(prefixCls, "-menu-item-title")
|
|
140
|
-
},
|
|
141
|
-
default: function _default() {
|
|
142
|
-
return [menuTitle];
|
|
143
|
-
}
|
|
144
|
-
})]) : _createVNode("span", {
|
|
134
|
+
}, [menuTitle])]) : _createVNode("span", {
|
|
145
135
|
"class": "".concat(prefixCls, "-menu-item")
|
|
146
|
-
},
|
|
147
|
-
default: function _default() {
|
|
148
|
-
return [menuTitle];
|
|
149
|
-
}
|
|
150
|
-
});
|
|
136
|
+
}, [menuTitle]);
|
|
151
137
|
return _createVNode(Menu.SubMenu, {
|
|
152
138
|
"title": defaultTitle,
|
|
153
139
|
"key": item.path,
|
|
@@ -156,9 +142,9 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(_props, ctx) {
|
|
|
156
142
|
"iconUrl": _this.props.iconfontUrl,
|
|
157
143
|
"icon": (_item$meta6 = item.meta) === null || _item$meta6 === void 0 ? void 0 : _item$meta6.icon
|
|
158
144
|
}, null)
|
|
159
|
-
},
|
|
145
|
+
}, {
|
|
160
146
|
default: function _default() {
|
|
161
|
-
return [
|
|
147
|
+
return [_this.getNavMenuItems(item.children)];
|
|
162
148
|
}
|
|
163
149
|
});
|
|
164
150
|
}
|
|
@@ -175,14 +161,13 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(_props, ctx) {
|
|
|
175
161
|
"disabled": (_item$meta7 = item.meta) === null || _item$meta7 === void 0 ? void 0 : _item$meta7.disabled,
|
|
176
162
|
"danger": (_item$meta8 = item.meta) === null || _item$meta8 === void 0 ? void 0 : _item$meta8.danger,
|
|
177
163
|
"key": item.path
|
|
178
|
-
},
|
|
164
|
+
}, {
|
|
179
165
|
default: function _default() {
|
|
180
166
|
return [title];
|
|
181
167
|
}
|
|
182
168
|
});
|
|
183
169
|
});
|
|
184
170
|
_defineProperty(this, "getMenuItem", function (item) {
|
|
185
|
-
var _slot2;
|
|
186
171
|
var _item$meta9, _item$meta10, _item$meta11, _item$meta12, _item$meta13;
|
|
187
172
|
var meta = _objectSpread({}, item.meta);
|
|
188
173
|
var target = meta.target || null;
|
|
@@ -205,27 +190,19 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(_props, ctx) {
|
|
|
205
190
|
"icon": (_item$meta10 = item.meta) === null || _item$meta10 === void 0 ? void 0 : _item$meta10.icon
|
|
206
191
|
}, null) || undefined;
|
|
207
192
|
var menuTitle = locale && locale((_item$meta11 = item.meta) === null || _item$meta11 === void 0 ? void 0 : _item$meta11.title) || ((_item$meta12 = item.meta) === null || _item$meta12 === void 0 ? void 0 : _item$meta12.title);
|
|
208
|
-
var defaultTitle = (
|
|
193
|
+
var defaultTitle = (_item$meta13 = item.meta) !== null && _item$meta13 !== void 0 && _item$meta13.icon ? _createVNode(CustomTag, _objectSpread(_objectSpread(_objectSpread({}, attrs), props), {}, {
|
|
209
194
|
"class": "".concat(prefixCls, "-menu-item")
|
|
210
195
|
}), {
|
|
211
196
|
default: function _default() {
|
|
212
197
|
return [icon, _createVNode("span", {
|
|
213
198
|
"class": "".concat(prefixCls, "-menu-item-title")
|
|
214
|
-
},
|
|
215
|
-
default: function _default() {
|
|
216
|
-
return [menuTitle];
|
|
217
|
-
}
|
|
218
|
-
})];
|
|
199
|
+
}, [menuTitle])];
|
|
219
200
|
}
|
|
220
201
|
}) : _createVNode(CustomTag, _objectSpread(_objectSpread(_objectSpread({}, attrs), props), {}, {
|
|
221
202
|
"class": "".concat(prefixCls, "-menu-item")
|
|
222
|
-
}),
|
|
223
|
-
default: function _default() {
|
|
224
|
-
return [menuTitle];
|
|
225
|
-
}
|
|
226
|
-
})) ? _slot2 : {
|
|
203
|
+
}), {
|
|
227
204
|
default: function _default() {
|
|
228
|
-
return [
|
|
205
|
+
return [_createVNode("span", null, [menuTitle])];
|
|
229
206
|
}
|
|
230
207
|
});
|
|
231
208
|
return [defaultTitle, icon];
|
|
@@ -263,7 +240,6 @@ export default defineComponent({
|
|
|
263
240
|
emit('click', args);
|
|
264
241
|
};
|
|
265
242
|
return function () {
|
|
266
|
-
var _slot3;
|
|
267
243
|
return _createVNode(Menu, _objectSpread({
|
|
268
244
|
"key": "Menu",
|
|
269
245
|
"inlineIndent": 16,
|
|
@@ -274,9 +250,9 @@ export default defineComponent({
|
|
|
274
250
|
"onOpenChange": handleOpenChange,
|
|
275
251
|
"onSelect": handleSelect,
|
|
276
252
|
"onClick": handleClick
|
|
277
|
-
}, props.menuProps),
|
|
253
|
+
}, props.menuProps), {
|
|
278
254
|
default: function _default() {
|
|
279
|
-
return [
|
|
255
|
+
return [menuUtil.getNavMenuItems(props.menuData)];
|
|
280
256
|
}
|
|
281
257
|
});
|
|
282
258
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
-
import
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import { createVNode as _createVNode, createTextVNode as _createTextVNode, Fragment as _Fragment } from "vue";
|
|
4
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
6
|
import { LayoutSider as Sider, Menu, Tooltip } from 'ant-design-vue';
|
|
6
7
|
import BaseMenu, { baseMenuProps } from './BaseMenu';
|
|
@@ -10,9 +11,7 @@ import IconFont from '../../Icon';
|
|
|
10
11
|
import { useRouteContext } from '../RouteContext';
|
|
11
12
|
import { computed, unref } from 'vue';
|
|
12
13
|
import "../typings";
|
|
13
|
-
|
|
14
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
|
|
15
|
-
}
|
|
14
|
+
import useProLayoutStyle from '../style';
|
|
16
15
|
export var siderMenuProps = _objectSpread(_objectSpread(_objectSpread({}, defaultSettingProps), baseMenuProps), {}, {
|
|
17
16
|
logo: {
|
|
18
17
|
type: [Object, String, Function],
|
|
@@ -145,11 +144,7 @@ export var defaultRenderLogoAndTitle = function defaultRenderLogoAndTitle(props)
|
|
|
145
144
|
if (layout === 'mix' && renderFunction === false) {
|
|
146
145
|
return null;
|
|
147
146
|
}
|
|
148
|
-
var titleDom = _createVNode("h1", null,
|
|
149
|
-
default: function _default() {
|
|
150
|
-
return [title];
|
|
151
|
-
}
|
|
152
|
-
});
|
|
147
|
+
var titleDom = _createVNode("h1", null, [title]);
|
|
153
148
|
if (renderKey === 'menuHeaderRender') {
|
|
154
149
|
return null;
|
|
155
150
|
}
|
|
@@ -159,11 +154,7 @@ export var defaultRenderLogoAndTitle = function defaultRenderLogoAndTitle(props)
|
|
|
159
154
|
return renderFunction(logoDom, props.collapsed ? null : titleDom, props);
|
|
160
155
|
}
|
|
161
156
|
if (Array.isArray(renderFunction)) {
|
|
162
|
-
return _createVNode(_Fragment, null,
|
|
163
|
-
default: function _default() {
|
|
164
|
-
return [renderFunction];
|
|
165
|
-
}
|
|
166
|
-
});
|
|
157
|
+
return _createVNode(_Fragment, null, [renderFunction]);
|
|
167
158
|
}
|
|
168
159
|
return _createVNode("a", null, [logoDom, props.collapsed ? null : titleDom]);
|
|
169
160
|
};
|
|
@@ -175,7 +166,6 @@ export var defaultRenderCollapsedButton = function defaultRenderCollapsedButton(
|
|
|
175
166
|
}, null);
|
|
176
167
|
};
|
|
177
168
|
var SiderMenu = function SiderMenu(props) {
|
|
178
|
-
var _slot;
|
|
179
169
|
var collapsed = props.collapsed,
|
|
180
170
|
siderWidth = props.siderWidth,
|
|
181
171
|
breakpoint = props.breakpoint,
|
|
@@ -189,6 +179,13 @@ var SiderMenu = function SiderMenu(props) {
|
|
|
189
179
|
collapsedButtonRender = _props$collapsedButto === void 0 ? defaultRenderCollapsedButton : _props$collapsedButto,
|
|
190
180
|
linksRender = props.linksRender,
|
|
191
181
|
theme = props.theme;
|
|
182
|
+
var prefixCls = computed(function () {
|
|
183
|
+
return 'pro-layout';
|
|
184
|
+
});
|
|
185
|
+
var _useProLayoutStyle = useProLayoutStyle(prefixCls),
|
|
186
|
+
_useProLayoutStyle2 = _slicedToArray(_useProLayoutStyle, 2),
|
|
187
|
+
wrapSSR = _useProLayoutStyle2[0],
|
|
188
|
+
hashId = _useProLayoutStyle2[1];
|
|
192
189
|
var context = useRouteContext();
|
|
193
190
|
var getPrefixCls = context.getPrefixCls;
|
|
194
191
|
var baseClassName = getPrefixCls('sider');
|
|
@@ -199,7 +196,7 @@ var SiderMenu = function SiderMenu(props) {
|
|
|
199
196
|
return props.collapsed ? props.collapsedWidth : props.siderWidth;
|
|
200
197
|
});
|
|
201
198
|
var classNames = computed(function () {
|
|
202
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, baseClassName, true), "".concat(baseClassName, "-fixed"), context.fixSiderbar), "".concat(baseClassName, "-").concat(theme), true), "".concat(baseClassName, "-layout-").concat(props.layout), props.layout);
|
|
199
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, baseClassName, true), "".concat(baseClassName, "-fixed"), context.fixSiderbar), "".concat(baseClassName, "-").concat(theme), true), "".concat(baseClassName, "-layout-").concat(props.layout), props.layout), hashId.value, true);
|
|
203
200
|
});
|
|
204
201
|
var logCls = computed(function () {
|
|
205
202
|
return _defineProperty(_defineProperty({}, "".concat(baseClassName, "-logo"), true), "".concat(baseClassName, "-logo-card"), props.layoutType === LayoutType.CARD);
|
|
@@ -242,7 +239,6 @@ var SiderMenu = function SiderMenu(props) {
|
|
|
242
239
|
},
|
|
243
240
|
'onUpdate:selectedKeys': handleSelect
|
|
244
241
|
}, null);
|
|
245
|
-
console.log('context', context.fixSiderbar);
|
|
246
242
|
return _createVNode(_Fragment, null, [context.fixSiderbar && _createVNode("div", {
|
|
247
243
|
"style": {
|
|
248
244
|
width: "".concat(sSideWidth.value, "px"),
|
|
@@ -277,17 +273,9 @@ var SiderMenu = function SiderMenu(props) {
|
|
|
277
273
|
"onClick": props.layout !== 'mix' ? props.onMenuHeaderClick : undefined,
|
|
278
274
|
"id": "logo",
|
|
279
275
|
"style": props === null || props === void 0 ? void 0 : props.logoStyle
|
|
280
|
-
},
|
|
281
|
-
default: function _default() {
|
|
282
|
-
return [headerDom];
|
|
283
|
-
}
|
|
284
|
-
}), extraDom && _createVNode("div", {
|
|
276
|
+
}, [headerDom]), extraDom && _createVNode("div", {
|
|
285
277
|
"class": _defineProperty(_defineProperty({}, "".concat(baseClassName, "-extra"), true), "".concat(baseClassName, "-extra-no-logo"), !headerDom)
|
|
286
|
-
},
|
|
287
|
-
default: function _default() {
|
|
288
|
-
return [extraDom];
|
|
289
|
-
}
|
|
290
|
-
}), _createVNode("div", {
|
|
278
|
+
}, [extraDom]), _createVNode("div", {
|
|
291
279
|
"class": "".concat(baseClassName, "-body"),
|
|
292
280
|
"style": "flex: 1; overflow: hidden auto;"
|
|
293
281
|
}, [props.layoutType !== LayoutType.CARD ? menuContentRender && menuContentRender(props, defaultMenuDom) || defaultMenuDom : null]), _createVNode("div", {
|
|
@@ -304,17 +292,17 @@ var SiderMenu = function SiderMenu(props) {
|
|
|
304
292
|
props.onCollapse(!props.collapsed);
|
|
305
293
|
}
|
|
306
294
|
}
|
|
307
|
-
}, _isSlot(_slot = _createVNode(Menu.Item, {
|
|
308
|
-
"key": 'collapsed-button',
|
|
309
|
-
"class": "".concat(baseClassName, "-collapsed-button"),
|
|
310
|
-
"title": false
|
|
311
295
|
}, {
|
|
312
296
|
default: function _default() {
|
|
313
|
-
return [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
297
|
+
return [_createVNode(Menu.Item, {
|
|
298
|
+
"key": 'collapsed-button',
|
|
299
|
+
"class": "".concat(baseClassName, "-collapsed-button"),
|
|
300
|
+
"title": false
|
|
301
|
+
}, {
|
|
302
|
+
default: function _default() {
|
|
303
|
+
return [collapsedButtonRender && typeof collapsedButtonRender === 'function' ? collapsedButtonRender(collapsed) : collapsedButtonRender];
|
|
304
|
+
}
|
|
305
|
+
})];
|
|
318
306
|
}
|
|
319
307
|
}) : null])];
|
|
320
308
|
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import { Keyframes } from "ant-design-vue";
|
|
3
|
+
export var genSiderMenuStyle = function genSiderMenuStyle(config) {
|
|
4
|
+
var _$concat8;
|
|
5
|
+
var token = config.token;
|
|
6
|
+
var proLayoutSiderMenuCls = "".concat(token.antCls, "-pro-sider");
|
|
7
|
+
var proLayoutHeaderHeight = '48px';
|
|
8
|
+
var proLayoutTitleHideKeyframes = new Keyframes('pro-layout-title-hide', {
|
|
9
|
+
'0%': {
|
|
10
|
+
display: 'none',
|
|
11
|
+
opacity: 0
|
|
12
|
+
},
|
|
13
|
+
'80%': {
|
|
14
|
+
display: 'none',
|
|
15
|
+
opacity: 0
|
|
16
|
+
},
|
|
17
|
+
'100%': {
|
|
18
|
+
display: 'unset',
|
|
19
|
+
opacity: 1
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(proLayoutSiderMenuCls), (_$concat8 = {
|
|
23
|
+
position: 'relative',
|
|
24
|
+
backgroundColor: '#001529',
|
|
25
|
+
borderRight: 0,
|
|
26
|
+
// FIXME: 临时修正(可能不会做兼容)
|
|
27
|
+
zIndex: 20
|
|
28
|
+
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_$concat8, "".concat(token.antCls, "-menu"), {
|
|
29
|
+
background: 'transparent'
|
|
30
|
+
}), "&".concat(token.antCls, "-layout-sider-light"), _defineProperty(_defineProperty({}, "".concat(token.antCls, "-menu-item a"), {
|
|
31
|
+
color: token.colorTextHeading
|
|
32
|
+
}), "".concat(token.antCls, "-menu-item-selected a, ").concat(token.antCls, "-menu-item a:hover"), {
|
|
33
|
+
color: token.colorPrimary
|
|
34
|
+
})), "".concat(proLayoutSiderMenuCls, "-logo"), {
|
|
35
|
+
position: 'relative',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
padding: '16px 16px',
|
|
39
|
+
cursor: 'pointer',
|
|
40
|
+
transition: 'padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)',
|
|
41
|
+
'> a': {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
minHeight: 32
|
|
46
|
+
},
|
|
47
|
+
'img': {
|
|
48
|
+
display: 'inline-block',
|
|
49
|
+
height: 32,
|
|
50
|
+
verticalAlign: 'middle'
|
|
51
|
+
},
|
|
52
|
+
'h1': {
|
|
53
|
+
display: 'inline-block',
|
|
54
|
+
height: '32px',
|
|
55
|
+
margin: '0 0 0 12px',
|
|
56
|
+
color: 'white',
|
|
57
|
+
fontWeight: 600,
|
|
58
|
+
fontSize: '18px',
|
|
59
|
+
lineHeight: '32px',
|
|
60
|
+
verticalAlign: 'middle',
|
|
61
|
+
animationName: proLayoutTitleHideKeyframes,
|
|
62
|
+
animationDuration: '0.3s'
|
|
63
|
+
}
|
|
64
|
+
}), "".concat(proLayoutSiderMenuCls, "-logo-card"), {
|
|
65
|
+
padding: '16px 0',
|
|
66
|
+
justifyContent: 'center'
|
|
67
|
+
}), "".concat(proLayoutSiderMenuCls, "-extra"), _defineProperty({
|
|
68
|
+
marginBottom: '16px',
|
|
69
|
+
padding: '0 16px'
|
|
70
|
+
}, "".concat(proLayoutSiderMenuCls, "-extra-no-logo"), {
|
|
71
|
+
marginTop: '16px'
|
|
72
|
+
})), "".concat(proLayoutSiderMenuCls, "-menu"), {
|
|
73
|
+
position: 'relative',
|
|
74
|
+
zIndex: 10,
|
|
75
|
+
minHeight: '100%',
|
|
76
|
+
boxShadow: '2px 0 6px rgba(0, 21, 41, 0.35)'
|
|
77
|
+
}), "".concat(token.antCls, "-layout-sider-children"), {
|
|
78
|
+
display: 'flex',
|
|
79
|
+
flexDirection: 'column',
|
|
80
|
+
height: '100%',
|
|
81
|
+
'::-webkit-scrollbar': {
|
|
82
|
+
width: '6px',
|
|
83
|
+
height: '6px'
|
|
84
|
+
},
|
|
85
|
+
'::webkit-scrollbar-track': {
|
|
86
|
+
background: 'rgba(255, 255, 255, 0.15)',
|
|
87
|
+
borderRadius: '3px',
|
|
88
|
+
boxShadow: 'inset 0 0 5px rgba(37, 37, 37, 0.05)'
|
|
89
|
+
},
|
|
90
|
+
/* 滚动条滑块 */
|
|
91
|
+
'::-webkit-scrollbar-thumb': {
|
|
92
|
+
background: 'rgba(255, 255, 255, 0.2)',
|
|
93
|
+
borderRadius: '3px',
|
|
94
|
+
boxShadow: 'inset 0 0 5px rgba(255, 255, 255, 0.05)'
|
|
95
|
+
}
|
|
96
|
+
}), "&".concat(token.antCls, "-layout-sider-collapsed"), _defineProperty(_defineProperty({}, "".concat(token.antCls, "-menu-inline-collapsed"), {
|
|
97
|
+
width: '48px'
|
|
98
|
+
}), "".concat(proLayoutSiderMenuCls), _defineProperty({}, "".concat(proLayoutSiderMenuCls, "-logo"), {
|
|
99
|
+
padding: '16px 24px'
|
|
100
|
+
}))), "&".concat(token.antCls, "-layout-sider").concat(proLayoutSiderMenuCls, "-fixed"), _defineProperty({
|
|
101
|
+
position: 'fixed',
|
|
102
|
+
top: 0,
|
|
103
|
+
left: 0,
|
|
104
|
+
zIndex: 99,
|
|
105
|
+
height: '100%',
|
|
106
|
+
overflow: 'auto',
|
|
107
|
+
overflowX: 'hidden',
|
|
108
|
+
boxShadow: '2px 0 8px 0 rgba(29, 35, 41, 0.05)'
|
|
109
|
+
}, "> ".concat(token.antCls, "-menu-root"), _defineProperty({}, ":not".concat(proLayoutSiderMenuCls, "-link-menu"), {
|
|
110
|
+
height: "calc(100vh - ".concat(proLayoutHeaderHeight, ")"),
|
|
111
|
+
overflowY: 'auto'
|
|
112
|
+
}))), "".concat(proLayoutSiderMenuCls, "-light"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
113
|
+
backgroundColor: token.colorBgContainer,
|
|
114
|
+
boxShadow: '2px 0 8px 0 rgba(29, 35, 41, 0.05)'
|
|
115
|
+
}, "".concat(token.antCls, "-layout-sider-children"), {
|
|
116
|
+
'::webkit-scrollbar-track': {
|
|
117
|
+
background: 'rgba(0, 0, 0, 0.06)',
|
|
118
|
+
borderRadius: '3px',
|
|
119
|
+
boxShadow: 'inset 0 0 5px rgba(0, 21, 41, 0.05)',
|
|
120
|
+
/* 滚动条滑块 */
|
|
121
|
+
'::-webkit-scrollbar-thumb': {
|
|
122
|
+
background: 'rgba(0, 0, 0, 0.12)',
|
|
123
|
+
borderRadius: '3px',
|
|
124
|
+
boxShadow: 'inset 0 0 5px rgba(0, 21, 41, 0.05)'
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}), "".concat(proLayoutSiderMenuCls, "-logo"), {
|
|
128
|
+
'h1': {
|
|
129
|
+
color: token.colorPrimary
|
|
130
|
+
}
|
|
131
|
+
}), "".concat(token.antCls, "-menu-light"), {
|
|
132
|
+
borderRightColor: 'transparent'
|
|
133
|
+
}), "".concat(proLayoutSiderMenuCls, "-collapsed-button"), {
|
|
134
|
+
borderTop: "".concat(token.lineWidth, " solid ").concat(token.colorSplit)
|
|
135
|
+
})), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_$concat8, "".concat(proLayoutSiderMenuCls, "-icon"), {
|
|
136
|
+
width: '14px',
|
|
137
|
+
verticalAlign: 'baseline'
|
|
138
|
+
}), "".concat(proLayoutSiderMenuCls, "-link"), _defineProperty({
|
|
139
|
+
width: '100%'
|
|
140
|
+
}, "ul".concat(token.antCls, "-menu-root"), {
|
|
141
|
+
height: 'auto'
|
|
142
|
+
})), "".concat(proLayoutSiderMenuCls, "-collapsed-button"), {
|
|
143
|
+
borderTop: "".concat(token.lineWidth, " solid rgba(0, 0, 0, 0.25)"),
|
|
144
|
+
'.anticon': {
|
|
145
|
+
fontSize: '16px'
|
|
146
|
+
}
|
|
147
|
+
}), ".top-nav-menu li".concat(token.antCls, "-menu-item"), {
|
|
148
|
+
height: '100%',
|
|
149
|
+
lineHeight: 1
|
|
150
|
+
}), '.drawer .drawer-content', {
|
|
151
|
+
background: "#001529"
|
|
152
|
+
}))), "".concat(token.antCls, "-pro-menu-item"), _defineProperty({}, ".anticon".concat(token.antCls, "-pro-menu-item-title"), {
|
|
153
|
+
marginLeft: '10px'
|
|
154
|
+
})), '.sider-app-menus', {
|
|
155
|
+
width: '100px',
|
|
156
|
+
backgroundColor: '#fff',
|
|
157
|
+
cursor: 'pointer',
|
|
158
|
+
padding: '6px',
|
|
159
|
+
transition: 'all .3s',
|
|
160
|
+
borderRadius: '4px',
|
|
161
|
+
color: '#333',
|
|
162
|
+
'&:hover': {
|
|
163
|
+
backgroundColor: '#efefef'
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
};
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { isVNode as _isVNode } from "vue";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import { createVNode as _createVNode } from "vue";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
6
|
var _excluded = ["rightContentRender"];
|
|
7
7
|
import { computed, ref } from 'vue';
|
|
8
|
-
import { default as ResizeObserver } from
|
|
8
|
+
import { default as ResizeObserver } from "ant-design-vue/es/vc-resize-observer";
|
|
9
9
|
import { defaultRenderLogoAndTitle, siderMenuProps } from '../SiderMenu/SiderMenu';
|
|
10
|
-
import PropTypes from
|
|
10
|
+
import PropTypes from "ant-design-vue/es/_util/vue-types";
|
|
11
11
|
import { defaultSettingProps, LayoutType } from '../defaultSettings';
|
|
12
12
|
import { defaultPrefixCls, useRouteContext } from '../RouteContext';
|
|
13
13
|
import BaseMenu from '../SiderMenu/BaseMenu';
|
|
14
14
|
import { clearMenuItem } from '../util';
|
|
15
|
-
|
|
16
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
|
|
17
|
-
}
|
|
15
|
+
import useProLayoutStyle from '../style';
|
|
18
16
|
export var baseHeaderProps = _objectSpread(_objectSpread({}, defaultSettingProps), {}, {
|
|
19
17
|
prefixCls: PropTypes.string.def('ant-pro'),
|
|
20
18
|
collapsed: PropTypes.looseBool,
|
|
@@ -99,6 +97,13 @@ export var TopNavHeader = function TopNavHeader(props) {
|
|
|
99
97
|
mode = props.mode;
|
|
100
98
|
var context = useRouteContext();
|
|
101
99
|
var prefixCls = "".concat(propPrefixCls || defaultPrefixCls, "-top-nav-header");
|
|
100
|
+
var stylePrefixCls = computed(function () {
|
|
101
|
+
return 'pro-layout';
|
|
102
|
+
});
|
|
103
|
+
var _useProLayoutStyle = useProLayoutStyle(stylePrefixCls),
|
|
104
|
+
_useProLayoutStyle2 = _slicedToArray(_useProLayoutStyle, 2),
|
|
105
|
+
wrapSSR = _useProLayoutStyle2[0],
|
|
106
|
+
hashId = _useProLayoutStyle2[1];
|
|
102
107
|
var headerDom = defaultRenderLogoAndTitle(_objectSpread(_objectSpread({}, props), {}, {
|
|
103
108
|
collapsed: false
|
|
104
109
|
}),
|
|
@@ -121,7 +126,7 @@ export var TopNavHeader = function TopNavHeader(props) {
|
|
|
121
126
|
return props.layout === 'mix' && props.splitMenus ? 'horizontal' : mode;
|
|
122
127
|
});
|
|
123
128
|
var className = computed(function () {
|
|
124
|
-
return _defineProperty(_defineProperty(_defineProperty({}, prefixCls, true), "light", props.theme === 'light'), "dark", props.theme === 'dark');
|
|
129
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, true), hashId.value, true), "light", props.theme === 'light'), "dark", props.theme === 'dark');
|
|
125
130
|
});
|
|
126
131
|
var paddingLeft = computed(function () {
|
|
127
132
|
return context.layoutType === LayoutType.PAD && props.collapsed ? context.headerLeftWidth + 'px' : 0;
|
|
@@ -141,11 +146,7 @@ export var TopNavHeader = function TopNavHeader(props) {
|
|
|
141
146
|
"class": "".concat(prefixCls, "-logo"),
|
|
142
147
|
"key": "logo",
|
|
143
148
|
"id": "logo"
|
|
144
|
-
},
|
|
145
|
-
default: function _default() {
|
|
146
|
-
return [headerDom];
|
|
147
|
-
}
|
|
148
|
-
})]), _createVNode("div", {
|
|
149
|
+
}, [headerDom])]), _createVNode("div", {
|
|
149
150
|
"style": {
|
|
150
151
|
flex: 1
|
|
151
152
|
},
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
export var genTopHeaderStyle = function genTopHeaderStyle(config) {
|
|
3
|
+
var token = config.token;
|
|
4
|
+
var topNavHeaderCls = "".concat(token.antCls, "-pro-top-nav-header");
|
|
5
|
+
var proLayoutGlobalHeaderCls = "".concat(token.antCls, "-pro-global-header");
|
|
6
|
+
var proLayoutHeaderBg = token.colorBgContainer;
|
|
7
|
+
var proLayoutHeaderHoverBg = token.colorBgContainer;
|
|
8
|
+
var proLayoutHeaderBoxShadow = '0 1px 4px rgba(0, 21, 41, 0.08)';
|
|
9
|
+
return _defineProperty(_defineProperty(_defineProperty({}, proLayoutGlobalHeaderCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
10
|
+
position: 'relative',
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
height: '100%',
|
|
14
|
+
padding: '0 16px',
|
|
15
|
+
backgroundColor: proLayoutHeaderBg,
|
|
16
|
+
boxShadow: proLayoutHeaderBoxShadow,
|
|
17
|
+
'> *': {
|
|
18
|
+
height: '100%'
|
|
19
|
+
}
|
|
20
|
+
}, "".concat(proLayoutGlobalHeaderCls, "-coppapsed-button"), {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
marginLeft: '16px',
|
|
24
|
+
fontSize: '20px'
|
|
25
|
+
}), "".concat(proLayoutGlobalHeaderCls, "-layout"), _defineProperty({}, "".concat(proLayoutGlobalHeaderCls, "-layout-mix"), _defineProperty(_defineProperty({
|
|
26
|
+
backgroundColor: '#001529'
|
|
27
|
+
}, "".concat(proLayoutGlobalHeaderCls, "-logo"), {
|
|
28
|
+
'h1': {
|
|
29
|
+
color: '#fff'
|
|
30
|
+
}
|
|
31
|
+
}), '.anticon', {
|
|
32
|
+
color: '#fff'
|
|
33
|
+
}))), "".concat(proLayoutGlobalHeaderCls, "-logo"), {
|
|
34
|
+
position: 'relative',
|
|
35
|
+
overflow: 'hidden',
|
|
36
|
+
a: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
height: '100%',
|
|
40
|
+
img: {
|
|
41
|
+
height: '28px'
|
|
42
|
+
},
|
|
43
|
+
h1: {
|
|
44
|
+
height: '32px',
|
|
45
|
+
margin: '0 0 0 12px',
|
|
46
|
+
color: token.colorPrimary,
|
|
47
|
+
fontWeight: 600,
|
|
48
|
+
fontSize: '18px',
|
|
49
|
+
lineHeight: '32px'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}), "".concat(proLayoutGlobalHeaderCls, "-menu"), _defineProperty({
|
|
53
|
+
'.anticon': {
|
|
54
|
+
marginRight: '8px'
|
|
55
|
+
}
|
|
56
|
+
}, "".concat(token.antCls, "-dropdown-menu-item"), {
|
|
57
|
+
minWidth: '160px'
|
|
58
|
+
})), '.dark', {
|
|
59
|
+
height: '48px',
|
|
60
|
+
'.action': _defineProperty({
|
|
61
|
+
color: 'rgba(255, 255, 255, 0.85)',
|
|
62
|
+
'> i': {
|
|
63
|
+
color: 'rgba(255, 255, 255, 0.85)'
|
|
64
|
+
},
|
|
65
|
+
'&:hover,&.opend': {
|
|
66
|
+
background: token.colorPrimary
|
|
67
|
+
}
|
|
68
|
+
}, "".concat(token.antCls, "-badge"), {
|
|
69
|
+
color: 'rgba(255, 255, 255, 0.85)'
|
|
70
|
+
})
|
|
71
|
+
})), topNavHeaderCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
72
|
+
position: 'relative',
|
|
73
|
+
width: '100%',
|
|
74
|
+
height: '100%',
|
|
75
|
+
boxShadow: '0 1px 4px 0 rgba(0, 21, 41, 0.12)',
|
|
76
|
+
transition: 'background 0.3s, width 0.2s'
|
|
77
|
+
}, "".concat(token.antCls, "-menu"), {
|
|
78
|
+
backgroundColor: 'transparent'
|
|
79
|
+
}), '&.light', _defineProperty(_defineProperty({
|
|
80
|
+
backgroundColor: token.colorBgContainer
|
|
81
|
+
}, "".concat(topNavHeaderCls, "-logo"), {
|
|
82
|
+
h1: {
|
|
83
|
+
color: token.colorTextHeading
|
|
84
|
+
}
|
|
85
|
+
}), '.anticon', {
|
|
86
|
+
color: 'inherit'
|
|
87
|
+
})), "".concat(topNavHeaderCls, "-main"), _defineProperty({
|
|
88
|
+
display: 'flex',
|
|
89
|
+
height: '100%',
|
|
90
|
+
paddingLeft: '16px'
|
|
91
|
+
}, "".concat(topNavHeaderCls, "-main-left"), {
|
|
92
|
+
display: 'flex',
|
|
93
|
+
minWidth: '192px'
|
|
94
|
+
})), '.anticon', {
|
|
95
|
+
color: '#fff'
|
|
96
|
+
}), "".concat(topNavHeaderCls, "-logo"), {
|
|
97
|
+
position: 'relative',
|
|
98
|
+
minWidth: '165px',
|
|
99
|
+
height: '100%',
|
|
100
|
+
overflow: 'hidden',
|
|
101
|
+
img: {
|
|
102
|
+
display: 'inline-block',
|
|
103
|
+
height: '32px',
|
|
104
|
+
verticalAlign: 'middle'
|
|
105
|
+
},
|
|
106
|
+
h1: {
|
|
107
|
+
display: 'inline-block',
|
|
108
|
+
margin: '0 0 0 12px',
|
|
109
|
+
color: token.colorPrimary,
|
|
110
|
+
fontWeight: 600,
|
|
111
|
+
fontSize: '16px',
|
|
112
|
+
verticalAlign: 'top'
|
|
113
|
+
}
|
|
114
|
+
}), "".concat(topNavHeaderCls, "-menu"), _defineProperty({
|
|
115
|
+
minWidth: 0
|
|
116
|
+
}, "".concat(token.antCls, "-menu").concat(token.antCls, "-meu-horizontal"), _defineProperty({
|
|
117
|
+
height: '100%',
|
|
118
|
+
border: 'none'
|
|
119
|
+
}, "".concat(token.antCls, "-menu-item"), _defineProperty({
|
|
120
|
+
height: '100%'
|
|
121
|
+
}, "".concat(token.antCls, "-badge"), {
|
|
122
|
+
color: 'unset'
|
|
123
|
+
}))))), "".concat(token.antCls, "-pro-menu-popup"), _defineProperty({}, "".concat(token.antCls, "-badge"), {
|
|
124
|
+
color: 'unset'
|
|
125
|
+
}));
|
|
126
|
+
};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import genCompoentStyle from '../../style/styleRegister';
|
|
2
|
+
import { genBasicLayoutStyle } from '../Basic/BasicLayoutStyle';
|
|
3
|
+
import { genHeaderStyle } from '../Basic/HeaderStyle';
|
|
4
|
+
import { genPageContainerStyle } from '../PageContainer/style';
|
|
5
|
+
import { genSiderMenuStyle } from '../SiderMenu/style';
|
|
6
|
+
import { genTopHeaderStyle } from '../TopHeader/style';
|
|
7
|
+
export default genCompoentStyle([genBasicLayoutStyle, genHeaderStyle, genPageContainerStyle, genSiderMenuStyle, genTopHeaderStyle]);
|
package/es/ProLayout/util.js
CHANGED
|
@@ -3,14 +3,14 @@ export function clearMenuItem(menusData) {
|
|
|
3
3
|
return menusData.map(function (item) {
|
|
4
4
|
var _finalItem$meta;
|
|
5
5
|
var finalItem = _objectSpread({}, item);
|
|
6
|
-
if ((_finalItem$meta = finalItem.meta)
|
|
6
|
+
if ((_finalItem$meta = finalItem.meta) !== null && _finalItem$meta !== void 0 && _finalItem$meta.hideInMenu) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
|
-
if (finalItem &&
|
|
9
|
+
if (finalItem && finalItem !== null && finalItem !== void 0 && finalItem.children) {
|
|
10
10
|
var _finalItem$meta2;
|
|
11
|
-
if (!((_finalItem$meta2 = finalItem.meta)
|
|
11
|
+
if (!((_finalItem$meta2 = finalItem.meta) !== null && _finalItem$meta2 !== void 0 && _finalItem$meta2.hideChildInMenu) && finalItem.children.some(function (child) {
|
|
12
12
|
var _child$meta;
|
|
13
|
-
return child && child.name && !((_child$meta = child.meta)
|
|
13
|
+
return child && child.name && !((_child$meta = child.meta) !== null && _child$meta !== void 0 && _child$meta.hideInMenu);
|
|
14
14
|
})) {
|
|
15
15
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
16
16
|
children: clearMenuItem(finalItem.children)
|
|
@@ -27,7 +27,7 @@ export function flatMap(menusData) {
|
|
|
27
27
|
return menusData.map(function (item) {
|
|
28
28
|
var _finalItem$meta3;
|
|
29
29
|
var finalItem = _objectSpread({}, item);
|
|
30
|
-
if (!finalItem.name || (
|
|
30
|
+
if (!finalItem.name || (_finalItem$meta3 = finalItem.meta) !== null && _finalItem$meta3 !== void 0 && _finalItem$meta3.hideInMenu) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
if (finalItem.children) {
|