@oceanbase/ui 0.2.13 → 0.2.14
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.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 +4 -4
- package/es/BasicLayout/style/index.d.ts +2 -2
- package/es/BatchOperationBar/index.d.ts +3 -3
- package/es/Boundary/constant.d.ts +4 -4
- package/es/DocDialog/index.js +1 -2
- package/es/FullscreenBox/index.d.ts +1 -1
- package/es/Highlight/index.d.ts +3 -3
- 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/NavMenu/index.js +5 -6
- package/es/PageContainer/ItemRender.js +3 -3
- package/es/PageContainer/index.d.ts +2 -2
- package/es/PageContainer/style/index.d.ts +1 -1
- 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/TreeSearch/index.d.ts +1 -1
- package/es/Welcome/index.d.ts +2 -2
- package/es/_util/genComponentStyleHook.d.ts +1 -1
- package/es/_util/genComponentStyleHook.js +5 -5
- package/es/_util/useNavigate.d.ts +2 -0
- package/es/_util/useNavigate.js +7 -0
- 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 +4 -4
- package/lib/BasicLayout/style/index.d.ts +2 -2
- package/lib/BatchOperationBar/index.d.ts +3 -3
- package/lib/Boundary/constant.d.ts +4 -4
- package/lib/DocDialog/index.js +1 -2
- package/lib/FullscreenBox/index.d.ts +1 -1
- package/lib/Highlight/index.d.ts +3 -3
- 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/NavMenu/index.js +5 -6
- package/lib/PageContainer/ItemRender.js +3 -3
- package/lib/PageContainer/index.d.ts +2 -2
- package/lib/PageContainer/style/index.d.ts +1 -1
- 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/TreeSearch/index.d.ts +1 -1
- package/lib/Welcome/index.d.ts +2 -2
- package/lib/_util/genComponentStyleHook.d.ts +1 -1
- 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/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 +8 -9
- package/es/_util/useHistory.d.ts +0 -4
- package/es/_util/useHistory.js +0 -13
- 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"));
|
|
@@ -74,7 +74,7 @@ var BasicLayout = ({
|
|
|
74
74
|
const prefixCls = getPrefixCls("basic-layout", customizePrefixCls);
|
|
75
75
|
const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
|
|
76
76
|
const basicLayoutCls = (0, import_classnames.default)(className, hashId);
|
|
77
|
-
const
|
|
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,5 @@
|
|
|
1
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
-
export
|
|
1
|
+
import type { FullToken, GenerateStyle } from '@oceanbase/design/es/theme';
|
|
2
|
+
export type BasicLayoutToken = FullToken<any>;
|
|
3
3
|
export declare const genBasicLayoutStyle: GenerateStyle<BasicLayoutToken>;
|
|
4
4
|
declare const _default: (prefixCls: string) => any;
|
|
5
5
|
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: {
|
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
|
|
32
|
-
declare const supportedLanguages: ("ruby" | "
|
|
33
|
-
export
|
|
31
|
+
export type ThemeType = (typeof ThemeTypes)[number];
|
|
32
|
+
declare const supportedLanguages: ("ruby" | "javascript" | "typescript" | "css" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
|
|
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/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
|
|
@@ -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 {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PageContainerToken } from '@ant-design/pro-layout/es/components/PageContainer/style';
|
|
2
|
-
import type { GenerateStyle } from '
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
3
|
export declare const genPageContainerStyle: GenerateStyle<PageContainerToken>;
|
|
4
4
|
declare const _default: (prefixCls: string) => any;
|
|
5
5
|
export default _default;
|
package/lib/Password/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PasswordProps as
|
|
1
|
+
import type { PasswordProps as InputPasswordProps } from '@oceanbase/design/es/input';
|
|
2
2
|
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
|
|
3
3
|
import type { Validator } from './Content';
|
|
4
4
|
export interface PasswordLocale {
|
|
@@ -13,7 +13,7 @@ export interface PasswordLocale {
|
|
|
13
13
|
copyPassword: string;
|
|
14
14
|
andKeepItProperly: string;
|
|
15
15
|
}
|
|
16
|
-
export interface PasswordProps extends LocaleWrapperProps, Omit<
|
|
16
|
+
export interface PasswordProps extends LocaleWrapperProps, Omit<InputPasswordProps, 'onChange'> {
|
|
17
17
|
value?: string;
|
|
18
18
|
onChange?: (value?: string) => void;
|
|
19
19
|
rules?: Validator[];
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
|
|
3
3
|
import type { RangeValue } from './Ranger';
|
|
4
4
|
import type { RangeOption } from './typing';
|
|
5
|
-
export
|
|
5
|
+
export type QuickType = 'select' | 'dropdown';
|
|
6
6
|
interface IProps extends LocaleWrapperProps {
|
|
7
7
|
selects: RangeOption[];
|
|
8
8
|
type?: QuickType;
|
|
@@ -12,6 +12,7 @@ interface IProps extends LocaleWrapperProps {
|
|
|
12
12
|
name?: string;
|
|
13
13
|
defaultName?: string;
|
|
14
14
|
isMoment?: boolean;
|
|
15
|
+
size?: 'small' | 'large' | 'middle';
|
|
15
16
|
}
|
|
16
17
|
declare const _default: (props: IProps) => React.JSX.Element;
|
|
17
18
|
export default _default;
|
package/lib/Ranger/Ranger.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Dayjs } from 'dayjs';
|
|
2
2
|
import type { Moment } from 'moment';
|
|
3
3
|
import './index.less';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export type RangeName = 'customize' | string;
|
|
5
|
+
export type RangeValue = [Moment, Moment] | [Dayjs, Dayjs];
|
|
6
|
+
export type RangeDateValue = {
|
|
7
7
|
name: RangeName;
|
|
8
8
|
range: RangeValue;
|
|
9
9
|
};
|
package/lib/Ranger/index.d.ts
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import InternalRanger from './Ranger';
|
|
3
|
-
import type { RangeOption } from './typing';
|
|
4
|
-
declare type InternalRangerType = typeof InternalRanger;
|
|
5
|
-
interface RangerType extends InternalRangerType {
|
|
6
|
-
NEAR_1_MINUTES: RangeOption;
|
|
7
|
-
NEAR_5_MINUTES: RangeOption;
|
|
8
|
-
NEAR_10_MINUTES: RangeOption;
|
|
9
|
-
NEAR_20_MINUTES: RangeOption;
|
|
10
|
-
NEAR_30_MINUTES: RangeOption;
|
|
11
|
-
NEAR_1_HOURS: RangeOption;
|
|
12
|
-
NEAR_2_HOURS: RangeOption;
|
|
13
|
-
NEAR_3_HOURS: RangeOption;
|
|
14
|
-
NEAR_6_HOURS: RangeOption;
|
|
15
|
-
TODAY: RangeOption;
|
|
16
|
-
YESTERDAY: RangeOption;
|
|
17
|
-
TOMORROW: RangeOption;
|
|
18
|
-
THIS_WEEK: RangeOption;
|
|
19
|
-
LAST_WEEK: RangeOption;
|
|
20
|
-
NEXT_WEEK: RangeOption;
|
|
21
|
-
THIS_MONTH: RangeOption;
|
|
22
|
-
LAST_MONTH: RangeOption;
|
|
23
|
-
NEXT_MONTH: RangeOption;
|
|
24
|
-
THIS_QUARTER: RangeOption;
|
|
25
|
-
LAST_QUARTER: RangeOption;
|
|
26
|
-
NEXT_QUARTER: RangeOption;
|
|
27
|
-
THIS_YEAR: RangeOption;
|
|
28
|
-
LAST_YEAR: RangeOption;
|
|
29
|
-
NEXT_YEAR: RangeOption;
|
|
30
|
-
QuickPicker: typeof QuickPicker;
|
|
31
|
-
}
|
|
32
|
-
declare const Ranger: RangerType;
|
|
1
|
+
declare const Ranger: any;
|
|
33
2
|
export default Ranger;
|
package/lib/SideTip/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { BadgeProps } from '
|
|
2
|
-
import type { TooltipPropsWithTitle } from '
|
|
1
|
+
import type { BadgeProps } from '@oceanbase/design/es/badge/index';
|
|
2
|
+
import type { TooltipPropsWithTitle } from '@oceanbase/design/es/tooltip/index';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
|
|
5
5
|
import './index.less';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type SideTipType = 'primary' | 'default';
|
|
7
|
+
export type SideTipSize = 'small' | 'default';
|
|
8
8
|
export interface Position {
|
|
9
9
|
/**
|
|
10
10
|
* @title 距离右侧
|
package/lib/Welcome/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ButtonProps } from '
|
|
1
|
+
import type { ButtonProps } from '@oceanbase/design/es/button';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import './index.less';
|
|
4
4
|
export interface IntroduceItem {
|
|
@@ -19,7 +19,7 @@ export interface WelcomeLocale {
|
|
|
19
19
|
helpTitle: string;
|
|
20
20
|
defaultOperation: string;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type StepType = 'default' | 'card';
|
|
23
23
|
export interface WelcomeProps {
|
|
24
24
|
title: string;
|
|
25
25
|
description: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProAliasToken } from '@ant-design/pro-components';
|
|
2
|
-
import type { GenerateStyle } from '
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
3
|
export interface OBToken extends ProAliasToken {
|
|
4
4
|
/** Wrap component class with `.` prefix */
|
|
5
5
|
componentCls: string;
|
|
@@ -37,10 +37,10 @@ var import_react = __toESM(require("react"));
|
|
|
37
37
|
var import_design = require("@oceanbase/design");
|
|
38
38
|
function genComponentStyleHook(componentName, styleFn) {
|
|
39
39
|
return (prefixCls) => {
|
|
40
|
+
const { getPrefixCls, iconPrefixCls } = import_react.default.useContext(import_design.ConfigProvider.ConfigContext);
|
|
41
|
+
const rootPrefixCls = getPrefixCls();
|
|
42
|
+
const componentCls = `.${prefixCls}`;
|
|
40
43
|
return (0, import_pro_components.useStyle)(componentName, (token) => {
|
|
41
|
-
const { getPrefixCls, iconPrefixCls } = import_react.default.useContext(import_design.ConfigProvider.ConfigContext);
|
|
42
|
-
const rootPrefixCls = getPrefixCls();
|
|
43
|
-
const componentCls = `.${prefixCls}`;
|
|
44
44
|
const mergedToken = {
|
|
45
45
|
...token,
|
|
46
46
|
componentCls,
|