@redneckz/wildless-cms-uni-blocks 0.14.913 → 0.14.915

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 (240) hide show
  1. package/bin/migration-scripts/0.14.910.js +27 -0
  2. package/bundle/api/LeadServiceAPI.d.ts +0 -1
  3. package/bundle/api/getSubmitBody.d.ts +120 -96
  4. package/bundle/blocks.schema.json +1 -1
  5. package/bundle/bundle.umd.js +134 -83
  6. package/bundle/bundle.umd.min.js +1 -1
  7. package/bundle/components/ApplicationForm/getInitialFormState.d.ts +3 -0
  8. package/bundle/hooks/useDadataParty.d.ts +6 -0
  9. package/bundle/ui-kit/FormField/Fields/DadataPartySelectField.d.ts +6 -0
  10. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  11. package/bundle/ui-kit/Select/Option.d.ts +3 -6
  12. package/bundle/ui-kit/Select/Select.d.ts +2 -1
  13. package/bundle/ui-kit/Select/SelectPopup.d.ts +6 -2
  14. package/bundle/ui-kit/Select/useSelectPopup.d.ts +2 -1
  15. package/dist/api/LeadServiceAPI.d.ts +0 -1
  16. package/dist/api/LeadServiceAPI.js.map +1 -1
  17. package/dist/api/getSubmitBody.d.ts +120 -96
  18. package/dist/api/getSubmitBody.js +1 -6
  19. package/dist/api/getSubmitBody.js.map +1 -1
  20. package/dist/components/ApplicationForm/getFormatData.js +11 -1
  21. package/dist/components/ApplicationForm/getFormatData.js.map +1 -1
  22. package/dist/components/ApplicationForm/getInitialFormState.d.ts +3 -0
  23. package/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
  24. package/dist/hooks/useDadataParty.d.ts +6 -0
  25. package/dist/hooks/{useInn.js → useDadataParty.js} +4 -4
  26. package/dist/hooks/useDadataParty.js.map +1 -0
  27. package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  28. package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  29. package/dist/ui-kit/FormField/Fields/DadataPartySelectField.d.ts +6 -0
  30. package/dist/ui-kit/FormField/Fields/DadataPartySelectField.js +84 -0
  31. package/dist/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -0
  32. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  33. package/dist/ui-kit/FormField/getField.js +3 -4
  34. package/dist/ui-kit/FormField/getField.js.map +1 -1
  35. package/dist/ui-kit/FormField/getObjectValidator.js +3 -3
  36. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  37. package/dist/ui-kit/Select/Option.d.ts +3 -6
  38. package/dist/ui-kit/Select/Select.d.ts +2 -1
  39. package/dist/ui-kit/Select/Select.js +4 -4
  40. package/dist/ui-kit/Select/Select.js.map +1 -1
  41. package/dist/ui-kit/Select/SelectPopup.d.ts +6 -2
  42. package/dist/ui-kit/Select/SelectPopup.js +5 -3
  43. package/dist/ui-kit/Select/SelectPopup.js.map +1 -1
  44. package/dist/ui-kit/Select/useSelectPopup.d.ts +2 -1
  45. package/dist/ui-kit/Select/useSelectPopup.js +6 -3
  46. package/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
  47. package/lib/api/LeadServiceAPI.d.ts +0 -1
  48. package/lib/api/LeadServiceAPI.js.map +1 -1
  49. package/lib/api/getSubmitBody.d.ts +120 -96
  50. package/lib/api/getSubmitBody.js +1 -6
  51. package/lib/api/getSubmitBody.js.map +1 -1
  52. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
  53. package/lib/components/ApplicationForm/getFormatData.js +11 -1
  54. package/lib/components/ApplicationForm/getFormatData.js.map +1 -1
  55. package/lib/components/ApplicationForm/getInitialFormState.d.ts +3 -0
  56. package/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
  57. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  58. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +1 -1
  59. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.d.ts +2 -0
  60. package/lib/hooks/useDadataParty.d.ts +6 -0
  61. package/lib/hooks/{useInn.js → useDadataParty.js} +2 -2
  62. package/lib/hooks/useDadataParty.js.map +1 -0
  63. package/lib/retail/components/DraftDialog/utils.d.ts +3 -3
  64. package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  65. package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  66. package/lib/ui-kit/FormField/Fields/DadataPartySelectField.d.ts +6 -0
  67. package/lib/ui-kit/FormField/Fields/DadataPartySelectField.js +82 -0
  68. package/lib/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -0
  69. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  70. package/lib/ui-kit/FormField/getField.js +3 -4
  71. package/lib/ui-kit/FormField/getField.js.map +1 -1
  72. package/lib/ui-kit/FormField/getObjectValidator.js +3 -3
  73. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  74. package/lib/ui-kit/Select/Option.d.ts +3 -6
  75. package/lib/ui-kit/Select/Select.d.ts +2 -1
  76. package/lib/ui-kit/Select/Select.js +4 -4
  77. package/lib/ui-kit/Select/Select.js.map +1 -1
  78. package/lib/ui-kit/Select/SelectPopup.d.ts +6 -2
  79. package/lib/ui-kit/Select/SelectPopup.js +5 -3
  80. package/lib/ui-kit/Select/SelectPopup.js.map +1 -1
  81. package/lib/ui-kit/Select/useSelectPopup.d.ts +2 -1
  82. package/lib/ui-kit/Select/useSelectPopup.js +6 -3
  83. package/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
  84. package/mobile/bundle/api/LeadServiceAPI.d.ts +0 -1
  85. package/mobile/bundle/api/getSubmitBody.d.ts +120 -96
  86. package/mobile/bundle/bundle.umd.js +134 -83
  87. package/mobile/bundle/bundle.umd.min.js +1 -1
  88. package/mobile/bundle/components/ApplicationForm/getInitialFormState.d.ts +3 -0
  89. package/mobile/bundle/hooks/useDadataParty.d.ts +6 -0
  90. package/mobile/bundle/ui-kit/FormField/Fields/DadataPartySelectField.d.ts +6 -0
  91. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  92. package/mobile/bundle/ui-kit/Select/Option.d.ts +3 -6
  93. package/mobile/bundle/ui-kit/Select/Select.d.ts +2 -1
  94. package/mobile/bundle/ui-kit/Select/SelectPopup.d.ts +6 -2
  95. package/mobile/bundle/ui-kit/Select/useSelectPopup.d.ts +2 -1
  96. package/mobile/dist/api/LeadServiceAPI.d.ts +0 -1
  97. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  98. package/mobile/dist/api/getSubmitBody.d.ts +120 -96
  99. package/mobile/dist/api/getSubmitBody.js +1 -6
  100. package/mobile/dist/api/getSubmitBody.js.map +1 -1
  101. package/mobile/dist/components/ApplicationForm/getFormatData.js +11 -1
  102. package/mobile/dist/components/ApplicationForm/getFormatData.js.map +1 -1
  103. package/mobile/dist/components/ApplicationForm/getInitialFormState.d.ts +3 -0
  104. package/mobile/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
  105. package/mobile/dist/hooks/useDadataParty.d.ts +6 -0
  106. package/mobile/dist/hooks/{useInn.js → useDadataParty.js} +4 -4
  107. package/mobile/dist/hooks/useDadataParty.js.map +1 -0
  108. package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  109. package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  110. package/mobile/dist/ui-kit/FormField/Fields/DadataPartySelectField.d.ts +6 -0
  111. package/mobile/dist/ui-kit/FormField/Fields/DadataPartySelectField.js +84 -0
  112. package/mobile/dist/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -0
  113. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  114. package/mobile/dist/ui-kit/FormField/getField.js +3 -4
  115. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  116. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +3 -3
  117. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  118. package/mobile/dist/ui-kit/Select/Option.d.ts +3 -6
  119. package/mobile/dist/ui-kit/Select/Select.d.ts +2 -1
  120. package/mobile/dist/ui-kit/Select/Select.js +4 -4
  121. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  122. package/mobile/dist/ui-kit/Select/SelectPopup.d.ts +6 -2
  123. package/mobile/dist/ui-kit/Select/SelectPopup.js +5 -3
  124. package/mobile/dist/ui-kit/Select/SelectPopup.js.map +1 -1
  125. package/mobile/dist/ui-kit/Select/useSelectPopup.d.ts +2 -1
  126. package/mobile/dist/ui-kit/Select/useSelectPopup.js +6 -3
  127. package/mobile/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
  128. package/mobile/lib/api/LeadServiceAPI.d.ts +0 -1
  129. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  130. package/mobile/lib/api/getSubmitBody.d.ts +120 -96
  131. package/mobile/lib/api/getSubmitBody.js +1 -6
  132. package/mobile/lib/api/getSubmitBody.js.map +1 -1
  133. package/mobile/lib/components/ApplicationForm/getFormatData.js +11 -1
  134. package/mobile/lib/components/ApplicationForm/getFormatData.js.map +1 -1
  135. package/mobile/lib/components/ApplicationForm/getInitialFormState.d.ts +3 -0
  136. package/mobile/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
  137. package/mobile/lib/hooks/useDadataParty.d.ts +6 -0
  138. package/mobile/lib/hooks/{useInn.js → useDadataParty.js} +2 -2
  139. package/mobile/lib/hooks/useDadataParty.js.map +1 -0
  140. package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  141. package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  142. package/mobile/lib/ui-kit/FormField/Fields/DadataPartySelectField.d.ts +6 -0
  143. package/mobile/lib/ui-kit/FormField/Fields/DadataPartySelectField.js +82 -0
  144. package/mobile/lib/ui-kit/FormField/Fields/DadataPartySelectField.js.map +1 -0
  145. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  146. package/mobile/lib/ui-kit/FormField/getField.js +3 -4
  147. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  148. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +3 -3
  149. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  150. package/mobile/lib/ui-kit/Select/Option.d.ts +3 -6
  151. package/mobile/lib/ui-kit/Select/Select.d.ts +2 -1
  152. package/mobile/lib/ui-kit/Select/Select.js +4 -4
  153. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  154. package/mobile/lib/ui-kit/Select/SelectPopup.d.ts +6 -2
  155. package/mobile/lib/ui-kit/Select/SelectPopup.js +5 -3
  156. package/mobile/lib/ui-kit/Select/SelectPopup.js.map +1 -1
  157. package/mobile/lib/ui-kit/Select/useSelectPopup.d.ts +2 -1
  158. package/mobile/lib/ui-kit/Select/useSelectPopup.js +6 -3
  159. package/mobile/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
  160. package/mobile/src/api/LeadServiceAPI.ts +0 -1
  161. package/mobile/src/api/getSubmitBody.ts +0 -11
  162. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +22 -43
  163. package/mobile/src/components/ApplicationForm/getFormatData.tsx +16 -0
  164. package/mobile/src/components/ApplicationForm/getInitialFormState.tsx +3 -0
  165. package/mobile/src/hooks/{useInn.ts → useDadataParty.ts} +2 -2
  166. package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  167. package/mobile/src/ui-kit/FormField/Fields/DadataPartySelectField.tsx +150 -0
  168. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +3 -3
  169. package/mobile/src/ui-kit/FormField/getField.tsx +3 -4
  170. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +3 -3
  171. package/mobile/src/ui-kit/Select/Option.ts +4 -6
  172. package/mobile/src/ui-kit/Select/Select.tsx +6 -4
  173. package/mobile/src/ui-kit/Select/SelectPopup.tsx +15 -21
  174. package/mobile/src/ui-kit/Select/useSelectPopup.tsx +9 -1
  175. package/package.json +1 -1
  176. package/src/api/LeadServiceAPI.ts +0 -1
  177. package/src/api/getSubmitBody.ts +0 -11
  178. package/src/components/ApplicationForm/ApplicationForm.example.json +22 -43
  179. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +36 -13
  180. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +13 -12
  181. package/src/components/ApplicationForm/getFormatData.tsx +16 -0
  182. package/src/components/ApplicationForm/getInitialFormState.tsx +3 -0
  183. package/src/components/Carousel/Carousel.fixture.mobile.tsx +16 -16
  184. package/src/components/Carousel/Carousel.fixture.tsx +42 -20
  185. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +19 -19
  186. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +44 -23
  187. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +12 -12
  188. package/src/hooks/{useInn.ts → useDadataParty.ts} +2 -2
  189. package/src/icons/IconName.ts +4 -4
  190. package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  191. package/src/ui-kit/FormField/Fields/DadataPartySelectField.tsx +150 -0
  192. package/src/ui-kit/FormField/NameFieldDef.ts +3 -3
  193. package/src/ui-kit/FormField/getField.tsx +3 -4
  194. package/src/ui-kit/FormField/getObjectValidator.tsx +3 -3
  195. package/src/ui-kit/Select/Option.ts +4 -6
  196. package/src/ui-kit/Select/Select.tsx +6 -4
  197. package/src/ui-kit/Select/SelectPopup.tsx +15 -21
  198. package/src/ui-kit/Select/useSelectPopup.tsx +9 -1
  199. package/bundle/hooks/useInn.d.ts +0 -7
  200. package/bundle/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +0 -2
  201. package/bundle/ui-kit/FormField/Fields/InnDadataField.d.ts +0 -2
  202. package/dist/hooks/useInn.d.ts +0 -7
  203. package/dist/hooks/useInn.js.map +0 -1
  204. package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +0 -2
  205. package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js +0 -17
  206. package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +0 -1
  207. package/dist/ui-kit/FormField/Fields/InnDadataField.d.ts +0 -2
  208. package/dist/ui-kit/FormField/Fields/InnDadataField.js +0 -32
  209. package/dist/ui-kit/FormField/Fields/InnDadataField.js.map +0 -1
  210. package/lib/hooks/useInn.d.ts +0 -7
  211. package/lib/hooks/useInn.js.map +0 -1
  212. package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +0 -2
  213. package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js +0 -15
  214. package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +0 -1
  215. package/lib/ui-kit/FormField/Fields/InnDadataField.d.ts +0 -2
  216. package/lib/ui-kit/FormField/Fields/InnDadataField.js +0 -30
  217. package/lib/ui-kit/FormField/Fields/InnDadataField.js.map +0 -1
  218. package/mobile/bundle/hooks/useInn.d.ts +0 -7
  219. package/mobile/bundle/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +0 -2
  220. package/mobile/bundle/ui-kit/FormField/Fields/InnDadataField.d.ts +0 -2
  221. package/mobile/dist/hooks/useInn.d.ts +0 -7
  222. package/mobile/dist/hooks/useInn.js.map +0 -1
  223. package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +0 -2
  224. package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js +0 -17
  225. package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +0 -1
  226. package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.d.ts +0 -2
  227. package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.js +0 -32
  228. package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.js.map +0 -1
  229. package/mobile/lib/hooks/useInn.d.ts +0 -7
  230. package/mobile/lib/hooks/useInn.js.map +0 -1
  231. package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +0 -2
  232. package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js +0 -15
  233. package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +0 -1
  234. package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.d.ts +0 -2
  235. package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.js +0 -30
  236. package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.js.map +0 -1
  237. package/mobile/src/ui-kit/FormField/Fields/CompanyNameByInnField.tsx +0 -24
  238. package/mobile/src/ui-kit/FormField/Fields/InnDadataField.tsx +0 -52
  239. package/src/ui-kit/FormField/Fields/CompanyNameByInnField.tsx +0 -24
  240. package/src/ui-kit/FormField/Fields/InnDadataField.tsx +0 -52
@@ -28,12 +28,12 @@
28
28
  "columns": 2,
29
29
  "inputs": [
30
30
  {
31
- "name": "fullName",
31
+ "name": "dadataPartyNameSelect",
32
32
  "required": true,
33
33
  "label": "Наименование организации"
34
34
  },
35
35
  {
36
- "name": "inn",
36
+ "name": "dadataPartyInnSelect",
37
37
  "required": true
38
38
  },
39
39
  {
@@ -205,7 +205,7 @@
205
205
  "required": true
206
206
  },
207
207
  {
208
- "name": "inn",
208
+ "name": "dadataPartyInnSelect",
209
209
  "required": true
210
210
  },
211
211
  {
@@ -339,7 +339,7 @@
339
339
  {
340
340
  "inputs": [
341
341
  {
342
- "name": "fullName",
342
+ "name": "companyNameDadata",
343
343
  "required": true,
344
344
  "label": "Наименование организации"
345
345
  }
@@ -407,7 +407,7 @@
407
407
  "columns": 2,
408
408
  "inputs": [
409
409
  {
410
- "name": "fullName",
410
+ "name": "dadataPartyNameSelect",
411
411
  "required": true,
412
412
  "label": "Наименование организации"
413
413
  },
@@ -416,7 +416,7 @@
416
416
  "required": true
417
417
  },
418
418
  {
419
- "name": "inn",
419
+ "name": "dadataPartyInnSelect",
420
420
  "required": true
421
421
  },
422
422
  {
@@ -659,9 +659,7 @@
659
659
  "required": true,
660
660
  "condition": {
661
661
  "name": "serviceDirection",
662
- "values": [
663
- "Юридическое лицо / ИП"
664
- ]
662
+ "values": ["Юридическое лицо / ИП"]
665
663
  }
666
664
  },
667
665
  {
@@ -669,9 +667,7 @@
669
667
  "label": "Наименование организации",
670
668
  "condition": {
671
669
  "name": "serviceDirection",
672
- "values": [
673
- "Юридическое лицо / ИП"
674
- ]
670
+ "values": ["Юридическое лицо / ИП"]
675
671
  }
676
672
  },
677
673
  {
@@ -926,9 +922,7 @@
926
922
  "required": true,
927
923
  "condition": {
928
924
  "name": "vedTypes",
929
- "values": [
930
- "currencyControl"
931
- ]
925
+ "values": ["currencyControl"]
932
926
  }
933
927
  }
934
928
  ]
@@ -937,18 +931,15 @@
937
931
  "columns": 2,
938
932
  "inputs": [
939
933
  {
940
- "name": "inn",
934
+ "name": "innDadata",
941
935
  "required": true,
942
936
  "condition": {
943
937
  "name": "vedTypes",
944
- "values": [
945
- "currencyControl",
946
- "documentOperations"
947
- ]
938
+ "values": ["currencyControl", "documentOperations"]
948
939
  }
949
940
  },
950
941
  {
951
- "name": "fullName",
942
+ "name": "dadataPartyNameSelect",
952
943
  "required": true,
953
944
  "label": "Наименование организации"
954
945
  },
@@ -966,11 +957,7 @@
966
957
  "required": true,
967
958
  "condition": {
968
959
  "name": "vedTypes",
969
- "values": [
970
- "documentOperations",
971
- "conversionTransactions",
972
- "otherIssues"
973
- ]
960
+ "values": ["documentOperations", "conversionTransactions", "otherIssues"]
974
961
  }
975
962
  }
976
963
  ]
@@ -1137,7 +1124,7 @@
1137
1124
  "required": true
1138
1125
  },
1139
1126
  {
1140
- "name": "inn",
1127
+ "name": "dadataPartyInnSelect",
1141
1128
  "required": true
1142
1129
  }
1143
1130
  ]
@@ -1181,7 +1168,7 @@
1181
1168
  "required": true
1182
1169
  },
1183
1170
  {
1184
- "name": "inn"
1171
+ "name": "dadataPartyInnSelect"
1185
1172
  }
1186
1173
  ]
1187
1174
  }
@@ -1354,9 +1341,7 @@
1354
1341
  "required": true,
1355
1342
  "condition": {
1356
1343
  "name": "serviceDirection",
1357
- "values": [
1358
- "Юридическое лицо / ИП"
1359
- ]
1344
+ "values": ["Юридическое лицо / ИП"]
1360
1345
  }
1361
1346
  },
1362
1347
  {
@@ -1364,9 +1349,7 @@
1364
1349
  "label": "Наименование организации",
1365
1350
  "condition": {
1366
1351
  "name": "serviceDirection",
1367
- "values": [
1368
- "Юридическое лицо / ИП"
1369
- ]
1352
+ "values": ["Юридическое лицо / ИП"]
1370
1353
  }
1371
1354
  },
1372
1355
  {
@@ -1383,9 +1366,7 @@
1383
1366
  "label": "Ваше сообщение",
1384
1367
  "condition": {
1385
1368
  "name": "serviceDirection",
1386
- "values": [
1387
- "Физическое лицо"
1388
- ]
1369
+ "values": ["Физическое лицо"]
1389
1370
  }
1390
1371
  },
1391
1372
  {
@@ -1394,9 +1375,7 @@
1394
1375
  "required": true,
1395
1376
  "condition": {
1396
1377
  "name": "serviceDirection",
1397
- "values": [
1398
- "Юридическое лицо / ИП"
1399
- ]
1378
+ "values": ["Юридическое лицо / ИП"]
1400
1379
  }
1401
1380
  }
1402
1381
  ]
@@ -1448,11 +1427,11 @@
1448
1427
  "columns": 2,
1449
1428
  "inputs": [
1450
1429
  {
1451
- "name": "innDadata",
1430
+ "name": "dadataPartyNameSelect",
1452
1431
  "required": true
1453
1432
  },
1454
1433
  {
1455
- "name": "companyNameByInn",
1434
+ "name": "dadataPartyInnSelect",
1456
1435
  "required": true
1457
1436
  }
1458
1437
  ]
@@ -1553,4 +1532,4 @@
1553
1532
  }
1554
1533
  }
1555
1534
  ]
1556
- ]
1535
+ ]
@@ -22,6 +22,9 @@ export const getFormatData = (data: FormState): Record<string, any> => {
22
22
  situationDescription,
23
23
  applierType,
24
24
  isPremium,
25
+ dadataPartyNameSelect,
26
+ partnerSymbolCode,
27
+ dadataPartyInnSelect,
25
28
  ...usedData
26
29
  } = data;
27
30
  const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
@@ -34,6 +37,10 @@ export const getFormatData = (data: FormState): Record<string, any> => {
34
37
  ...(serviceType ? { typeForm: serviceType } : {}),
35
38
  ...getIncidentComment(sufferedFrom?.text, situationDescription),
36
39
  ...getIsClient(applierType),
40
+ ...getDadataValues([
41
+ [dadataPartyInnSelect, 'inn'],
42
+ [dadataPartyNameSelect, 'fullName'],
43
+ ]),
37
44
  };
38
45
 
39
46
  return Object.fromEntries(
@@ -58,3 +65,12 @@ const getVedTypes = (vedTypes?: string): { vedTypes?: Record<string, boolean> }
58
65
  vedTypes: Object.fromEntries(VED_TYPES.map(({ id }) => [id, id === vedTypes])),
59
66
  }
60
67
  : {};
68
+
69
+ const getDadataValues = (fields: [Option | undefined, string][]): Record<string, string> =>
70
+ fields.reduce((acc, [field, name]) => {
71
+ if (field?.text && name) {
72
+ acc[name] = field.text;
73
+ }
74
+
75
+ return acc;
76
+ }, {});
@@ -34,6 +34,9 @@ export interface FormState {
34
34
  situationDescription?: string;
35
35
  applierType?: ApplierType;
36
36
  isPremium?: boolean;
37
+ partnerSymbolCode?: string;
38
+ dadataPartyInnSelect?: Option;
39
+ dadataPartyNameSelect?: Option;
37
40
  }
38
41
 
39
42
  const initialFormState = {
@@ -2,13 +2,13 @@ import { getDaDataHints } from '../retail/api/dadataHints/dadataHints';
2
2
 
3
3
  const INN_DADATA_URL = 'suggest/party';
4
4
 
5
- interface InnHint {
5
+ export interface DaDataPartyHint {
6
6
  fullName?: string;
7
7
  address?: string;
8
8
  inn?: string;
9
9
  }
10
10
 
11
- export const useInn = async (searchQuery: string): Promise<InnHint[]> =>
11
+ export const useDadataParty = async (searchQuery: string): Promise<DaDataPartyHint[]> =>
12
12
  (await getDaDataHints({ url: INN_DADATA_URL, query: searchQuery })).map((_) => ({
13
13
  fullName: _?.value,
14
14
  address: _?.data?.address?.value,
@@ -94,7 +94,7 @@ export const BaseTile = JSX<BaseTileProps>(
94
94
 
95
95
  const renderMiddleContent = (insetTitle: VNode, children: VNode) =>
96
96
  insetTitle || children ? (
97
- <div className="grow space-y-lg w-fit">
97
+ <div className="space-y-lg">
98
98
  {insetTitle}
99
99
  {children}
100
100
  </div>
@@ -0,0 +1,150 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useAsyncEffect } from '../../../hooks/useAsyncEffect';
4
+ import { useDadataParty, type DaDataPartyHint } from '../../../hooks/useDadataParty';
5
+ import { type OptionWithData } from '../../Select/Option';
6
+ import { SelectControl } from '../../Select/SelectControl';
7
+ import { Text } from '../../Text/Text';
8
+ import { type CustomFieldProps } from '../CustomFieldProps';
9
+
10
+ type FieldType = 'dadataPartyInnSelect' | 'dadataPartyNameSelect';
11
+
12
+ type FieldConfig = {
13
+ label: string;
14
+ placeholder: string;
15
+ inputProps?: {
16
+ isInteger?: boolean;
17
+ maxLength?: number;
18
+ };
19
+ };
20
+
21
+ type FieldMappingValue = {
22
+ fieldValue: string;
23
+ linkedFieldName: string;
24
+ linkedFieldValue: string;
25
+ };
26
+
27
+ const FIELD_MAPPING: Record<FieldType, FieldMappingValue> = {
28
+ dadataPartyInnSelect: {
29
+ fieldValue: 'inn',
30
+ linkedFieldName: 'dadataPartyNameSelect',
31
+ linkedFieldValue: 'fullName',
32
+ },
33
+ dadataPartyNameSelect: {
34
+ fieldValue: 'fullName',
35
+ linkedFieldName: 'dadataPartyInnSelect',
36
+ linkedFieldValue: 'inn',
37
+ },
38
+ };
39
+
40
+ const FIELD_CONFIG: Record<FieldType, FieldConfig> = {
41
+ dadataPartyInnSelect: {
42
+ label: 'ИНН',
43
+ placeholder: 'Введите ИНН',
44
+ inputProps: {
45
+ isInteger: true,
46
+ maxLength: 12,
47
+ },
48
+ },
49
+ dadataPartyNameSelect: {
50
+ label: 'Полное наименование',
51
+ placeholder: 'Введите полное наименование',
52
+ },
53
+ };
54
+
55
+ export const DadataPartySelectField = JSX<CustomFieldProps>(({ field, input = {} }) => {
56
+ const fieldName = input.name ?? '';
57
+
58
+ const linkedField = FIELD_MAPPING[fieldName].linkedFieldName;
59
+ const linkedFieldValue = field(linkedField).value;
60
+ const linkedFieldValueData = linkedFieldValue?.data;
61
+
62
+ useAsyncEffect(async () => {
63
+ if (
64
+ linkedFieldValueData?.fullName &&
65
+ linkedFieldValueData?.fullName !== field(fieldName)?.value?.data?.fullName
66
+ ) {
67
+ const fieldValues = getFieldValues(linkedFieldValue as OptionWithData<DaDataPartyHint>);
68
+ const { fullName, address, inn } = fieldValues;
69
+
70
+ const optionTextValue = getLinkedFieldValue(fieldValues, linkedField as string);
71
+ const dadataFields = useDadataParty(optionTextValue);
72
+ setSearchQuery(optionTextValue);
73
+
74
+ setOptions(await dadataFields);
75
+
76
+ field(fieldName)?.onChange?.({
77
+ key: inn,
78
+ text: optionTextValue,
79
+ data: {
80
+ fullName,
81
+ address,
82
+ },
83
+ });
84
+ }
85
+ }, [linkedFieldValueData]);
86
+
87
+ const [options, setOptions] = useState<DaDataPartyHint[]>([]); // InnSuggestion
88
+ const [searchQuery, setSearchQuery] = useState('');
89
+
90
+ useAsyncEffect(async () => {
91
+ const dadataFields = useDadataParty(searchQuery);
92
+ setOptions(await dadataFields);
93
+
94
+ return options;
95
+ }, [searchQuery]);
96
+
97
+ const getOptions = useMemo(
98
+ () =>
99
+ (options || []).map((item = {}) => ({
100
+ key: item.inn ?? '',
101
+ text: item[FIELD_MAPPING[fieldName].fieldValue],
102
+ data: {
103
+ fullName: item.fullName,
104
+ address: item.address,
105
+ },
106
+ })),
107
+ [options],
108
+ );
109
+
110
+ return (
111
+ <SelectControl
112
+ {...FIELD_CONFIG[fieldName]}
113
+ options={getOptions}
114
+ {...field(input.name ?? '')}
115
+ isSearch
116
+ isManualInput
117
+ disableFilterOptions={true}
118
+ onSearchQuery={setSearchQuery}
119
+ renderOptions={renderOptions}
120
+ />
121
+ );
122
+ });
123
+
124
+ export type CompanyDataProps = {
125
+ fullName?: string;
126
+ address?: string;
127
+ };
128
+
129
+ const getFieldValues = (value: OptionWithData<CompanyDataProps>): DaDataPartyHint => ({
130
+ inn: value?.key,
131
+ fullName: value?.data?.fullName,
132
+ address: value?.data?.address,
133
+ });
134
+
135
+ const renderOptions = (option: OptionWithData<CompanyDataProps>) => (
136
+ <span>
137
+ <Text size="text-s">{option?.data?.fullName}</Text>
138
+ <div className="space-x-2">
139
+ <Text size="text-s" font="font-light">
140
+ {option?.key}
141
+ </Text>
142
+ <Text size="text-s" font="font-light">
143
+ {option?.data?.address}
144
+ </Text>
145
+ </div>
146
+ </span>
147
+ );
148
+
149
+ const getLinkedFieldValue = (fieldValues: DaDataPartyHint, linkedField: string): string =>
150
+ fieldValues?.[FIELD_MAPPING[linkedField].linkedFieldValue];
@@ -40,8 +40,8 @@ type NameFieldApplicationDef =
40
40
  | 'consentToReceiveMaterials'
41
41
  | 'consentDataProcessing'
42
42
  | 'partnerSymbolCode'
43
- | 'innDadata'
44
- | 'companyNameByInn'
45
- | 'partnerName';
43
+ | 'partnerName'
44
+ | 'dadataPartyNameSelect'
45
+ | 'dadataPartyInnSelect';
46
46
 
47
47
  export type NameFieldDef = NameFieldApplicationDef;
@@ -13,13 +13,12 @@ import { BankEmpoleeField } from './Fields/BankEmpoleeField';
13
13
  import { BirthdayField } from './Fields/BirthdayField';
14
14
  import { CollectionCountField } from './Fields/CollectionCountField';
15
15
  import { CommentField } from './Fields/CommentField';
16
- import { CompanyNameByInnField } from './Fields/CompanyNameByInnField';
16
+ import { DadataPartySelectField } from './Fields/DadataPartySelectField';
17
17
  import { DesiredMeetingDateField } from './Fields/DesiredMeetingDateField';
18
18
  import { EmailField } from './Fields/EmailField';
19
19
  import { FeedbackMethodField } from './Fields/FeedbackMethodField';
20
20
  import { FullNameField } from './Fields/FullNameField';
21
21
  import { FullRegionField } from './Fields/FullRegionField';
22
- import { InnDadataField } from './Fields/InnDadataField';
23
22
  import { InnField } from './Fields/InnField';
24
23
  import { IsClientField } from './Fields/IsClientField';
25
24
  import { LocalitiesField } from './Fields/LocalitiesField';
@@ -100,9 +99,9 @@ const InputsMap = {
100
99
  partnerSymbolCode: (props: CustomFieldProps) => (
101
100
  <PartnerSymbolCodeField {...props} source={AGENTS_REF} />
102
101
  ),
103
- innDadata: InnDadataField,
104
- companyNameByInn: CompanyNameByInnField,
105
102
  partnerName: (props: CustomFieldProps) => <PartnerNameField {...props} source={AGENTS_REF} />,
103
+ dadataPartyNameSelect: DadataPartySelectField,
104
+ dadataPartyInnSelect: DadataPartySelectField,
106
105
  };
107
106
 
108
107
  export const getField =
@@ -41,9 +41,9 @@ export const validatorObj: Record<string, Validator> = {
41
41
  typeForm: defaultValidator(),
42
42
  consentToReceiveMaterials: agreementValidator,
43
43
  consentDataProcessing: agreementValidator,
44
- partnerSymbolCode: defaultValidator(),
45
- innDadata: innDadataValidator('Укажите ИНН'),
46
- companyNameByInn: defaultValidator(),
44
+ partnerSymbolCode: defaultValidator('Укажите идентификатор партнёра'),
45
+ dadataPartyInnSelect: innDadataValidator('Укажите ИНН'),
46
+ dadataPartyNameSelect: defaultValidator('Укажите наименование организации'),
47
47
  };
48
48
 
49
49
  export const getFormValidator = <FormState extends Record<string, any>, F extends BaseFieldDef>(
@@ -1,11 +1,9 @@
1
1
  import type { TextProps } from '../../model/HeadlineType';
2
2
 
3
- type companyData = {
4
- companyName?: string;
5
- companyAddress?: string;
6
- };
7
-
8
3
  export type Option = TextProps & {
9
4
  key: string;
10
- innDaData?: companyData;
5
+ };
6
+
7
+ export type OptionWithData<T = unknown> = Option & {
8
+ data?: T;
11
9
  };
@@ -8,7 +8,7 @@ import { debounce } from '../../utils/debounce';
8
8
  import { noop } from '../../utils/noop';
9
9
  import { style } from '../../utils/style';
10
10
  import { renderLabel } from '../Input/renderLabel';
11
- import { type Option } from './Option';
11
+ import { type Option, type OptionWithData } from './Option';
12
12
  import { renderSearchInput } from './renderSearchInput';
13
13
  import { renderSelectContainer } from './renderSelectContainer';
14
14
  import { useSelectPopup } from './useSelectPopup';
@@ -23,6 +23,7 @@ export interface SelectProps extends DefaultControlType, ControlProps<Option> {
23
23
  inputProps?: InputTypeProps;
24
24
  disableFilterOptions?: boolean;
25
25
  onSearchQuery?: (value: string) => void;
26
+ renderOptions?: (option?: OptionWithData) => void;
26
27
  }
27
28
 
28
29
  export type InputTypeProps = {
@@ -44,6 +45,7 @@ export const Select = JSX<SelectProps>(
44
45
  onSearchQuery = noop,
45
46
  inputProps,
46
47
  disableFilterOptions = false,
48
+ renderOptions,
47
49
  ...rest
48
50
  }) => {
49
51
  const [isOpen, { setFalse: close, setTrue: open }] = useBool();
@@ -61,19 +63,19 @@ export const Select = JSX<SelectProps>(
61
63
  }, [isDisabled]);
62
64
 
63
65
  const handleClose = useCallback(() => {
64
- !isManualInput && setQuery('');
66
+ !isSearch && setQuery('');
65
67
  close();
66
68
  }, [isManualInput]);
67
69
 
68
70
  const handleChangeQuery = useCallback(
69
71
  (newQuery: string) => {
70
72
  setQuery(newQuery);
71
- isManualInput && onChange?.({ key: newQuery, text: newQuery, innDaData: {} });
73
+ isManualInput && onChange?.({ key: newQuery, text: newQuery });
72
74
  debouncedOnSearchQuery?.(newQuery);
73
75
  },
74
76
  [isManualInput, onChange, debouncedOnSearchQuery],
75
77
  );
76
- const selectState = { query, value, options, isOpen, iconVersion };
78
+ const selectState = { query, value, options, isOpen, iconVersion, renderOptions, isSearch };
77
79
  const inputRef = useSelectPopup({
78
80
  onChange,
79
81
  onClose: handleClose,
@@ -3,15 +3,18 @@ import { type ControlProps } from '../../model/ControlProps';
3
3
  import { type IconVersion } from '../../model/IconVersion';
4
4
  import { style } from '../../utils/style';
5
5
  import { Icon } from '../Icon/Icon';
6
- import { Text } from '../Text/Text';
7
6
  import { filterOptions } from './filterOptions';
8
7
  import { formatOption } from './formatOption';
9
- import { type Option } from './Option';
8
+ import { type Option, type OptionWithData } from './Option';
10
9
 
11
- export interface SelectPopupProps extends ControlProps<Option> {
10
+ export interface SelectPopupProps extends ControlProps<Option>, SelectSearchProps {
12
11
  iconVersion?: IconVersion;
13
12
  options?: Option[];
14
13
  popupRef?: { current: HTMLDivElement | null };
14
+ renderOptions?: (option: OptionWithData) => void;
15
+ }
16
+
17
+ interface SelectSearchProps {
15
18
  query?: string;
16
19
  onChangeQuery?: (value: string) => void;
17
20
  disableFilterOptions?: boolean;
@@ -22,11 +25,13 @@ export const SelectPopup = JSX<SelectPopupProps>(
22
25
  popupRef,
23
26
  options,
24
27
  value,
25
- query,
26
28
  iconVersion,
27
- disableFilterOptions,
28
29
  onChange,
30
+ renderOptions = renderDefaultOptions,
31
+ // TODO: вынести в хук отвечающий за фильтрацию
32
+ query,
29
33
  onChangeQuery,
34
+ disableFilterOptions,
30
35
  }) =>
31
36
  options?.length ? (
32
37
  <div
@@ -48,22 +53,7 @@ export const SelectPopup = JSX<SelectPopupProps>(
48
53
  }
49
54
  }}
50
55
  >
51
- {option?.innDaData ? (
52
- <span>
53
- <Text size="text-s">{option?.innDaData?.companyName}</Text>
54
- <div className="space-x-2">
55
- <Text size="text-s" font="font-light">
56
- {formatOption(option)}
57
- </Text>
58
- <Text size="text-s" font="font-light">
59
- {option?.innDaData?.companyAddress}
60
- </Text>
61
- </div>
62
- </span>
63
- ) : (
64
- <span className="min-h-6">{formatOption(option)}</span>
65
- )}
66
-
56
+ {renderOptions(option)}
67
57
  <Icon
68
58
  name="DoneSimpleIcon"
69
59
  width="16"
@@ -78,3 +68,7 @@ export const SelectPopup = JSX<SelectPopupProps>(
78
68
  </div>
79
69
  ) : null,
80
70
  );
71
+
72
+ const renderDefaultOptions = (option: Option) => (
73
+ <span className="min-h-6">{formatOption(option)}</span>
74
+ );
@@ -10,6 +10,7 @@ interface SelectPopupOptions extends SelectPopupProps, OnCloseProps {
10
10
  isOpen?: boolean;
11
11
  onChangeQuery?: (value: string) => void;
12
12
  disableFilterOptions?: boolean;
13
+ isSearch?: boolean;
13
14
  }
14
15
 
15
16
  export function useSelectPopup({
@@ -22,6 +23,8 @@ export function useSelectPopup({
22
23
  iconVersion,
23
24
  disableFilterOptions = false,
24
25
  onChangeQuery = noop,
26
+ renderOptions,
27
+ isSearch = false,
25
28
  }: SelectPopupOptions) {
26
29
  const popup = usePopupManager();
27
30
 
@@ -34,11 +37,15 @@ export function useSelectPopup({
34
37
  (option: Option) => {
35
38
  close();
36
39
  onChange(option);
37
- onChangeQuery('');
40
+ onChangeQuery(isSearch && option?.text ? option.text : '');
38
41
  },
39
42
  [close, onChange],
40
43
  );
41
44
 
45
+ useEffect(() => {
46
+ onChangeQuery(isSearch && value?.text ? value.text : '');
47
+ }, [value]);
48
+
42
49
  const inputRef = useRef<HTMLDivElement | null>(null);
43
50
  const popupRef = useOutsideClick<HTMLDivElement>(close);
44
51
 
@@ -61,6 +68,7 @@ export function useSelectPopup({
61
68
  disableFilterOptions={disableFilterOptions}
62
69
  onChange={handleChange}
63
70
  onChangeQuery={onChangeQuery}
71
+ renderOptions={renderOptions}
64
72
  />
65
73
  ),
66
74
  top: top + window.scrollY + height,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.913",
3
+ "version": "0.14.915",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -13,7 +13,6 @@ export type LeadRequest = Record<string, JSONRecord | JSONScalar | null> & {
13
13
  fullRegion?: string;
14
14
  secondaryPhoneNumber?: string;
15
15
  partnerSymbolCode?: string;
16
- companyNameByInn?: string;
17
16
  partnerName?: string;
18
17
  };
19
18