@oceanbase/ui 0.2.11 → 0.2.13

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.
@@ -16,14 +16,14 @@ import { REFRESH_FREQUENCY } from "./constants";
16
16
  import { RefreshMan } from "./RefreshMan";
17
17
 
18
18
  // antd Notification组件支持的api种类
19
- export var NotificationApi;
20
- (function (NotificationApi) {
19
+ export var NotificationApi = /*#__PURE__*/function (NotificationApi) {
21
20
  NotificationApi["success"] = "success";
22
21
  NotificationApi["error"] = "error";
23
22
  NotificationApi["info"] = "info";
24
23
  NotificationApi["warning"] = "warning";
25
24
  NotificationApi["open"] = "open";
26
- })(NotificationApi || (NotificationApi = {}));
25
+ return NotificationApi;
26
+ }({});
27
27
  export var BackgroundTaskManagerConstants = {
28
28
  REFRESH_FREQUENCY: REFRESH_FREQUENCY,
29
29
  NotificationApi: NotificationApi
@@ -1,5 +1,5 @@
1
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", "className"];
2
+ var _excluded = ["children", "location", "banner", "iconUrl", "logoUrl", "simpleLogoUrl", "topHeader", "menus", "defaultCollapsed", "defaultSelectedKeys", "defaultOpenKeys", "sideHeader", "subSideMenuProps", "subSideMenus", "prefixCls", "className"];
3
3
  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; }
4
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
5
  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); }
@@ -16,24 +16,25 @@ import { CaretRightFilled, LeftOutlined, RightOutlined } from '@oceanbase/icons'
16
16
  import { setAlpha } from '@ant-design/pro-components';
17
17
  import { token } from '@oceanbase/design';
18
18
  import { isNullValue } from '@oceanbase/util';
19
- import { Divider, Layout, Menu, Tooltip } from '@oceanbase/design';
20
- import classnames from 'classnames';
19
+ import { ConfigProvider, Divider, Layout, Menu, Tooltip } from '@oceanbase/design';
20
+ import classNames from 'classnames';
21
21
  import { some } from 'lodash';
22
22
  import { pathToRegexp } from 'path-to-regexp';
23
- import React, { useEffect, useState } from 'react';
23
+ import React, { useContext, useEffect, useState } from 'react';
24
24
  import LocaleWrapper from "../locale/LocaleWrapper";
25
25
  import { getPrefix, isEnglish, urlToList } from "../_util";
26
26
  import useHistory from "../_util/useHistory";
27
27
  import Header from "./Header";
28
- import "./index.less";
29
28
  import zhCN from "./locale/zh-CN";
29
+ import useStyle from "./style";
30
+ import "./index.less";
30
31
  var Content = Layout.Content,
31
32
  Sider = Layout.Sider;
32
33
  var SubMenu = Menu.SubMenu,
33
34
  Item = Menu.Item;
34
35
  var prefix = getPrefix('layout');
35
36
  var BasicLayout = function BasicLayout(_ref) {
36
- var _classnames2;
37
+ var _classNames2;
37
38
  var children = _ref.children,
38
39
  _ref$location = _ref.location,
39
40
  _ref$location2 = _ref$location === void 0 ? {} : _ref$location,
@@ -54,8 +55,16 @@ var BasicLayout = function BasicLayout(_ref) {
54
55
  sideHeader = _ref.sideHeader,
55
56
  subSideMenuProps = _ref.subSideMenuProps,
56
57
  subSideMenus = _ref.subSideMenus,
58
+ customizePrefixCls = _ref.prefixCls,
57
59
  className = _ref.className,
58
60
  restProps = _objectWithoutProperties(_ref, _excluded);
61
+ var _useContext = useContext(ConfigProvider.ConfigContext),
62
+ getPrefixCls = _useContext.getPrefixCls;
63
+ var prefixCls = getPrefixCls('basic-layout', customizePrefixCls);
64
+ var _useStyle = useStyle(prefixCls),
65
+ wrapSSR = _useStyle.wrapSSR,
66
+ hashId = _useStyle.hashId;
67
+ var basicLayoutCls = classNames(className, hashId);
59
68
  var history = useHistory();
60
69
  // 侧边栏导航是否收起
61
70
  var _useState = useState(defaultCollapsed),
@@ -237,10 +246,10 @@ var BasicLayout = function BasicLayout(_ref) {
237
246
  } else if (!subSideMenus && !menus) {
238
247
  siderWidth = 0;
239
248
  }
240
- return /*#__PURE__*/React.createElement(React.Fragment, null, banner && /*#__PURE__*/React.createElement("div", {
249
+ return wrapSSR( /*#__PURE__*/React.createElement(React.Fragment, null, banner && /*#__PURE__*/React.createElement("div", {
241
250
  className: "".concat(prefix, "-banner-wrapper")
242
251
  }, banner), /*#__PURE__*/React.createElement(Layout, _extends({
243
- className: classnames(prefix, className, _defineProperty({}, "".concat(prefix, "-with-banner"), banner))
252
+ className: classNames(prefix, className, basicLayoutCls, _defineProperty({}, "".concat(prefix, "-with-banner"), banner))
244
253
  }, restProps), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, _extends({
245
254
  pathname: pathname,
246
255
  iconUrl: iconUrl,
@@ -254,7 +263,7 @@ var BasicLayout = function BasicLayout(_ref) {
254
263
  }, (subSideMenus || menus) && /*#__PURE__*/React.createElement(Sider, {
255
264
  theme: "light",
256
265
  width: siderWidth,
257
- className: classnames("".concat(prefix, "-sider"), (_classnames2 = {}, _defineProperty(_classnames2, "".concat(prefix, "-sider-collapsed"), collapsed), _defineProperty(_classnames2, "".concat(prefix, "-sider-has-sub-sider"), subSideMenus), _classnames2))
266
+ className: classNames("".concat(prefix, "-sider"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "-sider-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefix, "-sider-has-sub-sider"), subSideMenus), _classNames2))
258
267
  }, /*#__PURE__*/React.createElement("div", {
259
268
  className: "".concat(prefix, "-sider-wrapper")
260
269
  }, subSideMenus && /*#__PURE__*/React.createElement("div", {
@@ -300,11 +309,11 @@ var BasicLayout = function BasicLayout(_ref) {
300
309
  setOpenKeys([]);
301
310
  }
302
311
  }, collapsed ? /*#__PURE__*/React.createElement(RightOutlined, null) : /*#__PURE__*/React.createElement(LeftOutlined, null)))))), /*#__PURE__*/React.createElement(Content, {
303
- className: classnames("".concat(prefix, "-content"), "".concat(prefix, "-content-").concat(siderWidth)),
312
+ className: classNames("".concat(prefix, "-content"), "".concat(prefix, "-content-").concat(siderWidth)),
304
313
  style: {
305
314
  marginLeft: siderWidth
306
315
  }
307
- }, children))))));
316
+ }, children)))))));
308
317
  };
309
318
  export default LocaleWrapper({
310
319
  componentName: 'BasicLayout',
@@ -371,10 +371,6 @@
371
371
  }
372
372
  }
373
373
 
374
- .@{prefixCls}-pro-footer-bar {
375
- width: calc(100% - 192px - 24px);
376
- }
377
-
378
374
  @media (min-width: @maxWidth) {
379
375
  .@{prefixCls}-pro-footer-bar {
380
376
  right: calc((100% - @maxWidth) / 2 + 24px);
@@ -0,0 +1,5 @@
1
+ import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
2
+ export declare type BasicLayoutToken = FullToken<any>;
3
+ export declare const genBasicLayoutStyle: GenerateStyle<BasicLayoutToken>;
4
+ declare const _default: (prefixCls: string) => any;
5
+ export default _default;
@@ -0,0 +1,21 @@
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
+ 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 genBasicLayoutStyle = function genBasicLayoutStyle(token) {
7
+ var _ref;
8
+ var proComponentsCls = token.proComponentsCls;
9
+ return _ref = {}, _defineProperty(_ref, "".concat(proComponentsCls, "-page-container"), {
10
+ // 48px is the height of BasicLayout header
11
+ minHeight: 'calc(100vh - 48px)'
12
+ }), _defineProperty(_ref, "".concat(proComponentsCls, "-footer-bar"), {
13
+ width: "calc(100% - 192px - 24px)"
14
+ }), _ref;
15
+ };
16
+ export default (function (prefixCls) {
17
+ var useStyle = genComponentStyleHook('BasicLayout', function (token) {
18
+ return [genBasicLayoutStyle(token)];
19
+ });
20
+ return useStyle(prefixCls);
21
+ });
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
29
29
  export declare const THEME_LIGHT = "light";
30
30
  declare const ThemeTypes: ["dark", "light"];
31
31
  export declare type ThemeType = (typeof ThemeTypes)[number];
32
- declare const supportedLanguages: ("ruby" | "javascript" | "typescript" | "css" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
32
+ declare const supportedLanguages: ("ruby" | "json" | "javascript" | "typescript" | "css" | "groovy" | "java" | "python" | "bash" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
33
33
  export declare type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
@@ -15,7 +15,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  * 高亮能力基于highlight.js 的语法解析能力 https://highlightjs.org/
16
16
  * 听说过的还算有名的语言放在langugaes中了,需要新增语言时在languages文件夹中添加并import使用,加入到 languageMap中
17
17
  * 如果没有在 https://github.com/highlightjs/highlight.js/tree/master/src/languages 中查找是否支持,然后添加
18
- * 优先支持蚂蚁主流语言,没有import在代码中使用的不会打包
18
+ * 优先支持主流语言,没有 import 在代码中使用的不会打包
19
19
  */
20
20
  import hljs from 'highlight.js/lib/core';
21
21
  import React, { useEffect, useState } from 'react';
@@ -231,7 +231,6 @@ var Highlight = function Highlight(props) {
231
231
  className: classNames("".concat(prefixCls), className, themeClass)
232
232
  }), copyable && /*#__PURE__*/React.createElement(CopyButton, null), /*#__PURE__*/React.createElement("table", {
233
233
  style: {
234
- padding: '0',
235
234
  height: height
236
235
  },
237
236
  className: classNames("".concat(theme === THEME_DARK ? "".concat(prefixCls, "-dark") : "".concat(prefixCls, "-light")))
@@ -1,10 +1,15 @@
1
- import type { AnimationConfig } from 'lottie-web';
1
+ import type { AnimationConfig, AnimationItem } from 'lottie-web';
2
2
  import React from 'react';
3
- interface LottieProps extends Omit<AnimationConfig, 'container'> {
3
+ export interface LottieProps extends Omit<AnimationConfig, 'container'> {
4
4
  path: string;
5
+ mode?: 'default' | 'icon';
6
+ loop?: boolean;
5
7
  speed?: number;
6
- mode?: 'normal' | 'icon';
8
+ className?: string;
7
9
  style?: React.CSSProperties;
8
10
  }
9
- declare const Lottie: React.FC<LottieProps>;
11
+ export interface LottieRef {
12
+ animation: AnimationItem;
13
+ }
14
+ declare const Lottie: React.ForwardRefExoticComponent<LottieProps & React.RefAttributes<LottieRef>>;
10
15
  export default Lottie;
@@ -1,37 +1,65 @@
1
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 = ["mode", "speed", "style"];
2
+ var _excluded = ["mode", "loop", "speed", "className", "style"];
3
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
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; }
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); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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
+ 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
+ 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; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
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; }
9
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; }
10
- import classNames from 'classnames';
11
16
  import lottie from 'lottie-web';
12
- import React, { useEffect, useRef } from 'react';
13
- var Lottie = function Lottie(_ref) {
14
- var mode = _ref.mode,
17
+ import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
18
+ import { useUpdateEffect } from 'ahooks';
19
+ import classNames from 'classnames';
20
+ var Lottie = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
21
+ var _ref$mode = _ref.mode,
22
+ mode = _ref$mode === void 0 ? 'default' : _ref$mode,
23
+ _ref$loop = _ref.loop,
24
+ loop = _ref$loop === void 0 ? true : _ref$loop,
15
25
  _ref$speed = _ref.speed,
16
26
  speed = _ref$speed === void 0 ? 1 : _ref$speed,
27
+ className = _ref.className,
17
28
  style = _ref.style,
18
29
  restProps = _objectWithoutProperties(_ref, _excluded);
19
- var ref = useRef();
30
+ var _useState = useState(),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ animation = _useState2[0],
33
+ setAnimation = _useState2[1];
34
+ var containerRef = useRef();
20
35
  useEffect(function () {
21
- // ref: https://github.com/airbnb/lottie-web/blob/master/index.d.ts#L81
22
- var animation = lottie.loadAnimation(_objectSpread({
23
- container: ref.current,
24
- renderer: 'svg',
25
- loop: false,
26
- autoplay: true
27
- }, restProps));
28
- // ref: https://github.com/airbnb/lottie-web/blob/master/index.d.ts#L6
29
- animation.setSpeed(speed);
36
+ if (!animation) {
37
+ // ref: https://github.com/airbnb/lottie-web/blob/master/index.d.ts#L129
38
+ var newAnimation = lottie.loadAnimation(_objectSpread({
39
+ container: containerRef.current,
40
+ renderer: 'svg',
41
+ loop: loop
42
+ }, restProps));
43
+ setAnimation(newAnimation);
44
+ }
30
45
  }, []);
31
- return /*#__PURE__*/React.createElement("span", {
32
- ref: ref,
33
- className: classNames('ob-lottie', _defineProperty({}, 'anticon', mode === 'icon')),
34
- style: style
46
+ useUpdateEffect(function () {
47
+ if (animation) {
48
+ animation.setLoop(loop);
49
+ animation.setSpeed(speed);
50
+ }
51
+ }, [loop, speed]);
52
+ useImperativeHandle(ref, function () {
53
+ return {
54
+ animation: animation
55
+ };
56
+ });
57
+ return /*#__PURE__*/React.createElement("div", {
58
+ ref: containerRef,
59
+ className: classNames(className, _defineProperty({}, 'anticon', mode === 'icon')),
60
+ style: _objectSpread({
61
+ display: 'inline-block'
62
+ }, style)
35
63
  });
36
- };
64
+ });
37
65
  export default Lottie;
@@ -29,26 +29,33 @@ export default (function (props) {
29
29
  var history = useHistory();
30
30
  var preProcess = useCallback(function (list) {
31
31
  var pathname = location.pathname;
32
- for (var i = 0; i < list.length; i++) {
33
- var _list$i = list[i],
34
- link = _list$i.link,
35
- openNewTab = _list$i.openNewTab,
36
- href = _list$i.href,
37
- key = _list$i.key,
38
- children = _list$i.children;
39
- var linkList = isArray(link) ? link : [link];
40
- var match = linkList.some(function (lk) {
41
- return pathToRegexp(lk).test(pathname);
42
- });
43
- if (match) {
44
- if (openNewTab || href) return false;
45
- setSelectedKeys([key]);
46
- setMenus(list);
47
- return;
48
- }
49
- if (!!(children !== null && children !== void 0 && children.length)) {
50
- preProcess(children);
32
+ try {
33
+ for (var i = 0; i < list.length; i++) {
34
+ var _list$i = list[i],
35
+ link = _list$i.link,
36
+ openNewTab = _list$i.openNewTab,
37
+ href = _list$i.href,
38
+ key = _list$i.key,
39
+ children = _list$i.children;
40
+ var linkList = isArray(link) ? link : [link];
41
+ var match = linkList.some(function (lk) {
42
+ return (
43
+ // pathToRegexp 不支持 http/https 协议解析,需要去掉协议头
44
+ pathToRegexp(lk.replace(/^https?:\/\//, '')).test(pathname)
45
+ );
46
+ });
47
+ if (match) {
48
+ if (openNewTab || href) return false;
49
+ setSelectedKeys([key]);
50
+ setMenus(list);
51
+ return;
52
+ }
53
+ if (!!(children !== null && children !== void 0 && children.length)) {
54
+ preProcess(children);
55
+ }
51
56
  }
57
+ } catch (error) {
58
+ console.log('error', error);
52
59
  }
53
60
  }, [location]);
54
61
  useEffect(function () {
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  declare const _default: ({ route, params, routes, paths }: {
2
3
  route: any;
3
4
  params: any;
4
5
  routes: any;
5
6
  paths: any;
6
- }) => import("react").JSX.Element;
7
+ }) => React.JSX.Element;
7
8
  export default _default;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import useHistory from "../_util/useHistory";
2
3
  export default (function (_ref) {
3
4
  var route = _ref.route,
@@ -10,11 +10,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
10
10
  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; }
11
11
  import { SyncOutlined } from '@oceanbase/icons';
12
12
  import { PageContainer as AntPageContainer } from '@ant-design/pro-components';
13
- import { Space } from '@oceanbase/design';
14
13
  import classNames from 'classnames';
15
14
  import { isObject } from 'lodash';
16
15
  import React, { useContext } from 'react';
17
- import { ConfigProvider, Tooltip } from '@oceanbase/design';
16
+ import { ConfigProvider, Space, Tooltip } from '@oceanbase/design';
18
17
  import LocaleWrapper from "../locale/LocaleWrapper";
19
18
  import ItemRender from "./ItemRender";
20
19
  import zhCN from "./locale/zh-CN";
@@ -8,6 +8,7 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
8
8
  var antCls = token.antCls,
9
9
  proComponentsCls = token.proComponentsCls,
10
10
  componentCls = token.componentCls,
11
+ colorBgLayout = token.colorBgLayout,
11
12
  colorBgBase = token.colorBgBase,
12
13
  borderRadius = token.borderRadius,
13
14
  boxShadowSecondary = token.boxShadowSecondary,
@@ -18,8 +19,8 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
18
19
  var height = controlHeightLG;
19
20
  var lineHeight = "".concat(controlHeightLG, "px");
20
21
  return _ref = {}, _defineProperty(_ref, "".concat(componentCls), (_$concat3 = {
21
- // 48px is the height of BasicLayout header
22
- minHeight: 'calc(100vh - 48px)'
22
+ minHeight: '100vh',
23
+ backgroundColor: colorBgLayout
23
24
  }, _defineProperty(_$concat3, "".concat(proComponentsCls, "-grid-content"), {
24
25
  minHeight: 'auto'
25
26
  }), _defineProperty(_$concat3, "".concat(antCls, "-page-header"), (_$concat2 = {}, _defineProperty(_$concat2, "".concat(antCls, "-page-header-breadcrumb"), {
@@ -54,6 +55,7 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
54
55
  })), _defineProperty(_ref, "".concat(componentCls, "-with-footer "), {
55
56
  paddingBottom: 64
56
57
  }), _defineProperty(_ref, "".concat(proComponentsCls, "-footer-bar"), (_$concat5 = {
58
+ width: '100%',
57
59
  backgroundColor: colorBgBase,
58
60
  borderRadius: borderRadius,
59
61
  boxShadow: boxShadowSecondary,
@@ -75,7 +75,7 @@
75
75
  user-select: none;
76
76
 
77
77
  &.@{prefix}-button-primary {
78
- background-color: #1677ff;
78
+ background-color: #006aff;
79
79
  }
80
80
 
81
81
  &.@{prefix}-button-small {
@@ -95,7 +95,7 @@
95
95
  position: absolute;
96
96
  width: 56px;
97
97
  height: 56px;
98
- color: #1677ff;
98
+ color: #006aff;
99
99
  font-size: 56px;
100
100
  inset-block-start: 0;
101
101
  inset-inline-end: 0;
@@ -1,9 +1,13 @@
1
- import { useHistory,
1
+ import {
2
+ // react-router-dom v5
3
+ // @ts-ignore
4
+
2
5
  // react-router-dom v6
3
6
  // @ts-ignore
4
7
  useNavigate } from 'react-router-dom';
5
8
  export default (function () {
6
9
  return {
7
- push: useHistory ? useHistory().push : useNavigate ? useNavigate() : null
10
+ // push: useHistory ? useHistory().push : useNavigate ? useNavigate() : null,
11
+ push: useNavigate ? useNavigate() : null
8
12
  };
9
13
  });
package/es/index.less CHANGED
@@ -1,15 +1 @@
1
1
  @import './variable.less';
2
-
3
- html,
4
- body {
5
- height: 100%;
6
- margin: 0;
7
- padding: 0;
8
- background-color: @colorBgLayout;
9
- }
10
-
11
- #root {
12
- display: flex;
13
- flex-direction: column;
14
- height: 100%;
15
- }