@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
|
@@ -5,4 +5,4 @@ export declare type CardTypeData = {
|
|
|
5
5
|
displayOrder: number;
|
|
6
6
|
description: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const getCardTypes: (
|
|
8
|
+
export declare const getCardTypes: (paymentSystemTypeCd: string, creditProgramId: string) => Promise<CardTypeData[]>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CreateUserProfileResponse } from './updateUserTask';
|
|
2
1
|
export declare type UpdateUserProfileBody = {
|
|
3
2
|
profile: {
|
|
4
3
|
id: number;
|
|
@@ -19,4 +18,4 @@ export declare type UpdateUserProfileBody = {
|
|
|
19
18
|
smsConsentBki?: string;
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
|
-
export declare const updateUserProfile: (body: UpdateUserProfileBody) => Promise<
|
|
21
|
+
export declare const updateUserProfile: (body: UpdateUserProfileBody) => Promise<Response>;
|
package/bundle/bundle.umd.js
CHANGED
|
@@ -1675,6 +1675,8 @@
|
|
|
1675
1675
|
confirmationIncome: defaultValidator(),
|
|
1676
1676
|
deliveryDate: defaultValidator('Укажите дату доставки'),
|
|
1677
1677
|
addressCourier: addressDaDataValidator(),
|
|
1678
|
+
cardCategory: defaultValidator('Укажите категорию карты'),
|
|
1679
|
+
paymentSystem: defaultValidator('Укажите тип платежной системы'),
|
|
1678
1680
|
};
|
|
1679
1681
|
const getObjectValidator = (inputs) => {
|
|
1680
1682
|
const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
|
|
@@ -2916,26 +2918,42 @@
|
|
|
2916
2918
|
const FIELD_NAME$a = 'birthPlace';
|
|
2917
2919
|
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) })));
|
|
2918
2920
|
|
|
2919
|
-
const getCardTypes = async (
|
|
2920
|
-
const
|
|
2921
|
+
const getCardTypes = async (paymentSystemTypeCd, creditProgramId) => {
|
|
2922
|
+
const data = await fetchRetailJSON('/dictionaryFiltered', 'POST', {
|
|
2921
2923
|
type: 'CARD_TYPE',
|
|
2922
|
-
presets: {
|
|
2924
|
+
presets: { paymentSystemTypeCd, creditProgramId },
|
|
2923
2925
|
});
|
|
2924
|
-
const data = await response?.json();
|
|
2925
2926
|
return Array.isArray(data) ? data : [];
|
|
2926
2927
|
};
|
|
2927
2928
|
|
|
2929
|
+
function useLocalStorage(key) {
|
|
2930
|
+
const [storedValue, setStoredValue] = useState(JSON.parse(globalThis.localStorage?.getItem(key) || 'null'));
|
|
2931
|
+
const setValue = useCallback((value) => {
|
|
2932
|
+
globalThis.localStorage?.setItem(key, JSON.stringify(value));
|
|
2933
|
+
setStoredValue(value);
|
|
2934
|
+
}, [key, globalThis.localStorage]);
|
|
2935
|
+
return [storedValue, setValue];
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2928
2938
|
const CardCategoryField = JSX(({ field, input }) => {
|
|
2929
2939
|
const [cardTypes, setCardTypes] = useState([]);
|
|
2940
|
+
const [programId] = useLocalStorage('programId');
|
|
2941
|
+
const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
|
|
2930
2942
|
const selectedPaymentSystem = field('paymentSystem').value;
|
|
2931
2943
|
useEffect(() => {
|
|
2932
|
-
(
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2944
|
+
if (selectedPaymentSystem && programId) {
|
|
2945
|
+
(async () => {
|
|
2946
|
+
const fetchedCardTypes = await getCardTypes(selectedPaymentSystem, programId);
|
|
2947
|
+
setCardTypes(fetchedCardTypes);
|
|
2948
|
+
if (!isValidCardCategory(fetchedCardTypes, selectedCardCategory)) {
|
|
2949
|
+
cardCategoryChange && cardCategoryChange(null);
|
|
2950
|
+
}
|
|
2951
|
+
})();
|
|
2952
|
+
}
|
|
2936
2953
|
}, [selectedPaymentSystem]);
|
|
2937
2954
|
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 }));
|
|
2938
2955
|
});
|
|
2956
|
+
const isValidCardCategory = (cardTypes, selectedCardCategory) => cardTypes.some((cardType) => cardType.key === selectedCardCategory?.key);
|
|
2939
2957
|
|
|
2940
2958
|
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 })));
|
|
2941
2959
|
|
|
@@ -3582,11 +3600,10 @@
|
|
|
3582
3600
|
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 }));
|
|
3583
3601
|
});
|
|
3584
3602
|
|
|
3585
|
-
const getPaymentSystems = async () => {
|
|
3586
|
-
const
|
|
3587
|
-
creditProgramId
|
|
3603
|
+
const getPaymentSystems = async (creditProgramId) => {
|
|
3604
|
+
const data = await fetchRetailJSON('/public-data/creditProgramConditions', 'POST', {
|
|
3605
|
+
creditProgramId,
|
|
3588
3606
|
});
|
|
3589
|
-
const data = await response?.json();
|
|
3590
3607
|
return (data?.paymentSystems?.map((paymentSystem) => ({
|
|
3591
3608
|
id: paymentSystem.type,
|
|
3592
3609
|
text: paymentSystem.name,
|
|
@@ -3595,12 +3612,15 @@
|
|
|
3595
3612
|
|
|
3596
3613
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
3597
3614
|
const { value, onChange } = field('paymentSystem');
|
|
3615
|
+
const [programId] = useLocalStorage('programId');
|
|
3598
3616
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
3599
3617
|
useEffect(() => {
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3618
|
+
if (programId) {
|
|
3619
|
+
(async () => {
|
|
3620
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
3621
|
+
setPaymentSystemOptions(fetchedPaymentSystems || []);
|
|
3622
|
+
})();
|
|
3623
|
+
}
|
|
3604
3624
|
}, []);
|
|
3605
3625
|
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) }));
|
|
3606
3626
|
});
|
|
@@ -4027,15 +4047,6 @@
|
|
|
4027
4047
|
return _ === (dataValue?.key ?? dataValue);
|
|
4028
4048
|
}));
|
|
4029
4049
|
|
|
4030
|
-
function useLocalStorage(key) {
|
|
4031
|
-
const [storedValue, setStoredValue] = useState(JSON.parse(globalThis.localStorage?.getItem(key) || 'null'));
|
|
4032
|
-
const setValue = useCallback((value) => {
|
|
4033
|
-
globalThis.localStorage?.setItem(key, JSON.stringify(value));
|
|
4034
|
-
setStoredValue(value);
|
|
4035
|
-
}, [key, globalThis.localStorage]);
|
|
4036
|
-
return [storedValue, setValue];
|
|
4037
|
-
}
|
|
4038
|
-
|
|
4039
4050
|
const CONSENT_ALL_DOCS_TEXT = 'Согласие на все документы';
|
|
4040
4051
|
const CONSENT_REQUIRED = 'Отметьте все обязательные соглашения';
|
|
4041
4052
|
const GroupedConsents = JSX(({ inputs = [], typeForm = '', field, key }) => {
|
|
@@ -4123,19 +4134,19 @@
|
|
|
4123
4134
|
|
|
4124
4135
|
const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
|
|
4125
4136
|
|
|
4126
|
-
const updateUserProfile = (body) =>
|
|
4137
|
+
const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
|
|
4127
4138
|
|
|
4128
4139
|
const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
|
|
4129
4140
|
|
|
4130
4141
|
const getUpdateUserProfileData = (profileId, formData) => {
|
|
4131
|
-
const { name = '', surname = '', middleName = '',
|
|
4142
|
+
const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', processPersonalDataFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
|
|
4132
4143
|
return {
|
|
4133
4144
|
profile: {
|
|
4134
4145
|
id: profileId,
|
|
4135
4146
|
name,
|
|
4136
4147
|
surname,
|
|
4137
4148
|
midname: middleName,
|
|
4138
|
-
birthDate:
|
|
4149
|
+
birthDate: limitedBirthday && formatDate(limitedBirthday, true),
|
|
4139
4150
|
email,
|
|
4140
4151
|
phone: formatPhone(phone),
|
|
4141
4152
|
processPersonalDataFlg: Boolean(processPersonalDataFlg),
|
|
@@ -4645,12 +4656,17 @@
|
|
|
4645
4656
|
profileId,
|
|
4646
4657
|
programId,
|
|
4647
4658
|
});
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4659
|
+
try {
|
|
4660
|
+
await updateUserTask(getLeadFormTaskData({
|
|
4661
|
+
participantId,
|
|
4662
|
+
taskId,
|
|
4663
|
+
profileId,
|
|
4664
|
+
formData: transformedForm,
|
|
4665
|
+
}));
|
|
4666
|
+
}
|
|
4667
|
+
catch (ex) {
|
|
4668
|
+
console.log(ex);
|
|
4669
|
+
}
|
|
4654
4670
|
saveUserData({ participantId, taskId, profileId, programId });
|
|
4655
4671
|
saveForm(formData);
|
|
4656
4672
|
};
|
|
@@ -10369,7 +10385,7 @@
|
|
|
10369
10385
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10370
10386
|
});
|
|
10371
10387
|
|
|
10372
|
-
const packageVersion = "0.14.
|
|
10388
|
+
const packageVersion = "0.14.684";
|
|
10373
10389
|
|
|
10374
10390
|
exports.Blocks = Blocks;
|
|
10375
10391
|
exports.ContentPage = ContentPage;
|