@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { InfiniteTreeListData } from '../types';
|
|
2
3
|
export type InfiniteTreeListItemProps = {
|
|
3
4
|
children: ReactNode;
|
|
4
5
|
/**
|
|
@@ -10,15 +11,23 @@ export type InfiniteTreeListItemProps = {
|
|
|
10
11
|
*/
|
|
11
12
|
actions?: ReactNode;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* Загруженные дочерние элементы узла.
|
|
15
|
+
*/
|
|
16
|
+
childItems?: InfiniteTreeListData[];
|
|
17
|
+
/**
|
|
18
|
+
* Флаг достижения конца списка
|
|
19
|
+
*/
|
|
20
|
+
isEndReached?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Флаг ошибки загрузки дочерних элементов узла
|
|
14
23
|
*/
|
|
15
24
|
isError?: boolean;
|
|
16
25
|
/**
|
|
17
|
-
*
|
|
26
|
+
* Флаг загрузки дочерних элементов
|
|
18
27
|
*/
|
|
19
28
|
isLoading?: boolean;
|
|
20
29
|
/**
|
|
21
|
-
*
|
|
30
|
+
* Элемент заблокирован для взаимодействия
|
|
22
31
|
*/
|
|
23
32
|
isDisabled?: boolean;
|
|
24
33
|
/**
|
|
@@ -33,4 +42,12 @@ export type InfiniteTreeListItemProps = {
|
|
|
33
42
|
* Текст ошибки
|
|
34
43
|
*/
|
|
35
44
|
errorMsg?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Обработчик раскрытия узла
|
|
47
|
+
*/
|
|
48
|
+
onOpen?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Обработчик подгрузки данных
|
|
51
|
+
*/
|
|
52
|
+
onLoadMore?: () => void;
|
|
36
53
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type MouseEvent } from 'react';
|
|
2
2
|
import { type TooltipProps } from '../../../Tooltip';
|
|
3
3
|
import { type InfiniteTreeListItemProps } from '../types';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Логика строки: отдаёт списку данные дочерних элементов и callback-функции
|
|
6
|
+
* пагинации, сообщает о раскрытии узла и собирает состояние блокировки строки
|
|
7
|
+
*/
|
|
8
|
+
export declare const useLogic: ({ isDisabled, disabledReason, isLoading, isError, isEndReached, childItems, onOpen, onLoadMore, onRetry, }: InfiniteTreeListItemProps) => {
|
|
5
9
|
item: import("../../types").FlattenTree<import("../../types").InfiniteTreeListData>;
|
|
6
10
|
handleClick: (event: MouseEvent) => void;
|
|
7
11
|
itemSkeleton: import("react").ReactNode;
|
|
@@ -10,4 +14,6 @@ export declare const useLogic: ({ isDisabled, disabledReason, }: InfiniteTreeLis
|
|
|
10
14
|
tooltipProps: Omit<TooltipProps, "children" | "ref">;
|
|
11
15
|
isDisabledByActions: boolean;
|
|
12
16
|
isChevronActive: boolean;
|
|
17
|
+
isRowLoading: boolean;
|
|
18
|
+
isRowError: boolean;
|
|
13
19
|
};
|
|
@@ -1,18 +1,68 @@
|
|
|
1
|
-
import { useCallback, useContext, useEffect, useState, } from 'react';
|
|
1
|
+
import { useCallback, useContext, useEffect, useRef, useState, } from 'react';
|
|
2
2
|
import { InfiniteTreeListContext } from '../../InfiniteTreeListContext';
|
|
3
3
|
import { TreeListItemContext } from '../TreeListItemContext';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Логика строки: отдаёт списку данные дочерних элементов и callback-функции
|
|
6
|
+
* пагинации, сообщает о раскрытии узла и собирает состояние блокировки строки
|
|
7
|
+
*/
|
|
8
|
+
export const useLogic = ({ isDisabled, disabledReason, isLoading, isError, isEndReached, childItems, onOpen, onLoadMore, onRetry, }) => {
|
|
9
|
+
const { itemSkeleton, setDisabled, registerChildrenCallbacks, registerChildren, notifyExpand, } = useContext(InfiniteTreeListContext);
|
|
6
10
|
const { item, onToggle, isDisabled: isDisabledByActions, disabledReason: disabledReasonByActions, } = useContext(TreeListItemContext);
|
|
11
|
+
const isChildrenControl = childItems !== undefined || onLoadMore !== undefined;
|
|
7
12
|
useEffect(() => {
|
|
8
13
|
if (isDisabled) {
|
|
9
14
|
setDisabled(item.id, isDisabled);
|
|
10
15
|
}
|
|
11
16
|
}, [isDisabled]);
|
|
12
|
-
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
registerChildrenCallbacks(item.id, {
|
|
19
|
+
onLoadMore,
|
|
20
|
+
onRetry,
|
|
21
|
+
});
|
|
22
|
+
}, [item.id, onLoadMore, onRetry, registerChildrenCallbacks]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!isChildrenControl) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
registerChildren(item.id, {
|
|
28
|
+
data: childItems ?? [],
|
|
29
|
+
isLoading,
|
|
30
|
+
isError,
|
|
31
|
+
isEndReached,
|
|
32
|
+
});
|
|
33
|
+
}, [
|
|
34
|
+
item.id,
|
|
35
|
+
isChildrenControl,
|
|
36
|
+
childItems,
|
|
37
|
+
isLoading,
|
|
38
|
+
isError,
|
|
39
|
+
isEndReached,
|
|
40
|
+
registerChildren,
|
|
41
|
+
]);
|
|
42
|
+
// onOpen вызывается на раскрытии узла, а не на клике: узел раскрывается и
|
|
43
|
+
// через initialExpandedLevel, где клика не было. Повторные вызовы блокируются
|
|
44
|
+
const onOpenRef = useRef(onOpen);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
onOpenRef.current = onOpen;
|
|
47
|
+
});
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!item.meta.isExpanded) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
notifyExpand(item.id, () => onOpenRef.current?.());
|
|
53
|
+
}, [item.meta.isExpanded, item.id, notifyExpand]);
|
|
54
|
+
const [optimisticExpanded, setOptimisticExpanded] = useState(null);
|
|
55
|
+
const isChevronActive = optimisticExpanded ?? item.meta.isExpanded;
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
setOptimisticExpanded(null);
|
|
58
|
+
}, [item.meta.isExpanded]);
|
|
13
59
|
const handleClick = useCallback((event) => {
|
|
14
60
|
event.stopPropagation();
|
|
15
|
-
|
|
61
|
+
// Лист не раскрывается: клик не должен заводить его в набор раскрытых узлов
|
|
62
|
+
if (!item.meta.hasNested) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
setOptimisticExpanded((prev) => !(prev ?? item.meta.isExpanded));
|
|
16
66
|
onToggle(item);
|
|
17
67
|
}, [item, onToggle]);
|
|
18
68
|
// Omit ref для избежания ошибки типов у Tooltip
|
|
@@ -33,5 +83,7 @@ export const useLogic = ({ isDisabled, disabledReason, }) => {
|
|
|
33
83
|
tooltipProps,
|
|
34
84
|
isDisabledByActions,
|
|
35
85
|
isChevronActive,
|
|
86
|
+
isRowLoading: Boolean(isLoading && !isChildrenControl),
|
|
87
|
+
isRowError: Boolean(isError && !isChildrenControl),
|
|
36
88
|
};
|
|
37
89
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Typography } from '
|
|
2
|
+
import { Typography } from '../../../Typography';
|
|
3
3
|
import { END_OF_SCROLL_MESSAGE } from './constants';
|
|
4
4
|
export const EndData = ({ endOfScrollMsg = END_OF_SCROLL_MESSAGE }) => (_jsx(Typography, { children: endOfScrollMsg }));
|
package/components/InfiniteTreeList/{ErrorMessage → ListFooter/ErrorMessage}/ErrorMessage.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Typography } from '
|
|
2
|
+
import { Button } from '../../../Button';
|
|
3
|
+
import { Typography } from '../../../Typography';
|
|
4
4
|
import { ERROR_MESSAGE } from './constants';
|
|
5
5
|
import { Wrapper } from './styles';
|
|
6
6
|
export const ErrorMessage = ({ onRetry }) => (_jsxs(Wrapper, { children: [_jsx(Typography, { align: "center", children: ERROR_MESSAGE }), _jsx(Button, { onClick: onRetry, children: "\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430" })] }));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("../../../styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ContextProp } from 'react-virtuoso';
|
|
2
|
+
import type { ListFooterContext } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Футер списка для Virtuoso.
|
|
5
|
+
*
|
|
6
|
+
* Вынесен в модуль и передаётся в `components.Footer`: inline-компонент в
|
|
7
|
+
* `components` на каждый рендер даёт новый тип, и React размонтирует футер.
|
|
8
|
+
* Данные приходят через `context` Virtuoso
|
|
9
|
+
*/
|
|
10
|
+
export declare const ListFooter: ({ context }: ContextProp<ListFooterContext>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Loader } from '../../Loader';
|
|
3
|
+
import { EndData } from './EndData';
|
|
4
|
+
import { ErrorMessage } from './ErrorMessage';
|
|
5
|
+
import { Footer, FooterDummy } from './styles';
|
|
6
|
+
/**
|
|
7
|
+
* Футер списка для Virtuoso.
|
|
8
|
+
*
|
|
9
|
+
* Вынесен в модуль и передаётся в `components.Footer`: inline-компонент в
|
|
10
|
+
* `components` на каждый рендер даёт новый тип, и React размонтирует футер.
|
|
11
|
+
* Данные приходят через `context` Virtuoso
|
|
12
|
+
*/
|
|
13
|
+
export const ListFooter = ({ context }) => {
|
|
14
|
+
const { isLoading, isError, isEndReached, endOfScrollMsg, onRetry } = context;
|
|
15
|
+
if (isLoading) {
|
|
16
|
+
return (_jsx(Footer, { children: _jsx(Loader, {}) }));
|
|
17
|
+
}
|
|
18
|
+
if (isError) {
|
|
19
|
+
return (_jsx(Footer, { children: _jsx(ErrorMessage, { onRetry: onRetry }) }));
|
|
20
|
+
}
|
|
21
|
+
if (isEndReached) {
|
|
22
|
+
return (_jsx(Footer, { children: _jsx(EndData, { endOfScrollMsg: endOfScrollMsg }) }));
|
|
23
|
+
}
|
|
24
|
+
return _jsx(FooterDummy, {});
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListFooter';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const Footer: import("
|
|
2
|
+
export declare const Footer: import("../../styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
6
|
-
export declare const FooterDummy: import("
|
|
6
|
+
export declare const FooterDummy: import("../../styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ListFooterContext = {
|
|
2
|
+
/**
|
|
3
|
+
* Флаг состояния загрузки
|
|
4
|
+
*/
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Флаг состояния ошибки
|
|
8
|
+
*/
|
|
9
|
+
isError?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Флаг достижения конца списка
|
|
12
|
+
*/
|
|
13
|
+
isEndReached?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Сообщение, отображаемое при достижении конца списка
|
|
16
|
+
*/
|
|
17
|
+
endOfScrollMsg?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Функция обработки нажатия на кнопку "Повторить запрос"
|
|
20
|
+
*/
|
|
21
|
+
onRetry: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
type Props = {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Контейнер со скроллом
|
|
5
|
+
*/
|
|
4
6
|
scrollRef: RefObject<HTMLElement | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Ref кнопки. Скролл списка переключает её видимость через classname
|
|
9
|
+
*/
|
|
10
|
+
buttonRef: RefObject<HTMLButtonElement | null>;
|
|
5
11
|
handleScrollToTop: () => void;
|
|
6
12
|
};
|
|
7
|
-
export declare const OnTopButton: ({
|
|
13
|
+
export declare const OnTopButton: ({ scrollRef, buttonRef, handleScrollToTop, }: Props) => import("react").ReactPortal | null;
|
|
8
14
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { infiniteTreeListClassnames } from '../constants';
|
|
4
|
+
import { StyledScrollToTopButton } from './styles';
|
|
5
|
+
export const OnTopButton = ({ scrollRef, buttonRef, handleScrollToTop, }) => {
|
|
5
6
|
const parentElement = scrollRef?.current?.parentElement;
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
7
|
+
if (!parentElement) {
|
|
8
|
+
return null;
|
|
8
9
|
}
|
|
9
|
-
return
|
|
10
|
+
return createPortal(_jsx(StyledScrollToTopButton, { ref: buttonRef, className: infiniteTreeListClassnames.scrollToTopButton, onClick: handleScrollToTop }), parentElement);
|
|
10
11
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledScrollToTopButton: import("../../styled").StyledComponent<import("../../ScrollToTopButton").ScrollToTopButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ScrollToTopButton } from '../../ScrollToTopButton';
|
|
2
|
+
import { styled } from '../../styled';
|
|
3
|
+
import { infiniteTreeListClassnames } from '../constants';
|
|
4
|
+
export const StyledScrollToTopButton = styled(ScrollToTopButton) `
|
|
5
|
+
display: none;
|
|
6
|
+
|
|
7
|
+
&.${infiniteTreeListClassnames.visibleScrollToTopButton} {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
}
|
|
10
|
+
`;
|
package/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/CustomParentWrapper.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../../types';
|
|
3
|
+
type CustomParentWrapperProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Строка узла с подгружаемыми дочерними элементами
|
|
6
|
+
*/
|
|
7
|
+
item: FlattenTree<InfiniteTreeListData>;
|
|
8
|
+
/**
|
|
9
|
+
* Рендер-функция строки родителя из props списка
|
|
10
|
+
*/
|
|
11
|
+
renderParent: (item: FlattenTree<InfiniteTreeListData>) => ReactNode;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* То же, что `CustomItemWrapper`, но для узлов с подгружаемыми дочерними
|
|
15
|
+
* элементами.
|
|
16
|
+
*
|
|
17
|
+
* Отдельный компонент, а не ветка внутри `CustomItemWrapper`: хуки из
|
|
18
|
+
* `renderItem` и `renderParent` ложатся в hook-list вызвавшего компонента, и
|
|
19
|
+
* смена ветки меняла бы их количество между рендерами — React упал бы с
|
|
20
|
+
* `Rendered fewer hooks than expected`
|
|
21
|
+
*/
|
|
22
|
+
export declare const CustomParentWrapper: import("react").MemoExoticComponent<({ item, renderParent }: CustomParentWrapperProps) => import("react/jsx-runtime").JSX.Element>;
|
|
23
|
+
export {};
|
package/components/InfiniteTreeList/ParentItems/Item/CustomParentWrapper/CustomParentWrapper.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* То же, что `CustomItemWrapper`, но для узлов с подгружаемыми дочерними
|
|
5
|
+
* элементами.
|
|
6
|
+
*
|
|
7
|
+
* Отдельный компонент, а не ветка внутри `CustomItemWrapper`: хуки из
|
|
8
|
+
* `renderItem` и `renderParent` ложатся в hook-list вызвавшего компонента, и
|
|
9
|
+
* смена ветки меняла бы их количество между рендерами — React упал бы с
|
|
10
|
+
* `Rendered fewer hooks than expected`
|
|
11
|
+
*/
|
|
12
|
+
export const CustomParentWrapper = memo(({ item, renderParent }) => (_jsx(_Fragment, { children: renderParent(item) })));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomParentWrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomParentWrapper';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ItemProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Строка одного узла с подгружаемыми дочерними элементами.
|
|
5
|
+
*
|
|
6
|
+
* В строке виртуализации не живёт: рисуется порталом в свой постоянный
|
|
7
|
+
* контейнер, а контейнер `TreeItem` переносит в строку скролла, пока узел на
|
|
8
|
+
* экране
|
|
9
|
+
*/
|
|
10
|
+
export declare const Item: import("react").MemoExoticComponent<(props: ItemProps) => import("react").ReactPortal | null>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { infiniteTreeListClassnames } from '../../constants';
|
|
5
|
+
import { TreeListItemContextProvider } from '../../InfiniteTreeListItem';
|
|
6
|
+
import { Wrapper } from '../../TreeItem/styles';
|
|
7
|
+
import { CustomParentWrapper } from './CustomParentWrapper';
|
|
8
|
+
import { useLogic } from './useLogic';
|
|
9
|
+
/**
|
|
10
|
+
* Строка одного узла с подгружаемыми дочерними элементами.
|
|
11
|
+
*
|
|
12
|
+
* В строке виртуализации не живёт: рисуется порталом в свой постоянный
|
|
13
|
+
* контейнер, а контейнер `TreeItem` переносит в строку скролла, пока узел на
|
|
14
|
+
* экране
|
|
15
|
+
*/
|
|
16
|
+
export const Item = memo((props) => {
|
|
17
|
+
const { nodeId, slot, cssVars, parent, renderParent, onToggle } = useLogic(props);
|
|
18
|
+
if (!slot) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return createPortal(_jsx(TreeListItemContextProvider, { item: parent, onToggle: onToggle, children: _jsx(Wrapper, { id: nodeId, className: infiniteTreeListClassnames.row, style: cssVars, children: _jsx(CustomParentWrapper, { item: parent, renderParent: renderParent }) }) }), slot);
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type ItemProps } from '../types';
|
|
3
|
+
type UseLogicParams = ItemProps;
|
|
4
|
+
export declare const useLogic: ({ parent }: UseLogicParams) => {
|
|
5
|
+
slot: HTMLDivElement | null;
|
|
6
|
+
nodeId: string;
|
|
7
|
+
cssVars: CSSProperties;
|
|
8
|
+
parent: import("../../../types").FlattenTree<import("../../../types").InfiniteTreeListData>;
|
|
9
|
+
renderParent: (item: import("../../../types").FlattenTree<import("../../../types").InfiniteTreeListData>) => import("react").ReactNode;
|
|
10
|
+
onToggle: (item: import("../../../types").InfiniteTreeListData) => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { InfiniteTreeListContext } from '../../../InfiniteTreeListContext';
|
|
3
|
+
export const useLogic = ({ parent }) => {
|
|
4
|
+
const { renderParent, onToggle, acquireParentSlot } = useContext(InfiniteTreeListContext);
|
|
5
|
+
const slot = acquireParentSlot(parent.id);
|
|
6
|
+
const { nodeId, level, siblingIndex } = parent.meta;
|
|
7
|
+
const cssVars = {
|
|
8
|
+
'--level': level,
|
|
9
|
+
'--sibling-index': siblingIndex,
|
|
10
|
+
};
|
|
11
|
+
return { slot, nodeId, cssVars, parent, renderParent, onToggle };
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InfiniteTreeListData } from '../types';
|
|
2
|
+
import type { ParentItemsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Постоянный слой строк узлов с подгружаемыми дочерними элементами.
|
|
5
|
+
*
|
|
6
|
+
* Разметки на своём месте не даёт: каждая строка рисуется порталом в свой
|
|
7
|
+
* контейнер, а виртуализация переносит контейнер в строку скролла. Строка
|
|
8
|
+
* монтируется один раз, поэтому её состояние переживает и уход со скролла, и
|
|
9
|
+
* сворачивание ветки
|
|
10
|
+
*/
|
|
11
|
+
export declare const ParentItems: <TData extends InfiniteTreeListData<TData>>({ parents, }: ParentItemsProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Item } from './Item';
|
|
3
|
+
/**
|
|
4
|
+
* Постоянный слой строк узлов с подгружаемыми дочерними элементами.
|
|
5
|
+
*
|
|
6
|
+
* Разметки на своём месте не даёт: каждая строка рисуется порталом в свой
|
|
7
|
+
* контейнер, а виртуализация переносит контейнер в строку скролла. Строка
|
|
8
|
+
* монтируется один раз, поэтому её состояние переживает и уход со скролла, и
|
|
9
|
+
* сворачивание ветки
|
|
10
|
+
*/
|
|
11
|
+
export const ParentItems = ({ parents, }) => (_jsx(_Fragment, { children: parents.map((parent) => (_jsx(Item, { parent: parent }, parent.id))) }));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FlattenTree, InfiniteTreeListData } from '../types';
|
|
2
|
+
export type ParentItemsProps<TData extends InfiniteTreeListData<TData>> = {
|
|
3
|
+
/**
|
|
4
|
+
* Узлы с подгружаемыми дочерними элементами, строки которых держатся
|
|
5
|
+
* смонтированными
|
|
6
|
+
*/
|
|
7
|
+
parents: FlattenTree<TData>[];
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../types';
|
|
2
|
+
type ChildrenPlaceholderProps<TData extends InfiniteTreeListData<TData>> = {
|
|
3
|
+
/**
|
|
4
|
+
* Строка ветки с заполненным `placeholderKind`
|
|
5
|
+
*/
|
|
6
|
+
item: FlattenTree<TData>;
|
|
7
|
+
};
|
|
8
|
+
export declare const ChildrenPlaceholder: <TData extends InfiniteTreeListData<TData>>({ item, }: ChildrenPlaceholderProps<TData>) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { Loader } from '../../../Loader';
|
|
4
|
+
import { InfiniteTreeListContext } from '../../InfiniteTreeListContext';
|
|
5
|
+
import { InfiniteTreeListItem } from '../../InfiniteTreeListItem';
|
|
6
|
+
import { NoDataRow } from './NoDataRow';
|
|
7
|
+
export const ChildrenPlaceholder = ({ item, }) => {
|
|
8
|
+
const { onRetry } = useContext(InfiniteTreeListContext);
|
|
9
|
+
const { parentId } = item.meta;
|
|
10
|
+
switch (item.placeholderKind) {
|
|
11
|
+
case 'spinner':
|
|
12
|
+
return _jsx(Loader, {});
|
|
13
|
+
case 'skeleton':
|
|
14
|
+
return _jsx(InfiniteTreeListItem, { isLoading: true, children: null });
|
|
15
|
+
case 'no-data':
|
|
16
|
+
return _jsx(NoDataRow, {});
|
|
17
|
+
case 'error':
|
|
18
|
+
return (_jsx(InfiniteTreeListItem, { isError: true, onRetry: () => parentId && onRetry(parentId), children: null }));
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NoDataRow: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from '../../../../Typography';
|
|
3
|
+
import { CHILDREN_NO_DATA_MSG } from '../../../constants';
|
|
4
|
+
import { InfiniteTreeListItem } from '../../../InfiniteTreeListItem';
|
|
5
|
+
export const NoDataRow = () => (_jsx(InfiniteTreeListItem, { children: _jsx(Typography, { color: "grey", colorIntensity: "600", children: CHILDREN_NO_DATA_MSG }) }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NoDataRow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NoDataRow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChildrenPlaceholder';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChildrenPlaceholder';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { FlattenTree, InfiniteTreeListData } from '../../types';
|
|
3
|
+
type CustomItemWrapperProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Строка плоского списка
|
|
6
|
+
*/
|
|
7
|
+
item: FlattenTree<InfiniteTreeListData>;
|
|
8
|
+
/**
|
|
9
|
+
* Рендер-функция строки из props списка
|
|
10
|
+
*/
|
|
11
|
+
renderItem: (item: FlattenTree<InfiniteTreeListData>) => ReactNode;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Изолирует `renderItem` потребителя от ре-рендеров строки: без `memo` каждый
|
|
15
|
+
* ре-рендер `Item` пересобирал бы разметку строки заново.
|
|
16
|
+
*
|
|
17
|
+
* Узлы с подгружаемыми дочерними элементами рисует `CustomParentWrapper`
|
|
18
|
+
*/
|
|
19
|
+
export declare const CustomItemWrapper: import("react").MemoExoticComponent<({ item, renderItem }: CustomItemWrapperProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// cspell:ignore пересобирал
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Изолирует `renderItem` потребителя от ре-рендеров строки: без `memo` каждый
|
|
6
|
+
* ре-рендер `Item` пересобирал бы разметку строки заново.
|
|
7
|
+
*
|
|
8
|
+
* Узлы с подгружаемыми дочерними элементами рисует `CustomParentWrapper`
|
|
9
|
+
*/
|
|
10
|
+
export const CustomItemWrapper = memo(({ item, renderItem }) => _jsx(_Fragment, { children: renderItem(item) }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomItemWrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomItemWrapper';
|