@astral/ui 4.36.0 → 4.36.1
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/TreeAsyncAutocomplete/OptionsModal/styles.js +1 -1
- package/components/TreeAutocomplete/OptionsModal/OptionsModal.js +1 -1
- package/components/TreeAutocomplete/OptionsModal/styles.d.ts +4 -0
- package/components/TreeAutocomplete/OptionsModal/styles.js +10 -3
- package/components/TreeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +5 -3
- package/components/TreeAutocomplete/OptionsModal/useLogic/useLogic.js +2 -1
- package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +1 -1
- package/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +1 -1
- package/components/TreeLikeAutocomplete/OptionsModal/styles.d.ts +4 -0
- package/components/TreeLikeAutocomplete/OptionsModal/styles.js +10 -3
- package/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +5 -3
- package/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.js +2 -1
- package/node/components/TreeAsyncAutocomplete/OptionsModal/styles.js +1 -1
- package/node/components/TreeAutocomplete/OptionsModal/OptionsModal.js +1 -1
- package/node/components/TreeAutocomplete/OptionsModal/styles.d.ts +4 -0
- package/node/components/TreeAutocomplete/OptionsModal/styles.js +10 -3
- package/node/components/TreeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +5 -3
- package/node/components/TreeAutocomplete/OptionsModal/useLogic/useLogic.js +2 -1
- package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +1 -1
- package/node/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +1 -1
- package/node/components/TreeLikeAutocomplete/OptionsModal/styles.d.ts +4 -0
- package/node/components/TreeLikeAutocomplete/OptionsModal/styles.js +10 -3
- package/node/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +5 -3
- package/node/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.js +2 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ export const StyledDialogContent = styled(DialogContent, {
|
|
|
13
13
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
14
14
|
|
|
15
15
|
width: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
16
|
-
height: ${({ $size }) =>
|
|
16
|
+
height: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
17
17
|
|
|
18
18
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
19
19
|
width: auto;
|
|
@@ -25,5 +25,5 @@ export const OptionsModal = (props) => {
|
|
|
25
25
|
}
|
|
26
26
|
return _jsx(TreeList, { ...treeProps, ...treeListProps });
|
|
27
27
|
};
|
|
28
|
-
return (_jsxs(Dialog, { ...externalDialogProps, disableRestoreFocus: true, open: isOpen, ...modalProps, children: [_jsxs(StyledDialogContent, { children: [_jsx(SearchField, { fullWidth: true, ...searchFieldProps }), _jsx(Paper, { variant: "outlined", children: _jsx(TreeListWrapper, { children: renderComponent() }) })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { ...confirmButtonProps, children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" })] })] }));
|
|
28
|
+
return (_jsxs(Dialog, { ...externalDialogProps, disableRestoreFocus: true, open: isOpen, ...modalProps, children: [_jsxs(StyledDialogContent, { "$size": modalProps.size, children: [_jsx(SearchField, { fullWidth: true, ...searchFieldProps }), _jsx(Paper, { variant: "outlined", children: _jsx(TreeListWrapper, { children: renderComponent() }) })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { ...confirmButtonProps, children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" })] })] }));
|
|
29
29
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
3
|
export declare const StyledDialogContent: import("../../styled").StyledComponent<import("../../DialogContent").DialogContentProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
$size: Size;
|
|
4
7
|
}, {}, {}>;
|
|
5
8
|
export declare const TreeListWrapper: import("../../styled").StyledComponent<{
|
|
6
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
10
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
8
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export {};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { DIALOG_SIZES } from '../../Dialog';
|
|
1
2
|
import { DialogContent } from '../../DialogContent';
|
|
2
3
|
import { styled } from '../../styled';
|
|
3
|
-
export const StyledDialogContent = styled(DialogContent
|
|
4
|
+
export const StyledDialogContent = styled(DialogContent, {
|
|
5
|
+
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
6
|
+
}) `
|
|
4
7
|
display: grid;
|
|
5
8
|
grid-template-columns: 100%;
|
|
6
9
|
grid-template-rows: max-content 1fr;
|
|
7
10
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
8
11
|
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
12
|
+
width: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
13
|
+
height: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
14
|
+
|
|
15
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
16
|
+
width: auto;
|
|
17
|
+
}
|
|
11
18
|
`;
|
|
12
19
|
export const TreeListWrapper = styled.div `
|
|
13
20
|
overflow: auto;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { type ButtonProps } from '../../../Button';
|
|
2
|
-
import { type DialogProps } from '../../../Dialog';
|
|
2
|
+
import { type DialogProps, type DialogSize } from '../../../Dialog';
|
|
3
3
|
import { type SearchFieldProps } from '../../../SearchField';
|
|
4
4
|
import { type TreeListProps } from '../../../Tree';
|
|
5
5
|
import { type OptionsModalProps } from '../types';
|
|
6
6
|
type UseLogicResult = {
|
|
7
7
|
isNoResult: boolean;
|
|
8
8
|
searchFieldProps: SearchFieldProps;
|
|
9
|
-
modalProps: Partial<DialogProps
|
|
9
|
+
modalProps: Partial<DialogProps> & {
|
|
10
|
+
size: DialogSize;
|
|
11
|
+
};
|
|
10
12
|
treeListProps: TreeListProps;
|
|
11
13
|
cancelButtonProps: ButtonProps;
|
|
12
14
|
confirmButtonProps: ButtonProps;
|
|
13
15
|
};
|
|
14
|
-
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }: OptionsModalProps) => UseLogicResult;
|
|
16
|
+
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size, }: OptionsModalProps) => UseLogicResult;
|
|
15
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState, } from 'react';
|
|
2
2
|
import { deepMap } from '../../../utils/array';
|
|
3
3
|
import { findInTree } from './utils';
|
|
4
|
-
export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }) => {
|
|
4
|
+
export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size = 'md', }) => {
|
|
5
5
|
const [value, setValue] = useState(initialValue);
|
|
6
6
|
const [searchValue, setSearchValue] = useState();
|
|
7
7
|
useEffect(() => {
|
|
@@ -47,6 +47,7 @@ export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, opti
|
|
|
47
47
|
isNoResult,
|
|
48
48
|
modalProps: {
|
|
49
49
|
onClose: handleClose,
|
|
50
|
+
size,
|
|
50
51
|
},
|
|
51
52
|
searchFieldProps: {
|
|
52
53
|
value: searchValue,
|
|
@@ -13,7 +13,7 @@ export const StyledDialogContent = styled(DialogContent, {
|
|
|
13
13
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
14
14
|
|
|
15
15
|
width: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
16
|
-
height: ${({ $size }) =>
|
|
16
|
+
height: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
17
17
|
|
|
18
18
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
19
19
|
width: auto;
|
|
@@ -25,5 +25,5 @@ export const OptionsModal = (props) => {
|
|
|
25
25
|
}
|
|
26
26
|
return (_jsx(TreeLikeList, { isConfirmChildrenSelection: isConfirmChildrenSelection, ...treeProps, ...treeLikeListProps }));
|
|
27
27
|
};
|
|
28
|
-
return (_jsxs(Dialog, { ...externalDialogProps, disableRestoreFocus: true, open: isOpen, ...modalProps, children: [_jsxs(StyledDialogContent, { children: [_jsx(SearchField, { fullWidth: true, ...searchFieldProps }), _jsx(Paper, { variant: "outlined", children: _jsx(TreeListWrapper, { children: renderComponent() }) })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { ...confirmButtonProps, children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" })] })] }));
|
|
28
|
+
return (_jsxs(Dialog, { ...externalDialogProps, disableRestoreFocus: true, open: isOpen, ...modalProps, children: [_jsxs(StyledDialogContent, { "$size": modalProps.size, children: [_jsx(SearchField, { fullWidth: true, ...searchFieldProps }), _jsx(Paper, { variant: "outlined", children: _jsx(TreeListWrapper, { children: renderComponent() }) })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { ...confirmButtonProps, children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" })] })] }));
|
|
29
29
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
3
|
export declare const StyledDialogContent: import("../../styled").StyledComponent<import("../../DialogContent").DialogContentProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
$size: Size;
|
|
4
7
|
}, {}, {}>;
|
|
5
8
|
export declare const TreeListWrapper: import("../../styled").StyledComponent<{
|
|
6
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
10
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
8
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export {};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { DIALOG_SIZES } from '../../Dialog';
|
|
1
2
|
import { DialogContent } from '../../DialogContent';
|
|
2
3
|
import { styled } from '../../styled';
|
|
3
|
-
export const StyledDialogContent = styled(DialogContent
|
|
4
|
+
export const StyledDialogContent = styled(DialogContent, {
|
|
5
|
+
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
6
|
+
}) `
|
|
4
7
|
display: grid;
|
|
5
8
|
grid-template-columns: 100%;
|
|
6
9
|
grid-template-rows: max-content 1fr;
|
|
7
10
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
8
11
|
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
12
|
+
width: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
13
|
+
height: ${({ $size }) => DIALOG_SIZES[$size].minWidth};
|
|
14
|
+
|
|
15
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
16
|
+
width: auto;
|
|
17
|
+
}
|
|
11
18
|
`;
|
|
12
19
|
export const TreeListWrapper = styled.div `
|
|
13
20
|
overflow: auto;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ButtonProps } from '../../../Button';
|
|
2
|
-
import { type DialogProps } from '../../../Dialog';
|
|
2
|
+
import { type DialogProps, type DialogSize } from '../../../Dialog';
|
|
3
3
|
import { type SearchFieldProps } from '../../../SearchField';
|
|
4
4
|
import { type TreeLikeListProps } from '../../../TreeLikeList';
|
|
5
5
|
import { type OptionsModalProps } from '../types';
|
|
@@ -7,10 +7,12 @@ type UseLogicParams = OptionsModalProps;
|
|
|
7
7
|
type UseLogicResult = {
|
|
8
8
|
isNoResult: boolean;
|
|
9
9
|
searchFieldProps: SearchFieldProps;
|
|
10
|
-
modalProps: Partial<DialogProps
|
|
10
|
+
modalProps: Partial<DialogProps> & {
|
|
11
|
+
size: DialogSize;
|
|
12
|
+
};
|
|
11
13
|
treeLikeListProps: TreeLikeListProps;
|
|
12
14
|
cancelButtonProps: ButtonProps;
|
|
13
15
|
confirmButtonProps: ButtonProps;
|
|
14
16
|
};
|
|
15
|
-
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }: UseLogicParams) => UseLogicResult;
|
|
17
|
+
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size, }: UseLogicParams) => UseLogicResult;
|
|
16
18
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState, } from 'react';
|
|
2
2
|
import { deepMap } from '../../../utils/array';
|
|
3
3
|
import { findInTree } from './utils';
|
|
4
|
-
export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }) => {
|
|
4
|
+
export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size = 'md', }) => {
|
|
5
5
|
const [value, setValue] = useState(initialValue);
|
|
6
6
|
const [searchValue, setSearchValue] = useState();
|
|
7
7
|
useEffect(() => {
|
|
@@ -47,6 +47,7 @@ export const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, opti
|
|
|
47
47
|
isNoResult,
|
|
48
48
|
modalProps: {
|
|
49
49
|
onClose: handleClose,
|
|
50
|
+
size,
|
|
50
51
|
},
|
|
51
52
|
searchFieldProps: {
|
|
52
53
|
value: searchValue,
|
|
@@ -16,7 +16,7 @@ exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent
|
|
|
16
16
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
17
17
|
|
|
18
18
|
width: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
19
|
-
height: ${({ $size }) =>
|
|
19
|
+
height: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
20
20
|
|
|
21
21
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
22
22
|
width: auto;
|
|
@@ -28,6 +28,6 @@ const OptionsModal = (props) => {
|
|
|
28
28
|
}
|
|
29
29
|
return (0, jsx_runtime_1.jsx)(Tree_1.TreeList, { ...treeProps, ...treeListProps });
|
|
30
30
|
};
|
|
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, { children: [(0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { fullWidth: true, ...searchFieldProps }), (0, jsx_runtime_1.jsx)(Paper_1.Paper, { 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)(Button_1.Button, { 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" })] })] }));
|
|
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)(Paper_1.Paper, { 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)(Button_1.Button, { 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
32
|
};
|
|
33
33
|
exports.OptionsModal = OptionsModal;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
3
|
export declare const StyledDialogContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../DialogContent").DialogContentProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
$size: Size;
|
|
4
7
|
}, {}, {}>;
|
|
5
8
|
export declare const TreeListWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
6
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
10
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
8
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export {};
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TreeListWrapper = exports.StyledDialogContent = void 0;
|
|
4
|
+
const Dialog_1 = require("../../Dialog");
|
|
4
5
|
const DialogContent_1 = require("../../DialogContent");
|
|
5
6
|
const styled_1 = require("../../styled");
|
|
6
|
-
exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent
|
|
7
|
+
exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent, {
|
|
8
|
+
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
9
|
+
}) `
|
|
7
10
|
display: grid;
|
|
8
11
|
grid-template-columns: 100%;
|
|
9
12
|
grid-template-rows: max-content 1fr;
|
|
10
13
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
11
14
|
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
15
|
+
width: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
16
|
+
height: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
17
|
+
|
|
18
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
19
|
+
width: auto;
|
|
20
|
+
}
|
|
14
21
|
`;
|
|
15
22
|
exports.TreeListWrapper = styled_1.styled.div `
|
|
16
23
|
overflow: auto;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { type ButtonProps } from '../../../Button';
|
|
2
|
-
import { type DialogProps } from '../../../Dialog';
|
|
2
|
+
import { type DialogProps, type DialogSize } from '../../../Dialog';
|
|
3
3
|
import { type SearchFieldProps } from '../../../SearchField';
|
|
4
4
|
import { type TreeListProps } from '../../../Tree';
|
|
5
5
|
import { type OptionsModalProps } from '../types';
|
|
6
6
|
type UseLogicResult = {
|
|
7
7
|
isNoResult: boolean;
|
|
8
8
|
searchFieldProps: SearchFieldProps;
|
|
9
|
-
modalProps: Partial<DialogProps
|
|
9
|
+
modalProps: Partial<DialogProps> & {
|
|
10
|
+
size: DialogSize;
|
|
11
|
+
};
|
|
10
12
|
treeListProps: TreeListProps;
|
|
11
13
|
cancelButtonProps: ButtonProps;
|
|
12
14
|
confirmButtonProps: ButtonProps;
|
|
13
15
|
};
|
|
14
|
-
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }: OptionsModalProps) => UseLogicResult;
|
|
16
|
+
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size, }: OptionsModalProps) => UseLogicResult;
|
|
15
17
|
export {};
|
|
@@ -4,7 +4,7 @@ exports.useLogic = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const array_1 = require("../../../utils/array");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
|
-
const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }) => {
|
|
7
|
+
const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size = 'md', }) => {
|
|
8
8
|
const [value, setValue] = (0, react_1.useState)(initialValue);
|
|
9
9
|
const [searchValue, setSearchValue] = (0, react_1.useState)();
|
|
10
10
|
(0, react_1.useEffect)(() => {
|
|
@@ -50,6 +50,7 @@ const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, fi
|
|
|
50
50
|
isNoResult,
|
|
51
51
|
modalProps: {
|
|
52
52
|
onClose: handleClose,
|
|
53
|
+
size,
|
|
53
54
|
},
|
|
54
55
|
searchFieldProps: {
|
|
55
56
|
value: searchValue,
|
|
@@ -16,7 +16,7 @@ exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent
|
|
|
16
16
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
17
17
|
|
|
18
18
|
width: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
19
|
-
height: ${({ $size }) =>
|
|
19
|
+
height: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
20
20
|
|
|
21
21
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
22
22
|
width: auto;
|
|
@@ -28,6 +28,6 @@ const OptionsModal = (props) => {
|
|
|
28
28
|
}
|
|
29
29
|
return ((0, jsx_runtime_1.jsx)(TreeLikeList_1.TreeLikeList, { isConfirmChildrenSelection: isConfirmChildrenSelection, ...treeProps, ...treeLikeListProps }));
|
|
30
30
|
};
|
|
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, { children: [(0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { fullWidth: true, ...searchFieldProps }), (0, jsx_runtime_1.jsx)(Paper_1.Paper, { 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)(Button_1.Button, { 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" })] })] }));
|
|
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)(Paper_1.Paper, { 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)(Button_1.Button, { 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
32
|
};
|
|
33
33
|
exports.OptionsModal = OptionsModal;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
3
|
export declare const StyledDialogContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../DialogContent").DialogContentProps & {
|
|
3
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
$size: Size;
|
|
4
7
|
}, {}, {}>;
|
|
5
8
|
export declare const TreeListWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
6
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
10
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
8
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export {};
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TreeListWrapper = exports.StyledDialogContent = void 0;
|
|
4
|
+
const Dialog_1 = require("../../Dialog");
|
|
4
5
|
const DialogContent_1 = require("../../DialogContent");
|
|
5
6
|
const styled_1 = require("../../styled");
|
|
6
|
-
exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent
|
|
7
|
+
exports.StyledDialogContent = (0, styled_1.styled)(DialogContent_1.DialogContent, {
|
|
8
|
+
shouldForwardProp: (prop) => !['$size'].includes(prop),
|
|
9
|
+
}) `
|
|
7
10
|
display: grid;
|
|
8
11
|
grid-template-columns: 100%;
|
|
9
12
|
grid-template-rows: max-content 1fr;
|
|
10
13
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
11
14
|
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
15
|
+
width: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
16
|
+
height: ${({ $size }) => Dialog_1.DIALOG_SIZES[$size].minWidth};
|
|
17
|
+
|
|
18
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
19
|
+
width: auto;
|
|
20
|
+
}
|
|
14
21
|
`;
|
|
15
22
|
exports.TreeListWrapper = styled_1.styled.div `
|
|
16
23
|
overflow: auto;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ButtonProps } from '../../../Button';
|
|
2
|
-
import { type DialogProps } from '../../../Dialog';
|
|
2
|
+
import { type DialogProps, type DialogSize } from '../../../Dialog';
|
|
3
3
|
import { type SearchFieldProps } from '../../../SearchField';
|
|
4
4
|
import { type TreeLikeListProps } from '../../../TreeLikeList';
|
|
5
5
|
import { type OptionsModalProps } from '../types';
|
|
@@ -7,10 +7,12 @@ type UseLogicParams = OptionsModalProps;
|
|
|
7
7
|
type UseLogicResult = {
|
|
8
8
|
isNoResult: boolean;
|
|
9
9
|
searchFieldProps: SearchFieldProps;
|
|
10
|
-
modalProps: Partial<DialogProps
|
|
10
|
+
modalProps: Partial<DialogProps> & {
|
|
11
|
+
size: DialogSize;
|
|
12
|
+
};
|
|
11
13
|
treeLikeListProps: TreeLikeListProps;
|
|
12
14
|
cancelButtonProps: ButtonProps;
|
|
13
15
|
confirmButtonProps: ButtonProps;
|
|
14
16
|
};
|
|
15
|
-
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }: UseLogicParams) => UseLogicResult;
|
|
17
|
+
export declare const useLogic: ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size, }: UseLogicParams) => UseLogicResult;
|
|
16
18
|
export {};
|
|
@@ -4,7 +4,7 @@ exports.useLogic = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const array_1 = require("../../../utils/array");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
|
-
const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, }) => {
|
|
7
|
+
const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, filterOptions, onChange, onClose, size = 'md', }) => {
|
|
8
8
|
const [value, setValue] = (0, react_1.useState)(initialValue);
|
|
9
9
|
const [searchValue, setSearchValue] = (0, react_1.useState)();
|
|
10
10
|
(0, react_1.useEffect)(() => {
|
|
@@ -50,6 +50,7 @@ const useLogic = ({ isOpen, isLoading, isLoadingError, initialValue, options, fi
|
|
|
50
50
|
isNoResult,
|
|
51
51
|
modalProps: {
|
|
52
52
|
onClose: handleClose,
|
|
53
|
+
size,
|
|
53
54
|
},
|
|
54
55
|
searchFieldProps: {
|
|
55
56
|
value: searchValue,
|