@redneckz/wildless-cms-uni-blocks 0.14.655 → 0.14.656
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 +87 -61
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CreditCardForm/formStateMap.d.ts +10 -10
- package/bundle/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
- package/bundle/components/CreditCardForm/renderInfo.d.ts +2 -1
- package/bundle/components/CreditCardForm/renderStep.d.ts +3 -4
- package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -4
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js +61 -34
- package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/dist/components/CreditCardForm/formStateMap.d.ts +10 -10
- package/dist/components/CreditCardForm/formStateMap.js +3 -7
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
- package/dist/components/CreditCardForm/getFilteredInputs.js +11 -0
- package/dist/components/CreditCardForm/getFilteredInputs.js.map +1 -0
- package/dist/components/CreditCardForm/getInitialFormState.js +3 -0
- package/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/dist/components/CreditCardForm/renderInfo.d.ts +2 -1
- package/dist/components/CreditCardForm/renderInfo.js +5 -3
- package/dist/components/CreditCardForm/renderInfo.js.map +1 -1
- package/dist/components/CreditCardForm/renderStep.d.ts +3 -4
- package/dist/components/CreditCardForm/renderStep.js +1 -9
- package/dist/components/CreditCardForm/renderStep.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -4
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js +61 -34
- package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.d.ts +10 -10
- package/lib/components/CreditCardForm/formStateMap.js +3 -7
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
- package/lib/components/CreditCardForm/getFilteredInputs.js +8 -0
- package/lib/components/CreditCardForm/getFilteredInputs.js.map +1 -0
- package/lib/components/CreditCardForm/getInitialFormState.js +3 -0
- package/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/lib/components/CreditCardForm/renderInfo.d.ts +2 -1
- package/lib/components/CreditCardForm/renderInfo.js +5 -3
- package/lib/components/CreditCardForm/renderInfo.js.map +1 -1
- package/lib/components/CreditCardForm/renderStep.d.ts +3 -4
- package/lib/components/CreditCardForm/renderStep.js +1 -9
- package/lib/components/CreditCardForm/renderStep.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +87 -61
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CreditCardForm/formStateMap.d.ts +10 -10
- package/mobile/bundle/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
- package/mobile/bundle/components/CreditCardForm/renderInfo.d.ts +2 -1
- package/mobile/bundle/components/CreditCardForm/renderStep.d.ts +3 -4
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -4
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +61 -34
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.d.ts +10 -10
- package/mobile/dist/components/CreditCardForm/formStateMap.js +3 -7
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
- package/mobile/dist/components/CreditCardForm/getFilteredInputs.js +11 -0
- package/mobile/dist/components/CreditCardForm/getFilteredInputs.js.map +1 -0
- package/mobile/dist/components/CreditCardForm/getInitialFormState.js +3 -0
- package/mobile/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/renderInfo.d.ts +2 -1
- package/mobile/dist/components/CreditCardForm/renderInfo.js +5 -3
- package/mobile/dist/components/CreditCardForm/renderInfo.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/renderStep.d.ts +3 -4
- package/mobile/dist/components/CreditCardForm/renderStep.js +1 -9
- package/mobile/dist/components/CreditCardForm/renderStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -4
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +61 -34
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.d.ts +10 -10
- package/mobile/lib/components/CreditCardForm/formStateMap.js +3 -7
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getFilteredInputs.d.ts +3 -0
- package/mobile/lib/components/CreditCardForm/getFilteredInputs.js +8 -0
- package/mobile/lib/components/CreditCardForm/getFilteredInputs.js.map +1 -0
- package/mobile/lib/components/CreditCardForm/getInitialFormState.js +3 -0
- package/mobile/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/renderInfo.d.ts +2 -1
- package/mobile/lib/components/CreditCardForm/renderInfo.js +5 -3
- package/mobile/lib/components/CreditCardForm/renderInfo.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/renderStep.d.ts +3 -4
- package/mobile/lib/components/CreditCardForm/renderStep.js +1 -9
- package/mobile/lib/components/CreditCardForm/renderStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +3 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -6
- package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +61 -34
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +14 -17
- package/mobile/src/components/CreditCardForm/getFilteredInputs.tsx +18 -0
- package/mobile/src/components/CreditCardForm/getInitialFormState.tsx +3 -0
- package/mobile/src/components/CreditCardForm/renderInfo.tsx +9 -3
- package/mobile/src/components/CreditCardForm/renderStep.tsx +5 -22
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +3 -1
- package/package.json +1 -1
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -6
- package/src/components/CreditCardForm/creditCardFormStepsData.tsx +61 -34
- package/src/components/CreditCardForm/formStateMap.tsx +14 -17
- package/src/components/CreditCardForm/getFilteredInputs.tsx +18 -0
- package/src/components/CreditCardForm/getInitialFormState.tsx +3 -0
- package/src/components/CreditCardForm/renderInfo.tsx +9 -3
- package/src/components/CreditCardForm/renderStep.tsx +5 -22
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +3 -1
|
@@ -3553,7 +3553,7 @@
|
|
|
3553
3553
|
const [responseType, setResponseType] = useState('');
|
|
3554
3554
|
const responseTypeDialog = useResponseTypeDialog({ typeForm });
|
|
3555
3555
|
const handleSubmit = useCallback(async (formData, ev) => {
|
|
3556
|
-
const inputsFiltered = getFilteredInputs(inputs, formData);
|
|
3556
|
+
const inputsFiltered = getFilteredInputs$1(inputs, formData);
|
|
3557
3557
|
const feedbackValidator = objectValidator(getObjectValidator(inputsFiltered));
|
|
3558
3558
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
3559
3559
|
return console.warn('validation fail');
|
|
@@ -3580,7 +3580,7 @@
|
|
|
3580
3580
|
}, [responseType]);
|
|
3581
3581
|
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
|
|
3582
3582
|
});
|
|
3583
|
-
const getFilteredInputs = (inputs, data) => inputs
|
|
3583
|
+
const getFilteredInputs$1 = (inputs, data) => inputs
|
|
3584
3584
|
.filter((_) => (_?.name === 'secondaryPhone' ? Boolean(data.secondaryPhone) : _))
|
|
3585
3585
|
.filter((input) => !input?.condition ||
|
|
3586
3586
|
input?.condition.values.find((_) => {
|
|
@@ -6123,11 +6123,6 @@
|
|
|
6123
6123
|
fiasCode: '',
|
|
6124
6124
|
},
|
|
6125
6125
|
housing: '',
|
|
6126
|
-
methodObtain: 'office',
|
|
6127
|
-
addressCourier: {
|
|
6128
|
-
fullAddress: '',
|
|
6129
|
-
fiasCode: '',
|
|
6130
|
-
},
|
|
6131
6126
|
},
|
|
6132
6127
|
2: {
|
|
6133
6128
|
amountWorkers: { key: '', text: '' },
|
|
@@ -6154,6 +6149,7 @@
|
|
|
6154
6149
|
familyStatus: { key: '', text: '' },
|
|
6155
6150
|
dependents: undefined,
|
|
6156
6151
|
familyMembers: undefined,
|
|
6152
|
+
confirmationIncome: { key: '', text: '' },
|
|
6157
6153
|
mandatoryIncome: undefined,
|
|
6158
6154
|
otherPayments: undefined,
|
|
6159
6155
|
snils: '',
|
|
@@ -6172,11 +6168,11 @@
|
|
|
6172
6168
|
fullAddress: '',
|
|
6173
6169
|
fiasCode: '',
|
|
6174
6170
|
},
|
|
6175
|
-
|
|
6176
|
-
addressCoutier: {
|
|
6171
|
+
addressCourier: {
|
|
6177
6172
|
fullAddress: '',
|
|
6178
6173
|
fiasCode: '',
|
|
6179
6174
|
},
|
|
6175
|
+
bankEmployeeCode: '',
|
|
6180
6176
|
methodObtain: 'office',
|
|
6181
6177
|
deliveryDate: undefined,
|
|
6182
6178
|
},
|
|
@@ -6198,6 +6194,9 @@
|
|
|
6198
6194
|
localStorageData.beginDate = localStorageData?.beginDate
|
|
6199
6195
|
? new Date(localStorageData.beginDate)
|
|
6200
6196
|
: undefined;
|
|
6197
|
+
localStorageData.deliveryDate = localStorageData?.deliveryDate
|
|
6198
|
+
? new Date(localStorageData.deliveryDate)
|
|
6199
|
+
: undefined;
|
|
6201
6200
|
}
|
|
6202
6201
|
return {
|
|
6203
6202
|
...formStateMap$1[step],
|
|
@@ -6205,24 +6204,25 @@
|
|
|
6205
6204
|
};
|
|
6206
6205
|
};
|
|
6207
6206
|
|
|
6208
|
-
const
|
|
6207
|
+
const getFilteredInputs = (inputs, data) => inputs
|
|
6208
|
+
.filter((_) => _)
|
|
6209
|
+
.filter((input) => !input?.condition ||
|
|
6210
|
+
input?.condition.values.find((_) => {
|
|
6211
|
+
const dataValue = data?.[input?.condition?.name ?? ''];
|
|
6212
|
+
return _ === (dataValue?.key ?? dataValue);
|
|
6213
|
+
}));
|
|
6214
|
+
|
|
6215
|
+
const renderInfo$2 = (state, inputs = []) => {
|
|
6209
6216
|
const infoInputs = inputs.filter((_) => _.fieldType === 'info');
|
|
6210
|
-
|
|
6211
|
-
|
|
6217
|
+
const filteredInputs = getFilteredInputs(infoInputs, state);
|
|
6218
|
+
return filteredInputs.length
|
|
6219
|
+
? filteredInputs.map(({ text, name }, i) => jsx(InfoCard, { __html: text }, `${name}_${i}`))
|
|
6212
6220
|
: null;
|
|
6213
6221
|
};
|
|
6214
6222
|
|
|
6215
6223
|
const renderInputs$1 = ({ field, inputs }) => (inputs || [])?.map(getField(field, ''));
|
|
6216
6224
|
|
|
6217
|
-
const
|
|
6218
|
-
?.filter(({ type }) => type === methodObtain || !type)
|
|
6219
|
-
.map(({ inputs, columns, title }, i) => (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(inputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`)));
|
|
6220
|
-
const renderStep$1 = ({ sections, field, isLastStep, methodObtain }) => {
|
|
6221
|
-
if (isLastStep) {
|
|
6222
|
-
return renderLastStep({ sections, field, methodObtain });
|
|
6223
|
-
}
|
|
6224
|
-
return sections?.map(({ inputs, columns, title }, i) => (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(inputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`)));
|
|
6225
|
-
};
|
|
6225
|
+
const renderStep$1 = ({ sections, field, userInputParams }) => sections?.map(({ inputs, columns, title }, i) => (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(userInputParams, inputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`)));
|
|
6226
6226
|
|
|
6227
6227
|
const StepsNavigationButtons$1 = JSX(({ step, onPrevStep }) => {
|
|
6228
6228
|
const isFirstStep = step === 0;
|
|
@@ -6367,7 +6367,8 @@
|
|
|
6367
6367
|
const [profileId] = useLocalStorage('profileId');
|
|
6368
6368
|
const [participantId] = useLocalStorage('participantId');
|
|
6369
6369
|
const handleSubmit = useCallback(async (formData) => {
|
|
6370
|
-
const
|
|
6370
|
+
const inputsFiltered = getFilteredInputs(inputs, formData);
|
|
6371
|
+
const feedbackValidator = objectValidator(getObjectValidator(calculateInputs$1(formData, inputsFiltered, step)));
|
|
6371
6372
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
6372
6373
|
return console.warn('validation fail');
|
|
6373
6374
|
}
|
|
@@ -6412,18 +6413,16 @@
|
|
|
6412
6413
|
saveStep,
|
|
6413
6414
|
finishForm,
|
|
6414
6415
|
});
|
|
6415
|
-
const [
|
|
6416
|
+
const [userInputParams, { field, onSubmit }] = useForm(initialState, {
|
|
6416
6417
|
onSubmit: (formData, ev) => {
|
|
6417
6418
|
handleSubmit({ ...formData, ...customSubmit.current?.(ev) });
|
|
6418
6419
|
},
|
|
6419
6420
|
});
|
|
6420
|
-
const methodObtain = 'methodObtain' in state ? state.methodObtain : undefined;
|
|
6421
6421
|
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$1({
|
|
6422
6422
|
sections,
|
|
6423
6423
|
field,
|
|
6424
6424
|
registerSubmit,
|
|
6425
|
-
|
|
6426
|
-
isLastStep: step === 5,
|
|
6425
|
+
userInputParams: userInputParams,
|
|
6427
6426
|
}), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
|
|
6428
6427
|
});
|
|
6429
6428
|
|
|
@@ -6682,56 +6681,83 @@
|
|
|
6682
6681
|
inputs: [{ fieldType: 'common', name: 'methodObtain' }],
|
|
6683
6682
|
},
|
|
6684
6683
|
{
|
|
6685
|
-
type: 'courier',
|
|
6686
6684
|
title: 'Адрес',
|
|
6687
6685
|
columns: 1,
|
|
6688
6686
|
inputs: [],
|
|
6689
6687
|
},
|
|
6690
6688
|
{
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6689
|
+
inputs: [
|
|
6690
|
+
{
|
|
6691
|
+
fieldType: 'common',
|
|
6692
|
+
name: 'addressCourier',
|
|
6693
|
+
dadata: true,
|
|
6694
|
+
condition: {
|
|
6695
|
+
name: 'methodObtain',
|
|
6696
|
+
values: ['courier'],
|
|
6697
|
+
},
|
|
6698
|
+
required: true,
|
|
6699
|
+
},
|
|
6700
|
+
{
|
|
6701
|
+
fieldType: 'common',
|
|
6702
|
+
name: 'deliveryDate',
|
|
6703
|
+
condition: {
|
|
6704
|
+
name: 'methodObtain',
|
|
6705
|
+
values: ['courier'],
|
|
6706
|
+
},
|
|
6707
|
+
required: true,
|
|
6708
|
+
},
|
|
6709
|
+
{
|
|
6710
|
+
fieldType: 'common',
|
|
6711
|
+
name: 'comment',
|
|
6712
|
+
condition: {
|
|
6713
|
+
name: 'methodObtain',
|
|
6714
|
+
values: ['courier'],
|
|
6715
|
+
},
|
|
6716
|
+
},
|
|
6717
|
+
],
|
|
6715
6718
|
},
|
|
6716
6719
|
{
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6720
|
+
inputs: [
|
|
6721
|
+
{
|
|
6722
|
+
fieldType: 'common',
|
|
6723
|
+
name: 'regionRetail',
|
|
6724
|
+
required: true,
|
|
6725
|
+
condition: {
|
|
6726
|
+
name: 'methodObtain',
|
|
6727
|
+
values: ['office'],
|
|
6728
|
+
},
|
|
6729
|
+
},
|
|
6730
|
+
{
|
|
6731
|
+
fieldType: 'common',
|
|
6732
|
+
name: 'addressRetail',
|
|
6733
|
+
required: true,
|
|
6734
|
+
condition: {
|
|
6735
|
+
name: 'methodObtain',
|
|
6736
|
+
values: ['office'],
|
|
6737
|
+
},
|
|
6738
|
+
},
|
|
6739
|
+
],
|
|
6721
6740
|
},
|
|
6722
6741
|
{
|
|
6723
|
-
type: 'office',
|
|
6724
6742
|
inputs: [
|
|
6725
6743
|
{
|
|
6726
6744
|
fieldType: 'info',
|
|
6727
6745
|
text: 'Если представитель Банка помогал Вам в заведении заявки, введите здесь его код',
|
|
6746
|
+
condition: {
|
|
6747
|
+
name: 'methodObtain',
|
|
6748
|
+
values: ['office'],
|
|
6749
|
+
},
|
|
6750
|
+
},
|
|
6751
|
+
{
|
|
6752
|
+
fieldType: 'common',
|
|
6753
|
+
name: 'bankEmployeeCode',
|
|
6754
|
+
condition: {
|
|
6755
|
+
name: 'methodObtain',
|
|
6756
|
+
values: ['office'],
|
|
6757
|
+
},
|
|
6728
6758
|
},
|
|
6729
6759
|
],
|
|
6730
6760
|
},
|
|
6731
|
-
{
|
|
6732
|
-
type: 'office',
|
|
6733
|
-
inputs: [{ fieldType: 'common', name: 'bankEmployeeCode' }],
|
|
6734
|
-
},
|
|
6735
6761
|
],
|
|
6736
6762
|
];
|
|
6737
6763
|
|
|
@@ -9441,7 +9467,7 @@
|
|
|
9441
9467
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
9442
9468
|
});
|
|
9443
9469
|
|
|
9444
|
-
const packageVersion = "0.14.
|
|
9470
|
+
const packageVersion = "0.14.655";
|
|
9445
9471
|
|
|
9446
9472
|
exports.Blocks = Blocks;
|
|
9447
9473
|
exports.ContentPage = ContentPage;
|