@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.
- package/LICENSE +22 -0
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/BackgroundTaskManager/index.js +3 -3
- package/es/BasicLayout/index.js +20 -11
- package/es/BasicLayout/index.less +0 -4
- package/es/BasicLayout/style/index.d.ts +5 -0
- package/es/BasicLayout/style/index.js +21 -0
- package/es/Highlight/index.d.ts +1 -1
- package/es/Highlight/index.js +1 -2
- package/es/Lottie/index.d.ts +9 -4
- package/es/Lottie/index.js +48 -20
- package/es/NavMenu/index.js +26 -19
- package/es/PageContainer/ItemRender.d.ts +2 -1
- package/es/PageContainer/ItemRender.js +1 -0
- package/es/PageContainer/index.js +1 -2
- package/es/PageContainer/style/index.js +4 -2
- package/es/SideTip/index.less +2 -2
- package/es/_util/useHistory.js +6 -2
- package/es/index.less +0 -14
- package/lib/BasicLayout/index.js +96 -88
- package/lib/BasicLayout/index.less +0 -4
- package/lib/BasicLayout/style/index.d.ts +5 -0
- package/lib/BasicLayout/style/index.js +49 -0
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/Highlight/index.js +0 -1
- package/lib/Lottie/index.d.ts +9 -4
- package/lib/Lottie/index.js +42 -25
- package/lib/NavMenu/index.js +22 -13
- package/lib/PageContainer/ItemRender.d.ts +2 -1
- package/lib/PageContainer/ItemRender.js +2 -1
- package/lib/PageContainer/index.js +3 -4
- package/lib/PageContainer/style/index.js +4 -2
- package/lib/SideTip/index.less +2 -2
- package/lib/_util/useHistory.js +2 -1
- package/lib/index.less +0 -14
- package/package.json +20 -20
|
@@ -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
|
-
|
|
25
|
+
return NotificationApi;
|
|
26
|
+
}({});
|
|
27
27
|
export var BackgroundTaskManagerConstants = {
|
|
28
28
|
REFRESH_FREQUENCY: REFRESH_FREQUENCY,
|
|
29
29
|
NotificationApi: NotificationApi
|
package/es/BasicLayout/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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',
|
|
@@ -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
|
+
});
|
package/es/Highlight/index.d.ts
CHANGED
|
@@ -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" | "
|
|
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
|
/**
|
package/es/Highlight/index.js
CHANGED
|
@@ -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
|
-
*
|
|
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")))
|
package/es/Lottie/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
8
|
+
className?: string;
|
|
7
9
|
style?: React.CSSProperties;
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
export interface LottieRef {
|
|
12
|
+
animation: AnimationItem;
|
|
13
|
+
}
|
|
14
|
+
declare const Lottie: React.ForwardRefExoticComponent<LottieProps & React.RefAttributes<LottieRef>>;
|
|
10
15
|
export default Lottie;
|
package/es/Lottie/index.js
CHANGED
|
@@ -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
|
-
|
|
14
|
-
|
|
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
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
package/es/NavMenu/index.js
CHANGED
|
@@ -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
|
-
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 () {
|
|
@@ -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
|
-
|
|
22
|
-
|
|
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,
|
package/es/SideTip/index.less
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
user-select: none;
|
|
76
76
|
|
|
77
77
|
&.@{prefix}-button-primary {
|
|
78
|
-
background-color: #
|
|
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: #
|
|
98
|
+
color: #006aff;
|
|
99
99
|
font-size: 56px;
|
|
100
100
|
inset-block-start: 0;
|
|
101
101
|
inset-inline-end: 0;
|
package/es/_util/useHistory.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
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
|
});
|