@oceanbase/ui 0.2.23 → 0.2.25
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/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.js +3 -3
- package/es/Action/Item.js +1 -1
- package/es/BackgroundTaskManager/RefreshMan.js +1 -1
- package/es/BackgroundTaskManager/index.js +6 -6
- package/es/BasicLayout/Header.d.ts +1 -1
- package/es/BasicLayout/Header.js +57 -62
- package/es/BasicLayout/index.d.ts +0 -1
- package/es/BasicLayout/index.js +59 -69
- package/es/BasicLayout/style/Header.d.ts +9 -0
- package/es/BasicLayout/style/Header.js +95 -0
- package/es/BasicLayout/style/index.js +318 -7
- package/es/BatchOperationBar/index.js +5 -5
- package/es/Boundary/Components/Exception.js +1 -1
- package/es/ContentWithIcon/index.js +3 -3
- package/es/ContentWithQuestion/index.js +3 -3
- package/es/ContentWithQuestion/index.less +1 -2
- package/es/Dialog/Anchor.js +4 -4
- package/es/Dialog/EventProxy.js +1 -1
- package/es/Dialog/index.js +5 -5
- package/es/DocDialog/index.js +4 -4
- package/es/FullscreenBox/index.js +2 -2
- package/es/GraphToolbar/index.js +7 -7
- package/es/Highlight/DiffView/DiffCells.js +1 -1
- package/es/Highlight/DiffView/index.js +9 -9
- package/es/Highlight/JsonView.js +1 -1
- package/es/Highlight/index.d.ts +1 -1
- package/es/Highlight/index.js +4 -4
- package/es/Highlight/useKeyDownCopyEvent.js +1 -1
- package/es/IconFont/index.js +3 -3
- package/es/LocaleDropdown/index.js +3 -3
- package/es/Login/ActivateForm.js +4 -4
- package/es/Login/LoginForm.js +4 -4
- package/es/Login/RegisterForm.js +6 -6
- package/es/Login/index.js +4 -4
- package/es/Lottie/index.js +4 -4
- package/es/NavMenu/index.js +2 -2
- package/es/PageContainer/ItemRender.js +1 -1
- package/es/PageContainer/index.js +12 -7
- package/es/PageContainer/style/index.js +11 -6
- package/es/Password/index.js +7 -7
- package/es/Ranger/QuickPicker.d.ts +2 -2
- package/es/Ranger/QuickPicker.js +5 -5
- package/es/Ranger/Ranger.js +5 -5
- package/es/Ranger/constant/index.js +1 -1
- package/es/Ranger/index.d.ts +2 -0
- package/es/Ranger/index.js +2 -0
- package/es/SideTip/Dragger.js +3 -3
- package/es/SideTip/IconLoading.js +3 -3
- package/es/SideTip/index.js +4 -4
- package/es/TagSelect/Group.js +2 -2
- package/es/TagSelect/Item.js +4 -4
- package/es/TagSelect/style/index.js +3 -3
- package/es/TaskGraph/Graph.js +1 -1
- package/es/TaskGraph/index.js +6 -6
- package/es/TaskGraph/register.js +3 -3
- package/es/TreeSearch/index.d.ts +2 -2
- package/es/TreeSearch/index.js +2 -2
- package/es/TreeSearch/util.js +5 -5
- package/es/Welcome/index.js +4 -3
- package/es/Welcome/index.less +4 -5
- package/es/_util/genComponentStyleHook.js +3 -3
- package/es/locale/LocaleWrapper.js +3 -3
- package/es/locale/en-US.js +3 -3
- package/es/locale/zh-CN.js +3 -3
- package/es/locale/zh-TW.js +3 -3
- package/lib/BasicLayout/Header.d.ts +1 -1
- package/lib/BasicLayout/Header.js +51 -69
- package/lib/BasicLayout/index.d.ts +0 -1
- package/lib/BasicLayout/index.js +49 -44
- package/lib/BasicLayout/style/Header.d.ts +9 -0
- package/lib/BasicLayout/style/Header.js +139 -0
- package/lib/BasicLayout/style/index.js +415 -7
- package/lib/ContentWithQuestion/index.less +1 -2
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/PageContainer/index.js +8 -2
- package/lib/PageContainer/style/index.js +13 -4
- package/lib/Ranger/QuickPicker.d.ts +2 -2
- package/lib/Ranger/index.d.ts +2 -0
- package/lib/Ranger/index.js +8 -0
- package/lib/TreeSearch/index.d.ts +2 -2
- package/lib/Welcome/index.js +11 -1
- package/lib/Welcome/index.less +4 -5
- package/package.json +6 -6
- package/es/BasicLayout/Header.less +0 -134
- package/es/BasicLayout/index.less +0 -396
- package/es/assets/user.svg +0 -16
- package/lib/BasicLayout/Header.less +0 -134
- package/lib/BasicLayout/index.less +0 -396
- package/lib/assets/user.svg +0 -16
package/es/BasicLayout/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
var _excluded = ["children", "location", "banner", "iconUrl", "logoUrl", "simpleLogoUrl", "topHeader", "menus", "defaultCollapsed", "defaultSelectedKeys", "defaultOpenKeys", "sideHeader", "subSideMenuProps", "subSideMenus", "
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["children", "location", "banner", "iconUrl", "logoUrl", "simpleLogoUrl", "topHeader", "menus", "defaultCollapsed", "defaultSelectedKeys", "defaultOpenKeys", "sideHeader", "subSideMenuProps", "subSideMenus", "className", "prefixCls"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
7
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -9,26 +9,25 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
9
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
-
function _iterableToArrayLimit(
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
16
|
import { CaretRightFilled, LeftOutlined, RightOutlined } from '@oceanbase/icons';
|
|
17
17
|
import { setAlpha } from '@ant-design/pro-components';
|
|
18
|
-
import { token } from '@oceanbase/design';
|
|
18
|
+
import { Typography, token } from '@oceanbase/design';
|
|
19
19
|
import { isNullValue } from '@oceanbase/util';
|
|
20
20
|
import { ConfigProvider, Divider, Layout, Menu, Tooltip } from '@oceanbase/design';
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import { some } from 'lodash';
|
|
23
23
|
import { pathToRegexp } from 'path-to-regexp';
|
|
24
|
-
import React, {
|
|
24
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
25
25
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
26
|
-
import {
|
|
26
|
+
import { urlToList } from "../_util";
|
|
27
27
|
import useNavigate from "../_util/useNavigate";
|
|
28
28
|
import Header from "./Header";
|
|
29
29
|
import zhCN from "./locale/zh-CN";
|
|
30
30
|
import useStyle from "./style";
|
|
31
|
-
import "./index.less";
|
|
32
31
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
32
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
33
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -36,9 +35,8 @@ var Content = Layout.Content,
|
|
|
36
35
|
Sider = Layout.Sider;
|
|
37
36
|
var SubMenu = Menu.SubMenu,
|
|
38
37
|
Item = Menu.Item;
|
|
39
|
-
var prefix = getPrefix('layout');
|
|
40
38
|
var BasicLayout = function BasicLayout(_ref) {
|
|
41
|
-
var _classNames2;
|
|
39
|
+
var _classNames, _classNames2;
|
|
42
40
|
var children = _ref.children,
|
|
43
41
|
_ref$location = _ref.location,
|
|
44
42
|
_ref$location2 = _ref$location === void 0 ? {} : _ref$location,
|
|
@@ -59,15 +57,14 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
59
57
|
sideHeader = _ref.sideHeader,
|
|
60
58
|
subSideMenuProps = _ref.subSideMenuProps,
|
|
61
59
|
subSideMenus = _ref.subSideMenus,
|
|
62
|
-
customizePrefixCls = _ref.prefixCls,
|
|
63
60
|
className = _ref.className,
|
|
61
|
+
customizePrefixCls = _ref.prefixCls,
|
|
64
62
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
65
63
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
66
64
|
getPrefixCls = _useContext.getPrefixCls;
|
|
67
|
-
var prefixCls = getPrefixCls('basic-layout', customizePrefixCls);
|
|
65
|
+
var prefixCls = getPrefixCls('pro-basic-layout', customizePrefixCls);
|
|
68
66
|
var _useStyle = useStyle(prefixCls),
|
|
69
67
|
wrapSSR = _useStyle.wrapSSR;
|
|
70
|
-
var basicLayoutCls = classNames(className);
|
|
71
68
|
var navigate = useNavigate();
|
|
72
69
|
// 侧边栏导航是否收起
|
|
73
70
|
var _useState = useState(defaultCollapsed),
|
|
@@ -148,24 +145,20 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
148
145
|
}) : item.accessible)) {
|
|
149
146
|
pre.push( /*#__PURE__*/_jsx(SubMenu, {
|
|
150
147
|
"data-testid": "menu.sub",
|
|
151
|
-
title: /*#__PURE__*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
children: item.title
|
|
166
|
-
})]
|
|
167
|
-
})
|
|
168
|
-
})),
|
|
148
|
+
title: /*#__PURE__*/_jsxs("div", {
|
|
149
|
+
children: [renderIcon(item), /*#__PURE__*/_jsx(Typography.Text, {
|
|
150
|
+
ellipsis: {
|
|
151
|
+
tooltip: {
|
|
152
|
+
placement: 'right'
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
style: {
|
|
156
|
+
lineHeight: '40px',
|
|
157
|
+
maxWidth: 80
|
|
158
|
+
},
|
|
159
|
+
children: item.title
|
|
160
|
+
})]
|
|
161
|
+
}),
|
|
169
162
|
children: renderMenu(item.children)
|
|
170
163
|
}, item.link));
|
|
171
164
|
} else if (!item.children && accessible) {
|
|
@@ -173,27 +166,23 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
173
166
|
"data-testid": "menu.item",
|
|
174
167
|
onClick: function onClick() {
|
|
175
168
|
if (pathname !== item.link) {
|
|
176
|
-
navigate === null || navigate === void 0
|
|
169
|
+
navigate === null || navigate === void 0 || navigate(item.link);
|
|
177
170
|
}
|
|
178
171
|
},
|
|
179
|
-
children: /*#__PURE__*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
children: item.title
|
|
194
|
-
})]
|
|
195
|
-
})
|
|
196
|
-
}))
|
|
172
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
173
|
+
children: [renderIcon(item), /*#__PURE__*/_jsx(Typography.Text, {
|
|
174
|
+
ellipsis: {
|
|
175
|
+
tooltip: {
|
|
176
|
+
placement: 'right'
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
style: {
|
|
180
|
+
lineHeight: '40px',
|
|
181
|
+
maxWidth: 116
|
|
182
|
+
},
|
|
183
|
+
children: item.title
|
|
184
|
+
})]
|
|
185
|
+
})
|
|
197
186
|
}, item.link));
|
|
198
187
|
}
|
|
199
188
|
if (item.divider && accessible) {
|
|
@@ -230,7 +219,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
230
219
|
"data-testid": "menu.item",
|
|
231
220
|
onClick: function onClick() {
|
|
232
221
|
if (pathname !== item.link) {
|
|
233
|
-
navigate === null || navigate === void 0
|
|
222
|
+
navigate === null || navigate === void 0 || navigate(item.link);
|
|
234
223
|
}
|
|
235
224
|
},
|
|
236
225
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
@@ -254,7 +243,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
254
243
|
var siderWidth = 0;
|
|
255
244
|
// 根据菜单项的配置计算侧边栏的宽度
|
|
256
245
|
if (subSideMenus && menus) {
|
|
257
|
-
siderWidth = collapsed ?
|
|
246
|
+
siderWidth = collapsed ? 52 * 2 : 208;
|
|
258
247
|
} else if (subSideMenus && !menus) {
|
|
259
248
|
siderWidth = 52;
|
|
260
249
|
} else if (!subSideMenus && menus) {
|
|
@@ -264,34 +253,35 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
264
253
|
}
|
|
265
254
|
return wrapSSR( /*#__PURE__*/_jsxs(_Fragment, {
|
|
266
255
|
children: [banner && /*#__PURE__*/_jsx("div", {
|
|
267
|
-
className: "".concat(
|
|
256
|
+
className: "".concat(prefixCls, "-banner-wrapper"),
|
|
268
257
|
children: banner
|
|
269
258
|
}), /*#__PURE__*/_jsx(Layout, _objectSpread(_objectSpread({
|
|
270
|
-
className: classNames(
|
|
259
|
+
className: classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-with-banner"), banner), _defineProperty(_classNames, "".concat(prefixCls, "-sider-").concat(siderWidth), true), _classNames), className)
|
|
271
260
|
}, restProps), {}, {
|
|
272
261
|
children: /*#__PURE__*/_jsxs(React.Fragment, {
|
|
273
262
|
children: [/*#__PURE__*/_jsx(Header, _objectSpread({
|
|
263
|
+
prefixCls: prefixCls,
|
|
274
264
|
pathname: pathname,
|
|
275
265
|
iconUrl: iconUrl,
|
|
276
266
|
logoUrl: logoUrl,
|
|
277
267
|
simpleLogoUrl: simpleLogoUrl
|
|
278
268
|
}, topHeader)), /*#__PURE__*/_jsx("div", {
|
|
279
269
|
children: /*#__PURE__*/_jsxs(Layout, {
|
|
280
|
-
className: "".concat(
|
|
270
|
+
className: "".concat(prefixCls, "-content-layout"),
|
|
281
271
|
style: {
|
|
282
272
|
marginTop: 48
|
|
283
273
|
},
|
|
284
274
|
children: [(subSideMenus || menus) && /*#__PURE__*/_jsx(Sider, {
|
|
285
275
|
theme: "light",
|
|
286
276
|
width: siderWidth,
|
|
287
|
-
className: classNames("".concat(
|
|
277
|
+
className: classNames("".concat(prefixCls, "-sider"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-sider-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefixCls, "-sider-has-sub-sider"), subSideMenus), _classNames2)),
|
|
288
278
|
children: /*#__PURE__*/_jsxs("div", {
|
|
289
|
-
className: "".concat(
|
|
279
|
+
className: "".concat(prefixCls, "-sider-wrapper"),
|
|
290
280
|
children: [subSideMenus && /*#__PURE__*/_jsx("div", {
|
|
291
|
-
className: "".concat(
|
|
281
|
+
className: "".concat(prefixCls, "-sub-sider"),
|
|
292
282
|
children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, subSideMenuProps), {}, {
|
|
293
283
|
mode: "vertical",
|
|
294
|
-
className: "".concat(
|
|
284
|
+
className: "".concat(prefixCls, "-menu-vertical"),
|
|
295
285
|
children: renderCollapsedMenu(subSideMenus, true)
|
|
296
286
|
}))
|
|
297
287
|
}), (sideHeader || menus) && /*#__PURE__*/_jsxs("div", {
|
|
@@ -300,17 +290,17 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
300
290
|
width: '100%'
|
|
301
291
|
},
|
|
302
292
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
303
|
-
className: "".concat(
|
|
293
|
+
className: "".concat(prefixCls, "-sider-content"),
|
|
304
294
|
children: [sideHeader && /*#__PURE__*/_jsx("div", {
|
|
305
|
-
className: "".concat(
|
|
295
|
+
className: "".concat(prefixCls, "-sider-header"),
|
|
306
296
|
children: sideHeader
|
|
307
297
|
}), /*#__PURE__*/_jsx("div", {
|
|
308
|
-
className: "".concat(
|
|
298
|
+
className: "".concat(prefixCls, "-menu-wrapper"),
|
|
309
299
|
children: collapsed ? /*#__PURE__*/_jsx("div", {
|
|
310
|
-
className: "".concat(
|
|
300
|
+
className: "".concat(prefixCls, "-menu-collapsed"),
|
|
311
301
|
children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
312
302
|
mode: "vertical",
|
|
313
|
-
className: "".concat(
|
|
303
|
+
className: "".concat(prefixCls, "-menu-vertical"),
|
|
314
304
|
children: renderCollapsedMenu(menus, false)
|
|
315
305
|
}))
|
|
316
306
|
}) : /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
@@ -324,14 +314,14 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
324
314
|
}
|
|
325
315
|
});
|
|
326
316
|
},
|
|
327
|
-
className: "".concat(
|
|
317
|
+
className: "".concat(prefixCls, "-menu"),
|
|
328
318
|
children: renderMenu(menus)
|
|
329
319
|
}))
|
|
330
320
|
})]
|
|
331
321
|
}), /*#__PURE__*/_jsx("div", {
|
|
332
|
-
className: "".concat(
|
|
322
|
+
className: "".concat(prefixCls, "-sider-border"),
|
|
333
323
|
children: /*#__PURE__*/_jsx("div", {
|
|
334
|
-
className: "".concat(
|
|
324
|
+
className: "".concat(prefixCls, "-sider-collapse"),
|
|
335
325
|
onClick: function onClick() {
|
|
336
326
|
setCollapsed(!collapsed);
|
|
337
327
|
// 导航展开/收起时,重置 openKeys
|
|
@@ -343,7 +333,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
343
333
|
})]
|
|
344
334
|
})
|
|
345
335
|
}), /*#__PURE__*/_jsx(Content, {
|
|
346
|
-
className: classNames("".concat(
|
|
336
|
+
className: classNames("".concat(prefixCls, "-content"), "".concat(prefixCls, "-content-").concat(siderWidth)),
|
|
347
337
|
style: {
|
|
348
338
|
marginLeft: siderWidth
|
|
349
339
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
|
|
3
|
+
export type HeaderToken = FullToken<any>;
|
|
4
|
+
export declare const genHeaderStyle: GenerateStyle<HeaderToken>;
|
|
5
|
+
declare const _default: (prefixCls: string) => {
|
|
6
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
7
|
+
hashId: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
|
+
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
|
+
export var genHeaderStyle = function genHeaderStyle(token) {
|
|
7
|
+
var _$concat2, _$concat5, _$concat7, _ref;
|
|
8
|
+
var antCls = token.antCls,
|
|
9
|
+
componentCls = token.componentCls;
|
|
10
|
+
return _ref = {}, _defineProperty(_ref, "".concat(componentCls), (_$concat5 = {
|
|
11
|
+
position: 'fixed',
|
|
12
|
+
zIndex: 10,
|
|
13
|
+
width: '100%',
|
|
14
|
+
height: 48,
|
|
15
|
+
padding: '10px 24px',
|
|
16
|
+
lineHeight: '48px',
|
|
17
|
+
backgroundColor: token.colorBgLayout,
|
|
18
|
+
boxShadow: "inset 0 -1px 0 0 ".concat(token.colorBorderSecondary)
|
|
19
|
+
}, _defineProperty(_$concat5, "".concat(componentCls, "-content"), {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'space-between',
|
|
23
|
+
maxWidth: token.maxWidth,
|
|
24
|
+
height: '100%',
|
|
25
|
+
margin: '0 auto'
|
|
26
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-logo"), {
|
|
27
|
+
height: 24,
|
|
28
|
+
cursor: 'pointer'
|
|
29
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-icon"), {
|
|
30
|
+
width: 52,
|
|
31
|
+
height: 48,
|
|
32
|
+
lineHeight: '48px',
|
|
33
|
+
textAlign: 'center',
|
|
34
|
+
borderRight: "1px solid ".concat(token.colorBorderSecondary),
|
|
35
|
+
borderBottom: "1px solid ".concat(token.colorBorderSecondary),
|
|
36
|
+
cursor: 'pointer',
|
|
37
|
+
img: {
|
|
38
|
+
height: 32,
|
|
39
|
+
marginTop: 8
|
|
40
|
+
}
|
|
41
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-title"), {
|
|
42
|
+
/* 占据剩余的全部空间 */
|
|
43
|
+
flex: 1,
|
|
44
|
+
margin: '0 16px'
|
|
45
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-extra"), _defineProperty({
|
|
46
|
+
display: 'flex',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
justifyContent: 'space-between'
|
|
49
|
+
}, "".concat(componentCls, "-extra-item"), (_$concat2 = {
|
|
50
|
+
display: 'inline-flex',
|
|
51
|
+
fontSize: 12,
|
|
52
|
+
cursor: 'pointer',
|
|
53
|
+
'&:not(:last-child)': {
|
|
54
|
+
marginRight: 24
|
|
55
|
+
}
|
|
56
|
+
}, _defineProperty(_$concat2, "".concat(componentCls, "-extra-icon-wrapper"), {
|
|
57
|
+
width: 28,
|
|
58
|
+
height: 28,
|
|
59
|
+
lineHeight: '28px',
|
|
60
|
+
textAlign: 'center',
|
|
61
|
+
border: '0.88px solid #ced4e1',
|
|
62
|
+
borderRadius: 14
|
|
63
|
+
}), _defineProperty(_$concat2, "".concat(componentCls, "-extra-user-wrapper"), _defineProperty({
|
|
64
|
+
height: 28,
|
|
65
|
+
padding: '0 10px',
|
|
66
|
+
lineHeight: '28px',
|
|
67
|
+
border: '0.88px solid #ced4e1',
|
|
68
|
+
borderRadius: 14
|
|
69
|
+
}, "".concat(componentCls, "-extra-user-icon"), {
|
|
70
|
+
marginRight: 6
|
|
71
|
+
})), _$concat2))), _defineProperty(_$concat5, "".concat(componentCls, "-extra-with-label"), _defineProperty({}, "".concat(componentCls, "-extra-item"), {
|
|
72
|
+
'&:not(:last-child)': {
|
|
73
|
+
marginRight: '24px !important'
|
|
74
|
+
}
|
|
75
|
+
})), _$concat5)), _defineProperty(_ref, "".concat(componentCls, "-about-wrapper"), (_$concat7 = {}, _defineProperty(_$concat7, "".concat(componentCls, "-about"), {
|
|
76
|
+
marginTop: 12
|
|
77
|
+
}), _defineProperty(_$concat7, "".concat(componentCls, "-logo"), {
|
|
78
|
+
height: 72
|
|
79
|
+
}), _defineProperty(_$concat7, "".concat(componentCls, "-release-info"), _defineProperty({
|
|
80
|
+
marginTop: 20,
|
|
81
|
+
marginBottom: 50
|
|
82
|
+
}, "".concat(componentCls, "-date"), {
|
|
83
|
+
fontSize: 12,
|
|
84
|
+
color: token.colorTextTertiary
|
|
85
|
+
})), _defineProperty(_$concat7, "".concat(componentCls, "-copyright"), {
|
|
86
|
+
fontSize: 12,
|
|
87
|
+
color: token.colorTextTertiary
|
|
88
|
+
}), _$concat7)), _ref;
|
|
89
|
+
};
|
|
90
|
+
export default (function (prefixCls) {
|
|
91
|
+
var useStyle = genComponentStyleHook('Header', function (token) {
|
|
92
|
+
return [genHeaderStyle(token)];
|
|
93
|
+
});
|
|
94
|
+
return useStyle(prefixCls);
|
|
95
|
+
});
|