@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/locale/zh-CN.js
CHANGED
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
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
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
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
|
-
import
|
|
7
|
+
import zhCN from '@oceanbase/design/es/locale/zh-CN';
|
|
8
8
|
import BasicLayout from "../BasicLayout/locale/zh-CN";
|
|
9
9
|
import BatchOperationBar from "../BatchOperationBar/locale/zh-CN";
|
|
10
10
|
import Dialog from "../Dialog/locale/zh-CN";
|
|
@@ -19,7 +19,7 @@ import Ranger from "../Ranger/locale/zh-CN";
|
|
|
19
19
|
import SideTip from "../SideTip/locale/zh-CN";
|
|
20
20
|
import TaskGraph from "../TaskGraph/locale/zh-CN";
|
|
21
21
|
import Welcome from "../Welcome/locale/zh-CN";
|
|
22
|
-
export default _objectSpread(_objectSpread({},
|
|
22
|
+
export default _objectSpread(_objectSpread({}, zhCN), {}, {
|
|
23
23
|
// 业务组件
|
|
24
24
|
BasicLayout: BasicLayout,
|
|
25
25
|
PageContainer: PageContainer,
|
package/es/locale/zh-TW.js
CHANGED
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
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
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
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
|
-
import
|
|
7
|
+
import zhTW from '@oceanbase/design/es/locale/zh-TW';
|
|
8
8
|
import BasicLayout from "../BasicLayout/locale/zh-TW";
|
|
9
9
|
import BatchOperationBar from "../BatchOperationBar/locale/zh-TW";
|
|
10
10
|
import Dialog from "../Dialog/locale/zh-TW";
|
|
@@ -16,7 +16,7 @@ import { default as Boundary, default as Password } from "../Password/locale/zh-
|
|
|
16
16
|
import Ranger from "../Ranger/locale/zh-TW";
|
|
17
17
|
import TaskGraph from "../TaskGraph/locale/zh-TW";
|
|
18
18
|
import Welcome from "../Welcome/locale/zh-TW";
|
|
19
|
-
export default _objectSpread(_objectSpread({},
|
|
19
|
+
export default _objectSpread(_objectSpread({}, zhTW), {}, {
|
|
20
20
|
// 业务组件
|
|
21
21
|
BasicLayout: BasicLayout,
|
|
22
22
|
PageContainer: PageContainer,
|
package/lib/Action/Item.js
CHANGED
|
@@ -64,14 +64,12 @@ var ActionButton = class extends import_react.default.PureComponent {
|
|
|
64
64
|
danger,
|
|
65
65
|
disabled,
|
|
66
66
|
onClick: (_) => {
|
|
67
|
-
|
|
67
|
+
const handle = onClick == null ? void 0 : onClick();
|
|
68
|
+
if (enableLoading && (handle == null ? void 0 : handle.then)) {
|
|
68
69
|
this.setState({ loading: true });
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.setState({ loading: false });
|
|
73
|
-
});
|
|
74
|
-
}
|
|
70
|
+
handle.then(() => {
|
|
71
|
+
this.setState({ loading: false });
|
|
72
|
+
});
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
},
|
|
@@ -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;
|
|
@@ -34,8 +34,8 @@ __export(BackgroundTaskManager_exports, {
|
|
|
34
34
|
default: () => BackgroundTaskManager_default
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(BackgroundTaskManager_exports);
|
|
37
|
-
var import_design = require("@oceanbase/design");
|
|
38
37
|
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_design = require("@oceanbase/design");
|
|
39
39
|
var import_constants = require("./constants");
|
|
40
40
|
var import_RefreshMan = require("./RefreshMan");
|
|
41
41
|
var NotificationApi = /* @__PURE__ */ ((NotificationApi2) => {
|
|
@@ -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;
|
|
@@ -40,7 +40,7 @@ var import_react = __toESM(require("react"));
|
|
|
40
40
|
var import_constant = require("../constant");
|
|
41
41
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
42
42
|
var import_util = require("../_util");
|
|
43
|
-
var
|
|
43
|
+
var import_useNavigate = __toESM(require("../_util/useNavigate"));
|
|
44
44
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
45
45
|
var import_oceanbase_logo = __toESM(require("../assets/logo/oceanbase_logo.svg"));
|
|
46
46
|
var import_user = __toESM(require("../assets/user.svg"));
|
|
@@ -69,7 +69,7 @@ var Header = ({
|
|
|
69
69
|
langs,
|
|
70
70
|
...restProps
|
|
71
71
|
}) => {
|
|
72
|
-
const
|
|
72
|
+
const navigate = (0, import_useNavigate.default)();
|
|
73
73
|
const [visible, setVisible] = (0, import_react.useState)(false);
|
|
74
74
|
const isWelcome = pathname === welcomePath;
|
|
75
75
|
const helpMenu = /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -78,7 +78,7 @@ var Header = ({
|
|
|
78
78
|
onClick: ({ key }) => {
|
|
79
79
|
var _a;
|
|
80
80
|
if (key === "welcome") {
|
|
81
|
-
|
|
81
|
+
navigate == null ? void 0 : navigate(welcomePath);
|
|
82
82
|
} else if (key === "viewDocs") {
|
|
83
83
|
(0, import_util.directTo)(docsPath);
|
|
84
84
|
} else if (key === "downloadDocs") {
|
|
@@ -110,7 +110,7 @@ var Header = ({
|
|
|
110
110
|
src: simpleLogoUrl,
|
|
111
111
|
alt: "",
|
|
112
112
|
onClick: () => {
|
|
113
|
-
|
|
113
|
+
navigate == null ? void 0 : navigate("/");
|
|
114
114
|
},
|
|
115
115
|
className: `${prefix}-logo`
|
|
116
116
|
}
|
|
@@ -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/lib/BasicLayout/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var import_path_to_regexp = require("path-to-regexp");
|
|
|
43
43
|
var import_react = __toESM(require("react"));
|
|
44
44
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
45
45
|
var import_util2 = require("../_util");
|
|
46
|
-
var
|
|
46
|
+
var import_useNavigate = __toESM(require("../_util/useNavigate"));
|
|
47
47
|
var import_Header = __toESM(require("./Header"));
|
|
48
48
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
49
49
|
var import_style = __toESM(require("./style"));
|
|
@@ -72,9 +72,9 @@ var BasicLayout = ({
|
|
|
72
72
|
}) => {
|
|
73
73
|
const { getPrefixCls } = (0, import_react.useContext)(import_design2.ConfigProvider.ConfigContext);
|
|
74
74
|
const prefixCls = getPrefixCls("basic-layout", customizePrefixCls);
|
|
75
|
-
const { wrapSSR
|
|
76
|
-
const basicLayoutCls = (0, import_classnames.default)(className
|
|
77
|
-
const
|
|
75
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
76
|
+
const basicLayoutCls = (0, import_classnames.default)(className);
|
|
77
|
+
const navigate = (0, import_useNavigate.default)();
|
|
78
78
|
const [collapsed, setCollapsed] = (0, import_react.useState)(defaultCollapsed);
|
|
79
79
|
const [selectedKeys, setSelectedKeys] = (0, import_react.useState)(defaultSelectedKeys);
|
|
80
80
|
const [openKeys, setOpenKeys] = (0, import_react.useState)(defaultOpenKeys);
|
|
@@ -157,7 +157,7 @@ var BasicLayout = ({
|
|
|
157
157
|
key: item.link,
|
|
158
158
|
onClick: () => {
|
|
159
159
|
if (pathname !== item.link) {
|
|
160
|
-
|
|
160
|
+
navigate == null ? void 0 : navigate(item.link);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
},
|
|
@@ -217,7 +217,7 @@ var BasicLayout = ({
|
|
|
217
217
|
key: item.link,
|
|
218
218
|
onClick: () => {
|
|
219
219
|
if (pathname !== item.link) {
|
|
220
|
-
|
|
220
|
+
navigate == null ? void 0 : navigate(item.link);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
},
|
|
@@ -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,130 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/ContentWithIcon/index.tsx
|
|
30
|
+
var ContentWithIcon_exports = {};
|
|
31
|
+
__export(ContentWithIcon_exports, {
|
|
32
|
+
default: () => ContentWithIcon_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ContentWithIcon_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_icons = require("@ant-design/icons");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_util = require("../_util");
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var prefix = (0, import_util.getPrefix)("content-with-question");
|
|
42
|
+
var ContentWithIcon = ({
|
|
43
|
+
content,
|
|
44
|
+
tooltip,
|
|
45
|
+
prefixIcon = null,
|
|
46
|
+
suffixIcon,
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
iconType,
|
|
50
|
+
color,
|
|
51
|
+
tooltipWithLink = false,
|
|
52
|
+
popOver,
|
|
53
|
+
textHidden = true,
|
|
54
|
+
size = 14,
|
|
55
|
+
infoColor,
|
|
56
|
+
exclamationColor = "#FAAD14",
|
|
57
|
+
...restProps
|
|
58
|
+
}) => {
|
|
59
|
+
const defaultIconType = () => {
|
|
60
|
+
if (iconType === "question") {
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
62
|
+
import_icons.QuestionCircleOutlined,
|
|
63
|
+
{
|
|
64
|
+
style: { color: color === "default" ? "#132039" : color, fontSize: size },
|
|
65
|
+
className: `${prefix}-help`
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
if (iconType === "info") {
|
|
70
|
+
if (infoColor) {
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
72
|
+
import_icons.InfoCircleFilled,
|
|
73
|
+
{
|
|
74
|
+
style: { color: infoColor, fontSize: size },
|
|
75
|
+
className: `${prefix}-help`
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
} else {
|
|
79
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
80
|
+
import_icons.InfoCircleOutlined,
|
|
81
|
+
{
|
|
82
|
+
style: { color: "3333333", fontSize: size },
|
|
83
|
+
className: `${prefix}-help`
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (iconType === "exclamation") {
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
import_icons.ExclamationCircleFilled,
|
|
91
|
+
{
|
|
92
|
+
style: { color: exclamationColor, fontSize: size },
|
|
93
|
+
className: `${prefix}-help`
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
suffixIcon = suffixIcon !== null && iconType ? defaultIconType() : suffixIcon;
|
|
99
|
+
const getIcon = (iconConfig) => {
|
|
100
|
+
return iconConfig ? !textHidden && iconType === "info" ? (
|
|
101
|
+
// 文本描述直接展示且只在 info 类型下生效
|
|
102
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, iconConfig, /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#5C6B8A" } }, "文本示意不超过二十字文本示意不超过二十字"))
|
|
103
|
+
) : (
|
|
104
|
+
// 提示文案描述带有链接
|
|
105
|
+
tooltipWithLink ? /* @__PURE__ */ import_react.default.createElement(import_antd.Popover, { ...popOver }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : defaultIconType()) : /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { ...tooltip }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : defaultIconType())
|
|
106
|
+
) : null;
|
|
107
|
+
};
|
|
108
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
109
|
+
"span",
|
|
110
|
+
{
|
|
111
|
+
className: (0, import_classnames.default)({
|
|
112
|
+
[`${prefix}-item`]: true,
|
|
113
|
+
[className]: !!className
|
|
114
|
+
}),
|
|
115
|
+
...restProps
|
|
116
|
+
},
|
|
117
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, getIcon(
|
|
118
|
+
// 图标在文字前
|
|
119
|
+
prefixIcon === true ? defaultIconType() : prefixIcon
|
|
120
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
121
|
+
"span",
|
|
122
|
+
{
|
|
123
|
+
"data-testid": "content",
|
|
124
|
+
style: { color: color === "default" ? "#5C6B8A" : color, fontSize: size }
|
|
125
|
+
},
|
|
126
|
+
content ?? children
|
|
127
|
+
), getIcon(suffixIcon))
|
|
128
|
+
));
|
|
129
|
+
};
|
|
130
|
+
var ContentWithIcon_default = ContentWithIcon;
|
package/lib/DocDialog/index.js
CHANGED
|
@@ -34,7 +34,6 @@ __export(DocDialog_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(DocDialog_exports);
|
|
35
35
|
var import_lodash = require("lodash");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_react_router_dom = require("react-router-dom");
|
|
38
37
|
var import_Dialog = __toESM(require("../Dialog"));
|
|
39
38
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
40
39
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
@@ -59,7 +58,7 @@ var DocDialogComp = (props) => {
|
|
|
59
58
|
} = props;
|
|
60
59
|
const [clientHeight, setClientHeight] = (0, import_react.useState)(document.body.clientHeight);
|
|
61
60
|
const [clientWidth, setClientWidth] = (0, import_react.useState)(document.body.clientWidth);
|
|
62
|
-
const location =
|
|
61
|
+
const location = window.location;
|
|
63
62
|
const currentLink = (0, import_react.useMemo)(() => {
|
|
64
63
|
const { pathname } = location;
|
|
65
64
|
const link = Object.entries(docUrls).find((set) => pathname.indexOf(set[0]) > -1);
|
|
@@ -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/lib/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 样式
|
|
@@ -47,21 +47,21 @@ var Activate = ({
|
|
|
47
47
|
goBack,
|
|
48
48
|
...restProps
|
|
49
49
|
}) => {
|
|
50
|
-
const [
|
|
50
|
+
const [form] = import_design.Form.useForm();
|
|
51
51
|
const handleValidateConfirmPassword = (0, import_react.useCallback)(
|
|
52
52
|
(rule, value, callback) => {
|
|
53
|
-
if (!
|
|
53
|
+
if (!form) {
|
|
54
54
|
callback();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const pwd =
|
|
57
|
+
const pwd = form.getFieldValue("password");
|
|
58
58
|
if ((0, import_lodash.toString)(value) !== (0, import_lodash.toString)(pwd)) {
|
|
59
59
|
callback(locale.samePasswordMessage);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
callback();
|
|
63
63
|
},
|
|
64
|
-
[
|
|
64
|
+
[form]
|
|
65
65
|
);
|
|
66
66
|
const passwordRegexpRule = passwordRule || {
|
|
67
67
|
pattern: import_RegisterForm.PASSWORD_REGEX,
|
|
@@ -73,7 +73,7 @@ var Activate = ({
|
|
|
73
73
|
layout: "vertical",
|
|
74
74
|
requiredMark: false,
|
|
75
75
|
className: `${prefix}-form`,
|
|
76
|
-
form
|
|
76
|
+
form,
|
|
77
77
|
...restProps,
|
|
78
78
|
"data-testid": "login.register"
|
|
79
79
|
},
|
package/lib/Login/LoginForm.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ var Register = ({
|
|
|
48
48
|
errorMessage,
|
|
49
49
|
...restProps
|
|
50
50
|
}) => {
|
|
51
|
-
const [
|
|
51
|
+
const [form] = import_design.Form.useForm();
|
|
52
52
|
const handleValidateAccount = (0, import_react.useCallback)(
|
|
53
53
|
async (rule, value) => {
|
|
54
54
|
if (!value || !(0, import_lodash.isFunction)(isUserExists)) {
|
|
@@ -63,18 +63,18 @@ var Register = ({
|
|
|
63
63
|
);
|
|
64
64
|
const handleValidateConfirmPassword = (0, import_react.useCallback)(
|
|
65
65
|
(rule, value, callback) => {
|
|
66
|
-
if (!
|
|
66
|
+
if (!form) {
|
|
67
67
|
callback();
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
const pwd =
|
|
70
|
+
const pwd = form.getFieldValue("password");
|
|
71
71
|
if ((0, import_lodash.toString)(value) !== (0, import_lodash.toString)(pwd)) {
|
|
72
72
|
callback(locale.samePasswordMessage);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
callback();
|
|
76
76
|
},
|
|
77
|
-
[
|
|
77
|
+
[form]
|
|
78
78
|
);
|
|
79
79
|
const passwordRegexpRule = passwordRule || {
|
|
80
80
|
pattern: PASSWORD_REGEX,
|
|
@@ -86,7 +86,7 @@ var Register = ({
|
|
|
86
86
|
layout: "vertical",
|
|
87
87
|
requiredMark: false,
|
|
88
88
|
className: `${prefix}-form`,
|
|
89
|
-
form
|
|
89
|
+
form,
|
|
90
90
|
...restProps,
|
|
91
91
|
"data-testid": "login.register"
|
|
92
92
|
},
|
package/lib/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/lib/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/lib/NavMenu/index.js
CHANGED
|
@@ -36,17 +36,16 @@ var import_design = require("@oceanbase/design");
|
|
|
36
36
|
var import_lodash = require("lodash");
|
|
37
37
|
var import_path_to_regexp = require("path-to-regexp");
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
|
-
var import_react_router_dom = require("react-router-dom");
|
|
40
39
|
var import_util = require("../_util");
|
|
41
|
-
var
|
|
40
|
+
var import_useNavigate = __toESM(require("../_util/useNavigate"));
|
|
42
41
|
var import_index = require("./index.less");
|
|
43
42
|
var prefix = (0, import_util.getPrefix)("menu");
|
|
44
43
|
var NavMenu_default = (props) => {
|
|
45
44
|
const { menuList, className, style } = props;
|
|
46
45
|
const [selectedKeys, setSelectedKeys] = (0, import_react.useState)(["0"]);
|
|
47
46
|
const [menus, setMenus] = (0, import_react.useState)([]);
|
|
48
|
-
const location =
|
|
49
|
-
const
|
|
47
|
+
const location = window.location;
|
|
48
|
+
const navigate = (0, import_useNavigate.default)();
|
|
50
49
|
const preProcess = (0, import_react.useCallback)(
|
|
51
50
|
(list) => {
|
|
52
51
|
const { pathname } = location;
|
|
@@ -92,9 +91,9 @@ var NavMenu_default = (props) => {
|
|
|
92
91
|
const onMenuClick = (0, import_react.useCallback)(
|
|
93
92
|
(link) => {
|
|
94
93
|
const linkList = (0, import_lodash.isArray)(link) ? link : [link];
|
|
95
|
-
|
|
94
|
+
navigate == null ? void 0 : navigate(linkList[0]);
|
|
96
95
|
},
|
|
97
|
-
[
|
|
96
|
+
[navigate]
|
|
98
97
|
);
|
|
99
98
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-container ${className}`, style }, /* @__PURE__ */ import_react.default.createElement(
|
|
100
99
|
import_design.Menu,
|
|
@@ -33,18 +33,18 @@ __export(ItemRender_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(ItemRender_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var
|
|
36
|
+
var import_useNavigate = __toESM(require("../_util/useNavigate"));
|
|
37
37
|
var ItemRender_default = ({ route, params, routes, paths }) => {
|
|
38
38
|
const routeIndex = routes.indexOf(route);
|
|
39
39
|
const last = routeIndex === routes.length - 1;
|
|
40
40
|
const title = route.title || route.breadcrumbName;
|
|
41
41
|
const path = route.href || routes.slice(0, routeIndex + 1).map((item) => item.path).join("/");
|
|
42
|
-
const
|
|
42
|
+
const navigate = (0, import_useNavigate.default)();
|
|
43
43
|
return last ? /* @__PURE__ */ import_react.default.createElement("span", null, title) : /* @__PURE__ */ import_react.default.createElement(
|
|
44
44
|
"a",
|
|
45
45
|
{
|
|
46
46
|
onClick: () => {
|
|
47
|
-
|
|
47
|
+
navigate == null ? void 0 : navigate(path);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
title
|