@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.cjs.js
CHANGED
|
@@ -3252,6 +3252,8 @@ var validation$3 = {
|
|
|
3252
3252
|
enterFirstName: "First name is required.",
|
|
3253
3253
|
enterLastName: "Last name is required.",
|
|
3254
3254
|
enterPhone: "Phone number is required.",
|
|
3255
|
+
enterCompany: "Company is required.",
|
|
3256
|
+
enterTitle: "Title is required.",
|
|
3255
3257
|
enterFieldName: "{{fieldName}} is required."
|
|
3256
3258
|
};
|
|
3257
3259
|
var buttons$n = {
|
|
@@ -3566,7 +3568,9 @@ var labels$12 = {
|
|
|
3566
3568
|
required: "required",
|
|
3567
3569
|
firstName: "First name",
|
|
3568
3570
|
lastName: "Last name",
|
|
3569
|
-
phone: "Phone"
|
|
3571
|
+
phone: "Phone",
|
|
3572
|
+
company: "Company",
|
|
3573
|
+
title: "Title"
|
|
3570
3574
|
};
|
|
3571
3575
|
var messages$15 = {
|
|
3572
3576
|
alreadyHaveAccount: "Already have an account?",
|
|
@@ -3666,7 +3670,9 @@ var labels$11 = {
|
|
|
3666
3670
|
selectImage: "Upload new photo",
|
|
3667
3671
|
removeImage: "Remove current photo",
|
|
3668
3672
|
zoom: "Zoom",
|
|
3669
|
-
tin: "Tax Identification Number"
|
|
3673
|
+
tin: "Tax Identification Number",
|
|
3674
|
+
company: "Company",
|
|
3675
|
+
userTitle: "Title"
|
|
3670
3676
|
};
|
|
3671
3677
|
var messages$14 = {
|
|
3672
3678
|
userUpdated: "Thanks! Your profile was updated successfully.",
|
|
@@ -4206,6 +4212,8 @@ var validation$2 = {
|
|
|
4206
4212
|
enterFirstName: "Le prénom est requis.",
|
|
4207
4213
|
enterLastName: "Le nom de famille est requis.",
|
|
4208
4214
|
enterPhone: "Le numéro de téléphone est requis.",
|
|
4215
|
+
enterCompany: "L'entreprise est obligatoire.",
|
|
4216
|
+
enterTitle: "Le titre est obligatoire.",
|
|
4209
4217
|
enterFieldName: "{{fieldName}} est requis."
|
|
4210
4218
|
};
|
|
4211
4219
|
var buttons$h = {
|
|
@@ -4520,7 +4528,9 @@ var labels$M = {
|
|
|
4520
4528
|
required: "Champs obligatoires",
|
|
4521
4529
|
firstName: "Prénom",
|
|
4522
4530
|
lastName: "Nom de famille",
|
|
4523
|
-
phone: "Téléphoner"
|
|
4531
|
+
phone: "Téléphoner",
|
|
4532
|
+
company: "Entreprise",
|
|
4533
|
+
title: "Titre"
|
|
4524
4534
|
};
|
|
4525
4535
|
var messages$O = {
|
|
4526
4536
|
alreadyHaveAccount: "Vous avez déjà un compte?",
|
|
@@ -4621,7 +4631,9 @@ var labels$L = {
|
|
|
4621
4631
|
selectImage: "Télécharger une nouvelle photo",
|
|
4622
4632
|
removeImage: "supprimer la photo actuelle",
|
|
4623
4633
|
zoom: "Zoom",
|
|
4624
|
-
tin: "Numéro d'identification fiscale"
|
|
4634
|
+
tin: "Numéro d'identification fiscale",
|
|
4635
|
+
company: "Entreprise",
|
|
4636
|
+
userTitle: "Titre"
|
|
4625
4637
|
};
|
|
4626
4638
|
var messages$N = {
|
|
4627
4639
|
userUpdated: "Votre profil a été mis à jour avec succès.",
|
|
@@ -5150,6 +5162,8 @@ var validation$1 = {
|
|
|
5150
5162
|
enterFirstName: "이름은 필수 항목입니다.",
|
|
5151
5163
|
enterLastName: "성은 필수 항목입니다.",
|
|
5152
5164
|
enterPhone: "전화번호는 필수 항목입니다.",
|
|
5165
|
+
enterCompany: "회사는 필수입니다.",
|
|
5166
|
+
enterTitle: "제목은 필수 입력 사항입니다.",
|
|
5153
5167
|
enterFieldName: "{{fieldName}} 필수."
|
|
5154
5168
|
};
|
|
5155
5169
|
var buttons$b = {
|
|
@@ -5464,7 +5478,9 @@ var labels$u = {
|
|
|
5464
5478
|
required: "필수 항목",
|
|
5465
5479
|
firstName: "이름",
|
|
5466
5480
|
lastName: "성",
|
|
5467
|
-
phone: "핸드폰"
|
|
5481
|
+
phone: "핸드폰",
|
|
5482
|
+
company: "회사",
|
|
5483
|
+
title: "제목"
|
|
5468
5484
|
};
|
|
5469
5485
|
var messages$v = {
|
|
5470
5486
|
alreadyHaveAccount: "이미 계정이 있습니까?",
|
|
@@ -5564,7 +5580,9 @@ var labels$t = {
|
|
|
5564
5580
|
selectImage: "새로운 사진 업로드",
|
|
5565
5581
|
removeImage: "기존 사진 제거",
|
|
5566
5582
|
zoom: "확대",
|
|
5567
|
-
tin: "세금 식별 번호"
|
|
5583
|
+
tin: "세금 식별 번호",
|
|
5584
|
+
company: "회사",
|
|
5585
|
+
userTitle: "제목"
|
|
5568
5586
|
};
|
|
5569
5587
|
var messages$u = {
|
|
5570
5588
|
userUpdated: "감사합니다! 프로필이 성공적으로 업데이트되었습니다.",
|
|
@@ -6200,6 +6218,8 @@ var validation = {
|
|
|
6200
6218
|
enterFirstName: "El nombre es obligatorio.",
|
|
6201
6219
|
enterLastName: "El apellido es obligatorio.",
|
|
6202
6220
|
enterPhone: "El número de teléfono es obligatorio.",
|
|
6221
|
+
enterCompany: "La empresa es obligatorio.",
|
|
6222
|
+
enterTitle: "El título es obligatorio.",
|
|
6203
6223
|
enterFieldName: "{{fieldName}} es obligatorio."
|
|
6204
6224
|
};
|
|
6205
6225
|
var buttons$5 = {
|
|
@@ -6510,7 +6530,9 @@ var labels$c = {
|
|
|
6510
6530
|
required: "obligatorio",
|
|
6511
6531
|
firstName: "Nombre",
|
|
6512
6532
|
lastName: "Apellido",
|
|
6513
|
-
phone: "Teléfono"
|
|
6533
|
+
phone: "Teléfono",
|
|
6534
|
+
company: "Empresa",
|
|
6535
|
+
title: "Título"
|
|
6514
6536
|
};
|
|
6515
6537
|
var messages$c = {
|
|
6516
6538
|
alreadyHaveAccount: " ¿Ya tienes una cuenta?",
|
|
@@ -6610,7 +6632,9 @@ var labels$b = {
|
|
|
6610
6632
|
selectImage: "Subir nueva foto",
|
|
6611
6633
|
removeImage: "Eliminar foto actual",
|
|
6612
6634
|
zoom: "Acercar",
|
|
6613
|
-
tin: "Número de Identificación Fiscal"
|
|
6635
|
+
tin: "Número de Identificación Fiscal",
|
|
6636
|
+
company: "Empresa",
|
|
6637
|
+
userTitle: "Título"
|
|
6614
6638
|
};
|
|
6615
6639
|
var messages$b = {
|
|
6616
6640
|
userUpdated: "¡Gracias! Tu perfil se actualizó con éxito.",
|
|
@@ -12893,6 +12917,8 @@ const SET_PASSWORD_ERROR = "SET_PASSWORD_ERROR";
|
|
|
12893
12917
|
const SET_FIRST_NAME_ERROR = "SET_FIRST_NAME_ERROR";
|
|
12894
12918
|
const SET_LAST_NAME_ERROR = "SET_LAST_NAME_ERROR";
|
|
12895
12919
|
const SET_PHONE_ERROR = "SET_PHONE_ERROR";
|
|
12920
|
+
const SET_COMPANY_ERROR = "SET_COMPANY_ERROR";
|
|
12921
|
+
const SET_TITLE_ERROR = "SET_TITLE_ERROR";
|
|
12896
12922
|
const SET_TEXT_FIELD = "SET_TEXT_FIELD";
|
|
12897
12923
|
const SET_TEXT_FIELD_ERROR = "SET_TEXT_FIELD_ERROR";
|
|
12898
12924
|
const SET_MONTH = "SET_MONTH";
|
|
@@ -12930,6 +12956,8 @@ const SET_LAST_NAME = "SET_LAST_NAME";
|
|
|
12930
12956
|
const SET_START_DATE = "SET_START_DATE";
|
|
12931
12957
|
const SET_GIFT_MESSAGE = "SET_GIFT_MESSAGE";
|
|
12932
12958
|
const SET_PHONE = "SET_PHONE";
|
|
12959
|
+
const SET_COMPANY = "SET_COMPANY";
|
|
12960
|
+
const SET_TITLE = "SET_TITLE";
|
|
12933
12961
|
const SET_TIN = "SET_TIN";
|
|
12934
12962
|
const GET_COUNTRIES_SUCCESS = "GET_COUNTRIES_SUCCESS";
|
|
12935
12963
|
const GET_COUNTRIES_FETCH = "GET_COUNTRIES_FETCH";
|
|
@@ -13631,6 +13659,8 @@ const initialState$m = {
|
|
|
13631
13659
|
firstName: "",
|
|
13632
13660
|
lastName: "",
|
|
13633
13661
|
phone: "",
|
|
13662
|
+
company: "",
|
|
13663
|
+
title: "",
|
|
13634
13664
|
emailError: null,
|
|
13635
13665
|
passwordError: null,
|
|
13636
13666
|
confirmPassword: "",
|
|
@@ -13640,6 +13670,8 @@ const initialState$m = {
|
|
|
13640
13670
|
firstNameError: null,
|
|
13641
13671
|
lastNameError: null,
|
|
13642
13672
|
phoneError: null,
|
|
13673
|
+
companyError: null,
|
|
13674
|
+
titleError: null,
|
|
13643
13675
|
selectFields: {},
|
|
13644
13676
|
alert: {
|
|
13645
13677
|
type: "error",
|
|
@@ -13670,8 +13702,8 @@ const RegisterContainer = _ref => {
|
|
|
13670
13702
|
firstName,
|
|
13671
13703
|
lastName,
|
|
13672
13704
|
phone,
|
|
13673
|
-
|
|
13674
|
-
|
|
13705
|
+
company,
|
|
13706
|
+
title,
|
|
13675
13707
|
selectFields
|
|
13676
13708
|
} = filteredData;
|
|
13677
13709
|
if (!hasSecurityTokenEnabled$1()) {
|
|
@@ -13692,8 +13724,8 @@ const RegisterContainer = _ref => {
|
|
|
13692
13724
|
first_name: firstName,
|
|
13693
13725
|
last_name: lastName,
|
|
13694
13726
|
phone: phone,
|
|
13695
|
-
title:
|
|
13696
|
-
organization:
|
|
13727
|
+
title: title,
|
|
13728
|
+
organization: company,
|
|
13697
13729
|
security_token: securityToken,
|
|
13698
13730
|
metadata: {
|
|
13699
13731
|
...selectFields
|
|
@@ -13803,6 +13835,18 @@ const RegisterContainer = _ref => {
|
|
|
13803
13835
|
phone: action.payload,
|
|
13804
13836
|
phoneError: null
|
|
13805
13837
|
});
|
|
13838
|
+
case SET_COMPANY:
|
|
13839
|
+
return lib_7({
|
|
13840
|
+
...state,
|
|
13841
|
+
company: action.payload,
|
|
13842
|
+
companyError: null
|
|
13843
|
+
});
|
|
13844
|
+
case SET_TITLE:
|
|
13845
|
+
return lib_7({
|
|
13846
|
+
...state,
|
|
13847
|
+
title: action.payload,
|
|
13848
|
+
titleError: null
|
|
13849
|
+
});
|
|
13806
13850
|
case SET_TEXT_FIELD:
|
|
13807
13851
|
return lib_7({
|
|
13808
13852
|
...state,
|
|
@@ -13844,6 +13888,18 @@ const RegisterContainer = _ref => {
|
|
|
13844
13888
|
phoneError: action.payload,
|
|
13845
13889
|
phone: null
|
|
13846
13890
|
});
|
|
13891
|
+
case SET_COMPANY_ERROR:
|
|
13892
|
+
return lib_7({
|
|
13893
|
+
...state,
|
|
13894
|
+
companyError: action.payload,
|
|
13895
|
+
company: null
|
|
13896
|
+
});
|
|
13897
|
+
case SET_TITLE_ERROR:
|
|
13898
|
+
return lib_7({
|
|
13899
|
+
...state,
|
|
13900
|
+
titleError: action.payload,
|
|
13901
|
+
title: null
|
|
13902
|
+
});
|
|
13847
13903
|
case SET_TEXT_FIELD_ERROR:
|
|
13848
13904
|
return lib_7({
|
|
13849
13905
|
...state,
|
|
@@ -14905,98 +14961,10 @@ function hasSecurityTokenEnabled() {
|
|
|
14905
14961
|
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);
|
|
14906
14962
|
}
|
|
14907
14963
|
|
|
14908
|
-
|
|
14909
|
-
className: `pelcro-loader-wrapper ${props.className}`
|
|
14910
|
-
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
14911
|
-
width: props.width,
|
|
14912
|
-
height: props.height,
|
|
14913
|
-
viewBox: "0 0 120 30",
|
|
14914
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14915
|
-
fill: "currentColor",
|
|
14916
|
-
"aria-label": props.label
|
|
14917
|
-
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14918
|
-
cx: "15",
|
|
14919
|
-
cy: "15",
|
|
14920
|
-
r: props.radius + 6
|
|
14921
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14922
|
-
attributeName: "r",
|
|
14923
|
-
from: "15",
|
|
14924
|
-
to: "15",
|
|
14925
|
-
begin: "0s",
|
|
14926
|
-
dur: "0.8s",
|
|
14927
|
-
values: "15;9;15",
|
|
14928
|
-
calcMode: "linear",
|
|
14929
|
-
repeatCount: "indefinite"
|
|
14930
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14931
|
-
attributeName: "fillOpacity",
|
|
14932
|
-
from: "1",
|
|
14933
|
-
to: "1",
|
|
14934
|
-
begin: "0s",
|
|
14935
|
-
dur: "0.8s",
|
|
14936
|
-
values: "1;.5;1",
|
|
14937
|
-
calcMode: "linear",
|
|
14938
|
-
repeatCount: "indefinite"
|
|
14939
|
-
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14940
|
-
cx: "60",
|
|
14941
|
-
cy: "15",
|
|
14942
|
-
r: props.radius,
|
|
14943
|
-
attributeName: "fillOpacity",
|
|
14944
|
-
from: "1",
|
|
14945
|
-
to: "0.3"
|
|
14946
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14947
|
-
attributeName: "r",
|
|
14948
|
-
from: "9",
|
|
14949
|
-
to: "9",
|
|
14950
|
-
begin: "0s",
|
|
14951
|
-
dur: "0.8s",
|
|
14952
|
-
values: "9;15;9",
|
|
14953
|
-
calcMode: "linear",
|
|
14954
|
-
repeatCount: "indefinite"
|
|
14955
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14956
|
-
attributeName: "fillOpacity",
|
|
14957
|
-
from: "0.5",
|
|
14958
|
-
to: "0.5",
|
|
14959
|
-
begin: "0s",
|
|
14960
|
-
dur: "0.8s",
|
|
14961
|
-
values: ".5;1;.5",
|
|
14962
|
-
calcMode: "linear",
|
|
14963
|
-
repeatCount: "indefinite"
|
|
14964
|
-
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
14965
|
-
cx: "105",
|
|
14966
|
-
cy: "15",
|
|
14967
|
-
r: props.radius + 6
|
|
14968
|
-
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14969
|
-
attributeName: "r",
|
|
14970
|
-
from: "15",
|
|
14971
|
-
to: "15",
|
|
14972
|
-
begin: "0s",
|
|
14973
|
-
dur: "0.8s",
|
|
14974
|
-
values: "15;9;15",
|
|
14975
|
-
calcMode: "linear",
|
|
14976
|
-
repeatCount: "indefinite"
|
|
14977
|
-
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
14978
|
-
attributeName: "fillOpacity",
|
|
14979
|
-
from: "1",
|
|
14980
|
-
to: "1",
|
|
14981
|
-
begin: "0s",
|
|
14982
|
-
dur: "0.8s",
|
|
14983
|
-
values: "1;.5;1",
|
|
14984
|
-
calcMode: "linear",
|
|
14985
|
-
repeatCount: "indefinite"
|
|
14986
|
-
}))));
|
|
14987
|
-
Loader.defaultProps = {
|
|
14988
|
-
height: 50,
|
|
14989
|
-
width: 35,
|
|
14990
|
-
color: "#32aea1",
|
|
14991
|
-
label: "Loading data..",
|
|
14992
|
-
radius: 9
|
|
14993
|
-
};
|
|
14994
|
-
|
|
14995
|
-
function TextInput(_ref) {
|
|
14996
|
-
var _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
14964
|
+
function Title(_ref) {
|
|
14997
14965
|
let {
|
|
14966
|
+
initWithUserTitle = true,
|
|
14998
14967
|
store,
|
|
14999
|
-
fieldName,
|
|
15000
14968
|
...otherProps
|
|
15001
14969
|
} = _ref;
|
|
15002
14970
|
const {
|
|
@@ -15005,83 +14973,157 @@ function TextInput(_ref) {
|
|
|
15005
14973
|
const {
|
|
15006
14974
|
dispatch,
|
|
15007
14975
|
state: {
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
loading
|
|
14976
|
+
title: stateTitle,
|
|
14977
|
+
titleError
|
|
15011
14978
|
}
|
|
15012
14979
|
} = React.useContext(store);
|
|
15013
|
-
const [
|
|
14980
|
+
const [title, setTitle] = React.useState(stateTitle);
|
|
15014
14981
|
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
15015
14982
|
const handleInputChange = React.useCallback(value => {
|
|
15016
|
-
|
|
14983
|
+
setTitle(value);
|
|
15017
14984
|
if (finishedTyping) {
|
|
15018
|
-
if (
|
|
14985
|
+
if (title !== null && title !== void 0 && title.length) {
|
|
15019
14986
|
dispatch({
|
|
15020
|
-
type:
|
|
15021
|
-
payload:
|
|
15022
|
-
[fieldName]: value,
|
|
15023
|
-
[fieldName + "Error"]: null
|
|
15024
|
-
}
|
|
14987
|
+
type: SET_TITLE,
|
|
14988
|
+
payload: title
|
|
15025
14989
|
});
|
|
15026
14990
|
} else {
|
|
15027
14991
|
if (otherProps.required) {
|
|
15028
14992
|
dispatch({
|
|
15029
|
-
type:
|
|
15030
|
-
payload:
|
|
15031
|
-
[fieldName + "Error"]: t("validation.enterFieldName", {
|
|
15032
|
-
fieldName: otherProps.label
|
|
15033
|
-
}),
|
|
15034
|
-
[fieldName]: null
|
|
15035
|
-
}
|
|
14993
|
+
type: SET_TITLE_ERROR,
|
|
14994
|
+
payload: t("validation.enterTitle")
|
|
15036
14995
|
});
|
|
15037
14996
|
} else {
|
|
15038
14997
|
dispatch({
|
|
15039
|
-
type:
|
|
15040
|
-
payload:
|
|
15041
|
-
[fieldName]: value,
|
|
15042
|
-
[fieldName + "Error"]: null
|
|
15043
|
-
}
|
|
14998
|
+
type: SET_TITLE,
|
|
14999
|
+
payload: title
|
|
15044
15000
|
});
|
|
15045
15001
|
}
|
|
15046
15002
|
}
|
|
15047
15003
|
}
|
|
15048
|
-
}, [dispatch,
|
|
15004
|
+
}, [dispatch, title, finishedTyping] // eslint-disable-line react-hooks/exhaustive-deps
|
|
15049
15005
|
);
|
|
15050
15006
|
|
|
15051
15007
|
React.useEffect(() => {
|
|
15052
|
-
handleInputChange(
|
|
15053
|
-
}, [finishedTyping,
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
|
|
15008
|
+
handleInputChange(title);
|
|
15009
|
+
}, [finishedTyping, title, handleInputChange]);
|
|
15010
|
+
|
|
15011
|
+
// Initialize title field with user's title
|
|
15012
|
+
const loadTitleIntoField = () => {
|
|
15013
|
+
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro$user$r, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$;
|
|
15014
|
+
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);
|
|
15015
|
+
dispatch({
|
|
15016
|
+
type: SET_TITLE,
|
|
15017
|
+
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
|
|
15018
|
+
});
|
|
15019
|
+
};
|
|
15020
|
+
React.useEffect(() => {
|
|
15021
|
+
if (initWithUserTitle) {
|
|
15022
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
15023
|
+
loadTitleIntoField();
|
|
15024
|
+
});
|
|
15025
|
+
loadTitleIntoField();
|
|
15026
|
+
return () => {
|
|
15027
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
15028
|
+
};
|
|
15029
|
+
}
|
|
15030
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
15031
|
+
|
|
15057
15032
|
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
15058
15033
|
type: "text",
|
|
15059
|
-
error:
|
|
15060
|
-
value:
|
|
15061
|
-
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],
|
|
15034
|
+
error: titleError,
|
|
15035
|
+
value: title,
|
|
15062
15036
|
onChange: e => handleInputChange(e.target.value),
|
|
15063
15037
|
onBlur: () => setFinishedTyping(true),
|
|
15064
15038
|
onFocus: () => setFinishedTyping(false)
|
|
15065
15039
|
}, otherProps));
|
|
15066
15040
|
}
|
|
15067
15041
|
|
|
15068
|
-
const
|
|
15069
|
-
|
|
15070
|
-
|
|
15071
|
-
}));
|
|
15072
|
-
};
|
|
15042
|
+
const RegisterJobTitle = props => /*#__PURE__*/React__default['default'].createElement(Title, Object.assign({
|
|
15043
|
+
store: store$m
|
|
15044
|
+
}, props));
|
|
15073
15045
|
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
15046
|
+
function Company(_ref) {
|
|
15047
|
+
let {
|
|
15048
|
+
initWithUserCompany = true,
|
|
15049
|
+
store,
|
|
15050
|
+
...otherProps
|
|
15051
|
+
} = _ref;
|
|
15052
|
+
const {
|
|
15053
|
+
t
|
|
15054
|
+
} = useTranslation("common");
|
|
15055
|
+
const {
|
|
15056
|
+
dispatch,
|
|
15057
|
+
state: {
|
|
15058
|
+
company: stateCompany,
|
|
15059
|
+
companyError
|
|
15060
|
+
}
|
|
15061
|
+
} = React.useContext(store);
|
|
15062
|
+
const [company, setCompany] = React.useState(stateCompany);
|
|
15063
|
+
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
15064
|
+
const handleInputChange = React.useCallback(value => {
|
|
15065
|
+
setCompany(value);
|
|
15066
|
+
if (finishedTyping) {
|
|
15067
|
+
if (company !== null && company !== void 0 && company.length) {
|
|
15068
|
+
dispatch({
|
|
15069
|
+
type: SET_COMPANY,
|
|
15070
|
+
payload: company
|
|
15071
|
+
});
|
|
15072
|
+
} else {
|
|
15073
|
+
if (otherProps.required) {
|
|
15074
|
+
dispatch({
|
|
15075
|
+
type: SET_COMPANY_ERROR,
|
|
15076
|
+
payload: t("validation.enterCompany")
|
|
15077
|
+
});
|
|
15078
|
+
} else {
|
|
15079
|
+
dispatch({
|
|
15080
|
+
type: SET_COMPANY,
|
|
15081
|
+
payload: company
|
|
15082
|
+
});
|
|
15083
|
+
}
|
|
15084
|
+
}
|
|
15085
|
+
}
|
|
15086
|
+
}, [dispatch, company, finishedTyping] // eslint-disable-line react-hooks/exhaustive-deps
|
|
15087
|
+
);
|
|
15079
15088
|
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15089
|
+
React.useEffect(() => {
|
|
15090
|
+
handleInputChange(company);
|
|
15091
|
+
}, [finishedTyping, company, handleInputChange]);
|
|
15092
|
+
|
|
15093
|
+
// Initialize company field with user's company
|
|
15094
|
+
const loadCompanyIntoField = () => {
|
|
15095
|
+
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;
|
|
15096
|
+
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);
|
|
15097
|
+
dispatch({
|
|
15098
|
+
type: SET_COMPANY,
|
|
15099
|
+
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
|
|
15100
|
+
});
|
|
15101
|
+
};
|
|
15102
|
+
React.useEffect(() => {
|
|
15103
|
+
if (initWithUserCompany) {
|
|
15104
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
15105
|
+
loadCompanyIntoField();
|
|
15106
|
+
});
|
|
15107
|
+
loadCompanyIntoField();
|
|
15108
|
+
return () => {
|
|
15109
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
15110
|
+
};
|
|
15111
|
+
}
|
|
15112
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
15113
|
+
|
|
15114
|
+
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
15115
|
+
type: "text",
|
|
15116
|
+
error: companyError,
|
|
15117
|
+
value: company,
|
|
15118
|
+
onChange: e => handleInputChange(e.target.value),
|
|
15119
|
+
onBlur: () => setFinishedTyping(true),
|
|
15120
|
+
onFocus: () => setFinishedTyping(false)
|
|
15121
|
+
}, otherProps));
|
|
15122
|
+
}
|
|
15123
|
+
|
|
15124
|
+
const RegisterCompany = props => /*#__PURE__*/React__default['default'].createElement(Company, Object.assign({
|
|
15125
|
+
store: store$m
|
|
15126
|
+
}, props));
|
|
15085
15127
|
|
|
15086
15128
|
/**
|
|
15087
15129
|
*
|
|
@@ -23487,6 +23529,93 @@ const NewsletterUpdateButton = _ref => {
|
|
|
23487
23529
|
}, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
|
|
23488
23530
|
};
|
|
23489
23531
|
|
|
23532
|
+
const Loader = props => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
23533
|
+
className: `pelcro-loader-wrapper ${props.className}`
|
|
23534
|
+
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
23535
|
+
width: props.width,
|
|
23536
|
+
height: props.height,
|
|
23537
|
+
viewBox: "0 0 120 30",
|
|
23538
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23539
|
+
fill: "currentColor",
|
|
23540
|
+
"aria-label": props.label
|
|
23541
|
+
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
23542
|
+
cx: "15",
|
|
23543
|
+
cy: "15",
|
|
23544
|
+
r: props.radius + 6
|
|
23545
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
23546
|
+
attributeName: "r",
|
|
23547
|
+
from: "15",
|
|
23548
|
+
to: "15",
|
|
23549
|
+
begin: "0s",
|
|
23550
|
+
dur: "0.8s",
|
|
23551
|
+
values: "15;9;15",
|
|
23552
|
+
calcMode: "linear",
|
|
23553
|
+
repeatCount: "indefinite"
|
|
23554
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
23555
|
+
attributeName: "fillOpacity",
|
|
23556
|
+
from: "1",
|
|
23557
|
+
to: "1",
|
|
23558
|
+
begin: "0s",
|
|
23559
|
+
dur: "0.8s",
|
|
23560
|
+
values: "1;.5;1",
|
|
23561
|
+
calcMode: "linear",
|
|
23562
|
+
repeatCount: "indefinite"
|
|
23563
|
+
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
23564
|
+
cx: "60",
|
|
23565
|
+
cy: "15",
|
|
23566
|
+
r: props.radius,
|
|
23567
|
+
attributeName: "fillOpacity",
|
|
23568
|
+
from: "1",
|
|
23569
|
+
to: "0.3"
|
|
23570
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
23571
|
+
attributeName: "r",
|
|
23572
|
+
from: "9",
|
|
23573
|
+
to: "9",
|
|
23574
|
+
begin: "0s",
|
|
23575
|
+
dur: "0.8s",
|
|
23576
|
+
values: "9;15;9",
|
|
23577
|
+
calcMode: "linear",
|
|
23578
|
+
repeatCount: "indefinite"
|
|
23579
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
23580
|
+
attributeName: "fillOpacity",
|
|
23581
|
+
from: "0.5",
|
|
23582
|
+
to: "0.5",
|
|
23583
|
+
begin: "0s",
|
|
23584
|
+
dur: "0.8s",
|
|
23585
|
+
values: ".5;1;.5",
|
|
23586
|
+
calcMode: "linear",
|
|
23587
|
+
repeatCount: "indefinite"
|
|
23588
|
+
})), /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
23589
|
+
cx: "105",
|
|
23590
|
+
cy: "15",
|
|
23591
|
+
r: props.radius + 6
|
|
23592
|
+
}, /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
23593
|
+
attributeName: "r",
|
|
23594
|
+
from: "15",
|
|
23595
|
+
to: "15",
|
|
23596
|
+
begin: "0s",
|
|
23597
|
+
dur: "0.8s",
|
|
23598
|
+
values: "15;9;15",
|
|
23599
|
+
calcMode: "linear",
|
|
23600
|
+
repeatCount: "indefinite"
|
|
23601
|
+
}), /*#__PURE__*/React__default['default'].createElement("animate", {
|
|
23602
|
+
attributeName: "fillOpacity",
|
|
23603
|
+
from: "1",
|
|
23604
|
+
to: "1",
|
|
23605
|
+
begin: "0s",
|
|
23606
|
+
dur: "0.8s",
|
|
23607
|
+
values: "1;.5;1",
|
|
23608
|
+
calcMode: "linear",
|
|
23609
|
+
repeatCount: "indefinite"
|
|
23610
|
+
}))));
|
|
23611
|
+
Loader.defaultProps = {
|
|
23612
|
+
height: 50,
|
|
23613
|
+
width: 35,
|
|
23614
|
+
color: "#32aea1",
|
|
23615
|
+
label: "Loading data..",
|
|
23616
|
+
radius: 9
|
|
23617
|
+
};
|
|
23618
|
+
|
|
23490
23619
|
const NewsletterUpdateList = () => {
|
|
23491
23620
|
const handleSelectNewsletter = event => {
|
|
23492
23621
|
dispatch({
|
|
@@ -24165,7 +24294,7 @@ function SubscriptionManageMembersModal(_ref) {
|
|
|
24165
24294
|
}
|
|
24166
24295
|
SubscriptionManageMembersModal.viewId = "manage-members";
|
|
24167
24296
|
|
|
24168
|
-
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;
|
|
24297
|
+
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;
|
|
24169
24298
|
const initialState$g = {
|
|
24170
24299
|
email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
|
|
24171
24300
|
emailError: null,
|
|
@@ -24175,10 +24304,14 @@ const initialState$g = {
|
|
|
24175
24304
|
lastNameError: null,
|
|
24176
24305
|
username: (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.username,
|
|
24177
24306
|
usernameError: null,
|
|
24178
|
-
|
|
24179
|
-
|
|
24307
|
+
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,
|
|
24308
|
+
companyError: null,
|
|
24309
|
+
title: (_window$Pelcro$user$r7 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r7 === void 0 ? void 0 : _window$Pelcro$user$r7.title,
|
|
24310
|
+
titleError: null,
|
|
24311
|
+
displayName: (_window$Pelcro$user$r8 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r8 === void 0 ? void 0 : _window$Pelcro$user$r8.display_name,
|
|
24312
|
+
phone: (_window$Pelcro$user$r9 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r9 === void 0 ? void 0 : _window$Pelcro$user$r9.phone,
|
|
24180
24313
|
phoneError: null,
|
|
24181
|
-
tin: (_window$Pelcro$user$
|
|
24314
|
+
tin: (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.tin,
|
|
24182
24315
|
buttonDisabled: false,
|
|
24183
24316
|
textFields: {},
|
|
24184
24317
|
alert: {
|
|
@@ -24208,28 +24341,34 @@ const UserUpdateContainer = _ref => {
|
|
|
24208
24341
|
loadUserDataIntoFields();
|
|
24209
24342
|
}, []);
|
|
24210
24343
|
const loadUserDataIntoFields = () => {
|
|
24211
|
-
var _window$Pelcro$user$
|
|
24344
|
+
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;
|
|
24212
24345
|
const fields = [{
|
|
24213
24346
|
type: SET_EMAIL,
|
|
24214
|
-
payload: (_window$Pelcro$user$
|
|
24347
|
+
payload: (_window$Pelcro$user$r11 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r11 === void 0 ? void 0 : _window$Pelcro$user$r11.email
|
|
24215
24348
|
}, {
|
|
24216
24349
|
type: SET_FIRST_NAME,
|
|
24217
|
-
payload: (_window$Pelcro$user$
|
|
24350
|
+
payload: (_window$Pelcro$user$r12 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r12 === void 0 ? void 0 : _window$Pelcro$user$r12.first_name
|
|
24218
24351
|
}, {
|
|
24219
24352
|
type: SET_LAST_NAME,
|
|
24220
|
-
payload: (_window$Pelcro$user$
|
|
24353
|
+
payload: (_window$Pelcro$user$r13 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r13 === void 0 ? void 0 : _window$Pelcro$user$r13.last_name
|
|
24221
24354
|
}, {
|
|
24222
24355
|
type: SET_USERNAME,
|
|
24223
|
-
payload: (_window$Pelcro$user$
|
|
24356
|
+
payload: (_window$Pelcro$user$r14 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r14 === void 0 ? void 0 : _window$Pelcro$user$r14.username
|
|
24224
24357
|
}, {
|
|
24225
24358
|
type: SET_DISPLAY_NAME,
|
|
24226
|
-
payload: (_window$Pelcro$user$
|
|
24359
|
+
payload: (_window$Pelcro$user$r15 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r15 === void 0 ? void 0 : _window$Pelcro$user$r15.display_name
|
|
24227
24360
|
}, {
|
|
24228
24361
|
type: SET_PHONE,
|
|
24229
|
-
payload: (_window$Pelcro$user$
|
|
24362
|
+
payload: (_window$Pelcro$user$r16 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r16 === void 0 ? void 0 : _window$Pelcro$user$r16.phone
|
|
24230
24363
|
}, {
|
|
24231
24364
|
type: SET_TIN,
|
|
24232
|
-
payload: (_window$Pelcro$user$
|
|
24365
|
+
payload: (_window$Pelcro$user$r17 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r17 === void 0 ? void 0 : _window$Pelcro$user$r17.tin
|
|
24366
|
+
}, {
|
|
24367
|
+
type: SET_COMPANY,
|
|
24368
|
+
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
|
|
24369
|
+
}, {
|
|
24370
|
+
type: SET_TITLE,
|
|
24371
|
+
payload: (_window$Pelcro$user$r20 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r20 === void 0 ? void 0 : _window$Pelcro$user$r20.title
|
|
24233
24372
|
}];
|
|
24234
24373
|
fields.filter(field => Boolean(field.payload)).forEach(field => {
|
|
24235
24374
|
dispatch(field);
|
|
@@ -24244,7 +24383,9 @@ const UserUpdateContainer = _ref => {
|
|
|
24244
24383
|
phone,
|
|
24245
24384
|
tin,
|
|
24246
24385
|
textFields,
|
|
24247
|
-
displayName
|
|
24386
|
+
displayName,
|
|
24387
|
+
company,
|
|
24388
|
+
title
|
|
24248
24389
|
} = _ref2;
|
|
24249
24390
|
window.Pelcro.user.update({
|
|
24250
24391
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
@@ -24257,6 +24398,8 @@ const UserUpdateContainer = _ref => {
|
|
|
24257
24398
|
display_name: displayName,
|
|
24258
24399
|
phone: phone,
|
|
24259
24400
|
tin: tin,
|
|
24401
|
+
organization: company,
|
|
24402
|
+
title: title,
|
|
24260
24403
|
metadata: {
|
|
24261
24404
|
updated: "updated",
|
|
24262
24405
|
...textFields
|
|
@@ -24350,6 +24493,30 @@ const UserUpdateContainer = _ref => {
|
|
|
24350
24493
|
usernameError: action.payload,
|
|
24351
24494
|
username: ""
|
|
24352
24495
|
});
|
|
24496
|
+
case SET_COMPANY:
|
|
24497
|
+
return lib_7({
|
|
24498
|
+
...state,
|
|
24499
|
+
company: action.payload,
|
|
24500
|
+
companyError: null
|
|
24501
|
+
});
|
|
24502
|
+
case SET_COMPANY_ERROR:
|
|
24503
|
+
return lib_7({
|
|
24504
|
+
...state,
|
|
24505
|
+
companyError: action.payload,
|
|
24506
|
+
company: ""
|
|
24507
|
+
});
|
|
24508
|
+
case SET_TITLE:
|
|
24509
|
+
return lib_7({
|
|
24510
|
+
...state,
|
|
24511
|
+
title: action.payload,
|
|
24512
|
+
titleError: null
|
|
24513
|
+
});
|
|
24514
|
+
case SET_TITLE_ERROR:
|
|
24515
|
+
return lib_7({
|
|
24516
|
+
...state,
|
|
24517
|
+
titleError: action.payload,
|
|
24518
|
+
title: ""
|
|
24519
|
+
});
|
|
24353
24520
|
case SET_PHONE:
|
|
24354
24521
|
return lib_7({
|
|
24355
24522
|
...state,
|
|
@@ -24802,12 +24969,116 @@ function UserUpdateModal(_ref) {
|
|
|
24802
24969
|
}
|
|
24803
24970
|
UserUpdateModal.viewId = "user-edit";
|
|
24804
24971
|
|
|
24972
|
+
function TextInput(_ref) {
|
|
24973
|
+
var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
|
|
24974
|
+
let {
|
|
24975
|
+
initWithFieldName = true,
|
|
24976
|
+
store,
|
|
24977
|
+
fieldName,
|
|
24978
|
+
...otherProps
|
|
24979
|
+
} = _ref;
|
|
24980
|
+
const {
|
|
24981
|
+
t
|
|
24982
|
+
} = useTranslation("common");
|
|
24983
|
+
const {
|
|
24984
|
+
dispatch,
|
|
24985
|
+
state: {
|
|
24986
|
+
[fieldName]: stateFieldName,
|
|
24987
|
+
[fieldName + "Error"]: fieldNameError,
|
|
24988
|
+
loading
|
|
24989
|
+
}
|
|
24990
|
+
} = React.useContext(store);
|
|
24991
|
+
const [fieldNameState, setFieldNameState] = React.useState(stateFieldName);
|
|
24992
|
+
const [finishedTyping, setFinishedTyping] = React.useState(false);
|
|
24993
|
+
const handleInputChange = React.useCallback(value => {
|
|
24994
|
+
setFieldNameState(value);
|
|
24995
|
+
if (finishedTyping) {
|
|
24996
|
+
if (fieldNameState !== null && fieldNameState !== void 0 && fieldNameState.length) {
|
|
24997
|
+
dispatch({
|
|
24998
|
+
type: SET_TEXT_FIELD,
|
|
24999
|
+
payload: {
|
|
25000
|
+
[fieldName]: value,
|
|
25001
|
+
[fieldName + "Error"]: null
|
|
25002
|
+
}
|
|
25003
|
+
});
|
|
25004
|
+
} else {
|
|
25005
|
+
if (otherProps.required) {
|
|
25006
|
+
dispatch({
|
|
25007
|
+
type: SET_TEXT_FIELD_ERROR,
|
|
25008
|
+
payload: {
|
|
25009
|
+
[fieldName + "Error"]: t("validation.enterFieldName", {
|
|
25010
|
+
fieldName: otherProps.label
|
|
25011
|
+
}),
|
|
25012
|
+
[fieldName]: null
|
|
25013
|
+
}
|
|
25014
|
+
});
|
|
25015
|
+
} else {
|
|
25016
|
+
dispatch({
|
|
25017
|
+
type: SET_TEXT_FIELD,
|
|
25018
|
+
payload: {
|
|
25019
|
+
[fieldName]: value,
|
|
25020
|
+
[fieldName + "Error"]: null
|
|
25021
|
+
}
|
|
25022
|
+
});
|
|
25023
|
+
}
|
|
25024
|
+
}
|
|
25025
|
+
}
|
|
25026
|
+
}, [dispatch, fieldNameState, finishedTyping] // eslint-disable-line react-hooks/exhaustive-deps
|
|
25027
|
+
);
|
|
25028
|
+
|
|
25029
|
+
React.useEffect(() => {
|
|
25030
|
+
handleInputChange(fieldNameState);
|
|
25031
|
+
}, [finishedTyping, fieldNameState, handleInputChange]);
|
|
25032
|
+
|
|
25033
|
+
// Initialize field name field with user's first name
|
|
25034
|
+
const loadFieldNameIntoField = () => {
|
|
25035
|
+
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;
|
|
25036
|
+
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]);
|
|
25037
|
+
dispatch({
|
|
25038
|
+
type: SET_TEXT_FIELD,
|
|
25039
|
+
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]
|
|
25040
|
+
});
|
|
25041
|
+
};
|
|
25042
|
+
React.useEffect(() => {
|
|
25043
|
+
if (initWithFieldName) {
|
|
25044
|
+
document.addEventListener("PelcroUserLoaded", () => {
|
|
25045
|
+
loadFieldNameIntoField();
|
|
25046
|
+
});
|
|
25047
|
+
loadFieldNameIntoField();
|
|
25048
|
+
return () => {
|
|
25049
|
+
document.removeEventListener("PelcroUserLoaded", handleInputChange);
|
|
25050
|
+
};
|
|
25051
|
+
}
|
|
25052
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
25053
|
+
|
|
25054
|
+
if (loading) {
|
|
25055
|
+
return /*#__PURE__*/React__default['default'].createElement(Loader, null);
|
|
25056
|
+
}
|
|
25057
|
+
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
25058
|
+
type: "text",
|
|
25059
|
+
error: fieldNameError,
|
|
25060
|
+
value: fieldNameState,
|
|
25061
|
+
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],
|
|
25062
|
+
onChange: e => handleInputChange(e.target.value),
|
|
25063
|
+
onBlur: () => setFinishedTyping(true),
|
|
25064
|
+
onFocus: () => setFinishedTyping(false)
|
|
25065
|
+
}, otherProps));
|
|
25066
|
+
}
|
|
25067
|
+
|
|
24805
25068
|
const UserUpdateTextInput = props => {
|
|
24806
25069
|
return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
|
|
24807
25070
|
store: store$g
|
|
24808
25071
|
}));
|
|
24809
25072
|
};
|
|
24810
25073
|
|
|
25074
|
+
const UserUpdateCompany = props => /*#__PURE__*/React__default['default'].createElement(Company, Object.assign({
|
|
25075
|
+
store: store$g
|
|
25076
|
+
}, props));
|
|
25077
|
+
|
|
25078
|
+
const UserUpdateJobTitle = props => /*#__PURE__*/React__default['default'].createElement(Title, Object.assign({
|
|
25079
|
+
store: store$g
|
|
25080
|
+
}, props));
|
|
25081
|
+
|
|
24811
25082
|
const initialState$f = {
|
|
24812
25083
|
isSubmitting: false,
|
|
24813
25084
|
firstName: "",
|
|
@@ -36415,10 +36686,12 @@ exports.TextInput = TextInput;
|
|
|
36415
36686
|
exports.Tooltip = Tooltip;
|
|
36416
36687
|
exports.UserNameInput = UserNameInput;
|
|
36417
36688
|
exports.UserUpdateButton = UserUpdateButton;
|
|
36689
|
+
exports.UserUpdateCompany = UserUpdateCompany;
|
|
36418
36690
|
exports.UserUpdateContainer = UserUpdateContainer;
|
|
36419
36691
|
exports.UserUpdateDisplayName = UserUpdateDisplayName;
|
|
36420
36692
|
exports.UserUpdateEmail = UserUpdateEmail;
|
|
36421
36693
|
exports.UserUpdateFirstName = UserUpdateFirstName;
|
|
36694
|
+
exports.UserUpdateJobTitle = UserUpdateJobTitle;
|
|
36422
36695
|
exports.UserUpdateLastName = UserUpdateLastName;
|
|
36423
36696
|
exports.UserUpdateModal = UserUpdateModal;
|
|
36424
36697
|
exports.UserUpdatePhone = UserUpdatePhone;
|