@astral/ui 4.0.0-alpha.28 → 4.0.0-alpha.29
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/Checkbox/Checkbox.js +1 -1
- package/components/Checkbox/constants.d.ts +3 -0
- package/components/Checkbox/constants.js +3 -0
- package/components/Checkbox/index.d.ts +1 -1
- package/components/Checkbox/index.js +1 -1
- package/components/Checkbox/styles.js +25 -25
- package/components/ScrollWrapper/ScrollWrapper.d.ts +7 -0
- package/components/ScrollWrapper/ScrollWrapper.js +3 -0
- package/components/ScrollWrapper/index.d.ts +1 -0
- package/components/ScrollWrapper/index.js +1 -0
- package/components/ScrollWrapper/styles.d.ts +7 -0
- package/components/ScrollWrapper/styles.js +7 -0
- package/components/Tree/MultipleTreeList/TreeItem/styles.js +16 -2
- package/components/Tree/MultipleTreeList/styles.d.ts +0 -6
- package/components/Tree/MultipleTreeList/styles.js +0 -3
- package/components/Tree/TreeItem/constants.d.ts +1 -0
- package/components/Tree/TreeItem/constants.js +2 -1
- package/components/Tree/TreeItem/styles.d.ts +0 -4
- package/components/Tree/TreeItem/styles.js +15 -8
- package/components/TreeAutocomplete/Input/Input.js +7 -5
- package/components/TreeAutocomplete/Input/constants.d.ts +1 -0
- package/components/TreeAutocomplete/Input/constants.js +1 -0
- package/components/TreeAutocomplete/Input/styles.d.ts +3 -10
- package/components/TreeAutocomplete/Input/styles.js +3 -18
- package/components/TreeAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +1 -1
- package/components/TreeAutocomplete/OptionsModal/OptionsModal.js +2 -1
- package/components/TreeAutocomplete/OptionsModal/styles.js +3 -6
- package/components/TreeAutocomplete/TreeAutocomplete.d.ts +1 -57
- package/components/TreeAutocomplete/types.d.ts +56 -0
- package/components/TreeAutocomplete/useLogic/useLogic.d.ts +1 -1
- package/components/TreeLikeAutocomplete/Input/Input.js +5 -5
- package/components/TreeLikeAutocomplete/Input/styles.d.ts +1 -25
- package/components/TreeLikeAutocomplete/Input/styles.js +7 -20
- package/components/TreeLikeAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +1 -1
- package/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +2 -1
- package/components/TreeLikeAutocomplete/OptionsModal/styles.js +2 -6
- package/components/TreeLikeAutocomplete/TreeLikeAutocomplete.d.ts +1 -62
- package/components/TreeLikeAutocomplete/types.d.ts +61 -1
- package/components/TreeLikeAutocomplete/useLogic/useLogic.d.ts +2 -2
- package/node/components/Checkbox/Checkbox.js +1 -1
- package/node/components/Checkbox/constants.d.ts +3 -0
- package/node/components/Checkbox/constants.js +4 -1
- package/node/components/Checkbox/index.d.ts +1 -1
- package/node/components/Checkbox/index.js +3 -1
- package/node/components/Checkbox/styles.js +24 -24
- package/node/components/ScrollWrapper/ScrollWrapper.d.ts +7 -0
- package/node/components/ScrollWrapper/ScrollWrapper.js +7 -0
- package/node/components/ScrollWrapper/index.d.ts +1 -0
- package/node/components/ScrollWrapper/index.js +17 -0
- package/node/components/ScrollWrapper/styles.d.ts +7 -0
- package/node/components/ScrollWrapper/styles.js +10 -0
- package/node/components/Tree/MultipleTreeList/TreeItem/styles.js +15 -1
- package/node/components/Tree/MultipleTreeList/styles.d.ts +0 -6
- package/node/components/Tree/MultipleTreeList/styles.js +1 -4
- package/node/components/Tree/TreeItem/constants.d.ts +1 -0
- package/node/components/Tree/TreeItem/constants.js +2 -1
- package/node/components/Tree/TreeItem/styles.d.ts +0 -4
- package/node/components/Tree/TreeItem/styles.js +15 -8
- package/node/components/TreeAutocomplete/Input/Input.js +4 -2
- package/node/components/TreeAutocomplete/Input/constants.d.ts +1 -0
- package/node/components/TreeAutocomplete/Input/constants.js +4 -0
- package/node/components/TreeAutocomplete/Input/styles.d.ts +3 -10
- package/node/components/TreeAutocomplete/Input/styles.js +4 -19
- package/node/components/TreeAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +1 -1
- package/node/components/TreeAutocomplete/OptionsModal/OptionsModal.js +2 -1
- package/node/components/TreeAutocomplete/OptionsModal/styles.js +3 -6
- package/node/components/TreeAutocomplete/TreeAutocomplete.d.ts +1 -57
- package/node/components/TreeAutocomplete/types.d.ts +56 -0
- package/node/components/TreeAutocomplete/useLogic/useLogic.d.ts +1 -1
- package/node/components/TreeLikeAutocomplete/Input/Input.js +3 -3
- package/node/components/TreeLikeAutocomplete/Input/styles.d.ts +1 -25
- package/node/components/TreeLikeAutocomplete/Input/styles.js +8 -21
- package/node/components/TreeLikeAutocomplete/OptionsModal/ErrorMessage/ErrorMessage.js +1 -1
- package/node/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +2 -1
- package/node/components/TreeLikeAutocomplete/OptionsModal/styles.js +2 -6
- package/node/components/TreeLikeAutocomplete/TreeLikeAutocomplete.d.ts +1 -62
- package/node/components/TreeLikeAutocomplete/types.d.ts +61 -1
- package/node/components/TreeLikeAutocomplete/useLogic/useLogic.d.ts +2 -2
- package/package.json +1 -1
- package/components/TreeLikeList/faker.d.ts +0 -8
- package/components/TreeLikeList/faker.js +0 -17
- package/node/components/TreeLikeList/faker.d.ts +0 -8
- package/node/components/TreeLikeList/faker.js +0 -21
|
@@ -9,30 +9,6 @@ export declare const EndAdornmentWrapper: import("@emotion/styled").StyledCompon
|
|
|
9
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
10
10
|
as?: import("react").ElementType<any> | undefined;
|
|
11
11
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
-
export declare const
|
|
13
|
-
variant?: "link" | "outlined" | "text" | "contained" | "light" | undefined;
|
|
14
|
-
loading?: boolean | undefined;
|
|
15
|
-
color?: "grey" | "primary" | "error" | "warning" | "success" | undefined;
|
|
16
|
-
component?: import("react").ElementType | undefined;
|
|
17
|
-
selected?: boolean | undefined;
|
|
18
|
-
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
19
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
20
|
-
}, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
21
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
22
|
-
}, {}, {}>;
|
|
23
|
-
export declare const StyledCircleErrorFillSm: import("@emotion/styled").StyledComponent<{
|
|
24
|
-
children?: import("react").ReactNode;
|
|
25
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
26
|
-
color?: import("@mui/types").OverridableStringUnion<"action" | "inherit" | "info" | "primary" | "secondary" | "error" | "warning" | "success" | "disabled", import("@mui/material").SvgIconPropsColorOverrides> | undefined;
|
|
27
|
-
fontSize?: import("@mui/types").OverridableStringUnion<"small" | "inherit" | "medium" | "large", import("@mui/material").SvgIconPropsSizeOverrides> | undefined;
|
|
28
|
-
htmlColor?: string | undefined;
|
|
29
|
-
inheritViewBox?: boolean | undefined;
|
|
30
|
-
shapeRendering?: string | undefined;
|
|
31
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
32
|
-
titleAccess?: string | undefined;
|
|
33
|
-
viewBox?: string | undefined;
|
|
34
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
|
|
35
|
-
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
36
|
-
}, "color" | "fontSize" | "shapeRendering" | "children" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & {
|
|
12
|
+
export declare const StyledLoader: import("@emotion/styled").StyledComponent<import("../../Loader").LoaderProps & {
|
|
37
13
|
theme?: import("@emotion/react").Theme | undefined;
|
|
38
14
|
}, {}, {}>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { inputBaseClasses } from '@mui/material';
|
|
2
|
-
import {
|
|
3
|
-
import { IconButton } from '../../IconButton';
|
|
2
|
+
import { Loader } from '../../Loader';
|
|
4
3
|
import { css, styled } from '../../styles';
|
|
5
4
|
import { TagsList } from '../../TagsList';
|
|
6
5
|
import { TextField } from '../../TextField';
|
|
@@ -14,9 +13,8 @@ const hiddenInputClass = css `
|
|
|
14
13
|
export const StyledTextField = styled(TextField, {
|
|
15
14
|
shouldForwardProp: (prop) => !['$isHidden'].includes(prop),
|
|
16
15
|
}) `
|
|
17
|
-
min-width: 400px;
|
|
18
|
-
|
|
19
16
|
.${inputBaseClasses.root} {
|
|
17
|
+
height: 40px;
|
|
20
18
|
padding-top: ${({ theme }) => theme.spacing(1)};
|
|
21
19
|
padding-bottom: ${({ theme }) => theme.spacing(1)};
|
|
22
20
|
}
|
|
@@ -35,24 +33,13 @@ export const StyledTagsList = styled(TagsList) `
|
|
|
35
33
|
`;
|
|
36
34
|
export const EndAdornmentWrapper = styled.div `
|
|
37
35
|
display: flex;
|
|
36
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
38
37
|
align-items: center;
|
|
39
38
|
|
|
40
39
|
margin-left: auto;
|
|
40
|
+
padding-left: ${({ theme }) => theme.spacing(1)};
|
|
41
41
|
`;
|
|
42
|
-
export const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
&:hover {
|
|
46
|
-
background-color: transparent;
|
|
47
|
-
|
|
48
|
-
svg {
|
|
49
|
-
fill: ${({ theme }) => theme.palette.grey['700']};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
export const StyledCircleErrorFillSm = styled(CircleErrorFillSm) `
|
|
54
|
-
width: 16px;
|
|
55
|
-
height: 16px;
|
|
56
|
-
|
|
57
|
-
fill: ${({ theme }) => theme.palette.grey['500']};
|
|
42
|
+
export const StyledLoader = styled(Loader) `
|
|
43
|
+
width: 20px;
|
|
44
|
+
height: 20px;
|
|
58
45
|
`;
|
|
@@ -3,4 +3,4 @@ import { Button } from '../../../Button';
|
|
|
3
3
|
import { Typography } from '../../../Typography';
|
|
4
4
|
import { Wrapper } from './styles';
|
|
5
5
|
const DEFAULT_ERROR_MSG = 'Не удалось загрузить данные';
|
|
6
|
-
export const ErrorMessage = ({ loadingErrorMsg = DEFAULT_ERROR_MSG, onRetry, }) => (_jsxs(Wrapper, { children: [_jsx(Typography, { color: "
|
|
6
|
+
export const ErrorMessage = ({ loadingErrorMsg = DEFAULT_ERROR_MSG, onRetry, }) => (_jsxs(Wrapper, { children: [_jsx(Typography, { color: "grey", children: loadingErrorMsg }), onRetry && (_jsx(Button, { onClick: onRetry, variant: "light", color: "grey", children: "\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430" }))] }));
|
|
@@ -13,6 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { Button } from '../../Button';
|
|
14
14
|
import { Dialog } from '../../Dialog';
|
|
15
15
|
import { DialogActions } from '../../DialogActions';
|
|
16
|
+
import { ScrollWrapper } from '../../ScrollWrapper';
|
|
16
17
|
import { SearchField } from '../../SearchField';
|
|
17
18
|
import { TreeLikeList } from '../../TreeLikeList';
|
|
18
19
|
import { ErrorMessage } from './ErrorMessage';
|
|
@@ -35,5 +36,5 @@ export const OptionsModal = (props) => {
|
|
|
35
36
|
}
|
|
36
37
|
return (_jsx(TreeLikeList, Object.assign({ isConfirmChildrenSelection: isConfirmChildrenSelection }, treeProps, treeLikeListProps)));
|
|
37
38
|
};
|
|
38
|
-
return (_jsxs(Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [_jsxs(StyledDialogContent, { children: [_jsx(SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), _jsx(TreeListWrapper, { children: renderComponent() })] }), _jsxs(DialogActions, { children: [_jsx(Button, Object.assign({ variant: "text" }, cancelButtonProps, { children: "\u041E\u0442\u043C\u0435\u043D\u0430" })), _jsx(Button, Object.assign({}, confirmButtonProps, { children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" }))] })] })));
|
|
39
|
+
return (_jsxs(Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [_jsxs(StyledDialogContent, { children: [_jsx(SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), _jsx(ScrollWrapper, { children: _jsx(TreeListWrapper, { children: renderComponent() }) })] }), _jsxs(DialogActions, { children: [_jsx(Button, Object.assign({ variant: "text" }, cancelButtonProps, { children: "\u041E\u0442\u043C\u0435\u043D\u0430" })), _jsx(Button, Object.assign({}, confirmButtonProps, { children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" }))] })] })));
|
|
39
40
|
};
|
|
@@ -4,7 +4,7 @@ export const StyledDialogContent = styled(DialogContent) `
|
|
|
4
4
|
display: grid;
|
|
5
5
|
grid-template-columns: 100%;
|
|
6
6
|
grid-template-rows: max-content 1fr;
|
|
7
|
-
gap: ${({ theme }) => theme.spacing(
|
|
7
|
+
gap: ${({ theme }) => theme.spacing(4)};
|
|
8
8
|
|
|
9
9
|
width: 100%;
|
|
10
10
|
height: 500px;
|
|
@@ -13,9 +13,5 @@ export const TreeListWrapper = styled.div `
|
|
|
13
13
|
overflow: auto;
|
|
14
14
|
|
|
15
15
|
min-width: 500px;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
background-color: ${({ theme }) => theme.palette.background.element};
|
|
19
|
-
border: 2px solid ${({ theme }) => theme.palette.grey[300]};
|
|
20
|
-
border-radius: 3px;
|
|
16
|
+
height: 100%;
|
|
21
17
|
`;
|
|
@@ -1,64 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { type TextFieldProps } from '../TextField';
|
|
4
|
-
import { type TreeListData, type TreeListProps } from '../Tree';
|
|
5
|
-
import type { TreeLikeAutocompleteValue, TreeLikeListAutocompleteData } from './types';
|
|
6
|
-
export type TreeLikeAutocompleteTreeProps = Pick<TreeListProps, 'disabledItems' | 'renderItem'>;
|
|
7
|
-
export type TreeLikeAutocompleteProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Выбранное значения
|
|
10
|
-
*/
|
|
11
|
-
value?: TreeLikeAutocompleteValue;
|
|
12
|
-
/**
|
|
13
|
-
* Опции, которые необходимо отобразить в виде дерева.
|
|
14
|
-
*/
|
|
15
|
-
options: TreeLikeListAutocompleteData[];
|
|
16
|
-
/**
|
|
17
|
-
* Если true, при выборе родителя будет возможность выбора дочерних элементов
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
isConfirmChildrenSelection?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Если true, поля будут недоступны для взаимодействия
|
|
23
|
-
*/
|
|
24
|
-
isDisabled?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Если true, поля будут подсвечены, как содержащие ошибку
|
|
27
|
-
*/
|
|
28
|
-
isError?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Флаг загрузки options
|
|
31
|
-
* Если true, вместо дерева options будет отображен лоадер
|
|
32
|
-
*/
|
|
33
|
-
isLoading?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Флаг ошибки загрузки options
|
|
36
|
-
* Если true, вместо дерева options будет отображен плейсхолдер с ошибкой
|
|
37
|
-
*/
|
|
38
|
-
isLoadingError?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Текст ошибки при загрузке данных
|
|
41
|
-
*/
|
|
42
|
-
loadingErrorMsg?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Предназначен для конфигурации всплывающего окна
|
|
45
|
-
*/
|
|
46
|
-
dialogProps: Omit<DialogProps, 'open' | 'onClose'>;
|
|
47
|
-
/**
|
|
48
|
-
* Предназначен для конфигурации дерева опций
|
|
49
|
-
*/
|
|
50
|
-
treeProps?: TreeLikeAutocompleteTreeProps;
|
|
51
|
-
/**
|
|
52
|
-
* Функция обработки нажатия на кнопку "Повторить запрос"
|
|
53
|
-
*/
|
|
54
|
-
onRetry?: () => void;
|
|
55
|
-
/**
|
|
56
|
-
* Функция для поиска элементов по дереву, если не определено, то будет использован встроенный поиск
|
|
57
|
-
*/
|
|
58
|
-
filterOptions?: (node: TreeListData, searchValue: string) => boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Функция, которая запускается при выборе item
|
|
61
|
-
*/
|
|
62
|
-
onChange?: (newValue: TreeLikeAutocompleteValue | undefined) => void;
|
|
63
|
-
} & Omit<TextFieldProps, 'autoComplete' | 'defaultValue' | 'select' | 'error' | 'disabled' | 'multiline' | 'rows' | 'maxRows' | 'minRows' | 'SelectProps' | 'endAdornment' | 'onChange'>;
|
|
2
|
+
import type { TreeLikeAutocompleteProps } from './types';
|
|
64
3
|
export declare const TreeLikeAutocomplete: import("react").ForwardRefExoticComponent<Omit<TreeLikeAutocompleteProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DialogProps } from '../Dialog';
|
|
2
|
+
import type { TextFieldProps } from '../TextField';
|
|
3
|
+
import { type TreeListData, type TreeListProps } from '../Tree';
|
|
2
4
|
export type TreeLikeAutocompleteValue = string[];
|
|
3
5
|
export type TreeLikeListAutocompleteData = Omit<TreeListData, 'label' | 'children'> & {
|
|
4
6
|
/**
|
|
@@ -10,3 +12,61 @@ export type TreeLikeListAutocompleteData = Omit<TreeListData, 'label' | 'childre
|
|
|
10
12
|
*/
|
|
11
13
|
children?: TreeLikeListAutocompleteData[];
|
|
12
14
|
};
|
|
15
|
+
export type TreeLikeAutocompleteTreeProps = Pick<TreeListProps, 'disabledItems' | 'renderItem'>;
|
|
16
|
+
export type TreeLikeAutocompleteProps = {
|
|
17
|
+
/**
|
|
18
|
+
* Выбранное значения
|
|
19
|
+
*/
|
|
20
|
+
value?: TreeLikeAutocompleteValue;
|
|
21
|
+
/**
|
|
22
|
+
* Опции, которые необходимо отобразить в виде дерева.
|
|
23
|
+
*/
|
|
24
|
+
options: TreeLikeListAutocompleteData[];
|
|
25
|
+
/**
|
|
26
|
+
* Если true, при выборе родителя будет возможность выбора дочерних элементов
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
isConfirmChildrenSelection?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Если true, поля будут недоступны для взаимодействия
|
|
32
|
+
*/
|
|
33
|
+
isDisabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Если true, поля будут подсвечены, как содержащие ошибку
|
|
36
|
+
*/
|
|
37
|
+
isError?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Флаг загрузки options
|
|
40
|
+
* Если true, вместо дерева options будет отображен лоадер
|
|
41
|
+
*/
|
|
42
|
+
isLoading?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Флаг ошибки загрузки options
|
|
45
|
+
* Если true, вместо дерева options будет отображен плейсхолдер с ошибкой
|
|
46
|
+
*/
|
|
47
|
+
isLoadingError?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Текст ошибки при загрузке данных
|
|
50
|
+
*/
|
|
51
|
+
loadingErrorMsg?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Предназначен для конфигурации всплывающего окна
|
|
54
|
+
*/
|
|
55
|
+
dialogProps: Omit<DialogProps, 'open' | 'onClose'>;
|
|
56
|
+
/**
|
|
57
|
+
* Предназначен для конфигурации дерева опций
|
|
58
|
+
*/
|
|
59
|
+
treeProps?: TreeLikeAutocompleteTreeProps;
|
|
60
|
+
/**
|
|
61
|
+
* Функция обработки нажатия на кнопку "Повторить запрос"
|
|
62
|
+
*/
|
|
63
|
+
onRetry?: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Функция для поиска элементов по дереву, если не определено, то будет использован встроенный поиск
|
|
66
|
+
*/
|
|
67
|
+
filterOptions?: (node: TreeListData, searchValue: string) => boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Функция, которая запускается при выборе item
|
|
70
|
+
*/
|
|
71
|
+
onChange?: (newValue: TreeLikeAutocompleteValue | undefined) => void;
|
|
72
|
+
} & Omit<TextFieldProps, 'autoComplete' | 'defaultValue' | 'select' | 'error' | 'disabled' | 'multiline' | 'rows' | 'maxRows' | 'minRows' | 'SelectProps' | 'endAdornment' | 'onChange'>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type FocusEvent, type KeyboardEvent, type SyntheticEvent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { TreeLikeAutocompleteProps } from '../types';
|
|
3
3
|
type UseLogicProps = TreeLikeAutocompleteProps;
|
|
4
4
|
export declare const useLogic: ({ value, options, onBlur }: UseLogicProps) => {
|
|
5
5
|
inputProps: {
|
|
6
|
-
valueToRender: import("
|
|
6
|
+
valueToRender: import("../types").TreeLikeListAutocompleteData[] | undefined;
|
|
7
7
|
onBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
|
8
8
|
onClick: () => void;
|
|
9
9
|
onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
@@ -9,5 +9,5 @@ const styles_1 = require("./styles");
|
|
|
9
9
|
const useLogic_1 = require("./useLogic");
|
|
10
10
|
exports.Checkbox = (0, react_1.forwardRef)((props, ref) => {
|
|
11
11
|
const { onChange, color, isChecked, indeterminate, isError, disabled, restProps, className, role, style, name, inputRef, value, id, } = (0, useLogic_1.useLogic)(props);
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, Object.assign({ role: role, "$isDisabled": disabled, "$isError": isError, "$isChecked": isChecked, "$isIndeterminate": indeterminate, className: className, style: style, ref: ref }, restProps, { children: [(0, jsx_runtime_1.jsx)(styles_1.Input, { type: "checkbox", checked: isChecked, disabled: disabled, onChange: onChange, "aria-checked": indeterminate ? 'mixed' : isChecked, "aria-disabled": disabled, name: name, ref: inputRef, value: value, id: id }), (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { className: constants_1.checkboxClassnames.iconWrapper, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: constants_1.checkboxClassnames.icon, color: color }) })] })));
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, Object.assign({ role: role, "$isDisabled": disabled, "$isError": isError, "$isChecked": isChecked, "$isIndeterminate": indeterminate, className: className, style: style, ref: ref }, restProps, { children: [(0, jsx_runtime_1.jsx)(styles_1.Input, { type: "checkbox", checked: isChecked, disabled: disabled, onChange: onChange, "aria-checked": indeterminate ? 'mixed' : isChecked, "aria-disabled": disabled, name: name, ref: inputRef, value: value, id: id, className: constants_1.checkboxClassnames.input }), (0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { className: constants_1.checkboxClassnames.iconWrapper, children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: constants_1.checkboxClassnames.icon, color: color }) })] })));
|
|
13
13
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkboxClassnames = void 0;
|
|
3
|
+
exports.MOBILE_CHECKBOX_SIZE = exports.CHECKBOX_SIZE = exports.checkboxClassnames = void 0;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
exports.checkboxClassnames = {
|
|
6
6
|
root: (0, utils_1.createUIKitClassname)('checkbox'),
|
|
@@ -13,4 +13,7 @@ exports.checkboxClassnames = {
|
|
|
13
13
|
symbol: (0, utils_1.createUIKitClassname)('checkbox__symbol'),
|
|
14
14
|
iconChecked: (0, utils_1.createUIKitClassname)('checkbox__icon_checked'),
|
|
15
15
|
iconIndeterminate: (0, utils_1.createUIKitClassname)('checkbox__icon_indeterminate'),
|
|
16
|
+
input: (0, utils_1.createUIKitClassname)('checkbox__input'),
|
|
16
17
|
};
|
|
18
|
+
exports.CHECKBOX_SIZE = '32px';
|
|
19
|
+
exports.MOBILE_CHECKBOX_SIZE = '40px';
|
|
@@ -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.checkboxClassnames = void 0;
|
|
17
|
+
exports.MOBILE_CHECKBOX_SIZE = exports.CHECKBOX_SIZE = exports.checkboxClassnames = void 0;
|
|
18
18
|
__exportStar(require("./Checkbox"), exports);
|
|
19
19
|
var constants_1 = require("./constants");
|
|
20
20
|
Object.defineProperty(exports, "checkboxClassnames", { enumerable: true, get: function () { return constants_1.checkboxClassnames; } });
|
|
21
|
+
Object.defineProperty(exports, "CHECKBOX_SIZE", { enumerable: true, get: function () { return constants_1.CHECKBOX_SIZE; } });
|
|
22
|
+
Object.defineProperty(exports, "MOBILE_CHECKBOX_SIZE", { enumerable: true, get: function () { return constants_1.MOBILE_CHECKBOX_SIZE; } });
|
|
@@ -22,19 +22,18 @@ exports.Wrapper = (0, styles_1.styled)('span', {
|
|
|
22
22
|
display: flex;
|
|
23
23
|
justify-content: center;
|
|
24
24
|
|
|
25
|
-
.${constants_1.checkboxClassnames.icon} {
|
|
25
|
+
.${constants_1.checkboxClassnames.icon} {
|
|
26
26
|
fill: ${({ $isDisabled, theme }) => $isDisabled && theme.palette.components.disabled};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.${constants_1.checkboxClassnames.symbol} {
|
|
30
|
-
fill: ${({ $isDisabled, theme }) =>
|
|
30
|
+
fill: ${({ $isDisabled, theme }) => $isDisabled ? theme.palette.grey[500] : 'white'};
|
|
31
31
|
|
|
32
32
|
${mixins_1.easeOutBackTransition};
|
|
33
|
-
|
|
34
33
|
}
|
|
35
|
-
|
|
34
|
+
|
|
36
35
|
.${constants_1.checkboxClassnames.outline} {
|
|
37
|
-
fill: ${({ $isDisabled, $isChecked, $isIndeterminate }) =>
|
|
36
|
+
fill: ${({ $isDisabled, $isChecked, $isIndeterminate }) => !$isDisabled && !$isChecked && !$isIndeterminate && 'white'};
|
|
38
37
|
stroke: ${({ theme, $isDisabled, $isError, $isChecked, $isIndeterminate, }) => getOutlineColor({
|
|
39
38
|
theme,
|
|
40
39
|
isHover: false,
|
|
@@ -45,30 +44,31 @@ exports.Wrapper = (0, styles_1.styled)('span', {
|
|
|
45
44
|
})};
|
|
46
45
|
|
|
47
46
|
${mixins_1.easeOutBackTransition};
|
|
48
|
-
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
.${constants_1.checkboxClassnames.iconChecked} {
|
|
52
50
|
transform-origin: bottom;
|
|
53
|
-
transform: ${({ $isChecked, $isIndeterminate }) =>
|
|
51
|
+
transform: ${({ $isChecked, $isIndeterminate }) => $isChecked && !$isIndeterminate ? 'scale(1)' : 'scale(0)'};
|
|
54
52
|
|
|
55
|
-
opacity: ${({ $isChecked, $isIndeterminate }) =>
|
|
53
|
+
opacity: ${({ $isChecked, $isIndeterminate }) => $isChecked && !$isIndeterminate ? 1 : 0};
|
|
56
54
|
}
|
|
57
|
-
|
|
55
|
+
|
|
58
56
|
.${constants_1.checkboxClassnames.iconIndeterminate} {
|
|
59
57
|
transform-origin: bottom;
|
|
60
|
-
transform: ${({ $isIndeterminate }) =>
|
|
58
|
+
transform: ${({ $isIndeterminate }) => $isIndeterminate ? 'scale(1)' : 'scale(0)'};
|
|
61
59
|
|
|
62
60
|
opacity: ${({ $isIndeterminate }) => ($isIndeterminate ? 1 : 0)};
|
|
63
61
|
}
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
&:hover {
|
|
66
64
|
.${constants_1.checkboxClassnames.icon} {
|
|
67
|
-
color: ${({ $isError, theme }) => $isError ? theme.palette.error[700] : theme.palette.primary[700]}
|
|
65
|
+
color: ${({ $isError, theme }) => $isError ? theme.palette.error[700] : theme.palette.primary[700]};
|
|
68
66
|
}
|
|
69
|
-
|
|
67
|
+
|
|
70
68
|
.${constants_1.checkboxClassnames.outline} {
|
|
71
|
-
fill: ${({ theme, $isDisabled, $isChecked, $isIndeterminate }) =>
|
|
69
|
+
fill: ${({ theme, $isDisabled, $isChecked, $isIndeterminate }) => !$isDisabled &&
|
|
70
|
+
!$isChecked &&
|
|
71
|
+
!$isIndeterminate &&
|
|
72
72
|
theme.palette.background.elementHover};
|
|
73
73
|
stroke: ${({ theme, $isDisabled, $isError, $isChecked, $isIndeterminate, }) => getOutlineColor({
|
|
74
74
|
theme,
|
|
@@ -83,22 +83,22 @@ exports.Wrapper = (0, styles_1.styled)('span', {
|
|
|
83
83
|
`;
|
|
84
84
|
exports.Input = styles_1.styled.input `
|
|
85
85
|
cursor: ${({ disabled }) => !disabled && 'pointer'};
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
position: absolute;
|
|
88
88
|
|
|
89
|
-
width:
|
|
90
|
-
height:
|
|
89
|
+
width: ${constants_1.CHECKBOX_SIZE};
|
|
90
|
+
height: ${constants_1.CHECKBOX_SIZE};
|
|
91
91
|
margin: 0;
|
|
92
92
|
|
|
93
93
|
opacity: 0;
|
|
94
94
|
|
|
95
95
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
96
|
-
width:
|
|
97
|
-
height:
|
|
96
|
+
width: ${constants_1.MOBILE_CHECKBOX_SIZE};
|
|
97
|
+
height: ${constants_1.MOBILE_CHECKBOX_SIZE};
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
&:focus-visible {
|
|
101
|
-
|
|
101
|
+
~ .${constants_1.checkboxClassnames.iconWrapper} > .${constants_1.checkboxClassnames.icon} {
|
|
102
102
|
border-radius: ${({ theme }) => theme.shape.small};
|
|
103
103
|
outline: 2px solid ${({ theme }) => theme.palette.components.focused};
|
|
104
104
|
outline-offset: -2px;
|
|
@@ -110,12 +110,12 @@ exports.IconWrapper = styles_1.styled.span `
|
|
|
110
110
|
align-items: center;
|
|
111
111
|
justify-content: center;
|
|
112
112
|
|
|
113
|
-
width:
|
|
114
|
-
height:
|
|
113
|
+
width: ${constants_1.CHECKBOX_SIZE};
|
|
114
|
+
height: ${constants_1.CHECKBOX_SIZE};
|
|
115
115
|
|
|
116
116
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
117
|
-
width:
|
|
118
|
-
height:
|
|
117
|
+
width: ${constants_1.MOBILE_CHECKBOX_SIZE};
|
|
118
|
+
height: ${constants_1.MOBILE_CHECKBOX_SIZE};
|
|
119
119
|
|
|
120
120
|
.${constants_1.checkboxClassnames.icon} {
|
|
121
121
|
width: 20px;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScrollWrapper = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("./styles");
|
|
6
|
+
const ScrollWrapper = ({ children, shape = 'medium', }) => (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { "$shape": shape, children: children });
|
|
7
|
+
exports.ScrollWrapper = ScrollWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ScrollWrapper';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ScrollWrapper"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
$shape: 'small' | 'medium' | 'large';
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Wrapper = void 0;
|
|
4
|
+
const styles_1 = require("../styles");
|
|
5
|
+
exports.Wrapper = styles_1.styled.div `
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
|
|
8
|
+
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
9
|
+
border-radius: ${({ theme, $shape }) => theme.shape[$shape]};
|
|
10
|
+
`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.List = exports.StyledTreeItem = exports.StyledCheckbox = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
4
5
|
const Checkbox_1 = require("../../../Checkbox");
|
|
5
6
|
const styles_1 = require("../../../styles");
|
|
6
7
|
const mixins_1 = require("../../../styles/mixins");
|
|
@@ -8,13 +9,26 @@ const TreeItem_1 = require("../../TreeItem");
|
|
|
8
9
|
exports.StyledCheckbox = (0, styles_1.styled)(Checkbox_1.Checkbox) `
|
|
9
10
|
padding-top: 0;
|
|
10
11
|
padding-bottom: 0;
|
|
12
|
+
|
|
13
|
+
& > .${Checkbox_1.checkboxClassnames.input}, .${Checkbox_1.checkboxClassnames.iconWrapper} {
|
|
14
|
+
width: 32px;
|
|
15
|
+
height: 16px;
|
|
16
|
+
|
|
17
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
|
+
height: 20px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
`;
|
|
12
22
|
exports.StyledTreeItem = (0, styles_1.styled)(TreeItem_1.TreeItem) `
|
|
23
|
+
.${material_1.formControlLabelClasses.root} .${material_1.formControlLabelClasses.label} {
|
|
24
|
+
margin-left: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
13
27
|
.${TreeItem_1.treeClassnames.note} {
|
|
14
28
|
/* cSpell:ignore чекбоксом */
|
|
15
29
|
|
|
16
30
|
/* Добавляем к отступу ширину контейнера с чекбоксом */
|
|
17
|
-
margin-left: ${
|
|
31
|
+
margin-left: ${Checkbox_1.CHECKBOX_SIZE};
|
|
18
32
|
}
|
|
19
33
|
`;
|
|
20
34
|
exports.List = styles_1.styled.ul `
|
|
@@ -3,9 +3,3 @@ export declare const List: import("@emotion/styled").StyledComponent<{
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
6
|
-
export declare const InnerList: import("@emotion/styled").StyledComponent<{
|
|
7
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: import("react").ElementType<any> | undefined;
|
|
9
|
-
} & import("react").ClassAttributes<HTMLUListElement> & import("react").HTMLAttributes<HTMLUListElement> & {
|
|
10
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
-
}, {}, {}>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.List = void 0;
|
|
4
4
|
const styles_1 = require("../../styles");
|
|
5
5
|
const mixins_1 = require("../../styles/mixins");
|
|
6
6
|
exports.List = styles_1.styled.ul `
|
|
7
7
|
${mixins_1.listContainer};
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
`;
|
|
10
|
-
exports.InnerList = (0, styles_1.styled)(exports.List) `
|
|
11
|
-
overflow: unset;
|
|
12
|
-
`;
|
|
@@ -8,5 +8,6 @@ exports.GAP_WIDTH = '4px';
|
|
|
8
8
|
exports.HALF_PADDING_COLLAPSE_BUTTON_WIDTH = '14px';
|
|
9
9
|
exports.TOOLTIP_PLACEMENT = 'bottom-start';
|
|
10
10
|
exports.treeClassnames = {
|
|
11
|
-
note: (0, utils_1.createUIKitClassname)('
|
|
11
|
+
note: (0, utils_1.createUIKitClassname)('tree-item__note'),
|
|
12
|
+
label: (0, utils_1.createUIKitClassname)('tree-item__label'),
|
|
12
13
|
};
|
|
@@ -45,10 +45,6 @@ export declare const ChevronIcon: import("@emotion/styled").StyledComponent<{
|
|
|
45
45
|
} & {
|
|
46
46
|
$isActive?: boolean | undefined;
|
|
47
47
|
}, {}, {}>;
|
|
48
|
-
export declare const List: import("@emotion/styled").StyledComponent<{
|
|
49
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
50
|
-
as?: import("react").ElementType<any> | undefined;
|
|
51
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
52
48
|
export declare const LabelWrapper: import("@emotion/styled").StyledComponent<{
|
|
53
49
|
theme?: import("@emotion/react").Theme | undefined;
|
|
54
50
|
as?: import("react").ElementType<any> | undefined;
|