@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.
Files changed (91) hide show
  1. package/dist/ui.min.css +1 -1
  2. package/dist/ui.min.js +1 -1
  3. package/es/Action/Group.js +3 -3
  4. package/es/Action/Item.js +1 -1
  5. package/es/BackgroundTaskManager/RefreshMan.js +1 -1
  6. package/es/BackgroundTaskManager/index.js +6 -6
  7. package/es/BasicLayout/Header.d.ts +1 -1
  8. package/es/BasicLayout/Header.js +57 -62
  9. package/es/BasicLayout/index.d.ts +0 -1
  10. package/es/BasicLayout/index.js +59 -69
  11. package/es/BasicLayout/style/Header.d.ts +9 -0
  12. package/es/BasicLayout/style/Header.js +95 -0
  13. package/es/BasicLayout/style/index.js +318 -7
  14. package/es/BatchOperationBar/index.js +5 -5
  15. package/es/Boundary/Components/Exception.js +1 -1
  16. package/es/ContentWithIcon/index.js +3 -3
  17. package/es/ContentWithQuestion/index.js +3 -3
  18. package/es/ContentWithQuestion/index.less +1 -2
  19. package/es/Dialog/Anchor.js +4 -4
  20. package/es/Dialog/EventProxy.js +1 -1
  21. package/es/Dialog/index.js +5 -5
  22. package/es/DocDialog/index.js +4 -4
  23. package/es/FullscreenBox/index.js +2 -2
  24. package/es/GraphToolbar/index.js +7 -7
  25. package/es/Highlight/DiffView/DiffCells.js +1 -1
  26. package/es/Highlight/DiffView/index.js +9 -9
  27. package/es/Highlight/JsonView.js +1 -1
  28. package/es/Highlight/index.d.ts +1 -1
  29. package/es/Highlight/index.js +4 -4
  30. package/es/Highlight/useKeyDownCopyEvent.js +1 -1
  31. package/es/IconFont/index.js +3 -3
  32. package/es/LocaleDropdown/index.js +3 -3
  33. package/es/Login/ActivateForm.js +4 -4
  34. package/es/Login/LoginForm.js +4 -4
  35. package/es/Login/RegisterForm.js +6 -6
  36. package/es/Login/index.js +4 -4
  37. package/es/Lottie/index.js +4 -4
  38. package/es/NavMenu/index.js +2 -2
  39. package/es/PageContainer/ItemRender.js +1 -1
  40. package/es/PageContainer/index.js +12 -7
  41. package/es/PageContainer/style/index.js +11 -6
  42. package/es/Password/index.js +7 -7
  43. package/es/Ranger/QuickPicker.d.ts +2 -2
  44. package/es/Ranger/QuickPicker.js +5 -5
  45. package/es/Ranger/Ranger.js +5 -5
  46. package/es/Ranger/constant/index.js +1 -1
  47. package/es/Ranger/index.d.ts +2 -0
  48. package/es/Ranger/index.js +2 -0
  49. package/es/SideTip/Dragger.js +3 -3
  50. package/es/SideTip/IconLoading.js +3 -3
  51. package/es/SideTip/index.js +4 -4
  52. package/es/TagSelect/Group.js +2 -2
  53. package/es/TagSelect/Item.js +4 -4
  54. package/es/TagSelect/style/index.js +3 -3
  55. package/es/TaskGraph/Graph.js +1 -1
  56. package/es/TaskGraph/index.js +6 -6
  57. package/es/TaskGraph/register.js +3 -3
  58. package/es/TreeSearch/index.d.ts +2 -2
  59. package/es/TreeSearch/index.js +2 -2
  60. package/es/TreeSearch/util.js +5 -5
  61. package/es/Welcome/index.js +4 -3
  62. package/es/Welcome/index.less +4 -5
  63. package/es/_util/genComponentStyleHook.js +3 -3
  64. package/es/locale/LocaleWrapper.js +3 -3
  65. package/es/locale/en-US.js +3 -3
  66. package/es/locale/zh-CN.js +3 -3
  67. package/es/locale/zh-TW.js +3 -3
  68. package/lib/BasicLayout/Header.d.ts +1 -1
  69. package/lib/BasicLayout/Header.js +51 -69
  70. package/lib/BasicLayout/index.d.ts +0 -1
  71. package/lib/BasicLayout/index.js +49 -44
  72. package/lib/BasicLayout/style/Header.d.ts +9 -0
  73. package/lib/BasicLayout/style/Header.js +139 -0
  74. package/lib/BasicLayout/style/index.js +415 -7
  75. package/lib/ContentWithQuestion/index.less +1 -2
  76. package/lib/Highlight/index.d.ts +1 -1
  77. package/lib/PageContainer/index.js +8 -2
  78. package/lib/PageContainer/style/index.js +13 -4
  79. package/lib/Ranger/QuickPicker.d.ts +2 -2
  80. package/lib/Ranger/index.d.ts +2 -0
  81. package/lib/Ranger/index.js +8 -0
  82. package/lib/TreeSearch/index.d.ts +2 -2
  83. package/lib/Welcome/index.js +11 -1
  84. package/lib/Welcome/index.less +4 -5
  85. package/package.json +6 -6
  86. package/es/BasicLayout/Header.less +0 -134
  87. package/es/BasicLayout/index.less +0 -396
  88. package/es/assets/user.svg +0 -16
  89. package/lib/BasicLayout/Header.less +0 -134
  90. package/lib/BasicLayout/index.less +0 -396
  91. package/lib/assets/user.svg +0 -16
@@ -1,7 +1,7 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["children", "location", "banner", "iconUrl", "logoUrl", "simpleLogoUrl", "topHeader", "menus", "defaultCollapsed", "defaultSelectedKeys", "defaultOpenKeys", "sideHeader", "subSideMenuProps", "subSideMenus", "prefixCls", "className"];
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
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, { useContext, useEffect, useState } from 'react';
24
+ import React, { useEffect, useState, useContext } from 'react';
25
25
  import LocaleWrapper from "../locale/LocaleWrapper";
26
- import { getPrefix, isEnglish, urlToList } from "../_util";
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__*/_jsx(Tooltip, _objectSpread(_objectSpread({
152
- placement: "right",
153
- title: item.title
154
- // SubMenu 通常都会带 icon,因此这里判断英文环境下如果标题字符长度 > 15 就支持 tooltip 展示
155
- }, isEnglish() && item.title && item.title.length > 15 ? {} : {
156
- visible: false,
157
- // Support for antd 5.0
158
- open: false
159
- }), {}, {
160
- getPopupContainer: function getPopupContainer() {
161
- return document.body;
162
- },
163
- children: /*#__PURE__*/_jsxs("span", {
164
- children: [renderIcon(item), /*#__PURE__*/_jsx("span", {
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 ? void 0 : navigate(item.link);
169
+ navigate === null || navigate === void 0 || navigate(item.link);
177
170
  }
178
171
  },
179
- children: /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
180
- placement: "right",
181
- title: item.title
182
- // 对于 Menu.Item,英文环境下如果标题字符长度 > 20 就支持 tooltip 展示
183
- }, isEnglish() && item.title && item.title.length > 20 ? {} : {
184
- visible: false,
185
- // Support for antd 5.0
186
- open: false
187
- }), {}, {
188
- getPopupContainer: function getPopupContainer() {
189
- return document.body;
190
- },
191
- children: /*#__PURE__*/_jsxs("span", {
192
- children: [renderIcon(item), /*#__PURE__*/_jsx("span", {
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 ? void 0 : navigate(item.link);
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 ? 104 : 192;
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(prefix, "-banner-wrapper"),
256
+ className: "".concat(prefixCls, "-banner-wrapper"),
268
257
  children: banner
269
258
  }), /*#__PURE__*/_jsx(Layout, _objectSpread(_objectSpread({
270
- className: classNames(prefix, className, basicLayoutCls, _defineProperty({}, "".concat(prefix, "-with-banner"), banner))
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(prefix, "-content-layout"),
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(prefix, "-sider"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "-sider-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefix, "-sider-has-sub-sider"), subSideMenus), _classNames2)),
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(prefix, "-sider-wrapper"),
279
+ className: "".concat(prefixCls, "-sider-wrapper"),
290
280
  children: [subSideMenus && /*#__PURE__*/_jsx("div", {
291
- className: "".concat(prefix, "-sub-sider"),
281
+ className: "".concat(prefixCls, "-sub-sider"),
292
282
  children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, subSideMenuProps), {}, {
293
283
  mode: "vertical",
294
- className: "".concat(prefix, "-menu-vertical"),
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(prefix, "-sider-content"),
293
+ className: "".concat(prefixCls, "-sider-content"),
304
294
  children: [sideHeader && /*#__PURE__*/_jsx("div", {
305
- className: "".concat(prefix, "-sider-header"),
295
+ className: "".concat(prefixCls, "-sider-header"),
306
296
  children: sideHeader
307
297
  }), /*#__PURE__*/_jsx("div", {
308
- className: "".concat(prefix, "-menu-wrapper"),
298
+ className: "".concat(prefixCls, "-menu-wrapper"),
309
299
  children: collapsed ? /*#__PURE__*/_jsx("div", {
310
- className: "".concat(prefix, "-menu-collapsed"),
300
+ className: "".concat(prefixCls, "-menu-collapsed"),
311
301
  children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, menuProps), {}, {
312
302
  mode: "vertical",
313
- className: "".concat(prefix, "-menu-vertical"),
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(prefix, "-menu"),
317
+ className: "".concat(prefixCls, "-menu"),
328
318
  children: renderMenu(menus)
329
319
  }))
330
320
  })]
331
321
  }), /*#__PURE__*/_jsx("div", {
332
- className: "".concat(prefix, "-sider-border"),
322
+ className: "".concat(prefixCls, "-sider-border"),
333
323
  children: /*#__PURE__*/_jsx("div", {
334
- className: "".concat(prefix, "-sider-collapse"),
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(prefix, "-content"), "".concat(prefix, "-content-").concat(siderWidth)),
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
+ });