@redneckz/wildless-cms-uni-blocks 0.14.886 → 0.14.887
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/api/LeadServiceAPI.d.ts +2 -1
- package/bundle/bundle.umd.js +10 -3
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/api/LeadServiceAPI.d.ts +2 -1
- package/dist/api/LeadServiceAPI.js +7 -1
- package/dist/api/LeadServiceAPI.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +3 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/api/LeadServiceAPI.d.ts +2 -1
- package/lib/api/LeadServiceAPI.js +7 -1
- package/lib/api/LeadServiceAPI.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +3 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/bundle/api/LeadServiceAPI.d.ts +2 -1
- package/mobile/bundle/bundle.umd.js +10 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/api/LeadServiceAPI.d.ts +2 -1
- package/mobile/dist/api/LeadServiceAPI.js +7 -1
- package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +3 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/api/LeadServiceAPI.d.ts +2 -1
- package/mobile/lib/api/LeadServiceAPI.js +7 -1
- package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +3 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/src/api/LeadServiceAPI.ts +10 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +3 -1
- package/mobile/src/model/FormTypeFieldDef.ts +2 -1
- package/package.json +2 -2
- package/src/api/LeadServiceAPI.ts +10 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +30 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +23 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +23 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +3 -1
- package/src/icons/IconName.ts +4 -4
- package/src/model/FormTypeFieldDef.ts +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JSONRecord, type JSONScalar } from '@redneckz/json-op';
|
|
2
|
+
import { type Router } from '../external/useRouter';
|
|
2
3
|
export declare type LeadRequest = Record<string, JSONRecord | JSONScalar | null> & {
|
|
3
4
|
typeForm?: string;
|
|
4
5
|
addressBranch?: string;
|
|
@@ -12,5 +13,5 @@ export declare type LeadRequest = Record<string, JSONRecord | JSONScalar | null>
|
|
|
12
13
|
companyNameByInn?: string;
|
|
13
14
|
};
|
|
14
15
|
export declare function LeadServiceAPI(): {
|
|
15
|
-
send: (body: LeadRequest, isIndividualType?: boolean) => Promise<any>;
|
|
16
|
+
send: (body: LeadRequest, router: Router, isIndividualType?: boolean) => Promise<any>;
|
|
16
17
|
};
|
package/bundle/bundle.umd.js
CHANGED
|
@@ -1005,7 +1005,7 @@
|
|
|
1005
1005
|
const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
1006
1006
|
|
|
1007
1007
|
function LeadServiceAPI() {
|
|
1008
|
-
async function send(body, isIndividualType = false) {
|
|
1008
|
+
async function send(body, router, isIndividualType = false) {
|
|
1009
1009
|
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, inn, innDadata, fullRegion, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, serviceDirection, partnerSymbolCode, companyNameByInn, ...staticBody } = body;
|
|
1010
1010
|
const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
|
|
1011
1011
|
const url = `${API_BASE_URI$1}${isNaturalPerson ? '/lead' : '/sendcorporatelead'}`;
|
|
@@ -1024,6 +1024,7 @@
|
|
|
1024
1024
|
applicationDate,
|
|
1025
1025
|
...getSecondaryPhone(secondaryPhone),
|
|
1026
1026
|
}),
|
|
1027
|
+
...addPageSlug(typeForm, router),
|
|
1027
1028
|
...formatPFForm(typeForm, { innDadata, fullRegion, partnerSymbolCode, companyNameByInn }),
|
|
1028
1029
|
...staticBody,
|
|
1029
1030
|
};
|
|
@@ -1066,6 +1067,11 @@
|
|
|
1066
1067
|
fullname: data?.companyNameByInn,
|
|
1067
1068
|
}
|
|
1068
1069
|
: {};
|
|
1070
|
+
const addPageSlug = (typeForm, router) => typeForm === 'UNIVERSAL'
|
|
1071
|
+
? {
|
|
1072
|
+
typeForm: router?.pathname?.split('/')?.at(-1) || '/',
|
|
1073
|
+
}
|
|
1074
|
+
: {};
|
|
1069
1075
|
|
|
1070
1076
|
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1071
1077
|
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
@@ -2579,12 +2585,13 @@
|
|
|
2579
2585
|
const ApplicationForm = UniBlock(({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, ...rest }) => {
|
|
2580
2586
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
2581
2587
|
const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
|
|
2588
|
+
const router = useRouter();
|
|
2582
2589
|
const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
|
|
2583
2590
|
const responseTypeDialog = useDialog(ResponseTypeDialog);
|
|
2584
2591
|
const aspects = useAspects();
|
|
2585
2592
|
const handleSubmit = useCallback(async (formData, ev) => {
|
|
2586
2593
|
const formatData = getFormatData({ ...formData, ...additionalParams });
|
|
2587
|
-
const ok = Boolean(await API.send(formatData, endpoint === 'lead'));
|
|
2594
|
+
const ok = Boolean(await API.send(formatData, router, endpoint === 'lead'));
|
|
2588
2595
|
responseTypeDialog.open({ ok, typeForm });
|
|
2589
2596
|
if (ok) {
|
|
2590
2597
|
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
@@ -11530,7 +11537,7 @@
|
|
|
11530
11537
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11531
11538
|
});
|
|
11532
11539
|
|
|
11533
|
-
const packageVersion = "0.14.
|
|
11540
|
+
const packageVersion = "0.14.886";
|
|
11534
11541
|
|
|
11535
11542
|
exports.Blocks = Blocks;
|
|
11536
11543
|
exports.ContentPage = ContentPage;
|