@consta/uikit 3.17.0 → 3.17.3

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 (350) hide show
  1. package/Attach/package.json +1 -1
  2. package/Attachment/package.json +1 -1
  3. package/Avatar/package.json +1 -1
  4. package/Badge/package.json +1 -1
  5. package/BasicSelectDeprecated/package.json +1 -1
  6. package/Breadcrumbs/package.json +1 -1
  7. package/BreadcrumbsCanary/package.json +1 -1
  8. package/Button/package.json +1 -1
  9. package/CHANGELOG.md +23 -45
  10. package/Calendar/package.json +1 -1
  11. package/Card/package.json +1 -1
  12. package/Checkbox/package.json +1 -1
  13. package/CheckboxGroup/package.json +1 -1
  14. package/ChoiceGroup/package.json +1 -1
  15. package/Collapse/package.json +1 -1
  16. package/CollapseGroup/package.json +1 -1
  17. package/Combobox/package.json +1 -1
  18. package/ComboboxDeprecated/package.json +1 -1
  19. package/ContextMenu/package.json +1 -1
  20. package/DatePickerCanary/package.json +1 -1
  21. package/DateTimeCanary/package.json +1 -1
  22. package/DragNDropField/package.json +1 -1
  23. package/EventInterceptor/package.json +1 -1
  24. package/FieldCaption/package.json +1 -1
  25. package/FieldLabel/package.json +1 -1
  26. package/File/package.json +1 -1
  27. package/FileField/package.json +1 -1
  28. package/FileIcon/package.json +1 -1
  29. package/FileIconAvi/package.json +1 -1
  30. package/FileIconBmp/package.json +1 -1
  31. package/FileIconCsv/package.json +1 -1
  32. package/FileIconDoc/package.json +1 -1
  33. package/FileIconExe/package.json +1 -1
  34. package/FileIconGif/package.json +1 -1
  35. package/FileIconJpg/package.json +1 -1
  36. package/FileIconJson/package.json +1 -1
  37. package/FileIconLoading/package.json +1 -1
  38. package/FileIconMov/package.json +1 -1
  39. package/FileIconMp3/package.json +1 -1
  40. package/FileIconMp4/package.json +1 -1
  41. package/FileIconPdf/package.json +1 -1
  42. package/FileIconPng/package.json +1 -1
  43. package/FileIconPtt/package.json +1 -1
  44. package/FileIconRar/package.json +1 -1
  45. package/FileIconRtf/package.json +1 -1
  46. package/FileIconTiff/package.json +1 -1
  47. package/FileIconTxt/package.json +1 -1
  48. package/FileIconUndefined/package.json +1 -1
  49. package/FileIconWav/package.json +1 -1
  50. package/FileIconXls/package.json +1 -1
  51. package/FileIconZip/package.json +1 -1
  52. package/Grid/package.json +1 -1
  53. package/Header/package.json +1 -1
  54. package/Icon/package.json +1 -1
  55. package/IconAdd/package.json +1 -1
  56. package/IconAddToComparison/package.json +1 -1
  57. package/IconAlert/package.json +1 -1
  58. package/IconAlignBlocksLeft/package.json +1 -1
  59. package/IconAlignBlocksRight/package.json +1 -1
  60. package/IconAlignCenter/package.json +1 -1
  61. package/IconAlignJustify/package.json +1 -1
  62. package/IconAlignLeft/package.json +1 -1
  63. package/IconAlignRight/package.json +1 -1
  64. package/IconAllDone/package.json +1 -1
  65. package/IconArrowDown/package.json +1 -1
  66. package/IconArrowLeft/package.json +1 -1
  67. package/IconArrowRight/package.json +1 -1
  68. package/IconArrowUp/package.json +1 -1
  69. package/IconArtBrush/package.json +1 -1
  70. package/IconAttach/package.json +1 -1
  71. package/IconBackward/package.json +1 -1
  72. package/IconBag/package.json +1 -1
  73. package/IconBarrier/package.json +1 -1
  74. package/IconBento/package.json +1 -1
  75. package/IconBold/package.json +1 -1
  76. package/IconBook/package.json +1 -1
  77. package/IconBookmarkFilled/package.json +1 -1
  78. package/IconBookmarkStroked/package.json +1 -1
  79. package/IconCalculator/package.json +1 -1
  80. package/IconCalendar/package.json +1 -1
  81. package/IconCamera/package.json +1 -1
  82. package/IconCancel/package.json +1 -1
  83. package/IconCards/package.json +1 -1
  84. package/IconChat/package.json +1 -1
  85. package/IconCheck/package.json +1 -1
  86. package/IconClose/package.json +1 -1
  87. package/IconCollapse/package.json +1 -1
  88. package/IconColorFill/package.json +1 -1
  89. package/IconColorText/package.json +1 -1
  90. package/IconColumns/package.json +1 -1
  91. package/IconComment/package.json +1 -1
  92. package/IconConnection/package.json +1 -1
  93. package/IconCopy/package.json +1 -1
  94. package/IconCrown/package.json +1 -1
  95. package/IconCursorMouse/package.json +1 -1
  96. package/IconDataNull/package.json +1 -1
  97. package/IconDiamond/package.json +1 -1
  98. package/IconDinosaur/package.json +1 -1
  99. package/IconDisconnection/package.json +1 -1
  100. package/IconDocAdd/package.json +1 -1
  101. package/IconDocBlank/package.json +1 -1
  102. package/IconDocDelete/package.json +1 -1
  103. package/IconDocExport/package.json +1 -1
  104. package/IconDocFilled/package.json +1 -1
  105. package/IconDown/package.json +1 -1
  106. package/IconDownload/package.json +1 -1
  107. package/IconDrag/package.json +1 -1
  108. package/IconDraggable/package.json +1 -1
  109. package/IconDrillingRig/package.json +1 -1
  110. package/IconDrop/package.json +1 -1
  111. package/IconEdit/package.json +1 -1
  112. package/IconExit/package.json +1 -1
  113. package/IconExpand/package.json +1 -1
  114. package/IconEye/package.json +1 -1
  115. package/IconEyeClose/package.json +1 -1
  116. package/IconFavorite/package.json +1 -1
  117. package/IconFilter/package.json +1 -1
  118. package/IconFitToDefault/package.json +1 -1
  119. package/IconFlagFilled/package.json +1 -1
  120. package/IconFlagStroked/package.json +1 -1
  121. package/IconFolders/package.json +1 -1
  122. package/IconForward/package.json +1 -1
  123. package/IconFunnel/package.json +1 -1
  124. package/IconGas/package.json +1 -1
  125. package/IconGeo/package.json +1 -1
  126. package/IconGrouping/package.json +1 -1
  127. package/IconHamburger/package.json +1 -1
  128. package/IconHand/package.json +1 -1
  129. package/IconHealth/package.json +1 -1
  130. package/IconHome/package.json +1 -1
  131. package/IconInComparison/package.json +1 -1
  132. package/IconInfo/package.json +1 -1
  133. package/IconIntroduction/package.json +1 -1
  134. package/IconIpad/package.json +1 -1
  135. package/IconItalic/package.json +1 -1
  136. package/IconKebab/package.json +1 -1
  137. package/IconLaptop/package.json +1 -1
  138. package/IconLayers/package.json +1 -1
  139. package/IconLeaf/package.json +1 -1
  140. package/IconLightningBolt/package.json +1 -1
  141. package/IconLineAndBarChart/package.json +1 -1
  142. package/IconLink/package.json +1 -1
  143. package/IconList/package.json +1 -1
  144. package/IconListNumbered/package.json +1 -1
  145. package/IconLock/package.json +1 -1
  146. package/IconLogicalElement/package.json +1 -1
  147. package/IconMBU/package.json +1 -1
  148. package/IconMGRP/package.json +1 -1
  149. package/IconMLSP/package.json +1 -1
  150. package/IconMMP/package.json +1 -1
  151. package/IconMail/package.json +1 -1
  152. package/IconMap/package.json +1 -1
  153. package/IconMaxHeight/package.json +1 -1
  154. package/IconMaxWidth/package.json +1 -1
  155. package/IconMeatball/package.json +1 -1
  156. package/IconMic/package.json +1 -1
  157. package/IconMolecules/package.json +1 -1
  158. package/IconMoon/package.json +1 -1
  159. package/IconNodeEnd/package.json +1 -1
  160. package/IconNodeStart/package.json +1 -1
  161. package/IconNodeStep/package.json +1 -1
  162. package/IconNodes/package.json +1 -1
  163. package/IconOpenInNew/package.json +1 -1
  164. package/IconOperators/package.json +1 -1
  165. package/IconPanelBottom/package.json +1 -1
  166. package/IconPanelLeft/package.json +1 -1
  167. package/IconPanelRight/package.json +1 -1
  168. package/IconPanelTop/package.json +1 -1
  169. package/IconPaste/package.json +1 -1
  170. package/IconPause/package.json +1 -1
  171. package/IconPhone/package.json +1 -1
  172. package/IconPhoto/package.json +1 -1
  173. package/IconPicture/package.json +1 -1
  174. package/IconPlay/package.json +1 -1
  175. package/IconPressure/package.json +1 -1
  176. package/IconPriceLabel/package.json +1 -1
  177. package/IconProcessing/package.json +1 -1
  178. package/IconQuestion/package.json +1 -1
  179. package/IconQuote/package.json +1 -1
  180. package/IconRUO/package.json +1 -1
  181. package/IconRUS/package.json +1 -1
  182. package/IconRecord/package.json +1 -1
  183. package/IconRemove/package.json +1 -1
  184. package/IconRemoveFromComparison/package.json +1 -1
  185. package/IconReply/package.json +1 -1
  186. package/IconResize/package.json +1 -1
  187. package/IconRestart/package.json +1 -1
  188. package/IconRevert/package.json +1 -1
  189. package/IconRing/package.json +1 -1
  190. package/IconRouble/package.json +1 -1
  191. package/IconRuler/package.json +1 -1
  192. package/IconSave/package.json +1 -1
  193. package/IconScreen/package.json +1 -1
  194. package/IconSearch/package.json +1 -1
  195. package/IconSelect/package.json +1 -1
  196. package/IconSelectOpen/package.json +1 -1
  197. package/IconSendMessage/package.json +1 -1
  198. package/IconSettings/package.json +1 -1
  199. package/IconShape/package.json +1 -1
  200. package/IconShuffle/package.json +1 -1
  201. package/IconSmile/package.json +1 -1
  202. package/IconSortDown/package.json +1 -1
  203. package/IconSortDownCenter/package.json +1 -1
  204. package/IconSortUp/package.json +1 -1
  205. package/IconSortUpCenter/package.json +1 -1
  206. package/IconStop/package.json +1 -1
  207. package/IconStorage/package.json +1 -1
  208. package/IconStrikethrough/package.json +1 -1
  209. package/IconSun/package.json +1 -1
  210. package/IconTable/package.json +1 -1
  211. package/IconTable2/package.json +1 -1
  212. package/IconTarget/package.json +1 -1
  213. package/IconTeam/package.json +1 -1
  214. package/IconTechResponse/package.json +1 -1
  215. package/IconTest/package.json +1 -1
  216. package/IconThumbUp/package.json +1 -1
  217. package/IconTie/package.json +1 -1
  218. package/IconTop/package.json +1 -1
  219. package/IconTrash/package.json +1 -1
  220. package/IconType/package.json +1 -1
  221. package/IconUnderline/package.json +1 -1
  222. package/IconUnlock/package.json +1 -1
  223. package/IconUnsort/package.json +1 -1
  224. package/IconUnsortCenter/package.json +1 -1
  225. package/IconUpload/package.json +1 -1
  226. package/IconUser/package.json +1 -1
  227. package/IconVZD/package.json +1 -1
  228. package/IconVideo/package.json +1 -1
  229. package/IconWarning/package.json +1 -1
  230. package/IconWatch/package.json +1 -1
  231. package/IconWideScreen/package.json +1 -1
  232. package/IconWorld/package.json +1 -1
  233. package/IconWrench/package.json +1 -1
  234. package/Informer/package.json +1 -1
  235. package/LayoutCanary/package.json +1 -1
  236. package/Loader/package.json +1 -1
  237. package/MixCard/package.json +1 -1
  238. package/MixFocus/package.json +1 -1
  239. package/MixPopoverAnimate/package.json +1 -1
  240. package/MixSpace/package.json +1 -1
  241. package/MixVisuallyHidden/package.json +1 -1
  242. package/Modal/package.json +1 -1
  243. package/MultiComboboxDeprecated/package.json +1 -1
  244. package/Pagination/package.json +1 -1
  245. package/Popover/package.json +1 -1
  246. package/PortalWithTheme/package.json +1 -1
  247. package/ProgressSpin/package.json +1 -1
  248. package/ProgressStepBarCanary/package.json +1 -1
  249. package/Radio/package.json +1 -1
  250. package/RadioGroup/package.json +1 -1
  251. package/Responses/package.json +1 -1
  252. package/Responses403/package.json +1 -1
  253. package/Responses404/package.json +1 -1
  254. package/Responses500/package.json +1 -1
  255. package/Responses503/package.json +1 -1
  256. package/ResponsesConnectionError/package.json +1 -1
  257. package/ResponsesDeleted/package.json +1 -1
  258. package/ResponsesEmptyBox/package.json +1 -1
  259. package/ResponsesEmptyPockets/package.json +1 -1
  260. package/ResponsesExit/package.json +1 -1
  261. package/ResponsesImage/package.json +1 -1
  262. package/ResponsesImage403/package.json +1 -1
  263. package/ResponsesImage404/package.json +1 -1
  264. package/ResponsesImage500/package.json +1 -1
  265. package/ResponsesImage503/package.json +1 -1
  266. package/ResponsesImageConnectionError/package.json +1 -1
  267. package/ResponsesImageDeleted/package.json +1 -1
  268. package/ResponsesImageEmptyBox/package.json +1 -1
  269. package/ResponsesImageEmptyPockets/package.json +1 -1
  270. package/ResponsesImageNothingFound/package.json +1 -1
  271. package/ResponsesImageSuccess/package.json +1 -1
  272. package/ResponsesNothingFound/package.json +1 -1
  273. package/ResponsesSuccess/package.json +1 -1
  274. package/Select/package.json +1 -1
  275. package/Sidebar/package.json +1 -1
  276. package/Skeleton/package.json +1 -1
  277. package/SliderCanary/package.json +1 -1
  278. package/SnackBar/package.json +1 -1
  279. package/Steps/package.json +1 -1
  280. package/Switch/package.json +1 -1
  281. package/SwitchGroup/package.json +1 -1
  282. package/Table/package.json +1 -1
  283. package/Tabs/package.json +1 -1
  284. package/Tag/package.json +1 -1
  285. package/TagBase/package.json +1 -1
  286. package/Text/package.json +1 -1
  287. package/TextField/package.json +1 -1
  288. package/Theme/package.json +1 -1
  289. package/ThemeToggler/package.json +1 -1
  290. package/Timer/package.json +1 -1
  291. package/Tooltip/package.json +1 -1
  292. package/User/package.json +1 -1
  293. package/UserSelect/package.json +1 -1
  294. package/UserSelectDeprecated/package.json +1 -1
  295. package/__internal__/cjs-src/components/ContextMenu/helpers.d.ts +3 -3
  296. package/__internal__/cjs-src/components/Popover/Popover.css +8 -0
  297. package/__internal__/cjs-src/components/Popover/Popover.d.ts +6 -3
  298. package/__internal__/cjs-src/components/Popover/Popover.js +31 -9
  299. package/__internal__/cjs-src/components/Popover/helpers.d.ts +2 -1
  300. package/__internal__/cjs-src/components/Popover/helpers.js +7 -3
  301. package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.css +0 -1
  302. package/__internal__/cjs-src/components/Sidebar/Sidebar.css +5 -0
  303. package/__internal__/cjs-src/components/Sidebar/Sidebar.js +1 -1
  304. package/__internal__/cjs-src/components/Table/Table.css +1 -0
  305. package/__internal__/cjs-src/components/Table/Table.d.ts +1 -1
  306. package/__internal__/cjs-src/components/Table/Table.js +17 -5
  307. package/__internal__/cjs-src/components/Table/helpers.d.ts +1 -0
  308. package/__internal__/cjs-src/components/Table/helpers.js +12 -4
  309. package/__internal__/cjs-src/components/Tooltip/Tooltip.css +0 -1
  310. package/__internal__/src/components/ContextMenu/helpers.d.ts +3 -3
  311. package/__internal__/src/components/Popover/Popover.css +8 -0
  312. package/__internal__/src/components/Popover/Popover.d.ts +6 -3
  313. package/__internal__/src/components/Popover/Popover.js +30 -8
  314. package/__internal__/src/components/Popover/helpers.d.ts +2 -1
  315. package/__internal__/src/components/Popover/helpers.js +6 -2
  316. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.css +0 -1
  317. package/__internal__/src/components/Sidebar/Sidebar.css +5 -0
  318. package/__internal__/src/components/Sidebar/Sidebar.js +1 -1
  319. package/__internal__/src/components/Table/Table.css +1 -0
  320. package/__internal__/src/components/Table/Table.d.ts +1 -1
  321. package/__internal__/src/components/Table/Table.js +18 -6
  322. package/__internal__/src/components/Table/helpers.d.ts +1 -0
  323. package/__internal__/src/components/Table/helpers.js +10 -3
  324. package/__internal__/src/components/Tooltip/Tooltip.css +0 -1
  325. package/createIcon/package.json +1 -1
  326. package/createResponsesImage/package.json +1 -1
  327. package/package.json +1 -1
  328. package/useBreakpoints/package.json +1 -1
  329. package/useChoiceGroup/package.json +1 -1
  330. package/useChoiceGroupIndexed/package.json +1 -1
  331. package/useClickOutside/package.json +1 -1
  332. package/useComponentSize/package.json +1 -1
  333. package/useDebounce/package.json +1 -1
  334. package/useFlag/package.json +1 -1
  335. package/useForkRef/package.json +1 -1
  336. package/useGlobalKeys/package.json +1 -1
  337. package/useHideElementsInLine/package.json +1 -1
  338. package/useKeys/package.json +1 -1
  339. package/useMutableRef/package.json +1 -1
  340. package/useOverflow/package.json +1 -1
  341. package/usePrevious/package.json +1 -1
  342. package/useRefs/package.json +1 -1
  343. package/useResizeObserved/package.json +1 -1
  344. package/useScrollElements/package.json +1 -1
  345. package/useScrollPosition/package.json +1 -1
  346. package/useSelect/package.json +1 -1
  347. package/useSortSteps/package.json +1 -1
  348. package/useThemeVars/package.json +1 -1
  349. package/useTimer/package.json +1 -1
  350. package/withTooltip/package.json +1 -1
@@ -103,6 +103,12 @@ var InternalTable = function (props, ref) {
103
103
  var updateColumnWidth = function (idx, newWidth) {
104
104
  setResizedColumnWidths(array_1.updateAt(resizedColumnWidths, idx, newWidth));
105
105
  };
106
+ var overallColumnsWidth = react_1.useMemo(function () {
107
+ var columnsElements = Object.values(columnsRefs.current).filter(type_guards_1.isNotNil);
108
+ var columnsElementsWidths = columnsElements.map(function (el) { return el.getBoundingClientRect().width; });
109
+ var resultArr = helpers_1.getMergedArray(columnsElementsWidths, resizedColumnWidths);
110
+ return resultArr.reduce(function (a, b) { return (a !== null && a !== void 0 ? a : 0) + (b !== null && b !== void 0 ? b : 0); });
111
+ }, [resizedColumnWidths, isResizable]);
106
112
  react_1["default"].useLayoutEffect(function () {
107
113
  var columnsElements = Object.values(columnsRefs.current).filter(type_guards_1.isNotNil);
108
114
  if (columnsElements.length === 0)
@@ -111,15 +117,21 @@ var InternalTable = function (props, ref) {
111
117
  setInitialColumnWidths(columnsElementsWidths);
112
118
  // Проверяем, что таблица отрисовалась корректно, и устанавливаем значения ширин колонок после 1го и последующих рендера
113
119
  if (columnsElements[0].getBoundingClientRect().left !==
114
- columnsElements[columnsElements.length - 1].getBoundingClientRect().left &&
115
- !resizedColumnWidths.some(type_guards_1.isNotNil)) {
116
- return setResizedColumnWidths(columnsElementsWidths);
120
+ columnsElements[columnsElements.length - 1].getBoundingClientRect().left) {
121
+ var resultArr = helpers_1.getMergedArray(columnsElementsWidths, resizedColumnWidths);
122
+ // Выставляю в undefined так как если вычеслять значение для последней колонки так,
123
+ // чтобы заполнялось все свободное пространство, при изменении ширины таблицы в меньшую сторону
124
+ // ширина последней колонки изменяться не будет, а так она будет css'ом проставляться в auto
125
+ if ((overallColumnsWidth !== null && overallColumnsWidth !== void 0 ? overallColumnsWidth : tableWidth) < tableWidth) {
126
+ resultArr[resultArr.length - 1] = undefined;
127
+ }
128
+ return setResizedColumnWidths(resultArr);
117
129
  }
118
130
  // условие изменения ширины колонок при изменении ширины экрана (контейнера таблицы)
119
131
  if (tableWidth > 0 && !isResizable) {
120
132
  return setResizedColumnWidths(getColumnsWidth());
121
133
  }
122
- }, [tableWidth]);
134
+ }, [tableWidth, overallColumnsWidth]);
123
135
  var isSortedByColumn = function (column) {
124
136
  return getColumnSortByField(column) === (sorting === null || sorting === void 0 ? void 0 : sorting.by);
125
137
  };
@@ -240,7 +252,7 @@ var InternalTable = function (props, ref) {
240
252
  var flatRowsData = helpers_1.transformRows(filteredData, expandedRowIds, isExpandedRowsByDefault);
241
253
  var rowsData = getSlicedRows(flatRowsData);
242
254
  var tableStyle = {
243
- 'gridTemplateColumns': helpers_1.getColumnsSize(resizedColumnWidths),
255
+ '--table-grid-template-columns': helpers_1.getColumnsSize(resizedColumnWidths),
244
256
  '--table-width': tableWidth + "px"
245
257
  };
246
258
  var hasMergedCells = columnsWithMetaData(lowHeaders).some(function (header) { return header.mergeCells; });
@@ -113,3 +113,4 @@ export declare const useLazyLoadData: (maxVisibleRows: number, scrollableEl: HTM
113
113
  setBoundaryRef: (columnIdx: number, rowIdx: number) => React.RefObject<HTMLDivElement> | undefined;
114
114
  };
115
115
  export declare const transformRows: <T extends TableRow>(rows: T[], expandedRowIds: string[], isTableExpanded?: boolean | undefined) => TableTreeRow<T>[];
116
+ export declare function getMergedArray<TYPE>(mainArr: TYPE[], mergeArr: TYPE[]): TYPE[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.transformRows = exports.useLazyLoadData = exports.useHeaderData = exports.transformColumns = exports.getMaxLevel = exports.getNewSorting = exports.createSortingState = exports.getColumnLeftOffset = exports.getColumnsSize = exports.Order = void 0;
3
+ exports.getMergedArray = exports.transformRows = exports.useLazyLoadData = exports.useHeaderData = exports.transformColumns = exports.getMaxLevel = exports.getNewSorting = exports.createSortingState = exports.getColumnLeftOffset = exports.getColumnsSize = exports.Order = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var react_1 = tslib_1.__importDefault(require("react"));
6
6
  var type_guards_1 = require("../../utils/type-guards");
@@ -11,9 +11,7 @@ exports.Order = {
11
11
  desc: 'desc'
12
12
  };
13
13
  exports.getColumnsSize = function (sizes) {
14
- return sizes
15
- .map(function (s) { return (type_guards_1.isNumber(s) ? s + "px" : "minmax(min-content, " + 100 / sizes.length + "%)"); })
16
- .join(' ');
14
+ return sizes.map(function (s) { return (type_guards_1.isNumber(s) ? s + "px" : "auto"); }).join(' ');
17
15
  };
18
16
  exports.getColumnLeftOffset = function (_a) {
19
17
  var columnIndex = _a.columnIndex, resizedColumnWidths = _a.resizedColumnWidths, initialColumnWidths = _a.initialColumnWidths;
@@ -260,3 +258,13 @@ exports.transformRows = function (rows, expandedRowIds, isTableExpanded) {
260
258
  }
261
259
  return rowsArr;
262
260
  };
261
+ function getMergedArray(mainArr, mergeArr) {
262
+ var _a;
263
+ var length = Math.max(mainArr.length, mergeArr.length);
264
+ var resultArr = [];
265
+ for (var i = 0; i < length; i++) {
266
+ resultArr.push((_a = mergeArr[i]) !== null && _a !== void 0 ? _a : mainArr[i]);
267
+ }
268
+ return resultArr;
269
+ }
270
+ exports.getMergedArray = getMergedArray;
@@ -5,7 +5,6 @@
5
5
  /* Задаются через js */
6
6
  --tooltip-arrow-size: 0;
7
7
  --tooltip-arrow-offset: 0;
8
- position: relative;
9
8
  }
10
9
 
11
10
  .Tooltip_status_alert {
@@ -2,7 +2,7 @@
2
2
  import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';
3
3
  import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
4
4
  import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
5
- import { Direction, Position } from '../Popover/Popover';
5
+ import { Direction, PopoverPropOffset, Position } from '../Popover/Popover';
6
6
  export declare const contextMenuSizes: readonly ["m", "s", "l"];
7
7
  export declare type ContextMenuPropSize = typeof contextMenuSizes[number];
8
8
  export declare const contextMenuDefaultSize: ContextMenuPropSize;
@@ -48,7 +48,7 @@ export declare type ContextMenuProps<ITEM> = PropsWithHTMLAttributesAndRef<{
48
48
  subMenuDirection?: ContextMenuPropSubMenuDirection;
49
49
  getKey?: ContextMenuPropGetKey<ITEM>;
50
50
  getDisabled?: ContextMenuPropGetDisable<ITEM>;
51
- offset?: number;
51
+ offset?: PopoverPropOffset;
52
52
  onItemClick?: (props: {
53
53
  e: React.MouseEvent;
54
54
  item: ITEM;
@@ -85,7 +85,7 @@ export declare type Level<ITEM> = {
85
85
  activeItem?: string;
86
86
  direction?: Direction;
87
87
  possibleDirections?: readonly Direction[];
88
- offset?: number;
88
+ offset?: PopoverPropOffset;
89
89
  } & PositioningProps;
90
90
  export declare type ContextMenuItemComponent = <AS extends keyof JSX.IntrinsicElements = 'div'>(props: ContextMenuItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
91
91
  export declare type ContextMenuComponent = <ITEM>(props: ContextMenuProps<ITEM>) => React.ReactElement | null;
@@ -0,0 +1,8 @@
1
+ .Popover {
2
+ position: absolute;
3
+ top: var(--popover-top);
4
+ left: var(--popover-left);
5
+ visibility: var(--popover-visibility);
6
+ width: var(--popover-width);
7
+ pointer-events: var(--popover-pointer-events);
8
+ }
@@ -1,3 +1,4 @@
1
+ import './Popover.css';
1
2
  import React from 'react';
2
3
  import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';
3
4
  import { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes';
@@ -9,6 +10,8 @@ export { usePopoverReposition };
9
10
  */
10
11
  export declare const directionsStartCenter: readonly ["downCenter", "upCenter", "downRight", "downLeft", "upRight", "upLeft", "leftUp", "leftCenter", "leftDown", "rightUp", "rightCenter", "rightDown"];
11
12
  export declare const directionsStartEdge: readonly ["downStartLeft", "upStartLeft", "downStartRight", "upStartRight", "leftStartUp", "leftStartDown", "rightStartUp", "rightStartDown"];
13
+ export declare const popoverPropOffset: readonly ["3xs", "2xs", "xs", "s", "m", "l", "xl", "2xl", "3xl", "4xl", "5xl", "6xl"];
14
+ export declare type PopoverPropOffset = typeof popoverPropOffset[number] | number;
12
15
  export declare const directions: ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[];
13
16
  export declare type Direction = typeof directions[number];
14
17
  export declare type Position = {
@@ -28,7 +31,7 @@ declare type ChildrenRenderProp = (direction: Direction) => React.ReactNode;
28
31
  export declare type Props = PropsWithJsxAttributes<{
29
32
  direction?: Direction;
30
33
  spareDirection?: Direction;
31
- offset?: number;
34
+ offset?: PopoverPropOffset;
32
35
  arrowOffset?: number;
33
36
  possibleDirections?: readonly Direction[];
34
37
  isInteractive?: boolean;
@@ -39,7 +42,7 @@ export declare type Props = PropsWithJsxAttributes<{
39
42
  export declare const Popover: React.ForwardRefExoticComponent<Pick<Pick<({
40
43
  direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
41
44
  spareDirection?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
42
- offset?: number | undefined;
45
+ offset?: number | "xs" | "s" | "m" | "l" | "2xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "3xs" | undefined;
43
46
  arrowOffset?: number | undefined;
44
47
  possibleDirections?: readonly ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[] | undefined;
45
48
  isInteractive?: boolean | undefined;
@@ -53,7 +56,7 @@ export declare const Popover: React.ForwardRefExoticComponent<Pick<Pick<({
53
56
  } & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "css" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key">) | ({
54
57
  direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
55
58
  spareDirection?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
56
- offset?: number | undefined;
59
+ offset?: number | "xs" | "s" | "m" | "l" | "2xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "3xs" | undefined;
57
60
  arrowOffset?: number | undefined;
58
61
  possibleDirections?: readonly ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[] | undefined;
59
62
  isInteractive?: boolean | undefined;
@@ -1,8 +1,11 @@
1
1
  import { __assign, __read, __rest, __spread } from "tslib";
2
+ import './Popover.css';
2
3
  import React, { useEffect } from 'react';
3
4
  import { useClickOutside } from '../../hooks/useClickOutside/useClickOutside';
4
5
  import { useComponentSize } from '../../hooks/useComponentSize/useComponentSize';
5
6
  import { useForkRef } from '../../hooks/useForkRef/useForkRef';
7
+ import { useThemeVars } from '../../hooks/useThemeVars/useThemeVars';
8
+ import { cn } from '../../utils/bem';
6
9
  import { PortalWithTheme, usePortalContext } from '../PortalWithTheme/PortalWithTheme';
7
10
  import { useTheme } from '../Theme/Theme';
8
11
  import { getComputedPositionAndDirection } from './helpers';
@@ -36,6 +39,20 @@ export var directionsStartEdge = [
36
39
  'rightStartUp',
37
40
  'rightStartDown',
38
41
  ];
42
+ export var popoverPropOffset = [
43
+ '3xs',
44
+ '2xs',
45
+ 'xs',
46
+ 's',
47
+ 'm',
48
+ 'l',
49
+ 'xl',
50
+ '2xl',
51
+ '3xl',
52
+ '4xl',
53
+ '5xl',
54
+ '6xl',
55
+ ];
39
56
  export var directions = __spread(directionsStartCenter, directionsStartEdge);
40
57
  var isRenderProp = function (children) { return typeof children === 'function'; };
41
58
  /**
@@ -53,20 +70,23 @@ var ContextConsumer = function (_a) {
53
70
  });
54
71
  return React.createElement(React.Fragment, null, children);
55
72
  };
73
+ var cnPopover = cn('Popover');
56
74
  export var Popover = React.forwardRef(function (props, componentRef) {
57
- var children = props.children, _a = props.direction, passedDirection = _a === void 0 ? 'upCenter' : _a, _b = props.offset, offset = _b === void 0 ? 0 : _b, arrowOffset = props.arrowOffset, _c = props.possibleDirections, possibleDirections = _c === void 0 ? directions : _c, _d = props.isInteractive, isInteractive = _d === void 0 ? true : _d, onClickOutside = props.onClickOutside, _e = props.spareDirection, spareDirection = _e === void 0 ? 'downStartLeft' : _e, style = props.style, passedPosition = props.position, anchorRef = props.anchorRef, equalAnchorWidth = props.equalAnchorWidth, onSetDirection = props.onSetDirection, otherProps = __rest(props, ["children", "direction", "offset", "arrowOffset", "possibleDirections", "isInteractive", "onClickOutside", "spareDirection", "style", "position", "anchorRef", "equalAnchorWidth", "onSetDirection"]);
75
+ var _a;
76
+ var children = props.children, _b = props.direction, passedDirection = _b === void 0 ? 'upCenter' : _b, _c = props.offset, offset = _c === void 0 ? 0 : _c, arrowOffset = props.arrowOffset, _d = props.possibleDirections, possibleDirections = _d === void 0 ? directions : _d, _e = props.isInteractive, isInteractive = _e === void 0 ? true : _e, onClickOutside = props.onClickOutside, _f = props.spareDirection, spareDirection = _f === void 0 ? 'downStartLeft' : _f, style = props.style, className = props.className, passedPosition = props.position, anchorRef = props.anchorRef, equalAnchorWidth = props.equalAnchorWidth, onSetDirection = props.onSetDirection, otherProps = __rest(props, ["children", "direction", "offset", "arrowOffset", "possibleDirections", "isInteractive", "onClickOutside", "spareDirection", "style", "className", "position", "anchorRef", "equalAnchorWidth", "onSetDirection"]);
58
77
  var ref = React.useRef(null);
59
78
  var theme = useTheme().theme;
60
- var _f = __read(React.useState(), 2), anchorClientRect = _f[0], setAnchorClientRect = _f[1];
61
- var _g = useComponentSize(ref), width = _g.width, height = _g.height;
79
+ var _g = __read(React.useState(), 2), anchorClientRect = _g[0], setAnchorClientRect = _g[1];
80
+ var _h = useComponentSize(ref), width = _h.width, height = _h.height;
62
81
  var anchorSize = useComponentSize(anchorRef || { current: null });
63
82
  var previousDirectionRef = React.useRef(null);
64
83
  var previousDirection = previousDirectionRef.current;
65
- var _h = __read(React.useState([]), 2), bannedDirections = _h[0], setBannedDirections = _h[1];
84
+ var _j = __read(React.useState([]), 2), bannedDirections = _j[0], setBannedDirections = _j[1];
66
85
  var resetBannedDirections = function () {
67
86
  setBannedDirections(function (state) { return (state.length ? [] : state); });
68
87
  previousDirectionRef.current = null;
69
88
  };
89
+ var vars = useThemeVars();
70
90
  var updateAnchorClientRect = function () { var _a; return setAnchorClientRect((_a = anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()); };
71
91
  React.useLayoutEffect(updateAnchorClientRect, [anchorSize]);
72
92
  usePopoverReposition({
@@ -77,14 +97,16 @@ export var Popover = React.forwardRef(function (props, componentRef) {
77
97
  updateAnchorClientRect();
78
98
  }
79
99
  });
80
- var _j = getComputedPositionAndDirection({
100
+ var _k = getComputedPositionAndDirection({
81
101
  contentSize: { width: width, height: height },
82
102
  viewportSize: {
83
103
  // Размер вьюпорта без скроллбаров
84
104
  width: document.documentElement.clientWidth,
85
105
  height: document.documentElement.clientHeight
86
106
  },
87
- offset: offset,
107
+ offset: typeof offset === 'string'
108
+ ? vars.space["--space-" + offset]
109
+ : offset,
88
110
  arrowOffset: arrowOffset,
89
111
  direction: passedDirection,
90
112
  possibleDirections: possibleDirections,
@@ -94,7 +116,7 @@ export var Popover = React.forwardRef(function (props, componentRef) {
94
116
  : passedPosition,
95
117
  anchorSize: anchorSize,
96
118
  spareDirection: spareDirection
97
- }), position = _j.position, direction = _j.direction;
119
+ }), position = _k.position, direction = _k.direction;
98
120
  useEffect(function () { return onSetDirection && onSetDirection(direction); }, [direction]);
99
121
  /**
100
122
  * Может возникнуть ситуация, когда перерасчет поповера всегда будет выдавать 2 направления
@@ -112,6 +134,6 @@ export var Popover = React.forwardRef(function (props, componentRef) {
112
134
  // Главное не сбрасывать при изменении размеров поповера, т.к. именно оно может вызвать бесконечный перебор
113
135
  React.useLayoutEffect(resetBannedDirections, [props]);
114
136
  var content = isRenderProp(children) ? children(direction) : children;
115
- return (React.createElement(PortalWithTheme, __assign({}, otherProps, { preset: theme, container: window.document.body, ref: useForkRef([ref, componentRef]), style: __assign(__assign(__assign({}, style), (equalAnchorWidth && { width: anchorSize.width })), { pointerEvents: isInteractive ? undefined : 'none', position: 'absolute', top: ((position === null || position === void 0 ? void 0 : position.y) || 0) + window.scrollY, left: ((position === null || position === void 0 ? void 0 : position.x) || 0) + window.scrollX, visibility: position ? undefined : 'hidden' }) }),
137
+ return (React.createElement(PortalWithTheme, __assign({}, otherProps, { preset: theme, className: cnPopover(null, [className]), container: window.document.body, ref: useForkRef([ref, componentRef]), style: __assign(__assign({}, style), (_a = {}, _a['--popover-top'] = ((position === null || position === void 0 ? void 0 : position.y) || 0) + window.scrollY + "px", _a['--popover-left'] = ((position === null || position === void 0 ? void 0 : position.x) || 0) + window.scrollX + "px", _a["--popover-width"] = equalAnchorWidth ? anchorSize.width + "px" : undefined, _a["--popover-pointer-events"] = isInteractive ? undefined : 'none', _a["--popover-visibility"] = position ? undefined : 'hidden', _a)) }),
116
138
  React.createElement(ContextConsumer, { onClickOutside: onClickOutside, ignoreClicksInsideRefs: [ref, anchorRef || { current: null }] }, content)));
117
139
  });
@@ -1,6 +1,7 @@
1
1
  import { Direction, Position } from './Popover';
2
2
  declare type Size = Pick<ClientRect, 'width' | 'height'>;
3
3
  declare type PositionsByDirection = Record<Direction, NonNullable<Position>>;
4
+ export declare const convertPixelsToNumber: (pixels: string) => number;
4
5
  export declare const getPositionsByDirection: ({ contentSize, anchorSize, position: { x, y }, offset, arrowOffset, }: {
5
6
  contentSize: Size;
6
7
  anchorSize: Size;
@@ -13,7 +14,7 @@ declare type ComputedPositionAndDirectionParams = {
13
14
  contentSize: Size;
14
15
  viewportSize: Size;
15
16
  anchorSize?: Size;
16
- offset: number;
17
+ offset?: number | string;
17
18
  arrowOffset?: number;
18
19
  direction: Direction;
19
20
  spareDirection: Direction;
@@ -3,6 +3,9 @@ var getPosition = function (x, y) { return ({
3
3
  x: Math.round(x),
4
4
  y: Math.round(y)
5
5
  }); };
6
+ export var convertPixelsToNumber = function (pixels) {
7
+ return Number(pixels.slice(0, pixels.length - 2));
8
+ };
6
9
  export var getPositionsByDirection = function (_a) {
7
10
  var contentSize = _a.contentSize, anchorSize = _a.anchorSize, _b = _a.position, x = _b.x, y = _b.y, offset = _a.offset, _c = _a.arrowOffset, arrowOffset = _c === void 0 ? 0 : _c;
8
11
  var contentWidth = contentSize.width, contentHeight = contentSize.height;
@@ -53,15 +56,16 @@ export var getPositionsByDirection = function (_a) {
53
56
  };
54
57
  };
55
58
  export var getComputedPositionAndDirection = function (_a) {
56
- var initialPosition = _a.position, contentSize = _a.contentSize, viewportSize = _a.viewportSize, _b = _a.anchorSize, anchorSize = _b === void 0 ? { width: 0, height: 0 } : _b, offset = _a.offset, arrowOffset = _a.arrowOffset, initialDirection = _a.direction, possibleDirections = _a.possibleDirections, bannedDirections = _a.bannedDirections, spareDirection = _a.spareDirection;
59
+ var initialPosition = _a.position, contentSize = _a.contentSize, viewportSize = _a.viewportSize, _b = _a.anchorSize, anchorSize = _b === void 0 ? { width: 0, height: 0 } : _b, _c = _a.offset, offset = _c === void 0 ? 0 : _c, arrowOffset = _a.arrowOffset, initialDirection = _a.direction, possibleDirections = _a.possibleDirections, bannedDirections = _a.bannedDirections, spareDirection = _a.spareDirection;
57
60
  if (!initialPosition) {
58
61
  return { position: initialPosition, direction: initialDirection };
59
62
  }
63
+ var currentOffset = typeof offset === 'string' ? convertPixelsToNumber(offset) : offset;
60
64
  var positionsByDirection = getPositionsByDirection({
61
65
  contentSize: contentSize,
62
66
  anchorSize: anchorSize,
63
67
  position: initialPosition,
64
- offset: offset,
68
+ offset: currentOffset,
65
69
  arrowOffset: arrowOffset
66
70
  });
67
71
  var direction = __spread([initialDirection], possibleDirections).filter(function (dir) { return !bannedDirections.includes(dir); })
@@ -4,7 +4,6 @@
4
4
  overflow: hidden;
5
5
  -webkit-box-sizing: border-box;
6
6
  box-sizing: border-box;
7
- width: 100%;
8
7
  min-width: 220px;
9
8
  margin: -1px 0 -1px;
10
9
  background: var(--color-bg-default);
@@ -19,6 +19,10 @@
19
19
  overflow: hidden;
20
20
  }
21
21
 
22
+ .Sidebar:not(.Sidebar_hasOverlay) {
23
+ pointer-events: none;
24
+ }
25
+
22
26
  .Sidebar_position_top {
23
27
  -webkit-box-orient: vertical;
24
28
  -webkit-box-direction: normal;
@@ -65,6 +69,7 @@
65
69
  background-color: var(--color-bg-default);
66
70
  -webkit-box-shadow: var(--shadow-modal);
67
71
  box-shadow: var(--shadow-modal);
72
+ pointer-events: auto;
68
73
  }
69
74
 
70
75
  .Sidebar-Window_position_right,
@@ -47,7 +47,7 @@ export var Sidebar = function (props) {
47
47
  useGlobalKeys({
48
48
  Escape: function (e) { return isOpen && onEsc && onEsc(e); }
49
49
  });
50
- return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position }), classNames: cnForCssTransition(cnSidebar), timeout: 200, nodeRef: portalRef },
50
+ return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, className: cnSidebar({ position: position, hasOverlay: hasOverlay }), classNames: cnForCssTransition(cnSidebar), timeout: 200, nodeRef: portalRef },
51
51
  React.createElement(PortalWithTheme, { preset: theme, ref: portalRef, container: container, className: rootClassName, style: typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' ? { zIndex: style.zIndex } : undefined },
52
52
  hasOverlay && React.createElement("div", { className: cnSidebar('Overlay'), "aria-label": "Overlay" }),
53
53
  React.createElement("div", __assign({}, otherProps, { style: __assign(__assign({}, style), (typeof (style === null || style === void 0 ? void 0 : style.zIndex) === 'number' && { zIndex: (style === null || style === void 0 ? void 0 : style.zIndex) + 1 })), className: cnSidebar('Window', { size: size, position: position }, [className]), ref: ref }),
@@ -14,6 +14,7 @@
14
14
  overflow: auto;
15
15
  max-width: 100%;
16
16
  max-height: 100%;
17
+ grid-template-columns: var(--table-grid-template-columns);
17
18
  }
18
19
 
19
20
  .Table_size_s {
@@ -93,13 +93,13 @@ export declare type TableColumn<T extends TableRow> = {
93
93
  export declare type TableProps<T extends TableRow> = {
94
94
  columns: TableColumn<T>[];
95
95
  rows: T[];
96
+ isResizable?: boolean;
96
97
  filters?: Filters<T>;
97
98
  onSortBy?: onSortBy<T>;
98
99
  size?: Size;
99
100
  stickyHeader?: boolean;
100
101
  stickyColumns?: number;
101
102
  minColumnWidth?: number;
102
- isResizable?: boolean;
103
103
  activeRow?: ActiveRow;
104
104
  verticalAlign?: VerticalAlign;
105
105
  headerVerticalAlign?: HeaderVerticalAlign;
@@ -17,7 +17,7 @@ import { TableResizer } from './Resizer/TableResizer';
17
17
  import { TableRowsCollapse, } from './RowsCollapse/TableRowsCollapse';
18
18
  import { TableSelectedOptionsList, } from './SelectedOptionsList/TableSelectedOptionsList';
19
19
  import { fieldFiltersPresent, filterTableData, getSelectedFiltersList, isSelectedFiltersPresent, useSelectedFilters, } from './filtering';
20
- import { createSortingState, getColumnLeftOffset, getColumnsSize, getNewSorting, Order, transformRows, useHeaderData, useLazyLoadData, } from './helpers';
20
+ import { createSortingState, getColumnLeftOffset, getColumnsSize, getMergedArray, getNewSorting, Order, transformRows, useHeaderData, useLazyLoadData, } from './helpers';
21
21
  export { TableTextFilter } from './TextFilter/TableTextFilter';
22
22
  export { TableFilterContainer } from './FilterContainer/TableFilterContainer';
23
23
  export { TableNumberFilter } from './NumberFilter/TableNumberFilter';
@@ -96,6 +96,12 @@ var InternalTable = function (props, ref) {
96
96
  var updateColumnWidth = function (idx, newWidth) {
97
97
  setResizedColumnWidths(updateAt(resizedColumnWidths, idx, newWidth));
98
98
  };
99
+ var overallColumnsWidth = useMemo(function () {
100
+ var columnsElements = Object.values(columnsRefs.current).filter(isNotNil);
101
+ var columnsElementsWidths = columnsElements.map(function (el) { return el.getBoundingClientRect().width; });
102
+ var resultArr = getMergedArray(columnsElementsWidths, resizedColumnWidths);
103
+ return resultArr.reduce(function (a, b) { return (a !== null && a !== void 0 ? a : 0) + (b !== null && b !== void 0 ? b : 0); });
104
+ }, [resizedColumnWidths, isResizable]);
99
105
  React.useLayoutEffect(function () {
100
106
  var columnsElements = Object.values(columnsRefs.current).filter(isNotNil);
101
107
  if (columnsElements.length === 0)
@@ -104,15 +110,21 @@ var InternalTable = function (props, ref) {
104
110
  setInitialColumnWidths(columnsElementsWidths);
105
111
  // Проверяем, что таблица отрисовалась корректно, и устанавливаем значения ширин колонок после 1го и последующих рендера
106
112
  if (columnsElements[0].getBoundingClientRect().left !==
107
- columnsElements[columnsElements.length - 1].getBoundingClientRect().left &&
108
- !resizedColumnWidths.some(isNotNil)) {
109
- return setResizedColumnWidths(columnsElementsWidths);
113
+ columnsElements[columnsElements.length - 1].getBoundingClientRect().left) {
114
+ var resultArr = getMergedArray(columnsElementsWidths, resizedColumnWidths);
115
+ // Выставляю в undefined так как если вычеслять значение для последней колонки так,
116
+ // чтобы заполнялось все свободное пространство, при изменении ширины таблицы в меньшую сторону
117
+ // ширина последней колонки изменяться не будет, а так она будет css'ом проставляться в auto
118
+ if ((overallColumnsWidth !== null && overallColumnsWidth !== void 0 ? overallColumnsWidth : tableWidth) < tableWidth) {
119
+ resultArr[resultArr.length - 1] = undefined;
120
+ }
121
+ return setResizedColumnWidths(resultArr);
110
122
  }
111
123
  // условие изменения ширины колонок при изменении ширины экрана (контейнера таблицы)
112
124
  if (tableWidth > 0 && !isResizable) {
113
125
  return setResizedColumnWidths(getColumnsWidth());
114
126
  }
115
- }, [tableWidth]);
127
+ }, [tableWidth, overallColumnsWidth]);
116
128
  var isSortedByColumn = function (column) {
117
129
  return getColumnSortByField(column) === (sorting === null || sorting === void 0 ? void 0 : sorting.by);
118
130
  };
@@ -233,7 +245,7 @@ var InternalTable = function (props, ref) {
233
245
  var flatRowsData = transformRows(filteredData, expandedRowIds, isExpandedRowsByDefault);
234
246
  var rowsData = getSlicedRows(flatRowsData);
235
247
  var tableStyle = {
236
- 'gridTemplateColumns': getColumnsSize(resizedColumnWidths),
248
+ '--table-grid-template-columns': getColumnsSize(resizedColumnWidths),
237
249
  '--table-width': tableWidth + "px"
238
250
  };
239
251
  var hasMergedCells = columnsWithMetaData(lowHeaders).some(function (header) { return header.mergeCells; });
@@ -113,3 +113,4 @@ export declare const useLazyLoadData: (maxVisibleRows: number, scrollableEl: HTM
113
113
  setBoundaryRef: (columnIdx: number, rowIdx: number) => React.RefObject<HTMLDivElement> | undefined;
114
114
  };
115
115
  export declare const transformRows: <T extends TableRow>(rows: T[], expandedRowIds: string[], isTableExpanded?: boolean | undefined) => TableTreeRow<T>[];
116
+ export declare function getMergedArray<TYPE>(mainArr: TYPE[], mergeArr: TYPE[]): TYPE[];
@@ -8,9 +8,7 @@ export var Order = {
8
8
  desc: 'desc'
9
9
  };
10
10
  export var getColumnsSize = function (sizes) {
11
- return sizes
12
- .map(function (s) { return (isNumber(s) ? s + "px" : "minmax(min-content, " + 100 / sizes.length + "%)"); })
13
- .join(' ');
11
+ return sizes.map(function (s) { return (isNumber(s) ? s + "px" : "auto"); }).join(' ');
14
12
  };
15
13
  export var getColumnLeftOffset = function (_a) {
16
14
  var columnIndex = _a.columnIndex, resizedColumnWidths = _a.resizedColumnWidths, initialColumnWidths = _a.initialColumnWidths;
@@ -257,3 +255,12 @@ export var transformRows = function (rows, expandedRowIds, isTableExpanded) {
257
255
  }
258
256
  return rowsArr;
259
257
  };
258
+ export function getMergedArray(mainArr, mergeArr) {
259
+ var _a;
260
+ var length = Math.max(mainArr.length, mergeArr.length);
261
+ var resultArr = [];
262
+ for (var i = 0; i < length; i++) {
263
+ resultArr.push((_a = mergeArr[i]) !== null && _a !== void 0 ? _a : mainArr[i]);
264
+ }
265
+ return resultArr;
266
+ }
@@ -5,7 +5,6 @@
5
5
  /* Задаются через js */
6
6
  --tooltip-arrow-size: 0;
7
7
  --tooltip-arrow-offset: 0;
8
- position: relative;
9
8
  }
10
9
 
11
10
  .Tooltip_status_alert {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/createIcon",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/createResponsesImage",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "keywords": [
5
5
  "ui-kit",
6
6
  "design-system",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useBreakpoints",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useChoiceGroup",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useChoiceGroupIndexed",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useClickOutside",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useComponentSize",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useDebounce",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useFlag",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useForkRef",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useGlobalKeys",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit/useHideElementsInLine",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "main": "index.js",
5
5
  "module": "es.js",
6
6
  "sideEffects": [