@consta/uikit 5.31.0 → 5.32.0

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 (432) hide show
  1. package/ColorPicker/index.d.ts +1 -0
  2. package/ColorPicker/index.js +1 -0
  3. package/__internal__/src/components/Attachment/Attachment.css +1 -1
  4. package/__internal__/src/components/Attachment/types.d.ts +1 -1
  5. package/__internal__/src/components/Attachment/types.js.map +1 -1
  6. package/__internal__/src/components/AttachmentDeprecated/Attachment.css +1 -1
  7. package/__internal__/src/components/AttachmentDeprecated/AttachmentDeprecated.js.map +1 -1
  8. package/__internal__/src/components/AttachmentDeprecated/types.d.ts +1 -1
  9. package/__internal__/src/components/AttachmentDeprecated/types.js.map +1 -1
  10. package/__internal__/src/components/Avatar/Avatar.d.ts +2 -2
  11. package/__internal__/src/components/Avatar/Avatar.js.map +1 -1
  12. package/__internal__/src/components/AvatarGroup/types.d.ts +2 -2
  13. package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
  14. package/__internal__/src/components/Badge/Badge.css +2 -2
  15. package/__internal__/src/components/Badge/maps.js.map +1 -1
  16. package/__internal__/src/components/Badge/types.d.ts +4 -4
  17. package/__internal__/src/components/Badge/types.js.map +1 -1
  18. package/__internal__/src/components/Banner/Banner.d.ts +4 -4
  19. package/__internal__/src/components/Banner/Banner.js.map +1 -1
  20. package/__internal__/src/components/BookmarkTabs/BookmarkTabs.js.map +1 -1
  21. package/__internal__/src/components/BookmarkTabs/types.d.ts +3 -3
  22. package/__internal__/src/components/BookmarkTabs/types.js.map +1 -1
  23. package/__internal__/src/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  24. package/__internal__/src/components/Breadcrumbs/types.d.ts +2 -2
  25. package/__internal__/src/components/Breadcrumbs/types.js.map +1 -1
  26. package/__internal__/src/components/Button/Button.d.ts +4 -4
  27. package/__internal__/src/components/Button/Button.js.map +1 -1
  28. package/__internal__/src/components/Card/Card.d.ts +3 -3
  29. package/__internal__/src/components/Card/Card.js.map +1 -1
  30. package/__internal__/src/components/Checkbox/Checkbox.css +2 -2
  31. package/__internal__/src/components/Checkbox/Checkbox.d.ts +3 -3
  32. package/__internal__/src/components/Checkbox/Checkbox.js.map +1 -1
  33. package/__internal__/src/components/CheckboxDeprecated/Checkbox.css +2 -2
  34. package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.d.ts +3 -3
  35. package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.js.map +1 -1
  36. package/__internal__/src/components/CheckboxGroup/types.d.ts +4 -4
  37. package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
  38. package/__internal__/src/components/Chips/ChipsItem/ChipsItem.css +2 -2
  39. package/__internal__/src/components/Chips/types.d.ts +2 -2
  40. package/__internal__/src/components/Chips/types.js.map +1 -1
  41. package/__internal__/src/components/ChoiceGroup/ChoiceGroup.js.map +1 -1
  42. package/__internal__/src/components/ChoiceGroup/types.d.ts +4 -4
  43. package/__internal__/src/components/ChoiceGroup/types.js.map +1 -1
  44. package/__internal__/src/components/Collapse/types.d.ts +7 -7
  45. package/__internal__/src/components/Collapse/types.js.map +1 -1
  46. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.css +7 -0
  47. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.d.ts +6 -0
  48. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js +2 -0
  49. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js.map +1 -0
  50. package/__internal__/src/components/ColorPicker/ColorControl/index.d.ts +2 -0
  51. package/__internal__/src/components/ColorPicker/ColorControl/index.js +2 -0
  52. package/__internal__/src/components/ColorPicker/ColorControl/index.js.map +1 -0
  53. package/__internal__/src/components/ColorPicker/ColorControl/types.d.ts +6 -0
  54. package/__internal__/src/components/ColorPicker/ColorControl/types.js +2 -0
  55. package/__internal__/src/components/ColorPicker/ColorControl/types.js.map +1 -0
  56. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.css +1 -0
  57. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.d.ts +4 -0
  58. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js +2 -0
  59. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js.map +1 -0
  60. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.d.ts +1 -0
  61. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js +2 -0
  62. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js.map +1 -0
  63. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.d.ts +6 -0
  64. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js +2 -0
  65. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js.map +1 -0
  66. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.css +1 -0
  67. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.d.ts +16 -0
  68. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js +2 -0
  69. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js.map +1 -0
  70. package/__internal__/src/components/ColorPicker/ColorMarker/index.d.ts +1 -0
  71. package/__internal__/src/components/ColorPicker/ColorMarker/index.js +2 -0
  72. package/__internal__/src/components/ColorPicker/ColorMarker/index.js.map +1 -0
  73. package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.d.ts +13 -0
  74. package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js +2 -0
  75. package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js.map +1 -0
  76. package/__internal__/src/components/ColorPicker/ColorPalette/index.d.ts +1 -0
  77. package/__internal__/src/components/ColorPicker/ColorPalette/index.js +2 -0
  78. package/__internal__/src/components/ColorPicker/ColorPalette/index.js.map +1 -0
  79. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.css +1 -0
  80. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.d.ts +3 -0
  81. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js +2 -0
  82. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js.map +1 -0
  83. package/__internal__/src/components/ColorPicker/ColorPicker/index.d.ts +2 -0
  84. package/__internal__/src/components/ColorPicker/ColorPicker/index.js +2 -0
  85. package/__internal__/src/components/ColorPicker/ColorPicker/index.js.map +1 -0
  86. package/__internal__/src/components/ColorPicker/ColorPicker/types.d.ts +25 -0
  87. package/__internal__/src/components/ColorPicker/ColorPicker/types.js +2 -0
  88. package/__internal__/src/components/ColorPicker/ColorPicker/types.js.map +1 -0
  89. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.css +1 -0
  90. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.d.ts +12 -0
  91. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js +2 -0
  92. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js.map +1 -0
  93. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.d.ts +1 -0
  94. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js +2 -0
  95. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js.map +1 -0
  96. package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.d.ts +12 -0
  97. package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js +2 -0
  98. package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js.map +1 -0
  99. package/__internal__/src/components/ColorPicker/ColorPickerBase/index.d.ts +1 -0
  100. package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js +2 -0
  101. package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js.map +1 -0
  102. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.css +1 -0
  103. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.d.ts +12 -0
  104. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js +2 -0
  105. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js.map +1 -0
  106. package/__internal__/src/components/ColorPicker/ColorPickerHue/index.d.ts +1 -0
  107. package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js +2 -0
  108. package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js.map +1 -0
  109. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.css +3 -0
  110. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.d.ts +5 -0
  111. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js +2 -0
  112. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js.map +1 -0
  113. package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.d.ts +12 -0
  114. package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js +2 -0
  115. package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js.map +1 -0
  116. package/__internal__/src/components/ColorPicker/ColorPickerInput/index.d.ts +2 -0
  117. package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js +2 -0
  118. package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js.map +1 -0
  119. package/__internal__/src/components/ColorPicker/ColorPickerInput/types.d.ts +25 -0
  120. package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js +2 -0
  121. package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js.map +1 -0
  122. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.css +1 -0
  123. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.d.ts +15 -0
  124. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js +2 -0
  125. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js.map +1 -0
  126. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.d.ts +1 -0
  127. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js +2 -0
  128. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js.map +1 -0
  129. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.css +1 -0
  130. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.d.ts +8 -0
  131. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js +2 -0
  132. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js.map +1 -0
  133. package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.d.ts +1 -0
  134. package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js +2 -0
  135. package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js.map +1 -0
  136. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.css +1 -0
  137. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.d.ts +16 -0
  138. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js +2 -0
  139. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js.map +1 -0
  140. package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.d.ts +1 -0
  141. package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js +2 -0
  142. package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js.map +1 -0
  143. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.css +1 -0
  144. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.d.ts +13 -0
  145. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js +2 -0
  146. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js.map +1 -0
  147. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.d.ts +1 -0
  148. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js +2 -0
  149. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js.map +1 -0
  150. package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.d.ts +2 -0
  151. package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js +2 -0
  152. package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js.map +1 -0
  153. package/__internal__/src/components/ColorPicker/hooks/useEventCallback.d.ts +1 -0
  154. package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js +2 -0
  155. package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js.map +1 -0
  156. package/__internal__/src/components/ColorPicker/index.d.ts +10 -0
  157. package/__internal__/src/components/ColorPicker/index.js +2 -0
  158. package/__internal__/src/components/ColorPicker/index.js.map +1 -0
  159. package/__internal__/src/components/ColorPicker/models/hexAlphaModel.d.ts +2 -0
  160. package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js +2 -0
  161. package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js.map +1 -0
  162. package/__internal__/src/components/ColorPicker/models/hexModel.d.ts +2 -0
  163. package/__internal__/src/components/ColorPicker/models/hexModel.js +2 -0
  164. package/__internal__/src/components/ColorPicker/models/hexModel.js.map +1 -0
  165. package/__internal__/src/components/ColorPicker/models/hslModel.d.ts +2 -0
  166. package/__internal__/src/components/ColorPicker/models/hslModel.js +2 -0
  167. package/__internal__/src/components/ColorPicker/models/hslModel.js.map +1 -0
  168. package/__internal__/src/components/ColorPicker/models/hslStringModel.d.ts +2 -0
  169. package/__internal__/src/components/ColorPicker/models/hslStringModel.js +2 -0
  170. package/__internal__/src/components/ColorPicker/models/hslStringModel.js.map +1 -0
  171. package/__internal__/src/components/ColorPicker/models/hslaModel.d.ts +2 -0
  172. package/__internal__/src/components/ColorPicker/models/hslaModel.js +2 -0
  173. package/__internal__/src/components/ColorPicker/models/hslaModel.js.map +1 -0
  174. package/__internal__/src/components/ColorPicker/models/hslaStringModel.d.ts +2 -0
  175. package/__internal__/src/components/ColorPicker/models/hslaStringModel.js +2 -0
  176. package/__internal__/src/components/ColorPicker/models/hslaStringModel.js.map +1 -0
  177. package/__internal__/src/components/ColorPicker/models/hsvModel.d.ts +2 -0
  178. package/__internal__/src/components/ColorPicker/models/hsvModel.js +2 -0
  179. package/__internal__/src/components/ColorPicker/models/hsvModel.js.map +1 -0
  180. package/__internal__/src/components/ColorPicker/models/hsvStringModel.d.ts +2 -0
  181. package/__internal__/src/components/ColorPicker/models/hsvStringModel.js +2 -0
  182. package/__internal__/src/components/ColorPicker/models/hsvStringModel.js.map +1 -0
  183. package/__internal__/src/components/ColorPicker/models/hsvaModel.d.ts +2 -0
  184. package/__internal__/src/components/ColorPicker/models/hsvaModel.js +2 -0
  185. package/__internal__/src/components/ColorPicker/models/hsvaModel.js.map +1 -0
  186. package/__internal__/src/components/ColorPicker/models/hsvaStringModel.d.ts +2 -0
  187. package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js +2 -0
  188. package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js.map +1 -0
  189. package/__internal__/src/components/ColorPicker/models/index.d.ts +14 -0
  190. package/__internal__/src/components/ColorPicker/models/index.js +2 -0
  191. package/__internal__/src/components/ColorPicker/models/index.js.map +1 -0
  192. package/__internal__/src/components/ColorPicker/models/rgbModel.d.ts +2 -0
  193. package/__internal__/src/components/ColorPicker/models/rgbModel.js +2 -0
  194. package/__internal__/src/components/ColorPicker/models/rgbModel.js.map +1 -0
  195. package/__internal__/src/components/ColorPicker/models/rgbStringModel.d.ts +2 -0
  196. package/__internal__/src/components/ColorPicker/models/rgbStringModel.js +2 -0
  197. package/__internal__/src/components/ColorPicker/models/rgbStringModel.js.map +1 -0
  198. package/__internal__/src/components/ColorPicker/models/rgbaModel.d.ts +2 -0
  199. package/__internal__/src/components/ColorPicker/models/rgbaModel.js +2 -0
  200. package/__internal__/src/components/ColorPicker/models/rgbaModel.js.map +1 -0
  201. package/__internal__/src/components/ColorPicker/models/rgbaStringModel.d.ts +2 -0
  202. package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js +2 -0
  203. package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js.map +1 -0
  204. package/__internal__/src/components/ColorPicker/types.d.ts +33 -0
  205. package/__internal__/src/components/ColorPicker/types.js +2 -0
  206. package/__internal__/src/components/ColorPicker/types.js.map +1 -0
  207. package/__internal__/src/components/ColorPicker/utils/clamp.d.ts +1 -0
  208. package/__internal__/src/components/ColorPicker/utils/clamp.js +2 -0
  209. package/__internal__/src/components/ColorPicker/utils/clamp.js.map +1 -0
  210. package/__internal__/src/components/ColorPicker/utils/compare.d.ts +4 -0
  211. package/__internal__/src/components/ColorPicker/utils/compare.js +2 -0
  212. package/__internal__/src/components/ColorPicker/utils/compare.js.map +1 -0
  213. package/__internal__/src/components/ColorPicker/utils/convert.d.ts +32 -0
  214. package/__internal__/src/components/ColorPicker/utils/convert.js +2 -0
  215. package/__internal__/src/components/ColorPicker/utils/convert.js.map +1 -0
  216. package/__internal__/src/components/ColorPicker/utils/format.d.ts +1 -0
  217. package/__internal__/src/components/ColorPicker/utils/format.js +2 -0
  218. package/__internal__/src/components/ColorPicker/utils/format.js.map +1 -0
  219. package/__internal__/src/components/ColorPicker/utils/round.d.ts +1 -0
  220. package/__internal__/src/components/ColorPicker/utils/round.js +2 -0
  221. package/__internal__/src/components/ColorPicker/utils/round.js.map +1 -0
  222. package/__internal__/src/components/ColorPicker/utils/validate.d.ts +1 -0
  223. package/__internal__/src/components/ColorPicker/utils/validate.js +2 -0
  224. package/__internal__/src/components/ColorPicker/utils/validate.js.map +1 -0
  225. package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
  226. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
  227. package/__internal__/src/components/ContextMenu/types.d.ts +3 -3
  228. package/__internal__/src/components/ContextMenu/types.js.map +1 -1
  229. package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.d.ts +1 -0
  230. package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js.map +1 -1
  231. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
  232. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
  233. package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +1 -1
  234. package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +1 -1
  235. package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +1 -1
  236. package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js +1 -1
  237. package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js.map +1 -1
  238. package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js +1 -1
  239. package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js.map +1 -1
  240. package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js +1 -1
  241. package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js.map +1 -1
  242. package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +1 -1
  243. package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js.map +1 -1
  244. package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js +1 -1
  245. package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js.map +1 -1
  246. package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js +1 -1
  247. package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js.map +1 -1
  248. package/__internal__/src/components/DatePicker/getChangeFnRange.js +1 -1
  249. package/__internal__/src/components/DatePicker/getChangeFnRange.js.map +1 -1
  250. package/__internal__/src/components/DatePicker/helpers.js.map +1 -1
  251. package/__internal__/src/components/DatePicker/types.d.ts +6 -6
  252. package/__internal__/src/components/DatePicker/types.js.map +1 -1
  253. package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js +1 -1
  254. package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js.map +1 -1
  255. package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js +1 -1
  256. package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js.map +1 -1
  257. package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.d.ts +1 -1
  258. package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.js.map +1 -1
  259. package/__internal__/src/components/DateTime/DateTimeGrid/DateTimeGrid.css +1 -1
  260. package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js +1 -1
  261. package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js.map +1 -1
  262. package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js +1 -1
  263. package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js.map +1 -1
  264. package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js +1 -1
  265. package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js.map +1 -1
  266. package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js +1 -1
  267. package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js.map +1 -1
  268. package/__internal__/src/components/DateTime/helpers/index.js +1 -1
  269. package/__internal__/src/components/DateTime/helpers/index.js.map +1 -1
  270. package/__internal__/src/components/DateTime/helpers/types.d.ts +4 -3
  271. package/__internal__/src/components/DateTime/helpers/types.js.map +1 -1
  272. package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.css +1 -1
  273. package/__internal__/src/components/DragNDropFieldCanary/types.d.ts +1 -1
  274. package/__internal__/src/components/DragNDropFieldCanary/types.js.map +1 -1
  275. package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.css +4 -2
  276. package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js +1 -1
  277. package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js.map +1 -1
  278. package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.d.ts +5 -2
  279. package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js +1 -1
  280. package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js.map +1 -1
  281. package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.d.ts +1 -0
  282. package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js +1 -1
  283. package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js.map +1 -1
  284. package/__internal__/src/components/FieldGroup/getForm.js +1 -1
  285. package/__internal__/src/components/FieldGroup/getForm.js.map +1 -1
  286. package/__internal__/src/components/FileCanary/types.d.ts +1 -1
  287. package/__internal__/src/components/FileCanary/types.js.map +1 -1
  288. package/__internal__/src/components/FlatSelect/FlatSelect.css +8 -8
  289. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.d.ts +1 -1
  290. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js.map +1 -1
  291. package/__internal__/src/components/Grid/types.d.ts +4 -4
  292. package/__internal__/src/components/Grid/types.js.map +1 -1
  293. package/__internal__/src/components/GridDeprecated/Grid.css +1 -1
  294. package/__internal__/src/components/GridDeprecated/GridDeprecated.d.ts +4 -4
  295. package/__internal__/src/components/GridDeprecated/GridDeprecated.js.map +1 -1
  296. package/__internal__/src/components/Informer/Informer.d.ts +3 -3
  297. package/__internal__/src/components/Informer/Informer.js.map +1 -1
  298. package/__internal__/src/components/Layout/Layout.d.ts +3 -3
  299. package/__internal__/src/components/Layout/Layout.js.map +1 -1
  300. package/__internal__/src/components/Layout/useFixed.d.ts +2 -2
  301. package/__internal__/src/components/Layout/useFixed.js.map +1 -1
  302. package/__internal__/src/components/ListCanary/ListCanary.js.map +1 -1
  303. package/__internal__/src/components/ListCanary/ListItemGrid/ListItemGrid.css +1 -1
  304. package/__internal__/src/components/ListCanary/types.d.ts +4 -4
  305. package/__internal__/src/components/ListCanary/types.js.map +1 -1
  306. package/__internal__/src/components/LoaderDeprecated/Loader.css +2 -2
  307. package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.d.ts +1 -1
  308. package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.js.map +1 -1
  309. package/__internal__/src/components/Modal/ModalLayout/ModalLayout.css +4 -4
  310. package/__internal__/src/components/ModalDeprecated/ModalDeprecated.d.ts +2 -2
  311. package/__internal__/src/components/ModalDeprecated/ModalDeprecated.js.map +1 -1
  312. package/__internal__/src/components/Notification/helpers/defaultDateFormat.js +1 -1
  313. package/__internal__/src/components/Notification/helpers/defaultDateFormat.js.map +1 -1
  314. package/__internal__/src/components/Pagination/types.d.ts +3 -3
  315. package/__internal__/src/components/Pagination/types.js.map +1 -1
  316. package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.d.ts +4 -4
  317. package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.js.map +1 -1
  318. package/__internal__/src/components/Popover/Popover.d.ts +2 -2
  319. package/__internal__/src/components/Popover/Popover.js.map +1 -1
  320. package/__internal__/src/components/ProgressLine/ProgressLine.css +1 -1
  321. package/__internal__/src/components/ProgressLine/types.d.ts +1 -1
  322. package/__internal__/src/components/ProgressLine/types.js.map +1 -1
  323. package/__internal__/src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
  324. package/__internal__/src/components/ProgressSpin/ProgressSpin.js.map +1 -1
  325. package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css +8 -8
  326. package/__internal__/src/components/ProgressStepBar/helpers.d.ts +5 -5
  327. package/__internal__/src/components/ProgressStepBar/helpers.js.map +1 -1
  328. package/__internal__/src/components/Radio/Radio.css +1 -1
  329. package/__internal__/src/components/Radio/Radio.d.ts +3 -3
  330. package/__internal__/src/components/Radio/Radio.js.map +1 -1
  331. package/__internal__/src/components/RadioGroup/types.d.ts +4 -4
  332. package/__internal__/src/components/RadioGroup/types.js.map +1 -1
  333. package/__internal__/src/components/Responses/Responses.d.ts +1 -1
  334. package/__internal__/src/components/Responses/Responses.js.map +1 -1
  335. package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.d.ts +1 -1
  336. package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.js.map +1 -1
  337. package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.css +2 -2
  338. package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.d.ts +1 -1
  339. package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.js.map +1 -1
  340. package/__internal__/src/components/SelectCanary/helpers.d.ts +1 -1
  341. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +1 -1
  342. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
  343. package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.css +1 -1
  344. package/__internal__/src/components/SelectComponents/types.d.ts +4 -4
  345. package/__internal__/src/components/SelectComponents/types.js.map +1 -1
  346. package/__internal__/src/components/SelectComponents/useSelect/useSelect.js +1 -1
  347. package/__internal__/src/components/SelectComponents/useSelect/useSelect.js.map +1 -1
  348. package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.d.ts +1 -1
  349. package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js.map +1 -1
  350. package/__internal__/src/components/SelectComponentsDeprecated/SelectValueTag/SelectValueTag.css +1 -1
  351. package/__internal__/src/components/SelectComponentsDeprecated/types.d.ts +4 -4
  352. package/__internal__/src/components/SelectComponentsDeprecated/types.js.map +1 -1
  353. package/__internal__/src/components/Sidebar/types.d.ts +2 -2
  354. package/__internal__/src/components/Sidebar/types.js.map +1 -1
  355. package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.d.ts +2 -2
  356. package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.js.map +1 -1
  357. package/__internal__/src/components/Skeleton/Skeleton.css +1 -1
  358. package/__internal__/src/components/Slider/helper.d.ts +2 -2
  359. package/__internal__/src/components/Slider/helper.js.map +1 -1
  360. package/__internal__/src/components/SnackBar/types.d.ts +4 -4
  361. package/__internal__/src/components/SnackBar/types.js.map +1 -1
  362. package/__internal__/src/components/Spoiler/types.d.ts +2 -2
  363. package/__internal__/src/components/Spoiler/types.js.map +1 -1
  364. package/__internal__/src/components/Steps/StepsStep/StepsStep.css +1 -1
  365. package/__internal__/src/components/Steps/types.d.ts +1 -1
  366. package/__internal__/src/components/Steps/types.js.map +1 -1
  367. package/__internal__/src/components/Switch/Switch.css +1 -1
  368. package/__internal__/src/components/Switch/types.d.ts +3 -3
  369. package/__internal__/src/components/Switch/types.js.map +1 -1
  370. package/__internal__/src/components/SwitchGroup/types.d.ts +1 -1
  371. package/__internal__/src/components/SwitchGroup/types.js.map +1 -1
  372. package/__internal__/src/components/Table/Cell/TableCell.css +1 -1
  373. package/__internal__/src/components/Table/Cell/TableCell.d.ts +2 -2
  374. package/__internal__/src/components/Table/Cell/TableCell.js.map +1 -1
  375. package/__internal__/src/components/Table/Header/TableHeader.d.ts +1 -1
  376. package/__internal__/src/components/Table/Header/TableHeader.js.map +1 -1
  377. package/__internal__/src/components/Table/Table.d.ts +3 -3
  378. package/__internal__/src/components/Table/Table.js.map +1 -1
  379. package/__internal__/src/components/Table/__mock__/data.mock.d.ts +10 -10
  380. package/__internal__/src/components/Table/__mock__/data.mock.js.map +1 -1
  381. package/__internal__/src/components/Table/helpers.d.ts +1 -1
  382. package/__internal__/src/components/Table/helpers.js.map +1 -1
  383. package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
  384. package/__internal__/src/components/Tabs/types.d.ts +4 -4
  385. package/__internal__/src/components/Tabs/types.js.map +1 -1
  386. package/__internal__/src/components/Tag/Tag.d.ts +1 -1
  387. package/__internal__/src/components/Tag/Tag.js.map +1 -1
  388. package/__internal__/src/components/TagBase/TagBase.d.ts +3 -3
  389. package/__internal__/src/components/TagBase/TagBase.js.map +1 -1
  390. package/__internal__/src/components/Text/Text.d.ts +13 -13
  391. package/__internal__/src/components/Text/Text.js.map +1 -1
  392. package/__internal__/src/components/TextAreaAutoSize/TextAreaAutoSize.css +1 -1
  393. package/__internal__/src/components/TextDeprecated/TextDeprecated.d.ts +13 -13
  394. package/__internal__/src/components/TextDeprecated/TextDeprecated.js.map +1 -1
  395. package/__internal__/src/components/TextField/types.d.ts +4 -4
  396. package/__internal__/src/components/TextField/types.js.map +1 -1
  397. package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js +1 -1
  398. package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js.map +1 -1
  399. package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.css +2 -2
  400. package/__internal__/src/components/TextFieldCanary/useTextField.js.map +1 -1
  401. package/__internal__/src/components/ThemeToggler/ThemeToggler.js.map +1 -1
  402. package/__internal__/src/components/ThemeToggler/types.d.ts +1 -1
  403. package/__internal__/src/components/ThemeToggler/types.js.map +1 -1
  404. package/__internal__/src/components/Timer/Timer.d.ts +1 -1
  405. package/__internal__/src/components/Timer/Timer.js.map +1 -1
  406. package/__internal__/src/components/Tooltip/types.d.ts +2 -2
  407. package/__internal__/src/components/Tooltip/types.js.map +1 -1
  408. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.d.ts +2 -2
  409. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.js.map +1 -1
  410. package/__internal__/src/components/User/User.css +1 -1
  411. package/__internal__/src/components/User/User.d.ts +4 -4
  412. package/__internal__/src/components/User/User.js.map +1 -1
  413. package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.css +1 -1
  414. package/__internal__/src/fileIcons/FileIcon/FileIcon.d.ts +1 -1
  415. package/__internal__/src/fileIcons/FileIcon/FileIcon.js.map +1 -1
  416. package/__internal__/src/hocs/withTooltip/withTooltip.d.ts +1 -1
  417. package/__internal__/src/hocs/withTooltip/withTooltip.js.map +1 -1
  418. package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.d.ts +1 -1
  419. package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.js.map +1 -1
  420. package/__internal__/src/hooks/useRefs/useRefs.js.map +1 -1
  421. package/__internal__/src/hooks/useStyleProps/types.js.map +1 -1
  422. package/__internal__/src/mixs/MixCard/MixCard.d.ts +2 -2
  423. package/__internal__/src/mixs/MixCard/MixCard.js.map +1 -1
  424. package/__internal__/src/mixs/MixFlex/MixFlex.d.ts +5 -5
  425. package/__internal__/src/mixs/MixFlex/MixFlex.js.map +1 -1
  426. package/__internal__/src/mixs/MixScrollBar/MixScrollBar.d.ts +2 -2
  427. package/__internal__/src/mixs/MixScrollBar/MixScrollBar.js.map +1 -1
  428. package/__internal__/src/mixs/MixVisuallyHidden/MixVisuallyHidden.css +1 -1
  429. package/__internal__/src/utils/array.js.map +1 -1
  430. package/__internal__/src/utils/date/index.js +1 -1
  431. package/__internal__/src/utils/date/index.js.map +1 -1
  432. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["cn","progressStepBarPropSize","progressStepBarPropSizeDefault","progressStepBarPropDirection","progressStepBarPropDirectionDefault","progressStepBarPropStatus","progressStepBarPropStatusDefault","progressStepBarPointNumbersMap","progressStepBarPropPosition","progressStepBarPropPositionDefault","cnProgressStepBar","defaultGetItemLabel","item","label","defaultGetItemTooltipContent","tooltipContent","defaultGetItemPoint","point","defaultGetItemLineStatus","lineStatus","defaultGetItemProgress","progress","defaultGetItemContent","content","defaultGetItemStatus","status","defaultGetItemOnClick","onClick","withDefaultGetters","props","getItemLabel","getItemTooltipContent","getItemPoint","getItemProgress","getItemContent","getItemStatus","getItemLineStatus","getItemOnClick","getItemPosition","index","length","position","getRefSize","ref","current","getBoundingClientRect","width","height","calculateLines","refs","direction","sizes","i","width1","height1","width2","size","first","second","push","validateVisibleIndex","Math","min"],"sources":["../../../../../src/components/ProgressStepBar/helpers.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const progressStepBarPropSize = ['s', 'xs', 'm'] as const;\nexport type ProgressStepBarPropSize = typeof progressStepBarPropSize[number];\nexport const progressStepBarPropSizeDefault = progressStepBarPropSize[0];\n\nexport const progressStepBarPropDirection = ['horizontal', 'vertical'] as const;\nexport type ProgressStepBarPropDirection =\n typeof progressStepBarPropDirection[number];\nexport const progressStepBarPropDirectionDefault =\n progressStepBarPropDirection[0];\n\nexport const progressStepBarPropStatus = [\n 'normal',\n 'success',\n 'warning',\n 'alert',\n] as const;\nexport type ProgressStepBarPropStatus =\n typeof progressStepBarPropStatus[number];\nexport const progressStepBarPropStatusDefault = progressStepBarPropStatus[0];\n\nexport const progressStepBarPointNumbersMap = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n] as const;\nexport type ProgressStepBarPointNumbersMap =\n typeof progressStepBarPointNumbersMap[number];\n\nexport const progressStepBarPropPosition = ['center', 'start', 'end'] as const;\nexport type ProgressStepBarPropPosition =\n typeof progressStepBarPropPosition[number];\nexport const progressStepBarPropPositionDefault: ProgressStepBarPropPosition =\n progressStepBarPropPosition[0];\n\nexport type ProgressStepBarPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type ProgressStepBarPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number;\nexport type ProgressStepBarPropGetItemTooltipContent<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type ProgressStepBarPropGetItemLineStatus<ITEM> = (\n item: ITEM,\n) => ProgressStepBarPropStatus | undefined;\nexport type ProgressStepBarPropGetItemPoint<ITEM> = (\n item: ITEM,\n) => ProgressStepBarPointNumbersMap | IconComponent | undefined;\nexport type ProgressStepBarPropGetItemProgress<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ProgressStepBarPropGetItemContent<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\nexport type ProgressStepBarPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ProgressStepBarPropStatus | undefined;\nexport type ProgressStepBarPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\n\nexport type ProgressStepBarItemDefault = {\n label?: string;\n tooltipContent?: string;\n lineStatus?: ProgressStepBarPropStatus;\n point?: ProgressStepBarPointNumbersMap | IconComponent;\n status?: ProgressStepBarPropStatus;\n progress?: boolean;\n content?: React.ReactNode;\n onClick?: React.EventHandler<React.MouseEvent>;\n};\n\nexport type Line = {\n status: ProgressStepBarPropStatus;\n size: number;\n};\n\nexport type ProgressStepBarPropOnItemClick<ITEM> = (\n item: ITEM,\n props: {\n e: React.MouseEvent;\n index: number;\n },\n) => void;\n\nexport type ProgressStepBarProps<ITEM = ProgressStepBarItemDefault> =\n PropsWithHTMLAttributesAndRef<\n {\n steps: ITEM[];\n direction?: ProgressStepBarPropDirection;\n size?: ProgressStepBarPropSize;\n activeStepIndex?: number;\n onItemClick?: ProgressStepBarPropOnItemClick<ITEM>;\n getItemLabel?: ProgressStepBarPropGetItemLabel<ITEM>;\n getItemLineStatus?: ProgressStepBarPropGetItemLineStatus<ITEM>;\n getItemTooltipContent?: ProgressStepBarPropGetItemTooltipContent<ITEM>;\n getItemPoint?: ProgressStepBarPropGetItemPoint<ITEM>;\n getItemProgress?: ProgressStepBarPropGetItemProgress<ITEM>;\n getItemContent?: ProgressStepBarPropGetItemContent<ITEM>;\n getItemStatus?: ProgressStepBarPropGetItemStatus<ITEM>;\n getItemOnClick?: ProgressStepBarPropGetItemOnClick<ITEM>;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: ProgressStepBarItemDefault['label'] }\n ? {}\n : { getItemLabel: ProgressStepBarPropGetItemLabel<ITEM> });\n\nexport type ProgressStepBarItemProps = {\n content?: React.ReactNode;\n label?: string;\n point?: ProgressStepBarPointNumbersMap | IconComponent;\n progress?: boolean;\n status?: ProgressStepBarPropStatus | 'system';\n tooltipContent?: string;\n tooltipZIndex?: number;\n position?: ProgressStepBarPropPosition;\n direction: ProgressStepBarPropDirection;\n size: ProgressStepBarPropSize;\n onClick?: (e: React.MouseEvent) => void;\n pointRef?: React.RefObject<HTMLButtonElement>;\n className?: string;\n};\n\nexport const cnProgressStepBar = cn('ProgressStepBar');\n\nexport const defaultGetItemLabel: ProgressStepBarPropGetItemLabel<\n ProgressStepBarItemDefault\n> = (item) => item.label;\nexport const defaultGetItemTooltipContent: ProgressStepBarPropGetItemTooltipContent<\n ProgressStepBarItemDefault\n> = (item) => item.tooltipContent;\nexport const defaultGetItemPoint: ProgressStepBarPropGetItemPoint<\n ProgressStepBarItemDefault\n> = (item) => item.point;\nexport const defaultGetItemLineStatus: ProgressStepBarPropGetItemLineStatus<\n ProgressStepBarItemDefault\n> = (item) => item.lineStatus;\nexport const defaultGetItemProgress: ProgressStepBarPropGetItemProgress<\n ProgressStepBarItemDefault\n> = (item) => item.progress;\nexport const defaultGetItemContent: ProgressStepBarPropGetItemContent<\n ProgressStepBarItemDefault\n> = (item) => item.content;\nexport const defaultGetItemStatus: ProgressStepBarPropGetItemStatus<\n ProgressStepBarItemDefault\n> = (item) => item.status;\nexport const defaultGetItemOnClick: ProgressStepBarPropGetItemOnClick<\n ProgressStepBarItemDefault\n> = (item) => item.onClick;\n\nexport type ProgressStepBarComponent = <ITEM = ProgressStepBarItemDefault>(\n props: ProgressStepBarProps<ITEM>,\n) => React.ReactNode | null;\n\nexport type ProgressStepBarItemComponent = (\n props: PropsWithHTMLAttributesAndRef<\n ProgressStepBarItemProps,\n HTMLDivElement\n >,\n) => React.ReactNode | null;\n\nexport function withDefaultGetters<ITEM>(props: ProgressStepBarProps<ITEM>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemTooltipContent:\n props.getItemTooltipContent || defaultGetItemTooltipContent,\n getItemPoint: props.getItemPoint || defaultGetItemPoint,\n getItemProgress: props.getItemProgress || defaultGetItemProgress,\n getItemContent: props.getItemContent || defaultGetItemContent,\n getItemStatus: props.getItemStatus || defaultGetItemStatus,\n getItemLineStatus: props.getItemLineStatus || defaultGetItemLineStatus,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n };\n}\n\nexport const getItemPosition = (index: number, length: number) => {\n let position: ProgressStepBarPropPosition = 'center';\n if (index === length - 1) position = 'end';\n if (index === 0) position = 'start';\n\n return position;\n};\n\nconst getRefSize = (ref: React.RefObject<HTMLElement>) => {\n if (ref.current) {\n const { width, height } = ref.current.getBoundingClientRect();\n return [width, height];\n }\n return [0, 0];\n};\n\nexport const calculateLines = (\n refs: React.RefObject<HTMLElement>[],\n direction: ProgressStepBarPropDirection,\n) => {\n const sizes: number[] = [];\n const { length } = refs;\n\n if (length < 2) {\n return sizes;\n }\n\n for (let i = 0; i < length - 1; i++) {\n const [width1, height1] = getRefSize(refs[i]);\n const [width2] = getRefSize(refs[i + 1]);\n\n let size = 0;\n if (direction === 'horizontal') {\n const first = i === 0 ? width1 : width1 / 2;\n const second = i === length - 2 ? width2 : width2 / 2;\n size = first + second;\n } else {\n size = height1;\n if (i === length - 2) {\n size += 2;\n }\n }\n sizes.push(size);\n }\n\n return sizes;\n};\n\nexport const validateVisibleIndex = (\n length: number,\n index: number | undefined,\n) => {\n if (!index) {\n return index;\n }\n\n if (index < 0) {\n return undefined;\n }\n\n return Math.min(index, length - 1);\n};\n"],"mappings":"suBAGA,OAASA,EAAT,uBAGA,M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AAO,IAAMC,eAAc,CAAG,SAC5BC,CAD4B,CAE5BC,CAF4B,CAGzB,IACGC,EAAe,CAAG,EADrB,CAEKX,CAFL,CAEgBS,CAFhB,CAEKT,MAFL,CAIH,GAAa,CAAT,CAAAA,CAAJ,CACE,MAAOW,EAAP,CAGF,IAAK,GAAIC,EAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGZ,CAAM,CAAG,CAA7B,CAAgCY,CAAC,EAAjC,CAAqC,OACTV,UAAU,CAACO,CAAI,CAACG,CAAD,CAAL,CADD,uBAC5BC,CAD4B,MACpBC,CADoB,QAElBZ,UAAU,CAACO,CAAI,CAACG,CAAC,CAAG,CAAL,CAAL,CAFQ,uBAE5BG,CAF4B,MAI/BC,CAAI,CAAG,CAJwB,CAKnC,GAAkB,YAAd,GAAAN,CAAJ,CAAgC,IACxBO,EAAK,CAAS,CAAN,GAAAL,CAAC,CAASC,CAAT,CAAkBA,CAAM,CAAG,CADZ,CAExBK,CAAM,CAAGN,CAAC,GAAKZ,CAAM,CAAG,CAAf,CAAmBe,CAAnB,CAA4BA,CAAM,CAAG,CAFtB,CAG9BC,CAAI,CAAGC,CAAK,CAAGC,CAChB,CAJD,IAKEF,EAAI,CAAGF,CALT,CAMMF,CAAC,GAAKZ,CAAM,CAAG,CANrB,GAOIgB,CAAI,EAAI,CAPZ,EAUAL,CAAK,CAACQ,IAAN,CAAWH,CAAX,CACD,CAED,MAAOL,EACR,CA9BM,CAgCP,MAAO,IAAMS,qBAAoB,CAAG,SAClCpB,CADkC,CAElCD,CAFkC,CAG/B,OACEA,EADF,CAKS,CAAR,CAAAA,CALD,QASIsB,IAAI,CAACC,GAAL,CAASvB,CAAT,CAAgBC,CAAM,CAAG,CAAzB,CATJ,CAEMD,CAQV,CAbM"}
1
+ {"version":3,"file":"helpers.js","names":["cn","progressStepBarPropSize","progressStepBarPropSizeDefault","progressStepBarPropDirection","progressStepBarPropDirectionDefault","progressStepBarPropStatus","progressStepBarPropStatusDefault","progressStepBarPointNumbersMap","progressStepBarPropPosition","progressStepBarPropPositionDefault","cnProgressStepBar","defaultGetItemLabel","item","label","defaultGetItemTooltipContent","tooltipContent","defaultGetItemPoint","point","defaultGetItemLineStatus","lineStatus","defaultGetItemProgress","progress","defaultGetItemContent","content","defaultGetItemStatus","status","defaultGetItemOnClick","onClick","withDefaultGetters","props","getItemLabel","getItemTooltipContent","getItemPoint","getItemProgress","getItemContent","getItemStatus","getItemLineStatus","getItemOnClick","getItemPosition","index","length","position","getRefSize","ref","current","getBoundingClientRect","width","height","calculateLines","refs","direction","sizes","i","width1","height1","width2","size","first","second","push","validateVisibleIndex","Math","min"],"sources":["../../../../../src/components/ProgressStepBar/helpers.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const progressStepBarPropSize = ['s', 'xs', 'm'] as const;\nexport type ProgressStepBarPropSize = (typeof progressStepBarPropSize)[number];\nexport const progressStepBarPropSizeDefault = progressStepBarPropSize[0];\n\nexport const progressStepBarPropDirection = ['horizontal', 'vertical'] as const;\nexport type ProgressStepBarPropDirection =\n (typeof progressStepBarPropDirection)[number];\nexport const progressStepBarPropDirectionDefault =\n progressStepBarPropDirection[0];\n\nexport const progressStepBarPropStatus = [\n 'normal',\n 'success',\n 'warning',\n 'alert',\n] as const;\nexport type ProgressStepBarPropStatus =\n (typeof progressStepBarPropStatus)[number];\nexport const progressStepBarPropStatusDefault = progressStepBarPropStatus[0];\n\nexport const progressStepBarPointNumbersMap = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n] as const;\nexport type ProgressStepBarPointNumbersMap =\n (typeof progressStepBarPointNumbersMap)[number];\n\nexport const progressStepBarPropPosition = ['center', 'start', 'end'] as const;\nexport type ProgressStepBarPropPosition =\n (typeof progressStepBarPropPosition)[number];\nexport const progressStepBarPropPositionDefault: ProgressStepBarPropPosition =\n progressStepBarPropPosition[0];\n\nexport type ProgressStepBarPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type ProgressStepBarPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number;\nexport type ProgressStepBarPropGetItemTooltipContent<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type ProgressStepBarPropGetItemLineStatus<ITEM> = (\n item: ITEM,\n) => ProgressStepBarPropStatus | undefined;\nexport type ProgressStepBarPropGetItemPoint<ITEM> = (\n item: ITEM,\n) => ProgressStepBarPointNumbersMap | IconComponent | undefined;\nexport type ProgressStepBarPropGetItemProgress<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ProgressStepBarPropGetItemContent<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\nexport type ProgressStepBarPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ProgressStepBarPropStatus | undefined;\nexport type ProgressStepBarPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\n\nexport type ProgressStepBarItemDefault = {\n label?: string;\n tooltipContent?: string;\n lineStatus?: ProgressStepBarPropStatus;\n point?: ProgressStepBarPointNumbersMap | IconComponent;\n status?: ProgressStepBarPropStatus;\n progress?: boolean;\n content?: React.ReactNode;\n onClick?: React.EventHandler<React.MouseEvent>;\n};\n\nexport type Line = {\n status: ProgressStepBarPropStatus;\n size: number;\n};\n\nexport type ProgressStepBarPropOnItemClick<ITEM> = (\n item: ITEM,\n props: {\n e: React.MouseEvent;\n index: number;\n },\n) => void;\n\nexport type ProgressStepBarProps<ITEM = ProgressStepBarItemDefault> =\n PropsWithHTMLAttributesAndRef<\n {\n steps: ITEM[];\n direction?: ProgressStepBarPropDirection;\n size?: ProgressStepBarPropSize;\n activeStepIndex?: number;\n onItemClick?: ProgressStepBarPropOnItemClick<ITEM>;\n getItemLabel?: ProgressStepBarPropGetItemLabel<ITEM>;\n getItemLineStatus?: ProgressStepBarPropGetItemLineStatus<ITEM>;\n getItemTooltipContent?: ProgressStepBarPropGetItemTooltipContent<ITEM>;\n getItemPoint?: ProgressStepBarPropGetItemPoint<ITEM>;\n getItemProgress?: ProgressStepBarPropGetItemProgress<ITEM>;\n getItemContent?: ProgressStepBarPropGetItemContent<ITEM>;\n getItemStatus?: ProgressStepBarPropGetItemStatus<ITEM>;\n getItemOnClick?: ProgressStepBarPropGetItemOnClick<ITEM>;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: ProgressStepBarItemDefault['label'] }\n ? {}\n : { getItemLabel: ProgressStepBarPropGetItemLabel<ITEM> });\n\nexport type ProgressStepBarItemProps = {\n content?: React.ReactNode;\n label?: string;\n point?: ProgressStepBarPointNumbersMap | IconComponent;\n progress?: boolean;\n status?: ProgressStepBarPropStatus | 'system';\n tooltipContent?: string;\n tooltipZIndex?: number;\n position?: ProgressStepBarPropPosition;\n direction: ProgressStepBarPropDirection;\n size: ProgressStepBarPropSize;\n onClick?: (e: React.MouseEvent) => void;\n pointRef?: React.RefObject<HTMLButtonElement>;\n className?: string;\n};\n\nexport const cnProgressStepBar = cn('ProgressStepBar');\n\nexport const defaultGetItemLabel: ProgressStepBarPropGetItemLabel<\n ProgressStepBarItemDefault\n> = (item) => item.label;\nexport const defaultGetItemTooltipContent: ProgressStepBarPropGetItemTooltipContent<\n ProgressStepBarItemDefault\n> = (item) => item.tooltipContent;\nexport const defaultGetItemPoint: ProgressStepBarPropGetItemPoint<\n ProgressStepBarItemDefault\n> = (item) => item.point;\nexport const defaultGetItemLineStatus: ProgressStepBarPropGetItemLineStatus<\n ProgressStepBarItemDefault\n> = (item) => item.lineStatus;\nexport const defaultGetItemProgress: ProgressStepBarPropGetItemProgress<\n ProgressStepBarItemDefault\n> = (item) => item.progress;\nexport const defaultGetItemContent: ProgressStepBarPropGetItemContent<\n ProgressStepBarItemDefault\n> = (item) => item.content;\nexport const defaultGetItemStatus: ProgressStepBarPropGetItemStatus<\n ProgressStepBarItemDefault\n> = (item) => item.status;\nexport const defaultGetItemOnClick: ProgressStepBarPropGetItemOnClick<\n ProgressStepBarItemDefault\n> = (item) => item.onClick;\n\nexport type ProgressStepBarComponent = <ITEM = ProgressStepBarItemDefault>(\n props: ProgressStepBarProps<ITEM>,\n) => React.ReactNode | null;\n\nexport type ProgressStepBarItemComponent = (\n props: PropsWithHTMLAttributesAndRef<\n ProgressStepBarItemProps,\n HTMLDivElement\n >,\n) => React.ReactNode | null;\n\nexport function withDefaultGetters<ITEM>(props: ProgressStepBarProps<ITEM>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemTooltipContent:\n props.getItemTooltipContent || defaultGetItemTooltipContent,\n getItemPoint: props.getItemPoint || defaultGetItemPoint,\n getItemProgress: props.getItemProgress || defaultGetItemProgress,\n getItemContent: props.getItemContent || defaultGetItemContent,\n getItemStatus: props.getItemStatus || defaultGetItemStatus,\n getItemLineStatus: props.getItemLineStatus || defaultGetItemLineStatus,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n };\n}\n\nexport const getItemPosition = (index: number, length: number) => {\n let position: ProgressStepBarPropPosition = 'center';\n if (index === length - 1) position = 'end';\n if (index === 0) position = 'start';\n\n return position;\n};\n\nconst getRefSize = (ref: React.RefObject<HTMLElement>) => {\n if (ref.current) {\n const { width, height } = ref.current.getBoundingClientRect();\n return [width, height];\n }\n return [0, 0];\n};\n\nexport const calculateLines = (\n refs: React.RefObject<HTMLElement>[],\n direction: ProgressStepBarPropDirection,\n) => {\n const sizes: number[] = [];\n const { length } = refs;\n\n if (length < 2) {\n return sizes;\n }\n\n for (let i = 0; i < length - 1; i++) {\n const [width1, height1] = getRefSize(refs[i]);\n const [width2] = getRefSize(refs[i + 1]);\n\n let size = 0;\n if (direction === 'horizontal') {\n const first = i === 0 ? width1 : width1 / 2;\n const second = i === length - 2 ? width2 : width2 / 2;\n size = first + second;\n } else {\n size = height1;\n if (i === length - 2) {\n size += 2;\n }\n }\n sizes.push(size);\n }\n\n return sizes;\n};\n\nexport const validateVisibleIndex = (\n length: number,\n index: number | undefined,\n) => {\n if (!index) {\n return index;\n }\n\n if (index < 0) {\n return undefined;\n }\n\n return Math.min(index, length - 1);\n};\n"],"mappings":"suBAGA,OAASA,EAAT,uBAGA,MAAO,IAAMC,wBAAuB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAhC,CAEP,MAAO,IAAMC,+BAA8B,CAAGD,uBAAuB,CAAC,CAAD,CAA9D,CAEP,MAAO,IAAME,6BAA4B,CAAG,CAAC,YAAD,CAAe,UAAf,CAArC,CAGP,MAAO,IAAMC,oCAAmC,CAC9CD,4BAA4B,CAAC,CAAD,CADvB,CAGP,MAAO,IAAME,0BAAyB,CAAG,CACvC,QADuC,CAEvC,SAFuC,CAGvC,SAHuC,CAIvC,OAJuC,CAAlC,CAQP,MAAO,IAAMC,iCAAgC,CAAGD,yBAAyB,CAAC,CAAD,CAAlE,CAEP,MAAO,IAAME,+BAA8B,CAAG,CAC5C,CAD4C,CACzC,CADyC,CACtC,CADsC,CACnC,CADmC,CAChC,CADgC,CAC7B,CAD6B,CAC1B,CAD0B,CACvB,CADuB,CACpB,CADoB,CACjB,CADiB,CAAvC,CAMP,MAAO,IAAMC,4BAA2B,CAAG,CAAC,QAAD,CAAW,OAAX,CAAoB,KAApB,CAApC,CAGP,MAAO,IAAMC,mCAA+D,CAC1ED,2BAA2B,CAAC,CAAD,CADtB,CA8FP,MAAO,IAAME,kBAAiB,CAAGV,EAAE,CAAC,iBAAD,CAA5B,CAEP,MAAO,IAAMW,oBAEZ,CAAG,SAACC,CAAD,QAAUA,EAAI,CAACC,KAAf,CAFG,CAGP,MAAO,IAAMC,6BAEZ,CAAG,SAACF,CAAD,QAAUA,EAAI,CAACG,cAAf,CAFG,CAGP,MAAO,IAAMC,oBAEZ,CAAG,SAACJ,CAAD,QAAUA,EAAI,CAACK,KAAf,CAFG,CAGP,MAAO,IAAMC,yBAEZ,CAAG,SAACN,CAAD,QAAUA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CATJ,CAEMD,CAQV,CAbM"}
@@ -1 +1 @@
1
- .Radio{display:inline-flex;font-family:var(--font-sans);line-height:var(--line-height-text-s)}.Radio,.Radio-Input{cursor:pointer;position:relative}.Radio-Input{-webkit-appearance:none;border:var(--control-border-width) solid;border-radius:50%;box-sizing:border-box;flex-shrink:0;height:var(--radio-size);margin:0;transition:border-color .15s,background-color .15s;width:var(--radio-size)}.Radio-Input:before{border-radius:50%;box-sizing:border-box;content:"";height:var(--radio-size);left:calc(50% - var(--radio-size)/2);opacity:0;position:absolute;top:calc(50% - var(--radio-size)/2);transform:scale(0);transition:background-color .15s,opacity .15s,transform .15s;width:var(--radio-size)}.Radio-Label{color:var(--color-control-typo-default);font-size:var(--radio-font-size);margin-left:var(--radio-offset)}.Radio_size_xs{--radio-font-size:var(--control-text-size-xs);--radio-size:var(--control-box-size-m);--radio-offset:var(--space-xs);--align-top-margin:0}.Radio_size_s{--radio-font-size:var(--control-text-size-s);--radio-size:var(--control-box-size-m);--radio-offset:var(--space-xs);--align-top-margin:var(--space-3xs)}.Radio_size_m{--radio-font-size:var(--control-text-size-m);--radio-size:var(--control-box-size-l);--radio-offset:var(--space-xs);--align-top-margin:var(--space-3xs)}.Radio_size_l{--radio-font-size:var(--control-text-size-l);--radio-size:var(--control-box-size-l);--radio-offset:var(--space-s);--align-top-margin:var(--space-3xs)}.Radio_view_primary:hover .Radio-Input{border-color:var(--color-control-bg-border-default-hover)}.Radio_view_primary .Radio-Input{border-color:var(--color-control-bg-border-default)}.Radio_view_primary .Radio-Input:before{background-color:var(--color-control-bg-primary)}.Radio_view_primary .Radio-Input:checked{border-color:var(--color-control-bg-primary)}.Radio_view_primary .Radio-Input:checked:before{background-color:var(--color-control-bg-primary)}.Radio_view_primary:hover .Radio-Input:checked{border-color:var(--color-control-bg-primary-hover)}.Radio_view_primary:hover .Radio-Input:checked:before{background-color:var(--color-control-bg-primary-hover)}.Radio_view_ghost:hover .Radio-Input{border-color:var(--color-control-bg-border-default-hover)}.Radio_view_ghost .Radio-Input{border-color:var(--color-control-bg-border-default)}.Radio_view_ghost .Radio-Input:before{background-color:var(--color-control-bg-primary)}.Radio_view_ghost .Radio-Input:checked{background-color:var(--color-control-bg-ghost);border-color:var(--color-control-bg-border-default)}.Radio_view_ghost .Radio-Input:checked:before{background-color:var(--color-control-typo-ghost)}.Radio_view_ghost:hover .Radio-Input:checked{background-color:var(--color-control-bg-ghost-hover);border-color:var(--color-control-bg-border-default)}.Radio_view_ghost:hover .Radio-Input:checked:before{background-color:var(--color-control-typo-ghost-hover)}.Radio-Input:checked:before{opacity:1;transform:scale(.4)}.Radio_disabled{pointer-events:none}.Radio_disabled .Radio-Input:disabled{background-color:var(--color-control-bg-disable);border-color:transparent}.Radio_disabled .Radio-Input:disabled:before{background-color:var(--color-control-typo-disable)}.Radio_disabled .Radio-Input:disabled~.Radio-Label{color:var(--color-control-typo-disable)}.Radio_align_center{align-items:center}.Radio_align_top{align-items:top}.Radio_align_top .Radio-Input{margin-top:var(--align-top-margin)}
1
+ .Radio{display:inline-flex;font-family:var(--font-sans);line-height:var(--line-height-text-s)}.Radio,.Radio-Input{cursor:pointer;position:relative}.Radio-Input{-webkit-appearance:none;border:var(--control-border-width) solid;border-radius:50%;box-sizing:border-box;flex-shrink:0;height:var(--radio-size);margin:0;transition:border-color .15s,background-color .15s;width:var(--radio-size)}.Radio-Input:before{border-radius:50%;box-sizing:border-box;content:"";height:var(--radio-size);left:calc(50% - var(--radio-size)/2);opacity:0;position:absolute;top:calc(50% - var(--radio-size)/2);transform:scale(0);transition:background-color .15s,opacity .15s,transform .15s;width:var(--radio-size)}.Radio-Label{color:var(--color-control-typo-default);font-size:var(--radio-font-size);margin-left:var(--radio-offset)}.Radio_size_xs{--radio-font-size:var(--control-text-size-xs);--radio-size:var(--control-box-size-m);--radio-offset:var(--space-xs);--align-top-margin:0}.Radio_size_s{--radio-font-size:var(--control-text-size-s);--radio-size:var(--control-box-size-m);--radio-offset:var(--space-xs);--align-top-margin:var(--space-3xs)}.Radio_size_m{--radio-font-size:var(--control-text-size-m);--radio-size:var(--control-box-size-l);--radio-offset:var(--space-xs);--align-top-margin:var(--space-3xs)}.Radio_size_l{--radio-font-size:var(--control-text-size-l);--radio-size:var(--control-box-size-l);--radio-offset:var(--space-s);--align-top-margin:var(--space-3xs)}.Radio_view_primary:hover .Radio-Input{border-color:var(--color-control-bg-border-default-hover)}.Radio_view_primary .Radio-Input{border-color:var(--color-control-bg-border-default)}.Radio_view_primary .Radio-Input:before{background-color:var(--color-control-bg-primary)}.Radio_view_primary .Radio-Input:checked{border-color:var(--color-control-bg-primary)}.Radio_view_primary .Radio-Input:checked:before{background-color:var(--color-control-bg-primary)}.Radio_view_primary:hover .Radio-Input:checked{border-color:var(--color-control-bg-primary-hover)}.Radio_view_primary:hover .Radio-Input:checked:before{background-color:var(--color-control-bg-primary-hover)}.Radio_view_ghost:hover .Radio-Input{border-color:var(--color-control-bg-border-default-hover)}.Radio_view_ghost .Radio-Input{border-color:var(--color-control-bg-border-default)}.Radio_view_ghost .Radio-Input:before{background-color:var(--color-control-bg-primary)}.Radio_view_ghost .Radio-Input:checked{background-color:var(--color-control-bg-ghost);border-color:var(--color-control-bg-border-default)}.Radio_view_ghost .Radio-Input:checked:before{background-color:var(--color-control-typo-ghost)}.Radio_view_ghost:hover .Radio-Input:checked{background-color:var(--color-control-bg-ghost-hover);border-color:var(--color-control-bg-border-default)}.Radio_view_ghost:hover .Radio-Input:checked:before{background-color:var(--color-control-typo-ghost-hover)}.Radio-Input:checked:before{opacity:1;transform:scale(.4)}.Radio_disabled{pointer-events:none}.Radio_disabled .Radio-Input:disabled{background-color:var(--color-control-bg-disable);border-color:transparent}.Radio_disabled .Radio-Input:disabled:before{background-color:var(--color-control-typo-disable)}.Radio_disabled .Radio-Input:disabled~.Radio-Label{color:var(--color-control-typo-disable)}.Radio_align_center{align-items:center}.Radio_align_top{align-items:start}.Radio_align_top .Radio-Input{margin-top:var(--align-top-margin)}
@@ -2,13 +2,13 @@ import './Radio.css';
2
2
  import React, { ChangeEventHandler } from 'react';
3
3
  import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
4
4
  export declare const radioPropSize: readonly ["m", "l", "s", "xs"];
5
- export type RadioPropSize = typeof radioPropSize[number];
5
+ export type RadioPropSize = (typeof radioPropSize)[number];
6
6
  export declare const radioPropSizeDefault: RadioPropSize;
7
7
  export declare const radioPropView: readonly ["primary", "ghost"];
8
- export type RadioPropView = typeof radioPropView[number];
8
+ export type RadioPropView = (typeof radioPropView)[number];
9
9
  export declare const radioPropViewDefault: RadioPropView;
10
10
  export declare const radioPropAlign: readonly ["center", "top"];
11
- export type RadioPropAlign = typeof radioPropAlign[number];
11
+ export type RadioPropAlign = (typeof radioPropAlign)[number];
12
12
  export declare const radioPropAlignDefault: RadioPropAlign;
13
13
  export type RadioPropOnChange = (checked: boolean, params: {
14
14
  e: React.ChangeEvent<HTMLInputElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","radioPropSize","radioPropSizeDefault","radioPropView","radioPropViewDefault","radioPropAlign","radioPropAlignDefault","radioPropOnChangeDefault","cnRadio","COMPONENT_NAME","Radio","forwardRef","props","ref","radioRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef","otherProps"],"sources":["../../../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import './Radio.css';\n\nimport React, { ChangeEventHandler, useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\nexport const radioPropSize = ['m', 'l', 's', 'xs'] as const;\nexport type RadioPropSize = typeof radioPropSize[number];\nexport const radioPropSizeDefault: RadioPropSize = radioPropSize[0];\n\nexport const radioPropView = ['primary', 'ghost'] as const;\nexport type RadioPropView = typeof radioPropView[number];\nexport const radioPropViewDefault: RadioPropView = radioPropView[0];\n\nexport const radioPropAlign = ['center', 'top'] as const;\nexport type RadioPropAlign = typeof radioPropAlign[number];\nexport const radioPropAlignDefault: RadioPropAlign = radioPropAlign[0];\n\nconst radioPropOnChangeDefault = () => {};\n\nexport type RadioPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type Props = {\n checked?: boolean;\n size?: RadioPropSize;\n view?: RadioPropView;\n align?: RadioPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n for?: string;\n inputId?: string;\n};\n\nexport type RadioProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;\n\nexport const cnRadio = cn('Radio');\n\nexport const COMPONENT_NAME = 'Radio' as const;\n\nexport const Radio = React.forwardRef<HTMLLabelElement, RadioProps>(\n (props, ref) => {\n const radioRef = useRef<HTMLLabelElement>(null);\n\n const {\n checked = false,\n name,\n size = radioPropSizeDefault,\n view = radioPropViewDefault,\n align = radioPropAlignDefault,\n disabled,\n className,\n label,\n onChange = radioPropOnChangeDefault,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputId,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, radioRef);\n\n return (\n <label\n {...otherProps}\n className={cnRadio({ size, view, disabled, align }, [className])}\n ref={useForkRef([ref, radioRef])}\n >\n <input\n type=\"radio\"\n name={name}\n className={cnRadio('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n id={inputId}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnRadio('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"sQAAA,oBAEA,MAAOA,MAAP,EAAoCC,MAApC,KAAkD,OAAlD,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAEA,MAAO,IAAMC,cAAa,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAgB,IAAhB,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,cAAa,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,QAAD,CAAW,KAAX,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,GAAME,yBAAwB,CAAG,UAAM,CAAE,CAAzC,CAkCA,MAAO,IAAMC,QAAO,CAAGT,EAAE,CAAC,OAAD,CAAlB,CAEP,MAAO,IAAMU,eAAc,CAAG,OAAvB,CAEP,MAAO,IAAMC,MAAK,CAAGf,KAAK,CAACgB,UAAN,CACnB,SAACC,CAAD,CAAQC,CAAR,CAAgB,IACRC,EAAQ,CAAGlB,MAAM,CAAmB,IAAnB,CADT,GAsBVI,eAAe,CAACS,cAAD,CAAiBG,CAAjB,CAAwBE,CAAxB,CAtBL,KAIZC,OAJY,CAKZC,CALY,GAKZA,IALY,KAMZC,IANY,CAMZA,CANY,YAMLf,oBANK,OAOZgB,IAPY,CAOZA,CAPY,YAOLd,oBAPK,OAQZe,KARY,CAQZA,CARY,YAQJb,qBARI,GASZc,CATY,GASZA,QATY,CAUZC,CAVY,GAUZA,SAVY,CAWZC,CAXY,GAWZA,KAXY,KAYZC,QAZY,CAYZA,CAZY,YAYDhB,wBAZC,GAaZiB,CAbY,GAaZA,OAbY,CAcZC,CAdY,GAcZA,MAdY,CAeZC,CAfY,GAeZA,QAfY,CAgBZC,CAhBY,GAgBZA,QAhBY,CAiBZC,CAjBY,GAiBZA,IAjBY,CAkBZC,CAlBY,GAkBZA,QAlBY,CAmBZC,CAnBY,GAmBZA,OAnBY,CAoBZC,CApBY,GAoBZA,QApBY,CAqBTC,CArBS,uCAwBd,MACE,8CACMA,CADN,EAEE,SAAS,CAAExB,OAAO,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcE,QAAQ,CAARA,CAAd,CAAwBD,KAAK,CAALA,CAAxB,CAAD,CAAkC,CAACE,CAAD,CAAlC,CAFpB,CAGE,GAAG,CAAExB,UAAU,CAAC,CAACgB,CAAD,CAAMC,CAAN,CAAD,CAHjB,GAKE,6BACE,IAAI,CAAC,OADP,CAEE,IAAI,CAAEE,CAFR,CAGE,SAAS,CAAER,OAAO,CAAC,OAAD,CAAU,CAACV,UAAU,EAAX,CAAV,CAHpB,CAIE,OAAO,cAJT,CAKE,QAAQ,CAAEsB,CALZ,CAME,QAAQ,CAAEG,CANZ,CAOE,OAAO,CAAEC,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,EAAE,CAAEE,CAZN,CAaE,QAAQ,CAAED,CAbZ,CAcE,GAAG,CAAEE,CAdP,EALF,CAqBGT,CAAK,EAAI,4BAAM,SAAS,CAAEd,OAAO,CAAC,OAAD,CAAxB,EAAoCc,CAApC,CArBZ,CAwBH,CAlDkB,CAAd"}
1
+ {"version":3,"file":"Radio.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","radioPropSize","radioPropSizeDefault","radioPropView","radioPropViewDefault","radioPropAlign","radioPropAlignDefault","radioPropOnChangeDefault","cnRadio","COMPONENT_NAME","Radio","forwardRef","props","ref","radioRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputId","inputRef","otherProps"],"sources":["../../../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import './Radio.css';\n\nimport React, { ChangeEventHandler, useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\n\nexport const radioPropSize = ['m', 'l', 's', 'xs'] as const;\nexport type RadioPropSize = (typeof radioPropSize)[number];\nexport const radioPropSizeDefault: RadioPropSize = radioPropSize[0];\n\nexport const radioPropView = ['primary', 'ghost'] as const;\nexport type RadioPropView = (typeof radioPropView)[number];\nexport const radioPropViewDefault: RadioPropView = radioPropView[0];\n\nexport const radioPropAlign = ['center', 'top'] as const;\nexport type RadioPropAlign = (typeof radioPropAlign)[number];\nexport const radioPropAlignDefault: RadioPropAlign = radioPropAlign[0];\n\nconst radioPropOnChangeDefault = () => {};\n\nexport type RadioPropOnChange = (\n checked: boolean,\n params: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type Props = {\n checked?: boolean;\n size?: RadioPropSize;\n view?: RadioPropView;\n align?: RadioPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: ChangeEventHandler<HTMLInputElement>;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n for?: string;\n inputId?: string;\n};\n\nexport type RadioProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;\n\nexport const cnRadio = cn('Radio');\n\nexport const COMPONENT_NAME = 'Radio' as const;\n\nexport const Radio = React.forwardRef<HTMLLabelElement, RadioProps>(\n (props, ref) => {\n const radioRef = useRef<HTMLLabelElement>(null);\n\n const {\n checked = false,\n name,\n size = radioPropSizeDefault,\n view = radioPropViewDefault,\n align = radioPropAlignDefault,\n disabled,\n className,\n label,\n onChange = radioPropOnChangeDefault,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputId,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, radioRef);\n\n return (\n <label\n {...otherProps}\n className={cnRadio({ size, view, disabled, align }, [className])}\n ref={useForkRef([ref, radioRef])}\n >\n <input\n type=\"radio\"\n name={name}\n className={cnRadio('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n id={inputId}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnRadio('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"sQAAA,oBAEA,MAAOA,MAAP,EAAoCC,MAApC,KAAkD,OAAlD,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAEA,MAAO,IAAMC,cAAa,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAgB,IAAhB,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,cAAa,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,QAAD,CAAW,KAAX,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CA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,CAAU,CAACV,UAAU,EAAX,CAAV,CAHpB,CAIE,OAAO,cAJT,CAKE,QAAQ,CAAEsB,CALZ,CAME,QAAQ,CAAEG,CANZ,CAOE,OAAO,CAAEC,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,EAAE,CAAEE,CAZN,CAaE,QAAQ,CAAED,CAbZ,CAcE,GAAG,CAAEE,CAdP,EALF,CAqBGT,CAAK,EAAI,4BAAM,SAAS,CAAEd,OAAO,CAAC,OAAD,CAAxB,EAAoCc,CAApC,CArBZ,CAwBH,CAlDkB,CAAd"}
@@ -5,16 +5,16 @@ export type RadioGroupDefaultItem = {
5
5
  disabled?: boolean;
6
6
  };
7
7
  export declare const radioGroupDirections: readonly ["column", "row"];
8
- export type RadioGroupDirection = typeof radioGroupDirections[number];
8
+ export type RadioGroupDirection = (typeof radioGroupDirections)[number];
9
9
  export declare const radioGroupDefaultDirection: RadioGroupDirection;
10
10
  export declare const radioGroupSizes: readonly ["m", "l", "xs", "s"];
11
- export type RadioGroupPropSize = typeof radioGroupSizes[number];
11
+ export type RadioGroupPropSize = (typeof radioGroupSizes)[number];
12
12
  export declare const radioGroupDefaultSize: RadioGroupPropSize;
13
13
  export declare const radioGroupViews: readonly ["primary", "ghost"];
14
- export type RadioGroupPropView = typeof radioGroupViews[number];
14
+ export type RadioGroupPropView = (typeof radioGroupViews)[number];
15
15
  export declare const radioGroupDefaultView: RadioGroupPropView;
16
16
  export declare const radioGroupPropAlign: readonly ["center", "top"];
17
- export type RadioGroupPropAlign = typeof radioGroupPropAlign[number];
17
+ export type RadioGroupPropAlign = (typeof radioGroupPropAlign)[number];
18
18
  export declare const radioGroupPropAlignDefault: RadioGroupPropAlign;
19
19
  export type RadioGroupPropGetItemKey<ITEM> = (item: ITEM) => string | number | undefined;
20
20
  export type RadioGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["radioGroupDirections","radioGroupDefaultDirection","radioGroupSizes","radioGroupDefaultSize","radioGroupViews","radioGroupDefaultView","radioGroupPropAlign","radioGroupPropAlignDefault"],"sources":["../../../../../src/components/RadioGroup/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport type RadioGroupDefaultItem = {\n key?: string | number;\n label: string;\n disabled?: boolean;\n};\n\nexport const radioGroupDirections = ['column', 'row'] as const;\nexport type RadioGroupDirection = typeof radioGroupDirections[number];\nexport const radioGroupDefaultDirection: RadioGroupDirection =\n radioGroupDirections[0];\n\nexport const radioGroupSizes = ['m', 'l', 'xs', 's'] as const;\nexport type RadioGroupPropSize = typeof radioGroupSizes[number];\nexport const radioGroupDefaultSize: RadioGroupPropSize = radioGroupSizes[0];\n\nexport const radioGroupViews = ['primary', 'ghost'] as const;\nexport type RadioGroupPropView = typeof radioGroupViews[number];\nexport const radioGroupDefaultView: RadioGroupPropView = radioGroupViews[0];\n\nexport const radioGroupPropAlign = ['center', 'top'] as const;\nexport type RadioGroupPropAlign = typeof radioGroupPropAlign[number];\nexport const radioGroupPropAlignDefault: RadioGroupPropAlign =\n radioGroupPropAlign[0];\n\nexport type RadioGroupPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type RadioGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type RadioGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type RadioGroupPropOnChange<ITEM> = (\n value: ITEM,\n props: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type RadioGroupProps<ITEM = RadioGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n align?: RadioGroupPropAlign;\n value?: ITEM | null;\n items: ITEM[];\n getItemKey?: RadioGroupPropGetItemKey<ITEM>;\n getItemLabel?: RadioGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: RadioGroupPropGetItemDisabled<ITEM>;\n onChange?: RadioGroupPropOnChange<ITEM>;\n name?: string;\n direction?: RadioGroupDirection;\n size?: RadioGroupPropSize;\n view?: RadioGroupPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: RadioGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: RadioGroupPropGetItemLabel<ITEM>;\n });\n\nexport type RadioGroupComponent = <ITEM = RadioGroupDefaultItem>(\n props: RadioGroupProps<ITEM>,\n) => React.ReactNode | null;\n"],"mappings":"AAQA,MAAO,IAAMA,qBAAoB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA7B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,oBAAoB,CAAC,CAAD,CADf,CAGP,MAAO,IAAME,gBAAe,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,IAAX,CAAiB,GAAjB,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAGD,eAAe,CAAC,CAAD,CAAjE,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAGD,eAAe,CAAC,CAAD,CAAjE,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,mBAAmB,CAAC,CAAD,CADd"}
1
+ {"version":3,"file":"types.js","names":["radioGroupDirections","radioGroupDefaultDirection","radioGroupSizes","radioGroupDefaultSize","radioGroupViews","radioGroupDefaultView","radioGroupPropAlign","radioGroupPropAlignDefault"],"sources":["../../../../../src/components/RadioGroup/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport type RadioGroupDefaultItem = {\n key?: string | number;\n label: string;\n disabled?: boolean;\n};\n\nexport const radioGroupDirections = ['column', 'row'] as const;\nexport type RadioGroupDirection = (typeof radioGroupDirections)[number];\nexport const radioGroupDefaultDirection: RadioGroupDirection =\n radioGroupDirections[0];\n\nexport const radioGroupSizes = ['m', 'l', 'xs', 's'] as const;\nexport type RadioGroupPropSize = (typeof radioGroupSizes)[number];\nexport const radioGroupDefaultSize: RadioGroupPropSize = radioGroupSizes[0];\n\nexport const radioGroupViews = ['primary', 'ghost'] as const;\nexport type RadioGroupPropView = (typeof radioGroupViews)[number];\nexport const radioGroupDefaultView: RadioGroupPropView = radioGroupViews[0];\n\nexport const radioGroupPropAlign = ['center', 'top'] as const;\nexport type RadioGroupPropAlign = (typeof radioGroupPropAlign)[number];\nexport const radioGroupPropAlignDefault: RadioGroupPropAlign =\n radioGroupPropAlign[0];\n\nexport type RadioGroupPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type RadioGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type RadioGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type RadioGroupPropOnChange<ITEM> = (\n value: ITEM,\n props: {\n e: React.ChangeEvent<HTMLInputElement>;\n },\n) => void;\n\nexport type RadioGroupProps<ITEM = RadioGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n align?: RadioGroupPropAlign;\n value?: ITEM | null;\n items: ITEM[];\n getItemKey?: RadioGroupPropGetItemKey<ITEM>;\n getItemLabel?: RadioGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: RadioGroupPropGetItemDisabled<ITEM>;\n onChange?: RadioGroupPropOnChange<ITEM>;\n name?: string;\n direction?: RadioGroupDirection;\n size?: RadioGroupPropSize;\n view?: RadioGroupPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: RadioGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: RadioGroupPropGetItemLabel<ITEM>;\n });\n\nexport type RadioGroupComponent = <ITEM = RadioGroupDefaultItem>(\n props: RadioGroupProps<ITEM>,\n) => React.ReactNode | null;\n"],"mappings":"AAQA,MAAO,IAAMA,qBAAoB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA7B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,oBAAoB,CAAC,CAAD,CADf,CAGP,MAAO,IAAME,gBAAe,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,IAAX,CAAiB,GAAjB,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAGD,eAAe,CAAC,CAAD,CAAjE,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAGD,eAAe,CAAC,CAAD,CAAjE,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,mBAAmB,CAAC,CAAD,CADd"}
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { ResponsesImageProps } from '../../responsesImages/ResponsesImage/ResponsesImage';
4
4
  import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
5
5
  export declare const responsesPropSize: readonly ["l", "m"];
6
- export type ResponsesPropSize = typeof responsesPropSize[number];
6
+ export type ResponsesPropSize = (typeof responsesPropSize)[number];
7
7
  export declare const responsesPropSizeDefault: ResponsesPropSize;
8
8
  export type ResponsesProps = PropsWithHTMLAttributes<{
9
9
  title?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"Responses.js","names":["React","cnMixSpace","cn","responsesPropSize","responsesPropSizeDefault","cnResponses","Responses","forwardRef","props","ref","className","title","description","size","image","actions","mT","mB"],"sources":["../../../../../src/components/Responses/Responses.tsx"],"sourcesContent":["import './Responses.css';\n\nimport React from 'react';\n\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { ResponsesImageProps } from '##/responsesImages/ResponsesImage/ResponsesImage';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const responsesPropSize = ['l', 'm'] as const;\nexport type ResponsesPropSize = typeof responsesPropSize[number];\nexport const responsesPropSizeDefault: ResponsesPropSize = responsesPropSize[0];\n\nexport type ResponsesProps = PropsWithHTMLAttributes<\n {\n title?: React.ReactNode;\n description?: React.ReactNode;\n size?: ResponsesPropSize;\n image: React.FC<ResponsesImageProps>;\n actions?: React.ReactNode;\n children?: never;\n },\n HTMLDivElement\n>;\n\nexport const cnResponses = cn('Responses');\n\nexport const Responses = React.forwardRef<HTMLDivElement, ResponsesProps>(\n (props, ref) => {\n const {\n className,\n title,\n description,\n size = responsesPropSizeDefault,\n image,\n actions,\n } = props;\n const Image = image;\n\n return (\n <div className={cnResponses({ size }, [className])} ref={ref}>\n <Image className={cnResponses('Image')} />\n {title && (\n <h1\n className={cnResponses('Title', [cnMixSpace({ mT: 'xl', mB: 0 })])}\n >\n {title}\n </h1>\n )}\n {description && (\n <p className={cnResponses('Description', [cnMixSpace({ mT: 'xs' })])}>\n {description}\n </p>\n )}\n {actions && (\n <div\n className={cnResponses('ButtonsWrapper', [\n cnMixSpace({ mT: 'xl' }),\n ])}\n >\n {actions}\n </div>\n )}\n </div>\n );\n },\n);\n"],"mappings":"AAAA,wBAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,UAAT,2BAEA,OAASC,EAAT,uBAGA,MAAO,IAAMC,kBAAiB,CAAG,CAAC,GAAD,CAAM,GAAN,CAA1B,CAEP,MAAO,IAAMC,yBAA2C,CAAGD,iBAAiB,CAAC,CAAD,CAArE,CAcP,MAAO,IAAME,YAAW,CAAGH,EAAE,CAAC,WAAD,CAAtB,CAEP,MAAO,IAAMI,UAAS,CAAGN,KAAK,CAACO,UAAN,CACvB,SAACC,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAQVF,CARU,CAEZE,SAFY,CAGZC,CAHY,CAQVH,CARU,CAGZG,KAHY,CAIZC,CAJY,CAQVJ,CARU,CAIZI,WAJY,GAQVJ,CARU,CAKZK,IALY,CAKZA,CALY,YAKLT,wBALK,GAMZU,CANY,CAQVN,CARU,CAMZM,KANY,CAOZC,CAPY,CAQVP,CARU,CAOZO,OAPY,CAWd,MACE,4BAAK,SAAS,CAAEV,WAAW,CAAC,CAAEQ,IAAI,CAAJA,CAAF,CAAD,CAAW,CAACH,CAAD,CAAX,CAA3B,CAAoD,GAAG,CAAED,CAAzD,EACE,oBAJUK,CAIV,EAAO,SAAS,CAAET,WAAW,CAAC,OAAD,CAA7B,EADF,CAEGM,CAAK,EACJ,0BACE,SAAS,CAAEN,WAAW,CAAC,OAAD,CAAU,CAACJ,UAAU,CAAC,CAAEe,EAAE,CAAE,IAAN,CAAYC,EAAE,CAAE,CAAhB,CAAD,CAAX,CAAV,CADxB,EAGGN,CAHH,CAHJ,CASGC,CAAW,EACV,yBAAG,SAAS,CAAEP,WAAW,CAAC,aAAD,CAAgB,CAACJ,UAAU,CAAC,CAAEe,EAAE,CAAE,IAAN,CAAD,CAAX,CAAhB,CAAzB,EACGJ,CADH,CAVJ,CAcGG,CAAO,EACN,2BACE,SAAS,CAAEV,WAAW,CAAC,gBAAD,CAAmB,CACvCJ,UAAU,CAAC,CAAEe,EAAE,CAAE,IAAN,CAAD,CAD6B,CAAnB,CADxB,EAKGD,CALH,CAfJ,CAyBH,CAtCsB,CAAlB"}
1
+ {"version":3,"file":"Responses.js","names":["React","cnMixSpace","cn","responsesPropSize","responsesPropSizeDefault","cnResponses","Responses","forwardRef","props","ref","className","title","description","size","image","actions","mT","mB"],"sources":["../../../../../src/components/Responses/Responses.tsx"],"sourcesContent":["import './Responses.css';\n\nimport React from 'react';\n\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { ResponsesImageProps } from '##/responsesImages/ResponsesImage/ResponsesImage';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const responsesPropSize = ['l', 'm'] as const;\nexport type ResponsesPropSize = (typeof responsesPropSize)[number];\nexport const responsesPropSizeDefault: ResponsesPropSize = responsesPropSize[0];\n\nexport type ResponsesProps = PropsWithHTMLAttributes<\n {\n title?: React.ReactNode;\n description?: React.ReactNode;\n size?: ResponsesPropSize;\n image: React.FC<ResponsesImageProps>;\n actions?: React.ReactNode;\n children?: never;\n },\n HTMLDivElement\n>;\n\nexport const cnResponses = cn('Responses');\n\nexport const Responses = React.forwardRef<HTMLDivElement, ResponsesProps>(\n (props, ref) => {\n const {\n className,\n title,\n description,\n size = responsesPropSizeDefault,\n image,\n actions,\n } = props;\n const Image = image;\n\n return (\n <div className={cnResponses({ size }, [className])} ref={ref}>\n <Image className={cnResponses('Image')} />\n {title && (\n <h1\n className={cnResponses('Title', [cnMixSpace({ mT: 'xl', mB: 0 })])}\n >\n {title}\n </h1>\n )}\n {description && (\n <p className={cnResponses('Description', [cnMixSpace({ mT: 'xs' })])}>\n {description}\n </p>\n )}\n {actions && (\n <div\n className={cnResponses('ButtonsWrapper', [\n cnMixSpace({ mT: 'xl' }),\n ])}\n >\n {actions}\n </div>\n )}\n </div>\n );\n },\n);\n"],"mappings":"AAAA,wBAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,UAAT,2BAEA,OAASC,EAAT,uBAGA,MAAO,IAAMC,kBAAiB,CAAG,CAAC,GAAD,CAAM,GAAN,CAA1B,CAEP,MAAO,IAAMC,yBAA2C,CAAGD,iBAAiB,CAAC,CAAD,CAArE,CAcP,MAAO,IAAME,YAAW,CAAGH,EAAE,CAAC,WAAD,CAAtB,CAEP,MAAO,IAAMI,UAAS,CAAGN,KAAK,CAACO,UAAN,CACvB,SAACC,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAQVF,CARU,CAEZE,SAFY,CAGZC,CAHY,CAQVH,CARU,CAGZG,KAHY,CAIZC,CAJY,CAQVJ,CARU,CAIZI,WAJY,GAQVJ,CARU,CAKZK,IALY,CAKZA,CALY,YAKLT,wBALK,GAMZU,CANY,CAQVN,CARU,CAMZM,KANY,CAOZC,CAPY,CAQVP,CARU,CAOZO,OAPY,CAWd,MACE,4BAAK,SAAS,CAAEV,WAAW,CAAC,CAAEQ,IAAI,CAAJA,CAAF,CAAD,CAAW,CAACH,CAAD,CAAX,CAA3B,CAAoD,GAAG,CAAED,CAAzD,EACE,oBAJUK,CAIV,EAAO,SAAS,CAAET,WAAW,CAAC,OAAD,CAA7B,EADF,CAEGM,CAAK,EACJ,0BACE,SAAS,CAAEN,WAAW,CAAC,OAAD,CAAU,CAACJ,UAAU,CAAC,CAAEe,EAAE,CAAE,IAAN,CAAYC,EAAE,CAAE,CAAhB,CAAD,CAAX,CAAV,CADxB,EAGGN,CAHH,CAHJ,CASGC,CAAW,EACV,yBAAG,SAAS,CAAEP,WAAW,CAAC,aAAD,CAAgB,CAACJ,UAAU,CAAC,CAAEe,EAAE,CAAE,IAAN,CAAD,CAAX,CAAhB,CAAzB,EACGJ,CADH,CAVJ,CAcGG,CAAO,EACN,2BACE,SAAS,CAAEV,WAAW,CAAC,gBAAD,CAAmB,CACvCJ,UAAU,CAAC,CAAEe,EAAE,CAAE,IAAN,CAAD,CAD6B,CAAnB,CADxB,EAKGD,CALH,CAfJ,CAyBH,CAtCsB,CAAlB"}
@@ -7,7 +7,7 @@ import { GetOptionPropsResult, OptionForCreate, OptionProps } from '../useSelect
7
7
  import { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttributes';
8
8
  import { CountedGroup } from '../types';
9
9
  export declare const selectDropdownForm: readonly ["default", "brick", "round"];
10
- export type SelectDropdownPropForm = typeof selectDropdownForm[number];
10
+ export type SelectDropdownPropForm = (typeof selectDropdownForm)[number];
11
11
  export declare const defaultSelectDropdownPropForm: "default";
12
12
  type RenderItemProps<ITEM> = {
13
13
  item: ITEM;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDropdown.js","names":["useAtom","React","Fragment","memo","useMemo","ListItem","ListLoader","mapVerticalSpace","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","forkRef","useForkRef","useVirtualScroll","cnMixScrollBar","cnMixSpace","cnCanary","cn","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","SelectPopover","SelectRenderItem","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","getLengthElements","elements","length","index","element","items","isVisible","slice","SelectDropdown","props","controlRef","size","getOptionActions","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItemsAtom","form","openAtom","offset","offsetProp","renderItem","visibleItemsAtom","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","highlightedIndexAtom","valueAtom","getItemKeyAtom","highlightIndex","onCreate","onChange","onChangeAll","inputValueAtom","groupsCounterAtom","dropdownZIndexAtom","selectAllLabel","container","otherProps","visibleItems","hasItems","isListMount","setIsListMount","getItemKey","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","listRefs","scrollElementRef","scrollContainerRef","getIndex","getVirtualIndex","zIndex","pV","marginTop","map","key","virtualIndex","item"],"sources":["../../../../../../src/components/SelectCanary/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport { AtomMut } from '@reatom/framework';\nimport { useAtom } from '@reatom/npm-react';\nimport React, { Fragment, memo, useMemo } from 'react';\n\nimport { FieldPropSize } from '##/components/FieldComponents';\nimport {\n ListItem,\n ListLoader,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { PopoverPropOffset } from '##/components/Popover';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '##/components/SelectCanary/useSelect';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cnCanary as cn } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectItemAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { SelectPopover } from '../SelectPopover';\nimport { SelectRenderItem } from '../SelectRenderItem';\nimport { CountedGroup } from '../types';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownForm[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype RenderItemProps<ITEM> = {\n item: ITEM;\n active: boolean;\n hovered: boolean;\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n ref: React.Ref<HTMLDivElement>;\n};\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: FieldPropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionActions(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n openAtom: AtomMut<boolean>;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;\n highlightedIndexAtom: AtomMut<number>;\n visibleItemsAtom: AtomMut<(OptionForCreate | CountedGroup<ITEM, GROUP>)[]>;\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?:\n | ((label: string | undefined) => React.ReactNode)\n | React.ReactNode;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItemsAtom: AtomMut<boolean>;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n valueAtom: AtomMut<ITEM[]>;\n getItemKeyAtom: AtomMut<(item: ITEM) => string | number>;\n onChangeAll: (e: React.SyntheticEvent, items: ITEM[]) => void;\n highlightIndex: (index: number) => void;\n onCreate: (e: React.SyntheticEvent) => void;\n onChange: (e: React.SyntheticEvent, item: ITEM) => void;\n inputValueAtom: AtomMut<string>;\n groupsCounterAtom: AtomMut<Record<string, [number, number]>>;\n dropdownZIndexAtom: AtomMut<number | undefined>;\n selectAllLabel: string;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n}>;\n\ntype SelectDropdownComponent = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nconst cnSelectDropdown = cn('SelectDropdown');\n\nconst getLengthElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n }\n )[],\n) => {\n let length = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element?.items?.length) {\n length += element.items.length;\n }\n }\n\n return length;\n};\n\nconst isVisible = (slice: [number, number], index: number) => {\n return index >= slice[0] && index < slice[1];\n};\n\nexport const SelectDropdown: SelectDropdownComponent = memo((props) => {\n const {\n controlRef,\n size,\n getOptionActions,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItemsAtom,\n form,\n openAtom,\n offset: offsetProp = 'none',\n renderItem,\n visibleItemsAtom,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n highlightedIndexAtom,\n valueAtom,\n getItemKeyAtom,\n highlightIndex,\n onCreate,\n onChange,\n onChangeAll,\n inputValueAtom,\n groupsCounterAtom,\n dropdownZIndexAtom,\n selectAllLabel,\n container,\n ...otherProps\n } = props;\n\n const [visibleItems] = useAtom(visibleItemsAtom);\n\n const [hasItems] = useAtom(hasItemsAtom);\n const [isListMount, setIsListMount] = useAtom(false);\n const [getItemKey] = useAtom(getItemKeyAtom);\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLengthElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isListMount,\n onScrollToBottom,\n });\n\n const scrollContainerRef = useForkRef([scrollElementRef, dropdownRefProp]);\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n const [zIndex] = useAtom(dropdownZIndexAtom);\n\n return (\n <SelectPopover\n {...otherProps}\n anchorRef={controlRef}\n offset={offset}\n role=\"listbox\"\n className={cnSelectDropdown()}\n size={size}\n controlRef={controlRef}\n openAtom={openAtom}\n form={form}\n onMount={setIsListMount}\n style={{ zIndex }}\n container={container}\n >\n {isListMount && (\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar({ size: 'xs' }),\n ])}\n ref={scrollContainerRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List')}\n key={cnSelectDropdown('List')}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n key={cnSelectDropdown('List', { key: 'CreateButton' })}\n labelForCreate={labelForCreate}\n indent={indent}\n ref={itemsRefs[index]}\n onClick={onCreate}\n highlightedIndexAtom={highlightedIndexAtom}\n inputValueAtom={inputValueAtom}\n highlightIndex={highlightIndex}\n index={index}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group-${group.key}-Label`}\n />\n )}\n {group.items.map((item) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n label={selectAllLabel}\n groupId={group.key}\n highlightedIndexAtom={highlightedIndexAtom}\n groupsCounterAtom={groupsCounterAtom}\n key={cnSelectDropdown('SelectItemAll', {\n group: group.key,\n })}\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionActions({\n index,\n item,\n })}\n index={index}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectRenderItem\n key={cnSelectDropdown('SelectRenderItem', {\n group: group.key,\n item: getItemKey(item),\n })}\n getItemKeyAtom={getItemKeyAtom}\n highlightedIndexAtom={highlightedIndexAtom}\n rootRef={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n renderItem={renderItem}\n item={item}\n {...getOptionActions({\n index,\n item,\n })}\n index={index}\n valueAtom={valueAtom}\n />\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n )}\n </SelectPopover>\n );\n});\n"],"mappings":"goBAAA,6BAGA,OAASA,OAAT,KAAwB,mBAAxB,CACA,MAAOC,MAAP,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B,CAKE,cAAc,CAAErC,CALlB,CAME,oBAAoB,CAAEF,CANxB,CAOE,OAAO,CAAEjD,OAAO,CAAC,CACf6E,EAAQ,CAACU,CAAD,CADO,CAEfzC,CAAS,CAAC1B,CAAD,CAFM,CAAD,CAPlB,CAWE,UAAU,CAAEqB,CAXd,CAYE,IAAI,CAAE+C,CAZR,EAaM3D,CAAgB,CAAC,CACnBT,KAAK,CAALA,CADmB,CAEnBoE,IAAI,CAAJA,CAFmB,CAAD,CAbtB,EAiBE,KAAK,CAAEpE,CAjBT,CAkBE,SAAS,CAAE8B,CAlBb,GAsBL,CACF,CAzDA,CAZH,CAwEH,CA/FA,CALH,CAqGGP,CAAS,EAAIyB,CAAb,EACC,oBAAC,UAAD,EAAY,IAAI,CAAExC,CAAlB,CAAwB,WAAW,CAAEuC,CAArC,EAtGJ,CAVF,CAmHG,CAACxB,CAAD,EAAc,CAACoB,CAAf,EAA2B5B,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEP,CADR,CAEE,KAAK,CAAEO,CAFT,CAGE,WAAW,CAAEgC,CAHf,EAKGhC,CALH,CApHJ,CAfJ,CA+IH,CAjO0D,CAApD"}
1
+ {"version":3,"file":"SelectDropdown.js","names":["useAtom","React","Fragment","memo","useMemo","ListItem","ListLoader","mapVerticalSpace","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","forkRef","useForkRef","useVirtualScroll","cnMixScrollBar","cnMixSpace","cnCanary","cn","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","SelectPopover","SelectRenderItem","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","getLengthElements","elements","length","index","element","items","isVisible","slice","SelectDropdown","props","controlRef","size","getOptionActions","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItemsAtom","form","openAtom","offset","offsetProp","renderItem","visibleItemsAtom","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","highlightedIndexAtom","valueAtom","getItemKeyAtom","highlightIndex","onCreate","onChange","onChangeAll","inputValueAtom","groupsCounterAtom","dropdownZIndexAtom","selectAllLabel","container","otherProps","visibleItems","hasItems","isListMount","setIsListMount","getItemKey","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","listRefs","scrollElementRef","scrollContainerRef","getIndex","getVirtualIndex","zIndex","pV","marginTop","map","key","virtualIndex","item"],"sources":["../../../../../../src/components/SelectCanary/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport { AtomMut } from '@reatom/framework';\nimport { useAtom } from '@reatom/npm-react';\nimport React, { Fragment, memo, useMemo } from 'react';\n\nimport { FieldPropSize } from '##/components/FieldComponents';\nimport {\n ListItem,\n ListLoader,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { PopoverPropOffset } from '##/components/Popover';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '##/components/SelectCanary/useSelect';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cnCanary as cn } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectItemAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { SelectPopover } from '../SelectPopover';\nimport { SelectRenderItem } from '../SelectRenderItem';\nimport { CountedGroup } from '../types';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = (typeof selectDropdownForm)[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype RenderItemProps<ITEM> = {\n item: ITEM;\n active: boolean;\n hovered: boolean;\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n ref: React.Ref<HTMLDivElement>;\n};\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: FieldPropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionActions(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n openAtom: AtomMut<boolean>;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;\n highlightedIndexAtom: AtomMut<number>;\n visibleItemsAtom: AtomMut<(OptionForCreate | CountedGroup<ITEM, GROUP>)[]>;\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?:\n | ((label: string | undefined) => React.ReactNode)\n | React.ReactNode;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItemsAtom: AtomMut<boolean>;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n valueAtom: AtomMut<ITEM[]>;\n getItemKeyAtom: AtomMut<(item: ITEM) => string | number>;\n onChangeAll: (e: React.SyntheticEvent, items: ITEM[]) => void;\n highlightIndex: (index: number) => void;\n onCreate: (e: React.SyntheticEvent) => void;\n onChange: (e: React.SyntheticEvent, item: ITEM) => void;\n inputValueAtom: AtomMut<string>;\n groupsCounterAtom: AtomMut<Record<string, [number, number]>>;\n dropdownZIndexAtom: AtomMut<number | undefined>;\n selectAllLabel: string;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n}>;\n\ntype SelectDropdownComponent = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nconst cnSelectDropdown = cn('SelectDropdown');\n\nconst getLengthElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n }\n )[],\n) => {\n let length = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element?.items?.length) {\n length += element.items.length;\n }\n }\n\n return length;\n};\n\nconst isVisible = (slice: [number, number], index: number) => {\n return index >= slice[0] && index < slice[1];\n};\n\nexport const SelectDropdown: SelectDropdownComponent = memo((props) => {\n const {\n controlRef,\n size,\n getOptionActions,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItemsAtom,\n form,\n openAtom,\n offset: offsetProp = 'none',\n renderItem,\n visibleItemsAtom,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n highlightedIndexAtom,\n valueAtom,\n getItemKeyAtom,\n highlightIndex,\n onCreate,\n onChange,\n onChangeAll,\n inputValueAtom,\n groupsCounterAtom,\n dropdownZIndexAtom,\n selectAllLabel,\n container,\n ...otherProps\n } = props;\n\n const [visibleItems] = useAtom(visibleItemsAtom);\n\n const [hasItems] = useAtom(hasItemsAtom);\n const [isListMount, setIsListMount] = useAtom(false);\n const [getItemKey] = useAtom(getItemKeyAtom);\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLengthElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isListMount,\n onScrollToBottom,\n });\n\n const scrollContainerRef = useForkRef([scrollElementRef, dropdownRefProp]);\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n const [zIndex] = useAtom(dropdownZIndexAtom);\n\n return (\n <SelectPopover\n {...otherProps}\n anchorRef={controlRef}\n offset={offset}\n role=\"listbox\"\n className={cnSelectDropdown()}\n size={size}\n controlRef={controlRef}\n openAtom={openAtom}\n form={form}\n onMount={setIsListMount}\n style={{ zIndex }}\n container={container}\n >\n {isListMount && (\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar({ size: 'xs' }),\n ])}\n ref={scrollContainerRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List')}\n key={cnSelectDropdown('List')}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n key={cnSelectDropdown('List', { key: 'CreateButton' })}\n labelForCreate={labelForCreate}\n indent={indent}\n ref={itemsRefs[index]}\n onClick={onCreate}\n highlightedIndexAtom={highlightedIndexAtom}\n inputValueAtom={inputValueAtom}\n highlightIndex={highlightIndex}\n index={index}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group-${group.key}-Label`}\n />\n )}\n {group.items.map((item) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n label={selectAllLabel}\n groupId={group.key}\n highlightedIndexAtom={highlightedIndexAtom}\n groupsCounterAtom={groupsCounterAtom}\n key={cnSelectDropdown('SelectItemAll', {\n group: group.key,\n })}\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionActions({\n index,\n item,\n })}\n index={index}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectRenderItem\n key={cnSelectDropdown('SelectRenderItem', {\n group: group.key,\n item: getItemKey(item),\n })}\n getItemKeyAtom={getItemKeyAtom}\n highlightedIndexAtom={highlightedIndexAtom}\n rootRef={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n renderItem={renderItem}\n item={item}\n {...getOptionActions({\n index,\n item,\n })}\n index={index}\n valueAtom={valueAtom}\n />\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n )}\n </SelectPopover>\n );\n});\n"],"mappings":"goBAAA,6BAGA,OAASA,OAAT,KAAwB,mBAAxB,CACA,MAAOC,MAAP,EAAgBC,QAAhB,CAA0BC,IAA1B,CAAgCC,OAAhC,KAA+C,OAA/C,CAGA,OACEC,QADF,CAEEC,UAFF,CAGEC,gBAHF,wBAMA,OAEEC,oBAFF,CAGEC,iBAHF,CAIEC,oBAJF,oBAQA,OAASC,OAAT,CAAkBC,UAAlB,iCACA,OAASC,gBAAT,uCACA,OAASC,cAAT,kCACA,OAASC,UAAT,8BACA,OAASC,QAAQ,GAAIC,GAArB,0BACA,OAASC,WAAT,kCAIA,OAASC,kBAAT,gDACA,OAASC,gBAAT,4CACA,OAASC,aAAT,sCACA,OAASC,YAAT,oCACA,OAASC,aA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AZH,CAwEH,CA/FA,CALH,CAqGGP,CAAS,EAAIyB,CAAb,EACC,oBAAC,UAAD,EAAY,IAAI,CAAExC,CAAlB,CAAwB,WAAW,CAAEuC,CAArC,EAtGJ,CAVF,CAmHG,CAACxB,CAAD,EAAc,CAACoB,CAAf,EAA2B5B,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEP,CADR,CAEE,KAAK,CAAEO,CAFT,CAGE,WAAW,CAAEgC,CAHf,EAKGhC,CALH,CApHJ,CAfJ,CA+IH,CAjO0D,CAApD"}
@@ -1,3 +1,3 @@
1
1
  .canary--SelectMultiple{--select-value-offset:var(--field-control-layout-space);--select-max-height-var:var(
2
- --select-max-height-prop,calc(var(--field-control-layout-height)*3.7)
3
- )}.canary--SelectMultiple.SelectControlLayout_clearButton{--select-value-offset:calc(var(--field-control-layout-right-slot-content-width-0) + var(--field-control-layout-space)*2)}
2
+ --select-max-height-prop,calc(var(--field-control-layout-height)*3.7)
3
+ )}.canary--SelectMultiple.SelectControlLayout_clearButton{--select-value-offset:calc(var(--field-control-layout-right-slot-content-width-0) + var(--field-control-layout-space)*2)}
@@ -4,7 +4,7 @@ import { FieldPropSize } from '../../FieldComponents';
4
4
  import { PopoverPropOffset } from '../../Popover';
5
5
  import { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttributes';
6
6
  export declare const SelectPopoverForm: readonly ["default", "brick", "round"];
7
- export type SelectPopoverPropForm = typeof SelectPopoverForm[number];
7
+ export type SelectPopoverPropForm = (typeof SelectPopoverForm)[number];
8
8
  export declare const defaultSelectPopoverPropForm: "default";
9
9
  type Props = PropsWithJsxAttributes<{
10
10
  controlRef: React.MutableRefObject<HTMLDivElement | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectPopover.js","names":["classnames","reatomComponent","React","useCallback","useRef","Transition","cnListBox","Popover","animateTimeout","cnMixPopoverAnimate","SelectPopoverForm","defaultSelectPopoverPropForm","SelectPopover","props","ctx","size","className","openAtom","offset","offsetProp","controlRef","form","anchorRef","children","onMount","container","otherProps","popoverRef","spy","animate","border","shadow"],"sources":["../../../../../../src/components/SelectCanary/SelectPopover/SelectPopover.tsx"],"sourcesContent":["import { classnames } from '@bem-react/classnames';\nimport { AtomMut } from '@reatom/framework';\nimport { reatomComponent } from '@reatom/npm-react';\nimport React, { useCallback, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { FieldPropSize } from '##/components/FieldComponents';\nimport { cnListBox } from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nexport const SelectPopoverForm = ['default', 'brick', 'round'] as const;\nexport type SelectPopoverPropForm = typeof SelectPopoverForm[number];\nexport const defaultSelectPopoverPropForm = SelectPopoverForm[0];\n\ntype Props = PropsWithJsxAttributes<{\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n form: SelectPopoverPropForm;\n openAtom: AtomMut<boolean>;\n size: FieldPropSize;\n offset?: PopoverPropOffset | 'none';\n anchorRef: React.RefObject<HTMLElement> | undefined;\n children: React.ReactNode;\n onMount: (isMount: boolean) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n}>;\n\nexport const SelectPopover = reatomComponent<Props>((props) => {\n const {\n ctx,\n size,\n className,\n openAtom,\n offset: offsetProp = 'none',\n controlRef,\n form,\n anchorRef,\n children,\n onMount,\n container,\n ...otherProps\n } = props;\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n\n return (\n <Transition\n in={ctx.spy(openAtom)}\n nodeRef={popoverRef}\n timeout={animateTimeout}\n unmountOnExit\n onEntering={useCallback(() => onMount(true), [])}\n onExited={useCallback(() => onMount(false), [])}\n >\n {(animate) => {\n return (\n <Popover\n {...otherProps}\n anchorRef={anchorRef}\n container={container}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={classnames(\n className,\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n )}\n equalAnchorWidth\n >\n {children}\n </Popover>\n );\n }}\n </Transition>\n );\n});\n"],"mappings":"mNAAA,OAASA,UAAT,KAA2B,uBAA3B,CAEA,OAASC,eAAT,KAAgC,mBAAhC,CACA,MAAOC,MAAP,EAAgBC,WAAhB,CAA6BC,MAA7B,KAA2C,OAA3C,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAGA,OAASC,SAAT,wBACA,OAASC,OAAT,qBACA,OACEC,cADF,CAEEC,mBAFF,yDAMA,MAAO,IAAMC,kBAAiB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAA1B,CAEP,MAAO,IAAMC,6BAA4B,CAAGD,iBAAiB,CAAC,CAAD,CAAtD,CAeP,MAAO,IAAME,cAAa,CAAGX,eAAe,CAAQ,SAACY,CAAD,CAAW,IAE3DC,EAF2D,CAczDD,CAdyD,CAE3DC,GAF2D,CAG3DC,CAH2D,CAczDF,CAdyD,CAG3DE,IAH2D,CAI3DC,CAJ2D,CAczDH,CAdyD,CAI3DG,SAJ2D,CAK3DC,CAL2D,CAczDJ,CAdyD,CAK3DI,QAL2D,GAczDJ,CAdyD,CAM3DK,MAN2D,CAMnDC,CANmD,YAMtC,MANsC,GAO3DC,CAP2D,CAczDP,CAdyD,CAO3DO,UAP2D,CAQ3DC,CAR2D,CAczDR,CAdyD,CAQ3DQ,IAR2D,CAS3DC,CAT2D,CAczDT,CAdyD,CAS3DS,SAT2D,CAU3DC,CAV2D,CAczDV,CAdyD,CAU3DU,QAV2D,CAW3DC,CAX2D,CAczDX,CAdyD,CAW3DW,OAX2D,CAY3DC,CAZ2D,CAczDZ,CAdyD,CAY3DY,SAZ2D,CAaxDC,CAbwD,0BAczDb,CAdyD,YAgBvDK,CAAM,CAAkB,MAAf,GAAAC,CAAU,QAA0BA,CAhBU,CAkBvDQ,CAAU,CAAGvB,MAAM,CAAiB,IAAjB,CAlBoC,CAoB7D,MACE,qBAAC,UAAD,EACE,GAAIU,CAAG,CAACc,GAAJ,CAAQX,CAAR,CADN,CAEE,OAAO,CAAEU,CAFX,CAGE,OAAO,CAAEnB,cAHX,CAIE,aAAa,GAJf,CAKE,UAAU,CAAEL,WAAW,CAAC,iBAAMqB,EAAO,IAAb,CAAD,CAAsB,EAAtB,CALzB,CAME,QAAQ,CAAErB,WAAW,CAAC,iBAAMqB,EAAO,IAAb,CAAD,CAAuB,EAAvB,CANvB,EAQG,SAACK,CAAD,CAAa,CACZ,MACE,qBAAC,OAAD,kBACMH,CADN,EAEE,SAAS,CAAEJ,CAFb,CAGE,SAAS,CAAEG,CAHb,CAIE,SAAS,CAAC,eAJZ,CAKE,kBAAkB,CAAE,CAClB,eADkB,CAElB,aAFkB,CAGlB,gBAHkB,CAIlB,cAJkB,CALtB,CAWE,MAAM,CAAEP,CAXV,CAYE,GAAG,CAAES,CAZP,CAaE,IAAI,CAAC,SAbP,CAcE,SAAS,CAAE3B,UAAU,CACnBgB,CADmB,CAEnBV,SAAS,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQM,IAAI,CAAJA,CAAR,CAAcS,MAAM,GAApB,CAA4BC,MAAM,GAAlC,CAAD,CAFU,CAGnBtB,mBAAmB,CAAC,CAAEoB,OAAO,CAAPA,CAAF,CAAD,CAHA,CAdvB,CAmBE,gBAAgB,GAnBlB,GAqBGN,CArBH,CAwBH,CAlCH,CAqCH,CA1D2C,CAArC"}
1
+ {"version":3,"file":"SelectPopover.js","names":["classnames","reatomComponent","React","useCallback","useRef","Transition","cnListBox","Popover","animateTimeout","cnMixPopoverAnimate","SelectPopoverForm","defaultSelectPopoverPropForm","SelectPopover","props","ctx","size","className","openAtom","offset","offsetProp","controlRef","form","anchorRef","children","onMount","container","otherProps","popoverRef","spy","animate","border","shadow"],"sources":["../../../../../../src/components/SelectCanary/SelectPopover/SelectPopover.tsx"],"sourcesContent":["import { classnames } from '@bem-react/classnames';\nimport { AtomMut } from '@reatom/framework';\nimport { reatomComponent } from '@reatom/npm-react';\nimport React, { useCallback, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { FieldPropSize } from '##/components/FieldComponents';\nimport { cnListBox } from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nexport const SelectPopoverForm = ['default', 'brick', 'round'] as const;\nexport type SelectPopoverPropForm = (typeof SelectPopoverForm)[number];\nexport const defaultSelectPopoverPropForm = SelectPopoverForm[0];\n\ntype Props = PropsWithJsxAttributes<{\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n form: SelectPopoverPropForm;\n openAtom: AtomMut<boolean>;\n size: FieldPropSize;\n offset?: PopoverPropOffset | 'none';\n anchorRef: React.RefObject<HTMLElement> | undefined;\n children: React.ReactNode;\n onMount: (isMount: boolean) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n}>;\n\nexport const SelectPopover = reatomComponent<Props>((props) => {\n const {\n ctx,\n size,\n className,\n openAtom,\n offset: offsetProp = 'none',\n controlRef,\n form,\n anchorRef,\n children,\n onMount,\n container,\n ...otherProps\n } = props;\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n\n return (\n <Transition\n in={ctx.spy(openAtom)}\n nodeRef={popoverRef}\n timeout={animateTimeout}\n unmountOnExit\n onEntering={useCallback(() => onMount(true), [])}\n onExited={useCallback(() => onMount(false), [])}\n >\n {(animate) => {\n return (\n <Popover\n {...otherProps}\n anchorRef={anchorRef}\n container={container}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={classnames(\n className,\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n )}\n equalAnchorWidth\n >\n {children}\n </Popover>\n );\n }}\n </Transition>\n );\n});\n"],"mappings":"mNAAA,OAASA,UAAT,KAA2B,uBAA3B,CAEA,OAASC,eAAT,KAAgC,mBAAhC,CACA,MAAOC,MAAP,EAAgBC,WAAhB,CAA6BC,MAA7B,KAA2C,OAA3C,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAGA,OAASC,SAAT,wBACA,OAASC,OAAT,qBACA,OACEC,cADF,CAEEC,mBAFF,yDAMA,MAAO,IAAMC,kBAAiB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAA1B,CAEP,MAAO,IAAMC,6BAA4B,CAAGD,iBAAiB,CAAC,CAAD,CAAtD,CAeP,MAAO,IAAME,cAAa,CAAGX,eAAe,CAAQ,SAACY,CAAD,CAAW,IAE3DC,EAF2D,CAczDD,CAdyD,CAE3DC,GAF2D,CAG3DC,CAH2D,CAczDF,CAdyD,CAG3DE,IAH2D,CAI3DC,CAJ2D,CAczDH,CAdyD,CAI3DG,SAJ2D,CAK3DC,CAL2D,CAczDJ,CAdyD,CAK3DI,QAL2D,GAczDJ,CAdyD,CAM3DK,MAN2D,CAMnDC,CANmD,YAMtC,MANsC,GAO3DC,CAP2D,CAczDP,CAdyD,CAO3DO,UAP2D,CAQ3DC,CAR2D,CAczDR,CAdyD,CAQ3DQ,IAR2D,CAS3DC,CAT2D,CAczDT,CAdyD,CAS3DS,SAT2D,CAU3DC,CAV2D,CAczDV,CAdyD,CAU3DU,QAV2D,CAW3DC,CAX2D,CAczDX,CAdyD,CAW3DW,OAX2D,CAY3DC,CAZ2D,CAczDZ,CAdyD,CAY3DY,SAZ2D,CAaxDC,CAbwD,0BAczDb,CAdyD,YAgBvDK,CAAM,CAAkB,MAAf,GAAAC,CAAU,QAA0BA,CAhBU,CAkBvDQ,CAAU,CAAGvB,MAAM,CAAiB,IAAjB,CAlBoC,CAoB7D,MACE,qBAAC,UAAD,EACE,GAAIU,CAAG,CAACc,GAAJ,CAAQX,CAAR,CADN,CAEE,OAAO,CAAEU,CAFX,CAGE,OAAO,CAAEnB,cAHX,CAIE,aAAa,GAJf,CAKE,UAAU,CAAEL,WAAW,CAAC,iBAAMqB,EAAO,IAAb,CAAD,CAAsB,EAAtB,CALzB,CAME,QAAQ,CAAErB,WAAW,CAAC,iBAAMqB,EAAO,IAAb,CAAD,CAAuB,EAAvB,CANvB,EAQG,SAACK,CAAD,CAAa,CACZ,MACE,qBAAC,OAAD,kBACMH,CADN,EAEE,SAAS,CAAEJ,CAFb,CAGE,SAAS,CAAEG,CAHb,CAIE,SAAS,CAAC,eAJZ,CAKE,kBAAkB,CAAE,CAClB,eADkB,CAElB,aAFkB,CAGlB,gBAHkB,CAIlB,cAJkB,CALtB,CAWE,MAAM,CAAEP,CAXV,CAYE,GAAG,CAAES,CAZP,CAaE,IAAI,CAAC,SAbP,CAcE,SAAS,CAAE3B,UAAU,CACnBgB,CADmB,CAEnBV,SAAS,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQM,IAAI,CAAJA,CAAR,CAAcS,MAAM,GAApB,CAA4BC,MAAM,GAAlC,CAAD,CAFU,CAGnBtB,mBAAmB,CAAC,CAAEoB,OAAO,CAAPA,CAAF,CAAD,CAHA,CAdvB,CAmBE,gBAAgB,GAnBlB,GAqBGN,CArBH,CAwBH,CAlCH,CAqCH,CA1D2C,CAArC"}
@@ -55,7 +55,7 @@ export declare function withDefaultGetters<ITEM = SelectItemDefault, GROUP = Sel
55
55
  iconClear?: import("@consta/icons/Icon").IconComponent;
56
56
  selectAll?: (MULTIPLE extends true ? boolean : never) | undefined;
57
57
  selectAllLabel?: string;
58
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "onFocus" | "onBlur" | "onChange" | "onInput" | "size" | "view" | "form" | "status" | "input" | "disabled" | "value" | "multiple" | "placeholder" | "inputRef" | "items" | "dropdownForm" | "dropdownClassName" | "dropdownRef" | "isLoading" | "labelForEmptyItems" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "onScrollToBottom" | "labelForCreate" | "inputValue" | "selectAll" | "onDropdownOpen" | "dropdownOpen" | "ignoreOutsideClicksRefs" | "virtualScroll" | "dropdownViewportRef" | "dropdownContainer" | "inputDefaultValue" | "clearButton" | "iconClear" | "onCreate" | "selectAllLabel" | "aria-Label"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
58
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "onFocus" | "onBlur" | "onChange" | "onInput" | "size" | "view" | "form" | "status" | "input" | "disabled" | "value" | "multiple" | "placeholder" | "inputRef" | "items" | "dropdownForm" | "dropdownClassName" | "dropdownRef" | "isLoading" | "labelForEmptyItems" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "onScrollToBottom" | "labelForCreate" | "inputValue" | "selectAll" | "onDropdownOpen" | "dropdownOpen" | "ignoreOutsideClicksRefs" | "virtualScroll" | "dropdownViewportRef" | "dropdownContainer" | "inputDefaultValue" | "clearButton" | "iconClear" | "onCreate" | "aria-Label" | "selectAllLabel"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
59
59
  label: SelectItemDefault["label"];
60
60
  } ? {} : {
61
61
  getItemLabel: SelectPropGetItemLabel<ITEM>;
@@ -6,7 +6,7 @@ import { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttribu
6
6
  import { PropSize, RenderItemProps } from '../types';
7
7
  import { GetOptionPropsResult, OptionForCreate, OptionProps } from '../useSelect';
8
8
  export declare const selectDropdownForm: readonly ["default", "brick", "round"];
9
- export type SelectDropdownPropForm = typeof selectDropdownForm[number];
9
+ export type SelectDropdownPropForm = (typeof selectDropdownForm)[number];
10
10
  export declare const defaultSelectDropdownPropForm: "default";
11
11
  type Props<ITEM, GROUP> = PropsWithJsxAttributes<{
12
12
  size: PropSize;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useEffect","useMemo","useRef","Transition","cnListBox","ListItem","ListLoader","mapVerticalSpace","Popover","useDebounce","useFlag","forkRef","useForkRef","useVirtualScroll","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnMixSpace","cn","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","getLengthElements","elements","element","length","index","items","isVisible","slice","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","viewportRef","container","otherProps","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","listRefs","scrollElementRef","popoverRef","scrolled","setScrolled","setScrolledOffDebounce","off","fn","on","current","addEventListener","removeEventListener","animate","getIndex","getVirtualIndex","border","shadow","pV","marginTop","map","groupIndex","label","item","keyPrefix","virtualIndex","key","i","checkedCount","totalCount","ref"],"sources":["../../../../../../src/components/SelectComponents/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useEffect, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n ListLoader,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectItemAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../useSelect';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = typeof selectDropdownForm[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n}>;\n\ntype SelectDropdownComponent = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nconst cnSelectDropdown = cn('SelectDropdown');\n\nconst getLengthElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[],\n) => {\n let length = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element.items.length) {\n length += element.items.length;\n }\n }\n\n return length;\n};\n\nconst isVisible = (slice: [number, number], index: number) => {\n return index >= slice[0] && index < slice[1];\n};\n\nexport const SelectDropdown: SelectDropdownComponent = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n viewportRef,\n container,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLengthElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isOpen,\n onScrollToBottom,\n });\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const dropdownRef = useForkRef([scrollElementRef, dropdownRefProp]);\n const [scrolled, setScrolled] = useFlag();\n const setScrolledOffDebounce = useDebounce(setScrolled.off, 100);\n\n useEffect(() => {\n const fn = () => {\n setScrolled.on();\n setScrolledOffDebounce();\n };\n\n scrollElementRef.current?.addEventListener('scroll', fn);\n\n return () => {\n scrollElementRef.current?.removeEventListener('scroll', fn);\n };\n }, [scrollElementRef.current]);\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n viewportRef={viewportRef}\n container={container}\n >\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List', { scrolled })}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group, groupIndex) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n ref={itemsRefs[index]}\n {...getOptionProps({\n index,\n item: group,\n keyPrefix: groupIndex,\n })}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group-${group.key}`}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionProps({\n index,\n item,\n keyPrefix: i,\n })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n ref: forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ]),\n item,\n ...getOptionProps({\n index,\n item,\n keyPrefix: i,\n }),\n })}\n </Fragment>\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"mnCAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,OAArC,CAA8CC,MAA9C,KAA4D,OAA5D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E,CAAD,CADH,CAKT+D,IAAI,CAAJA,CALS,EAMNvD,CAAc,CAAC,CAChBR,KAAK,CAALA,CADgB,CAEhB+D,IAAI,CAAJA,CAFgB,CAGhBC,SAAS,CAAEG,CAHK,CAAD,CANR,EADb,CAgBL,CACF,CApDA,CAZH,CAmEH,CA1FA,CAJH,CA+FG7C,CAAS,EAAIU,CAAb,EACC,oBAAC,UAAD,EAAY,IAAI,CAAEzB,CAAlB,CAAwB,WAAW,CAAEwB,CAArC,EAhGJ,CAVF,CA6GG,CAACT,CAAD,EAAcP,CAAd,EAA0BS,CAA1B,EAAsCX,CAAtC,EACC,oBAAC,QAAD,EACE,IAAI,CAAEN,CADR,CAEE,KAAK,CAAEM,CAFT,CAGE,WAAW,CAAEkB,CAHf,EAKGlB,CALH,CA9GJ,CAsHG,CAACS,CAAD,EAAc,CAACP,CAAf,EAA2BD,CAA3B,EACC,oBAAC,QAAD,EACE,IAAI,CAAEP,CADR,CAEE,KAAK,CAAEO,CAFT,CAGE,WAAW,CAAEiB,CAHf,EAKGjB,CALH,CAvHJ,CAtBF,CAwJH,CAnKH,CAsKH,CArPM"}
1
+ {"version":3,"file":"SelectDropdown.js","names":["React","Fragment","useEffect","useMemo","useRef","Transition","cnListBox","ListItem","ListLoader","mapVerticalSpace","Popover","useDebounce","useFlag","forkRef","useForkRef","useVirtualScroll","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnMixSpace","cn","fabricIndex","SelectCreateButton","SelectGroupLabel","SelectItemAll","SelectLoader","isNotOptionForCreate","isOptionForCreate","isOptionForSelectAll","selectDropdownForm","defaultSelectDropdownPropForm","cnSelectDropdown","getLengthElements","elements","element","length","index","items","isVisible","slice","SelectDropdown","props","controlRef","size","getOptionProps","dropdownRefProp","dropdownRef","labelForCreate","className","labelForNotFound","labelForEmptyItems","hasItems","form","isOpen","offset","offsetProp","renderItem","visibleItems","isLoading","getGroupLabel","notFound","itemsRefs","virtualScroll","onScrollToBottom","viewportRef","container","otherProps","indent","isListShowed","filter","group","Array","isArray","lengthForVirtualScroll","isActive","spaceTop","sliceHookProp","listRefs","scrollElementRef","popoverRef","scrolled","setScrolled","setScrolledOffDebounce","off","fn","on","current","addEventListener","removeEventListener","animate","getIndex","getVirtualIndex","border","shadow","pV","marginTop","map","groupIndex","label","item","keyPrefix","virtualIndex","key","i","checkedCount","totalCount","ref"],"sources":["../../../../../../src/components/SelectComponents/SelectDropdown/SelectDropdown.tsx"],"sourcesContent":["import './SelectDropdown.css';\n\nimport React, { Fragment, useEffect, useMemo, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n cnListBox,\n ListItem,\n ListLoader,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { Popover, PopoverPropOffset } from '##/components/Popover';\nimport { useDebounce } from '##/hooks/useDebounce';\nimport { useFlag } from '##/hooks/useFlag';\nimport { forkRef, useForkRef } from '##/hooks/useForkRef';\nimport { useVirtualScroll } from '##/hooks/useVirtualScroll';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '##/mixs/MixPopoverAnimate/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { fabricIndex } from '##/utils/fabricIndex';\nimport { SelectAllItem } from '##/utils/getGroups';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport { SelectCreateButton } from '../SelectCreateButton/SelectCreateButton';\nimport { SelectGroupLabel } from '../SelectGroupLabel/SelectGroupLabel';\nimport { SelectItemAll } from '../SelectItemAll/SelectItemAll';\nimport { SelectLoader } from '../SelectLoader/SelectLoader';\nimport { PropSize, RenderItemProps } from '../types';\nimport {\n GetOptionPropsResult,\n isNotOptionForCreate,\n isOptionForCreate,\n isOptionForSelectAll,\n OptionForCreate,\n OptionProps,\n} from '../useSelect';\n\nexport const selectDropdownForm = ['default', 'brick', 'round'] as const;\nexport type SelectDropdownPropForm = (typeof selectDropdownForm)[number];\nexport const defaultSelectDropdownPropForm = selectDropdownForm[0];\n\ntype Props<ITEM, GROUP> = PropsWithJsxAttributes<{\n size: PropSize;\n controlRef: React.MutableRefObject<HTMLDivElement | null>;\n dropdownRef: React.Ref<HTMLDivElement>;\n getOptionProps(props: OptionProps<ITEM>): GetOptionPropsResult;\n form: SelectDropdownPropForm;\n isOpen: boolean;\n offset?: PopoverPropOffset | 'none';\n isLoading?: boolean;\n renderItem: (props: RenderItemProps<ITEM>) => React.ReactNode | null;\n visibleItems: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[];\n getGroupLabel?: (group: GROUP) => string;\n labelForCreate?: string;\n labelForNotFound?: string;\n labelForEmptyItems?: string;\n notFound?: boolean;\n hasItems?: boolean;\n itemsRefs: React.RefObject<HTMLDivElement>[];\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n}>;\n\ntype SelectDropdownComponent = <ITEM, GROUP>(\n props: Props<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nconst cnSelectDropdown = cn('SelectDropdown');\n\nconst getLengthElements = <ITEM, GROUP>(\n elements: (\n | OptionForCreate\n | {\n items: Array<SelectAllItem | ITEM>;\n key: string | number;\n group?: GROUP;\n groupIndex: number;\n checkedCount?: number;\n totalCount?: number;\n }\n )[],\n) => {\n let length = elements.length <= 1 ? 0 : elements.length;\n\n for (let index = 0; index < elements.length; index++) {\n const element = elements[index];\n\n if (isNotOptionForCreate(element) && element.items.length) {\n length += element.items.length;\n }\n }\n\n return length;\n};\n\nconst isVisible = (slice: [number, number], index: number) => {\n return index >= slice[0] && index < slice[1];\n};\n\nexport const SelectDropdown: SelectDropdownComponent = (props) => {\n const {\n controlRef,\n size,\n getOptionProps,\n dropdownRef: dropdownRefProp,\n labelForCreate,\n className,\n labelForNotFound,\n labelForEmptyItems,\n hasItems = true,\n form,\n isOpen,\n offset: offsetProp = 'none',\n renderItem,\n visibleItems,\n isLoading,\n getGroupLabel,\n notFound,\n itemsRefs,\n virtualScroll,\n onScrollToBottom,\n viewportRef,\n container,\n ...otherProps\n } = props;\n\n const indent = form === 'round' ? 'increased' : 'normal';\n\n const isListShowed = useMemo(() => {\n return (\n visibleItems.filter(\n (group) =>\n isOptionForCreate(group) ||\n (Array.isArray(group.items) && group.items.length > 0),\n ).length > 0\n );\n }, [visibleItems]);\n\n const offset = offsetProp === 'none' ? undefined : offsetProp;\n\n const lengthForVirtualScroll = useMemo(\n () => getLengthElements(visibleItems),\n [visibleItems],\n );\n\n const {\n spaceTop,\n slice: sliceHookProp,\n listRefs,\n scrollElementRef,\n } = useVirtualScroll({\n length: lengthForVirtualScroll,\n isActive: virtualScroll && isOpen,\n onScrollToBottom,\n });\n\n const slice: [number, number] =\n sliceHookProp[0] === 0 && virtualScroll ? [0, 50] : sliceHookProp;\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const dropdownRef = useForkRef([scrollElementRef, dropdownRefProp]);\n const [scrolled, setScrolled] = useFlag();\n const setScrolledOffDebounce = useDebounce(setScrolled.off, 100);\n\n useEffect(() => {\n const fn = () => {\n setScrolled.on();\n setScrolledOffDebounce();\n };\n\n scrollElementRef.current?.addEventListener('scroll', fn);\n\n return () => {\n scrollElementRef.current?.removeEventListener('scroll', fn);\n };\n }, [scrollElementRef.current]);\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={popoverRef}\n timeout={animateTimeout}\n >\n {(animate) => {\n const getIndex = fabricIndex();\n const getVirtualIndex = fabricIndex();\n\n return (\n <Popover\n {...otherProps}\n anchorRef={controlRef}\n direction=\"downStartLeft\"\n possibleDirections={[\n 'downStartLeft',\n 'upStartLeft',\n 'downStartRight',\n 'upStartRight',\n ]}\n offset={offset}\n ref={popoverRef}\n role=\"listbox\"\n className={cnSelectDropdown(null, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n equalAnchorWidth\n viewportRef={viewportRef}\n container={container}\n >\n <div\n className={cnSelectDropdown('ScrollContainer', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar(),\n ])}\n ref={dropdownRef}\n >\n {isLoading && !isListShowed && <SelectLoader />}\n <div\n className={cnSelectDropdown('List', { scrolled })}\n style={{ marginTop: spaceTop }}\n >\n {visibleItems.map((group, groupIndex) => {\n if (isOptionForCreate(group)) {\n const index = getIndex();\n return (\n <SelectCreateButton\n size={size}\n labelForCreate={labelForCreate}\n inputValue={group.label}\n indent={indent}\n ref={itemsRefs[index]}\n {...getOptionProps({\n index,\n item: group,\n keyPrefix: groupIndex,\n })}\n />\n );\n }\n\n const virtualIndex =\n visibleItems.length > 1 ? getVirtualIndex() : 0;\n\n return (\n <Fragment key={group.key}>\n {group.group &&\n getGroupLabel &&\n isVisible(slice, virtualIndex) && (\n <SelectGroupLabel\n label={getGroupLabel(group.group)}\n size={size}\n indent={indent}\n ref={listRefs[virtualIndex]}\n key={`group-${group.key}`}\n />\n )}\n {group.items.map((item, i) => {\n if (isOptionForSelectAll(item)) {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n\n if (isVisible(slice, virtualIndex)) {\n return (\n <SelectItemAll\n ref={forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ])}\n indent={indent}\n size={size}\n {...getOptionProps({\n index,\n item,\n keyPrefix: i,\n })}\n intermediate={\n item.checkedCount && item.totalCount\n ? item.checkedCount !== item.totalCount\n : false\n }\n checked={item.checkedCount === item.totalCount}\n countItems={item.checkedCount}\n total={item.totalCount}\n />\n );\n }\n } else {\n const virtualIndex = getVirtualIndex();\n const index = getIndex();\n if (isVisible(slice, virtualIndex)) {\n return (\n <Fragment key={`${group.key}-${i}`}>\n {renderItem({\n ref: forkRef([\n listRefs[virtualIndex],\n itemsRefs[index],\n ]),\n item,\n ...getOptionProps({\n index,\n item,\n keyPrefix: i,\n }),\n })}\n </Fragment>\n );\n }\n }\n })}\n </Fragment>\n );\n })}\n {isLoading && isListShowed && (\n <ListLoader size={size} innerOffset={indent} />\n )}\n </div>\n {!isLoading && hasItems && notFound && labelForNotFound && (\n <ListItem\n size={size}\n label={labelForNotFound}\n innerOffset={indent}\n >\n {labelForNotFound}\n </ListItem>\n )}\n {!isLoading && !hasItems && labelForEmptyItems && (\n <ListItem\n size={size}\n label={labelForEmptyItems}\n innerOffset={indent}\n >\n {labelForEmptyItems}\n </ListItem>\n )}\n </div>\n </Popover>\n );\n }}\n </Transition>\n );\n};\n"],"mappings":"mnCAAA,6BAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,OAArC,CAA8CC,MAA9C,KAA4D,OAA5D,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,SADF,CAEEC,QAFF,CAGEC,UAHF,CAIEC,gBAJF,wBAMA,OAASC,OAAT,qBACA,OAASC,WAAT,kCACA,OAASC,OAAT,8BACA,OAASC,OAAT,CAAkBC,UAAlB,iCACA,OAASC,gBAAT,uCACA,OACEC,cADF,CAEEC,mBAFF,yDAIA,OAASC,cAAT,kCACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BACA,OAASC,WAAT,kCAIA,OAASC,kBAAT,gDACA,OAASC,gBAAT,4CACA,OAASC,aAAT,sCACA,OAASC,YAAT,oCAEA,OAEEC,oBAFF,CAGEC,iBAHF,CAIEC,oBAJF,oBASA,MAAO,IAAMC,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAA3B,CAEP,MAAO,IAAMC,8BAA6B,CAAGD,kBAAkB,CAAC,CAAD,CAAxD,C,GAwCDE,iBAAgB,CAAGX,EAAE,CAAC,gBAAD,C,CAErBY,iBAAiB,CAAG,SACxBC,CADwB,CAYrB,CAGH,OACQC,EADR,CAFIC,CAAM,CAAsB,CAAnB,EAAAF,CAAQ,CAACE,MAAT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ueTag{margin:0 var(--tag-space) var(--tag-space) 0}.TagBase.SelectValueTag.TagBase_size_l,.TagBase.SelectValueTag.TagBase_size_m,.TagBase.SelectValueTag.TagBase_size_s{height:calc(var(--tag-base-height) - var(--space-3xs));line-height:calc(var(--tag-base-height) - var(--space-3xs))}.TagBase.SelectValueTag .TagBase-Label{word-break:break-word}.TagBase.SelectValueTag_disabled{background-color:var(--color-control-bg-disable);pointer-events:none}.TagBase.SelectValueTag_disabled>*{color:var(--color-control-typo-disable)}
1
+ .TagBase.SelectValueTag{margin:0 var(--tag-space) var(--tag-space) 0}.TagBase.SelectValueTag.TagBase_size_l,.TagBase.SelectValueTag.TagBase_size_m,.TagBase.SelectValueTag.TagBase_size_s{height:calc(var(--tag-base-height) - var(--space-3xs));line-height:calc(var(--tag-base-height) - var(--space-3xs))}.TagBase.SelectValueTag .TagBase-Label{overflow-wrap:break-word}.TagBase.SelectValueTag_disabled{background-color:var(--color-control-bg-disable);pointer-events:none}.TagBase.SelectValueTag_disabled>*{color:var(--color-control-typo-disable)}
@@ -1,15 +1,15 @@
1
1
  import { RefObject } from 'react';
2
2
  export declare const propSize: readonly ["m", "xs", "s", "l"];
3
- export type PropSize = typeof propSize[number];
3
+ export type PropSize = (typeof propSize)[number];
4
4
  export declare const defaultPropSize: "m";
5
5
  export declare const propForm: readonly ["default", "defaultClear", "defaultBrick", "brick", "brickDefault", "brickClear", "brickRound", "round", "roundClear", "roundBrick", "clearRound", "clearDefault", "clearBrick", "clearClear"];
6
- export type PropForm = typeof propForm[number];
6
+ export type PropForm = (typeof propForm)[number];
7
7
  export declare const defaultPropForm: "default";
8
8
  export declare const propView: readonly ["default", "clear"];
9
- export type PropView = typeof propView[number];
9
+ export type PropView = (typeof propView)[number];
10
10
  export declare const defaultPropView: "default";
11
11
  export declare const propStatus: readonly ["alert", "warning", "success"];
12
- export type PropStatus = typeof propStatus[number];
12
+ export type PropStatus = (typeof propStatus)[number];
13
13
  export type CommonSelectProps<ITEM> = {
14
14
  options: ITEM[];
15
15
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["propSize","defaultPropSize","propForm","defaultPropForm","propView","defaultPropView","propStatus"],"sources":["../../../../../src/components/SelectComponents/types.ts"],"sourcesContent":["import { RefObject } from 'react';\n\nexport const propSize = ['m', 'xs', 's', 'l'] as const;\nexport type PropSize = typeof propSize[number];\nexport const defaultPropSize = propSize[0];\n\nexport const propForm = [\n 'default',\n 'defaultClear',\n 'defaultBrick',\n 'brick',\n 'brickDefault',\n 'brickClear',\n 'brickRound',\n 'round',\n 'roundClear',\n 'roundBrick',\n 'clearRound',\n 'clearDefault',\n 'clearBrick',\n 'clearClear',\n] as const;\nexport type PropForm = typeof propForm[number];\nexport const defaultPropForm = propForm[0];\n\nexport const propView = ['default', 'clear'] as const;\nexport type PropView = typeof propView[number];\nexport const defaultPropView = propView[0];\n\nexport const propStatus = ['alert', 'warning', 'success'] as const;\nexport type PropStatus = typeof propStatus[number];\n\nexport type CommonSelectProps<ITEM> = {\n options: ITEM[];\n id: string;\n placeholder?: string;\n ariaLabel?: string;\n getOptionLabel(arg: ITEM): string;\n getOptionKey?(arg: ITEM): string | number;\n onBlur?: (event?: React.FocusEvent<HTMLInputElement>) => void;\n onFocus?: (event?: React.FocusEvent<HTMLInputElement>) => void;\n children?: never;\n dropdownClassName?: string;\n dropdownRef?: RefObject<HTMLDivElement>;\n name?: string;\n};\n\nexport type RenderItemProps<ITEM> = {\n item: ITEM;\n active: boolean;\n hovered: boolean;\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n ref: React.Ref<HTMLDivElement>;\n};\n"],"mappings":"AAEA,MAAO,IAAMA,SAAQ,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAjB,CAEP,MAAO,IAAMC,gBAAe,CAAGD,QAAQ,CAAC,CAAD,CAAhC,CAEP,MAAO,IAAME,SAAQ,CAAG,CACtB,SADsB,CAEtB,cAFsB,CAGtB,cAHsB,CAItB,OAJsB,CAKtB,cALsB,CAMtB,YANsB,CAOtB,YAPsB,CAQtB,OARsB,CAStB,YATsB,CAUtB,YAVsB,CAWtB,YAXsB,CAYtB,cAZsB,CAatB,YAbsB,CActB,YAdsB,CAAjB,CAiBP,MAAO,IAAMC,gBAAe,CAAGD,QAAQ,CAAC,CAAD,CAAhC,CAEP,MAAO,IAAME,SAAQ,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAjB,CAEP,MAAO,IAAMC,gBAAe,CAAGD,QAAQ,CAAC,CAAD,CAAhC,CAEP,MAAO,IAAME,WAAU,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAnB"}
1
+ {"version":3,"file":"types.js","names":["propSize","defaultPropSize","propForm","defaultPropForm","propView","defaultPropView","propStatus"],"sources":["../../../../../src/components/SelectComponents/types.ts"],"sourcesContent":["import { RefObject } from 'react';\n\nexport const propSize = ['m', 'xs', 's', 'l'] as const;\nexport type PropSize = (typeof propSize)[number];\nexport const defaultPropSize = propSize[0];\n\nexport const propForm = [\n 'default',\n 'defaultClear',\n 'defaultBrick',\n 'brick',\n 'brickDefault',\n 'brickClear',\n 'brickRound',\n 'round',\n 'roundClear',\n 'roundBrick',\n 'clearRound',\n 'clearDefault',\n 'clearBrick',\n 'clearClear',\n] as const;\nexport type PropForm = (typeof propForm)[number];\nexport const defaultPropForm = propForm[0];\n\nexport const propView = ['default', 'clear'] as const;\nexport type PropView = (typeof propView)[number];\nexport const defaultPropView = propView[0];\n\nexport const propStatus = ['alert', 'warning', 'success'] as const;\nexport type PropStatus = (typeof propStatus)[number];\n\nexport type CommonSelectProps<ITEM> = {\n options: ITEM[];\n id: string;\n placeholder?: string;\n ariaLabel?: string;\n getOptionLabel(arg: ITEM): string;\n getOptionKey?(arg: ITEM): string | number;\n onBlur?: (event?: React.FocusEvent<HTMLInputElement>) => void;\n onFocus?: (event?: React.FocusEvent<HTMLInputElement>) => void;\n children?: never;\n dropdownClassName?: string;\n dropdownRef?: RefObject<HTMLDivElement>;\n name?: string;\n};\n\nexport type RenderItemProps<ITEM> = {\n item: ITEM;\n active: boolean;\n hovered: boolean;\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n ref: React.Ref<HTMLDivElement>;\n};\n"],"mappings":"AAEA,MAAO,IAAMA,SAAQ,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAjB,CAEP,MAAO,IAAMC,gBAAe,CAAGD,QAAQ,CAAC,CAAD,CAAhC,CAEP,MAAO,IAAME,SAAQ,CAAG,CACtB,SADsB,CAEtB,cAFsB,CAGtB,cAHsB,CAItB,OAJsB,CAKtB,cALsB,CAMtB,YANsB,CAOtB,YAPsB,CAQtB,OARsB,CAStB,YATsB,CAUtB,YAVsB,CAWtB,YAXsB,CAYtB,cAZsB,CAatB,YAbsB,CActB,YAdsB,CAAjB,CAiBP,MAAO,IAAMC,gBAAe,CAAGD,QAAQ,CAAC,CAAD,CAAhC,CAEP,MAAO,IAAME,SAAQ,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAjB,CAEP,MAAO,IAAMC,gBAAe,CAAGD,QAAQ,CAAC,CAAD,CAAhC,CAEP,MAAO,IAAME,WAAU,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAnB"}