@oceanbase/ui 0.2.13 → 0.2.15
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/Item.js +6 -8
- package/es/BackgroundTaskManager/index.d.ts +5 -5
- package/es/BackgroundTaskManager/index.js +1 -1
- package/es/BasicLayout/Header.d.ts +1 -1
- package/es/BasicLayout/Header.js +4 -4
- package/es/BasicLayout/index.d.ts +3 -2
- package/es/BasicLayout/index.js +6 -7
- package/es/BasicLayout/style/index.d.ts +7 -3
- package/es/BatchOperationBar/index.d.ts +3 -3
- package/es/Boundary/constant.d.ts +4 -4
- package/es/ContentWithIcon/index.d.ts +21 -0
- package/es/ContentWithIcon/index.js +110 -0
- package/{lib/ContentWithQuestion → es/ContentWithIcon}/index.less +5 -1
- package/es/DocDialog/index.js +1 -2
- package/es/FullscreenBox/index.d.ts +1 -1
- package/es/Highlight/index.d.ts +2 -2
- package/es/LocaleDropdown/index.d.ts +1 -1
- package/es/Login/ActivateForm.d.ts +1 -1
- package/es/Login/ActivateForm.js +5 -5
- package/es/Login/LoginForm.d.ts +1 -1
- package/es/Login/RegisterForm.d.ts +1 -1
- package/es/Login/RegisterForm.js +5 -5
- package/es/Login/index.d.ts +2 -2
- package/es/Lottie/index.d.ts +2 -1
- package/es/NavMenu/index.js +5 -6
- package/es/PageContainer/ItemRender.js +3 -3
- package/es/PageContainer/index.d.ts +2 -2
- package/es/PageContainer/index.js +2 -3
- package/es/PageContainer/style/index.d.ts +6 -2
- package/es/Password/index.d.ts +2 -2
- package/es/Ranger/QuickPicker.d.ts +2 -1
- package/es/Ranger/Ranger.d.ts +3 -3
- package/es/Ranger/index.d.ts +1 -32
- package/es/SideTip/index.d.ts +4 -4
- package/es/TagSelect/Group.d.ts +23 -0
- package/es/TagSelect/Group.js +121 -0
- package/es/TagSelect/Item.d.ts +17 -0
- package/es/TagSelect/Item.js +84 -0
- package/es/TagSelect/TagSelectContext.d.ts +13 -0
- package/es/TagSelect/TagSelectContext.js +3 -0
- package/es/TagSelect/index.d.ts +6 -0
- package/es/TagSelect/index.js +6 -0
- package/es/TagSelect/style/index.d.ts +9 -0
- package/es/TagSelect/style/index.js +98 -0
- package/es/TreeSearch/index.d.ts +1 -1
- package/es/Welcome/index.d.ts +2 -2
- package/es/_util/genComponentStyleHook.d.ts +6 -2
- package/es/_util/genComponentStyleHook.js +5 -5
- package/es/_util/useNavigate.d.ts +2 -0
- package/es/_util/useNavigate.js +7 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -2
- package/es/interface.d.ts +1 -1
- package/es/locale/en-US.js +2 -2
- package/es/locale/index.d.ts +2 -2
- package/es/locale/zh-CN.js +2 -2
- package/es/locale/zh-TW.js +2 -2
- package/lib/Action/Item.js +5 -7
- package/lib/BackgroundTaskManager/index.d.ts +5 -5
- package/lib/BackgroundTaskManager/index.js +1 -1
- package/lib/BasicLayout/Header.d.ts +1 -1
- package/lib/BasicLayout/Header.js +4 -4
- package/lib/BasicLayout/index.d.ts +3 -2
- package/lib/BasicLayout/index.js +6 -6
- package/lib/BasicLayout/style/index.d.ts +7 -3
- package/lib/BatchOperationBar/index.d.ts +3 -3
- package/lib/Boundary/constant.d.ts +4 -4
- package/lib/ContentWithIcon/index.d.ts +21 -0
- package/lib/ContentWithIcon/index.js +130 -0
- package/{es/ContentWithQuestion → lib/ContentWithIcon}/index.less +5 -1
- package/lib/DocDialog/index.js +1 -2
- package/lib/FullscreenBox/index.d.ts +1 -1
- package/lib/Highlight/index.d.ts +2 -2
- package/lib/LocaleDropdown/index.d.ts +1 -1
- package/lib/Login/ActivateForm.d.ts +1 -1
- package/lib/Login/ActivateForm.js +5 -5
- package/lib/Login/LoginForm.d.ts +1 -1
- package/lib/Login/RegisterForm.d.ts +1 -1
- package/lib/Login/RegisterForm.js +5 -5
- package/lib/Login/index.d.ts +2 -2
- package/lib/Lottie/index.d.ts +2 -1
- package/lib/NavMenu/index.js +5 -6
- package/lib/PageContainer/ItemRender.js +3 -3
- package/lib/PageContainer/index.d.ts +2 -2
- package/lib/PageContainer/index.js +2 -3
- package/lib/PageContainer/style/index.d.ts +6 -2
- package/lib/Password/index.d.ts +2 -2
- package/lib/Ranger/QuickPicker.d.ts +2 -1
- package/lib/Ranger/Ranger.d.ts +3 -3
- package/lib/Ranger/index.d.ts +1 -32
- package/lib/SideTip/index.d.ts +4 -4
- package/lib/TagSelect/Group.d.ts +23 -0
- package/lib/TagSelect/Group.js +128 -0
- package/lib/TagSelect/Item.d.ts +17 -0
- package/lib/TagSelect/Item.js +108 -0
- package/lib/TagSelect/TagSelectContext.d.ts +13 -0
- package/lib/TagSelect/TagSelectContext.js +27 -0
- package/lib/TagSelect/index.d.ts +6 -0
- package/lib/TagSelect/index.js +37 -0
- package/lib/TagSelect/style/index.d.ts +9 -0
- package/lib/TagSelect/style/index.js +152 -0
- package/lib/TreeSearch/index.d.ts +1 -1
- package/lib/Welcome/index.d.ts +2 -2
- package/lib/_util/genComponentStyleHook.d.ts +6 -2
- package/lib/_util/genComponentStyleHook.js +3 -3
- package/lib/_util/useNavigate.d.ts +2 -0
- package/lib/_util/{useHistory.js → useNavigate.js} +10 -11
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -3
- package/lib/interface.d.ts +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/index.d.ts +2 -2
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/package.json +10 -11
- package/es/ContentWithQuestion/index.d.ts +0 -13
- package/es/ContentWithQuestion/index.js +0 -46
- package/es/_util/useHistory.d.ts +0 -4
- package/es/_util/useHistory.js +0 -13
- package/lib/ContentWithQuestion/index.d.ts +0 -13
- package/lib/ContentWithQuestion/index.js +0 -76
- package/lib/_util/useHistory.d.ts +0 -4
package/es/Action/Item.js
CHANGED
|
@@ -55,18 +55,16 @@ export var ActionButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
55
55
|
danger: danger,
|
|
56
56
|
disabled: disabled,
|
|
57
57
|
onClick: function onClick(_) {
|
|
58
|
-
|
|
58
|
+
var handle = _onClick === null || _onClick === void 0 ? void 0 : _onClick();
|
|
59
|
+
if (enableLoading && handle !== null && handle !== void 0 && handle.then) {
|
|
59
60
|
_this2.setState({
|
|
60
61
|
loading: true
|
|
61
62
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
_this2.setState({
|
|
66
|
-
loading: false
|
|
67
|
-
});
|
|
63
|
+
handle.then(function () {
|
|
64
|
+
_this2.setState({
|
|
65
|
+
loading: false
|
|
68
66
|
});
|
|
69
|
-
}
|
|
67
|
+
});
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
}, children));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GlobalConfigProps, NotificationInstance } from 'antd/es/notification/interface';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { GlobalConfigProps, NotificationInstance } from '@oceanbase/design/es/notification/interface';
|
|
3
3
|
export declare enum NotificationApi {
|
|
4
4
|
success = "success",
|
|
5
5
|
error = "error",
|
|
@@ -16,9 +16,9 @@ export declare const BackgroundTaskManagerConstants: {
|
|
|
16
16
|
};
|
|
17
17
|
NotificationApi: typeof NotificationApi;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
export
|
|
21
|
-
export
|
|
19
|
+
type Namespace = string;
|
|
20
|
+
export type TaskMgrID = string | number;
|
|
21
|
+
export type ITaskMgrQueue = Record<TaskMgrID, Namespace>;
|
|
22
22
|
interface NotificationAction {
|
|
23
23
|
api: (params: any) => Promise<any>;
|
|
24
24
|
successCb: (response: any, id: TaskMgrID) => {
|
|
@@ -30,7 +30,7 @@ interface NotificationAction {
|
|
|
30
30
|
config: GlobalConfigProps;
|
|
31
31
|
} | null;
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export type ITaskMgrPreset = Record<Namespace, NotificationAction>;
|
|
34
34
|
export interface BackgroundTaskManagerRef {
|
|
35
35
|
pushQueue: (queue: ITaskMgrQueue) => void;
|
|
36
36
|
popQueue: (id: TaskMgrID) => void;
|
|
@@ -10,8 +10,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
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; }
|
|
11
11
|
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
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { notification } from '@oceanbase/design';
|
|
14
13
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
14
|
+
import { notification } from '@oceanbase/design';
|
|
15
15
|
import { REFRESH_FREQUENCY } from "./constants";
|
|
16
16
|
import { RefreshMan } from "./RefreshMan";
|
|
17
17
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { Locale } from '../interface';
|
|
3
3
|
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
|
|
4
4
|
import './Header.less';
|
|
5
|
-
export
|
|
5
|
+
export type OverlayFunc = () => React.ReactElement;
|
|
6
6
|
export interface HeaderLocale {
|
|
7
7
|
help: string;
|
|
8
8
|
welcome: string;
|
package/es/BasicLayout/Header.js
CHANGED
|
@@ -20,7 +20,7 @@ import React, { useState } from 'react';
|
|
|
20
20
|
import { OB_SITE_LINK } from "../constant";
|
|
21
21
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
22
22
|
import { directTo, getPrefix } from "../_util";
|
|
23
|
-
import
|
|
23
|
+
import useNavigate from "../_util/useNavigate";
|
|
24
24
|
import zhCN from "./locale/zh-CN";
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
import logoImg from "../assets/logo/oceanbase_logo.svg";
|
|
@@ -56,7 +56,7 @@ var Header = function Header(_ref) {
|
|
|
56
56
|
locales = _ref.locales,
|
|
57
57
|
langs = _ref.langs,
|
|
58
58
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
59
|
-
var
|
|
59
|
+
var navigate = useNavigate();
|
|
60
60
|
var _useState = useState(false),
|
|
61
61
|
_useState2 = _slicedToArray(_useState, 2),
|
|
62
62
|
visible = _useState2[0],
|
|
@@ -69,7 +69,7 @@ var Header = function Header(_ref) {
|
|
|
69
69
|
onClick: function onClick(_ref2) {
|
|
70
70
|
var key = _ref2.key;
|
|
71
71
|
if (key === 'welcome') {
|
|
72
|
-
|
|
72
|
+
navigate === null || navigate === void 0 ? void 0 : navigate(welcomePath);
|
|
73
73
|
} else if (key === 'viewDocs') {
|
|
74
74
|
directTo(docsPath);
|
|
75
75
|
} else if (key === 'downloadDocs') {
|
|
@@ -98,7 +98,7 @@ var Header = function Header(_ref) {
|
|
|
98
98
|
src: simpleLogoUrl,
|
|
99
99
|
alt: "",
|
|
100
100
|
onClick: function onClick() {
|
|
101
|
-
|
|
101
|
+
navigate === null || navigate === void 0 ? void 0 : navigate('/');
|
|
102
102
|
},
|
|
103
103
|
className: "".concat(prefix, "-logo")
|
|
104
104
|
}), title && /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BadgeProps } from '
|
|
2
|
-
import type { MenuProps } from '
|
|
1
|
+
import type { BadgeProps } from '@oceanbase/design/es/badge';
|
|
2
|
+
import type { MenuProps } from '@oceanbase/design/es/menu';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
|
|
5
5
|
import type { HeaderProps } from './Header';
|
|
@@ -39,6 +39,7 @@ export interface BasicLayoutProps extends LocaleWrapperProps {
|
|
|
39
39
|
sideHeader?: React.ReactNode;
|
|
40
40
|
subSideMenus?: MenuItem[];
|
|
41
41
|
subSideMenuProps?: MenuProps;
|
|
42
|
+
prefixCls?: string;
|
|
42
43
|
style?: React.CSSProperties;
|
|
43
44
|
}
|
|
44
45
|
declare const _default: any;
|
package/es/BasicLayout/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { pathToRegexp } from 'path-to-regexp';
|
|
|
23
23
|
import React, { useContext, useEffect, useState } from 'react';
|
|
24
24
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
25
25
|
import { getPrefix, isEnglish, urlToList } from "../_util";
|
|
26
|
-
import
|
|
26
|
+
import useNavigate from "../_util/useNavigate";
|
|
27
27
|
import Header from "./Header";
|
|
28
28
|
import zhCN from "./locale/zh-CN";
|
|
29
29
|
import useStyle from "./style";
|
|
@@ -62,10 +62,9 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
62
62
|
getPrefixCls = _useContext.getPrefixCls;
|
|
63
63
|
var prefixCls = getPrefixCls('basic-layout', customizePrefixCls);
|
|
64
64
|
var _useStyle = useStyle(prefixCls),
|
|
65
|
-
wrapSSR = _useStyle.wrapSSR
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
var history = useHistory();
|
|
65
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
66
|
+
var basicLayoutCls = classNames(className);
|
|
67
|
+
var navigate = useNavigate();
|
|
69
68
|
// 侧边栏导航是否收起
|
|
70
69
|
var _useState = useState(defaultCollapsed),
|
|
71
70
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -166,7 +165,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
166
165
|
key: item.link,
|
|
167
166
|
onClick: function onClick() {
|
|
168
167
|
if (pathname !== item.link) {
|
|
169
|
-
|
|
168
|
+
navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
171
|
}, /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
@@ -218,7 +217,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
218
217
|
key: item.link,
|
|
219
218
|
onClick: function onClick() {
|
|
220
219
|
if (pathname !== item.link) {
|
|
221
|
-
|
|
220
|
+
navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
|
|
222
221
|
}
|
|
223
222
|
}
|
|
224
223
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FullToken, GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
|
+
export type BasicLayoutToken = FullToken<any>;
|
|
3
4
|
export declare const genBasicLayoutStyle: GenerateStyle<BasicLayoutToken>;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
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
|
+
};
|
|
5
9
|
export default _default;
|
|
@@ -7,9 +7,9 @@ export interface AlertRenderParams {
|
|
|
7
7
|
setSelectedRows: (selectedRows: any[]) => void;
|
|
8
8
|
cleanSelectedRows: (cleanSelectdRows?: any[]) => void;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
10
|
+
export type RenderFun = ((props: AlertRenderParams) => ReactNode) | false;
|
|
11
|
+
export type Vertical = 'top' | 'bottom';
|
|
12
|
+
export type Horizontal = 'left' | 'right';
|
|
13
13
|
export interface Props extends LocaleWrapperProps {
|
|
14
14
|
width?: number | string;
|
|
15
15
|
title?: ReactNode;
|
|
@@ -4,10 +4,10 @@ export interface ConfigType {
|
|
|
4
4
|
buttonText?: string;
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
7
|
+
export type FunctionConfigType = Record<string, ConfigType>;
|
|
8
|
+
export type FunctionStateType = keyof FunctionConfigType;
|
|
9
|
+
export type CodeType = 404 | 403;
|
|
10
|
+
export type CodePresetType = Record<CodeType, ConfigType>;
|
|
11
11
|
export declare const CODE_PRESET: (locale: any) => CodePresetType;
|
|
12
12
|
export declare const EXCEPTION_PRESET: (locale: any) => {
|
|
13
13
|
ERROR_BOUNDARY: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface ContentWithIconProps {
|
|
4
|
+
content?: React.ReactNode;
|
|
5
|
+
tooltip?: any;
|
|
6
|
+
prefixIcon?: React.ReactNode | boolean;
|
|
7
|
+
suffixIcon?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
iconType?: 'question' | 'info' | 'exclamation';
|
|
10
|
+
color?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
onClick?: (e: React.SyntheticEvent) => void;
|
|
13
|
+
tooltipWithLink?: boolean;
|
|
14
|
+
textHidden?: boolean;
|
|
15
|
+
popOver?: any;
|
|
16
|
+
size?: number;
|
|
17
|
+
infoColor?: string;
|
|
18
|
+
exclamationColor?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const ContentWithIcon: React.FC<ContentWithIconProps>;
|
|
21
|
+
export default ContentWithIcon;
|
|
@@ -0,0 +1,110 @@
|
|
|
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 = ["content", "tooltip", "prefixIcon", "suffixIcon", "className", "children", "iconType", "color", "tooltipWithLink", "popOver", "textHidden", "size", "infoColor", "exclamationColor"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
import React, { isValidElement } from 'react';
|
|
10
|
+
import { Tooltip, Space, Popover } from 'antd';
|
|
11
|
+
import { ExclamationCircleFilled, InfoCircleFilled, InfoCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
import { getPrefix } from "../_util";
|
|
14
|
+
import "./index.less";
|
|
15
|
+
var prefix = getPrefix('content-with-question');
|
|
16
|
+
var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
17
|
+
var _classNames;
|
|
18
|
+
var content = _ref.content,
|
|
19
|
+
tooltip = _ref.tooltip,
|
|
20
|
+
_ref$prefixIcon = _ref.prefixIcon,
|
|
21
|
+
prefixIcon = _ref$prefixIcon === void 0 ? null : _ref$prefixIcon,
|
|
22
|
+
suffixIcon = _ref.suffixIcon,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
children = _ref.children,
|
|
25
|
+
iconType = _ref.iconType,
|
|
26
|
+
color = _ref.color,
|
|
27
|
+
_ref$tooltipWithLink = _ref.tooltipWithLink,
|
|
28
|
+
tooltipWithLink = _ref$tooltipWithLink === void 0 ? false : _ref$tooltipWithLink,
|
|
29
|
+
popOver = _ref.popOver,
|
|
30
|
+
_ref$textHidden = _ref.textHidden,
|
|
31
|
+
textHidden = _ref$textHidden === void 0 ? true : _ref$textHidden,
|
|
32
|
+
_ref$size = _ref.size,
|
|
33
|
+
size = _ref$size === void 0 ? 14 : _ref$size,
|
|
34
|
+
infoColor = _ref.infoColor,
|
|
35
|
+
_ref$exclamationColor = _ref.exclamationColor,
|
|
36
|
+
exclamationColor = _ref$exclamationColor === void 0 ? '#FAAD14' : _ref$exclamationColor,
|
|
37
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var defaultIconType = function defaultIconType() {
|
|
39
|
+
if (iconType === 'question') {
|
|
40
|
+
return /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
|
|
41
|
+
style: {
|
|
42
|
+
color: color === 'default' ? '#132039' : color,
|
|
43
|
+
fontSize: size
|
|
44
|
+
},
|
|
45
|
+
className: "".concat(prefix, "-help")
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (iconType === 'info') {
|
|
49
|
+
if (infoColor) {
|
|
50
|
+
return /*#__PURE__*/React.createElement(InfoCircleFilled, {
|
|
51
|
+
style: {
|
|
52
|
+
color: infoColor,
|
|
53
|
+
fontSize: size
|
|
54
|
+
},
|
|
55
|
+
className: "".concat(prefix, "-help")
|
|
56
|
+
});
|
|
57
|
+
} else {
|
|
58
|
+
return /*#__PURE__*/React.createElement(InfoCircleOutlined, {
|
|
59
|
+
style: {
|
|
60
|
+
color: '3333333',
|
|
61
|
+
fontSize: size
|
|
62
|
+
},
|
|
63
|
+
className: "".concat(prefix, "-help")
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (iconType === 'exclamation') {
|
|
68
|
+
return /*#__PURE__*/React.createElement(ExclamationCircleFilled, {
|
|
69
|
+
style: {
|
|
70
|
+
color: exclamationColor,
|
|
71
|
+
fontSize: size
|
|
72
|
+
},
|
|
73
|
+
className: "".concat(prefix, "-help")
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// 图标在文字后
|
|
79
|
+
suffixIcon = suffixIcon !== null && iconType ? defaultIconType() : suffixIcon; // 自定义图标,非内置
|
|
80
|
+
|
|
81
|
+
// FIXME: antd 已经废弃 icon type 的用法,该组件也需要做相应处理,后面将会是传入 Icon 的形式而非 type
|
|
82
|
+
var getIcon = function getIcon(iconConfig) {
|
|
83
|
+
return iconConfig ? !textHidden && iconType === 'info' ?
|
|
84
|
+
/*#__PURE__*/
|
|
85
|
+
// 文本描述直接展示且只在 info 类型下生效
|
|
86
|
+
React.createElement(Space, {
|
|
87
|
+
size: 4
|
|
88
|
+
}, iconConfig, /*#__PURE__*/React.createElement("span", {
|
|
89
|
+
style: {
|
|
90
|
+
color: '#5C6B8A'
|
|
91
|
+
}
|
|
92
|
+
}, "\u6587\u672C\u793A\u610F\u4E0D\u8D85\u8FC7\u4E8C\u5341\u5B57\u6587\u672C\u793A\u610F\u4E0D\u8D85\u8FC7\u4E8C\u5341\u5B57")) :
|
|
93
|
+
// 提示文案描述带有链接
|
|
94
|
+
tooltipWithLink ? /*#__PURE__*/React.createElement(Popover, popOver, /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : defaultIconType()) : /*#__PURE__*/React.createElement(Tooltip, tooltip, /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : defaultIconType()) : null;
|
|
95
|
+
};
|
|
96
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", _extends({
|
|
97
|
+
className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-item"), true), _defineProperty(_classNames, className, !!className), _classNames))
|
|
98
|
+
}, restProps), /*#__PURE__*/React.createElement(Space, {
|
|
99
|
+
size: 4
|
|
100
|
+
}, getIcon(
|
|
101
|
+
// 图标在文字前
|
|
102
|
+
prefixIcon === true ? defaultIconType() : prefixIcon), /*#__PURE__*/React.createElement("span", {
|
|
103
|
+
"data-testid": "content",
|
|
104
|
+
style: {
|
|
105
|
+
color: color === 'default' ? '#5C6B8A' : color,
|
|
106
|
+
fontSize: size
|
|
107
|
+
}
|
|
108
|
+
}, content !== null && content !== void 0 ? content : children), getIcon(suffixIcon))));
|
|
109
|
+
};
|
|
110
|
+
export default ContentWithIcon;
|
package/es/DocDialog/index.js
CHANGED
|
@@ -12,7 +12,6 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { debounce } from 'lodash';
|
|
14
14
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
15
|
-
import { useLocation } from 'react-router-dom';
|
|
16
15
|
import Dialog from "../Dialog";
|
|
17
16
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
18
17
|
import zhCN from "./locale/zh-CN";
|
|
@@ -45,7 +44,7 @@ var DocDialogComp = function DocDialogComp(props) {
|
|
|
45
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
45
|
clientWidth = _useState4[0],
|
|
47
46
|
setClientWidth = _useState4[1];
|
|
48
|
-
var location =
|
|
47
|
+
var location = window.location;
|
|
49
48
|
var currentLink = useMemo(function () {
|
|
50
49
|
var _link$;
|
|
51
50
|
var pathname = location.pathname;
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
|
|
4
4
|
import './index.less';
|
|
5
|
-
export
|
|
5
|
+
export type FullscreenModeType = 'viewport' | 'browser';
|
|
6
6
|
export interface FullscreenBoxRef {
|
|
7
7
|
changeFullscreen: () => void;
|
|
8
8
|
}
|
package/es/Highlight/index.d.ts
CHANGED
|
@@ -28,9 +28,9 @@ export declare const languageMap: {
|
|
|
28
28
|
export declare const THEME_DARK = "dark";
|
|
29
29
|
export declare const THEME_LIGHT = "light";
|
|
30
30
|
declare const ThemeTypes: ["dark", "light"];
|
|
31
|
-
export
|
|
31
|
+
export type ThemeType = (typeof ThemeTypes)[number];
|
|
32
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
|
-
export
|
|
33
|
+
export type LanguageType = (typeof supportedLanguages)[number] | 'html';
|
|
34
34
|
export interface HighlightProps extends LocaleWrapperProps {
|
|
35
35
|
/**
|
|
36
36
|
* @description 样式
|
package/es/Login/ActivateForm.js
CHANGED
|
@@ -24,19 +24,19 @@ var Activate = function Activate(_ref) {
|
|
|
24
24
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
25
|
var _Form$useForm = Form.useForm(),
|
|
26
26
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
27
|
-
|
|
27
|
+
form = _Form$useForm2[0];
|
|
28
28
|
var handleValidateConfirmPassword = useCallback(function (rule, value, callback) {
|
|
29
|
-
if (!
|
|
29
|
+
if (!form) {
|
|
30
30
|
callback();
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
var pwd =
|
|
33
|
+
var pwd = form.getFieldValue('password');
|
|
34
34
|
if (toString(value) !== toString(pwd)) {
|
|
35
35
|
callback(locale.samePasswordMessage);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
callback();
|
|
39
|
-
}, [
|
|
39
|
+
}, [form]);
|
|
40
40
|
var passwordRegexpRule = passwordRule || {
|
|
41
41
|
pattern: PASSWORD_REGEX,
|
|
42
42
|
message: locale.passwordHelp
|
|
@@ -45,7 +45,7 @@ var Activate = function Activate(_ref) {
|
|
|
45
45
|
layout: "vertical",
|
|
46
46
|
requiredMark: false,
|
|
47
47
|
className: "".concat(prefix, "-form"),
|
|
48
|
-
form:
|
|
48
|
+
form: form
|
|
49
49
|
}, restProps, {
|
|
50
50
|
"data-testid": "login.register"
|
|
51
51
|
}), errorMessage && /*#__PURE__*/React.createElement(Alert, {
|
package/es/Login/LoginForm.d.ts
CHANGED
package/es/Login/RegisterForm.js
CHANGED
|
@@ -33,7 +33,7 @@ var Register = function Register(_ref) {
|
|
|
33
33
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
34
34
|
var _Form$useForm = Form.useForm(),
|
|
35
35
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
36
|
-
|
|
36
|
+
form = _Form$useForm2[0];
|
|
37
37
|
var handleValidateAccount = useCallback( /*#__PURE__*/function () {
|
|
38
38
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(rule, value) {
|
|
39
39
|
var isExists;
|
|
@@ -66,17 +66,17 @@ var Register = function Register(_ref) {
|
|
|
66
66
|
};
|
|
67
67
|
}(), [isUserExists]);
|
|
68
68
|
var handleValidateConfirmPassword = useCallback(function (rule, value, callback) {
|
|
69
|
-
if (!
|
|
69
|
+
if (!form) {
|
|
70
70
|
callback();
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
var pwd =
|
|
73
|
+
var pwd = form.getFieldValue('password');
|
|
74
74
|
if (toString(value) !== toString(pwd)) {
|
|
75
75
|
callback(locale.samePasswordMessage);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
callback();
|
|
79
|
-
}, [
|
|
79
|
+
}, [form]);
|
|
80
80
|
var passwordRegexpRule = passwordRule || {
|
|
81
81
|
pattern: PASSWORD_REGEX,
|
|
82
82
|
message: locale.passwordHelp
|
|
@@ -85,7 +85,7 @@ var Register = function Register(_ref) {
|
|
|
85
85
|
layout: "vertical",
|
|
86
86
|
requiredMark: false,
|
|
87
87
|
className: "".concat(prefix, "-form"),
|
|
88
|
-
form:
|
|
88
|
+
form: form
|
|
89
89
|
}, restProps, {
|
|
90
90
|
"data-testid": "login.register"
|
|
91
91
|
}), errorMessage && /*#__PURE__*/React.createElement(Alert, {
|
package/es/Login/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AlertProps } from '
|
|
2
|
-
import type { FormProps } from '
|
|
1
|
+
import type { AlertProps } from '@oceanbase/design/es/alert';
|
|
2
|
+
import type { FormProps } from '@oceanbase/design/es/form';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { IActivateFormProps } from './ActivateForm';
|
|
5
5
|
import type { ILoginFormProps } from './LoginForm';
|
package/es/Lottie/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AnimationConfig, AnimationItem } from 'lottie-web';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface LottieProps extends Omit<AnimationConfig, 'container'> {
|
|
4
|
-
path
|
|
4
|
+
path?: string;
|
|
5
|
+
animationData?: any;
|
|
5
6
|
mode?: 'default' | 'icon';
|
|
6
7
|
loop?: boolean;
|
|
7
8
|
speed?: number;
|
package/es/NavMenu/index.js
CHANGED
|
@@ -8,9 +8,8 @@ import { Menu } from '@oceanbase/design';
|
|
|
8
8
|
import { isArray } from 'lodash';
|
|
9
9
|
import { pathToRegexp } from 'path-to-regexp';
|
|
10
10
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
11
|
-
import { useLocation } from 'react-router-dom';
|
|
12
11
|
import { getPrefix } from "../_util";
|
|
13
|
-
import
|
|
12
|
+
import useNavigate from "../_util/useNavigate";
|
|
14
13
|
import "./index.less";
|
|
15
14
|
var prefix = getPrefix('menu');
|
|
16
15
|
export default (function (props) {
|
|
@@ -25,8 +24,8 @@ export default (function (props) {
|
|
|
25
24
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
25
|
menus = _useState4[0],
|
|
27
26
|
setMenus = _useState4[1];
|
|
28
|
-
var location =
|
|
29
|
-
var
|
|
27
|
+
var location = window.location;
|
|
28
|
+
var navigate = useNavigate();
|
|
30
29
|
var preProcess = useCallback(function (list) {
|
|
31
30
|
var pathname = location.pathname;
|
|
32
31
|
try {
|
|
@@ -71,8 +70,8 @@ export default (function (props) {
|
|
|
71
70
|
}, [setSelectedKeys, menus]);
|
|
72
71
|
var onMenuClick = useCallback(function (link) {
|
|
73
72
|
var linkList = isArray(link) ? link : [link];
|
|
74
|
-
|
|
75
|
-
}, [
|
|
73
|
+
navigate === null || navigate === void 0 ? void 0 : navigate(linkList[0]);
|
|
74
|
+
}, [navigate]);
|
|
76
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
77
76
|
className: "".concat(prefix, "-container ").concat(className),
|
|
78
77
|
style: style
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useNavigate from "../_util/useNavigate";
|
|
3
3
|
export default (function (_ref) {
|
|
4
4
|
var route = _ref.route,
|
|
5
5
|
params = _ref.params,
|
|
@@ -13,10 +13,10 @@ export default (function (_ref) {
|
|
|
13
13
|
var path = route.href || routes.slice(0, routeIndex + 1).map(function (item) {
|
|
14
14
|
return item.path;
|
|
15
15
|
}).join('/');
|
|
16
|
-
var
|
|
16
|
+
var navigate = useNavigate();
|
|
17
17
|
return last ? /*#__PURE__*/React.createElement("span", null, title) : /*#__PURE__*/React.createElement("a", {
|
|
18
18
|
onClick: function onClick() {
|
|
19
|
-
|
|
19
|
+
navigate === null || navigate === void 0 ? void 0 : navigate(path);
|
|
20
20
|
}
|
|
21
21
|
}, title);
|
|
22
22
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { IconComponentProps } from '@oceanbase/icons/es/components/Icon';
|
|
2
2
|
import type { PageContainerProps as AntPageContainerProps, PageHeaderProps as AntPageHeaderProps } from '@ant-design/pro-components';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export
|
|
4
|
+
export type ReloadType = boolean | IconComponentProps | React.ReactNode;
|
|
5
5
|
export interface PageContainerLocale {
|
|
6
6
|
reload?: string;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type PageHeaderProps = AntPageHeaderProps & {
|
|
9
9
|
reload?: ReloadType;
|
|
10
10
|
};
|
|
11
11
|
export interface PageContainerProps extends AntPageContainerProps {
|
|
@@ -33,8 +33,7 @@ var PageContainer = function PageContainer(_ref) {
|
|
|
33
33
|
var rootPrefixCls = getPrefixCls();
|
|
34
34
|
var prefixCls = getPrefixCls('pro-page-container', customizePrefixCls);
|
|
35
35
|
var _useStyle = useStyle(prefixCls),
|
|
36
|
-
wrapSSR = _useStyle.wrapSSR
|
|
37
|
-
hashId = _useStyle.hashId;
|
|
36
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
38
37
|
var _ref2 = header || {},
|
|
39
38
|
reload = _ref2.reload,
|
|
40
39
|
subTitle = _ref2.subTitle,
|
|
@@ -64,7 +63,7 @@ var PageContainer = function PageContainer(_ref) {
|
|
|
64
63
|
var noHasHeader = ['title', 'subTitle', 'extra', 'tags', 'footer', 'avatar', 'backIcon', 'breadcrumb'].every(function (item) {
|
|
65
64
|
return !(newHeader !== null && newHeader !== void 0 && newHeader[item]);
|
|
66
65
|
}) && !content && !extraContent && !tabList && !tabBarExtraContent;
|
|
67
|
-
var pageContainerCls = classNames(_defineProperty({}, "".concat(prefixCls, "-no-page-header"), noHasHeader), className
|
|
66
|
+
var pageContainerCls = classNames(_defineProperty({}, "".concat(prefixCls, "-no-page-header"), noHasHeader), className);
|
|
68
67
|
return wrapSSR( /*#__PURE__*/React.createElement(AntPageContainer, _extends({
|
|
69
68
|
prefixCls: customizePrefixCls,
|
|
70
69
|
className: pageContainerCls,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { PageContainerToken } from '@ant-design/pro-layout/es/components/PageContainer/style';
|
|
2
|
-
import type { GenerateStyle } from '
|
|
3
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
4
|
export declare const genPageContainerStyle: GenerateStyle<PageContainerToken>;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
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
|
+
};
|
|
5
9
|
export default _default;
|