@redneckz/wildless-cms-uni-blocks 0.14.677 → 0.14.678

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 (244) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +61 -50
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/renderInputs.d.ts +1 -5
  5. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  6. package/bundle/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
  7. package/bundle/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
  8. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  9. package/bundle/ui-kit/FormField/getField.d.ts +1 -1
  10. package/bundle/ui-kit/FormField/validators.d.ts +1 -0
  11. package/dist/components/ApplicationForm/renderInputs.d.ts +1 -5
  12. package/dist/components/ApplicationForm/renderInputs.js +2 -2
  13. package/dist/components/ApplicationForm/renderInputs.js.map +1 -1
  14. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  15. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  16. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  17. package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  18. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  19. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
  20. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  21. package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
  22. package/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  23. package/dist/components/CreditCardForm/creditCardFormStepsData.js +1 -1
  24. package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  25. package/dist/components/CreditCardForm/formStateMap.js +1 -1
  26. package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  27. package/dist/components/CreditCardForm/getInitialFormState.js +1 -1
  28. package/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
  29. package/dist/components/CreditCardForm/getSecondStepData.js +2 -2
  30. package/dist/components/CreditCardForm/getSecondStepData.js.map +1 -1
  31. package/dist/components/CreditForm/creditFormStepsData.js +1 -1
  32. package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  33. package/dist/components/CreditForm/formStateMap.js +1 -1
  34. package/dist/components/CreditForm/formStateMap.js.map +1 -1
  35. package/dist/components/CreditForm/getFirstStepData.js +2 -2
  36. package/dist/components/CreditForm/getFirstStepData.js.map +1 -1
  37. package/dist/components/CreditForm/getInitialFormState.js +1 -1
  38. package/dist/components/CreditForm/getInitialFormState.js.map +1 -1
  39. package/dist/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
  40. package/dist/ui-kit/FormField/Fields/BirthdayField.js +1 -18
  41. package/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  42. package/dist/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
  43. package/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js +11 -0
  44. package/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
  45. package/dist/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
  46. package/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
  47. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  48. package/dist/ui-kit/FormField/getField.d.ts +1 -1
  49. package/dist/ui-kit/FormField/getField.js +4 -2
  50. package/dist/ui-kit/FormField/getField.js.map +1 -1
  51. package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
  52. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  53. package/dist/ui-kit/FormField/validators.d.ts +1 -0
  54. package/dist/ui-kit/FormField/validators.js +15 -1
  55. package/dist/ui-kit/FormField/validators.js.map +1 -1
  56. package/lib/components/ApplicationForm/renderInputs.d.ts +1 -5
  57. package/lib/components/ApplicationForm/renderInputs.js +2 -2
  58. package/lib/components/ApplicationForm/renderInputs.js.map +1 -1
  59. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  60. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  61. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  62. package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  63. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  64. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
  65. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  66. package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
  67. package/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  68. package/lib/components/CreditCardForm/creditCardFormStepsData.js +1 -1
  69. package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  70. package/lib/components/CreditCardForm/formStateMap.js +1 -1
  71. package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  72. package/lib/components/CreditCardForm/getInitialFormState.js +1 -1
  73. package/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
  74. package/lib/components/CreditCardForm/getSecondStepData.js +2 -2
  75. package/lib/components/CreditCardForm/getSecondStepData.js.map +1 -1
  76. package/lib/components/CreditForm/creditFormStepsData.js +1 -1
  77. package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  78. package/lib/components/CreditForm/formStateMap.js +1 -1
  79. package/lib/components/CreditForm/formStateMap.js.map +1 -1
  80. package/lib/components/CreditForm/getFirstStepData.js +2 -2
  81. package/lib/components/CreditForm/getFirstStepData.js.map +1 -1
  82. package/lib/components/CreditForm/getInitialFormState.js +1 -1
  83. package/lib/components/CreditForm/getInitialFormState.js.map +1 -1
  84. package/lib/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
  85. package/lib/ui-kit/FormField/Fields/BirthdayField.js +1 -18
  86. package/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  87. package/lib/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
  88. package/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js +9 -0
  89. package/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
  90. package/lib/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
  91. package/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
  92. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  93. package/lib/ui-kit/FormField/getField.d.ts +1 -1
  94. package/lib/ui-kit/FormField/getField.js +4 -2
  95. package/lib/ui-kit/FormField/getField.js.map +1 -1
  96. package/lib/ui-kit/FormField/getObjectValidator.js +2 -1
  97. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  98. package/lib/ui-kit/FormField/validators.d.ts +1 -0
  99. package/lib/ui-kit/FormField/validators.js +13 -0
  100. package/lib/ui-kit/FormField/validators.js.map +1 -1
  101. package/mobile/bundle/bundle.umd.js +61 -50
  102. package/mobile/bundle/bundle.umd.min.js +1 -1
  103. package/mobile/bundle/components/ApplicationForm/renderInputs.d.ts +1 -5
  104. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  105. package/mobile/bundle/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
  106. package/mobile/bundle/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
  107. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  108. package/mobile/bundle/ui-kit/FormField/getField.d.ts +1 -1
  109. package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
  110. package/mobile/dist/components/ApplicationForm/renderInputs.d.ts +1 -5
  111. package/mobile/dist/components/ApplicationForm/renderInputs.js +2 -2
  112. package/mobile/dist/components/ApplicationForm/renderInputs.js.map +1 -1
  113. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  114. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  115. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  116. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  117. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  118. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
  119. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  120. package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
  121. package/mobile/dist/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  122. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +1 -1
  123. package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  124. package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
  125. package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
  126. package/mobile/dist/components/CreditCardForm/getInitialFormState.js +1 -1
  127. package/mobile/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
  128. package/mobile/dist/components/CreditCardForm/getSecondStepData.js +2 -2
  129. package/mobile/dist/components/CreditCardForm/getSecondStepData.js.map +1 -1
  130. package/mobile/dist/components/CreditForm/creditFormStepsData.js +1 -1
  131. package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
  132. package/mobile/dist/components/CreditForm/formStateMap.js +1 -1
  133. package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
  134. package/mobile/dist/components/CreditForm/getFirstStepData.js +2 -2
  135. package/mobile/dist/components/CreditForm/getFirstStepData.js.map +1 -1
  136. package/mobile/dist/components/CreditForm/getInitialFormState.js +1 -1
  137. package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -1
  138. package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
  139. package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js +1 -18
  140. package/mobile/dist/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  141. package/mobile/dist/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
  142. package/mobile/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js +11 -0
  143. package/mobile/dist/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
  144. package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
  145. package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
  146. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  147. package/mobile/dist/ui-kit/FormField/getField.d.ts +1 -1
  148. package/mobile/dist/ui-kit/FormField/getField.js +4 -2
  149. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  150. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
  151. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  152. package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
  153. package/mobile/dist/ui-kit/FormField/validators.js +15 -1
  154. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  155. package/mobile/lib/components/ApplicationForm/renderInputs.d.ts +1 -5
  156. package/mobile/lib/components/ApplicationForm/renderInputs.js +2 -2
  157. package/mobile/lib/components/ApplicationForm/renderInputs.js.map +1 -1
  158. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  159. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  160. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
  161. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -1
  162. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  163. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -2
  164. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  165. package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js +1 -1
  166. package/mobile/lib/components/ApplicationLeadForm/pasreEsiaProfile.js.map +1 -1
  167. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +1 -1
  168. package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
  169. package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
  170. package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
  171. package/mobile/lib/components/CreditCardForm/getInitialFormState.js +1 -1
  172. package/mobile/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
  173. package/mobile/lib/components/CreditCardForm/getSecondStepData.js +2 -2
  174. package/mobile/lib/components/CreditCardForm/getSecondStepData.js.map +1 -1
  175. package/mobile/lib/components/CreditForm/creditFormStepsData.js +1 -1
  176. package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
  177. package/mobile/lib/components/CreditForm/formStateMap.js +1 -1
  178. package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
  179. package/mobile/lib/components/CreditForm/getFirstStepData.js +2 -2
  180. package/mobile/lib/components/CreditForm/getFirstStepData.js.map +1 -1
  181. package/mobile/lib/components/CreditForm/getInitialFormState.js +1 -1
  182. package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -1
  183. package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.d.ts +1 -5
  184. package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js +1 -18
  185. package/mobile/lib/ui-kit/FormField/Fields/BirthdayField.js.map +1 -1
  186. package/mobile/lib/ui-kit/FormField/Fields/LimitedBirthdayField.d.ts +2 -0
  187. package/mobile/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js +9 -0
  188. package/mobile/lib/ui-kit/FormField/Fields/LimitedBirthdayField.js.map +1 -0
  189. package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js +10 -1
  190. package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
  191. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  192. package/mobile/lib/ui-kit/FormField/getField.d.ts +1 -1
  193. package/mobile/lib/ui-kit/FormField/getField.js +4 -2
  194. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  195. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +2 -1
  196. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  197. package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
  198. package/mobile/lib/ui-kit/FormField/validators.js +13 -0
  199. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  200. package/mobile/src/components/ApplicationForm/renderInputs.tsx +3 -12
  201. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +1 -1
  202. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
  203. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -1
  204. package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +2 -2
  205. package/mobile/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +1 -1
  206. package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +1 -1
  207. package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
  208. package/mobile/src/components/CreditCardForm/getInitialFormState.tsx +1 -1
  209. package/mobile/src/components/CreditCardForm/getSecondStepData.tsx +2 -2
  210. package/mobile/src/components/CreditForm/creditFormStepsData.tsx +1 -1
  211. package/mobile/src/components/CreditForm/formStateMap.tsx +1 -1
  212. package/mobile/src/components/CreditForm/getFirstStepData.tsx +2 -2
  213. package/mobile/src/components/CreditForm/getInitialFormState.tsx +1 -1
  214. package/mobile/src/ui-kit/FormField/Fields/BirthdayField.tsx +6 -36
  215. package/mobile/src/ui-kit/FormField/Fields/LimitedBirthdayField.tsx +16 -0
  216. package/mobile/src/ui-kit/FormField/Fields/MiddleNameField.tsx +22 -9
  217. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +1 -0
  218. package/mobile/src/ui-kit/FormField/getField.tsx +4 -3
  219. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
  220. package/mobile/src/ui-kit/FormField/validators.ts +19 -0
  221. package/package.json +1 -1
  222. package/src/components/ApplicationForm/renderInputs.tsx +3 -12
  223. package/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +1 -1
  224. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +1 -1
  225. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +1 -1
  226. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +1 -1
  227. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +3 -1
  228. package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +2 -2
  229. package/src/components/ApplicationLeadForm/pasreEsiaProfile.ts +1 -1
  230. package/src/components/CreditCardForm/creditCardFormStepsData.tsx +1 -1
  231. package/src/components/CreditCardForm/formStateMap.tsx +1 -1
  232. package/src/components/CreditCardForm/getInitialFormState.tsx +1 -1
  233. package/src/components/CreditCardForm/getSecondStepData.tsx +2 -2
  234. package/src/components/CreditForm/creditFormStepsData.tsx +1 -1
  235. package/src/components/CreditForm/formStateMap.tsx +1 -1
  236. package/src/components/CreditForm/getFirstStepData.tsx +2 -2
  237. package/src/components/CreditForm/getInitialFormState.tsx +1 -1
  238. package/src/ui-kit/FormField/Fields/BirthdayField.tsx +6 -36
  239. package/src/ui-kit/FormField/Fields/LimitedBirthdayField.tsx +16 -0
  240. package/src/ui-kit/FormField/Fields/MiddleNameField.tsx +22 -9
  241. package/src/ui-kit/FormField/NameFieldDef.ts +1 -0
  242. package/src/ui-kit/FormField/getField.tsx +4 -3
  243. package/src/ui-kit/FormField/getObjectValidator.tsx +2 -0
  244. package/src/ui-kit/FormField/validators.ts +19 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.677",
3
+ "version": "0.14.678",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -6,25 +6,16 @@ import type {
6
6
  import { CONSENTS } from '../ApplicationLeadForm/consents';
7
7
  import { GroupedConsents } from '../ApplicationLeadForm/GroupedConsents';
8
8
 
9
- type RenderInputsProps = GroupedConsentsProps & {
10
- isRetailForm?: boolean;
11
- };
12
-
13
- export const renderInputs = ({
14
- field,
15
- typeForm = '',
16
- inputs,
17
- isRetailForm = false,
18
- }: RenderInputsProps) => {
9
+ export const renderInputs = ({ field, typeForm = '', inputs }: GroupedConsentsProps) => {
19
10
  const { consentInputs, restInputs } = splitInputs(inputs || []);
20
11
 
21
12
  return consentInputs.length > 2 ? (
22
13
  <div>
23
- {restInputs.map(getField(field, typeForm, isRetailForm))}
14
+ {restInputs.map(getField(field, typeForm))}
24
15
  <GroupedConsents inputs={consentInputs} field={field} />
25
16
  </div>
26
17
  ) : (
27
- (inputs || [])?.map(getField(field, typeForm, isRetailForm))
18
+ (inputs || [])?.map(getField(field, typeForm))
28
19
  );
29
20
  };
30
21
 
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "fieldType": "common",
31
- "name": "birthday",
31
+ "name": "limitedBirthday",
32
32
  "required": true
33
33
  },
34
34
  {
@@ -22,7 +22,7 @@ export default {
22
22
  { fieldType: 'common', name: 'surname', required: true },
23
23
  { fieldType: 'common', name: 'name', required: true },
24
24
  { fieldType: 'common', name: 'middleName' },
25
- { fieldType: 'common', name: 'birthday', required: true },
25
+ { fieldType: 'common', name: 'limitedBirthday', required: true },
26
26
  { fieldType: 'common', name: 'phone', required: true },
27
27
  { fieldType: 'common', name: 'email', required: true },
28
28
  ],
@@ -24,7 +24,7 @@ export default {
24
24
  { fieldType: 'common', name: 'surname', required: true, dadata: true },
25
25
  { fieldType: 'common', name: 'name', required: true, dadata: true },
26
26
  { fieldType: 'common', name: 'middleName', dadata: true },
27
- { fieldType: 'common', name: 'birthday', required: true },
27
+ { fieldType: 'common', name: 'limitedBirthday', required: true },
28
28
  { fieldType: 'common', name: 'phone', required: true },
29
29
  { fieldType: 'common', name: 'email', required: true, dadata: true },
30
30
  ],
@@ -69,7 +69,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
69
69
  className={style(inputColumnStyles(_.columns), 'grid gap-x-m')}
70
70
  >
71
71
  {renderTitle(_.title)}
72
- {renderInputs({ field, inputs: _?.inputs, isRetailForm: true })}
72
+ {renderInputs({ field, inputs: _?.inputs })}
73
73
  </div>
74
74
  ))}
75
75
  {renderSubmitButton(button)}
@@ -56,6 +56,7 @@ export interface FormState extends FormConsents, FormStateDeliveryType {
56
56
  fullName?: string;
57
57
  registrationDate?: Date | string;
58
58
  birthday?: Date | string;
59
+ limitedBirthday?: Date | string;
59
60
  birthPlace?: string;
60
61
  sex?: string;
61
62
  phone?: string;
@@ -173,6 +174,7 @@ const initialFormState = {
173
174
  serviceDirection: SERVICE_DIRECTIONS[0],
174
175
  vedTypes: VED_TYPES[0],
175
176
  birthday: undefined,
177
+ limitedBirthday: undefined,
176
178
  isClient: false,
177
179
  onlineCheckout: false,
178
180
  posTerminal: false,
@@ -198,7 +200,7 @@ export const getInitialFormState = (
198
200
  ): FormState => {
199
201
  if (savedForm) {
200
202
  const formStateCopy = { ...savedForm };
201
- formStateCopy.birthday = new Date(formStateCopy?.birthday || 0);
203
+ formStateCopy.limitedBirthday = new Date(formStateCopy?.limitedBirthday || 0);
202
204
 
203
205
  return formStateCopy;
204
206
  }
@@ -17,7 +17,7 @@ export const getLeadFormTaskData = ({
17
17
  profileId,
18
18
  formData,
19
19
  }: getLeadFormTaskDataProps): UpdateUserTaskBody => {
20
- const { name, surname, middleName, birthday, phone, email } = formData;
20
+ const { name, surname, middleName, limitedBirthday, phone, email } = formData;
21
21
 
22
22
  return {
23
23
  sendToBank: true,
@@ -27,7 +27,7 @@ export const getLeadFormTaskData = ({
27
27
  id: taskId,
28
28
  participants: [
29
29
  {
30
- birthDate: birthday && formatDate(birthday, true),
30
+ birthDate: limitedBirthday && formatDate(limitedBirthday, true),
31
31
  id: participantId,
32
32
  midname: middleName,
33
33
  name,
@@ -9,7 +9,7 @@ export const parseEsiaProfile = (esiaProfile: UpdateProfileEsiaResponse): FormSt
9
9
  name: profile?.name,
10
10
  surname: profile?.surname,
11
11
  middleName: profile?.midname,
12
- birthday: profile?.birthDate,
12
+ limitedBirthday: profile?.birthDate,
13
13
  phone: normalizePhone(profile?.phone),
14
14
  email: profile?.email,
15
15
  dulIssueDateField: document?.dulIssueDate,
@@ -33,7 +33,7 @@ export const stepsSectionsMap: CreditCardSectionsProps[][] = [
33
33
  { fieldType: 'common', name: 'name', required: true, dadata: true, filledByEsia: true },
34
34
  { fieldType: 'common', name: 'middleName', dadata: true, filledByEsia: true },
35
35
  { fieldType: 'common', name: 'sex', required: true },
36
- { fieldType: 'common', name: 'birthday', required: true, filledByEsia: true },
36
+ { fieldType: 'common', name: 'limitedBirthday', required: true, filledByEsia: true },
37
37
  { fieldType: 'common', name: 'birthPlace', required: true },
38
38
  { fieldType: 'common', name: 'phone', required: true },
39
39
  { fieldType: 'common', name: 'email', required: true, dadata: true },
@@ -11,7 +11,7 @@ export const formStateMap: Partial<FormState>[] = [
11
11
  name: '',
12
12
  middleName: '',
13
13
  sex: '',
14
- birthday: undefined,
14
+ limitedBirthday: undefined,
15
15
  birthPlace: '',
16
16
  phone: '',
17
17
  email: '',
@@ -7,7 +7,7 @@ export const getInitialFormState = (
7
7
  ): FormState => ({
8
8
  ...formStateMap[step],
9
9
  ...localStorageData,
10
- birthday: transformStringToData(localStorageData?.birthday as string),
10
+ limitedBirthday: transformStringToData(localStorageData?.limitedBirthday as string),
11
11
  dulIssueDateField: transformStringToData(localStorageData?.dulIssueDateField as string),
12
12
  participantDateRegistration: transformStringToData(
13
13
  localStorageData?.participantDateRegistration as string,
@@ -9,7 +9,7 @@ export const getSecondStepData = (formData: FormState): Partial<Participant> =>
9
9
  name,
10
10
  surname,
11
11
  middleName,
12
- birthday = '',
12
+ limitedBirthday = '',
13
13
  phone = '',
14
14
  email,
15
15
  sex,
@@ -27,7 +27,7 @@ export const getSecondStepData = (formData: FormState): Partial<Participant> =>
27
27
  } = formData;
28
28
 
29
29
  return {
30
- birthDate: formatDate(birthday, true),
30
+ birthDate: formatDate(limitedBirthday, true),
31
31
  midname: middleName,
32
32
  name,
33
33
  surname,
@@ -22,7 +22,7 @@ export const stepsSectionsMap: SectionsProps[][] = [
22
22
  { fieldType: 'common', name: 'name', required: true, dadata: true, filledByEsia: true },
23
23
  { fieldType: 'common', name: 'middleName', dadata: true, filledByEsia: true },
24
24
  { fieldType: 'common', name: 'sex', required: true },
25
- { fieldType: 'common', name: 'birthday', required: true, filledByEsia: true },
25
+ { fieldType: 'common', name: 'limitedBirthday', required: true, filledByEsia: true },
26
26
  { fieldType: 'common', name: 'birthPlace', required: true, filledByEsia: true },
27
27
  { fieldType: 'common', name: 'phone', required: true, filledByEsia: true },
28
28
  { fieldType: 'common', name: 'email', required: true, dadata: true },
@@ -15,7 +15,7 @@ export const formStateMap: Partial<FormState>[] = [
15
15
  name: '',
16
16
  middleName: '',
17
17
  sex: '',
18
- birthday: undefined,
18
+ limitedBirthday: undefined,
19
19
  birthPlace: '',
20
20
  phone: '',
21
21
  email: '',
@@ -9,7 +9,7 @@ export const getFirstStepData = (formData: FormState): Partial<Participant> => {
9
9
  name,
10
10
  surname,
11
11
  middleName,
12
- birthday = '',
12
+ limitedBirthday = '',
13
13
  phone = '',
14
14
  email,
15
15
  sex,
@@ -27,7 +27,7 @@ export const getFirstStepData = (formData: FormState): Partial<Participant> => {
27
27
  } = formData;
28
28
 
29
29
  return {
30
- birthDate: formatDate(birthday, true),
30
+ birthDate: formatDate(limitedBirthday, true),
31
31
  midname: middleName,
32
32
  name,
33
33
  surname,
@@ -7,7 +7,7 @@ export const getInitialFormState = (
7
7
  ): FormState => ({
8
8
  ...formStateMap[step],
9
9
  ...localStorageData,
10
- birthday: transformStringToData(localStorageData?.birthday as string),
10
+ limitedBirthday: transformStringToData(localStorageData?.limitedBirthday as string),
11
11
  dulIssueDateField: transformStringToData(localStorageData?.dulIssueDateField as string),
12
12
  participantDateRegistration: transformStringToData(
13
13
  localStorageData?.participantDateRegistration as string,
@@ -3,40 +3,10 @@ import { DatePickerControl } from '../../DatePicker/DatePickerControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
- import { isEsiaAuthorize } from '../isEsiaAuthorize';
7
6
 
8
- const MIN_AGE = 23;
9
- const MAX_AGE = 75;
10
- const AGE_ERROR_MESSAGE = 'Допустимый возраст заёмщика - от 23 до 75 лет';
11
-
12
- interface BirthdayFieldProps extends CustomFieldProps {
13
- isRetailForm?: boolean;
14
- }
15
-
16
- const FIELD_NAME = 'birthday';
17
-
18
- export const BirthdayField = JSX<BirthdayFieldProps>(({ field, input, isRetailForm = false }) => {
19
- const { value } = field(FIELD_NAME);
20
-
21
- return (
22
- <DatePickerControl
23
- label="Дата рождения"
24
- {...getValidation(field(FIELD_NAME), validatorObj.birthday, input?.required)}
25
- error={isRetailForm && value && !birthdayValidate(value as Date) ? AGE_ERROR_MESSAGE : ''}
26
- disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
27
- />
28
- );
29
- });
30
-
31
- const birthdayValidate = (date?: Date) => {
32
- const today = new Date();
33
-
34
- const minDate = new Date(today.getFullYear() - MIN_AGE, today.getMonth(), today.getDate());
35
- const maxDate = new Date(today.getFullYear() - MAX_AGE, today.getMonth(), today.getDate());
36
-
37
- if (!date || date > minDate || date < maxDate) {
38
- return false;
39
- }
40
-
41
- return true;
42
- };
7
+ export const BirthdayField = JSX<CustomFieldProps>(({ field, input }) => (
8
+ <DatePickerControl
9
+ label="Дата рождения"
10
+ {...getValidation(field('birthday'), validatorObj.birthday, input?.required)}
11
+ />
12
+ ));
@@ -0,0 +1,16 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { DatePickerControl } from '../../DatePicker/DatePickerControl';
3
+ import { type CustomFieldProps } from '../CustomFieldProps';
4
+ import { validatorObj } from '../getObjectValidator';
5
+ import { getValidation } from '../getValidation';
6
+ import { isEsiaAuthorize } from '../isEsiaAuthorize';
7
+
8
+ const FIELD_NAME = 'limitedBirthday';
9
+
10
+ export const LimitedBirthdayField = JSX<CustomFieldProps>(({ field, input }) => (
11
+ <DatePickerControl
12
+ label="Дата рождения"
13
+ {...getValidation(field(FIELD_NAME), validatorObj.limitedBirthday, input?.required)}
14
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
15
+ />
16
+ ));
@@ -1,4 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
2
4
  import { InputControl } from '../../Input/InputControl';
3
5
  import { type CustomFieldProps } from '../CustomFieldProps';
4
6
  import { validatorObj } from '../getObjectValidator';
@@ -7,12 +9,23 @@ import { isEsiaAuthorize } from '../isEsiaAuthorize';
7
9
 
8
10
  const FIELD_NAME = 'middleName';
9
11
 
10
- export const MiddleNameField = JSX<CustomFieldProps>(({ field, input }) => (
11
- <InputControl
12
- label="Отчество (Обязательно, при наличии)"
13
- maxLength={60}
14
- disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
15
- {...getValidation(field(FIELD_NAME), validatorObj.middleName, input?.required)}
16
- {...input}
17
- />
18
- ));
12
+ export const MiddleNameField = JSX<CustomFieldProps>(({ field, input }) => {
13
+ const onDaDataChange = useCallback((item: DaDataSuggestion) => {
14
+ const dadataGender = item?.data?.gender;
15
+
16
+ if (dadataGender && dadataGender !== 'UNKNOWN') {
17
+ field('sex')?.onChange?.(dadataGender.toLowerCase());
18
+ }
19
+ }, []);
20
+
21
+ return (
22
+ <InputControl
23
+ label="Отчество (Обязательно, при наличии)"
24
+ maxLength={60}
25
+ disabled={input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME)}
26
+ {...getValidation(field(FIELD_NAME), validatorObj.middleName, input?.required)}
27
+ {...input}
28
+ onDaDataChange={onDaDataChange}
29
+ />
30
+ );
31
+ });
@@ -27,6 +27,7 @@ export type NameFieldDef =
27
27
  | 'typeForm'
28
28
  | 'registrationDate'
29
29
  | 'birthday'
30
+ | 'limitedBirthday'
30
31
  | 'birthPlace'
31
32
  | 'sex'
32
33
  | 'isClient'
@@ -59,6 +59,7 @@ import { JobsNumberField } from './Fields/JobsNumberField';
59
59
  import { LastJobExperienceField } from './Fields/LastJobExperienceField';
60
60
  import { LegalEntityNameField } from './Fields/LegalEntityNameField';
61
61
  import { LegalFormField } from './Fields/LegalFormField';
62
+ import { LimitedBirthdayField } from './Fields/LimitedBirthdayField';
62
63
  import { LocalitiesField } from './Fields/LocalitiesField';
63
64
  import { MandatoryPaymentsField } from './Fields/MandatoryPaymentsField';
64
65
  import { MethodObtainField } from './Fields/MethodObtainField';
@@ -98,8 +99,7 @@ const PRODUCT_REF = {
98
99
  };
99
100
 
100
101
  export const getField =
101
- (field: FormFieldRegisterer<any>, typeForm: string, isRetailForm = false) =>
102
- (input: FieldDef, i: number) => {
102
+ (field: FormFieldRegisterer<any>, typeForm: string) => (input: FieldDef, i: number) => {
103
103
  const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
104
104
 
105
105
  const InputsMap = {
@@ -123,7 +123,8 @@ export const getField =
123
123
  comment: <CommentField field={field} input={input} />,
124
124
  addressBranch: <AddressBranchField field={field} input={input} isPremium={isPremium} />,
125
125
  sex: <SexField field={field} input={input} />,
126
- birthday: <BirthdayField field={field} input={input} isRetailForm={isRetailForm} />,
126
+ birthday: <BirthdayField field={field} input={input} />,
127
+ limitedBirthday: <LimitedBirthdayField field={field} input={input} />,
127
128
  birthPlace: <BirthPlaceField field={field} input={input} />,
128
129
  desiredMeetingDate: <DesiredMeetingDateField field={field} input={input} />,
129
130
  product: <ProductField field={field} source={PRODUCT_REF} />,
@@ -12,6 +12,7 @@ import {
12
12
  innValidator,
13
13
  jobNumberValidator,
14
14
  lengthStringValidator,
15
+ limitedBirthdayValidator,
15
16
  nameValidator,
16
17
  numberValidator,
17
18
  phoneValidator,
@@ -30,6 +31,7 @@ export const validatorObj: Record<string, Validator> = {
30
31
  secondaryPhone: phoneValidator('Укажите номер телефона'),
31
32
  organizationPhone: phoneValidator('Укажите номер телефона'),
32
33
  birthday: defaultValidator('Укажите дату рождения'),
34
+ limitedBirthday: limitedBirthdayValidator(),
33
35
  birthPlace: defaultValidator('Укажите место рождения'),
34
36
  education: defaultValidator('Выберите ваше образование'),
35
37
  housing: defaultValidator('Выберите тип жилья'),
@@ -7,6 +7,10 @@ const ERROR_MESSAGE = 'Некорректно заполненное поле';
7
7
 
8
8
  const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
9
9
 
10
+ const MIN_AGE = 23;
11
+ const MAX_AGE = 75;
12
+ const AGE_ERROR_MESSAGE = 'Допустимый возраст заёмщика - от 23 до 75 лет';
13
+
10
14
  export const defaultValidator = (errorMsg?: string) => required(errorMsg ?? ERROR_MESSAGE);
11
15
 
12
16
  export const defaultSelectValidator = (errorMsg?: string) =>
@@ -88,3 +92,18 @@ export const codeWordValidator = (errorMsg?: string) =>
88
92
  const cyrillicPattern = /^[\u0400-\u04FF\d]+$/u;
89
93
 
90
94
  const isCyrillic = (_ = '') => cyrillicPattern.test(_);
95
+
96
+ const limitedBirthdayValidate = (date?: Date) => {
97
+ const today = new Date();
98
+
99
+ const minDate = new Date(today.getFullYear() - MIN_AGE, today.getMonth(), today.getDate());
100
+ const maxDate = new Date(today.getFullYear() - MAX_AGE, today.getMonth(), today.getDate());
101
+
102
+ if (!date || date > minDate || date < maxDate) {
103
+ return false;
104
+ }
105
+
106
+ return true;
107
+ };
108
+
109
+ export const limitedBirthdayValidator = () => validator(limitedBirthdayValidate)(AGE_ERROR_MESSAGE);