@oceanbase/ui 0.4.19 → 0.4.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.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.js +121 -15
- package/es/Action/style/index.js +8 -4
- package/es/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/es/BasicLayout/locale/ja-JP.js +12 -0
- package/es/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/es/BatchOperationBar/locale/ja-JP.js +6 -0
- package/es/Boundary/locale/ja-JP.d.ts +11 -0
- package/es/Boundary/locale/ja-JP.js +10 -0
- package/es/DateRanger/Ranger.d.ts +4 -0
- package/es/DateRanger/Ranger.js +158 -14
- package/es/DateRanger/constant/index.js +1 -1
- package/es/DateRanger/index.less +23 -0
- package/es/DateRanger/locale/ja-JP.d.ts +56 -0
- package/es/DateRanger/locale/ja-JP.js +20 -0
- package/es/Dialog/locale/ja-JP.d.ts +5 -0
- package/es/Dialog/locale/ja-JP.js +4 -0
- package/es/DocDialog/locale/ja-JP.d.ts +2 -0
- package/es/DocDialog/locale/ja-JP.js +1 -0
- package/es/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/es/FullscreenBox/locale/ja-JP.js +1 -0
- package/es/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/es/GraphToolbar/locale/ja-JP.js +8 -0
- package/es/Highlight/locale/ja-JP.d.ts +4 -0
- package/es/Highlight/locale/ja-JP.js +3 -0
- package/es/Login/locale/ja-JP.d.ts +28 -0
- package/es/Login/locale/ja-JP.js +27 -0
- package/es/PageContainer/locale/ja-JP.d.ts +4 -0
- package/es/PageContainer/locale/ja-JP.js +3 -0
- package/es/Password/locale/ja-JP.d.ts +13 -0
- package/es/Password/locale/ja-JP.js +12 -0
- package/es/ProTable/index.js +4 -1
- package/es/Ranger/locale/ja-JP.d.ts +28 -0
- package/es/Ranger/locale/ja-JP.js +29 -0
- package/es/SideTip/locale/ja-JP.d.ts +2 -0
- package/es/SideTip/locale/ja-JP.js +1 -0
- package/es/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/es/TaskGraph/locale/ja-JP.js +12 -0
- package/es/Welcome/locale/ja-JP.d.ts +5 -0
- package/es/Welcome/locale/ja-JP.js +4 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +42 -0
- package/lib/Action/Group.js +122 -46
- package/lib/Action/Item.js +14 -9
- package/lib/Action/style/index.js +16 -1
- package/lib/BackgroundTaskManager/RefreshMan.js +3 -12
- package/lib/BackgroundTaskManager/index.js +3 -12
- package/lib/BasicLayout/Header.js +120 -62
- package/lib/BasicLayout/index.js +166 -143
- package/lib/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/lib/BasicLayout/locale/ja-JP.js +36 -0
- package/lib/BatchOperationBar/index.js +59 -44
- package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/lib/BatchOperationBar/locale/ja-JP.js +30 -0
- package/lib/Boundary/Components/Code.js +11 -5
- package/lib/Boundary/Components/Exception.js +33 -23
- package/lib/Boundary/Components/Function.js +11 -5
- package/lib/Boundary/locale/ja-JP.d.ts +11 -0
- package/lib/Boundary/locale/ja-JP.js +34 -0
- package/lib/ContentWithIcon/index.js +30 -22
- package/lib/ContentWithQuestion/index.js +8 -3
- package/lib/DateRanger/PickerPanel.js +235 -217
- package/lib/DateRanger/Ranger.d.ts +4 -0
- package/lib/DateRanger/Ranger.js +396 -227
- package/lib/DateRanger/constant/index.js +1 -1
- package/lib/DateRanger/index.less +23 -0
- package/lib/DateRanger/locale/ja-JP.d.ts +56 -0
- package/lib/DateRanger/locale/ja-JP.js +49 -0
- package/lib/Dialog/Anchor.js +8 -5
- package/lib/Dialog/EventProxy.js +3 -12
- package/lib/Dialog/index.js +132 -108
- package/lib/Dialog/locale/ja-JP.d.ts +5 -0
- package/lib/Dialog/locale/ja-JP.js +28 -0
- package/lib/DocDialog/index.js +3 -2
- package/lib/DocDialog/locale/ja-JP.d.ts +2 -0
- package/lib/DocDialog/locale/ja-JP.js +25 -0
- package/lib/FooterToolbar/index.js +3 -2
- package/lib/FullscreenBox/index.js +16 -7
- package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/lib/FullscreenBox/locale/ja-JP.js +25 -0
- package/lib/GraphToolbar/index.js +70 -58
- package/lib/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/lib/GraphToolbar/locale/ja-JP.js +32 -0
- package/lib/Highlight/DiffView/DiffCells.js +17 -10
- package/lib/Highlight/DiffView/index.js +35 -31
- package/lib/Highlight/HighlightCell.js +13 -10
- package/lib/Highlight/JsonView.js +15 -14
- package/lib/Highlight/index.js +50 -45
- package/lib/Highlight/locale/ja-JP.d.ts +4 -0
- package/lib/Highlight/locale/ja-JP.js +27 -0
- package/lib/IconFont/index.js +2 -12
- package/lib/LightFilter/index.js +3 -2
- package/lib/LocaleDropdown/index.js +13 -20
- package/lib/Login/ActivateForm.js +53 -60
- package/lib/Login/LoginForm.js +118 -109
- package/lib/Login/RegisterForm.js +79 -86
- package/lib/Login/index.js +92 -64
- package/lib/Login/locale/ja-JP.d.ts +28 -0
- package/lib/Login/locale/ja-JP.js +51 -0
- package/lib/NavMenu/index.js +9 -8
- package/lib/PageContainer/ItemRender.js +5 -5
- package/lib/PageContainer/index.js +8 -4
- package/lib/PageContainer/locale/ja-JP.d.ts +4 -0
- package/lib/PageContainer/locale/ja-JP.js +27 -0
- package/lib/PageLoading/index.js +6 -16
- package/lib/Password/Content.js +38 -42
- package/lib/Password/index.js +83 -68
- package/lib/Password/locale/ja-JP.d.ts +13 -0
- package/lib/Password/locale/ja-JP.js +36 -0
- package/lib/ProCard/index.js +4 -3
- package/lib/ProTable/index.js +10 -5
- package/lib/Ranger/QuickPicker.js +24 -15
- package/lib/Ranger/Ranger.js +37 -34
- package/lib/Ranger/locale/ja-JP.d.ts +28 -0
- package/lib/Ranger/locale/ja-JP.js +53 -0
- package/lib/SideTip/Dragger.js +5 -4
- package/lib/SideTip/IconLoading.js +25 -25
- package/lib/SideTip/index.js +19 -10
- package/lib/SideTip/locale/ja-JP.d.ts +2 -0
- package/lib/SideTip/locale/ja-JP.js +25 -0
- package/lib/TagSelect/Group.js +9 -5
- package/lib/TagSelect/Item.js +22 -18
- package/lib/TaskGraph/Graph.js +29 -24
- package/lib/TaskGraph/index.js +56 -50
- package/lib/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/lib/TaskGraph/locale/ja-JP.js +36 -0
- package/lib/TreeSearch/index.js +30 -35
- package/lib/Welcome/index.js +64 -37
- package/lib/Welcome/locale/ja-JP.d.ts +5 -0
- package/lib/Welcome/locale/ja-JP.js +28 -0
- package/lib/Welcome/step.js +11 -4
- package/lib/locale/LocaleWrapper.js +15 -14
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +71 -0
- package/package.json +5 -5
package/lib/Login/LoginForm.js
CHANGED
|
@@ -35,10 +35,11 @@ module.exports = __toCommonJS(LoginForm_exports);
|
|
|
35
35
|
var import_icons = require("@oceanbase/icons");
|
|
36
36
|
var import_design = require("@oceanbase/design");
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
|
-
var import_react =
|
|
38
|
+
var import_react = require("react");
|
|
39
39
|
var import_design2 = require("@oceanbase/design");
|
|
40
40
|
var import_util = require("../_util");
|
|
41
41
|
var import_index = require("./index.less");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var prefix = (0, import_util.getPrefix)("login");
|
|
43
44
|
var Login = ({
|
|
44
45
|
loading,
|
|
@@ -55,7 +56,7 @@ var Login = ({
|
|
|
55
56
|
}) => {
|
|
56
57
|
const { token } = import_design2.theme.useToken();
|
|
57
58
|
const [focusInput, setFocusInput] = (0, import_react.useState)("");
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
59
60
|
import_design.Form,
|
|
60
61
|
{
|
|
61
62
|
layout: "vertical",
|
|
@@ -63,119 +64,127 @@ var Login = ({
|
|
|
63
64
|
className: `${prefix}-form`,
|
|
64
65
|
style: { paddingLeft: showAuthCode ? 96 : 0 },
|
|
65
66
|
...restProps,
|
|
66
|
-
"data-testid": "login.form"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
name: "username",
|
|
73
|
-
rules: [
|
|
67
|
+
"data-testid": "login.form",
|
|
68
|
+
children: [
|
|
69
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Alert, { type: "error", showIcon: true, className: `${prefix}-alert`, message: errorMessage }),
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
import_design.Form.Item,
|
|
74
72
|
{
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
name: "username",
|
|
74
|
+
rules: [
|
|
75
|
+
{
|
|
76
|
+
required: true,
|
|
77
|
+
message: locale.usernameMessage
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_design.Input,
|
|
82
|
+
{
|
|
83
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UserOutlined, { style: { color: token.colorIcon } }),
|
|
84
|
+
placeholder: locale.usernamePlaceholder,
|
|
85
|
+
onFocus: () => {
|
|
86
|
+
setFocusInput("username");
|
|
87
|
+
},
|
|
88
|
+
onBlur: () => {
|
|
89
|
+
setFocusInput("");
|
|
90
|
+
},
|
|
91
|
+
className: (0, import_classnames.default)({
|
|
92
|
+
[`${prefix}-focus-input`]: focusInput === "username"
|
|
93
|
+
}),
|
|
94
|
+
...(componentProps == null ? void 0 : componentProps.username) || {}
|
|
95
|
+
}
|
|
96
|
+
)
|
|
77
97
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
import_design.Input,
|
|
82
|
-
{
|
|
83
|
-
prefix: /* @__PURE__ */ import_react.default.createElement(import_icons.UserOutlined, { style: { color: token.colorIcon } }),
|
|
84
|
-
placeholder: locale.usernamePlaceholder,
|
|
85
|
-
onFocus: () => {
|
|
86
|
-
setFocusInput("username");
|
|
87
|
-
},
|
|
88
|
-
onBlur: () => {
|
|
89
|
-
setFocusInput("");
|
|
90
|
-
},
|
|
91
|
-
className: (0, import_classnames.default)({
|
|
92
|
-
[`${prefix}-focus-input`]: focusInput === "username"
|
|
93
|
-
}),
|
|
94
|
-
...(componentProps == null ? void 0 : componentProps.username) || {}
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
),
|
|
98
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
99
|
-
import_design.Form.Item,
|
|
100
|
-
{
|
|
101
|
-
name: "password",
|
|
102
|
-
rules: passwordOptional ? [] : [
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
|
+
import_design.Form.Item,
|
|
103
101
|
{
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
name: "password",
|
|
103
|
+
rules: passwordOptional ? [] : [
|
|
104
|
+
{
|
|
105
|
+
required: true,
|
|
106
|
+
message: locale.passwordMessage
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
import_design.Input.Password,
|
|
111
|
+
{
|
|
112
|
+
visibilityToggle: true,
|
|
113
|
+
autoComplete: "current-password",
|
|
114
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LockOutlined, { style: { color: token.colorIcon } }),
|
|
115
|
+
placeholder: locale.passwordPlaceholder,
|
|
116
|
+
onFocus: () => {
|
|
117
|
+
setFocusInput("password");
|
|
118
|
+
},
|
|
119
|
+
onBlur: () => {
|
|
120
|
+
setFocusInput("");
|
|
121
|
+
},
|
|
122
|
+
className: focusInput === "password" ? `${prefix}-focus-input` : "",
|
|
123
|
+
...(componentProps == null ? void 0 : componentProps.password) || {}
|
|
124
|
+
}
|
|
125
|
+
)
|
|
106
126
|
}
|
|
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
|
-
|
|
127
|
+
),
|
|
128
|
+
showAuthCode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefix}-auth-code`, children: [
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
import_design.Form.Item,
|
|
131
|
+
{
|
|
132
|
+
name: "authCode",
|
|
133
|
+
rules: [
|
|
134
|
+
{
|
|
135
|
+
required: true,
|
|
136
|
+
message: "验证码不能为空"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
+
import_design.Input,
|
|
141
|
+
{
|
|
142
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SafetyCertificateOutlined, { style: { color: token.colorIcon } }),
|
|
143
|
+
placeholder: "请输入验证码",
|
|
144
|
+
onFocus: () => {
|
|
145
|
+
setFocusInput("authCode");
|
|
146
|
+
},
|
|
147
|
+
onBlur: () => {
|
|
148
|
+
setFocusInput("");
|
|
149
|
+
},
|
|
150
|
+
className: (0, import_classnames.default)({
|
|
151
|
+
[`${prefix}-focus-input`]: focusInput === "authCode"
|
|
152
|
+
}),
|
|
153
|
+
...(componentProps == null ? void 0 : componentProps.authCode) || {}
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(`${prefix}-code-btn`), children: [
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: authCodeImg, alt: "", width: "96", height: "38" }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-code-mask`, onClick: onAuthCodeImgChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SyncOutlined, {}) })
|
|
161
|
+
] })
|
|
162
|
+
] }),
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
|
+
import_design.Button,
|
|
132
165
|
{
|
|
133
|
-
|
|
134
|
-
|
|
166
|
+
htmlType: "submit",
|
|
167
|
+
loading,
|
|
168
|
+
type: "primary",
|
|
169
|
+
block: true,
|
|
170
|
+
className: `${prefix}-submit-btn`,
|
|
171
|
+
children: locale.loginText
|
|
135
172
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}),
|
|
152
|
-
...(componentProps == null ? void 0 : componentProps.authCode) || {}
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${prefix}-code-btn`) }, /* @__PURE__ */ import_react.default.createElement("img", { src: authCodeImg, alt: "", width: "96", height: "38" }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-code-mask`, onClick: onAuthCodeImgChange }, /* @__PURE__ */ import_react.default.createElement(import_icons.SyncOutlined, null)))),
|
|
156
|
-
/* @__PURE__ */ import_react.default.createElement(import_design.Form.Item, null, /* @__PURE__ */ import_react.default.createElement(
|
|
157
|
-
import_design.Button,
|
|
158
|
-
{
|
|
159
|
-
htmlType: "submit",
|
|
160
|
-
loading,
|
|
161
|
-
type: "primary",
|
|
162
|
-
block: true,
|
|
163
|
-
className: `${prefix}-submit-btn`
|
|
164
|
-
},
|
|
165
|
-
locale.loginText
|
|
166
|
-
)),
|
|
167
|
-
showOtherLoginButton && /* @__PURE__ */ import_react.default.createElement(import_design.Form.Item, null, /* @__PURE__ */ import_react.default.createElement(
|
|
168
|
-
import_design.Button,
|
|
169
|
-
{
|
|
170
|
-
htmlType: "button",
|
|
171
|
-
loading: otherLoginProps.loading,
|
|
172
|
-
type: "primary",
|
|
173
|
-
block: true,
|
|
174
|
-
onClick: otherLoginProps.onFinish,
|
|
175
|
-
className: `${prefix}-submit-btn`
|
|
176
|
-
},
|
|
177
|
-
locale.otherLoginText
|
|
178
|
-
))
|
|
173
|
+
) }),
|
|
174
|
+
showOtherLoginButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
+
import_design.Button,
|
|
176
|
+
{
|
|
177
|
+
htmlType: "button",
|
|
178
|
+
loading: otherLoginProps.loading,
|
|
179
|
+
type: "primary",
|
|
180
|
+
block: true,
|
|
181
|
+
onClick: otherLoginProps.onFinish,
|
|
182
|
+
className: `${prefix}-submit-btn`,
|
|
183
|
+
children: locale.otherLoginText
|
|
184
|
+
}
|
|
185
|
+
) })
|
|
186
|
+
]
|
|
187
|
+
}
|
|
179
188
|
);
|
|
180
189
|
};
|
|
181
190
|
var LoginForm_default = Login;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
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
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/Login/RegisterForm.tsx
|
|
@@ -35,9 +25,10 @@ __export(RegisterForm_exports, {
|
|
|
35
25
|
module.exports = __toCommonJS(RegisterForm_exports);
|
|
36
26
|
var import_design = require("@oceanbase/design");
|
|
37
27
|
var import_lodash = require("lodash");
|
|
38
|
-
var import_react =
|
|
28
|
+
var import_react = require("react");
|
|
39
29
|
var import_util = require("../_util");
|
|
40
30
|
var import_index = require("./index.less");
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
32
|
var PASSWORD_REGEX = /^(?=(.*[a-z]){2,})(?=(.*[A-Z]){2,})(?=(.*\d){2,})(?=(.*[ !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]){2,})[A-Za-z\d !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]{8,32}$/;
|
|
42
33
|
var prefix = (0, import_util.getPrefix)("login");
|
|
43
34
|
var Register = ({
|
|
@@ -80,7 +71,7 @@ var Register = ({
|
|
|
80
71
|
pattern: PASSWORD_REGEX,
|
|
81
72
|
message: locale.passwordHelp
|
|
82
73
|
};
|
|
83
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
84
75
|
import_design.Form,
|
|
85
76
|
{
|
|
86
77
|
layout: "vertical",
|
|
@@ -88,86 +79,88 @@ var Register = ({
|
|
|
88
79
|
className: `${prefix}-form`,
|
|
89
80
|
form,
|
|
90
81
|
...restProps,
|
|
91
|
-
"data-testid": "login.register"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
{
|
|
97
|
-
name: "username",
|
|
98
|
-
label: locale.usernameLabel,
|
|
99
|
-
extra: locale.usernameHelp,
|
|
100
|
-
validateFirst: true,
|
|
101
|
-
rules: [
|
|
102
|
-
{
|
|
103
|
-
required: true,
|
|
104
|
-
whitespace: true,
|
|
105
|
-
message: locale.usernameMessage
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
min: 4,
|
|
109
|
-
max: 48,
|
|
110
|
-
message: locale.usernameLengthMessage
|
|
111
|
-
},
|
|
82
|
+
"data-testid": "login.register",
|
|
83
|
+
children: [
|
|
84
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Alert, { type: "error", showIcon: true, className: `${prefix}-alert`, message: errorMessage }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
|
+
import_design.Form.Item,
|
|
112
87
|
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
88
|
+
name: "username",
|
|
89
|
+
label: locale.usernameLabel,
|
|
90
|
+
extra: locale.usernameHelp,
|
|
91
|
+
validateFirst: true,
|
|
92
|
+
rules: [
|
|
93
|
+
{
|
|
94
|
+
required: true,
|
|
95
|
+
whitespace: true,
|
|
96
|
+
message: locale.usernameMessage
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
min: 4,
|
|
100
|
+
max: 48,
|
|
101
|
+
message: locale.usernameLengthMessage
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
pattern: /^[a-zA-Z0-9_.+@#$%]+$/,
|
|
105
|
+
message: locale.usernameFormatMessage
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
validator: handleValidateAccount
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input, { autoComplete: "new-account", autoFocus: true })
|
|
118
112
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
),
|
|
123
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
124
|
-
import_design.Form.Item,
|
|
125
|
-
{
|
|
126
|
-
name: "password",
|
|
127
|
-
label: locale.passwordLabel,
|
|
128
|
-
dependencies: ["confirmPassword"],
|
|
129
|
-
help: passwordRegexpRule.message,
|
|
130
|
-
validateFirst: true,
|
|
131
|
-
rules: [
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
+
import_design.Form.Item,
|
|
132
116
|
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
117
|
+
name: "password",
|
|
118
|
+
label: locale.passwordLabel,
|
|
119
|
+
dependencies: ["confirmPassword"],
|
|
120
|
+
help: passwordRegexpRule.message,
|
|
121
|
+
validateFirst: true,
|
|
122
|
+
rules: [
|
|
123
|
+
{
|
|
124
|
+
required: true,
|
|
125
|
+
message: locale.passwordMessage
|
|
126
|
+
},
|
|
127
|
+
passwordRegexpRule
|
|
128
|
+
],
|
|
129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { visibilityToggle: true, autoComplete: "new-password" })
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
import_design.Form.Item,
|
|
149
134
|
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
135
|
+
name: "confirmPassword",
|
|
136
|
+
label: locale.confirmPwdLabel,
|
|
137
|
+
dependencies: ["password"],
|
|
138
|
+
validateFirst: true,
|
|
139
|
+
rules: [
|
|
140
|
+
{
|
|
141
|
+
required: true,
|
|
142
|
+
message: locale.confirmPwdMessage
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
validator: handleValidateConfirmPassword
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { visibilityToggle: true, autoComplete: "new-password" })
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
import_design.Button,
|
|
153
153
|
{
|
|
154
|
-
|
|
154
|
+
htmlType: "submit",
|
|
155
|
+
loading,
|
|
156
|
+
type: "primary",
|
|
157
|
+
block: true,
|
|
158
|
+
className: `${prefix}-submit-btn`,
|
|
159
|
+
children: locale.registerBtn
|
|
155
160
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
),
|
|
160
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
161
|
-
import_design.Button,
|
|
162
|
-
{
|
|
163
|
-
htmlType: "submit",
|
|
164
|
-
loading,
|
|
165
|
-
type: "primary",
|
|
166
|
-
block: true,
|
|
167
|
-
className: `${prefix}-submit-btn`
|
|
168
|
-
},
|
|
169
|
-
locale.registerBtn
|
|
170
|
-
)
|
|
161
|
+
)
|
|
162
|
+
]
|
|
163
|
+
}
|
|
171
164
|
);
|
|
172
165
|
};
|
|
173
166
|
var RegisterForm_default = Register;
|
package/lib/Login/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var import_ahooks = require("ahooks");
|
|
|
36
36
|
var import_design = require("@oceanbase/design");
|
|
37
37
|
var import_design2 = require("@oceanbase/design");
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
|
-
var import_react =
|
|
39
|
+
var import_react = require("react");
|
|
40
40
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
41
41
|
var import_util = require("../_util");
|
|
42
42
|
var import_ActivateForm = __toESM(require("./ActivateForm"));
|
|
@@ -47,6 +47,7 @@ var import_oceanbase_logo = __toESM(require("../assets/logo/oceanbase_logo.svg")
|
|
|
47
47
|
var import_oceanbase_logo_dark = __toESM(require("../assets/logo/oceanbase_logo_dark.svg"));
|
|
48
48
|
var import_LocaleDropdown = __toESM(require("../LocaleDropdown"));
|
|
49
49
|
var import_index = require("./index.less");
|
|
50
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
51
|
var prefix = (0, import_util.getPrefix)("login");
|
|
51
52
|
var Login = (props) => {
|
|
52
53
|
const {
|
|
@@ -96,75 +97,102 @@ var Login = (props) => {
|
|
|
96
97
|
setShowActivate(!showActivate);
|
|
97
98
|
}, [showActivate, isLoading]);
|
|
98
99
|
const showWaterMark = !showRegister;
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.App, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
100
101
|
"div",
|
|
101
102
|
{
|
|
102
103
|
className: (0, import_classnames.default)(`${prefix}-container`, {
|
|
103
104
|
[`${prefix}-container-with-board`]: board,
|
|
104
105
|
[`${prefix}-container-mobile`]: isMobile
|
|
105
106
|
}),
|
|
106
|
-
style
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
107
|
+
style,
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-bg`, style: { backgroundImage: `url(${bgImage})` }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-info`, children: [
|
|
110
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-welcome`, children: title }),
|
|
111
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-start`, children: description })
|
|
112
|
+
] }) }),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-card`, children: [
|
|
114
|
+
showLocale && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LocaleDropdown.default, { locales, className: `${prefix}-locale` }),
|
|
115
|
+
board && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-board`, children: board }),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-content`, children: [
|
|
117
|
+
showActivate ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefix}-activate-logo` }),
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
+
import_design.Divider,
|
|
121
|
+
{
|
|
122
|
+
style: {
|
|
123
|
+
marginTop: 14,
|
|
124
|
+
marginBottom: 20
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.activeTitle }),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Paragraph, { children: locale.activeTitleDescrition }),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
+
import_ActivateForm.default,
|
|
132
|
+
{
|
|
133
|
+
...activateFormProps,
|
|
134
|
+
locale,
|
|
135
|
+
errorMessage: alertProps == null ? void 0 : alertProps.message,
|
|
136
|
+
goBack
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: showRegister ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefix}-reigster-logo` }),
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
import_design.Divider,
|
|
143
|
+
{
|
|
144
|
+
style: {
|
|
145
|
+
marginTop: 14,
|
|
146
|
+
marginBottom: 20
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.registerTitle }),
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
import_RegisterForm.default,
|
|
153
|
+
{
|
|
154
|
+
...registerProps,
|
|
155
|
+
locale,
|
|
156
|
+
errorMessage: alertProps == null ? void 0 : alertProps.message
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefix}-logo` }),
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
162
|
+
import_LoginForm.default,
|
|
163
|
+
{
|
|
164
|
+
...loginProps,
|
|
165
|
+
otherLoginProps,
|
|
166
|
+
locale,
|
|
167
|
+
errorMessage: alertProps == null ? void 0 : alertProps.message,
|
|
168
|
+
showAuthCode,
|
|
169
|
+
showOtherLoginButton,
|
|
170
|
+
authCodeImg,
|
|
171
|
+
onAuthCodeImgChange
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] }) }),
|
|
175
|
+
!!enableRegister && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-switch-btn`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { type: "link", onClick: switchForm, "data-testid": "login.register.btn", children: showRegister ? locale.switchLoginLabel : locale.switchRegisterLabel }) }),
|
|
176
|
+
showWaterMark ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
className: `${prefix}-watermark-wrapper`,
|
|
180
|
+
style: { paddingLeft: showAuthCode ? 96 : 0 },
|
|
181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
|
+
"img",
|
|
183
|
+
{
|
|
184
|
+
src: (theme == null ? void 0 : theme.isDark) ? import_oceanbase_logo_dark.default : import_oceanbase_logo.default,
|
|
185
|
+
alt: "",
|
|
186
|
+
className: `${prefix}-watermark`
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
) : null
|
|
191
|
+
] })
|
|
192
|
+
] })
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
) });
|
|
168
196
|
};
|
|
169
197
|
var Login_default = (0, import_LocaleWrapper.default)({
|
|
170
198
|
componentName: "Login",
|