@redneckz/wildless-cms-uni-blocks 0.14.739 → 0.14.741
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 +36 -39
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
- package/bundle/components/CreditForm/CreditFormStep.d.ts +0 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +2 -1
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -3
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +2 -1
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.d.ts +0 -1
- package/dist/components/CreditForm/CreditFormStep.js +2 -3
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/ui-kit/FormField/validators.js +1 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js +2 -1
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -3
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +2 -1
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.d.ts +0 -1
- package/lib/components/CreditForm/CreditFormStep.js +2 -3
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AddressField.d.ts +1 -1
- package/lib/ui-kit/FormField/validators.js +1 -1
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +36 -39
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
- package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +0 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +2 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -3
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +2 -1
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +0 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -3
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.js +1 -1
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +2 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.d.ts +0 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -3
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +1 -4
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +2 -1
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +0 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -3
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.js +1 -1
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +13 -9
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -6
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -4
- package/mobile/src/components/CreditForm/CreditForm.tsx +14 -10
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -6
- package/mobile/src/ui-kit/FormField/validators.ts +1 -3
- package/package.json +1 -1
- package/src/components/CreditCardForm/CreditCardForm.tsx +13 -9
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -6
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -4
- package/src/components/CreditForm/CreditForm.tsx +14 -10
- package/src/components/CreditForm/CreditFormStep.tsx +2 -6
- package/src/ui-kit/FormField/validators.ts +1 -3
|
@@ -2571,7 +2571,7 @@
|
|
|
2571
2571
|
const AGE_ERROR_MESSAGE = 'Допустимый возраст заёмщика - от 23 до 75 лет';
|
|
2572
2572
|
const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE);
|
|
2573
2573
|
const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE);
|
|
2574
|
-
const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' &&
|
|
2574
|
+
const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && /^[0-9]{1,2}$/g.test(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2575
2575
|
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE);
|
|
2576
2576
|
const lengthStringValidator = (inputLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= inputLength)(errorMsg ?? ERROR_MESSAGE);
|
|
2577
2577
|
const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
|
|
@@ -6800,33 +6800,6 @@
|
|
|
6800
6800
|
return (jsx("div", { className: "py-lg px-5xl bg-white col-span-12", children: jsxs("div", { children: [jsxs("span", { className: "font-bold mr-s", children: ["\u0428\u0430\u0433 ", step + 1, " \u0438\u0437 ", totalSteps, "."] }), stepsTitles[step] || null, jsx(ProgressBar, { step: progress, showPercentage: false })] }) }));
|
|
6801
6801
|
});
|
|
6802
6802
|
|
|
6803
|
-
const calculateInputs = (getValue) => (inputs, step) => inputs
|
|
6804
|
-
.filter((_) => _)
|
|
6805
|
-
.map((_) => {
|
|
6806
|
-
if ([
|
|
6807
|
-
checkIsRetiree(step, getValue),
|
|
6808
|
-
checkBusinessOwner(_, getValue),
|
|
6809
|
-
checkConsentPfrFlg(_, getValue),
|
|
6810
|
-
checkAddressFillFromESIA(_, getValue),
|
|
6811
|
-
checkAddressFact(_, getValue),
|
|
6812
|
-
checkCondition(_, getValue),
|
|
6813
|
-
].some(Boolean)) {
|
|
6814
|
-
return { ..._, required: false };
|
|
6815
|
-
}
|
|
6816
|
-
return _;
|
|
6817
|
-
});
|
|
6818
|
-
const checkIsRetiree = (step, getValue) => step === 2 && getValue('employment')?.key === 'RETIREE';
|
|
6819
|
-
const checkBusinessOwner = ({ name }, getValue) => name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
|
|
6820
|
-
const checkAddressFillFromESIA = ({ name, filledByEsia }, getValue) => name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
|
|
6821
|
-
const checkAddressFact = ({ name }, getValue) => name === 'addressFact' && getValue('addressMatch');
|
|
6822
|
-
const checkCondition = ({ condition }, getValue) => condition?.name &&
|
|
6823
|
-
condition?.values?.some((_) => {
|
|
6824
|
-
const dataValue = getValue(condition?.name);
|
|
6825
|
-
return _ !== (dataValue?.key ?? dataValue);
|
|
6826
|
-
});
|
|
6827
|
-
const checkConsentPfrFlg = ({ name }, getValue) => name === 'snils' && isSnilsRequired(getValue);
|
|
6828
|
-
const isSnilsRequired = (getValue) => getValue('confirmationIncome')?.key !== 'PFR_CERTIFICATE';
|
|
6829
|
-
|
|
6830
6803
|
var STATUS_TYPE;
|
|
6831
6804
|
(function (STATUS_TYPE) {
|
|
6832
6805
|
STATUS_TYPE["process"] = "IN_PROCESS";
|
|
@@ -6984,6 +6957,33 @@
|
|
|
6984
6957
|
return statusesMap[status] || jsx(ReworkStatusContent$1, {});
|
|
6985
6958
|
};
|
|
6986
6959
|
|
|
6960
|
+
const calculateInputs = (getValue) => (inputs, step) => inputs
|
|
6961
|
+
.filter((_) => _)
|
|
6962
|
+
.map((_) => {
|
|
6963
|
+
if ([
|
|
6964
|
+
checkIsRetiree(step, getValue),
|
|
6965
|
+
checkBusinessOwner(_, getValue),
|
|
6966
|
+
checkConsentPfrFlg(_, getValue),
|
|
6967
|
+
checkAddressFillFromESIA(_, getValue),
|
|
6968
|
+
checkAddressFact(_, getValue),
|
|
6969
|
+
checkCondition(_, getValue),
|
|
6970
|
+
].some(Boolean)) {
|
|
6971
|
+
return { ..._, required: false };
|
|
6972
|
+
}
|
|
6973
|
+
return _;
|
|
6974
|
+
});
|
|
6975
|
+
const checkIsRetiree = (step, getValue) => step === 2 && getValue('employment')?.key === 'RETIREE';
|
|
6976
|
+
const checkBusinessOwner = ({ name }, getValue) => name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
|
|
6977
|
+
const checkAddressFillFromESIA = ({ name, filledByEsia }, getValue) => name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
|
|
6978
|
+
const checkAddressFact = ({ name }, getValue) => name === 'addressFact' && getValue('addressMatch');
|
|
6979
|
+
const checkCondition = ({ condition }, getValue) => condition?.name &&
|
|
6980
|
+
condition?.values?.some((_) => {
|
|
6981
|
+
const dataValue = getValue(condition?.name);
|
|
6982
|
+
return _ !== (dataValue?.key ?? dataValue);
|
|
6983
|
+
});
|
|
6984
|
+
const checkConsentPfrFlg = ({ name }, getValue) => name === 'snils' && isSnilsRequired(getValue);
|
|
6985
|
+
const isSnilsRequired = (getValue) => getValue('confirmationIncome')?.key !== 'PFR_CERTIFICATE';
|
|
6986
|
+
|
|
6987
6987
|
const InputsMap = { ...InputsRetailMap, ...InputRetailCardMap };
|
|
6988
6988
|
const renderInputs$1 = ({ field, inputs, params }) => inputs.map(getField(field, params, InputsMap));
|
|
6989
6989
|
|
|
@@ -7290,10 +7290,7 @@
|
|
|
7290
7290
|
}));
|
|
7291
7291
|
resetForm(response);
|
|
7292
7292
|
}
|
|
7293
|
-
onNextStep();
|
|
7294
|
-
if (isFinalStep) {
|
|
7295
|
-
onFinish?.();
|
|
7296
|
-
}
|
|
7293
|
+
isFinalStep ? onFinish?.() : onNextStep();
|
|
7297
7294
|
}
|
|
7298
7295
|
catch (ex) {
|
|
7299
7296
|
// Do nothing
|
|
@@ -7305,7 +7302,7 @@
|
|
|
7305
7302
|
return [initialState, handleSubmit, isSending];
|
|
7306
7303
|
};
|
|
7307
7304
|
|
|
7308
|
-
const CreditCardFormStep = JSX(({ step, sections,
|
|
7305
|
+
const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
|
|
7309
7306
|
const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs || []), [sections]);
|
|
7310
7307
|
const formValidator = useCallback((formState) =>
|
|
7311
7308
|
// TODO Слишком сложно
|
|
@@ -7319,7 +7316,7 @@
|
|
|
7319
7316
|
formValidator,
|
|
7320
7317
|
onSubmit,
|
|
7321
7318
|
});
|
|
7322
|
-
return
|
|
7319
|
+
return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step }), jsx(StepsNavigationButtons$1, { isSending: isSending, step: step, onPrevStep: onPrevStep })] }));
|
|
7323
7320
|
});
|
|
7324
7321
|
|
|
7325
7322
|
const PERSONAL_INFO_CONTENT = [
|
|
@@ -7723,7 +7720,7 @@
|
|
|
7723
7720
|
}, []);
|
|
7724
7721
|
const sections = stepsSectionsMap$1[step];
|
|
7725
7722
|
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
7726
|
-
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections,
|
|
7723
|
+
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step))) })] }) }));
|
|
7727
7724
|
});
|
|
7728
7725
|
|
|
7729
7726
|
const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
|
|
@@ -8097,7 +8094,7 @@
|
|
|
8097
8094
|
return [initialState, handleSubmit, isSending];
|
|
8098
8095
|
};
|
|
8099
8096
|
|
|
8100
|
-
const CreditFormStep = JSX(({ step, sections,
|
|
8097
|
+
const CreditFormStep = JSX(({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
|
|
8101
8098
|
const { programId } = useRetailFormStore();
|
|
8102
8099
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
8103
8100
|
const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
|
|
@@ -8113,7 +8110,7 @@
|
|
|
8113
8110
|
formValidator,
|
|
8114
8111
|
onSubmit,
|
|
8115
8112
|
});
|
|
8116
|
-
return
|
|
8113
|
+
return (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, isSending: isSending, onPrevStep: onPrevStep })] }));
|
|
8117
8114
|
});
|
|
8118
8115
|
|
|
8119
8116
|
const stepsSectionsMap = [
|
|
@@ -8148,7 +8145,7 @@
|
|
|
8148
8145
|
const sections = stepsSectionsMap[step];
|
|
8149
8146
|
const isStartStep = step === 0;
|
|
8150
8147
|
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
8151
|
-
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections,
|
|
8148
|
+
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsx(CreditFormStep, { step: step, sections: sections, programsSource: programsSource, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step))) })] }) }));
|
|
8152
8149
|
});
|
|
8153
8150
|
|
|
8154
8151
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
@@ -10056,7 +10053,7 @@
|
|
|
10056
10053
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10057
10054
|
});
|
|
10058
10055
|
|
|
10059
|
-
const packageVersion = "0.14.
|
|
10056
|
+
const packageVersion = "0.14.740";
|
|
10060
10057
|
|
|
10061
10058
|
exports.Blocks = Blocks;
|
|
10062
10059
|
exports.ContentPage = ContentPage;
|