@redneckz/wildless-cms-uni-blocks 0.14.876 → 0.14.877
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 +4 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +187 -91
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationForm.d.ts +2 -3
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/bundle/hooks/useInn.d.ts +7 -0
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/bundle/retail/components/Fields/SelectField.d.ts +1 -0
- package/bundle/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
- package/bundle/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
- package/bundle/ui-kit/FormField/validators.d.ts +8 -1
- package/bundle/ui-kit/Select/Option.d.ts +6 -0
- package/bundle/ui-kit/Select/Select.d.ts +2 -0
- package/bundle/ui-kit/Select/SelectPopup.d.ts +1 -0
- package/bundle/ui-kit/Select/useSelectPopup.d.ts +2 -1
- package/dist/api/LeadServiceAPI.d.ts +4 -0
- package/dist/api/LeadServiceAPI.js +13 -6
- package/dist/api/LeadServiceAPI.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.d.ts +2 -3
- package/dist/components/ApplicationForm/ApplicationForm.js +4 -3
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
- package/dist/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
- package/dist/hooks/useInn.d.ts +7 -0
- package/dist/hooks/useInn.js +11 -0
- package/dist/hooks/useInn.js.map +1 -0
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/retail/components/Fields/SelectField.d.ts +1 -0
- package/dist/retail/components/Fields/SelectField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js +17 -0
- package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
- package/{mobile/dist/ui-kit/FormField/Fields/RegionPremiumField.js → dist/ui-kit/FormField/Fields/FullRegionField.js} +5 -4
- package/dist/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/InnDadataField.js +29 -0
- package/dist/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
- package/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +19 -0
- package/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +12 -2
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +3 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
- package/dist/ui-kit/FormField/inputColumnStyle.js +1 -1
- package/dist/ui-kit/FormField/inputColumnStyle.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +8 -1
- package/dist/ui-kit/FormField/validators.js +5 -2
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/Select/Option.d.ts +6 -0
- package/dist/ui-kit/Select/Select.d.ts +2 -0
- package/dist/ui-kit/Select/Select.js +27 -5
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/ui-kit/Select/SelectPopup.d.ts +1 -0
- package/dist/ui-kit/Select/SelectPopup.js +4 -2
- package/dist/ui-kit/Select/SelectPopup.js.map +1 -1
- package/dist/ui-kit/Select/useSelectPopup.d.ts +2 -1
- package/dist/ui-kit/Select/useSelectPopup.js +3 -2
- package/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/lib/api/LeadServiceAPI.d.ts +4 -0
- package/lib/api/LeadServiceAPI.js +13 -6
- package/lib/api/LeadServiceAPI.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.d.ts +2 -3
- 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 +4 -3
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
- package/lib/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/hooks/useInn.d.ts +7 -0
- package/lib/hooks/useInn.js +8 -0
- package/lib/hooks/useInn.js.map +1 -0
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/retail/components/Fields/SelectField.d.ts +1 -0
- package/lib/retail/components/Fields/SelectField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js +15 -0
- package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
- package/lib/ui-kit/FormField/Fields/{RegionPremiumField.js → FullRegionField.js} +4 -3
- package/lib/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/InnDadataField.js +27 -0
- package/lib/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
- package/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +17 -0
- package/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +12 -2
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +4 -1
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
- package/lib/ui-kit/FormField/inputColumnStyle.js +1 -1
- package/lib/ui-kit/FormField/inputColumnStyle.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +8 -1
- package/lib/ui-kit/FormField/validators.js +3 -1
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/Select/Option.d.ts +6 -0
- package/lib/ui-kit/Select/Select.d.ts +2 -0
- package/lib/ui-kit/Select/Select.js +28 -6
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/ui-kit/Select/SelectPopup.d.ts +1 -0
- package/lib/ui-kit/Select/SelectPopup.js +4 -2
- package/lib/ui-kit/Select/SelectPopup.js.map +1 -1
- package/lib/ui-kit/Select/useSelectPopup.d.ts +2 -1
- package/lib/ui-kit/Select/useSelectPopup.js +3 -2
- package/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/mobile/bundle/api/LeadServiceAPI.d.ts +4 -0
- package/mobile/bundle/bundle.umd.js +187 -91
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationForm.d.ts +2 -3
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/mobile/bundle/hooks/useInn.d.ts +7 -0
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/bundle/retail/components/Fields/SelectField.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
- package/mobile/bundle/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +8 -1
- package/mobile/bundle/ui-kit/Select/Option.d.ts +6 -0
- package/mobile/bundle/ui-kit/Select/Select.d.ts +2 -0
- package/mobile/bundle/ui-kit/Select/SelectPopup.d.ts +1 -0
- package/mobile/bundle/ui-kit/Select/useSelectPopup.d.ts +2 -1
- package/mobile/dist/api/LeadServiceAPI.d.ts +4 -0
- package/mobile/dist/api/LeadServiceAPI.js +13 -6
- package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.d.ts +2 -3
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +4 -3
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
- package/mobile/dist/hooks/useInn.d.ts +7 -0
- package/mobile/dist/hooks/useInn.js +11 -0
- package/mobile/dist/hooks/useInn.js.map +1 -0
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/retail/components/Fields/SelectField.d.ts +1 -0
- package/mobile/dist/retail/components/Fields/SelectField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js +17 -0
- package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
- package/{dist/ui-kit/FormField/Fields/RegionPremiumField.js → mobile/dist/ui-kit/FormField/Fields/FullRegionField.js} +5 -4
- package/mobile/dist/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.js +29 -0
- package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
- package/mobile/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +19 -0
- package/mobile/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +12 -2
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +3 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/inputColumnStyle.js +1 -1
- package/mobile/dist/ui-kit/FormField/inputColumnStyle.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +8 -1
- package/mobile/dist/ui-kit/FormField/validators.js +5 -2
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/Select/Option.d.ts +6 -0
- package/mobile/dist/ui-kit/Select/Select.d.ts +2 -0
- package/mobile/dist/ui-kit/Select/Select.js +27 -5
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/ui-kit/Select/SelectPopup.d.ts +1 -0
- package/mobile/dist/ui-kit/Select/SelectPopup.js +4 -2
- package/mobile/dist/ui-kit/Select/SelectPopup.js.map +1 -1
- package/mobile/dist/ui-kit/Select/useSelectPopup.d.ts +2 -1
- package/mobile/dist/ui-kit/Select/useSelectPopup.js +3 -2
- package/mobile/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/mobile/lib/api/LeadServiceAPI.d.ts +4 -0
- package/mobile/lib/api/LeadServiceAPI.js +13 -6
- package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.d.ts +2 -3
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +4 -3
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
- package/mobile/lib/hooks/useInn.d.ts +7 -0
- package/mobile/lib/hooks/useInn.js +8 -0
- package/mobile/lib/hooks/useInn.js.map +1 -0
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/retail/components/Fields/SelectField.d.ts +1 -0
- package/mobile/lib/retail/components/Fields/SelectField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js +15 -0
- package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
- package/mobile/lib/ui-kit/FormField/Fields/{RegionPremiumField.js → FullRegionField.js} +4 -3
- package/mobile/lib/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.js +27 -0
- package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
- package/mobile/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +17 -0
- package/mobile/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +12 -2
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +4 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/inputColumnStyle.js +1 -1
- package/mobile/lib/ui-kit/FormField/inputColumnStyle.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +8 -1
- package/mobile/lib/ui-kit/FormField/validators.js +3 -1
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/Select/Option.d.ts +6 -0
- package/mobile/lib/ui-kit/Select/Select.d.ts +2 -0
- package/mobile/lib/ui-kit/Select/Select.js +28 -6
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/ui-kit/Select/SelectPopup.d.ts +1 -0
- package/mobile/lib/ui-kit/Select/SelectPopup.js +4 -2
- package/mobile/lib/ui-kit/Select/SelectPopup.js.map +1 -1
- package/mobile/lib/ui-kit/Select/useSelectPopup.d.ts +2 -1
- package/mobile/lib/ui-kit/Select/useSelectPopup.js +3 -2
- package/mobile/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
- package/mobile/src/api/LeadServiceAPI.ts +28 -3
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +84 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +29 -14
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +6 -4
- package/mobile/src/hooks/useInn.ts +16 -0
- package/mobile/src/model/FormTypeFieldDef.ts +2 -1
- package/mobile/src/retail/components/Fields/SelectField.tsx +1 -0
- package/mobile/src/ui-kit/FormField/Fields/CompanyNameByInnField.tsx +24 -0
- package/mobile/src/ui-kit/FormField/Fields/{RegionPremiumField.tsx → FullRegionField.tsx} +7 -2
- package/mobile/src/ui-kit/FormField/Fields/InnDadataField.tsx +47 -0
- package/mobile/src/ui-kit/FormField/Fields/PartnerSymbolCodeField.tsx +47 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +5 -1
- package/mobile/src/ui-kit/FormField/getField.tsx +15 -2
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +4 -0
- package/mobile/src/ui-kit/FormField/inputColumnStyle.tsx +1 -1
- package/mobile/src/ui-kit/FormField/validators.ts +13 -1
- package/mobile/src/ui-kit/Select/Option.ts +6 -0
- package/mobile/src/ui-kit/Select/Select.tsx +71 -17
- package/mobile/src/ui-kit/Select/SelectPopup.tsx +20 -2
- package/mobile/src/ui-kit/Select/useSelectPopup.tsx +4 -0
- package/package.json +2 -2
- package/src/api/LeadServiceAPI.ts +28 -3
- package/src/components/ApplicationForm/ApplicationForm.example.json +84 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +47 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +47 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +29 -14
- package/src/components/ApplicationForm/ApplicationFormContent.ts +6 -4
- package/src/hooks/useInn.ts +16 -0
- package/src/model/FormTypeFieldDef.ts +2 -1
- package/src/retail/components/Fields/SelectField.tsx +1 -0
- package/src/ui-kit/FormField/Fields/CompanyNameByInnField.tsx +24 -0
- package/src/ui-kit/FormField/Fields/{RegionPremiumField.tsx → FullRegionField.tsx} +7 -2
- package/src/ui-kit/FormField/Fields/InnDadataField.tsx +47 -0
- package/src/ui-kit/FormField/Fields/PartnerSymbolCodeField.tsx +47 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +5 -1
- package/src/ui-kit/FormField/getField.tsx +15 -2
- package/src/ui-kit/FormField/getObjectValidator.tsx +4 -0
- package/src/ui-kit/FormField/inputColumnStyle.tsx +1 -1
- package/src/ui-kit/FormField/validators.ts +13 -1
- package/src/ui-kit/Select/Option.ts +6 -0
- package/src/ui-kit/Select/Select.tsx +71 -17
- package/src/ui-kit/Select/SelectPopup.tsx +20 -2
- package/src/ui-kit/Select/useSelectPopup.tsx +4 -0
- package/bundle/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
- package/lib/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
- package/lib/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
- package/mobile/bundle/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
- package/mobile/lib/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
- package/mobile/lib/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
|
@@ -8,5 +8,6 @@ export interface SelectPopupProps extends ControlProps<Option> {
|
|
|
8
8
|
current: HTMLDivElement | null;
|
|
9
9
|
};
|
|
10
10
|
query?: string;
|
|
11
|
+
onChangeQuery?: (value: string) => void;
|
|
11
12
|
}
|
|
12
13
|
export declare const SelectPopup: import("@redneckz/uni-jsx").UNIComponent<SelectPopupProps, any, any>;
|
|
@@ -2,14 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { style } from '../../utils/style.js';
|
|
4
4
|
import { Icon } from '../Icon/Icon.js';
|
|
5
|
+
import { Text } from '../Text/Text.js';
|
|
5
6
|
import { filterOptions } from './filterOptions.js';
|
|
6
7
|
import { formatOption } from './formatOption.js';
|
|
7
|
-
export const SelectPopup = JSX(({ popupRef, options, value, query, onChange, iconVersion }) => options?.length ? (_jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", ref: popupRef, children: filterOptions(options, query).map((option) => (_jsxs("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", "aria-selected": option.key === value?.key, onClick: (e) => {
|
|
8
|
+
export const SelectPopup = JSX(({ popupRef, options, value, query, onChange, iconVersion, onChangeQuery }) => options?.length ? (_jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", ref: popupRef, children: filterOptions(options, query).map((option) => (_jsxs("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", "aria-selected": option.key === value?.key, onClick: (e) => {
|
|
8
9
|
e.stopPropagation();
|
|
9
10
|
if (onChange) {
|
|
11
|
+
onChangeQuery?.('');
|
|
10
12
|
onChange(option);
|
|
11
13
|
}
|
|
12
|
-
}, children: [_jsx("span", { className: "min-h-6", children: formatOption(option) }), _jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", iconVersion: iconVersion, className: style('absolute right-4 pt-3xs', {
|
|
14
|
+
}, children: [option?.innDaData ? (_jsxs("span", { children: [_jsx(Text, { size: "text-s", children: option?.innDaData?.companyName }), _jsxs("div", { className: "space-x-2", children: [_jsx(Text, { size: "text-s", font: "font-light", children: formatOption(option) }), _jsx(Text, { size: "text-s", font: "font-light", children: option?.innDaData?.companyAddress })] })] })) : (_jsx("span", { className: "min-h-6", children: formatOption(option) })), _jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", iconVersion: iconVersion, className: style('absolute right-4 pt-3xs', {
|
|
13
15
|
hidden: option.key !== value?.key,
|
|
14
16
|
}) })] }, option.key))) })) : null);
|
|
15
17
|
//# sourceMappingURL=SelectPopup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPopup.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/SelectPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectPopup.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/SelectPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAW9C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC5B,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,EAAE,CAC5E,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAChB,cACE,SAAS,EAAC,kFAAkF,EAC5F,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,QAAQ,YAEZ,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7C,eAEE,SAAS,EAAC,qEAAqE,EAC/E,IAAI,EAAC,UAAU,mBACA,MAAM,CAAC,GAAG,KAAK,KAAK,EAAE,GAAG,EACxC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,IAAI,QAAQ,EAAE;gBACZ,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;gBACpB,QAAQ,CAAC,MAAM,CAAC,CAAC;aAClB;QACH,CAAC,aAEA,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CACnB,2BACE,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,YAAE,MAAM,EAAE,SAAS,EAAE,WAAW,GAAQ,EAC3D,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,YAAY,YAClC,YAAY,CAAC,MAAM,CAAC,GAChB,EACP,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,YAAY,YAClC,MAAM,EAAE,SAAS,EAAE,cAAc,GAC7B,IACH,IACD,CACR,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,SAAS,YAAE,YAAY,CAAC,MAAM,CAAC,GAAQ,CACxD,EAED,KAAC,IAAI,IACH,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,KAAK,CAAC,yBAAyB,EAAE;oBAC1C,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK,EAAE,GAAG;iBAClC,CAAC,GACF,KApCG,MAAM,CAAC,GAAG,CAqCX,CACP,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,CACX,CAAC"}
|
|
@@ -2,8 +2,9 @@ import type { OnCloseProps } from '../../model/OnCloseProps';
|
|
|
2
2
|
import { type SelectPopupProps } from './SelectPopup';
|
|
3
3
|
interface SelectPopupOptions extends SelectPopupProps, OnCloseProps {
|
|
4
4
|
isOpen?: boolean;
|
|
5
|
+
onChangeQuery?: (value: string) => void;
|
|
5
6
|
}
|
|
6
|
-
export declare function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, }: SelectPopupOptions): {
|
|
7
|
+
export declare function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, onChangeQuery, }: SelectPopupOptions): {
|
|
7
8
|
current: HTMLDivElement | null;
|
|
8
9
|
};
|
|
9
10
|
export {};
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
|
|
4
4
|
import { usePopupManager } from '../PopupManager/usePopupManager.js';
|
|
5
5
|
import { SelectPopup } from './SelectPopup.js';
|
|
6
|
-
export function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, }) {
|
|
6
|
+
export function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, onChangeQuery, }) {
|
|
7
7
|
const popup = usePopupManager();
|
|
8
8
|
const close = useCallback(() => {
|
|
9
9
|
popup.close();
|
|
@@ -12,6 +12,7 @@ export function useSelectPopup({ isOpen, options, value, query, onChange, onClos
|
|
|
12
12
|
const handleChange = useCallback((option) => {
|
|
13
13
|
close();
|
|
14
14
|
onChange && onChange(option);
|
|
15
|
+
onChangeQuery && onChangeQuery('');
|
|
15
16
|
}, [close, onChange]);
|
|
16
17
|
const inputRef = useRef(null);
|
|
17
18
|
const popupRef = useOutsideClick(close);
|
|
@@ -22,7 +23,7 @@ export function useSelectPopup({ isOpen, options, value, query, onChange, onClos
|
|
|
22
23
|
const inputElement = inputRef.current;
|
|
23
24
|
const { top, left, width, height } = inputElement.getBoundingClientRect();
|
|
24
25
|
popup.open({
|
|
25
|
-
popup: (_jsx(SelectPopup, { popupRef: popupRef, options: options, value: value, query: query, onChange: handleChange, iconVersion: iconVersion })),
|
|
26
|
+
popup: (_jsx(SelectPopup, { popupRef: popupRef, options: options, value: value, query: query, onChange: handleChange, iconVersion: iconVersion, onChangeQuery: onChangeQuery })),
|
|
26
27
|
top: top + window.scrollY + height,
|
|
27
28
|
left,
|
|
28
29
|
width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectPopup.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/useSelectPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useSelectPopup.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/useSelectPopup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AAOnE,MAAM,UAAU,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,aAAa,GACM;IACnB,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO,IAAI,OAAO,EAAE,CAAC;IACvB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,MAAc,EAAE,EAAE;QACjB,KAAK,EAAE,CAAC;QACR,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC7B,aAAa,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC,EACD,CAAC,KAAK,EAAE,QAAQ,CAAC,CAClB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,eAAe,CAAiB,KAAK,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YAChC,OAAO;SACR;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC;QACtC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;QAE1E,KAAK,CAAC,IAAI,CAAC;YACT,KAAK,EAAE,CACL,KAAC,WAAW,IACV,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,GAC5B,CACH;YACD,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM;YAClC,IAAI;YACJ,KAAK;SACN,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAElD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -5,7 +5,11 @@ export declare type LeadRequest = Record<string, JSONRecord | JSONScalar | null>
|
|
|
5
5
|
phone?: string;
|
|
6
6
|
email?: string;
|
|
7
7
|
inn?: string;
|
|
8
|
+
innDadata?: string;
|
|
9
|
+
fullRegion?: string;
|
|
8
10
|
secondaryPhoneNumber?: string;
|
|
11
|
+
partnerSymbolCode?: string;
|
|
12
|
+
companyNameByInn?: string;
|
|
9
13
|
};
|
|
10
14
|
export declare function LeadServiceAPI(): {
|
|
11
15
|
send: (body: LeadRequest, isIndividualType?: boolean) => Promise<any>;
|
|
@@ -1014,7 +1014,7 @@
|
|
|
1014
1014
|
|
|
1015
1015
|
function LeadServiceAPI() {
|
|
1016
1016
|
async function send(body, isIndividualType = false) {
|
|
1017
|
-
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, inn, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, serviceDirection, ...staticBody } = body;
|
|
1017
|
+
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, inn, innDadata, fullRegion, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, serviceDirection, partnerSymbolCode, companyNameByInn, ...staticBody } = body;
|
|
1018
1018
|
const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
|
|
1019
1019
|
const url = `${API_BASE_URI$1}${isNaturalPerson ? '/lead' : '/sendcorporatelead'}`;
|
|
1020
1020
|
const submitBody = {
|
|
@@ -1032,6 +1032,7 @@
|
|
|
1032
1032
|
applicationDate,
|
|
1033
1033
|
...getSecondaryPhone(secondaryPhone),
|
|
1034
1034
|
}),
|
|
1035
|
+
...formatPFForm(typeForm, { innDadata, fullRegion, partnerSymbolCode, companyNameByInn }),
|
|
1035
1036
|
...staticBody,
|
|
1036
1037
|
};
|
|
1037
1038
|
try {
|
|
@@ -1062,11 +1063,17 @@
|
|
|
1062
1063
|
const getEmail = (email, isNaturalPerson = true) => ({
|
|
1063
1064
|
[isNaturalPerson ? 'email' : 'mail']: email,
|
|
1064
1065
|
});
|
|
1065
|
-
const getSecondaryPhone = (secondaryPhone = '') =>
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1066
|
+
const getSecondaryPhone = (secondaryPhone = '') => !secondaryPhone || secondaryPhone === '+7 ('
|
|
1067
|
+
? {}
|
|
1068
|
+
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
1069
|
+
const formatPFForm = (typeForm, data) => typeForm === 'PF'
|
|
1070
|
+
? {
|
|
1071
|
+
inn: data?.innDadata,
|
|
1072
|
+
region: data?.fullRegion,
|
|
1073
|
+
partnerComments: data?.partnerSymbolCode,
|
|
1074
|
+
fullname: data?.companyNameByInn,
|
|
1075
|
+
}
|
|
1076
|
+
: {};
|
|
1070
1077
|
|
|
1071
1078
|
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1072
1079
|
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
@@ -1257,6 +1264,22 @@
|
|
|
1257
1264
|
|
|
1258
1265
|
const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
|
|
1259
1266
|
|
|
1267
|
+
const debounce = (fn, delay = 600) => {
|
|
1268
|
+
let timerId;
|
|
1269
|
+
const debouncedCallback = (...args) => {
|
|
1270
|
+
debouncedCallback.dispose();
|
|
1271
|
+
timerId = setTimeout(() => {
|
|
1272
|
+
fn(...args);
|
|
1273
|
+
}, delay);
|
|
1274
|
+
};
|
|
1275
|
+
debouncedCallback.dispose = () => {
|
|
1276
|
+
if (timerId) {
|
|
1277
|
+
clearTimeout(timerId);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
return debouncedCallback;
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1260
1283
|
const inputValidStyle = 'border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded';
|
|
1261
1284
|
|
|
1262
1285
|
const getValidStyle = (valid) => (valid ? inputValidStyle : 'border-error');
|
|
@@ -1317,16 +1340,17 @@
|
|
|
1317
1340
|
return options.filter((_) => _.text?.toLocaleLowerCase().includes(query?.trim().toLocaleLowerCase()));
|
|
1318
1341
|
};
|
|
1319
1342
|
|
|
1320
|
-
const SelectPopup = JSX(({ popupRef, options, value, query, onChange, iconVersion }) => options?.length ? (jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", ref: popupRef, children: filterOptions(options, query).map((option) => (jsxs("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", "aria-selected": option.key === value?.key, onClick: (e) => {
|
|
1343
|
+
const SelectPopup = JSX(({ popupRef, options, value, query, onChange, iconVersion, onChangeQuery }) => options?.length ? (jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", ref: popupRef, children: filterOptions(options, query).map((option) => (jsxs("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", "aria-selected": option.key === value?.key, onClick: (e) => {
|
|
1321
1344
|
e.stopPropagation();
|
|
1322
1345
|
if (onChange) {
|
|
1346
|
+
onChangeQuery?.('');
|
|
1323
1347
|
onChange(option);
|
|
1324
1348
|
}
|
|
1325
|
-
}, children: [jsx("span", { className: "min-h-6", children: formatOption(option) }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", iconVersion: iconVersion, className: style('absolute right-4 pt-3xs', {
|
|
1349
|
+
}, children: [option?.innDaData ? (jsxs("span", { children: [jsx(Text, { size: "text-s", children: option?.innDaData?.companyName }), jsxs("div", { className: "space-x-2", children: [jsx(Text, { size: "text-s", font: "font-light", children: formatOption(option) }), jsx(Text, { size: "text-s", font: "font-light", children: option?.innDaData?.companyAddress })] })] })) : (jsx("span", { className: "min-h-6", children: formatOption(option) })), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", iconVersion: iconVersion, className: style('absolute right-4 pt-3xs', {
|
|
1326
1350
|
hidden: option.key !== value?.key,
|
|
1327
1351
|
}) })] }, option.key))) })) : null);
|
|
1328
1352
|
|
|
1329
|
-
function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, }) {
|
|
1353
|
+
function useSelectPopup({ isOpen, options, value, query, onChange, onClose, iconVersion, onChangeQuery, }) {
|
|
1330
1354
|
const popup = usePopupManager();
|
|
1331
1355
|
const close = useCallback(() => {
|
|
1332
1356
|
popup.close();
|
|
@@ -1335,6 +1359,7 @@
|
|
|
1335
1359
|
const handleChange = useCallback((option) => {
|
|
1336
1360
|
close();
|
|
1337
1361
|
onChange && onChange(option);
|
|
1362
|
+
onChangeQuery && onChangeQuery('');
|
|
1338
1363
|
}, [close, onChange]);
|
|
1339
1364
|
const inputRef = useRef(null);
|
|
1340
1365
|
const popupRef = useOutsideClick(close);
|
|
@@ -1345,7 +1370,7 @@
|
|
|
1345
1370
|
const inputElement = inputRef.current;
|
|
1346
1371
|
const { top, left, width, height } = inputElement.getBoundingClientRect();
|
|
1347
1372
|
popup.open({
|
|
1348
|
-
popup: (jsx(SelectPopup, { popupRef: popupRef, options: options, value: value, query: query, onChange: handleChange, iconVersion: iconVersion })),
|
|
1373
|
+
popup: (jsx(SelectPopup, { popupRef: popupRef, options: options, value: value, query: query, onChange: handleChange, iconVersion: iconVersion, onChangeQuery: onChangeQuery })),
|
|
1349
1374
|
top: top + window.scrollY + height,
|
|
1350
1375
|
left,
|
|
1351
1376
|
width,
|
|
@@ -1354,19 +1379,26 @@
|
|
|
1354
1379
|
return inputRef;
|
|
1355
1380
|
}
|
|
1356
1381
|
|
|
1357
|
-
const Select = JSX(({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, disabled = false, iconVersion = 'black', onChange, }) => {
|
|
1382
|
+
const Select = JSX(({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, isManualInput = false, disabled = false, iconVersion = 'black', onChange, onSearchQuery, }) => {
|
|
1358
1383
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1359
1384
|
const [query, setQuery] = useState('');
|
|
1360
|
-
const isDisabled = getDisabled(disabled, options.length);
|
|
1385
|
+
const isDisabled = getDisabled(disabled, options.length, isManualInput);
|
|
1386
|
+
const isIconHidden = getIconHidden(isManualInput, options);
|
|
1361
1387
|
const hasOpen = isOpen && !isDisabled;
|
|
1388
|
+
const debouncedOnSearchQuery = useMemo(() => onSearchQuery && getDebouncedSearchQuery(onSearchQuery), [onSearchQuery]);
|
|
1362
1389
|
const handleOpen = useCallback(() => {
|
|
1363
1390
|
if (isDisabled) {
|
|
1364
1391
|
return;
|
|
1365
1392
|
}
|
|
1366
1393
|
open();
|
|
1367
1394
|
}, [isDisabled]);
|
|
1395
|
+
const handleChangeQuery = (newQuery) => {
|
|
1396
|
+
setQuery(newQuery);
|
|
1397
|
+
setOption(newQuery, onChange);
|
|
1398
|
+
debouncedOnSearchQuery && debouncedOnSearchQuery(newQuery);
|
|
1399
|
+
};
|
|
1368
1400
|
const handleClose = useCallback(() => {
|
|
1369
|
-
setQuery('');
|
|
1401
|
+
!isManualInput && setQuery('');
|
|
1370
1402
|
close();
|
|
1371
1403
|
}, []);
|
|
1372
1404
|
const inputRef = useSelectPopup({
|
|
@@ -1377,12 +1409,26 @@
|
|
|
1377
1409
|
onChange,
|
|
1378
1410
|
onClose: handleClose,
|
|
1379
1411
|
iconVersion,
|
|
1412
|
+
onChangeQuery: setQuery,
|
|
1380
1413
|
});
|
|
1381
|
-
return (jsxs("div", { className: style('space-y-xs', className), children: [renderLabel$1(label), jsxs("div", { className: style('relative', hasOpen ? 'z-20' : 'z-10'), ref: inputRef, children: [jsxs("div", { className: style('h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden', getStyle(isBorder, valid, isDisabled)), onClick: hasOpen ? handleClose : handleOpen, children: [jsx("p", { className: "line-clamp-2 text-ellipsis", children:
|
|
1414
|
+
return (jsxs("div", { className: style('space-y-xs', className), children: [renderLabel$1(label), jsxs("div", { className: style('relative', hasOpen ? 'z-20' : 'z-10'), ref: inputRef, children: [jsxs("div", { className: style('h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden', getStyle(isBorder, valid, isDisabled)), onClick: hasOpen ? handleClose : handleOpen, children: [jsx("p", { className: "line-clamp-2 text-ellipsis", children: useRenderOptionText({ isManualInput, query, value, placeholder }) }), isIconHidden ? '' : renderIcon$2(hasOpen, iconVersion)] }), isSearch && hasOpen ? renderSearchInput(query, isDisabled, handleChangeQuery) : null] })] }));
|
|
1382
1415
|
});
|
|
1416
|
+
const useRenderOptionText = (data) => useMemo(() => {
|
|
1417
|
+
if (data.isManualInput && data.query) {
|
|
1418
|
+
return data.query;
|
|
1419
|
+
}
|
|
1420
|
+
return formatOption(data.value) || data.placeholder;
|
|
1421
|
+
}, [data.isManualInput, data.query, data.value, data.placeholder]);
|
|
1422
|
+
const renderSearchInput = (query, isDisabled, onChangeQuery) => (jsx("div", { className: style('absolute top-0 w-full z-20'), children: jsx(Input, { type: "text", value: query, autoFocus: true, disabled: isDisabled, onChange: (value) => onChangeQuery(value) }) }));
|
|
1383
1423
|
const renderIcon$2 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-0 flex self-center', { 'rotate-180': !isOpen }), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
|
|
1384
1424
|
const getStyle = (isBorder, valid, disabled) => style(isBorder ? 'border rounded-md ' : '', isBorder && !disabled ? 'hover:border-primary-hover' : '', disabled ? 'bg-main-divider' : 'cursor-pointer ', valid ? 'border-gray' : 'border-error');
|
|
1385
|
-
|
|
1425
|
+
// TODO Нужен рефактор и декомпозиция компонента getDisabled, setOption, getIconHidden
|
|
1426
|
+
const getDisabled = (disabled, length, isManualInput) => disabled || (!isManualInput && length === 0);
|
|
1427
|
+
const setOption = (query, onChange) => {
|
|
1428
|
+
onChange && query.trim() !== '' && onChange({ key: query, text: query, innDaData: {} });
|
|
1429
|
+
};
|
|
1430
|
+
const getIconHidden = (isManualInput, options) => isManualInput && !options.length;
|
|
1431
|
+
const getDebouncedSearchQuery = (onSearchQuery) => debounce((searchValue) => onSearchQuery(searchValue), 300);
|
|
1386
1432
|
|
|
1387
1433
|
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1388
1434
|
|
|
@@ -1919,6 +1965,17 @@
|
|
|
1919
1965
|
|
|
1920
1966
|
const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...field(input?.name ?? ''), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true })));
|
|
1921
1967
|
|
|
1968
|
+
const CompanyNameByInnField = JSX(({ field, input }) => {
|
|
1969
|
+
const fieldInn = field('innDadata');
|
|
1970
|
+
useEffect(() => {
|
|
1971
|
+
if (fieldInn?.value?.key !== '') {
|
|
1972
|
+
const companyName = fieldInn?.value?.innDaData?.companyName;
|
|
1973
|
+
companyName && field?.('companyNameByInn')?.onChange?.(companyName);
|
|
1974
|
+
}
|
|
1975
|
+
}, [fieldInn?.value]);
|
|
1976
|
+
return (jsx(InputControl, { maxLength: 60, label: "\u041F\u043E\u043B\u043D\u043E\u0435 \u043D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435", ...field(input?.name ?? ''), ...input }));
|
|
1977
|
+
});
|
|
1978
|
+
|
|
1922
1979
|
const DesiredMeetingDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0438", ...field(input?.name ?? '') })));
|
|
1923
1980
|
|
|
1924
1981
|
const EmailField$1 = JSX(({ field, input }) => {
|
|
@@ -1939,6 +1996,89 @@
|
|
|
1939
1996
|
|
|
1940
1997
|
const FullNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E", ...field(input?.name ?? ''), ...input })));
|
|
1941
1998
|
|
|
1999
|
+
const FullRegionField = JSX(({ field, input, params }) => {
|
|
2000
|
+
const isPremium = params?.isPremium;
|
|
2001
|
+
const branchByRegions = useBranchesByRegions(isPremium);
|
|
2002
|
+
const regions = useMemo(() => branchByRegions?.map(({ region }) => ({
|
|
2003
|
+
key: region,
|
|
2004
|
+
text: region,
|
|
2005
|
+
})), [branchByRegions]);
|
|
2006
|
+
return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions, ...field(input?.name ?? '') }));
|
|
2007
|
+
});
|
|
2008
|
+
|
|
2009
|
+
function useAsyncEffect(effect, deps) {
|
|
2010
|
+
useEffect(() => {
|
|
2011
|
+
const free = effect();
|
|
2012
|
+
return () => {
|
|
2013
|
+
free.then((_) => {
|
|
2014
|
+
_ instanceof Function && _();
|
|
2015
|
+
});
|
|
2016
|
+
};
|
|
2017
|
+
}, deps);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
const DEFAULT_HINTS_COUNT = 10;
|
|
2021
|
+
const defaultResponseItemHandler = (item) => item?.value || '';
|
|
2022
|
+
const getResponseHandler = (itemHandler) => (response) => {
|
|
2023
|
+
const responseData = response?.suggestions || [];
|
|
2024
|
+
return responseData.map((item) => {
|
|
2025
|
+
const value = itemHandler(item);
|
|
2026
|
+
return {
|
|
2027
|
+
...item,
|
|
2028
|
+
processedValue: value,
|
|
2029
|
+
};
|
|
2030
|
+
});
|
|
2031
|
+
};
|
|
2032
|
+
const getDaDataHints = (options) => {
|
|
2033
|
+
const { url, query, queryPrefix, requestData = {}, responseItemHandler = defaultResponseItemHandler, } = options;
|
|
2034
|
+
const responseHandler = getResponseHandler(responseItemHandler);
|
|
2035
|
+
const queryPrefixValue = queryPrefix ? `${queryPrefix}, ` : '';
|
|
2036
|
+
const combinedQuery = `${queryPrefixValue}${query}`;
|
|
2037
|
+
return globalThis
|
|
2038
|
+
?.fetch?.(`/api/v1/suggestions/${url}`, {
|
|
2039
|
+
method: 'POST',
|
|
2040
|
+
mode: 'cors',
|
|
2041
|
+
headers: {
|
|
2042
|
+
'Content-Type': 'application/json',
|
|
2043
|
+
},
|
|
2044
|
+
body: JSON.stringify({
|
|
2045
|
+
count: DEFAULT_HINTS_COUNT,
|
|
2046
|
+
...requestData,
|
|
2047
|
+
query: combinedQuery,
|
|
2048
|
+
}),
|
|
2049
|
+
})
|
|
2050
|
+
.then((response) => response.json())
|
|
2051
|
+
.then(responseHandler);
|
|
2052
|
+
};
|
|
2053
|
+
|
|
2054
|
+
const INN_DADATA_URL = 'suggest/party';
|
|
2055
|
+
const useInn = async (searchQuery) => (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery })).map((_) => ({
|
|
2056
|
+
fullName: _?.value,
|
|
2057
|
+
address: _?.data?.address?.value,
|
|
2058
|
+
inn: _?.data?.inn,
|
|
2059
|
+
}));
|
|
2060
|
+
|
|
2061
|
+
const InnDadataField = JSX(({ field, input }) => {
|
|
2062
|
+
const [options, setOptions] = useState([]);
|
|
2063
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
2064
|
+
useAsyncEffect(async () => {
|
|
2065
|
+
const fieldInns = useInn(searchQuery);
|
|
2066
|
+
setOptions(await fieldInns);
|
|
2067
|
+
return options;
|
|
2068
|
+
}, [searchQuery]);
|
|
2069
|
+
const getOptions = useMemo(() => {
|
|
2070
|
+
return (options || []).map((item) => ({
|
|
2071
|
+
key: item?.inn ?? '',
|
|
2072
|
+
text: item?.inn,
|
|
2073
|
+
innDaData: {
|
|
2074
|
+
companyName: item?.fullName,
|
|
2075
|
+
companyAddress: item?.address,
|
|
2076
|
+
},
|
|
2077
|
+
}));
|
|
2078
|
+
}, [options]);
|
|
2079
|
+
return (jsx(SelectControl, { label: "\u0418\u041D\u041D", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0418\u041D\u041D", options: getOptions, ...field(input?.name ?? ''), isSearch: true, isManualInput: true, onSearchQuery: setSearchQuery }));
|
|
2080
|
+
});
|
|
2081
|
+
|
|
1942
2082
|
const InnField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? '') })));
|
|
1943
2083
|
|
|
1944
2084
|
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
@@ -2013,6 +2153,19 @@
|
|
|
2013
2153
|
|
|
2014
2154
|
const PartnerCommentsField = JSX(({ field, input }) => (jsx(InputControl, { ...field(input?.name ?? ''), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...input })));
|
|
2015
2155
|
|
|
2156
|
+
const PartnerSymbolCodeField = UniBlock(({ field, input, source }) => {
|
|
2157
|
+
const agentsList = source?.agentsList;
|
|
2158
|
+
const { value: partnerCode } = field('partnerSymbolCode');
|
|
2159
|
+
const [symbolCodeError, setSymbolCodeError] = useState('');
|
|
2160
|
+
const isPartnerCodeExist = agentsList?.some((item) => item?.symbolCode === partnerCode);
|
|
2161
|
+
useEffect(() => {
|
|
2162
|
+
setSymbolCodeError(partnerCode && !isPartnerCodeExist
|
|
2163
|
+
? 'ID партнера не найден. Обратитесь к своему менеджеру'
|
|
2164
|
+
: '');
|
|
2165
|
+
}, [partnerCode]);
|
|
2166
|
+
return (jsx(InputControl, { label: "\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u043F\u0430\u0440\u0442\u043D\u0435\u0440\u0430", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), error: symbolCodeError || field('partnerSymbolCode')?.error }));
|
|
2167
|
+
});
|
|
2168
|
+
|
|
2016
2169
|
const isPlaceholder = (_) => _ === '_';
|
|
2017
2170
|
const isDigit = (_) => /\d/.test(_);
|
|
2018
2171
|
const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
|
|
@@ -2066,15 +2219,6 @@
|
|
|
2066
2219
|
return (jsx(SelectControl, { label: input?.label || 'Филиал', placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...field(input?.name ?? '') }));
|
|
2067
2220
|
});
|
|
2068
2221
|
|
|
2069
|
-
const RegionPremiumField = JSX(({ field, input }) => {
|
|
2070
|
-
const branchByRegions = useBranchesByRegions(true);
|
|
2071
|
-
const regions = useMemo(() => branchByRegions?.map(({ region }) => ({
|
|
2072
|
-
key: region,
|
|
2073
|
-
text: region,
|
|
2074
|
-
})), [branchByRegions]);
|
|
2075
|
-
return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions, ...field(input?.name ?? '') }));
|
|
2076
|
-
});
|
|
2077
|
-
|
|
2078
2222
|
const RepresentativeNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044F", ...input, ...field('representativeName') })));
|
|
2079
2223
|
|
|
2080
2224
|
const withValidator = (props, validator) => {
|
|
@@ -2096,12 +2240,14 @@
|
|
|
2096
2240
|
const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE$1);
|
|
2097
2241
|
const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE$1);
|
|
2098
2242
|
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE$1);
|
|
2099
|
-
const innValidator = (errorMsg) => validator((_) =>
|
|
2243
|
+
const innValidator = (errorMsg) => validator((_) => isValidInnLength(_))(errorMsg);
|
|
2244
|
+
const innDadataValidator = (errorMsg) => validator((_) => Boolean(_?.text) && isValidInnLength(_.text))(errorMsg);
|
|
2100
2245
|
const phoneValidate = (email) => /^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
2101
2246
|
const phoneValidator = (errorMsg) => validator(phoneValidate)(errorMsg);
|
|
2102
2247
|
const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
|
|
2103
2248
|
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(email);
|
|
2104
2249
|
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
2250
|
+
const isValidInnLength = (value) => typeof value === 'string' && (value.length === 10 || value.length === 12);
|
|
2105
2251
|
|
|
2106
2252
|
const validatorObj$1 = {
|
|
2107
2253
|
fullName: defaultValidator(),
|
|
@@ -2132,6 +2278,9 @@
|
|
|
2132
2278
|
typeForm: defaultValidator(),
|
|
2133
2279
|
consentToReceiveMaterials: agreementValidator,
|
|
2134
2280
|
consentDataProcessing: agreementValidator,
|
|
2281
|
+
partnerSymbolCode: defaultValidator(),
|
|
2282
|
+
innDadata: innDadataValidator('Укажите ИНН'),
|
|
2283
|
+
companyNameByInn: defaultValidator(),
|
|
2135
2284
|
};
|
|
2136
2285
|
const getFormValidator = (fieldDefs, externalValidatorObj = {}) => {
|
|
2137
2286
|
const requiredFields = fieldDefs.filter((_) => Boolean(_?.required && _?.name));
|
|
@@ -2227,6 +2376,9 @@
|
|
|
2227
2376
|
const PRODUCT_REF = {
|
|
2228
2377
|
$ref: '/wcms-resources/outservice-productlist.json',
|
|
2229
2378
|
};
|
|
2379
|
+
const AGENTS_REF = {
|
|
2380
|
+
$ref: '/wcms-resources/agenty-dlya-rko.json',
|
|
2381
|
+
};
|
|
2230
2382
|
const InputsMap$1 = {
|
|
2231
2383
|
fullName: FullNameField,
|
|
2232
2384
|
addressBranch: AddressBranchField,
|
|
@@ -2249,7 +2401,7 @@
|
|
|
2249
2401
|
bankEmpolee: BankEmpoleeField,
|
|
2250
2402
|
secondaryPhone: SecondaryPhoneField,
|
|
2251
2403
|
applicationDate: ApplicationDateField,
|
|
2252
|
-
region: (props) => getPremium(props?.params?.typeForm) ? (jsx(
|
|
2404
|
+
region: (props) => getPremium(props?.params?.typeForm) ? (jsx(FullRegionField, { ...props })) : (jsx(RegionField, { ...props })),
|
|
2253
2405
|
consentToReceiveMaterials: ConsentToReceiveMaterialsField,
|
|
2254
2406
|
sufferedFrom: SufferedFromField,
|
|
2255
2407
|
situationDescription: SituationDescriptionField,
|
|
@@ -2263,6 +2415,10 @@
|
|
|
2263
2415
|
email: EmailField$1,
|
|
2264
2416
|
inn: InnField,
|
|
2265
2417
|
comment: CommentField,
|
|
2418
|
+
fullRegion: FullRegionField,
|
|
2419
|
+
partnerSymbolCode: (props) => (jsx(PartnerSymbolCodeField, { ...props, source: AGENTS_REF })),
|
|
2420
|
+
innDadata: InnDadataField,
|
|
2421
|
+
companyNameByInn: CompanyNameByInnField,
|
|
2266
2422
|
};
|
|
2267
2423
|
const getField = (field, params, externalInputs = {}) => (input, i) => {
|
|
2268
2424
|
const fieldsRegister = {
|
|
@@ -2273,7 +2429,7 @@
|
|
|
2273
2429
|
return shouldRenderField({ input, field }) && Component ? (jsx("div", { children: jsx(Component, { field: field, input: input, params: params }) }, i)) : null;
|
|
2274
2430
|
};
|
|
2275
2431
|
|
|
2276
|
-
const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
|
|
2432
|
+
const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '@xl:grid-cols-1 gap-x-0';
|
|
2277
2433
|
|
|
2278
2434
|
const renderTitle = (title) => title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: title }) })) : null;
|
|
2279
2435
|
|
|
@@ -2423,7 +2579,7 @@
|
|
|
2423
2579
|
const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), jsxs("div", { className: "flex sm:justify-center gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "\u0442\u0435\u043B\u0435\u0444\u043E\u043D 8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "\u043F\u043E\u0447\u0442\u0430 ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
|
|
2424
2580
|
|
|
2425
2581
|
const API = LeadServiceAPI();
|
|
2426
|
-
const ApplicationForm =
|
|
2582
|
+
const ApplicationForm = UniBlock(({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, ...rest }) => {
|
|
2427
2583
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
2428
2584
|
const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
|
|
2429
2585
|
const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
|
|
@@ -2443,8 +2599,9 @@
|
|
|
2443
2599
|
onSubmit: handleSubmit,
|
|
2444
2600
|
});
|
|
2445
2601
|
const fieldName = getConsentDataProcessing(inputs)?.name;
|
|
2446
|
-
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections
|
|
2602
|
+
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [renderSections(sections, field, { typeForm, additionalParams }), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
|
|
2447
2603
|
});
|
|
2604
|
+
const renderSections = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
|
|
2448
2605
|
|
|
2449
2606
|
const NoConsentDialog = JSX(({ attempts, onClose = noop }) => {
|
|
2450
2607
|
const navigator = locationNavigator();
|
|
@@ -2776,56 +2933,6 @@
|
|
|
2776
2933
|
return (jsxs("div", { className: "flex gap-lg items-center rounded-md bg-main-gray p-4xl", children: [jsxs("div", { className: "flex flex-col justify-around w-full", children: [jsx("p", { className: "mb-m text-xl", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsxs("ul", { className: "list-disc list-inside mb-4xl", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { className: "block mb-xl self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), jsx(Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), jsx(Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
|
|
2777
2934
|
});
|
|
2778
2935
|
|
|
2779
|
-
const debounce = (fn, delay = 600) => {
|
|
2780
|
-
let timerId;
|
|
2781
|
-
const debouncedCallback = (...args) => {
|
|
2782
|
-
debouncedCallback.dispose();
|
|
2783
|
-
timerId = setTimeout(() => {
|
|
2784
|
-
fn(...args);
|
|
2785
|
-
}, delay);
|
|
2786
|
-
};
|
|
2787
|
-
debouncedCallback.dispose = () => {
|
|
2788
|
-
if (timerId) {
|
|
2789
|
-
clearTimeout(timerId);
|
|
2790
|
-
}
|
|
2791
|
-
};
|
|
2792
|
-
return debouncedCallback;
|
|
2793
|
-
};
|
|
2794
|
-
|
|
2795
|
-
const DEFAULT_HINTS_COUNT = 10;
|
|
2796
|
-
const defaultResponseItemHandler = (item) => item?.value || '';
|
|
2797
|
-
const getResponseHandler = (itemHandler) => (response) => {
|
|
2798
|
-
const responseData = response?.suggestions || [];
|
|
2799
|
-
return responseData.map((item) => {
|
|
2800
|
-
const value = itemHandler(item);
|
|
2801
|
-
return {
|
|
2802
|
-
...item,
|
|
2803
|
-
processedValue: value,
|
|
2804
|
-
};
|
|
2805
|
-
});
|
|
2806
|
-
};
|
|
2807
|
-
const getDaDataHints = (options) => {
|
|
2808
|
-
const { url, query, queryPrefix, requestData = {}, responseItemHandler = defaultResponseItemHandler, } = options;
|
|
2809
|
-
const responseHandler = getResponseHandler(responseItemHandler);
|
|
2810
|
-
const queryPrefixValue = queryPrefix ? `${queryPrefix}, ` : '';
|
|
2811
|
-
const combinedQuery = `${queryPrefixValue}${query}`;
|
|
2812
|
-
return globalThis
|
|
2813
|
-
?.fetch?.(`/api/v1/suggestions/${url}`, {
|
|
2814
|
-
method: 'POST',
|
|
2815
|
-
mode: 'cors',
|
|
2816
|
-
headers: {
|
|
2817
|
-
'Content-Type': 'application/json',
|
|
2818
|
-
},
|
|
2819
|
-
body: JSON.stringify({
|
|
2820
|
-
count: DEFAULT_HINTS_COUNT,
|
|
2821
|
-
...requestData,
|
|
2822
|
-
query: combinedQuery,
|
|
2823
|
-
}),
|
|
2824
|
-
})
|
|
2825
|
-
.then((response) => response.json())
|
|
2826
|
-
.then(responseHandler);
|
|
2827
|
-
};
|
|
2828
|
-
|
|
2829
2936
|
const NAME_HINTS_LIST_OPTIONS = {
|
|
2830
2937
|
url: 'suggest/fio',
|
|
2831
2938
|
requestData: {
|
|
@@ -4797,17 +4904,6 @@
|
|
|
4797
4904
|
return (jsx(DaDataInputControl, { label: "\u0414\u043E\u043B\u044F \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0432 \u0431\u0438\u0437\u043D\u0435\u0441\u0435", placeholder: "\u0432 %", isInteger: true, maxLength: 3, ...field(input?.name ?? ''), ...input, onChange: onChange }));
|
|
4798
4905
|
});
|
|
4799
4906
|
|
|
4800
|
-
function useAsyncEffect(effect, deps) {
|
|
4801
|
-
useEffect(() => {
|
|
4802
|
-
const free = effect();
|
|
4803
|
-
return () => {
|
|
4804
|
-
free.then((_) => {
|
|
4805
|
-
_ instanceof Function && _();
|
|
4806
|
-
});
|
|
4807
|
-
};
|
|
4808
|
-
}, deps);
|
|
4809
|
-
}
|
|
4810
|
-
|
|
4811
4907
|
const getPaymentSystems = async (creditProgramId) => {
|
|
4812
4908
|
const data = await fetchRetailJSON('/public-data/creditProgramConditions', 'POST', {
|
|
4813
4909
|
creditProgramId,
|
|
@@ -10579,7 +10675,7 @@
|
|
|
10579
10675
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10580
10676
|
});
|
|
10581
10677
|
|
|
10582
|
-
const packageVersion = "0.14.
|
|
10678
|
+
const packageVersion = "0.14.876";
|
|
10583
10679
|
|
|
10584
10680
|
exports.Blocks = Blocks;
|
|
10585
10681
|
exports.ContentPage = ContentPage;
|