@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
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserHintWrapper = exports.StyledSearchField = exports.TreeListWrapper = exports.StyledDialogContent = void 0;
|
|
3
|
+
exports.UserHintWrapper = exports.ResetButton = exports.CancelButton = exports.StyledPaper = exports.StyledSearchField = exports.CheckableTagWrapper = exports.SearchFieldWrapper = exports.TreeViewSlot = exports.TreeListWrapper = exports.StyledDialogContent = void 0;
|
|
4
4
|
const FormHelperText_1 = require("@mui/material/FormHelperText");
|
|
5
|
+
const InputBase_1 = require("@mui/material/InputBase");
|
|
6
|
+
const Paper_1 = require("@mui/material/Paper");
|
|
7
|
+
const BottomDrawer_1 = require("../../BottomDrawer");
|
|
8
|
+
const Button_1 = require("../../Button");
|
|
5
9
|
const Dialog_1 = require("../../Dialog");
|
|
6
10
|
const DialogContent_1 = require("../../DialogContent");
|
|
11
|
+
const Loader_1 = require("../../Loader");
|
|
12
|
+
const Paper_2 = require("../../Paper");
|
|
7
13
|
const SearchField_1 = require("../../SearchField");
|
|
14
|
+
const SvgIcon_1 = require("../../SvgIcon");
|
|
8
15
|
const styled_1 = require("../../styled");
|
|
16
|
+
const Tag_1 = require("../../Tag");
|
|
9
17
|
const Tree_1 = require("../../Tree");
|
|
10
18
|
exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent, {
|
|
11
19
|
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
@@ -17,29 +25,107 @@ exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent
|
|
|
17
25
|
|
|
18
26
|
width: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
19
27
|
height: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
20
|
-
|
|
28
|
+
|
|
21
29
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
22
30
|
width: auto;
|
|
31
|
+
padding: 0;
|
|
32
|
+
gap: ${({ theme }) => theme.spacing(3)};
|
|
33
|
+
|
|
34
|
+
height: calc(100vh - ${BottomDrawer_1.OFFSET_TOP_SCREEN} - ${BottomDrawer_1.DEFAULT_HEADER_HEIGHT}px - 72px);
|
|
35
|
+
|
|
36
|
+
/* Причина игнора: Прогрессивное улучшение */
|
|
37
|
+
/* stylelint-disable plugin/no-unsupported-browser-features */
|
|
38
|
+
@supports (height: 100dvh) {
|
|
39
|
+
height: calc(100dvh - ${BottomDrawer_1.OFFSET_TOP_SCREEN} - ${BottomDrawer_1.DEFAULT_HEADER_HEIGHT}px - 72px);
|
|
40
|
+
}
|
|
41
|
+
/* stylelint-enable plugin/no-unsupported-browser-features */
|
|
23
42
|
}
|
|
24
43
|
`;
|
|
25
44
|
exports.TreeListWrapper = styled_1.styled.div `
|
|
26
|
-
|
|
45
|
+
overflow: auto;
|
|
46
|
+
|
|
47
|
+
height: 100%;
|
|
27
48
|
|
|
28
|
-
height: 100%;
|
|
29
|
-
|
|
30
49
|
& .${Tree_1.treeListClassnames.list} {
|
|
31
50
|
width: auto;
|
|
32
51
|
min-width: max-content;
|
|
33
52
|
}
|
|
53
|
+
|
|
54
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
55
|
+
& .${Tree_1.treeListClassnames.list} {
|
|
56
|
+
min-width: unset;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* stylelint-disable plugin/no-unsupported-browser-features */
|
|
60
|
+
&:not(:has(.${Tree_1.treeListClassnames.list})) {
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
/* stylelint-enable plugin/no-unsupported-browser-features */
|
|
64
|
+
|
|
65
|
+
height: auto;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
exports.TreeViewSlot = styled_1.styled.div `
|
|
69
|
+
height: 100%;
|
|
70
|
+
`;
|
|
71
|
+
exports.SearchFieldWrapper = styled_1.styled.div `
|
|
72
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
73
|
+
padding: ${({ theme }) => theme.spacing(3, 4, 0)};
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
exports.CheckableTagWrapper = styled_1.styled.div `
|
|
77
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
78
|
+
padding: ${({ theme }) => theme.spacing(0, 4)};
|
|
79
|
+
|
|
80
|
+
& .${Tag_1.tagClassnames.root} {
|
|
81
|
+
width: 100%;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
34
84
|
`;
|
|
35
85
|
exports.StyledSearchField = (0, styled_1.styled)(SearchField_1.SearchField) `
|
|
36
86
|
& .${FormHelperText_1.formHelperTextClasses.root} {
|
|
37
87
|
display: flex;
|
|
38
88
|
|
|
39
89
|
margin-top: ${({ theme }) => theme.spacing(2)};
|
|
40
|
-
|
|
90
|
+
|
|
41
91
|
color: ${({ theme }) => theme.palette.grey[500]};
|
|
42
92
|
}
|
|
93
|
+
|
|
94
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
95
|
+
& .${FormHelperText_1.formHelperTextClasses.root} {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
& .${InputBase_1.inputBaseClasses.root}.${InputBase_1.inputBaseClasses.adornedEnd} .${Loader_1.loaderClassnames.root} .${SvgIcon_1.svgIconClassnames.root} {
|
|
100
|
+
width: 20px;
|
|
101
|
+
height: 20px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
exports.StyledPaper = (0, styled_1.styled)(Paper_2.Paper) `
|
|
106
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
107
|
+
&.${Paper_1.paperClasses.root} {
|
|
108
|
+
border-top-left-radius: 0;
|
|
109
|
+
border-top-right-radius: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
border: unset;
|
|
113
|
+
|
|
114
|
+
overflow: auto;
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
exports.CancelButton = (0, styled_1.styled)(Button_1.Button) `
|
|
118
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
119
|
+
display: none;
|
|
120
|
+
}
|
|
121
|
+
`;
|
|
122
|
+
exports.ResetButton = (0, styled_1.styled)(Button_1.Button) `
|
|
123
|
+
display: none;
|
|
124
|
+
|
|
125
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
126
|
+
display: flex;
|
|
127
|
+
margin-left: auto;
|
|
128
|
+
}
|
|
43
129
|
`;
|
|
44
130
|
exports.UserHintWrapper = styled_1.styled.div `
|
|
45
131
|
display: flex;
|
|
@@ -47,4 +133,9 @@ exports.UserHintWrapper = styled_1.styled.div `
|
|
|
47
133
|
justify-content: center;
|
|
48
134
|
|
|
49
135
|
height: 36px;
|
|
136
|
+
|
|
137
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
138
|
+
padding: ${({ theme }) => theme.spacing(3, 4)};
|
|
139
|
+
height: auto;
|
|
140
|
+
}
|
|
50
141
|
`;
|
|
@@ -16,6 +16,7 @@ type UseLogicResult = {
|
|
|
16
16
|
treeListProps: TreeLikeListProps<TreeLikeAsyncAutocompleteValue>;
|
|
17
17
|
cancelButtonProps: ButtonProps;
|
|
18
18
|
confirmButtonProps: ButtonProps;
|
|
19
|
+
resetButtonProps: ButtonProps;
|
|
19
20
|
handleRetry: () => void;
|
|
20
21
|
isShowUserHint?: boolean;
|
|
21
22
|
isShowModalLoader: boolean;
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const useViewportType_1 = require("../../../useViewportType");
|
|
5
6
|
const array_1 = require("../../../utils/array");
|
|
7
|
+
const checkIsDeepEqual_1 = require("../../../utils/checkIsDeepEqual");
|
|
6
8
|
const hooks_1 = require("./hooks");
|
|
7
9
|
const useLogic = ({ isOpen, initialValue, options, onChange, dialogProps, onInputChange, onRetry, meta, onShowUserHint, isLoadingModal, minSymbolsToFetch = 0, isLoading, isLoadingError, loadingErrorMsg, treeProps, }) => {
|
|
10
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
8
11
|
const [value, setValue] = (0, react_1.useState)(initialValue);
|
|
9
12
|
const [searchValue, setSearchValue] = (0, react_1.useState)();
|
|
10
13
|
const { onClose, ...restDialogProps } = dialogProps;
|
|
@@ -61,6 +64,14 @@ const useLogic = ({ isOpen, initialValue, options, onChange, dialogProps, onInpu
|
|
|
61
64
|
onChange?.(value);
|
|
62
65
|
onClose?.(event, 'escapeKeyDown');
|
|
63
66
|
};
|
|
67
|
+
const handleReset = () => {
|
|
68
|
+
const isSameAsInitial = (0, checkIsDeepEqual_1.checkIsDeepEqual)((value ?? []).map(({ id }) => id).sort(), (initialValue ?? []).map(({ id }) => id).sort());
|
|
69
|
+
if (!isSameAsInitial) {
|
|
70
|
+
setValue(initialValue);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
setValue(undefined);
|
|
74
|
+
};
|
|
64
75
|
// Определяем isNoResult в зависимости от режима
|
|
65
76
|
const isNoResult = (0, react_1.useMemo)(() => {
|
|
66
77
|
if (!searchValue) {
|
|
@@ -78,7 +89,7 @@ const useLogic = ({ isOpen, initialValue, options, onChange, dialogProps, onInpu
|
|
|
78
89
|
isNoResultInSelectedTree,
|
|
79
90
|
options.length,
|
|
80
91
|
]);
|
|
81
|
-
const isDisabledButton = !value
|
|
92
|
+
const isDisabledButton = isNoResult || (!value?.length && !initialValue?.length);
|
|
82
93
|
const handleRetry = () => {
|
|
83
94
|
onRetry?.(searchValue);
|
|
84
95
|
};
|
|
@@ -116,7 +127,7 @@ const useLogic = ({ isOpen, initialValue, options, onChange, dialogProps, onInpu
|
|
|
116
127
|
data: selectedTreeDataToRender,
|
|
117
128
|
onChange: handleChange,
|
|
118
129
|
isObjectMode: true,
|
|
119
|
-
isInitialExpanded:
|
|
130
|
+
isInitialExpanded: !isMobile,
|
|
120
131
|
},
|
|
121
132
|
modalProps: {
|
|
122
133
|
onClose: handleClose,
|
|
@@ -142,6 +153,10 @@ const useLogic = ({ isOpen, initialValue, options, onChange, dialogProps, onInpu
|
|
|
142
153
|
disabled: isDisabledButton,
|
|
143
154
|
onClick: handleClick,
|
|
144
155
|
},
|
|
156
|
+
resetButtonProps: {
|
|
157
|
+
disabled: !value?.length,
|
|
158
|
+
onClick: handleReset,
|
|
159
|
+
},
|
|
145
160
|
};
|
|
146
161
|
};
|
|
147
162
|
exports.useLogic = useLogic;
|
|
@@ -5,7 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const Button_1 = require("../../Button");
|
|
6
6
|
const Dialog_1 = require("../../Dialog");
|
|
7
7
|
const DialogActions_1 = require("../../DialogActions");
|
|
8
|
-
const Paper_1 = require("../../Paper");
|
|
9
8
|
const SearchField_1 = require("../../SearchField");
|
|
10
9
|
const TreeLikeList_1 = require("../../TreeLikeList");
|
|
11
10
|
const ErrorMessage_1 = require("./ErrorMessage");
|
|
@@ -14,8 +13,8 @@ const NoData_1 = require("./NoData");
|
|
|
14
13
|
const styles_1 = require("./styles");
|
|
15
14
|
const useLogic_1 = require("./useLogic");
|
|
16
15
|
const OptionsModal = (props) => {
|
|
17
|
-
const { isNoResult, searchFieldProps, modalProps, treeLikeListProps, cancelButtonProps, confirmButtonProps, } = (0, useLogic_1.useLogic)(props);
|
|
18
|
-
const { isOpen, initialValue, options, isConfirmChildrenSelection, isLoading, isLoadingError, loadingErrorMsg, treeProps, filterOptions, onChange, onRetry, onClose, ...externalDialogProps } = props;
|
|
16
|
+
const { isNoResult, searchFieldProps, modalProps, treeLikeListProps, cancelButtonProps, confirmButtonProps, resetButtonProps, } = (0, useLogic_1.useLogic)(props);
|
|
17
|
+
const { isOpen, initialValue, options, isConfirmChildrenSelection, isLoading, isLoadingError, loadingErrorMsg, treeProps, filterOptions, onChange, onRetry, onClose, headerContent, ...externalDialogProps } = props;
|
|
19
18
|
const renderComponent = () => {
|
|
20
19
|
if (isLoading) {
|
|
21
20
|
return (0, jsx_runtime_1.jsx)(Loader_1.Loader, {});
|
|
@@ -28,6 +27,6 @@ const OptionsModal = (props) => {
|
|
|
28
27
|
}
|
|
29
28
|
return ((0, jsx_runtime_1.jsx)(TreeLikeList_1.TreeLikeList, { isConfirmChildrenSelection: isConfirmChildrenSelection, ...treeProps, ...treeLikeListProps }));
|
|
30
29
|
};
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { ...externalDialogProps, disableRestoreFocus: true, open: isOpen, ...modalProps, children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { "$size": modalProps.size, children: [(0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { fullWidth: true, ...searchFieldProps }), (0, jsx_runtime_1.jsx)(
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { ...externalDialogProps, disableRestoreFocus: true, open: isOpen, ...modalProps, headerContent: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.ResetButton, { variant: "text", color: "primary", ...resetButtonProps, children: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C" }), headerContent] }), children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { "$size": modalProps.size, children: [(0, jsx_runtime_1.jsx)(styles_1.SearchFieldWrapper, { children: (0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { fullWidth: true, ...searchFieldProps }) }), (0, jsx_runtime_1.jsx)(styles_1.StyledPaper, { variant: "outlined", children: (0, jsx_runtime_1.jsx)(styles_1.TreeListWrapper, { children: renderComponent() }) })] }), (0, jsx_runtime_1.jsxs)(DialogActions_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(styles_1.CancelButton, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { ...confirmButtonProps, children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" })] })] }));
|
|
32
31
|
};
|
|
33
32
|
exports.OptionsModal = OptionsModal;
|
|
@@ -9,4 +9,31 @@ export declare const TreeListWrapper: import("@emotion/styled/dist/declarations/
|
|
|
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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../Paper").PaperProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
}, {}, {}>;
|
|
19
|
+
export declare const CancelButton: import("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TreeListWrapper = exports.StyledDialogContent = void 0;
|
|
3
|
+
exports.ResetButton = exports.CancelButton = exports.StyledPaper = exports.SearchFieldWrapper = exports.TreeListWrapper = exports.StyledDialogContent = void 0;
|
|
4
|
+
const Paper_1 = require("@mui/material/Paper");
|
|
5
|
+
const BottomDrawer_1 = require("../../BottomDrawer");
|
|
6
|
+
const Button_1 = require("../../Button");
|
|
4
7
|
const Dialog_1 = require("../../Dialog");
|
|
5
8
|
const DialogContent_1 = require("../../DialogContent");
|
|
9
|
+
const Paper_2 = require("../../Paper");
|
|
6
10
|
const styled_1 = require("../../styled");
|
|
7
11
|
exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent, {
|
|
8
12
|
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
@@ -14,9 +18,20 @@ exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent
|
|
|
14
18
|
|
|
15
19
|
width: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
16
20
|
height: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
17
|
-
|
|
21
|
+
|
|
18
22
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
19
23
|
width: auto;
|
|
24
|
+
padding: 0;
|
|
25
|
+
gap: ${({ theme }) => theme.spacing(3)};
|
|
26
|
+
|
|
27
|
+
height: calc(100vh - ${BottomDrawer_1.OFFSET_TOP_SCREEN} - ${BottomDrawer_1.DEFAULT_HEADER_HEIGHT}px - 72px);
|
|
28
|
+
|
|
29
|
+
/* Причина игнора: Прогрессивное улучшение */
|
|
30
|
+
/* stylelint-disable plugin/no-unsupported-browser-features */
|
|
31
|
+
@supports (height: 100dvh) {
|
|
32
|
+
height: calc(100dvh - ${BottomDrawer_1.OFFSET_TOP_SCREEN} - ${BottomDrawer_1.DEFAULT_HEADER_HEIGHT}px - 72px);
|
|
33
|
+
}
|
|
34
|
+
/* stylelint-enable plugin/no-unsupported-browser-features */
|
|
20
35
|
}
|
|
21
36
|
`;
|
|
22
37
|
exports.TreeListWrapper = styled_1.styled.div `
|
|
@@ -24,3 +39,31 @@ exports.TreeListWrapper = styled_1.styled.div `
|
|
|
24
39
|
|
|
25
40
|
height: 100%;
|
|
26
41
|
`;
|
|
42
|
+
exports.SearchFieldWrapper = styled_1.styled.div `
|
|
43
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
44
|
+
padding: ${({ theme }) => theme.spacing(3, 4, 0)};
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
exports.StyledPaper = (0, styled_1.styled)(Paper_2.Paper) `
|
|
48
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
49
|
+
&.${Paper_1.paperClasses.root} {
|
|
50
|
+
border-top-left-radius: 0;
|
|
51
|
+
border-top-right-radius: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
border: unset;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
exports.CancelButton = (0, styled_1.styled)(Button_1.Button) `
|
|
58
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
exports.ResetButton = (0, styled_1.styled)(Button_1.Button) `
|
|
63
|
+
display: none;
|
|
64
|
+
|
|
65
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
66
|
+
display: flex;
|
|
67
|
+
margin-left: auto;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
@@ -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 {};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const array_1 = require("../../../utils/array");
|
|
6
|
+
const checkIsDeepEqual_1 = require("../../../utils/checkIsDeepEqual");
|
|
6
7
|
const utils_1 = require("./utils");
|
|
7
8
|
const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size = 'md', }) => {
|
|
8
9
|
const [value, setValue] = (0, react_1.useState)(initialValue);
|
|
@@ -44,8 +45,16 @@ const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, fi
|
|
|
44
45
|
onChange?.(value);
|
|
45
46
|
onClose?.(event, 'escapeKeyDown');
|
|
46
47
|
};
|
|
48
|
+
const handleReset = () => {
|
|
49
|
+
const isSameAsInitial = (0, checkIsDeepEqual_1.checkIsDeepEqual)([...(value ?? [])].sort(), [...(initialValue ?? [])].sort());
|
|
50
|
+
if (!isSameAsInitial) {
|
|
51
|
+
setValue(initialValue);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
setValue(undefined);
|
|
55
|
+
};
|
|
47
56
|
const isNoResult = Boolean(searchValue) && !filteredOptions.length;
|
|
48
|
-
const isDisabledButton =
|
|
57
|
+
const isDisabledButton = isNoResult || (!value?.length && !initialValue?.length);
|
|
49
58
|
return {
|
|
50
59
|
isNoResult,
|
|
51
60
|
modalProps: {
|
|
@@ -69,6 +78,10 @@ const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, fi
|
|
|
69
78
|
disabled: isDisabledButton,
|
|
70
79
|
onClick: handleClick,
|
|
71
80
|
},
|
|
81
|
+
resetButtonProps: {
|
|
82
|
+
disabled: !value?.length,
|
|
83
|
+
onClick: handleReset,
|
|
84
|
+
},
|
|
72
85
|
};
|
|
73
86
|
};
|
|
74
87
|
exports.useLogic = useLogic;
|
|
@@ -3,15 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TreeItem = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const Button_1 = require("../../Button");
|
|
6
|
+
const ClickAwayListener_1 = require("../../ClickAwayListener");
|
|
6
7
|
const FormControlLabel_1 = require("../../FormControlLabel");
|
|
7
8
|
const styles_1 = require("./styles");
|
|
8
9
|
const useLogic_1 = require("./useLogic");
|
|
9
10
|
const TreeItem = (props) => {
|
|
10
|
-
const { isSelected, isDefaultExpanded, disabledReason, isDisabled, nextLevel, formControlLabelProps,
|
|
11
|
+
const { isSelected, isDefaultExpanded, disabledReason, isDisabled, nextLevel, formControlLabelProps, confirmChildrenProps, confirmChildrenButtonProps, handleChange, handleMobileOpenChange, isMobile, isMobilePanelOpen, isConfirmChildrenAvailable, itemRef, confirmChildrenExcludeNodes, } = (0, useLogic_1.useLogic)(props);
|
|
11
12
|
const { item, prefixId, level, renderItem, value, isConfirmChildrenSelection, isInitialExpanded, expandedLevel, chainsToSelectedItem, disabledItems, onChange, isObjectMode, } = props;
|
|
12
13
|
const { id, label, note, children = [], options } = item;
|
|
14
|
+
const itemLabel = renderItem ? renderItem({ label, note, id }) : label;
|
|
15
|
+
const confirmChildrenButtonLabel = !isSelected
|
|
16
|
+
? 'Исключить дочерние'
|
|
17
|
+
: 'Выбрать дочерние';
|
|
18
|
+
const renderConfirmChildrenCollapse = () => ((0, jsx_runtime_1.jsx)(styles_1.ConfirmChildrenCollapse, { in: confirmChildrenProps.open, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(styles_1.ConfirmChildrenButton, { variant: "light", ...confirmChildrenButtonProps, children: confirmChildrenButtonLabel }) }));
|
|
13
19
|
if (children.length) {
|
|
14
|
-
|
|
20
|
+
const checkbox = (0, jsx_runtime_1.jsx)(styles_1.StyledCheckbox, { checked: isSelected });
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.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: (0, jsx_runtime_1.jsx)(FormControlLabel_1.FormControlLabel, { control: isMobile ? (checkbox) : ((0, jsx_runtime_1.jsx)(styles_1.StyledTooltip, { arrow: false, placement: "right", leaveDelay: 250, title: (0, jsx_runtime_1.jsx)(styles_1.PopoverContent, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "light", ...confirmChildrenButtonProps, children: confirmChildrenButtonLabel }) }), ...confirmChildrenProps, children: checkbox })), label: itemLabel, ...formControlLabelProps }), mobileHeaderLabel: itemLabel, mobileHeaderControl: (0, jsx_runtime_1.jsx)(styles_1.StyledCheckbox, { checked: isSelected, disabled: isDisabled, onChange: handleChange }), mobileHeaderAdditionalContent: isConfirmChildrenAvailable && isMobilePanelOpen ? ((0, jsx_runtime_1.jsx)(ClickAwayListener_1.ClickAwayListener, { isActive: confirmChildrenProps.open, onClickAway: confirmChildrenProps.onClose, children: renderConfirmChildrenCollapse() })) : undefined, level: level, onClick: handleChange, onMobilePanelOpenChange: handleMobileOpenChange, children: (0, jsx_runtime_1.jsx)(styles_1.List, { children: children.map((child) => ((0, jsx_runtime_1.jsx)(exports.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 && ((0, jsx_runtime_1.jsx)(ClickAwayListener_1.ClickAwayListener, { isActive: confirmChildrenProps.open, excludeNodes: confirmChildrenExcludeNodes, onClickAway: confirmChildrenProps.onClose, children: (0, jsx_runtime_1.jsx)("li", { children: renderConfirmChildrenCollapse() }) }))] }));
|
|
15
22
|
}
|
|
16
23
|
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDisabled: isDisabled, disabledReason: disabledReason, note: renderItem ? null : note, component: "li", label: (0, jsx_runtime_1.jsx)(FormControlLabel_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(styles_1.StyledCheckbox, { checked: isSelected }), label: renderItem ? renderItem({ label, note, id }) : label, ...formControlLabelProps }), level: level, onClick: handleChange }));
|
|
17
24
|
};
|
|
@@ -14,23 +14,7 @@ export declare const StyledCheckbox: import("@emotion/styled/dist/declarations/s
|
|
|
14
14
|
} & import("react").RefAttributes<HTMLInputElement> & {
|
|
15
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
16
|
}, {}, {}>;
|
|
17
|
-
export declare const StyledTreeItem: import("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
@@ -44,3 +28,16 @@ export declare const PopoverContent: import("@emotion/styled/dist/declarations/s
|
|
|
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("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../Collapse").CollapseProps & {
|
|
32
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
+
}, {}, {}>;
|
|
34
|
+
export declare const ConfirmChildrenButton: import("@emotion/styled/dist/declarations/src/types").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,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PopoverContent = exports.StyledTooltip = exports.List = exports.StyledTreeItem = exports.StyledCheckbox = void 0;
|
|
3
|
+
exports.ConfirmChildrenButton = exports.ConfirmChildrenCollapse = exports.PopoverContent = exports.StyledTooltip = exports.List = exports.StyledTreeItem = exports.StyledCheckbox = void 0;
|
|
4
|
+
const FormControlLabel_1 = require("@mui/material/FormControlLabel");
|
|
4
5
|
const Tooltip_1 = require("@mui/material/Tooltip");
|
|
6
|
+
const Button_1 = require("../../Button");
|
|
5
7
|
const Checkbox_1 = require("../../Checkbox");
|
|
8
|
+
const Collapse_1 = require("../../Collapse");
|
|
6
9
|
const styled_1 = require("../../styled");
|
|
7
10
|
const mixins_1 = require("../../styled/mixins");
|
|
8
11
|
const Tooltip_2 = require("../../Tooltip");
|
|
@@ -10,6 +13,14 @@ const Tree_1 = require("../../Tree");
|
|
|
10
13
|
exports.StyledCheckbox = (0, styled_1.styled)(Checkbox_1.Checkbox) `
|
|
11
14
|
padding-top: 0;
|
|
12
15
|
padding-bottom: 0;
|
|
16
|
+
|
|
17
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
|
+
height: 20px;
|
|
19
|
+
|
|
20
|
+
& .${Checkbox_1.checkboxClassnames.iconWrapper}, & .${Checkbox_1.checkboxClassnames.input} {
|
|
21
|
+
height: 20px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
13
24
|
`;
|
|
14
25
|
exports.StyledTreeItem = (0, styled_1.styled)(Tree_1.TreeItem) `
|
|
15
26
|
.${Tree_1.treeClassnames.note} {
|
|
@@ -18,6 +29,21 @@ exports.StyledTreeItem = (0, styled_1.styled)(Tree_1.TreeItem) `
|
|
|
18
29
|
/* Добавляем к отступу ширину контейнера с чекбоксом */
|
|
19
30
|
margin-left: ${({ theme }) => `calc(${theme.spacing(1)} + 32px)`};
|
|
20
31
|
}
|
|
32
|
+
|
|
33
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
34
|
+
& .${FormControlLabel_1.formControlLabelClasses.root} {
|
|
35
|
+
margin-left: 0;
|
|
36
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
& .${FormControlLabel_1.formControlLabelClasses.root} .${FormControlLabel_1.formControlLabelClasses.label} {
|
|
40
|
+
margin-left: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
& .${Tree_1.treeClassnames.note} {
|
|
44
|
+
margin-left: ${({ theme }) => `calc(${theme.spacing(1)} + ${Checkbox_1.MOBILE_CHECKBOX_SIZE})`};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
21
47
|
`;
|
|
22
48
|
exports.List = styled_1.styled.ul `
|
|
23
49
|
${mixins_1.listContainer};
|
|
@@ -32,4 +58,25 @@ exports.StyledTooltip = (0, styled_1.styled)(Tooltip_2.Tooltip) `
|
|
|
32
58
|
`;
|
|
33
59
|
exports.PopoverContent = styled_1.styled.div `
|
|
34
60
|
padding: ${({ theme }) => theme.spacing(1)};
|
|
61
|
+
|
|
62
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
63
|
+
padding: ${({ theme }) => theme.spacing(3, 2)};
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
exports.ConfirmChildrenCollapse = (0, styled_1.styled)(Collapse_1.Collapse) `
|
|
67
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
68
|
+
border-bottom: 1px solid
|
|
69
|
+
${({ theme }) => theme.palette.components.border.default};
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
exports.ConfirmChildrenButton = (0, styled_1.styled)(Button_1.Button) `
|
|
73
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
74
|
+
justify-content: flex-start;
|
|
75
|
+
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: auto;
|
|
78
|
+
padding: ${({ theme }) => theme.spacing(3, 4)};
|
|
79
|
+
|
|
80
|
+
border-radius: 0;
|
|
81
|
+
}
|
|
35
82
|
`;
|
|
@@ -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 {};
|