@astral/ui 1.34.0 → 1.35.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/DataGrid/DataGrid.d.ts +8 -1
- package/DataGrid/DataGrid.js +3 -2
- package/DataGrid/DataGridBody/styles.js +1 -1
- package/DataGrid/DataGridLoader/DataGridLoader.d.ts +3 -1
- package/DataGrid/DataGridLoader/DataGridLoader.js +2 -2
- package/DataGrid/DataGridLoader/styles.d.ts +6 -1
- package/DataGrid/DataGridLoader/styles.js +3 -1
- package/DataGrid/styles.d.ts +8 -0
- package/DataGrid/styles.js +7 -3
- package/NavMenu/NavMenuItem/NavMenuItem.d.ts +1 -1
- package/NavMenu/NavMenuItem/NavMenuItem.js +1 -1
- package/NavMenu/NavMenuItem/NavMenuItemButton/styles.js +35 -0
- package/esm/DataGrid/DataGrid.d.ts +8 -1
- package/esm/DataGrid/DataGrid.js +3 -2
- package/esm/DataGrid/DataGridBody/styles.js +1 -1
- package/esm/DataGrid/DataGridLoader/DataGridLoader.d.ts +3 -1
- package/esm/DataGrid/DataGridLoader/DataGridLoader.js +2 -2
- package/esm/DataGrid/DataGridLoader/styles.d.ts +6 -1
- package/esm/DataGrid/DataGridLoader/styles.js +3 -1
- package/esm/DataGrid/styles.d.ts +8 -0
- package/esm/DataGrid/styles.js +7 -3
- package/esm/NavMenu/NavMenuItem/NavMenuItem.d.ts +1 -1
- package/esm/NavMenu/NavMenuItem/NavMenuItem.js +1 -1
- package/esm/NavMenu/NavMenuItem/NavMenuItemButton/styles.js +35 -0
- package/package.json +2 -2
package/DataGrid/DataGrid.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DataGridColumns, DataGridRow, DataGridSort } from './types';
|
|
3
3
|
export declare type DataGridProps<Data extends object = DataGridRow, SortField extends keyof Data = keyof Data> = {
|
|
4
|
+
className?: string;
|
|
4
5
|
/**
|
|
5
6
|
* @example <DataGrid rows={[{name: 'test'}]} />
|
|
6
7
|
* Массив данных для таблицы
|
|
@@ -74,5 +75,11 @@ export declare type DataGridProps<Data extends object = DataGridRow, SortField e
|
|
|
74
75
|
* Используется для отображения переданного кол-ва строк при отсутствии данных
|
|
75
76
|
*/
|
|
76
77
|
minDisplayRows?: number;
|
|
78
|
+
/**
|
|
79
|
+
* @default 50
|
|
80
|
+
* @example <DateGrid Footer={Footer} footerHeight={50} />
|
|
81
|
+
* Высота Footer, по-умолчанию указана высота Footer из кита
|
|
82
|
+
*/
|
|
83
|
+
footerHeight?: number;
|
|
77
84
|
};
|
|
78
|
-
export declare function DataGrid<Data extends object = DataGridRow, SortField extends keyof Data = keyof Data>({ columns, rows, selectedRows, sorting, maxHeight, minDisplayRows, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, }: DataGridProps<Data, SortField>): JSX.Element;
|
|
85
|
+
export declare function DataGrid<Data extends object = DataGridRow, SortField extends keyof Data = keyof Data>({ columns, rows, selectedRows, sorting, maxHeight, minDisplayRows, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, className, footerHeight, }: DataGridProps<Data, SortField>): JSX.Element;
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -12,8 +12,9 @@ const DataGridBody_1 = require("./DataGridBody");
|
|
|
12
12
|
const DataGridLoader_1 = __importDefault(require("./DataGridLoader/DataGridLoader"));
|
|
13
13
|
const DataGridNoData_1 = require("./DataGridNoData");
|
|
14
14
|
const styles_1 = require("./styles");
|
|
15
|
-
function DataGrid({ columns, rows = [], selectedRows = [], sorting, maxHeight, minDisplayRows = 10, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, }) {
|
|
15
|
+
function DataGrid({ columns, rows = [], selectedRows = [], sorting, maxHeight, minDisplayRows = 10, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, className, footerHeight = 50, }) {
|
|
16
16
|
const selectable = Boolean(onSelectRow);
|
|
17
|
+
const withFooter = Boolean(Footer);
|
|
17
18
|
const handleSelectAllRows = (event) => {
|
|
18
19
|
if (!onSelectRow) {
|
|
19
20
|
return;
|
|
@@ -43,6 +44,6 @@ function DataGrid({ columns, rows = [], selectedRows = [], sorting, maxHeight, m
|
|
|
43
44
|
}
|
|
44
45
|
return null;
|
|
45
46
|
}, [noDataPlaceholder, loading]);
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.DataGridContainer, { children: [(0, jsx_runtime_1.
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.DataGridContainer, Object.assign({ maxHeight: maxHeight, className: className }, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledTableContainer, { children: (0, jsx_runtime_1.jsxs)(Table_1.Table, Object.assign({ stickyHeader: true }, { children: [(0, jsx_runtime_1.jsx)(DataGridHead_1.DataGridHead, { onSort: onSort, rowsCount: rows.length, uncheckedRowsCount: uncheckedRowsCount, onSelectAllRows: handleSelectAllRows, selectable: selectable, sorting: sorting, columns: columns }), (0, jsx_runtime_1.jsx)(DataGridBody_1.DataGridBody, { keyId: keyId, selectedRows: selectedRows, minDisplayRows: minDisplayRows, onRowClick: onRowClick, onSelectRow: handleSelectRow, selectable: selectable, rows: rows, columns: columns, emptyCellValue: emptyCellValue, noDataPlaceholder: renderedPlaceholder() })] })) }), (0, jsx_runtime_1.jsx)(DataGridLoader_1.default, { footerHeight: footerHeight, withFooter: withFooter, loading: loading }), Footer] })));
|
|
47
48
|
}
|
|
48
49
|
exports.DataGrid = DataGrid;
|
|
@@ -9,5 +9,5 @@ exports.StyledTableBody = (0, styles_1.styled)(Table_1.TableBody, {
|
|
|
9
9
|
}) `
|
|
10
10
|
position: relative;
|
|
11
11
|
|
|
12
|
-
height: ${({ empty, minDisplayRows }) => empty ? `${TABLE_ROW_HEIGHT * minDisplayRows}px` : '
|
|
12
|
+
height: ${({ empty, minDisplayRows }) => empty ? `${TABLE_ROW_HEIGHT * minDisplayRows}px` : '100%'};
|
|
13
13
|
`;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare type DataGridLoaderProps = {
|
|
3
3
|
loading?: boolean;
|
|
4
|
+
withFooter: boolean;
|
|
5
|
+
footerHeight: number;
|
|
4
6
|
};
|
|
5
|
-
declare const DataGridLoader: ({ loading }: DataGridLoaderProps) => JSX.Element;
|
|
7
|
+
declare const DataGridLoader: ({ loading, withFooter, footerHeight, }: DataGridLoaderProps) => JSX.Element;
|
|
6
8
|
export default DataGridLoader;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
const styles_1 = require("./styles");
|
|
5
|
-
const DataGridLoader = ({ loading = false }) => {
|
|
6
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.LoaderWrapper, { children: [loading && (0, jsx_runtime_1.jsx)(styles_1.Backdrop, {}), loading
|
|
5
|
+
const DataGridLoader = ({ loading = false, withFooter, footerHeight, }) => {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.LoaderWrapper, { children: [loading && ((0, jsx_runtime_1.jsx)(styles_1.Backdrop, { withFooter: withFooter, footerHeight: footerHeight })), loading && (0, jsx_runtime_1.jsx)(styles_1.StyledLinearProgress, {}), !loading && (0, jsx_runtime_1.jsx)(styles_1.StyledDivider, {})] }));
|
|
7
7
|
};
|
|
8
8
|
exports.default = DataGridLoader;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
declare type BackdropProps = {
|
|
3
|
+
withFooter: boolean;
|
|
4
|
+
footerHeight: number;
|
|
5
|
+
};
|
|
2
6
|
export declare const Backdrop: import("@emotion/styled").StyledComponent<{
|
|
3
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
8
|
as?: import("react").ElementType<any> | undefined;
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
} & BackdropProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
10
|
export declare const StyledDivider: import("@emotion/styled").StyledComponent<import("../../Divider").DividerProps & {
|
|
7
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
12
|
}, {}, {}>;
|
|
@@ -13,3 +17,4 @@ export declare const LoaderWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
13
17
|
export declare const StyledLinearProgress: import("@emotion/styled").StyledComponent<import("@mui/material").LinearProgressProps & {
|
|
14
18
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
19
|
}, {}, {}>;
|
|
20
|
+
export {};
|
|
@@ -9,7 +9,9 @@ exports.Backdrop = styles_1.styled.div `
|
|
|
9
9
|
top: 0;
|
|
10
10
|
|
|
11
11
|
width: 100%;
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
/* Если в DataGrid передан Footer, нужно чтобы Backdrop не перекрывал его в состоянии loading, поэтому тут его высота вычитается из всей высоты бэкдропа */
|
|
14
|
+
height: ${({ withFooter, footerHeight }) => withFooter ? `calc(100% - ${footerHeight}px) ` : '100%'};
|
|
13
15
|
|
|
14
16
|
background-color: ${({ theme }) => theme.palette.grey['100']};
|
|
15
17
|
opacity: 0.6;
|
package/DataGrid/styles.d.ts
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
export declare const DataGridContainer: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
children?: import("react").ReactNode;
|
|
7
|
+
classes?: Partial<import("@mui/material").TableContainerClasses> | undefined;
|
|
8
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
9
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "css" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
10
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
11
|
+
}, "sx" | "children" | keyof import("@mui/material/OverridableComponent").CommonProps> & {
|
|
12
|
+
maxHeight?: number | undefined;
|
|
5
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
14
|
export declare const StyledTableContainer: import("@emotion/styled").StyledComponent<import("../Table").TableContainerProps & {
|
|
7
15
|
theme?: import("@emotion/react").Theme | undefined;
|
package/DataGrid/styles.js
CHANGED
|
@@ -4,13 +4,17 @@ exports.StyledTableContainer = exports.DataGridContainer = void 0;
|
|
|
4
4
|
const styles_1 = require("../styles");
|
|
5
5
|
const Table_1 = require("../Table");
|
|
6
6
|
exports.DataGridContainer = styles_1.styled.div `
|
|
7
|
+
position: relative;
|
|
8
|
+
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
7
11
|
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
max-height: ${({ maxHeight }) => (maxHeight ? `${maxHeight}px` : 'initial')};
|
|
8
14
|
overflow: hidden;
|
|
9
15
|
`;
|
|
10
16
|
exports.StyledTableContainer = (0, styles_1.styled)(Table_1.TableContainer, {
|
|
11
17
|
shouldForwardProp: (prop) => prop !== 'maxHeight',
|
|
12
18
|
}) `
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
max-height: ${({ maxHeight }) => `${maxHeight}px` || 'auto'};
|
|
19
|
+
height: 100%;
|
|
16
20
|
`;
|
|
@@ -4,8 +4,8 @@ exports.NavMenuItem = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Collapse_1 = require("../../Collapse");
|
|
7
|
+
const NavMenuItemList_1 = require("./NavMenuItemList");
|
|
7
8
|
const NavMenuItemButton_1 = require("./NavMenuItemButton");
|
|
8
|
-
const NavMenuItemList_1 = require("./NavMenuItemList/NavMenuItemList");
|
|
9
9
|
const NavMenuItem = (props) => {
|
|
10
10
|
var _a;
|
|
11
11
|
const { collapsedIn, item: [key, value], } = props;
|
|
@@ -11,6 +11,41 @@ exports.NavMenuItemButtonRoot = (0, styles_1.styled)(ListItemButton_1.ListItemBu
|
|
|
11
11
|
padding: ${({ theme }) => theme.spacing(2)};
|
|
12
12
|
|
|
13
13
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
14
|
+
|
|
15
|
+
.MuiListItemIcon-root {
|
|
16
|
+
color: ${({ theme, selected }) => {
|
|
17
|
+
return selected ? theme.palette.primary['800'] : 'inherit';
|
|
18
|
+
}};
|
|
19
|
+
|
|
20
|
+
transition: ${({ theme }) => {
|
|
21
|
+
return theme.transitions.create('color', {
|
|
22
|
+
easing: theme.transitions.easing.easeIn,
|
|
23
|
+
duration: theme.transitions.duration.shortest,
|
|
24
|
+
});
|
|
25
|
+
}};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.Mui-selected:hover {
|
|
29
|
+
background-color: inherit;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
color: ${({ theme }) => theme.palette.primary['800']};
|
|
34
|
+
|
|
35
|
+
background-color: inherit;
|
|
36
|
+
|
|
37
|
+
.MuiListItemIcon-root {
|
|
38
|
+
color: ${({ theme }) => theme.palette.primary['800']};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:active {
|
|
43
|
+
color: ${({ theme }) => theme.palette.primary['900']};
|
|
44
|
+
|
|
45
|
+
.MuiListItemIcon-root {
|
|
46
|
+
color: ${({ theme }) => theme.palette.primary['900']};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
14
49
|
`;
|
|
15
50
|
exports.NavMenuItemButtonIcon = (0, styles_1.styled)(ListItemIcon_1.ListItemIcon) `
|
|
16
51
|
min-width: unset;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DataGridColumns, DataGridRow, DataGridSort } from './types';
|
|
3
3
|
export declare type DataGridProps<Data extends object = DataGridRow, SortField extends keyof Data = keyof Data> = {
|
|
4
|
+
className?: string;
|
|
4
5
|
/**
|
|
5
6
|
* @example <DataGrid rows={[{name: 'test'}]} />
|
|
6
7
|
* Массив данных для таблицы
|
|
@@ -74,5 +75,11 @@ export declare type DataGridProps<Data extends object = DataGridRow, SortField e
|
|
|
74
75
|
* Используется для отображения переданного кол-ва строк при отсутствии данных
|
|
75
76
|
*/
|
|
76
77
|
minDisplayRows?: number;
|
|
78
|
+
/**
|
|
79
|
+
* @default 50
|
|
80
|
+
* @example <DateGrid Footer={Footer} footerHeight={50} />
|
|
81
|
+
* Высота Footer, по-умолчанию указана высота Footer из кита
|
|
82
|
+
*/
|
|
83
|
+
footerHeight?: number;
|
|
77
84
|
};
|
|
78
|
-
export declare function DataGrid<Data extends object = DataGridRow, SortField extends keyof Data = keyof Data>({ columns, rows, selectedRows, sorting, maxHeight, minDisplayRows, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, }: DataGridProps<Data, SortField>): JSX.Element;
|
|
85
|
+
export declare function DataGrid<Data extends object = DataGridRow, SortField extends keyof Data = keyof Data>({ columns, rows, selectedRows, sorting, maxHeight, minDisplayRows, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, className, footerHeight, }: DataGridProps<Data, SortField>): JSX.Element;
|
package/esm/DataGrid/DataGrid.js
CHANGED
|
@@ -6,8 +6,9 @@ import { DataGridBody } from './DataGridBody';
|
|
|
6
6
|
import DataGridLoader from './DataGridLoader/DataGridLoader';
|
|
7
7
|
import { DataGridNoData } from './DataGridNoData';
|
|
8
8
|
import { DataGridContainer, StyledTableContainer } from './styles';
|
|
9
|
-
export function DataGrid({ columns, rows = [], selectedRows = [], sorting, maxHeight, minDisplayRows = 10, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, }) {
|
|
9
|
+
export function DataGrid({ columns, rows = [], selectedRows = [], sorting, maxHeight, minDisplayRows = 10, onRowClick, onSelectRow, Footer, noDataPlaceholder, loading, onSort, keyId, emptyCellValue, className, footerHeight = 50, }) {
|
|
10
10
|
const selectable = Boolean(onSelectRow);
|
|
11
|
+
const withFooter = Boolean(Footer);
|
|
11
12
|
const handleSelectAllRows = (event) => {
|
|
12
13
|
if (!onSelectRow) {
|
|
13
14
|
return;
|
|
@@ -37,5 +38,5 @@ export function DataGrid({ columns, rows = [], selectedRows = [], sorting, maxHe
|
|
|
37
38
|
}
|
|
38
39
|
return null;
|
|
39
40
|
}, [noDataPlaceholder, loading]);
|
|
40
|
-
return (_jsxs(DataGridContainer,
|
|
41
|
+
return (_jsxs(DataGridContainer, Object.assign({ maxHeight: maxHeight, className: className }, { children: [_jsx(StyledTableContainer, { children: _jsxs(Table, Object.assign({ stickyHeader: true }, { children: [_jsx(DataGridHead, { onSort: onSort, rowsCount: rows.length, uncheckedRowsCount: uncheckedRowsCount, onSelectAllRows: handleSelectAllRows, selectable: selectable, sorting: sorting, columns: columns }), _jsx(DataGridBody, { keyId: keyId, selectedRows: selectedRows, minDisplayRows: minDisplayRows, onRowClick: onRowClick, onSelectRow: handleSelectRow, selectable: selectable, rows: rows, columns: columns, emptyCellValue: emptyCellValue, noDataPlaceholder: renderedPlaceholder() })] })) }), _jsx(DataGridLoader, { footerHeight: footerHeight, withFooter: withFooter, loading: loading }), Footer] })));
|
|
41
42
|
}
|
|
@@ -6,5 +6,5 @@ export const StyledTableBody = styled(TableBody, {
|
|
|
6
6
|
}) `
|
|
7
7
|
position: relative;
|
|
8
8
|
|
|
9
|
-
height: ${({ empty, minDisplayRows }) => empty ? `${TABLE_ROW_HEIGHT * minDisplayRows}px` : '
|
|
9
|
+
height: ${({ empty, minDisplayRows }) => empty ? `${TABLE_ROW_HEIGHT * minDisplayRows}px` : '100%'};
|
|
10
10
|
`;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare type DataGridLoaderProps = {
|
|
3
3
|
loading?: boolean;
|
|
4
|
+
withFooter: boolean;
|
|
5
|
+
footerHeight: number;
|
|
4
6
|
};
|
|
5
|
-
declare const DataGridLoader: ({ loading }: DataGridLoaderProps) => JSX.Element;
|
|
7
|
+
declare const DataGridLoader: ({ loading, withFooter, footerHeight, }: DataGridLoaderProps) => JSX.Element;
|
|
6
8
|
export default DataGridLoader;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Backdrop, LoaderWrapper, StyledDivider, StyledLinearProgress, } from './styles';
|
|
3
|
-
const DataGridLoader = ({ loading = false }) => {
|
|
4
|
-
return (_jsxs(LoaderWrapper, { children: [loading && _jsx(Backdrop, {}), loading
|
|
3
|
+
const DataGridLoader = ({ loading = false, withFooter, footerHeight, }) => {
|
|
4
|
+
return (_jsxs(LoaderWrapper, { children: [loading && (_jsx(Backdrop, { withFooter: withFooter, footerHeight: footerHeight })), loading && _jsx(StyledLinearProgress, {}), !loading && _jsx(StyledDivider, {})] }));
|
|
5
5
|
};
|
|
6
6
|
export default DataGridLoader;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
declare type BackdropProps = {
|
|
3
|
+
withFooter: boolean;
|
|
4
|
+
footerHeight: number;
|
|
5
|
+
};
|
|
2
6
|
export declare const Backdrop: import("@emotion/styled").StyledComponent<{
|
|
3
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
8
|
as?: import("react").ElementType<any> | undefined;
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
} & BackdropProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
10
|
export declare const StyledDivider: import("@emotion/styled").StyledComponent<import("../../Divider").DividerProps & {
|
|
7
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
12
|
}, {}, {}>;
|
|
@@ -13,3 +17,4 @@ export declare const LoaderWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
13
17
|
export declare const StyledLinearProgress: import("@emotion/styled").StyledComponent<import("@mui/material").LinearProgressProps & {
|
|
14
18
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
19
|
}, {}, {}>;
|
|
20
|
+
export {};
|
|
@@ -6,7 +6,9 @@ export const Backdrop = styled.div `
|
|
|
6
6
|
top: 0;
|
|
7
7
|
|
|
8
8
|
width: 100%;
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
/* Если в DataGrid передан Footer, нужно чтобы Backdrop не перекрывал его в состоянии loading, поэтому тут его высота вычитается из всей высоты бэкдропа */
|
|
11
|
+
height: ${({ withFooter, footerHeight }) => withFooter ? `calc(100% - ${footerHeight}px) ` : '100%'};
|
|
10
12
|
|
|
11
13
|
background-color: ${({ theme }) => theme.palette.grey['100']};
|
|
12
14
|
opacity: 0.6;
|
package/esm/DataGrid/styles.d.ts
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
export declare const DataGridContainer: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
children?: import("react").ReactNode;
|
|
7
|
+
classes?: Partial<import("@mui/material").TableContainerClasses> | undefined;
|
|
8
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
9
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "css" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
10
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
11
|
+
}, "sx" | "children" | keyof import("@mui/material/OverridableComponent").CommonProps> & {
|
|
12
|
+
maxHeight?: number | undefined;
|
|
5
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
14
|
export declare const StyledTableContainer: import("@emotion/styled").StyledComponent<import("../Table").TableContainerProps & {
|
|
7
15
|
theme?: import("@emotion/react").Theme | undefined;
|
package/esm/DataGrid/styles.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { styled } from '../styles';
|
|
2
2
|
import { TableContainer } from '../Table';
|
|
3
3
|
export const DataGridContainer = styled.div `
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
4
8
|
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
max-height: ${({ maxHeight }) => (maxHeight ? `${maxHeight}px` : 'initial')};
|
|
5
11
|
overflow: hidden;
|
|
6
12
|
`;
|
|
7
13
|
export const StyledTableContainer = styled(TableContainer, {
|
|
8
14
|
shouldForwardProp: (prop) => prop !== 'maxHeight',
|
|
9
15
|
}) `
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
max-height: ${({ maxHeight }) => `${maxHeight}px` || 'auto'};
|
|
16
|
+
height: 100%;
|
|
13
17
|
`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo, useState, } from 'react';
|
|
3
3
|
import { Collapse } from '../../Collapse';
|
|
4
|
+
import { NavMenuItemList } from './NavMenuItemList';
|
|
4
5
|
import { NavMenuItemButton } from './NavMenuItemButton';
|
|
5
|
-
import { NavMenuItemList } from './NavMenuItemList/NavMenuItemList';
|
|
6
6
|
export const NavMenuItem = (props) => {
|
|
7
7
|
var _a;
|
|
8
8
|
const { collapsedIn, item: [key, value], } = props;
|
|
@@ -8,6 +8,41 @@ export const NavMenuItemButtonRoot = styled(ListItemButton) `
|
|
|
8
8
|
padding: ${({ theme }) => theme.spacing(2)};
|
|
9
9
|
|
|
10
10
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
11
|
+
|
|
12
|
+
.MuiListItemIcon-root {
|
|
13
|
+
color: ${({ theme, selected }) => {
|
|
14
|
+
return selected ? theme.palette.primary['800'] : 'inherit';
|
|
15
|
+
}};
|
|
16
|
+
|
|
17
|
+
transition: ${({ theme }) => {
|
|
18
|
+
return theme.transitions.create('color', {
|
|
19
|
+
easing: theme.transitions.easing.easeIn,
|
|
20
|
+
duration: theme.transitions.duration.shortest,
|
|
21
|
+
});
|
|
22
|
+
}};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.Mui-selected:hover {
|
|
26
|
+
background-color: inherit;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
color: ${({ theme }) => theme.palette.primary['800']};
|
|
31
|
+
|
|
32
|
+
background-color: inherit;
|
|
33
|
+
|
|
34
|
+
.MuiListItemIcon-root {
|
|
35
|
+
color: ${({ theme }) => theme.palette.primary['800']};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:active {
|
|
40
|
+
color: ${({ theme }) => theme.palette.primary['900']};
|
|
41
|
+
|
|
42
|
+
.MuiListItemIcon-root {
|
|
43
|
+
color: ${({ theme }) => theme.palette.primary['900']};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
11
46
|
`;
|
|
12
47
|
export const NavMenuItemButtonIcon = styled(ListItemIcon) `
|
|
13
48
|
min-width: unset;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.0",
|
|
4
4
|
"browser": "./esm/index.js",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@astral/icons": "^1.
|
|
7
|
+
"@astral/icons": "^1.35.0",
|
|
8
8
|
"@emotion/cache": "11.7.1",
|
|
9
9
|
"@emotion/react": "11.9.0",
|
|
10
10
|
"@emotion/server": "11.4.0",
|