@pelcro/react-pelcro-js 3.8.1 → 3.9.0-beta.1
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.cjs.js +338 -171
- package/dist/index.esm.js +338 -171
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3245,7 +3245,10 @@ var validation$2 = {
|
|
|
3245
3245
|
validEmail: "le courriel n’est pas valide",
|
|
3246
3246
|
enterEmail: "Un courriel est requis.",
|
|
3247
3247
|
enterPassword: "Mot de passe requis.",
|
|
3248
|
-
confirmPassword: "Confirmer le mot de passe requis."
|
|
3248
|
+
confirmPassword: "Confirmer le mot de passe requis.",
|
|
3249
|
+
enterFirstName: "Le prénom est requis.",
|
|
3250
|
+
enterLastName: "Le nom de famille est requis.",
|
|
3251
|
+
enterPhone: "Le numéro de téléphone est requis."
|
|
3249
3252
|
};
|
|
3250
3253
|
var buttons$e = {
|
|
3251
3254
|
account: "Accès abonné(e)s",
|
|
@@ -3334,7 +3337,10 @@ var validation$1 = {
|
|
|
3334
3337
|
validEmail: "Email address is not valid.",
|
|
3335
3338
|
enterEmail: "Email address is required.",
|
|
3336
3339
|
enterPassword: "Password is required.",
|
|
3337
|
-
confirmPassword: "Confirm password is required."
|
|
3340
|
+
confirmPassword: "Confirm password is required.",
|
|
3341
|
+
enterFirstName: "First name is required.",
|
|
3342
|
+
enterLastName: "Last name is required.",
|
|
3343
|
+
enterPhone: "Phone number is required."
|
|
3338
3344
|
};
|
|
3339
3345
|
var buttons$d = {
|
|
3340
3346
|
account: "My account",
|
|
@@ -3422,7 +3428,10 @@ var common_en = {
|
|
|
3422
3428
|
var validation = {
|
|
3423
3429
|
validEmail: "이메일 주소가 유효하지 않습니다.",
|
|
3424
3430
|
enterEmail: "이메일 주소는 필수 항목입니다.",
|
|
3425
|
-
enterPassword: "비밀번호는 필수 항목입니다."
|
|
3431
|
+
enterPassword: "비밀번호는 필수 항목입니다.",
|
|
3432
|
+
enterFirstName: "이름은 필수 항목입니다.",
|
|
3433
|
+
enterLastName: "성은 필수 항목입니다.",
|
|
3434
|
+
enterPhone: "전화번호는 필수 항목입니다."
|
|
3426
3435
|
};
|
|
3427
3436
|
var buttons$c = {
|
|
3428
3437
|
account: "내 계정",
|
|
@@ -4083,7 +4092,8 @@ var labels$w = {
|
|
|
4083
4092
|
emailPlaceholder: "Enter email",
|
|
4084
4093
|
required: "required",
|
|
4085
4094
|
firstName: "First name",
|
|
4086
|
-
lastName: "Last name"
|
|
4095
|
+
lastName: "Last name",
|
|
4096
|
+
phone: "Phone"
|
|
4087
4097
|
};
|
|
4088
4098
|
var messages$z = {
|
|
4089
4099
|
alreadyHaveAccount: "Already have an account?",
|
|
@@ -4178,7 +4188,8 @@ var labels$v = {
|
|
|
4178
4188
|
emailPlaceholder: "Courriel",
|
|
4179
4189
|
required: "Champs obligatoires",
|
|
4180
4190
|
firstName: "Prénom",
|
|
4181
|
-
lastName: "Nom de famille"
|
|
4191
|
+
lastName: "Nom de famille",
|
|
4192
|
+
phone: "Téléphoner"
|
|
4182
4193
|
};
|
|
4183
4194
|
var messages$y = {
|
|
4184
4195
|
alreadyHaveAccount: "Vous avez déjà un compte?",
|
|
@@ -4274,7 +4285,8 @@ var labels$u = {
|
|
|
4274
4285
|
emailPlaceholder: "이메일 입력",
|
|
4275
4286
|
required: "필수 항목",
|
|
4276
4287
|
firstName: "이름",
|
|
4277
|
-
lastName: "성"
|
|
4288
|
+
lastName: "성",
|
|
4289
|
+
phone: "핸드폰"
|
|
4278
4290
|
};
|
|
4279
4291
|
var messages$x = {
|
|
4280
4292
|
alreadyHaveAccount: "이미 계정이 있습니까?",
|
|
@@ -10808,6 +10820,9 @@ const SET_EMAIL = "SET_EMAIL";
|
|
|
10808
10820
|
const SET_PASSWORD = "SET_PASSWORD";
|
|
10809
10821
|
const SET_EMAIL_ERROR = "SET_EMAIL_ERROR";
|
|
10810
10822
|
const SET_PASSWORD_ERROR = "SET_PASSWORD_ERROR";
|
|
10823
|
+
const SET_FIRST_NAME_ERROR = "SET_FIRST_NAME_ERROR";
|
|
10824
|
+
const SET_LAST_NAME_ERROR = "SET_LAST_NAME_ERROR";
|
|
10825
|
+
const SET_PHONE_ERROR = "SET_PHONE_ERROR";
|
|
10811
10826
|
const SET_TEXT_FIELD = "SET_TEXT_FIELD";
|
|
10812
10827
|
const SET_TOKEN = "SET_TOKEN";
|
|
10813
10828
|
const SET_GIFT_CODE = "SET_GIFT_CODE";
|
|
@@ -11440,14 +11455,18 @@ facebookLoginRenderProps.FacebookLogin;
|
|
|
11440
11455
|
const initialState$k = {
|
|
11441
11456
|
email: "",
|
|
11442
11457
|
password: "",
|
|
11458
|
+
firstName: "",
|
|
11459
|
+
lastName: "",
|
|
11460
|
+
phone: "",
|
|
11443
11461
|
emailError: null,
|
|
11444
11462
|
passwordError: null,
|
|
11445
11463
|
confirmPassword: "",
|
|
11446
11464
|
confirmPasswordError: null,
|
|
11447
11465
|
confirmPasswordUsed: false,
|
|
11448
11466
|
buttonDisabled: false,
|
|
11449
|
-
|
|
11450
|
-
|
|
11467
|
+
firstNameError: null,
|
|
11468
|
+
lastNameError: null,
|
|
11469
|
+
phoneError: null,
|
|
11451
11470
|
selectFields: {},
|
|
11452
11471
|
alert: {
|
|
11453
11472
|
type: "error",
|
|
@@ -11478,6 +11497,7 @@ const RegisterContainer = ({
|
|
|
11478
11497
|
password,
|
|
11479
11498
|
firstName,
|
|
11480
11499
|
lastName,
|
|
11500
|
+
phone,
|
|
11481
11501
|
organization,
|
|
11482
11502
|
jobTitle,
|
|
11483
11503
|
selectFields
|
|
@@ -11503,6 +11523,7 @@ const RegisterContainer = ({
|
|
|
11503
11523
|
password,
|
|
11504
11524
|
first_name: firstName,
|
|
11505
11525
|
last_name: lastName,
|
|
11526
|
+
phone: phone,
|
|
11506
11527
|
security_token: securityToken,
|
|
11507
11528
|
metadata: {
|
|
11508
11529
|
organization,
|
|
@@ -11592,12 +11613,20 @@ const RegisterContainer = ({
|
|
|
11592
11613
|
|
|
11593
11614
|
case SET_FIRST_NAME:
|
|
11594
11615
|
return lib_7({ ...state,
|
|
11595
|
-
firstName: action.payload
|
|
11616
|
+
firstName: action.payload,
|
|
11617
|
+
firstNameError: null
|
|
11596
11618
|
});
|
|
11597
11619
|
|
|
11598
11620
|
case SET_LAST_NAME:
|
|
11599
11621
|
return lib_7({ ...state,
|
|
11600
|
-
lastName: action.payload
|
|
11622
|
+
lastName: action.payload,
|
|
11623
|
+
lastNameError: null
|
|
11624
|
+
});
|
|
11625
|
+
|
|
11626
|
+
case SET_PHONE:
|
|
11627
|
+
return lib_7({ ...state,
|
|
11628
|
+
phone: action.payload,
|
|
11629
|
+
phoneError: null
|
|
11601
11630
|
});
|
|
11602
11631
|
|
|
11603
11632
|
case SET_TEXT_FIELD:
|
|
@@ -11623,6 +11652,24 @@ const RegisterContainer = ({
|
|
|
11623
11652
|
password: ""
|
|
11624
11653
|
});
|
|
11625
11654
|
|
|
11655
|
+
case SET_FIRST_NAME_ERROR:
|
|
11656
|
+
return lib_7({ ...state,
|
|
11657
|
+
firstNameError: action.payload,
|
|
11658
|
+
firstName: ""
|
|
11659
|
+
});
|
|
11660
|
+
|
|
11661
|
+
case SET_LAST_NAME_ERROR:
|
|
11662
|
+
return lib_7({ ...state,
|
|
11663
|
+
lastNameError: action.payload,
|
|
11664
|
+
lastName: ""
|
|
11665
|
+
});
|
|
11666
|
+
|
|
11667
|
+
case SET_PHONE_ERROR:
|
|
11668
|
+
return lib_7({ ...state,
|
|
11669
|
+
phoneError: action.payload,
|
|
11670
|
+
phone: null
|
|
11671
|
+
});
|
|
11672
|
+
|
|
11626
11673
|
case SET_CONFIRM_PASSWORD_ERROR:
|
|
11627
11674
|
return lib_7({ ...state,
|
|
11628
11675
|
confirmPasswordError: action.payload,
|
|
@@ -12230,25 +12277,32 @@ const RegisterButton = ({
|
|
|
12230
12277
|
className,
|
|
12231
12278
|
...otherProps
|
|
12232
12279
|
}) => {
|
|
12233
|
-
var _window$Pelcro$site$r;
|
|
12280
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
12234
12281
|
|
|
12235
12282
|
const {
|
|
12236
12283
|
state: {
|
|
12237
12284
|
emailError,
|
|
12238
12285
|
passwordError,
|
|
12286
|
+
firstNameError,
|
|
12287
|
+
lastNameError,
|
|
12288
|
+
phoneError,
|
|
12239
12289
|
email,
|
|
12240
12290
|
password,
|
|
12291
|
+
firstName,
|
|
12292
|
+
lastName,
|
|
12293
|
+
phone,
|
|
12241
12294
|
buttonDisabled
|
|
12242
12295
|
},
|
|
12243
12296
|
dispatch
|
|
12244
12297
|
} = React.useContext(store$k);
|
|
12298
|
+
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
12245
12299
|
const {
|
|
12246
12300
|
t
|
|
12247
12301
|
} = useTranslation("register");
|
|
12248
12302
|
const [isDisabled, setDisabled] = React.useState(true);
|
|
12249
12303
|
React.useEffect(() => {
|
|
12250
|
-
setDisabled(buttonDisabled || emailError || passwordError || !email.length || !password.length);
|
|
12251
|
-
}, [buttonDisabled, emailError, passwordError, email, password]);
|
|
12304
|
+
setDisabled(buttonDisabled || emailError || passwordError || firstNameError || lastNameError || phoneError || !email.length || !password.length || supportsTap && !firstName.length || supportsTap && !lastName.length || supportsTap && !phone.length);
|
|
12305
|
+
}, [buttonDisabled, emailError, passwordError, firstNameError, lastNameError, phoneError, email, password, firstName, lastName, phone]);
|
|
12252
12306
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
12253
12307
|
onClick: () => {
|
|
12254
12308
|
dispatch({
|
|
@@ -12260,121 +12314,51 @@ const RegisterButton = ({
|
|
|
12260
12314
|
isLoading: buttonDisabled,
|
|
12261
12315
|
className: `${className} g-recaptcha`,
|
|
12262
12316
|
"data-action": "register",
|
|
12263
|
-
"data-sitekey": (_window$Pelcro$site$
|
|
12317
|
+
"data-sitekey": (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.security_key
|
|
12264
12318
|
}, otherProps), name !== null && name !== void 0 ? name : t("messages.createAccount"));
|
|
12265
12319
|
};
|
|
12266
12320
|
|
|
12267
|
-
const Loader = props => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12268
|
-
className: `pelcro-loader-wrapper ${props.className}`
|
|
12269
|
-
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
12270
|
-
width: props.width,
|
|
12271
|
-
height: props.height,
|
|
12272
|
-
viewBox: "0 0 120 30",
|
|
12273
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
12274
|
-
fill: "currentColor",
|
|
12275
|
-
"aria-label": props.label
|
|
12276
|
-
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
12277
|
-
cx: "15",
|
|
12278
|
-
cy: "15",
|
|
12279
|
-
r: props.radius + 6
|
|
12280
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12281
|
-
attributeName: "r",
|
|
12282
|
-
from: "15",
|
|
12283
|
-
to: "15",
|
|
12284
|
-
begin: "0s",
|
|
12285
|
-
dur: "0.8s",
|
|
12286
|
-
values: "15;9;15",
|
|
12287
|
-
calcMode: "linear",
|
|
12288
|
-
repeatCount: "indefinite"
|
|
12289
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12290
|
-
attributeName: "fillOpacity",
|
|
12291
|
-
from: "1",
|
|
12292
|
-
to: "1",
|
|
12293
|
-
begin: "0s",
|
|
12294
|
-
dur: "0.8s",
|
|
12295
|
-
values: "1;.5;1",
|
|
12296
|
-
calcMode: "linear",
|
|
12297
|
-
repeatCount: "indefinite"
|
|
12298
|
-
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
12299
|
-
cx: "60",
|
|
12300
|
-
cy: "15",
|
|
12301
|
-
r: props.radius,
|
|
12302
|
-
attributeName: "fillOpacity",
|
|
12303
|
-
from: "1",
|
|
12304
|
-
to: "0.3"
|
|
12305
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12306
|
-
attributeName: "r",
|
|
12307
|
-
from: "9",
|
|
12308
|
-
to: "9",
|
|
12309
|
-
begin: "0s",
|
|
12310
|
-
dur: "0.8s",
|
|
12311
|
-
values: "9;15;9",
|
|
12312
|
-
calcMode: "linear",
|
|
12313
|
-
repeatCount: "indefinite"
|
|
12314
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12315
|
-
attributeName: "fillOpacity",
|
|
12316
|
-
from: "0.5",
|
|
12317
|
-
to: "0.5",
|
|
12318
|
-
begin: "0s",
|
|
12319
|
-
dur: "0.8s",
|
|
12320
|
-
values: ".5;1;.5",
|
|
12321
|
-
calcMode: "linear",
|
|
12322
|
-
repeatCount: "indefinite"
|
|
12323
|
-
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
12324
|
-
cx: "105",
|
|
12325
|
-
cy: "15",
|
|
12326
|
-
r: props.radius + 6
|
|
12327
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12328
|
-
attributeName: "r",
|
|
12329
|
-
from: "15",
|
|
12330
|
-
to: "15",
|
|
12331
|
-
begin: "0s",
|
|
12332
|
-
dur: "0.8s",
|
|
12333
|
-
values: "15;9;15",
|
|
12334
|
-
calcMode: "linear",
|
|
12335
|
-
repeatCount: "indefinite"
|
|
12336
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12337
|
-
attributeName: "fillOpacity",
|
|
12338
|
-
from: "1",
|
|
12339
|
-
to: "1",
|
|
12340
|
-
begin: "0s",
|
|
12341
|
-
dur: "0.8s",
|
|
12342
|
-
values: "1;.5;1",
|
|
12343
|
-
calcMode: "linear",
|
|
12344
|
-
repeatCount: "indefinite"
|
|
12345
|
-
}))));
|
|
12346
|
-
Loader.defaultProps = {
|
|
12347
|
-
height: 50,
|
|
12348
|
-
width: 35,
|
|
12349
|
-
color: "#32aea1",
|
|
12350
|
-
label: "Loading data..",
|
|
12351
|
-
radius: 9
|
|
12352
|
-
};
|
|
12353
|
-
|
|
12354
12321
|
function FirstName({
|
|
12355
12322
|
store,
|
|
12356
12323
|
...otherProps
|
|
12357
12324
|
}) {
|
|
12325
|
+
const {
|
|
12326
|
+
t
|
|
12327
|
+
} = useTranslation("common");
|
|
12358
12328
|
const {
|
|
12359
12329
|
dispatch,
|
|
12360
|
-
state
|
|
12330
|
+
state: {
|
|
12331
|
+
firstName: stateFirstName,
|
|
12332
|
+
firstNameError
|
|
12333
|
+
}
|
|
12361
12334
|
} = React.useContext(store);
|
|
12335
|
+
const [firstName, setFirstName] = React.useState(stateFirstName);
|
|
12336
|
+
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
12337
|
+
const handleInputChange = React.useCallback(value => {
|
|
12338
|
+
setFirstName(value);
|
|
12362
12339
|
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12340
|
+
if (firstName !== null && firstName !== void 0 && firstName.length) {
|
|
12341
|
+
dispatch({
|
|
12342
|
+
type: SET_FIRST_NAME,
|
|
12343
|
+
payload: firstName
|
|
12344
|
+
});
|
|
12345
|
+
} else if (finishedTyping && otherProps.required) {
|
|
12346
|
+
dispatch({
|
|
12347
|
+
type: SET_FIRST_NAME_ERROR,
|
|
12348
|
+
payload: t("validation.enterFirstName")
|
|
12349
|
+
});
|
|
12350
|
+
}
|
|
12351
|
+
}, [dispatch, firstName, finishedTyping]);
|
|
12352
|
+
React.useEffect(() => {
|
|
12353
|
+
handleInputChange(firstName);
|
|
12354
|
+
}, [finishedTyping, firstName, handleInputChange]);
|
|
12374
12355
|
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
12375
12356
|
type: "text",
|
|
12376
|
-
|
|
12377
|
-
|
|
12357
|
+
error: firstNameError,
|
|
12358
|
+
value: firstName,
|
|
12359
|
+
onChange: e => handleInputChange(e.target.value),
|
|
12360
|
+
onBlur: () => setFinishedTyping(true),
|
|
12361
|
+
onFocus: () => setFinishedTyping(false)
|
|
12378
12362
|
}, otherProps));
|
|
12379
12363
|
}
|
|
12380
12364
|
|
|
@@ -12386,26 +12370,43 @@ function LastName({
|
|
|
12386
12370
|
store,
|
|
12387
12371
|
...otherProps
|
|
12388
12372
|
}) {
|
|
12373
|
+
const {
|
|
12374
|
+
t
|
|
12375
|
+
} = useTranslation("common");
|
|
12389
12376
|
const {
|
|
12390
12377
|
dispatch,
|
|
12391
|
-
state
|
|
12378
|
+
state: {
|
|
12379
|
+
lastName: stateLastName,
|
|
12380
|
+
lastNameError
|
|
12381
|
+
}
|
|
12392
12382
|
} = React.useContext(store);
|
|
12383
|
+
const [lastName, setLastName] = React.useState(stateLastName);
|
|
12384
|
+
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
12385
|
+
const handleInputChange = React.useCallback(value => {
|
|
12386
|
+
setLastName(value);
|
|
12393
12387
|
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12388
|
+
if (lastName !== null && lastName !== void 0 && lastName.length) {
|
|
12389
|
+
dispatch({
|
|
12390
|
+
type: SET_LAST_NAME,
|
|
12391
|
+
payload: lastName
|
|
12392
|
+
});
|
|
12393
|
+
} else if (finishedTyping && otherProps.required) {
|
|
12394
|
+
dispatch({
|
|
12395
|
+
type: SET_LAST_NAME_ERROR,
|
|
12396
|
+
payload: t("validation.enterLastName")
|
|
12397
|
+
});
|
|
12398
|
+
}
|
|
12399
|
+
}, [dispatch, lastName, finishedTyping]);
|
|
12400
|
+
React.useEffect(() => {
|
|
12401
|
+
handleInputChange(lastName);
|
|
12402
|
+
}, [finishedTyping, lastName, handleInputChange]);
|
|
12405
12403
|
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
12406
12404
|
type: "text",
|
|
12407
|
-
|
|
12408
|
-
|
|
12405
|
+
error: lastNameError,
|
|
12406
|
+
value: lastName,
|
|
12407
|
+
onChange: e => handleInputChange(e.target.value),
|
|
12408
|
+
onBlur: () => setFinishedTyping(true),
|
|
12409
|
+
onFocus: () => setFinishedTyping(false)
|
|
12409
12410
|
}, otherProps));
|
|
12410
12411
|
}
|
|
12411
12412
|
|
|
@@ -12413,12 +12414,60 @@ const RegisterLastName = props => /*#__PURE__*/React__default['default'].createE
|
|
|
12413
12414
|
store: store$k
|
|
12414
12415
|
}, props));
|
|
12415
12416
|
|
|
12417
|
+
function Phone({
|
|
12418
|
+
store,
|
|
12419
|
+
...otherProps
|
|
12420
|
+
}) {
|
|
12421
|
+
const {
|
|
12422
|
+
t
|
|
12423
|
+
} = useTranslation("common");
|
|
12424
|
+
const {
|
|
12425
|
+
dispatch,
|
|
12426
|
+
state: {
|
|
12427
|
+
phone: statePhone,
|
|
12428
|
+
phoneError
|
|
12429
|
+
}
|
|
12430
|
+
} = React.useContext(store);
|
|
12431
|
+
const [phone, setPhone] = React.useState(statePhone);
|
|
12432
|
+
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
12433
|
+
const handleInputChange = React.useCallback(value => {
|
|
12434
|
+
setPhone(value);
|
|
12435
|
+
|
|
12436
|
+
if (phone !== null && phone !== void 0 && phone.length) {
|
|
12437
|
+
dispatch({
|
|
12438
|
+
type: SET_PHONE,
|
|
12439
|
+
payload: phone
|
|
12440
|
+
});
|
|
12441
|
+
} else if (finishedTyping && otherProps.required) {
|
|
12442
|
+
dispatch({
|
|
12443
|
+
type: SET_PHONE_ERROR,
|
|
12444
|
+
payload: t("validation.enterPhone")
|
|
12445
|
+
});
|
|
12446
|
+
}
|
|
12447
|
+
}, [dispatch, phone, finishedTyping]);
|
|
12448
|
+
React.useEffect(() => {
|
|
12449
|
+
handleInputChange(phone);
|
|
12450
|
+
}, [finishedTyping, phone, handleInputChange]);
|
|
12451
|
+
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
12452
|
+
type: "tel",
|
|
12453
|
+
error: phoneError,
|
|
12454
|
+
value: phone,
|
|
12455
|
+
onChange: e => handleInputChange(e.target.value),
|
|
12456
|
+
onBlur: () => setFinishedTyping(true),
|
|
12457
|
+
onFocus: () => setFinishedTyping(false)
|
|
12458
|
+
}, otherProps));
|
|
12459
|
+
}
|
|
12460
|
+
|
|
12461
|
+
const RegisterPhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
|
|
12462
|
+
store: store$k
|
|
12463
|
+
}, props));
|
|
12464
|
+
|
|
12416
12465
|
/**
|
|
12417
12466
|
*
|
|
12418
12467
|
*/
|
|
12419
12468
|
|
|
12420
12469
|
function RegisterView(props) {
|
|
12421
|
-
var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett;
|
|
12470
|
+
var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett, _window$Pelcro$site$r4;
|
|
12422
12471
|
|
|
12423
12472
|
const {
|
|
12424
12473
|
t
|
|
@@ -12430,6 +12479,7 @@ function RegisterView(props) {
|
|
|
12430
12479
|
const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
|
|
12431
12480
|
const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
|
|
12432
12481
|
const showNameFields = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableNameFieldsInRegister;
|
|
12482
|
+
const supportsTap = Boolean((_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.tap_gateway_settings);
|
|
12433
12483
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12434
12484
|
id: "pelcro-register-view"
|
|
12435
12485
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -12439,16 +12489,25 @@ function RegisterView(props) {
|
|
|
12439
12489
|
}, title), /*#__PURE__*/React__default['default'].createElement("p", null, subtitle)), /*#__PURE__*/React__default['default'].createElement("form", {
|
|
12440
12490
|
action: "javascript:void(0);",
|
|
12441
12491
|
className: "plc-mt-2 pelcro-form"
|
|
12442
|
-
}, /*#__PURE__*/React__default['default'].createElement(RegisterContainer, props, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, null), showNameFields && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12492
|
+
}, /*#__PURE__*/React__default['default'].createElement(RegisterContainer, props, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, null), (showNameFields || supportsTap) && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12443
12493
|
className: "plc-flex plc-items-start"
|
|
12444
12494
|
}, /*#__PURE__*/React__default['default'].createElement(RegisterFirstName, {
|
|
12445
12495
|
id: "pelcro-input-first-name",
|
|
12446
|
-
label: t("labels.firstName")
|
|
12496
|
+
label: t("labels.firstName"),
|
|
12497
|
+
errorId: "pelcro-input-firstName-error",
|
|
12498
|
+
required: supportsTap ? true : false
|
|
12447
12499
|
}), /*#__PURE__*/React__default['default'].createElement(RegisterLastName, {
|
|
12448
12500
|
wrapperClassName: "plc-ml-3",
|
|
12449
12501
|
id: "pelcro-input-last-name",
|
|
12450
|
-
label: t("labels.lastName")
|
|
12451
|
-
|
|
12502
|
+
label: t("labels.lastName"),
|
|
12503
|
+
errorId: "pelcro-input-lastName-error",
|
|
12504
|
+
required: supportsTap ? true : false
|
|
12505
|
+
})), supportsTap && /*#__PURE__*/React__default['default'].createElement(RegisterPhone, {
|
|
12506
|
+
id: "pelcro-input-phone",
|
|
12507
|
+
errorId: "pelcro-input-phone-error",
|
|
12508
|
+
label: t("labels.phone"),
|
|
12509
|
+
required: supportsTap ? true : false
|
|
12510
|
+
}), /*#__PURE__*/React__default['default'].createElement(RegisterEmail, {
|
|
12452
12511
|
id: "pelcro-input-email",
|
|
12453
12512
|
errorId: "pelcro-input-email-error",
|
|
12454
12513
|
label: t("labels.email"),
|
|
@@ -12494,11 +12553,98 @@ function RegisterView(props) {
|
|
|
12494
12553
|
*/
|
|
12495
12554
|
|
|
12496
12555
|
function hasSecurityTokenEnabled() {
|
|
12497
|
-
var _window$Pelcro$site, _window$Pelcro$site$
|
|
12556
|
+
var _window$Pelcro$site, _window$Pelcro$site$r5;
|
|
12498
12557
|
|
|
12499
|
-
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$
|
|
12558
|
+
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r5 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r5 === void 0 ? void 0 : _window$Pelcro$site$r5.security_key);
|
|
12500
12559
|
}
|
|
12501
12560
|
|
|
12561
|
+
const Loader = props => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12562
|
+
className: `pelcro-loader-wrapper ${props.className}`
|
|
12563
|
+
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
12564
|
+
width: props.width,
|
|
12565
|
+
height: props.height,
|
|
12566
|
+
viewBox: "0 0 120 30",
|
|
12567
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12568
|
+
fill: "currentColor",
|
|
12569
|
+
"aria-label": props.label
|
|
12570
|
+
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
12571
|
+
cx: "15",
|
|
12572
|
+
cy: "15",
|
|
12573
|
+
r: props.radius + 6
|
|
12574
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12575
|
+
attributeName: "r",
|
|
12576
|
+
from: "15",
|
|
12577
|
+
to: "15",
|
|
12578
|
+
begin: "0s",
|
|
12579
|
+
dur: "0.8s",
|
|
12580
|
+
values: "15;9;15",
|
|
12581
|
+
calcMode: "linear",
|
|
12582
|
+
repeatCount: "indefinite"
|
|
12583
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12584
|
+
attributeName: "fillOpacity",
|
|
12585
|
+
from: "1",
|
|
12586
|
+
to: "1",
|
|
12587
|
+
begin: "0s",
|
|
12588
|
+
dur: "0.8s",
|
|
12589
|
+
values: "1;.5;1",
|
|
12590
|
+
calcMode: "linear",
|
|
12591
|
+
repeatCount: "indefinite"
|
|
12592
|
+
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
12593
|
+
cx: "60",
|
|
12594
|
+
cy: "15",
|
|
12595
|
+
r: props.radius,
|
|
12596
|
+
attributeName: "fillOpacity",
|
|
12597
|
+
from: "1",
|
|
12598
|
+
to: "0.3"
|
|
12599
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12600
|
+
attributeName: "r",
|
|
12601
|
+
from: "9",
|
|
12602
|
+
to: "9",
|
|
12603
|
+
begin: "0s",
|
|
12604
|
+
dur: "0.8s",
|
|
12605
|
+
values: "9;15;9",
|
|
12606
|
+
calcMode: "linear",
|
|
12607
|
+
repeatCount: "indefinite"
|
|
12608
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12609
|
+
attributeName: "fillOpacity",
|
|
12610
|
+
from: "0.5",
|
|
12611
|
+
to: "0.5",
|
|
12612
|
+
begin: "0s",
|
|
12613
|
+
dur: "0.8s",
|
|
12614
|
+
values: ".5;1;.5",
|
|
12615
|
+
calcMode: "linear",
|
|
12616
|
+
repeatCount: "indefinite"
|
|
12617
|
+
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
12618
|
+
cx: "105",
|
|
12619
|
+
cy: "15",
|
|
12620
|
+
r: props.radius + 6
|
|
12621
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12622
|
+
attributeName: "r",
|
|
12623
|
+
from: "15",
|
|
12624
|
+
to: "15",
|
|
12625
|
+
begin: "0s",
|
|
12626
|
+
dur: "0.8s",
|
|
12627
|
+
values: "15;9;15",
|
|
12628
|
+
calcMode: "linear",
|
|
12629
|
+
repeatCount: "indefinite"
|
|
12630
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
12631
|
+
attributeName: "fillOpacity",
|
|
12632
|
+
from: "1",
|
|
12633
|
+
to: "1",
|
|
12634
|
+
begin: "0s",
|
|
12635
|
+
dur: "0.8s",
|
|
12636
|
+
values: "1;.5;1",
|
|
12637
|
+
calcMode: "linear",
|
|
12638
|
+
repeatCount: "indefinite"
|
|
12639
|
+
}))));
|
|
12640
|
+
Loader.defaultProps = {
|
|
12641
|
+
height: 50,
|
|
12642
|
+
width: 35,
|
|
12643
|
+
color: "#32aea1",
|
|
12644
|
+
label: "Loading data..",
|
|
12645
|
+
radius: 9
|
|
12646
|
+
};
|
|
12647
|
+
|
|
12502
12648
|
function TextInput({
|
|
12503
12649
|
store,
|
|
12504
12650
|
fieldName,
|
|
@@ -19114,9 +19260,12 @@ const initialState$f = {
|
|
|
19114
19260
|
email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
|
|
19115
19261
|
emailError: null,
|
|
19116
19262
|
firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
|
|
19263
|
+
firstNameError: null,
|
|
19117
19264
|
lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
|
|
19265
|
+
lastNameError: null,
|
|
19118
19266
|
displayName: (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.display_name,
|
|
19119
19267
|
phone: (_window$Pelcro$user$r5 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.phone,
|
|
19268
|
+
phoneError: null,
|
|
19120
19269
|
buttonDisabled: false,
|
|
19121
19270
|
textFields: {},
|
|
19122
19271
|
alert: {
|
|
@@ -19228,17 +19377,26 @@ const UserUpdateContainer = ({
|
|
|
19228
19377
|
|
|
19229
19378
|
case SET_EMAIL:
|
|
19230
19379
|
return lib_7({ ...state,
|
|
19231
|
-
email: action.payload
|
|
19380
|
+
email: action.payload,
|
|
19381
|
+
emailError: null
|
|
19232
19382
|
});
|
|
19233
19383
|
|
|
19234
19384
|
case SET_EMAIL_ERROR:
|
|
19235
19385
|
return lib_7({ ...state,
|
|
19236
|
-
emailError: action.payload
|
|
19386
|
+
emailError: action.payload,
|
|
19387
|
+
email: ""
|
|
19237
19388
|
});
|
|
19238
19389
|
|
|
19239
19390
|
case SET_FIRST_NAME:
|
|
19240
19391
|
return lib_7({ ...state,
|
|
19241
|
-
firstName: action.payload
|
|
19392
|
+
firstName: action.payload,
|
|
19393
|
+
firstNameError: null
|
|
19394
|
+
});
|
|
19395
|
+
|
|
19396
|
+
case SET_FIRST_NAME_ERROR:
|
|
19397
|
+
return lib_7({ ...state,
|
|
19398
|
+
firstNameError: action.payload,
|
|
19399
|
+
firstName: ""
|
|
19242
19400
|
});
|
|
19243
19401
|
|
|
19244
19402
|
case SET_DISPLAY_NAME:
|
|
@@ -19248,12 +19406,26 @@ const UserUpdateContainer = ({
|
|
|
19248
19406
|
|
|
19249
19407
|
case SET_LAST_NAME:
|
|
19250
19408
|
return lib_7({ ...state,
|
|
19251
|
-
lastName: action.payload
|
|
19409
|
+
lastName: action.payload,
|
|
19410
|
+
lastNameError: null
|
|
19411
|
+
});
|
|
19412
|
+
|
|
19413
|
+
case SET_LAST_NAME_ERROR:
|
|
19414
|
+
return lib_7({ ...state,
|
|
19415
|
+
lastNameError: action.payload,
|
|
19416
|
+
lastName: ""
|
|
19252
19417
|
});
|
|
19253
19418
|
|
|
19254
19419
|
case SET_PHONE:
|
|
19255
19420
|
return lib_7({ ...state,
|
|
19256
|
-
phone: action.payload
|
|
19421
|
+
phone: action.payload,
|
|
19422
|
+
phoneError: null
|
|
19423
|
+
});
|
|
19424
|
+
|
|
19425
|
+
case SET_PHONE_ERROR:
|
|
19426
|
+
return lib_7({ ...state,
|
|
19427
|
+
phoneError: action.payload,
|
|
19428
|
+
phone: ""
|
|
19257
19429
|
});
|
|
19258
19430
|
|
|
19259
19431
|
case SHOW_ALERT:
|
|
@@ -19359,16 +19531,30 @@ const UserUpdateButton = ({
|
|
|
19359
19531
|
onClick,
|
|
19360
19532
|
...otherProps
|
|
19361
19533
|
}) => {
|
|
19534
|
+
var _window$Pelcro$site$r;
|
|
19535
|
+
|
|
19362
19536
|
const {
|
|
19363
19537
|
state: {
|
|
19364
19538
|
buttonDisabled,
|
|
19365
|
-
|
|
19539
|
+
email,
|
|
19540
|
+
firstName,
|
|
19541
|
+
lastName,
|
|
19542
|
+
phone,
|
|
19543
|
+
emailError,
|
|
19544
|
+
firstNameError,
|
|
19545
|
+
lastNameError,
|
|
19546
|
+
phoneError
|
|
19366
19547
|
},
|
|
19367
19548
|
dispatch
|
|
19368
19549
|
} = React.useContext(store$f);
|
|
19550
|
+
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19369
19551
|
const {
|
|
19370
19552
|
t
|
|
19371
19553
|
} = useTranslation("userEdit");
|
|
19554
|
+
const [isDisabled, setDisabled] = React.useState(true);
|
|
19555
|
+
React.useEffect(() => {
|
|
19556
|
+
setDisabled(buttonDisabled || emailError || firstNameError || lastNameError || phoneError || !(email !== null && email !== void 0 && email.length) || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length));
|
|
19557
|
+
}, [email, firstName, lastName, phone, buttonDisabled, emailError, firstNameError, lastNameError, phoneError]);
|
|
19372
19558
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
19373
19559
|
onClick: () => {
|
|
19374
19560
|
dispatch({
|
|
@@ -19376,7 +19562,7 @@ const UserUpdateButton = ({
|
|
|
19376
19562
|
});
|
|
19377
19563
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
19378
19564
|
},
|
|
19379
|
-
disabled:
|
|
19565
|
+
disabled: isDisabled,
|
|
19380
19566
|
isLoading: buttonDisabled && !emailError
|
|
19381
19567
|
}, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
|
|
19382
19568
|
};
|
|
@@ -19389,31 +19575,6 @@ const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].creat
|
|
|
19389
19575
|
store: store$f
|
|
19390
19576
|
}, props));
|
|
19391
19577
|
|
|
19392
|
-
function Phone({
|
|
19393
|
-
store,
|
|
19394
|
-
...otherProps
|
|
19395
|
-
}) {
|
|
19396
|
-
const {
|
|
19397
|
-
dispatch,
|
|
19398
|
-
state: {
|
|
19399
|
-
phone
|
|
19400
|
-
}
|
|
19401
|
-
} = React.useContext(store);
|
|
19402
|
-
|
|
19403
|
-
const handleInputChange = value => {
|
|
19404
|
-
dispatch({
|
|
19405
|
-
type: SET_PHONE,
|
|
19406
|
-
payload: value
|
|
19407
|
-
});
|
|
19408
|
-
};
|
|
19409
|
-
|
|
19410
|
-
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
19411
|
-
type: "tel",
|
|
19412
|
-
value: phone,
|
|
19413
|
-
onChange: e => handleInputChange(e.target.value)
|
|
19414
|
-
}, otherProps));
|
|
19415
|
-
}
|
|
19416
|
-
|
|
19417
19578
|
const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
|
|
19418
19579
|
store: store$f
|
|
19419
19580
|
}, props));
|
|
@@ -19446,9 +19607,12 @@ const UserUpdateProfilePic = ({
|
|
|
19446
19607
|
};
|
|
19447
19608
|
|
|
19448
19609
|
const UserUpdateView = props => {
|
|
19610
|
+
var _window$Pelcro$site$r;
|
|
19611
|
+
|
|
19449
19612
|
const {
|
|
19450
19613
|
t
|
|
19451
19614
|
} = useTranslation("userEdit");
|
|
19615
|
+
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19452
19616
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19453
19617
|
id: "pelcro-user-update-view"
|
|
19454
19618
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -19467,19 +19631,22 @@ const UserUpdateView = props => {
|
|
|
19467
19631
|
id: "pelcro-input-first-name",
|
|
19468
19632
|
errorId: "pelcro-input-first-name-error",
|
|
19469
19633
|
label: t("labels.firstName"),
|
|
19470
|
-
autoFocus: true
|
|
19634
|
+
autoFocus: true,
|
|
19635
|
+
required: supportsTap ? true : false
|
|
19471
19636
|
}), /*#__PURE__*/React__default['default'].createElement(UserUpdateLastName, {
|
|
19472
19637
|
wrapperClassName: "plc-ml-3",
|
|
19473
19638
|
autoComplete: "last-name",
|
|
19474
19639
|
id: "pelcro-input-last-name",
|
|
19475
19640
|
errorId: "pelcro-input-last-name-error",
|
|
19476
|
-
label: t("labels.lastName")
|
|
19641
|
+
label: t("labels.lastName"),
|
|
19642
|
+
required: supportsTap ? true : false
|
|
19477
19643
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19478
19644
|
className: "plc-flex plc-items-start"
|
|
19479
19645
|
}, /*#__PURE__*/React__default['default'].createElement(UserUpdatePhone, {
|
|
19480
19646
|
id: "pelcro-input-phone",
|
|
19481
19647
|
errorId: "pelcro-input-phone-error",
|
|
19482
|
-
label: t("labels.phone")
|
|
19648
|
+
label: t("labels.phone"),
|
|
19649
|
+
required: supportsTap ? true : false
|
|
19483
19650
|
})), /*#__PURE__*/React__default['default'].createElement(UserUpdateButton, {
|
|
19484
19651
|
role: "submit",
|
|
19485
19652
|
className: "plc-w-full plc-mt-2",
|