@astral/ui 4.92.3 → 4.94.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/AsyncAutocomplete/AsyncAutocomplete.d.ts +1 -0
- package/components/AsyncAutocomplete/types.d.ts +5 -0
- package/components/AsyncAutocomplete/useLogic/useLogic.d.ts +1 -1
- package/components/AsyncAutocomplete/useLogic/useLogic.js +13 -4
- package/components/BottomDrawer/index.d.ts +1 -1
- package/components/BottomDrawer/index.js +1 -1
- package/components/ClickAwayListener/ClickAwayListener.d.ts +1 -1
- package/components/ClickAwayListener/ClickAwayListener.js +8 -2
- package/components/Radio/Radio.js +1 -1
- package/components/Radio/constants.d.ts +3 -0
- package/components/Radio/constants.js +3 -0
- package/components/Radio/index.d.ts +1 -1
- package/components/Radio/index.js +1 -1
- package/components/Radio/styles.js +9 -9
- package/components/Tree/MultipleTreeList/MultipleTreeList.js +2 -2
- package/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +4 -7
- package/components/Tree/MultipleTreeList/TreeItem/styles.d.ts +1 -17
- package/components/Tree/MultipleTreeList/TreeItem/styles.js +19 -2
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +4 -1
- package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +8 -2
- package/components/Tree/MultipleTreeList/styles.d.ts +4 -0
- package/components/Tree/MultipleTreeList/styles.js +25 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.d.ts +2 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.js +11 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.d.ts +2 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.js +50 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.d.ts +404 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +172 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.d.ts +11 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +3 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +3 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.d.ts +11 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.js +18 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.d.ts +24 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.js +50 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.d.ts +13 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.js +17 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.d.ts +19 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +39 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.d.ts +13 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.js +6 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.d.ts +7 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.js +12 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.d.ts +2 -0
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.js +2 -0
- package/components/Tree/TreeItem/MobileSlidePanel/constants.d.ts +11 -0
- package/components/Tree/TreeItem/MobileSlidePanel/constants.js +12 -0
- package/components/Tree/TreeItem/MobileSlidePanel/index.d.ts +2 -0
- package/components/Tree/TreeItem/MobileSlidePanel/index.js +2 -0
- package/components/Tree/TreeItem/MobileSlidePanel/types.d.ts +49 -0
- package/components/Tree/TreeItem/MobileSlidePanel/types.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.d.ts +14 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.js +62 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.d.ts +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.js +1 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.d.ts +9 -0
- package/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.js +11 -0
- package/components/Tree/TreeItem/TreeItem.d.ts +2 -1
- package/components/Tree/TreeItem/TreeItem.js +49 -9
- package/components/Tree/TreeItem/constants.d.ts +9 -0
- package/components/Tree/TreeItem/constants.js +9 -0
- package/components/Tree/TreeItem/styles.d.ts +4 -13
- package/components/Tree/TreeItem/styles.js +153 -39
- package/components/Tree/TreeItem/types.d.ts +18 -0
- package/components/Tree/TreeItem/useLogic/useLogic.d.ts +21 -7
- package/components/Tree/TreeItem/useLogic/useLogic.js +40 -2
- package/components/Tree/TreeList/TreeItem/TreeItem.js +5 -5
- package/components/Tree/TreeList/TreeItem/styles.d.ts +19 -0
- package/components/Tree/TreeList/TreeItem/styles.js +36 -0
- package/components/Tree/TreeList/TreeItem/useLogic/useLogic.d.ts +6 -0
- package/components/Tree/TreeList/TreeItem/useLogic/useLogic.js +11 -0
- package/components/Tree/TreeList/TreeList.js +2 -2
- package/components/Tree/TreeList/styles.d.ts +4 -0
- package/components/Tree/TreeList/styles.js +26 -0
- package/components/TreeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/components/TreeAsyncAutocomplete/OptionsModal/OptionsModal.js +2 -3
- package/components/TreeAsyncAutocomplete/OptionsModal/styles.d.ts +17 -0
- package/components/TreeAsyncAutocomplete/OptionsModal/styles.js +75 -5
- package/components/TreeAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/components/TreeAutocomplete/OptionsModal/OptionsModal.js +2 -3
- package/components/TreeAutocomplete/OptionsModal/styles.d.ts +17 -0
- package/components/TreeAutocomplete/OptionsModal/styles.js +36 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +5 -9
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +35 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +96 -5
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +17 -2
- package/components/TreeLikeAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +5 -6
- package/components/TreeLikeAutocomplete/OptionsModal/styles.d.ts +27 -0
- package/components/TreeLikeAutocomplete/OptionsModal/styles.js +44 -1
- package/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
- package/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.js +14 -1
- package/components/TreeLikeList/TreeItem/TreeItem.js +11 -4
- package/components/TreeLikeList/TreeItem/styles.d.ts +14 -17
- package/components/TreeLikeList/TreeItem/styles.js +48 -1
- package/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +8 -2
- package/components/TreeLikeList/TreeItem/useLogic/useLogic.js +35 -13
- package/components/TreeLikeList/TreeLikeList.js +2 -2
- package/components/TreeLikeList/styles.d.ts +4 -0
- package/components/TreeLikeList/styles.js +25 -0
- package/components/useAsyncOptions/faker.d.ts +3 -0
- package/components/useAsyncOptions/faker.js +3 -0
- package/components/useAsyncOptions/index.d.ts +1 -0
- package/components/useAsyncOptions/index.js +1 -0
- package/components/useAsyncOptions/public.d.ts +1 -0
- package/components/useAsyncOptions/public.js +1 -0
- package/components/useAsyncOptions/types.d.ts +7 -0
- package/components/useAsyncOptions/types.js +1 -0
- package/components/useAsyncOptions/useAsyncOptions.d.ts +8 -1
- package/components/useAsyncOptions/useAsyncOptions.js +22 -3
- package/node/components/AsyncAutocomplete/AsyncAutocomplete.d.ts +1 -0
- package/node/components/AsyncAutocomplete/types.d.ts +5 -0
- package/node/components/AsyncAutocomplete/useLogic/useLogic.d.ts +1 -1
- package/node/components/AsyncAutocomplete/useLogic/useLogic.js +13 -4
- package/node/components/BottomDrawer/index.d.ts +1 -1
- package/node/components/BottomDrawer/index.js +3 -1
- package/node/components/ClickAwayListener/ClickAwayListener.d.ts +1 -1
- package/node/components/ClickAwayListener/ClickAwayListener.js +8 -2
- package/node/components/Radio/Radio.js +1 -1
- package/node/components/Radio/constants.d.ts +3 -0
- package/node/components/Radio/constants.js +4 -1
- package/node/components/Radio/index.d.ts +1 -1
- package/node/components/Radio/index.js +3 -1
- package/node/components/Radio/styles.js +8 -8
- package/node/components/Tree/MultipleTreeList/MultipleTreeList.js +1 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +4 -7
- package/node/components/Tree/MultipleTreeList/TreeItem/styles.d.ts +1 -17
- package/node/components/Tree/MultipleTreeList/TreeItem/styles.js +18 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +4 -1
- package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +8 -2
- package/node/components/Tree/MultipleTreeList/styles.d.ts +4 -0
- package/node/components/Tree/MultipleTreeList/styles.js +26 -1
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.d.ts +2 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.js +15 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.d.ts +2 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.js +54 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.d.ts +404 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +175 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.d.ts +11 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.js +2 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +3 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +19 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.d.ts +11 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.js +22 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.d.ts +24 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.js +54 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.d.ts +13 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.js +21 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.d.ts +19 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +43 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.d.ts +13 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.js +9 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.d.ts +7 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.js +16 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.d.ts +2 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.js +18 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/constants.d.ts +11 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/constants.js +15 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/index.d.ts +2 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/index.js +18 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/types.d.ts +49 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/types.js +2 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.d.ts +14 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.js +66 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.d.ts +1 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.js +17 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.d.ts +9 -0
- package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.js +15 -0
- package/node/components/Tree/TreeItem/TreeItem.d.ts +2 -1
- package/node/components/Tree/TreeItem/TreeItem.js +48 -9
- package/node/components/Tree/TreeItem/constants.d.ts +9 -0
- package/node/components/Tree/TreeItem/constants.js +10 -1
- package/node/components/Tree/TreeItem/styles.d.ts +4 -13
- package/node/components/Tree/TreeItem/styles.js +153 -39
- package/node/components/Tree/TreeItem/types.d.ts +18 -0
- package/node/components/Tree/TreeItem/useLogic/useLogic.d.ts +21 -7
- package/node/components/Tree/TreeItem/useLogic/useLogic.js +39 -1
- package/node/components/Tree/TreeList/TreeItem/TreeItem.js +4 -4
- package/node/components/Tree/TreeList/TreeItem/styles.d.ts +19 -0
- package/node/components/Tree/TreeList/TreeItem/styles.js +60 -1
- package/node/components/Tree/TreeList/TreeItem/useLogic/useLogic.d.ts +6 -0
- package/node/components/Tree/TreeList/TreeItem/useLogic/useLogic.js +11 -0
- package/node/components/Tree/TreeList/TreeList.js +1 -1
- package/node/components/Tree/TreeList/styles.d.ts +4 -0
- package/node/components/Tree/TreeList/styles.js +27 -1
- package/node/components/TreeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/node/components/TreeAsyncAutocomplete/OptionsModal/OptionsModal.js +1 -2
- package/node/components/TreeAsyncAutocomplete/OptionsModal/styles.d.ts +17 -0
- package/node/components/TreeAsyncAutocomplete/OptionsModal/styles.js +76 -6
- package/node/components/TreeAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/node/components/TreeAutocomplete/OptionsModal/OptionsModal.js +1 -2
- package/node/components/TreeAutocomplete/OptionsModal/styles.d.ts +17 -0
- package/node/components/TreeAutocomplete/OptionsModal/styles.js +37 -1
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +3 -7
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +35 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +97 -6
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +17 -2
- package/node/components/TreeLikeAutocomplete/OptionsModal/NoData/styles.js +5 -0
- package/node/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +3 -4
- package/node/components/TreeLikeAutocomplete/OptionsModal/styles.d.ts +27 -0
- package/node/components/TreeLikeAutocomplete/OptionsModal/styles.js +45 -2
- package/node/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
- package/node/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.js +14 -1
- package/node/components/TreeLikeList/TreeItem/TreeItem.js +9 -2
- package/node/components/TreeLikeList/TreeItem/styles.d.ts +14 -17
- package/node/components/TreeLikeList/TreeItem/styles.js +48 -1
- package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +8 -2
- package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.js +34 -12
- package/node/components/TreeLikeList/TreeLikeList.js +1 -1
- package/node/components/TreeLikeList/styles.d.ts +4 -0
- package/node/components/TreeLikeList/styles.js +26 -1
- package/node/components/useAsyncOptions/faker.d.ts +3 -0
- package/node/components/useAsyncOptions/faker.js +9 -0
- package/node/components/useAsyncOptions/index.d.ts +1 -0
- package/node/components/useAsyncOptions/index.js +1 -0
- package/node/components/useAsyncOptions/public.d.ts +1 -0
- package/node/components/useAsyncOptions/public.js +1 -0
- package/node/components/useAsyncOptions/types.d.ts +7 -0
- package/node/components/useAsyncOptions/types.js +2 -0
- package/node/components/useAsyncOptions/useAsyncOptions.d.ts +8 -1
- package/node/components/useAsyncOptions/useAsyncOptions.js +22 -3
- package/package.json +1 -1
- package/components/AsyncAutocomplete/faker.d.ts +0 -2
- package/components/AsyncAutocomplete/faker.js +0 -38
- package/node/components/AsyncAutocomplete/faker.d.ts +0 -2
- package/node/components/AsyncAutocomplete/faker.js +0 -45
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
export declare const Item: import("../../styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
-
} & {
|
|
7
|
-
$level: number;
|
|
8
6
|
}, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
9
7
|
export declare const ItemContent: import("../../styled").StyledComponent<{
|
|
10
8
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
9
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
12
|
-
} & {
|
|
13
|
-
$isSelected: boolean;
|
|
14
|
-
$isDisabled: boolean;
|
|
15
|
-
$level: number;
|
|
16
10
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
17
11
|
export declare const CollapseButton: import("../../styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
18
12
|
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
@@ -23,8 +17,6 @@ export declare const CollapseButton: import("../../styled").StyledComponent<Omit
|
|
|
23
17
|
size?: "large" | "medium" | undefined;
|
|
24
18
|
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
25
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
26
|
-
} & {
|
|
27
|
-
$isNotBlockingExpandList?: boolean | undefined;
|
|
28
20
|
}, {}, {}>;
|
|
29
21
|
export declare const ChevronIcon: import("../../styled").StyledComponent<{
|
|
30
22
|
children?: import("react").ReactNode;
|
|
@@ -33,14 +25,10 @@ export declare const ChevronIcon: import("../../styled").StyledComponent<{
|
|
|
33
25
|
size?: "sm" | "md" | "auto" | undefined;
|
|
34
26
|
} & import("react").SVGProps<SVGSVGElement> & {
|
|
35
27
|
theme?: import("@emotion/react").Theme | undefined;
|
|
36
|
-
} & {
|
|
37
|
-
$isActive?: boolean | undefined;
|
|
38
28
|
}, {}, {}>;
|
|
39
29
|
export declare const LabelWrapper: import("../../styled").StyledComponent<{
|
|
40
30
|
theme?: import("@emotion/react").Theme | undefined;
|
|
41
31
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
42
|
-
} & {
|
|
43
|
-
$level: number;
|
|
44
32
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
45
33
|
export declare const Label: import("../../styled").StyledComponent<import("../../Typography/types").TypographyPropsBase & {
|
|
46
34
|
color?: import("../../Typography").TypographyColor | undefined;
|
|
@@ -344,7 +332,7 @@ export declare const Note: import("../../styled").StyledComponent<import("../../
|
|
|
344
332
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
345
333
|
open?: boolean | undefined;
|
|
346
334
|
width?: import("csstype").Property.Width<string | number> | undefined;
|
|
347
|
-
size?: import("
|
|
335
|
+
size?: import("../../Tooltip").TooltipSize | undefined;
|
|
348
336
|
componentsProps?: {
|
|
349
337
|
popper?: (Partial<import("@mui/material").PopperProps> & import("@mui/material").TooltipComponentsPropsOverrides) | undefined;
|
|
350
338
|
transition?: (import("@mui/material/transitions").TransitionProps & import("@mui/material").TooltipComponentsPropsOverrides) | undefined;
|
|
@@ -406,3 +394,6 @@ export declare const ItemWrapper: import("../../styled").StyledComponent<{
|
|
|
406
394
|
theme?: import("@emotion/react").Theme | undefined;
|
|
407
395
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
408
396
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
397
|
+
export declare const StyledCollapse: import("../../styled").StyledComponent<import("../../Collapse").CollapseProps & {
|
|
398
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
399
|
+
}, {}, {}>;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { typographyClasses } from '@mui/material/Typography';
|
|
2
2
|
import { ChevronROutlineMd } from '../../../icons/ChevronROutlineMd';
|
|
3
3
|
import { buttonClasses } from '../../Button';
|
|
4
|
+
import { Collapse } from '../../Collapse';
|
|
4
5
|
import { descriptionClassnames } from '../../Description';
|
|
5
6
|
import { IconButton } from '../../IconButton';
|
|
6
7
|
import { OverflowTypography } from '../../OverflowTypography';
|
|
7
8
|
import { svgIconClassnames } from '../../SvgIcon';
|
|
8
9
|
import { styled } from '../../styled';
|
|
10
|
+
import { tooltipClassnames } from '../../Tooltip';
|
|
9
11
|
import { Typography } from '../../Typography';
|
|
10
|
-
import { COLLAPSE_BUTTON_WIDTH, GAP_WIDTH, HALF_PADDING_COLLAPSE_BUTTON_WIDTH, TREE_LINE_WIDTH, } from './constants';
|
|
11
|
-
const getBackgroundColor = (theme, isSelected, isDisabled) => {
|
|
12
|
-
if (isDisabled) {
|
|
13
|
-
return 'transparent';
|
|
14
|
-
}
|
|
15
|
-
return isSelected
|
|
16
|
-
? theme.palette.primary[100]
|
|
17
|
-
: theme.palette.background.elementHover;
|
|
18
|
-
};
|
|
12
|
+
import { COLLAPSE_BUTTON_WIDTH, GAP_WIDTH, HALF_PADDING_COLLAPSE_BUTTON_WIDTH, MOBILE_COLLAPSE_BUTTON_WIDTH, TREE_LINE_WIDTH, treeClassnames, } from './constants';
|
|
19
13
|
export const Item = styled('li', {
|
|
20
|
-
shouldForwardProp: (prop) => !['as'
|
|
14
|
+
shouldForwardProp: (prop) => !['as'].includes(prop),
|
|
21
15
|
}) `
|
|
16
|
+
--tree-item-level: 0;
|
|
17
|
+
|
|
22
18
|
position: relative;
|
|
23
19
|
|
|
24
20
|
&:not(:last-of-type)::before {
|
|
@@ -27,18 +23,29 @@ export const Item = styled('li', {
|
|
|
27
23
|
position: absolute;
|
|
28
24
|
z-index: 1;
|
|
29
25
|
top: 0;
|
|
30
|
-
transform:
|
|
26
|
+
transform: translateX(
|
|
27
|
+
calc(
|
|
28
|
+
((${COLLAPSE_BUTTON_WIDTH} + ${GAP_WIDTH}) * var(--tree-item-level)) -
|
|
29
|
+
${HALF_PADDING_COLLAPSE_BUTTON_WIDTH}
|
|
30
|
+
)
|
|
31
|
+
);
|
|
31
32
|
|
|
32
33
|
width: 0;
|
|
33
34
|
height: 100%;
|
|
34
35
|
|
|
35
36
|
border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
36
37
|
}
|
|
38
|
+
|
|
39
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
40
|
+
position: static;
|
|
41
|
+
|
|
42
|
+
&:not(:last-of-type)::before {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
37
46
|
`;
|
|
38
|
-
export const ItemContent = styled('div'
|
|
39
|
-
|
|
40
|
-
}) `
|
|
41
|
-
cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')};
|
|
47
|
+
export const ItemContent = styled('div') `
|
|
48
|
+
cursor: pointer;
|
|
42
49
|
|
|
43
50
|
position: relative;
|
|
44
51
|
|
|
@@ -46,11 +53,14 @@ export const ItemContent = styled('div', {
|
|
|
46
53
|
|
|
47
54
|
min-height: 32px;
|
|
48
55
|
padding: ${({ theme }) => theme.spacing(0, 4, 1, 0)};
|
|
49
|
-
padding-left: ${({ theme, $level }) => `calc(${theme.spacing($level * 7)} + ${theme.spacing(7)})`};
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
padding-left: ${({ theme }) => `calc(
|
|
58
|
+
var(--tree-item-level) * ${theme.spacing(7)} + ${theme.spacing(7)}`}
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
52
62
|
|
|
53
|
-
background-color:
|
|
63
|
+
background-color: transparent;
|
|
54
64
|
|
|
55
65
|
transition: ${({ theme }) => theme.transitions.create('background-color', {
|
|
56
66
|
easing: theme.transitions.easing.easeIn,
|
|
@@ -58,54 +68,124 @@ export const ItemContent = styled('div', {
|
|
|
58
68
|
})};
|
|
59
69
|
|
|
60
70
|
&:hover {
|
|
61
|
-
background-color: ${({ theme
|
|
71
|
+
background-color: ${({ theme }) => theme.palette.background.elementHover};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.${treeClassnames.selected} {
|
|
75
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
76
|
+
|
|
77
|
+
&:hover, &:focus {
|
|
78
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.${treeClassnames.disabled} {
|
|
83
|
+
cursor: default;
|
|
84
|
+
color: ${({ theme }) => theme.palette.text.disabled};
|
|
85
|
+
|
|
86
|
+
&:hover, &:focus {
|
|
87
|
+
background-color: transparent;
|
|
88
|
+
}
|
|
62
89
|
}
|
|
63
90
|
|
|
64
91
|
&:focus {
|
|
65
|
-
background-color: ${({ theme
|
|
92
|
+
background-color: ${({ theme }) => theme.palette.background.elementHover};
|
|
66
93
|
border: 0;
|
|
67
94
|
outline: 0;
|
|
68
95
|
}
|
|
96
|
+
|
|
97
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
98
|
+
padding: ${({ theme }) => theme.microSpacing(6, 3)};
|
|
99
|
+
|
|
100
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
&.${treeClassnames.hasNested} {
|
|
104
|
+
padding-right: ${({ theme }) => theme.spacing(11)};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
& .${tooltipClassnames.contentWrapper} {
|
|
108
|
+
width: 100%;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:focus {
|
|
112
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
69
115
|
`;
|
|
70
|
-
export const CollapseButton = styled(IconButton
|
|
71
|
-
shouldForwardProp: (prop) => !['$isNotBlockingExpandList'].includes(prop),
|
|
72
|
-
}) `
|
|
116
|
+
export const CollapseButton = styled(IconButton) `
|
|
73
117
|
position: relative;
|
|
74
118
|
z-index: 1;
|
|
75
119
|
|
|
76
120
|
width: ${COLLAPSE_BUTTON_WIDTH};
|
|
77
|
-
height:
|
|
121
|
+
height: ${COLLAPSE_BUTTON_WIDTH};
|
|
78
122
|
margin-left: -${COLLAPSE_BUTTON_WIDTH};
|
|
79
123
|
|
|
80
|
-
color:
|
|
124
|
+
color: inherit;
|
|
125
|
+
|
|
126
|
+
&.${treeClassnames.notBlockingExpandList} {
|
|
127
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
128
|
+
}
|
|
81
129
|
|
|
82
|
-
&.${buttonClasses.root}
|
|
83
|
-
width:
|
|
84
|
-
height:
|
|
130
|
+
&.${buttonClasses.root} {
|
|
131
|
+
width: ${COLLAPSE_BUTTON_WIDTH};
|
|
132
|
+
height: ${COLLAPSE_BUTTON_WIDTH};
|
|
133
|
+
}
|
|
85
134
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
135
|
+
&.${buttonClasses.root} .${svgIconClassnames.root} {
|
|
136
|
+
width: ${COLLAPSE_BUTTON_WIDTH};
|
|
137
|
+
height: ${COLLAPSE_BUTTON_WIDTH};
|
|
90
138
|
}
|
|
91
139
|
|
|
92
140
|
&:hover {
|
|
93
141
|
background-color: ${({ theme }) => theme.palette.grey[300]};
|
|
94
142
|
}
|
|
143
|
+
|
|
144
|
+
&.${treeClassnames.open} .${svgIconClassnames.root} {
|
|
145
|
+
transform: rotateZ(90deg);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: 0;
|
|
151
|
+
right: 0;
|
|
152
|
+
bottom: 0;
|
|
153
|
+
z-index: 0;
|
|
154
|
+
|
|
155
|
+
width: ${MOBILE_COLLAPSE_BUTTON_WIDTH};
|
|
156
|
+
height: auto;
|
|
157
|
+
margin-left: 0;
|
|
158
|
+
padding: ${({ theme }) => theme.spacing(0, 4, 0, 8)};
|
|
159
|
+
|
|
160
|
+
border-radius: 0;
|
|
161
|
+
|
|
162
|
+
&.${treeClassnames.open} .${svgIconClassnames.root} {
|
|
163
|
+
transform: rotateZ(0deg);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.${buttonClasses.root} {
|
|
167
|
+
width: ${MOBILE_COLLAPSE_BUTTON_WIDTH};
|
|
168
|
+
height: auto;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&:hover {
|
|
172
|
+
background-color: transparent;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
95
175
|
`;
|
|
96
|
-
export const ChevronIcon = styled(ChevronROutlineMd
|
|
97
|
-
|
|
98
|
-
}) `
|
|
99
|
-
transform: rotateZ(${({ $isActive }) => ($isActive ? 90 : 0)}deg);
|
|
176
|
+
export const ChevronIcon = styled(ChevronROutlineMd) `
|
|
177
|
+
transform: rotateZ(0deg);
|
|
100
178
|
|
|
101
179
|
transition: ${({ theme }) => theme.transitions.create('transform', {
|
|
102
180
|
easing: theme.transitions.easing.sharp,
|
|
103
181
|
duration: theme.transitions.duration.short,
|
|
104
182
|
})};
|
|
183
|
+
|
|
184
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
185
|
+
transition: none;
|
|
186
|
+
}
|
|
105
187
|
`;
|
|
106
|
-
export const LabelWrapper = styled
|
|
107
|
-
shouldForwardProp: (prop) => prop !== '$level',
|
|
108
|
-
}) `
|
|
188
|
+
export const LabelWrapper = styled.div `
|
|
109
189
|
position: relative;
|
|
110
190
|
|
|
111
191
|
display: flex;
|
|
@@ -134,12 +214,33 @@ export const LabelWrapper = styled('div', {
|
|
|
134
214
|
border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
135
215
|
border-radius: 0 0 0 ${({ theme }) => theme.shape.small};
|
|
136
216
|
}
|
|
217
|
+
|
|
218
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
219
|
+
position: static;
|
|
220
|
+
|
|
221
|
+
&::before {
|
|
222
|
+
display: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
padding-top: 0;
|
|
226
|
+
|
|
227
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
228
|
+
width: 100%;
|
|
229
|
+
|
|
230
|
+
justify-content: space-between;
|
|
231
|
+
}
|
|
137
232
|
`;
|
|
138
233
|
export const Label = styled(Typography) `
|
|
139
234
|
display: flex;
|
|
140
235
|
align-items: center;
|
|
141
236
|
|
|
142
237
|
margin-left: ${({ theme }) => theme.spacing(1)};
|
|
238
|
+
|
|
239
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
240
|
+
margin-left: 0;
|
|
241
|
+
order: 1;
|
|
242
|
+
padding: ${({ theme }) => theme.microSpacing(1, 0)};
|
|
243
|
+
}
|
|
143
244
|
`;
|
|
144
245
|
export const Note = styled(OverflowTypography) `
|
|
145
246
|
margin-left: ${({ theme }) => theme.spacing(1)};
|
|
@@ -150,8 +251,21 @@ export const Note = styled(OverflowTypography) `
|
|
|
150
251
|
color: inherit;
|
|
151
252
|
}
|
|
152
253
|
}
|
|
254
|
+
|
|
255
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
256
|
+
margin-left: 0;
|
|
257
|
+
}
|
|
153
258
|
`;
|
|
154
259
|
export const ItemWrapper = styled.div `
|
|
155
260
|
display: flex;
|
|
156
261
|
flex-direction: column;
|
|
262
|
+
|
|
263
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
264
|
+
width: 100%;
|
|
265
|
+
}
|
|
266
|
+
`;
|
|
267
|
+
export const StyledCollapse = styled(Collapse) `
|
|
268
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
269
|
+
display: none;
|
|
270
|
+
}
|
|
157
271
|
`;
|
|
@@ -67,4 +67,22 @@ export type TreeItemProps<TComponent extends ElementType = ElementType> = {
|
|
|
67
67
|
* Функция, которая запускается при нажатии на элемент списка.
|
|
68
68
|
*/
|
|
69
69
|
onClick?: (event: SyntheticEvent) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Содержимое родителя в шапке мобильной панели.
|
|
72
|
+
* По умолчанию используется `label` / `renderItem`.
|
|
73
|
+
*/
|
|
74
|
+
mobileHeaderLabel?: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Элемент справа от родителя в шапке мобильной панели.
|
|
77
|
+
*/
|
|
78
|
+
mobileHeaderControl?: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* Дополнительное содержимое под родителем в шапке мобильной панели.
|
|
81
|
+
*/
|
|
82
|
+
mobileHeaderAdditionalContent?: ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Вызывается при открытии и закрытии мобильной панели вложенных элементов.
|
|
85
|
+
* На десктопе не вызывается: там список раскрывается через Collapse.
|
|
86
|
+
*/
|
|
87
|
+
onMobilePanelOpenChange?: (isOpen: boolean) => void;
|
|
70
88
|
} & Omit<ComponentProps<TComponent>, ''>;
|
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
import { type MouseEvent, type SyntheticEvent } from 'react';
|
|
1
|
+
import { type CSSProperties, type MouseEvent, type SyntheticEvent } from 'react';
|
|
2
2
|
import { type TreeItemProps } from '../types';
|
|
3
|
-
type UseLogicProps = TreeItemProps
|
|
4
|
-
export declare const useLogic: ({ id, prefixId, isDefaultExpanded, isForceExpanded, isDisabled, disabledReason, onClick, }: UseLogicProps) => {
|
|
3
|
+
type UseLogicProps = Omit<TreeItemProps, 'ref'>;
|
|
4
|
+
export declare const useLogic: ({ id, prefixId, label, note, renderItem, mobileHeaderLabel, mobileHeaderControl, mobileHeaderAdditionalContent, isDefaultExpanded, isForceExpanded, isDisabled, isSelected, disabledReason, level, onClick, onMobilePanelOpenChange, }: UseLogicProps) => {
|
|
5
5
|
isOpen: boolean;
|
|
6
|
+
isMobileOpen: boolean;
|
|
7
|
+
isMobile: boolean;
|
|
6
8
|
handleToggle: (event: MouseEvent<HTMLElement>) => void;
|
|
7
|
-
|
|
9
|
+
handleClose: (event: MouseEvent<HTMLElement>) => void;
|
|
10
|
+
handleClick: (event: SyntheticEvent<HTMLDivElement>) => any;
|
|
11
|
+
itemCssVars: CSSProperties;
|
|
8
12
|
itemProps: {
|
|
9
13
|
id: any;
|
|
10
14
|
};
|
|
11
15
|
itemContentProps: {
|
|
12
16
|
tabIndex: number;
|
|
13
|
-
onClick: (event: SyntheticEvent<HTMLDivElement>) =>
|
|
14
|
-
onKeyDown: (event: SyntheticEvent<HTMLDivElement>) =>
|
|
17
|
+
onClick: (event: SyntheticEvent<HTMLDivElement>) => any;
|
|
18
|
+
onKeyDown: (event: SyntheticEvent<HTMLDivElement>) => any;
|
|
15
19
|
};
|
|
16
20
|
tooltipProps: {
|
|
17
|
-
title:
|
|
21
|
+
title: any;
|
|
18
22
|
withoutContainer: boolean;
|
|
19
23
|
disableInteractive: boolean;
|
|
20
24
|
};
|
|
25
|
+
mobileSlidePanelProps: {
|
|
26
|
+
id: any;
|
|
27
|
+
parentLabel: any;
|
|
28
|
+
parentNote: any;
|
|
29
|
+
parentControl: any;
|
|
30
|
+
parentAdditionalContent: any;
|
|
31
|
+
isParentSelected: any;
|
|
32
|
+
isParentDisabled: any;
|
|
33
|
+
onParentClick: any;
|
|
34
|
+
};
|
|
21
35
|
};
|
|
22
36
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { useEffect, useState, } from 'react';
|
|
2
|
-
|
|
1
|
+
import { useEffect, useMemo, useState, } from 'react';
|
|
2
|
+
import { useViewportType } from '../../../useViewportType';
|
|
3
|
+
export const useLogic = ({ id, prefixId, label, note, renderItem, mobileHeaderLabel, mobileHeaderControl, mobileHeaderAdditionalContent, isDefaultExpanded = false, isForceExpanded, isDisabled, isSelected, disabledReason, level = 0, onClick, onMobilePanelOpenChange, }) => {
|
|
4
|
+
const { isMobile } = useViewportType();
|
|
3
5
|
const [isOpen, setOpen] = useState(isDefaultExpanded);
|
|
6
|
+
const [isMobileOpen, setMobileOpen] = useState(false);
|
|
4
7
|
useEffect(() => {
|
|
5
8
|
setOpen(isDefaultExpanded);
|
|
6
9
|
}, []);
|
|
@@ -23,14 +26,39 @@ export const useLogic = ({ id, prefixId, isDefaultExpanded = false, isForceExpan
|
|
|
23
26
|
};
|
|
24
27
|
const handleToggle = (event) => {
|
|
25
28
|
event.stopPropagation();
|
|
29
|
+
if (isMobile) {
|
|
30
|
+
const nextState = !isMobileOpen;
|
|
31
|
+
setMobileOpen(nextState);
|
|
32
|
+
onMobilePanelOpenChange?.(nextState);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
26
35
|
setOpen((currentState) => !currentState);
|
|
27
36
|
};
|
|
37
|
+
const handleClose = (event) => {
|
|
38
|
+
event.stopPropagation();
|
|
39
|
+
setMobileOpen(false);
|
|
40
|
+
onMobilePanelOpenChange?.(false);
|
|
41
|
+
};
|
|
28
42
|
const idAttr = prefixId ? `${prefixId}${id}` : id;
|
|
29
43
|
const tabIndex = isDisabled ? -1 : 0;
|
|
44
|
+
const itemCssVars = { '--tree-item-level': level };
|
|
45
|
+
const parentLabel = useMemo(() => {
|
|
46
|
+
if (mobileHeaderLabel != null) {
|
|
47
|
+
return mobileHeaderLabel;
|
|
48
|
+
}
|
|
49
|
+
if (renderItem) {
|
|
50
|
+
return renderItem({ label, note, id });
|
|
51
|
+
}
|
|
52
|
+
return label;
|
|
53
|
+
}, [mobileHeaderLabel, renderItem, label, note, id]);
|
|
30
54
|
return {
|
|
31
55
|
isOpen,
|
|
56
|
+
isMobileOpen,
|
|
57
|
+
isMobile,
|
|
32
58
|
handleToggle,
|
|
59
|
+
handleClose,
|
|
33
60
|
handleClick,
|
|
61
|
+
itemCssVars,
|
|
34
62
|
itemProps: {
|
|
35
63
|
id: idAttr,
|
|
36
64
|
},
|
|
@@ -44,5 +72,15 @@ export const useLogic = ({ id, prefixId, isDefaultExpanded = false, isForceExpan
|
|
|
44
72
|
withoutContainer: !isDisabled,
|
|
45
73
|
disableInteractive: true,
|
|
46
74
|
},
|
|
75
|
+
mobileSlidePanelProps: {
|
|
76
|
+
id,
|
|
77
|
+
parentLabel,
|
|
78
|
+
parentNote: note,
|
|
79
|
+
parentControl: mobileHeaderControl,
|
|
80
|
+
parentAdditionalContent: mobileHeaderAdditionalContent,
|
|
81
|
+
isParentSelected: isSelected,
|
|
82
|
+
isParentDisabled: isDisabled,
|
|
83
|
+
onParentClick: onClick,
|
|
84
|
+
},
|
|
47
85
|
};
|
|
48
86
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { List } from './styles';
|
|
2
|
+
import { List, StyledFormControlLabel, StyledRadio, StyledTreeItem, } from './styles';
|
|
4
3
|
import { useLogic } from './useLogic';
|
|
5
4
|
export const TreeItem = (props) => {
|
|
6
|
-
const { isSelected, isDefaultExpanded, isDisabled, disabledReason, nextLevel, handleChange, } = useLogic(props);
|
|
5
|
+
const { isSelected, isDefaultExpanded, isDisabled, disabledReason, nextLevel, handleChange, formControlLabelProps, } = useLogic(props);
|
|
7
6
|
const { item, prefixId, level, renderItem, value, isInitialExpanded, expandedLevel, chainToSelectedItem, disabledItems, onChange, isObjectMode, } = props;
|
|
8
7
|
const { id, label, note, children = [], options } = item;
|
|
8
|
+
const itemLabel = renderItem ? renderItem({ label, note, id }) : label;
|
|
9
9
|
if (children.length) {
|
|
10
|
-
return (_jsx(
|
|
10
|
+
return (_jsx(StyledTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDefaultExpanded: isDefaultExpanded, isForceExpanded: options?.isForceExpanded, isDisabled: isDisabled, disabledReason: disabledReason, component: "li", label: _jsx(StyledFormControlLabel, { control: _jsx(StyledRadio, { checked: isSelected, disabled: isDisabled, value: id }), label: itemLabel, ...formControlLabelProps }), note: renderItem ? null : note, mobileHeaderLabel: itemLabel, mobileHeaderControl: _jsx(StyledRadio, { checked: isSelected, disabled: isDisabled, value: id, onChange: handleChange }), level: level, onClick: handleChange, children: _jsx(List, { children: children.map((child) => (_jsx(TreeItem, { item: child, prefixId: prefixId, renderItem: renderItem, level: nextLevel, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, chainToSelectedItem: chainToSelectedItem, disabledItems: disabledItems, value: value, onChange: onChange, isObjectMode: isObjectMode }, child.id))) }) }));
|
|
11
11
|
}
|
|
12
|
-
return (_jsx(
|
|
12
|
+
return (_jsx(StyledTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDisabled: isDisabled, disabledReason: disabledReason, note: renderItem ? null : note, component: "li", label: _jsx(StyledFormControlLabel, { control: _jsx(StyledRadio, { checked: isSelected, disabled: isDisabled, value: id }), label: itemLabel, ...formControlLabelProps }), level: level, onClick: handleChange }));
|
|
13
13
|
};
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const StyledRadio: import("../../../styled").StyledComponent<import("react").HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
checked?: boolean | undefined;
|
|
4
|
+
isError?: boolean | undefined;
|
|
5
|
+
onChange?: ((event: import("react").ChangeEvent<HTMLInputElement, Element>, checked: boolean) => void) | undefined;
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
value?: string | undefined;
|
|
8
|
+
autoFocus?: boolean | undefined;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
style?: import("react").CSSProperties | undefined;
|
|
11
|
+
inputRef?: import("react").RefObject<HTMLInputElement> | undefined;
|
|
12
|
+
} & import("react").RefAttributes<HTMLInputElement> & {
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
export declare const StyledTreeItem: import("../../../styled").StyledComponent<Omit<import("../../TreeItem").TreeItemProps, "ref"> & import("react").RefAttributes<HTMLLIElement> & {
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
}, {}, {}>;
|
|
2
18
|
export declare const List: import("../../../styled").StyledComponent<{
|
|
3
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
20
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
21
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
22
|
+
export declare const StyledFormControlLabel: import("../../../styled").StyledComponent<import("@mui/material/FormControlLabel").FormControlLabelProps & {
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
}, {}, {}>;
|
|
@@ -1,5 +1,41 @@
|
|
|
1
|
+
import FormControlLabel, { formControlLabelClasses, } from '@mui/material/FormControlLabel';
|
|
2
|
+
import { MOBILE_RADIO_SIZE, Radio, radioClassnames } from '../../../Radio';
|
|
1
3
|
import { styled } from '../../../styled';
|
|
2
4
|
import { listContainer } from '../../../styled/mixins';
|
|
5
|
+
import { TreeItem, treeClassnames } from '../../TreeItem';
|
|
6
|
+
export const StyledRadio = styled(Radio) `
|
|
7
|
+
${({ theme }) => theme.breakpoints.up('sm')} {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
12
|
+
height: 20px;
|
|
13
|
+
|
|
14
|
+
& .${radioClassnames.iconWrapper}, & .${radioClassnames.input} {
|
|
15
|
+
height: 20px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
export const StyledTreeItem = styled(TreeItem) `
|
|
20
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
|
+
.${treeClassnames.note} {
|
|
22
|
+
|
|
23
|
+
/* Добавляем к отступу ширину контейнера с радио кнопкой */
|
|
24
|
+
margin-left: ${({ theme }) => `calc(${theme.spacing(1)} + ${MOBILE_RADIO_SIZE})`};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
3
28
|
export const List = styled.ul `
|
|
4
29
|
${listContainer}
|
|
5
30
|
`;
|
|
31
|
+
export const StyledFormControlLabel = styled(FormControlLabel) `
|
|
32
|
+
margin-left: 0;
|
|
33
|
+
|
|
34
|
+
& .${formControlLabelClasses.label} {
|
|
35
|
+
margin-left: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
39
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SyntheticEvent } from 'react';
|
|
1
2
|
import type { TreeListItemValue } from '../../types';
|
|
2
3
|
import { type TreeItemProps } from '../types';
|
|
3
4
|
type UseLogicProps<TValue extends TreeListItemValue = string> = TreeItemProps<TValue>;
|
|
@@ -8,5 +9,10 @@ export declare const useLogic: <TValue extends TreeListItemValue = string>({ val
|
|
|
8
9
|
disabledReason: string | undefined;
|
|
9
10
|
nextLevel: number;
|
|
10
11
|
handleChange: () => void | undefined;
|
|
12
|
+
formControlLabelProps: {
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
onChange: () => void | undefined;
|
|
15
|
+
onClick: (event: SyntheticEvent) => void;
|
|
16
|
+
};
|
|
11
17
|
};
|
|
12
18
|
export {};
|
|
@@ -27,6 +27,12 @@ export const useLogic = ({ value, level, item, isInitialExpanded, expandedLevel,
|
|
|
27
27
|
}
|
|
28
28
|
return onChange?.(id);
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Предотвращаем всплытие события, так как клик в области radio или label вызывает обработчик на уровне всего item
|
|
32
|
+
*/
|
|
33
|
+
const handleClick = (event) => {
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
};
|
|
30
36
|
return {
|
|
31
37
|
isSelected,
|
|
32
38
|
isDefaultExpanded,
|
|
@@ -34,5 +40,10 @@ export const useLogic = ({ value, level, item, isInitialExpanded, expandedLevel,
|
|
|
34
40
|
disabledReason,
|
|
35
41
|
nextLevel,
|
|
36
42
|
handleChange,
|
|
43
|
+
formControlLabelProps: {
|
|
44
|
+
disabled: isDisabled,
|
|
45
|
+
onChange: handleChange,
|
|
46
|
+
onClick: handleClick,
|
|
47
|
+
},
|
|
37
48
|
};
|
|
38
49
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../../utils/cn';
|
|
3
3
|
import { treeListClassnames } from './constants';
|
|
4
|
-
import { List } from './styles';
|
|
4
|
+
import { List, ListWrapper } from './styles';
|
|
5
5
|
import { TreeItem } from './TreeItem';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
7
7
|
const INITIAL_LEVEL = 0;
|
|
8
8
|
export const TreeList = (props) => {
|
|
9
9
|
const { listProps, itemProps } = useLogic(props);
|
|
10
10
|
const { data, className, expandedLevel = 10, disabledItems, ...restProps } = props;
|
|
11
|
-
return (_jsx(List, { className: cn(className, treeListClassnames.list), ...listProps, children: data.map((item) => (_jsx(TreeItem, { item: item, level: INITIAL_LEVEL, expandedLevel: expandedLevel, ...itemProps, ...restProps }, item.id))) }));
|
|
11
|
+
return (_jsx(ListWrapper, { children: _jsx(List, { className: cn(className, treeListClassnames.list), ...listProps, children: data.map((item) => (_jsx(TreeItem, { item: item, level: INITIAL_LEVEL, expandedLevel: expandedLevel, ...itemProps, ...restProps }, item.id))) }) }));
|
|
12
12
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const ListWrapper: 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>, {}>;
|
|
2
6
|
export declare const List: import("../../styled").StyledComponent<{
|
|
3
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { styled } from '../../styled';
|
|
2
2
|
import { listContainer } from '../../styled/mixins';
|
|
3
|
+
export const ListWrapper = styled.div `
|
|
4
|
+
display: contents;
|
|
5
|
+
|
|
6
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
7
|
+
position: relative;
|
|
8
|
+
z-index: 0;
|
|
9
|
+
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
|
|
13
|
+
height: 100%;
|
|
14
|
+
min-height: 0;
|
|
15
|
+
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
|
|
18
|
+
transform: translateZ(0);
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
3
21
|
export const List = styled.ul `
|
|
4
22
|
${listContainer};
|
|
23
|
+
position: relative;
|
|
5
24
|
overflow: hidden;
|
|
25
|
+
|
|
26
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
27
|
+
flex-grow: 1;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
|
|
30
|
+
overflow-y: auto;
|
|
31
|
+
}
|
|
6
32
|
`;
|