@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
|
@@ -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"}
|
|
@@ -9,7 +9,18 @@ export type LeadRequest = Record<string, JSONRecord | JSONScalar | null> & {
|
|
|
9
9
|
phone?: string;
|
|
10
10
|
email?: string;
|
|
11
11
|
inn?: string;
|
|
12
|
+
innDadata?: string;
|
|
13
|
+
fullRegion?: string;
|
|
12
14
|
secondaryPhoneNumber?: string;
|
|
15
|
+
partnerSymbolCode?: string;
|
|
16
|
+
companyNameByInn?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type PFFormData = {
|
|
20
|
+
innDadata?: string;
|
|
21
|
+
fullRegion?: string;
|
|
22
|
+
partnerSymbolCode?: string;
|
|
23
|
+
companyNameByInn?: string;
|
|
13
24
|
};
|
|
14
25
|
|
|
15
26
|
export function LeadServiceAPI() {
|
|
@@ -22,11 +33,15 @@ export function LeadServiceAPI() {
|
|
|
22
33
|
birthday,
|
|
23
34
|
desiredMeetingDate,
|
|
24
35
|
inn,
|
|
36
|
+
innDadata,
|
|
37
|
+
fullRegion,
|
|
25
38
|
addressBranch,
|
|
26
39
|
secondaryPhone = '',
|
|
27
40
|
bankEmpolee,
|
|
28
41
|
applicationDate,
|
|
29
42
|
serviceDirection,
|
|
43
|
+
partnerSymbolCode,
|
|
44
|
+
companyNameByInn,
|
|
30
45
|
...staticBody
|
|
31
46
|
} = body;
|
|
32
47
|
const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
|
|
@@ -46,6 +61,7 @@ export function LeadServiceAPI() {
|
|
|
46
61
|
applicationDate,
|
|
47
62
|
...getSecondaryPhone(secondaryPhone as string),
|
|
48
63
|
}),
|
|
64
|
+
...formatPFForm(typeForm, { innDadata, fullRegion, partnerSymbolCode, companyNameByInn }),
|
|
49
65
|
...staticBody,
|
|
50
66
|
};
|
|
51
67
|
|
|
@@ -85,8 +101,17 @@ const getEmail = (email?: string, isNaturalPerson = true) => ({
|
|
|
85
101
|
[isNaturalPerson ? 'email' : 'mail']: email,
|
|
86
102
|
});
|
|
87
103
|
|
|
88
|
-
const getSecondaryPhone = (secondaryPhone = '') =>
|
|
89
|
-
|
|
104
|
+
const getSecondaryPhone = (secondaryPhone = '') =>
|
|
105
|
+
!secondaryPhone || secondaryPhone === '+7 ('
|
|
90
106
|
? {}
|
|
91
107
|
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
92
|
-
|
|
108
|
+
|
|
109
|
+
const formatPFForm = (typeForm?: string, data?: PFFormData) =>
|
|
110
|
+
typeForm === 'PF'
|
|
111
|
+
? {
|
|
112
|
+
inn: data?.innDadata,
|
|
113
|
+
region: data?.fullRegion,
|
|
114
|
+
partnerComments: data?.partnerSymbolCode,
|
|
115
|
+
fullname: data?.companyNameByInn,
|
|
116
|
+
}
|
|
117
|
+
: {};
|
|
@@ -1378,5 +1378,89 @@
|
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
|
+
],
|
|
1382
|
+
[
|
|
1383
|
+
"Онлайн-заявка от партнера",
|
|
1384
|
+
{
|
|
1385
|
+
"content": {
|
|
1386
|
+
"version": "primary",
|
|
1387
|
+
"title": "Онлайн-заявка от партнера",
|
|
1388
|
+
"typeForm": "PF",
|
|
1389
|
+
"endpoint": "sendcorporatedlead",
|
|
1390
|
+
"sections": [
|
|
1391
|
+
{
|
|
1392
|
+
"title": "Информация о партнере",
|
|
1393
|
+
"inputs": [
|
|
1394
|
+
{
|
|
1395
|
+
"name": "partnerSymbolCode",
|
|
1396
|
+
"required": true
|
|
1397
|
+
}
|
|
1398
|
+
]
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"title": "Информация о компании",
|
|
1402
|
+
"columns": 2,
|
|
1403
|
+
"inputs": [
|
|
1404
|
+
{
|
|
1405
|
+
"name": "innDadata",
|
|
1406
|
+
"required": true
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "companyNameByInn",
|
|
1410
|
+
"required": true
|
|
1411
|
+
}
|
|
1412
|
+
]
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
"title": "Данные контактного лица",
|
|
1416
|
+
"columns": 2,
|
|
1417
|
+
"inputs": [
|
|
1418
|
+
{
|
|
1419
|
+
"name": "surname",
|
|
1420
|
+
"required": true
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
"name": "name",
|
|
1424
|
+
"required": true
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
"name": "phone",
|
|
1428
|
+
"required": true
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
"name": "email"
|
|
1432
|
+
}
|
|
1433
|
+
]
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
"title": "Регион компании",
|
|
1437
|
+
"inputs": [
|
|
1438
|
+
{
|
|
1439
|
+
"name": "fullRegion",
|
|
1440
|
+
"required": true
|
|
1441
|
+
}
|
|
1442
|
+
]
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
"title": "Комментарий",
|
|
1446
|
+
"inputs": [
|
|
1447
|
+
{
|
|
1448
|
+
"name": "comment"
|
|
1449
|
+
}
|
|
1450
|
+
]
|
|
1451
|
+
}
|
|
1452
|
+
],
|
|
1453
|
+
"button": {
|
|
1454
|
+
"text": "Отправить заявку",
|
|
1455
|
+
"version": "primary"
|
|
1456
|
+
},
|
|
1457
|
+
"link": {
|
|
1458
|
+
"text": "Согласен на обработку персональных данных",
|
|
1459
|
+
"href": "/privacy-policy",
|
|
1460
|
+
"target": "_blank"
|
|
1461
|
+
},
|
|
1462
|
+
"isPremium": false
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1381
1465
|
]
|
|
1382
1466
|
]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { JSX } from '@redneckz/uni-jsx';
|
|
2
1
|
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { LeadServiceAPI } from '../../api/LeadServiceAPI';
|
|
4
3
|
import { handleAspects } from '../../hooks/useAspects/handleAspects';
|
|
5
4
|
import { useAspects } from '../../hooks/useAspects/useAspects';
|
|
6
|
-
import { useForm } from '../../hooks/useForm/useForm';
|
|
5
|
+
import { useForm, type FormFieldRegisterer } from '../../hooks/useForm/useForm';
|
|
6
|
+
import { type FormTypeFieldDef } from '../../model/FormTypeFieldDef';
|
|
7
|
+
import { type SectionsProps } from '../../model/InputSectionsType';
|
|
7
8
|
import { ApplicationFormLayout } from '../../ui-kit/ApplicationFormLayout/ApplicationFormLayout';
|
|
8
9
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
9
10
|
import { getConsentDataProcessing } from '../../ui-kit/FormField/getConsentDataProcessing';
|
|
@@ -13,19 +14,29 @@ import { inputColumnStyles } from '../../ui-kit/FormField/inputColumnStyle';
|
|
|
13
14
|
import { renderTitle } from '../../ui-kit/FormField/renderTitle';
|
|
14
15
|
import { type PreventableEventWithTarget } from '../../ui-kit/PreventableEvent';
|
|
15
16
|
import { ResponseTypeDialog } from '../../ui-kit/ResponseTypeDialog/ResponseTypeDialog';
|
|
17
|
+
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
16
18
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
17
19
|
import { style } from '../../utils/style';
|
|
18
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
type additionalParamsType,
|
|
22
|
+
type ApplicationFormContent,
|
|
23
|
+
type FieldDef,
|
|
24
|
+
} from './ApplicationFormContent';
|
|
19
25
|
import { getFormatData } from './getFormatData';
|
|
20
26
|
import { getInitialFormState, type FormState } from './getInitialFormState';
|
|
21
27
|
import { renderAgreementSubmit } from './renderAgreementSubmit';
|
|
22
28
|
import { renderContacts } from './renderContacts';
|
|
23
29
|
|
|
24
|
-
interface ApplicationFormProps extends ApplicationFormContent, UniBlockProps {}
|
|
30
|
+
export interface ApplicationFormProps extends ApplicationFormContent, UniBlockProps {}
|
|
31
|
+
|
|
32
|
+
type renderSectionsType = {
|
|
33
|
+
typeForm: FormTypeFieldDef;
|
|
34
|
+
additionalParams?: additionalParamsType;
|
|
35
|
+
};
|
|
25
36
|
|
|
26
37
|
const API = LeadServiceAPI();
|
|
27
38
|
|
|
28
|
-
export const ApplicationForm =
|
|
39
|
+
export const ApplicationForm = UniBlock<ApplicationFormProps>(
|
|
29
40
|
({
|
|
30
41
|
className,
|
|
31
42
|
title,
|
|
@@ -80,15 +91,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
80
91
|
{...rest}
|
|
81
92
|
>
|
|
82
93
|
<form onSubmit={onSubmit}>
|
|
83
|
-
{sections
|
|
84
|
-
<div
|
|
85
|
-
key={`section-${i}`}
|
|
86
|
-
className={style(inputColumnStyles(_.columns), 'grid gap-x-m')}
|
|
87
|
-
>
|
|
88
|
-
{renderTitle(_.title)}
|
|
89
|
-
{(_?.inputs || [])?.map(getField<FieldDef>(field, { typeForm }))}
|
|
90
|
-
</div>
|
|
91
|
-
))}
|
|
94
|
+
{renderSections(sections, field, { typeForm, additionalParams })}
|
|
92
95
|
{renderAgreementSubmit(
|
|
93
96
|
fieldName ? field('consentDataProcessing') : undefined,
|
|
94
97
|
link,
|
|
@@ -100,3 +103,15 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
100
103
|
);
|
|
101
104
|
},
|
|
102
105
|
);
|
|
106
|
+
|
|
107
|
+
const renderSections = (
|
|
108
|
+
sections: SectionsProps[],
|
|
109
|
+
field: FormFieldRegisterer<Record<string, any>>,
|
|
110
|
+
{ typeForm, additionalParams }: renderSectionsType,
|
|
111
|
+
) =>
|
|
112
|
+
sections.map((_, i) => (
|
|
113
|
+
<div key={`section-${i}`} className={style(inputColumnStyles(_.columns), 'grid gap-x-m')}>
|
|
114
|
+
{renderTitle(_.title)}
|
|
115
|
+
{(_?.inputs || [])?.map(getField<FieldDef>(field, { typeForm, ...additionalParams }))}
|
|
116
|
+
</div>
|
|
117
|
+
));
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
/* eslint-disable max-len */
|
|
3
|
-
|
|
4
1
|
import { type AspectsProps } from '../../model/AspectsProps';
|
|
5
2
|
import { type ColumnsCount } from '../../model/ColumnCount';
|
|
6
3
|
import { type FormTypeFieldDef } from '../../model/FormTypeFieldDef';
|
|
@@ -71,11 +68,16 @@ type productType = {
|
|
|
71
68
|
product?: string;
|
|
72
69
|
};
|
|
73
70
|
|
|
71
|
+
type premiumForm = {
|
|
72
|
+
/** @title Форма для премиума */
|
|
73
|
+
isPremium?: boolean;
|
|
74
|
+
};
|
|
75
|
+
|
|
74
76
|
/**
|
|
75
77
|
* @title Отображать выбор продукта
|
|
76
78
|
* @default { "showProduct": "" }
|
|
77
79
|
*/
|
|
78
|
-
type additionalParamsType = hideProductDef | showProductDef;
|
|
80
|
+
export type additionalParamsType = premiumForm | hideProductDef | showProductDef;
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
83
|
* @title Форма заявки настраиваемая
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getDaDataHints } from '../retail/api/dadataHints/dadataHints';
|
|
2
|
+
|
|
3
|
+
const INN_DADATA_URL = 'suggest/party';
|
|
4
|
+
|
|
5
|
+
interface InnHint {
|
|
6
|
+
fullName?: string;
|
|
7
|
+
address?: string;
|
|
8
|
+
inn?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const useInn = async (searchQuery: string): Promise<InnHint[]> =>
|
|
12
|
+
(await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery })).map((_) => ({
|
|
13
|
+
fullName: _?.value,
|
|
14
|
+
address: _?.data?.address?.value,
|
|
15
|
+
inn: _?.data?.inn,
|
|
16
|
+
}));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { InputControl } from '../../Input/InputControl';
|
|
4
|
+
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
5
|
+
|
|
6
|
+
export const CompanyNameByInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
7
|
+
const fieldInn = field('innDadata');
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (fieldInn?.value?.key !== '') {
|
|
11
|
+
const companyName = fieldInn?.value?.innDaData?.companyName;
|
|
12
|
+
companyName && field?.('companyNameByInn')?.onChange?.(companyName);
|
|
13
|
+
}
|
|
14
|
+
}, [fieldInn?.value]);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<InputControl
|
|
18
|
+
maxLength={60}
|
|
19
|
+
label="Полное наименование"
|
|
20
|
+
{...field(input?.name ?? '')}
|
|
21
|
+
{...input}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
@@ -5,8 +5,13 @@ import { type Option } from '../../Select/Option';
|
|
|
5
5
|
import { SelectControl } from '../../Select/SelectControl';
|
|
6
6
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
7
7
|
|
|
8
|
-
export
|
|
9
|
-
|
|
8
|
+
export interface FullRegionFieldProps extends CustomFieldProps {
|
|
9
|
+
isPremium?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const FullRegionField = JSX<FullRegionFieldProps>(({ field, input, params }) => {
|
|
13
|
+
const isPremium = params?.isPremium as boolean;
|
|
14
|
+
const branchByRegions = useBranchesByRegions(isPremium);
|
|
10
15
|
const regions = useMemo(
|
|
11
16
|
() =>
|
|
12
17
|
branchByRegions?.map(({ region }) => ({
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useAsyncEffect } from '../../../hooks/useAsyncEffect';
|
|
4
|
+
import { useInn } from '../../../hooks/useInn';
|
|
5
|
+
import { SelectControl } from '../../Select/SelectControl';
|
|
6
|
+
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
7
|
+
|
|
8
|
+
type InnSuggestion = {
|
|
9
|
+
fullName?: string;
|
|
10
|
+
address?: string;
|
|
11
|
+
inn?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const InnDadataField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
15
|
+
const [options, setOptions] = useState<InnSuggestion[]>([]);
|
|
16
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
17
|
+
|
|
18
|
+
useAsyncEffect(async () => {
|
|
19
|
+
const fieldInns = useInn(searchQuery);
|
|
20
|
+
setOptions(await fieldInns);
|
|
21
|
+
|
|
22
|
+
return options;
|
|
23
|
+
}, [searchQuery]);
|
|
24
|
+
|
|
25
|
+
const getOptions = useMemo(() => {
|
|
26
|
+
return (options || []).map((item) => ({
|
|
27
|
+
key: item?.inn ?? '',
|
|
28
|
+
text: item?.inn,
|
|
29
|
+
innDaData: {
|
|
30
|
+
companyName: item?.fullName,
|
|
31
|
+
companyAddress: item?.address,
|
|
32
|
+
},
|
|
33
|
+
}));
|
|
34
|
+
}, [options]);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<SelectControl
|
|
38
|
+
label="ИНН"
|
|
39
|
+
placeholder="Введите ИНН"
|
|
40
|
+
options={getOptions}
|
|
41
|
+
{...field(input?.name ?? '')}
|
|
42
|
+
isSearch
|
|
43
|
+
isManualInput
|
|
44
|
+
onSearchQuery={setSearchQuery}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import type { JSONRefObject } from '../../../data/JSONRefObject';
|
|
3
|
+
import { UniBlock } from '../../../UniBlock/UniBlock';
|
|
4
|
+
import type { UniBlockProps } from '../../../UniBlock/UniBlockProps';
|
|
5
|
+
import { InputControl } from '../../Input/InputControl';
|
|
6
|
+
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
7
|
+
|
|
8
|
+
export interface PartnerSymbolCodeFieldProps extends CustomFieldProps, UniBlockProps {
|
|
9
|
+
source?: JSONRefObject & {
|
|
10
|
+
agentsList?: AgentType[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type AgentType = {
|
|
15
|
+
isActive?: boolean;
|
|
16
|
+
symbolCode?: string;
|
|
17
|
+
ID?: string;
|
|
18
|
+
agentName?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const PartnerSymbolCodeField = UniBlock<PartnerSymbolCodeFieldProps>(
|
|
22
|
+
({ field, input, source }) => {
|
|
23
|
+
const agentsList = source?.agentsList;
|
|
24
|
+
const { value: partnerCode } = field('partnerSymbolCode');
|
|
25
|
+
const [symbolCodeError, setSymbolCodeError] = useState('');
|
|
26
|
+
const isPartnerCodeExist = agentsList?.some((item) => item?.symbolCode === partnerCode);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setSymbolCodeError(
|
|
30
|
+
partnerCode && !isPartnerCodeExist
|
|
31
|
+
? 'ID партнера не найден. Обратитесь к своему менеджеру'
|
|
32
|
+
: '',
|
|
33
|
+
);
|
|
34
|
+
}, [partnerCode]);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<InputControl
|
|
38
|
+
label="Идентификатор партнера"
|
|
39
|
+
isInteger={true}
|
|
40
|
+
maxLength={12}
|
|
41
|
+
{...input}
|
|
42
|
+
{...field(input?.name ?? '')}
|
|
43
|
+
error={symbolCodeError || field('partnerSymbolCode')?.error}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
@@ -7,6 +7,7 @@ type NameFieldApplicationDef =
|
|
|
7
7
|
| 'fullName'
|
|
8
8
|
| 'inn'
|
|
9
9
|
| 'comment'
|
|
10
|
+
| 'fullRegion'
|
|
10
11
|
| 'region'
|
|
11
12
|
| 'addressBranch'
|
|
12
13
|
| 'typeForm'
|
|
@@ -37,6 +38,9 @@ type NameFieldApplicationDef =
|
|
|
37
38
|
| 'representativeName'
|
|
38
39
|
| 'regionBranch'
|
|
39
40
|
| 'consentToReceiveMaterials'
|
|
40
|
-
| 'consentDataProcessing'
|
|
41
|
+
| 'consentDataProcessing'
|
|
42
|
+
| 'partnerSymbolCode'
|
|
43
|
+
| 'innDadata'
|
|
44
|
+
| 'companyNameByInn';
|
|
41
45
|
|
|
42
46
|
export type NameFieldDef = NameFieldApplicationDef;
|
|
@@ -13,10 +13,13 @@ import { BankEmpoleeField } from './Fields/BankEmpoleeField';
|
|
|
13
13
|
import { BirthdayField } from './Fields/BirthdayField';
|
|
14
14
|
import { CollectionCountField } from './Fields/CollectionCountField';
|
|
15
15
|
import { CommentField } from './Fields/CommentField';
|
|
16
|
+
import { CompanyNameByInnField } from './Fields/CompanyNameByInnField';
|
|
16
17
|
import { DesiredMeetingDateField } from './Fields/DesiredMeetingDateField';
|
|
17
18
|
import { EmailField } from './Fields/EmailField';
|
|
18
19
|
import { FeedbackMethodField } from './Fields/FeedbackMethodField';
|
|
19
20
|
import { FullNameField } from './Fields/FullNameField';
|
|
21
|
+
import { FullRegionField } from './Fields/FullRegionField';
|
|
22
|
+
import { InnDadataField } from './Fields/InnDadataField';
|
|
20
23
|
import { InnField } from './Fields/InnField';
|
|
21
24
|
import { IsClientField } from './Fields/IsClientField';
|
|
22
25
|
import { LocalitiesField } from './Fields/LocalitiesField';
|
|
@@ -24,11 +27,11 @@ import { MiddleNameField } from './Fields/MiddleNameField';
|
|
|
24
27
|
import { NameField } from './Fields/NameField';
|
|
25
28
|
import { OnlineCheckoutField } from './Fields/OnlineCheckoutField';
|
|
26
29
|
import { PartnerCommentsField } from './Fields/PartnerCommentsField';
|
|
30
|
+
import { PartnerSymbolCodeField } from './Fields/PartnerSymbolCodeField';
|
|
27
31
|
import { PhoneField } from './Fields/PhoneField';
|
|
28
32
|
import { PosTerminalField } from './Fields/PosTerminalField';
|
|
29
33
|
import { ProductField } from './Fields/ProductField';
|
|
30
34
|
import { RegionField } from './Fields/RegionField';
|
|
31
|
-
import { RegionPremiumField } from './Fields/RegionPremiumField';
|
|
32
35
|
import { RepresentativeNameField } from './Fields/RepresentativeNameField';
|
|
33
36
|
import { SecondaryPhoneField } from './Fields/SecondaryPhoneField';
|
|
34
37
|
import { ServiceDirectionField } from './Fields/ServiceDirectionField';
|
|
@@ -46,6 +49,10 @@ const PRODUCT_REF = {
|
|
|
46
49
|
$ref: '/wcms-resources/outservice-productlist.json',
|
|
47
50
|
};
|
|
48
51
|
|
|
52
|
+
const AGENTS_REF = {
|
|
53
|
+
$ref: '/wcms-resources/agenty-dlya-rko.json',
|
|
54
|
+
};
|
|
55
|
+
|
|
49
56
|
const InputsMap = {
|
|
50
57
|
fullName: FullNameField,
|
|
51
58
|
addressBranch: AddressBranchField,
|
|
@@ -70,7 +77,7 @@ const InputsMap = {
|
|
|
70
77
|
applicationDate: ApplicationDateField,
|
|
71
78
|
region: (props: CustomFieldProps) =>
|
|
72
79
|
getPremium(props?.params?.typeForm as FormTypeFieldDef) ? (
|
|
73
|
-
<
|
|
80
|
+
<FullRegionField {...props} />
|
|
74
81
|
) : (
|
|
75
82
|
<RegionField {...props} />
|
|
76
83
|
),
|
|
@@ -87,6 +94,12 @@ const InputsMap = {
|
|
|
87
94
|
email: EmailField,
|
|
88
95
|
inn: InnField,
|
|
89
96
|
comment: CommentField,
|
|
97
|
+
fullRegion: FullRegionField,
|
|
98
|
+
partnerSymbolCode: (props: CustomFieldProps) => (
|
|
99
|
+
<PartnerSymbolCodeField {...props} source={AGENTS_REF} />
|
|
100
|
+
),
|
|
101
|
+
innDadata: InnDadataField,
|
|
102
|
+
companyNameByInn: CompanyNameByInnField,
|
|
90
103
|
};
|
|
91
104
|
|
|
92
105
|
export const getField =
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
defaultSelectValidator,
|
|
7
7
|
defaultValidator,
|
|
8
8
|
emailValidator,
|
|
9
|
+
innDadataValidator,
|
|
9
10
|
innValidator,
|
|
10
11
|
nameValidator,
|
|
11
12
|
phoneValidator,
|
|
@@ -40,6 +41,9 @@ export const validatorObj: Record<string, Validator> = {
|
|
|
40
41
|
typeForm: defaultValidator(),
|
|
41
42
|
consentToReceiveMaterials: agreementValidator,
|
|
42
43
|
consentDataProcessing: agreementValidator,
|
|
44
|
+
partnerSymbolCode: defaultValidator(),
|
|
45
|
+
innDadata: innDadataValidator('Укажите ИНН'),
|
|
46
|
+
companyNameByInn: defaultValidator(),
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
export const getFormValidator = <FormState extends Record<string, any>, F extends BaseFieldDef>(
|
|
@@ -2,6 +2,12 @@ import { isCyrillic } from '../../utils/isCyrilic';
|
|
|
2
2
|
import { required } from '../../validation/required';
|
|
3
3
|
import { validator } from '../../validation/validator';
|
|
4
4
|
|
|
5
|
+
interface DadataItem {
|
|
6
|
+
text?: string;
|
|
7
|
+
key?: string;
|
|
8
|
+
innDaData?: any;
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
6
12
|
|
|
7
13
|
export const defaultValidator = (errorMsg?: string) => required(errorMsg ?? ERROR_MESSAGE);
|
|
@@ -15,7 +21,10 @@ export const nameValidator = (errorMsg?: string) =>
|
|
|
15
21
|
);
|
|
16
22
|
|
|
17
23
|
export const innValidator = (errorMsg: string) =>
|
|
18
|
-
validator((_) =>
|
|
24
|
+
validator((_: string) => isValidInnLength(_))(errorMsg);
|
|
25
|
+
|
|
26
|
+
export const innDadataValidator = (errorMsg: string) =>
|
|
27
|
+
validator((_: DadataItem) => Boolean(_?.text) && isValidInnLength(_.text))(errorMsg);
|
|
19
28
|
|
|
20
29
|
const phoneValidate = (email: string) =>
|
|
21
30
|
/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
@@ -33,3 +42,6 @@ const emailValidate = (email: string) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test
|
|
|
33
42
|
|
|
34
43
|
export const emailValidator = (errorMsg: string) =>
|
|
35
44
|
validator((_: string) => emailValidate(_))(errorMsg);
|
|
45
|
+
|
|
46
|
+
const isValidInnLength = (value: string | undefined): boolean =>
|
|
47
|
+
typeof value === 'string' && (value.length === 10 || value.length === 12);
|