@astral/ui 4.92.3 → 4.93.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/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/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/package.json +1 -1
|
@@ -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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './BottomDrawer';
|
|
2
|
-
export { bottomDrawerClassnames } from './constants';
|
|
2
|
+
export { bottomDrawerClassnames, OFFSET_TOP_SCREEN, DEFAULT_HEADER_HEIGHT, } from './constants';
|
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.bottomDrawerClassnames = void 0;
|
|
17
|
+
exports.DEFAULT_HEADER_HEIGHT = exports.OFFSET_TOP_SCREEN = exports.bottomDrawerClassnames = void 0;
|
|
18
18
|
__exportStar(require("./BottomDrawer"), exports);
|
|
19
19
|
var constants_1 = require("./constants");
|
|
20
20
|
Object.defineProperty(exports, "bottomDrawerClassnames", { enumerable: true, get: function () { return constants_1.bottomDrawerClassnames; } });
|
|
21
|
+
Object.defineProperty(exports, "OFFSET_TOP_SCREEN", { enumerable: true, get: function () { return constants_1.OFFSET_TOP_SCREEN; } });
|
|
22
|
+
Object.defineProperty(exports, "DEFAULT_HEADER_HEIGHT", { enumerable: true, get: function () { return constants_1.DEFAULT_HEADER_HEIGHT; } });
|
|
@@ -7,4 +7,4 @@ export type ClickAwayListenerProps = Omit<UseClickAwayListenerOptions, 'ref' | '
|
|
|
7
7
|
/**
|
|
8
8
|
* компонент предоставляющий обертку для работы с хуком useClickAwayEffect
|
|
9
9
|
*/
|
|
10
|
-
export declare const ClickAwayListener: ({ onClickAway, preventBubbling, isActive, children, }: ClickAwayListenerProps) => ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
10
|
+
export declare const ClickAwayListener: ({ onClickAway, preventBubbling, isActive, excludeNodes, children, }: ClickAwayListenerProps) => ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -6,9 +6,15 @@ const useClickAwayEffect_1 = require("../useClickAwayEffect");
|
|
|
6
6
|
/**
|
|
7
7
|
* компонент предоставляющий обертку для работы с хуком useClickAwayEffect
|
|
8
8
|
*/
|
|
9
|
-
const ClickAwayListener = ({ onClickAway, preventBubbling, isActive = true, children, }) => {
|
|
9
|
+
const ClickAwayListener = ({ onClickAway, preventBubbling, isActive = true, excludeNodes, children, }) => {
|
|
10
10
|
const ref = (0, react_1.useRef)(null);
|
|
11
|
-
(0, useClickAwayEffect_1.useClickAwayEffect)({
|
|
11
|
+
(0, useClickAwayEffect_1.useClickAwayEffect)({
|
|
12
|
+
ref,
|
|
13
|
+
onClickAway,
|
|
14
|
+
preventBubbling,
|
|
15
|
+
isActive,
|
|
16
|
+
excludeNodes,
|
|
17
|
+
});
|
|
12
18
|
// biome-ignore lint/suspicious/noExplicitAny: ReactElement имеет generic unknown по умолчанию и не содержит ref внутри
|
|
13
19
|
const child = children;
|
|
14
20
|
return react_1.Children.only((0, react_1.cloneElement)(child, { ref }));
|
|
@@ -11,5 +11,5 @@ const useLogic_1 = require("./useLogic");
|
|
|
11
11
|
exports.Radio = (0, react_1.forwardRef)((props, ref) => {
|
|
12
12
|
(0, useCheckControlled_1.useCheckControlled)('Radio', props);
|
|
13
13
|
const { onChange, isChecked, isError, disabled, restProps, className, name, style, inputRef, value, id, } = (0, useLogic_1.useLogic)(props);
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isDisabled": disabled, "$isError": isError, "$isChecked": isChecked, className: className, style: style, ref: ref, ...restProps, children: [(0, jsx_runtime_1.jsx)(styles_1.Input, { type: "radio", name: name, checked: isChecked, disabled: disabled, onChange: onChange, "aria-checked": isChecked, "aria-disabled": disabled, ref: inputRef, value: value, id: id }), (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { className: constants_1.radioClassnames.iconWrapper, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: constants_1.radioClassnames.icon }) })] }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isDisabled": disabled, "$isError": isError, "$isChecked": isChecked, className: className, style: style, ref: ref, ...restProps, children: [(0, jsx_runtime_1.jsx)(styles_1.Input, { type: "radio", className: constants_1.radioClassnames.input, name: name, checked: isChecked, disabled: disabled, onChange: onChange, "aria-checked": isChecked, "aria-disabled": disabled, ref: inputRef, value: value, id: id }), (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { className: constants_1.radioClassnames.iconWrapper, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: constants_1.radioClassnames.icon }) })] }));
|
|
15
15
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const radioClassnames: {
|
|
2
2
|
readonly root: string;
|
|
3
|
+
readonly input: string;
|
|
3
4
|
readonly checked: string;
|
|
4
5
|
readonly disabled: string;
|
|
5
6
|
readonly iconWrapper: string;
|
|
@@ -7,3 +8,5 @@ export declare const radioClassnames: {
|
|
|
7
8
|
readonly outerCircle: string;
|
|
8
9
|
readonly dot: string;
|
|
9
10
|
};
|
|
11
|
+
export declare const RADIO_SIZE = "32px";
|
|
12
|
+
export declare const MOBILE_RADIO_SIZE = "40px";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.radioClassnames = void 0;
|
|
3
|
+
exports.MOBILE_RADIO_SIZE = exports.RADIO_SIZE = exports.radioClassnames = void 0;
|
|
4
4
|
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
5
|
exports.radioClassnames = {
|
|
6
6
|
root: (0, createUIKitClassname_1.createUIKitClassname)('radio'),
|
|
7
|
+
input: (0, createUIKitClassname_1.createUIKitClassname)('radio__input'),
|
|
7
8
|
checked: (0, createUIKitClassname_1.createUIKitClassname)('radio_checked'),
|
|
8
9
|
disabled: (0, createUIKitClassname_1.createUIKitClassname)('radio_disabled'),
|
|
9
10
|
iconWrapper: (0, createUIKitClassname_1.createUIKitClassname)('radio__icon-wrapper'),
|
|
@@ -11,3 +12,5 @@ exports.radioClassnames = {
|
|
|
11
12
|
outerCircle: (0, createUIKitClassname_1.createUIKitClassname)('radio__outer-circle'),
|
|
12
13
|
dot: (0, createUIKitClassname_1.createUIKitClassname)('radio__dot'),
|
|
13
14
|
};
|
|
15
|
+
exports.RADIO_SIZE = '32px';
|
|
16
|
+
exports.MOBILE_RADIO_SIZE = '40px';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.radioClassnames = exports.Radio = void 0;
|
|
3
|
+
exports.MOBILE_RADIO_SIZE = exports.RADIO_SIZE = exports.radioClassnames = exports.Radio = void 0;
|
|
4
4
|
var Radio_1 = require("./Radio");
|
|
5
5
|
Object.defineProperty(exports, "Radio", { enumerable: true, get: function () { return Radio_1.Radio; } });
|
|
6
6
|
var constants_1 = require("./constants");
|
|
7
7
|
Object.defineProperty(exports, "radioClassnames", { enumerable: true, get: function () { return constants_1.radioClassnames; } });
|
|
8
|
+
Object.defineProperty(exports, "RADIO_SIZE", { enumerable: true, get: function () { return constants_1.RADIO_SIZE; } });
|
|
9
|
+
Object.defineProperty(exports, "MOBILE_RADIO_SIZE", { enumerable: true, get: function () { return constants_1.MOBILE_RADIO_SIZE; } });
|
|
@@ -85,15 +85,15 @@ exports.Input = styled_1.styled.input `
|
|
|
85
85
|
|
|
86
86
|
position: absolute;
|
|
87
87
|
|
|
88
|
-
width:
|
|
89
|
-
height:
|
|
88
|
+
width: ${constants_1.RADIO_SIZE};
|
|
89
|
+
height: ${constants_1.RADIO_SIZE};
|
|
90
90
|
margin: 0;
|
|
91
91
|
|
|
92
92
|
opacity: 0;
|
|
93
93
|
|
|
94
94
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
95
|
-
width:
|
|
96
|
-
height:
|
|
95
|
+
width: ${constants_1.MOBILE_RADIO_SIZE};
|
|
96
|
+
height: ${constants_1.MOBILE_RADIO_SIZE};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
&:focus-visible {
|
|
@@ -109,12 +109,12 @@ exports.IconWrapper = styled_1.styled.span `
|
|
|
109
109
|
align-items: center;
|
|
110
110
|
justify-content: center;
|
|
111
111
|
|
|
112
|
-
width:
|
|
113
|
-
height:
|
|
112
|
+
width: ${constants_1.RADIO_SIZE};
|
|
113
|
+
height: ${constants_1.RADIO_SIZE};
|
|
114
114
|
|
|
115
115
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
116
|
+
width: ${constants_1.MOBILE_RADIO_SIZE};
|
|
117
|
+
height: ${constants_1.MOBILE_RADIO_SIZE};
|
|
118
118
|
|
|
119
119
|
.${constants_1.radioClassnames.icon} {
|
|
120
120
|
width: 20px;
|
|
@@ -8,6 +8,6 @@ const useLogic_1 = require("./useLogic");
|
|
|
8
8
|
const INITIAL_LEVEL = 0;
|
|
9
9
|
const MultipleTreeList = ({ data, value, className, expandedLevel = 10, disabledItems, ...props }) => {
|
|
10
10
|
const { formattedDisabledItems } = (0, useLogic_1.useLogic)({ disabledItems });
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.List, { className: className, children: data.map((item) => ((0, jsx_runtime_1.jsx)(TreeItem_1.TreeItem, { item: item, value: value, level: INITIAL_LEVEL, expandedLevel: expandedLevel, disabledItems: formattedDisabledItems, ...props }, item.id))) }));
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.ListWrapper, { children: (0, jsx_runtime_1.jsx)(styles_1.List, { className: className, children: data.map((item) => ((0, jsx_runtime_1.jsx)(TreeItem_1.TreeItem, { item: item, value: value, level: INITIAL_LEVEL, expandedLevel: expandedLevel, disabledItems: formattedDisabledItems, ...props }, item.id))) }) }));
|
|
12
12
|
};
|
|
13
13
|
exports.MultipleTreeList = MultipleTreeList;
|