@panneau/form-auth 4.0.73 → 4.0.75
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/index.d.ts +7 -5
- package/dist/index.js +88 -93
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { Field, Label } from '@panneau/core';
|
|
2
|
+
import { Field, Label, ControlSize, FormDefinition } from '@panneau/core';
|
|
3
3
|
|
|
4
4
|
interface ChangePasswordProps {
|
|
5
5
|
action?: string;
|
|
@@ -36,8 +36,8 @@ declare function ForgotPassword({ action, fields, emailLabel, submitButtonLabel,
|
|
|
36
36
|
interface LoginProps {
|
|
37
37
|
action?: string;
|
|
38
38
|
postForm?: ((action: string, data: unknown) => Promise<unknown>) | null;
|
|
39
|
-
fields
|
|
40
|
-
size?:
|
|
39
|
+
fields: Field[] | null;
|
|
40
|
+
size?: ControlSize;
|
|
41
41
|
emailLabel?: Label | null;
|
|
42
42
|
passwordLabel?: Label | null;
|
|
43
43
|
submitButtonLabel?: Label | null;
|
|
@@ -45,7 +45,7 @@ interface LoginProps {
|
|
|
45
45
|
forgotPasswordLink?: string;
|
|
46
46
|
forgotPasswordLabel?: Label | null;
|
|
47
47
|
}
|
|
48
|
-
declare function Login({ action, postForm,
|
|
48
|
+
declare function Login({ action, postForm, size, submitButtonLabel, withForgotPassword, forgotPasswordLink, forgotPasswordLabel, ...props }: LoginProps): react.JSX.Element;
|
|
49
49
|
|
|
50
50
|
interface RegisterProps {
|
|
51
51
|
action?: string;
|
|
@@ -106,4 +106,6 @@ interface TwoFactorEnableProps {
|
|
|
106
106
|
}
|
|
107
107
|
declare function TwoFactorEnable({ action, fields, explainationLabel, submitButtonLabel, size, withSkipLink, skipLink, skipLabel, ...props }: TwoFactorEnableProps): react.JSX.Element;
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
declare const definitions: FormDefinition[];
|
|
110
|
+
|
|
111
|
+
export { ChangePassword, ConfirmPassword, ForgotPassword, Login, Register, ResetPassword, TwoFactorChallenge, TwoFactorDisable, TwoFactorEnable, definitions as definition };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
3
3
|
import Form from '@panneau/form';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import Link from '@panneau/element-link';
|
|
6
|
+
import { useFormDefinition } from '@panneau/core/contexts';
|
|
6
7
|
import { postJSON, getCSRFHeaders } from '@folklore/fetch';
|
|
7
8
|
|
|
8
9
|
function ChangePassword(t0) {
|
|
@@ -315,139 +316,112 @@ function ForgotPassword(t0) {
|
|
|
315
316
|
}
|
|
316
317
|
|
|
317
318
|
function Login(t0) {
|
|
318
|
-
const $ = c(
|
|
319
|
+
const $ = c(25);
|
|
319
320
|
let props;
|
|
320
321
|
let t1;
|
|
321
|
-
let t10;
|
|
322
322
|
let t2;
|
|
323
323
|
let t3;
|
|
324
324
|
let t4;
|
|
325
325
|
let t5;
|
|
326
326
|
let t6;
|
|
327
327
|
let t7;
|
|
328
|
-
let t8;
|
|
329
|
-
let t9;
|
|
330
328
|
if ($[0] !== t0) {
|
|
331
329
|
({
|
|
332
330
|
action: t1,
|
|
333
331
|
postForm: t2,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
withForgotPassword: t8,
|
|
340
|
-
forgotPasswordLink: t9,
|
|
341
|
-
forgotPasswordLabel: t10,
|
|
332
|
+
size: t3,
|
|
333
|
+
submitButtonLabel: t4,
|
|
334
|
+
withForgotPassword: t5,
|
|
335
|
+
forgotPasswordLink: t6,
|
|
336
|
+
forgotPasswordLabel: t7,
|
|
342
337
|
...props
|
|
343
338
|
} = t0);
|
|
344
339
|
$[0] = t0;
|
|
345
340
|
$[1] = props;
|
|
346
341
|
$[2] = t1;
|
|
347
|
-
$[3] =
|
|
348
|
-
$[4] =
|
|
349
|
-
$[5] =
|
|
350
|
-
$[6] =
|
|
351
|
-
$[7] =
|
|
352
|
-
$[8] =
|
|
353
|
-
$[9] = t7;
|
|
354
|
-
$[10] = t8;
|
|
355
|
-
$[11] = t9;
|
|
342
|
+
$[3] = t2;
|
|
343
|
+
$[4] = t3;
|
|
344
|
+
$[5] = t4;
|
|
345
|
+
$[6] = t5;
|
|
346
|
+
$[7] = t6;
|
|
347
|
+
$[8] = t7;
|
|
356
348
|
} else {
|
|
357
349
|
props = $[1];
|
|
358
350
|
t1 = $[2];
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
t7 = $[9];
|
|
366
|
-
t8 = $[10];
|
|
367
|
-
t9 = $[11];
|
|
351
|
+
t2 = $[3];
|
|
352
|
+
t3 = $[4];
|
|
353
|
+
t4 = $[5];
|
|
354
|
+
t5 = $[6];
|
|
355
|
+
t6 = $[7];
|
|
356
|
+
t7 = $[8];
|
|
368
357
|
}
|
|
369
358
|
const action = t1 === undefined ? "/login" : t1;
|
|
370
359
|
const postForm = t2 === undefined ? null : t2;
|
|
371
|
-
const
|
|
372
|
-
const
|
|
373
|
-
const
|
|
374
|
-
const
|
|
375
|
-
const
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
let
|
|
380
|
-
if ($[
|
|
381
|
-
|
|
382
|
-
name: "email",
|
|
383
|
-
type: "email",
|
|
384
|
-
size,
|
|
385
|
-
label: emailLabel || /*#__PURE__*/jsx(FormattedMessage, {
|
|
386
|
-
id: "LI0Gz4"
|
|
387
|
-
})
|
|
388
|
-
}, {
|
|
389
|
-
name: "password",
|
|
390
|
-
type: "password",
|
|
391
|
-
size,
|
|
392
|
-
label: passwordLabel || /*#__PURE__*/jsx(FormattedMessage, {
|
|
393
|
-
id: "4yfet+"
|
|
394
|
-
})
|
|
395
|
-
}];
|
|
396
|
-
$[12] = emailLabel;
|
|
397
|
-
$[13] = fields;
|
|
398
|
-
$[14] = passwordLabel;
|
|
399
|
-
$[15] = size;
|
|
400
|
-
$[16] = t11;
|
|
401
|
-
} else {
|
|
402
|
-
t11 = $[16];
|
|
403
|
-
}
|
|
404
|
-
let t12;
|
|
405
|
-
if ($[17] !== submitButtonLabel) {
|
|
406
|
-
t12 = submitButtonLabel || /*#__PURE__*/jsx(FormattedMessage, {
|
|
360
|
+
const size = t3 === undefined ? "lg" : t3;
|
|
361
|
+
const submitButtonLabel = t4 === undefined ? null : t4;
|
|
362
|
+
const withForgotPassword = t5 === undefined ? false : t5;
|
|
363
|
+
const forgotPasswordLink = t6 === undefined ? "/forgot-password" : t6;
|
|
364
|
+
const forgotPasswordLabel = t7 === undefined ? null : t7;
|
|
365
|
+
const {
|
|
366
|
+
fields
|
|
367
|
+
} = useFormDefinition("login") || {};
|
|
368
|
+
let t8;
|
|
369
|
+
if ($[9] !== submitButtonLabel) {
|
|
370
|
+
t8 = submitButtonLabel || /*#__PURE__*/jsx(FormattedMessage, {
|
|
407
371
|
id: "g6qbbX"
|
|
408
372
|
});
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
373
|
+
$[9] = submitButtonLabel;
|
|
374
|
+
$[10] = t8;
|
|
411
375
|
} else {
|
|
412
|
-
|
|
376
|
+
t8 = $[10];
|
|
413
377
|
}
|
|
414
|
-
let
|
|
415
|
-
if ($[
|
|
416
|
-
|
|
378
|
+
let t9;
|
|
379
|
+
if ($[11] !== forgotPasswordLabel || $[12] !== forgotPasswordLink || $[13] !== withForgotPassword) {
|
|
380
|
+
t9 = withForgotPassword ? /*#__PURE__*/jsx(Link, {
|
|
417
381
|
href: forgotPasswordLink,
|
|
418
382
|
className: "py-2 px-4",
|
|
419
383
|
children: forgotPasswordLabel || /*#__PURE__*/jsx(FormattedMessage, {
|
|
420
384
|
id: "ZBNqY2"
|
|
421
385
|
})
|
|
422
386
|
}) : null;
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
387
|
+
$[11] = forgotPasswordLabel;
|
|
388
|
+
$[12] = forgotPasswordLink;
|
|
389
|
+
$[13] = withForgotPassword;
|
|
390
|
+
$[14] = t9;
|
|
427
391
|
} else {
|
|
428
|
-
|
|
392
|
+
t9 = $[14];
|
|
429
393
|
}
|
|
430
|
-
let
|
|
431
|
-
if ($[
|
|
432
|
-
|
|
394
|
+
let t10;
|
|
395
|
+
if ($[15] !== fields) {
|
|
396
|
+
t10 = fields || [];
|
|
397
|
+
$[15] = fields;
|
|
398
|
+
$[16] = t10;
|
|
399
|
+
} else {
|
|
400
|
+
t10 = $[16];
|
|
401
|
+
}
|
|
402
|
+
let t11;
|
|
403
|
+
if ($[17] !== action || $[18] !== postForm || $[19] !== props || $[20] !== size || $[21] !== t10 || $[22] !== t8 || $[23] !== t9) {
|
|
404
|
+
t11 = /*#__PURE__*/jsx(Form, {
|
|
433
405
|
action: action,
|
|
434
406
|
postForm: postForm,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
407
|
+
submitButtonLabel: t8,
|
|
408
|
+
actions: t9,
|
|
409
|
+
size: size,
|
|
410
|
+
fields: t10,
|
|
438
411
|
...props
|
|
439
412
|
});
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
$[
|
|
445
|
-
$[
|
|
446
|
-
$[
|
|
413
|
+
$[17] = action;
|
|
414
|
+
$[18] = postForm;
|
|
415
|
+
$[19] = props;
|
|
416
|
+
$[20] = size;
|
|
417
|
+
$[21] = t10;
|
|
418
|
+
$[22] = t8;
|
|
419
|
+
$[23] = t9;
|
|
420
|
+
$[24] = t11;
|
|
447
421
|
} else {
|
|
448
|
-
|
|
422
|
+
t11 = $[24];
|
|
449
423
|
}
|
|
450
|
-
return
|
|
424
|
+
return t11;
|
|
451
425
|
}
|
|
452
426
|
|
|
453
427
|
function Register(t0) {
|
|
@@ -1041,4 +1015,25 @@ function TwoFactorEnable(t0) {
|
|
|
1041
1015
|
return t13;
|
|
1042
1016
|
}
|
|
1043
1017
|
|
|
1044
|
-
|
|
1018
|
+
const definitions = [{
|
|
1019
|
+
id: 'login',
|
|
1020
|
+
component: 'login',
|
|
1021
|
+
fields: [{
|
|
1022
|
+
name: 'email',
|
|
1023
|
+
type: 'email',
|
|
1024
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
1025
|
+
id: "LI0Gz4"
|
|
1026
|
+
})
|
|
1027
|
+
}, {
|
|
1028
|
+
name: 'password',
|
|
1029
|
+
type: 'password',
|
|
1030
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
1031
|
+
id: "4yfet+"
|
|
1032
|
+
})
|
|
1033
|
+
}],
|
|
1034
|
+
submitButtonLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
1035
|
+
id: "g6qbbX"
|
|
1036
|
+
})
|
|
1037
|
+
}];
|
|
1038
|
+
|
|
1039
|
+
export { ChangePassword, ConfirmPassword, ForgotPassword, Login, Register, ResetPassword, TwoFactorChallenge, TwoFactorDisable, TwoFactorEnable, definitions as definition };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/form-auth",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.75",
|
|
4
4
|
"description": "Basic forgot password form",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@babel/runtime": "^7.28.6",
|
|
50
50
|
"@folklore/fetch": "^0.1.21",
|
|
51
|
-
"@panneau/core": "^4.0.
|
|
52
|
-
"@panneau/element-link": "^4.0.
|
|
53
|
-
"@panneau/form": "^4.0.
|
|
51
|
+
"@panneau/core": "^4.0.75",
|
|
52
|
+
"@panneau/element-link": "^4.0.75",
|
|
53
|
+
"@panneau/form": "^4.0.75",
|
|
54
54
|
"classnames": "^2.5.1",
|
|
55
55
|
"lodash": "^4.17.21",
|
|
56
56
|
"react-intl": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^10.0.0"
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "2eb608f88ad5041b3fa9c472e97a68680e281766"
|
|
70
70
|
}
|