@astral/ui 4.100.0 → 4.101.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.
- package/components/InfiniteTreeList/InfiniteTreeList.d.ts +18 -0
- package/components/InfiniteTreeList/InfiniteTreeList.js +26 -19
- package/components/InfiniteTreeList/InfiniteTreeListActions/InfiniteTreeListActions.d.ts +9 -0
- package/components/InfiniteTreeList/InfiniteTreeListActions/InfiniteTreeListActions.js +9 -0
- package/components/InfiniteTreeList/InfiniteTreeListActions/types.d.ts +5 -0
- package/components/InfiniteTreeList/InfiniteTreeListActions/useLogic/useLogic.js +5 -6
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +81 -0
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +21 -0
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +3 -2
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +69 -13
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/ErrorPlaceholder.d.ts +6 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/ErrorPlaceholder.js +8 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/constants.d.ts +1 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/constants.js +1 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/index.d.ts +1 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/index.js +1 -0
- package/components/InfiniteTreeList/{ErrorMessage → InfiniteTreeListItem/ErrorPlaceholder}/styles.d.ts +1 -1
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +29 -7
- package/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContext.d.ts +19 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContext.js +4 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContextProvider/TreeListItemContextProvider.d.ts +4 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContextProvider/TreeListItemContextProvider.js +13 -8
- package/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +6 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +7 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +4 -4
- package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +28 -5
- package/components/InfiniteTreeList/InfiniteTreeListItem/types.d.ts +20 -3
- package/components/InfiniteTreeList/InfiniteTreeListItem/useLogic/useLogic.d.ts +7 -1
- package/components/InfiniteTreeList/InfiniteTreeListItem/useLogic/useLogic.js +57 -5
- package/components/InfiniteTreeList/{EndData → ListFooter/EndData}/EndData.js +1 -1
- package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/ErrorMessage.js +2 -2
- package/components/InfiniteTreeList/ListFooter/ErrorMessage/styles.d.ts +5 -0
- package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/styles.js +1 -1
- package/components/InfiniteTreeList/ListFooter/ListFooter.d.ts +10 -0
- package/components/InfiniteTreeList/ListFooter/ListFooter.js +25 -0
- package/components/InfiniteTreeList/ListFooter/index.d.ts +2 -0
- package/components/InfiniteTreeList/ListFooter/index.js +1 -0
- package/components/InfiniteTreeList/{styles.d.ts → ListFooter/styles.d.ts} +2 -2
- package/components/InfiniteTreeList/{styles.js → ListFooter/styles.js} +1 -1
- package/components/InfiniteTreeList/ListFooter/types.d.ts +22 -0
- package/components/InfiniteTreeList/ListFooter/types.js +1 -0
- package/components/InfiniteTreeList/OnTopButton/OnTopButton.d.ts +8 -2
- package/components/InfiniteTreeList/OnTopButton/OnTopButton.js +6 -5
- package/components/InfiniteTreeList/OnTopButton/styles.d.ts +4 -0
- package/components/InfiniteTreeList/OnTopButton/styles.js +10 -0
- package/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/CustomParentWrapper.d.ts +23 -0
- package/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/CustomParentWrapper.js +12 -0
- package/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/index.d.ts +1 -0
- package/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/index.js +1 -0
- package/components/InfiniteTreeList/ParentItems/Item/Item.d.ts +10 -0
- package/components/InfiniteTreeList/ParentItems/Item/Item.js +22 -0
- package/components/InfiniteTreeList/ParentItems/Item/index.d.ts +2 -0
- package/components/InfiniteTreeList/ParentItems/Item/index.js +2 -0
- package/components/InfiniteTreeList/ParentItems/Item/types.d.ts +8 -0
- package/components/InfiniteTreeList/ParentItems/Item/types.js +1 -0
- package/components/InfiniteTreeList/ParentItems/Item/useLogic/index.d.ts +1 -0
- package/components/InfiniteTreeList/ParentItems/Item/useLogic/index.js +1 -0
- package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +12 -0
- package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +12 -0
- package/components/InfiniteTreeList/ParentItems/ParentItems.d.ts +11 -0
- package/components/InfiniteTreeList/ParentItems/ParentItems.js +11 -0
- package/components/InfiniteTreeList/ParentItems/index.d.ts +3 -0
- package/components/InfiniteTreeList/ParentItems/index.js +3 -0
- package/components/InfiniteTreeList/ParentItems/types.d.ts +8 -0
- package/components/InfiniteTreeList/ParentItems/types.js +1 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/ChildrenPlaceholder.d.ts +9 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/ChildrenPlaceholder.js +22 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.d.ts +1 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +5 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/index.d.ts +1 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/index.js +1 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/index.d.ts +1 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/index.js +1 -0
- package/components/InfiniteTreeList/TreeItem/CustomItemWrapper/CustomItemWrapper.d.ts +20 -0
- package/components/InfiniteTreeList/TreeItem/CustomItemWrapper/CustomItemWrapper.js +10 -0
- package/components/InfiniteTreeList/TreeItem/CustomItemWrapper/index.d.ts +1 -0
- package/components/InfiniteTreeList/TreeItem/CustomItemWrapper/index.js +1 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/ParentSlot.d.ts +5 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/ParentSlot.js +38 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/index.d.ts +2 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/index.js +2 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/styles.d.ts +9 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/styles.js +8 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/types.d.ts +6 -0
- package/components/InfiniteTreeList/TreeItem/ParentSlot/types.js +1 -0
- package/components/InfiniteTreeList/TreeItem/TreeItem.d.ts +5 -2
- package/components/InfiniteTreeList/TreeItem/TreeItem.js +31 -4
- package/components/InfiniteTreeList/TreeItem/constants.d.ts +3 -0
- package/components/InfiniteTreeList/TreeItem/constants.js +3 -1
- package/components/InfiniteTreeList/TreeItem/styles.d.ts +0 -3
- package/components/InfiniteTreeList/TreeItem/styles.js +23 -8
- package/components/InfiniteTreeList/TreeItem/types.d.ts +4 -9
- package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +29 -9
- package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +61 -19
- package/components/InfiniteTreeList/constants.d.ts +14 -2
- package/components/InfiniteTreeList/constants.js +14 -2
- package/components/InfiniteTreeList/hooks/index.d.ts +5 -0
- package/components/InfiniteTreeList/hooks/index.js +5 -0
- package/components/InfiniteTreeList/hooks/useChildrenState/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useChildrenState/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useChildrenState/types.d.ts +43 -0
- package/components/InfiniteTreeList/hooks/useChildrenState/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useChildrenState/useChildrenState.d.ts +20 -0
- package/components/InfiniteTreeList/hooks/useChildrenState/useChildrenState.js +115 -0
- package/components/InfiniteTreeList/hooks/useEnterAnimation/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useEnterAnimation/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useEnterAnimation/types.d.ts +29 -0
- package/components/InfiniteTreeList/hooks/useEnterAnimation/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useEnterAnimation/useEnterAnimation.d.ts +6 -0
- package/components/InfiniteTreeList/hooks/useEnterAnimation/useEnterAnimation.js +35 -0
- package/components/InfiniteTreeList/hooks/useExpandNotifier/index.d.ts +1 -0
- package/components/InfiniteTreeList/hooks/useExpandNotifier/index.js +1 -0
- package/components/InfiniteTreeList/hooks/useExpandNotifier/useExpandNotifier.d.ts +8 -0
- package/components/InfiniteTreeList/hooks/useExpandNotifier/useExpandNotifier.js +19 -0
- package/components/InfiniteTreeList/hooks/useFlatTree/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useFlatTree/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useFlatTree/types.d.ts +20 -0
- package/components/InfiniteTreeList/hooks/useFlatTree/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useFlatTree/useFlatTree.d.ts +15 -0
- package/components/InfiniteTreeList/hooks/useFlatTree/useFlatTree.js +88 -0
- package/components/InfiniteTreeList/hooks/useListScroll/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +25 -0
- package/components/InfiniteTreeList/hooks/useListScroll/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +29 -0
- package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +59 -0
- package/components/InfiniteTreeList/index.d.ts +1 -1
- package/components/InfiniteTreeList/public.d.ts +1 -1
- package/components/InfiniteTreeList/types.d.ts +83 -17
- package/components/InfiniteTreeList/useLogic/useLogic.d.ts +22 -12
- package/components/InfiniteTreeList/useLogic/useLogic.js +66 -71
- package/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/checkHasSkeletonPlaceholders.d.ts +5 -0
- package/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/checkHasSkeletonPlaceholders.js +6 -0
- package/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/index.js +1 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/checkIsChildrenPlaceholder.d.ts +5 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/checkIsChildrenPlaceholder.js +4 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/index.js +1 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/checkIsChildrenPlaceholderOf.d.ts +5 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/checkIsChildrenPlaceholderOf.js +5 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/index.js +1 -0
- package/components/InfiniteTreeList/utils/checkIsDirectChild/checkIsDirectChild.d.ts +6 -0
- package/components/InfiniteTreeList/utils/checkIsDirectChild/checkIsDirectChild.js +6 -0
- package/components/InfiniteTreeList/utils/checkIsDirectChild/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkIsDirectChild/index.js +1 -0
- package/components/InfiniteTreeList/utils/checkIsNoDataChildren/checkIsNoDataChildren.d.ts +12 -0
- package/components/InfiniteTreeList/utils/checkIsNoDataChildren/checkIsNoDataChildren.js +14 -0
- package/components/InfiniteTreeList/utils/checkIsNoDataChildren/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkIsNoDataChildren/index.js +1 -0
- package/components/InfiniteTreeList/utils/checkIsSameChildren/checkIsSameChildren.d.ts +5 -0
- package/components/InfiniteTreeList/utils/checkIsSameChildren/checkIsSameChildren.js +16 -0
- package/components/InfiniteTreeList/utils/checkIsSameChildren/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkIsSameChildren/index.js +1 -0
- package/components/InfiniteTreeList/utils/countDirectChildren/countDirectChildren.d.ts +5 -0
- package/components/InfiniteTreeList/utils/countDirectChildren/countDirectChildren.js +5 -0
- package/components/InfiniteTreeList/utils/countDirectChildren/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/countDirectChildren/index.js +1 -0
- package/components/InfiniteTreeList/utils/createParentSlots/createParentSlots.d.ts +24 -0
- package/components/InfiniteTreeList/utils/createParentSlots/createParentSlots.js +35 -0
- package/components/InfiniteTreeList/utils/createParentSlots/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/createParentSlots/index.js +1 -0
- package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +21 -0
- package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +40 -0
- package/components/InfiniteTreeList/utils/createTailRegistry/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/createTailRegistry/index.js +1 -0
- package/components/InfiniteTreeList/utils/flattenChildren/flattenChildren.d.ts +5 -0
- package/components/InfiniteTreeList/utils/flattenChildren/flattenChildren.js +5 -0
- package/components/InfiniteTreeList/utils/flattenChildren/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/flattenChildren/index.js +1 -0
- package/components/InfiniteTreeList/utils/flattenTree/flattenTree.d.ts +6 -0
- package/components/InfiniteTreeList/{useLogic/utils → utils}/flattenTree/flattenTree.js +9 -4
- package/components/InfiniteTreeList/utils/getEnteringChildren/getEnteringChildren.d.ts +17 -0
- package/components/InfiniteTreeList/utils/getEnteringChildren/getEnteringChildren.js +14 -0
- package/components/InfiniteTreeList/utils/getEnteringChildren/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/getEnteringChildren/index.js +1 -0
- package/components/InfiniteTreeList/utils/getIdsToKeep/getIdsToKeep.d.ts +10 -0
- package/components/InfiniteTreeList/utils/getIdsToKeep/getIdsToKeep.js +27 -0
- package/components/InfiniteTreeList/utils/getIdsToKeep/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/getIdsToKeep/index.js +1 -0
- package/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/getInitialExpandedIds.d.ts +4 -2
- package/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/getInitialExpandedIds.js +5 -4
- package/components/InfiniteTreeList/utils/getNestedItems/getNestedItems.d.ts +6 -0
- package/components/InfiniteTreeList/utils/getNestedItems/getNestedItems.js +18 -0
- package/components/InfiniteTreeList/utils/getNestedItems/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/getNestedItems/index.js +1 -0
- package/components/InfiniteTreeList/utils/index.d.ts +20 -0
- package/components/InfiniteTreeList/utils/index.js +20 -0
- package/components/InfiniteTreeList/utils/insertChildren/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/insertChildren/index.js +1 -0
- package/components/InfiniteTreeList/utils/insertChildren/insertChildren.d.ts +5 -0
- package/components/InfiniteTreeList/utils/insertChildren/insertChildren.js +41 -0
- package/components/InfiniteTreeList/utils/removeChildren/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/removeChildren/index.js +1 -0
- package/components/InfiniteTreeList/utils/removeChildren/removeChildren.d.ts +5 -0
- package/components/InfiniteTreeList/utils/removeChildren/removeChildren.js +12 -0
- package/components/InfiniteTreeList/utils/sortCollapsed/sortCollapsed.d.ts +5 -0
- package/components/InfiniteTreeList/{useLogic/utils → utils}/sortCollapsed/sortCollapsed.js +1 -6
- package/components/InfiniteTreeList/utils/startRemoveAnimation/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/startRemoveAnimation/index.js +1 -0
- package/components/InfiniteTreeList/utils/startRemoveAnimation/startRemoveAnimation.d.ts +1 -0
- package/components/InfiniteTreeList/utils/startRemoveAnimation/startRemoveAnimation.js +5 -0
- package/components/InfiniteTreeList/utils/syncChildrenPlaceholders/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/syncChildrenPlaceholders/index.js +1 -0
- package/components/InfiniteTreeList/utils/syncChildrenPlaceholders/syncChildrenPlaceholders.d.ts +11 -0
- package/components/InfiniteTreeList/utils/syncChildrenPlaceholders/syncChildrenPlaceholders.js +99 -0
- package/node/components/InfiniteTreeList/InfiniteTreeList.d.ts +18 -0
- package/node/components/InfiniteTreeList/InfiniteTreeList.js +24 -17
- package/node/components/InfiniteTreeList/InfiniteTreeListActions/InfiniteTreeListActions.d.ts +9 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListActions/InfiniteTreeListActions.js +9 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListActions/types.d.ts +5 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListActions/useLogic/useLogic.js +5 -6
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +81 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +21 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +3 -2
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +69 -13
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/ErrorPlaceholder.d.ts +6 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/ErrorPlaceholder.js +12 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/constants.d.ts +1 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/constants.js +4 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/index.js +5 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +11 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +28 -6
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContext.d.ts +19 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContext.js +4 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContextProvider/TreeListItemContextProvider.d.ts +4 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/TreeListItemContext/TreeListItemContextProvider/TreeListItemContextProvider.js +13 -8
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +6 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +10 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +4 -4
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +29 -6
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/types.d.ts +20 -3
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/useLogic/useLogic.d.ts +7 -1
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/useLogic/useLogic.js +56 -4
- package/node/components/InfiniteTreeList/{EndData → ListFooter/EndData}/EndData.js +1 -1
- package/node/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/ErrorMessage.js +2 -2
- package/node/components/InfiniteTreeList/ListFooter/ErrorMessage/styles.d.ts +5 -0
- package/node/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/styles.js +1 -1
- package/node/components/InfiniteTreeList/ListFooter/ListFooter.d.ts +10 -0
- package/node/components/InfiniteTreeList/ListFooter/ListFooter.js +29 -0
- package/node/components/InfiniteTreeList/ListFooter/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/ListFooter/index.js +17 -0
- package/node/components/InfiniteTreeList/{styles.js → ListFooter/styles.js} +1 -1
- package/node/components/InfiniteTreeList/ListFooter/types.d.ts +22 -0
- package/node/components/InfiniteTreeList/ListFooter/types.js +2 -0
- package/node/components/InfiniteTreeList/OnTopButton/OnTopButton.d.ts +8 -2
- package/node/components/InfiniteTreeList/OnTopButton/OnTopButton.js +6 -5
- package/node/components/InfiniteTreeList/OnTopButton/styles.d.ts +4 -0
- package/node/components/InfiniteTreeList/OnTopButton/styles.js +13 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/CustomParentWrapper.d.ts +23 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/CustomParentWrapper.js +15 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/index.js +17 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/Item.d.ts +10 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/Item.js +25 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/index.js +18 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/types.d.ts +8 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/types.js +2 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/index.js +17 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +12 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +16 -0
- package/node/components/InfiniteTreeList/ParentItems/ParentItems.d.ts +11 -0
- package/node/components/InfiniteTreeList/ParentItems/ParentItems.js +15 -0
- package/node/components/InfiniteTreeList/ParentItems/index.d.ts +3 -0
- package/node/components/InfiniteTreeList/ParentItems/index.js +19 -0
- package/node/components/InfiniteTreeList/ParentItems/types.d.ts +8 -0
- package/node/components/InfiniteTreeList/ParentItems/types.js +2 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/ChildrenPlaceholder.d.ts +9 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/ChildrenPlaceholder.js +26 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.d.ts +1 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +9 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/index.js +17 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/index.js +17 -0
- package/node/components/InfiniteTreeList/TreeItem/CustomItemWrapper/CustomItemWrapper.d.ts +20 -0
- package/node/components/InfiniteTreeList/TreeItem/CustomItemWrapper/CustomItemWrapper.js +13 -0
- package/node/components/InfiniteTreeList/TreeItem/CustomItemWrapper/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/TreeItem/CustomItemWrapper/index.js +17 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/ParentSlot.d.ts +5 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/ParentSlot.js +42 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/index.js +18 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/styles.d.ts +9 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/styles.js +11 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/types.d.ts +6 -0
- package/node/components/InfiniteTreeList/TreeItem/ParentSlot/types.js +2 -0
- package/node/components/InfiniteTreeList/TreeItem/TreeItem.d.ts +5 -2
- package/node/components/InfiniteTreeList/TreeItem/TreeItem.js +31 -4
- package/node/components/InfiniteTreeList/TreeItem/constants.d.ts +3 -0
- package/node/components/InfiniteTreeList/TreeItem/constants.js +3 -1
- package/node/components/InfiniteTreeList/TreeItem/styles.d.ts +0 -3
- package/node/components/InfiniteTreeList/TreeItem/styles.js +23 -8
- package/node/components/InfiniteTreeList/TreeItem/types.d.ts +4 -9
- package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +29 -9
- package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +60 -18
- package/node/components/InfiniteTreeList/constants.d.ts +14 -2
- package/node/components/InfiniteTreeList/constants.js +15 -3
- package/node/components/InfiniteTreeList/hooks/index.d.ts +5 -0
- package/node/components/InfiniteTreeList/hooks/index.js +21 -0
- package/node/components/InfiniteTreeList/hooks/useChildrenState/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useChildrenState/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useChildrenState/types.d.ts +43 -0
- package/node/components/InfiniteTreeList/hooks/useChildrenState/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useChildrenState/useChildrenState.d.ts +20 -0
- package/node/components/InfiniteTreeList/hooks/useChildrenState/useChildrenState.js +119 -0
- package/node/components/InfiniteTreeList/hooks/useEnterAnimation/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useEnterAnimation/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useEnterAnimation/types.d.ts +29 -0
- package/node/components/InfiniteTreeList/hooks/useEnterAnimation/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useEnterAnimation/useEnterAnimation.d.ts +6 -0
- package/node/components/InfiniteTreeList/hooks/useEnterAnimation/useEnterAnimation.js +39 -0
- package/node/components/InfiniteTreeList/hooks/useExpandNotifier/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/hooks/useExpandNotifier/index.js +17 -0
- package/node/components/InfiniteTreeList/hooks/useExpandNotifier/useExpandNotifier.d.ts +8 -0
- package/node/components/InfiniteTreeList/hooks/useExpandNotifier/useExpandNotifier.js +23 -0
- package/node/components/InfiniteTreeList/hooks/useFlatTree/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useFlatTree/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useFlatTree/types.d.ts +20 -0
- package/node/components/InfiniteTreeList/hooks/useFlatTree/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useFlatTree/useFlatTree.d.ts +15 -0
- package/node/components/InfiniteTreeList/hooks/useFlatTree/useFlatTree.js +92 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +25 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +29 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +63 -0
- package/node/components/InfiniteTreeList/index.d.ts +1 -1
- package/node/components/InfiniteTreeList/public.d.ts +1 -1
- package/node/components/InfiniteTreeList/types.d.ts +83 -17
- package/node/components/InfiniteTreeList/useLogic/useLogic.d.ts +22 -12
- package/node/components/InfiniteTreeList/useLogic/useLogic.js +64 -69
- package/node/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/checkHasSkeletonPlaceholders.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/checkHasSkeletonPlaceholders.js +10 -0
- package/node/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkHasSkeletonPlaceholders/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/checkIsChildrenPlaceholder.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/checkIsChildrenPlaceholder.js +8 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholder/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/checkIsChildrenPlaceholderOf.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/checkIsChildrenPlaceholderOf.js +9 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkIsChildrenPlaceholderOf/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/checkIsDirectChild/checkIsDirectChild.d.ts +6 -0
- package/node/components/InfiniteTreeList/utils/checkIsDirectChild/checkIsDirectChild.js +10 -0
- package/node/components/InfiniteTreeList/utils/checkIsDirectChild/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkIsDirectChild/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/checkIsNoDataChildren/checkIsNoDataChildren.d.ts +12 -0
- package/node/components/InfiniteTreeList/utils/checkIsNoDataChildren/checkIsNoDataChildren.js +18 -0
- package/node/components/InfiniteTreeList/utils/checkIsNoDataChildren/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkIsNoDataChildren/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/checkIsSameChildren/checkIsSameChildren.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/checkIsSameChildren/checkIsSameChildren.js +20 -0
- package/node/components/InfiniteTreeList/utils/checkIsSameChildren/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkIsSameChildren/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/countDirectChildren/countDirectChildren.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/countDirectChildren/countDirectChildren.js +9 -0
- package/node/components/InfiniteTreeList/utils/countDirectChildren/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/countDirectChildren/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/createParentSlots/createParentSlots.d.ts +24 -0
- package/node/components/InfiniteTreeList/utils/createParentSlots/createParentSlots.js +39 -0
- package/node/components/InfiniteTreeList/utils/createParentSlots/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/createParentSlots/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +21 -0
- package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +44 -0
- package/node/components/InfiniteTreeList/utils/createTailRegistry/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/createTailRegistry/index.js +5 -0
- package/node/components/InfiniteTreeList/utils/flattenChildren/flattenChildren.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/flattenChildren/flattenChildren.js +9 -0
- package/node/components/InfiniteTreeList/utils/flattenChildren/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/flattenChildren/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/flattenTree/flattenTree.d.ts +6 -0
- package/node/components/InfiniteTreeList/{useLogic/utils → utils}/flattenTree/flattenTree.js +9 -4
- package/node/components/InfiniteTreeList/utils/getEnteringChildren/getEnteringChildren.d.ts +17 -0
- package/node/components/InfiniteTreeList/utils/getEnteringChildren/getEnteringChildren.js +18 -0
- package/node/components/InfiniteTreeList/utils/getEnteringChildren/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/getEnteringChildren/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/getIdsToKeep/getIdsToKeep.d.ts +10 -0
- package/node/components/InfiniteTreeList/utils/getIdsToKeep/getIdsToKeep.js +31 -0
- package/node/components/InfiniteTreeList/utils/getIdsToKeep/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/getIdsToKeep/index.js +17 -0
- package/node/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/getInitialExpandedIds.d.ts +4 -2
- package/node/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/getInitialExpandedIds.js +5 -4
- package/node/components/InfiniteTreeList/utils/getNestedItems/getNestedItems.d.ts +6 -0
- package/node/components/InfiniteTreeList/utils/getNestedItems/getNestedItems.js +22 -0
- package/node/components/InfiniteTreeList/utils/getNestedItems/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/{useLogic/utils/getDescendants → utils/getNestedItems}/index.js +1 -1
- package/node/components/InfiniteTreeList/utils/index.d.ts +20 -0
- package/node/components/InfiniteTreeList/utils/index.js +36 -0
- package/node/components/InfiniteTreeList/utils/insertChildren/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/insertChildren/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/insertChildren/insertChildren.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/insertChildren/insertChildren.js +45 -0
- package/node/components/InfiniteTreeList/utils/removeChildren/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/removeChildren/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/removeChildren/removeChildren.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/removeChildren/removeChildren.js +16 -0
- package/node/components/InfiniteTreeList/utils/sortCollapsed/sortCollapsed.d.ts +5 -0
- package/node/components/InfiniteTreeList/{useLogic/utils → utils}/sortCollapsed/sortCollapsed.js +1 -6
- package/node/components/InfiniteTreeList/utils/startRemoveAnimation/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/startRemoveAnimation/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/startRemoveAnimation/startRemoveAnimation.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/startRemoveAnimation/startRemoveAnimation.js +9 -0
- package/node/components/InfiniteTreeList/utils/syncChildrenPlaceholders/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/syncChildrenPlaceholders/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/syncChildrenPlaceholders/syncChildrenPlaceholders.d.ts +11 -0
- package/node/components/InfiniteTreeList/utils/syncChildrenPlaceholders/syncChildrenPlaceholders.js +104 -0
- package/package.json +1 -1
- package/components/InfiniteTreeList/useLogic/utils/flattenTree/flattenTree.d.ts +0 -5
- package/components/InfiniteTreeList/useLogic/utils/getDescendants/getDescendants.d.ts +0 -10
- package/components/InfiniteTreeList/useLogic/utils/getDescendants/getDescendants.js +0 -22
- package/components/InfiniteTreeList/useLogic/utils/getDescendants/index.d.ts +0 -1
- package/components/InfiniteTreeList/useLogic/utils/getDescendants/index.js +0 -1
- package/components/InfiniteTreeList/useLogic/utils/index.d.ts +0 -4
- package/components/InfiniteTreeList/useLogic/utils/index.js +0 -4
- package/components/InfiniteTreeList/useLogic/utils/sortCollapsed/sortCollapsed.d.ts +0 -10
- package/node/components/InfiniteTreeList/useLogic/utils/flattenTree/flattenTree.d.ts +0 -5
- package/node/components/InfiniteTreeList/useLogic/utils/getDescendants/getDescendants.d.ts +0 -10
- package/node/components/InfiniteTreeList/useLogic/utils/getDescendants/getDescendants.js +0 -26
- package/node/components/InfiniteTreeList/useLogic/utils/getDescendants/index.d.ts +0 -1
- package/node/components/InfiniteTreeList/useLogic/utils/index.d.ts +0 -4
- package/node/components/InfiniteTreeList/useLogic/utils/index.js +0 -20
- package/node/components/InfiniteTreeList/useLogic/utils/sortCollapsed/sortCollapsed.d.ts +0 -10
- /package/components/InfiniteTreeList/{EndData → ListFooter/EndData}/EndData.d.ts +0 -0
- /package/components/InfiniteTreeList/{EndData → ListFooter/EndData}/constants.d.ts +0 -0
- /package/components/InfiniteTreeList/{EndData → ListFooter/EndData}/constants.js +0 -0
- /package/components/InfiniteTreeList/{EndData → ListFooter/EndData}/index.d.ts +0 -0
- /package/components/InfiniteTreeList/{EndData → ListFooter/EndData}/index.js +0 -0
- /package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/ErrorMessage.d.ts +0 -0
- /package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/constants.d.ts +0 -0
- /package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/constants.js +0 -0
- /package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/index.d.ts +0 -0
- /package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/index.js +0 -0
- /package/components/InfiniteTreeList/{useLogic/utils → utils}/flattenTree/index.d.ts +0 -0
- /package/components/InfiniteTreeList/{useLogic/utils → utils}/flattenTree/index.js +0 -0
- /package/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/index.d.ts +0 -0
- /package/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/index.js +0 -0
- /package/components/InfiniteTreeList/{useLogic/utils → utils}/sortCollapsed/index.d.ts +0 -0
- /package/components/InfiniteTreeList/{useLogic/utils → utils}/sortCollapsed/index.js +0 -0
- /package/node/components/InfiniteTreeList/{ErrorMessage → InfiniteTreeListItem/ErrorPlaceholder}/styles.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{EndData → ListFooter/EndData}/EndData.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{EndData → ListFooter/EndData}/constants.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{EndData → ListFooter/EndData}/constants.js +0 -0
- /package/node/components/InfiniteTreeList/{EndData → ListFooter/EndData}/index.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{EndData → ListFooter/EndData}/index.js +0 -0
- /package/node/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/ErrorMessage.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/constants.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/constants.js +0 -0
- /package/node/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/index.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/index.js +0 -0
- /package/node/components/InfiniteTreeList/{styles.d.ts → ListFooter/styles.d.ts} +0 -0
- /package/node/components/InfiniteTreeList/{useLogic/utils → utils}/flattenTree/index.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{useLogic/utils → utils}/flattenTree/index.js +0 -0
- /package/node/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/index.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{useLogic/utils → utils}/getInitialExpandedIds/index.js +0 -0
- /package/node/components/InfiniteTreeList/{useLogic/utils → utils}/sortCollapsed/index.d.ts +0 -0
- /package/node/components/InfiniteTreeList/{useLogic/utils → utils}/sortCollapsed/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getIdsToKeep';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getIdsToKeep';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { InfiniteTreeListData } from '
|
|
1
|
+
import type { InfiniteTreeListData } from '../../types';
|
|
2
2
|
/**
|
|
3
|
-
* Получает начальный набор раскрытых
|
|
3
|
+
* Получает начальный набор раскрытых узлов.
|
|
4
|
+
* Узел с подгружаемыми дочерними элементами раскрывается наравне
|
|
5
|
+
* со статической веткой
|
|
4
6
|
*/
|
|
5
7
|
export declare const getInitialExpandedIds: <TData extends InfiniteTreeListData<TData>>(prev: Set<string>, items: TData[], initialExpandedLevel?: number, currentLevel?: number) => Set<string>;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Получает начальный набор раскрытых
|
|
2
|
+
* Получает начальный набор раскрытых узлов.
|
|
3
|
+
* Узел с подгружаемыми дочерними элементами раскрывается наравне
|
|
4
|
+
* со статической веткой
|
|
3
5
|
*/
|
|
4
6
|
export const getInitialExpandedIds = (prev, items, initialExpandedLevel, currentLevel = 0) => {
|
|
5
7
|
const expandedIds = new Set(prev);
|
|
6
|
-
// Более точная проверка
|
|
7
8
|
if (initialExpandedLevel === undefined) {
|
|
8
9
|
return expandedIds;
|
|
9
10
|
}
|
|
10
11
|
const shouldExpand = currentLevel < initialExpandedLevel;
|
|
11
12
|
items.forEach((item) => {
|
|
12
|
-
|
|
13
|
+
const hasNested = Boolean(item.children) || item.hasChildren === true;
|
|
14
|
+
if (shouldExpand && hasNested) {
|
|
13
15
|
if (!prev?.has(item.id)) {
|
|
14
16
|
expandedIds.add(item.id);
|
|
15
17
|
}
|
|
16
|
-
// Рекурсивно обрабатываем существующих детей
|
|
17
18
|
if (item.children?.length) {
|
|
18
19
|
const childExpandedIds = getInitialExpandedIds(prev, item.children, initialExpandedLevel, currentLevel + 1);
|
|
19
20
|
childExpandedIds.forEach((id) => expandedIds.add(id));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Собирает вложенные строки узла из плоского списка.
|
|
4
|
+
* Свёрнутых веток в списке нет
|
|
5
|
+
*/
|
|
6
|
+
export declare const getNestedItems: <TData extends InfiniteTreeListData<TData>>(flatList: FlattenTree<TData>[], parentId: string) => FlattenTree<TData>[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Собирает вложенные строки узла из плоского списка.
|
|
3
|
+
* Свёрнутых веток в списке нет
|
|
4
|
+
*/
|
|
5
|
+
export const getNestedItems = (flatList, parentId) => {
|
|
6
|
+
const result = [];
|
|
7
|
+
const collectChildren = (id) => {
|
|
8
|
+
const children = flatList.filter((item) => item.meta.parentId === id);
|
|
9
|
+
children.forEach((child) => {
|
|
10
|
+
result.push(child);
|
|
11
|
+
if (child.meta.isExpanded) {
|
|
12
|
+
collectChildren(child.id);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
collectChildren(parentId);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getNestedItems';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getNestedItems';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './checkHasSkeletonPlaceholders';
|
|
2
|
+
export * from './checkIsChildrenPlaceholder';
|
|
3
|
+
export * from './checkIsChildrenPlaceholderOf';
|
|
4
|
+
export * from './checkIsDirectChild';
|
|
5
|
+
export * from './checkIsNoDataChildren';
|
|
6
|
+
export * from './checkIsSameChildren';
|
|
7
|
+
export * from './countDirectChildren';
|
|
8
|
+
export * from './createParentSlots';
|
|
9
|
+
export * from './createTailRegistry';
|
|
10
|
+
export * from './flattenChildren';
|
|
11
|
+
export * from './flattenTree';
|
|
12
|
+
export * from './getEnteringChildren';
|
|
13
|
+
export * from './getIdsToKeep';
|
|
14
|
+
export * from './getInitialExpandedIds';
|
|
15
|
+
export * from './getNestedItems';
|
|
16
|
+
export * from './insertChildren';
|
|
17
|
+
export * from './removeChildren';
|
|
18
|
+
export * from './sortCollapsed';
|
|
19
|
+
export * from './startRemoveAnimation';
|
|
20
|
+
export * from './syncChildrenPlaceholders';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './checkHasSkeletonPlaceholders';
|
|
2
|
+
export * from './checkIsChildrenPlaceholder';
|
|
3
|
+
export * from './checkIsChildrenPlaceholderOf';
|
|
4
|
+
export * from './checkIsDirectChild';
|
|
5
|
+
export * from './checkIsNoDataChildren';
|
|
6
|
+
export * from './checkIsSameChildren';
|
|
7
|
+
export * from './countDirectChildren';
|
|
8
|
+
export * from './createParentSlots';
|
|
9
|
+
export * from './createTailRegistry';
|
|
10
|
+
export * from './flattenChildren';
|
|
11
|
+
export * from './flattenTree';
|
|
12
|
+
export * from './getEnteringChildren';
|
|
13
|
+
export * from './getIdsToKeep';
|
|
14
|
+
export * from './getInitialExpandedIds';
|
|
15
|
+
export * from './getNestedItems';
|
|
16
|
+
export * from './insertChildren';
|
|
17
|
+
export * from './removeChildren';
|
|
18
|
+
export * from './sortCollapsed';
|
|
19
|
+
export * from './startRemoveAnimation';
|
|
20
|
+
export * from './syncChildrenPlaceholders';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './insertChildren';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './insertChildren';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Вставляет дочерние элементы после родителя в плоский список.
|
|
4
|
+
*/
|
|
5
|
+
export declare const insertChildren: <TData extends InfiniteTreeListData<TData>>(flatList: FlattenTree<TData>[], parentId: string, childrenData: TData[], expandedIds: Set<string>) => FlattenTree<TData>[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { checkIsDirectChild } from '../checkIsDirectChild';
|
|
2
|
+
import { flattenChildren } from '../flattenChildren';
|
|
3
|
+
import { getNestedItems } from '../getNestedItems';
|
|
4
|
+
/**
|
|
5
|
+
* Возвращает прямых дочерних элементов родителя из плоского списка
|
|
6
|
+
*/
|
|
7
|
+
const getDirectChildren = (flatList, parentId) => flatList.filter((item) => checkIsDirectChild(item, parentId));
|
|
8
|
+
/**
|
|
9
|
+
* Вставляет дочерние элементы после родителя в плоский список.
|
|
10
|
+
*/
|
|
11
|
+
export const insertChildren = (flatList, parentId, childrenData, expandedIds) => {
|
|
12
|
+
const parentIndex = flatList.findIndex((item) => item.id === parentId);
|
|
13
|
+
if (parentIndex === -1) {
|
|
14
|
+
return flatList;
|
|
15
|
+
}
|
|
16
|
+
const parent = flatList[parentIndex];
|
|
17
|
+
const nextChildren = flattenChildren(childrenData, parent, expandedIds);
|
|
18
|
+
const existingDirect = getDirectChildren(flatList, parentId);
|
|
19
|
+
const sameBranch = existingDirect.length === nextChildren.length &&
|
|
20
|
+
existingDirect.every((item, index) => item.id === nextChildren[index]?.id);
|
|
21
|
+
if (sameBranch) {
|
|
22
|
+
return flatList;
|
|
23
|
+
}
|
|
24
|
+
const nestedItems = getNestedItems(flatList, parentId);
|
|
25
|
+
const nextBranch = [];
|
|
26
|
+
nextChildren.forEach((child) => {
|
|
27
|
+
nextBranch.push(child);
|
|
28
|
+
const sourceChild = childrenData.find((item) => item.id === child.id);
|
|
29
|
+
const isNestedFlattened = Boolean(child.meta.isExpanded && sourceChild?.children?.length);
|
|
30
|
+
if (!isNestedFlattened) {
|
|
31
|
+
nextBranch.push(...getNestedItems(flatList, child.id));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const branchEnd = parentIndex + 1 + nestedItems.length;
|
|
35
|
+
return [
|
|
36
|
+
...flatList.slice(0, parentIndex),
|
|
37
|
+
{ ...parent, children: childrenData },
|
|
38
|
+
...nextBranch,
|
|
39
|
+
...flatList.slice(branchEnd),
|
|
40
|
+
];
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './removeChildren';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './removeChildren';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Удаляет дочерние элементы родителя из плоского списка и сворачивает родителя
|
|
4
|
+
*/
|
|
5
|
+
export declare const removeChildren: <TData extends InfiniteTreeListData<TData>>(flatList: FlattenTree<TData>[], parentId: string) => FlattenTree<TData>[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getNestedItems } from '../getNestedItems';
|
|
2
|
+
/**
|
|
3
|
+
* Удаляет дочерние элементы родителя из плоского списка и сворачивает родителя
|
|
4
|
+
*/
|
|
5
|
+
export const removeChildren = (flatList, parentId) => {
|
|
6
|
+
const descendantIds = new Set(getNestedItems(flatList, parentId).map((item) => item.id));
|
|
7
|
+
return flatList
|
|
8
|
+
.filter((item) => !descendantIds.has(item.id))
|
|
9
|
+
.map((item) => item.id === parentId
|
|
10
|
+
? { ...item, meta: { ...item.meta, isExpanded: false } }
|
|
11
|
+
: item);
|
|
12
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Сортирует элементы для корректной последовательности анимации при сворачивании
|
|
4
|
+
*/
|
|
5
|
+
export declare const sortCollapsed: <TData extends InfiniteTreeListData<TData>>(items: FlattenTree<TData>[]) => FlattenTree<TData>[];
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Сортирует элементы для корректной последовательности анимации при
|
|
3
|
-
* Сначала более глубокие уровни, затем по индексу среди соседей.
|
|
4
|
-
*
|
|
5
|
-
* @typeParam T - тип данных элемента дерева
|
|
6
|
-
* @param items - элементы в формате `FlattenTree<T>`
|
|
7
|
-
* @returns Отсортированный массив `FlattenTree<T>`
|
|
2
|
+
* Сортирует элементы для корректной последовательности анимации при сворачивании
|
|
8
3
|
*/
|
|
9
4
|
export const sortCollapsed = (items) => {
|
|
10
5
|
return [...items].sort((a, b) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './startRemoveAnimation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './startRemoveAnimation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const startRemoveAnimation: (nodeId: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './syncChildrenPlaceholders';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './syncChildrenPlaceholders';
|
package/components/InfiniteTreeList/utils/syncChildrenPlaceholders/syncChildrenPlaceholders.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Возвращает id строк-заглушек, которые получит родитель.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getChildrenPlaceholderIds: (parentId: string, count: number) => string[];
|
|
6
|
+
/**
|
|
7
|
+
* Приводит строки-заглушки ветки родителя к состоянию загрузки её дочерних
|
|
8
|
+
* элементов:
|
|
9
|
+
* ставит нужный вид заглушки, меняет его или убирает заглушки совсем
|
|
10
|
+
*/
|
|
11
|
+
export declare const syncChildrenPlaceholders: <TData extends InfiniteTreeListData<TData>>(flatList: FlattenTree<TData>[], parentId: string, isLoading: boolean, skeletonCount: number, isError?: boolean, isNoData?: boolean) => FlattenTree<TData>[];
|
package/components/InfiniteTreeList/utils/syncChildrenPlaceholders/syncChildrenPlaceholders.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { checkIsChildrenPlaceholderOf } from '../checkIsChildrenPlaceholderOf';
|
|
2
|
+
import { checkIsDirectChild } from '../checkIsDirectChild';
|
|
3
|
+
import { countDirectChildren } from '../countDirectChildren';
|
|
4
|
+
import { getNestedItems } from '../getNestedItems';
|
|
5
|
+
/**
|
|
6
|
+
* Возвращает стабильный id строки-заглушки для родителя.
|
|
7
|
+
*/
|
|
8
|
+
const getPlaceholderId = (parentId, index) => `loader-${parentId}-${index}`;
|
|
9
|
+
/**
|
|
10
|
+
* Возвращает стабильный id строки-заглушки «Нет данных».
|
|
11
|
+
*/
|
|
12
|
+
const getNoDataId = (parentId) => `no-data-${parentId}`;
|
|
13
|
+
/**
|
|
14
|
+
* Возвращает id строк-заглушек, которые получит родитель.
|
|
15
|
+
*/
|
|
16
|
+
export const getChildrenPlaceholderIds = (parentId, count) => Array.from({ length: count }, (_, index) => getPlaceholderId(parentId, index));
|
|
17
|
+
/**
|
|
18
|
+
* Какую заглушку должна показывать ветка при текущем состоянии загрузки
|
|
19
|
+
* дочерних элементов.
|
|
20
|
+
*/
|
|
21
|
+
const resolveChildrenPlaceholderKind = (isLoading, isError, isNoData, realChildren) => {
|
|
22
|
+
if (isLoading) {
|
|
23
|
+
return realChildren ? 'spinner' : 'skeleton';
|
|
24
|
+
}
|
|
25
|
+
if (isError) {
|
|
26
|
+
return 'error';
|
|
27
|
+
}
|
|
28
|
+
if (isNoData && !realChildren) {
|
|
29
|
+
return 'no-data';
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
};
|
|
33
|
+
const getPlaceholderCount = (kind, skeletonCount) => {
|
|
34
|
+
if (!kind) {
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
return kind === 'skeleton' ? skeletonCount : 1;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Создаёт строку-заглушку ветки
|
|
41
|
+
*/
|
|
42
|
+
const createChildrenPlaceholder = (parent, { kind, index, siblingIndex, }) => {
|
|
43
|
+
const id = kind === 'no-data'
|
|
44
|
+
? getNoDataId(parent.id)
|
|
45
|
+
: getPlaceholderId(parent.id, index);
|
|
46
|
+
return {
|
|
47
|
+
id,
|
|
48
|
+
placeholderKind: kind,
|
|
49
|
+
meta: {
|
|
50
|
+
hasNested: false,
|
|
51
|
+
isChildrenAsync: false,
|
|
52
|
+
level: parent.meta.level + 1,
|
|
53
|
+
path: [...parent.meta.path, id],
|
|
54
|
+
isExpanded: false,
|
|
55
|
+
parentId: parent.id,
|
|
56
|
+
siblingIndex,
|
|
57
|
+
nodeId: `infinite-tree-item-${id}`,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Приводит строки-заглушки ветки родителя к состоянию загрузки её дочерних
|
|
63
|
+
* элементов:
|
|
64
|
+
* ставит нужный вид заглушки, меняет его или убирает заглушки совсем
|
|
65
|
+
*/
|
|
66
|
+
export const syncChildrenPlaceholders = (flatList, parentId, isLoading, skeletonCount, isError, isNoData) => {
|
|
67
|
+
const parentIndex = flatList.findIndex((item) => item.id === parentId);
|
|
68
|
+
if (parentIndex === -1) {
|
|
69
|
+
return flatList;
|
|
70
|
+
}
|
|
71
|
+
const parent = flatList[parentIndex];
|
|
72
|
+
const existingPlaceholders = flatList.filter((item) => checkIsChildrenPlaceholderOf(item, parentId));
|
|
73
|
+
const realChildren = flatList.some((item) => checkIsDirectChild(item, parentId));
|
|
74
|
+
const kind = resolveChildrenPlaceholderKind(isLoading, Boolean(isError), Boolean(isNoData), realChildren);
|
|
75
|
+
const desiredCount = getPlaceholderCount(kind, skeletonCount);
|
|
76
|
+
const samePlaceholders = existingPlaceholders.length === desiredCount &&
|
|
77
|
+
existingPlaceholders.every((item) => item.placeholderKind === kind);
|
|
78
|
+
if (samePlaceholders) {
|
|
79
|
+
return flatList;
|
|
80
|
+
}
|
|
81
|
+
const withoutPlaceholders = flatList.filter((item) => !checkIsChildrenPlaceholderOf(item, parentId));
|
|
82
|
+
if (!kind) {
|
|
83
|
+
return withoutPlaceholders;
|
|
84
|
+
}
|
|
85
|
+
const nextParentIndex = withoutPlaceholders.findIndex((item) => item.id === parentId);
|
|
86
|
+
const nestedItems = getNestedItems(withoutPlaceholders, parentId);
|
|
87
|
+
const insertIndex = nextParentIndex + 1 + nestedItems.length;
|
|
88
|
+
const realDirectCount = countDirectChildren(withoutPlaceholders, parentId);
|
|
89
|
+
const placeholders = Array.from({ length: desiredCount }, (_, index) => createChildrenPlaceholder(parent, {
|
|
90
|
+
kind,
|
|
91
|
+
index,
|
|
92
|
+
siblingIndex: realDirectCount + index,
|
|
93
|
+
}));
|
|
94
|
+
return [
|
|
95
|
+
...withoutPlaceholders.slice(0, insertIndex),
|
|
96
|
+
...placeholders,
|
|
97
|
+
...withoutPlaceholders.slice(insertIndex),
|
|
98
|
+
];
|
|
99
|
+
};
|
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
import type { InfiniteTreeListData, InfiniteTreeListProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Виртуализированное дерево с бесконечной подгрузкой
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <InfiniteTreeList
|
|
7
|
+
* items={items}
|
|
8
|
+
* scrollRef={scrollRef}
|
|
9
|
+
* onRetry={refetch}
|
|
10
|
+
* renderItem={(item) => (
|
|
11
|
+
* <InfiniteTreeListItem>{item.name}</InfiniteTreeListItem>
|
|
12
|
+
* )}
|
|
13
|
+
* renderParent={(item) => (
|
|
14
|
+
* <InfiniteTreeListItem childItems={childrenState[item.id]?.data}>
|
|
15
|
+
* {item.name}
|
|
16
|
+
* </InfiniteTreeListItem>
|
|
17
|
+
* )}
|
|
18
|
+
* />
|
|
19
|
+
*/
|
|
2
20
|
export declare const InfiniteTreeList: <TData extends InfiniteTreeListData<TData>>(props: InfiniteTreeListProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,30 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InfiniteTreeList = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// cspell:ignore Виртуализированное
|
|
5
6
|
const react_virtuoso_1 = require("react-virtuoso");
|
|
6
7
|
const ContentState_1 = require("../ContentState");
|
|
7
|
-
const Loader_1 = require("../Loader");
|
|
8
|
-
const constants_1 = require("./constants");
|
|
9
|
-
const EndData_1 = require("./EndData");
|
|
10
|
-
const ErrorMessage_1 = require("./ErrorMessage");
|
|
11
8
|
const InfiniteTreeListContext_1 = require("./InfiniteTreeListContext");
|
|
12
|
-
const
|
|
9
|
+
const ListFooter_1 = require("./ListFooter");
|
|
13
10
|
const NoDataPlaceholder_1 = require("./NoDataPlaceholder");
|
|
14
11
|
const OnTopButton_1 = require("./OnTopButton");
|
|
15
|
-
const
|
|
12
|
+
const ParentItems_1 = require("./ParentItems");
|
|
16
13
|
const TreeItem_1 = require("./TreeItem");
|
|
17
14
|
const useLogic_1 = require("./useLogic");
|
|
15
|
+
const computeItemKey = (_, item) => item.id;
|
|
16
|
+
/**
|
|
17
|
+
* Виртуализированное дерево с бесконечной подгрузкой
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <InfiniteTreeList
|
|
21
|
+
* items={items}
|
|
22
|
+
* scrollRef={scrollRef}
|
|
23
|
+
* onRetry={refetch}
|
|
24
|
+
* renderItem={(item) => (
|
|
25
|
+
* <InfiniteTreeListItem>{item.name}</InfiniteTreeListItem>
|
|
26
|
+
* )}
|
|
27
|
+
* renderParent={(item) => (
|
|
28
|
+
* <InfiniteTreeListItem childItems={childrenState[item.id]?.data}>
|
|
29
|
+
* {item.name}
|
|
30
|
+
* </InfiniteTreeListItem>
|
|
31
|
+
* )}
|
|
32
|
+
* />
|
|
33
|
+
*/
|
|
18
34
|
const InfiniteTreeList = (props) => {
|
|
19
|
-
const { flatList, onToggle, contentStateProps, scrollParent, virtuosoProps,
|
|
20
|
-
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(InfiniteTreeListContext_1.InfiniteTreeListContextProvider, { itemSkeleton: itemSkeleton, children: (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, children: items.length && scrollParent ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { ...virtuosoProps, data: flatList, customScrollParent: scrollParent, endReached: onLoadMore, itemContent: renderItemContent, computeItemKey: (_, item) => item.id, components: {
|
|
22
|
-
Footer: () => {
|
|
23
|
-
const { isLoading, isError, isEndReached } = footerProps;
|
|
24
|
-
if (!isLoading && !isError && !isEndReached) {
|
|
25
|
-
return (0, jsx_runtime_1.jsx)(styles_1.FooterDummy, {});
|
|
26
|
-
}
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Footer, { children: [isLoading && (0, jsx_runtime_1.jsx)(Loader_1.Loader, {}), isError && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { onRetry: onRetry }), isEndReached && ((0, jsx_runtime_1.jsx)(EndData_1.EndData, { endOfScrollMsg: endOfScrollMsg }))] }));
|
|
28
|
-
},
|
|
29
|
-
}, overscan: constants_1.OVERSCAN }), (0, jsx_runtime_1.jsx)(OnTopButton_1.OnTopButton, { ...onTopButtonProps })] })) : ((0, jsx_runtime_1.jsx)(NoDataPlaceholder_1.NoDataPlaceholder, { noDataImgSrc: noDataImgSrc })) }) }));
|
|
35
|
+
const { flatList, onToggle, contentStateProps, scrollParent, virtuosoProps, footerContext, onTopButtonProps, renderItem, renderParent, items, itemSkeleton, onRetry, noDataImgSrc, enterAnimation, tailRegistry, nodePaginationMap, registerChildren, notifyExpand, parentItems, acquireParentSlot, } = (0, useLogic_1.useLogic)(props);
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(InfiniteTreeListContext_1.InfiniteTreeListContextProvider, { itemSkeleton: itemSkeleton, nodePaginationMap: nodePaginationMap, registerChildren: registerChildren, notifyExpand: notifyExpand, onListRetry: onRetry, enterAnimation: enterAnimation, tailRegistry: tailRegistry, renderItem: renderItem, renderParent: renderParent, onToggle: onToggle, acquireParentSlot: acquireParentSlot, children: [(0, jsx_runtime_1.jsx)(ParentItems_1.ParentItems, { parents: parentItems }), (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, children: items.length > 0 && scrollParent ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { ...virtuosoProps, data: flatList, customScrollParent: scrollParent, computeItemKey: computeItemKey, context: footerContext, components: { Item: TreeItem_1.TreeItem, Footer: ListFooter_1.ListFooter } }), (0, jsx_runtime_1.jsx)(OnTopButton_1.OnTopButton, { ...onTopButtonProps })] })) : ((0, jsx_runtime_1.jsx)(NoDataPlaceholder_1.NoDataPlaceholder, { noDataImgSrc: noDataImgSrc })) })] }));
|
|
30
37
|
};
|
|
31
38
|
exports.InfiniteTreeList = InfiniteTreeList;
|
package/node/components/InfiniteTreeList/InfiniteTreeListActions/InfiniteTreeListActions.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import type { InfiniteTreeListActionProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Действия строки дерева. Блокирующее действие в состоянии загрузки блокирует
|
|
4
|
+
* строку вместе со всей её веткой
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <InfiniteTreeListActions
|
|
8
|
+
* actions={{ main: [{ name: 'Изменить', onClick: handleEdit }] }}
|
|
9
|
+
* />
|
|
10
|
+
*/
|
|
2
11
|
export declare const InfiniteTreeListActions: <TItem>({ actions, }: InfiniteTreeListActionProps<TItem>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,6 +4,15 @@ exports.InfiniteTreeListActions = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const ActionCellBase_1 = require("../../ActionCellBase");
|
|
6
6
|
const useLogic_1 = require("./useLogic");
|
|
7
|
+
/**
|
|
8
|
+
* Действия строки дерева. Блокирующее действие в состоянии загрузки блокирует
|
|
9
|
+
* строку вместе со всей её веткой
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <InfiniteTreeListActions
|
|
13
|
+
* actions={{ main: [{ name: 'Изменить', onClick: handleEdit }] }}
|
|
14
|
+
* />
|
|
15
|
+
*/
|
|
7
16
|
const InfiniteTreeListActions = ({ actions, }) => {
|
|
8
17
|
const { isDisabledAction, handleWrapperClick, handleActionClick } = (0, useLogic_1.useLogic)({
|
|
9
18
|
actions,
|
|
@@ -10,17 +10,16 @@ const useLogic = ({ actions }) => {
|
|
|
10
10
|
const { setDisabled } = (0, react_1.useContext)(InfiniteTreeListContext_1.InfiniteTreeListContext);
|
|
11
11
|
const blockingAction = (0, react_1.useMemo)(() => [...main, ...secondary].find((action) => action.isBlockingOperation && action.loading), [main, secondary]);
|
|
12
12
|
const isDisabledAction = Boolean(blockingAction);
|
|
13
|
+
const loadingNote = blockingAction?.loadingNote;
|
|
13
14
|
(0, react_1.useEffect)(() => {
|
|
14
|
-
if (
|
|
15
|
-
// Добавляем id элемента в Set disabled элементов
|
|
15
|
+
if (isDisabledAction) {
|
|
16
16
|
setDisabled(item.id, true);
|
|
17
|
-
setDisabledReason(
|
|
17
|
+
setDisabledReason(loadingNote);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
// Удаляем id элемента из Set disabled элементов
|
|
21
20
|
setDisabled(item.id, false);
|
|
22
|
-
setDisabledReason(
|
|
23
|
-
}, [
|
|
21
|
+
setDisabledReason(undefined);
|
|
22
|
+
}, [isDisabledAction, loadingNote, item.id]);
|
|
24
23
|
const handleActionClick = (0, react_1.useCallback)((onClick) => () => {
|
|
25
24
|
onClick?.(item);
|
|
26
25
|
}, [item]);
|
package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts
CHANGED
|
@@ -1,7 +1,88 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import type { EnterAnimationResult } from '../hooks';
|
|
3
|
+
import type { FlattenTree, InfiniteTreeChildrenPagination, InfiniteTreeListData } from '../types';
|
|
4
|
+
import type { TailRegistry } from '../utils';
|
|
5
|
+
export type NodePagination = {
|
|
6
|
+
/**
|
|
7
|
+
* ID последнего загруженного дочернего элемента узла
|
|
8
|
+
*/
|
|
9
|
+
lastChildId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Все дочерние данные узла загружены
|
|
12
|
+
*/
|
|
13
|
+
isEndReached?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Дочерние элементы узла загружаются
|
|
16
|
+
*/
|
|
17
|
+
isChildrenLoading?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Загрузка дочерних элементов завершилась ошибкой
|
|
20
|
+
*/
|
|
21
|
+
isChildrenError?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type NodeChildrenCallbacks = {
|
|
24
|
+
/**
|
|
25
|
+
* Обработчик подгрузки данных
|
|
26
|
+
*/
|
|
27
|
+
onLoadMore?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Функция обработки нажатия на кнопку "Повторить запрос"
|
|
30
|
+
*/
|
|
31
|
+
onRetry?: () => void;
|
|
32
|
+
};
|
|
2
33
|
export type InfiniteTreeListContextProps = {
|
|
34
|
+
/**
|
|
35
|
+
* Рендер-функция строки
|
|
36
|
+
*/
|
|
37
|
+
renderItem: (item: FlattenTree<InfiniteTreeListData>) => ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Рендер-функция строки узла с подгружаемыми дочерними элементами
|
|
40
|
+
*/
|
|
41
|
+
renderParent: (item: FlattenTree<InfiniteTreeListData>) => ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Переключает раскрытие узла
|
|
44
|
+
*/
|
|
45
|
+
onToggle: (item: InfiniteTreeListData) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Строка в состоянии загрузки
|
|
48
|
+
*/
|
|
3
49
|
itemSkeleton: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Id заблокированных узлов
|
|
52
|
+
*/
|
|
4
53
|
disabledIdList: Set<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Отмечает узел заблокированным или снимает отметку
|
|
56
|
+
*/
|
|
5
57
|
setDisabled: (itemId: string, disabled: boolean) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Данные пагинации узлов по parentId
|
|
60
|
+
*/
|
|
61
|
+
nodePaginationMap: Record<string, NodePagination>;
|
|
62
|
+
/**
|
|
63
|
+
* Регистрирует callback-функции загрузки дочерних элементов узла
|
|
64
|
+
*/
|
|
65
|
+
registerChildrenCallbacks: (itemId: string, callbacks: NodeChildrenCallbacks) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Передаёт состояние загрузки дочерних элементов в список. Список
|
|
68
|
+
* синхронизирует плоский список
|
|
69
|
+
*/
|
|
70
|
+
registerChildren: (itemId: string, childrenState: InfiniteTreeChildrenPagination) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Оповещает список о раскрытии узла
|
|
73
|
+
*/
|
|
74
|
+
notifyExpand: (itemId: string, onOpen?: () => void) => void;
|
|
75
|
+
onLoadMore: (parentId: string) => void;
|
|
76
|
+
onRetry: (parentId: string) => void;
|
|
77
|
+
enterAnimation: EnterAnimationResult;
|
|
78
|
+
/**
|
|
79
|
+
* Реестр хвостов вложенных веток. Переживает размонтирование строки
|
|
80
|
+
*/
|
|
81
|
+
tailRegistry: TailRegistry;
|
|
82
|
+
/**
|
|
83
|
+
* Отдаёт постоянный DOM-контейнер строки узла: строка монтируется вне
|
|
84
|
+
* виртуализации, а её контейнер переносится в строку скролла
|
|
85
|
+
*/
|
|
86
|
+
acquireParentSlot: (itemId: string) => HTMLDivElement | null;
|
|
6
87
|
};
|
|
7
88
|
export declare const InfiniteTreeListContext: import("react").Context<InfiniteTreeListContextProps>;
|
|
@@ -3,7 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InfiniteTreeListContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
exports.InfiniteTreeListContext = (0, react_1.createContext)({
|
|
6
|
+
renderItem: () => null,
|
|
7
|
+
renderParent: () => null,
|
|
8
|
+
onToggle: () => undefined,
|
|
6
9
|
itemSkeleton: '',
|
|
7
10
|
disabledIdList: new Set(),
|
|
8
11
|
setDisabled: () => undefined,
|
|
12
|
+
nodePaginationMap: {},
|
|
13
|
+
registerChildrenCallbacks: () => undefined,
|
|
14
|
+
registerChildren: () => undefined,
|
|
15
|
+
notifyExpand: () => undefined,
|
|
16
|
+
onLoadMore: () => undefined,
|
|
17
|
+
onRetry: () => undefined,
|
|
18
|
+
enterAnimation: {
|
|
19
|
+
schedule: () => undefined,
|
|
20
|
+
read: () => ({ shouldAnimate: false }),
|
|
21
|
+
claim: () => undefined,
|
|
22
|
+
reset: () => undefined,
|
|
23
|
+
},
|
|
24
|
+
tailRegistry: {
|
|
25
|
+
register: () => undefined,
|
|
26
|
+
unregister: () => undefined,
|
|
27
|
+
checkRange: () => undefined,
|
|
28
|
+
},
|
|
29
|
+
acquireParentSlot: () => null,
|
|
9
30
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type InfiniteTreeListContextProps } from '../InfiniteTreeListContext';
|
|
3
|
-
type Props = Pick<InfiniteTreeListContextProps, 'itemSkeleton'> & {
|
|
3
|
+
type Props = Pick<InfiniteTreeListContextProps, 'itemSkeleton' | 'nodePaginationMap' | 'enterAnimation' | 'tailRegistry' | 'registerChildren' | 'notifyExpand' | 'renderItem' | 'renderParent' | 'onToggle' | 'acquireParentSlot'> & {
|
|
4
4
|
children: ReactNode;
|
|
5
|
+
onListRetry: () => void;
|
|
5
6
|
};
|
|
6
|
-
export declare const InfiniteTreeListContextProvider: ({ children, itemSkeleton, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const InfiniteTreeListContextProvider: ({ children, itemSkeleton, nodePaginationMap, onListRetry, registerChildren, notifyExpand, enterAnimation, tailRegistry, renderItem, renderParent, onToggle, acquireParentSlot, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|