@astral/ui 4.45.0 → 4.47.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/ComplianceStatus/ComplianceStatus.d.ts +1 -43
- package/components/ComplianceStatus/ComplianceStatus.js +17 -2
- package/components/ComplianceStatus/constants.d.ts +14 -0
- package/components/ComplianceStatus/constants.js +18 -0
- package/components/ComplianceStatus/index.d.ts +2 -1
- package/components/ComplianceStatus/index.js +1 -1
- package/components/ComplianceStatus/public.d.ts +2 -1
- package/components/ComplianceStatus/public.js +1 -1
- package/components/ComplianceStatus/styles.d.ts +0 -5
- package/components/ComplianceStatus/styles.js +21 -3
- package/components/ComplianceStatus/types.d.ts +42 -0
- package/components/ComplianceStatus/types.js +1 -0
- package/components/DataGrid/Body/Body.d.ts +1 -98
- package/components/DataGrid/Body/Body.js +3 -15
- package/components/DataGrid/Body/index.d.ts +1 -0
- package/components/DataGrid/Body/index.js +1 -0
- package/components/DataGrid/Body/types.d.ts +110 -0
- package/components/DataGrid/Body/types.js +1 -0
- package/components/DataGrid/DataGrid.js +30 -5
- package/components/DataGrid/Head/Head.d.ts +4 -0
- package/components/DataGrid/Head/Head.js +3 -2
- package/components/DataGrid/Loader/Loader.js +2 -2
- package/components/DataGrid/Loader/styles.js +4 -2
- package/components/DataGrid/PinnedSections/PinnedSections.d.ts +35 -0
- package/components/DataGrid/PinnedSections/PinnedSections.js +11 -0
- package/components/DataGrid/PinnedSections/Section/Section.d.ts +3 -0
- package/components/DataGrid/PinnedSections/Section/Section.js +17 -0
- package/components/DataGrid/PinnedSections/Section/index.d.ts +1 -0
- package/components/DataGrid/PinnedSections/Section/index.js +1 -0
- package/components/DataGrid/PinnedSections/Section/styles.d.ts +5 -0
- package/components/DataGrid/PinnedSections/Section/styles.js +100 -0
- package/components/DataGrid/PinnedSections/Section/types.d.ts +26 -0
- package/components/DataGrid/PinnedSections/Section/types.js +1 -0
- package/components/DataGrid/PinnedSections/Section/useLogic/useLogic.d.ts +9 -0
- package/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +16 -0
- package/components/DataGrid/PinnedSections/index.d.ts +1 -0
- package/components/DataGrid/PinnedSections/index.js +1 -0
- package/components/DataGrid/PinnedSections/styles.d.ts +7 -0
- package/components/DataGrid/PinnedSections/styles.js +18 -0
- package/components/DataGrid/PinnedSections/types.d.ts +5 -0
- package/components/DataGrid/PinnedSections/types.js +1 -0
- package/components/DataGrid/PinnedSections/useLogic/index.js +1 -0
- package/components/DataGrid/PinnedSections/useLogic/useLogic.d.ts +9 -0
- package/components/DataGrid/PinnedSections/useLogic/useLogic.js +19 -0
- package/components/DataGrid/Row/NestedChildren/NestedChildren.js +2 -2
- package/components/DataGrid/Row/Row.d.ts +1 -94
- package/components/DataGrid/Row/Row.js +23 -8
- package/components/DataGrid/Row/constants.d.ts +3 -1
- package/components/DataGrid/Row/constants.js +3 -1
- package/components/DataGrid/Row/styles.js +9 -8
- package/components/DataGrid/Row/types.d.ts +118 -0
- package/components/DataGrid/Row/types.js +1 -0
- package/components/DataGrid/Row/useLogic/useLogic.d.ts +3 -2
- package/components/DataGrid/Row/useLogic/useLogic.js +14 -2
- package/components/DataGrid/constants.d.ts +7 -0
- package/components/DataGrid/constants.js +7 -0
- package/components/DataGrid/hooks/index.d.ts +1 -0
- package/components/DataGrid/hooks/index.js +1 -0
- package/components/DataGrid/hooks/useRowHover/index.d.ts +1 -0
- package/components/DataGrid/hooks/useRowHover/index.js +1 -0
- package/components/DataGrid/hooks/useRowHover/useRowHover.d.ts +15 -0
- package/components/DataGrid/hooks/useRowHover/useRowHover.js +93 -0
- package/components/DataGrid/styles.js +17 -0
- package/components/DataGrid/types.d.ts +4 -0
- package/components/DataGrid/useLogic/hooks/index.d.ts +2 -0
- package/components/DataGrid/useLogic/hooks/index.js +2 -0
- package/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +1 -0
- package/components/DataGrid/useLogic/hooks/useClassnames/index.js +1 -0
- package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +12 -0
- package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +14 -0
- package/components/DataGrid/useLogic/hooks/usePinnedColumns/index.d.ts +1 -0
- package/components/DataGrid/useLogic/hooks/usePinnedColumns/index.js +1 -0
- package/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.d.ts +18 -0
- package/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +43 -0
- package/components/DataGrid/useLogic/useLogic.d.ts +30 -4
- package/components/DataGrid/useLogic/useLogic.js +55 -16
- package/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.d.ts +17 -0
- package/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.js +45 -0
- package/components/DataGrid/useLogic/utils/getColumnSections/index.d.ts +1 -0
- package/components/DataGrid/useLogic/utils/getColumnSections/index.js +1 -0
- package/components/DataGrid/useLogic/utils/index.d.ts +2 -1
- package/components/DataGrid/useLogic/utils/index.js +2 -1
- package/components/DataGrid/useLogic/utils/syncRowsHeight/index.d.ts +1 -0
- package/components/DataGrid/useLogic/utils/syncRowsHeight/index.js +1 -0
- package/components/DataGrid/useLogic/utils/syncRowsHeight/syncRowsHeight.d.ts +5 -0
- package/components/DataGrid/useLogic/utils/syncRowsHeight/syncRowsHeight.js +21 -0
- package/components/DataGrid/utils/index.d.ts +1 -0
- package/components/DataGrid/utils/index.js +1 -0
- package/components/DataGridInfinite/useLogic/useLogic.js +1 -1
- package/node/components/ComplianceStatus/ComplianceStatus.d.ts +1 -43
- package/node/components/ComplianceStatus/ComplianceStatus.js +17 -2
- package/node/components/ComplianceStatus/constants.d.ts +14 -0
- package/node/components/ComplianceStatus/constants.js +21 -0
- package/node/components/ComplianceStatus/index.d.ts +2 -1
- package/node/components/ComplianceStatus/public.d.ts +2 -1
- package/node/components/ComplianceStatus/styles.d.ts +0 -5
- package/node/components/ComplianceStatus/styles.js +21 -3
- package/node/components/ComplianceStatus/types.d.ts +42 -0
- package/node/components/ComplianceStatus/types.js +2 -0
- package/node/components/DataGrid/Body/Body.d.ts +1 -98
- package/node/components/DataGrid/Body/Body.js +3 -15
- package/node/components/DataGrid/Body/index.d.ts +1 -0
- package/node/components/DataGrid/Body/index.js +1 -0
- package/node/components/DataGrid/Body/types.d.ts +110 -0
- package/node/components/DataGrid/Body/types.js +2 -0
- package/node/components/DataGrid/DataGrid.js +29 -4
- package/node/components/DataGrid/Head/Head.d.ts +4 -0
- package/node/components/DataGrid/Head/Head.js +3 -2
- package/node/components/DataGrid/Loader/Loader.js +1 -1
- package/node/components/DataGrid/Loader/styles.js +4 -2
- package/node/components/DataGrid/PinnedSections/PinnedSections.d.ts +35 -0
- package/node/components/DataGrid/PinnedSections/PinnedSections.js +15 -0
- package/node/components/DataGrid/PinnedSections/Section/Section.d.ts +3 -0
- package/node/components/DataGrid/PinnedSections/Section/Section.js +21 -0
- package/node/components/DataGrid/PinnedSections/Section/index.d.ts +1 -0
- package/node/components/DataGrid/PinnedSections/Section/index.js +17 -0
- package/node/components/DataGrid/PinnedSections/Section/styles.d.ts +5 -0
- package/node/components/DataGrid/PinnedSections/Section/styles.js +103 -0
- package/node/components/DataGrid/PinnedSections/Section/types.d.ts +26 -0
- package/node/components/DataGrid/PinnedSections/Section/types.js +2 -0
- package/node/components/DataGrid/PinnedSections/Section/useLogic/index.d.ts +1 -0
- package/node/components/DataGrid/PinnedSections/Section/useLogic/useLogic.d.ts +9 -0
- package/node/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +20 -0
- package/node/components/DataGrid/PinnedSections/index.d.ts +1 -0
- package/node/components/DataGrid/PinnedSections/index.js +17 -0
- package/node/components/DataGrid/PinnedSections/styles.d.ts +7 -0
- package/node/components/DataGrid/PinnedSections/styles.js +21 -0
- package/node/components/DataGrid/PinnedSections/types.d.ts +5 -0
- package/node/components/DataGrid/PinnedSections/types.js +2 -0
- package/node/components/DataGrid/PinnedSections/useLogic/index.d.ts +1 -0
- package/node/components/DataGrid/PinnedSections/useLogic/index.js +17 -0
- package/node/components/DataGrid/PinnedSections/useLogic/useLogic.d.ts +9 -0
- package/node/components/DataGrid/PinnedSections/useLogic/useLogic.js +23 -0
- package/node/components/DataGrid/Row/NestedChildren/NestedChildren.js +1 -1
- package/node/components/DataGrid/Row/Row.d.ts +1 -94
- package/node/components/DataGrid/Row/Row.js +23 -8
- package/node/components/DataGrid/Row/constants.d.ts +3 -1
- package/node/components/DataGrid/Row/constants.js +4 -2
- package/node/components/DataGrid/Row/styles.js +8 -7
- package/node/components/DataGrid/Row/types.d.ts +118 -0
- package/node/components/DataGrid/Row/types.js +2 -0
- package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +3 -2
- package/node/components/DataGrid/Row/useLogic/useLogic.js +13 -1
- package/node/components/DataGrid/constants.d.ts +7 -0
- package/node/components/DataGrid/constants.js +7 -0
- package/node/components/DataGrid/hooks/index.d.ts +1 -0
- package/node/components/DataGrid/hooks/index.js +17 -0
- package/node/components/DataGrid/hooks/useRowHover/index.d.ts +1 -0
- package/node/components/DataGrid/hooks/useRowHover/index.js +17 -0
- package/node/components/DataGrid/hooks/useRowHover/useRowHover.d.ts +15 -0
- package/node/components/DataGrid/hooks/useRowHover/useRowHover.js +97 -0
- package/node/components/DataGrid/styles.js +17 -0
- package/node/components/DataGrid/types.d.ts +4 -0
- package/node/components/DataGrid/useLogic/hooks/index.d.ts +2 -0
- package/node/components/DataGrid/useLogic/hooks/index.js +18 -0
- package/node/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +1 -0
- package/node/components/DataGrid/useLogic/hooks/useClassnames/index.js +17 -0
- package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +12 -0
- package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +18 -0
- package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/index.d.ts +1 -0
- package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/index.js +17 -0
- package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.d.ts +18 -0
- package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +47 -0
- package/node/components/DataGrid/useLogic/useLogic.d.ts +30 -4
- package/node/components/DataGrid/useLogic/useLogic.js +53 -14
- package/node/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.d.ts +17 -0
- package/node/components/DataGrid/useLogic/utils/getColumnSections/getColumnSections.js +50 -0
- package/node/components/DataGrid/useLogic/utils/getColumnSections/index.d.ts +1 -0
- package/node/components/DataGrid/useLogic/utils/getColumnSections/index.js +17 -0
- package/node/components/DataGrid/useLogic/utils/index.d.ts +2 -1
- package/node/components/DataGrid/useLogic/utils/index.js +5 -3
- package/node/components/DataGrid/useLogic/utils/syncRowsHeight/index.d.ts +1 -0
- package/node/components/DataGrid/useLogic/utils/syncRowsHeight/index.js +17 -0
- package/node/components/DataGrid/useLogic/utils/syncRowsHeight/syncRowsHeight.d.ts +5 -0
- package/node/components/DataGrid/useLogic/utils/syncRowsHeight/syncRowsHeight.js +25 -0
- package/node/components/DataGrid/utils/index.d.ts +1 -0
- package/node/components/DataGrid/utils/index.js +3 -1
- package/node/components/DataGridInfinite/useLogic/useLogic.js +1 -1
- package/package.json +2 -1
- package/components/DataGrid/Body/useLogic/useLogic.d.ts +0 -12
- package/components/DataGrid/Body/useLogic/useLogic.js +0 -11
- package/node/components/DataGrid/Body/useLogic/useLogic.d.ts +0 -12
- package/node/components/DataGrid/Body/useLogic/useLogic.js +0 -15
- /package/components/DataGrid/{Body → PinnedSections/Section}/useLogic/index.d.ts +0 -0
- /package/components/DataGrid/{Body → PinnedSections/Section}/useLogic/index.js +0 -0
- /package/{node/components/DataGrid/Body → components/DataGrid/PinnedSections}/useLogic/index.d.ts +0 -0
- /package/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/getGridTemplateColumns.d.ts +0 -0
- /package/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/getGridTemplateColumns.js +0 -0
- /package/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/index.d.ts +0 -0
- /package/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/index.js +0 -0
- /package/node/components/DataGrid/{Body → PinnedSections/Section}/useLogic/index.js +0 -0
- /package/node/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/getGridTemplateColumns.d.ts +0 -0
- /package/node/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/getGridTemplateColumns.js +0 -0
- /package/node/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/index.d.ts +0 -0
- /package/node/components/DataGrid/{useLogic/utils → utils}/getGridTemplateColumns/index.js +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getInertProps } from '../../utils/getInertProps';
|
|
3
|
+
import { Section } from './Section';
|
|
4
|
+
import { PinnedColumnsContainer } from './styles';
|
|
5
|
+
import { useLogic } from './useLogic';
|
|
6
|
+
export const PinnedSections = ({ gridColumns, className, isDisabled, headProps, bodyProps, sections, isNoData, }) => {
|
|
7
|
+
const { pinnedContainerStyles, sectionOffsets } = useLogic({ sections });
|
|
8
|
+
return (_jsx(PinnedColumnsContainer, { "$gridColumns": gridColumns, className: className, ...getInertProps(isDisabled), style: pinnedContainerStyles, children: sections.map(({ columns, position }) => {
|
|
9
|
+
return (_jsx(Section, { columns: columns, position: position, sectionOffset: sectionOffsets[position], bodyProps: bodyProps, headProps: headProps, isNoData: isNoData }, position));
|
|
10
|
+
}) }));
|
|
11
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DataGridRow } from '../../types';
|
|
2
|
+
import type { SectionProps } from './types';
|
|
3
|
+
export declare const Section: <TData extends Record<string, unknown> = DataGridRow, TSortField extends keyof TData = keyof TData>({ columns, position, isNoData, headProps, bodyProps, sectionOffset, }: SectionProps<TData, TSortField>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Body } from '../../Body';
|
|
3
|
+
import { dataGridClassnames } from '../../constants';
|
|
4
|
+
import { Head } from '../../Head';
|
|
5
|
+
import { DataGridSection } from './styles';
|
|
6
|
+
import { useLogic } from './useLogic';
|
|
7
|
+
export const Section = ({ columns, position, isNoData, headProps, bodyProps, sectionOffset, }) => {
|
|
8
|
+
const { classnames, gridColumns, shouldNotRenderSection } = useLogic({
|
|
9
|
+
position,
|
|
10
|
+
isNoData,
|
|
11
|
+
columns,
|
|
12
|
+
});
|
|
13
|
+
if (shouldNotRenderSection) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (_jsxs(DataGridSection, { className: classnames, children: [!isNoData && (_jsx(Head, { ...headProps, columns: columns, gridColumns: gridColumns, sectionOffset: sectionOffset })), _jsx(Body, { ...bodyProps, columns: columns, gridColumns: gridColumns, sectionOffset: sectionOffset, className: dataGridClassnames.body })] }));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Section';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Section';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DataGridSection: 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>, {}>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { styled } from '../../../styled';
|
|
2
|
+
import { dataGridClassnames } from '../../constants';
|
|
3
|
+
export const DataGridSection = styled.div `
|
|
4
|
+
display: flex;
|
|
5
|
+
grid-column: calc(var(--left-columns-count) + 1) / calc(var(--right-columns-count) * -1 - 1);
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
min-width: 0;
|
|
9
|
+
|
|
10
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
11
|
+
|
|
12
|
+
& .${dataGridClassnames.header} {
|
|
13
|
+
position: sticky;
|
|
14
|
+
z-index: ${({ theme }) => theme.zIndex.fab - 1};
|
|
15
|
+
top: 0;
|
|
16
|
+
|
|
17
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.${dataGridClassnames.pinnedSectionNoData} {
|
|
21
|
+
grid-column: 1 / -1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.${dataGridClassnames.leftPinnedSection} {
|
|
25
|
+
position: sticky;
|
|
26
|
+
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
27
|
+
left: 0;
|
|
28
|
+
|
|
29
|
+
container-name: data-grid-left-pinned-section;
|
|
30
|
+
container-type: scroll-state;
|
|
31
|
+
grid-column: 1 / calc(var(--left-columns-count) + 1);
|
|
32
|
+
|
|
33
|
+
&::after {
|
|
34
|
+
content: '';
|
|
35
|
+
|
|
36
|
+
position: absolute;
|
|
37
|
+
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
38
|
+
top: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
|
|
41
|
+
height: 100%;
|
|
42
|
+
|
|
43
|
+
border-right: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& .${dataGridClassnames.header} {
|
|
47
|
+
left: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/* Причина игнора: прогрессивное улучшение */
|
|
52
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
53
|
+
@container data-grid-left-pinned-section scroll-state(stuck: left) {
|
|
54
|
+
&::after {
|
|
55
|
+
/* Ширина видимой части тени */
|
|
56
|
+
width: 4px;
|
|
57
|
+
|
|
58
|
+
box-shadow: 3px 0 4px 0 #63636326;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.${dataGridClassnames.rightPinnedSection} {
|
|
64
|
+
position: sticky;
|
|
65
|
+
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
66
|
+
right: 0;
|
|
67
|
+
|
|
68
|
+
container-name: data-grid-right-pinned-section;
|
|
69
|
+
container-type: scroll-state;
|
|
70
|
+
grid-column: calc(var(--right-columns-count) * -1 - 1) / -1;
|
|
71
|
+
|
|
72
|
+
&::after {
|
|
73
|
+
content: '';
|
|
74
|
+
|
|
75
|
+
position: absolute;
|
|
76
|
+
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
77
|
+
top: 0;
|
|
78
|
+
left: 0;
|
|
79
|
+
|
|
80
|
+
height: 100%;
|
|
81
|
+
|
|
82
|
+
border-left: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
& .${dataGridClassnames.header} {
|
|
86
|
+
right: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Причина игнора: прогрессивное улучшение */
|
|
90
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
91
|
+
@container data-grid-right-pinned-section scroll-state(stuck: right) {
|
|
92
|
+
&::after {
|
|
93
|
+
/* Ширина видимой части тени */
|
|
94
|
+
width: 4px;
|
|
95
|
+
|
|
96
|
+
box-shadow: -3px 0 4px 0 #63636326;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type BodyProps } from '../../Body';
|
|
2
|
+
import { type HeadProps } from '../../Head';
|
|
3
|
+
import { type CellValue, type DataGridColumns, type DataGridRow } from '../../types';
|
|
4
|
+
export type SectionProps<TData extends Record<string, CellValue> = DataGridRow, TSortField extends keyof TData = keyof TData> = {
|
|
5
|
+
/**
|
|
6
|
+
* Параметры предназначены для конфигурации таблицы
|
|
7
|
+
*/
|
|
8
|
+
bodyProps: Omit<BodyProps<TData>, 'gridColumns' | 'columns'>;
|
|
9
|
+
/**
|
|
10
|
+
* Параметры предназначены для конфигурации шапки таблицы
|
|
11
|
+
*/
|
|
12
|
+
headProps: Omit<HeadProps<TData, TSortField>, 'columns' | 'gridColumns'>;
|
|
13
|
+
/**
|
|
14
|
+
* Флаг для отображения placeholder при отсутствии данных
|
|
15
|
+
*/
|
|
16
|
+
isNoData?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Конфигурация колонок для секции
|
|
19
|
+
*/
|
|
20
|
+
columns: DataGridColumns<TData>[];
|
|
21
|
+
/**
|
|
22
|
+
* Позиция секции
|
|
23
|
+
*/
|
|
24
|
+
position: 'left' | 'center' | 'right';
|
|
25
|
+
sectionOffset: number;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CellValue, DataGridRow } from '../../..//types';
|
|
2
|
+
import { type SectionProps } from '../types';
|
|
3
|
+
type UseLogicParams<TData extends Record<string, CellValue> = DataGridRow> = Pick<SectionProps<TData>, 'isNoData' | 'position' | 'columns'>;
|
|
4
|
+
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow>({ position, isNoData, columns, }: UseLogicParams<TData>) => {
|
|
5
|
+
classnames: string;
|
|
6
|
+
gridColumns: string;
|
|
7
|
+
shouldNotRenderSection: boolean;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { classNames } from '../../../../utils/classNames';
|
|
3
|
+
import { dataGridClassnames } from '../../../constants';
|
|
4
|
+
import { getGridTemplateColumns } from '../../../utils';
|
|
5
|
+
export const useLogic = ({ position, isNoData, columns, }) => {
|
|
6
|
+
const classnames = useMemo(() => classNames({
|
|
7
|
+
[dataGridClassnames.leftPinnedSection]: position === 'left',
|
|
8
|
+
[dataGridClassnames.rightPinnedSection]: position === 'right',
|
|
9
|
+
[dataGridClassnames.pinnedSectionNoData]: isNoData && position === 'center',
|
|
10
|
+
}), []);
|
|
11
|
+
const shouldNotRenderSection = (isNoData && position !== 'center') || !columns || columns.length === 0;
|
|
12
|
+
const gridColumns = shouldNotRenderSection
|
|
13
|
+
? ''
|
|
14
|
+
: getGridTemplateColumns(columns);
|
|
15
|
+
return { classnames, gridColumns, shouldNotRenderSection };
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PinnedSections';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PinnedSections';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PinnedColumnsContainer: import("../../styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
$gridColumns: string;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { styled } from '../../styled';
|
|
2
|
+
import { dataGridClassnames } from '../constants';
|
|
3
|
+
export const PinnedColumnsContainer = styled.div `
|
|
4
|
+
overflow: auto;
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-columns: ${({ $gridColumns }) => $gridColumns};
|
|
7
|
+
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
|
|
11
|
+
&.${dataGridClassnames.disabled} {
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
|
|
14
|
+
background: ${({ theme }) => theme.palette.background.element};
|
|
15
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
16
|
+
mix-blend-mode: luminosity;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type CellValue, type DataGridRow } from '../../types';
|
|
3
|
+
import { type PinnedSectionsProps } from '../PinnedSections';
|
|
4
|
+
type UseLogicParams<TData extends Record<string, CellValue> = DataGridRow> = Pick<PinnedSectionsProps<TData>, 'sections'>;
|
|
5
|
+
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow>({ sections, }: UseLogicParams<TData>) => {
|
|
6
|
+
pinnedContainerStyles: CSSProperties;
|
|
7
|
+
sectionOffsets: Record<string, number>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
export const useLogic = ({ sections, }) => {
|
|
3
|
+
const pinnedContainerStyles = {
|
|
4
|
+
'--left-columns-count': sections.find((section) => section.position === 'left')?.columns
|
|
5
|
+
?.length ?? 0,
|
|
6
|
+
'--right-columns-count': sections.find((section) => section.position === 'right')?.columns
|
|
7
|
+
?.length ?? 0,
|
|
8
|
+
};
|
|
9
|
+
const sectionOffsets = useMemo(() => {
|
|
10
|
+
const offsets = {};
|
|
11
|
+
let currentOffset = 0;
|
|
12
|
+
sections.forEach((section) => {
|
|
13
|
+
offsets[section.position] = currentOffset;
|
|
14
|
+
currentOffset += section.columns?.length ?? 0;
|
|
15
|
+
});
|
|
16
|
+
return offsets;
|
|
17
|
+
}, [sections]);
|
|
18
|
+
return { pinnedContainerStyles, sectionOffsets };
|
|
19
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { Collapse } from '../../../Collapse';
|
|
4
|
-
import {
|
|
4
|
+
import { dataGridRowClassnames } from '../constants';
|
|
5
5
|
import { MoreButton, MoreButtonRow, NestedRows } from './styles';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
7
7
|
export const NestedChildren = memo((props) => {
|
|
@@ -27,7 +27,7 @@ export const NestedChildren = memo((props) => {
|
|
|
27
27
|
options,
|
|
28
28
|
nestedChildren: children,
|
|
29
29
|
level: nextLevel,
|
|
30
|
-
className:
|
|
30
|
+
className: dataGridRowClassnames.hidden,
|
|
31
31
|
});
|
|
32
32
|
}) }) }), isShowMoreButton && (_jsx(MoreButtonRow, { "$level": nextLevel, "$isShowConnector": isShowConnector, "$gridColumns": gridColumns, children: _jsx(MoreButton, { "$moreButtonColumnPosition": moreButtonColumnPosition, variant: "link", onClick: handleToggleShowAllChildren, children: isShowAllChildren ? 'Скрыть' : 'Показать все' }) }))] }))] }) }));
|
|
33
33
|
});
|
|
@@ -1,95 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type Variant } from '../enums';
|
|
3
|
-
import type { CellValue, DataGridColumns, DataGridRowOptions } from '../types';
|
|
4
|
-
export type RowProps<TData extends Record<string, CellValue>> = {
|
|
5
|
-
/**
|
|
6
|
-
* Название класса, применяется к корневому компоненту
|
|
7
|
-
*/
|
|
8
|
-
className?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Поле, которое будет использоваться в качестве ключа
|
|
11
|
-
*/
|
|
12
|
-
keyId: keyof TData;
|
|
13
|
-
/**
|
|
14
|
-
* Данные строки для отображения
|
|
15
|
-
*/
|
|
16
|
-
row: TData;
|
|
17
|
-
/**
|
|
18
|
-
* Конфигурация колонок для таблицы
|
|
19
|
-
*/
|
|
20
|
-
columns: DataGridColumns<TData>[];
|
|
21
|
-
/**
|
|
22
|
-
* Вариант отображения вложенных элементов
|
|
23
|
-
*/
|
|
24
|
-
variant: `${Variant}`;
|
|
25
|
-
/**
|
|
26
|
-
* Конфигурация ширины колонок
|
|
27
|
-
*/
|
|
28
|
-
gridColumns: string;
|
|
29
|
-
/**
|
|
30
|
-
* Уровень вложенности в дереве
|
|
31
|
-
*/
|
|
32
|
-
level: number;
|
|
33
|
-
/**
|
|
34
|
-
* Вложенные элементы
|
|
35
|
-
*/
|
|
36
|
-
nestedChildren: Array<TData & {
|
|
37
|
-
options?: DataGridRowOptions<TData>;
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* Идентификатор активного элемента массива rows. Выделяет активную строку в таблице
|
|
41
|
-
*/
|
|
42
|
-
activeRowId?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Если true, то дерево будет раскрыто по умолчанию
|
|
45
|
-
*/
|
|
46
|
-
isInitialExpanded: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Уровень раскрытия дерева по умолчанию, при isInitialExpanded=true
|
|
49
|
-
*/
|
|
50
|
-
expandedLevel: number;
|
|
51
|
-
/**
|
|
52
|
-
* Количество отображаемых по умолчанию дочерних элементов
|
|
53
|
-
*/
|
|
54
|
-
initialVisibleChildrenCount: number;
|
|
55
|
-
/**
|
|
56
|
-
* Номер колонки, в которой будет расположена кнопка "Показать все"
|
|
57
|
-
* Работает только для `variant="subrows"`
|
|
58
|
-
*/
|
|
59
|
-
moreButtonColumnPosition: number;
|
|
60
|
-
/**
|
|
61
|
-
* Если false, кнопка разворачивания элементов не показывается
|
|
62
|
-
* Работает только для `variant="subrows"`
|
|
63
|
-
*/
|
|
64
|
-
isVisibleCollapseButton: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Если true, то будет отображаться чекбокс для выбора элемента
|
|
67
|
-
*/
|
|
68
|
-
isSelectable?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Флаг выбора текущей строки
|
|
71
|
-
*/
|
|
72
|
-
isSelected?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Массив выбранных строк
|
|
75
|
-
*/
|
|
76
|
-
selectedRows?: TData[];
|
|
77
|
-
/**
|
|
78
|
-
* Заглушка для пустых ячеек (если отсутствует field и filter и renderCell)
|
|
79
|
-
* @default '-'
|
|
80
|
-
*/
|
|
81
|
-
emptyCellValue?: ReactNode;
|
|
82
|
-
/**
|
|
83
|
-
* Дополнительные настройки строки
|
|
84
|
-
*/
|
|
85
|
-
options?: DataGridRowOptions<TData>;
|
|
86
|
-
/**
|
|
87
|
-
* Обработчик выбора строки
|
|
88
|
-
*/
|
|
89
|
-
onSelectRow: (row: TData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
90
|
-
/**
|
|
91
|
-
* Обработчик клика строки таблицы
|
|
92
|
-
*/
|
|
93
|
-
onRowClick?: (row: TData) => void;
|
|
94
|
-
};
|
|
1
|
+
import type { RowProps } from './types';
|
|
95
2
|
export declare const Row: <TData extends Record<string, unknown>>(props: RowProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,8 +10,8 @@ import { CellStyled, CheckboxCell, ChevronIcon, CollapseButton, CollapseCell, Co
|
|
|
10
10
|
import { useLogic } from './useLogic';
|
|
11
11
|
import { checkIsDisabled } from './utils';
|
|
12
12
|
const RowComponent = (props) => {
|
|
13
|
-
const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, tooltipProps, nestedChildrenProps, disabled, isRenderCollapseButton, } = useLogic(props);
|
|
14
|
-
const { className, row, options, variant, isSelectable, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, selectedRows, activeRowId, keyId, onSelectRow, onRowClick,
|
|
13
|
+
const { isOpen, isShowConnector, childrenColumns, rowId, handleToggle, checkboxProps, rowProps, tooltipProps, nestedChildrenProps, disabled, isRenderCollapseButton, rowRef, } = useLogic(props);
|
|
14
|
+
const { className, row, options, variant, isSelectable, gridColumns, isInitialExpanded, expandedLevel, level, nestedChildren, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, columns, emptyCellValue, selectedRows, activeRowId, keyId, onSelectRow, onRowClick, sectionOffset, totalColumnsCount, registerRowElement, unregisterRowElement, onRowEnter, onRowLeave,
|
|
15
15
|
// В этот rest-оператор попадают специфичные пропсы (атрибуты) virtuoso
|
|
16
16
|
// Необходимы для DataGridInfinite
|
|
17
17
|
...selfProps } = props;
|
|
@@ -23,17 +23,26 @@ const RowComponent = (props) => {
|
|
|
23
23
|
return (_jsxs(_Fragment, { children: [isRenderCollapseButton && (_jsx(CollapseCell, { children: _jsx(CollapseButton, { variant: "text", onClick: handleToggle, children: _jsx(ChevronIcon, { "$isActive": isOpen }) }) })), isSelectable && !isNotSelectable && (_jsx(CheckboxCell, { ...getInertProps(disabled), onClick: (event) => event.stopPropagation(), children: _jsx(Checkbox, { ...checkboxProps }) }))] }));
|
|
24
24
|
};
|
|
25
25
|
const renderCells = useCallback(() => {
|
|
26
|
+
const lastCellGlobalIndex = (totalColumnsCount ?? columns.length) - 1;
|
|
26
27
|
const availableCellsByIndex = !isDisabledLastCell
|
|
27
|
-
? [
|
|
28
|
+
? [lastCellGlobalIndex]
|
|
28
29
|
: undefined;
|
|
29
30
|
return columns?.map((cell, index) => {
|
|
30
31
|
const cellId = `${rowId}-${index}`;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
32
|
+
const globalIndex = (sectionOffset ?? 0) + index;
|
|
33
|
+
const isDisabledCell = checkIsDisabled(disabled, availableCellsByIndex, globalIndex);
|
|
34
|
+
const isFirstCell = globalIndex === 0;
|
|
33
35
|
return (_jsx(CellStyled, { "$level": isFirstCell ? level : 0, row: row, cell: cell, emptyCellValue: emptyCellValue, startAdornment: isFirstCell && renderStartAdornment(), isDisabled: isDisabledCell, isHidePersonalData: cell.isHidePersonalData }, cellId));
|
|
34
36
|
});
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
+
}, [
|
|
38
|
+
isOpen,
|
|
39
|
+
columns,
|
|
40
|
+
disabled,
|
|
41
|
+
checkboxProps.checked,
|
|
42
|
+
totalColumnsCount,
|
|
43
|
+
sectionOffset,
|
|
44
|
+
]);
|
|
45
|
+
const renderRow = useCallback(({ key, ...nestedRowProps }) => (_jsx(Row, { keyId: keyId, ...nestedRowProps, variant: variant, isSelectable: isSelectable, selectedRows: selectedRows, gridColumns: gridColumns, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition, isVisibleCollapseButton: isVisibleCollapseButton, activeRowId: activeRowId, columns: childrenColumns, onSelectRow: onSelectRow, onRowClick: onRowClick, totalColumnsCount: totalColumnsCount, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, onRowEnter: onRowEnter, onRowLeave: onRowLeave, sectionOffset: sectionOffset }, key)), [
|
|
37
46
|
keyId,
|
|
38
47
|
variant,
|
|
39
48
|
isSelectable,
|
|
@@ -43,12 +52,18 @@ const RowComponent = (props) => {
|
|
|
43
52
|
expandedLevel,
|
|
44
53
|
initialVisibleChildrenCount,
|
|
45
54
|
moreButtonColumnPosition,
|
|
55
|
+
sectionOffset,
|
|
56
|
+
totalColumnsCount,
|
|
46
57
|
activeRowId,
|
|
47
58
|
childrenColumns,
|
|
48
59
|
onSelectRow,
|
|
49
60
|
onRowClick,
|
|
61
|
+
registerRowElement,
|
|
62
|
+
unregisterRowElement,
|
|
63
|
+
onRowEnter,
|
|
64
|
+
onRowLeave,
|
|
50
65
|
]);
|
|
51
|
-
return (_jsxs(Wrapper, { "$level": level, "$isShowConnector": isShowConnector, className: className, ...selfProps, children: [_jsx(Tooltip, { followCursor: true, arrow: false, ...tooltipProps, children: _jsx(ContentWrapper, { "$level": level, "$isShowConnector": isShowConnector, "$gridColumns": gridColumns, [DISABLE_ROW_ATTR]: disabled, ...rowProps, children: renderCells() }) }), _jsx(NestedChildren, { ...nestedChildrenProps, data: nestedChildren, keyId: keyId, level: level, variant: variant, gridColumns: gridColumns, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition,
|
|
66
|
+
return (_jsxs(Wrapper, { "$level": level, "$isShowConnector": isShowConnector, className: className, ...selfProps, children: [_jsx(Tooltip, { followCursor: true, arrow: false, ...tooltipProps, children: _jsx(ContentWrapper, { "$level": level, "data-row-id": rowId, ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), "$isShowConnector": isShowConnector, "$gridColumns": gridColumns, [DISABLE_ROW_ATTR]: disabled, ...rowProps, children: renderCells() }) }), _jsx(NestedChildren, { ...nestedChildrenProps, data: nestedChildren, keyId: keyId, level: level, variant: variant, gridColumns: gridColumns, initialVisibleChildrenCount: initialVisibleChildrenCount, moreButtonColumnPosition: moreButtonColumnPosition,
|
|
52
67
|
// biome-ignore lint/suspicious/noTsIgnore: <>
|
|
53
68
|
// @ts-ignore
|
|
54
69
|
renderRow: renderRow })] }));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createUIKitClassname } from '../../utils/createUIKitClassname';
|
|
2
2
|
export const DISABLE_ROW_ATTR = 'data-row-disable';
|
|
3
|
-
export const
|
|
3
|
+
export const dataGridRowClassnames = {
|
|
4
4
|
hidden: createUIKitClassname('data-grid__row_hidden'),
|
|
5
|
+
hover: createUIKitClassname('data-grid__row_hover'),
|
|
6
|
+
hasPinnedColumns: createUIKitClassname('data-grid__row_has-pinned-columns'),
|
|
5
7
|
};
|
|
@@ -3,12 +3,12 @@ import { IconButton } from '../../IconButton';
|
|
|
3
3
|
import { styled } from '../../styled';
|
|
4
4
|
import { Cell } from '../Cell';
|
|
5
5
|
import { ROOT_ACTION_CELL_WIDTH, TREE_LINE_WIDTH } from '../constants';
|
|
6
|
-
import {
|
|
6
|
+
import { dataGridRowClassnames } from './constants';
|
|
7
7
|
export const Wrapper = styled.li `
|
|
8
8
|
position: relative;
|
|
9
9
|
|
|
10
10
|
&:not(:last-of-type)::before,
|
|
11
|
-
&.${
|
|
11
|
+
&.${dataGridRowClassnames.hidden}::before {
|
|
12
12
|
content: '';
|
|
13
13
|
|
|
14
14
|
position: absolute;
|
|
@@ -32,12 +32,6 @@ export const ContentWrapper = styled.div `
|
|
|
32
32
|
|
|
33
33
|
background-color: ${({ theme, $isSelected }) => $isSelected ? theme.palette.primary[100] : 'transparent'};
|
|
34
34
|
|
|
35
|
-
transition: ${({ theme }) => {
|
|
36
|
-
return theme.transitions.create(['background-color'], {
|
|
37
|
-
duration: theme.transitions.duration.short,
|
|
38
|
-
});
|
|
39
|
-
}};
|
|
40
|
-
|
|
41
35
|
&::before {
|
|
42
36
|
content: '';
|
|
43
37
|
|
|
@@ -58,6 +52,13 @@ export const ContentWrapper = styled.div `
|
|
|
58
52
|
&:hover {
|
|
59
53
|
cursor: ${({ $isHovered }) => ($isHovered ? 'pointer' : 'default')};
|
|
60
54
|
|
|
55
|
+
background-color: ${({ theme }) => theme.palette.background.elementHover};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
&.${dataGridRowClassnames.hover} {
|
|
60
|
+
cursor: ${({ $isHovered }) => ($isHovered ? 'pointer' : 'default')};
|
|
61
|
+
|
|
61
62
|
background-color: ${({ theme, $isSelected }) => $isSelected
|
|
62
63
|
? theme.palette.primary[100]
|
|
63
64
|
: theme.palette.background.elementHover};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type ChangeEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type Variant } from '../enums';
|
|
3
|
+
import { type CellValue, type DataGridColumns, type DataGridRowOptions } from '../types';
|
|
4
|
+
export type RowProps<TData extends Record<string, CellValue>> = {
|
|
5
|
+
/**
|
|
6
|
+
* Название класса, применяется к корневому компоненту
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Поле, которое будет использоваться в качестве ключа
|
|
11
|
+
*/
|
|
12
|
+
keyId: keyof TData;
|
|
13
|
+
/**
|
|
14
|
+
* Данные строки для отображения
|
|
15
|
+
*/
|
|
16
|
+
row: TData;
|
|
17
|
+
/**
|
|
18
|
+
* Конфигурация колонок для таблицы
|
|
19
|
+
*/
|
|
20
|
+
columns: DataGridColumns<TData>[];
|
|
21
|
+
/**
|
|
22
|
+
* Вариант отображения вложенных элементов
|
|
23
|
+
*/
|
|
24
|
+
variant: `${Variant}`;
|
|
25
|
+
/**
|
|
26
|
+
* Конфигурация ширины колонок
|
|
27
|
+
*/
|
|
28
|
+
gridColumns: string;
|
|
29
|
+
/**
|
|
30
|
+
* Уровень вложенности в дереве
|
|
31
|
+
*/
|
|
32
|
+
level: number;
|
|
33
|
+
/**
|
|
34
|
+
* Вложенные элементы
|
|
35
|
+
*/
|
|
36
|
+
nestedChildren: Array<TData & {
|
|
37
|
+
options?: DataGridRowOptions<TData>;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Идентификатор активного элемента массива rows. Выделяет активную строку в таблице
|
|
41
|
+
*/
|
|
42
|
+
activeRowId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Если true, то дерево будет раскрыто по умолчанию
|
|
45
|
+
*/
|
|
46
|
+
isInitialExpanded: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Уровень раскрытия дерева по умолчанию, при isInitialExpanded=true
|
|
49
|
+
*/
|
|
50
|
+
expandedLevel: number;
|
|
51
|
+
/**
|
|
52
|
+
* Количество отображаемых по умолчанию дочерних элементов
|
|
53
|
+
*/
|
|
54
|
+
initialVisibleChildrenCount: number;
|
|
55
|
+
/**
|
|
56
|
+
* Номер колонки, в которой будет расположена кнопка "Показать все"
|
|
57
|
+
* Работает только для `variant="subrows"`
|
|
58
|
+
*/
|
|
59
|
+
moreButtonColumnPosition: number;
|
|
60
|
+
/**
|
|
61
|
+
* Если false, кнопка разворачивания элементов не показывается
|
|
62
|
+
* Работает только для `variant="subrows"`
|
|
63
|
+
*/
|
|
64
|
+
isVisibleCollapseButton: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Если true, то будет отображаться чекбокс для выбора элемента
|
|
67
|
+
*/
|
|
68
|
+
isSelectable?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Флаг выбора текущей строки
|
|
71
|
+
*/
|
|
72
|
+
isSelected?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Массив выбранных строк
|
|
75
|
+
*/
|
|
76
|
+
selectedRows?: TData[];
|
|
77
|
+
/**
|
|
78
|
+
* Заглушка для пустых ячеек (если отсутствует field и filter и renderCell)
|
|
79
|
+
* @default '-'
|
|
80
|
+
*/
|
|
81
|
+
emptyCellValue?: ReactNode;
|
|
82
|
+
/**
|
|
83
|
+
* Дополнительные настройки строки
|
|
84
|
+
*/
|
|
85
|
+
options?: DataGridRowOptions<TData>;
|
|
86
|
+
/**
|
|
87
|
+
* Обработчик выбора строки
|
|
88
|
+
*/
|
|
89
|
+
onSelectRow: (row: TData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Обработчик клика строки таблицы
|
|
92
|
+
*/
|
|
93
|
+
onRowClick?: (row: TData) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Смещение секции
|
|
96
|
+
*/
|
|
97
|
+
sectionOffset?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Общее количество колонок (для правильного определения последней ячейки)
|
|
100
|
+
*/
|
|
101
|
+
totalColumnsCount?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Регистрация элемента строки
|
|
104
|
+
*/
|
|
105
|
+
registerRowElement?: (rowId: string, el: HTMLElement) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Отмена регистрации элемента строки
|
|
108
|
+
*/
|
|
109
|
+
unregisterRowElement?: (rowId: string, el: HTMLElement) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Обработчик наведения на строку
|
|
112
|
+
*/
|
|
113
|
+
onRowEnter?: (rowId: string) => void;
|
|
114
|
+
/**
|
|
115
|
+
* Обработчик выхода из строки
|
|
116
|
+
*/
|
|
117
|
+
onRowLeave?: (rowId: string, event: PointerEvent) => void;
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|