@pelcro/react-pelcro-js 3.26.0-beta.47 → 3.26.0-beta.49
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 +435 -162
- package/dist/index.esm.js +434 -163
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3222,6 +3222,8 @@ var validation$3 = {
|
|
|
3222
3222
|
enterFirstName: "First name is required.",
|
|
3223
3223
|
enterLastName: "Last name is required.",
|
|
3224
3224
|
enterPhone: "Phone number is required.",
|
|
3225
|
+
enterCompany: "Company is required.",
|
|
3226
|
+
enterTitle: "Title is required.",
|
|
3225
3227
|
enterFieldName: "{{fieldName}} is required."
|
|
3226
3228
|
};
|
|
3227
3229
|
var buttons$n = {
|
|
@@ -3536,7 +3538,9 @@ var labels$12 = {
|
|
|
3536
3538
|
required: "required",
|
|
3537
3539
|
firstName: "First name",
|
|
3538
3540
|
lastName: "Last name",
|
|
3539
|
-
phone: "Phone"
|
|
3541
|
+
phone: "Phone",
|
|
3542
|
+
company: "Company",
|
|
3543
|
+
title: "Title"
|
|
3540
3544
|
};
|
|
3541
3545
|
var messages$15 = {
|
|
3542
3546
|
alreadyHaveAccount: "Already have an account?",
|
|
@@ -3636,7 +3640,9 @@ var labels$11 = {
|
|
|
3636
3640
|
selectImage: "Upload new photo",
|
|
3637
3641
|
removeImage: "Remove current photo",
|
|
3638
3642
|
zoom: "Zoom",
|
|
3639
|
-
tin: "Tax Identification Number"
|
|
3643
|
+
tin: "Tax Identification Number",
|
|
3644
|
+
company: "Company",
|
|
3645
|
+
userTitle: "Title"
|
|
3640
3646
|
};
|
|
3641
3647
|
var messages$14 = {
|
|
3642
3648
|
userUpdated: "Thanks! Your profile was updated successfully.",
|
|
@@ -4176,6 +4182,8 @@ var validation$2 = {
|
|
|
4176
4182
|
enterFirstName: "Le prénom est requis.",
|
|
4177
4183
|
enterLastName: "Le nom de famille est requis.",
|
|
4178
4184
|
enterPhone: "Le numéro de téléphone est requis.",
|
|
4185
|
+
enterCompany: "L'entreprise est obligatoire.",
|
|
4186
|
+
enterTitle: "Le titre est obligatoire.",
|
|
4179
4187
|
enterFieldName: "{{fieldName}} est requis."
|
|
4180
4188
|
};
|
|
4181
4189
|
var buttons$h = {
|
|
@@ -4490,7 +4498,9 @@ var labels$M = {
|
|
|
4490
4498
|
required: "Champs obligatoires",
|
|
4491
4499
|
firstName: "Prénom",
|
|
4492
4500
|
lastName: "Nom de famille",
|
|
4493
|
-
phone: "Téléphoner"
|
|
4501
|
+
phone: "Téléphoner",
|
|
4502
|
+
company: "Entreprise",
|
|
4503
|
+
title: "Titre"
|
|
4494
4504
|
};
|
|
4495
4505
|
var messages$O = {
|
|
4496
4506
|
alreadyHaveAccount: "Vous avez déjà un compte?",
|
|
@@ -4591,7 +4601,9 @@ var labels$L = {
|
|
|
4591
4601
|
selectImage: "Télécharger une nouvelle photo",
|
|
4592
4602
|
removeImage: "supprimer la photo actuelle",
|
|
4593
4603
|
zoom: "Zoom",
|
|
4594
|
-
tin: "Numéro d'identification fiscale"
|
|
4604
|
+
tin: "Numéro d'identification fiscale",
|
|
4605
|
+
company: "Entreprise",
|
|
4606
|
+
userTitle: "Titre"
|
|
4595
4607
|
};
|
|
4596
4608
|
var messages$N = {
|
|
4597
4609
|
userUpdated: "Votre profil a été mis à jour avec succès.",
|
|
@@ -5120,6 +5132,8 @@ var validation$1 = {
|
|
|
5120
5132
|
enterFirstName: "이름은 필수 항목입니다.",
|
|
5121
5133
|
enterLastName: "성은 필수 항목입니다.",
|
|
5122
5134
|
enterPhone: "전화번호는 필수 항목입니다.",
|
|
5135
|
+
enterCompany: "회사는 필수입니다.",
|
|
5136
|
+
enterTitle: "제목은 필수 입력 사항입니다.",
|
|
5123
5137
|
enterFieldName: "{{fieldName}} 필수."
|
|
5124
5138
|
};
|
|
5125
5139
|
var buttons$b = {
|
|
@@ -5434,7 +5448,9 @@ var labels$u = {
|
|
|
5434
5448
|
required: "필수 항목",
|
|
5435
5449
|
firstName: "이름",
|
|
5436
5450
|
lastName: "성",
|
|
5437
|
-
phone: "핸드폰"
|
|
5451
|
+
phone: "핸드폰",
|
|
5452
|
+
company: "회사",
|
|
5453
|
+
title: "제목"
|
|
5438
5454
|
};
|
|
5439
5455
|
var messages$v = {
|
|
5440
5456
|
alreadyHaveAccount: "이미 계정이 있습니까?",
|
|
@@ -5534,7 +5550,9 @@ var labels$t = {
|
|
|
5534
5550
|
selectImage: "새로운 사진 업로드",
|
|
5535
5551
|
removeImage: "기존 사진 제거",
|
|
5536
5552
|
zoom: "확대",
|
|
5537
|
-
tin: "세금 식별 번호"
|
|
5553
|
+
tin: "세금 식별 번호",
|
|
5554
|
+
company: "회사",
|
|
5555
|
+
userTitle: "제목"
|
|
5538
5556
|
};
|
|
5539
5557
|
var messages$u = {
|
|
5540
5558
|
userUpdated: "감사합니다! 프로필이 성공적으로 업데이트되었습니다.",
|
|
@@ -6170,6 +6188,8 @@ var validation = {
|
|
|
6170
6188
|
enterFirstName: "El nombre es obligatorio.",
|
|
6171
6189
|
enterLastName: "El apellido es obligatorio.",
|
|
6172
6190
|
enterPhone: "El número de teléfono es obligatorio.",
|
|
6191
|
+
enterCompany: "La empresa es obligatorio.",
|
|
6192
|
+
enterTitle: "El título es obligatorio.",
|
|
6173
6193
|
enterFieldName: "{{fieldName}} es obligatorio."
|
|
6174
6194
|
};
|
|
6175
6195
|
var buttons$5 = {
|
|
@@ -6480,7 +6500,9 @@ var labels$c = {
|
|
|
6480
6500
|
required: "obligatorio",
|
|
6481
6501
|
firstName: "Nombre",
|
|
6482
6502
|
lastName: "Apellido",
|
|
6483
|
-
phone: "Teléfono"
|
|
6503
|
+
phone: "Teléfono",
|
|
6504
|
+
company: "Empresa",
|
|
6505
|
+
title: "Título"
|
|
6484
6506
|
};
|
|
6485
6507
|
var messages$c = {
|
|
6486
6508
|
alreadyHaveAccount: " ¿Ya tienes una cuenta?",
|
|
@@ -6580,7 +6602,9 @@ var labels$b = {
|
|
|
6580
6602
|
selectImage: "Subir nueva foto",
|
|
6581
6603
|
removeImage: "Eliminar foto actual",
|
|
6582
6604
|
zoom: "Acercar",
|
|
6583
|
-
tin: "Número de Identificación Fiscal"
|
|
6605
|
+
tin: "Número de Identificación Fiscal",
|
|
6606
|
+
company: "Empresa",
|
|
6607
|
+
userTitle: "Título"
|
|
6584
6608
|
};
|
|
6585
6609
|
var messages$b = {
|
|
6586
6610
|
userUpdated: "¡Gracias! Tu perfil se actualizó con éxito.",
|
|
@@ -12863,6 +12887,8 @@ const SET_PASSWORD_ERROR = "SET_PASSWORD_ERROR";
|
|
|
12863
12887
|
const SET_FIRST_NAME_ERROR = "SET_FIRST_NAME_ERROR";
|
|
12864
12888
|
const SET_LAST_NAME_ERROR = "SET_LAST_NAME_ERROR";
|
|
12865
12889
|
const SET_PHONE_ERROR = "SET_PHONE_ERROR";
|
|
12890
|
+
const SET_COMPANY_ERROR = "SET_COMPANY_ERROR";
|
|
12891
|
+
const SET_TITLE_ERROR = "SET_TITLE_ERROR";
|
|
12866
12892
|
const SET_TEXT_FIELD = "SET_TEXT_FIELD";
|
|
12867
12893
|
const SET_TEXT_FIELD_ERROR = "SET_TEXT_FIELD_ERROR";
|
|
12868
12894
|
const SET_MONTH = "SET_MONTH";
|
|
@@ -12900,6 +12926,8 @@ const SET_LAST_NAME = "SET_LAST_NAME";
|
|
|
12900
12926
|
const SET_START_DATE = "SET_START_DATE";
|
|
12901
12927
|
const SET_GIFT_MESSAGE = "SET_GIFT_MESSAGE";
|
|
12902
12928
|
const SET_PHONE = "SET_PHONE";
|
|
12929
|
+
const SET_COMPANY = "SET_COMPANY";
|
|
12930
|
+
const SET_TITLE = "SET_TITLE";
|
|
12903
12931
|
const SET_TIN = "SET_TIN";
|
|
12904
12932
|
const GET_COUNTRIES_SUCCESS = "GET_COUNTRIES_SUCCESS";
|
|
12905
12933
|
const GET_COUNTRIES_FETCH = "GET_COUNTRIES_FETCH";
|
|
@@ -13601,6 +13629,8 @@ const initialState$m = {
|
|
|
13601
13629
|
firstName: "",
|
|
13602
13630
|
lastName: "",
|
|
13603
13631
|
phone: "",
|
|
13632
|
+
company: "",
|
|
13633
|
+
title: "",
|
|
13604
13634
|
emailError: null,
|
|
13605
13635
|
passwordError: null,
|
|
13606
13636
|
confirmPassword: "",
|
|
@@ -13610,6 +13640,8 @@ const initialState$m = {
|
|
|
13610
13640
|
firstNameError: null,
|
|
13611
13641
|
lastNameError: null,
|
|
13612
13642
|
phoneError: null,
|
|
13643
|
+
companyError: null,
|
|
13644
|
+
titleError: null,
|
|
13613
13645
|
selectFields: {},
|
|
13614
13646
|
alert: {
|
|
13615
13647
|
type: "error",
|
|
@@ -13640,8 +13672,8 @@ const RegisterContainer = _ref => {
|
|
|
13640
13672
|
firstName,
|
|
13641
13673
|
lastName,
|
|
13642
13674
|
phone,
|
|
13643
|
-
|
|
13644
|
-
|
|
13675
|
+
company,
|
|
13676
|
+
title,
|
|
13645
13677
|
selectFields
|
|
13646
13678
|
} = filteredData;
|
|
13647
13679
|
if (!hasSecurityTokenEnabled$1()) {
|
|
@@ -13662,8 +13694,8 @@ const RegisterContainer = _ref => {
|
|
|
13662
13694
|
first_name: firstName,
|
|
13663
13695
|
last_name: lastName,
|
|
13664
13696
|
phone: phone,
|
|
13665
|
-
title:
|
|
13666
|
-
organization:
|
|
13697
|
+
title: title,
|
|
13698
|
+
organization: company,
|
|
13667
13699
|
security_token: securityToken,
|
|
13668
13700
|
metadata: {
|
|
13669
13701
|
...selectFields
|
|
@@ -13773,6 +13805,18 @@ const RegisterContainer = _ref => {
|
|
|
13773
13805
|
phone: action.payload,
|
|
13774
13806
|
phoneError: null
|
|
13775
13807
|
});
|
|
13808
|
+
case SET_COMPANY:
|
|
13809
|
+
return lib_7({
|
|
13810
|
+
...state,
|
|
13811
|
+
company: action.payload,
|
|
13812
|
+
companyError: null
|
|
13813
|
+
});
|
|
13814
|
+
case SET_TITLE:
|
|
13815
|
+
return lib_7({
|
|
13816
|
+
...state,
|
|
13817
|
+
title: action.payload,
|
|
13818
|
+
titleError: null
|
|
13819
|
+
});
|
|
13776
13820
|
case SET_TEXT_FIELD:
|
|
13777
13821
|
return lib_7({
|
|
13778
13822
|
...state,
|
|
@@ -13814,6 +13858,18 @@ const RegisterContainer = _ref => {
|
|
|
13814
13858
|
phoneError: action.payload,
|
|
13815
13859
|
phone: null
|
|
13816
13860
|
});
|
|
13861
|
+
case SET_COMPANY_ERROR:
|
|
13862
|
+
return lib_7({
|
|
13863
|
+
...state,
|
|
13864
|
+
companyError: action.payload,
|
|
13865
|
+
company: null
|
|
13866
|
+
});
|
|
13867
|
+
case SET_TITLE_ERROR:
|
|
13868
|
+
return lib_7({
|
|
13869
|
+
...state,
|
|
13870
|
+
titleError: action.payload,
|
|
13871
|
+
title: null
|
|
13872
|
+
});
|
|
13817
13873
|
case SET_TEXT_FIELD_ERROR:
|
|
13818
13874
|
return lib_7({
|
|
13819
13875
|
...state,
|
|
@@ -14875,98 +14931,10 @@ function hasSecurityTokenEnabled() {
|
|
|
14875
14931
|
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.security_key);
|
|
14876
14932
|
}
|
|
14877
14933
|
|
|
14878
|
-
|
|
14879
|
-
className: `pelcro-loader-wrapper ${props.className}`
|
|
14880
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
14881
|
-
width: props.width,
|
|
14882
|
-
height: props.height,
|
|
14883
|
-
viewBox: "0 0 120 30",
|
|
14884
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14885
|
-
fill: "currentColor",
|
|
14886
|
-
"aria-label": props.label
|
|
14887
|
-
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
14888
|
-
cx: "15",
|
|
14889
|
-
cy: "15",
|
|
14890
|
-
r: props.radius + 6
|
|
14891
|
-
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14892
|
-
attributeName: "r",
|
|
14893
|
-
from: "15",
|
|
14894
|
-
to: "15",
|
|
14895
|
-
begin: "0s",
|
|
14896
|
-
dur: "0.8s",
|
|
14897
|
-
values: "15;9;15",
|
|
14898
|
-
calcMode: "linear",
|
|
14899
|
-
repeatCount: "indefinite"
|
|
14900
|
-
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14901
|
-
attributeName: "fillOpacity",
|
|
14902
|
-
from: "1",
|
|
14903
|
-
to: "1",
|
|
14904
|
-
begin: "0s",
|
|
14905
|
-
dur: "0.8s",
|
|
14906
|
-
values: "1;.5;1",
|
|
14907
|
-
calcMode: "linear",
|
|
14908
|
-
repeatCount: "indefinite"
|
|
14909
|
-
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
14910
|
-
cx: "60",
|
|
14911
|
-
cy: "15",
|
|
14912
|
-
r: props.radius,
|
|
14913
|
-
attributeName: "fillOpacity",
|
|
14914
|
-
from: "1",
|
|
14915
|
-
to: "0.3"
|
|
14916
|
-
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14917
|
-
attributeName: "r",
|
|
14918
|
-
from: "9",
|
|
14919
|
-
to: "9",
|
|
14920
|
-
begin: "0s",
|
|
14921
|
-
dur: "0.8s",
|
|
14922
|
-
values: "9;15;9",
|
|
14923
|
-
calcMode: "linear",
|
|
14924
|
-
repeatCount: "indefinite"
|
|
14925
|
-
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14926
|
-
attributeName: "fillOpacity",
|
|
14927
|
-
from: "0.5",
|
|
14928
|
-
to: "0.5",
|
|
14929
|
-
begin: "0s",
|
|
14930
|
-
dur: "0.8s",
|
|
14931
|
-
values: ".5;1;.5",
|
|
14932
|
-
calcMode: "linear",
|
|
14933
|
-
repeatCount: "indefinite"
|
|
14934
|
-
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
14935
|
-
cx: "105",
|
|
14936
|
-
cy: "15",
|
|
14937
|
-
r: props.radius + 6
|
|
14938
|
-
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
14939
|
-
attributeName: "r",
|
|
14940
|
-
from: "15",
|
|
14941
|
-
to: "15",
|
|
14942
|
-
begin: "0s",
|
|
14943
|
-
dur: "0.8s",
|
|
14944
|
-
values: "15;9;15",
|
|
14945
|
-
calcMode: "linear",
|
|
14946
|
-
repeatCount: "indefinite"
|
|
14947
|
-
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
14948
|
-
attributeName: "fillOpacity",
|
|
14949
|
-
from: "1",
|
|
14950
|
-
to: "1",
|
|
14951
|
-
begin: "0s",
|
|
14952
|
-
dur: "0.8s",
|
|
14953
|
-
values: "1;.5;1",
|
|
14954
|
-
calcMode: "linear",
|
|
14955
|
-
repeatCount: "indefinite"
|
|
14956
|
-
}))));
|
|
14957
|
-
Loader.defaultProps = {
|
|
14958
|
-
height: 50,
|
|
14959
|
-
width: 35,
|
|
14960
|
-
color: "#32aea1",
|
|
14961
|
-
label: "Loading data..",
|
|
14962
|
-
radius: 9
|
|
14963
|
-
};
|
|
14964
|
-
|
|
14965
|
-
function TextInput(_ref) {
|
|
14966
|
-
var _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
14934
|
+
function Title(_ref) {
|
|
14967
14935
|
let {
|
|
14936
|
+
initWithUserTitle = true,
|
|
14968
14937
|
store,
|
|
14969
|
-
fieldName,
|
|
14970
14938
|
...otherProps
|
|
14971
14939
|
} = _ref;
|
|
14972
14940
|
const {
|
|
@@ -14975,83 +14943,157 @@ function TextInput(_ref) {
|
|
|
14975
14943
|
const {
|
|
14976
14944
|
dispatch,
|
|
14977
14945
|
state: {
|
|
14978
|
-
|
|
14979
|
-
|
|
14980
|
-
loading
|
|
14946
|
+
title: stateTitle,
|
|
14947
|
+
titleError
|
|
14981
14948
|
}
|
|
14982
14949
|
} = useContext(store);
|
|
14983
|
-
const [
|
|
14950
|
+
const [title, setTitle] = useState(stateTitle);
|
|
14984
14951
|
const [finishedTyping, setFinishedTyping] = useState(false);
|
|
14985
14952
|
const handleInputChange = useCallback(value => {
|
|
14986
|
-
|
|
14953
|
+
setTitle(value);
|
|
14987
14954
|
if (finishedTyping) {
|
|
14988
|
-
if (
|
|
14955
|
+
if (title !== null && title !== void 0 && title.length) {
|
|
14989
14956
|
dispatch({
|
|
14990
|
-
type:
|
|
14991
|
-
payload:
|
|
14992
|
-
[fieldName]: value,
|
|
14993
|
-
[fieldName + "Error"]: null
|
|
14994
|
-
}
|
|
14957
|
+
type: SET_TITLE,
|
|
14958
|
+
payload: title
|
|
14995
14959
|
});
|
|
14996
14960
|
} else {
|
|
14997
14961
|
if (otherProps.required) {
|
|
14998
14962
|
dispatch({
|
|
14999
|
-
type:
|
|
15000
|
-
payload:
|
|
15001
|
-
[fieldName + "Error"]: t("validation.enterFieldName", {
|
|
15002
|
-
fieldName: otherProps.label
|
|
15003
|
-
}),
|
|
15004
|
-
[fieldName]: null
|
|
15005
|
-
}
|
|
14963
|
+
type: SET_TITLE_ERROR,
|
|
14964
|
+
payload: t("validation.enterTitle")
|
|
15006
14965
|
});
|
|
15007
14966
|
} else {
|
|
15008
14967
|
dispatch({
|
|
15009
|
-
type:
|
|
15010
|
-
payload:
|
|
15011
|
-
[fieldName]: value,
|
|
15012
|
-
[fieldName + "Error"]: null
|
|
15013
|
-
}
|
|
14968
|
+
type: SET_TITLE,
|
|
14969
|
+
payload: title
|
|
15014
14970
|
});
|
|
15015
14971
|
}
|
|
15016
14972
|
}
|
|
15017
14973
|
}
|
|
15018
|
-
}, [dispatch,
|
|
14974
|
+
}, [dispatch, title, finishedTyping] // eslint-disable-line react-hooks/exhaustive-deps
|
|
15019
14975
|
);
|
|
15020
14976
|
|
|
15021
14977
|
useEffect(() => {
|
|
15022
|
-
handleInputChange(
|
|
15023
|
-
}, [finishedTyping,
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
14978
|
+
handleInputChange(title);
|
|
14979
|
+
}, [finishedTyping, title, handleInputChange]);
|
|
14980
|
+
|
|
14981
|
+
// Initialize title field with user's title
|
|
14982
|
+
const loadTitleIntoField = () => {
|
|
14983
|
+
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro$user$r, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$;
|
|
14984
|
+
handleInputChange((_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : (_window$Pelcro$user$r = _window$Pelcro$user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.title);
|
|
14985
|
+
dispatch({
|
|
14986
|
+
type: SET_TITLE,
|
|
14987
|
+
payload: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : (_window$Pelcro2$user$ = _window$Pelcro2$user.read()) === null || _window$Pelcro2$user$ === void 0 ? void 0 : _window$Pelcro2$user$.title
|
|
14988
|
+
});
|
|
14989
|
+
};
|
|
14990
|
+
useEffect(() => {
|
|
14991
|
+
if (initWithUserTitle) {
|
|
14992
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
14993
|
+
loadTitleIntoField();
|
|
14994
|
+
});
|
|
14995
|
+
loadTitleIntoField();
|
|
14996
|
+
return () => {
|
|
14997
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
14998
|
+
};
|
|
14999
|
+
}
|
|
15000
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
15001
|
+
|
|
15027
15002
|
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
15028
15003
|
type: "text",
|
|
15029
|
-
error:
|
|
15030
|
-
value:
|
|
15031
|
-
defaultValue: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : (_window$Pelcro$user$r2 = _window$Pelcro$user$r.metadata) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2[fieldName],
|
|
15004
|
+
error: titleError,
|
|
15005
|
+
value: title,
|
|
15032
15006
|
onChange: e => handleInputChange(e.target.value),
|
|
15033
15007
|
onBlur: () => setFinishedTyping(true),
|
|
15034
15008
|
onFocus: () => setFinishedTyping(false)
|
|
15035
15009
|
}, otherProps));
|
|
15036
15010
|
}
|
|
15037
15011
|
|
|
15038
|
-
const
|
|
15039
|
-
|
|
15040
|
-
|
|
15041
|
-
}));
|
|
15042
|
-
};
|
|
15012
|
+
const RegisterJobTitle = props => /*#__PURE__*/React__default.createElement(Title, Object.assign({
|
|
15013
|
+
store: store$m
|
|
15014
|
+
}, props));
|
|
15043
15015
|
|
|
15044
|
-
|
|
15045
|
-
|
|
15046
|
-
|
|
15047
|
-
|
|
15048
|
-
|
|
15016
|
+
function Company(_ref) {
|
|
15017
|
+
let {
|
|
15018
|
+
initWithUserCompany = true,
|
|
15019
|
+
store,
|
|
15020
|
+
...otherProps
|
|
15021
|
+
} = _ref;
|
|
15022
|
+
const {
|
|
15023
|
+
t
|
|
15024
|
+
} = useTranslation("common");
|
|
15025
|
+
const {
|
|
15026
|
+
dispatch,
|
|
15027
|
+
state: {
|
|
15028
|
+
company: stateCompany,
|
|
15029
|
+
companyError
|
|
15030
|
+
}
|
|
15031
|
+
} = useContext(store);
|
|
15032
|
+
const [company, setCompany] = useState(stateCompany);
|
|
15033
|
+
const [finishedTyping, setFinishedTyping] = useState(false);
|
|
15034
|
+
const handleInputChange = useCallback(value => {
|
|
15035
|
+
setCompany(value);
|
|
15036
|
+
if (finishedTyping) {
|
|
15037
|
+
if (company !== null && company !== void 0 && company.length) {
|
|
15038
|
+
dispatch({
|
|
15039
|
+
type: SET_COMPANY,
|
|
15040
|
+
payload: company
|
|
15041
|
+
});
|
|
15042
|
+
} else {
|
|
15043
|
+
if (otherProps.required) {
|
|
15044
|
+
dispatch({
|
|
15045
|
+
type: SET_COMPANY_ERROR,
|
|
15046
|
+
payload: t("validation.enterCompany")
|
|
15047
|
+
});
|
|
15048
|
+
} else {
|
|
15049
|
+
dispatch({
|
|
15050
|
+
type: SET_COMPANY,
|
|
15051
|
+
payload: company
|
|
15052
|
+
});
|
|
15053
|
+
}
|
|
15054
|
+
}
|
|
15055
|
+
}
|
|
15056
|
+
}, [dispatch, company, finishedTyping] // eslint-disable-line react-hooks/exhaustive-deps
|
|
15057
|
+
);
|
|
15049
15058
|
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15059
|
+
useEffect(() => {
|
|
15060
|
+
handleInputChange(company);
|
|
15061
|
+
}, [finishedTyping, company, handleInputChange]);
|
|
15062
|
+
|
|
15063
|
+
// Initialize company field with user's company
|
|
15064
|
+
const loadCompanyIntoField = () => {
|
|
15065
|
+
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$, _window$Pelcro2$user$2;
|
|
15066
|
+
handleInputChange((_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : (_window$Pelcro$user$r = _window$Pelcro$user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : (_window$Pelcro$user$r2 = _window$Pelcro$user$r.organization) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.name);
|
|
15067
|
+
dispatch({
|
|
15068
|
+
type: SET_COMPANY,
|
|
15069
|
+
payload: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : (_window$Pelcro2$user$ = _window$Pelcro2$user.read()) === null || _window$Pelcro2$user$ === void 0 ? void 0 : (_window$Pelcro2$user$2 = _window$Pelcro2$user$.organization) === null || _window$Pelcro2$user$2 === void 0 ? void 0 : _window$Pelcro2$user$2.name
|
|
15070
|
+
});
|
|
15071
|
+
};
|
|
15072
|
+
useEffect(() => {
|
|
15073
|
+
if (initWithUserCompany) {
|
|
15074
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
15075
|
+
loadCompanyIntoField();
|
|
15076
|
+
});
|
|
15077
|
+
loadCompanyIntoField();
|
|
15078
|
+
return () => {
|
|
15079
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
15080
|
+
};
|
|
15081
|
+
}
|
|
15082
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
15083
|
+
|
|
15084
|
+
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
15085
|
+
type: "text",
|
|
15086
|
+
error: companyError,
|
|
15087
|
+
value: company,
|
|
15088
|
+
onChange: e => handleInputChange(e.target.value),
|
|
15089
|
+
onBlur: () => setFinishedTyping(true),
|
|
15090
|
+
onFocus: () => setFinishedTyping(false)
|
|
15091
|
+
}, otherProps));
|
|
15092
|
+
}
|
|
15093
|
+
|
|
15094
|
+
const RegisterCompany = props => /*#__PURE__*/React__default.createElement(Company, Object.assign({
|
|
15095
|
+
store: store$m
|
|
15096
|
+
}, props));
|
|
15055
15097
|
|
|
15056
15098
|
/**
|
|
15057
15099
|
*
|
|
@@ -23457,6 +23499,93 @@ const NewsletterUpdateButton = _ref => {
|
|
|
23457
23499
|
}, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
|
|
23458
23500
|
};
|
|
23459
23501
|
|
|
23502
|
+
const Loader = props => /*#__PURE__*/React__default.createElement("div", {
|
|
23503
|
+
className: `pelcro-loader-wrapper ${props.className}`
|
|
23504
|
+
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
23505
|
+
width: props.width,
|
|
23506
|
+
height: props.height,
|
|
23507
|
+
viewBox: "0 0 120 30",
|
|
23508
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23509
|
+
fill: "currentColor",
|
|
23510
|
+
"aria-label": props.label
|
|
23511
|
+
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
23512
|
+
cx: "15",
|
|
23513
|
+
cy: "15",
|
|
23514
|
+
r: props.radius + 6
|
|
23515
|
+
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
23516
|
+
attributeName: "r",
|
|
23517
|
+
from: "15",
|
|
23518
|
+
to: "15",
|
|
23519
|
+
begin: "0s",
|
|
23520
|
+
dur: "0.8s",
|
|
23521
|
+
values: "15;9;15",
|
|
23522
|
+
calcMode: "linear",
|
|
23523
|
+
repeatCount: "indefinite"
|
|
23524
|
+
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
23525
|
+
attributeName: "fillOpacity",
|
|
23526
|
+
from: "1",
|
|
23527
|
+
to: "1",
|
|
23528
|
+
begin: "0s",
|
|
23529
|
+
dur: "0.8s",
|
|
23530
|
+
values: "1;.5;1",
|
|
23531
|
+
calcMode: "linear",
|
|
23532
|
+
repeatCount: "indefinite"
|
|
23533
|
+
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
23534
|
+
cx: "60",
|
|
23535
|
+
cy: "15",
|
|
23536
|
+
r: props.radius,
|
|
23537
|
+
attributeName: "fillOpacity",
|
|
23538
|
+
from: "1",
|
|
23539
|
+
to: "0.3"
|
|
23540
|
+
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
23541
|
+
attributeName: "r",
|
|
23542
|
+
from: "9",
|
|
23543
|
+
to: "9",
|
|
23544
|
+
begin: "0s",
|
|
23545
|
+
dur: "0.8s",
|
|
23546
|
+
values: "9;15;9",
|
|
23547
|
+
calcMode: "linear",
|
|
23548
|
+
repeatCount: "indefinite"
|
|
23549
|
+
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
23550
|
+
attributeName: "fillOpacity",
|
|
23551
|
+
from: "0.5",
|
|
23552
|
+
to: "0.5",
|
|
23553
|
+
begin: "0s",
|
|
23554
|
+
dur: "0.8s",
|
|
23555
|
+
values: ".5;1;.5",
|
|
23556
|
+
calcMode: "linear",
|
|
23557
|
+
repeatCount: "indefinite"
|
|
23558
|
+
})), /*#__PURE__*/React__default.createElement("circle", {
|
|
23559
|
+
cx: "105",
|
|
23560
|
+
cy: "15",
|
|
23561
|
+
r: props.radius + 6
|
|
23562
|
+
}, /*#__PURE__*/React__default.createElement("animate", {
|
|
23563
|
+
attributeName: "r",
|
|
23564
|
+
from: "15",
|
|
23565
|
+
to: "15",
|
|
23566
|
+
begin: "0s",
|
|
23567
|
+
dur: "0.8s",
|
|
23568
|
+
values: "15;9;15",
|
|
23569
|
+
calcMode: "linear",
|
|
23570
|
+
repeatCount: "indefinite"
|
|
23571
|
+
}), /*#__PURE__*/React__default.createElement("animate", {
|
|
23572
|
+
attributeName: "fillOpacity",
|
|
23573
|
+
from: "1",
|
|
23574
|
+
to: "1",
|
|
23575
|
+
begin: "0s",
|
|
23576
|
+
dur: "0.8s",
|
|
23577
|
+
values: "1;.5;1",
|
|
23578
|
+
calcMode: "linear",
|
|
23579
|
+
repeatCount: "indefinite"
|
|
23580
|
+
}))));
|
|
23581
|
+
Loader.defaultProps = {
|
|
23582
|
+
height: 50,
|
|
23583
|
+
width: 35,
|
|
23584
|
+
color: "#32aea1",
|
|
23585
|
+
label: "Loading data..",
|
|
23586
|
+
radius: 9
|
|
23587
|
+
};
|
|
23588
|
+
|
|
23460
23589
|
const NewsletterUpdateList = () => {
|
|
23461
23590
|
const handleSelectNewsletter = event => {
|
|
23462
23591
|
dispatch({
|
|
@@ -24135,7 +24264,7 @@ function SubscriptionManageMembersModal(_ref) {
|
|
|
24135
24264
|
}
|
|
24136
24265
|
SubscriptionManageMembersModal.viewId = "manage-members";
|
|
24137
24266
|
|
|
24138
|
-
var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5, _window$Pelcro$user$r6, _window$Pelcro$user$r7;
|
|
24267
|
+
var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5, _window$Pelcro$user$r6, _window$Pelcro$user$r7, _window$Pelcro$user$r8, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
24139
24268
|
const initialState$g = {
|
|
24140
24269
|
email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
|
|
24141
24270
|
emailError: null,
|
|
@@ -24145,10 +24274,14 @@ const initialState$g = {
|
|
|
24145
24274
|
lastNameError: null,
|
|
24146
24275
|
username: (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.username,
|
|
24147
24276
|
usernameError: null,
|
|
24148
|
-
|
|
24149
|
-
|
|
24277
|
+
company: (_window$Pelcro$user$r5 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : (_window$Pelcro$user$r6 = _window$Pelcro$user$r5.organization) === null || _window$Pelcro$user$r6 === void 0 ? void 0 : _window$Pelcro$user$r6.name,
|
|
24278
|
+
companyError: null,
|
|
24279
|
+
title: (_window$Pelcro$user$r7 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r7 === void 0 ? void 0 : _window$Pelcro$user$r7.title,
|
|
24280
|
+
titleError: null,
|
|
24281
|
+
displayName: (_window$Pelcro$user$r8 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r8 === void 0 ? void 0 : _window$Pelcro$user$r8.display_name,
|
|
24282
|
+
phone: (_window$Pelcro$user$r9 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r9 === void 0 ? void 0 : _window$Pelcro$user$r9.phone,
|
|
24150
24283
|
phoneError: null,
|
|
24151
|
-
tin: (_window$Pelcro$user$
|
|
24284
|
+
tin: (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.tin,
|
|
24152
24285
|
buttonDisabled: false,
|
|
24153
24286
|
textFields: {},
|
|
24154
24287
|
alert: {
|
|
@@ -24178,28 +24311,34 @@ const UserUpdateContainer = _ref => {
|
|
|
24178
24311
|
loadUserDataIntoFields();
|
|
24179
24312
|
}, []);
|
|
24180
24313
|
const loadUserDataIntoFields = () => {
|
|
24181
|
-
var _window$Pelcro$user$
|
|
24314
|
+
var _window$Pelcro$user$r11, _window$Pelcro$user$r12, _window$Pelcro$user$r13, _window$Pelcro$user$r14, _window$Pelcro$user$r15, _window$Pelcro$user$r16, _window$Pelcro$user$r17, _window$Pelcro$user$r18, _window$Pelcro$user$r19, _window$Pelcro$user$r20;
|
|
24182
24315
|
const fields = [{
|
|
24183
24316
|
type: SET_EMAIL,
|
|
24184
|
-
payload: (_window$Pelcro$user$
|
|
24317
|
+
payload: (_window$Pelcro$user$r11 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r11 === void 0 ? void 0 : _window$Pelcro$user$r11.email
|
|
24185
24318
|
}, {
|
|
24186
24319
|
type: SET_FIRST_NAME,
|
|
24187
|
-
payload: (_window$Pelcro$user$
|
|
24320
|
+
payload: (_window$Pelcro$user$r12 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r12 === void 0 ? void 0 : _window$Pelcro$user$r12.first_name
|
|
24188
24321
|
}, {
|
|
24189
24322
|
type: SET_LAST_NAME,
|
|
24190
|
-
payload: (_window$Pelcro$user$
|
|
24323
|
+
payload: (_window$Pelcro$user$r13 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r13 === void 0 ? void 0 : _window$Pelcro$user$r13.last_name
|
|
24191
24324
|
}, {
|
|
24192
24325
|
type: SET_USERNAME,
|
|
24193
|
-
payload: (_window$Pelcro$user$
|
|
24326
|
+
payload: (_window$Pelcro$user$r14 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r14 === void 0 ? void 0 : _window$Pelcro$user$r14.username
|
|
24194
24327
|
}, {
|
|
24195
24328
|
type: SET_DISPLAY_NAME,
|
|
24196
|
-
payload: (_window$Pelcro$user$
|
|
24329
|
+
payload: (_window$Pelcro$user$r15 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r15 === void 0 ? void 0 : _window$Pelcro$user$r15.display_name
|
|
24197
24330
|
}, {
|
|
24198
24331
|
type: SET_PHONE,
|
|
24199
|
-
payload: (_window$Pelcro$user$
|
|
24332
|
+
payload: (_window$Pelcro$user$r16 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r16 === void 0 ? void 0 : _window$Pelcro$user$r16.phone
|
|
24200
24333
|
}, {
|
|
24201
24334
|
type: SET_TIN,
|
|
24202
|
-
payload: (_window$Pelcro$user$
|
|
24335
|
+
payload: (_window$Pelcro$user$r17 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r17 === void 0 ? void 0 : _window$Pelcro$user$r17.tin
|
|
24336
|
+
}, {
|
|
24337
|
+
type: SET_COMPANY,
|
|
24338
|
+
payload: (_window$Pelcro$user$r18 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r18 === void 0 ? void 0 : (_window$Pelcro$user$r19 = _window$Pelcro$user$r18.organization) === null || _window$Pelcro$user$r19 === void 0 ? void 0 : _window$Pelcro$user$r19.name
|
|
24339
|
+
}, {
|
|
24340
|
+
type: SET_TITLE,
|
|
24341
|
+
payload: (_window$Pelcro$user$r20 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r20 === void 0 ? void 0 : _window$Pelcro$user$r20.title
|
|
24203
24342
|
}];
|
|
24204
24343
|
fields.filter(field => Boolean(field.payload)).forEach(field => {
|
|
24205
24344
|
dispatch(field);
|
|
@@ -24214,7 +24353,9 @@ const UserUpdateContainer = _ref => {
|
|
|
24214
24353
|
phone,
|
|
24215
24354
|
tin,
|
|
24216
24355
|
textFields,
|
|
24217
|
-
displayName
|
|
24356
|
+
displayName,
|
|
24357
|
+
company,
|
|
24358
|
+
title
|
|
24218
24359
|
} = _ref2;
|
|
24219
24360
|
window.Pelcro.user.update({
|
|
24220
24361
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
@@ -24227,6 +24368,8 @@ const UserUpdateContainer = _ref => {
|
|
|
24227
24368
|
display_name: displayName,
|
|
24228
24369
|
phone: phone,
|
|
24229
24370
|
tin: tin,
|
|
24371
|
+
organization: company,
|
|
24372
|
+
title: title,
|
|
24230
24373
|
metadata: {
|
|
24231
24374
|
updated: "updated",
|
|
24232
24375
|
...textFields
|
|
@@ -24320,6 +24463,30 @@ const UserUpdateContainer = _ref => {
|
|
|
24320
24463
|
usernameError: action.payload,
|
|
24321
24464
|
username: ""
|
|
24322
24465
|
});
|
|
24466
|
+
case SET_COMPANY:
|
|
24467
|
+
return lib_7({
|
|
24468
|
+
...state,
|
|
24469
|
+
company: action.payload,
|
|
24470
|
+
companyError: null
|
|
24471
|
+
});
|
|
24472
|
+
case SET_COMPANY_ERROR:
|
|
24473
|
+
return lib_7({
|
|
24474
|
+
...state,
|
|
24475
|
+
companyError: action.payload,
|
|
24476
|
+
company: ""
|
|
24477
|
+
});
|
|
24478
|
+
case SET_TITLE:
|
|
24479
|
+
return lib_7({
|
|
24480
|
+
...state,
|
|
24481
|
+
title: action.payload,
|
|
24482
|
+
titleError: null
|
|
24483
|
+
});
|
|
24484
|
+
case SET_TITLE_ERROR:
|
|
24485
|
+
return lib_7({
|
|
24486
|
+
...state,
|
|
24487
|
+
titleError: action.payload,
|
|
24488
|
+
title: ""
|
|
24489
|
+
});
|
|
24323
24490
|
case SET_PHONE:
|
|
24324
24491
|
return lib_7({
|
|
24325
24492
|
...state,
|
|
@@ -24772,12 +24939,116 @@ function UserUpdateModal(_ref) {
|
|
|
24772
24939
|
}
|
|
24773
24940
|
UserUpdateModal.viewId = "user-edit";
|
|
24774
24941
|
|
|
24942
|
+
function TextInput(_ref) {
|
|
24943
|
+
var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
|
|
24944
|
+
let {
|
|
24945
|
+
initWithFieldName = true,
|
|
24946
|
+
store,
|
|
24947
|
+
fieldName,
|
|
24948
|
+
...otherProps
|
|
24949
|
+
} = _ref;
|
|
24950
|
+
const {
|
|
24951
|
+
t
|
|
24952
|
+
} = useTranslation("common");
|
|
24953
|
+
const {
|
|
24954
|
+
dispatch,
|
|
24955
|
+
state: {
|
|
24956
|
+
[fieldName]: stateFieldName,
|
|
24957
|
+
[fieldName + "Error"]: fieldNameError,
|
|
24958
|
+
loading
|
|
24959
|
+
}
|
|
24960
|
+
} = useContext(store);
|
|
24961
|
+
const [fieldNameState, setFieldNameState] = useState(stateFieldName);
|
|
24962
|
+
const [finishedTyping, setFinishedTyping] = useState(false);
|
|
24963
|
+
const handleInputChange = useCallback(value => {
|
|
24964
|
+
setFieldNameState(value);
|
|
24965
|
+
if (finishedTyping) {
|
|
24966
|
+
if (fieldNameState !== null && fieldNameState !== void 0 && fieldNameState.length) {
|
|
24967
|
+
dispatch({
|
|
24968
|
+
type: SET_TEXT_FIELD,
|
|
24969
|
+
payload: {
|
|
24970
|
+
[fieldName]: value,
|
|
24971
|
+
[fieldName + "Error"]: null
|
|
24972
|
+
}
|
|
24973
|
+
});
|
|
24974
|
+
} else {
|
|
24975
|
+
if (otherProps.required) {
|
|
24976
|
+
dispatch({
|
|
24977
|
+
type: SET_TEXT_FIELD_ERROR,
|
|
24978
|
+
payload: {
|
|
24979
|
+
[fieldName + "Error"]: t("validation.enterFieldName", {
|
|
24980
|
+
fieldName: otherProps.label
|
|
24981
|
+
}),
|
|
24982
|
+
[fieldName]: null
|
|
24983
|
+
}
|
|
24984
|
+
});
|
|
24985
|
+
} else {
|
|
24986
|
+
dispatch({
|
|
24987
|
+
type: SET_TEXT_FIELD,
|
|
24988
|
+
payload: {
|
|
24989
|
+
[fieldName]: value,
|
|
24990
|
+
[fieldName + "Error"]: null
|
|
24991
|
+
}
|
|
24992
|
+
});
|
|
24993
|
+
}
|
|
24994
|
+
}
|
|
24995
|
+
}
|
|
24996
|
+
}, [dispatch, fieldNameState, finishedTyping] // eslint-disable-line react-hooks/exhaustive-deps
|
|
24997
|
+
);
|
|
24998
|
+
|
|
24999
|
+
useEffect(() => {
|
|
25000
|
+
handleInputChange(fieldNameState);
|
|
25001
|
+
}, [finishedTyping, fieldNameState, handleInputChange]);
|
|
25002
|
+
|
|
25003
|
+
// Initialize field name field with user's first name
|
|
25004
|
+
const loadFieldNameIntoField = () => {
|
|
25005
|
+
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$, _window$Pelcro2$user$2;
|
|
25006
|
+
handleInputChange((_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : (_window$Pelcro$user$r = _window$Pelcro$user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : (_window$Pelcro$user$r2 = _window$Pelcro$user$r.metadata) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2[fieldName]);
|
|
25007
|
+
dispatch({
|
|
25008
|
+
type: SET_TEXT_FIELD,
|
|
25009
|
+
payload: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : (_window$Pelcro2$user$ = _window$Pelcro2$user.read()) === null || _window$Pelcro2$user$ === void 0 ? void 0 : (_window$Pelcro2$user$2 = _window$Pelcro2$user$.metadata) === null || _window$Pelcro2$user$2 === void 0 ? void 0 : _window$Pelcro2$user$2[fieldName]
|
|
25010
|
+
});
|
|
25011
|
+
};
|
|
25012
|
+
useEffect(() => {
|
|
25013
|
+
if (initWithFieldName) {
|
|
25014
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
25015
|
+
loadFieldNameIntoField();
|
|
25016
|
+
});
|
|
25017
|
+
loadFieldNameIntoField();
|
|
25018
|
+
return () => {
|
|
25019
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
25020
|
+
};
|
|
25021
|
+
}
|
|
25022
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
25023
|
+
|
|
25024
|
+
if (loading) {
|
|
25025
|
+
return /*#__PURE__*/React__default.createElement(Loader, null);
|
|
25026
|
+
}
|
|
25027
|
+
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
25028
|
+
type: "text",
|
|
25029
|
+
error: fieldNameError,
|
|
25030
|
+
value: fieldNameState,
|
|
25031
|
+
defaultValue: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : (_window$Pelcro$user$r4 = _window$Pelcro$user$r3.metadata) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4[fieldName],
|
|
25032
|
+
onChange: e => handleInputChange(e.target.value),
|
|
25033
|
+
onBlur: () => setFinishedTyping(true),
|
|
25034
|
+
onFocus: () => setFinishedTyping(false)
|
|
25035
|
+
}, otherProps));
|
|
25036
|
+
}
|
|
25037
|
+
|
|
24775
25038
|
const UserUpdateTextInput = props => {
|
|
24776
25039
|
return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
|
|
24777
25040
|
store: store$g
|
|
24778
25041
|
}));
|
|
24779
25042
|
};
|
|
24780
25043
|
|
|
25044
|
+
const UserUpdateCompany = props => /*#__PURE__*/React__default.createElement(Company, Object.assign({
|
|
25045
|
+
store: store$g
|
|
25046
|
+
}, props));
|
|
25047
|
+
|
|
25048
|
+
const UserUpdateJobTitle = props => /*#__PURE__*/React__default.createElement(Title, Object.assign({
|
|
25049
|
+
store: store$g
|
|
25050
|
+
}, props));
|
|
25051
|
+
|
|
24781
25052
|
const initialState$f = {
|
|
24782
25053
|
isSubmitting: false,
|
|
24783
25054
|
firstName: "",
|
|
@@ -36160,4 +36431,4 @@ const QrCodeModal = _ref => {
|
|
|
36160
36431
|
};
|
|
36161
36432
|
QrCodeModal.viewId = "qrcode";
|
|
36162
36433
|
|
|
36163
|
-
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplePayButton, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, DonationModalWithHook as DonationModal, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodCreateContainer, PaymentMethodCreateModal, PaymentMethodCreateView, PaymentMethodDeleteContainer, PaymentMethodDeleteList, PaymentMethodDeleteModal, PaymentMethodDeleteOptions, PaymentMethodDeleteSubmit, PaymentMethodDeleteView, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateSetDefault, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, TextInput, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };
|
|
36434
|
+
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplePayButton, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, DonationModalWithHook as DonationModal, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodCreateContainer, PaymentMethodCreateModal, PaymentMethodCreateView, PaymentMethodDeleteContainer, PaymentMethodDeleteList, PaymentMethodDeleteModal, PaymentMethodDeleteOptions, PaymentMethodDeleteSubmit, PaymentMethodDeleteView, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateSetDefault, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, TextInput, Tooltip, UserNameInput, UserUpdateButton, UserUpdateCompany, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateJobTitle, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };
|