@redneckz/wildless-cms-uni-blocks 0.14.684 → 0.14.685
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/bundle/api/RetailAPI/getCardTypes.d.ts +1 -1
- package/bundle/api/RetailAPI/getPaymentSystems.d.ts +1 -1
- package/bundle/api/RetailAPI/updateUserProfile.d.ts +1 -2
- package/bundle/bundle.umd.js +51 -35
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/api/RetailAPI/getCardTypes.d.ts +1 -1
- package/dist/api/RetailAPI/getCardTypes.js +3 -4
- package/dist/api/RetailAPI/getCardTypes.js.map +1 -1
- package/dist/api/RetailAPI/getPaymentSystems.d.ts +1 -1
- package/dist/api/RetailAPI/getPaymentSystems.js +3 -4
- package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/dist/api/RetailAPI/updateUserProfile.d.ts +1 -2
- package/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/dist/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
- package/dist/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -6
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
- package/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
- package/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +2 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/api/RetailAPI/getCardTypes.d.ts +1 -1
- package/lib/api/RetailAPI/getCardTypes.js +4 -5
- package/lib/api/RetailAPI/getCardTypes.js.map +1 -1
- package/lib/api/RetailAPI/getPaymentSystems.d.ts +1 -1
- package/lib/api/RetailAPI/getPaymentSystems.js +4 -5
- package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/lib/api/RetailAPI/updateUserProfile.d.ts +1 -2
- package/lib/api/RetailAPI/updateUserProfile.js +2 -2
- package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/lib/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
- package/lib/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -6
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
- package/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
- package/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +2 -0
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/getCardTypes.d.ts +1 -1
- package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +1 -1
- package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +1 -2
- package/mobile/bundle/bundle.umd.js +51 -35
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/api/RetailAPI/getCardTypes.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/getCardTypes.js +3 -4
- package/mobile/dist/api/RetailAPI/getCardTypes.js.map +1 -1
- package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/getPaymentSystems.js +3 -4
- package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +1 -2
- package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/dist/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
- package/mobile/dist/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -6
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
- package/mobile/dist/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
- package/mobile/dist/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +2 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/api/RetailAPI/getCardTypes.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/getCardTypes.js +4 -5
- package/mobile/lib/api/RetailAPI/getCardTypes.js.map +1 -1
- package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/getPaymentSystems.js +4 -5
- package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +1 -2
- package/mobile/lib/api/RetailAPI/updateUserProfile.js +2 -2
- package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/lib/api/RetailAPI/utils/getUpdateUserProfile.js +2 -2
- package/mobile/lib/api/RetailAPI/utils/getUpdateUserProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +11 -6
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js +13 -4
- package/mobile/lib/ui-kit/FormField/Fields/CardCategoryField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js +8 -4
- package/mobile/lib/ui-kit/FormField/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +2 -0
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/src/api/RetailAPI/getCardTypes.ts +4 -6
- package/mobile/src/api/RetailAPI/getPaymentSystems.ts +9 -7
- package/mobile/src/api/RetailAPI/updateUserProfile.ts +2 -3
- package/mobile/src/api/RetailAPI/utils/getUpdateUserProfile.ts +2 -2
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -8
- package/mobile/src/ui-kit/FormField/Fields/CardCategoryField.tsx +17 -4
- package/mobile/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +8 -4
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/getCardTypes.ts +4 -6
- package/src/api/RetailAPI/getPaymentSystems.ts +9 -7
- package/src/api/RetailAPI/updateUserProfile.ts +2 -3
- package/src/api/RetailAPI/utils/getUpdateUserProfile.ts +2 -2
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -8
- package/src/ui-kit/FormField/Fields/CardCategoryField.tsx +17 -4
- package/src/ui-kit/FormField/Fields/PaymentSystemField.tsx +8 -4
- package/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
|
@@ -1683,6 +1683,8 @@
|
|
|
1683
1683
|
confirmationIncome: defaultValidator(),
|
|
1684
1684
|
deliveryDate: defaultValidator('Укажите дату доставки'),
|
|
1685
1685
|
addressCourier: addressDaDataValidator(),
|
|
1686
|
+
cardCategory: defaultValidator('Укажите категорию карты'),
|
|
1687
|
+
paymentSystem: defaultValidator('Укажите тип платежной системы'),
|
|
1686
1688
|
};
|
|
1687
1689
|
const getObjectValidator = (inputs) => {
|
|
1688
1690
|
const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
|
|
@@ -2924,26 +2926,42 @@
|
|
|
2924
2926
|
const FIELD_NAME$a = 'birthPlace';
|
|
2925
2927
|
const BirthPlaceField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthPlace'), validatorObj.birthPlace, input?.required), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$a) })));
|
|
2926
2928
|
|
|
2927
|
-
const getCardTypes = async (
|
|
2928
|
-
const
|
|
2929
|
+
const getCardTypes = async (paymentSystemTypeCd, creditProgramId) => {
|
|
2930
|
+
const data = await fetchRetailJSON('/dictionaryFiltered', 'POST', {
|
|
2929
2931
|
type: 'CARD_TYPE',
|
|
2930
|
-
presets: {
|
|
2932
|
+
presets: { paymentSystemTypeCd, creditProgramId },
|
|
2931
2933
|
});
|
|
2932
|
-
const data = await response?.json();
|
|
2933
2934
|
return Array.isArray(data) ? data : [];
|
|
2934
2935
|
};
|
|
2935
2936
|
|
|
2937
|
+
function useLocalStorage(key) {
|
|
2938
|
+
const [storedValue, setStoredValue] = useState(JSON.parse(globalThis.localStorage?.getItem(key) || 'null'));
|
|
2939
|
+
const setValue = useCallback((value) => {
|
|
2940
|
+
globalThis.localStorage?.setItem(key, JSON.stringify(value));
|
|
2941
|
+
setStoredValue(value);
|
|
2942
|
+
}, [key, globalThis.localStorage]);
|
|
2943
|
+
return [storedValue, setValue];
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2936
2946
|
const CardCategoryField = JSX(({ field, input }) => {
|
|
2937
2947
|
const [cardTypes, setCardTypes] = useState([]);
|
|
2948
|
+
const [programId] = useLocalStorage('programId');
|
|
2949
|
+
const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
|
|
2938
2950
|
const selectedPaymentSystem = field('paymentSystem').value;
|
|
2939
2951
|
useEffect(() => {
|
|
2940
|
-
(
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2952
|
+
if (selectedPaymentSystem && programId) {
|
|
2953
|
+
(async () => {
|
|
2954
|
+
const fetchedCardTypes = await getCardTypes(selectedPaymentSystem, programId);
|
|
2955
|
+
setCardTypes(fetchedCardTypes);
|
|
2956
|
+
if (!isValidCardCategory(fetchedCardTypes, selectedCardCategory)) {
|
|
2957
|
+
cardCategoryChange && cardCategoryChange(null);
|
|
2958
|
+
}
|
|
2959
|
+
})();
|
|
2960
|
+
}
|
|
2944
2961
|
}, [selectedPaymentSystem]);
|
|
2945
2962
|
return (jsx(SelectField, { field: field, source: cardTypes, label: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u043A\u0430\u0440\u0442\u044B", fieldName: "cardCategory", input: input }));
|
|
2946
2963
|
});
|
|
2964
|
+
const isValidCardCategory = (cardTypes, selectedCardCategory) => cardTypes.some((cardType) => cardType.key === selectedCardCategory?.key);
|
|
2947
2965
|
|
|
2948
2966
|
const ChildrenField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...getValidation(field('children'), validatorObj.children, input?.required), ...input })));
|
|
2949
2967
|
|
|
@@ -3590,11 +3608,10 @@
|
|
|
3590
3608
|
return (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest }));
|
|
3591
3609
|
});
|
|
3592
3610
|
|
|
3593
|
-
const getPaymentSystems = async () => {
|
|
3594
|
-
const
|
|
3595
|
-
creditProgramId
|
|
3611
|
+
const getPaymentSystems = async (creditProgramId) => {
|
|
3612
|
+
const data = await fetchRetailJSON('/public-data/creditProgramConditions', 'POST', {
|
|
3613
|
+
creditProgramId,
|
|
3596
3614
|
});
|
|
3597
|
-
const data = await response?.json();
|
|
3598
3615
|
return (data?.paymentSystems?.map((paymentSystem) => ({
|
|
3599
3616
|
id: paymentSystem.type,
|
|
3600
3617
|
text: paymentSystem.name,
|
|
@@ -3603,12 +3620,15 @@
|
|
|
3603
3620
|
|
|
3604
3621
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
3605
3622
|
const { value, onChange } = field('paymentSystem');
|
|
3623
|
+
const [programId] = useLocalStorage('programId');
|
|
3606
3624
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
3607
3625
|
useEffect(() => {
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3626
|
+
if (programId) {
|
|
3627
|
+
(async () => {
|
|
3628
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
3629
|
+
setPaymentSystemOptions(fetchedPaymentSystems || []);
|
|
3630
|
+
})();
|
|
3631
|
+
}
|
|
3612
3632
|
}, []);
|
|
3613
3633
|
return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: paymentSystemOptions, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('paymentSystem'), validatorObj.paymentSystem, input?.required) }));
|
|
3614
3634
|
});
|
|
@@ -4035,15 +4055,6 @@
|
|
|
4035
4055
|
return _ === (dataValue?.key ?? dataValue);
|
|
4036
4056
|
}));
|
|
4037
4057
|
|
|
4038
|
-
function useLocalStorage(key) {
|
|
4039
|
-
const [storedValue, setStoredValue] = useState(JSON.parse(globalThis.localStorage?.getItem(key) || 'null'));
|
|
4040
|
-
const setValue = useCallback((value) => {
|
|
4041
|
-
globalThis.localStorage?.setItem(key, JSON.stringify(value));
|
|
4042
|
-
setStoredValue(value);
|
|
4043
|
-
}, [key, globalThis.localStorage]);
|
|
4044
|
-
return [storedValue, setValue];
|
|
4045
|
-
}
|
|
4046
|
-
|
|
4047
4058
|
const CONSENT_ALL_DOCS_TEXT = 'Согласие на все документы';
|
|
4048
4059
|
const CONSENT_REQUIRED = 'Отметьте все обязательные соглашения';
|
|
4049
4060
|
const GroupedConsents = JSX(({ inputs = [], typeForm = '', field, key }) => {
|
|
@@ -4131,19 +4142,19 @@
|
|
|
4131
4142
|
|
|
4132
4143
|
const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
|
|
4133
4144
|
|
|
4134
|
-
const updateUserProfile = (body) =>
|
|
4145
|
+
const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
|
|
4135
4146
|
|
|
4136
4147
|
const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
|
|
4137
4148
|
|
|
4138
4149
|
const getUpdateUserProfileData = (profileId, formData) => {
|
|
4139
|
-
const { name = '', surname = '', middleName = '',
|
|
4150
|
+
const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', processPersonalDataFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
|
|
4140
4151
|
return {
|
|
4141
4152
|
profile: {
|
|
4142
4153
|
id: profileId,
|
|
4143
4154
|
name,
|
|
4144
4155
|
surname,
|
|
4145
4156
|
midname: middleName,
|
|
4146
|
-
birthDate:
|
|
4157
|
+
birthDate: limitedBirthday && formatDate(limitedBirthday, true),
|
|
4147
4158
|
email,
|
|
4148
4159
|
phone: formatPhone(phone),
|
|
4149
4160
|
processPersonalDataFlg: Boolean(processPersonalDataFlg),
|
|
@@ -4653,12 +4664,17 @@
|
|
|
4653
4664
|
profileId,
|
|
4654
4665
|
programId,
|
|
4655
4666
|
});
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4667
|
+
try {
|
|
4668
|
+
await updateUserTask(getLeadFormTaskData({
|
|
4669
|
+
participantId,
|
|
4670
|
+
taskId,
|
|
4671
|
+
profileId,
|
|
4672
|
+
formData: transformedForm,
|
|
4673
|
+
}));
|
|
4674
|
+
}
|
|
4675
|
+
catch (ex) {
|
|
4676
|
+
console.log(ex);
|
|
4677
|
+
}
|
|
4662
4678
|
saveUserData({ participantId, taskId, profileId, programId });
|
|
4663
4679
|
saveForm(formData);
|
|
4664
4680
|
};
|
|
@@ -9996,7 +10012,7 @@
|
|
|
9996
10012
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
9997
10013
|
});
|
|
9998
10014
|
|
|
9999
|
-
const packageVersion = "0.14.
|
|
10015
|
+
const packageVersion = "0.14.684";
|
|
10000
10016
|
|
|
10001
10017
|
exports.Blocks = Blocks;
|
|
10002
10018
|
exports.ContentPage = ContentPage;
|