@oceanbase/ui 0.2.19 → 0.2.21
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/Group.d.ts +1 -1
- package/es/Action/Group.js +50 -41
- package/es/Action/Item.d.ts +2 -2
- package/es/Action/Item.js +32 -26
- package/es/Action/index.d.ts +1 -2
- package/es/BackgroundTaskManager/RefreshMan.js +8 -3
- package/es/BackgroundTaskManager/index.js +8 -4
- package/es/BasicLayout/Header.js +193 -140
- package/es/BasicLayout/index.js +149 -108
- package/es/BatchOperationBar/index.js +46 -29
- package/es/Boundary/Components/Code.js +17 -10
- package/es/Boundary/Components/Exception.js +46 -31
- package/es/Boundary/Components/Function.js +17 -10
- package/es/ContentWithIcon/index.js +42 -26
- package/es/ContentWithIcon/index.less +0 -1
- package/es/Dialog/Anchor.d.ts +1 -1
- package/es/Dialog/Anchor.js +9 -6
- package/es/Dialog/EventProxy.d.ts +1 -1
- package/es/Dialog/EventProxy.js +3 -2
- package/es/Dialog/index.js +129 -108
- package/es/Dialog/index.less +3 -1
- package/es/DocDialog/index.d.ts +1 -1
- package/es/DocDialog/index.js +8 -3
- package/es/FullscreenBox/index.d.ts +1 -1
- package/es/FullscreenBox/index.js +22 -16
- package/es/GraphToolbar/index.js +79 -65
- package/es/Highlight/DiffView/DiffCells.d.ts +2 -2
- package/es/Highlight/DiffView/DiffCells.js +22 -15
- package/es/Highlight/DiffView/index.js +49 -40
- package/es/Highlight/HighlightCell.d.ts +1 -1
- package/es/Highlight/HighlightCell.js +19 -13
- package/es/Highlight/JsonView.d.ts +1 -2
- package/es/Highlight/JsonView.js +15 -13
- package/es/Highlight/index.d.ts +1 -1
- package/es/Highlight/index.js +66 -54
- package/es/IconFont/index.d.ts +1 -1
- package/es/IconFont/index.js +9 -3
- package/es/LocaleDropdown/index.js +38 -26
- package/es/Login/ActivateForm.js +63 -50
- package/es/Login/LoginForm.js +115 -99
- package/es/Login/RegisterForm.js +78 -67
- package/es/Login/index.js +122 -91
- package/es/Lottie/index.js +2 -1
- package/es/NavMenu/index.d.ts +2 -2
- package/es/NavMenu/index.js +34 -29
- package/es/PageContainer/ItemRender.d.ts +1 -2
- package/es/PageContainer/ItemRender.js +7 -3
- package/es/PageContainer/index.js +13 -10
- package/es/Password/Content.js +55 -47
- package/es/Password/index.js +62 -45
- package/es/Ranger/QuickPicker.d.ts +1 -2
- package/es/Ranger/QuickPicker.js +42 -31
- package/es/Ranger/Ranger.js +31 -27
- package/es/SideTip/Dragger.d.ts +1 -1
- package/es/SideTip/Dragger.js +5 -3
- package/es/SideTip/IconLoading.d.ts +1 -2
- package/es/SideTip/IconLoading.js +28 -20
- package/es/SideTip/index.js +43 -30
- package/es/SideTip/index.less +4 -1
- package/es/TagSelect/Group.d.ts +1 -1
- package/es/TagSelect/Group.js +16 -11
- package/es/TagSelect/Item.d.ts +1 -1
- package/es/TagSelect/Item.js +30 -23
- package/es/TagSelect/style/index.d.ts +1 -1
- package/es/TaskGraph/Graph.js +39 -31
- package/es/TaskGraph/index.js +68 -57
- package/es/TreeSearch/index.js +36 -32
- package/es/Welcome/index.js +113 -83
- package/es/Welcome/step.js +31 -23
- package/es/locale/LocaleWrapper.js +3 -3
- package/lib/Action/Group.d.ts +1 -1
- package/lib/Action/Item.d.ts +2 -2
- package/lib/Action/index.d.ts +1 -2
- package/lib/ContentWithIcon/index.less +0 -1
- package/lib/Dialog/Anchor.d.ts +1 -1
- package/lib/Dialog/EventProxy.d.ts +1 -1
- package/lib/Dialog/EventProxy.js +12 -2
- package/lib/Dialog/index.less +3 -1
- package/lib/DocDialog/index.d.ts +1 -1
- package/lib/FullscreenBox/index.d.ts +1 -1
- package/lib/FullscreenBox/index.js +76 -74
- package/lib/Highlight/DiffView/DiffCells.d.ts +2 -2
- package/lib/Highlight/DiffView/index.js +1 -1
- package/lib/Highlight/HighlightCell.d.ts +1 -1
- package/lib/Highlight/JsonView.d.ts +1 -2
- package/lib/Highlight/JsonView.js +3 -3
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/IconFont/index.d.ts +1 -1
- package/lib/NavMenu/index.d.ts +2 -2
- package/lib/PageContainer/ItemRender.d.ts +1 -2
- package/lib/Ranger/QuickPicker.d.ts +1 -2
- package/lib/SideTip/Dragger.d.ts +1 -1
- package/lib/SideTip/IconLoading.d.ts +1 -2
- package/lib/SideTip/index.less +4 -1
- package/lib/TagSelect/Group.d.ts +1 -1
- package/lib/TagSelect/Group.js +4 -6
- package/lib/TagSelect/Item.d.ts +1 -1
- package/lib/TagSelect/style/index.d.ts +1 -1
- package/package.json +10 -9
package/es/IconFont/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ interface IconFontProps {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
7
|
}
|
|
8
|
-
declare const IconFont: (props: IconFontProps) =>
|
|
8
|
+
declare const IconFont: (props: IconFontProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
9
9
|
export default IconFont;
|
package/es/IconFont/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["type", "className"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
10
|
import { createFromIconfontCN } from '@oceanbase/icons';
|
|
6
11
|
import React from 'react';
|
|
7
12
|
import "./font/iconfont.css";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
14
|
var CustomIcon = createFromIconfontCN({
|
|
9
15
|
// 在 iconfont.cn 上生成
|
|
10
16
|
scriptUrl: '//at.alicdn.com/t/a/font_3786261_ifhixq9j5c.js'
|
|
@@ -15,10 +21,10 @@ var IconFont = function IconFont(props) {
|
|
|
15
21
|
className = props.className,
|
|
16
22
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
17
23
|
// TODO: 后续建议统一使用 iconfont.cn 上的图标,这里先兼容两种用法
|
|
18
|
-
return iconfontList.includes(type) ? /*#__PURE__*/
|
|
24
|
+
return iconfontList.includes(type) ? /*#__PURE__*/_jsx(CustomIcon, _objectSpread({
|
|
19
25
|
type: type,
|
|
20
26
|
className: className
|
|
21
|
-
}, restProps)) : /*#__PURE__*/
|
|
27
|
+
}, restProps)) : /*#__PURE__*/_jsx("i", _objectSpread({
|
|
22
28
|
className: "iconfont ".concat(type, " ").concat(className)
|
|
23
29
|
}, restProps));
|
|
24
30
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["locales", "showLabel"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
10
|
import { GlobalOutlined } from '@oceanbase/icons';
|
|
@@ -8,40 +13,47 @@ import { Dropdown, Menu, Space } from '@oceanbase/design';
|
|
|
8
13
|
import React from 'react';
|
|
9
14
|
import { LOCALE_LIST } from "../constant";
|
|
10
15
|
import { getLocale, getPrefix, setLocale } from "../_util";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
18
|
var prefix = getPrefix('layout-header');
|
|
12
19
|
var LocaleDropdown = function LocaleDropdown(_ref) {
|
|
13
20
|
var locales = _ref.locales,
|
|
14
21
|
showLabel = _ref.showLabel,
|
|
15
22
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
23
|
// 语言切换菜单
|
|
17
|
-
var localeMenu = /*#__PURE__*/
|
|
24
|
+
var localeMenu = /*#__PURE__*/_jsx(Menu, {
|
|
18
25
|
onClick: function onClick(_ref2) {
|
|
19
26
|
var key = _ref2.key;
|
|
20
27
|
setLocale(key);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
},
|
|
29
|
+
children: LOCALE_LIST.filter(function (item) {
|
|
30
|
+
return !locales || locales.includes(item.value);
|
|
31
|
+
}).map(function (item) {
|
|
32
|
+
return /*#__PURE__*/_jsx(Menu.Item, {
|
|
33
|
+
children: item.label
|
|
34
|
+
}, item.value);
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
return /*#__PURE__*/_jsx(Dropdown, _objectSpread(_objectSpread({
|
|
30
38
|
overlay: localeMenu
|
|
31
|
-
}, restProps),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
}, restProps), {}, {
|
|
40
|
+
children: showLabel ? /*#__PURE__*/_jsx("span", {
|
|
41
|
+
style: {
|
|
42
|
+
display: 'inline-block',
|
|
43
|
+
width: 28,
|
|
44
|
+
height: 28,
|
|
45
|
+
fontSize: 12,
|
|
46
|
+
fontWeight: 500,
|
|
47
|
+
lineHeight: '28px',
|
|
48
|
+
textAlign: 'center',
|
|
49
|
+
border: '0.88px solid #ced4e1',
|
|
50
|
+
borderRadius: 14
|
|
51
|
+
},
|
|
52
|
+
children: findByValue(LOCALE_LIST, getLocale()).minLabel
|
|
53
|
+
}) : /*#__PURE__*/_jsxs(Space, {
|
|
54
|
+
className: "".concat(prefix, "-extra-item"),
|
|
55
|
+
children: [/*#__PURE__*/_jsx(GlobalOutlined, {}), findByValue(LOCALE_LIST, getLocale()).shortLabel]
|
|
56
|
+
})
|
|
57
|
+
}));
|
|
46
58
|
};
|
|
47
59
|
export default LocaleDropdown;
|
package/es/Login/ActivateForm.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["locale", "loading", "passwordRule", "errorMessage", "goBack"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -14,6 +19,8 @@ import React, { useCallback } from 'react';
|
|
|
14
19
|
import { getPrefix } from "../_util";
|
|
15
20
|
import "./index.less";
|
|
16
21
|
import { PASSWORD_REGEX } from "./RegisterForm";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
24
|
var prefix = getPrefix('login');
|
|
18
25
|
var Activate = function Activate(_ref) {
|
|
19
26
|
var locale = _ref.locale,
|
|
@@ -41,58 +48,64 @@ var Activate = function Activate(_ref) {
|
|
|
41
48
|
pattern: PASSWORD_REGEX,
|
|
42
49
|
message: locale.passwordHelp
|
|
43
50
|
};
|
|
44
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread({
|
|
45
52
|
layout: "vertical",
|
|
46
53
|
requiredMark: false,
|
|
47
54
|
className: "".concat(prefix, "-form"),
|
|
48
55
|
form: form
|
|
49
|
-
}, restProps, {
|
|
50
|
-
"data-testid": "login.register"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
56
|
+
}, restProps), {}, {
|
|
57
|
+
"data-testid": "login.register",
|
|
58
|
+
children: [errorMessage && /*#__PURE__*/_jsx(Alert, {
|
|
59
|
+
type: "error",
|
|
60
|
+
showIcon: true,
|
|
61
|
+
className: "".concat(prefix, "-alert"),
|
|
62
|
+
message: errorMessage
|
|
63
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
64
|
+
name: "password",
|
|
65
|
+
label: locale.passwordLabel,
|
|
66
|
+
dependencies: ['confirmPassword'],
|
|
67
|
+
help: passwordRegexpRule.message,
|
|
68
|
+
validateFirst: true,
|
|
69
|
+
rules: [{
|
|
70
|
+
required: true,
|
|
71
|
+
message: locale.passwordMessage
|
|
72
|
+
}, passwordRegexpRule],
|
|
73
|
+
children: /*#__PURE__*/_jsx(Input.Password, {
|
|
74
|
+
visibilityToggle: true,
|
|
75
|
+
autoComplete: "new-password"
|
|
76
|
+
})
|
|
77
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
78
|
+
name: "confirmPassword",
|
|
79
|
+
label: locale.confirmPwdLabel,
|
|
80
|
+
dependencies: ['password'],
|
|
81
|
+
validateFirst: true,
|
|
82
|
+
rules: [{
|
|
83
|
+
required: true,
|
|
84
|
+
message: locale.confirmPwdMessage
|
|
85
|
+
}, {
|
|
86
|
+
validator: handleValidateConfirmPassword
|
|
87
|
+
}],
|
|
88
|
+
children: /*#__PURE__*/_jsx(Input.Password, {
|
|
89
|
+
visibilityToggle: true,
|
|
90
|
+
autoComplete: "new-password"
|
|
91
|
+
})
|
|
92
|
+
}), /*#__PURE__*/_jsx(Button
|
|
93
|
+
// 按下回车键,即可触发点击事件
|
|
94
|
+
, {
|
|
95
|
+
htmlType: "submit",
|
|
96
|
+
loading: loading,
|
|
97
|
+
type: "primary",
|
|
98
|
+
block: true,
|
|
99
|
+
className: "".concat(prefix, "-submit-btn"),
|
|
100
|
+
children: locale.activeSubmitBtn
|
|
101
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
102
|
+
className: "".concat(prefix, "-switch-btn"),
|
|
103
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
104
|
+
type: "link",
|
|
105
|
+
onClick: goBack,
|
|
106
|
+
children: locale.activeBackBtn
|
|
107
|
+
})
|
|
108
|
+
})]
|
|
109
|
+
}));
|
|
97
110
|
};
|
|
98
111
|
export default Activate;
|
package/es/Login/LoginForm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["loading", "locale", "errorMessage", "showAuthCode", "showOtherLoginButton", "authCodeImg", "otherLoginProps", "onAuthCodeImgChange"];
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
7
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -19,6 +20,8 @@ import React, { useState } from 'react';
|
|
|
19
20
|
import { token } from '@oceanbase/design';
|
|
20
21
|
import { getPrefix } from "../_util";
|
|
21
22
|
import "./index.less";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
25
|
var prefix = getPrefix('login');
|
|
23
26
|
var Login = function Login(_ref) {
|
|
24
27
|
var loading = _ref.loading,
|
|
@@ -34,109 +37,122 @@ var Login = function Login(_ref) {
|
|
|
34
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
38
|
focusInput = _useState2[0],
|
|
36
39
|
setFocusInput = _useState2[1];
|
|
37
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread({
|
|
38
41
|
layout: "vertical",
|
|
39
42
|
hideRequiredMark: true,
|
|
40
43
|
className: "".concat(prefix, "-form"),
|
|
41
44
|
style: {
|
|
42
45
|
paddingLeft: showAuthCode ? 96 : 0
|
|
43
46
|
}
|
|
44
|
-
}, restProps, {
|
|
45
|
-
"data-testid": "login.form"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
47
|
+
}, restProps), {}, {
|
|
48
|
+
"data-testid": "login.form",
|
|
49
|
+
children: [errorMessage && /*#__PURE__*/_jsx(Alert, {
|
|
50
|
+
type: "error",
|
|
51
|
+
showIcon: true,
|
|
52
|
+
className: "".concat(prefix, "-alert"),
|
|
53
|
+
message: errorMessage
|
|
54
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
55
|
+
name: "username",
|
|
56
|
+
rules: [{
|
|
57
|
+
required: true,
|
|
58
|
+
message: locale.usernameMessage
|
|
59
|
+
}],
|
|
60
|
+
children: /*#__PURE__*/_jsx(Input, {
|
|
61
|
+
prefix: /*#__PURE__*/_jsx(UserOutlined, {
|
|
62
|
+
style: {
|
|
63
|
+
color: token.colorIcon
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
placeholder: locale.usernamePlaceholder,
|
|
67
|
+
onFocus: function onFocus() {
|
|
68
|
+
setFocusInput('username');
|
|
69
|
+
},
|
|
70
|
+
onBlur: function onBlur() {
|
|
71
|
+
setFocusInput('');
|
|
72
|
+
},
|
|
73
|
+
className: classNames(_defineProperty({}, "".concat(prefix, "-focus-input"), focusInput === 'username'))
|
|
74
|
+
})
|
|
75
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
76
|
+
name: "password",
|
|
77
|
+
rules: [{
|
|
78
|
+
required: true,
|
|
79
|
+
message: locale.passwordMessage
|
|
80
|
+
}],
|
|
81
|
+
children: /*#__PURE__*/_jsx(Input.Password, {
|
|
82
|
+
visibilityToggle: true,
|
|
83
|
+
autoComplete: "current-password",
|
|
84
|
+
prefix: /*#__PURE__*/_jsx(LockOutlined, {
|
|
85
|
+
style: {
|
|
86
|
+
color: token.colorIcon
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
placeholder: locale.passwordPlaceholder,
|
|
90
|
+
onFocus: function onFocus() {
|
|
91
|
+
setFocusInput('password');
|
|
92
|
+
},
|
|
93
|
+
onBlur: function onBlur() {
|
|
94
|
+
setFocusInput('');
|
|
95
|
+
},
|
|
96
|
+
className: focusInput === 'password' ? "".concat(prefix, "-focus-input") : ''
|
|
97
|
+
})
|
|
98
|
+
}), showAuthCode && /*#__PURE__*/_jsxs(Space, {
|
|
99
|
+
className: "".concat(prefix, "-auth-code"),
|
|
100
|
+
children: [/*#__PURE__*/_jsx(Form.Item, {
|
|
101
|
+
name: "authCode",
|
|
102
|
+
rules: [{
|
|
103
|
+
required: true,
|
|
104
|
+
message: '验证码不能为空'
|
|
105
|
+
}],
|
|
106
|
+
children: /*#__PURE__*/_jsx(Input, {
|
|
107
|
+
prefix: /*#__PURE__*/_jsx(SafetyCertificateOutlined, {
|
|
108
|
+
style: {
|
|
109
|
+
color: token.colorIcon
|
|
110
|
+
}
|
|
111
|
+
}),
|
|
112
|
+
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
113
|
+
onFocus: function onFocus() {
|
|
114
|
+
setFocusInput('authCode');
|
|
115
|
+
},
|
|
116
|
+
onBlur: function onBlur() {
|
|
117
|
+
setFocusInput('');
|
|
118
|
+
},
|
|
119
|
+
className: classNames(_defineProperty({}, "".concat(prefix, "-focus-input"), focusInput === 'authCode'))
|
|
120
|
+
})
|
|
121
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
122
|
+
className: classNames("".concat(prefix, "-code-btn")),
|
|
123
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
124
|
+
src: authCodeImg,
|
|
125
|
+
alt: "",
|
|
126
|
+
width: "96",
|
|
127
|
+
height: "38"
|
|
128
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
129
|
+
className: "".concat(prefix, "-code-mask"),
|
|
130
|
+
onClick: onAuthCodeImgChange,
|
|
131
|
+
children: /*#__PURE__*/_jsx(SyncOutlined, {})
|
|
132
|
+
})]
|
|
133
|
+
})]
|
|
134
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
135
|
+
children: /*#__PURE__*/_jsx(Button
|
|
136
|
+
// 按下回车键,即可触发点击事件
|
|
137
|
+
, {
|
|
138
|
+
htmlType: "submit",
|
|
139
|
+
loading: loading,
|
|
140
|
+
type: "primary",
|
|
141
|
+
block: true,
|
|
142
|
+
className: "".concat(prefix, "-submit-btn"),
|
|
143
|
+
children: locale.loginText
|
|
144
|
+
})
|
|
145
|
+
}), showOtherLoginButton && /*#__PURE__*/_jsx(Form.Item, {
|
|
146
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
147
|
+
htmlType: "button",
|
|
148
|
+
loading: otherLoginProps.loading,
|
|
149
|
+
type: "primary",
|
|
150
|
+
block: true,
|
|
151
|
+
onClick: otherLoginProps.onFinish,
|
|
152
|
+
className: "".concat(prefix, "-submit-btn"),
|
|
153
|
+
children: locale.otherLoginText
|
|
154
|
+
})
|
|
155
|
+
})]
|
|
156
|
+
}));
|
|
141
157
|
};
|
|
142
158
|
export default Login;
|