@refinedev/antd 5.36.18 → 5.37.0
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/CHANGELOG.md +25 -0
- package/README.md +15 -29
- package/dist/components/autoSaveIndicator/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/forgotPassword/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/login/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/register/index.d.ts.map +1 -1
- package/dist/components/pages/auth/components/updatePassword/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/iife/index.js +30 -49
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/autoSaveIndicator/index.tsx +58 -26
- package/src/components/pages/auth/components/forgotPassword/index.tsx +4 -3
- package/src/components/pages/auth/components/login/index.tsx +121 -103
- package/src/components/pages/auth/components/register/index.tsx +129 -93
- package/src/components/pages/auth/components/updatePassword/index.tsx +4 -3
- package/src/components/undoableNotification/index.tsx +1 -1
- package/src/hooks/import/index.tsx +1 -1
@@ -30,7 +30,7 @@ import {
|
|
30
30
|
headStyles,
|
31
31
|
bodyStyles,
|
32
32
|
} from "../styles";
|
33
|
-
import {
|
33
|
+
import { ThemedTitleV2 } from "@components";
|
34
34
|
|
35
35
|
const { Text, Title } = Typography;
|
36
36
|
const { useToken } = theme;
|
@@ -49,6 +49,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
49
49
|
renderContent,
|
50
50
|
formProps,
|
51
51
|
title,
|
52
|
+
hideForm,
|
52
53
|
}) => {
|
53
54
|
const { token } = useToken();
|
54
55
|
const [form] = Form.useForm<RegisterFormTypes>();
|
@@ -74,7 +75,7 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
74
75
|
fontSize: "20px",
|
75
76
|
}}
|
76
77
|
>
|
77
|
-
{title ?? <
|
78
|
+
{title ?? <ThemedTitleV2 collapsed={false} />}
|
78
79
|
</div>
|
79
80
|
);
|
80
81
|
|
@@ -118,15 +119,17 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
118
119
|
</Button>
|
119
120
|
);
|
120
121
|
})}
|
121
|
-
|
122
|
-
<
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
122
|
+
{!hideForm && (
|
123
|
+
<Divider>
|
124
|
+
<Text
|
125
|
+
style={{
|
126
|
+
color: token.colorTextLabel,
|
127
|
+
}}
|
128
|
+
>
|
129
|
+
{translate("pages.login.divider", "or")}
|
130
|
+
</Text>
|
131
|
+
</Divider>
|
132
|
+
)}
|
130
133
|
</>
|
131
134
|
);
|
132
135
|
}
|
@@ -145,96 +148,127 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
145
148
|
{...(contentProps ?? {})}
|
146
149
|
>
|
147
150
|
{renderProviders()}
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
<Form.Item
|
156
|
-
name="email"
|
157
|
-
label={translate("pages.register.email", "Email")}
|
158
|
-
rules={[
|
159
|
-
{ required: true },
|
160
|
-
{
|
161
|
-
type: "email",
|
162
|
-
message: translate(
|
163
|
-
"pages.register.errors.validEmail",
|
164
|
-
"Invalid email address",
|
165
|
-
),
|
166
|
-
},
|
167
|
-
]}
|
151
|
+
{!hideForm && (
|
152
|
+
<Form<RegisterFormTypes>
|
153
|
+
layout="vertical"
|
154
|
+
form={form}
|
155
|
+
onFinish={(values) => register(values)}
|
156
|
+
requiredMark={false}
|
157
|
+
{...formProps}
|
168
158
|
>
|
169
|
-
<
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
159
|
+
<Form.Item
|
160
|
+
name="email"
|
161
|
+
label={translate("pages.register.email", "Email")}
|
162
|
+
rules={[
|
163
|
+
{ required: true },
|
164
|
+
{
|
165
|
+
type: "email",
|
166
|
+
message: translate(
|
167
|
+
"pages.register.errors.validEmail",
|
168
|
+
"Invalid email address",
|
169
|
+
),
|
170
|
+
},
|
171
|
+
]}
|
172
|
+
>
|
173
|
+
<Input
|
174
|
+
size="large"
|
175
|
+
placeholder={translate(
|
176
|
+
"pages.register.fields.email",
|
177
|
+
"Email",
|
178
|
+
)}
|
179
|
+
/>
|
180
|
+
</Form.Item>
|
181
|
+
<Form.Item
|
182
|
+
name="password"
|
183
|
+
label={translate(
|
184
|
+
"pages.register.fields.password",
|
185
|
+
"Password",
|
174
186
|
)}
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
187
|
+
rules={[{ required: true }]}
|
188
|
+
>
|
189
|
+
<Input
|
190
|
+
type="password"
|
191
|
+
placeholder="●●●●●●●●"
|
192
|
+
size="large"
|
193
|
+
/>
|
194
|
+
</Form.Item>
|
195
|
+
<div
|
196
|
+
style={{
|
197
|
+
display: "flex",
|
198
|
+
justifyContent: "space-between",
|
199
|
+
marginBottom: "24px",
|
200
|
+
}}
|
201
|
+
>
|
202
|
+
{loginLink ?? (
|
203
|
+
<Text
|
204
|
+
style={{
|
205
|
+
fontSize: 12,
|
206
|
+
marginLeft: "auto",
|
207
|
+
}}
|
208
|
+
>
|
209
|
+
{translate(
|
210
|
+
"pages.login.buttons.haveAccount",
|
211
|
+
"Have an account?",
|
212
|
+
)}{" "}
|
213
|
+
<ActiveLink
|
214
|
+
style={{
|
215
|
+
fontWeight: "bold",
|
216
|
+
color: token.colorPrimaryTextHover,
|
217
|
+
}}
|
218
|
+
to="/login"
|
219
|
+
>
|
220
|
+
{translate("pages.login.signin", "Sign in")}
|
221
|
+
</ActiveLink>
|
222
|
+
</Text>
|
223
|
+
)}
|
224
|
+
</div>
|
225
|
+
<Form.Item
|
226
|
+
style={{
|
227
|
+
marginBottom: 0,
|
228
|
+
}}
|
229
|
+
>
|
230
|
+
<Button
|
231
|
+
type="primary"
|
232
|
+
size="large"
|
233
|
+
htmlType="submit"
|
234
|
+
loading={isLoading}
|
235
|
+
block
|
236
|
+
>
|
237
|
+
{translate(
|
238
|
+
"pages.register.buttons.submit",
|
239
|
+
"Sign up",
|
240
|
+
)}
|
241
|
+
</Button>
|
242
|
+
</Form.Item>
|
243
|
+
</Form>
|
244
|
+
)}
|
245
|
+
{hideForm && loginLink !== false && (
|
191
246
|
<div
|
192
247
|
style={{
|
193
|
-
|
194
|
-
justifyContent: "space-between",
|
195
|
-
marginBottom: "24px",
|
248
|
+
marginTop: hideForm ? 16 : 8,
|
196
249
|
}}
|
197
250
|
>
|
198
|
-
|
199
|
-
|
251
|
+
<Text
|
252
|
+
style={{
|
253
|
+
fontSize: 12,
|
254
|
+
}}
|
255
|
+
>
|
256
|
+
{translate(
|
257
|
+
"pages.login.buttons.haveAccount",
|
258
|
+
"Have an account?",
|
259
|
+
)}{" "}
|
260
|
+
<ActiveLink
|
200
261
|
style={{
|
201
|
-
|
202
|
-
|
262
|
+
fontWeight: "bold",
|
263
|
+
color: token.colorPrimaryTextHover,
|
203
264
|
}}
|
265
|
+
to="/login"
|
204
266
|
>
|
205
|
-
{translate(
|
206
|
-
|
207
|
-
|
208
|
-
)}{" "}
|
209
|
-
<ActiveLink
|
210
|
-
style={{
|
211
|
-
fontWeight: "bold",
|
212
|
-
color: token.colorPrimaryTextHover,
|
213
|
-
}}
|
214
|
-
to="/login"
|
215
|
-
>
|
216
|
-
{translate("pages.login.signin", "Sign in")}
|
217
|
-
</ActiveLink>
|
218
|
-
</Text>
|
219
|
-
)}
|
267
|
+
{translate("pages.login.signin", "Sign in")}
|
268
|
+
</ActiveLink>
|
269
|
+
</Text>
|
220
270
|
</div>
|
221
|
-
|
222
|
-
<Form.Item
|
223
|
-
style={{
|
224
|
-
marginBottom: 0,
|
225
|
-
}}
|
226
|
-
>
|
227
|
-
<Button
|
228
|
-
type="primary"
|
229
|
-
size="large"
|
230
|
-
htmlType="submit"
|
231
|
-
loading={isLoading}
|
232
|
-
block
|
233
|
-
>
|
234
|
-
{translate("pages.register.buttons.submit", "Sign up")}
|
235
|
-
</Button>
|
236
|
-
</Form.Item>
|
237
|
-
</Form>
|
271
|
+
)}
|
238
272
|
</Card>
|
239
273
|
);
|
240
274
|
|
@@ -242,9 +276,11 @@ export const RegisterPage: React.FC<RegisterProps> = ({
|
|
242
276
|
<Layout style={layoutStyles} {...(wrapperProps ?? {})}>
|
243
277
|
<Row
|
244
278
|
justify="center"
|
245
|
-
align="middle"
|
279
|
+
align={hideForm ? "top" : "middle"}
|
246
280
|
style={{
|
247
|
-
|
281
|
+
padding: "16px 0",
|
282
|
+
minHeight: "100dvh",
|
283
|
+
paddingTop: hideForm ? "15dvh" : "16px",
|
248
284
|
}}
|
249
285
|
>
|
250
286
|
<Col xs={22}>
|
@@ -27,7 +27,7 @@ import {
|
|
27
27
|
headStyles,
|
28
28
|
bodyStyles,
|
29
29
|
} from "../styles";
|
30
|
-
import {
|
30
|
+
import { ThemedTitleV2 } from "@components";
|
31
31
|
|
32
32
|
const { Title } = Typography;
|
33
33
|
const { useToken } = theme;
|
@@ -69,7 +69,7 @@ export const UpdatePasswordPage: React.FC<UpdatePasswordProps> = ({
|
|
69
69
|
fontSize: "20px",
|
70
70
|
}}
|
71
71
|
>
|
72
|
-
{title ?? <
|
72
|
+
{title ?? <ThemedTitleV2 collapsed={false} />}
|
73
73
|
</div>
|
74
74
|
);
|
75
75
|
|
@@ -184,7 +184,8 @@ export const UpdatePasswordPage: React.FC<UpdatePasswordProps> = ({
|
|
184
184
|
justify="center"
|
185
185
|
align="middle"
|
186
186
|
style={{
|
187
|
-
|
187
|
+
padding: "16px 0",
|
188
|
+
minHeight: "100dvh",
|
188
189
|
}}
|
189
190
|
>
|
190
191
|
<Col xs={22}>
|