@astral/ui 4.104.2 → 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 (325) 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/ActionGroup/MainActions/ActionNode/ActionNode.d.ts +9 -0
  22. package/components/ActionGroup/MainActions/ActionNode/ActionNode.js +30 -0
  23. package/components/ActionGroup/MainActions/ActionNode/index.d.ts +1 -0
  24. package/components/ActionGroup/MainActions/ActionNode/index.js +1 -0
  25. package/components/ActionGroup/MainActions/MainActions.d.ts +1 -1
  26. package/components/ActionGroup/MainActions/MainActions.js +3 -14
  27. package/components/ActionGroup/MainActions/hooks/useMainActions/useMainActions.d.ts +352 -3
  28. package/components/ActionGroup/MainActions/hooks/useMainActions/useMainActions.js +33 -6
  29. package/components/ActionGroup/MainActions/index.d.ts +1 -0
  30. package/components/ActionGroup/MainActions/index.js +1 -0
  31. package/components/ActionGroup/MainActions/styles.d.ts +5 -6
  32. package/components/ActionGroup/MainActions/styles.js +6 -7
  33. package/components/ActionGroup/SecondaryVisibleActions/ActionNode/ActionNode.d.ts +12 -0
  34. package/components/ActionGroup/SecondaryVisibleActions/ActionNode/ActionNode.js +30 -0
  35. package/components/ActionGroup/SecondaryVisibleActions/ActionNode/index.d.ts +1 -0
  36. package/components/ActionGroup/SecondaryVisibleActions/ActionNode/index.js +1 -0
  37. package/components/ActionGroup/SecondaryVisibleActions/SecondaryVisibleActions.d.ts +1 -1
  38. package/components/ActionGroup/SecondaryVisibleActions/SecondaryVisibleActions.js +3 -7
  39. package/components/ActionGroup/constants.d.ts +3 -0
  40. package/components/ActionGroup/constants.js +4 -0
  41. package/components/ActionGroup/index.d.ts +2 -1
  42. package/components/ActionGroup/index.js +1 -0
  43. package/components/ActionGroup/public.d.ts +2 -1
  44. package/components/ActionGroup/public.js +1 -0
  45. package/components/ActionGroup/styles.js +5 -0
  46. package/components/ActionGroup/types.d.ts +48 -6
  47. package/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  48. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  49. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  50. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  51. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  52. package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  53. package/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +7 -4
  54. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  55. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  56. package/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  57. package/components/InfiniteTreeList/InfiniteTreeListItem/index.js +1 -0
  58. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  59. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +66 -2
  60. package/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  61. package/components/InfiniteTreeList/LevelHeader/LevelHeader.js +17 -0
  62. package/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  63. package/components/InfiniteTreeList/LevelHeader/constants.js +3 -0
  64. package/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  65. package/components/InfiniteTreeList/LevelHeader/index.js +2 -0
  66. package/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  67. package/components/InfiniteTreeList/LevelHeader/styles.js +51 -0
  68. package/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  69. package/components/InfiniteTreeList/LevelHeader/types.js +1 -0
  70. package/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  71. package/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  72. package/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  73. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  74. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  75. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  76. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  77. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +11 -0
  78. package/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  79. package/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  80. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  81. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +5 -4
  82. package/components/InfiniteTreeList/constants.d.ts +21 -0
  83. package/components/InfiniteTreeList/constants.js +21 -0
  84. package/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  85. package/components/InfiniteTreeList/hooks/index.js +2 -0
  86. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  87. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +2 -0
  88. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  89. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +1 -0
  90. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  91. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +48 -0
  92. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  93. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +3 -0
  94. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  95. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +2 -0
  96. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  97. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +1 -0
  98. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  99. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +42 -0
  100. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  101. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +2 -0
  102. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  103. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +1 -0
  104. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  105. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +27 -0
  106. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  107. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +2 -0
  108. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  109. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +1 -0
  110. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  111. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +39 -0
  112. package/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  113. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  114. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +192 -28
  115. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  116. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +6 -0
  117. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  118. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +1 -0
  119. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  120. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +1 -0
  121. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  122. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +2 -0
  123. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  124. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +1 -0
  125. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  126. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +18 -0
  127. package/components/InfiniteTreeList/styles.d.ts +5 -0
  128. package/components/InfiniteTreeList/styles.js +41 -0
  129. package/components/InfiniteTreeList/types.d.ts +4 -0
  130. package/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  131. package/components/InfiniteTreeList/useLogic/useLogic.js +165 -27
  132. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  133. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +4 -0
  134. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  135. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +1 -0
  136. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  137. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +5 -0
  138. package/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  139. package/components/InfiniteTreeList/utils/checkHasNested/index.js +1 -0
  140. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  141. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  142. package/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  143. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  144. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +5 -0
  145. package/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  146. package/components/InfiniteTreeList/utils/getLevelKey/index.js +1 -0
  147. package/components/InfiniteTreeList/utils/index.d.ts +3 -0
  148. package/components/InfiniteTreeList/utils/index.js +3 -0
  149. package/components/PageHeader/MobilePageActions/MobilePageActions.js +2 -2
  150. package/components/PageHeader/MobilePageActions/useLogic/useLogic.d.ts +1 -0
  151. package/components/PageHeader/MobilePageActions/useLogic/useLogic.js +3 -0
  152. package/components/PageHeader/PageActions/MainActions/MainActions.d.ts +1 -1
  153. package/components/PageHeader/PageActions/MainActions/MainActions.js +2 -2
  154. package/components/PageHeader/PageActions/MainActions/styles.js +5 -0
  155. package/components/PageHeader/PageActions/PageActions.js +2 -2
  156. package/components/PageHeader/PageActions/SecondaryVisibleActions/SecondaryVisibleActions.d.ts +1 -1
  157. package/components/PageHeader/PageActions/SecondaryVisibleActions/SecondaryVisibleActions.js +3 -3
  158. package/components/PageHeader/PageActions/SecondaryVisibleActions/styles.d.ts +7 -1
  159. package/components/PageHeader/PageActions/useLogic/useLogic.d.ts +1 -0
  160. package/components/PageHeader/PageActions/useLogic/useLogic.js +3 -0
  161. package/components/index.d.ts +1 -1
  162. package/components/useScrollManagement/useScrollManagement.js +7 -6
  163. package/node/components/ActionCellBase/ActionCellBase.js +10 -1
  164. package/node/components/ActionCellBase/MainAction/MainAction.js +6 -0
  165. package/node/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
  166. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
  167. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.js +7 -0
  168. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
  169. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.js +12 -0
  170. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
  171. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +21 -0
  172. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
  173. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.js +17 -0
  174. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
  175. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.js +10 -0
  176. package/node/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
  177. package/node/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
  178. package/node/components/ActionCellBase/SecondaryAction/styles.js +12 -0
  179. package/node/components/ActionCellBase/constants.d.ts +4 -0
  180. package/node/components/ActionCellBase/constants.js +8 -0
  181. package/node/components/ActionCellBase/styles.js +11 -0
  182. package/node/components/ActionCellBase/types.d.ts +25 -0
  183. package/node/components/ActionGroup/MainActions/ActionNode/ActionNode.d.ts +9 -0
  184. package/node/components/ActionGroup/MainActions/ActionNode/ActionNode.js +34 -0
  185. package/node/components/ActionGroup/MainActions/ActionNode/index.d.ts +1 -0
  186. package/node/components/ActionGroup/MainActions/ActionNode/index.js +17 -0
  187. package/node/components/ActionGroup/MainActions/MainActions.d.ts +1 -1
  188. package/node/components/ActionGroup/MainActions/MainActions.js +3 -14
  189. package/node/components/ActionGroup/MainActions/hooks/useMainActions/useMainActions.d.ts +352 -3
  190. package/node/components/ActionGroup/MainActions/hooks/useMainActions/useMainActions.js +33 -6
  191. package/node/components/ActionGroup/MainActions/index.d.ts +1 -0
  192. package/node/components/ActionGroup/MainActions/index.js +1 -0
  193. package/node/components/ActionGroup/MainActions/styles.d.ts +5 -6
  194. package/node/components/ActionGroup/MainActions/styles.js +7 -8
  195. package/node/components/ActionGroup/SecondaryVisibleActions/ActionNode/ActionNode.d.ts +12 -0
  196. package/node/components/ActionGroup/SecondaryVisibleActions/ActionNode/ActionNode.js +34 -0
  197. package/node/components/ActionGroup/SecondaryVisibleActions/ActionNode/index.d.ts +1 -0
  198. package/node/components/ActionGroup/SecondaryVisibleActions/ActionNode/index.js +17 -0
  199. package/node/components/ActionGroup/SecondaryVisibleActions/SecondaryVisibleActions.d.ts +1 -1
  200. package/node/components/ActionGroup/SecondaryVisibleActions/SecondaryVisibleActions.js +3 -7
  201. package/node/components/ActionGroup/constants.d.ts +3 -0
  202. package/node/components/ActionGroup/constants.js +7 -0
  203. package/node/components/ActionGroup/index.d.ts +2 -1
  204. package/node/components/ActionGroup/index.js +3 -1
  205. package/node/components/ActionGroup/public.d.ts +2 -1
  206. package/node/components/ActionGroup/public.js +3 -1
  207. package/node/components/ActionGroup/styles.js +5 -0
  208. package/node/components/ActionGroup/types.d.ts +48 -6
  209. package/node/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  210. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  211. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  212. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  213. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  214. package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  215. package/node/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +6 -3
  216. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  217. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  218. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  219. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.js +3 -0
  220. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  221. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +67 -3
  222. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  223. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.js +21 -0
  224. package/node/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  225. package/node/components/InfiniteTreeList/LevelHeader/constants.js +6 -0
  226. package/node/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  227. package/node/components/InfiniteTreeList/LevelHeader/index.js +18 -0
  228. package/node/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  229. package/node/components/InfiniteTreeList/LevelHeader/styles.js +54 -0
  230. package/node/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  231. package/node/components/InfiniteTreeList/LevelHeader/types.js +2 -0
  232. package/node/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  233. package/node/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  234. package/node/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  235. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  236. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  237. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  238. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  239. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +14 -0
  240. package/node/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  241. package/node/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  242. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  243. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +4 -3
  244. package/node/components/InfiniteTreeList/constants.d.ts +21 -0
  245. package/node/components/InfiniteTreeList/constants.js +22 -1
  246. package/node/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  247. package/node/components/InfiniteTreeList/hooks/index.js +2 -0
  248. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  249. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +18 -0
  250. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  251. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +2 -0
  252. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  253. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +52 -0
  254. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  255. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +19 -0
  256. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  257. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +18 -0
  258. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  259. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +2 -0
  260. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  261. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +46 -0
  262. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  263. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +18 -0
  264. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  265. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +2 -0
  266. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  267. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +31 -0
  268. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  269. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +18 -0
  270. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  271. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +2 -0
  272. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  273. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +43 -0
  274. package/node/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  275. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  276. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +190 -26
  277. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  278. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +10 -0
  279. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  280. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +17 -0
  281. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  282. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +17 -0
  283. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  284. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +18 -0
  285. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  286. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +2 -0
  287. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  288. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +22 -0
  289. package/node/components/InfiniteTreeList/styles.d.ts +5 -0
  290. package/node/components/InfiniteTreeList/styles.js +44 -0
  291. package/node/components/InfiniteTreeList/types.d.ts +4 -0
  292. package/node/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  293. package/node/components/InfiniteTreeList/useLogic/useLogic.js +162 -24
  294. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  295. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +8 -0
  296. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  297. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +17 -0
  298. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  299. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +9 -0
  300. package/node/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  301. package/node/components/InfiniteTreeList/utils/checkHasNested/index.js +17 -0
  302. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  303. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  304. package/node/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  305. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  306. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +9 -0
  307. package/node/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  308. package/node/components/InfiniteTreeList/utils/getLevelKey/index.js +17 -0
  309. package/node/components/InfiniteTreeList/utils/index.d.ts +3 -0
  310. package/node/components/InfiniteTreeList/utils/index.js +3 -0
  311. package/node/components/PageHeader/MobilePageActions/MobilePageActions.js +2 -2
  312. package/node/components/PageHeader/MobilePageActions/useLogic/useLogic.d.ts +1 -0
  313. package/node/components/PageHeader/MobilePageActions/useLogic/useLogic.js +3 -0
  314. package/node/components/PageHeader/PageActions/MainActions/MainActions.d.ts +1 -1
  315. package/node/components/PageHeader/PageActions/MainActions/MainActions.js +2 -2
  316. package/node/components/PageHeader/PageActions/MainActions/styles.js +5 -0
  317. package/node/components/PageHeader/PageActions/PageActions.js +2 -2
  318. package/node/components/PageHeader/PageActions/SecondaryVisibleActions/SecondaryVisibleActions.d.ts +1 -1
  319. package/node/components/PageHeader/PageActions/SecondaryVisibleActions/SecondaryVisibleActions.js +3 -3
  320. package/node/components/PageHeader/PageActions/SecondaryVisibleActions/styles.d.ts +7 -1
  321. package/node/components/PageHeader/PageActions/useLogic/useLogic.d.ts +1 -0
  322. package/node/components/PageHeader/PageActions/useLogic/useLogic.js +3 -0
  323. package/node/components/index.d.ts +1 -1
  324. package/node/components/useScrollManagement/useScrollManagement.js +6 -5
  325. package/package.json +1 -1
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = void 0;
4
4
  const react_1 = require("react");
5
5
  const ConfigProvider_1 = require("../../ConfigProvider");
6
+ const useViewportType_1 = require("../../useViewportType");
6
7
  const constants_1 = require("../constants");
7
8
  const hooks_1 = require("../hooks");
8
9
  const utils_1 = require("../utils");
@@ -12,6 +13,7 @@ const utils_1 = require("../utils");
12
13
  */
13
14
  const useLogic = ({ initialExpandedLevel, items, onRetry, errorMsg, isError, isLoading, scrollRef, isEndReached, onLoadMore, renderItem, renderParent, itemSkeleton, endOfScrollMsg, noDataImgSrc, errorImgSrc, }) => {
14
15
  const { imagesMap } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
16
+ const { isMobile } = (0, useViewportType_1.useViewportType)();
15
17
  const enterAnimation = (0, hooks_1.useEnterAnimation)();
16
18
  const parentSlotsRef = (0, react_1.useRef)(null);
17
19
  if (!parentSlotsRef.current) {
@@ -28,6 +30,7 @@ const useLogic = ({ initialExpandedLevel, items, onRetry, errorMsg, isError, isL
28
30
  enterAnimation,
29
31
  onCollapse: resetExpandNotification,
30
32
  });
33
+ const skeletonCount = itemSkeleton ? constants_1.CHILDREN_SKELETON_COUNT : 1;
31
34
  const { registerChildren, nodePaginationMap, parentItems } = (0, hooks_1.useChildrenState)({
32
35
  items,
33
36
  flatList,
@@ -37,49 +40,185 @@ const useLogic = ({ initialExpandedLevel, items, onRetry, errorMsg, isError, isL
37
40
  enterAnimation,
38
41
  insertChildren,
39
42
  syncChildrenPlaceholders,
40
- skeletonCount: itemSkeleton ? constants_1.CHILDREN_SKELETON_COUNT : 1,
43
+ skeletonCount,
41
44
  releaseParentSlot,
42
45
  });
43
- const { scrollParent, tailRegistry, isEndReachedWithScroll, virtuosoProps, onTopButtonProps, } = (0, hooks_1.useListScroll)({
46
+ const checkNodeExists = (0, react_1.useCallback)((nodeId) => flatList.some(({ id }) => id === nodeId), [flatList]);
47
+ const { currentNodeId, baseNodeId, activeLevelKeys, hasUpperLevel, isRootLevel, enterNode, leaveNode, } = (0, hooks_1.useLevelNavigation)({ items, isMobile, checkNodeExists });
48
+ const isBaseNodeExpanded = Boolean(baseNodeId && expandedIds.has(baseNodeId));
49
+ // Если корневой узел 1, то базовым уровнем становятся его дочерние элементы на
50
+ // мобильных устройствах
51
+ (0, react_1.useEffect)(() => {
52
+ if (!isMobile || !baseNodeId || isBaseNodeExpanded) {
53
+ return;
54
+ }
55
+ onToggle({ id: baseNodeId });
56
+ }, [isMobile, baseNodeId, isBaseNodeExpanded, onToggle]);
57
+ const currentNode = (0, react_1.useMemo)(() => {
58
+ if (!currentNodeId) {
59
+ return undefined;
60
+ }
61
+ return flatList.find(({ id }) => id === currentNodeId);
62
+ }, [currentNodeId, flatList]);
63
+ const levelTitle = currentNode?.title;
64
+ (0, hooks_1.useNodeTitleValidation)({
65
+ isMobile,
66
+ currentNodeId: currentNode?.id,
67
+ title: levelTitle,
68
+ });
69
+ const displayedList = (0, react_1.useMemo)(() => {
70
+ if (!isMobile) {
71
+ return flatList;
72
+ }
73
+ if (!currentNodeId) {
74
+ return flatList.filter((item) => item.meta.level === 0);
75
+ }
76
+ return flatList.filter((item) => item.meta.parentId === currentNodeId);
77
+ }, [isMobile, flatList, currentNodeId]);
78
+ // Уровни живут только на мобильной ширине
79
+ const levelKey = (0, utils_1.getLevelKey)(isMobile ? currentNodeId : undefined);
80
+ const { scrollParent, listRef, tailRegistry, isEndReachedWithScroll, virtuosoProps, onTopButtonProps, saveLevelSnapshot, dropLevelSnapshot, } = (0, hooks_1.useListScroll)({
44
81
  scrollRef,
45
82
  isEndReached,
46
83
  onLoadMore,
47
- flatListRef,
84
+ displayedList,
48
85
  enterAnimation,
86
+ isRootLevel,
87
+ levelKey,
88
+ activeLevelKeys,
49
89
  });
50
- const contentStateProps = (0, react_1.useMemo)(() => {
51
- const isNoData = !items?.length;
52
- return {
53
- // Проверка на текущие элементы списка необходима для рендера loading состояния при подгрузке данных
54
- // вместо общего LoadingPlaceholder на всю страницу
55
- isLoading: isNoData && isLoading,
56
- isError: isNoData && isError,
57
- loadingTitle: 'Загрузка данных',
58
- errorState: {
59
- imgAlt: 'Что-то пошло не так',
60
- errorList: [errorMsg || ''],
61
- imgSrc: errorImgSrc ?? imagesMap.defaultErrorImgSrc,
62
- onRetry,
63
- },
64
- };
65
- }, [items, isLoading, isError, errorMsg, errorImgSrc, onRetry, imagesMap]);
90
+ // Смена уровня — не появление строк, анимировать их не нужно
91
+ const prevLevelKeyRef = (0, react_1.useRef)(levelKey);
92
+ (0, react_1.useEffect)(() => {
93
+ if (prevLevelKeyRef.current === levelKey) {
94
+ return;
95
+ }
96
+ prevLevelKeyRef.current = levelKey;
97
+ enterAnimation.reset();
98
+ }, [levelKey, enterAnimation]);
99
+ const prepareNodeChildren = (0, react_1.useCallback)((listItem) => {
100
+ if (!expandedIdsRef.current.has(listItem.id)) {
101
+ onToggle(listItem);
102
+ }
103
+ const hasChildrenInList = Boolean(listItem.children?.length) ||
104
+ (0, utils_1.countDirectChildren)(flatListRef.current, listItem.id) > 0;
105
+ if (!hasChildrenInList) {
106
+ syncChildrenPlaceholders(listItem.id, true, skeletonCount);
107
+ }
108
+ }, [
109
+ onToggle,
110
+ flatListRef,
111
+ expandedIdsRef,
112
+ syncChildrenPlaceholders,
113
+ skeletonCount,
114
+ ]);
115
+ // На мобильной ширине дети узла открываются отдельным уровнем
116
+ const handleEnterNode = (0, react_1.useCallback)((item) => {
117
+ const listItem = flatListRef.current.find(({ id }) => id === item.id);
118
+ if (!listItem?.meta.hasNested) {
119
+ return;
120
+ }
121
+ prepareNodeChildren(listItem);
122
+ // Открытие уровня — не появление строк, анимировать их не нужно
123
+ enterAnimation.reset();
124
+ saveLevelSnapshot();
125
+ // Переход внутрь узла показывает уровень с начала
126
+ dropLevelSnapshot((0, utils_1.getLevelKey)(item.id));
127
+ enterNode(item.id);
128
+ }, [
129
+ flatListRef,
130
+ prepareNodeChildren,
131
+ enterAnimation,
132
+ saveLevelSnapshot,
133
+ dropLevelSnapshot,
134
+ enterNode,
135
+ ]);
136
+ const handleToggle = (0, react_1.useCallback)((item) => {
137
+ if (isMobile) {
138
+ handleEnterNode(item);
139
+ return;
140
+ }
141
+ onToggle(item);
142
+ }, [isMobile, handleEnterNode, onToggle]);
143
+ const handleLeaveLevel = (0, react_1.useCallback)(() => {
144
+ enterAnimation.reset();
145
+ saveLevelSnapshot();
146
+ leaveNode();
147
+ }, [saveLevelSnapshot, leaveNode, enterAnimation]);
148
+ const isNoData = !items?.length;
149
+ const state = (0, react_1.useMemo)(() => {
150
+ if (!isNoData) {
151
+ return undefined;
152
+ }
153
+ if (isLoading) {
154
+ return 'loading';
155
+ }
156
+ if (isError) {
157
+ return 'error';
158
+ }
159
+ return 'noData';
160
+ }, [isNoData, isLoading, isError]);
161
+ const contentStateProps = (0, react_1.useMemo)(() => ({
162
+ isLoading: state === 'loading',
163
+ isError: state === 'error',
164
+ loadingTitle: 'Загрузка данных',
165
+ errorState: {
166
+ imgAlt: 'Что-то пошло не так',
167
+ errorList: [errorMsg || ''],
168
+ imgSrc: errorImgSrc ?? imagesMap.defaultErrorImgSrc,
169
+ onRetry,
170
+ },
171
+ }), [state, errorMsg, errorImgSrc, onRetry, imagesMap]);
172
+ // Футер отвечает за корневой список
66
173
  const footerContext = (0, react_1.useMemo)(() => ({
174
+ isLoading: isRootLevel && isLoading,
175
+ isError: isRootLevel && isError,
176
+ isEndReached: isRootLevel && isEndReachedWithScroll,
177
+ endOfScrollMsg,
178
+ onRetry,
179
+ }), [
180
+ isRootLevel,
67
181
  isLoading,
68
182
  isError,
69
- isEndReached: isEndReachedWithScroll,
183
+ isEndReachedWithScroll,
70
184
  endOfScrollMsg,
71
185
  onRetry,
72
- }), [isLoading, isError, isEndReachedWithScroll, endOfScrollMsg, onRetry]);
186
+ ]);
187
+ const lastRowId = (0, react_1.useMemo)(() => {
188
+ if ((0, utils_1.checkHasFooterContent)(footerContext)) {
189
+ return undefined;
190
+ }
191
+ return displayedList[displayedList.length - 1]?.id;
192
+ }, [footerContext, displayedList]);
193
+ const levelHeaderProps = (0, react_1.useMemo)(() => {
194
+ if (!isMobile || !currentNodeId) {
195
+ return undefined;
196
+ }
197
+ if (!levelTitle && !hasUpperLevel) {
198
+ return undefined;
199
+ }
200
+ return {
201
+ title: levelTitle,
202
+ hasBackButton: hasUpperLevel,
203
+ onBack: handleLeaveLevel,
204
+ };
205
+ }, [isMobile, currentNodeId, levelTitle, hasUpperLevel, handleLeaveLevel]);
73
206
  return {
74
- flatList,
75
- onToggle,
207
+ displayedList,
208
+ levelKey,
209
+ lastRowId,
210
+ levelHeaderProps,
211
+ onToggle: handleToggle,
76
212
  nodePaginationMap,
77
213
  registerChildren,
78
214
  notifyExpand,
79
215
  parentItems,
80
216
  acquireParentSlot,
81
217
  contentStateProps,
218
+ isNoData,
219
+ state,
82
220
  scrollParent,
221
+ listRef,
83
222
  virtuosoProps,
84
223
  footerContext,
85
224
  onTopButtonProps,
@@ -88,7 +227,6 @@ const useLogic = ({ initialExpandedLevel, items, onRetry, errorMsg, isError, isL
88
227
  // Fallback подставляется один раз: ниже по дереву строка выбирает функцию по
89
228
  // типу узла, не проверяя, передал ли потребитель renderParent
90
229
  renderParent: renderParent ?? renderItem,
91
- items,
92
230
  onRetry,
93
231
  noDataImgSrc,
94
232
  enterAnimation,
@@ -0,0 +1,5 @@
1
+ import type { ListFooterContext } from '../../ListFooter';
2
+ /**
3
+ * Проверяет, покажет ли футер списка placeholder
4
+ */
5
+ export declare const checkHasFooterContent: ({ isLoading, isError, isEndReached, }: ListFooterContext) => boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkHasFooterContent = void 0;
4
+ /**
5
+ * Проверяет, покажет ли футер списка placeholder
6
+ */
7
+ const checkHasFooterContent = ({ isLoading, isError, isEndReached, }) => Boolean(isLoading || isError || isEndReached);
8
+ exports.checkHasFooterContent = checkHasFooterContent;
@@ -0,0 +1 @@
1
+ export * from './checkHasFooterContent';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./checkHasFooterContent"), exports);
@@ -0,0 +1,6 @@
1
+ import type { InfiniteTreeListData } from '../../types';
2
+ /**
3
+ * Проверяет, есть ли у элемента вложенность: тем же признаком список решает,
4
+ * рисовать ли строке Chevron, а мобильный режим — уводит ли строка внутрь узла
5
+ */
6
+ export declare const checkHasNested: <TData extends InfiniteTreeListData<TData>>(item: TData) => boolean;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkHasNested = void 0;
4
+ /**
5
+ * Проверяет, есть ли у элемента вложенность: тем же признаком список решает,
6
+ * рисовать ли строке Chevron, а мобильный режим — уводит ли строка внутрь узла
7
+ */
8
+ const checkHasNested = (item) => Boolean(item.children) || item.hasChildren === true;
9
+ exports.checkHasNested = checkHasNested;
@@ -0,0 +1 @@
1
+ export * from './checkHasNested';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./checkHasNested"), exports);
@@ -1,7 +1,8 @@
1
1
  export type TailRegistry = {
2
2
  /**
3
3
  * Регистрирует хвост ветки. Тот же `parentId` и `itemId` — обновляет callback.
4
- * Новый `itemId` сбрасывает `isLoadMoreRequested`
4
+ * Новый `itemId` сбрасывает `isLoadMoreRequested` и сразу проверяет хвост
5
+ * по последнему известному диапазону
5
6
  */
6
7
  register: (parentId: string, itemId: string, endReached: () => void) => void;
7
8
  /**
@@ -9,10 +10,14 @@ export type TailRegistry = {
9
10
  */
10
11
  unregister: (parentId: string, itemId?: string) => void;
11
12
  /**
12
- * Вызывает `endReached` для хвостов, чей индекс попадает в видимый диапазон.
13
- * `getIndex === -1` пропускает запись
13
+ * Запоминает видимый диапазон и вызывает `endReached` для хвостов, чей индекс
14
+ * в него попадает. `getIndex === -1` пропускает запись
14
15
  */
15
16
  checkRange: (endIndex: number, getIndex: (itemId: string) => number) => void;
17
+ /**
18
+ * Забывает запомненный диапазон: он относится к прежнему набору строк
19
+ */
20
+ forgetRange: () => void;
16
21
  };
17
22
  /**
18
23
  * Реестр хвостов вложенных веток. Живёт на экземпляре списка и переживает
@@ -7,6 +7,22 @@ exports.createTailRegistry = void 0;
7
7
  */
8
8
  const createTailRegistry = () => {
9
9
  const entries = new Map();
10
+ // Диапазон приходит от виртуализации раньше, чем монтируется строка хвоста:
11
+ // без запоминания диапазона хвост, видимый с первого кадра уровня, не
12
+ // сработал бы вовсе
13
+ let lastEndIndex = null;
14
+ let lastGetIndex = null;
15
+ const checkEntry = (entry) => {
16
+ if (entry.isLoadMoreRequested || lastEndIndex === null || !lastGetIndex) {
17
+ return;
18
+ }
19
+ const index = lastGetIndex(entry.itemId);
20
+ if (index === -1 || lastEndIndex < index) {
21
+ return;
22
+ }
23
+ entry.isLoadMoreRequested = true;
24
+ entry.endReached();
25
+ };
10
26
  return {
11
27
  register(parentId, itemId, endReached) {
12
28
  const existing = entries.get(parentId);
@@ -14,7 +30,13 @@ const createTailRegistry = () => {
14
30
  existing.endReached = endReached;
15
31
  return;
16
32
  }
17
- entries.set(parentId, { itemId, endReached, isLoadMoreRequested: false });
33
+ const entry = {
34
+ itemId,
35
+ endReached,
36
+ isLoadMoreRequested: false,
37
+ };
38
+ entries.set(parentId, entry);
39
+ checkEntry(entry);
18
40
  },
19
41
  unregister(parentId, itemId) {
20
42
  if (itemId === undefined) {
@@ -27,17 +49,13 @@ const createTailRegistry = () => {
27
49
  }
28
50
  },
29
51
  checkRange(endIndex, getIndex) {
30
- entries.forEach((entry) => {
31
- if (entry.isLoadMoreRequested) {
32
- return;
33
- }
34
- const index = getIndex(entry.itemId);
35
- if (index === -1 || endIndex < index) {
36
- return;
37
- }
38
- entry.isLoadMoreRequested = true;
39
- entry.endReached();
40
- });
52
+ lastEndIndex = endIndex;
53
+ lastGetIndex = getIndex;
54
+ entries.forEach(checkEntry);
55
+ },
56
+ forgetRange() {
57
+ lastEndIndex = null;
58
+ lastGetIndex = null;
41
59
  },
42
60
  };
43
61
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.flattenTree = void 0;
4
+ const checkHasNested_1 = require("../checkHasNested");
4
5
  /**
5
6
  * Проверяет, подгружаются ли дочерние элементы узла отдельно.
6
7
  */
@@ -18,7 +19,7 @@ const flattenTree = (items, expandedIds, parentPath = [], level = 0, parentId) =
18
19
  const flattenedItem = {
19
20
  ...item,
20
21
  meta: {
21
- hasNested: Boolean(item.children) || item.hasChildren === true,
22
+ hasNested: (0, checkHasNested_1.checkHasNested)(item),
22
23
  isChildrenAsync,
23
24
  level,
24
25
  path,
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Ключ уровня для снимков скролла и пересоздания списка
3
+ */
4
+ export declare const getLevelKey: (nodeId?: string) => string;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLevelKey = void 0;
4
+ const constants_1 = require("../../constants");
5
+ /**
6
+ * Ключ уровня для снимков скролла и пересоздания списка
7
+ */
8
+ const getLevelKey = (nodeId) => nodeId === undefined ? constants_1.ROOT_LEVEL_KEY : `${constants_1.NODE_LEVEL_KEY_PREFIX}${nodeId}`;
9
+ exports.getLevelKey = getLevelKey;
@@ -0,0 +1 @@
1
+ export * from './getLevelKey';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./getLevelKey"), exports);
@@ -1,3 +1,5 @@
1
+ export * from './checkHasFooterContent';
2
+ export * from './checkHasNested';
1
3
  export * from './checkHasSkeletonPlaceholders';
2
4
  export * from './checkIsChildrenPlaceholder';
3
5
  export * from './checkIsChildrenPlaceholderOf';
@@ -12,6 +14,7 @@ export * from './flattenTree';
12
14
  export * from './getEnteringChildren';
13
15
  export * from './getIdsToKeep';
14
16
  export * from './getInitialExpandedIds';
17
+ export * from './getLevelKey';
15
18
  export * from './getNestedItems';
16
19
  export * from './insertChildren';
17
20
  export * from './removeChildren';
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./checkHasFooterContent"), exports);
18
+ __exportStar(require("./checkHasNested"), exports);
17
19
  __exportStar(require("./checkHasSkeletonPlaceholders"), exports);
18
20
  __exportStar(require("./checkIsChildrenPlaceholder"), exports);
19
21
  __exportStar(require("./checkIsChildrenPlaceholderOf"), exports);
@@ -28,6 +30,7 @@ __exportStar(require("./flattenTree"), exports);
28
30
  __exportStar(require("./getEnteringChildren"), exports);
29
31
  __exportStar(require("./getIdsToKeep"), exports);
30
32
  __exportStar(require("./getInitialExpandedIds"), exports);
33
+ __exportStar(require("./getLevelKey"), exports);
31
34
  __exportStar(require("./getNestedItems"), exports);
32
35
  __exportStar(require("./insertChildren"), exports);
33
36
  __exportStar(require("./removeChildren"), exports);
@@ -6,11 +6,11 @@ const PageActions_1 = require("../PageActions");
6
6
  const styles_1 = require("./styles");
7
7
  const useLogic_1 = require("./useLogic");
8
8
  const MobilePageActions = (props) => {
9
- const { disabledAction, isActive, handleToggle, visibleMainActions, hiddenMainActions, isVisibleShowMoreButton, isLoading, } = (0, useLogic_1.useLogic)(props);
9
+ const { disabledAction, isRenderActionDisabled, isActive, handleToggle, visibleMainActions, hiddenMainActions, isVisibleShowMoreButton, isLoading, } = (0, useLogic_1.useLogic)(props);
10
10
  const { secondary, secondaryVisible, className } = props;
11
11
  if (isLoading) {
12
12
  return null;
13
13
  }
14
- return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, role: "presentation", children: [(0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledMainActions, { actions: visibleMainActions, isDisabled: disabledAction, "$isVisibleShowMoreButton": isVisibleShowMoreButton, size: "large" }), (0, jsx_runtime_1.jsxs)(styles_1.StyledCollapse, { in: isActive, children: [(0, jsx_runtime_1.jsx)(PageActions_1.MainActions, { isDisabled: disabledAction, actions: hiddenMainActions, size: "large" }), (0, jsx_runtime_1.jsxs)(styles_1.SecondaryActionsWrapper, { children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(PageActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: "large" })), secondary && ((0, jsx_runtime_1.jsx)(PageActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: "large" }))] })] })] }), isVisibleShowMoreButton && ((0, jsx_runtime_1.jsx)(styles_1.ShowMoreButton, { onClick: handleToggle, children: isActive ? 'Скрыть другие действия' : 'Показать другие действия' }))] }));
14
+ return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, role: "presentation", children: [(0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledMainActions, { actions: visibleMainActions, isDisabled: disabledAction, "$isVisibleShowMoreButton": isVisibleShowMoreButton, size: "large", isRenderActionDisabled: isRenderActionDisabled }), (0, jsx_runtime_1.jsxs)(styles_1.StyledCollapse, { in: isActive, children: [(0, jsx_runtime_1.jsx)(PageActions_1.MainActions, { isDisabled: disabledAction, actions: hiddenMainActions, size: "large", isRenderActionDisabled: isRenderActionDisabled }), (0, jsx_runtime_1.jsxs)(styles_1.SecondaryActionsWrapper, { children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(PageActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: "large", isRenderActionDisabled: true })), secondary && ((0, jsx_runtime_1.jsx)(PageActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: "large" }))] })] })] }), isVisibleShowMoreButton && ((0, jsx_runtime_1.jsx)(styles_1.ShowMoreButton, { onClick: handleToggle, children: isActive ? 'Скрыть другие действия' : 'Показать другие действия' }))] }));
15
15
  };
16
16
  exports.MobilePageActions = MobilePageActions;
@@ -3,6 +3,7 @@ import { type MobilePageActionsProps } from '../MobilePageActions';
3
3
  type UseLogicParams<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType> = MobilePageActionsProps<TMainActionComponent, TSecondaryActionComponent>;
4
4
  export declare const useLogic: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType>({ main, secondary, secondaryVisible, isLoading, }: UseLogicParams<TMainActionComponent, TSecondaryActionComponent>) => {
5
5
  disabledAction: boolean;
6
+ isRenderActionDisabled: boolean;
6
7
  isActive: boolean;
7
8
  handleToggle: () => void;
8
9
  visibleMainActions: import("../../../ActionGroup").MainAction<TMainActionComponent>[] | undefined;
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = void 0;
4
4
  const react_1 = require("react");
5
5
  const ActionGroup_1 = require("../../../ActionGroup");
6
+ const useViewportType_1 = require("../../../useViewportType");
6
7
  const useLogic = ({ main, secondary, secondaryVisible, isLoading, }) => {
7
8
  const [isActive, setIsActive] = (0, react_1.useState)(false);
8
9
  const { disabledAction } = (0, ActionGroup_1.useActionsState)({ main, secondary });
10
+ const { isMobile } = (0, useViewportType_1.useViewportType)();
9
11
  const handleToggle = () => {
10
12
  setIsActive(!isActive);
11
13
  };
@@ -13,6 +15,7 @@ const useLogic = ({ main, secondary, secondaryVisible, isLoading, }) => {
13
15
  const hiddenMainActions = main?.slice(2);
14
16
  return {
15
17
  disabledAction,
18
+ isRenderActionDisabled: !isMobile,
16
19
  isActive,
17
20
  handleToggle,
18
21
  visibleMainActions,
@@ -13,5 +13,5 @@ type PageMainActionsProps<TMainActionComponent extends ElementType> = Omit<MainA
13
13
  */
14
14
  spacing?: number;
15
15
  };
16
- export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, spacing, }: PageMainActionsProps<TMainActionComponent>) => import("react/jsx-runtime").JSX.Element | null;
16
+ export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, spacing, isRenderActionDisabled, }: PageMainActionsProps<TMainActionComponent>) => import("react/jsx-runtime").JSX.Element | null;
17
17
  export {};
@@ -4,10 +4,10 @@ exports.MainActions = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ActionGroup_1 = require("../../../ActionGroup");
6
6
  const styles_1 = require("./styles");
7
- const MainActions = ({ actions, isDisabled, className, size, spacing = 2, }) => {
7
+ const MainActions = ({ actions, isDisabled, className, size, spacing = 2, isRenderActionDisabled, }) => {
8
8
  if (!actions || (actions && actions.length === 0)) {
9
9
  return null;
10
10
  }
11
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, "$spacing": spacing, children: (0, jsx_runtime_1.jsx)(ActionGroup_1.MainActions, { actions: actions ?? [], isDisabled: isDisabled, size: size }) }));
11
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, "$spacing": spacing, children: (0, jsx_runtime_1.jsx)(ActionGroup_1.MainActions, { actions: actions ?? [], isDisabled: isDisabled, size: size, isRenderActionDisabled: isRenderActionDisabled }) }));
12
12
  };
13
13
  exports.MainActions = MainActions;
@@ -2,12 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Wrapper = void 0;
4
4
  const Button_1 = require("@mui/material/Button");
5
+ const ActionGroup_1 = require("../../../ActionGroup");
5
6
  const styled_1 = require("../../../styled");
6
7
  const Tooltip_1 = require("../../../Tooltip");
7
8
  exports.Wrapper = styled_1.styled.div `
8
9
  display: flex;
9
10
  gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
10
11
 
12
+ .${ActionGroup_1.actionGroupClassnames.action} {
13
+ flex-grow: 1;
14
+ }
15
+
11
16
  ${({ theme }) => theme.breakpoints.down('mobile')} {
12
17
  flex-wrap: wrap;
13
18
  gap: ${({ theme }) => theme.spacing(2)};
@@ -14,10 +14,10 @@ const styles_1 = require("./styles");
14
14
  const useLogic_1 = require("./useLogic");
15
15
  const PageActionsInner = (props, ref) => {
16
16
  const { secondary, secondaryVisible, main, className, isLoading, size = 'medium', spacing = 2, } = props;
17
- const { disabledAction, buttonClassnames, isFocusedMode, handleClick, tooltipTitle, collapsedActions, classnames, } = (0, useLogic_1.useLogic)(props);
17
+ const { disabledAction, isRenderActionDisabled, buttonClassnames, isFocusedMode, handleClick, tooltipTitle, collapsedActions, classnames, } = (0, useLogic_1.useLogic)(props);
18
18
  if (isLoading) {
19
19
  return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsx)(PageActionSkeleton_1.PageActionSkeleton, { size: size }) }));
20
20
  }
21
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$spacing": spacing, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: (0, jsx_runtime_1.jsx)(styles_1.FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? (0, jsx_runtime_1.jsx)(MinimizeOutlineMd_1.MinimizeOutlineMd, {}) : (0, jsx_runtime_1.jsx)(FullSizeOutlineMd_1.FullSizeOutlineMd, {}) }) }), (0, jsx_runtime_1.jsx)(styles_1.MainActionsWrapper, { "$spacing": spacing, className: classnames, children: (0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }) }), (secondaryVisible || secondary) && ((0, jsx_runtime_1.jsxs)(styles_1.SecondaryVisibleWrapper, { "$spacing": spacing, className: classnames, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] })), collapsedActions.length > 0 && ((0, jsx_runtime_1.jsx)(styles_1.CollapsedActionsWrapper, { className: classnames, children: (0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: collapsedActions, size: size }) }))] }) }));
21
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$spacing": spacing, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: tooltipTitle, enterDelay: 400, enterNextDelay: 400, placement: "bottom-end", children: (0, jsx_runtime_1.jsx)(styles_1.FocusModeButton, { className: buttonClassnames, variant: "outlined", onClick: handleClick, "aria-label": tooltipTitle, color: "grey", children: isFocusedMode ? (0, jsx_runtime_1.jsx)(MinimizeOutlineMd_1.MinimizeOutlineMd, {}) : (0, jsx_runtime_1.jsx)(FullSizeOutlineMd_1.FullSizeOutlineMd, {}) }) }), (0, jsx_runtime_1.jsx)(styles_1.MainActionsWrapper, { "$spacing": spacing, className: classnames, children: (0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing, isRenderActionDisabled: isRenderActionDisabled }) }), (secondaryVisible || secondary) && ((0, jsx_runtime_1.jsxs)(styles_1.SecondaryVisibleWrapper, { "$spacing": spacing, className: classnames, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size, isRenderActionDisabled: isRenderActionDisabled })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] })), collapsedActions.length > 0 && ((0, jsx_runtime_1.jsx)(styles_1.CollapsedActionsWrapper, { className: classnames, children: (0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: collapsedActions, size: size }) }))] }) }));
22
22
  };
23
23
  exports.PageActions = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(PageActionsInner);
@@ -1,2 +1,2 @@
1
1
  import { type SecondaryVisibleActionProps } from '../../../ActionGroup';
2
- export declare const SecondaryVisibleActions: ({ actions, size, }: SecondaryVisibleActionProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const SecondaryVisibleActions: ({ actions, size, isRenderActionDisabled, }: SecondaryVisibleActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SecondaryVisibleActions = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const styles_1 = require("./styles");
6
- const SecondaryVisibleActions = ({ actions, size = 'medium', }) => {
7
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [actions.map(({ disabledReason, isBlockingOperation, icon, name, ...restActionProps }) => {
6
+ const SecondaryVisibleActions = ({ actions, size = 'medium', isRenderActionDisabled, }) => {
7
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [actions.map(({ disabledReason, isBlockingOperation, icon, name, renderAction, ...restActionProps }) => {
8
8
  return ((0, jsx_runtime_1.jsx)(styles_1.StyledMobileButton, { variant: "outlined", size: size, color: "grey", ...restActionProps, children: name }, name));
9
- }), (0, jsx_runtime_1.jsx)(styles_1.StyledSecondaryVisibleActions, { actions: actions, size: size })] }));
9
+ }), (0, jsx_runtime_1.jsx)(styles_1.StyledSecondaryVisibleActions, { actions: actions, size: size, isRenderActionDisabled: isRenderActionDisabled })] }));
10
10
  };
11
11
  exports.SecondaryVisibleActions = SecondaryVisibleActions;