@consta/uikit 4.8.0 → 4.10.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 (312) hide show
  1. package/__internal__/src/components/Attach/Attach.d.ts +1 -16
  2. package/__internal__/src/components/Attachment/Attachment.css +1 -1
  3. package/__internal__/src/components/Attachment/Attachment.d.ts +2 -18
  4. package/__internal__/src/components/Attachment/Attachment.js +1 -1
  5. package/__internal__/src/components/Attachment/Attachment.js.map +1 -1
  6. package/__internal__/src/components/Attachment/index.d.ts +1 -0
  7. package/__internal__/src/components/Attachment/index.js +1 -1
  8. package/__internal__/src/components/Attachment/index.js.map +1 -1
  9. package/__internal__/src/components/Attachment/types.d.ts +21 -0
  10. package/__internal__/src/components/Attachment/types.js +2 -0
  11. package/__internal__/src/components/Attachment/types.js.map +1 -0
  12. package/__internal__/src/components/AutoCompleteCanary/helpers.d.ts +1 -1
  13. package/__internal__/src/components/Avatar/Avatar.css +1 -1
  14. package/__internal__/src/components/Avatar/Avatar.d.ts +2 -1
  15. package/__internal__/src/components/Avatar/Avatar.js +1 -1
  16. package/__internal__/src/components/Avatar/Avatar.js.map +1 -1
  17. package/__internal__/src/components/AvatarGroup/AvatarGroup.css +1 -1
  18. package/__internal__/src/components/AvatarGroup/AvatarGroup.js +1 -1
  19. package/__internal__/src/components/AvatarGroup/AvatarGroup.js.map +1 -1
  20. package/__internal__/src/components/AvatarGroup/helpers.d.ts +45 -44
  21. package/__internal__/src/components/AvatarGroup/types.d.ts +2 -1
  22. package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
  23. package/__internal__/src/components/Breadcrumbs/BreadcrumbsFitModeDropdown/BreadcrumbsFitModeDropdown.js +1 -1
  24. package/__internal__/src/components/Breadcrumbs/BreadcrumbsFitModeDropdown/BreadcrumbsFitModeDropdown.js.map +1 -1
  25. package/__internal__/src/components/Breadcrumbs/helpers.d.ts +43 -43
  26. package/__internal__/src/components/Breadcrumbs/useElements.d.ts +4 -6
  27. package/__internal__/src/components/Breadcrumbs/useElements.js +1 -1
  28. package/__internal__/src/components/Breadcrumbs/useElements.js.map +1 -1
  29. package/__internal__/src/components/CalendarDeprecated/CalendarDay/CalendarDay.d.ts +1 -1
  30. package/__internal__/src/components/CheckboxGroup/helper.d.ts +42 -42
  31. package/__internal__/src/components/ChoiceGroup/helper.d.ts +44 -44
  32. package/__internal__/src/components/CollapseGroup/helpers.d.ts +6 -6
  33. package/__internal__/src/components/Combobox/helpers.d.ts +2 -2
  34. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.d.ts +1 -1
  35. package/__internal__/src/components/ContextMenu/helpers.d.ts +4 -4
  36. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +3 -3
  37. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +1 -1
  38. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +3 -3
  39. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +1 -1
  40. package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +3 -3
  41. package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonthRange/DatePickerFieldTypeMonthRange.d.ts +1 -1
  42. package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +3 -3
  43. package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +3 -3
  44. package/__internal__/src/components/DatePicker/DatePickerFieldTypeYearRange/DatePickerFieldTypeYearRange.d.ts +1 -1
  45. package/__internal__/src/components/DateTime/DateTimeItem/DateTimeItem.d.ts +1 -1
  46. package/__internal__/src/components/DragNDropField/DragNDropField.d.ts +1 -1
  47. package/__internal__/src/components/EventInterceptor/propsHandlers/useCheckboxEventsHandler.d.ts +2 -2
  48. package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +3 -3
  49. package/__internal__/src/components/FieldGroup/FieldGroup.d.ts +1 -1
  50. package/__internal__/src/components/Header/Login/HeaderLogin.d.ts +1 -1
  51. package/__internal__/src/components/ListCanary/ListAddItem/ListAddItem.d.ts +1 -1
  52. package/__internal__/src/components/ListCanary/ListBox/ListBox.d.ts +1 -1
  53. package/__internal__/src/components/ListCanary/ListDivider/ListDivider.d.ts +1 -1
  54. package/__internal__/src/components/ListCanary/ListGroupLabel/ListGroupLabel.d.ts +1 -1
  55. package/__internal__/src/components/ListCanary/ListLoader/ListLoader.d.ts +1 -1
  56. package/__internal__/src/components/ListCanary/helper.d.ts +1 -1
  57. package/__internal__/src/components/Popover/Popover.d.ts +1 -1
  58. package/__internal__/src/components/ProgressLine/helpers.d.ts +43 -43
  59. package/__internal__/src/components/ProgressStepBar/helpers.d.ts +2 -2
  60. package/__internal__/src/components/RadioGroup/helper.d.ts +42 -42
  61. package/__internal__/src/components/Responses/Responses.d.ts +1 -1
  62. package/__internal__/src/components/Select/helpers.d.ts +2 -2
  63. package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +1 -1
  64. package/__internal__/src/components/SnackBar/helper.d.ts +42 -42
  65. package/__internal__/src/components/Steps/helper.d.ts +41 -41
  66. package/__internal__/src/components/Switch/Switch.css +1 -1
  67. package/__internal__/src/components/Switch/Switch.d.ts +20 -37
  68. package/__internal__/src/components/Switch/Switch.js +1 -1
  69. package/__internal__/src/components/Switch/Switch.js.map +1 -1
  70. package/__internal__/src/components/Switch/index.d.ts +1 -0
  71. package/__internal__/src/components/Switch/index.js +1 -1
  72. package/__internal__/src/components/Switch/index.js.map +1 -1
  73. package/__internal__/src/components/Switch/types.d.ts +35 -0
  74. package/__internal__/src/components/Switch/types.js +2 -0
  75. package/__internal__/src/components/Switch/types.js.map +1 -0
  76. package/__internal__/src/components/SwitchGroup/SwitchGroup.css +1 -1
  77. package/__internal__/src/components/SwitchGroup/SwitchGroup.js +1 -1
  78. package/__internal__/src/components/SwitchGroup/SwitchGroup.js.map +1 -1
  79. package/__internal__/src/components/SwitchGroup/helpers.d.ts +42 -42
  80. package/__internal__/src/components/SwitchGroup/types.d.ts +3 -8
  81. package/__internal__/src/components/SwitchGroup/types.js +1 -1
  82. package/__internal__/src/components/SwitchGroup/types.js.map +1 -1
  83. package/__internal__/src/components/Table/Table.js +1 -1
  84. package/__internal__/src/components/Table/Table.js.map +1 -1
  85. package/__internal__/src/components/Tabs/helpers.d.ts +74 -74
  86. package/__internal__/src/components/TagBase/TagBase.d.ts +1 -1
  87. package/__internal__/src/components/ThemeToggler/helpers.d.ts +42 -42
  88. package/__internal__/src/components/Timer/Timer.d.ts +1 -1
  89. package/__internal__/src/components/Tooltip/Tooltip.d.ts +1 -1
  90. package/__internal__/src/components/UserSelect/helpers.d.ts +2 -2
  91. package/__internal__/src/fileIcons/FileIcon/FileIcon.d.ts +1 -1
  92. package/__internal__/src/hooks/useBreakpoints/useBreakpoints.d.ts +1 -1
  93. package/__internal__/src/hooks/useHideElementsInLineCanary/helpers/getHiddenCount.d.ts +1 -0
  94. package/__internal__/src/hooks/useHideElementsInLineCanary/helpers/getHiddenCount.js +2 -0
  95. package/__internal__/src/hooks/useHideElementsInLineCanary/helpers/getHiddenCount.js.map +1 -0
  96. package/__internal__/src/hooks/useHideElementsInLineCanary/index.d.ts +2 -0
  97. package/__internal__/src/hooks/useHideElementsInLineCanary/index.js +2 -0
  98. package/__internal__/src/hooks/useHideElementsInLineCanary/index.js.map +1 -0
  99. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.d.ts +8 -0
  100. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.js +2 -0
  101. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.js.map +1 -0
  102. package/__internal__/src/icons/IconAdd/IconAdd.d.ts +1 -1
  103. package/__internal__/src/icons/IconAddToComparison/IconAddToComparison.d.ts +1 -1
  104. package/__internal__/src/icons/IconAlert/IconAlert.d.ts +1 -1
  105. package/__internal__/src/icons/IconAlignBlocksLeft/IconAlignBlocksLeft.d.ts +1 -1
  106. package/__internal__/src/icons/IconAlignBlocksRight/IconAlignBlocksRight.d.ts +1 -1
  107. package/__internal__/src/icons/IconAlignCenter/IconAlignCenter.d.ts +1 -1
  108. package/__internal__/src/icons/IconAlignJustify/IconAlignJustify.d.ts +1 -1
  109. package/__internal__/src/icons/IconAlignLeft/IconAlignLeft.d.ts +1 -1
  110. package/__internal__/src/icons/IconAlignRight/IconAlignRight.d.ts +1 -1
  111. package/__internal__/src/icons/IconAllDone/IconAllDone.d.ts +1 -1
  112. package/__internal__/src/icons/IconArrowDown/IconArrowDown.d.ts +1 -1
  113. package/__internal__/src/icons/IconArrowLeft/IconArrowLeft.d.ts +1 -1
  114. package/__internal__/src/icons/IconArrowRight/IconArrowRight.d.ts +1 -1
  115. package/__internal__/src/icons/IconArrowUp/IconArrowUp.d.ts +1 -1
  116. package/__internal__/src/icons/IconArtBrush/IconArtBrush.d.ts +1 -1
  117. package/__internal__/src/icons/IconAttach/IconAttach.d.ts +1 -1
  118. package/__internal__/src/icons/IconAxesRotate/IconAxesRotate.d.ts +1 -1
  119. package/__internal__/src/icons/IconBackward/IconBackward.d.ts +1 -1
  120. package/__internal__/src/icons/IconBag/IconBag.d.ts +1 -1
  121. package/__internal__/src/icons/IconBarrier/IconBarrier.d.ts +1 -1
  122. package/__internal__/src/icons/IconBento/IconBento.d.ts +1 -1
  123. package/__internal__/src/icons/IconBit/IconBit.d.ts +1 -1
  124. package/__internal__/src/icons/IconBold/IconBold.d.ts +1 -1
  125. package/__internal__/src/icons/IconBook/IconBook.d.ts +1 -1
  126. package/__internal__/src/icons/IconBookmarkFilled/IconBookmarkFilled.d.ts +1 -1
  127. package/__internal__/src/icons/IconBookmarkStroked/IconBookmarkStroked.d.ts +1 -1
  128. package/__internal__/src/icons/IconCalculator/IconCalculator.d.ts +1 -1
  129. package/__internal__/src/icons/IconCalendar/IconCalendar.d.ts +1 -1
  130. package/__internal__/src/icons/IconCamera/IconCamera.d.ts +1 -1
  131. package/__internal__/src/icons/IconCancel/IconCancel.d.ts +1 -1
  132. package/__internal__/src/icons/IconCards/IconCards.d.ts +1 -1
  133. package/__internal__/src/icons/IconChatFilled/IconChatFilled.d.ts +1 -1
  134. package/__internal__/src/icons/IconChatStroked/IconChatStroked.d.ts +1 -1
  135. package/__internal__/src/icons/IconCheck/IconCheck.d.ts +1 -1
  136. package/__internal__/src/icons/IconClose/IconClose.d.ts +1 -1
  137. package/__internal__/src/icons/IconCollapse/IconCollapse.d.ts +1 -1
  138. package/__internal__/src/icons/IconColorFill/IconColorFill.d.ts +1 -1
  139. package/__internal__/src/icons/IconColorText/IconColorText.d.ts +1 -1
  140. package/__internal__/src/icons/IconColumns/IconColumns.d.ts +1 -1
  141. package/__internal__/src/icons/IconCommentFilled/IconCommentFilled.d.ts +1 -1
  142. package/__internal__/src/icons/IconCommentStroked/IconCommentStroked.d.ts +1 -1
  143. package/__internal__/src/icons/IconConnection/IconConnection.d.ts +1 -1
  144. package/__internal__/src/icons/IconCopy/IconCopy.d.ts +1 -1
  145. package/__internal__/src/icons/IconCrown/IconCrown.d.ts +1 -1
  146. package/__internal__/src/icons/IconCursorMouse/IconCursorMouse.d.ts +1 -1
  147. package/__internal__/src/icons/IconDataNull/IconDataNull.d.ts +1 -1
  148. package/__internal__/src/icons/IconDiamond/IconDiamond.d.ts +1 -1
  149. package/__internal__/src/icons/IconDinosaur/IconDinosaur.d.ts +1 -1
  150. package/__internal__/src/icons/IconDisconnection/IconDisconnection.d.ts +1 -1
  151. package/__internal__/src/icons/IconDocAdd/IconDocAdd.d.ts +1 -1
  152. package/__internal__/src/icons/IconDocBlank/IconDocBlank.d.ts +1 -1
  153. package/__internal__/src/icons/IconDocDelete/IconDocDelete.d.ts +1 -1
  154. package/__internal__/src/icons/IconDocExport/IconDocExport.d.ts +1 -1
  155. package/__internal__/src/icons/IconDocFilled/IconDocFilled.d.ts +1 -1
  156. package/__internal__/src/icons/IconDown/IconDown.d.ts +1 -1
  157. package/__internal__/src/icons/IconDownload/IconDownload.d.ts +1 -1
  158. package/__internal__/src/icons/IconDrag/IconDrag.d.ts +1 -1
  159. package/__internal__/src/icons/IconDraggable/IconDraggable.d.ts +1 -1
  160. package/__internal__/src/icons/IconDrillingPartLeftFilled/IconDrillingPartLeftFilled.d.ts +1 -1
  161. package/__internal__/src/icons/IconDrillingPartLeftStroked/IconDrillingPartLeftStroked.d.ts +1 -1
  162. package/__internal__/src/icons/IconDrillingPartRightFilled/IconDrillingPartRightFilled.d.ts +1 -1
  163. package/__internal__/src/icons/IconDrillingPartRightStroked/IconDrillingPartRightStroked.d.ts +1 -1
  164. package/__internal__/src/icons/IconDrillingRig/IconDrillingRig.d.ts +1 -1
  165. package/__internal__/src/icons/IconDrop/IconDrop.d.ts +1 -1
  166. package/__internal__/src/icons/IconEdit/IconEdit.d.ts +1 -1
  167. package/__internal__/src/icons/IconExit/IconExit.d.ts +1 -1
  168. package/__internal__/src/icons/IconExpand/IconExpand.d.ts +1 -1
  169. package/__internal__/src/icons/IconEye/IconEye.d.ts +1 -1
  170. package/__internal__/src/icons/IconEyeClose/IconEyeClose.d.ts +1 -1
  171. package/__internal__/src/icons/IconFavorite/IconFavorite.d.ts +1 -1
  172. package/__internal__/src/icons/IconFilter/IconFilter.d.ts +1 -1
  173. package/__internal__/src/icons/IconFishboneFilled/IconFishboneFilled.d.ts +1 -1
  174. package/__internal__/src/icons/IconFishboneStroked/IconFishboneStroked.d.ts +1 -1
  175. package/__internal__/src/icons/IconFitToDefault/IconFitToDefault.d.ts +1 -1
  176. package/__internal__/src/icons/IconFlagFilled/IconFlagFilled.d.ts +1 -1
  177. package/__internal__/src/icons/IconFlagStroked/IconFlagStroked.d.ts +1 -1
  178. package/__internal__/src/icons/IconFolders/IconFolders.d.ts +1 -1
  179. package/__internal__/src/icons/IconForward/IconForward.d.ts +1 -1
  180. package/__internal__/src/icons/IconFunnel/IconFunnel.d.ts +1 -1
  181. package/__internal__/src/icons/IconGas/IconGas.d.ts +1 -1
  182. package/__internal__/src/icons/IconGeo/IconGeo.d.ts +1 -1
  183. package/__internal__/src/icons/IconGradients/IconGradients.d.ts +1 -1
  184. package/__internal__/src/icons/IconGrouping/IconGrouping.d.ts +1 -1
  185. package/__internal__/src/icons/IconHamburger/IconHamburger.d.ts +1 -1
  186. package/__internal__/src/icons/IconHand/IconHand.d.ts +1 -1
  187. package/__internal__/src/icons/IconHealth/IconHealth.d.ts +1 -1
  188. package/__internal__/src/icons/IconHome/IconHome.d.ts +1 -1
  189. package/__internal__/src/icons/IconInComparison/IconInComparison.d.ts +1 -1
  190. package/__internal__/src/icons/IconIncident/IconIncident.d.ts +1 -1
  191. package/__internal__/src/icons/IconInfo/IconInfo.d.ts +1 -1
  192. package/__internal__/src/icons/IconIntroduction/IconIntroduction.d.ts +1 -1
  193. package/__internal__/src/icons/IconIpad/IconIpad.d.ts +1 -1
  194. package/__internal__/src/icons/IconItalic/IconItalic.d.ts +1 -1
  195. package/__internal__/src/icons/IconKebab/IconKebab.d.ts +1 -1
  196. package/__internal__/src/icons/IconKernFilled/IconKernFilled.d.ts +1 -1
  197. package/__internal__/src/icons/IconKernStroked/IconKernStroked.d.ts +1 -1
  198. package/__internal__/src/icons/IconLaptop/IconLaptop.d.ts +1 -1
  199. package/__internal__/src/icons/IconLayers/IconLayers.d.ts +1 -1
  200. package/__internal__/src/icons/IconLeaf/IconLeaf.d.ts +1 -1
  201. package/__internal__/src/icons/IconLightningBolt/IconLightningBolt.d.ts +1 -1
  202. package/__internal__/src/icons/IconLineAndBarChart/IconLineAndBarChart.d.ts +1 -1
  203. package/__internal__/src/icons/IconLink/IconLink.d.ts +1 -1
  204. package/__internal__/src/icons/IconList/IconList.d.ts +1 -1
  205. package/__internal__/src/icons/IconListNumbered/IconListNumbered.d.ts +1 -1
  206. package/__internal__/src/icons/IconLithologyFilled/IconLithologyFilled.d.ts +1 -1
  207. package/__internal__/src/icons/IconLithologyStroked/IconLithologyStroked.d.ts +1 -1
  208. package/__internal__/src/icons/IconLock/IconLock.d.ts +1 -1
  209. package/__internal__/src/icons/IconLogicalElement/IconLogicalElement.d.ts +1 -1
  210. package/__internal__/src/icons/IconMBU/IconMBU.d.ts +1 -1
  211. package/__internal__/src/icons/IconMGRP/IconMGRP.d.ts +1 -1
  212. package/__internal__/src/icons/IconMLSP/IconMLSP.d.ts +1 -1
  213. package/__internal__/src/icons/IconMMP/IconMMP.d.ts +1 -1
  214. package/__internal__/src/icons/IconMail/IconMail.d.ts +1 -1
  215. package/__internal__/src/icons/IconMap/IconMap.d.ts +1 -1
  216. package/__internal__/src/icons/IconMaxHeight/IconMaxHeight.d.ts +1 -1
  217. package/__internal__/src/icons/IconMaxWidth/IconMaxWidth.d.ts +1 -1
  218. package/__internal__/src/icons/IconMeatball/IconMeatball.d.ts +1 -1
  219. package/__internal__/src/icons/IconMic/IconMic.d.ts +1 -1
  220. package/__internal__/src/icons/IconMolecules/IconMolecules.d.ts +1 -1
  221. package/__internal__/src/icons/IconMoon/IconMoon.d.ts +1 -1
  222. package/__internal__/src/icons/IconNodeEnd/IconNodeEnd.d.ts +1 -1
  223. package/__internal__/src/icons/IconNodeStart/IconNodeStart.d.ts +1 -1
  224. package/__internal__/src/icons/IconNodeStep/IconNodeStep.d.ts +1 -1
  225. package/__internal__/src/icons/IconNodes/IconNodes.d.ts +1 -1
  226. package/__internal__/src/icons/IconOilBarrel/IconOilBarrel.d.ts +1 -1
  227. package/__internal__/src/icons/IconOpenInNew/IconOpenInNew.d.ts +1 -1
  228. package/__internal__/src/icons/IconOperators/IconOperators.d.ts +1 -1
  229. package/__internal__/src/icons/IconPanelBottom/IconPanelBottom.d.ts +1 -1
  230. package/__internal__/src/icons/IconPanelLeft/IconPanelLeft.d.ts +1 -1
  231. package/__internal__/src/icons/IconPanelRight/IconPanelRight.d.ts +1 -1
  232. package/__internal__/src/icons/IconPanelTop/IconPanelTop.d.ts +1 -1
  233. package/__internal__/src/icons/IconPaste/IconPaste.d.ts +1 -1
  234. package/__internal__/src/icons/IconPause/IconPause.d.ts +1 -1
  235. package/__internal__/src/icons/IconPhone/IconPhone.d.ts +1 -1
  236. package/__internal__/src/icons/IconPhoto/IconPhoto.d.ts +1 -1
  237. package/__internal__/src/icons/IconPicture/IconPicture.d.ts +1 -1
  238. package/__internal__/src/icons/IconPlay/IconPlay.d.ts +1 -1
  239. package/__internal__/src/icons/IconPressureFilled/IconPressureFilled.d.ts +1 -1
  240. package/__internal__/src/icons/IconPressureStroked/IconPressureStroked.d.ts +1 -1
  241. package/__internal__/src/icons/IconPriceLabel/IconPriceLabel.d.ts +1 -1
  242. package/__internal__/src/icons/IconProcessing/IconProcessing.d.ts +1 -1
  243. package/__internal__/src/icons/IconQuestion/IconQuestion.d.ts +1 -1
  244. package/__internal__/src/icons/IconQuote/IconQuote.d.ts +1 -1
  245. package/__internal__/src/icons/IconRUO/IconRUO.d.ts +1 -1
  246. package/__internal__/src/icons/IconRUS/IconRUS.d.ts +1 -1
  247. package/__internal__/src/icons/IconRecord/IconRecord.d.ts +1 -1
  248. package/__internal__/src/icons/IconRemove/IconRemove.d.ts +1 -1
  249. package/__internal__/src/icons/IconRemoveFromComparison/IconRemoveFromComparison.d.ts +1 -1
  250. package/__internal__/src/icons/IconReply/IconReply.d.ts +1 -1
  251. package/__internal__/src/icons/IconResize/IconResize.d.ts +1 -1
  252. package/__internal__/src/icons/IconRestart/IconRestart.d.ts +1 -1
  253. package/__internal__/src/icons/IconRevert/IconRevert.d.ts +1 -1
  254. package/__internal__/src/icons/IconRing/IconRing.d.ts +1 -1
  255. package/__internal__/src/icons/IconRouble/IconRouble.d.ts +1 -1
  256. package/__internal__/src/icons/IconRuler/IconRuler.d.ts +1 -1
  257. package/__internal__/src/icons/IconSave/IconSave.d.ts +1 -1
  258. package/__internal__/src/icons/IconScreen/IconScreen.d.ts +1 -1
  259. package/__internal__/src/icons/IconSearch/IconSearch.d.ts +1 -1
  260. package/__internal__/src/icons/IconSelect/IconSelect.d.ts +1 -1
  261. package/__internal__/src/icons/IconSelectOpen/IconSelectOpen.d.ts +1 -1
  262. package/__internal__/src/icons/IconSendMessage/IconSendMessage.d.ts +1 -1
  263. package/__internal__/src/icons/IconSettings/IconSettings.d.ts +1 -1
  264. package/__internal__/src/icons/IconShape/IconShape.d.ts +1 -1
  265. package/__internal__/src/icons/IconShuffle/IconShuffle.d.ts +1 -1
  266. package/__internal__/src/icons/IconSmile/IconSmile.d.ts +1 -1
  267. package/__internal__/src/icons/IconSnowflake/IconSnowflake.d.ts +1 -1
  268. package/__internal__/src/icons/IconSortDown/IconSortDown.d.ts +1 -1
  269. package/__internal__/src/icons/IconSortDownCenter/IconSortDownCenter.d.ts +1 -1
  270. package/__internal__/src/icons/IconSortUp/IconSortUp.d.ts +1 -1
  271. package/__internal__/src/icons/IconSortUpCenter/IconSortUpCenter.d.ts +1 -1
  272. package/__internal__/src/icons/IconSpeed/IconSpeed.d.ts +1 -1
  273. package/__internal__/src/icons/IconStop/IconStop.d.ts +1 -1
  274. package/__internal__/src/icons/IconStorage/IconStorage.d.ts +1 -1
  275. package/__internal__/src/icons/IconStrikethrough/IconStrikethrough.d.ts +1 -1
  276. package/__internal__/src/icons/IconString/IconString.d.ts +1 -1
  277. package/__internal__/src/icons/IconSun/IconSun.d.ts +1 -1
  278. package/__internal__/src/icons/IconTable/IconTable.d.ts +1 -1
  279. package/__internal__/src/icons/IconTable2/IconTable2.d.ts +1 -1
  280. package/__internal__/src/icons/IconTarget/IconTarget.d.ts +1 -1
  281. package/__internal__/src/icons/IconTeam/IconTeam.d.ts +1 -1
  282. package/__internal__/src/icons/IconTechResponse/IconTechResponse.d.ts +1 -1
  283. package/__internal__/src/icons/IconTest/IconTest.d.ts +1 -1
  284. package/__internal__/src/icons/IconThumbUp/IconThumbUp.d.ts +1 -1
  285. package/__internal__/src/icons/IconTie/IconTie.d.ts +1 -1
  286. package/__internal__/src/icons/IconTop/IconTop.d.ts +1 -1
  287. package/__internal__/src/icons/IconTrajectory/IconTrajectory.d.ts +1 -1
  288. package/__internal__/src/icons/IconTrash/IconTrash.d.ts +1 -1
  289. package/__internal__/src/icons/IconType/IconType.d.ts +1 -1
  290. package/__internal__/src/icons/IconUnderline/IconUnderline.d.ts +1 -1
  291. package/__internal__/src/icons/IconUnlock/IconUnlock.d.ts +1 -1
  292. package/__internal__/src/icons/IconUnsort/IconUnsort.d.ts +1 -1
  293. package/__internal__/src/icons/IconUnsortCenter/IconUnsortCenter.d.ts +1 -1
  294. package/__internal__/src/icons/IconUpload/IconUpload.d.ts +1 -1
  295. package/__internal__/src/icons/IconUser/IconUser.d.ts +1 -1
  296. package/__internal__/src/icons/IconVZD/IconVZD.d.ts +1 -1
  297. package/__internal__/src/icons/IconVideo/IconVideo.d.ts +1 -1
  298. package/__internal__/src/icons/IconWarning/IconWarning.d.ts +1 -1
  299. package/__internal__/src/icons/IconWatch/IconWatch.d.ts +1 -1
  300. package/__internal__/src/icons/IconWellOpen/IconWellOpen.d.ts +1 -1
  301. package/__internal__/src/icons/IconWellPipe/IconWellPipe.d.ts +1 -1
  302. package/__internal__/src/icons/IconWideScreen/IconWideScreen.d.ts +1 -1
  303. package/__internal__/src/icons/IconWorldFilled/IconWorldFilled.d.ts +1 -1
  304. package/__internal__/src/icons/IconWorldStroked/IconWorldStroked.d.ts +1 -1
  305. package/__internal__/src/icons/IconWrench/IconWrench.d.ts +1 -1
  306. package/__internal__/src/icons/IconYandexDzen/IconYandexDzen.d.ts +1 -1
  307. package/__internal__/src/icons/IconYoutube/IconYoutube.d.ts +1 -1
  308. package/__internal__/src/icons/createIcon/createIcon.d.ts +1 -1
  309. package/__internal__/src/mixs/MixFocus/MixFocus.css +1 -1
  310. package/package.json +1 -1
  311. package/useHideElementsInLineCanary/index.d.ts +1 -0
  312. package/useHideElementsInLineCanary/index.js +1 -0
@@ -1,41 +1,24 @@
1
1
  import './Switch.css';
2
2
  import React from 'react';
3
- import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
4
- export declare const switchPropSize: readonly ["m", "s", "l"];
5
- export declare type SwitchPropSize = typeof switchPropSize[number];
6
- export declare const switchPropSizeDefault: SwitchPropSize;
7
- export declare const switchPropView: readonly ["primary", "ghost"];
8
- export declare type SwitchPropView = typeof switchPropView[number];
9
- export declare const switchPropViewDefault: SwitchPropView;
10
- export declare const switchPropAlign: readonly ["center", "top"];
11
- export declare type SwitchPropAlign = typeof switchPropAlign[number];
12
- export declare const switchPropAlignDefault: SwitchPropAlign;
13
- export declare type SwitchPropOnChange = (object: {
14
- e: React.ChangeEvent<HTMLInputElement>;
15
- checked: boolean;
16
- }) => void;
17
- declare type Props = {
18
- checked: boolean | undefined;
19
- size?: SwitchPropSize;
20
- view?: SwitchPropView;
21
- align?: SwitchPropAlign;
22
- disabled?: boolean;
23
- className?: string;
24
- label?: string;
25
- onChange?: SwitchPropOnChange;
26
- name?: string;
27
- onFocus?: React.FocusEventHandler<HTMLInputElement>;
28
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
29
- autoFocus?: boolean;
30
- readOnly?: boolean;
31
- required?: boolean;
32
- step?: number | string;
33
- tabIndex?: number;
34
- inputRef?: React.Ref<HTMLInputElement>;
35
- children?: never;
36
- };
37
- export declare type SwitchProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;
38
3
  export declare const cnSwitch: import("@bem-react/classname").ClassNameFormatter;
39
4
  export declare const COMPONENT_NAME: "Switch";
40
- export declare const Switch: React.ForwardRefExoticComponent<Props & Omit<React.HTMLAttributes<HTMLLabelElement>, "css" | keyof Props> & React.RefAttributes<HTMLLabelElement>>;
41
- export {};
5
+ export declare const Switch: React.ForwardRefExoticComponent<{
6
+ checked: boolean | undefined;
7
+ size?: "m" | "s" | "xs" | "l" | undefined;
8
+ view?: "primary" | "ghost" | undefined;
9
+ align?: "center" | "top" | undefined;
10
+ disabled?: boolean | undefined;
11
+ className?: string | undefined;
12
+ label?: string | undefined;
13
+ onChange?: import("./types").SwitchPropOnChange | undefined;
14
+ name?: string | undefined;
15
+ onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
16
+ onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
17
+ autoFocus?: boolean | undefined;
18
+ readOnly?: boolean | undefined;
19
+ required?: boolean | undefined;
20
+ step?: string | number | undefined;
21
+ tabIndex?: number | undefined;
22
+ inputRef?: React.Ref<HTMLInputElement> | undefined;
23
+ children?: undefined;
24
+ } & Omit<React.HTMLAttributes<HTMLLabelElement>, "css" | "className" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "size" | "label" | "view" | "step" | "name" | "autoFocus" | "disabled" | "checked" | "readOnly" | "required" | "align" | "inputRef"> & React.RefAttributes<HTMLLabelElement>>;
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef"];import"./Switch.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";export var switchPropSize=["m","s","l"];export var switchPropSizeDefault=switchPropSize[0];export var switchPropView=["primary","ghost"];export var switchPropViewDefault=switchPropView[0];export var switchPropAlign=["center","top"];export var switchPropAlignDefault=switchPropAlign[0];export var cnSwitch=cn("Switch");export var COMPONENT_NAME="Switch";export var Switch=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=void 0!==e&&e,g=d.name,h=d.size,i=void 0===h?switchPropSizeDefault:h,j=d.view,k=void 0===j?switchPropViewDefault:j,l=d.align,m=void 0===l?switchPropAlignDefault:l,n=d.disabled,o=d.className,p=d.label,q=d.onChange,r=d.onFocus,s=d.onBlur,t=d.readOnly,u=d.required,v=d.step,w=d.tabIndex,x=d.inputRef,y=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},y,{className:cnSwitch({size:i,view:k,disabled:n,align:m},[o]),ref:useForkRef([c,b])}),React.createElement("input",{type:"checkbox",name:g,className:cnSwitch("Input",[cnMixFocus()]),checked:f,disabled:n,onChange:function handleChange(a){q&&q({e:a,checked:!f})},onFocus:r,onBlur:s,readOnly:t,required:u,step:v,tabIndex:w,ref:x}),p&&React.createElement("span",{className:cnSwitch("Label")},p))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef"];import"./Switch.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{switchPropAlignDefault,switchPropSizeDefault,switchPropViewDefault}from"./types";export var cnSwitch=cn("Switch");export var COMPONENT_NAME="Switch";export var Switch=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=void 0!==e&&e,g=d.name,h=d.size,i=void 0===h?switchPropSizeDefault:h,j=d.view,k=void 0===j?switchPropViewDefault:j,l=d.align,m=void 0===l?switchPropAlignDefault:l,n=d.disabled,o=d.className,p=d.label,q=d.onChange,r=d.onFocus,s=d.onBlur,t=d.readOnly,u=d.required,v=d.step,w=d.tabIndex,x=d.inputRef,y=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},y,{className:cnSwitch({size:i,view:k,disabled:n,align:m},[o]),ref:useForkRef([c,b])}),React.createElement("input",{type:"checkbox",name:g,className:cnSwitch("Input",[cnMixFocus()]),checked:f,disabled:n,onChange:function handleChange(a){q&&q({e:a,checked:!f})},onFocus:r,onBlur:s,readOnly:t,required:u,step:v,tabIndex:w,ref:x}),p&&React.createElement("span",{className:cnSwitch("Label")},p))});
2
2
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","switchPropSize","switchPropSizeDefault","switchPropView","switchPropViewDefault","switchPropAlign","switchPropAlignDefault","cnSwitch","COMPONENT_NAME","Switch","forwardRef","props","ref","switchRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef","otherProps","handleChange","e"],"sources":["../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import './Switch.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 switchPropSize = ['m', 's', 'l'] as const;\nexport type SwitchPropSize = typeof switchPropSize[number];\nexport const switchPropSizeDefault: SwitchPropSize = switchPropSize[0];\n\nexport const switchPropView = ['primary', 'ghost'] as const;\nexport type SwitchPropView = typeof switchPropView[number];\nexport const switchPropViewDefault: SwitchPropView = switchPropView[0];\n\nexport const switchPropAlign = ['center', 'top'] as const;\nexport type SwitchPropAlign = typeof switchPropAlign[number];\nexport const switchPropAlignDefault: SwitchPropAlign = switchPropAlign[0];\n\nexport type SwitchPropOnChange = (object: {\n e: React.ChangeEvent<HTMLInputElement>;\n checked: boolean;\n}) => void;\n\ntype Props = {\n checked: boolean | undefined;\n size?: SwitchPropSize;\n view?: SwitchPropView;\n align?: SwitchPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: SwitchPropOnChange;\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};\n\nexport type SwitchProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;\n\nexport const cnSwitch = cn('Switch');\n\nexport const COMPONENT_NAME = 'Switch' as const;\n\nexport const Switch = React.forwardRef<HTMLLabelElement, SwitchProps>(\n (props, ref) => {\n const switchRef = useRef<HTMLLabelElement>(null);\n const {\n checked = false,\n name,\n size = switchPropSizeDefault,\n view = switchPropViewDefault,\n align = switchPropAlignDefault,\n disabled,\n className,\n label,\n onChange,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, switchRef);\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (e) => {\n if (onChange) {\n onChange({ e, checked: !checked });\n }\n };\n\n return (\n <label\n {...otherProps}\n className={cnSwitch({ size, view, disabled, align }, [className])}\n ref={useForkRef([switchRef, ref])}\n >\n <input\n type=\"checkbox\"\n name={name}\n className={cnSwitch('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnSwitch('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"4PAAA,qBAEA,MAAOA,MAAP,EAAoCC,MAApC,KAAkD,OAAlD,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBAEA,OAASC,eAAT,2CAEA,MAAO,IAAMC,eAAc,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,QAAD,CAAW,KAAX,CAAxB,CAEP,MAAO,IAAMC,uBAAuC,CAAGD,eAAe,CAAC,CAAD,CAA/D,CA8BP,MAAO,IAAME,SAAQ,CAAGR,EAAE,CAAC,QAAD,CAAnB,CAEP,MAAO,IAAMS,eAAc,CAAG,QAAvB,CAEP,MAAO,IAAMC,OAAM,CAAGd,KAAK,CAACe,UAAN,CACpB,SAACC,CAAD,CAAQC,CAAR,CAAgB,IACRC,EAAS,CAAGjB,MAAM,CAAmB,IAAnB,CADV,GAoBVI,eAAe,CAACQ,cAAD,CAAiBG,CAAjB,CAAwBE,CAAxB,CApBL,KAGZC,OAHY,CAGZA,CAHY,eAIZC,CAJY,GAIZA,IAJY,KAKZC,IALY,CAKZA,CALY,YAKLd,qBALK,OAMZe,IANY,CAMZA,CANY,YAMLb,qBANK,OAOZc,KAPY,CAOZA,CAPY,YAOJZ,sBAPI,GAQZa,CARY,GAQZA,QARY,CASZC,CATY,GASZA,SATY,CAUZC,CAVY,GAUZA,KAVY,CAWZC,CAXY,GAWZA,QAXY,CAYZC,CAZY,GAYZA,OAZY,CAaZC,CAbY,GAaZA,MAbY,CAcZC,CAdY,GAcZA,QAdY,CAeZC,CAfY,GAeZA,QAfY,CAgBZC,CAhBY,GAgBZA,IAhBY,CAiBZC,CAjBY,GAiBZA,QAjBY,CAkBZC,CAlBY,GAkBZA,QAlBY,CAmBTC,CAnBS,uCA4Bd,MACE,8CACMA,CADN,EAEE,SAAS,CAAEvB,QAAQ,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcE,QAAQ,CAARA,CAAd,CAAwBD,KAAK,CAALA,CAAxB,CAAD,CAAkC,CAACE,CAAD,CAAlC,CAFrB,CAGE,GAAG,CAAEvB,UAAU,CAAC,CAACgB,CAAD,CAAYD,CAAZ,CAAD,CAHjB,GAKE,6BACE,IAAI,CAAC,UADP,CAEE,IAAI,CAAEG,CAFR,CAGE,SAAS,CAAER,QAAQ,CAAC,OAAD,CAAU,CAACT,UAAU,EAAX,CAAV,CAHrB,CAIE,OAAO,CAAEgB,CAJX,CAKE,QAAQ,CAAEK,CALZ,CAME,QAAQ,CAlB6C,QAArDY,aAAqD,CAACC,CAAD,CAAO,CAC5DV,CAD4D,EAE9DA,CAAQ,CAAC,CAAEU,CAAC,CAADA,CAAF,CAAKlB,OAAO,CAAE,CAACA,CAAf,CAAD,CAEX,CAQG,CAOE,OAAO,CAAES,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,QAAQ,CAAEC,CAZZ,CAaE,GAAG,CAAEC,CAbP,EALF,CAoBGR,CAAK,EAAI,4BAAM,SAAS,CAAEd,QAAQ,CAAC,OAAD,CAAzB,EAAqCc,CAArC,CApBZ,CAuBH,CArDmB,CAAf"}
1
+ {"version":3,"file":"Switch.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","switchPropAlignDefault","switchPropSizeDefault","switchPropViewDefault","cnSwitch","COMPONENT_NAME","Switch","forwardRef","props","ref","switchRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef","otherProps","handleChange","e"],"sources":["../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import './Switch.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 { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport {\n switchPropAlignDefault,\n SwitchProps,\n switchPropSizeDefault,\n switchPropViewDefault,\n} from './types';\n\nexport const cnSwitch = cn('Switch');\n\nexport const COMPONENT_NAME = 'Switch' as const;\n\nexport const Switch = React.forwardRef<HTMLLabelElement, SwitchProps>(\n (props, ref) => {\n const switchRef = useRef<HTMLLabelElement>(null);\n const {\n checked = false,\n name,\n size = switchPropSizeDefault,\n view = switchPropViewDefault,\n align = switchPropAlignDefault,\n disabled,\n className,\n label,\n onChange,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, switchRef);\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (e) => {\n if (onChange) {\n onChange({ e, checked: !checked });\n }\n };\n\n return (\n <label\n {...otherProps}\n className={cnSwitch({ size, view, disabled, align }, [className])}\n ref={useForkRef([switchRef, ref])}\n >\n <input\n type=\"checkbox\"\n name={name}\n className={cnSwitch('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnSwitch('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"4PAAA,qBAEA,MAAOA,MAAP,EAAoCC,MAApC,KAAkD,OAAlD,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBACA,OAASC,eAAT,2CACA,OACEC,sBADF,CAGEC,qBAHF,CAIEC,qBAJF,eAOA,MAAO,IAAMC,SAAQ,CAAGL,EAAE,CAAC,QAAD,CAAnB,CAEP,MAAO,IAAMM,eAAc,CAAG,QAAvB,CAEP,MAAO,IAAMC,OAAM,CAAGX,KAAK,CAACY,UAAN,CACpB,SAACC,CAAD,CAAQC,CAAR,CAAgB,IACRC,EAAS,CAAGd,MAAM,CAAmB,IAAnB,CADV,GAoBVI,eAAe,CAACK,cAAD,CAAiBG,CAAjB,CAAwBE,CAAxB,CApBL,KAGZC,OAHY,CAGZA,CAHY,eAIZC,CAJY,GAIZA,IAJY,KAKZC,IALY,CAKZA,CALY,YAKLX,qBALK,OAMZY,IANY,CAMZA,CANY,YAMLX,qBANK,OAOZY,KAPY,CAOZA,CAPY,YAOJd,sBAPI,GAQZe,CARY,GAQZA,QARY,CASZC,CATY,GASZA,SATY,CAUZC,CAVY,GAUZA,KAVY,CAWZC,CAXY,GAWZA,QAXY,CAYZC,CAZY,GAYZA,OAZY,CAaZC,CAbY,GAaZA,MAbY,CAcZC,CAdY,GAcZA,QAdY,CAeZC,CAfY,GAeZA,QAfY,CAgBZC,CAhBY,GAgBZA,IAhBY,CAiBZC,CAjBY,GAiBZA,QAjBY,CAkBZC,CAlBY,GAkBZA,QAlBY,CAmBTC,CAnBS,uCA4Bd,MACE,8CACMA,CADN,EAEE,SAAS,CAAEvB,QAAQ,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcE,QAAQ,CAARA,CAAd,CAAwBD,KAAK,CAALA,CAAxB,CAAD,CAAkC,CAACE,CAAD,CAAlC,CAFrB,CAGE,GAAG,CAAEpB,UAAU,CAAC,CAACa,CAAD,CAAYD,CAAZ,CAAD,CAHjB,GAKE,6BACE,IAAI,CAAC,UADP,CAEE,IAAI,CAAEG,CAFR,CAGE,SAAS,CAAER,QAAQ,CAAC,OAAD,CAAU,CAACN,UAAU,EAAX,CAAV,CAHrB,CAIE,OAAO,CAAEa,CAJX,CAKE,QAAQ,CAAEK,CALZ,CAME,QAAQ,CAlB6C,QAArDY,aAAqD,CAACC,CAAD,CAAO,CAC5DV,CAD4D,EAE9DA,CAAQ,CAAC,CAAEU,CAAC,CAADA,CAAF,CAAKlB,OAAO,CAAE,CAACA,CAAf,CAAD,CAEX,CAQG,CAOE,OAAO,CAAES,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,QAAQ,CAAEC,CAZZ,CAaE,GAAG,CAAEC,CAbP,EALF,CAoBGR,CAAK,EAAI,4BAAM,SAAS,CAAEd,QAAQ,CAAC,OAAD,CAAzB,EAAqCc,CAArC,CApBZ,CAuBH,CArDmB,CAAf"}
@@ -1 +1,2 @@
1
1
  export * from './Switch';
2
+ export * from './types';
@@ -1,2 +1,2 @@
1
- export*from"./Switch";
1
+ export*from"./Switch";export*from"./types";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Switch/index.ts"],"sourcesContent":["export * from './Switch';\n"],"mappings":"AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Switch/index.ts"],"sourcesContent":["export * from './Switch';\nexport * from './types';\n"],"mappings":"AAAA,sBACA"}
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ import { PropsWithHTMLAttributes } from "../../utils/types/PropsWithHTMLAttributes";
3
+ export declare const switchPropSize: readonly ["m", "xs", "s", "l"];
4
+ export declare type SwitchPropSize = typeof switchPropSize[number];
5
+ export declare const switchPropSizeDefault: SwitchPropSize;
6
+ export declare const switchPropView: readonly ["primary", "ghost"];
7
+ export declare type SwitchPropView = typeof switchPropView[number];
8
+ export declare const switchPropViewDefault: SwitchPropView;
9
+ export declare const switchPropAlign: readonly ["center", "top"];
10
+ export declare type SwitchPropAlign = typeof switchPropAlign[number];
11
+ export declare const switchPropAlignDefault: SwitchPropAlign;
12
+ export declare type SwitchPropOnChange = (object: {
13
+ e: React.ChangeEvent<HTMLInputElement>;
14
+ checked: boolean;
15
+ }) => void;
16
+ export declare type SwitchProps = PropsWithHTMLAttributes<{
17
+ checked: boolean | undefined;
18
+ size?: SwitchPropSize;
19
+ view?: SwitchPropView;
20
+ align?: SwitchPropAlign;
21
+ disabled?: boolean;
22
+ className?: string;
23
+ label?: string;
24
+ onChange?: SwitchPropOnChange;
25
+ name?: string;
26
+ onFocus?: React.FocusEventHandler<HTMLInputElement>;
27
+ onBlur?: React.FocusEventHandler<HTMLInputElement>;
28
+ autoFocus?: boolean;
29
+ readOnly?: boolean;
30
+ required?: boolean;
31
+ step?: number | string;
32
+ tabIndex?: number;
33
+ inputRef?: React.Ref<HTMLInputElement>;
34
+ children?: never;
35
+ }, HTMLLabelElement>;
@@ -0,0 +1,2 @@
1
+ export var switchPropSize=["m","xs","s","l"];export var switchPropSizeDefault=switchPropSize[0];export var switchPropView=["primary","ghost"];export var switchPropViewDefault=switchPropView[0];export var switchPropAlign=["center","top"];export var switchPropAlignDefault=switchPropAlign[0];
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":["switchPropSize","switchPropSizeDefault","switchPropView","switchPropViewDefault","switchPropAlign","switchPropAlignDefault"],"sources":["../../../../../src/components/Switch/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const switchPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type SwitchPropSize = typeof switchPropSize[number];\nexport const switchPropSizeDefault: SwitchPropSize = switchPropSize[0];\n\nexport const switchPropView = ['primary', 'ghost'] as const;\nexport type SwitchPropView = typeof switchPropView[number];\nexport const switchPropViewDefault: SwitchPropView = switchPropView[0];\n\nexport const switchPropAlign = ['center', 'top'] as const;\nexport type SwitchPropAlign = typeof switchPropAlign[number];\nexport const switchPropAlignDefault: SwitchPropAlign = switchPropAlign[0];\n\nexport type SwitchPropOnChange = (object: {\n e: React.ChangeEvent<HTMLInputElement>;\n checked: boolean;\n}) => void;\n\nexport type SwitchProps = PropsWithHTMLAttributes<\n {\n checked: boolean | undefined;\n size?: SwitchPropSize;\n view?: SwitchPropView;\n align?: SwitchPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: SwitchPropOnChange;\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 },\n HTMLLabelElement\n>;\n"],"mappings":"AAEA,MAAO,IAAMA,eAAc,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,QAAD,CAAW,KAAX,CAAxB,CAEP,MAAO,IAAMC,uBAAuC,CAAGD,eAAe,CAAC,CAAD,CAA/D"}
@@ -1 +1 @@
1
- .SwitchGroup{display:flex}.SwitchGroup_direction_column{flex-direction:column}.SwitchGroup_direction_column .SwitchGroup-Item:not(:last-child){margin-bottom:var(--offset)}.SwitchGroup_direction_row{flex-direction:row}.SwitchGroup_direction_row .SwitchGroup-Item:not(:last-child){margin-right:var(--offset)}.SwitchGroup_size_m{--offset:var(--space-xs)}.SwitchGroup_size_l{--offset:var(--space-s)}
1
+ .SwitchGroup{display:flex;gap:var(--offset)}.SwitchGroup_direction_column{flex-direction:column}.SwitchGroup_direction_row{flex-direction:row}.SwitchGroup_size_s,.SwitchGroup_size_xs{--offset:var(--space-2xs)}.SwitchGroup_size_m{--offset:var(--space-xs)}.SwitchGroup_size_l{--offset:var(--space-s)}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","disabled","className"];import"./SwitchGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Switch}from"../Switch/Switch";import{withDefaultGetters}from"./helpers";import{switchGroupDefaultDirection,switchGroupDefaultSize,switchGroupDefaultView}from"./types";export var cnSwitchGroup=cn("SwitchGroup");var SwitchGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemLabel,h=c.getItemDisabled,i=c.onChange,j=c.name,k=c.direction,l=void 0===k?switchGroupDefaultDirection:k,m=c.size,n=void 0===m?switchGroupDefaultSize:m,o=c.view,p=void 0===o?switchGroupDefaultView:o,q=c.disabled,r=c.className,s=_objectWithoutProperties(c,_excluded),t=useChoiceGroup({value:e,getKey:g,callBack:i,multiple:!0}),u=t.getOnChange,v=t.getChecked;return React.createElement("div",Object.assign({},s,{ref:b,className:cnSwitchGroup({direction:l,size:n,view:p},[r])}),f.map(function(a){return React.createElement(Switch,{key:g(a),label:g(a),size:n,view:p,name:j,disabled:void 0!==q&&q||(null===h||void 0===h?void 0:h(a)),checked:v(a),onChange:function(b){var c=b.e;return u(a)(c)},className:cnSwitchGroup("Item")})}))};export var SwitchGroup=forwardRef(SwitchGroupRender);export*from"./types";
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","disabled","className"];import"./SwitchGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Switch,switchPropSizeDefault,switchPropViewDefault}from"../Switch";import{withDefaultGetters}from"./helpers";import{switchGroupDefaultDirection}from"./types";export var cnSwitchGroup=cn("SwitchGroup");var SwitchGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemLabel,h=c.getItemDisabled,i=c.onChange,j=c.name,k=c.direction,l=void 0===k?switchGroupDefaultDirection:k,m=c.size,n=void 0===m?switchPropSizeDefault:m,o=c.view,p=void 0===o?switchPropViewDefault:o,q=c.disabled,r=c.className,s=_objectWithoutProperties(c,_excluded),t=useChoiceGroup({value:e,getKey:g,callBack:i,multiple:!0}),u=t.getOnChange,v=t.getChecked;return React.createElement("div",Object.assign({},s,{ref:b,className:cnSwitchGroup({direction:l,size:n,view:p},[r])}),f.map(function(a){return React.createElement(Switch,{key:g(a),label:g(a),size:n,view:p,name:j,disabled:void 0!==q&&q||(null===h||void 0===h?void 0:h(a)),checked:v(a),onChange:function(b){var c=b.e;return u(a)(c)},className:cnSwitchGroup("Item")})}))};export var SwitchGroup=forwardRef(SwitchGroupRender);export*from"./types";
2
2
  //# sourceMappingURL=SwitchGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Switch","withDefaultGetters","switchGroupDefaultDirection","switchGroupDefaultSize","switchGroupDefaultView","cnSwitchGroup","SwitchGroupRender","props","ref","value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","disabled","className","otherProps","getKey","callBack","multiple","getOnChange","getChecked","map","item","e","SwitchGroup"],"sources":["../../../../../src/components/SwitchGroup/SwitchGroup.tsx"],"sourcesContent":["import './SwitchGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { Switch } from '../Switch/Switch';\nimport { withDefaultGetters } from './helpers';\nimport {\n SwitchGroupComponent,\n switchGroupDefaultDirection,\n switchGroupDefaultSize,\n switchGroupDefaultView,\n SwitchGroupProps,\n} from './types';\n\nexport const cnSwitchGroup = cn('SwitchGroup');\n\nconst SwitchGroupRender = (\n props: SwitchGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemLabel,\n getItemDisabled,\n onChange,\n name,\n direction = switchGroupDefaultDirection,\n size = switchGroupDefaultSize,\n view = switchGroupDefaultView,\n disabled = false,\n className,\n ...otherProps\n } = withDefaultGetters(props);\n\n const { getOnChange, getChecked } = useChoiceGroup({\n value,\n getKey: getItemLabel,\n callBack: onChange,\n multiple: true,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnSwitchGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => (\n <Switch\n key={getItemLabel(item)}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n disabled={disabled || getItemDisabled?.(item)}\n checked={getChecked(item)}\n onChange={({ e }) => getOnChange(item)(e)}\n className={cnSwitchGroup('Item')}\n />\n ))}\n </div>\n );\n};\n\nexport const SwitchGroup = forwardRef(\n SwitchGroupRender,\n) as SwitchGroupComponent;\n\nexport * from './types';\n"],"mappings":"yNAAA,0BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OAASC,MAAT,wBACA,OAASC,kBAAT,iBACA,OAEEC,2BAFF,CAGEC,sBAHF,CAIEC,sBAJF,eAQA,MAAO,IAAMC,cAAa,CAAGN,EAAE,CAAC,aAAD,CAAxB,CAEP,GAAMO,kBAAiB,CAAG,SACxBC,CADwB,CAExBC,CAFwB,CAGrB,OAcCP,kBAAkB,CAACM,CAAD,CAdnB,KAEDE,KAFC,CAEDA,CAFC,YAEO,IAFP,GAGDC,CAHC,GAGDA,KAHC,CAIDC,CAJC,GAIDA,YAJC,CAKDC,CALC,GAKDA,eALC,CAMDC,CANC,GAMDA,QANC,CAODC,CAPC,GAODA,IAPC,KAQDC,SARC,CAQDA,CARC,YAQWb,2BARX,OASDc,IATC,CASDA,CATC,YASMb,sBATN,OAUDc,IAVC,CAUDA,CAVC,YAUMb,sBAVN,OAWDc,QAXC,CAYDC,CAZC,GAYDA,SAZC,CAaEC,CAbF,yCAgBiCtB,cAAc,CAAC,CACjDW,KAAK,CAALA,CADiD,CAEjDY,MAAM,CAAEV,CAFyC,CAGjDW,QAAQ,CAAET,CAHuC,CAIjDU,QAAQ,GAJyC,CAAD,CAhB/C,CAgBKC,CAhBL,GAgBKA,WAhBL,CAgBkBC,CAhBlB,GAgBkBA,UAhBlB,CAuBH,MACE,4CACML,CADN,EAEE,GAAG,CAAEZ,CAFP,CAGE,SAAS,CAAEH,aAAa,CAAC,CAAEU,SAAS,CAATA,CAAF,CAAaC,IAAI,CAAJA,CAAb,CAAmBC,IAAI,CAAJA,CAAnB,CAAD,CAA4B,CAACE,CAAD,CAA5B,CAH1B,GAKGT,CAAK,CAACgB,GAAN,CAAU,SAACC,CAAD,QACT,qBAAC,MAAD,EACE,GAAG,CAAEhB,CAAY,CAACgB,CAAD,CADnB,CAEE,KAAK,CAAEhB,CAAY,CAACgB,CAAD,CAFrB,CAGE,IAAI,CAAEX,CAHR,CAIE,IAAI,CAAEC,CAJR,CAKE,IAAI,CAAEH,CALR,CAME,QAAQ,CAAE,uBAAYF,CAAZ,WAAYA,CAAZ,QAAYA,CAAe,CAAGe,CAAH,CAA3B,CANZ,CAOE,OAAO,CAAEF,CAAU,CAACE,CAAD,CAPrB,CAQE,QAAQ,CAAE,eAAGC,EAAH,GAAGA,CAAH,OAAWJ,EAAW,CAACG,CAAD,CAAX,CAAkBC,CAAlB,CAAX,CARZ,CASE,SAAS,CAAEvB,aAAa,CAAC,MAAD,CAT1B,EADS,CAAV,CALH,CAoBH,CA/CD,CAiDA,MAAO,IAAMwB,YAAW,CAAGhC,UAAU,CACnCS,iBADmC,CAA9B,CAIP"}
1
+ {"version":3,"file":"SwitchGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Switch","switchPropSizeDefault","switchPropViewDefault","withDefaultGetters","switchGroupDefaultDirection","cnSwitchGroup","SwitchGroupRender","props","ref","value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","disabled","className","otherProps","getKey","callBack","multiple","getOnChange","getChecked","map","item","e","SwitchGroup"],"sources":["../../../../../src/components/SwitchGroup/SwitchGroup.tsx"],"sourcesContent":["import './SwitchGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport {\n Switch,\n switchPropSizeDefault,\n switchPropViewDefault,\n} from '../Switch';\nimport { withDefaultGetters } from './helpers';\nimport {\n SwitchGroupComponent,\n switchGroupDefaultDirection,\n SwitchGroupProps,\n} from './types';\n\nexport const cnSwitchGroup = cn('SwitchGroup');\n\nconst SwitchGroupRender = (\n props: SwitchGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemLabel,\n getItemDisabled,\n onChange,\n name,\n direction = switchGroupDefaultDirection,\n size = switchPropSizeDefault,\n view = switchPropViewDefault,\n disabled = false,\n className,\n ...otherProps\n } = withDefaultGetters(props);\n\n const { getOnChange, getChecked } = useChoiceGroup({\n value,\n getKey: getItemLabel,\n callBack: onChange,\n multiple: true,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnSwitchGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => (\n <Switch\n key={getItemLabel(item)}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n disabled={disabled || getItemDisabled?.(item)}\n checked={getChecked(item)}\n onChange={({ e }) => getOnChange(item)(e)}\n className={cnSwitchGroup('Item')}\n />\n ))}\n </div>\n );\n};\n\nexport const SwitchGroup = forwardRef(\n SwitchGroupRender,\n) as SwitchGroupComponent;\n\nexport * from './types';\n"],"mappings":"yNAAA,0BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OACEC,MADF,CAEEC,qBAFF,CAGEC,qBAHF,iBAKA,OAASC,kBAAT,iBACA,OAEEC,2BAFF,eAMA,MAAO,IAAMC,cAAa,CAAGN,EAAE,CAAC,aAAD,CAAxB,CAEP,GAAMO,kBAAiB,CAAG,SACxBC,CADwB,CAExBC,CAFwB,CAGrB,OAcCL,kBAAkB,CAACI,CAAD,CAdnB,KAEDE,KAFC,CAEDA,CAFC,YAEO,IAFP,GAGDC,CAHC,GAGDA,KAHC,CAIDC,CAJC,GAIDA,YAJC,CAKDC,CALC,GAKDA,eALC,CAMDC,CANC,GAMDA,QANC,CAODC,CAPC,GAODA,IAPC,KAQDC,SARC,CAQDA,CARC,YAQWX,2BARX,OASDY,IATC,CASDA,CATC,YASMf,qBATN,OAUDgB,IAVC,CAUDA,CAVC,YAUMf,qBAVN,OAWDgB,QAXC,CAYDC,CAZC,GAYDA,SAZC,CAaEC,CAbF,yCAgBiCtB,cAAc,CAAC,CACjDW,KAAK,CAALA,CADiD,CAEjDY,MAAM,CAAEV,CAFyC,CAGjDW,QAAQ,CAAET,CAHuC,CAIjDU,QAAQ,GAJyC,CAAD,CAhB/C,CAgBKC,CAhBL,GAgBKA,WAhBL,CAgBkBC,CAhBlB,GAgBkBA,UAhBlB,CAuBH,MACE,4CACML,CADN,EAEE,GAAG,CAAEZ,CAFP,CAGE,SAAS,CAAEH,aAAa,CAAC,CAAEU,SAAS,CAATA,CAAF,CAAaC,IAAI,CAAJA,CAAb,CAAmBC,IAAI,CAAJA,CAAnB,CAAD,CAA4B,CAACE,CAAD,CAA5B,CAH1B,GAKGT,CAAK,CAACgB,GAAN,CAAU,SAACC,CAAD,QACT,qBAAC,MAAD,EACE,GAAG,CAAEhB,CAAY,CAACgB,CAAD,CADnB,CAEE,KAAK,CAAEhB,CAAY,CAACgB,CAAD,CAFrB,CAGE,IAAI,CAAEX,CAHR,CAIE,IAAI,CAAEC,CAJR,CAKE,IAAI,CAAEH,CALR,CAME,QAAQ,CAAE,uBAAYF,CAAZ,WAAYA,CAAZ,QAAYA,CAAe,CAAGe,CAAH,CAA3B,CANZ,CAOE,OAAO,CAAEF,CAAU,CAACE,CAAD,CAPrB,CAQE,QAAQ,CAAE,eAAGC,EAAH,GAAGA,CAAH,OAAWJ,EAAW,CAACG,CAAD,CAAX,CAAkBC,CAAlB,CAAX,CARZ,CASE,SAAS,CAAEvB,aAAa,CAAC,MAAD,CAT1B,EADS,CAAV,CALH,CAoBH,CA/CD,CAiDA,MAAO,IAAMwB,YAAW,CAAGhC,UAAU,CACnCS,iBADmC,CAA9B,CAIP"}
@@ -11,18 +11,53 @@ export declare const withDefaultGetters: (props: SwitchGroupProps) => {
11
11
  }) => void;
12
12
  name: string;
13
13
  direction?: "row" | "column" | undefined;
14
- size?: "m" | "l" | undefined;
14
+ size?: "m" | "s" | "xs" | "l" | undefined;
15
15
  view?: "primary" | "ghost" | undefined;
16
16
  disabled?: boolean | undefined;
17
17
  className?: string | undefined;
18
+ defaultChecked?: boolean | undefined;
19
+ defaultValue?: string | number | readonly string[] | undefined;
20
+ suppressContentEditableWarning?: boolean | undefined;
21
+ suppressHydrationWarning?: boolean | undefined;
22
+ accessKey?: string | undefined;
23
+ contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
24
+ contextMenu?: string | undefined;
25
+ dir?: string | undefined;
26
+ draggable?: (boolean | "true" | "false") | undefined;
27
+ hidden?: boolean | undefined;
28
+ id?: string | undefined;
29
+ lang?: string | undefined;
30
+ placeholder?: string | undefined;
18
31
  slot?: string | undefined;
32
+ spellCheck?: (boolean | "true" | "false") | undefined;
19
33
  style?: import("react").CSSProperties | undefined;
34
+ tabIndex?: number | undefined;
20
35
  title?: string | undefined;
21
- color?: string | undefined;
22
- id?: string | undefined;
23
- lang?: string | undefined;
36
+ translate?: "yes" | "no" | undefined;
37
+ radioGroup?: string | undefined;
24
38
  role?: import("react").AriaRole | undefined;
25
- tabIndex?: number | undefined;
39
+ about?: string | undefined;
40
+ datatype?: string | undefined;
41
+ inlist?: any;
42
+ prefix?: string | undefined;
43
+ property?: string | undefined;
44
+ resource?: string | undefined;
45
+ typeof?: string | undefined;
46
+ vocab?: string | undefined;
47
+ autoCapitalize?: string | undefined;
48
+ autoCorrect?: string | undefined;
49
+ autoSave?: string | undefined;
50
+ color?: string | undefined;
51
+ itemProp?: string | undefined;
52
+ itemScope?: boolean | undefined;
53
+ itemType?: string | undefined;
54
+ itemID?: string | undefined;
55
+ itemRef?: string | undefined;
56
+ results?: number | undefined;
57
+ security?: string | undefined;
58
+ unselectable?: "on" | "off" | undefined;
59
+ inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
60
+ is?: string | undefined;
26
61
  'aria-activedescendant'?: string | undefined;
27
62
  'aria-atomic'?: (boolean | "true" | "false") | undefined;
28
63
  'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
@@ -32,7 +67,7 @@ export declare const withDefaultGetters: (props: SwitchGroupProps) => {
32
67
  'aria-colindex'?: number | undefined;
33
68
  'aria-colspan'?: number | undefined;
34
69
  'aria-controls'?: string | undefined;
35
- 'aria-current'?: boolean | "time" | "step" | "date" | "true" | "false" | "page" | "location" | undefined;
70
+ 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
36
71
  'aria-describedby'?: string | undefined;
37
72
  'aria-details'?: string | undefined;
38
73
  'aria-disabled'?: (boolean | "true" | "false") | undefined;
@@ -41,7 +76,7 @@ export declare const withDefaultGetters: (props: SwitchGroupProps) => {
41
76
  'aria-expanded'?: (boolean | "true" | "false") | undefined;
42
77
  'aria-flowto'?: string | undefined;
43
78
  'aria-grabbed'?: (boolean | "true" | "false") | undefined;
44
- 'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
79
+ 'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
45
80
  'aria-hidden'?: (boolean | "true" | "false") | undefined;
46
81
  'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
47
82
  'aria-keyshortcuts'?: string | undefined;
@@ -234,41 +269,6 @@ export declare const withDefaultGetters: (props: SwitchGroupProps) => {
234
269
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
235
270
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
236
271
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
237
- defaultChecked?: boolean | undefined;
238
- defaultValue?: string | number | readonly string[] | undefined;
239
- suppressContentEditableWarning?: boolean | undefined;
240
- suppressHydrationWarning?: boolean | undefined;
241
- accessKey?: string | undefined;
242
- contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
243
- contextMenu?: string | undefined;
244
- dir?: string | undefined;
245
- draggable?: (boolean | "true" | "false") | undefined;
246
- hidden?: boolean | undefined;
247
- placeholder?: string | undefined;
248
- spellCheck?: (boolean | "true" | "false") | undefined;
249
- translate?: "no" | "yes" | undefined;
250
- radioGroup?: string | undefined;
251
- about?: string | undefined;
252
- datatype?: string | undefined;
253
- inlist?: any;
254
- prefix?: string | undefined;
255
- property?: string | undefined;
256
- resource?: string | undefined;
257
- typeof?: string | undefined;
258
- vocab?: string | undefined;
259
- autoCapitalize?: string | undefined;
260
- autoCorrect?: string | undefined;
261
- autoSave?: string | undefined;
262
- itemProp?: string | undefined;
263
- itemScope?: boolean | undefined;
264
- itemType?: string | undefined;
265
- itemID?: string | undefined;
266
- itemRef?: string | undefined;
267
- results?: number | undefined;
268
- security?: string | undefined;
269
- unselectable?: "on" | "off" | undefined;
270
- inputMode?: "text" | "email" | "search" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
271
- is?: string | undefined;
272
272
  ref?: import("react").Ref<HTMLDivElement> | undefined;
273
273
  key?: import("react").Key | null | undefined;
274
274
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
3
+ import { SwitchPropSize, SwitchPropView } from '../Switch/types';
3
4
  export declare type SwitchGroupDefaultItem = {
4
5
  label: string;
5
6
  disabled?: boolean;
@@ -7,12 +8,6 @@ export declare type SwitchGroupDefaultItem = {
7
8
  export declare const switchGroupDirections: readonly ["column", "row"];
8
9
  export declare type SwitchGroupDirection = typeof switchGroupDirections[number];
9
10
  export declare const switchGroupDefaultDirection: SwitchGroupDirection;
10
- export declare const switchGroupSizes: readonly ["m", "l"];
11
- export declare type SwitchGroupPropSize = typeof switchGroupSizes[number];
12
- export declare const switchGroupDefaultSize: SwitchGroupPropSize;
13
- export declare const switchGroupViews: readonly ["primary", "ghost"];
14
- export declare type SwitchGroupPropView = typeof switchGroupViews[number];
15
- export declare const switchGroupDefaultView: SwitchGroupPropView;
16
11
  export declare type SwitchGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;
17
12
  export declare type SwitchGroupPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
18
13
  export declare type SwitchGroupProps<ITEM = SwitchGroupDefaultItem> = PropsWithHTMLAttributesAndRef<{
@@ -26,8 +21,8 @@ export declare type SwitchGroupProps<ITEM = SwitchGroupDefaultItem> = PropsWithH
26
21
  }) => void;
27
22
  name: string;
28
23
  direction?: SwitchGroupDirection;
29
- size?: SwitchGroupPropSize;
30
- view?: SwitchGroupPropView;
24
+ size?: SwitchPropSize;
25
+ view?: SwitchPropView;
31
26
  disabled?: boolean;
32
27
  className?: string;
33
28
  }, HTMLDivElement> & (ITEM extends {
@@ -1,2 +1,2 @@
1
- export var switchGroupDirections=["column","row"];export var switchGroupDefaultDirection=switchGroupDirections[0];export var switchGroupSizes=["m","l"];export var switchGroupDefaultSize=switchGroupSizes[0];export var switchGroupViews=["primary","ghost"];export var switchGroupDefaultView=switchGroupViews[0];
1
+ export var switchGroupDirections=["column","row"];export var switchGroupDefaultDirection=switchGroupDirections[0];
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["switchGroupDirections","switchGroupDefaultDirection","switchGroupSizes","switchGroupDefaultSize","switchGroupViews","switchGroupDefaultView"],"sources":["../../../../../src/components/SwitchGroup/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport type SwitchGroupDefaultItem = {\n label: string;\n disabled?: boolean;\n};\n\nexport const switchGroupDirections = ['column', 'row'] as const;\nexport type SwitchGroupDirection = typeof switchGroupDirections[number];\nexport const switchGroupDefaultDirection: SwitchGroupDirection =\n switchGroupDirections[0];\n\nexport const switchGroupSizes = ['m', 'l'] as const;\nexport type SwitchGroupPropSize = typeof switchGroupSizes[number];\nexport const switchGroupDefaultSize: SwitchGroupPropSize = switchGroupSizes[0];\n\nexport const switchGroupViews = ['primary', 'ghost'] as const;\nexport type SwitchGroupPropView = typeof switchGroupViews[number];\nexport const switchGroupDefaultView: SwitchGroupPropView = switchGroupViews[0];\n\nexport type SwitchGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type SwitchGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type SwitchGroupProps<ITEM = SwitchGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n value?: ITEM[] | null;\n items: ITEM[];\n getItemLabel?: SwitchGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: SwitchGroupPropGetItemDisabled<ITEM>;\n onChange: (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: ITEM[] | null;\n }) => void;\n name: string;\n direction?: SwitchGroupDirection;\n size?: SwitchGroupPropSize;\n view?: SwitchGroupPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: SwitchGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: SwitchGroupPropGetItemLabel<ITEM>;\n });\n\nexport type SwitchGroupComponent = <ITEM>(\n props: SwitchGroupProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAOA,MAAO,IAAMA,sBAAqB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA9B,CAEP,MAAO,IAAMC,4BAAiD,CAC5DD,qBAAqB,CAAC,CAAD,CADhB,CAGP,MAAO,IAAME,iBAAgB,CAAG,CAAC,GAAD,CAAM,GAAN,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE,CAEP,MAAO,IAAME,iBAAgB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE"}
1
+ {"version":3,"file":"types.js","names":["switchGroupDirections","switchGroupDefaultDirection"],"sources":["../../../../../src/components/SwitchGroup/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { SwitchPropSize, SwitchPropView } from '../Switch/types';\n\nexport type SwitchGroupDefaultItem = {\n label: string;\n disabled?: boolean;\n};\n\nexport const switchGroupDirections = ['column', 'row'] as const;\nexport type SwitchGroupDirection = typeof switchGroupDirections[number];\nexport const switchGroupDefaultDirection: SwitchGroupDirection =\n switchGroupDirections[0];\n\nexport type SwitchGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type SwitchGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type SwitchGroupProps<ITEM = SwitchGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n value?: ITEM[] | null;\n items: ITEM[];\n getItemLabel?: SwitchGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: SwitchGroupPropGetItemDisabled<ITEM>;\n onChange: (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: ITEM[] | null;\n }) => void;\n name: string;\n direction?: SwitchGroupDirection;\n size?: SwitchPropSize;\n view?: SwitchPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: SwitchGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: SwitchGroupPropGetItemLabel<ITEM>;\n });\n\nexport type SwitchGroupComponent = <ITEM>(\n props: SwitchGroupProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAQA,MAAO,IAAMA,sBAAqB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA9B,CAEP,MAAO,IAAMC,4BAAiD,CAC5DD,qBAAqB,CAAC,CAAD,CADhB"}
@@ -1,2 +1,2 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _excluded=["columns","rows","size","filters","isResizable","stickyHeader","stickyColumns","minColumnWidth","activeRow","verticalAlign","headerVerticalAlign","zebraStriped","borderBetweenRows","borderBetweenColumns","emptyRowsPlaceholder","defaultExpandAll","className","onRowHover","onRowClick","onRowCreate","onCellClick","getAdditionalClassName","rowCreateText","lazyLoad","onSortBy","onFiltersUpdated","getTagLabel","getCellWrap","isExpandedRowsByDefault"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./Table.css";import{IconSortDown}from"@consta/icons/IconSortDown";import{IconSortUp}from"@consta/icons/IconSortUp";import{IconUnsort}from"@consta/icons/IconUnsort";import React,{useEffect,useMemo}from"react";import{useComponentSize}from"../../hooks/useComponentSize/useComponentSize";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{sortBy as sortByDefault,updateAt}from"../../utils/array";import{cn}from"../../utils/bem";import{setRef}from"../../utils/setRef";import{isNotNil,isString}from"../../utils/type-guards";import{Button}from"../Button/Button";import{Text}from"../Text/Text";import{TableCell}from"./Cell/TableCell";import{fieldFiltersPresent,filterTableData,getSelectedFiltersList,isSelectedFiltersPresent,useSelectedFilters}from"./filtering";import{TableHeader}from"./Header/TableHeader";import{calulateColSpans,createSortingState,getColumnLeftOffset,getColumnsSize,getMergedArray,getNewSorting,Order,transformRows,useHeaderData,useLazyLoadData}from"./helpers";import{TableResizer}from"./Resizer/TableResizer";import{TableRowsCollapse}from"./RowsCollapse/TableRowsCollapse";import{TableSelectedOptionsList}from"./SelectedOptionsList/TableSelectedOptionsList";export{TableTextFilter}from"./TextFilter/TableTextFilter";export{TableFilterContainer}from"./FilterContainer/TableFilterContainer";export{TableNumberFilter}from"./NumberFilter/TableNumberFilter";export{TableChoiceGroupFilter}from"./ChoiceGroupFilter/TableChoiceGroupFilter";var cnTable=cn("Table");export var sizes=["s","m","l"];export var zebraStriped=["odd","even"];export var headerVerticalAligns=["center","bottom"];var createButtonSizeMap={s:"xs",m:"s",l:"m"},getColumnSortByField=function(a){return a.sortable&&a.sortByField||a.accessor},sortingData=function(a,b,c){if(c)return a;if(!b)return a;var d=sortByDefault(a,b.by,b.order,b.sortFn);return d.some(function(a){var b;return null===(b=a.rows)||void 0===b?void 0:b.length})?d.map(function(a){return a.rows?_objectSpread(_objectSpread({},a),{},{rows:sortingData(a.rows,b,c)}):a}):d},defaultEmptyRowsPlaceholder=React.createElement(Text,{as:"span",view:"primary",size:"s",lineHeight:"s"},"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"),InternalTable=function(a,b){var c,d,e,f,g=a.columns,h=a.rows,i=a.size,j=void 0===i?"l":i,k=a.filters,l=a.isResizable,m=void 0!==l&&l,n=a.stickyHeader,o=a.stickyColumns,p=void 0===o?0:o,q=a.minColumnWidth,r=void 0===q?150:q,s=a.activeRow,t=a.verticalAlign,u=void 0===t?"top":t,v=a.headerVerticalAlign,w=void 0===v?"center":v,x=a.zebraStriped,y=a.borderBetweenRows,z=a.borderBetweenColumns,A=void 0!==z&&z,B=a.emptyRowsPlaceholder,C=void 0===B?defaultEmptyRowsPlaceholder:B,D=a.defaultExpandAll,E=a.className,F=a.onRowHover,G=a.onRowClick,H=a.onRowCreate,I=a.onCellClick,J=a.getAdditionalClassName,K=a.rowCreateText,L=void 0===K?"+ \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443":K,M=a.lazyLoad,N=a.onSortBy,O=a.onFiltersUpdated,P=a.getTagLabel,Q=a.getCellWrap,R=a.isExpandedRowsByDefault,S=void 0!==R&&R,T=_objectWithoutProperties(a,_excluded),U=useHeaderData(g),V=U.headers,W=U.flattenedHeaders,X=U.lowHeaders,Y=U.headerRowsRefs,Z=U.headerRowsHeights,$=U.resizerTopOffsets,_=(null===(c=V[0][p-1])||void 0===c?void 0:c.position.gridIndex)+((null===(d=V[0][p-1])||void 0===d?void 0:d.position.colSpan)||1),aa=function(){return X.map(function(a){return a.width})},ba=React.useState(aa()),ca=_slicedToArray(ba,2),da=ca[0],ea=ca[1],fa=React.useMemo(function(){return k&&k.filter(function(a){return a.id&&a.field})},[k]);React.useEffect(function(){ea(aa())},[X.length]);var ga=React.useState([]),ha=_slicedToArray(ga,2),ia=ha[0],ja=ha[1],ka=React.useState(null),la=_slicedToArray(ka,2),ma=la[0],na=la[1],oa=React.useState(null),pa=_slicedToArray(oa,2),qa=pa[0],ra=pa[1],sa=React.useState({top:0,left:0}),ta=_slicedToArray(sa,2),ua=ta[0],va=ta[1],wa=React.useRef(null),xa=React.useRef({}),ya=React.useRef({}),za=useSelectedFilters(fa,O),Aa=za.selectedFilters,Ba=za.updateSelectedFilters,Ca=za.removeOneSelectedFilter,Da=za.removeAllSelectedFilters,Ea=React.useState([]),Fa=_slicedToArray(Ea,2),Ga=Fa[0],Ha=Fa[1];React.useEffect(function(){var a=g.find(function(a){return isString(a.order)&&Object.prototype.hasOwnProperty.call(Order,a.order)});if(a){var b=createSortingState(getColumnSortByField(a),a.order,a.sortFn);na(b)}},[g]),useComponentSize(wa);var Ia=(null===(e=wa.current)||void 0===e?void 0:e.clientHeight)||0,Ja=(null===(f=wa.current)||void 0===f?void 0:f.clientWidth)||0,Ka=0<ua.left,La=0<ua.top,Ma=s&&s.onChange,Na=function(a,b){ea(updateAt(da,a,b))},Oa=useMemo(function(){var a=Object.values(xa.current).filter(isNotNil),b=a.map(function(a){return a.getBoundingClientRect().width}),c=getMergedArray(b,da);return c.reduce(function(c,a){return(null!==c&&void 0!==c?c:0)+(null!==a&&void 0!==a?a:0)})},[da,m]);React.useLayoutEffect(function(){var a=Object.values(xa.current).filter(isNotNil);if(0!==a.length){var b=a.map(function(a){return a.getBoundingClientRect().width});if(ja(b),a[0].getBoundingClientRect().left!==a[a.length-1].getBoundingClientRect().left){var h=getMergedArray(b,da);if((null!==Oa&&void 0!==Oa?Oa:Ja)<Ja){for(var c,d=!1,e=g.length-1;0<e;e--)if(c=g[e].width,!(c&&0<c))return h[e]=void 0,void(d=!0);if(!d&&Oa){var f;h[h.length-1]=(null!==(f=h[h.length-1])&&void 0!==f?f:0)+Ja-Oa}}return ea(h)}return 0<Ja&&!m?ea(aa()):void 0}},[Ja,Oa]);var Pa=function(a){return getColumnSortByField(a)===(null===ma||void 0===ma?void 0:ma.by)},Qa=function(a,b){return b>=p?void 0:getColumnLeftOffset({columnIndex:a,resizedColumnWidths:da,initialColumnWidths:ia})},Ra=function(a){var b=a.id,c=a.e;s&&s.onChange&&s.onChange({id:s.id===b?void 0:b,e:c})},Sa=function(a){return function(b){return F&&F({id:a,e:b})}},Ta=function(a,b){return function(c){return H&&H({e:c,id:b,index:a})}},Ua=function(a,b){var c=Math.min(r,ia[a]),d=da[a]||ia[a],e=Math.max(c,d+b);Na(a,e);var f=wa.current;a===da.length-1&&0<b&&f&&f.scrollBy(b,0)},Va=getColumnLeftOffset({columnIndex:p,resizedColumnWidths:da,initialColumnWidths:ia}),Wa=function(a){return a.map(function(a){var b,c=a.position.gridIndex,d=da[c],e=ia[c],f=d||e,g=getColumnLeftOffset({columnIndex:c,resizedColumnWidths:da,initialColumnWidths:ia}),h=p>a.position.topHeaderGridIndex,i=p>c||Va+ua.left<g+f,j=0<((null===(b=Aa[a.accessor])||void 0===b?void 0:b.selected)||[]).length;return _objectSpread(_objectSpread({},a),{},{filterable:!!(fa&&fieldFiltersPresent(fa,a.accessor)),isSortingActive:Pa(a),isFilterActive:j,isResized:!!f&&f!==e,isSticky:h,showResizer:i,columnWidth:f,columnLeftOffset:g})})},Xa=Wa(W),Ya=React.useMemo(function(){return h.some(function(a){var b;return!(!(null!==(b=a.rows)&&void 0!==b)||!b.length)})},[h]),Za=sortingData(h,ma,N),$a=fa&&isSelectedFiltersPresent(Aa)?filterTableData({data:Za,filters:fa||[],selectedFilters:Aa}):Za,_a=M||{},ab=_a.maxVisibleRows,bb=void 0===ab?210:ab,cb=_a.scrollableEl,db=void 0===cb?wa.current:cb,eb=useLazyLoadData(bb,db,!!M),fb=eb.getSlicedRows,gb=eb.setBoundaryRef,hb=transformRows($a,Ga,S),ib=fb(hb),jb={"--table-grid-template-columns":getColumnsSize(da),"--table-width":"".concat(Ja,"px")},kb=Wa(X).some(function(a){return a.mergeCells}),lb=function(a){return function(){return Ga.includes(a)?void Ha(function(b){return b.filter(function(b){return b!==a})}):void Ha(function(b){return[].concat(_toConsumableArray(b),[a])})}},mb=function(a,b){var c,d=!(!(null!==(c=a.rows)&&void 0!==c)||!c.length)&&0===b,e={level:a.options.level,isExpandedByDefault:S};if(!d||S)return e;var f=Ga.includes(a.id),g=lb(a.id);return _objectSpread(_objectSpread({},e),{},{withCollapseButton:d,isExpanded:f,toggleCollapse:g})},nb=function(a,b){var c=[];return a.forEach(function(a){var d,e;if((a.defaultExpand||0<(null!==(d=null===(e=a.rows)||void 0===e?void 0:e.length)&&void 0!==d?d:0)&&b)&&c.push(a.id),a.rows){var f=nb(a.rows,b);c=[].concat(_toConsumableArray(c),_toConsumableArray(f)),0<f.length&&-1===c.indexOf(a.id)&&c.push(a.id)}}),c};useEffect(function(){h&&Ha(nb(h,D))},[h,D]);var ob=function(a,b,c){var d=a.renderCell?a.renderCell(b):b[a.accessor];if(!Ya||0!==c)return d;var e=mb(b,c);return React.createElement(TableRowsCollapse,e,d)},pb=useMemo(function(){var a,b=ib.length,c=null!==(a=ib.slice(-1).pop())&&void 0!==a?a:{},d=c.id;return H?React.createElement("div",{className:cnTable(b?"CreatRowCell":"RowWithoutCells")},React.createElement(Button,{size:createButtonSizeMap[j],form:"brick",label:L,view:"clear",className:cnTable("CreateRowButton"),onClick:Ta(b,d),width:"full"})):null},[L,ib.length,H]),qb=function(a,b,c,d){var e,f=c.mergeCells,g=c.accessor,h=c.position,j=c.getComparisonValue,k=void 0===j?function(a){return a}:j,l=ib[b-1]&&k(ib[b-1][g]),m=k(a[g]),n={rowSpan:1,show:!1,style:{left:Qa(d,h.topHeaderGridIndex)}};if(f&&(ib[b-1]&&l!==m||0===b||l===m&&null!==(e=ib[b-1])&&void 0!==e&&e.rows)){if(!a.rows)for(var o,p=b;p<ib.length&&ib[p+1]&&(o=k(ib[p+1][g]),m===o&&!ib[p].rows);p++)n.rowSpan++;1<n.rowSpan&&(n.style["--row-span"]="span ".concat(n.rowSpan)),n.show=!0}return f||(n.show=!0),n},rb=function(a){null===I||void 0===I?void 0:I(a)};return React.createElement("div",Object.assign({},T,{ref:useForkRef([wa,b]),className:cnTable({size:j,isResizable:m,zebraStriped:x,withBorderBottom:!$a.length},[E]),style:jb,onScroll:function handleScroll(a){a.target instanceof HTMLElement&&a.target===wa.current&&va({top:a.target.scrollTop,left:a.target.scrollLeft})}}),Wa(X).map(function(a,b){return React.createElement(TableCell,{type:"resizer",key:b,ref:function(a){xa.current[b]=a},style:{left:Qa(b,b)},onContextMenu:function onContextMenu(a){return rb({e:a,type:"contextMenu",columnIdx:b,ref:{current:xa.current[b]}})},onClick:function onClick(a){return rb({e:a,type:"click",columnIdx:b,ref:{current:xa.current[b]}})},column:a,showVerticalShadow:Ka},m&&React.createElement(TableResizer,{height:Ia-$[b],top:$[b],isVisible:a.showResizer,onResize:function onResize(a){return Ua(b,a)},onDoubleClick:function onDoubleClick(){return Na(b,ia[b])}}))}),React.createElement(TableHeader,{isStickyHeader:void 0!==n&&n,headersWithMetaData:Xa,headerRowsHeights:Z,headerRowsRefs:Y,getStickyLeftOffset:Qa,stickyColumnsGrid:_,showVerticalCellShadow:Ka,headerVerticalAlign:w,getSortIcon:function getSortIcon(a){return Pa(a)&&("desc"===(null===ma||void 0===ma?void 0:ma.order)?IconSortDown:IconSortUp)||IconUnsort},handleSortClick:function handleSortClick(a){var b=getNewSorting(ma,getColumnSortByField(a),a.sortable&&(null===a||void 0===a?void 0:a.sortFn)||void 0),c=b?{sortingBy:b.by,sortOrder:b.order}:null;N&&N(c),na(b)},handleFilterTogglerClick:function handleFilterTogglerClick(a){return function(){ra(qa===a?null:a)}},handleCellClick:rb,handleTooltipSave:function handleTooltipSave(a,b,c){Ba(a,b,c)},filters:fa,visibleFilter:qa,selectedFilters:Aa,showHorizontalCellShadow:La,borderBetweenColumns:A}),fa&&isSelectedFiltersPresent(Aa)&&React.createElement("div",{className:cnTable("RowWithoutCells")},React.createElement(TableSelectedOptionsList,{values:getSelectedFiltersList({filters:fa,selectedFilters:Aa,columns:X}),getTagLabel:P,onRemove:function removeSelectedFilter(a){return function(b){Ca(a,b)}}(fa),onReset:function resetSelectedFilters(){fa&&fa.length&&Da(fa)}})),0<ib.length?ib.map(function(a,b){var c=0==(b+1)%2?"even":"odd",d=Wa(X),e=calulateColSpans(d,a);return React.createElement("div",{key:a.id,role:"presentation",className:cnTable("CellsRow",{nth:c,withMergedCells:kb}),onMouseEnter:Sa(a.id),onMouseLeave:Sa(void 0),onClick:function onClick(b){return G&&G({id:a.id,e:b})}},d.map(function(c,d){var f=qb(a,b,c,d),g=f.show,h=f.style,i=f.rowSpan,j=e[d],k=0<d?e.slice(0,d).reduce(function(c,a){return c+a})+1:1;if(g&&0<j){var l;return React.createElement(TableCell,{type:"content",key:c.accessor,ref:function(c){ya.current["".concat(d,"-").concat(a.id)]=c,setRef(gb(d,b),c)},style:_objectSpread(_objectSpread({},h),{},(l={},_defineProperty(l,"--table-cell-col-start",k),_defineProperty(l,"--table-cell-col-end",k+j),l)),wrapperClassName:cnTable("ContentCell",{isActive:!!s&&s.id===a.id,isDarkned:!!s&&s.id!==void 0&&s.id!==a.id,isMerged:c.mergeCells&&1<i}),className:null===J||void 0===J?void 0:J({column:c,row:a,isActive:!!s&&s.id===a.id}),wrap:null===Q||void 0===Q?void 0:Q(a),onContextMenu:function onContextMenu(b){return rb({e:b,type:"contextMenu",columnIdx:d,rowId:a.id,ref:{current:ya.current["".concat(d,"-").concat(a.id)]}})},onClick:function onClick(b){Ra({id:a.id,e:b}),rb({e:b,type:"click",columnIdx:d,rowId:a.id,ref:{current:ya.current["".concat(d,"-").concat(a.id)]}})},column:c,verticalAlign:u,isClickable:!!Ma,showVerticalShadow:Ka&&(null===c||void 0===c?void 0:c.position.gridIndex)+((null===c||void 0===c?void 0:c.position.colSpan)||1)===_,isBorderTop:0<b&&void 0!==y&&y,isBorderLeft:0<d&&A},ob(c,a,d))}return null}))}):React.createElement("div",{className:cnTable("RowWithoutCells")},React.createElement("div",{className:cnTable("EmptyCell")},function renderEmptyRowsPlaceholder(a){return"string"==typeof a?React.createElement(Text,{size:"s"},a):a}(C))),pb)};export var Table=React.forwardRef(InternalTable);
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _excluded=["columns","rows","size","filters","isResizable","stickyHeader","stickyColumns","minColumnWidth","activeRow","verticalAlign","headerVerticalAlign","zebraStriped","borderBetweenRows","borderBetweenColumns","emptyRowsPlaceholder","defaultExpandAll","className","onRowHover","onRowClick","onRowCreate","onCellClick","getAdditionalClassName","rowCreateText","lazyLoad","onSortBy","onFiltersUpdated","getTagLabel","getCellWrap","isExpandedRowsByDefault"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./Table.css";import{IconSortDown}from"@consta/icons/IconSortDown";import{IconSortUp}from"@consta/icons/IconSortUp";import{IconUnsort}from"@consta/icons/IconUnsort";import React,{useEffect,useMemo}from"react";import{useComponentSize}from"../../hooks/useComponentSize/useComponentSize";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{sortBy as sortByDefault,updateAt}from"../../utils/array";import{cn}from"../../utils/bem";import{setRef}from"../../utils/setRef";import{isNotNil,isString}from"../../utils/type-guards";import{Button}from"../Button/Button";import{Text}from"../Text/Text";import{TableCell}from"./Cell/TableCell";import{fieldFiltersPresent,filterTableData,getSelectedFiltersList,isSelectedFiltersPresent,useSelectedFilters}from"./filtering";import{TableHeader}from"./Header/TableHeader";import{calulateColSpans,createSortingState,getColumnLeftOffset,getColumnsSize,getMergedArray,getNewSorting,Order,transformRows,useHeaderData,useLazyLoadData}from"./helpers";import{TableResizer}from"./Resizer/TableResizer";import{TableRowsCollapse}from"./RowsCollapse/TableRowsCollapse";import{TableSelectedOptionsList}from"./SelectedOptionsList/TableSelectedOptionsList";export{TableTextFilter}from"./TextFilter/TableTextFilter";export{TableFilterContainer}from"./FilterContainer/TableFilterContainer";export{TableNumberFilter}from"./NumberFilter/TableNumberFilter";export{TableChoiceGroupFilter}from"./ChoiceGroupFilter/TableChoiceGroupFilter";var cnTable=cn("Table");export var sizes=["s","m","l"];export var zebraStriped=["odd","even"];export var headerVerticalAligns=["center","bottom"];var createButtonSizeMap={s:"xs",m:"s",l:"m"},getColumnSortByField=function(a){return a.sortable&&a.sortByField||a.accessor},sortingData=function(a,b,c){if(c)return a;if(!b)return a;var d=sortByDefault(a,b.by,b.order,b.sortFn);return d.some(function(a){var b;return null===(b=a.rows)||void 0===b?void 0:b.length})?d.map(function(a){return a.rows?_objectSpread(_objectSpread({},a),{},{rows:sortingData(a.rows,b,c)}):a}):d},defaultEmptyRowsPlaceholder=React.createElement(Text,{as:"span",view:"primary",size:"s",lineHeight:"s"},"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"),InternalTable=function(a,b){var c,d,e,f,g=a.columns,h=a.rows,i=a.size,j=void 0===i?"l":i,k=a.filters,l=a.isResizable,m=void 0!==l&&l,n=a.stickyHeader,o=a.stickyColumns,p=void 0===o?0:o,q=a.minColumnWidth,r=void 0===q?150:q,s=a.activeRow,t=a.verticalAlign,u=void 0===t?"top":t,v=a.headerVerticalAlign,w=void 0===v?"center":v,x=a.zebraStriped,y=a.borderBetweenRows,z=a.borderBetweenColumns,A=void 0!==z&&z,B=a.emptyRowsPlaceholder,C=void 0===B?defaultEmptyRowsPlaceholder:B,D=a.defaultExpandAll,E=a.className,F=a.onRowHover,G=a.onRowClick,H=a.onRowCreate,I=a.onCellClick,J=a.getAdditionalClassName,K=a.rowCreateText,L=void 0===K?"+ \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443":K,M=a.lazyLoad,N=a.onSortBy,O=a.onFiltersUpdated,P=a.getTagLabel,Q=a.getCellWrap,R=a.isExpandedRowsByDefault,S=void 0!==R&&R,T=_objectWithoutProperties(a,_excluded),U=useHeaderData(g),V=U.headers,W=U.flattenedHeaders,X=U.lowHeaders,Y=U.headerRowsRefs,Z=U.headerRowsHeights,$=U.resizerTopOffsets,_=(null===(c=V[0][p-1])||void 0===c?void 0:c.position.gridIndex)+((null===(d=V[0][p-1])||void 0===d?void 0:d.position.colSpan)||1),aa=function(){return X.map(function(a){return a.width})},ba=React.useState(aa()),ca=_slicedToArray(ba,2),da=ca[0],ea=ca[1],fa=React.useMemo(function(){return k&&k.filter(function(a){return a.id&&a.field})},[k]);React.useEffect(function(){ea(aa())},[X.length]);var ga=React.useState([]),ha=_slicedToArray(ga,2),ia=ha[0],ja=ha[1],ka=React.useState(null),la=_slicedToArray(ka,2),ma=la[0],na=la[1],oa=React.useState(null),pa=_slicedToArray(oa,2),qa=pa[0],ra=pa[1],sa=React.useState({top:0,left:0}),ta=_slicedToArray(sa,2),ua=ta[0],va=ta[1],wa=React.useRef(null),xa=React.useRef({}),ya=React.useRef({}),za=useSelectedFilters(fa,O),Aa=za.selectedFilters,Ba=za.updateSelectedFilters,Ca=za.removeOneSelectedFilter,Da=za.removeAllSelectedFilters,Ea=React.useState([]),Fa=_slicedToArray(Ea,2),Ga=Fa[0],Ha=Fa[1];React.useEffect(function(){var a=g.find(function(a){return isString(a.order)&&Object.prototype.hasOwnProperty.call(Order,a.order)});if(a){var b=createSortingState(getColumnSortByField(a),a.order,a.sortFn);na(b)}},[g]),useComponentSize(wa);var Ia=(null===(e=wa.current)||void 0===e?void 0:e.clientHeight)||0,Ja=(null===(f=wa.current)||void 0===f?void 0:f.clientWidth)||0,Ka=0<ua.left,La=0<ua.top,Ma=s&&s.onChange,Na=function(a,b){ea(updateAt(da,a,b))},Oa=useMemo(function(){var a=Object.values(xa.current).filter(isNotNil),b=a.map(function(a){return a.getBoundingClientRect().width}),c=getMergedArray(b,da);return c.reduce(function(c,a){return(null!==c&&void 0!==c?c:0)+(null!==a&&void 0!==a?a:0)})},[da,m]);React.useLayoutEffect(function(){var a=Object.values(xa.current).filter(isNotNil);if(0!==a.length){var b=a.map(function(a){return a.getBoundingClientRect().width});if(ja(b),a[0].getBoundingClientRect().left!==a[a.length-1].getBoundingClientRect().left){var h=getMergedArray(b,da);if((null!==Oa&&void 0!==Oa?Oa:Ja)<Ja){for(var c,d=!1,e=g.length-1;0<e;e--)if(c=g[e].width,!(c&&0<c))return h[e]=void 0,void(d=!0);if(!d&&Oa){var f;h[h.length-1]=(null!==(f=h[h.length-1])&&void 0!==f?f:0)+Ja-Oa}}return ea(h)}return 0<Ja&&!m?ea(aa()):void 0}},[Ja,Oa]);var Pa=function(a){return getColumnSortByField(a)===(null===ma||void 0===ma?void 0:ma.by)},Qa=function(a,b){return b>=p?void 0:getColumnLeftOffset({columnIndex:a,resizedColumnWidths:da,initialColumnWidths:ia})},Ra=function(a){var b=a.id,c=a.e;s&&s.onChange&&s.onChange({id:s.id===b?void 0:b,e:c})},Sa=function(a){return function(b){return F&&F({id:a,e:b})}},Ta=function(a,b){return function(c){return H&&H({e:c,id:b,index:a})}},Ua=function(a,b){var c=Math.min(r,ia[a]),d=da[a]||ia[a],e=Math.max(c,d+b);Na(a,e);var f=wa.current;a===da.length-1&&0<b&&f&&f.scrollBy(b,0)},Va=getColumnLeftOffset({columnIndex:p,resizedColumnWidths:da,initialColumnWidths:ia}),Wa=function(a){return a.map(function(a){var b,c=a.position.gridIndex,d=da[c],e=ia[c],f=d||e,g=getColumnLeftOffset({columnIndex:c,resizedColumnWidths:da,initialColumnWidths:ia}),h=p>a.position.topHeaderGridIndex,i=p>c||Va+ua.left<g+f,j=0<((null===(b=Aa[a.accessor])||void 0===b?void 0:b.selected)||[]).length;return _objectSpread(_objectSpread({},a),{},{filterable:!!(fa&&fieldFiltersPresent(fa,a.accessor)),isSortingActive:Pa(a),isFilterActive:j,isResized:!!f&&f!==e,isSticky:h,showResizer:i,columnWidth:f,columnLeftOffset:g})})},Xa=Wa(W),Ya=React.useMemo(function(){return h.some(function(a){var b;return!(!(null!==(b=a.rows)&&void 0!==b)||!b.length)})},[h]),Za=sortingData(h,ma,N),$a=fa&&isSelectedFiltersPresent(Aa)?filterTableData({data:Za,filters:fa||[],selectedFilters:Aa}):Za,_a=M||{},ab=_a.maxVisibleRows,bb=void 0===ab?210:ab,cb=_a.scrollableEl,db=void 0===cb?wa.current:cb,eb=useLazyLoadData(bb,db,!!M),fb=eb.getSlicedRows,gb=eb.setBoundaryRef,hb=transformRows($a,Ga,S),ib=fb(hb),jb={"--table-grid-template-columns":getColumnsSize(da),"--table-width":"".concat(Ja,"px")},kb=Wa(X).some(function(a){return a.mergeCells}),lb=function(a){return function(){return Ga.includes(a)?void Ha(function(b){return b.filter(function(b){return b!==a})}):void Ha(function(b){return[].concat(_toConsumableArray(b),[a])})}},mb=function(a,b){var c,d=!(!(null!==(c=a.rows)&&void 0!==c)||!c.length)&&0===b,e={level:a.options.level,isExpandedByDefault:S};if(!d||S)return e;var f=Ga.includes(a.id),g=lb(a.id);return _objectSpread(_objectSpread({},e),{},{withCollapseButton:d,isExpanded:f,toggleCollapse:g})},nb=function(a,b,c){var d=[];return a.forEach(function(a){var e,f;if((a.defaultExpand||0<(null!==(e=null===(f=a.rows)||void 0===f?void 0:f.length)&&void 0!==e?e:0)&&c)&&d.push(a.id),a.rows){var g=nb(a.rows,b+1,c);d=[].concat(_toConsumableArray(d),_toConsumableArray(g)),0<g.length&&-1===d.indexOf(a.id)&&d.push(a.id)}}),[].concat(_toConsumableArray(0===b?Ga:[]),_toConsumableArray(d.filter(function(a){return-1===Ga.indexOf(a)})))};useEffect(function(){h&&Ha(nb(h,0,D))},[h,D]);var ob=function(a,b,c){var d=a.renderCell?a.renderCell(b):b[a.accessor];if(!Ya||0!==c)return d;var e=mb(b,c);return React.createElement(TableRowsCollapse,e,d)},pb=useMemo(function(){var a,b=ib.length,c=null!==(a=ib.slice(-1).pop())&&void 0!==a?a:{},d=c.id;return H?React.createElement("div",{className:cnTable(b?"CreatRowCell":"RowWithoutCells")},React.createElement(Button,{size:createButtonSizeMap[j],form:"brick",label:L,view:"clear",className:cnTable("CreateRowButton"),onClick:Ta(b,d),width:"full"})):null},[L,ib.length,H]),qb=function(a,b,c,d){var e,f=c.mergeCells,g=c.accessor,h=c.position,j=c.getComparisonValue,k=void 0===j?function(a){return a}:j,l=ib[b-1]&&k(ib[b-1][g]),m=k(a[g]),n={rowSpan:1,show:!1,style:{left:Qa(d,h.topHeaderGridIndex)}};if(f&&(ib[b-1]&&l!==m||0===b||l===m&&null!==(e=ib[b-1])&&void 0!==e&&e.rows)){if(!a.rows)for(var o,p=b;p<ib.length&&ib[p+1]&&(o=k(ib[p+1][g]),m===o&&!ib[p].rows);p++)n.rowSpan++;1<n.rowSpan&&(n.style["--row-span"]="span ".concat(n.rowSpan)),n.show=!0}return f||(n.show=!0),n},rb=function(a){null===I||void 0===I?void 0:I(a)};return React.createElement("div",Object.assign({},T,{ref:useForkRef([wa,b]),className:cnTable({size:j,isResizable:m,zebraStriped:x,withBorderBottom:!$a.length},[E]),style:jb,onScroll:function handleScroll(a){a.target instanceof HTMLElement&&a.target===wa.current&&va({top:a.target.scrollTop,left:a.target.scrollLeft})}}),Wa(X).map(function(a,b){return React.createElement(TableCell,{type:"resizer",key:b,ref:function(a){xa.current[b]=a},style:{left:Qa(b,b)},onContextMenu:function onContextMenu(a){return rb({e:a,type:"contextMenu",columnIdx:b,ref:{current:xa.current[b]}})},onClick:function onClick(a){return rb({e:a,type:"click",columnIdx:b,ref:{current:xa.current[b]}})},column:a,showVerticalShadow:Ka},m&&React.createElement(TableResizer,{height:Ia-$[b],top:$[b],isVisible:a.showResizer,onResize:function onResize(a){return Ua(b,a)},onDoubleClick:function onDoubleClick(){return Na(b,ia[b])}}))}),React.createElement(TableHeader,{isStickyHeader:void 0!==n&&n,headersWithMetaData:Xa,headerRowsHeights:Z,headerRowsRefs:Y,getStickyLeftOffset:Qa,stickyColumnsGrid:_,showVerticalCellShadow:Ka,headerVerticalAlign:w,getSortIcon:function getSortIcon(a){return Pa(a)&&("desc"===(null===ma||void 0===ma?void 0:ma.order)?IconSortDown:IconSortUp)||IconUnsort},handleSortClick:function handleSortClick(a){var b=getNewSorting(ma,getColumnSortByField(a),a.sortable&&(null===a||void 0===a?void 0:a.sortFn)||void 0),c=b?{sortingBy:b.by,sortOrder:b.order}:null;N&&N(c),na(b)},handleFilterTogglerClick:function handleFilterTogglerClick(a){return function(){ra(qa===a?null:a)}},handleCellClick:rb,handleTooltipSave:function handleTooltipSave(a,b,c){Ba(a,b,c)},filters:fa,visibleFilter:qa,selectedFilters:Aa,showHorizontalCellShadow:La,borderBetweenColumns:A}),fa&&isSelectedFiltersPresent(Aa)&&React.createElement("div",{className:cnTable("RowWithoutCells")},React.createElement(TableSelectedOptionsList,{values:getSelectedFiltersList({filters:fa,selectedFilters:Aa,columns:X}),getTagLabel:P,onRemove:function removeSelectedFilter(a){return function(b){Ca(a,b)}}(fa),onReset:function resetSelectedFilters(){fa&&fa.length&&Da(fa)}})),0<ib.length?ib.map(function(a,b){var c=0==(b+1)%2?"even":"odd",d=Wa(X),e=calulateColSpans(d,a);return React.createElement("div",{key:a.id,role:"presentation",className:cnTable("CellsRow",{nth:c,withMergedCells:kb}),onMouseEnter:Sa(a.id),onMouseLeave:Sa(void 0),onClick:function onClick(b){return G&&G({id:a.id,e:b})}},d.map(function(c,d){var f=qb(a,b,c,d),g=f.show,h=f.style,i=f.rowSpan,j=e[d],k=0<d?e.slice(0,d).reduce(function(c,a){return c+a})+1:1;if(g&&0<j){var l;return React.createElement(TableCell,{type:"content",key:c.accessor,ref:function(c){ya.current["".concat(d,"-").concat(a.id)]=c,setRef(gb(d,b),c)},style:_objectSpread(_objectSpread({},h),{},(l={},_defineProperty(l,"--table-cell-col-start",k),_defineProperty(l,"--table-cell-col-end",k+j),l)),wrapperClassName:cnTable("ContentCell",{isActive:!!s&&s.id===a.id,isDarkned:!!s&&s.id!==void 0&&s.id!==a.id,isMerged:c.mergeCells&&1<i}),className:null===J||void 0===J?void 0:J({column:c,row:a,isActive:!!s&&s.id===a.id}),wrap:null===Q||void 0===Q?void 0:Q(a),onContextMenu:function onContextMenu(b){return rb({e:b,type:"contextMenu",columnIdx:d,rowId:a.id,ref:{current:ya.current["".concat(d,"-").concat(a.id)]}})},onClick:function onClick(b){Ra({id:a.id,e:b}),rb({e:b,type:"click",columnIdx:d,rowId:a.id,ref:{current:ya.current["".concat(d,"-").concat(a.id)]}})},column:c,verticalAlign:u,isClickable:!!Ma,showVerticalShadow:Ka&&(null===c||void 0===c?void 0:c.position.gridIndex)+((null===c||void 0===c?void 0:c.position.colSpan)||1)===_,isBorderTop:0<b&&void 0!==y&&y,isBorderLeft:0<d&&A},ob(c,a,d))}return null}))}):React.createElement("div",{className:cnTable("RowWithoutCells")},React.createElement("div",{className:cnTable("EmptyCell")},function renderEmptyRowsPlaceholder(a){return"string"==typeof a?React.createElement(Text,{size:"s"},a):a}(C))),pb)};export var Table=React.forwardRef(InternalTable);
2
2
  //# sourceMappingURL=Table.js.map