@oceanbase/ui 1.0.0-alpha.4 → 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Item.d.ts +6 -15
- package/es/Action/Item.js +85 -128
- package/es/Action/index.d.ts +6 -3
- package/es/BasicLayout/style/index.js +30 -18
- package/es/BatchOperationBar/index.d.ts +0 -1
- package/es/BatchOperationBar/index.js +17 -13
- package/es/BatchOperationBar/style/index.d.ts +10 -0
- package/es/BatchOperationBar/style/index.js +51 -0
- package/es/Boundary/Components/Code.js +11 -5
- package/es/Boundary/Components/Exception.js +85 -74
- package/es/Boundary/Components/Function.js +11 -5
- package/es/Boundary/index.d.ts +0 -1
- package/es/Boundary/index.js +0 -1
- package/es/Boundary/style/index.d.ts +10 -0
- package/es/Boundary/style/index.js +46 -0
- package/es/ContentWithIcon/index.d.ts +0 -1
- package/es/ContentWithIcon/index.js +29 -29
- package/es/ContentWithIcon/style/index.d.ts +10 -0
- package/es/ContentWithIcon/style/index.js +26 -0
- package/es/DateRanger/PickerPanel.js +5 -4
- package/es/DateRanger/Ranger.d.ts +0 -1
- package/es/DateRanger/Ranger.js +13 -8
- package/es/DateRanger/style/index.d.ts +10 -0
- package/es/DateRanger/style/index.js +126 -0
- package/es/Dialog/Anchor.d.ts +2 -10
- package/es/Dialog/Anchor.js +67 -96
- package/es/Dialog/index.d.ts +0 -1
- package/es/Dialog/index.js +537 -578
- package/es/Dialog/style/index.d.ts +10 -0
- package/es/Dialog/style/index.js +97 -0
- package/es/FullscreenBox/index.d.ts +0 -1
- package/es/FullscreenBox/index.js +46 -37
- package/es/FullscreenBox/style/index.d.ts +10 -0
- package/es/FullscreenBox/style/index.js +53 -0
- package/es/GraphToolbar/index.d.ts +0 -1
- package/es/GraphToolbar/index.js +19 -16
- package/es/GraphToolbar/style/index.d.ts +10 -0
- package/es/GraphToolbar/style/index.js +60 -0
- package/es/Highlight/DiffView/index.d.ts +0 -1
- package/es/Highlight/DiffView/index.js +5 -5
- package/es/Highlight/JsonView.d.ts +0 -1
- package/es/Highlight/JsonView.js +5 -5
- package/es/Highlight/index.d.ts +0 -1
- package/es/Highlight/index.js +23 -23
- package/es/Highlight/style/index.d.ts +10 -0
- package/es/Highlight/style/index.js +213 -0
- package/es/Login/ActivateForm.d.ts +0 -1
- package/es/Login/ActivateForm.js +12 -9
- package/es/Login/LoginForm.d.ts +0 -1
- package/es/Login/LoginForm.js +20 -15
- package/es/Login/RegisterForm.d.ts +0 -1
- package/es/Login/RegisterForm.js +14 -11
- package/es/Login/index.d.ts +0 -1
- package/es/Login/index.js +24 -22
- package/es/Login/style/index.d.ts +10 -0
- package/es/Login/style/index.js +182 -0
- package/es/NavMenu/index.d.ts +1 -2
- package/es/NavMenu/index.js +11 -8
- package/es/NavMenu/style/index.d.ts +10 -0
- package/es/NavMenu/style/index.js +47 -0
- package/es/Ranger/QuickPicker.js +8 -4
- package/es/Ranger/Ranger.d.ts +0 -1
- package/es/Ranger/Ranger.js +12 -9
- package/es/Ranger/style/index.d.ts +10 -0
- package/es/Ranger/style/index.js +44 -0
- package/es/SideTip/index.d.ts +0 -1
- package/es/SideTip/index.js +24 -22
- package/es/SideTip/style/index.d.ts +10 -0
- package/es/SideTip/style/index.js +162 -0
- package/es/TagSelect/Group.d.ts +6 -6
- package/es/TagSelect/Group.js +5 -3
- package/es/TagSelect/Item.js +5 -3
- package/es/TaskGraph/Graph/style/index.d.ts +10 -0
- package/es/TaskGraph/Graph/style/index.js +28 -0
- package/es/TaskGraph/Graph.d.ts +0 -1
- package/es/TaskGraph/Graph.js +26 -10
- package/es/TaskGraph/index.d.ts +0 -1
- package/es/TaskGraph/index.js +10 -7
- package/es/TaskGraph/style/index.d.ts +10 -0
- package/es/TaskGraph/style/index.js +102 -0
- package/es/Welcome/index.d.ts +0 -1
- package/es/Welcome/index.js +30 -26
- package/es/Welcome/step/style/index.d.ts +10 -0
- package/es/Welcome/step/style/index.js +44 -0
- package/es/Welcome/step.d.ts +0 -1
- package/es/Welcome/step.js +17 -14
- package/es/Welcome/style/index.d.ts +10 -0
- package/es/Welcome/style/index.js +141 -0
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/lib/Action/Item.d.ts +6 -15
- package/lib/Action/Item.js +66 -81
- package/lib/Action/index.d.ts +6 -3
- package/lib/BasicLayout/style/index.js +27 -18
- package/lib/BatchOperationBar/index.d.ts +0 -1
- package/lib/BatchOperationBar/index.js +54 -50
- package/lib/BatchOperationBar/style/index.d.ts +10 -0
- package/lib/BatchOperationBar/style/index.js +82 -0
- package/lib/Boundary/Components/Code.js +23 -17
- package/lib/Boundary/Components/Exception.js +40 -29
- package/lib/Boundary/Components/Function.js +18 -12
- package/lib/Boundary/index.d.ts +0 -1
- package/lib/Boundary/index.js +0 -1
- package/lib/Boundary/style/index.d.ts +10 -0
- package/lib/Boundary/style/index.js +74 -0
- package/lib/ContentWithIcon/index.d.ts +0 -1
- package/lib/ContentWithIcon/index.js +35 -32
- package/lib/ContentWithIcon/style/index.d.ts +10 -0
- package/lib/ContentWithIcon/style/index.js +57 -0
- package/lib/DateRanger/PickerPanel.js +2 -2
- package/lib/DateRanger/Ranger.d.ts +0 -1
- package/lib/DateRanger/Ranger.js +353 -348
- package/lib/DateRanger/style/index.d.ts +10 -0
- package/lib/DateRanger/style/index.js +195 -0
- package/lib/Dialog/Anchor.d.ts +2 -10
- package/lib/Dialog/Anchor.js +58 -60
- package/lib/Dialog/index.d.ts +0 -1
- package/lib/Dialog/index.js +446 -422
- package/lib/Dialog/style/index.d.ts +10 -0
- package/lib/Dialog/style/index.js +135 -0
- package/lib/FullscreenBox/index.d.ts +0 -1
- package/lib/FullscreenBox/index.js +47 -38
- package/lib/FullscreenBox/style/index.d.ts +10 -0
- package/lib/FullscreenBox/style/index.js +86 -0
- package/lib/GraphToolbar/index.d.ts +0 -1
- package/lib/GraphToolbar/index.js +69 -66
- package/lib/GraphToolbar/style/index.d.ts +10 -0
- package/lib/GraphToolbar/style/index.js +91 -0
- package/lib/Highlight/DiffView/index.d.ts +0 -1
- package/lib/Highlight/DiffView/index.js +3 -3
- package/lib/Highlight/JsonView.d.ts +0 -1
- package/lib/Highlight/JsonView.js +3 -3
- package/lib/Highlight/index.d.ts +0 -1
- package/lib/Highlight/index.js +32 -29
- package/lib/Highlight/style/index.d.ts +10 -0
- package/lib/Highlight/style/index.js +293 -0
- package/lib/Login/ActivateForm.d.ts +0 -1
- package/lib/Login/ActivateForm.js +17 -9
- package/lib/Login/LoginForm.d.ts +0 -1
- package/lib/Login/LoginForm.js +25 -13
- package/lib/Login/RegisterForm.d.ts +0 -1
- package/lib/Login/RegisterForm.js +17 -9
- package/lib/Login/index.d.ts +0 -1
- package/lib/Login/index.js +96 -94
- package/lib/Login/style/index.d.ts +10 -0
- package/lib/Login/style/index.js +267 -0
- package/lib/NavMenu/index.d.ts +1 -2
- package/lib/NavMenu/index.js +20 -17
- package/lib/NavMenu/style/index.d.ts +10 -0
- package/lib/NavMenu/style/index.js +78 -0
- package/lib/Ranger/QuickPicker.js +4 -2
- package/lib/Ranger/Ranger.d.ts +0 -1
- package/lib/Ranger/Ranger.js +48 -45
- package/lib/Ranger/style/index.d.ts +10 -0
- package/lib/Ranger/style/index.js +82 -0
- package/lib/SideTip/index.d.ts +0 -1
- package/lib/SideTip/index.js +46 -38
- package/lib/SideTip/style/index.d.ts +10 -0
- package/lib/SideTip/style/index.js +211 -0
- package/lib/TagSelect/Group.d.ts +6 -6
- package/lib/TagSelect/Group.js +3 -2
- package/lib/TagSelect/Item.js +3 -2
- package/lib/TaskGraph/Graph/style/index.d.ts +10 -0
- package/lib/TaskGraph/Graph/style/index.js +56 -0
- package/lib/TaskGraph/Graph.d.ts +0 -1
- package/lib/TaskGraph/Graph.js +16 -7
- package/lib/TaskGraph/index.d.ts +0 -1
- package/lib/TaskGraph/index.js +6 -5
- package/lib/TaskGraph/style/index.d.ts +10 -0
- package/lib/TaskGraph/style/index.js +143 -0
- package/lib/Welcome/index.d.ts +0 -1
- package/lib/Welcome/index.js +64 -59
- package/lib/Welcome/step/style/index.d.ts +10 -0
- package/lib/Welcome/step/style/index.js +74 -0
- package/lib/Welcome/step.d.ts +0 -1
- package/lib/Welcome/step.js +17 -13
- package/lib/Welcome/style/index.d.ts +10 -0
- package/lib/Welcome/style/index.js +188 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/package.json +4 -7
- package/es/BatchOperationBar/index.less +0 -46
- package/es/BatchOperationBar/index.less.d.ts +0 -15
- package/es/Boundary/index.less +0 -36
- package/es/ContentWithIcon/index.less +0 -21
- package/es/DateRanger/index.less +0 -180
- package/es/Dialog/index.less +0 -116
- package/es/FullscreenBox/index.less +0 -51
- package/es/GraphToolbar/index.less +0 -65
- package/es/Highlight/index.less +0 -381
- package/es/Login/index.less +0 -268
- package/es/NavMenu/index.less +0 -50
- package/es/Ranger/index.less +0 -57
- package/es/SideTip/index.less +0 -180
- package/es/TaskGraph/graph.less +0 -23
- package/es/TaskGraph/index.less +0 -117
- package/es/Welcome/index.less +0 -185
- package/es/index.less +0 -1
- package/es/variable.less +0 -54
- package/lib/BatchOperationBar/index.less +0 -46
- package/lib/BatchOperationBar/index.less.d.ts +0 -15
- package/lib/Boundary/index.less +0 -36
- package/lib/ContentWithIcon/index.less +0 -21
- package/lib/DateRanger/index.less +0 -180
- package/lib/Dialog/index.less +0 -116
- package/lib/FullscreenBox/index.less +0 -51
- package/lib/GraphToolbar/index.less +0 -65
- package/lib/Highlight/index.less +0 -381
- package/lib/Login/index.less +0 -268
- package/lib/NavMenu/index.less +0 -50
- package/lib/Ranger/index.less +0 -57
- package/lib/SideTip/index.less +0 -180
- package/lib/TaskGraph/graph.less +0 -23
- package/lib/TaskGraph/index.less +0 -117
- package/lib/Welcome/index.less +0 -185
- package/lib/index.less +0 -1
- package/lib/variable.less +0 -54
package/lib/Login/LoginForm.js
CHANGED
|
@@ -37,10 +37,7 @@ var import_design = require("@oceanbase/design");
|
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_react = require("react");
|
|
39
39
|
var import_design2 = require("@oceanbase/design");
|
|
40
|
-
var import_util = require("../_util");
|
|
41
|
-
var import_index = require("./index.less");
|
|
42
40
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
var prefix = (0, import_util.getPrefix)("login");
|
|
44
41
|
var Login = ({
|
|
45
42
|
loading,
|
|
46
43
|
locale,
|
|
@@ -54,6 +51,8 @@ var Login = ({
|
|
|
54
51
|
passwordOptional = false,
|
|
55
52
|
...restProps
|
|
56
53
|
}) => {
|
|
54
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_design2.ConfigProvider.ConfigContext);
|
|
55
|
+
const prefixCls = getPrefixCls("login");
|
|
57
56
|
const { token } = import_design2.theme.useToken();
|
|
58
57
|
const [focusInput, setFocusInput] = (0, import_react.useState)("");
|
|
59
58
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -61,12 +60,20 @@ var Login = ({
|
|
|
61
60
|
{
|
|
62
61
|
layout: "vertical",
|
|
63
62
|
hideRequiredMark: true,
|
|
64
|
-
className: `${
|
|
63
|
+
className: `${prefixCls}-form`,
|
|
65
64
|
style: { paddingLeft: showAuthCode ? 96 : 0 },
|
|
66
65
|
...restProps,
|
|
67
66
|
"data-testid": "login.form",
|
|
68
67
|
children: [
|
|
69
|
-
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
+
import_design.Alert,
|
|
70
|
+
{
|
|
71
|
+
type: "error",
|
|
72
|
+
showIcon: true,
|
|
73
|
+
className: `${prefixCls}-alert`,
|
|
74
|
+
message: errorMessage
|
|
75
|
+
}
|
|
76
|
+
),
|
|
70
77
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
78
|
import_design.Form.Item,
|
|
72
79
|
{
|
|
@@ -80,6 +87,7 @@ var Login = ({
|
|
|
80
87
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
88
|
import_design.Input,
|
|
82
89
|
{
|
|
90
|
+
size: "large",
|
|
83
91
|
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UserOutlined, { style: { color: token.colorIcon } }),
|
|
84
92
|
placeholder: locale.usernamePlaceholder,
|
|
85
93
|
onFocus: () => {
|
|
@@ -89,7 +97,7 @@ var Login = ({
|
|
|
89
97
|
setFocusInput("");
|
|
90
98
|
},
|
|
91
99
|
className: (0, import_classnames.default)({
|
|
92
|
-
[`${
|
|
100
|
+
[`${prefixCls}-form-focus-input`]: focusInput === "username"
|
|
93
101
|
}),
|
|
94
102
|
...(componentProps == null ? void 0 : componentProps.username) || {}
|
|
95
103
|
}
|
|
@@ -109,6 +117,7 @@ var Login = ({
|
|
|
109
117
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
118
|
import_design.Input.Password,
|
|
111
119
|
{
|
|
120
|
+
size: "large",
|
|
112
121
|
visibilityToggle: true,
|
|
113
122
|
autoComplete: "current-password",
|
|
114
123
|
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LockOutlined, { style: { color: token.colorIcon } }),
|
|
@@ -119,13 +128,13 @@ var Login = ({
|
|
|
119
128
|
onBlur: () => {
|
|
120
129
|
setFocusInput("");
|
|
121
130
|
},
|
|
122
|
-
className: focusInput === "password" ? `${
|
|
131
|
+
className: focusInput === "password" ? `${prefixCls}-form-focus-input` : "",
|
|
123
132
|
...(componentProps == null ? void 0 : componentProps.password) || {}
|
|
124
133
|
}
|
|
125
134
|
)
|
|
126
135
|
}
|
|
127
136
|
),
|
|
128
|
-
showAuthCode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${
|
|
137
|
+
showAuthCode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefixCls}-auth-code`, children: [
|
|
129
138
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
139
|
import_design.Form.Item,
|
|
131
140
|
{
|
|
@@ -139,6 +148,7 @@ var Login = ({
|
|
|
139
148
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
149
|
import_design.Input,
|
|
141
150
|
{
|
|
151
|
+
size: "large",
|
|
142
152
|
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SafetyCertificateOutlined, { style: { color: token.colorIcon } }),
|
|
143
153
|
placeholder: "请输入验证码",
|
|
144
154
|
onFocus: () => {
|
|
@@ -148,26 +158,27 @@ var Login = ({
|
|
|
148
158
|
setFocusInput("");
|
|
149
159
|
},
|
|
150
160
|
className: (0, import_classnames.default)({
|
|
151
|
-
[`${
|
|
161
|
+
[`${prefixCls}-form-focus-input`]: focusInput === "authCode"
|
|
152
162
|
}),
|
|
153
163
|
...(componentProps == null ? void 0 : componentProps.authCode) || {}
|
|
154
164
|
}
|
|
155
165
|
)
|
|
156
166
|
}
|
|
157
167
|
),
|
|
158
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(`${
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_classnames.default)(`${prefixCls}-code-btn`), children: [
|
|
159
169
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: authCodeImg, alt: "", width: "96", height: "38" }),
|
|
160
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-code-mask`, onClick: onAuthCodeImgChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SyncOutlined, {}) })
|
|
161
171
|
] })
|
|
162
172
|
] }),
|
|
163
173
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
174
|
import_design.Button,
|
|
165
175
|
{
|
|
166
176
|
htmlType: "submit",
|
|
177
|
+
size: "large",
|
|
167
178
|
loading,
|
|
168
179
|
type: "primary",
|
|
169
180
|
block: true,
|
|
170
|
-
className: `${
|
|
181
|
+
className: `${prefixCls}-submit-btn`,
|
|
171
182
|
children: locale.loginText
|
|
172
183
|
}
|
|
173
184
|
) }),
|
|
@@ -175,11 +186,12 @@ var Login = ({
|
|
|
175
186
|
import_design.Button,
|
|
176
187
|
{
|
|
177
188
|
htmlType: "button",
|
|
189
|
+
size: "large",
|
|
178
190
|
loading: otherLoginProps.loading,
|
|
179
191
|
type: "primary",
|
|
180
192
|
block: true,
|
|
181
193
|
onClick: otherLoginProps.onFinish,
|
|
182
|
-
className: `${
|
|
194
|
+
className: `${prefixCls}-submit-btn`,
|
|
183
195
|
children: locale.otherLoginText
|
|
184
196
|
}
|
|
185
197
|
) })
|
|
@@ -26,11 +26,8 @@ module.exports = __toCommonJS(RegisterForm_exports);
|
|
|
26
26
|
var import_design = require("@oceanbase/design");
|
|
27
27
|
var import_lodash = require("lodash");
|
|
28
28
|
var import_react = require("react");
|
|
29
|
-
var import_util = require("../_util");
|
|
30
|
-
var import_index = require("./index.less");
|
|
31
29
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
30
|
var PASSWORD_REGEX = /^(?=(.*[a-z]){2,})(?=(.*[A-Z]){2,})(?=(.*\d){2,})(?=(.*[ !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]){2,})[A-Za-z\d !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]{8,32}$/;
|
|
33
|
-
var prefix = (0, import_util.getPrefix)("login");
|
|
34
31
|
var Register = ({
|
|
35
32
|
isUserExists,
|
|
36
33
|
locale,
|
|
@@ -39,6 +36,8 @@ var Register = ({
|
|
|
39
36
|
errorMessage,
|
|
40
37
|
...restProps
|
|
41
38
|
}) => {
|
|
39
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
40
|
+
const prefixCls = getPrefixCls("login");
|
|
42
41
|
const [form] = import_design.Form.useForm();
|
|
43
42
|
const handleValidateAccount = (0, import_react.useCallback)(
|
|
44
43
|
async (rule, value) => {
|
|
@@ -76,12 +75,20 @@ var Register = ({
|
|
|
76
75
|
{
|
|
77
76
|
layout: "vertical",
|
|
78
77
|
requiredMark: false,
|
|
79
|
-
className: `${
|
|
78
|
+
className: `${prefixCls}-form`,
|
|
80
79
|
form,
|
|
81
80
|
...restProps,
|
|
82
81
|
"data-testid": "login.register",
|
|
83
82
|
children: [
|
|
84
|
-
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
import_design.Alert,
|
|
85
|
+
{
|
|
86
|
+
type: "error",
|
|
87
|
+
showIcon: true,
|
|
88
|
+
className: `${prefixCls}-alert`,
|
|
89
|
+
message: errorMessage
|
|
90
|
+
}
|
|
91
|
+
),
|
|
85
92
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
93
|
import_design.Form.Item,
|
|
87
94
|
{
|
|
@@ -108,7 +115,7 @@ var Register = ({
|
|
|
108
115
|
validator: handleValidateAccount
|
|
109
116
|
}
|
|
110
117
|
],
|
|
111
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input, { autoComplete: "new-account", autoFocus: true })
|
|
118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input, { size: "large", autoComplete: "new-account", autoFocus: true })
|
|
112
119
|
}
|
|
113
120
|
),
|
|
114
121
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -126,7 +133,7 @@ var Register = ({
|
|
|
126
133
|
},
|
|
127
134
|
passwordRegexpRule
|
|
128
135
|
],
|
|
129
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { visibilityToggle: true, autoComplete: "new-password" })
|
|
136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { size: "large", visibilityToggle: true, autoComplete: "new-password" })
|
|
130
137
|
}
|
|
131
138
|
),
|
|
132
139
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -145,17 +152,18 @@ var Register = ({
|
|
|
145
152
|
validator: handleValidateConfirmPassword
|
|
146
153
|
}
|
|
147
154
|
],
|
|
148
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { visibilityToggle: true, autoComplete: "new-password" })
|
|
155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Input.Password, { size: "large", visibilityToggle: true, autoComplete: "new-password" })
|
|
149
156
|
}
|
|
150
157
|
),
|
|
151
158
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
159
|
import_design.Button,
|
|
153
160
|
{
|
|
154
161
|
htmlType: "submit",
|
|
162
|
+
size: "large",
|
|
155
163
|
loading,
|
|
156
164
|
type: "primary",
|
|
157
165
|
block: true,
|
|
158
|
-
className: `${
|
|
166
|
+
className: `${prefixCls}-submit-btn`,
|
|
159
167
|
children: locale.registerBtn
|
|
160
168
|
}
|
|
161
169
|
)
|
package/lib/Login/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { IActivateFormProps } from './ActivateForm';
|
|
|
5
5
|
import type { ILoginFormProps } from './LoginForm';
|
|
6
6
|
import type { IRegisterFormProps } from './RegisterForm';
|
|
7
7
|
import type { Locale } from '../interface';
|
|
8
|
-
import './index.less';
|
|
9
8
|
export interface Values {
|
|
10
9
|
username: string;
|
|
11
10
|
password: string;
|
package/lib/Login/index.js
CHANGED
|
@@ -38,7 +38,6 @@ var import_design2 = require("@oceanbase/design");
|
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
39
|
var import_react = require("react");
|
|
40
40
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
41
|
-
var import_util = require("../_util");
|
|
42
41
|
var import_ActivateForm = __toESM(require("./ActivateForm"));
|
|
43
42
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
44
43
|
var import_LoginForm = __toESM(require("./LoginForm"));
|
|
@@ -46,9 +45,8 @@ var import_RegisterForm = __toESM(require("./RegisterForm"));
|
|
|
46
45
|
var import_oceanbase_logo = __toESM(require("../assets/logo/oceanbase_logo.svg"));
|
|
47
46
|
var import_oceanbase_logo_dark = __toESM(require("../assets/logo/oceanbase_logo_dark.svg"));
|
|
48
47
|
var import_LocaleDropdown = __toESM(require("../LocaleDropdown"));
|
|
49
|
-
var
|
|
48
|
+
var import_style = __toESM(require("./style"));
|
|
50
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
|
-
var prefix = (0, import_util.getPrefix)("login");
|
|
52
50
|
var Login = (props) => {
|
|
53
51
|
const {
|
|
54
52
|
logo,
|
|
@@ -72,6 +70,9 @@ var Login = (props) => {
|
|
|
72
70
|
isMobile,
|
|
73
71
|
style = {}
|
|
74
72
|
} = props;
|
|
73
|
+
const { getPrefixCls, theme } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
74
|
+
const prefixCls = getPrefixCls("login");
|
|
75
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
75
76
|
const [showRegister, setShowRegister] = (0, import_ahooks.useControllableValue)(props, {
|
|
76
77
|
defaultValue: false,
|
|
77
78
|
valuePropName: "showRegister",
|
|
@@ -83,7 +84,6 @@ var Login = (props) => {
|
|
|
83
84
|
trigger: "onShowActivateChange"
|
|
84
85
|
});
|
|
85
86
|
const isLoading = (loginProps == null ? void 0 : loginProps.loading) || (registerProps == null ? void 0 : registerProps.loading) || (otherLoginProps == null ? void 0 : otherLoginProps.loading);
|
|
86
|
-
const { theme } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
87
87
|
const switchForm = (0, import_react.useCallback)(() => {
|
|
88
88
|
if (isLoading) {
|
|
89
89
|
import_design2.message.warning(locale.isLoadingWarn);
|
|
@@ -97,102 +97,104 @@ var Login = (props) => {
|
|
|
97
97
|
setShowActivate(!showActivate);
|
|
98
98
|
}, [showActivate, isLoading]);
|
|
99
99
|
const showWaterMark = !showRegister;
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
100
|
+
return wrapSSR(
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.App, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
className: (0, import_classnames.default)(`${prefixCls}-container`, {
|
|
105
|
+
[`${prefixCls}-container-with-board`]: board,
|
|
106
|
+
[`${prefixCls}-container-mobile`]: isMobile
|
|
107
|
+
}),
|
|
108
|
+
style,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-bg`, style: { backgroundImage: `url(${bgImage})` }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-info`, children: [
|
|
111
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-welcome`, children: title }),
|
|
112
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-start`, children: description })
|
|
113
|
+
] }) }),
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-card`, children: [
|
|
115
|
+
showLocale && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LocaleDropdown.default, { locales, className: `${prefixCls}-locale` }),
|
|
116
|
+
board && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-board`, children: board }),
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-content`, children: [
|
|
118
|
+
showActivate ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefixCls}-activate-logo` }),
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
+
import_design.Divider,
|
|
122
|
+
{
|
|
123
|
+
style: {
|
|
124
|
+
marginTop: 14,
|
|
125
|
+
marginBottom: 20
|
|
126
|
+
}
|
|
125
127
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.activeTitle }),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Paragraph, { children: locale.activeTitleDescrition }),
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
+
import_ActivateForm.default,
|
|
133
|
+
{
|
|
134
|
+
...activateFormProps,
|
|
135
|
+
locale,
|
|
136
|
+
errorMessage: alertProps == null ? void 0 : alertProps.message,
|
|
137
|
+
goBack
|
|
147
138
|
}
|
|
148
|
-
|
|
149
|
-
),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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",
|
|
139
|
+
)
|
|
140
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: showRegister ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefixCls}-reigster-logo` }),
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
|
+
import_design.Divider,
|
|
144
|
+
{
|
|
145
|
+
style: {
|
|
146
|
+
marginTop: 14,
|
|
147
|
+
marginBottom: 20
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Title, { level: 3, children: locale.registerTitle }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
+
import_RegisterForm.default,
|
|
154
|
+
{
|
|
155
|
+
...registerProps,
|
|
156
|
+
locale,
|
|
157
|
+
errorMessage: alertProps == null ? void 0 : alertProps.message
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo, alt: "", className: `${prefixCls}-logo` }),
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
+
import_LoginForm.default,
|
|
183
164
|
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
165
|
+
...loginProps,
|
|
166
|
+
otherLoginProps,
|
|
167
|
+
locale,
|
|
168
|
+
errorMessage: alertProps == null ? void 0 : alertProps.message,
|
|
169
|
+
showAuthCode,
|
|
170
|
+
showOtherLoginButton,
|
|
171
|
+
authCodeImg,
|
|
172
|
+
onAuthCodeImgChange
|
|
187
173
|
}
|
|
188
174
|
)
|
|
189
|
-
}
|
|
190
|
-
|
|
175
|
+
] }) }),
|
|
176
|
+
!!enableRegister && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-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 }) }),
|
|
177
|
+
showWaterMark ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
className: `${prefixCls}-watermark-wrapper`,
|
|
181
|
+
style: { paddingLeft: showAuthCode ? 96 : 0 },
|
|
182
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
183
|
+
"img",
|
|
184
|
+
{
|
|
185
|
+
src: (theme == null ? void 0 : theme.isDark) ? import_oceanbase_logo_dark.default : import_oceanbase_logo.default,
|
|
186
|
+
alt: "",
|
|
187
|
+
className: `${prefixCls}-watermark`
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
) : null
|
|
192
|
+
] })
|
|
191
193
|
] })
|
|
192
|
-
]
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
)
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
) })
|
|
197
|
+
);
|
|
196
198
|
};
|
|
197
199
|
var Login_default = (0, import_LocaleWrapper.default)({
|
|
198
200
|
componentName: "Login",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
|
+
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
+
export type LoginToken = OBToken;
|
|
5
|
+
export declare const genLoginStyle: GenerateStyle<LoginToken>;
|
|
6
|
+
declare const _default: (prefixCls: string) => {
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
8
|
+
hashId: string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|