@oceanbase/ui 0.2.24 → 0.2.26
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.d.ts +1 -0
- package/es/BackgroundTaskManager/index.js +11 -7
- package/es/BasicLayout/Header.d.ts +1 -1
- package/es/BasicLayout/Header.js +62 -71
- package/es/BasicLayout/index.d.ts +0 -1
- package/es/BasicLayout/index.js +58 -66
- package/es/BasicLayout/style/Header.d.ts +9 -0
- package/es/BasicLayout/style/Header.js +94 -0
- package/es/BasicLayout/style/index.js +307 -6
- 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 +7 -5
- package/es/Highlight/useKeyDownCopyEvent.js +1 -1
- package/es/IconFont/index.js +3 -3
- package/es/LocaleDropdown/index.js +7 -7
- package/es/Login/ActivateForm.js +4 -4
- package/es/Login/LoginForm.js +7 -5
- package/es/Login/RegisterForm.js +6 -6
- package/es/Login/index.js +7 -9
- 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 +3 -3
- package/es/PageContainer/style/index.js +12 -9
- package/es/Password/Content.js +3 -1
- package/es/Password/index.js +10 -8
- package/es/Ranger/QuickPicker.js +5 -5
- package/es/Ranger/Ranger.js +5 -5
- package/es/Ranger/constant/index.js +1 -1
- 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.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/BackgroundTaskManager/index.d.ts +1 -0
- package/lib/BackgroundTaskManager/index.js +5 -1
- package/lib/BasicLayout/Header.d.ts +1 -1
- package/lib/BasicLayout/Header.js +58 -69
- package/lib/BasicLayout/index.d.ts +0 -1
- package/lib/BasicLayout/index.js +50 -45
- package/lib/BasicLayout/style/Header.d.ts +9 -0
- package/lib/BasicLayout/style/Header.js +139 -0
- package/lib/BasicLayout/style/index.js +399 -2
- package/lib/ContentWithQuestion/index.less +1 -2
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/Highlight/index.js +3 -2
- package/lib/LocaleDropdown/index.js +7 -3
- package/lib/Login/LoginForm.js +4 -3
- package/lib/Login/index.js +1 -1
- package/lib/PageContainer/style/index.js +11 -7
- package/lib/Password/Content.js +8 -7
- package/lib/Password/index.js +2 -1
- package/lib/Welcome/index.js +11 -1
- package/lib/Welcome/index.less +4 -5
- package/package.json +7 -7
- 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 {
|
|
18
|
+
import { Typography, theme } 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,7 +35,6 @@ 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
39
|
var _classNames, _classNames2;
|
|
42
40
|
var children = _ref.children,
|
|
@@ -59,15 +57,16 @@ 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);
|
|
63
|
+
var _theme$useToken = theme.useToken(),
|
|
64
|
+
token = _theme$useToken.token;
|
|
65
65
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
66
66
|
getPrefixCls = _useContext.getPrefixCls;
|
|
67
67
|
var prefixCls = getPrefixCls('pro-basic-layout', customizePrefixCls);
|
|
68
68
|
var _useStyle = useStyle(prefixCls),
|
|
69
69
|
wrapSSR = _useStyle.wrapSSR;
|
|
70
|
-
var basicLayoutCls = classNames(prefixCls, className);
|
|
71
70
|
var navigate = useNavigate();
|
|
72
71
|
// 侧边栏导航是否收起
|
|
73
72
|
var _useState = useState(defaultCollapsed),
|
|
@@ -148,24 +147,20 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
148
147
|
}) : item.accessible)) {
|
|
149
148
|
pre.push( /*#__PURE__*/_jsx(SubMenu, {
|
|
150
149
|
"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
|
-
})),
|
|
150
|
+
title: /*#__PURE__*/_jsxs("div", {
|
|
151
|
+
children: [renderIcon(item), /*#__PURE__*/_jsx(Typography.Text, {
|
|
152
|
+
ellipsis: {
|
|
153
|
+
tooltip: {
|
|
154
|
+
placement: 'right'
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
style: {
|
|
158
|
+
lineHeight: '40px',
|
|
159
|
+
maxWidth: 80
|
|
160
|
+
},
|
|
161
|
+
children: item.title
|
|
162
|
+
})]
|
|
163
|
+
}),
|
|
169
164
|
children: renderMenu(item.children)
|
|
170
165
|
}, item.link));
|
|
171
166
|
} else if (!item.children && accessible) {
|
|
@@ -173,27 +168,23 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
173
168
|
"data-testid": "menu.item",
|
|
174
169
|
onClick: function onClick() {
|
|
175
170
|
if (pathname !== item.link) {
|
|
176
|
-
navigate === null || navigate === void 0
|
|
171
|
+
navigate === null || navigate === void 0 || navigate(item.link);
|
|
177
172
|
}
|
|
178
173
|
},
|
|
179
|
-
children: /*#__PURE__*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
children: item.title
|
|
194
|
-
})]
|
|
195
|
-
})
|
|
196
|
-
}))
|
|
174
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
175
|
+
children: [renderIcon(item), /*#__PURE__*/_jsx(Typography.Text, {
|
|
176
|
+
ellipsis: {
|
|
177
|
+
tooltip: {
|
|
178
|
+
placement: 'right'
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
style: {
|
|
182
|
+
lineHeight: '40px',
|
|
183
|
+
maxWidth: 116
|
|
184
|
+
},
|
|
185
|
+
children: item.title
|
|
186
|
+
})]
|
|
187
|
+
})
|
|
197
188
|
}, item.link));
|
|
198
189
|
}
|
|
199
190
|
if (item.divider && accessible) {
|
|
@@ -230,7 +221,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
230
221
|
"data-testid": "menu.item",
|
|
231
222
|
onClick: function onClick() {
|
|
232
223
|
if (pathname !== item.link) {
|
|
233
|
-
navigate === null || navigate === void 0
|
|
224
|
+
navigate === null || navigate === void 0 || navigate(item.link);
|
|
234
225
|
}
|
|
235
226
|
},
|
|
236
227
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
@@ -264,34 +255,35 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
264
255
|
}
|
|
265
256
|
return wrapSSR( /*#__PURE__*/_jsxs(_Fragment, {
|
|
266
257
|
children: [banner && /*#__PURE__*/_jsx("div", {
|
|
267
|
-
className: "".concat(
|
|
258
|
+
className: "".concat(prefixCls, "-banner-wrapper"),
|
|
268
259
|
children: banner
|
|
269
260
|
}), /*#__PURE__*/_jsx(Layout, _objectSpread(_objectSpread({
|
|
270
|
-
className: classNames(
|
|
261
|
+
className: classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-with-banner"), banner), _defineProperty(_classNames, "".concat(prefixCls, "-sider-").concat(siderWidth), true), _classNames), className)
|
|
271
262
|
}, restProps), {}, {
|
|
272
263
|
children: /*#__PURE__*/_jsxs(React.Fragment, {
|
|
273
264
|
children: [/*#__PURE__*/_jsx(Header, _objectSpread({
|
|
265
|
+
prefixCls: prefixCls,
|
|
274
266
|
pathname: pathname,
|
|
275
267
|
iconUrl: iconUrl,
|
|
276
268
|
logoUrl: logoUrl,
|
|
277
269
|
simpleLogoUrl: simpleLogoUrl
|
|
278
270
|
}, topHeader)), /*#__PURE__*/_jsx("div", {
|
|
279
271
|
children: /*#__PURE__*/_jsxs(Layout, {
|
|
280
|
-
className: "".concat(
|
|
272
|
+
className: "".concat(prefixCls, "-content-layout"),
|
|
281
273
|
style: {
|
|
282
274
|
marginTop: 48
|
|
283
275
|
},
|
|
284
276
|
children: [(subSideMenus || menus) && /*#__PURE__*/_jsx(Sider, {
|
|
285
277
|
theme: "light",
|
|
286
278
|
width: siderWidth,
|
|
287
|
-
className: classNames("".concat(
|
|
279
|
+
className: classNames("".concat(prefixCls, "-sider"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-sider-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefixCls, "-sider-has-sub-sider"), subSideMenus), _classNames2)),
|
|
288
280
|
children: /*#__PURE__*/_jsxs("div", {
|
|
289
|
-
className: "".concat(
|
|
281
|
+
className: "".concat(prefixCls, "-sider-wrapper"),
|
|
290
282
|
children: [subSideMenus && /*#__PURE__*/_jsx("div", {
|
|
291
|
-
className: "".concat(
|
|
283
|
+
className: "".concat(prefixCls, "-sub-sider"),
|
|
292
284
|
children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, subSideMenuProps), {}, {
|
|
293
285
|
mode: "vertical",
|
|
294
|
-
className: "".concat(
|
|
286
|
+
className: "".concat(prefixCls, "-menu-vertical"),
|
|
295
287
|
children: renderCollapsedMenu(subSideMenus, true)
|
|
296
288
|
}))
|
|
297
289
|
}), (sideHeader || menus) && /*#__PURE__*/_jsxs("div", {
|
|
@@ -300,17 +292,17 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
300
292
|
width: '100%'
|
|
301
293
|
},
|
|
302
294
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
303
|
-
className: "".concat(
|
|
295
|
+
className: "".concat(prefixCls, "-sider-content"),
|
|
304
296
|
children: [sideHeader && /*#__PURE__*/_jsx("div", {
|
|
305
|
-
className: "".concat(
|
|
297
|
+
className: "".concat(prefixCls, "-sider-header"),
|
|
306
298
|
children: sideHeader
|
|
307
299
|
}), /*#__PURE__*/_jsx("div", {
|
|
308
|
-
className: "".concat(
|
|
300
|
+
className: "".concat(prefixCls, "-menu-wrapper"),
|
|
309
301
|
children: collapsed ? /*#__PURE__*/_jsx("div", {
|
|
310
|
-
className: "".concat(
|
|
302
|
+
className: "".concat(prefixCls, "-menu-collapsed"),
|
|
311
303
|
children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
312
304
|
mode: "vertical",
|
|
313
|
-
className: "".concat(
|
|
305
|
+
className: "".concat(prefixCls, "-menu-vertical"),
|
|
314
306
|
children: renderCollapsedMenu(menus, false)
|
|
315
307
|
}))
|
|
316
308
|
}) : /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
@@ -324,14 +316,14 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
324
316
|
}
|
|
325
317
|
});
|
|
326
318
|
},
|
|
327
|
-
className: "".concat(
|
|
319
|
+
className: "".concat(prefixCls, "-menu"),
|
|
328
320
|
children: renderMenu(menus)
|
|
329
321
|
}))
|
|
330
322
|
})]
|
|
331
323
|
}), /*#__PURE__*/_jsx("div", {
|
|
332
|
-
className: "".concat(
|
|
324
|
+
className: "".concat(prefixCls, "-sider-border"),
|
|
333
325
|
children: /*#__PURE__*/_jsx("div", {
|
|
334
|
-
className: "".concat(
|
|
326
|
+
className: "".concat(prefixCls, "-sider-collapse"),
|
|
335
327
|
onClick: function onClick() {
|
|
336
328
|
setCollapsed(!collapsed);
|
|
337
329
|
// 导航展开/收起时,重置 openKeys
|
|
@@ -343,7 +335,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
343
335
|
})]
|
|
344
336
|
})
|
|
345
337
|
}), /*#__PURE__*/_jsx(Content, {
|
|
346
|
-
className: classNames("".concat(
|
|
338
|
+
className: classNames("".concat(prefixCls, "-content"), "".concat(prefixCls, "-content-").concat(siderWidth)),
|
|
347
339
|
style: {
|
|
348
340
|
marginLeft: siderWidth
|
|
349
341
|
},
|
|
@@ -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,94 @@
|
|
|
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 componentCls = token.componentCls;
|
|
9
|
+
return _ref = {}, _defineProperty(_ref, "".concat(componentCls), (_$concat5 = {
|
|
10
|
+
position: 'fixed',
|
|
11
|
+
zIndex: 10,
|
|
12
|
+
width: '100%',
|
|
13
|
+
height: 48,
|
|
14
|
+
padding: '10px 24px',
|
|
15
|
+
lineHeight: '48px',
|
|
16
|
+
backgroundColor: token.colorBgLayout,
|
|
17
|
+
boxShadow: "inset 0 -1px 0 0 ".concat(token.colorBorderSecondary)
|
|
18
|
+
}, _defineProperty(_$concat5, "".concat(componentCls, "-content"), {
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'space-between',
|
|
22
|
+
maxWidth: token.maxWidth,
|
|
23
|
+
height: '100%',
|
|
24
|
+
margin: '0 auto'
|
|
25
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-logo"), {
|
|
26
|
+
height: 24,
|
|
27
|
+
cursor: 'pointer'
|
|
28
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-icon"), {
|
|
29
|
+
width: 52,
|
|
30
|
+
height: 48,
|
|
31
|
+
lineHeight: '48px',
|
|
32
|
+
textAlign: 'center',
|
|
33
|
+
borderRight: "1px solid ".concat(token.colorBorderSecondary),
|
|
34
|
+
borderBottom: "1px solid ".concat(token.colorBorderSecondary),
|
|
35
|
+
cursor: 'pointer',
|
|
36
|
+
img: {
|
|
37
|
+
height: 32,
|
|
38
|
+
marginTop: 8
|
|
39
|
+
}
|
|
40
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-title"), {
|
|
41
|
+
/* 占据剩余的全部空间 */
|
|
42
|
+
flex: 1,
|
|
43
|
+
margin: '0 16px'
|
|
44
|
+
}), _defineProperty(_$concat5, "".concat(componentCls, "-extra"), _defineProperty({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
justifyContent: 'space-between'
|
|
48
|
+
}, "".concat(componentCls, "-extra-item"), (_$concat2 = {
|
|
49
|
+
display: 'inline-flex',
|
|
50
|
+
fontSize: 12,
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
'&:not(:last-child)': {
|
|
53
|
+
marginRight: 24
|
|
54
|
+
}
|
|
55
|
+
}, _defineProperty(_$concat2, "".concat(componentCls, "-extra-icon-wrapper"), {
|
|
56
|
+
width: 28,
|
|
57
|
+
height: 28,
|
|
58
|
+
lineHeight: '28px',
|
|
59
|
+
textAlign: 'center',
|
|
60
|
+
border: '0.88px solid #ced4e1',
|
|
61
|
+
borderRadius: 14
|
|
62
|
+
}), _defineProperty(_$concat2, "".concat(componentCls, "-extra-user-wrapper"), _defineProperty({
|
|
63
|
+
height: 28,
|
|
64
|
+
padding: '0 10px',
|
|
65
|
+
lineHeight: '28px',
|
|
66
|
+
border: '0.88px solid #ced4e1',
|
|
67
|
+
borderRadius: 14
|
|
68
|
+
}, "".concat(componentCls, "-extra-user-icon"), {
|
|
69
|
+
marginRight: 6
|
|
70
|
+
})), _$concat2))), _defineProperty(_$concat5, "".concat(componentCls, "-extra-with-label"), _defineProperty({}, "".concat(componentCls, "-extra-item"), {
|
|
71
|
+
'&:not(:last-child)': {
|
|
72
|
+
marginRight: '24px !important'
|
|
73
|
+
}
|
|
74
|
+
})), _$concat5)), _defineProperty(_ref, "".concat(componentCls, "-about-wrapper"), (_$concat7 = {}, _defineProperty(_$concat7, "".concat(componentCls, "-about"), {
|
|
75
|
+
marginTop: 12
|
|
76
|
+
}), _defineProperty(_$concat7, "".concat(componentCls, "-logo"), {
|
|
77
|
+
height: 72
|
|
78
|
+
}), _defineProperty(_$concat7, "".concat(componentCls, "-release-info"), _defineProperty({
|
|
79
|
+
marginTop: 20,
|
|
80
|
+
marginBottom: 50
|
|
81
|
+
}, "".concat(componentCls, "-date"), {
|
|
82
|
+
fontSize: 12,
|
|
83
|
+
color: token.colorTextTertiary
|
|
84
|
+
})), _defineProperty(_$concat7, "".concat(componentCls, "-copyright"), {
|
|
85
|
+
fontSize: 12,
|
|
86
|
+
color: token.colorTextTertiary
|
|
87
|
+
}), _$concat7)), _ref;
|
|
88
|
+
};
|
|
89
|
+
export default (function (prefixCls) {
|
|
90
|
+
var useStyle = genComponentStyleHook('Header', function (token) {
|
|
91
|
+
return [genHeaderStyle(token)];
|
|
92
|
+
});
|
|
93
|
+
return useStyle(prefixCls);
|
|
94
|
+
});
|