@astral/ui 4.105.0 → 4.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ActionCellBase/ActionCellBase.js +10 -1
- package/components/ActionCellBase/MainAction/MainAction.js +6 -0
- package/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
- package/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
- package/components/ActionCellBase/MainAction/MainIconButton/constants.js +4 -0
- package/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
- package/components/ActionCellBase/MainAction/MainIconButton/styles.js +9 -0
- package/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
- package/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +17 -0
- package/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
- package/components/ActionCellBase/MainAction/MobileMainButton/index.js +1 -0
- package/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
- package/components/ActionCellBase/MainAction/MobileMainButton/styles.js +7 -0
- package/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
- package/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
- package/components/ActionCellBase/SecondaryAction/styles.js +9 -0
- package/components/ActionCellBase/constants.d.ts +4 -0
- package/components/ActionCellBase/constants.js +5 -0
- package/components/ActionCellBase/styles.js +11 -0
- package/components/ActionCellBase/types.d.ts +25 -0
- package/components/Autocomplete/Autocomplete.js +2 -3
- package/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
- package/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
- package/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +7 -4
- package/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/index.js +1 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
- package/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +66 -2
- package/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
- package/components/InfiniteTreeList/LevelHeader/LevelHeader.js +17 -0
- package/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
- package/components/InfiniteTreeList/LevelHeader/constants.js +3 -0
- package/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
- package/components/InfiniteTreeList/LevelHeader/index.js +2 -0
- package/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
- package/components/InfiniteTreeList/LevelHeader/styles.js +51 -0
- package/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
- package/components/InfiniteTreeList/LevelHeader/types.js +1 -0
- package/components/InfiniteTreeList/ListFooter/styles.js +8 -0
- package/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
- package/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
- package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
- package/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
- package/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +11 -0
- package/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
- package/components/InfiniteTreeList/TreeItem/styles.js +19 -0
- package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
- package/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +5 -4
- package/components/InfiniteTreeList/constants.d.ts +21 -0
- package/components/InfiniteTreeList/constants.js +21 -0
- package/components/InfiniteTreeList/hooks/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
- package/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
- package/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +48 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +3 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +42 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +27 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
- package/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +39 -0
- package/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
- package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
- package/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +192 -28
- package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
- package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +6 -0
- package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
- package/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +1 -0
- package/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
- package/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +1 -0
- package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
- package/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +2 -0
- package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
- package/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +1 -0
- package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
- package/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +18 -0
- package/components/InfiniteTreeList/styles.d.ts +5 -0
- package/components/InfiniteTreeList/styles.js +41 -0
- package/components/InfiniteTreeList/types.d.ts +4 -0
- package/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
- package/components/InfiniteTreeList/useLogic/useLogic.js +165 -27
- package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
- package/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +4 -0
- package/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +1 -0
- package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
- package/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +5 -0
- package/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/checkHasNested/index.js +1 -0
- package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
- package/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
- package/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
- package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
- package/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +5 -0
- package/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
- package/components/InfiniteTreeList/utils/getLevelKey/index.js +1 -0
- package/components/InfiniteTreeList/utils/index.d.ts +3 -0
- package/components/InfiniteTreeList/utils/index.js +3 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
- package/components/Select/Select.js +4 -3
- package/components/Select/useLogic/useLogic.d.ts +11 -2
- package/components/Select/useLogic/useLogic.js +4 -1
- package/components/TagsList/PopoverTags/PopoverTags.d.ts +7 -0
- package/components/TagsList/PopoverTags/PopoverTags.js +8 -0
- package/components/TagsList/PopoverTags/index.d.ts +2 -0
- package/components/TagsList/PopoverTags/index.js +2 -0
- package/components/TagsList/PopoverTags/styles.d.ts +8 -0
- package/components/TagsList/PopoverTags/styles.js +15 -0
- package/components/TagsList/PopoverTags/types.d.ts +24 -0
- package/components/TagsList/PopoverTags/types.js +1 -0
- package/components/TagsList/Tag/Tag.d.ts +9 -1
- package/components/TagsList/Tag/Tag.js +4 -3
- package/components/TagsList/TagsList.js +11 -5
- package/components/TagsList/constants.d.ts +35 -0
- package/components/TagsList/constants.js +35 -0
- package/components/TagsList/styles.d.ts +9 -1
- package/components/TagsList/styles.js +20 -1
- package/components/TagsList/types.d.ts +4 -0
- package/components/TagsList/useLogic/hooks/index.d.ts +1 -0
- package/components/TagsList/useLogic/hooks/index.js +1 -0
- package/components/TagsList/useLogic/hooks/useHoverDelay/index.d.ts +1 -0
- package/components/TagsList/useLogic/hooks/useHoverDelay/index.js +1 -0
- package/components/TagsList/useLogic/hooks/useHoverDelay/types.d.ts +20 -0
- package/components/TagsList/useLogic/hooks/useHoverDelay/types.js +1 -0
- package/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.d.ts +5 -0
- package/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.js +27 -0
- package/components/TagsList/useLogic/useLogic.d.ts +14 -2
- package/components/TagsList/useLogic/useLogic.js +84 -4
- package/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.d.ts +5 -0
- package/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.js +22 -0
- package/components/TagsList/utils/calculatePopoverWidth/index.d.ts +1 -0
- package/components/TagsList/utils/calculatePopoverWidth/index.js +1 -0
- package/components/TagsList/utils/index.d.ts +1 -0
- package/components/TagsList/utils/index.js +1 -0
- package/components/TreeLikeAsyncAutocomplete/Input/Input.js +3 -2
- package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +3 -2
- package/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +3 -1
- package/components/TreeLikeAutocomplete/Input/Input.js +2 -2
- package/components/TreeLikeAutocomplete/Input/useLogic/useLogic.d.ts +2 -1
- package/components/TreeLikeAutocomplete/Input/useLogic/useLogic.js +3 -1
- package/components/useScrollManagement/useScrollManagement.js +7 -6
- package/node/components/ActionCellBase/ActionCellBase.js +10 -1
- package/node/components/ActionCellBase/MainAction/MainAction.js +6 -0
- package/node/components/ActionCellBase/MainAction/MainIconButton/MainIconButton.js +7 -4
- package/node/components/ActionCellBase/MainAction/MainIconButton/constants.d.ts +3 -0
- package/node/components/ActionCellBase/MainAction/MainIconButton/constants.js +7 -0
- package/node/components/ActionCellBase/MainAction/MainIconButton/styles.d.ts +11 -0
- package/node/components/ActionCellBase/MainAction/MainIconButton/styles.js +12 -0
- package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.d.ts +14 -0
- package/node/components/ActionCellBase/MainAction/MobileMainButton/MobileMainButton.js +21 -0
- package/node/components/ActionCellBase/MainAction/MobileMainButton/index.d.ts +1 -0
- package/node/components/ActionCellBase/MainAction/MobileMainButton/index.js +17 -0
- package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.d.ts +11 -0
- package/node/components/ActionCellBase/MainAction/MobileMainButton/styles.js +10 -0
- package/node/components/ActionCellBase/SecondaryAction/SecondaryAction.js +2 -2
- package/node/components/ActionCellBase/SecondaryAction/styles.d.ts +4 -0
- package/node/components/ActionCellBase/SecondaryAction/styles.js +12 -0
- package/node/components/ActionCellBase/constants.d.ts +4 -0
- package/node/components/ActionCellBase/constants.js +8 -0
- package/node/components/ActionCellBase/styles.js +11 -0
- package/node/components/ActionCellBase/types.d.ts +25 -0
- package/node/components/Autocomplete/Autocomplete.js +2 -3
- package/node/components/InfiniteTreeList/InfiniteTreeList.js +16 -2
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.d.ts +4 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContext.js +1 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.d.ts +2 -2
- package/node/components/InfiniteTreeList/InfiniteTreeListContext/InfiniteTreeListContextProvider/InfiniteTreeListContextProvider.js +3 -1
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/ErrorPlaceholder/styles.js +8 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/InfiniteTreeListItem.js +6 -3
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.d.ts +2 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/constants.js +2 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/index.js +3 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.d.ts +14 -0
- package/node/components/InfiniteTreeList/InfiniteTreeListItem/styles.js +67 -3
- package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.d.ts +5 -0
- package/node/components/InfiniteTreeList/LevelHeader/LevelHeader.js +21 -0
- package/node/components/InfiniteTreeList/LevelHeader/constants.d.ts +3 -0
- package/node/components/InfiniteTreeList/LevelHeader/constants.js +6 -0
- package/node/components/InfiniteTreeList/LevelHeader/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/LevelHeader/index.js +18 -0
- package/node/components/InfiniteTreeList/LevelHeader/styles.d.ts +365 -0
- package/node/components/InfiniteTreeList/LevelHeader/styles.js +54 -0
- package/node/components/InfiniteTreeList/LevelHeader/types.d.ts +14 -0
- package/node/components/InfiniteTreeList/LevelHeader/types.js +2 -0
- package/node/components/InfiniteTreeList/ListFooter/styles.js +8 -0
- package/node/components/InfiniteTreeList/OnTopButton/styles.js +7 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/Item.js +10 -2
- package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.d.ts +1 -0
- package/node/components/InfiniteTreeList/ParentItems/Item/useLogic/useLogic.js +10 -2
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/NoDataRow.js +2 -2
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.d.ts +3 -0
- package/node/components/InfiniteTreeList/TreeItem/ChildrenPlaceholder/NoDataRow/styles.js +14 -0
- package/node/components/InfiniteTreeList/TreeItem/TreeItem.js +6 -3
- package/node/components/InfiniteTreeList/TreeItem/styles.js +19 -0
- package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.d.ts +2 -1
- package/node/components/InfiniteTreeList/TreeItem/useLogic/useLogic.js +4 -3
- package/node/components/InfiniteTreeList/constants.d.ts +21 -0
- package/node/components/InfiniteTreeList/constants.js +22 -1
- package/node/components/InfiniteTreeList/hooks/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/index.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useLevelNavigation/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.d.ts +15 -0
- package/node/components/InfiniteTreeList/hooks/useLevelNavigation/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.d.ts +15 -0
- package/node/components/InfiniteTreeList/hooks/useLevelNavigation/useLevelNavigation.js +52 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.d.ts +3 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/index.js +19 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.d.ts +16 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.d.ts +12 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useLevelSnapshots/useLevelSnapshots.js +46 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.d.ts +12 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.d.ts +15 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useScrollToTopButton/useScrollToTopButton.js +31 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.d.ts +11 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.d.ts +12 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/hooks/useTailWatcher/useTailWatcher.js +43 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/types.d.ts +14 -2
- package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.d.ts +9 -6
- package/node/components/InfiniteTreeList/hooks/useListScroll/useListScroll.js +190 -26
- package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.d.ts +4 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/getOffsetTop.js +10 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/utils/getOffsetTop/index.js +17 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/hooks/useListScroll/utils/index.js +17 -0
- package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.d.ts +2 -0
- package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/index.js +18 -0
- package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.d.ts +14 -0
- package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/types.js +2 -0
- package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.d.ts +5 -0
- package/node/components/InfiniteTreeList/hooks/useNodeTitleValidation/useNodeTitleValidation.js +22 -0
- package/node/components/InfiniteTreeList/styles.d.ts +5 -0
- package/node/components/InfiniteTreeList/styles.js +44 -0
- package/node/components/InfiniteTreeList/types.d.ts +4 -0
- package/node/components/InfiniteTreeList/useLogic/useLogic.d.ts +13 -5
- package/node/components/InfiniteTreeList/useLogic/useLogic.js +162 -24
- package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.d.ts +5 -0
- package/node/components/InfiniteTreeList/utils/checkHasFooterContent/checkHasFooterContent.js +8 -0
- package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkHasFooterContent/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.d.ts +6 -0
- package/node/components/InfiniteTreeList/utils/checkHasNested/checkHasNested.js +9 -0
- package/node/components/InfiniteTreeList/utils/checkHasNested/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/checkHasNested/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.d.ts +8 -3
- package/node/components/InfiniteTreeList/utils/createTailRegistry/createTailRegistry.js +30 -12
- package/node/components/InfiniteTreeList/utils/flattenTree/flattenTree.js +2 -1
- package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.d.ts +4 -0
- package/node/components/InfiniteTreeList/utils/getLevelKey/getLevelKey.js +9 -0
- package/node/components/InfiniteTreeList/utils/getLevelKey/index.d.ts +1 -0
- package/node/components/InfiniteTreeList/utils/getLevelKey/index.js +17 -0
- package/node/components/InfiniteTreeList/utils/index.d.ts +3 -0
- package/node/components/InfiniteTreeList/utils/index.js +3 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
- package/node/components/Select/Select.js +4 -3
- package/node/components/Select/useLogic/useLogic.d.ts +11 -2
- package/node/components/Select/useLogic/useLogic.js +4 -1
- package/node/components/TagsList/PopoverTags/PopoverTags.d.ts +7 -0
- package/node/components/TagsList/PopoverTags/PopoverTags.js +12 -0
- package/node/components/TagsList/PopoverTags/index.d.ts +2 -0
- package/node/components/TagsList/PopoverTags/index.js +18 -0
- package/node/components/TagsList/PopoverTags/styles.d.ts +8 -0
- package/node/components/TagsList/PopoverTags/styles.js +18 -0
- package/node/components/TagsList/PopoverTags/types.d.ts +24 -0
- package/node/components/TagsList/PopoverTags/types.js +2 -0
- package/node/components/TagsList/Tag/Tag.d.ts +9 -1
- package/node/components/TagsList/Tag/Tag.js +4 -4
- package/node/components/TagsList/TagsList.js +10 -4
- package/node/components/TagsList/constants.d.ts +35 -0
- package/node/components/TagsList/constants.js +36 -1
- package/node/components/TagsList/styles.d.ts +9 -1
- package/node/components/TagsList/styles.js +20 -1
- package/node/components/TagsList/types.d.ts +4 -0
- package/node/components/TagsList/useLogic/hooks/index.d.ts +1 -0
- package/node/components/TagsList/useLogic/hooks/index.js +17 -0
- package/node/components/TagsList/useLogic/hooks/useHoverDelay/index.d.ts +1 -0
- package/node/components/TagsList/useLogic/hooks/useHoverDelay/index.js +17 -0
- package/node/components/TagsList/useLogic/hooks/useHoverDelay/types.d.ts +20 -0
- package/node/components/TagsList/useLogic/hooks/useHoverDelay/types.js +2 -0
- package/node/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.d.ts +5 -0
- package/node/components/TagsList/useLogic/hooks/useHoverDelay/useHoverDelay.js +31 -0
- package/node/components/TagsList/useLogic/useLogic.d.ts +14 -2
- package/node/components/TagsList/useLogic/useLogic.js +81 -1
- package/node/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.d.ts +5 -0
- package/node/components/TagsList/utils/calculatePopoverWidth/calculatePopoverWidth.js +26 -0
- package/node/components/TagsList/utils/calculatePopoverWidth/index.d.ts +1 -0
- package/node/components/TagsList/utils/calculatePopoverWidth/index.js +17 -0
- package/node/components/TagsList/utils/index.d.ts +1 -0
- package/node/components/TagsList/utils/index.js +3 -1
- package/node/components/TreeLikeAsyncAutocomplete/Input/Input.js +3 -2
- package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.d.ts +3 -2
- package/node/components/TreeLikeAsyncAutocomplete/Input/useLogic/useLogic.js +3 -1
- package/node/components/TreeLikeAutocomplete/Input/Input.js +2 -2
- package/node/components/TreeLikeAutocomplete/Input/useLogic/useLogic.d.ts +2 -1
- package/node/components/TreeLikeAutocomplete/Input/useLogic/useLogic.js +3 -1
- package/node/components/useScrollManagement/useScrollManagement.js +6 -5
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").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>, {}>;
|
|
6
|
+
export declare const StyledTag: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../Tag").TagProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledTag = exports.Wrapper = void 0;
|
|
4
|
+
const styled_1 = require("../../styled");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const Tag_1 = require("../Tag");
|
|
7
|
+
exports.Wrapper = styled_1.styled.div `
|
|
8
|
+
overflow-y: auto;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
gap: ${({ theme }) => theme.spacing(constants_1.POPOVER_TAGS_GAP_SPACING)};
|
|
12
|
+
|
|
13
|
+
max-height: ${constants_1.POPOVER_MAX_HEIGHT}px;
|
|
14
|
+
padding-inline: ${({ theme }) => theme.spacing(constants_1.POPOVER_TAGS_PADDING_SPACING)};
|
|
15
|
+
`;
|
|
16
|
+
exports.StyledTag = (0, styled_1.styled)(Tag_1.Tag) `
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type TagProps } from '../Tag';
|
|
2
|
+
import { type TagValue } from '../types';
|
|
3
|
+
export type PopoverTagsProps<TData extends TagValue = TagValue> = {
|
|
4
|
+
/**
|
|
5
|
+
* Полный список выбранных элементов
|
|
6
|
+
*/
|
|
7
|
+
data: TData[];
|
|
8
|
+
/**
|
|
9
|
+
* Поле, используемое в качестве ключа списка
|
|
10
|
+
*/
|
|
11
|
+
keyId?: TData extends object ? keyof TData : never;
|
|
12
|
+
/**
|
|
13
|
+
* Если `true`, то тэги будут недоступны для взаимодействия
|
|
14
|
+
*/
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Используется для определения строкового значения опции
|
|
18
|
+
*/
|
|
19
|
+
getOptionLabel: (value: TData) => string | number;
|
|
20
|
+
/**
|
|
21
|
+
* Возвращает пропсы тэга, включая обработчик удаления
|
|
22
|
+
*/
|
|
23
|
+
getTagProps: (option: TData) => Pick<TagProps, 'label' | 'onDelete'>;
|
|
24
|
+
};
|
|
@@ -21,9 +21,17 @@ export type TagProps = {
|
|
|
21
21
|
* Хендлер клика по тегу
|
|
22
22
|
*/
|
|
23
23
|
onClick?: (value: MouseEvent<HTMLDivElement>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Хендлер наведения указателя на тег
|
|
26
|
+
*/
|
|
27
|
+
onMouseEnter?: (value: MouseEvent<HTMLDivElement>) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Хендлер увода указателя с тега
|
|
30
|
+
*/
|
|
31
|
+
onMouseLeave?: (value: MouseEvent<HTMLDivElement>) => void;
|
|
24
32
|
/**
|
|
25
33
|
* Название класса, применяется к корневому компоненту
|
|
26
34
|
*/
|
|
27
35
|
className?: string;
|
|
28
36
|
};
|
|
29
|
-
export declare const Tag: (
|
|
37
|
+
export declare const Tag: import("react").ForwardRefExoticComponent<TagProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Tag = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const OverflowTypography_1 = require("../../OverflowTypography");
|
|
6
7
|
const styles_1 = require("./styles");
|
|
7
8
|
const useLogic_1 = require("./useLogic");
|
|
8
|
-
|
|
9
|
+
exports.Tag = (0, react_1.forwardRef)((props, ref) => {
|
|
9
10
|
const { onMouseDown } = (0, useLogic_1.useLogic)();
|
|
10
11
|
const { shrinks, isDisabled, label, ...restProps } = props;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTag, { "$shrinks": shrinks, color: "grey", variant: "light", disabled: isDisabled, label: (0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { children: label }), ...restProps, onMouseDown: onMouseDown }));
|
|
12
|
-
};
|
|
13
|
-
exports.Tag = Tag;
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTag, { ref: ref, "$shrinks": shrinks, color: "grey", variant: "light", disabled: isDisabled, label: (0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { children: label }), ...restProps, onMouseDown: onMouseDown }));
|
|
13
|
+
});
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TagsList = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const CrossOutlineMd_1 = require("../../icons/CrossOutlineMd");
|
|
6
|
+
const IconButton_1 = require("../IconButton");
|
|
7
|
+
const NewPopover_1 = require("../NewPopover");
|
|
8
|
+
const Typography_1 = require("../Typography");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const PopoverTags_1 = require("./PopoverTags");
|
|
5
11
|
const styles_1 = require("./styles");
|
|
6
12
|
const Tag_1 = require("./Tag");
|
|
7
13
|
const useLogic_1 = require("./useLogic");
|
|
@@ -11,11 +17,11 @@ const utils_1 = require("./utils");
|
|
|
11
17
|
* Не предназначен для использования в продуктах, не экспортируется из пакета
|
|
12
18
|
*/
|
|
13
19
|
const TagsList = (props) => {
|
|
14
|
-
const { hiddenCount, tagsContainerRef, visibleOptions, getTagProps, showCounter, } = (0, useLogic_1.useLogic)(props);
|
|
15
|
-
const { className, keyId, isDisabled,
|
|
20
|
+
const { hiddenCount, tagsContainerRef, counterRef, visibleOptions, getTagProps, showCounter, isPopoverOpen, isPopoverEnabled, setPopoverContentRef, popoverContentCssVars, stopPopoverEventPropagation, popoverAnchorEl, closePopover, startPopoverDelay, cancelPopoverDelay, handleTagClick, handleCounterClick, } = (0, useLogic_1.useLogic)(props);
|
|
21
|
+
const { className, data = [], keyId, isDisabled, getOptionLabel } = props;
|
|
16
22
|
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, ref: tagsContainerRef, children: [visibleOptions?.map((option) => {
|
|
17
23
|
const tagProps = getTagProps(option);
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { isDisabled: isDisabled, onClick:
|
|
19
|
-
}), showCounter && ((0, jsx_runtime_1.jsx)(styles_1.CounterTag, { isDisabled: isDisabled, label: `+${hiddenCount}`, onClick:
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(Tag_1.Tag, { isDisabled: isDisabled, onClick: handleTagClick, ...tagProps }, (0, utils_1.getKey)(option, keyId, getOptionLabel)));
|
|
25
|
+
}), showCounter && ((0, jsx_runtime_1.jsx)(styles_1.CounterTag, { ref: counterRef, isDisabled: isDisabled, label: `+${hiddenCount}`, onClick: handleCounterClick, onMouseEnter: isPopoverEnabled ? startPopoverDelay : undefined, onMouseLeave: isPopoverEnabled ? cancelPopoverDelay : undefined }, "more")), (0, jsx_runtime_1.jsx)(NewPopover_1.NewPopover, { isOpen: isPopoverOpen, anchorEl: popoverAnchorEl, disableAutoFocus: true, onClose: closePopover, children: (0, jsx_runtime_1.jsxs)(styles_1.PopoverContentWrapper, { ref: setPopoverContentRef, style: popoverContentCssVars, onClick: stopPopoverEventPropagation, onMouseDown: stopPopoverEventPropagation, children: [(0, jsx_runtime_1.jsxs)(styles_1.PopoverHeader, { children: [(0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h5", children: constants_1.POPOVER_TITLE_TEXT }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", title: constants_1.POPOVER_CLOSE_TEXT, "aria-label": constants_1.POPOVER_CLOSE_TEXT, onClick: closePopover, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) })] }), (0, jsx_runtime_1.jsx)(PopoverTags_1.PopoverTags, { data: data, keyId: keyId, isDisabled: isDisabled, getOptionLabel: getOptionLabel, getTagProps: getTagProps })] }) })] }));
|
|
20
26
|
};
|
|
21
27
|
exports.TagsList = TagsList;
|
|
@@ -1,2 +1,37 @@
|
|
|
1
1
|
export declare const MIN_AVAILABLE_WIDTH = 50;
|
|
2
2
|
export declare const GAP_BETWEEN_TAGS = 4;
|
|
3
|
+
/**
|
|
4
|
+
* Задержка появления всплывающего окна при наведении на счётчик (мс)
|
|
5
|
+
*/
|
|
6
|
+
export declare const POPOVER_HOVER_DELAY = 500;
|
|
7
|
+
/**
|
|
8
|
+
* Максимальная ширина всплывающего окна (px)
|
|
9
|
+
*/
|
|
10
|
+
export declare const POPOVER_MAX_WIDTH = 480;
|
|
11
|
+
/**
|
|
12
|
+
* Максимальная высота всплывающего окна (px)
|
|
13
|
+
*/
|
|
14
|
+
export declare const POPOVER_MAX_HEIGHT = 370;
|
|
15
|
+
/**
|
|
16
|
+
* Количество тэгов, которые всплывающее окно вмещает в строку в любом случае:
|
|
17
|
+
* задаёт его минимальную ширину
|
|
18
|
+
*/
|
|
19
|
+
export declare const POPOVER_MIN_TAGS_IN_ROW = 2;
|
|
20
|
+
/**
|
|
21
|
+
* Отступ между тэгами во всплывающем окне в единицах theme.spacing.
|
|
22
|
+
* Используется и в стилях, и в расчёте минимальной ширины окна
|
|
23
|
+
*/
|
|
24
|
+
export declare const POPOVER_TAGS_GAP_SPACING = 2;
|
|
25
|
+
/**
|
|
26
|
+
* Горизонтальный отступ контейнера тэгов во всплывающем окне в единицах
|
|
27
|
+
* theme.spacing. Используется и в стилях, и в расчёте минимальной ширины окна
|
|
28
|
+
*/
|
|
29
|
+
export declare const POPOVER_TAGS_PADDING_SPACING = 4;
|
|
30
|
+
/**
|
|
31
|
+
* Заголовок всплывающего окна со списком выбранных элементов
|
|
32
|
+
*/
|
|
33
|
+
export declare const POPOVER_TITLE_TEXT = "\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B";
|
|
34
|
+
/**
|
|
35
|
+
* Доступное имя кнопки, закрывающей всплывающее окно
|
|
36
|
+
*/
|
|
37
|
+
export declare const POPOVER_CLOSE_TEXT = "\u0417\u0430\u043A\u0440\u044B\u0442\u044C";
|
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GAP_BETWEEN_TAGS = exports.MIN_AVAILABLE_WIDTH = void 0;
|
|
3
|
+
exports.POPOVER_CLOSE_TEXT = exports.POPOVER_TITLE_TEXT = exports.POPOVER_TAGS_PADDING_SPACING = exports.POPOVER_TAGS_GAP_SPACING = exports.POPOVER_MIN_TAGS_IN_ROW = exports.POPOVER_MAX_HEIGHT = exports.POPOVER_MAX_WIDTH = exports.POPOVER_HOVER_DELAY = exports.GAP_BETWEEN_TAGS = exports.MIN_AVAILABLE_WIDTH = void 0;
|
|
4
4
|
exports.MIN_AVAILABLE_WIDTH = 50;
|
|
5
5
|
exports.GAP_BETWEEN_TAGS = 4; // 4px
|
|
6
|
+
/**
|
|
7
|
+
* Задержка появления всплывающего окна при наведении на счётчик (мс)
|
|
8
|
+
*/
|
|
9
|
+
exports.POPOVER_HOVER_DELAY = 500;
|
|
10
|
+
/**
|
|
11
|
+
* Максимальная ширина всплывающего окна (px)
|
|
12
|
+
*/
|
|
13
|
+
exports.POPOVER_MAX_WIDTH = 480;
|
|
14
|
+
/**
|
|
15
|
+
* Максимальная высота всплывающего окна (px)
|
|
16
|
+
*/
|
|
17
|
+
exports.POPOVER_MAX_HEIGHT = 370;
|
|
18
|
+
/**
|
|
19
|
+
* Количество тэгов, которые всплывающее окно вмещает в строку в любом случае:
|
|
20
|
+
* задаёт его минимальную ширину
|
|
21
|
+
*/
|
|
22
|
+
exports.POPOVER_MIN_TAGS_IN_ROW = 2;
|
|
23
|
+
/**
|
|
24
|
+
* Отступ между тэгами во всплывающем окне в единицах theme.spacing.
|
|
25
|
+
* Используется и в стилях, и в расчёте минимальной ширины окна
|
|
26
|
+
*/
|
|
27
|
+
exports.POPOVER_TAGS_GAP_SPACING = 2;
|
|
28
|
+
/**
|
|
29
|
+
* Горизонтальный отступ контейнера тэгов во всплывающем окне в единицах
|
|
30
|
+
* theme.spacing. Используется и в стилях, и в расчёте минимальной ширины окна
|
|
31
|
+
*/
|
|
32
|
+
exports.POPOVER_TAGS_PADDING_SPACING = 4;
|
|
33
|
+
/**
|
|
34
|
+
* Заголовок всплывающего окна со списком выбранных элементов
|
|
35
|
+
*/
|
|
36
|
+
exports.POPOVER_TITLE_TEXT = 'Выбранные элементы';
|
|
37
|
+
/**
|
|
38
|
+
* Доступное имя кнопки, закрывающей всплывающее окно
|
|
39
|
+
*/
|
|
40
|
+
exports.POPOVER_CLOSE_TEXT = 'Закрыть';
|
|
@@ -3,6 +3,14 @@ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/type
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
-
export declare const CounterTag: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("./Tag").TagProps & {
|
|
6
|
+
export declare const CounterTag: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("./Tag").TagProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
}, {}, {}>;
|
|
9
|
+
export declare const PopoverContentWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
12
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const PopoverHeader: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
16
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CounterTag = exports.Wrapper = void 0;
|
|
3
|
+
exports.PopoverHeader = exports.PopoverContentWrapper = exports.CounterTag = exports.Wrapper = void 0;
|
|
4
4
|
const styled_1 = require("../styled");
|
|
5
5
|
const Tag_1 = require("../Tag");
|
|
6
6
|
const constants_1 = require("./constants");
|
|
@@ -11,9 +11,28 @@ exports.Wrapper = styled_1.styled.div `
|
|
|
11
11
|
column-gap: ${constants_1.GAP_BETWEEN_TAGS}px;
|
|
12
12
|
`;
|
|
13
13
|
exports.CounterTag = (0, styled_1.styled)(Tag_2.Tag) `
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
|
|
14
16
|
overflow: unset;
|
|
15
17
|
|
|
16
18
|
.${Tag_1.tagClassnames.label} {
|
|
17
19
|
min-width: unset;
|
|
18
20
|
}
|
|
19
21
|
`;
|
|
22
|
+
exports.PopoverContentWrapper = styled_1.styled.div `
|
|
23
|
+
--tags-list-popover-width: ${constants_1.POPOVER_MAX_WIDTH}px;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
27
|
+
|
|
28
|
+
width: var(--tags-list-popover-width);
|
|
29
|
+
max-width: ${constants_1.POPOVER_MAX_WIDTH}px;
|
|
30
|
+
padding-block: ${({ theme }) => theme.spacing(4)};
|
|
31
|
+
`;
|
|
32
|
+
exports.PopoverHeader = styled_1.styled.div `
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
|
|
37
|
+
padding-inline: ${({ theme }) => theme.spacing(4)};
|
|
38
|
+
`;
|
|
@@ -31,6 +31,10 @@ export type TagsListProps<TData extends TagValue = TagValue> = {
|
|
|
31
31
|
* Ref на внешний контейнер, чья ширина используется как база для расчёта доступного пространства..
|
|
32
32
|
*/
|
|
33
33
|
inputContainerRef?: RefObject<HTMLElement | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Ref на поле инпута
|
|
36
|
+
*/
|
|
37
|
+
fieldRef: RefObject<HTMLElement | null>;
|
|
34
38
|
/**
|
|
35
39
|
* Зарезервированная ширина, которая будет вычтена из доступной ширины при расчете количества отображаемых тегов
|
|
36
40
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useHoverDelay';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useHoverDelay"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useHoverDelay';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useHoverDelay"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type UseHoverDelayResult = {
|
|
2
|
+
/**
|
|
3
|
+
* Запускает отсчёт задержки. Повторный вызов перезапускает отсчёт
|
|
4
|
+
*/
|
|
5
|
+
start: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Отменяет отсчёт, если он не завершился
|
|
8
|
+
*/
|
|
9
|
+
cancel: () => void;
|
|
10
|
+
};
|
|
11
|
+
export type UseHoverDelayParams = {
|
|
12
|
+
/**
|
|
13
|
+
* Функция, вызывающаяся при hover-эффекте после задержки
|
|
14
|
+
*/
|
|
15
|
+
onHover: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Задержка вызова функции в мс
|
|
18
|
+
*/
|
|
19
|
+
delay: number;
|
|
20
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useHoverDelay = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Откладывает вызов на время удержания указателя над элементом.
|
|
7
|
+
*/
|
|
8
|
+
const useHoverDelay = ({ delay, onHover, }) => {
|
|
9
|
+
const timeoutRef = (0, react_1.useRef)(undefined);
|
|
10
|
+
const savedOnHoverRef = (0, react_1.useRef)(onHover);
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
|
+
savedOnHoverRef.current = onHover;
|
|
13
|
+
});
|
|
14
|
+
const cancel = () => {
|
|
15
|
+
if (timeoutRef.current === undefined) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
clearTimeout(timeoutRef.current);
|
|
19
|
+
timeoutRef.current = undefined;
|
|
20
|
+
};
|
|
21
|
+
const start = () => {
|
|
22
|
+
cancel();
|
|
23
|
+
timeoutRef.current = setTimeout(() => {
|
|
24
|
+
timeoutRef.current = undefined;
|
|
25
|
+
savedOnHoverRef.current();
|
|
26
|
+
}, delay);
|
|
27
|
+
};
|
|
28
|
+
(0, react_1.useEffect)(() => cancel, []);
|
|
29
|
+
return { start, cancel };
|
|
30
|
+
};
|
|
31
|
+
exports.useHoverDelay = useHoverDelay;
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { type CSSProperties, type MouseEvent, type SyntheticEvent } from 'react';
|
|
2
2
|
import type { TagsListProps, TagValue } from '../types';
|
|
3
3
|
type UseLogicParams<TData extends TagValue> = TagsListProps<TData>;
|
|
4
|
-
export declare const useLogic: <TData extends TagValue>({ data, keyId, getOptionLabel, onChange, inputContainerRef, reservedWidth, }: UseLogicParams<TData>) => {
|
|
4
|
+
export declare const useLogic: <TData extends TagValue>({ data, keyId, isDisabled, getOptionLabel, onChange, onClick, inputContainerRef, fieldRef, reservedWidth, }: UseLogicParams<TData>) => {
|
|
5
5
|
visibleOptions: TData[];
|
|
6
6
|
hiddenCount: number;
|
|
7
7
|
showCounter: boolean;
|
|
8
8
|
tagsContainerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
9
|
+
counterRef: import("react").RefObject<HTMLDivElement | null>;
|
|
9
10
|
getTagProps: (option: TData) => {
|
|
10
11
|
label: string | number;
|
|
11
12
|
shrinks: boolean;
|
|
12
13
|
onDelete: () => void;
|
|
13
14
|
};
|
|
15
|
+
isPopoverOpen: boolean;
|
|
16
|
+
isPopoverEnabled: boolean;
|
|
17
|
+
setPopoverContentRef: (node: HTMLDivElement | null) => void;
|
|
18
|
+
popoverContentCssVars: CSSProperties;
|
|
19
|
+
stopPopoverEventPropagation: (event: SyntheticEvent) => void;
|
|
20
|
+
popoverAnchorEl: HTMLElement | null;
|
|
21
|
+
closePopover: () => void;
|
|
22
|
+
startPopoverDelay: () => void;
|
|
23
|
+
cancelPopoverDelay: () => void;
|
|
24
|
+
handleTagClick: (event: MouseEvent<HTMLDivElement>) => void;
|
|
25
|
+
handleCounterClick: (event: MouseEvent<HTMLDivElement>) => void;
|
|
14
26
|
};
|
|
15
27
|
export {};
|
|
@@ -3,14 +3,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const useTheme_1 = require("../../theme/hooks/useTheme");
|
|
6
|
+
const useClickAwayEffect_1 = require("../../useClickAwayEffect");
|
|
7
|
+
const useNewToggle_1 = require("../../useNewToggle");
|
|
8
|
+
const useViewportType_1 = require("../../useViewportType");
|
|
6
9
|
const constants_1 = require("../constants");
|
|
7
10
|
const utils_1 = require("../utils");
|
|
8
|
-
const
|
|
11
|
+
const useHoverDelay_1 = require("./hooks/useHoverDelay");
|
|
12
|
+
const useLogic = ({ data = [], keyId, isDisabled, getOptionLabel, onChange, onClick, inputContainerRef, fieldRef, reservedWidth = 0, }) => {
|
|
9
13
|
const [visibleOptions, setVisibleOptions] = (0, react_1.useState)([]);
|
|
10
14
|
const [hiddenCount, setHiddenCount] = (0, react_1.useState)(0);
|
|
15
|
+
const [isPopoverOpen, togglePopover] = (0, useNewToggle_1.useNewToggle)(false);
|
|
16
|
+
const [isPopoverContentMounted, togglePopoverContentMounted] = (0, useNewToggle_1.useNewToggle)(false);
|
|
17
|
+
/**
|
|
18
|
+
* Ширина окна и якорь позиционирования фиксируются на момент открытия
|
|
19
|
+
* и дальше не пересчитываются
|
|
20
|
+
*/
|
|
21
|
+
const [popoverWidth, setPopoverWidth] = (0, react_1.useState)(0);
|
|
22
|
+
const [popoverAnchorEl, setPopoverAnchorEl] = (0, react_1.useState)(null);
|
|
11
23
|
const tagsContainerRef = (0, react_1.useRef)(null);
|
|
12
24
|
const availableWidthRef = (0, react_1.useRef)(0);
|
|
25
|
+
const popoverContentRef = (0, react_1.useRef)(null);
|
|
26
|
+
const counterRef = (0, react_1.useRef)(null);
|
|
13
27
|
const theme = (0, useTheme_1.useTheme)();
|
|
28
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
29
|
+
const openPopover = () => {
|
|
30
|
+
const field = fieldRef.current;
|
|
31
|
+
if (isPopoverOpen || !field) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
setPopoverWidth((0, utils_1.calculatePopoverWidth)(field.getBoundingClientRect().width, data.map((item) => getOptionLabel(item).toString()), theme));
|
|
35
|
+
setPopoverAnchorEl(field);
|
|
36
|
+
togglePopover(true);
|
|
37
|
+
};
|
|
38
|
+
const closePopover = () => togglePopover(false);
|
|
14
39
|
/**
|
|
15
40
|
* Обновляет доступную ширину для расчета количества отображаемых тегов
|
|
16
41
|
*/
|
|
@@ -67,6 +92,7 @@ const useLogic = ({ data = [], keyId, getOptionLabel, onChange, inputContainerRe
|
|
|
67
92
|
if (!data.length) {
|
|
68
93
|
setVisibleOptions([]);
|
|
69
94
|
setHiddenCount(0);
|
|
95
|
+
closePopover();
|
|
70
96
|
return;
|
|
71
97
|
}
|
|
72
98
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -105,12 +131,66 @@ const useLogic = ({ data = [], keyId, getOptionLabel, onChange, inputContainerRe
|
|
|
105
131
|
return { label, shrinks: false, onDelete };
|
|
106
132
|
};
|
|
107
133
|
const showCounter = hiddenCount > 0;
|
|
134
|
+
const { start: startPopoverDelay, cancel: cancelPopoverDelay } = (0, useHoverDelay_1.useHoverDelay)({ onHover: openPopover, delay: constants_1.POPOVER_HOVER_DELAY });
|
|
135
|
+
const setPopoverContentRef = (0, react_1.useCallback)((node) => {
|
|
136
|
+
popoverContentRef.current = node;
|
|
137
|
+
togglePopoverContentMounted(Boolean(node));
|
|
138
|
+
}, []);
|
|
139
|
+
const popoverExcludedNodes = (0, react_1.useMemo)(() => [counterRef], []);
|
|
140
|
+
(0, useClickAwayEffect_1.useClickAwayEffect)({
|
|
141
|
+
ref: popoverContentRef,
|
|
142
|
+
onClickAway: closePopover,
|
|
143
|
+
isActive: isPopoverOpen && isPopoverContentMounted,
|
|
144
|
+
excludeNodes: popoverExcludedNodes,
|
|
145
|
+
});
|
|
146
|
+
const isPopoverEnabled = !isMobile && !isDisabled;
|
|
147
|
+
const handleTagClick = (event) => {
|
|
148
|
+
event.stopPropagation();
|
|
149
|
+
onClick?.(event);
|
|
150
|
+
};
|
|
151
|
+
const handleCounterClick = (event) => {
|
|
152
|
+
event.stopPropagation();
|
|
153
|
+
cancelPopoverDelay();
|
|
154
|
+
// На мобильной ширине и в заблокированном поле у счётчика прежнее поведение — список опций
|
|
155
|
+
if (!isPopoverEnabled) {
|
|
156
|
+
onClick?.(event);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (isPopoverOpen) {
|
|
160
|
+
closePopover();
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
openPopover();
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Окно живёт в портале, но синтетические события React всплывают по дереву
|
|
167
|
+
* компонентов и доходят до обработчиков поля: у MUI Select это `handleMouseDown`,
|
|
168
|
+
* который переводит фокус на поле и открывает список, у TreeLike* — `onClick` поля
|
|
169
|
+
*/
|
|
170
|
+
const stopPopoverEventPropagation = (event) => {
|
|
171
|
+
event.stopPropagation();
|
|
172
|
+
};
|
|
173
|
+
const popoverContentCssVars = {
|
|
174
|
+
'--tags-list-popover-width': `${popoverWidth}px`,
|
|
175
|
+
};
|
|
108
176
|
return {
|
|
109
177
|
visibleOptions,
|
|
110
178
|
hiddenCount,
|
|
111
179
|
showCounter,
|
|
112
180
|
tagsContainerRef,
|
|
181
|
+
counterRef,
|
|
113
182
|
getTagProps,
|
|
183
|
+
isPopoverOpen,
|
|
184
|
+
isPopoverEnabled,
|
|
185
|
+
setPopoverContentRef,
|
|
186
|
+
popoverContentCssVars,
|
|
187
|
+
stopPopoverEventPropagation,
|
|
188
|
+
popoverAnchorEl,
|
|
189
|
+
closePopover,
|
|
190
|
+
startPopoverDelay,
|
|
191
|
+
cancelPopoverDelay,
|
|
192
|
+
handleTagClick,
|
|
193
|
+
handleCounterClick,
|
|
114
194
|
};
|
|
115
195
|
};
|
|
116
196
|
exports.useLogic = useLogic;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculatePopoverWidth = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const getTagWidth_1 = require("../getTagWidth");
|
|
6
|
+
const getSpacingValue = (theme, spacing) => parseInt(theme.spacing(spacing), 10);
|
|
7
|
+
/**
|
|
8
|
+
* Минимальная ширина popover: вмещает в строку POPOVER_MIN_TAGS_IN_ROW самых
|
|
9
|
+
* широких тэгов вместе с отступом между ними и отступами контейнера
|
|
10
|
+
*/
|
|
11
|
+
const getMinWidth = (tagLabels, theme) => {
|
|
12
|
+
const widestTagWidths = tagLabels
|
|
13
|
+
.map((label) => (0, getTagWidth_1.getTagWidth)(label, theme))
|
|
14
|
+
.sort((current, next) => next - current)
|
|
15
|
+
.slice(0, constants_1.POPOVER_MIN_TAGS_IN_ROW);
|
|
16
|
+
const tagsWidth = widestTagWidths.reduce((width, tagWidth) => width + tagWidth, 0);
|
|
17
|
+
const gapsWidth = Math.max(widestTagWidths.length - 1, 0) *
|
|
18
|
+
getSpacingValue(theme, constants_1.POPOVER_TAGS_GAP_SPACING);
|
|
19
|
+
const paddingsWidth = getSpacingValue(theme, constants_1.POPOVER_TAGS_PADDING_SPACING) * 2;
|
|
20
|
+
return tagsWidth + gapsWidth + paddingsWidth;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Вычисляет ширину всплывающего окна
|
|
24
|
+
*/
|
|
25
|
+
const calculatePopoverWidth = (fieldWidth, tagLabels, theme) => Math.min(Math.max(fieldWidth, getMinWidth(tagLabels, theme)), constants_1.POPOVER_MAX_WIDTH);
|
|
26
|
+
exports.calculatePopoverWidth = calculatePopoverWidth;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calculatePopoverWidth';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./calculatePopoverWidth"), exports);
|
|
@@ -3,3 +3,4 @@ export { getKey } from './getKey';
|
|
|
3
3
|
export { getTagWidth } from './getTagWidth';
|
|
4
4
|
export { getAvailableWidth } from './getAvailableWidth';
|
|
5
5
|
export { calculateVisibleTagsCount } from './calculateVisibleTagsCount';
|
|
6
|
+
export { calculatePopoverWidth } from './calculatePopoverWidth';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateVisibleTagsCount = exports.getAvailableWidth = exports.getTagWidth = exports.getKey = exports.getElementByText = void 0;
|
|
3
|
+
exports.calculatePopoverWidth = exports.calculateVisibleTagsCount = exports.getAvailableWidth = exports.getTagWidth = exports.getKey = exports.getElementByText = void 0;
|
|
4
4
|
var getElementByText_1 = require("./getElementByText");
|
|
5
5
|
Object.defineProperty(exports, "getElementByText", { enumerable: true, get: function () { return getElementByText_1.getElementByText; } });
|
|
6
6
|
var getKey_1 = require("./getKey");
|
|
@@ -11,3 +11,5 @@ var getAvailableWidth_1 = require("./getAvailableWidth");
|
|
|
11
11
|
Object.defineProperty(exports, "getAvailableWidth", { enumerable: true, get: function () { return getAvailableWidth_1.getAvailableWidth; } });
|
|
12
12
|
var calculateVisibleTagsCount_1 = require("./calculateVisibleTagsCount");
|
|
13
13
|
Object.defineProperty(exports, "calculateVisibleTagsCount", { enumerable: true, get: function () { return calculateVisibleTagsCount_1.calculateVisibleTagsCount; } });
|
|
14
|
+
var calculatePopoverWidth_1 = require("./calculatePopoverWidth");
|
|
15
|
+
Object.defineProperty(exports, "calculatePopoverWidth", { enumerable: true, get: function () { return calculatePopoverWidth_1.calculatePopoverWidth; } });
|
|
@@ -12,13 +12,14 @@ const styles_1 = require("./styles");
|
|
|
12
12
|
const useLogic_1 = require("./useLogic");
|
|
13
13
|
const ClearButton = ({ disabled, onClick }) => ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", color: "grey", disabled: disabled, onClick: onClick, title: constants_1.CLEAR_TEXT, "aria-label": constants_1.CLEAR_TEXT, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }));
|
|
14
14
|
exports.Input = (0, react_1.forwardRef)(({ disabled, onChange: propsOnChange, value, inputRef, hideHelperText = false, onClick, isLoading, ...restProps }, forwardedRef) => {
|
|
15
|
-
const { isVisibleClearButton, isVisibleTagsList, onChange, textFieldProps, onClearAll, } = (0, useLogic_1.useLogic)({
|
|
15
|
+
const { isVisibleClearButton, isVisibleTagsList, onChange, textFieldProps, onClearAll, fieldRef, } = (0, useLogic_1.useLogic)({
|
|
16
16
|
inputRef,
|
|
17
|
+
InputProps: restProps.InputProps,
|
|
17
18
|
value,
|
|
18
19
|
onChange: propsOnChange,
|
|
19
20
|
disabled,
|
|
20
21
|
onClick,
|
|
21
22
|
isLoading,
|
|
22
23
|
});
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTextField, { ...restProps, hideHelperText: hideHelperText, ref: forwardedRef, disabled: disabled, inputProps: { readOnly: true }, ...textFieldProps, startAdornment: isVisibleTagsList && ((0, jsx_runtime_1.jsx)(styles_1.StyledTagsList, { data: value, keyId: "id", isDisabled: disabled, getOptionLabel: (option) => option.label, onClick: onClick, onChange: onChange })), endAdornment: (0, jsx_runtime_1.jsxs)(styles_1.IconWrapper, { children: [isVisibleClearButton && ((0, jsx_runtime_1.jsx)(ClearButton, { disabled: disabled, onClick: onClearAll })), isLoading ? ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { size: "small" })) : ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", color: "grey", disabled: disabled, children: (0, jsx_runtime_1.jsx)(DownOutlineMd_1.DownOutlineMd, {}) }))] }) }));
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTextField, { ...restProps, hideHelperText: hideHelperText, ref: forwardedRef, disabled: disabled, inputProps: { readOnly: true }, ...textFieldProps, InputProps: { ...restProps.InputProps, ref: fieldRef }, startAdornment: isVisibleTagsList && ((0, jsx_runtime_1.jsx)(styles_1.StyledTagsList, { data: value, keyId: "id", isDisabled: disabled, fieldRef: fieldRef, getOptionLabel: (option) => option.label, onClick: onClick, onChange: onChange })), endAdornment: (0, jsx_runtime_1.jsxs)(styles_1.IconWrapper, { children: [isVisibleClearButton && ((0, jsx_runtime_1.jsx)(ClearButton, { disabled: disabled, onClick: onClearAll })), isLoading ? ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { size: "small" })) : ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", color: "grey", disabled: disabled, children: (0, jsx_runtime_1.jsx)(DownOutlineMd_1.DownOutlineMd, {}) }))] }) }));
|
|
24
25
|
});
|