@redneckz/wildless-cms-uni-blocks 0.14.816 → 0.14.818

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.
Files changed (210) hide show
  1. package/bundle/bundle.umd.js +129 -122
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  4. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
  5. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
  6. package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  7. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  8. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
  9. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  10. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
  11. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  12. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
  13. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  14. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
  15. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  16. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
  17. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
  18. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  19. package/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  20. package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  21. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  22. package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  23. package/dist/retail/components/Fields/BeginDateField.js +2 -1
  24. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  25. package/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  26. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  27. package/dist/retail/components/Fields/DaDataInnField.js +2 -1
  28. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  29. package/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  30. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  31. package/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  32. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  33. package/dist/retail/components/Fields/JobsNumberField.js +2 -1
  34. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  35. package/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  36. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  37. package/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  38. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  39. package/dist/retail/components/Fields/WagesField.js +2 -1
  40. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  41. package/dist/retail/content.js +7 -10
  42. package/dist/retail/content.js.map +1 -1
  43. package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  44. package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  45. package/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  46. package/lib/common.css +1 -1
  47. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  48. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
  49. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  50. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
  51. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  52. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
  53. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  54. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
  55. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  56. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
  57. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
  58. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  59. package/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  60. package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  61. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  62. package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  63. package/lib/retail/components/Fields/BeginDateField.js +2 -1
  64. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  65. package/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  66. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  67. package/lib/retail/components/Fields/DaDataInnField.js +2 -1
  68. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  69. package/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  70. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  71. package/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  72. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  73. package/lib/retail/components/Fields/JobsNumberField.js +2 -1
  74. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  75. package/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  76. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  77. package/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  78. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  79. package/lib/retail/components/Fields/WagesField.js +2 -1
  80. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  81. package/lib/retail/content.js +7 -10
  82. package/lib/retail/content.js.map +1 -1
  83. package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  84. package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  85. package/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  86. package/mobile/bundle/bundle.umd.js +129 -122
  87. package/mobile/bundle/bundle.umd.min.js +1 -1
  88. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  89. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
  90. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
  91. package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  92. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  93. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
  94. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  95. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
  96. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  97. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
  98. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  99. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
  100. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  101. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
  102. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
  103. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  104. package/mobile/dist/components/GalleryLayout/GalleryLayout.js +18 -8
  105. package/mobile/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
  106. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  107. package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  108. package/mobile/dist/retail/components/Fields/BeginDateField.js +2 -1
  109. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  110. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  111. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  112. package/mobile/dist/retail/components/Fields/DaDataInnField.js +2 -1
  113. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  114. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  115. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  116. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  117. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  118. package/mobile/dist/retail/components/Fields/JobsNumberField.js +2 -1
  119. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  120. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  121. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  122. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  123. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  124. package/mobile/dist/retail/components/Fields/WagesField.js +2 -1
  125. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  126. package/mobile/dist/retail/content.js +7 -10
  127. package/mobile/dist/retail/content.js.map +1 -1
  128. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  129. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  130. package/mobile/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  131. package/mobile/lib/common.css +1 -1
  132. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  133. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
  134. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  135. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
  136. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  137. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
  138. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  139. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
  140. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  141. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
  142. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
  143. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  144. package/mobile/lib/components/GalleryLayout/GalleryLayout.js +18 -8
  145. package/mobile/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
  146. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
  147. package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
  148. package/mobile/lib/retail/components/Fields/BeginDateField.js +2 -1
  149. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  150. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  151. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  152. package/mobile/lib/retail/components/Fields/DaDataInnField.js +2 -1
  153. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  154. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  155. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  156. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  157. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  158. package/mobile/lib/retail/components/Fields/JobsNumberField.js +2 -1
  159. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  160. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  161. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  162. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  163. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  164. package/mobile/lib/retail/components/Fields/WagesField.js +2 -1
  165. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  166. package/mobile/lib/retail/content.js +7 -10
  167. package/mobile/lib/retail/content.js.map +1 -1
  168. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
  169. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
  170. package/mobile/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
  171. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +24 -15
  172. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -1
  173. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +71 -80
  174. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +0 -1
  175. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -14
  176. package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  177. package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -2
  178. package/mobile/src/retail/components/Fields/BeginDateField.tsx +2 -0
  179. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  180. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  181. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  182. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  183. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  184. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  185. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  186. package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
  187. package/mobile/src/retail/content.tsx +7 -10
  188. package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  189. package/mobile/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
  190. package/package.json +1 -1
  191. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +24 -15
  192. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -1
  193. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +71 -80
  194. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +0 -1
  195. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -14
  196. package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +4 -15
  197. package/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
  198. package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -2
  199. package/src/retail/components/Fields/BeginDateField.tsx +2 -0
  200. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  201. package/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  202. package/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  203. package/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  204. package/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  205. package/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  206. package/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  207. package/src/retail/components/Fields/WagesField.tsx +2 -0
  208. package/src/retail/content.tsx +7 -10
  209. package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
  210. package/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
@@ -1,9 +1,9 @@
1
1
  import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
2
- import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
3
2
  import { useSetter } from '../../hooks/useSetter';
4
3
  import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
5
4
  import { type LeadFormState } from '../../retail/model/LeadFormState';
6
5
  import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
6
+ import { EsiaStatuses } from './ApplicationLeadForm';
7
7
  import { type ProductType } from './ApplicationLeadFormContent';
8
8
  import { getInitialFormState } from './getInitialFormState';
9
9
  import { parseEsiaProfile } from './parseEsiaProfile';
@@ -13,20 +13,16 @@ type InitApplicationLeadProps = {
13
13
  inputs: FieldRetailDef[];
14
14
  nextStepLink: string;
15
15
  productType: ProductType;
16
- setEsiaError: () => void;
17
- setEsiaAuthSuccess: () => void;
16
+ setEsiaStatus: (status: EsiaStatuses) => void;
18
17
  esiaAuthSuccess: boolean;
19
18
  };
20
19
 
21
20
  export const useInitApplicationLead = ({
22
21
  inputs,
23
22
  productType,
24
- setEsiaError,
25
- setEsiaAuthSuccess,
23
+ setEsiaStatus,
26
24
  esiaAuthSuccess,
27
- }: InitApplicationLeadProps): [LeadFormState, { isLoading: boolean }] => {
28
- const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
29
-
25
+ }: InitApplicationLeadProps): LeadFormState => {
30
26
  const leadFormStore = useLeadFormStore();
31
27
  const saveForm = useSetter(leadFormStore, 'leadForm');
32
28
 
@@ -36,7 +32,7 @@ export const useInitApplicationLead = ({
36
32
  );
37
33
 
38
34
  const requestEsiaProfile = useCallback(async (code: string, state: string) => {
39
- startLoading();
35
+ setEsiaStatus(EsiaStatuses.Pending);
40
36
  try {
41
37
  const data = await esiaRequestProfile({
42
38
  code,
@@ -52,12 +48,10 @@ export const useInitApplicationLead = ({
52
48
  ..._,
53
49
  ...parsedData,
54
50
  }));
55
- setEsiaAuthSuccess();
51
+ setEsiaStatus(EsiaStatuses.Success);
56
52
  }
57
53
  } catch {
58
- setEsiaError();
59
- } finally {
60
- endLoading();
54
+ setEsiaStatus(EsiaStatuses.Error);
61
55
  }
62
56
  }, []);
63
57
 
@@ -76,5 +70,5 @@ export const useInitApplicationLead = ({
76
70
  }
77
71
  }, []);
78
72
 
79
- return [initialFormState, { isLoading }];
73
+ return initialFormState;
80
74
  };
@@ -33,7 +33,7 @@ const LINK_SCHEMA: Record<string, JSONSchema7Definition> = {
33
33
  },
34
34
  },
35
35
  ],
36
- title: 'Ссылка',
36
+ title: 'Ссылка (если заполнено, то кнопка скрывается)',
37
37
  required: ['href'],
38
38
  },
39
39
  };
@@ -109,15 +109,18 @@ const blockDecoratorWrapper =
109
109
 
110
110
  const productBlockDecorator =
111
111
  (idx: number): BlockDecorator =>
112
- ({ blockClassName, block, render }, i) =>
113
- (
114
- <LinkWrapper key={i} {...block.content?.link} className={getChildStyle(idx)}>
112
+ ({ blockClassName, block, render }, i) => {
113
+ const modifiedBlock = modifyBlock(block, idx);
114
+
115
+ return (
116
+ <LinkWrapper key={String(i)} {...modifiedBlock.content?.link} className={getChildStyle(idx)}>
115
117
  {render({
116
118
  blockClassName: style(blockClassName, 'h-full'),
117
- block: modifyBlock(block, idx),
119
+ block: modifiedBlock,
118
120
  })}
119
121
  </LinkWrapper>
120
122
  );
123
+ };
121
124
 
122
125
  const getChildStyle = (index: number) =>
123
126
  SHORT_TILE_INDEXES.includes(index)
@@ -127,13 +130,21 @@ const getChildStyle = (index: number) =>
127
130
  const modifyBlock = (block: BlockDef, i: number) => {
128
131
  const content: ProductBlockContent & { link?: LinkProps } = { ...block.content };
129
132
 
130
- if (SHORT_TILE_INDEXES.includes(i)) {
133
+ const isSmallTile = SHORT_TILE_INDEXES.includes(i);
134
+
135
+ if (isSmallTile) {
131
136
  delete content.description;
132
137
  delete content.benefits;
133
- }
134
138
 
135
- if (content.link?.href) {
136
- delete content.buttons;
139
+ if (content.link?.href) {
140
+ delete content.buttons;
141
+ }
142
+
143
+ content.imageOptions = { ...content.imageOptions, className: 'max-w-max !h-auto' };
144
+ } else {
145
+ if ((content.buttons ?? []).length) {
146
+ delete content.link;
147
+ }
137
148
  }
138
149
 
139
150
  return { ...block, content };
@@ -19,13 +19,12 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
19
19
  snils,
20
20
  armyIdFlg,
21
21
  conscription,
22
- esiaAccountTypeCd,
23
22
  } = formData;
24
23
 
25
24
  return {
26
25
  maritalStatusCd: familyStatus,
27
26
  totalDependents: familyMembers,
28
- incomeCertificateCd: esiaAccountTypeCd?.key ? { key: 'SFR_CERTIFICATE' } : confirmationIncome,
27
+ incomeCertificateCd: confirmationIncome,
29
28
  otherDependents: dependents,
30
29
  childrenDependents: children,
31
30
  militaryStatusCd: conscription,
@@ -1,11 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { DatePickerControl } from '../../../ui-kit/DatePicker/DatePickerControl';
3
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
4
5
 
5
6
  export const BeginDateField = JSX<CustomFieldProps>(({ field, input }) => (
6
7
  <DatePickerControl
7
8
  label="Дата начала работы на текущем месте"
8
9
  {...field(input?.name ?? '')}
9
10
  {...input}
11
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
10
12
  />
11
13
  ));
@@ -1,18 +1,29 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { InfoCard } from '../../../ui-kit/InfoCard/InfoCard';
3
4
  import { useLeadFormData } from '../../hooks/useLeadFormData';
5
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
4
6
  import { SelectField } from './SelectField';
5
7
 
6
8
  export const ConfirmationIncomeField = JSX<CustomFieldProps>(({ field, input }) => {
7
9
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
10
+ const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
8
11
 
9
12
  return (
10
- <SelectField
11
- field={field}
12
- source={confirmationIncome}
13
- label="Способ подтверждения дохода"
14
- fieldName="confirmationIncome"
15
- input={input}
16
- />
13
+ <div>
14
+ {filledByEsia ? (
15
+ <div className="mb-6">
16
+ <InfoCard __html="Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги" />
17
+ </div>
18
+ ) : null}
19
+ <SelectField
20
+ field={field}
21
+ source={confirmationIncome}
22
+ label="Способ подтверждения дохода"
23
+ fieldName="confirmationIncome"
24
+ input={input}
25
+ disabled={filledByEsia}
26
+ />
27
+ </div>
17
28
  );
18
29
  });
@@ -4,6 +4,7 @@ import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProp
4
4
  import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
5
5
  import { getOrganizationFromInn } from '../../api/getOrganizationFromInn';
6
6
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
7
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
7
8
  import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
8
9
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
9
10
 
@@ -41,6 +42,7 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
41
42
  {...input}
42
43
  {...field(input?.name ?? '')}
43
44
  onDaDataChange={onDaDataChange}
45
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
44
46
  />
45
47
  );
46
48
  });
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
4
  import { clamp } from '../../../utils/clamp';
5
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
5
6
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
6
7
 
7
8
  const MAX_YEARS = 5;
@@ -22,6 +23,7 @@ export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) =>
22
23
  {...field(input?.name ?? '')}
23
24
  {...input}
24
25
  onChange={onChange}
26
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
25
27
  />
26
28
  );
27
29
  });
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -10,5 +11,6 @@ export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) =>
10
11
  placeholder="Количество лет"
11
12
  {...field(input?.name ?? '')}
12
13
  {...input}
14
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
13
15
  />
14
16
  ));
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -10,5 +11,6 @@ export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
10
11
  maxLength={2}
11
12
  {...field(input?.name ?? '')}
12
13
  {...input}
14
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
13
15
  />
14
16
  ));
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -10,5 +11,6 @@ export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) =
10
11
  maxLength={2}
11
12
  {...field(input?.name ?? '')}
12
13
  {...input}
14
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
13
15
  />
14
16
  ));
@@ -3,6 +3,7 @@ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
4
4
  import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
5
5
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
6
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
6
7
  import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
7
8
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
8
9
 
@@ -19,6 +20,7 @@ export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) =>
19
20
  label="Наименование организации"
20
21
  {...input}
21
22
  {...field(input?.name ?? '')}
23
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
22
24
  onDaDataChange={onDaDataChange}
23
25
  />
24
26
  );
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
3
+ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
3
4
  import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
4
5
 
5
6
  export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
@@ -9,5 +10,6 @@ export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
9
10
  isInteger={true}
10
11
  {...field(input?.name ?? '')}
11
12
  {...input}
13
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
12
14
  />
13
15
  ));
@@ -139,7 +139,7 @@ const EMPLOYMENT_CONTENT: CreditCardSectionsProps[] = [
139
139
  label: 'Телефон работодателя',
140
140
  required: true,
141
141
  },
142
- { name: 'beginDate', required: true },
142
+ { name: 'beginDate', required: true, filledByEsia: true },
143
143
  ],
144
144
  },
145
145
  {
@@ -181,23 +181,20 @@ const FAMILY_STATUS_AND_INCOME_CONTENT: CreditCardSectionsProps[] = [
181
181
  title: 'Совокупный доход',
182
182
  },
183
183
  {
184
+ columns: 1,
184
185
  inputs: [
185
186
  {
186
- name: 'infoCard',
187
- label: 'Сумма основного и дополнительных доходов после вычета налога',
187
+ name: 'confirmationIncome',
188
+ required: true,
189
+ filledByEsia: true,
188
190
  },
189
191
  ],
190
192
  },
191
193
  {
192
- columns: 1,
193
194
  inputs: [
194
195
  {
195
- name: 'confirmationIncome',
196
- required: true,
197
- condition: {
198
- name: 'esiaAccountTypeCd',
199
- values: [''],
200
- },
196
+ name: 'infoCard',
197
+ label: 'Сумма основного и дополнительных доходов после вычета налога',
201
198
  },
202
199
  ],
203
200
  },
@@ -54,12 +54,13 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
54
54
  directionRight = true,
55
55
  isImageAlwaysOnRight,
56
56
  isImageSecondary = false,
57
+ className: imageClassName,
57
58
  } = {},
58
59
  backwardButton,
59
60
  children,
60
61
  ...rest
61
62
  }) => {
62
- const img = image?.src ? <Img image={image} /> : null;
63
+ const img = image?.src ? <Img image={image} imageClassName={imageClassName} /> : null;
63
64
  const headline = (
64
65
  <Headline
65
66
  title={title}
@@ -19,6 +19,8 @@ export interface TileImageOptions {
19
19
  isImageSecondary?: boolean;
20
20
  /** @title Изображение всегда справа */
21
21
  isImageAlwaysOnRight?: boolean;
22
+ /** @hidden */
23
+ className?: string;
22
24
  }
23
25
 
24
26
  /** @title Цены */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.816",
3
+ "version": "0.14.818",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable max-lines-per-function */
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
- import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
4
- import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
3
+ import { useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
5
4
  import { useForm } from '../../hooks/useForm/useForm';
6
5
  import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
7
6
  import { validatorObj } from '../../retail/validator/validatorObj';
@@ -25,6 +24,12 @@ import { useInitApplicationLead } from './useInitApplicationLead';
25
24
 
26
25
  interface ApplicationLeadFormProps extends ApplicationLeadFormContent, UniBlockProps {}
27
26
 
27
+ export enum EsiaStatuses {
28
+ Success = 'SUCCESS',
29
+ Error = 'ERROR',
30
+ Pending = 'PENDING',
31
+ }
32
+
28
33
  export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
29
34
  ({
30
35
  className,
@@ -36,8 +41,8 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
36
41
  data,
37
42
  ...rest
38
43
  }) => {
39
- const [esiaError, { setTrue: setEsiaError }] = useBool(false);
40
- const [esiaAuthSuccess, { setTrue: setEsiaAuthSuccess }] = useBool(false);
44
+ const [esiaStatus, setEsiaStatus] = useState<EsiaStatuses>();
45
+ const leadForm = useRef<HTMLFormElement | null>(null);
41
46
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
42
47
  const inputs = useMemo(
43
48
  () => (applicationFormData?.flatMap((_) => _?.inputs) || []) as FieldRetailDef[],
@@ -46,19 +51,17 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
46
51
 
47
52
  const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
48
53
 
49
- const [initialFormState, { isLoading }] = useInitApplicationLead({
54
+ const initialFormState = useInitApplicationLead({
50
55
  inputs,
51
56
  nextStepLink,
52
57
  productType,
53
- setEsiaError,
54
- setEsiaAuthSuccess,
55
- esiaAuthSuccess,
58
+ setEsiaStatus,
59
+ esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
56
60
  });
57
61
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
58
62
  programId,
59
63
  nextStepLink,
60
64
  productType,
61
- esiaAuthSuccess,
62
65
  data,
63
66
  });
64
67
 
@@ -75,10 +78,16 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
75
78
  }, [ok]);
76
79
 
77
80
  useEffect(() => {
78
- if (initialFormState?.esiaAccountTypeCd) {
81
+ if (esiaStatus && leadForm?.current) {
82
+ leadForm.current.scrollIntoView({
83
+ block: 'start',
84
+ });
85
+ }
86
+
87
+ if (esiaStatus === EsiaStatuses.Success) {
79
88
  reset();
80
89
  }
81
- }, [initialFormState]);
90
+ }, [leadForm?.current, esiaStatus]);
82
91
 
83
92
  return (
84
93
  <ApplicationFormLayout
@@ -86,9 +95,9 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
86
95
  title={title}
87
96
  {...rest}
88
97
  >
89
- {!esiaAuthSuccess && !esiaError ? <EsiaLoginBanner /> : null}
90
- <form onSubmit={onSubmit} className="space-y-m relative">
91
- {isLoading ? <Loader blur={false} /> : null}
98
+ {!esiaStatus ? <EsiaLoginBanner /> : null}
99
+ <form onSubmit={onSubmit} className="space-y-m relative" ref={leadForm}>
100
+ {esiaStatus === EsiaStatuses.Pending ? <Loader blur={false} /> : null}
92
101
  {applicationFormData.map((_, i) => (
93
102
  <div
94
103
  key={`section-${i}`}
@@ -99,7 +108,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
99
108
  </div>
100
109
  ))}
101
110
  {renderSubmitButton(button, isSending)}
102
- {esiaError ? (
111
+ {esiaStatus === EsiaStatuses.Error ? (
103
112
  <Text size="text-m" font="font-medium" color="text-error">
104
113
  Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля
105
114
  вручную.
@@ -19,7 +19,6 @@ export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(() => {
19
19
 
20
20
  if (resp?.link) {
21
21
  navigator.assign(resp.link);
22
- globalThis.location.href = resp.link;
23
22
  }
24
23
  }, []);
25
24