@redneckz/wildless-cms-uni-blocks 0.14.621 → 0.14.622
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +35 -27
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/bundle/components/CreditForm/CreditFormStep.d.ts +1 -2
- package/bundle/components/CreditForm/StepsNavigationButtons.d.ts +0 -1
- package/bundle/components/CreditForm/creditFormStepsData.d.ts +2 -178
- package/bundle/ui-kit/FormField/getNamesFromInput.d.ts +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/dist/components/ApplicationForm/getInitialFormState.js +1 -1
- package/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationForm/renderInputs.js +2 -2
- package/dist/components/ApplicationForm/renderInputs.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +3 -3
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/CreditFormProgress.js +3 -3
- package/dist/components/CreditForm/CreditFormProgress.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.d.ts +1 -2
- package/dist/components/CreditForm/CreditFormStep.js +3 -3
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/StepsNavigationButtons.d.ts +0 -1
- package/dist/components/CreditForm/StepsNavigationButtons.js +2 -1
- package/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.d.ts +2 -178
- package/dist/components/CreditForm/creditFormStepsData.js +7 -8
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js +9 -1
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/dist/ui-kit/FormField/getField.js +1 -1
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getNamesFromInput.d.ts +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/lib/components/ApplicationForm/getInitialFormState.js +1 -1
- package/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationForm/renderInputs.js +2 -2
- package/lib/components/ApplicationForm/renderInputs.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.d.ts +0 -2
- package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +3 -3
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/CreditFormProgress.js +3 -3
- package/lib/components/CreditForm/CreditFormProgress.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.d.ts +1 -2
- package/lib/components/CreditForm/CreditFormStep.js +3 -3
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/StepsNavigationButtons.d.ts +0 -1
- package/lib/components/CreditForm/StepsNavigationButtons.js +2 -1
- package/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.d.ts +2 -178
- package/lib/components/CreditForm/creditFormStepsData.js +7 -8
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js +9 -1
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/lib/ui-kit/FormField/getField.js +1 -1
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getNamesFromInput.d.ts +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +35 -27
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +1 -2
- package/mobile/bundle/components/CreditForm/StepsNavigationButtons.d.ts +0 -1
- package/mobile/bundle/components/CreditForm/creditFormStepsData.d.ts +2 -178
- package/mobile/bundle/ui-kit/FormField/getNamesFromInput.d.ts +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/dist/components/ApplicationForm/getInitialFormState.js +1 -1
- package/mobile/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderInputs.js +2 -2
- package/mobile/dist/components/ApplicationForm/renderInputs.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +3 -3
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormProgress.js +3 -3
- package/mobile/dist/components/CreditForm/CreditFormProgress.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +1 -2
- package/mobile/dist/components/CreditForm/CreditFormStep.js +3 -3
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.d.ts +0 -1
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js +2 -1
- package/mobile/dist/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.d.ts +2 -178
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +7 -8
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js +9 -1
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getNamesFromInput.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/lib/components/ApplicationForm/getInitialFormState.js +1 -1
- package/mobile/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderInputs.js +2 -2
- package/mobile/lib/components/ApplicationForm/renderInputs.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +3 -3
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormProgress.js +3 -3
- package/mobile/lib/components/CreditForm/CreditFormProgress.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +1 -2
- package/mobile/lib/components/CreditForm/CreditFormStep.js +3 -3
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.d.ts +0 -1
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js +2 -1
- package/mobile/lib/components/CreditForm/StepsNavigationButtons.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.d.ts +2 -178
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +7 -8
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js +9 -1
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getNamesFromInput.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +1 -1
- package/mobile/src/components/ApplicationForm/getInitialFormState.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderInputs.tsx +2 -2
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +1 -1
- package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +9 -2
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +1 -1
- package/mobile/src/components/CreditForm/CreditForm.tsx +7 -5
- package/mobile/src/components/CreditForm/CreditFormProgress.tsx +5 -5
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +4 -5
- package/mobile/src/components/CreditForm/StepsNavigationButtons.tsx +3 -2
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +9 -8
- package/mobile/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +25 -9
- package/mobile/src/ui-kit/FormField/getField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormContent.ts +1 -1
- package/src/components/ApplicationForm/getInitialFormState.tsx +1 -1
- package/src/components/ApplicationForm/renderInputs.tsx +2 -2
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +0 -121
- package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +1 -1
- package/src/components/ApplicationLeadForm/GroupedConsents.tsx +9 -2
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +1 -1
- package/src/components/CreditForm/CreditForm.tsx +7 -5
- package/src/components/CreditForm/CreditFormProgress.tsx +5 -5
- package/src/components/CreditForm/CreditFormStep.tsx +4 -5
- package/src/components/CreditForm/StepsNavigationButtons.tsx +3 -2
- package/src/components/CreditForm/creditFormStepsData.tsx +9 -8
- package/src/icons/IconName.ts +6 -360
- package/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +25 -9
- package/src/ui-kit/FormField/getField.tsx +1 -1
- package/src/ui-kit/FormField/getObjectValidator.tsx +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -1518,7 +1518,7 @@
|
|
|
1518
1518
|
};
|
|
1519
1519
|
const getObjectValidator = (inputs) => {
|
|
1520
1520
|
const requiredInputs = getNamesFromInput(inputs.filter((_) => Boolean(_?.required)));
|
|
1521
|
-
return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
|
|
1521
|
+
return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_ || '']]));
|
|
1522
1522
|
};
|
|
1523
1523
|
|
|
1524
1524
|
const withValidator = (props, validator) => {
|
|
@@ -2329,7 +2329,15 @@
|
|
|
2329
2329
|
|
|
2330
2330
|
const ParticipantDateRegistrationField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E \u043C\u0435\u0441\u0442\u0443 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430", ...getValidation(field('participantDateRegistration'), validatorObj.participantDateRegistration, input?.required) })));
|
|
2331
2331
|
|
|
2332
|
-
const
|
|
2332
|
+
const MAX_PART = 100;
|
|
2333
|
+
const PartInBusinessField = JSX(({ field, input }) => {
|
|
2334
|
+
const partInBusinessField = {
|
|
2335
|
+
...getValidation(field('partInBusiness'), validatorObj.partInBusiness, input?.required),
|
|
2336
|
+
};
|
|
2337
|
+
const handleChange = (value) => partInBusinessField?.onChange &&
|
|
2338
|
+
partInBusinessField?.onChange(String(Number(value) > MAX_PART ? MAX_PART : Number(value) || ''));
|
|
2339
|
+
return (jsx(InputControl, { label: "\u0414\u043E\u043B\u044F \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0432 \u0431\u0438\u0437\u043D\u0435\u0441\u0435", placeholder: "\u0432 %", inputLength: 3, type: "number", ...partInBusinessField, ...input, onChange: handleChange }));
|
|
2340
|
+
});
|
|
2333
2341
|
|
|
2334
2342
|
const PartnerCommentsField = JSX(({ field, input }) => {
|
|
2335
2343
|
const { required, ...rest } = input;
|
|
@@ -2560,7 +2568,7 @@
|
|
|
2560
2568
|
bankEmployeeCode: jsx(BankEmpoleeCodeField, { field: field, input: input }),
|
|
2561
2569
|
partInBusiness: jsx(PartInBusinessField, { field: field, input: input }),
|
|
2562
2570
|
};
|
|
2563
|
-
return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name] }, String(i))) : null;
|
|
2571
|
+
return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name || ''] }, String(i))) : null;
|
|
2564
2572
|
};
|
|
2565
2573
|
|
|
2566
2574
|
const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
|
|
@@ -2687,7 +2695,7 @@
|
|
|
2687
2695
|
const getInitialFormState$2 = (inputs, typeForm = '') => {
|
|
2688
2696
|
const formState = Object.fromEntries(inputs.map((_) => [
|
|
2689
2697
|
_.name,
|
|
2690
|
-
(_.fieldType === 'ved' && _?.defaultValue) || initialFormState$1[_.name],
|
|
2698
|
+
(_.fieldType === 'ved' && _?.defaultValue) || initialFormState$1[_.name || ''],
|
|
2691
2699
|
]));
|
|
2692
2700
|
if (formState?.serviceType && typeForm === 'PREMIUMSERVICE') {
|
|
2693
2701
|
formState.serviceType = SERVICE_TYPES[1];
|
|
@@ -2823,8 +2831,8 @@
|
|
|
2823
2831
|
return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
|
|
2824
2832
|
};
|
|
2825
2833
|
const splitInputs = (inputs) => ({
|
|
2826
|
-
consentInputs: inputs?.filter((_) => Object.keys(CONSENTS).includes(_.name)) || [],
|
|
2827
|
-
restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name)) || [],
|
|
2834
|
+
consentInputs: inputs?.filter((_) => Object.keys(CONSENTS).includes(_.name || '')) || [],
|
|
2835
|
+
restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name || '')) || [],
|
|
2828
2836
|
});
|
|
2829
2837
|
|
|
2830
2838
|
/* eslint-disable max-lines */
|
|
@@ -2868,7 +2876,7 @@
|
|
|
2868
2876
|
}
|
|
2869
2877
|
const formState = Object.fromEntries(inputs.map((_) => [
|
|
2870
2878
|
_.name,
|
|
2871
|
-
(_.fieldType === 'ved' && _?.defaultValue) || initialFormState[_.name],
|
|
2879
|
+
(_.fieldType === 'ved' && _?.defaultValue) || initialFormState[_.name || ''],
|
|
2872
2880
|
]));
|
|
2873
2881
|
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
2874
2882
|
};
|
|
@@ -3377,7 +3385,7 @@
|
|
|
3377
3385
|
const [isLoading, setIsLoading] = useState(false);
|
|
3378
3386
|
const [profileId] = useLocalStorage('profileId');
|
|
3379
3387
|
const [, setEsiaData] = useLocalStorage('esiaData');
|
|
3380
|
-
const params = new URLSearchParams(decodeURIComponent(
|
|
3388
|
+
const params = new URLSearchParams(decodeURIComponent(globalThis.location.search));
|
|
3381
3389
|
const esiaAuth = params.get('esiaAuth');
|
|
3382
3390
|
const updateEsiaProfile = useCallback(async () => {
|
|
3383
3391
|
const code = params.get('code');
|
|
@@ -5095,9 +5103,9 @@
|
|
|
5095
5103
|
|
|
5096
5104
|
const ProgressBar = JSX(({ step = 10, description, showPercentage = true }) => (jsxs("div", { children: [jsx("div", { className: "h-4 w-full bg-gray relative", children: jsx("div", { className: "h-4 bg-green", style: { width: `${step}%` } }) }), jsxs("div", { className: "relative", children: [showPercentage ? jsxs("div", { className: "absolute left-2/4 text-green", children: [step, "%"] }) : null, description ? jsx("div", { className: "text-right mr-4 text-gray", children: description }) : null] })] })));
|
|
5097
5105
|
|
|
5098
|
-
const CreditFormProgress = JSX(({ step =
|
|
5099
|
-
const progress = useMemo(() => (step / totalSteps) * 100, [step, totalSteps]);
|
|
5100
|
-
return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold", children: ["\u0428\u0430\u0433 ", step, " \u0438\u0437 ", totalSteps, "."] }),
|
|
5106
|
+
const CreditFormProgress = JSX(({ step = 0, totalSteps = 5, stepsTitles = [] }) => {
|
|
5107
|
+
const progress = useMemo(() => ((step + 1) / totalSteps) * 100, [step, totalSteps]);
|
|
5108
|
+
return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold", children: ["\u0428\u0430\u0433 ", step + 1, " \u0438\u0437 ", totalSteps, "."] }), stepsTitles[step] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
|
|
5101
5109
|
});
|
|
5102
5110
|
|
|
5103
5111
|
const formStateMap = {
|
|
@@ -5179,7 +5187,8 @@
|
|
|
5179
5187
|
};
|
|
5180
5188
|
|
|
5181
5189
|
const StepsNavigationButtons = JSX(({ step, onPrevStep }) => {
|
|
5182
|
-
|
|
5190
|
+
const isFirstStep = step === 0;
|
|
5191
|
+
return (jsxs("div", { className: 'flex justify-between', children: [jsx(Button, { onClick: onPrevStep, className: style('w-full @xl:w-auto'), type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { className: style('w-full @xl:w-auto'), type: "submit", children: "\u0414\u0430\u043B\u0435\u0435" })] }));
|
|
5183
5192
|
});
|
|
5184
5193
|
|
|
5185
5194
|
const useCreditFormApi = ({ inputs, onNextStep, saveStep }) => {
|
|
@@ -5197,7 +5206,7 @@
|
|
|
5197
5206
|
};
|
|
5198
5207
|
};
|
|
5199
5208
|
|
|
5200
|
-
const CreditFormStep = JSX(({
|
|
5209
|
+
const CreditFormStep = JSX(({ step, sections, onPrevStep, onNextStep, inputs }) => {
|
|
5201
5210
|
const [localStorageData, saveStep] = useLocalStorage('leadForm');
|
|
5202
5211
|
const initialState = getInitialFormState(step, localStorageData);
|
|
5203
5212
|
const { handleSubmit } = useCreditFormApi({
|
|
@@ -5206,10 +5215,10 @@
|
|
|
5206
5215
|
saveStep,
|
|
5207
5216
|
});
|
|
5208
5217
|
const [, { field, onSubmit }] = useForm(initialState, { onSubmit: handleSubmit });
|
|
5209
|
-
return (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$1({ sections, field }), jsx(StepsNavigationButtons, { step: step,
|
|
5218
|
+
return (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$1({ sections, field }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
|
|
5210
5219
|
});
|
|
5211
5220
|
const renderStep$1 = ({ sections, field }) => {
|
|
5212
|
-
return sections
|
|
5221
|
+
return sections?.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderInfo$1(_?.inputs), renderTitle(_?.title), renderInputs({ field, inputs: _?.inputs })] }, `section-${i}`)));
|
|
5213
5222
|
};
|
|
5214
5223
|
const renderInfo$1 = (inputs = []) => {
|
|
5215
5224
|
const infoInputs = inputs.filter((_) => _.fieldType === 'info');
|
|
@@ -5218,9 +5227,8 @@
|
|
|
5218
5227
|
|
|
5219
5228
|
/* eslint-disable max-lines */
|
|
5220
5229
|
/* eslint-disable max-len */
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
1: [
|
|
5230
|
+
const stepsSectionsMap = [
|
|
5231
|
+
[
|
|
5224
5232
|
{
|
|
5225
5233
|
title: 'Персональные данные',
|
|
5226
5234
|
columns: 2,
|
|
@@ -5275,7 +5283,7 @@
|
|
|
5275
5283
|
],
|
|
5276
5284
|
},
|
|
5277
5285
|
],
|
|
5278
|
-
|
|
5286
|
+
[
|
|
5279
5287
|
{
|
|
5280
5288
|
title: 'Данные о трудоустройстве',
|
|
5281
5289
|
inputs: [],
|
|
@@ -5339,7 +5347,7 @@
|
|
|
5339
5347
|
inputs: [{ fieldType: 'common', name: 'fullAddress', required: true }],
|
|
5340
5348
|
},
|
|
5341
5349
|
],
|
|
5342
|
-
|
|
5350
|
+
[
|
|
5343
5351
|
{
|
|
5344
5352
|
title: 'Семейное положение',
|
|
5345
5353
|
},
|
|
@@ -5383,7 +5391,7 @@
|
|
|
5383
5391
|
inputs: [{ fieldType: 'common', name: 'armyIdFlg' }],
|
|
5384
5392
|
},
|
|
5385
5393
|
],
|
|
5386
|
-
|
|
5394
|
+
[
|
|
5387
5395
|
{
|
|
5388
5396
|
title: 'Дополнительные сведения',
|
|
5389
5397
|
columns: 1,
|
|
@@ -5405,7 +5413,7 @@
|
|
|
5405
5413
|
inputs: [{ fieldType: 'common', name: 'creditInRshbCd' }],
|
|
5406
5414
|
},
|
|
5407
5415
|
],
|
|
5408
|
-
|
|
5416
|
+
[
|
|
5409
5417
|
{
|
|
5410
5418
|
title: 'Отделение Банка',
|
|
5411
5419
|
columns: 1,
|
|
@@ -5434,7 +5442,7 @@
|
|
|
5434
5442
|
inputs: [{ fieldType: 'common', name: 'bankEmployeeCode' }],
|
|
5435
5443
|
},
|
|
5436
5444
|
],
|
|
5437
|
-
|
|
5445
|
+
];
|
|
5438
5446
|
|
|
5439
5447
|
const STEPS_COUNT = 5;
|
|
5440
5448
|
const STEPS_TITLES = [
|
|
@@ -5445,17 +5453,17 @@
|
|
|
5445
5453
|
'Отделение Банка',
|
|
5446
5454
|
];
|
|
5447
5455
|
const CreditForm = JSX(({ className, ...rest }) => {
|
|
5448
|
-
const [step, setStep] = useState(
|
|
5456
|
+
const [step, setStep] = useState(0);
|
|
5449
5457
|
const sections = useMemo(() => stepsSectionsMap[step], [step]);
|
|
5450
5458
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
5451
5459
|
const handleNextStep = useCallback(() => {
|
|
5452
|
-
setStep((_) => Math.min(_ + 1, STEPS_COUNT));
|
|
5460
|
+
setStep((_) => Math.min(_ + 1, STEPS_COUNT - 1));
|
|
5453
5461
|
}, []);
|
|
5454
5462
|
const handlePrevStep = useCallback(() => {
|
|
5455
5463
|
//TODO search hook - 1,
|
|
5456
5464
|
setStep((_) => Math.max(_ - 1, 0));
|
|
5457
5465
|
}, []);
|
|
5458
|
-
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container grid grid-cols-12", children: [jsx(CreditFormProgress, { stepsTitles: STEPS_TITLES, step: step, totalSteps: STEPS_COUNT }), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { inputs: inputs,
|
|
5466
|
+
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container grid grid-cols-12", children: [jsx(CreditFormProgress, { stepsTitles: STEPS_TITLES, step: step, totalSteps: STEPS_COUNT }), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { inputs: inputs, step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep }, String(step)) })] }) }));
|
|
5459
5467
|
});
|
|
5460
5468
|
|
|
5461
5469
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
@@ -8249,7 +8257,7 @@
|
|
|
8249
8257
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
8250
8258
|
});
|
|
8251
8259
|
|
|
8252
|
-
const packageVersion = "0.14.
|
|
8260
|
+
const packageVersion = "0.14.621";
|
|
8253
8261
|
|
|
8254
8262
|
exports.Blocks = Blocks;
|
|
8255
8263
|
exports.ContentPage = ContentPage;
|