@redneckz/wildless-cms-uni-blocks 0.14.965 → 0.14.967
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 +25 -20
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
- package/bundle/components/ApplicationForm/handlers.d.ts +2 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +2 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
- package/dist/components/ApplicationForm/handlers.d.ts +2 -1
- package/dist/components/ApplicationForm/handlers.js +20 -3
- package/dist/components/ApplicationForm/handlers.js.map +1 -1
- package/dist/retail/components/Fields/CreditCalcField.js +2 -15
- package/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +2 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
- package/lib/components/ApplicationForm/handlers.d.ts +2 -1
- package/lib/components/ApplicationForm/handlers.js +20 -3
- package/lib/components/ApplicationForm/handlers.js.map +1 -1
- package/lib/retail/components/Fields/CreditCalcField.js +2 -15
- package/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +25 -20
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
- package/mobile/bundle/components/ApplicationForm/handlers.d.ts +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
- package/mobile/dist/components/ApplicationForm/handlers.d.ts +2 -1
- package/mobile/dist/components/ApplicationForm/handlers.js +20 -3
- package/mobile/dist/components/ApplicationForm/handlers.js.map +1 -1
- package/mobile/dist/retail/components/Fields/CreditCalcField.js +2 -15
- package/mobile/dist/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
- package/mobile/lib/components/ApplicationForm/handlers.d.ts +2 -1
- package/mobile/lib/components/ApplicationForm/handlers.js +20 -3
- package/mobile/lib/components/ApplicationForm/handlers.js.map +1 -1
- package/mobile/lib/retail/components/Fields/CreditCalcField.js +2 -15
- package/mobile/lib/retail/components/Fields/CreditCalcField.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +3 -0
- package/mobile/src/components/ApplicationForm/handlers.ts +26 -3
- package/mobile/src/retail/components/Fields/CreditCalcField.tsx +3 -29
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +25 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
- package/src/components/ApplicationForm/ApplicationFormContent.ts +3 -0
- package/src/components/ApplicationForm/handlers.ts +26 -3
- package/src/retail/components/Fields/CreditCalcField.tsx +3 -29
package/bundle/bundle.umd.js
CHANGED
|
@@ -1906,11 +1906,28 @@
|
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
1908
|
};
|
|
1909
|
-
const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, }) => {
|
|
1910
|
-
const
|
|
1909
|
+
const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, withSnowplow, }) => {
|
|
1910
|
+
const response = await API$2.send(formatData, router, endpoint === 'lead');
|
|
1911
|
+
const ok = Boolean(response);
|
|
1911
1912
|
responseTypeDialog.open({ ok });
|
|
1912
1913
|
if (ok) {
|
|
1913
|
-
|
|
1914
|
+
const { requestId } = response;
|
|
1915
|
+
const { phone } = formatData;
|
|
1916
|
+
const utms = router.pathname.split('?')[1];
|
|
1917
|
+
const eventJSON = JSON.stringify({
|
|
1918
|
+
id: requestId,
|
|
1919
|
+
phone: String(phone),
|
|
1920
|
+
utm: utms,
|
|
1921
|
+
});
|
|
1922
|
+
const snowplowAspect = {
|
|
1923
|
+
aspectName: 'snowplowEvent',
|
|
1924
|
+
params: {
|
|
1925
|
+
eventAction: 'clickdepapl',
|
|
1926
|
+
eventJSON,
|
|
1927
|
+
},
|
|
1928
|
+
};
|
|
1929
|
+
const aspectsData = withSnowplow ? [...(data ?? []), snowplowAspect] : data;
|
|
1930
|
+
handleAspects({ aspectsAttributes: aspectsData, aspects, ev });
|
|
1914
1931
|
}
|
|
1915
1932
|
};
|
|
1916
1933
|
|
|
@@ -3043,7 +3060,7 @@
|
|
|
3043
3060
|
};
|
|
3044
3061
|
const ApplicationForm = UniBlock(
|
|
3045
3062
|
// eslint-disable-next-line max-lines-per-function
|
|
3046
|
-
({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, onSuccess, ...rest }) => {
|
|
3063
|
+
({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
|
|
3047
3064
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
3048
3065
|
const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
|
|
3049
3066
|
const router = useRouter();
|
|
@@ -3064,6 +3081,7 @@
|
|
|
3064
3081
|
verifyPhoneDialog,
|
|
3065
3082
|
onSuccess,
|
|
3066
3083
|
endpoint,
|
|
3084
|
+
withSnowplow,
|
|
3067
3085
|
});
|
|
3068
3086
|
}, [typeForm]);
|
|
3069
3087
|
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
@@ -5055,25 +5073,12 @@
|
|
|
5055
5073
|
|
|
5056
5074
|
const FIELD_NAME = 'calculator';
|
|
5057
5075
|
const CreditCalcField = JSX(({ field, params }) => {
|
|
5076
|
+
const defaultCalcSum = params?.calcData?.defaultParams?.sum ?? 0;
|
|
5058
5077
|
const handleChange = useCallback((_) => {
|
|
5059
5078
|
field(FIELD_NAME).onChange?.(_);
|
|
5060
5079
|
}, []);
|
|
5061
|
-
return (jsx(CalculatorCredit, { ...params?.calcData, padding: "p-0",
|
|
5080
|
+
return (jsx(CalculatorCredit, { ...params?.calcData, padding: "p-0", onChange: handleChange }, defaultCalcSum));
|
|
5062
5081
|
});
|
|
5063
|
-
const PARAMS_MAP = {
|
|
5064
|
-
moneyValue: 'sum',
|
|
5065
|
-
monthsValue: 'period',
|
|
5066
|
-
isInsurance: 'isEnableInsurance',
|
|
5067
|
-
isPensionClient: 'isEnablePensionClient',
|
|
5068
|
-
isStateEmployee: 'isEnableStateEmployee',
|
|
5069
|
-
isSalaryClient: 'isEnableSalaryClient',
|
|
5070
|
-
isAnnuity: 'isAnnuity',
|
|
5071
|
-
};
|
|
5072
|
-
const defaultValueAdapter = (value, isInverse = false) => {
|
|
5073
|
-
const keysMap = isInverse ? swap(PARAMS_MAP) : PARAMS_MAP;
|
|
5074
|
-
return Object.fromEntries(Object.entries(value ?? {}).map(([k, v]) => [keysMap[k], v]));
|
|
5075
|
-
};
|
|
5076
|
-
const swap = (_) => Object.fromEntries(Object.entries(_).map(([k, v]) => [v, k]));
|
|
5077
5082
|
|
|
5078
5083
|
const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
|
|
5079
5084
|
вкладчиком с долей участия более 20% уставного капитала руководителем,
|
|
@@ -13016,7 +13021,7 @@
|
|
|
13016
13021
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
13017
13022
|
});
|
|
13018
13023
|
|
|
13019
|
-
const packageVersion = "0.14.
|
|
13024
|
+
const packageVersion = "0.14.966";
|
|
13020
13025
|
|
|
13021
13026
|
exports.Blocks = Blocks;
|
|
13022
13027
|
exports.ContentPage = ContentPage;
|