@astral/ui 4.105.0 → 4.106.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 (247) hide show
  1. package/components/ActionCellBase/ActionCellBase.js +10 -1
  2. package/components/ActionCellBase/MainAction/MainAction.js +6 -0
  3. package/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
  4. package/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
  5. package/components/ActionCellBase/MainAction/MainIconButton/constants.js +4 -0
  6. package/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
  7. package/components/ActionCellBase/MainAction/MainIconButton/styles.js +9 -0
  8. package/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
  9. package/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +17 -0
  10. package/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
  11. package/components/ActionCellBase/MainAction/MobileMainButton/index.js +1 -0
  12. package/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
  13. package/components/ActionCellBase/MainAction/MobileMainButton/styles.js +7 -0
  14. package/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
  15. package/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
  16. package/components/ActionCellBase/SecondaryAction/styles.js +9 -0
  17. package/components/ActionCellBase/constants.d.ts +4 -0
  18. package/components/ActionCellBase/constants.js +5 -0
  19. package/components/ActionCellBase/styles.js +11 -0
  20. package/components/ActionCellBase/types.d.ts +25 -0
  21. package/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  22. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  23. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  24. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  25. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  26. package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  27. package/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +7 -4
  28. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  29. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  30. package/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  31. package/components/InfiniteTreeList/InfiniteTreeListItem/index.js +1 -0
  32. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  33. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +66 -2
  34. package/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  35. package/components/InfiniteTreeList/LevelHeader/LevelHeader.js +17 -0
  36. package/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  37. package/components/InfiniteTreeList/LevelHeader/constants.js +3 -0
  38. package/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  39. package/components/InfiniteTreeList/LevelHeader/index.js +2 -0
  40. package/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  41. package/components/InfiniteTreeList/LevelHeader/styles.js +51 -0
  42. package/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  43. package/components/InfiniteTreeList/LevelHeader/types.js +1 -0
  44. package/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  45. package/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  46. package/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  47. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  48. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  49. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  50. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  51. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +11 -0
  52. package/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  53. package/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  54. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  55. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +5 -4
  56. package/components/InfiniteTreeList/constants.d.ts +21 -0
  57. package/components/InfiniteTreeList/constants.js +21 -0
  58. package/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  59. package/components/InfiniteTreeList/hooks/index.js +2 -0
  60. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  61. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +2 -0
  62. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  63. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +1 -0
  64. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  65. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +48 -0
  66. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  67. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +3 -0
  68. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  69. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +2 -0
  70. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  71. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +1 -0
  72. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  73. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +42 -0
  74. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  75. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +2 -0
  76. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  77. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +1 -0
  78. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  79. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +27 -0
  80. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  81. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +2 -0
  82. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  83. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +1 -0
  84. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  85. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +39 -0
  86. package/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  87. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  88. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +192 -28
  89. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  90. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +6 -0
  91. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  92. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +1 -0
  93. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  94. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +1 -0
  95. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  96. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +2 -0
  97. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  98. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +1 -0
  99. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  100. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +18 -0
  101. package/components/InfiniteTreeList/styles.d.ts +5 -0
  102. package/components/InfiniteTreeList/styles.js +41 -0
  103. package/components/InfiniteTreeList/types.d.ts +4 -0
  104. package/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  105. package/components/InfiniteTreeList/useLogic/useLogic.js +165 -27
  106. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  107. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +4 -0
  108. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  109. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +1 -0
  110. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  111. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +5 -0
  112. package/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  113. package/components/InfiniteTreeList/utils/checkHasNested/index.js +1 -0
  114. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  115. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  116. package/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  117. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  118. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +5 -0
  119. package/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  120. package/components/InfiniteTreeList/utils/getLevelKey/index.js +1 -0
  121. package/components/InfiniteTreeList/utils/index.d.ts +3 -0
  122. package/components/InfiniteTreeList/utils/index.js +3 -0
  123. package/components/useScrollManagement/useScrollManagement.js +7 -6
  124. package/node/components/ActionCellBase/ActionCellBase.js +10 -1
  125. package/node/components/ActionCellBase/MainAction/MainAction.js +6 -0
  126. package/node/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
  127. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
  128. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.js +7 -0
  129. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
  130. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.js +12 -0
  131. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
  132. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +21 -0
  133. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
  134. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.js +17 -0
  135. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
  136. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.js +10 -0
  137. package/node/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
  138. package/node/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
  139. package/node/components/ActionCellBase/SecondaryAction/styles.js +12 -0
  140. package/node/components/ActionCellBase/constants.d.ts +4 -0
  141. package/node/components/ActionCellBase/constants.js +8 -0
  142. package/node/components/ActionCellBase/styles.js +11 -0
  143. package/node/components/ActionCellBase/types.d.ts +25 -0
  144. package/node/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  145. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  146. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  147. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  148. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  149. package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  150. package/node/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +6 -3
  151. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  152. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  153. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  154. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.js +3 -0
  155. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  156. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +67 -3
  157. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  158. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.js +21 -0
  159. package/node/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  160. package/node/components/InfiniteTreeList/LevelHeader/constants.js +6 -0
  161. package/node/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  162. package/node/components/InfiniteTreeList/LevelHeader/index.js +18 -0
  163. package/node/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  164. package/node/components/InfiniteTreeList/LevelHeader/styles.js +54 -0
  165. package/node/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  166. package/node/components/InfiniteTreeList/LevelHeader/types.js +2 -0
  167. package/node/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  168. package/node/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  169. package/node/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  170. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  171. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  172. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  173. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  174. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +14 -0
  175. package/node/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  176. package/node/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  177. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  178. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +4 -3
  179. package/node/components/InfiniteTreeList/constants.d.ts +21 -0
  180. package/node/components/InfiniteTreeList/constants.js +22 -1
  181. package/node/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  182. package/node/components/InfiniteTreeList/hooks/index.js +2 -0
  183. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  184. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +18 -0
  185. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  186. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +2 -0
  187. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  188. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +52 -0
  189. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  190. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +19 -0
  191. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  192. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +18 -0
  193. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  194. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +2 -0
  195. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  196. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +46 -0
  197. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  198. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +18 -0
  199. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  200. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +2 -0
  201. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  202. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +31 -0
  203. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  204. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +18 -0
  205. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  206. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +2 -0
  207. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  208. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +43 -0
  209. package/node/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  210. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  211. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +190 -26
  212. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  213. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +10 -0
  214. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  215. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +17 -0
  216. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  217. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +17 -0
  218. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  219. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +18 -0
  220. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  221. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +2 -0
  222. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  223. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +22 -0
  224. package/node/components/InfiniteTreeList/styles.d.ts +5 -0
  225. package/node/components/InfiniteTreeList/styles.js +44 -0
  226. package/node/components/InfiniteTreeList/types.d.ts +4 -0
  227. package/node/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  228. package/node/components/InfiniteTreeList/useLogic/useLogic.js +162 -24
  229. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  230. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +8 -0
  231. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  232. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +17 -0
  233. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  234. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +9 -0
  235. package/node/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  236. package/node/components/InfiniteTreeList/utils/checkHasNested/index.js +17 -0
  237. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  238. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  239. package/node/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  240. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  241. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +9 -0
  242. package/node/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  243. package/node/components/InfiniteTreeList/utils/getLevelKey/index.js +17 -0
  244. package/node/components/InfiniteTreeList/utils/index.d.ts +3 -0
  245. package/node/components/InfiniteTreeList/utils/index.js +3 -0
  246. package/node/components/useScrollManagement/useScrollManagement.js +6 -5
  247. package/package.json +1 -1
@@ -1,10 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cva } from '../utils/cva';
3
+ import { actionCellBaseClassnames } from './constants';
2
4
  import { MainAction } from './MainAction';
3
5
  import { SecondaryActions } from './SecondaryAction';
4
6
  import { Wrapper } from './styles';
7
+ const actionCellCva = cva(actionCellBaseClassnames.root, {
8
+ variants: {
9
+ hasMainActions: {
10
+ true: actionCellBaseClassnames.hasMainActions,
11
+ },
12
+ },
13
+ });
5
14
  export const ActionCellBase = ({ actions, isDisabledAction, handleWrapperClick, handleActionClick, }) => {
6
15
  const { main, secondary } = actions;
7
- return (_jsxs(Wrapper, { onClick: handleWrapperClick, children: [main.map((action) => {
16
+ return (_jsxs(Wrapper, { onClick: handleWrapperClick, className: actionCellCva({ hasMainActions: Boolean(main.length) }), children: [main.map((action) => {
8
17
  return (_jsx(MainAction, { action: action, onActionClick: handleActionClick, isDisabled: isDisabledAction }, action.name));
9
18
  }), secondary && (_jsx(SecondaryActions, { actions: secondary, onActionClick: handleActionClick, isDisabled: isDisabledAction }))] }));
10
19
  };
@@ -3,11 +3,17 @@ import { createElement as _createElement } from "react";
3
3
  import { IconDropdownButton } from '../../IconDropdownButton';
4
4
  import { MenuItem } from '../../MenuItem';
5
5
  import { Tooltip } from '../../Tooltip';
6
+ import { useViewportType } from '../../useViewportType';
6
7
  import { MainIconButton } from './MainIconButton';
8
+ import { MobileMainButton } from './MobileMainButton';
7
9
  export const MainAction = ({ action, onActionClick, isDisabled, }) => {
10
+ const { isMobile } = useViewportType();
8
11
  if ('actions' in action) {
9
12
  const { disabled, icon, name, disabledReason, actions } = action;
10
13
  return (_jsx(Tooltip, { title: disabledReason || name, withoutContainer: !disabled, placement: "top", children: _jsx(IconDropdownButton, { icon: icon, variant: "text", disabled: isDisabled || disabled, children: actions.map(({ name: nestedActionName, onClick: onClickNested, ...props }) => (_createElement(MenuItem, { ...props, key: nestedActionName, onClick: onActionClick(onClickNested) }, nestedActionName))) }) }, name));
11
14
  }
15
+ if (isMobile && action.isMobilePrimary) {
16
+ return (_jsx(MobileMainButton, { action: action, onActionClick: onActionClick, isDisabled: isDisabled }));
17
+ }
12
18
  return (_jsx(MainIconButton, { action: action, onActionClick: onActionClick, isDisabled: isDisabled }));
13
19
  };
@@ -1,14 +1,17 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { ConfirmAction, } from '../../../ConfirmAction';
3
- import { IconButton } from '../../../IconButton';
4
3
  import { Tooltip } from '../../../Tooltip';
4
+ import { mainIconButtonClassnames } from './constants';
5
+ import { StyledIconButton } from './styles';
5
6
  import { useLogic } from './useLogic';
6
7
  export const MainIconButton = (props) => {
7
8
  const { tooltipProps } = useLogic(props);
8
9
  const { action, onActionClick, isDisabled } = props;
9
- const { name, icon, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, ...actions } = action;
10
- const renderButton = (renderProps) => (_jsx(Tooltip, { withoutContainer: !disabled, placement: "top", ...tooltipProps, children: _jsx(IconButton, { disabled: isDisabled || disabled, loading: loading, ...actions, variant: "text", ...renderProps, children: icon }) }, name));
11
- return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
10
+ const { name, icon, needConfirm, confirmText, confirmMobileTitle, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, mobileProps, ...actions } = action;
11
+ const renderButton = (renderProps) => (_jsx(Tooltip, { withoutContainer: !disabled, placement: "top", ...tooltipProps, children: _jsx(StyledIconButton, { disabled: isDisabled || disabled, loading: loading, ...actions, variant: "text", ...renderProps, className: mainIconButtonClassnames.root, children: icon }) }, name));
12
+ return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, popoverProps: {
13
+ title: confirmMobileTitle,
14
+ }, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
12
15
  onClick: onActionClick(onClick),
13
16
  })) }));
14
17
  };
@@ -0,0 +1,3 @@
1
+ export declare const mainIconButtonClassnames: {
2
+ root: string;
3
+ };
@@ -0,0 +1,4 @@
1
+ import { createUIKitClassname } from '../../../utils/createUIKitClassname';
2
+ export const mainIconButtonClassnames = {
3
+ root: createUIKitClassname('action-cell-base__main-icon-button'),
4
+ };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledIconButton: import("../../../styled").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
3
+ variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
4
+ loading?: boolean | undefined;
5
+ color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
6
+ component?: import("react").ElementType | undefined;
7
+ selected?: boolean | undefined;
8
+ size?: "large" | "medium" | undefined;
9
+ } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ }, {}, {}>;
@@ -0,0 +1,9 @@
1
+ import { IconButton } from '../../../IconButton';
2
+ import { styled } from '../../../styled';
3
+ export const StyledIconButton = styled(IconButton) `
4
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
5
+ order: 2;
6
+
7
+ background-color: ${({ theme }) => theme.palette.grey[100]};
8
+ }
9
+ `;
@@ -0,0 +1,14 @@
1
+ import { type IconButtonProps } from '../../../IconButton';
2
+ import { type ActionHandler, type SingleAction } from '../../types';
3
+ export type MobileMainButtonProps<TAction> = {
4
+ action: IconButtonProps & SingleAction<TAction>;
5
+ /**
6
+ * Обработчик клика на действие
7
+ */
8
+ onActionClick: ActionHandler<TAction>;
9
+ /**
10
+ * Если true, action не доступен
11
+ */
12
+ isDisabled?: boolean;
13
+ };
14
+ export declare const MobileMainButton: <TAction>({ action, isDisabled, onActionClick, }: MobileMainButtonProps<TAction>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ConfirmAction, } from '../../../ConfirmAction';
3
+ import { StyledButton } from './styles';
4
+ export const MobileMainButton = ({ action, isDisabled, onActionClick, }) => {
5
+ const { mobileProps, name, icon, needConfirm, confirmText, confirmMobileTitle, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
6
+ const text = mobileProps?.text ?? name;
7
+ const color = mobileProps?.color ?? 'primary';
8
+ const renderButton = (renderProps) => (_jsx(StyledButton, { disabled: isDisabled || disabled, loading: loading, color: color, ...actions, variant: "contained", ...renderProps, children: text }));
9
+ if (needConfirm) {
10
+ return (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, popoverProps: {
11
+ title: confirmMobileTitle,
12
+ }, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) }));
13
+ }
14
+ return renderButton({
15
+ onClick: onActionClick(onClick),
16
+ });
17
+ };
@@ -0,0 +1 @@
1
+ export * from './MobileMainButton';
@@ -0,0 +1 @@
1
+ export * from './MobileMainButton';
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledButton: import("../../../styled").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
3
+ variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
4
+ loading?: boolean | undefined;
5
+ color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
6
+ component?: import("react").ElementType | undefined;
7
+ selected?: boolean | undefined;
8
+ size?: "large" | "medium" | undefined;
9
+ } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ }, {}, {}>;
@@ -0,0 +1,7 @@
1
+ import { Button } from '../../../Button';
2
+ import { styled } from '../../../styled';
3
+ export const StyledButton = styled(Button) `
4
+ order: 1;
5
+
6
+ width: 100%;
7
+ `;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createElement as _createElement } from "react";
3
3
  import { DotsVOutlineMd } from '../../../icons/DotsVOutlineMd';
4
- import { IconDropdownButton } from '../../IconDropdownButton';
5
4
  import { MenuItem } from '../../MenuItem';
5
+ import { StyledIconDropdownButton } from './styles';
6
6
  export const SecondaryActions = ({ actions, onActionClick, isDisabled, }) => {
7
- return (_jsx(IconDropdownButton, { "aria-label": "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F", icon: _jsx(DotsVOutlineMd, {}), variant: "text", disabled: isDisabled, children: actions.map((action) => {
7
+ return (_jsx(StyledIconDropdownButton, { "aria-label": "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F", title: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F", icon: _jsx(DotsVOutlineMd, {}), variant: "text", disabled: isDisabled, children: actions.map((action) => {
8
8
  const { onClick, name } = action;
9
9
  return (_createElement(MenuItem, { ...action, key: name, tooltipPlacement: "left", onClick: onActionClick(onClick) }, name));
10
10
  }) }));
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledIconDropdownButton: import("../../styled").StyledComponent<Omit<import("../../IconDropdownButton").IconDropdownButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
@@ -0,0 +1,9 @@
1
+ import { IconDropdownButton } from '../../IconDropdownButton';
2
+ import { styled } from '../../styled';
3
+ export const StyledIconDropdownButton = styled(IconDropdownButton) `
4
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
5
+ order: 3;
6
+
7
+ background-color: ${({ theme }) => theme.palette.grey[100]};
8
+ }
9
+ `;
@@ -0,0 +1,4 @@
1
+ export declare const actionCellBaseClassnames: {
2
+ root: string;
3
+ hasMainActions: string;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { createUIKitClassname } from '../utils/createUIKitClassname';
2
+ export const actionCellBaseClassnames = {
3
+ root: createUIKitClassname('action-cell-base'),
4
+ hasMainActions: createUIKitClassname('action-cell-base_has-main-actions'),
5
+ };
@@ -1,5 +1,16 @@
1
1
  import { styled } from '../styled';
2
+ import { actionCellBaseClassnames } from './constants';
2
3
  export const Wrapper = styled.div `
3
4
  display: inline-flex;
4
5
  align-items: center;
6
+
7
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
8
+ gap: ${({ theme }) => theme.spacing(3)};
9
+
10
+ width: auto;
11
+
12
+ &.${actionCellBaseClassnames.hasMainActions} {
13
+ width: 100%;
14
+ }
15
+ }
5
16
  `;
@@ -1,4 +1,5 @@
1
1
  import type { MouseEventHandler, ReactNode } from 'react';
2
+ import { type ButtonColor } from '../Button';
2
3
  import { type ConfirmActionProps } from '../ConfirmAction';
3
4
  import { type IconButtonProps } from '../IconButton';
4
5
  import { type MenuItemProps } from '../MenuItem';
@@ -33,6 +34,10 @@ export type SingleAction<TAction> = {
33
34
  * Поясняющий текст для подтверждения действия
34
35
  */
35
36
  confirmText?: ConfirmActionProps['text'];
37
+ /**
38
+ * Заголовок подтверждения действия на мобильной ширине
39
+ */
40
+ confirmMobileTitle?: string;
36
41
  /**
37
42
  * Параметры кнопки подтверждения действия
38
43
  */
@@ -49,6 +54,26 @@ export type SingleAction<TAction> = {
49
54
  * Причина блокировки строки во время загрузки
50
55
  */
51
56
  loadingNote?: string;
57
+ /**
58
+ * Если `true`, на мобильной ширине действие отображается кнопкой с текстом,
59
+ * а не иконкой
60
+ */
61
+ isMobilePrimary?: boolean;
62
+ /**
63
+ * Параметры кнопки действия на мобильной ширине
64
+ */
65
+ mobileProps?: {
66
+ /**
67
+ * Текст кнопки
68
+ * @default name
69
+ */
70
+ text?: string;
71
+ /**
72
+ * Цвет кнопки
73
+ * @default 'primary'
74
+ */
75
+ color?: ButtonColor;
76
+ };
52
77
  /**
53
78
  * Обработчик действия
54
79
  */
@@ -2,14 +2,28 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  // cspell:ignore Виртуализированное
3
3
  import { Virtuoso } from 'react-virtuoso';
4
4
  import { ContentState } from '../ContentState';
5
+ import { selfContainedClassname } from '../constants';
6
+ import { cva } from '../utils/cva';
7
+ import { infiniteTreeListClassnames } from './constants';
5
8
  import { InfiniteTreeListContextProvider, } from './InfiniteTreeListContext';
9
+ import { LevelHeader } from './LevelHeader';
6
10
  import { ListFooter } from './ListFooter';
7
11
  import { NoDataPlaceholder } from './NoDataPlaceholder';
8
12
  import { OnTopButton } from './OnTopButton';
9
13
  import { ParentItems } from './ParentItems';
14
+ import { InfiniteTreeListWrapper } from './styles';
10
15
  import { TreeItem } from './TreeItem';
11
16
  import { useLogic } from './useLogic';
12
17
  const computeItemKey = (_, item) => item.id;
18
+ const rootCva = cva([selfContainedClassname, infiniteTreeListClassnames.root], {
19
+ variants: {
20
+ state: {
21
+ loading: infiniteTreeListClassnames.loading,
22
+ error: infiniteTreeListClassnames.error,
23
+ noData: infiniteTreeListClassnames.noData,
24
+ },
25
+ },
26
+ });
13
27
  /**
14
28
  * Виртуализированное дерево с бесконечной подгрузкой
15
29
  *
@@ -29,6 +43,6 @@ const computeItemKey = (_, item) => item.id;
29
43
  * />
30
44
  */
31
45
  export const InfiniteTreeList = (props) => {
32
- const { flatList, onToggle, contentStateProps, scrollParent, virtuosoProps, footerContext, onTopButtonProps, renderItem, renderParent, items, itemSkeleton, onRetry, noDataImgSrc, enterAnimation, tailRegistry, nodePaginationMap, registerChildren, notifyExpand, parentItems, acquireParentSlot, } = useLogic(props);
33
- return (_jsxs(InfiniteTreeListContextProvider, { itemSkeleton: itemSkeleton, nodePaginationMap: nodePaginationMap, registerChildren: registerChildren, notifyExpand: notifyExpand, onListRetry: onRetry, enterAnimation: enterAnimation, tailRegistry: tailRegistry, renderItem: renderItem, renderParent: renderParent, onToggle: onToggle, acquireParentSlot: acquireParentSlot, children: [_jsx(ParentItems, { parents: parentItems }), _jsx(ContentState, { ...contentStateProps, children: items.length > 0 && scrollParent ? (_jsxs(_Fragment, { children: [_jsx(Virtuoso, { ...virtuosoProps, data: flatList, customScrollParent: scrollParent, computeItemKey: computeItemKey, context: footerContext, components: { Item: TreeItem, Footer: ListFooter } }), _jsx(OnTopButton, { ...onTopButtonProps })] })) : (_jsx(NoDataPlaceholder, { noDataImgSrc: noDataImgSrc })) })] }));
46
+ const { displayedList, levelKey, lastRowId, levelHeaderProps, onToggle, contentStateProps, isNoData, state, scrollParent, listRef, virtuosoProps, footerContext, onTopButtonProps, renderItem, renderParent, itemSkeleton, onRetry, noDataImgSrc, enterAnimation, tailRegistry, nodePaginationMap, registerChildren, notifyExpand, parentItems, acquireParentSlot, } = useLogic(props);
47
+ return (_jsx(InfiniteTreeListWrapper, { ref: listRef, className: rootCva({ state }), children: _jsxs(InfiniteTreeListContextProvider, { itemSkeleton: itemSkeleton, nodePaginationMap: nodePaginationMap, registerChildren: registerChildren, notifyExpand: notifyExpand, onListRetry: onRetry, enterAnimation: enterAnimation, tailRegistry: tailRegistry, renderItem: renderItem, renderParent: renderParent, onToggle: onToggle, acquireParentSlot: acquireParentSlot, lastRowId: lastRowId, children: [_jsx(ParentItems, { parents: parentItems }), levelHeaderProps && _jsx(LevelHeader, { ...levelHeaderProps }), _jsxs(ContentState, { ...contentStateProps, children: [isNoData && _jsx(NoDataPlaceholder, { noDataImgSrc: noDataImgSrc }), !isNoData && scrollParent && (_jsxs(_Fragment, { children: [_jsx(Virtuoso, { ...virtuosoProps, data: displayedList, customScrollParent: scrollParent, computeItemKey: computeItemKey, context: footerContext, components: { Item: TreeItem, Footer: ListFooter } }, levelKey), _jsx(OnTopButton, { ...onTopButtonProps })] }))] })] }) }));
34
48
  };
@@ -84,5 +84,9 @@ export type InfiniteTreeListContextProps = {
84
84
  * виртуализации, а её контейнер переносится в строку скролла
85
85
  */
86
86
  acquireParentSlot: (itemId: string) => HTMLDivElement | null;
87
+ /**
88
+ * Id последней строки данных
89
+ */
90
+ lastRowId?: string;
87
91
  };
88
92
  export declare const InfiniteTreeListContext: import("react").Context<InfiniteTreeListContextProps>;
@@ -22,6 +22,7 @@ export const InfiniteTreeListContext = createContext({
22
22
  register: () => undefined,
23
23
  unregister: () => undefined,
24
24
  checkRange: () => undefined,
25
+ forgetRange: () => undefined,
25
26
  },
26
27
  acquireParentSlot: () => null,
27
28
  });
@@ -1,8 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type InfiniteTreeListContextProps } from '../InfiniteTreeListContext';
3
- type Props = Pick<InfiniteTreeListContextProps, 'itemSkeleton' | 'nodePaginationMap' | 'enterAnimation' | 'tailRegistry' | 'registerChildren' | 'notifyExpand' | 'renderItem' | 'renderParent' | 'onToggle' | 'acquireParentSlot'> & {
3
+ type Props = Pick<InfiniteTreeListContextProps, 'itemSkeleton' | 'nodePaginationMap' | 'enterAnimation' | 'tailRegistry' | 'registerChildren' | 'notifyExpand' | 'renderItem' | 'renderParent' | 'onToggle' | 'acquireParentSlot' | 'lastRowId'> & {
4
4
  children: ReactNode;
5
5
  onListRetry: () => void;
6
6
  };
7
- export declare const InfiniteTreeListContextProvider: ({ children, itemSkeleton, nodePaginationMap, onListRetry, registerChildren, notifyExpand, enterAnimation, tailRegistry, renderItem, renderParent, onToggle, acquireParentSlot, }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const InfiniteTreeListContextProvider: ({ children, itemSkeleton, nodePaginationMap, onListRetry, registerChildren, notifyExpand, enterAnimation, tailRegistry, renderItem, renderParent, onToggle, acquireParentSlot, lastRowId, }: Props) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo, useRef, useState } from 'react';
3
3
  import { InfiniteTreeListContext, } from '../InfiniteTreeListContext';
4
- export const InfiniteTreeListContextProvider = ({ children, itemSkeleton, nodePaginationMap, onListRetry, registerChildren, notifyExpand, enterAnimation, tailRegistry, renderItem, renderParent, onToggle, acquireParentSlot, }) => {
4
+ export const InfiniteTreeListContextProvider = ({ children, itemSkeleton, nodePaginationMap, onListRetry, registerChildren, notifyExpand, enterAnimation, tailRegistry, renderItem, renderParent, onToggle, acquireParentSlot, lastRowId, }) => {
5
5
  const [disabledIdList, setDisabledIdList] = useState(new Set());
6
6
  const childrenCallbacksRef = useRef({});
7
7
  const setDisabled = useCallback((itemId, disabled) => {
@@ -51,6 +51,7 @@ export const InfiniteTreeListContextProvider = ({ children, itemSkeleton, nodePa
51
51
  enterAnimation,
52
52
  tailRegistry,
53
53
  acquireParentSlot,
54
+ lastRowId,
54
55
  }), [
55
56
  renderItem,
56
57
  renderParent,
@@ -67,6 +68,7 @@ export const InfiniteTreeListContextProvider = ({ children, itemSkeleton, nodePa
67
68
  enterAnimation,
68
69
  tailRegistry,
69
70
  acquireParentSlot,
71
+ lastRowId,
70
72
  ]);
71
73
  return (_jsx(InfiniteTreeListContext.Provider, { value: value, children: children }));
72
74
  };
@@ -5,4 +5,12 @@ export const Wrapper = styled.div `
5
5
  align-items: center;
6
6
 
7
7
  padding: ${({ theme }) => theme.spacing(0, 4)};
8
+
9
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
10
+ flex-direction: column;
11
+ gap: ${({ theme }) => theme.microSpacing(9)};
12
+
13
+ width: 100%;
14
+ padding: ${({ theme }) => theme.microSpacing(11, 0, 10)};
15
+ }
8
16
  `;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Chevron } from '../../Chevron';
3
2
  import { ContentState } from '../../ContentState';
4
3
  import { Loader } from '../../Loader';
5
4
  import { Tooltip } from '../../Tooltip';
@@ -8,7 +7,7 @@ import { cva } from '../../utils/cva';
8
7
  import { getInertProps } from '../../utils/getInertProps';
9
8
  import { infiniteTreeListItemClassnames } from './constants';
10
9
  import { ErrorPlaceholder } from './ErrorPlaceholder';
11
- import { ActionsWrapper, LoaderWrapper, Wrapper } from './styles';
10
+ import { ActionsWrapper, Content, LoaderWrapper, NestedIndicator, StyledChevron, Wrapper, } from './styles';
12
11
  import { useLogic } from './useLogic';
13
12
  const infiniteTreeListItemCva = cva(infiniteTreeListItemClassnames.root, {
14
13
  variants: {
@@ -21,6 +20,9 @@ const infiniteTreeListItemCva = cva(infiniteTreeListItemClassnames.root, {
21
20
  hasNested: {
22
21
  true: infiniteTreeListItemClassnames.hasNested,
23
22
  },
23
+ hasActions: {
24
+ true: infiniteTreeListItemClassnames.hasActions,
25
+ },
24
26
  },
25
27
  });
26
28
  export const InfiniteTreeListItem = (props) => {
@@ -29,9 +31,10 @@ export const InfiniteTreeListItem = (props) => {
29
31
  if (isRowError) {
30
32
  return _jsx(ErrorPlaceholder, { onRetry: onRetry, errorMsg: errorMsg });
31
33
  }
32
- return (_jsx(ContentState, { isLoading: isRowLoading, isSmoothLoading: false, loadingContent: _jsx(Wrapper, { className: infiniteTreeListItemCva({ isLoading: true }), children: itemSkeleton || (_jsx(LoaderWrapper, { children: _jsx(Loader, {}) })) }), children: _jsx(Tooltip, { ...tooltipProps, children: _jsxs(Wrapper, { onClick: handleClick, className: cn(infiniteTreeListItemCva({
34
+ return (_jsx(ContentState, { isLoading: isRowLoading, isSmoothLoading: false, loadingContent: _jsx(Wrapper, { className: infiniteTreeListItemCva({ isLoading: true }), children: _jsx(Content, { children: itemSkeleton || (_jsx(LoaderWrapper, { children: _jsx(Loader, {}) })) }) }), children: _jsx(Tooltip, { ...tooltipProps, children: _jsxs(Wrapper, { onClick: handleClick, className: cn(infiniteTreeListItemCva({
33
35
  isDisabled: Boolean(isDisabled || isDisabledByActions),
34
36
  isLoading: isRowLoading,
35
37
  hasNested: item.meta.hasNested,
36
- }), className), ...getInertProps(isDisabled || isDisabledByActions), children: [item.meta.hasNested && _jsx(Chevron, { isActive: isChevronActive }), children, actions && _jsx(ActionsWrapper, { children: actions })] }, `infinite-tree-list-item-${item.id}`) }) }));
38
+ hasActions: Boolean(actions),
39
+ }), className), ...getInertProps(isDisabled || isDisabledByActions), children: [item.meta.hasNested && (_jsx(NestedIndicator, { children: _jsx(StyledChevron, { isActive: isChevronActive }) })), _jsx(Content, { className: infiniteTreeListItemClassnames.content, children: children }), actions && _jsx(ActionsWrapper, { children: actions })] }, `infinite-tree-list-item-${item.id}`) }) }));
37
40
  };
@@ -1,6 +1,8 @@
1
1
  export declare const infiniteTreeListItemClassnames: {
2
2
  root: string;
3
+ content: string;
3
4
  disabled: string;
4
5
  loading: string;
5
6
  hasNested: string;
7
+ hasActions: string;
6
8
  };
@@ -1,7 +1,9 @@
1
1
  import { createUIKitClassname } from '../../utils/createUIKitClassname';
2
2
  export const infiniteTreeListItemClassnames = {
3
3
  root: createUIKitClassname('infinite-tree-list__item'),
4
+ content: createUIKitClassname('infinite-tree-list__item-content'),
4
5
  disabled: createUIKitClassname('infinite-tree-list__item_disabled'),
5
6
  loading: createUIKitClassname('infinite-tree-list__item_loading'),
6
7
  hasNested: createUIKitClassname('infinite-tree-list__item_has-nested'),
8
+ hasActions: createUIKitClassname('infinite-tree-list__item_has-actions'),
7
9
  };
@@ -1,3 +1,4 @@
1
1
  export * from './InfiniteTreeListItem';
2
2
  export * from './types';
3
3
  export * from './TreeListItemContext';
4
+ export { infiniteTreeListItemClassnames } from './constants';
@@ -1,3 +1,4 @@
1
1
  export * from './InfiniteTreeListItem';
2
2
  export * from './types';
3
3
  export * from './TreeListItemContext';
4
+ export { infiniteTreeListItemClassnames } from './constants';
@@ -3,6 +3,20 @@ export declare const Wrapper: import("../../styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const Content: import("../../styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const NestedIndicator: import("../../styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const StyledChevron: import("../../styled").StyledComponent<{
15
+ isActive?: boolean | undefined;
16
+ className?: string | undefined;
17
+ } & Omit<import("../..").WithoutEmotionSpecific<import("../..").SvgIconProps>, "classes" | "children" | "ref"> & {
18
+ theme?: import("@emotion/react").Theme | undefined;
19
+ }, {}, {}>;
6
20
  export declare const ActionsWrapper: import("../../styled").StyledComponent<{
7
21
  theme?: import("@emotion/react").Theme | undefined;
8
22
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -1,10 +1,12 @@
1
+ import { Chevron } from '../../Chevron';
1
2
  import { HOVER_MEDIA } from '../../constants';
2
3
  import { styled } from '../../styled';
3
4
  import { infiniteTreeListItemClassnames } from './constants';
4
5
  export const Wrapper = styled.div `
5
6
  cursor: default;
6
7
 
7
- display: flex;
8
+ display: grid;
9
+ grid-template-columns: 1fr;
8
10
  gap: ${({ theme }) => theme.spacing(3)};
9
11
  align-items: center;
10
12
 
@@ -25,8 +27,18 @@ export const Wrapper = styled.div `
25
27
  }
26
28
  }
27
29
 
30
+ &.${infiniteTreeListItemClassnames.hasActions} {
31
+ grid-template-columns: 1fr auto;
32
+ }
33
+
28
34
  &.${infiniteTreeListItemClassnames.hasNested} {
29
35
  cursor: pointer;
36
+
37
+ grid-template-columns: auto 1fr;
38
+
39
+ &.${infiniteTreeListItemClassnames.hasActions} {
40
+ grid-template-columns: auto 1fr auto;
41
+ }
30
42
  }
31
43
 
32
44
  &.${infiniteTreeListItemClassnames.loading} {
@@ -43,11 +55,63 @@ export const Wrapper = styled.div `
43
55
  &.${infiniteTreeListItemClassnames.disabled}:hover {
44
56
  background-color: ${({ theme }) => theme.palette.background.default};
45
57
  }
58
+
59
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
60
+ grid-template-columns: 1fr;
61
+ row-gap: ${({ theme }) => theme.spacing(4)};
62
+
63
+ padding: ${({ theme }) => theme.spacing(5, 4)};
64
+
65
+ &.${infiniteTreeListItemClassnames.hasNested} {
66
+ grid-template-columns: 1fr auto;
67
+
68
+ &.${infiniteTreeListItemClassnames.hasActions} {
69
+ grid-template-columns: 1fr auto;
70
+ }
71
+ }
72
+ }
73
+ `;
74
+ export const Content = styled.div `
75
+ display: flex;
76
+ gap: ${({ theme }) => theme.spacing(3)};
77
+ align-items: center;
78
+
79
+ min-width: 0;
80
+
81
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
82
+ grid-column: 1;
83
+ grid-row: 1;
84
+ }
85
+ `;
86
+ export const NestedIndicator = styled.div `
87
+ display: flex;
88
+ align-items: center;
89
+
90
+ min-height: ${({ theme }) => theme.typography.body1.lineHeight};
91
+
92
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
93
+ grid-column: 2;
94
+ grid-row: 1;
95
+ align-self: center;
96
+ }
97
+ `;
98
+ export const StyledChevron = styled(Chevron) `
99
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
100
+ transform: rotateZ(270deg);
101
+
102
+ width: 24px;
103
+ height: 24px;
104
+
105
+ transition: none;
106
+ }
46
107
  `;
47
108
  export const ActionsWrapper = styled.div `
48
109
  display: flex;
49
110
 
50
- margin-left: auto;
111
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
112
+ grid-column: 1 / -1;
113
+ grid-row: 2;
114
+ }
51
115
  `;
52
116
  export const LoaderWrapper = styled.div `
53
117
  display: flex;
@@ -0,0 +1,5 @@
1
+ import { type LevelHeaderProps } from './types';
2
+ /**
3
+ * Шапка отображаемого уровня на мобильной ширине
4
+ */
5
+ export declare const LevelHeader: ({ title, hasBackButton, onBack, }: LevelHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronLOutlineMd } from '../../../icons/ChevronLOutlineMd';
3
+ import { cva } from '../../utils/cva';
4
+ import { infiniteTreeListClassnames } from '../constants';
5
+ import { LEVEL_BACK_TITLE } from './constants';
6
+ import { BackButton, Title, Wrapper } from './styles';
7
+ const wrapperCva = cva(infiniteTreeListClassnames.levelHeader, {
8
+ variants: {
9
+ hasBackButton: {
10
+ true: infiniteTreeListClassnames.levelHeaderWithBackButton,
11
+ },
12
+ },
13
+ });
14
+ /**
15
+ * Шапка отображаемого уровня на мобильной ширине
16
+ */
17
+ export const LevelHeader = ({ title = LEVEL_BACK_TITLE, hasBackButton, onBack, }) => (_jsxs(Wrapper, { className: wrapperCva({ hasBackButton }), children: [hasBackButton && (_jsx(BackButton, { className: infiniteTreeListClassnames.levelHeaderBackButton, variant: "text", "aria-label": LEVEL_BACK_TITLE, onClick: onBack, children: _jsx(ChevronLOutlineMd, {}) })), _jsx(Title, { rowsCount: 2, children: title })] }));
@@ -0,0 +1,3 @@
1
+ export declare const LEVEL_BACK_TITLE = "\u041D\u0430\u0437\u0430\u0434";
2
+ export declare const LEVEL_BACK_BUTTON_WIDTH = "72px";
3
+ export declare const LEVEL_BACK_BUTTON_ICON_SIZE = "24px";
@@ -0,0 +1,3 @@
1
+ export const LEVEL_BACK_TITLE = 'Назад';
2
+ export const LEVEL_BACK_BUTTON_WIDTH = '72px';
3
+ export const LEVEL_BACK_BUTTON_ICON_SIZE = '24px';
@@ -0,0 +1,2 @@
1
+ export * from './LevelHeader';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export * from './LevelHeader';
2
+ export * from './types';