@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
|
@@ -9,4 +9,31 @@ export declare const TreeListWrapper: import("../../styled").StyledComponent<{
|
|
|
9
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
10
10
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
11
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const SearchFieldWrapper: import("../../styled").StyledComponent<{
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
15
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
16
|
+
export declare const StyledPaper: import("../../styled").StyledComponent<Omit<import("../../Paper").PaperProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
}, {}, {}>;
|
|
19
|
+
export declare const CancelButton: import("../../styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
20
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
21
|
+
loading?: boolean | undefined;
|
|
22
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
23
|
+
component?: import("react").ElementType | undefined;
|
|
24
|
+
selected?: boolean | undefined;
|
|
25
|
+
size?: "large" | "medium" | undefined;
|
|
26
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
27
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
28
|
+
}, {}, {}>;
|
|
29
|
+
export declare const ResetButton: import("../../styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
30
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
31
|
+
loading?: boolean | undefined;
|
|
32
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
33
|
+
component?: import("react").ElementType | undefined;
|
|
34
|
+
selected?: boolean | undefined;
|
|
35
|
+
size?: "large" | "medium" | undefined;
|
|
36
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
37
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
38
|
+
}, {}, {}>;
|
|
12
39
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { paperClasses } from '@mui/material/Paper';
|
|
2
|
+
import { DEFAULT_HEADER_HEIGHT, OFFSET_TOP_SCREEN } from '../../BottomDrawer';
|
|
3
|
+
import { Button } from '../../Button';
|
|
1
4
|
import { DIALOG_SIZES } from '../../Dialog';
|
|
2
5
|
import { DialogContent } from '../../DialogContent';
|
|
6
|
+
import { Paper } from '../../Paper';
|
|
3
7
|
import { styled } from '../../styled';
|
|
4
8
|
export const StyledDialogContent = styled(DialogContent, {
|
|
5
9
|
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
@@ -11,9 +15,20 @@ export const StyledDialogContent = styled(DialogContent, {
|
|
|
11
15
|
|
|
12
16
|
width: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
13
17
|
height: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
14
|
-
|
|
18
|
+
|
|
15
19
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
16
20
|
width: auto;
|
|
21
|
+
padding: 0;
|
|
22
|
+
gap: ${({ theme }) => theme.spacing(3)};
|
|
23
|
+
|
|
24
|
+
height: calc(100vh - ${OFFSET_TOP_SCREEN} - ${DEFAULT_HEADER_HEIGHT}px - 72px);
|
|
25
|
+
|
|
26
|
+
/* Причина игнора: Прогрессивное улучшение */
|
|
27
|
+
/* stylelint-disable plugin/no-unsupported-browser-features */
|
|
28
|
+
@supports (height: 100dvh) {
|
|
29
|
+
height: calc(100dvh - ${OFFSET_TOP_SCREEN} - ${DEFAULT_HEADER_HEIGHT}px - 72px);
|
|
30
|
+
}
|
|
31
|
+
/* stylelint-enable plugin/no-unsupported-browser-features */
|
|
17
32
|
}
|
|
18
33
|
`;
|
|
19
34
|
export const TreeListWrapper = styled.div `
|
|
@@ -21,3 +36,31 @@ export const TreeListWrapper = styled.div `
|
|
|
21
36
|
|
|
22
37
|
height: 100%;
|
|
23
38
|
`;
|
|
39
|
+
export const SearchFieldWrapper = styled.div `
|
|
40
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
41
|
+
padding: ${({ theme }) => theme.spacing(3, 4, 0)};
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
export const StyledPaper = styled(Paper) `
|
|
45
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
46
|
+
&.${paperClasses.root} {
|
|
47
|
+
border-top-left-radius: 0;
|
|
48
|
+
border-top-right-radius: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
border: unset;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
export const CancelButton = styled(Button) `
|
|
55
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
export const ResetButton = styled(Button) `
|
|
60
|
+
display: none;
|
|
61
|
+
|
|
62
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
63
|
+
display: flex;
|
|
64
|
+
margin-left: auto;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
@@ -13,6 +13,7 @@ type UseLogicResult = {
|
|
|
13
13
|
treeLikeListProps: TreeLikeListProps;
|
|
14
14
|
cancelButtonProps: ButtonProps;
|
|
15
15
|
confirmButtonProps: ButtonProps;
|
|
16
|
+
resetButtonProps: ButtonProps;
|
|
16
17
|
};
|
|
17
18
|
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size, }: UseLogicParams) => UseLogicResult;
|
|
18
19
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState, } from 'react';
|
|
2
2
|
import { deepMap } from '../../../utils/array';
|
|
3
|
+
import { checkIsDeepEqual } from '../../../utils/checkIsDeepEqual';
|
|
3
4
|
import { findInTree } from './utils';
|
|
4
5
|
export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size = 'md', }) => {
|
|
5
6
|
const [value, setValue] = useState(initialValue);
|
|
@@ -41,8 +42,16 @@ export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, opti
|
|
|
41
42
|
onChange?.(value);
|
|
42
43
|
onClose?.(event, 'escapeKeyDown');
|
|
43
44
|
};
|
|
45
|
+
const handleReset = () => {
|
|
46
|
+
const isSameAsInitial = checkIsDeepEqual([...(value ?? [])].sort(), [...(initialValue ?? [])].sort());
|
|
47
|
+
if (!isSameAsInitial) {
|
|
48
|
+
setValue(initialValue);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
setValue(undefined);
|
|
52
|
+
};
|
|
44
53
|
const isNoResult = Boolean(searchValue) && !filteredOptions.length;
|
|
45
|
-
const isDisabledButton =
|
|
54
|
+
const isDisabledButton = isNoResult || (!value?.length && !initialValue?.length);
|
|
46
55
|
return {
|
|
47
56
|
isNoResult,
|
|
48
57
|
modalProps: {
|
|
@@ -66,5 +75,9 @@ export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, opti
|
|
|
66
75
|
disabled: isDisabledButton,
|
|
67
76
|
onClick: handleClick,
|
|
68
77
|
},
|
|
78
|
+
resetButtonProps: {
|
|
79
|
+
disabled: !value?.length,
|
|
80
|
+
onClick: handleReset,
|
|
81
|
+
},
|
|
69
82
|
};
|
|
70
83
|
};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../../Button';
|
|
3
|
+
import { ClickAwayListener } from '../../ClickAwayListener';
|
|
3
4
|
import { FormControlLabel } from '../../FormControlLabel';
|
|
4
|
-
import { List, PopoverContent, StyledCheckbox, StyledTooltip, StyledTreeItem, } from './styles';
|
|
5
|
+
import { ConfirmChildrenButton, ConfirmChildrenCollapse, List, PopoverContent, StyledCheckbox, StyledTooltip, StyledTreeItem, } from './styles';
|
|
5
6
|
import { useLogic } from './useLogic';
|
|
6
7
|
export const TreeItem = (props) => {
|
|
7
|
-
const { isSelected, isDefaultExpanded, disabledReason, isDisabled, nextLevel, formControlLabelProps,
|
|
8
|
+
const { isSelected, isDefaultExpanded, disabledReason, isDisabled, nextLevel, formControlLabelProps, confirmChildrenProps, confirmChildrenButtonProps, handleChange, handleMobileOpenChange, isMobile, isMobilePanelOpen, isConfirmChildrenAvailable, itemRef, confirmChildrenExcludeNodes, } = useLogic(props);
|
|
8
9
|
const { item, prefixId, level, renderItem, value, isConfirmChildrenSelection, isInitialExpanded, expandedLevel, chainsToSelectedItem, disabledItems, onChange, isObjectMode, } = props;
|
|
9
10
|
const { id, label, note, children = [], options } = item;
|
|
11
|
+
const itemLabel = renderItem ? renderItem({ label, note, id }) : label;
|
|
12
|
+
const confirmChildrenButtonLabel = !isSelected
|
|
13
|
+
? 'Исключить дочерние'
|
|
14
|
+
: 'Выбрать дочерние';
|
|
15
|
+
const renderConfirmChildrenCollapse = () => (_jsx(ConfirmChildrenCollapse, { in: confirmChildrenProps.open, unmountOnExit: true, children: _jsx(ConfirmChildrenButton, { variant: "light", ...confirmChildrenButtonProps, children: confirmChildrenButtonLabel }) }));
|
|
10
16
|
if (children.length) {
|
|
11
|
-
|
|
17
|
+
const checkbox = _jsx(StyledCheckbox, { checked: isSelected });
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledTreeItem, { ref: itemRef, id: id, prefixId: prefixId, isSelected: isSelected, isDefaultExpanded: isDefaultExpanded, isForceExpanded: options?.isForceExpanded, disabledReason: disabledReason, isDisabled: isDisabled, note: renderItem ? null : note, isNotBlockingExpandList: true, component: "li", label: _jsx(FormControlLabel, { control: isMobile ? (checkbox) : (_jsx(StyledTooltip, { arrow: false, placement: "right", leaveDelay: 250, title: _jsx(PopoverContent, { children: _jsx(Button, { variant: "light", ...confirmChildrenButtonProps, children: confirmChildrenButtonLabel }) }), ...confirmChildrenProps, children: checkbox })), label: itemLabel, ...formControlLabelProps }), mobileHeaderLabel: itemLabel, mobileHeaderControl: _jsx(StyledCheckbox, { checked: isSelected, disabled: isDisabled, onChange: handleChange }), mobileHeaderAdditionalContent: isConfirmChildrenAvailable && isMobilePanelOpen ? (_jsx(ClickAwayListener, { isActive: confirmChildrenProps.open, onClickAway: confirmChildrenProps.onClose, children: renderConfirmChildrenCollapse() })) : undefined, level: level, onClick: handleChange, onMobilePanelOpenChange: handleMobileOpenChange, children: _jsx(List, { children: children.map((child) => (_jsx(TreeItem, { isObjectMode: isObjectMode, prefixId: prefixId, item: child, renderItem: renderItem, level: nextLevel, isConfirmChildrenSelection: isConfirmChildrenSelection, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, chainsToSelectedItem: chainsToSelectedItem, disabledItems: disabledItems, value: value, onChange: onChange }, child.id))) }) }), isConfirmChildrenAvailable && !isMobilePanelOpen && (_jsx(ClickAwayListener, { isActive: confirmChildrenProps.open, excludeNodes: confirmChildrenExcludeNodes, onClickAway: confirmChildrenProps.onClose, children: _jsx("li", { children: renderConfirmChildrenCollapse() }) }))] }));
|
|
12
19
|
}
|
|
13
20
|
return (_jsx(StyledTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDisabled: isDisabled, disabledReason: disabledReason, note: renderItem ? null : note, component: "li", label: _jsx(FormControlLabel, { control: _jsx(StyledCheckbox, { checked: isSelected }), label: renderItem ? renderItem({ label, note, id }) : label, ...formControlLabelProps }), level: level, onClick: handleChange }));
|
|
14
21
|
};
|
|
@@ -14,23 +14,7 @@ export declare const StyledCheckbox: import("../../styled").StyledComponent<impo
|
|
|
14
14
|
} & import("react").RefAttributes<HTMLInputElement> & {
|
|
15
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
16
|
}, {}, {}>;
|
|
17
|
-
export declare const StyledTreeItem: import("../../styled").StyledComponent<{
|
|
18
|
-
className?: string | undefined;
|
|
19
|
-
prefixId?: string | undefined;
|
|
20
|
-
isSelected: boolean;
|
|
21
|
-
label: import("react").ReactNode;
|
|
22
|
-
note?: import("react").ReactNode;
|
|
23
|
-
renderItem?: import("../..").SyncFunctionComponent<Omit<import("../../Tree").TreeListData, "children">> | undefined;
|
|
24
|
-
children?: import("react").ReactNode;
|
|
25
|
-
component?: import("react").ElementType | undefined;
|
|
26
|
-
level: number;
|
|
27
|
-
isDisabled?: boolean | undefined;
|
|
28
|
-
disabledReason?: string | undefined;
|
|
29
|
-
isNotBlockingExpandList?: boolean | undefined;
|
|
30
|
-
isDefaultExpanded?: boolean | undefined;
|
|
31
|
-
isForceExpanded?: boolean | undefined;
|
|
32
|
-
onClick?: ((event: import("react").SyntheticEvent<Element, Event>) => void) | undefined;
|
|
33
|
-
} & Omit<any, ""> & {
|
|
17
|
+
export declare const StyledTreeItem: import("../../styled").StyledComponent<Omit<import("../../Tree/TreeItem").TreeItemProps, "ref"> & import("react").RefAttributes<HTMLLIElement> & {
|
|
34
18
|
theme?: import("@emotion/react").Theme | undefined;
|
|
35
19
|
}, {}, {}>;
|
|
36
20
|
export declare const List: import("../../styled").StyledComponent<{
|
|
@@ -44,3 +28,16 @@ export declare const PopoverContent: import("../../styled").StyledComponent<{
|
|
|
44
28
|
theme?: import("@emotion/react").Theme | undefined;
|
|
45
29
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
46
30
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
31
|
+
export declare const ConfirmChildrenCollapse: import("../../styled").StyledComponent<import("../../Collapse").CollapseProps & {
|
|
32
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
+
}, {}, {}>;
|
|
34
|
+
export declare const ConfirmChildrenButton: import("../../styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
35
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
36
|
+
loading?: boolean | undefined;
|
|
37
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
38
|
+
component?: import("react").ElementType | undefined;
|
|
39
|
+
selected?: boolean | undefined;
|
|
40
|
+
size?: "large" | "medium" | undefined;
|
|
41
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
42
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
43
|
+
}, {}, {}>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { formControlLabelClasses } from '@mui/material/FormControlLabel';
|
|
1
2
|
import { tooltipClasses } from '@mui/material/Tooltip';
|
|
2
|
-
import {
|
|
3
|
+
import { Button } from '../../Button';
|
|
4
|
+
import { Checkbox, checkboxClassnames, MOBILE_CHECKBOX_SIZE, } from '../../Checkbox';
|
|
5
|
+
import { Collapse } from '../../Collapse';
|
|
3
6
|
import { styled } from '../../styled';
|
|
4
7
|
import { listContainer } from '../../styled/mixins';
|
|
5
8
|
import { Tooltip } from '../../Tooltip';
|
|
@@ -7,6 +10,14 @@ import { TreeItem, treeClassnames } from '../../Tree';
|
|
|
7
10
|
export const StyledCheckbox = styled(Checkbox) `
|
|
8
11
|
padding-top: 0;
|
|
9
12
|
padding-bottom: 0;
|
|
13
|
+
|
|
14
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
15
|
+
height: 20px;
|
|
16
|
+
|
|
17
|
+
& .${checkboxClassnames.iconWrapper}, & .${checkboxClassnames.input} {
|
|
18
|
+
height: 20px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
10
21
|
`;
|
|
11
22
|
export const StyledTreeItem = styled(TreeItem) `
|
|
12
23
|
.${treeClassnames.note} {
|
|
@@ -15,6 +26,21 @@ export const StyledTreeItem = styled(TreeItem) `
|
|
|
15
26
|
/* Добавляем к отступу ширину контейнера с чекбоксом */
|
|
16
27
|
margin-left: ${({ theme }) => `calc(${theme.spacing(1)} + 32px)`};
|
|
17
28
|
}
|
|
29
|
+
|
|
30
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
31
|
+
& .${formControlLabelClasses.root} {
|
|
32
|
+
margin-left: 0;
|
|
33
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
& .${formControlLabelClasses.root} .${formControlLabelClasses.label} {
|
|
37
|
+
margin-left: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
& .${treeClassnames.note} {
|
|
41
|
+
margin-left: ${({ theme }) => `calc(${theme.spacing(1)} + ${MOBILE_CHECKBOX_SIZE})`};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
18
44
|
`;
|
|
19
45
|
export const List = styled.ul `
|
|
20
46
|
${listContainer};
|
|
@@ -29,4 +55,25 @@ export const StyledTooltip = styled(Tooltip) `
|
|
|
29
55
|
`;
|
|
30
56
|
export const PopoverContent = styled.div `
|
|
31
57
|
padding: ${({ theme }) => theme.spacing(1)};
|
|
58
|
+
|
|
59
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
60
|
+
padding: ${({ theme }) => theme.spacing(3, 2)};
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
export const ConfirmChildrenCollapse = styled(Collapse) `
|
|
64
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
65
|
+
border-bottom: 1px solid
|
|
66
|
+
${({ theme }) => theme.palette.components.border.default};
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
export const ConfirmChildrenButton = styled(Button) `
|
|
70
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
71
|
+
justify-content: flex-start;
|
|
72
|
+
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: auto;
|
|
75
|
+
padding: ${({ theme }) => theme.spacing(3, 4)};
|
|
76
|
+
|
|
77
|
+
border-radius: 0;
|
|
78
|
+
}
|
|
32
79
|
`;
|
|
@@ -8,18 +8,24 @@ export declare const useLogic: <TValue extends MultipleValue = string[]>({ item,
|
|
|
8
8
|
isDisabled: boolean;
|
|
9
9
|
disabledReason: string | undefined;
|
|
10
10
|
nextLevel: number;
|
|
11
|
+
confirmChildrenExcludeNodes: import("react").RefObject<HTMLLIElement | null>[];
|
|
12
|
+
itemRef: import("react").RefObject<HTMLLIElement | null>;
|
|
11
13
|
formControlLabelProps: {
|
|
12
14
|
disabled: boolean;
|
|
13
15
|
onChange: () => void;
|
|
14
16
|
onClick: (event: SyntheticEvent) => void;
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
confirmChildrenProps: {
|
|
17
19
|
open: boolean;
|
|
18
20
|
onClose: (...a: unknown[]) => void;
|
|
19
21
|
};
|
|
20
22
|
confirmChildrenButtonProps: {
|
|
21
|
-
onClick: () => void;
|
|
23
|
+
onClick: (event: SyntheticEvent) => void;
|
|
22
24
|
};
|
|
23
25
|
handleChange: () => void;
|
|
26
|
+
handleMobileOpenChange: (isOpen: boolean) => void;
|
|
27
|
+
isMobile: boolean;
|
|
28
|
+
isMobilePanelOpen: boolean;
|
|
29
|
+
isConfirmChildrenAvailable: boolean | undefined;
|
|
24
30
|
};
|
|
25
31
|
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { useToggle } from '../../../useToggle';
|
|
3
|
+
import { useViewportType } from '../../../useViewportType';
|
|
3
4
|
import { addItem, addItemsByIds, checkIsSelected, getAllChildrenId, getCurrentValueIds, removeItem, removeItemsByIds, } from './utils';
|
|
4
5
|
export const useLogic = ({ item, value = [], level, isConfirmChildrenSelection, isInitialExpanded, expandedLevel, chainsToSelectedItem = [], disabledItems, onChange, isObjectMode, }) => {
|
|
5
6
|
const { id, children } = item;
|
|
6
|
-
const [
|
|
7
|
+
const [isConfirmChildrenOpen, openConfirmChildren, closeConfirmChildren] = useToggle();
|
|
8
|
+
const [isMobilePanelOpen, setIsMobilePanelOpen] = useState(false);
|
|
9
|
+
const itemRef = useRef(null);
|
|
10
|
+
const { isMobile } = useViewportType();
|
|
7
11
|
const childrenIds = useMemo(() => getAllChildrenId(children, disabledItems), [children, disabledItems]);
|
|
8
12
|
const isSelected = checkIsSelected(value, id);
|
|
9
13
|
const flatChainsToSelectedItem = useMemo(() => chainsToSelectedItem?.reduce((acc, chain) => acc.concat(chain), []), [chainsToSelectedItem]);
|
|
@@ -13,6 +17,16 @@ export const useLogic = ({ item, value = [], level, isConfirmChildrenSelection,
|
|
|
13
17
|
const isDisabled = Boolean(disabledItem);
|
|
14
18
|
const disabledReason = disabledItem?.disabledReason;
|
|
15
19
|
const nextLevel = level + 1;
|
|
20
|
+
const toggleConfirmChildren = (isOpen) => {
|
|
21
|
+
if (!isConfirmChildrenSelection) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (isOpen) {
|
|
25
|
+
openConfirmChildren();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
closeConfirmChildren();
|
|
29
|
+
};
|
|
16
30
|
const handleChange = () => {
|
|
17
31
|
if (isDisabled) {
|
|
18
32
|
return;
|
|
@@ -21,9 +35,7 @@ export const useLogic = ({ item, value = [], level, isConfirmChildrenSelection,
|
|
|
21
35
|
// Сбрасываем значение
|
|
22
36
|
if (currentValueIds.includes(id)) {
|
|
23
37
|
const hasSelectedChildren = childrenIds.some((childrenId) => currentValueIds.includes(childrenId));
|
|
24
|
-
|
|
25
|
-
openTooltip();
|
|
26
|
-
}
|
|
38
|
+
toggleConfirmChildren(hasSelectedChildren);
|
|
27
39
|
const newValue = removeItem(value, id);
|
|
28
40
|
return onChange(newValue);
|
|
29
41
|
}
|
|
@@ -31,11 +43,14 @@ export const useLogic = ({ item, value = [], level, isConfirmChildrenSelection,
|
|
|
31
43
|
const newValue = addItem(value, item, isObjectMode);
|
|
32
44
|
onChange(newValue);
|
|
33
45
|
const isAllChildrenSelected = childrenIds.every((childrenId) => currentValueIds.includes(childrenId));
|
|
34
|
-
|
|
35
|
-
openTooltip();
|
|
36
|
-
}
|
|
46
|
+
toggleConfirmChildren(!isAllChildrenSelected);
|
|
37
47
|
};
|
|
38
|
-
const
|
|
48
|
+
const handleMobileOpenChange = (isOpen) => {
|
|
49
|
+
setIsMobilePanelOpen(isOpen);
|
|
50
|
+
closeConfirmChildren();
|
|
51
|
+
};
|
|
52
|
+
const handleConfirmChildrenSelection = (event) => {
|
|
53
|
+
event.stopPropagation();
|
|
39
54
|
const currentValueIds = getCurrentValueIds(value);
|
|
40
55
|
if (isSelected) {
|
|
41
56
|
// Элемент выбран - выбираем все дочерние элементы
|
|
@@ -49,7 +64,7 @@ export const useLogic = ({ item, value = [], level, isConfirmChildrenSelection,
|
|
|
49
64
|
const newValue = removeItemsByIds(value, idsToRemove);
|
|
50
65
|
onChange(newValue);
|
|
51
66
|
}
|
|
52
|
-
|
|
67
|
+
closeConfirmChildren();
|
|
53
68
|
};
|
|
54
69
|
/**
|
|
55
70
|
* Предотвращаем всплытие события, так как клик в области чекбокса или label вызывает обработчик на уровне всего item
|
|
@@ -57,24 +72,31 @@ export const useLogic = ({ item, value = [], level, isConfirmChildrenSelection,
|
|
|
57
72
|
const handleClick = (event) => {
|
|
58
73
|
event.stopPropagation();
|
|
59
74
|
};
|
|
75
|
+
const confirmChildrenExcludeNodes = useMemo(() => [itemRef], []);
|
|
60
76
|
return {
|
|
61
77
|
isSelected,
|
|
62
78
|
isDefaultExpanded,
|
|
63
79
|
isDisabled,
|
|
64
80
|
disabledReason,
|
|
65
81
|
nextLevel,
|
|
82
|
+
confirmChildrenExcludeNodes,
|
|
83
|
+
itemRef,
|
|
66
84
|
formControlLabelProps: {
|
|
67
85
|
disabled: isDisabled,
|
|
68
86
|
onChange: handleChange,
|
|
69
87
|
onClick: handleClick,
|
|
70
88
|
},
|
|
71
|
-
|
|
72
|
-
open:
|
|
73
|
-
onClose:
|
|
89
|
+
confirmChildrenProps: {
|
|
90
|
+
open: isConfirmChildrenOpen,
|
|
91
|
+
onClose: closeConfirmChildren,
|
|
74
92
|
},
|
|
75
93
|
confirmChildrenButtonProps: {
|
|
76
94
|
onClick: handleConfirmChildrenSelection,
|
|
77
95
|
},
|
|
78
96
|
handleChange,
|
|
97
|
+
handleMobileOpenChange,
|
|
98
|
+
isMobile,
|
|
99
|
+
isMobilePanelOpen,
|
|
100
|
+
isConfirmChildrenAvailable: isMobile && isConfirmChildrenSelection,
|
|
79
101
|
};
|
|
80
102
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { treeListClassnames } from '../Tree';
|
|
3
3
|
import { cn } from '../utils/cn';
|
|
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 TreeLikeList = (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,8 +1,33 @@
|
|
|
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};
|
|
5
23
|
overflow: hidden;
|
|
24
|
+
|
|
25
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
26
|
+
flex-grow: 1;
|
|
27
|
+
min-height: 0;
|
|
28
|
+
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
}
|
|
6
31
|
`;
|
|
7
32
|
export const InnerList = styled(List) `
|
|
8
33
|
overflow: unset;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const makeFetchOptions: (options: string[]) => import("@vitest/spy").Mock<import("@vitest/spy").Procedure>;
|
|
2
|
+
export declare const makeEmptyFetchOptions: () => import("@vitest/spy").Mock<import("@vitest/spy").Procedure>;
|
|
3
|
+
export declare const makeErrorFetchOptions: (error: Error) => import("@vitest/spy").Mock<import("@vitest/spy").Procedure>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AutocompleteInputChangeReason } from '@mui/material/Autocomplete';
|
|
2
|
+
import { type ShouldFetch } from './types';
|
|
2
3
|
type FetchResult<TOptions> = {
|
|
3
4
|
options: TOptions[];
|
|
4
5
|
meta?: {
|
|
@@ -37,6 +38,10 @@ type UseAsyncOptionsParams<TOptions> = {
|
|
|
37
38
|
* Минимальное количество символов для выполнения запроса
|
|
38
39
|
*/
|
|
39
40
|
minSymbolsToFetch: number;
|
|
41
|
+
/**
|
|
42
|
+
* Функция, задающая правила валидации запроса
|
|
43
|
+
*/
|
|
44
|
+
shouldFetch?: ShouldFetch;
|
|
40
45
|
/**
|
|
41
46
|
* Задержка для debounce
|
|
42
47
|
*/
|
|
@@ -57,7 +62,7 @@ type UseAsyncOptionsParams<TOptions> = {
|
|
|
57
62
|
* Хук для асинхронной загрузки опций в компонентах с поиском.
|
|
58
63
|
* Управляет задержкой, отменой запросов и состояниями загрузки.
|
|
59
64
|
*/
|
|
60
|
-
export declare const useAsyncOptions: <TOptions>({ fetchOptions, fetchDelayMs, minSymbolsToFetch, onDataLoadError, isSmoothLoading, }: UseAsyncOptionsParams<TOptions>) => {
|
|
65
|
+
export declare const useAsyncOptions: <TOptions>({ fetchOptions, fetchDelayMs, minSymbolsToFetch, shouldFetch, onDataLoadError, isSmoothLoading, }: UseAsyncOptionsParams<TOptions>) => {
|
|
61
66
|
options: TOptions[];
|
|
62
67
|
meta: {
|
|
63
68
|
isAllDataLoaded: boolean;
|
|
@@ -65,6 +70,8 @@ export declare const useAsyncOptions: <TOptions>({ fetchOptions, fetchDelayMs, m
|
|
|
65
70
|
isLoadingData: boolean;
|
|
66
71
|
onRetry: (search: string) => void;
|
|
67
72
|
isLoadingError: boolean;
|
|
73
|
+
isAllow: boolean;
|
|
74
|
+
hintText: string;
|
|
68
75
|
debouncedFetchOptions: import("debounce").DebouncedFunction<(search: string) => void>;
|
|
69
76
|
onInputChange: (search: string, reason?: AutocompleteInputChangeReason) => void;
|
|
70
77
|
onOpen: (defaultSearch?: string, defaultValue?: TOptions | null | undefined, isAlwaysTriggerOnOpen?: boolean) => void;
|
|
@@ -5,12 +5,14 @@ import { useLoadingState } from '../useLoadingState';
|
|
|
5
5
|
* Хук для асинхронной загрузки опций в компонентах с поиском.
|
|
6
6
|
* Управляет задержкой, отменой запросов и состояниями загрузки.
|
|
7
7
|
*/
|
|
8
|
-
export const useAsyncOptions = ({ fetchOptions, fetchDelayMs, minSymbolsToFetch, onDataLoadError, isSmoothLoading, }) => {
|
|
8
|
+
export const useAsyncOptions = ({ fetchOptions, fetchDelayMs, minSymbolsToFetch, shouldFetch, onDataLoadError, isSmoothLoading, }) => {
|
|
9
9
|
const [isLoadingData, setIsLoadingData] = useState(false);
|
|
10
10
|
const [isFirstOpen, setIsFirstOpen] = useState(true);
|
|
11
11
|
const [isLoadingError, setIsLoadingError] = useState(false);
|
|
12
12
|
const abortControllerRef = useRef(null);
|
|
13
13
|
const { isShowLoader } = useLoadingState(isLoadingData);
|
|
14
|
+
const [isAllow, setIsAllow] = useState(true);
|
|
15
|
+
const [hintText, setHintText] = useState('');
|
|
14
16
|
const [options, setOptions] = useState({
|
|
15
17
|
options: [],
|
|
16
18
|
});
|
|
@@ -39,17 +41,32 @@ export const useAsyncOptions = ({ fetchOptions, fetchDelayMs, minSymbolsToFetch,
|
|
|
39
41
|
abortControllerRef.current = null;
|
|
40
42
|
});
|
|
41
43
|
}, fetchDelayMs), [fetchOptions, fetchDelayMs]);
|
|
42
|
-
const
|
|
44
|
+
const isAllowedSearch = (search) => {
|
|
43
45
|
if ((!search.length && minSymbolsToFetch > 0) ||
|
|
44
46
|
search.length < minSymbolsToFetch) {
|
|
47
|
+
setHintText('');
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const shouldFetchResult = shouldFetch?.(search);
|
|
51
|
+
if (shouldFetchResult && !shouldFetchResult.isAllow) {
|
|
52
|
+
setHintText(search.length !== 0 ? shouldFetchResult.reason : '');
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
};
|
|
57
|
+
const onInputChange = (search, reason) => {
|
|
58
|
+
if (!isAllowedSearch(search)) {
|
|
45
59
|
if (debouncedFetchOptions.isPending) {
|
|
46
60
|
debouncedFetchOptions.clear();
|
|
47
61
|
}
|
|
48
62
|
setIsLoadingData(false);
|
|
49
63
|
setOptions({ options: [] });
|
|
64
|
+
setIsAllow(false);
|
|
50
65
|
return;
|
|
51
66
|
}
|
|
52
67
|
if (!isFirstOpen) {
|
|
68
|
+
setIsAllow(true);
|
|
69
|
+
setHintText('');
|
|
53
70
|
if (reason === 'input') {
|
|
54
71
|
setIsLoadingData(true);
|
|
55
72
|
}
|
|
@@ -59,7 +76,7 @@ export const useAsyncOptions = ({ fetchOptions, fetchDelayMs, minSymbolsToFetch,
|
|
|
59
76
|
const onOpen = (defaultSearch = '', defaultValue, isAlwaysTriggerOnOpen = false) => {
|
|
60
77
|
if (isFirstOpen || isAlwaysTriggerOnOpen) {
|
|
61
78
|
setIsFirstOpen(false);
|
|
62
|
-
if (defaultValue ||
|
|
79
|
+
if (defaultValue || isAllowedSearch(defaultSearch)) {
|
|
63
80
|
setIsLoadingData(true);
|
|
64
81
|
debouncedFetchOptions(defaultSearch);
|
|
65
82
|
}
|
|
@@ -78,6 +95,8 @@ export const useAsyncOptions = ({ fetchOptions, fetchDelayMs, minSymbolsToFetch,
|
|
|
78
95
|
isLoadingData: isSmoothLoading ? isShowLoader : isLoadingData,
|
|
79
96
|
onRetry,
|
|
80
97
|
isLoadingError,
|
|
98
|
+
isAllow,
|
|
99
|
+
hintText,
|
|
81
100
|
debouncedFetchOptions,
|
|
82
101
|
onInputChange,
|
|
83
102
|
onOpen,
|
|
@@ -9,5 +9,6 @@ export declare const AsyncAutocomplete: <TOptions, TMultiple extends boolean = f
|
|
|
9
9
|
fetchDelayMs?: number | undefined;
|
|
10
10
|
fetchOptions: (search: string, signal?: AbortSignal | undefined) => Promise<TOptions[]>;
|
|
11
11
|
minSymbolsToFetch?: number | undefined;
|
|
12
|
+
shouldFetch?: import("../useAsyncOptions").ShouldFetch | undefined;
|
|
12
13
|
onDataLoadError?: ((error: Error) => void) | undefined;
|
|
13
14
|
} & import("react").RefAttributes<unknown>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|