@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/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";
|
|
@@ -65,7 +65,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
65
65
|
wrapSSR = _useStyle.wrapSSR,
|
|
66
66
|
hashId = _useStyle.hashId;
|
|
67
67
|
var basicLayoutCls = classNames(className, hashId);
|
|
68
|
-
var
|
|
68
|
+
var navigate = useNavigate();
|
|
69
69
|
// 侧边栏导航是否收起
|
|
70
70
|
var _useState = useState(defaultCollapsed),
|
|
71
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -166,7 +166,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
166
166
|
key: item.link,
|
|
167
167
|
onClick: function onClick() {
|
|
168
168
|
if (pathname !== item.link) {
|
|
169
|
-
|
|
169
|
+
navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}, /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
@@ -218,7 +218,7 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
218
218
|
key: item.link,
|
|
219
219
|
onClick: function onClick() {
|
|
220
220
|
if (pathname !== item.link) {
|
|
221
|
-
|
|
221
|
+
navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -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/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
|
|
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 样式
|
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/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 {
|
|
@@ -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/es/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/es/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/es/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/es/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/es/TreeSearch/index.d.ts
CHANGED
package/es/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;
|
|
@@ -9,12 +9,12 @@ import React from 'react';
|
|
|
9
9
|
import { ConfigProvider } from '@oceanbase/design';
|
|
10
10
|
export function genComponentStyleHook(componentName, styleFn) {
|
|
11
11
|
return function (prefixCls) {
|
|
12
|
+
var _React$useContext = React.useContext(ConfigProvider.ConfigContext),
|
|
13
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
14
|
+
iconPrefixCls = _React$useContext.iconPrefixCls;
|
|
15
|
+
var rootPrefixCls = getPrefixCls();
|
|
16
|
+
var componentCls = ".".concat(prefixCls);
|
|
12
17
|
return useStyle(componentName, function (token) {
|
|
13
|
-
var _React$useContext = React.useContext(ConfigProvider.ConfigContext),
|
|
14
|
-
getPrefixCls = _React$useContext.getPrefixCls,
|
|
15
|
-
iconPrefixCls = _React$useContext.iconPrefixCls;
|
|
16
|
-
var rootPrefixCls = getPrefixCls();
|
|
17
|
-
var componentCls = ".".concat(prefixCls);
|
|
18
18
|
var mergedToken = _objectSpread(_objectSpread({}, token), {}, {
|
|
19
19
|
componentCls: componentCls,
|
|
20
20
|
prefixCls: prefixCls,
|
package/es/interface.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Locale = 'zh-TW' | 'zh-CN' | 'en-US';
|
package/es/locale/en-US.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 enUS from '@oceanbase/design/es/locale/en-US';
|
|
8
8
|
import BasicLayout from "../BasicLayout/locale/en-US";
|
|
9
9
|
import BatchOperationBar from "../BatchOperationBar/locale/en-US";
|
|
10
10
|
import Boundary from "../Boundary/locale/en-US";
|
|
@@ -19,7 +19,7 @@ import Ranger from "../Ranger/locale/en-US";
|
|
|
19
19
|
import SideTip from "../SideTip/locale/en-US";
|
|
20
20
|
import TaskGraph from "../TaskGraph/locale/en-US";
|
|
21
21
|
import Welcome from "../Welcome/locale/en-US";
|
|
22
|
-
export default _objectSpread(_objectSpread({},
|
|
22
|
+
export default _objectSpread(_objectSpread({}, enUS), {}, {
|
|
23
23
|
// 业务组件
|
|
24
24
|
BasicLayout: BasicLayout,
|
|
25
25
|
PageContainer: PageContainer,
|
package/es/locale/index.d.ts
CHANGED