@redneckz/wildless-cms-uni-blocks 0.14.738 → 0.14.739
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +10 -10
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/services/retail/model/LeadFormState.d.ts +1 -1
- package/bundle/services/retail/model/NameFieldDef.d.ts +6 -0
- package/bundle/services/retail/model/RetailFormContent.d.ts +1 -1
- package/bundle/services/retail/utils/calculateInputs.d.ts +1 -2
- package/bundle/ui-kit/FormField/BaseFieldDef.d.ts +8 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -4
- package/bundle/ui-kit/FormField/getField.d.ts +2 -2
- package/bundle/ui-kit/FormField/getObjectValidator.d.ts +2 -2
- package/bundle/ui-kit/FormField/shouldRenderField.d.ts +6 -0
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/renderInputs.js +3 -3
- package/dist/components/ApplicationLeadForm/renderInputs.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/renderInputs.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.js +1 -1
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/renderInputs.js.map +1 -1
- package/dist/services/retail/model/LeadFormState.d.ts +1 -1
- package/dist/services/retail/model/NameFieldDef.d.ts +6 -0
- package/dist/services/retail/model/NameFieldDef.js +2 -0
- package/dist/services/retail/model/NameFieldDef.js.map +1 -0
- package/dist/services/retail/model/RetailFormContent.d.ts +1 -1
- package/dist/services/retail/utils/calculateInputs.d.ts +1 -2
- package/dist/services/retail/utils/calculateInputs.js.map +1 -1
- package/dist/ui-kit/FormField/BaseFieldDef.d.ts +8 -0
- package/dist/ui-kit/FormField/BaseFieldDef.js +2 -0
- package/dist/ui-kit/FormField/BaseFieldDef.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -4
- package/dist/ui-kit/FormField/getField.d.ts +2 -2
- package/dist/ui-kit/FormField/getField.js +3 -3
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.d.ts +2 -2
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.d.ts +6 -0
- package/dist/ui-kit/FormField/{isRenderField.js → shouldRenderField.js} +4 -4
- package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/renderInputs.js +3 -3
- package/lib/components/ApplicationLeadForm/renderInputs.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/renderInputs.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.js +1 -1
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/renderInputs.js.map +1 -1
- package/lib/services/retail/model/LeadFormState.d.ts +1 -1
- package/lib/services/retail/model/NameFieldDef.d.ts +6 -0
- package/lib/services/retail/model/NameFieldDef.js +2 -0
- package/lib/services/retail/model/NameFieldDef.js.map +1 -0
- package/lib/services/retail/model/RetailFormContent.d.ts +1 -1
- package/lib/services/retail/utils/calculateInputs.d.ts +1 -2
- package/lib/services/retail/utils/calculateInputs.js.map +1 -1
- package/lib/ui-kit/FormField/BaseFieldDef.d.ts +8 -0
- package/lib/ui-kit/FormField/BaseFieldDef.js +2 -0
- package/lib/ui-kit/FormField/BaseFieldDef.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -4
- package/lib/ui-kit/FormField/getField.d.ts +2 -2
- package/lib/ui-kit/FormField/getField.js +3 -3
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.d.ts +2 -2
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.d.ts +6 -0
- package/lib/ui-kit/FormField/{isRenderField.js → shouldRenderField.js} +2 -2
- package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +10 -10
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/services/retail/model/LeadFormState.d.ts +1 -1
- package/mobile/bundle/services/retail/model/NameFieldDef.d.ts +6 -0
- package/mobile/bundle/services/retail/model/RetailFormContent.d.ts +1 -1
- package/mobile/bundle/services/retail/utils/calculateInputs.d.ts +1 -2
- package/mobile/bundle/ui-kit/FormField/BaseFieldDef.d.ts +8 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -4
- package/mobile/bundle/ui-kit/FormField/getField.d.ts +2 -2
- package/mobile/bundle/ui-kit/FormField/getObjectValidator.d.ts +2 -2
- package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +6 -0
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/renderInputs.js +3 -3
- package/mobile/dist/components/ApplicationLeadForm/renderInputs.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/renderInputs.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/renderInputs.js.map +1 -1
- package/mobile/dist/services/retail/model/LeadFormState.d.ts +1 -1
- package/mobile/dist/services/retail/model/NameFieldDef.d.ts +6 -0
- package/mobile/dist/services/retail/model/NameFieldDef.js +2 -0
- package/mobile/dist/services/retail/model/NameFieldDef.js.map +1 -0
- package/mobile/dist/services/retail/model/RetailFormContent.d.ts +1 -1
- package/mobile/dist/services/retail/utils/calculateInputs.d.ts +1 -2
- package/mobile/dist/services/retail/utils/calculateInputs.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/BaseFieldDef.d.ts +8 -0
- package/mobile/dist/ui-kit/FormField/BaseFieldDef.js +2 -0
- package/mobile/dist/ui-kit/FormField/BaseFieldDef.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -4
- package/mobile/dist/ui-kit/FormField/getField.d.ts +2 -2
- package/mobile/dist/ui-kit/FormField/getField.js +3 -3
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.d.ts +2 -2
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +6 -0
- package/mobile/dist/ui-kit/FormField/{isRenderField.js → shouldRenderField.js} +4 -4
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/renderInputs.js +3 -3
- package/mobile/lib/components/ApplicationLeadForm/renderInputs.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/renderInputs.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/renderInputs.js.map +1 -1
- package/mobile/lib/services/retail/model/LeadFormState.d.ts +1 -1
- package/mobile/lib/services/retail/model/NameFieldDef.d.ts +6 -0
- package/mobile/lib/services/retail/model/NameFieldDef.js +2 -0
- package/mobile/lib/services/retail/model/NameFieldDef.js.map +1 -0
- package/mobile/lib/services/retail/model/RetailFormContent.d.ts +1 -1
- package/mobile/lib/services/retail/utils/calculateInputs.d.ts +1 -2
- package/mobile/lib/services/retail/utils/calculateInputs.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/BaseFieldDef.d.ts +8 -0
- package/mobile/lib/ui-kit/FormField/BaseFieldDef.js +2 -0
- package/mobile/lib/ui-kit/FormField/BaseFieldDef.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -4
- package/mobile/lib/ui-kit/FormField/getField.d.ts +2 -2
- package/mobile/lib/ui-kit/FormField/getField.js +3 -3
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.d.ts +2 -2
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +6 -0
- package/mobile/lib/ui-kit/FormField/{isRenderField.js → shouldRenderField.js} +2 -2
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/renderInputs.tsx +6 -4
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +1 -3
- package/mobile/src/components/CreditCardForm/renderInputs.tsx +3 -1
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -3
- package/mobile/src/components/CreditForm/renderInputs.tsx +1 -1
- package/mobile/src/services/retail/model/LeadFormState.ts +2 -2
- package/mobile/src/services/retail/model/NameFieldDef.ts +89 -0
- package/mobile/src/services/retail/model/RetailFormContent.ts +1 -1
- package/mobile/src/services/retail/utils/calculateInputs.ts +6 -7
- package/mobile/src/ui-kit/FormField/BaseFieldDef.ts +8 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +1 -81
- package/mobile/src/ui-kit/FormField/getField.tsx +10 -9
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +5 -5
- package/mobile/src/ui-kit/FormField/{isRenderField.tsx → shouldRenderField.tsx} +3 -3
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/src/components/ApplicationLeadForm/renderInputs.tsx +6 -4
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +1 -3
- package/src/components/CreditCardForm/renderInputs.tsx +3 -1
- package/src/components/CreditForm/CreditFormStep.tsx +2 -3
- package/src/components/CreditForm/renderInputs.tsx +1 -1
- package/src/services/retail/model/LeadFormState.ts +2 -2
- package/src/services/retail/model/NameFieldDef.ts +89 -0
- package/src/services/retail/model/RetailFormContent.ts +1 -1
- package/src/services/retail/utils/calculateInputs.ts +6 -7
- package/src/ui-kit/FormField/BaseFieldDef.ts +8 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +1 -81
- package/src/ui-kit/FormField/getField.tsx +10 -9
- package/src/ui-kit/FormField/getObjectValidator.tsx +5 -5
- package/src/ui-kit/FormField/{isRenderField.tsx → shouldRenderField.tsx} +3 -3
- package/bundle/ui-kit/FormField/dataSources.d.ts +0 -3
- package/bundle/ui-kit/FormField/isRenderField.d.ts +0 -6
- package/dist/ui-kit/FormField/dataSources.d.ts +0 -3
- package/dist/ui-kit/FormField/dataSources.js +0 -6
- package/dist/ui-kit/FormField/dataSources.js.map +0 -1
- package/dist/ui-kit/FormField/isRenderField.d.ts +0 -6
- package/dist/ui-kit/FormField/isRenderField.js.map +0 -1
- package/lib/ui-kit/FormField/dataSources.d.ts +0 -3
- package/lib/ui-kit/FormField/dataSources.js +0 -4
- package/lib/ui-kit/FormField/dataSources.js.map +0 -1
- package/lib/ui-kit/FormField/isRenderField.d.ts +0 -6
- package/lib/ui-kit/FormField/isRenderField.js.map +0 -1
- package/mobile/bundle/ui-kit/FormField/dataSources.d.ts +0 -3
- package/mobile/bundle/ui-kit/FormField/isRenderField.d.ts +0 -6
- package/mobile/dist/ui-kit/FormField/dataSources.d.ts +0 -3
- package/mobile/dist/ui-kit/FormField/dataSources.js +0 -6
- package/mobile/dist/ui-kit/FormField/dataSources.js.map +0 -1
- package/mobile/dist/ui-kit/FormField/isRenderField.d.ts +0 -6
- package/mobile/dist/ui-kit/FormField/isRenderField.js.map +0 -1
- package/mobile/lib/ui-kit/FormField/dataSources.d.ts +0 -3
- package/mobile/lib/ui-kit/FormField/dataSources.js +0 -4
- package/mobile/lib/ui-kit/FormField/dataSources.js.map +0 -1
- package/mobile/lib/ui-kit/FormField/isRenderField.d.ts +0 -6
- package/mobile/lib/ui-kit/FormField/isRenderField.js.map +0 -1
- package/mobile/src/ui-kit/FormField/dataSources.ts +0 -3
- package/src/ui-kit/FormField/dataSources.ts +0 -3
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type FieldDef } from '../../../components/ApplicationForm/ApplicationFormContent';
|
|
2
1
|
import { type LeadFormState } from '../model/LeadFormState';
|
|
3
2
|
import { type FieldRetailDef } from '../model/RetailFormContent';
|
|
4
3
|
export declare type GetValue = <K extends keyof LeadFormState>(name: K) => LeadFormState[K];
|
|
5
4
|
export declare const calculateInputs: (getValue: GetValue) => (inputs: FieldRetailDef[], step: number) => FieldRetailDef[];
|
|
6
|
-
export declare const checkCondition: ({ condition }:
|
|
5
|
+
export declare const checkCondition: ({ condition }: FieldRetailDef, getValue: GetValue) => boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateInputs.js","sourceRoot":"","sources":["../../../../src/services/retail/utils/calculateInputs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calculateInputs.js","sourceRoot":"","sources":["../../../../src/services/retail/utils/calculateInputs.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,MAAwB,EAAE,IAAY,EAAE,EAAE,CAChG,MAAM;KACH,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;KAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;IACT,IACE;QACE,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC;QAC9B,kBAAkB,CAAC,CAAC,EAAE,QAAQ,CAAC;QAC/B,kBAAkB,CAAC,CAAC,EAAE,QAAQ,CAAC;QAC/B,wBAAwB,CAAC,CAAC,EAAE,QAAQ,CAAC;QACrC,gBAAgB,CAAC,CAAC,EAAE,QAAQ,CAAC;QAC7B,cAAc,CAAC,CAAC,EAAE,QAAQ,CAAC;KAC5B,CAAC,IAAI,CAAC,OAAO,CAAC,EACf;QACA,OAAO,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;KAClC;IAED,OAAO,CAAC,CAAC;AACX,CAAC,CAAC,CAAC;AAEP,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,QAAkB,EAAE,EAAE,CAC1D,IAAI,KAAK,CAAC,IAAI,QAAQ,CAAC,YAAY,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC;AAE1D,MAAM,kBAAkB,GAAG,CAAC,EAAE,IAAI,EAAkB,EAAE,QAAkB,EAAE,EAAE,CAC1E,IAAI,KAAK,gBAAgB,IAAI,QAAQ,CAAC,sBAAsB,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC;AAE1F,MAAM,wBAAwB,GAAG,CAAC,EAAE,IAAI,EAAE,YAAY,EAAkB,EAAE,QAAkB,EAAE,EAAE,CAC9F,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,mBAAmB,CAAC,EAAE,GAAG,IAAI,YAAY,CAAC;AAEpF,MAAM,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAkB,EAAE,QAAkB,EAAE,EAAE,CACxE,IAAI,KAAK,aAAa,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,SAAS,EAAkB,EAAE,QAAkB,EAAE,EAAE,CAClF,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5B,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAE5C,OAAO,CAAC,KAAK,CAAE,SAAoB,EAAE,GAAG,IAAI,SAAS,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AAEL,MAAM,kBAAkB,GAAG,CAAC,EAAE,IAAI,EAAkB,EAAE,QAAkB,EAAE,EAAE,CAC1E,IAAI,KAAK,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC;AAEhD,MAAM,eAAe,GAAG,CAAC,QAAkB,EAAE,EAAE,CAC7C,QAAQ,CAAC,oBAAoB,CAAC,EAAE,GAAG,KAAK,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseFieldDef.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/BaseFieldDef.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
declare type NameFieldConsentDef = 'processPersonalDataFlg' | 'consentProviderFlg' | 'consentInformFlg' | 'consentPfrFlg' | 'consentOthersFlg';
|
|
2
|
-
declare type NameFieldCreditCardDef = 'addressCourier' | 'paymentSystem' | 'currency' | 'cardCategory' | 'codeWord' | 'confirmationIncome' | 'methodObtain' | 'deliveryDate';
|
|
3
|
-
declare type NameFieldRetailDef = 'organization' | 'organizationAddress' | 'organizationPhone' | 'organizationName' | 'legalForm' | 'generalSeniority' | 'lastJobExperience' | 'experience5Years' | 'jobsNumber' | 'beginDate' | 'addressFact' | 'addressRegistration' | 'addressRetail' | 'addressMatch' | 'sex' | 'limitedBirthday' | 'birthPlace' | 'education' | 'housing' | 'amountWorkers' | 'employment' | 'employerActivities' | 'employerOrganization' | 'positionOrganization' | 'familyStatus' | 'familyMembers' | 'children' | 'dependents' | 'totalIncome' | 'expenses' | 'snils' | 'conscription' | 'armyIdFlg' | 'dulSerie' | 'dulNumber' | 'dulIssueDateField' | 'dulSubdivisionCode' | 'dulIssuedBy' | 'participantDateRegistration' | 'retirementIncome' | 'rentalIncome' | 'otherIncome' | 'otherPayments' | 'additionalIncome' | 'wages' | 'mandatoryPayments' | 'incomeAverage' | 'disablePeopleFlg' | 'bankruptcyFlg' | 'shareholderFlg' | 'legalEntityName' | 'creditInRshbCd' | 'bankEmployeeCode' | 'partInBusiness' | 'regionRetail' | 'calculator' | 'infoCard';
|
|
4
1
|
declare type NameFieldApplicationDef = 'surname' | 'name' | 'middleName' | 'email' | 'phone' | 'fullName' | 'inn' | 'comment' | 'region' | 'addressBranch' | 'typeForm' | 'registrationDate' | 'birthday' | 'isClient' | 'acquiringType' | 'onlineCheckout' | 'posTerminal' | 'serviceDirection' | 'serviceType' | 'feedbackMethod' | 'bankEmpolee' | 'applicationDate' | 'secondaryPhone' | 'vedTypes' | 'term' | 'amount' | 'annualRevenue' | 'collectionCount' | 'desiredMeetingDate' | 'product' | 'localities' | 'partnerComments' | 'consentToReceiveMaterials' | 'consentDataProcessing';
|
|
5
|
-
export declare type NameFieldDef = NameFieldApplicationDef
|
|
2
|
+
export declare type NameFieldDef = NameFieldApplicationDef;
|
|
6
3
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FieldDef } from '../../components/ApplicationForm/ApplicationFormContent';
|
|
2
1
|
import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
|
|
3
2
|
import { type VNode } from '../../model/VNode';
|
|
4
|
-
|
|
3
|
+
import { type BaseFieldDef } from './BaseFieldDef';
|
|
4
|
+
export declare const getField: <F extends BaseFieldDef>(field: FormFieldRegisterer<any>, params?: Record<string, any>, externalInputs?: Record<string, VNode>) => (input: F, i: number) => any;
|
|
@@ -32,7 +32,7 @@ import { TermField } from './Fields/TermField.js';
|
|
|
32
32
|
import { UltraPremiumField } from './Fields/UltraPremiumField.js';
|
|
33
33
|
import { VedField } from './Fields/VedField.js';
|
|
34
34
|
import { getPremium } from './getPremium.js';
|
|
35
|
-
import {
|
|
35
|
+
import { shouldRenderField } from './shouldRenderField.js';
|
|
36
36
|
const PRODUCT_REF = {
|
|
37
37
|
$ref: '/wcms-resources/outservice-productlist.json',
|
|
38
38
|
};
|
|
@@ -70,10 +70,10 @@ const InputsMap = {
|
|
|
70
70
|
comment: CommentField,
|
|
71
71
|
};
|
|
72
72
|
export const getField = (field, params, externalInputs = {}) => (input, i) => {
|
|
73
|
-
const
|
|
73
|
+
const fieldsRegister = {
|
|
74
74
|
...InputsMap,
|
|
75
75
|
...externalInputs,
|
|
76
76
|
};
|
|
77
|
-
return
|
|
77
|
+
return (shouldRenderField({ input, field }) && (_jsx("div", { children: fieldsRegister[String(input.name)]?.({ field, input, params }) }, i)));
|
|
78
78
|
};
|
|
79
79
|
//# sourceMappingURL=getField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getField.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/getField.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"getField.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/getField.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM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A+B,KAAK,KAAK,GAAI,CAClE;IACD,MAAM,EAAE,CAAC,KAAuB,EAAE,EAAE,CAClC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAA4B,CAAC,CAAC,CAAC,CAAC,CACxD,KAAC,kBAAkB,OAAK,KAAK,GAAI,CAClC,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,OAAK,KAAK,GAAI,CAC3B;IACH,yBAAyB,EAAE,8BAA8B;IAEzD,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,eAAe;IAC3B,QAAQ,EAAE,aAAa;IACvB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,UAAU;IACjB,GAAG,EAAE,QAAQ;IACb,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GACnB,CACE,KAA+B,EAC/B,MAA4B,EAC5B,iBAAwC,EAAE,EAC1C,EAAE,CACJ,CAAC,KAAQ,EAAE,CAAS,EAAE,EAAE;IACtB,MAAM,cAAc,GAAG;QACrB,GAAG,SAAS;QACZ,GAAG,cAAc;KAClB,CAAC;IAEF,OAAO,CACL,iBAAiB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CACrC,wBAAc,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,IAAlE,CAAC,CAAwE,CACpF,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type FieldDef } from '../../components/ApplicationForm/ApplicationFormContent';
|
|
2
1
|
import { type FieldValidatorsMap } from '../../hooks/useForm/FormOptions';
|
|
3
2
|
import { type Validator } from '../../validation/validator';
|
|
3
|
+
import { type BaseFieldDef } from './BaseFieldDef';
|
|
4
4
|
export declare const validatorObj: Record<string, Validator>;
|
|
5
|
-
export declare const getFormValidator: <FormState extends Record<string, any
|
|
5
|
+
export declare const getFormValidator: <FormState extends Record<string, any>, F extends BaseFieldDef>(fieldDefs: F[]) => (_: FormState) => FieldValidatorsMap<FormState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getObjectValidator.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/getObjectValidator.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,MAAM,oBAAoB,GAA8B;IACtD,sBAAsB,EAAE,kBAAkB;IAC1C,kBAAkB,EAAE,kBAAkB;IACtC,gBAAgB,EAAE,kBAAkB;IACpC,aAAa,EAAE,kBAAkB;IACjC,gBAAgB,EAAE,kBAAkB;CACrC,CAAC;AAEF,MAAM,sBAAsB,GAA8B;IACxD,cAAc,EAAE,sBAAsB,EAAE;IACxC,aAAa,EAAE,gBAAgB,CAAC,+BAA+B,CAAC;IAChE,QAAQ,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IAC5C,YAAY,EAAE,gBAAgB,CAAC,yBAAyB,CAAC;IACzD,QAAQ,EAAE,iBAAiB,CAAC,iCAAiC,CAAC;IAC9D,kBAAkB,EAAE,sBAAsB,EAAE;IAC5C,YAAY,EAAE,gBAAgB,EAAE;IAChC,YAAY,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;CACxD,CAAC;AAEF,MAAM,kBAAkB,GAA8B;IACpD,YAAY,EAAE,sBAAsB,CAAC,0BAA0B,CAAC;IAChE,mBAAmB,EAAE,4BAA4B,EAAE;IACnD,iBAAiB,EAAE,cAAc,CAAC,wBAAwB,CAAC;IAC3D,gBAAgB,EAAE,gBAAgB,CAAC,k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EAAE,sBAAsB,EAAE;IAC1C,cAAc,EAAE,cAAc,CAAC,wBAAwB,CAAC;IACxD,MAAM,EAAE,sBAAsB,EAAE;IAEhC,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC;IAC9C,IAAI,EAAE,aAAa,CAAC,kBAAkB,CAAC;IACvC,UAAU,EAAE,aAAa,CAAC,uBAAuB,CAAC;IAClD,QAAQ,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;IACnD,KAAK,EAAE,cAAc,CAAC,wBAAwB,CAAC;IAC/C,KAAK,EAAE,cAAc,CAAC,2BAA2B,CAAC;IAClD,GAAG,EAAE,YAAY,CAAC,aAAa,CAAC;IAChC,OAAO,EAAE,gBAAgB,EAAE;IAC3B,QAAQ,EAAE,gBAAgB,EAAE;IAC5B,yBAAyB,EAAE,kBAAkB;IAC7C,qBAAqB,EAAE,kBAAkB;IACzC,GAAG,oBAAoB;IACvB,GAAG,kBAAkB;IACrB,GAAG,sBAAsB;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,
|
|
1
|
+
{"version":3,"file":"getObjectValidator.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/getObjectValidator.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,MAAM,oBAAoB,GAA8B;IACtD,sBAAsB,EAAE,kBAAkB;IAC1C,kBAAkB,EAAE,kBAAkB;IACtC,gBAAgB,EAAE,kBAAkB;IACpC,aAAa,EAAE,kBAAkB;IACjC,gBAAgB,EAAE,kBAAkB;CACrC,CAAC;AAEF,MAAM,sBAAsB,GAA8B;IACxD,cAAc,EA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IAAI,IAAI,EAAE,CAAC,CAAC;QAErE,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,IAAI,eAAe,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
|
|
2
|
+
import { type BaseFieldDef } from './BaseFieldDef';
|
|
3
|
+
export declare function shouldRenderField<F extends BaseFieldDef>({ input, field, }: {
|
|
4
|
+
input: F;
|
|
5
|
+
field: FormFieldRegisterer<any>;
|
|
6
|
+
}): string | true | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function shouldRenderField({ input, field, }) {
|
|
2
2
|
const { condition } = input;
|
|
3
3
|
const { value } = field(condition?.name || '');
|
|
4
4
|
return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
|
|
5
5
|
}
|
|
6
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=shouldRenderField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldRenderField.js","sourceRoot":"","sources":["../../../src/ui-kit/FormField/shouldRenderField.tsx"],"names":[],"mappings":"AAGA,MAAM,UAAU,iBAAiB,CAAyB,EACxD,KAAK,EACL,KAAK,GAIN;IACC,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IAE/C,OAAO,CAAC,SAAS,IAAI,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -86,7 +86,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
86
86
|
className={style(inputColumnStyles(_.columns), 'grid gap-x-m')}
|
|
87
87
|
>
|
|
88
88
|
{renderTitle(_.title)}
|
|
89
|
-
{(_?.inputs || [])?.map(getField(field, { typeForm }))}
|
|
89
|
+
{(_?.inputs || [])?.map(getField<FieldDef>(field, { typeForm }))}
|
|
90
90
|
</div>
|
|
91
91
|
))}
|
|
92
92
|
{renderAgreementSubmit(
|
|
@@ -56,7 +56,7 @@ export const GroupedConsents = JSX<GroupedConsentsProps>(({ inputs = [], field,
|
|
|
56
56
|
<FoldableSection isUnfolded={isUnfolded} className="flex flex-col pl-2xl">
|
|
57
57
|
{
|
|
58
58
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
59
|
-
inputs.map(getField(field, {}, InputsConsentsMap))
|
|
59
|
+
inputs.map(getField<FieldRetailDef>(field, {}, { ...InputsConsentsMap }))
|
|
60
60
|
}
|
|
61
61
|
</FoldableSection>
|
|
62
62
|
)}
|
|
@@ -10,7 +10,7 @@ export const renderInputs = ({ field, inputs }: GroupedConsentsProps) => {
|
|
|
10
10
|
|
|
11
11
|
return consentInputs.length > 2 ? (
|
|
12
12
|
<div>
|
|
13
|
-
{restInputs.map(getField(field, {}, { ...InputsApplicationLeadMap }))}
|
|
13
|
+
{restInputs.map(getField<FieldRetailDef>(field, {}, { ...InputsApplicationLeadMap }))}
|
|
14
14
|
<GroupedConsents inputs={consentInputs} field={field} />
|
|
15
15
|
</div>
|
|
16
16
|
) : (
|
|
@@ -18,7 +18,9 @@ export const renderInputs = ({ field, inputs }: GroupedConsentsProps) => {
|
|
|
18
18
|
);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const splitInputs = (
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const splitInputs = (
|
|
22
|
+
inputs: FieldRetailDef[] = [],
|
|
23
|
+
): { consentInputs: FieldRetailDef[]; restInputs: FieldRetailDef[] } => ({
|
|
24
|
+
consentInputs: inputs.filter(({ name }) => Object.keys(CONSENTS).includes(String(name))),
|
|
25
|
+
restInputs: inputs.filter(({ name }) => !Object.keys(CONSENTS).includes(String(name))),
|
|
24
26
|
});
|
|
@@ -3,10 +3,8 @@ import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
4
4
|
import { type SectionsRetailProps } from '../../model/InputSectionsType';
|
|
5
5
|
import { type LeadFormState } from '../../services/retail/model/LeadFormState';
|
|
6
|
-
import { type FieldRetailDef } from '../../services/retail/model/RetailFormContent';
|
|
7
6
|
import { calculateInputs } from '../../services/retail/utils/calculateInputs';
|
|
8
7
|
import { getFormValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
9
|
-
import { type SectionsProps } from '../ApplicationForm/ApplicationFormContent';
|
|
10
8
|
import { CreditCardFormStatusTracker } from './CreditCardFormStatusTracker';
|
|
11
9
|
import { renderStep } from './renderStep';
|
|
12
10
|
import { StepsNavigationButtons } from './StepsNavigationButtons';
|
|
@@ -24,7 +22,7 @@ export interface CreditCardFormStepProps {
|
|
|
24
22
|
export const CreditCardFormStep = JSX<CreditCardFormStepProps>(
|
|
25
23
|
({ step, sections, isFormFinished, onPrevStep, onNextStep, onFinish }) => {
|
|
26
24
|
const inputs = useMemo(
|
|
27
|
-
() =>
|
|
25
|
+
() => sections?.flatMap((_: SectionsRetailProps) => _?.inputs || []),
|
|
28
26
|
[sections],
|
|
29
27
|
);
|
|
30
28
|
|
|
@@ -13,4 +13,6 @@ export interface RenderInputsProps {
|
|
|
13
13
|
const InputsMap = { ...InputsRetailMap, ...InputRetailCardMap };
|
|
14
14
|
|
|
15
15
|
export const renderInputs = ({ field, inputs, params }: RenderInputsProps) =>
|
|
16
|
-
inputs.map(
|
|
16
|
+
inputs.map(
|
|
17
|
+
getField<FieldRetailDef>(field, params, InputsMap),
|
|
18
|
+
);
|
|
@@ -2,9 +2,8 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
4
4
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
5
|
-
import { type
|
|
5
|
+
import { type SectionsRetailProps } from '../../model/InputSectionsType';
|
|
6
6
|
import type { LeadFormState } from '../../services/retail/model/LeadFormState';
|
|
7
|
-
import { type FieldRetailDef } from '../../services/retail/model/RetailFormContent';
|
|
8
7
|
import { calculateInputs } from '../../services/retail/utils/calculateInputs';
|
|
9
8
|
import { getFormValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
10
9
|
import { CreditFormStatusTracker } from './CreditFormStatusTracker';
|
|
@@ -29,7 +28,7 @@ export const CreditFormStep = JSX<CreditFormStepProps>(
|
|
|
29
28
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
30
29
|
|
|
31
30
|
const inputs = useMemo(
|
|
32
|
-
() =>
|
|
31
|
+
() => sections?.flatMap((_: SectionsRetailProps) => _?.inputs ?? []),
|
|
33
32
|
[sections],
|
|
34
33
|
);
|
|
35
34
|
|
|
@@ -11,4 +11,4 @@ export interface RenderInputsProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const renderInputs = ({ field, inputs, params }: RenderInputsProps) =>
|
|
14
|
-
inputs.map(getField(field, params, { ...InputsRetailMap }));
|
|
14
|
+
inputs.map(getField<FieldRetailDef>(field, params, { ...InputsRetailMap }));
|
|
@@ -148,6 +148,6 @@ export interface LeadFormState extends FormRetailConsents, FormStateDeliveryType
|
|
|
148
148
|
loanAmount?: number;
|
|
149
149
|
creditPeriod?: number;
|
|
150
150
|
paymentTypeCd?: PaymentType;
|
|
151
|
+
// TODO: Only fields with value should be in state. Currently, for compatibility, all fields from NameFieldDef are listed here
|
|
152
|
+
infoCard?: string;
|
|
151
153
|
}
|
|
152
|
-
|
|
153
|
-
export { type NameFieldDef } from '../../../ui-kit/FormField/NameFieldDef';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
type NameFieldApplicationBaseDef =
|
|
2
|
+
| 'surname'
|
|
3
|
+
| 'name'
|
|
4
|
+
| 'middleName'
|
|
5
|
+
| 'limitedBirthday'
|
|
6
|
+
| 'email'
|
|
7
|
+
| 'phone'
|
|
8
|
+
| 'inn';
|
|
9
|
+
|
|
10
|
+
type NameFieldConsentDef =
|
|
11
|
+
| 'processPersonalDataFlg'
|
|
12
|
+
| 'consentProviderFlg'
|
|
13
|
+
| 'consentInformFlg'
|
|
14
|
+
| 'consentPfrFlg'
|
|
15
|
+
| 'consentOthersFlg';
|
|
16
|
+
|
|
17
|
+
type NameFieldCreditCardDef =
|
|
18
|
+
| 'addressCourier'
|
|
19
|
+
| 'paymentSystem'
|
|
20
|
+
| 'currency'
|
|
21
|
+
| 'cardCategory'
|
|
22
|
+
| 'codeWord'
|
|
23
|
+
| 'confirmationIncome'
|
|
24
|
+
| 'methodObtain'
|
|
25
|
+
| 'deliveryDate';
|
|
26
|
+
|
|
27
|
+
type NameFieldRetailDef =
|
|
28
|
+
| 'organization'
|
|
29
|
+
| 'organizationAddress'
|
|
30
|
+
| 'organizationPhone'
|
|
31
|
+
| 'organizationName'
|
|
32
|
+
| 'legalForm'
|
|
33
|
+
| 'generalSeniority'
|
|
34
|
+
| 'lastJobExperience'
|
|
35
|
+
| 'experience5Years'
|
|
36
|
+
| 'jobsNumber'
|
|
37
|
+
| 'beginDate'
|
|
38
|
+
| 'addressFact'
|
|
39
|
+
| 'addressRegistration'
|
|
40
|
+
| 'addressRetail'
|
|
41
|
+
| 'addressMatch'
|
|
42
|
+
| 'sex'
|
|
43
|
+
| 'birthPlace'
|
|
44
|
+
| 'education'
|
|
45
|
+
| 'housing'
|
|
46
|
+
| 'amountWorkers'
|
|
47
|
+
| 'employment'
|
|
48
|
+
| 'employerActivities'
|
|
49
|
+
| 'employerOrganization'
|
|
50
|
+
| 'positionOrganization'
|
|
51
|
+
| 'familyStatus'
|
|
52
|
+
| 'familyMembers'
|
|
53
|
+
| 'children'
|
|
54
|
+
| 'dependents'
|
|
55
|
+
| 'totalIncome'
|
|
56
|
+
| 'expenses'
|
|
57
|
+
| 'snils'
|
|
58
|
+
| 'conscription'
|
|
59
|
+
| 'armyIdFlg'
|
|
60
|
+
| 'dulSerie'
|
|
61
|
+
| 'dulNumber'
|
|
62
|
+
| 'dulIssueDateField'
|
|
63
|
+
| 'dulSubdivisionCode'
|
|
64
|
+
| 'dulIssuedBy'
|
|
65
|
+
| 'participantDateRegistration'
|
|
66
|
+
| 'retirementIncome'
|
|
67
|
+
| 'rentalIncome'
|
|
68
|
+
| 'otherIncome'
|
|
69
|
+
| 'otherPayments'
|
|
70
|
+
| 'additionalIncome'
|
|
71
|
+
| 'wages'
|
|
72
|
+
| 'mandatoryPayments'
|
|
73
|
+
| 'disablePeopleFlg'
|
|
74
|
+
| 'bankruptcyFlg'
|
|
75
|
+
| 'shareholderFlg'
|
|
76
|
+
| 'legalEntityName'
|
|
77
|
+
| 'creditInRshbCd'
|
|
78
|
+
| 'bankEmployeeCode'
|
|
79
|
+
| 'partInBusiness'
|
|
80
|
+
| 'regionRetail'
|
|
81
|
+
| 'calculator'
|
|
82
|
+
| 'infoCard'
|
|
83
|
+
| 'comment';
|
|
84
|
+
|
|
85
|
+
export type NameFieldDef =
|
|
86
|
+
| NameFieldApplicationBaseDef
|
|
87
|
+
| NameFieldConsentDef
|
|
88
|
+
| NameFieldRetailDef
|
|
89
|
+
| NameFieldCreditCardDef;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type FieldDef } from '../../../components/ApplicationForm/ApplicationFormContent';
|
|
2
1
|
import { type Option } from '../../../ui-kit/Select/Option';
|
|
3
2
|
import { type LeadFormState } from '../model/LeadFormState';
|
|
4
3
|
import { type FieldRetailDef } from '../model/RetailFormContent';
|
|
@@ -28,24 +27,24 @@ export const calculateInputs = (getValue: GetValue) => (inputs: FieldRetailDef[]
|
|
|
28
27
|
const checkIsRetiree = (step: number, getValue: GetValue) =>
|
|
29
28
|
step === 2 && getValue('employment')?.key === 'RETIREE';
|
|
30
29
|
|
|
31
|
-
const checkBusinessOwner = ({ name }:
|
|
30
|
+
const checkBusinessOwner = ({ name }: FieldRetailDef, getValue: GetValue) =>
|
|
32
31
|
name === 'partInBusiness' && getValue('positionOrganization')?.key !== 'BUSINESS_OWNER';
|
|
33
32
|
|
|
34
|
-
const checkAddressFillFromESIA = ({ name, filledByEsia }:
|
|
33
|
+
const checkAddressFillFromESIA = ({ name, filledByEsia }: FieldRetailDef, getValue: GetValue) =>
|
|
35
34
|
name?.startsWith('address') && getValue('esiaAccountTypeCd')?.key && filledByEsia;
|
|
36
35
|
|
|
37
|
-
const checkAddressFact = ({ name }:
|
|
36
|
+
const checkAddressFact = ({ name }: FieldRetailDef, getValue: GetValue) =>
|
|
38
37
|
name === 'addressFact' && getValue('addressMatch');
|
|
39
38
|
|
|
40
|
-
export const checkCondition = ({ condition }:
|
|
39
|
+
export const checkCondition = ({ condition }: FieldRetailDef, getValue: GetValue) =>
|
|
41
40
|
condition?.name &&
|
|
42
41
|
condition?.values?.some((_) => {
|
|
43
|
-
const dataValue = getValue(condition?.name
|
|
42
|
+
const dataValue = getValue(condition?.name);
|
|
44
43
|
|
|
45
44
|
return _ !== ((dataValue as Option)?.key ?? dataValue);
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
const checkConsentPfrFlg = ({ name }:
|
|
47
|
+
const checkConsentPfrFlg = ({ name }: FieldRetailDef, getValue: GetValue) =>
|
|
49
48
|
name === 'snils' && isSnilsRequired(getValue);
|
|
50
49
|
|
|
51
50
|
const isSnilsRequired = (getValue: GetValue) =>
|
|
@@ -1,79 +1,3 @@
|
|
|
1
|
-
type NameFieldConsentDef =
|
|
2
|
-
| 'processPersonalDataFlg'
|
|
3
|
-
| 'consentProviderFlg'
|
|
4
|
-
| 'consentInformFlg'
|
|
5
|
-
| 'consentPfrFlg'
|
|
6
|
-
| 'consentOthersFlg';
|
|
7
|
-
|
|
8
|
-
type NameFieldCreditCardDef =
|
|
9
|
-
| 'addressCourier'
|
|
10
|
-
| 'paymentSystem'
|
|
11
|
-
| 'currency'
|
|
12
|
-
| 'cardCategory'
|
|
13
|
-
| 'codeWord'
|
|
14
|
-
| 'confirmationIncome'
|
|
15
|
-
| 'methodObtain'
|
|
16
|
-
| 'deliveryDate';
|
|
17
|
-
|
|
18
|
-
type NameFieldRetailDef =
|
|
19
|
-
| 'organization'
|
|
20
|
-
| 'organizationAddress'
|
|
21
|
-
| 'organizationPhone'
|
|
22
|
-
| 'organizationName'
|
|
23
|
-
| 'legalForm'
|
|
24
|
-
| 'generalSeniority'
|
|
25
|
-
| 'lastJobExperience'
|
|
26
|
-
| 'experience5Years'
|
|
27
|
-
| 'jobsNumber'
|
|
28
|
-
| 'beginDate'
|
|
29
|
-
| 'addressFact'
|
|
30
|
-
| 'addressRegistration'
|
|
31
|
-
| 'addressRetail'
|
|
32
|
-
| 'addressMatch'
|
|
33
|
-
| 'sex'
|
|
34
|
-
| 'limitedBirthday'
|
|
35
|
-
| 'birthPlace'
|
|
36
|
-
| 'education'
|
|
37
|
-
| 'housing'
|
|
38
|
-
| 'amountWorkers'
|
|
39
|
-
| 'employment'
|
|
40
|
-
| 'employerActivities'
|
|
41
|
-
| 'employerOrganization'
|
|
42
|
-
| 'positionOrganization'
|
|
43
|
-
| 'familyStatus'
|
|
44
|
-
| 'familyMembers'
|
|
45
|
-
| 'children'
|
|
46
|
-
| 'dependents'
|
|
47
|
-
| 'totalIncome'
|
|
48
|
-
| 'expenses'
|
|
49
|
-
| 'snils'
|
|
50
|
-
| 'conscription'
|
|
51
|
-
| 'armyIdFlg'
|
|
52
|
-
| 'dulSerie'
|
|
53
|
-
| 'dulNumber'
|
|
54
|
-
| 'dulIssueDateField'
|
|
55
|
-
| 'dulSubdivisionCode'
|
|
56
|
-
| 'dulIssuedBy'
|
|
57
|
-
| 'participantDateRegistration'
|
|
58
|
-
| 'retirementIncome'
|
|
59
|
-
| 'rentalIncome'
|
|
60
|
-
| 'otherIncome'
|
|
61
|
-
| 'otherPayments'
|
|
62
|
-
| 'additionalIncome'
|
|
63
|
-
| 'wages'
|
|
64
|
-
| 'mandatoryPayments'
|
|
65
|
-
| 'incomeAverage'
|
|
66
|
-
| 'disablePeopleFlg'
|
|
67
|
-
| 'bankruptcyFlg'
|
|
68
|
-
| 'shareholderFlg'
|
|
69
|
-
| 'legalEntityName'
|
|
70
|
-
| 'creditInRshbCd'
|
|
71
|
-
| 'bankEmployeeCode'
|
|
72
|
-
| 'partInBusiness'
|
|
73
|
-
| 'regionRetail'
|
|
74
|
-
| 'calculator'
|
|
75
|
-
| 'infoCard';
|
|
76
|
-
|
|
77
1
|
type NameFieldApplicationDef =
|
|
78
2
|
| 'surname'
|
|
79
3
|
| 'name'
|
|
@@ -110,8 +34,4 @@ type NameFieldApplicationDef =
|
|
|
110
34
|
| 'consentToReceiveMaterials'
|
|
111
35
|
| 'consentDataProcessing';
|
|
112
36
|
|
|
113
|
-
export type NameFieldDef =
|
|
114
|
-
| NameFieldApplicationDef
|
|
115
|
-
| NameFieldRetailDef
|
|
116
|
-
| NameFieldCreditCardDef
|
|
117
|
-
| NameFieldConsentDef;
|
|
37
|
+
export type NameFieldDef = NameFieldApplicationDef;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
//TODO: Убрать обращение к компонентам т.к. ApplicationForm
|
|
2
|
-
import { type FieldDef } from '../../components/ApplicationForm/ApplicationFormContent';
|
|
3
1
|
import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
|
|
4
2
|
import { type FormTypeFieldDef } from '../../model/FormTypeFieldDef';
|
|
5
3
|
import { type VNode } from '../../model/VNode';
|
|
6
4
|
import { InputControl } from '../Input/InputControl';
|
|
5
|
+
import { type BaseFieldDef } from './BaseFieldDef';
|
|
7
6
|
import { type CustomFieldProps } from './CustomFieldProps';
|
|
8
7
|
import { AcquiringField } from './Fields/AcquiringField';
|
|
9
8
|
import { AddressBranchField } from './Fields/AddressBranchField';
|
|
@@ -37,7 +36,7 @@ import { TermField } from './Fields/TermField';
|
|
|
37
36
|
import { UltraPremiumField } from './Fields/UltraPremiumField';
|
|
38
37
|
import { VedField } from './Fields/VedField';
|
|
39
38
|
import { getPremium } from './getPremium';
|
|
40
|
-
import {
|
|
39
|
+
import { shouldRenderField } from './shouldRenderField';
|
|
41
40
|
|
|
42
41
|
const PRODUCT_REF = {
|
|
43
42
|
$ref: '/wcms-resources/outservice-productlist.json',
|
|
@@ -86,18 +85,20 @@ const InputsMap = {
|
|
|
86
85
|
};
|
|
87
86
|
|
|
88
87
|
export const getField =
|
|
89
|
-
(
|
|
88
|
+
<F extends BaseFieldDef>(
|
|
90
89
|
field: FormFieldRegisterer<any>,
|
|
91
90
|
params?: Record<string, any>,
|
|
92
91
|
externalInputs: Record<string, VNode> = {},
|
|
93
92
|
) =>
|
|
94
|
-
(input:
|
|
95
|
-
const
|
|
93
|
+
(input: F, i: number) => {
|
|
94
|
+
const fieldsRegister = {
|
|
96
95
|
...InputsMap,
|
|
97
96
|
...externalInputs,
|
|
98
97
|
};
|
|
99
98
|
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
return (
|
|
100
|
+
shouldRenderField({ input, field }) && (
|
|
101
|
+
<div key={i}>{fieldsRegister[String(input.name)]?.({ field, input, params })}</div>
|
|
102
|
+
)
|
|
103
|
+
);
|
|
103
104
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type FieldDef } from '../../components/ApplicationForm/ApplicationFormContent';
|
|
2
1
|
import { type FieldValidatorsMap } from '../../hooks/useForm/FormOptions';
|
|
3
2
|
import { type Validator } from '../../validation/validator';
|
|
3
|
+
import { type BaseFieldDef } from './BaseFieldDef';
|
|
4
4
|
import {
|
|
5
5
|
addressDaDataValidator,
|
|
6
6
|
addressOrganizationValidator,
|
|
@@ -124,8 +124,8 @@ export const validatorObj: Record<string, Validator> = {
|
|
|
124
124
|
...validatorCreditCardObj,
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
export const getFormValidator = <FormState extends Record<string, any
|
|
128
|
-
fieldDefs:
|
|
127
|
+
export const getFormValidator = <FormState extends Record<string, any>, F extends BaseFieldDef>(
|
|
128
|
+
fieldDefs: F[],
|
|
129
129
|
): ((_: FormState) => FieldValidatorsMap<FormState>) => {
|
|
130
130
|
const requiredFields = fieldDefs.filter((_) => Boolean(_?.required && _?.name));
|
|
131
131
|
|
|
@@ -145,11 +145,11 @@ export const getFormValidator = <FormState extends Record<string, any>>(
|
|
|
145
145
|
: requiredFieldValidatorsMap;
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
-
const byNonEmptyValidator = ({ name }:
|
|
148
|
+
const byNonEmptyValidator = ({ name }: BaseFieldDef): boolean => Boolean(validatorObj[name ?? '']);
|
|
149
149
|
|
|
150
150
|
const byCondition =
|
|
151
151
|
<FormState extends Record<string, any>>(formState: FormState) =>
|
|
152
|
-
(fieldDef:
|
|
152
|
+
(fieldDef: BaseFieldDef) =>
|
|
153
153
|
!fieldDef?.condition ||
|
|
154
154
|
fieldDef.condition.values.find((_) => {
|
|
155
155
|
const dependencyValue = formState?.[fieldDef?.condition?.name ?? ''];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type FieldDef } from '../../components/ApplicationForm/ApplicationFormContent';
|
|
2
1
|
import { type FormFieldRegisterer } from '../../hooks/useForm/useForm';
|
|
2
|
+
import { type BaseFieldDef } from './BaseFieldDef';
|
|
3
3
|
|
|
4
|
-
export function
|
|
4
|
+
export function shouldRenderField<F extends BaseFieldDef>({
|
|
5
5
|
input,
|
|
6
6
|
field,
|
|
7
7
|
}: {
|
|
8
|
-
input:
|
|
8
|
+
input: F;
|
|
9
9
|
field: FormFieldRegisterer<any>;
|
|
10
10
|
}) {
|
|
11
11
|
const { condition } = input;
|
package/package.json
CHANGED
|
@@ -86,7 +86,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
86
86
|
className={style(inputColumnStyles(_.columns), 'grid gap-x-m')}
|
|
87
87
|
>
|
|
88
88
|
{renderTitle(_.title)}
|
|
89
|
-
{(_?.inputs || [])?.map(getField(field, { typeForm }))}
|
|
89
|
+
{(_?.inputs || [])?.map(getField<FieldDef>(field, { typeForm }))}
|
|
90
90
|
</div>
|
|
91
91
|
))}
|
|
92
92
|
{renderAgreementSubmit(
|
|
@@ -56,7 +56,7 @@ export const GroupedConsents = JSX<GroupedConsentsProps>(({ inputs = [], field,
|
|
|
56
56
|
<FoldableSection isUnfolded={isUnfolded} className="flex flex-col pl-2xl">
|
|
57
57
|
{
|
|
58
58
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
59
|
-
inputs.map(getField(field, {}, InputsConsentsMap))
|
|
59
|
+
inputs.map(getField<FieldRetailDef>(field, {}, { ...InputsConsentsMap }))
|
|
60
60
|
}
|
|
61
61
|
</FoldableSection>
|
|
62
62
|
)}
|