@astral/ui 4.105.0 → 4.107.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 (333) 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/Autocomplete/Autocomplete.js +2 -3
  22. package/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  23. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  24. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  25. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  26. package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  27. package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  28. package/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +7 -4
  29. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  30. package/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  31. package/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  32. package/components/InfiniteTreeList/InfiniteTreeListItem/index.js +1 -0
  33. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  34. package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +66 -2
  35. package/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  36. package/components/InfiniteTreeList/LevelHeader/LevelHeader.js +17 -0
  37. package/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  38. package/components/InfiniteTreeList/LevelHeader/constants.js +3 -0
  39. package/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  40. package/components/InfiniteTreeList/LevelHeader/index.js +2 -0
  41. package/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  42. package/components/InfiniteTreeList/LevelHeader/styles.js +51 -0
  43. package/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  44. package/components/InfiniteTreeList/LevelHeader/types.js +1 -0
  45. package/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  46. package/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  47. package/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  48. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  49. package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  50. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  51. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  52. package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +11 -0
  53. package/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  54. package/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  55. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  56. package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +5 -4
  57. package/components/InfiniteTreeList/constants.d.ts +21 -0
  58. package/components/InfiniteTreeList/constants.js +21 -0
  59. package/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  60. package/components/InfiniteTreeList/hooks/index.js +2 -0
  61. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  62. package/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +2 -0
  63. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  64. package/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +1 -0
  65. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  66. package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +48 -0
  67. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  68. package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +3 -0
  69. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  70. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +2 -0
  71. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  72. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +1 -0
  73. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  74. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +42 -0
  75. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  76. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +2 -0
  77. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  78. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +1 -0
  79. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  80. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +27 -0
  81. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  82. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +2 -0
  83. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  84. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +1 -0
  85. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  86. package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +39 -0
  87. package/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  88. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  89. package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +192 -28
  90. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  91. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +6 -0
  92. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  93. package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +1 -0
  94. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  95. package/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +1 -0
  96. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  97. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +2 -0
  98. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  99. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +1 -0
  100. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  101. package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +18 -0
  102. package/components/InfiniteTreeList/styles.d.ts +5 -0
  103. package/components/InfiniteTreeList/styles.js +41 -0
  104. package/components/InfiniteTreeList/types.d.ts +4 -0
  105. package/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  106. package/components/InfiniteTreeList/useLogic/useLogic.js +165 -27
  107. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  108. package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +4 -0
  109. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  110. package/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +1 -0
  111. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  112. package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +5 -0
  113. package/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  114. package/components/InfiniteTreeList/utils/checkHasNested/index.js +1 -0
  115. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  116. package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  117. package/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  118. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  119. package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +5 -0
  120. package/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  121. package/components/InfiniteTreeList/utils/getLevelKey/index.js +1 -0
  122. package/components/InfiniteTreeList/utils/index.d.ts +3 -0
  123. package/components/InfiniteTreeList/utils/index.js +3 -0
  124. package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  125. package/components/Select/Select.js +4 -3
  126. package/components/Select/useLogic/useLogic.d.ts +11 -2
  127. package/components/Select/useLogic/useLogic.js +4 -1
  128. package/components/TagsList/PopoverTags/PopoverTags.d.ts +7 -0
  129. package/components/TagsList/PopoverTags/PopoverTags.js +8 -0
  130. package/components/TagsList/PopoverTags/index.d.ts +2 -0
  131. package/components/TagsList/PopoverTags/index.js +2 -0
  132. package/components/TagsList/PopoverTags/styles.d.ts +8 -0
  133. package/components/TagsList/PopoverTags/styles.js +15 -0
  134. package/components/TagsList/PopoverTags/types.d.ts +24 -0
  135. package/components/TagsList/PopoverTags/types.js +1 -0
  136. package/components/TagsList/Tag/Tag.d.ts +9 -1
  137. package/components/TagsList/Tag/Tag.js +4 -3
  138. package/components/TagsList/TagsList.js +11 -5
  139. package/components/TagsList/constants.d.ts +35 -0
  140. package/components/TagsList/constants.js +35 -0
  141. package/components/TagsList/styles.d.ts +9 -1
  142. package/components/TagsList/styles.js +20 -1
  143. package/components/TagsList/types.d.ts +4 -0
  144. package/components/TagsList/useLogic/hooks/index.d.ts +1 -0
  145. package/components/TagsList/useLogic/hooks/index.js +1 -0
  146. package/components/TagsList/useLogic/hooks/useHoverDelay/index.d.ts +1 -0
  147. package/components/TagsList/useLogic/hooks/useHoverDelay/index.js +1 -0
  148. package/components/TagsList/useLogic/hooks/useHoverDelay/types.d.ts +20 -0
  149. package/components/TagsList/useLogic/hooks/useHoverDelay/types.js +1 -0
  150. package/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.d.ts +5 -0
  151. package/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.js +27 -0
  152. package/components/TagsList/useLogic/useLogic.d.ts +14 -2
  153. package/components/TagsList/useLogic/useLogic.js +84 -4
  154. package/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.d.ts +5 -0
  155. package/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.js +22 -0
  156. package/components/TagsList/utils/calculatePopoverWidth/index.d.ts +1 -0
  157. package/components/TagsList/utils/calculatePopoverWidth/index.js +1 -0
  158. package/components/TagsList/utils/index.d.ts +1 -0
  159. package/components/TagsList/utils/index.js +1 -0
  160. package/components/TreeLikeAsyncAutocomplete/Input/Input.js +3 -2
  161. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +3 -2
  162. package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +3 -1
  163. package/components/TreeLikeAutocomplete/Input/Input.js +2 -2
  164. package/components/TreeLikeAutocomplete/Input/useLogic/useLogic.d.ts +2 -1
  165. package/components/TreeLikeAutocomplete/Input/useLogic/useLogic.js +3 -1
  166. package/components/useScrollManagement/useScrollManagement.js +7 -6
  167. package/node/components/ActionCellBase/ActionCellBase.js +10 -1
  168. package/node/components/ActionCellBase/MainAction/MainAction.js +6 -0
  169. package/node/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
  170. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
  171. package/node/components/ActionCellBase/MainAction/MainIconButton/constants.js +7 -0
  172. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
  173. package/node/components/ActionCellBase/MainAction/MainIconButton/styles.js +12 -0
  174. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
  175. package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +21 -0
  176. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
  177. package/node/components/ActionCellBase/MainAction/MobileMainButton/index.js +17 -0
  178. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
  179. package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.js +10 -0
  180. package/node/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
  181. package/node/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
  182. package/node/components/ActionCellBase/SecondaryAction/styles.js +12 -0
  183. package/node/components/ActionCellBase/constants.d.ts +4 -0
  184. package/node/components/ActionCellBase/constants.js +8 -0
  185. package/node/components/ActionCellBase/styles.js +11 -0
  186. package/node/components/ActionCellBase/types.d.ts +25 -0
  187. package/node/components/Autocomplete/Autocomplete.js +2 -3
  188. package/node/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
  189. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
  190. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
  191. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
  192. package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
  193. package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
  194. package/node/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +6 -3
  195. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
  196. package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
  197. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
  198. package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.js +3 -0
  199. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
  200. package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +67 -3
  201. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
  202. package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.js +21 -0
  203. package/node/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
  204. package/node/components/InfiniteTreeList/LevelHeader/constants.js +6 -0
  205. package/node/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
  206. package/node/components/InfiniteTreeList/LevelHeader/index.js +18 -0
  207. package/node/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
  208. package/node/components/InfiniteTreeList/LevelHeader/styles.js +54 -0
  209. package/node/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
  210. package/node/components/InfiniteTreeList/LevelHeader/types.js +2 -0
  211. package/node/components/InfiniteTreeList/ListFooter/styles.js +8 -0
  212. package/node/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
  213. package/node/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
  214. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
  215. package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
  216. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
  217. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
  218. package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +14 -0
  219. package/node/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
  220. package/node/components/InfiniteTreeList/TreeItem/styles.js +19 -0
  221. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
  222. package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +4 -3
  223. package/node/components/InfiniteTreeList/constants.d.ts +21 -0
  224. package/node/components/InfiniteTreeList/constants.js +22 -1
  225. package/node/components/InfiniteTreeList/hooks/index.d.ts +2 -0
  226. package/node/components/InfiniteTreeList/hooks/index.js +2 -0
  227. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
  228. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +18 -0
  229. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
  230. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +2 -0
  231. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
  232. package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +52 -0
  233. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
  234. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +19 -0
  235. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
  236. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +18 -0
  237. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
  238. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +2 -0
  239. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
  240. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +46 -0
  241. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
  242. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +18 -0
  243. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
  244. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +2 -0
  245. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
  246. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +31 -0
  247. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
  248. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +18 -0
  249. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
  250. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +2 -0
  251. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
  252. package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +43 -0
  253. package/node/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
  254. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
  255. package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +190 -26
  256. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
  257. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +10 -0
  258. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
  259. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +17 -0
  260. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
  261. package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +17 -0
  262. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
  263. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +18 -0
  264. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
  265. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +2 -0
  266. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
  267. package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +22 -0
  268. package/node/components/InfiniteTreeList/styles.d.ts +5 -0
  269. package/node/components/InfiniteTreeList/styles.js +44 -0
  270. package/node/components/InfiniteTreeList/types.d.ts +4 -0
  271. package/node/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
  272. package/node/components/InfiniteTreeList/useLogic/useLogic.js +162 -24
  273. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
  274. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +8 -0
  275. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
  276. package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +17 -0
  277. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
  278. package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +9 -0
  279. package/node/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
  280. package/node/components/InfiniteTreeList/utils/checkHasNested/index.js +17 -0
  281. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
  282. package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
  283. package/node/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
  284. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
  285. package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +9 -0
  286. package/node/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
  287. package/node/components/InfiniteTreeList/utils/getLevelKey/index.js +17 -0
  288. package/node/components/InfiniteTreeList/utils/index.d.ts +3 -0
  289. package/node/components/InfiniteTreeList/utils/index.js +3 -0
  290. package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  291. package/node/components/Select/Select.js +4 -3
  292. package/node/components/Select/useLogic/useLogic.d.ts +11 -2
  293. package/node/components/Select/useLogic/useLogic.js +4 -1
  294. package/node/components/TagsList/PopoverTags/PopoverTags.d.ts +7 -0
  295. package/node/components/TagsList/PopoverTags/PopoverTags.js +12 -0
  296. package/node/components/TagsList/PopoverTags/index.d.ts +2 -0
  297. package/node/components/TagsList/PopoverTags/index.js +18 -0
  298. package/node/components/TagsList/PopoverTags/styles.d.ts +8 -0
  299. package/node/components/TagsList/PopoverTags/styles.js +18 -0
  300. package/node/components/TagsList/PopoverTags/types.d.ts +24 -0
  301. package/node/components/TagsList/PopoverTags/types.js +2 -0
  302. package/node/components/TagsList/Tag/Tag.d.ts +9 -1
  303. package/node/components/TagsList/Tag/Tag.js +4 -4
  304. package/node/components/TagsList/TagsList.js +10 -4
  305. package/node/components/TagsList/constants.d.ts +35 -0
  306. package/node/components/TagsList/constants.js +36 -1
  307. package/node/components/TagsList/styles.d.ts +9 -1
  308. package/node/components/TagsList/styles.js +20 -1
  309. package/node/components/TagsList/types.d.ts +4 -0
  310. package/node/components/TagsList/useLogic/hooks/index.d.ts +1 -0
  311. package/node/components/TagsList/useLogic/hooks/index.js +17 -0
  312. package/node/components/TagsList/useLogic/hooks/useHoverDelay/index.d.ts +1 -0
  313. package/node/components/TagsList/useLogic/hooks/useHoverDelay/index.js +17 -0
  314. package/node/components/TagsList/useLogic/hooks/useHoverDelay/types.d.ts +20 -0
  315. package/node/components/TagsList/useLogic/hooks/useHoverDelay/types.js +2 -0
  316. package/node/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.d.ts +5 -0
  317. package/node/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.js +31 -0
  318. package/node/components/TagsList/useLogic/useLogic.d.ts +14 -2
  319. package/node/components/TagsList/useLogic/useLogic.js +81 -1
  320. package/node/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.d.ts +5 -0
  321. package/node/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.js +26 -0
  322. package/node/components/TagsList/utils/calculatePopoverWidth/index.d.ts +1 -0
  323. package/node/components/TagsList/utils/calculatePopoverWidth/index.js +17 -0
  324. package/node/components/TagsList/utils/index.d.ts +1 -0
  325. package/node/components/TagsList/utils/index.js +3 -1
  326. package/node/components/TreeLikeAsyncAutocomplete/Input/Input.js +3 -2
  327. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +3 -2
  328. package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +3 -1
  329. package/node/components/TreeLikeAutocomplete/Input/Input.js +2 -2
  330. package/node/components/TreeLikeAutocomplete/Input/useLogic/useLogic.d.ts +2 -1
  331. package/node/components/TreeLikeAutocomplete/Input/useLogic/useLogic.js +3 -1
  332. package/node/components/useScrollManagement/useScrollManagement.js +6 -5
  333. 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);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const StepPopover: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../../../../NewPopover").NewPopoverProps, "title" | "disableMobileDrawer" | "hasArrow"> & {
2
+ export declare const StepPopover: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../../../../NewPopover").NewPopoverProps, "title" | "hasArrow" | "disableMobileDrawer"> & {
3
3
  variant?: import("../../../../../HintPopover").HintPopoverVariant | undefined;
4
4
  title?: import("react").ReactNode;
5
5
  action?: import("react").ReactNode;
@@ -24,7 +24,7 @@ const styles_1 = require("./styles");
24
24
  const useLogic_1 = require("./useLogic");
25
25
  const ClearButton = (0, react_1.forwardRef)(({ onClick, disabled }, ref) => ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { disabled: disabled, ref: ref, onClick: onClick, variant: "text", title: constants_1.CLEAR_TEXT, "aria-label": constants_1.CLEAR_TEXT, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) })));
26
26
  const SelectInner = ({ required, getOptionLabel, placeholder, helperText, hideHelperText = false, loading, success, children, disabled, error, label, fullWidth, onChange: externalOnChange, isShowClearButton, isEnableAllSelection = false, valueOptions, value, onSelectAll, onUnselectAll, ...props }, ref) => {
27
- const { isOpened, isShowingClearButton, isNoData, onClearAll, openSelect, closeSelect, resetButtonRef, isShowingSelectAll, handleChangeOption, isSelectedAll, isIndeterminate, handleChangeArrayValue, selectAllClassName, findMenuItemsLabel, isShowingPlaceholder, } = (0, useLogic_1.useLogic)({
27
+ const { isOpened, isShowingClearButton, isNoData, onClearAll, openSelect, closeSelect, resetButtonRef, isShowingSelectAll, handleChangeOption, isSelectedAll, isIndeterminate, handleChangeArrayValue, selectAllClassName, findMenuItemsLabel, isShowingPlaceholder, fieldRef, } = (0, useLogic_1.useLogic)({
28
28
  ...props,
29
29
  children,
30
30
  value,
@@ -36,11 +36,12 @@ const SelectInner = ({ required, getOptionLabel, placeholder, helperText, hideHe
36
36
  onSelectAll,
37
37
  onUnselectAll,
38
38
  loading,
39
+ ref,
39
40
  });
40
41
  const renderValue = (selectedOptions) => {
41
42
  // Массив с выбранными опциями
42
43
  if (Array.isArray(selectedOptions) && selectedOptions.length) {
43
- return ((0, jsx_runtime_1.jsx)(TagsList_1.TagsList, { data: selectedOptions, getOptionLabel: getOptionLabel || ((optionLabel) => optionLabel), onChange: handleChangeArrayValue, onClick: openSelect }));
44
+ return ((0, jsx_runtime_1.jsx)(TagsList_1.TagsList, { data: selectedOptions, getOptionLabel: getOptionLabel || ((optionLabel) => optionLabel), fieldRef: fieldRef, onChange: handleChangeArrayValue, onClick: openSelect }));
44
45
  }
45
46
  // Пустой массив или пустая строка
46
47
  if ((Array.isArray(selectedOptions) || typeof selectedOptions === 'string') &&
@@ -53,6 +54,6 @@ const SelectInner = ({ required, getOptionLabel, placeholder, helperText, hideHe
53
54
  }
54
55
  return findMenuItemsLabel(children, selectedOptions);
55
56
  };
56
- return ((0, jsx_runtime_1.jsxs)(FormControl_1.default, { error: error, fullWidth: fullWidth, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.default, { htmlFor: "grouped-select", required: required, disabled: disabled, children: label })), (0, jsx_runtime_1.jsxs)(styles_1.StyledSelect, { ...props, value: value === null || value === undefined ? '' : value, open: isOpened, disabled: disabled, onOpen: openSelect, onClose: closeSelect, renderValue: renderValue, IconComponent: () => null, displayEmpty: true, ref: ref, fullWidth: fullWidth, onChange: handleChangeOption, "$isShowingPlaceholder": isShowingPlaceholder, endAdornment: (0, jsx_runtime_1.jsxs)(styles_1.EndAdornmentWrapper, { children: [loading && (0, jsx_runtime_1.jsx)(Loader_1.Loader, { color: "primary", size: "small" }), !loading && isShowingClearButton && ((0, jsx_runtime_1.jsx)(ClearButton, { disabled: disabled, ref: resetButtonRef, onClick: onClearAll })), !loading && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", disabled: disabled, onClick: openSelect, children: !isOpened ? (0, jsx_runtime_1.jsx)(DownOutlineMd_1.DownOutlineMd, {}) : (0, jsx_runtime_1.jsx)(UpOutlineMd_1.UpOutlineMd, {}) }))] }), children: [(0, jsx_runtime_1.jsx)(styles_1.Placeholder, { value: "", children: placeholder }), !loading && isShowingSelectAll && ((0, jsx_runtime_1.jsxs)(MenuItem_1.MenuItem, { className: selectAllClassName, selected: isSelectedAll, value: constants_1.SELECT_ALL_VALUE, children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: isSelectedAll, indeterminate: isIndeterminate }) }), "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435"] })), !loading && children, !loading && isNoData && (0, jsx_runtime_1.jsx)(styles_1.StateWrapper, { children: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), (0, jsx_runtime_1.jsx)(FormHelperText_1.FormHelperText, { error: error, success: success, hideHelperText: hideHelperText, children: helperText })] }));
57
+ return ((0, jsx_runtime_1.jsxs)(FormControl_1.default, { error: error, fullWidth: fullWidth, children: [label && ((0, jsx_runtime_1.jsx)(InputLabel_1.default, { htmlFor: "grouped-select", required: required, disabled: disabled, children: label })), (0, jsx_runtime_1.jsxs)(styles_1.StyledSelect, { ...props, value: value === null || value === undefined ? '' : value, open: isOpened, disabled: disabled, onOpen: openSelect, onClose: closeSelect, renderValue: renderValue, IconComponent: () => null, displayEmpty: true, ref: fieldRef, fullWidth: fullWidth, onChange: handleChangeOption, "$isShowingPlaceholder": isShowingPlaceholder, endAdornment: (0, jsx_runtime_1.jsxs)(styles_1.EndAdornmentWrapper, { children: [loading && (0, jsx_runtime_1.jsx)(Loader_1.Loader, { color: "primary", size: "small" }), !loading && isShowingClearButton && ((0, jsx_runtime_1.jsx)(ClearButton, { disabled: disabled, ref: resetButtonRef, onClick: onClearAll })), !loading && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", disabled: disabled, onClick: openSelect, children: !isOpened ? (0, jsx_runtime_1.jsx)(DownOutlineMd_1.DownOutlineMd, {}) : (0, jsx_runtime_1.jsx)(UpOutlineMd_1.UpOutlineMd, {}) }))] }), children: [(0, jsx_runtime_1.jsx)(styles_1.Placeholder, { value: "", children: placeholder }), !loading && isShowingSelectAll && ((0, jsx_runtime_1.jsxs)(MenuItem_1.MenuItem, { className: selectAllClassName, selected: isSelectedAll, value: constants_1.SELECT_ALL_VALUE, children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: isSelectedAll, indeterminate: isIndeterminate }) }), "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435"] })), !loading && children, !loading && isNoData && (0, jsx_runtime_1.jsx)(styles_1.StateWrapper, { children: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), (0, jsx_runtime_1.jsx)(FormHelperText_1.FormHelperText, { error: error, success: success, hideHelperText: hideHelperText, children: helperText })] }));
57
58
  };
58
59
  exports.Select = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(SelectInner);
@@ -1,6 +1,13 @@
1
- import { type ReactNode, type SyntheticEvent } from 'react';
1
+ import { type ForwardedRef, type ReactNode, type SyntheticEvent } from 'react';
2
2
  import { type SelectProps } from '../types';
3
- export declare const useLogic: <TValue>({ value, onChange, children, open: externalIsOpened, defaultOpen, multiple, isEnableAllSelection, isShowClearButton, valueOptions, onSelectAll, onUnselectAll, name, placeholder, onClose, onOpen, loading, }: SelectProps<TValue>) => {
3
+ type UseLogicParams<TValue> = Omit<SelectProps<TValue>, 'ref'> & {
4
+ /**
5
+ * Ref, пробрасываемый на контейнер поля: по нему считается ширина
6
+ * всплывающего окна тэгов и он служит якорем его позиционирования
7
+ */
8
+ ref: ForwardedRef<HTMLDivElement>;
9
+ };
10
+ export declare const useLogic: <TValue>({ value, onChange, children, open: externalIsOpened, defaultOpen, multiple, isEnableAllSelection, isShowClearButton, valueOptions, onSelectAll, onUnselectAll, name, placeholder, onClose, onOpen, loading, ref, }: UseLogicParams<TValue>) => {
4
11
  isOpened: boolean;
5
12
  isNoData: boolean;
6
13
  isShowingClearButton: boolean;
@@ -17,4 +24,6 @@ export declare const useLogic: <TValue>({ value, onChange, children, open: exter
17
24
  selectAllClassName: string | undefined;
18
25
  findMenuItemsLabel: (nodes: ReactNode, selectedValue: TValue) => ReactNode;
19
26
  isShowingPlaceholder: boolean;
27
+ fieldRef: import("react").RefObject<HTMLDivElement | null>;
20
28
  };
29
+ export {};
@@ -4,12 +4,14 @@ exports.useLogic = void 0;
4
4
  const MenuItem_1 = require("@mui/material/MenuItem");
5
5
  const react_1 = require("react");
6
6
  const MenuItem_2 = require("../../MenuItem");
7
+ const useForwardedRef_1 = require("../../useForwardedRef");
7
8
  const getNodeText_1 = require("../../utils/getNodeText");
8
9
  const isSyncReactElement_1 = require("../../utils/isSyncReactElement");
9
10
  const constants_1 = require("../constants");
10
11
  const isShowingPlaceholder_1 = require("./utils/isShowingPlaceholder");
11
- const useLogic = ({ value, onChange, children, open: externalIsOpened, defaultOpen, multiple, isEnableAllSelection, isShowClearButton = true, valueOptions, onSelectAll, onUnselectAll, name, placeholder, onClose, onOpen, loading, }) => {
12
+ const useLogic = ({ value, onChange, children, open: externalIsOpened, defaultOpen, multiple, isEnableAllSelection, isShowClearButton = true, valueOptions, onSelectAll, onUnselectAll, name, placeholder, onClose, onOpen, loading, ref, }) => {
12
13
  const [isOpened, setOpened] = (0, react_1.useState)(!loading && (defaultOpen || externalIsOpened || false));
14
+ const fieldRef = (0, useForwardedRef_1.useForwardedRef)(ref);
13
15
  const resetButtonRef = (0, react_1.useRef)(null);
14
16
  const optionsLength = Array.isArray(valueOptions)
15
17
  ? valueOptions?.length
@@ -132,6 +134,7 @@ const useLogic = ({ value, onChange, children, open: externalIsOpened, defaultOp
132
134
  selectAllClassName,
133
135
  findMenuItemsLabel,
134
136
  isShowingPlaceholder: (0, isShowingPlaceholder_1.isShowingPlaceholder)(value, placeholder),
137
+ fieldRef,
135
138
  };
136
139
  };
137
140
  exports.useLogic = useLogic;
@@ -0,0 +1,7 @@
1
+ import type { TagValue } from '../types';
2
+ import { type PopoverTagsProps } from './types';
3
+ /**
4
+ * Показывает все выбранные элементы тэгами с переносом по строкам.
5
+ * Используется как содержимое всплывающего окна TagsList
6
+ */
7
+ export declare const PopoverTags: <TData extends TagValue>({ data, keyId, isDisabled, getOptionLabel, getTagProps, }: PopoverTagsProps<TData>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PopoverTags = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const utils_1 = require("../utils");
6
+ const styles_1 = require("./styles");
7
+ /**
8
+ * Показывает все выбранные элементы тэгами с переносом по строкам.
9
+ * Используется как содержимое всплывающего окна TagsList
10
+ */
11
+ const PopoverTags = ({ data, keyId, isDisabled, getOptionLabel, getTagProps, }) => ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: data.map((option) => ((0, jsx_runtime_1.jsx)(styles_1.StyledTag, { isDisabled: isDisabled, ...getTagProps(option) }, (0, utils_1.getKey)(option, keyId, getOptionLabel)))) }));
12
+ exports.PopoverTags = PopoverTags;
@@ -0,0 +1,2 @@
1
+ export * from './PopoverTags';
2
+ export * from './types';
@@ -0,0 +1,18 @@
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("./PopoverTags"), exports);
18
+ __exportStar(require("./types"), exports);