@redneckz/wildless-cms-uni-blocks 0.14.896 → 0.14.898
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/bundle.umd.js +37 -15
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/hooks/useForm/useForm.d.ts +2 -0
- package/bundle/retail/components/DraftDialog/utils.d.ts +0 -6
- package/bundle/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +3 -2
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/hooks/useForm/useForm.d.ts +2 -0
- package/dist/hooks/useForm/useForm.js +17 -0
- package/dist/hooks/useForm/useForm.js.map +1 -1
- package/dist/retail/api/esiaRequestProfile.js +4 -2
- package/dist/retail/api/esiaRequestProfile.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -3
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/components/DraftDialog/utils.d.ts +0 -6
- package/dist/retail/components/DraftDialog/utils.js +1 -7
- package/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/dist/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/dist/ui-kit/FormField/RefWrapper.js +16 -0
- package/dist/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/dist/ui-kit/FormField/getField.js +2 -1
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +3 -2
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/hooks/useForm/useForm.d.ts +2 -0
- package/lib/hooks/useForm/useForm.js +17 -0
- package/lib/hooks/useForm/useForm.js.map +1 -1
- package/lib/retail/api/esiaRequestProfile.js +4 -2
- package/lib/retail/api/esiaRequestProfile.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -4
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/components/DraftDialog/utils.d.ts +0 -6
- package/lib/retail/components/DraftDialog/utils.js +0 -6
- package/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/lib/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/lib/ui-kit/FormField/RefWrapper.js +14 -0
- package/lib/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/lib/ui-kit/FormField/getField.js +2 -1
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +37 -15
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/hooks/useForm/useForm.d.ts +2 -0
- package/mobile/bundle/retail/components/DraftDialog/utils.d.ts +0 -6
- package/mobile/bundle/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +3 -2
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/hooks/useForm/useForm.d.ts +2 -0
- package/mobile/dist/hooks/useForm/useForm.js +17 -0
- package/mobile/dist/hooks/useForm/useForm.js.map +1 -1
- package/mobile/dist/retail/api/esiaRequestProfile.js +4 -2
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -3
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/utils.d.ts +0 -6
- package/mobile/dist/retail/components/DraftDialog/utils.js +1 -7
- package/mobile/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/mobile/dist/ui-kit/FormField/RefWrapper.js +16 -0
- package/mobile/dist/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/getField.js +2 -1
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +3 -2
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/hooks/useForm/useForm.d.ts +2 -0
- package/mobile/lib/hooks/useForm/useForm.js +17 -0
- package/mobile/lib/hooks/useForm/useForm.js.map +1 -1
- package/mobile/lib/retail/api/esiaRequestProfile.js +4 -2
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -4
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/utils.d.ts +0 -6
- package/mobile/lib/retail/components/DraftDialog/utils.js +0 -6
- package/mobile/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/RefWrapper.d.ts +7 -0
- package/mobile/lib/ui-kit/FormField/RefWrapper.js +14 -0
- package/mobile/lib/ui-kit/FormField/RefWrapper.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/getField.js +2 -1
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +3 -2
- package/mobile/src/hooks/useForm/useForm.ts +31 -2
- package/mobile/src/retail/api/esiaRequestProfile.ts +4 -2
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -5
- package/mobile/src/retail/components/DraftDialog/utils.ts +0 -7
- package/mobile/src/ui-kit/FormField/RefWrapper.tsx +20 -0
- package/mobile/src/ui-kit/FormField/getField.tsx +3 -2
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +3 -2
- package/src/hooks/useForm/useForm.ts +31 -2
- package/src/retail/api/esiaRequestProfile.ts +4 -2
- package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -5
- package/src/retail/components/DraftDialog/utils.ts +0 -7
- package/src/ui-kit/FormField/RefWrapper.tsx +20 -0
- package/src/ui-kit/FormField/getField.tsx +3 -2
package/bundle/bundle.umd.js
CHANGED
|
@@ -1244,6 +1244,7 @@
|
|
|
1244
1244
|
|
|
1245
1245
|
function useForm(initialState, { resetOnSubmit, formValidator, normalizer, onChange, onSubmit } = {}) {
|
|
1246
1246
|
const [formState, setFormState] = useNormalizedFormState(initialState, normalizer, onChange);
|
|
1247
|
+
const fieldRefs = useRef(getRefsObject(initialState));
|
|
1247
1248
|
const [isDirtyForm, { setTrue: markAsDirty, setFalse: markAsClean }] = useBool(false);
|
|
1248
1249
|
const dirtyFieldsMap = useRef({});
|
|
1249
1250
|
const [fieldValidatorsMap, { isValid, errors }] = useFormValidator(formState, formValidator);
|
|
@@ -1254,6 +1255,12 @@
|
|
|
1254
1255
|
const fieldValidator = options?.validator ?? fieldValidatorsMap[fieldName];
|
|
1255
1256
|
const fieldErrors = isDirty && fieldValidator ? fieldValidator(value) : [];
|
|
1256
1257
|
return {
|
|
1258
|
+
setFieldRef: (_) => {
|
|
1259
|
+
if (fieldRefs.current) {
|
|
1260
|
+
fieldRefs.current[fieldName] = _;
|
|
1261
|
+
}
|
|
1262
|
+
},
|
|
1263
|
+
fieldRef: fieldRefs.current?.[fieldName],
|
|
1257
1264
|
value: format ? format(value) : value,
|
|
1258
1265
|
isDirty,
|
|
1259
1266
|
errors: fieldValidator && fieldErrors,
|
|
@@ -1283,11 +1290,21 @@
|
|
|
1283
1290
|
onSubmit?.(formState, ev);
|
|
1284
1291
|
}
|
|
1285
1292
|
else {
|
|
1293
|
+
const errorFieldName = getErrorFieldName(formState, fieldValidatorsMap);
|
|
1286
1294
|
markAsDirty();
|
|
1295
|
+
field(errorFieldName).fieldRef?.scrollIntoView({ behavior: 'smooth' });
|
|
1287
1296
|
}
|
|
1288
1297
|
}, [resetOnSubmit, formState, isValid, reset, onSubmit]);
|
|
1289
1298
|
return [formState, { errors, field, update, reset, onSubmit: handleSubmit }];
|
|
1290
1299
|
}
|
|
1300
|
+
const getRefsObject = (initialState) => Object.keys(initialState).reduce((acc, key) => ({ ...acc, [key]: null }), {});
|
|
1301
|
+
const getErrorFieldName = (formState, fieldValidatorsMap = {}) => {
|
|
1302
|
+
const [errorFieldName = ''] = Object.entries(formState).find(([fieldName, value]) => {
|
|
1303
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
1304
|
+
return fieldValidatorsMap[fieldName]?.(value)?.length;
|
|
1305
|
+
}) ?? [];
|
|
1306
|
+
return errorFieldName;
|
|
1307
|
+
};
|
|
1291
1308
|
|
|
1292
1309
|
function copy(source, target) {
|
|
1293
1310
|
for (const [k, v] of source.entries()) {
|
|
@@ -2939,6 +2956,16 @@
|
|
|
2939
2956
|
|
|
2940
2957
|
const ConsentToReceiveMaterialsField = JSX(({ field, input }) => (jsx(Checkbox, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435", ...field(input?.name ?? '') })));
|
|
2941
2958
|
|
|
2959
|
+
const RefWrapper = JSX(({ onFieldRef = noop, children }) => {
|
|
2960
|
+
const ref = useRef(null);
|
|
2961
|
+
useEffect(() => {
|
|
2962
|
+
if (ref.current) {
|
|
2963
|
+
onFieldRef(ref.current);
|
|
2964
|
+
}
|
|
2965
|
+
}, []);
|
|
2966
|
+
return jsx("div", { ref: ref, children: children });
|
|
2967
|
+
});
|
|
2968
|
+
|
|
2942
2969
|
function shouldRenderField({ input, field, }) {
|
|
2943
2970
|
const { condition } = input;
|
|
2944
2971
|
const { value } = field(condition?.name || '');
|
|
@@ -2999,7 +3026,7 @@
|
|
|
2999
3026
|
...externalInputs,
|
|
3000
3027
|
};
|
|
3001
3028
|
const Component = fieldsRegister[String(input.name)];
|
|
3002
|
-
return shouldRenderField({ input, field }) && Component ? (jsx(
|
|
3029
|
+
return shouldRenderField({ input, field }) && Component ? (jsx(RefWrapper, { onFieldRef: field(input.name ?? '').setFieldRef, children: jsx(Component, { field: field, input: input, params: params }) }, String(i))) : null;
|
|
3003
3030
|
};
|
|
3004
3031
|
|
|
3005
3032
|
const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2 gap-x-m' : '@xl:grid-cols-1 gap-x-0';
|
|
@@ -5824,12 +5851,6 @@
|
|
|
5824
5851
|
WORK: 'Работаю',
|
|
5825
5852
|
RETIREE: 'Пенсионер',
|
|
5826
5853
|
};
|
|
5827
|
-
const INCOME_CERTIFICATE = {
|
|
5828
|
-
BANK_STATEMENT: 'Получаю зарплату на счет/карту в РСХБ',
|
|
5829
|
-
BANK_STATEMENT_PENS: 'Получаю пенсию на счет/карту в РСХБ',
|
|
5830
|
-
PFR_CERTIFICATE: 'Получаю зарплату на счет/карту в другом банке',
|
|
5831
|
-
OTHER: 'Другое',
|
|
5832
|
-
};
|
|
5833
5854
|
const getParticipantIncomes = (participantIncomes) => {
|
|
5834
5855
|
const wages = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "WAGES" /* EIncomesType.WAGES */)?.value;
|
|
5835
5856
|
const mandatoryPayments = participantIncomes?.find((contact) => contact.incomeTypeCd.key === "MANDATORY_PAYMENTS" /* EIncomesType.MANDATORY_PAYMENTS */)?.value;
|
|
@@ -5911,7 +5932,7 @@
|
|
|
5911
5932
|
const participant = task.participants[0];
|
|
5912
5933
|
const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
|
|
5913
5934
|
const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
|
|
5914
|
-
const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient,
|
|
5935
|
+
const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, } = participant;
|
|
5915
5936
|
return {
|
|
5916
5937
|
currency: currency?.key,
|
|
5917
5938
|
paymentSystem: getSelectValue(paymentSystem),
|
|
@@ -5949,7 +5970,6 @@
|
|
|
5949
5970
|
familyMembers: familyMembers?.toString(),
|
|
5950
5971
|
dependents: dependents?.toString(),
|
|
5951
5972
|
conscription: getSelectValue(conscription),
|
|
5952
|
-
confirmationIncome: getSelectValue(incomeCertificateCd, INCOME_CERTIFICATE),
|
|
5953
5973
|
snils,
|
|
5954
5974
|
armyIdFlg,
|
|
5955
5975
|
bankruptcyFlg,
|
|
@@ -5963,7 +5983,6 @@
|
|
|
5963
5983
|
monthsValue,
|
|
5964
5984
|
isAnnuity: paymentTypeCd?.key === 'ANNUITY',
|
|
5965
5985
|
},
|
|
5966
|
-
esiaAccountTypeCd: profile?.esiaAccountTypeCd,
|
|
5967
5986
|
...getParticipantIncomes(participantIncomes),
|
|
5968
5987
|
...getParticipantAddresses(participantAddresses),
|
|
5969
5988
|
...getParticipantContacts(participantContacts),
|
|
@@ -6354,8 +6373,10 @@
|
|
|
6354
6373
|
};
|
|
6355
6374
|
|
|
6356
6375
|
const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
|
|
6357
|
-
|
|
6358
|
-
|
|
6376
|
+
if (res?.access_token && res?.refresh_token) {
|
|
6377
|
+
saveToken(res);
|
|
6378
|
+
updateRefreshToken(true);
|
|
6379
|
+
}
|
|
6359
6380
|
return res;
|
|
6360
6381
|
});
|
|
6361
6382
|
|
|
@@ -6615,8 +6636,9 @@
|
|
|
6615
6636
|
const referalData = sessionStore.referalData;
|
|
6616
6637
|
const marketingInfoFromStorage = sessionStore.marketingInfo;
|
|
6617
6638
|
const queryStorage = new URLSearchParams(decodeURIComponent(queryFromStorage || ''));
|
|
6618
|
-
const
|
|
6619
|
-
const
|
|
6639
|
+
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
6640
|
+
const code = params.get('code');
|
|
6641
|
+
const state = params.get('state');
|
|
6620
6642
|
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
6621
6643
|
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
6622
6644
|
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
@@ -11671,7 +11693,7 @@
|
|
|
11671
11693
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11672
11694
|
});
|
|
11673
11695
|
|
|
11674
|
-
const packageVersion = "0.14.
|
|
11696
|
+
const packageVersion = "0.14.897";
|
|
11675
11697
|
|
|
11676
11698
|
exports.Blocks = Blocks;
|
|
11677
11699
|
exports.ContentPage = ContentPage;
|