@astral/ui 4.56.0 → 4.57.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/ContentState/ContentState.d.ts +1 -1
- package/components/ContentState/ContentState.js +2 -2
- package/components/ContentState/types.d.ts +4 -0
- package/components/DataGrid/Body/Body.d.ts +1 -1
- package/components/DataGrid/Body/Body.js +14 -7
- package/components/DataGrid/Body/constants.d.ts +4 -0
- package/components/DataGrid/Body/constants.js +5 -0
- package/components/DataGrid/Body/styles.d.ts +0 -3
- package/components/DataGrid/Body/styles.js +14 -1
- package/components/DataGrid/Body/useLogic/index.d.ts +1 -0
- package/components/DataGrid/Body/useLogic/index.js +1 -0
- package/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
- package/components/DataGrid/Body/useLogic/useLogic.js +15 -0
- package/components/DataGrid/Cell/Cell.js +20 -4
- package/components/DataGrid/Cell/constants.d.ts +7 -0
- package/components/DataGrid/Cell/constants.js +8 -0
- package/components/DataGrid/Cell/styles.d.ts +14 -0
- package/components/DataGrid/Cell/styles.js +47 -0
- package/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
- package/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
- package/components/DataGrid/DataGrid.js +42 -8
- package/components/DataGrid/Head/Head.js +1 -1
- package/components/DataGrid/Head/styles.js +4 -0
- package/components/DataGrid/Loader/styles.js +4 -0
- package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
- package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +10 -0
- package/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
- package/components/DataGrid/MobileSkeleton/index.js +1 -0
- package/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
- package/components/DataGrid/MobileSkeleton/styles.js +37 -0
- package/components/DataGrid/Row/NestedChildren/styles.js +5 -0
- package/components/DataGrid/Row/Row.js +25 -8
- package/components/DataGrid/Row/constants.d.ts +8 -0
- package/components/DataGrid/Row/constants.js +8 -0
- package/components/DataGrid/Row/styles.d.ts +4 -9
- package/components/DataGrid/Row/styles.js +66 -14
- package/components/DataGrid/Row/types.d.ts +5 -1
- package/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
- package/components/DataGrid/Row/useLogic/hooks/index.js +1 -0
- package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
- package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +15 -0
- package/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
- package/components/DataGrid/Row/useLogic/useLogic.js +28 -13
- package/components/DataGrid/constants.d.ts +4 -0
- package/components/DataGrid/constants.js +4 -0
- package/components/DataGrid/index.d.ts +1 -0
- package/components/DataGrid/index.js +1 -0
- package/components/DataGrid/styles.d.ts +0 -9
- package/components/DataGrid/styles.js +43 -12
- package/components/DataGrid/types.d.ts +7 -0
- package/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
- package/components/DataGrid/useLogic/hooks/index.js +1 -1
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +1 -0
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +32 -0
- package/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
- package/components/DataGrid/useLogic/useLogic.d.ts +10 -4
- package/components/DataGrid/useLogic/useLogic.js +17 -12
- package/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
- package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
- package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +5 -0
- package/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
- package/components/DataGrid/utils/getDataGridCssVars/index.js +1 -0
- package/components/DataGrid/utils/index.d.ts +1 -0
- package/components/DataGrid/utils/index.js +1 -0
- package/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
- package/components/DataGridInfinite/DataGridInfinite.js +5 -4
- package/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
- package/components/DataGridInfinite/useLogic/useLogic.js +12 -2
- package/components/DescriptionCell/styles.js +12 -3
- package/components/NewStepper/index.d.ts +1 -0
- package/components/NewStepper/index.js +1 -0
- package/components/NewStepper/public.d.ts +1 -0
- package/components/NewStepper/public.js +1 -0
- package/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
- package/components/PageLayoutSection/PageLayoutSection.js +13 -4
- package/components/PageLayoutSection/constants.d.ts +5 -0
- package/components/PageLayoutSection/constants.js +6 -0
- package/components/PageLayoutSection/styles.d.ts +1 -1
- package/components/PageLayoutSection/styles.js +6 -1
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
- package/node/components/ContentState/ContentState.d.ts +1 -1
- package/node/components/ContentState/ContentState.js +2 -2
- package/node/components/ContentState/types.d.ts +4 -0
- package/node/components/DataGrid/Body/Body.d.ts +1 -1
- package/node/components/DataGrid/Body/Body.js +14 -7
- package/node/components/DataGrid/Body/constants.d.ts +4 -0
- package/node/components/DataGrid/Body/constants.js +8 -0
- package/node/components/DataGrid/Body/styles.d.ts +0 -3
- package/node/components/DataGrid/Body/styles.js +14 -1
- package/node/components/DataGrid/Body/useLogic/index.d.ts +1 -0
- package/node/components/DataGrid/{useLogic/hooks/useClassnames → Body/useLogic}/index.js +1 -1
- package/node/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
- package/node/components/DataGrid/Body/useLogic/useLogic.js +19 -0
- package/node/components/DataGrid/Cell/Cell.js +18 -2
- package/node/components/DataGrid/Cell/constants.d.ts +7 -0
- package/node/components/DataGrid/Cell/constants.js +11 -0
- package/node/components/DataGrid/Cell/styles.d.ts +14 -0
- package/node/components/DataGrid/Cell/styles.js +48 -1
- package/node/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
- package/node/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
- package/node/components/DataGrid/DataGrid.js +41 -7
- package/node/components/DataGrid/Head/Head.js +1 -1
- package/node/components/DataGrid/Head/styles.js +4 -0
- package/node/components/DataGrid/Loader/styles.js +4 -0
- package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
- package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +14 -0
- package/node/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
- package/node/components/DataGrid/MobileSkeleton/index.js +17 -0
- package/node/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
- package/node/components/DataGrid/MobileSkeleton/styles.js +40 -0
- package/node/components/DataGrid/Row/NestedChildren/styles.js +5 -0
- package/node/components/DataGrid/Row/Row.js +23 -6
- package/node/components/DataGrid/Row/constants.d.ts +8 -0
- package/node/components/DataGrid/Row/constants.js +9 -1
- package/node/components/DataGrid/Row/styles.d.ts +4 -9
- package/node/components/DataGrid/Row/styles.js +66 -14
- package/node/components/DataGrid/Row/types.d.ts +5 -1
- package/node/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
- package/node/components/DataGrid/Row/useLogic/hooks/index.js +17 -0
- package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
- package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +19 -0
- package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
- package/node/components/DataGrid/Row/useLogic/useLogic.js +28 -13
- package/node/components/DataGrid/constants.d.ts +4 -0
- package/node/components/DataGrid/constants.js +5 -1
- package/node/components/DataGrid/index.d.ts +1 -0
- package/node/components/DataGrid/index.js +3 -1
- package/node/components/DataGrid/styles.d.ts +0 -9
- package/node/components/DataGrid/styles.js +43 -12
- package/node/components/DataGrid/types.d.ts +7 -0
- package/node/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
- package/node/components/DataGrid/useLogic/hooks/index.js +1 -1
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +17 -0
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +36 -0
- package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
- package/node/components/DataGrid/useLogic/useLogic.d.ts +10 -4
- package/node/components/DataGrid/useLogic/useLogic.js +19 -14
- package/node/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
- package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
- package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +9 -0
- package/node/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
- package/node/components/DataGrid/utils/getDataGridCssVars/index.js +5 -0
- package/node/components/DataGrid/utils/index.d.ts +1 -0
- package/node/components/DataGrid/utils/index.js +3 -1
- package/node/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
- package/node/components/DataGridInfinite/DataGridInfinite.js +5 -4
- package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
- package/node/components/DataGridInfinite/useLogic/useLogic.js +11 -1
- package/node/components/DescriptionCell/styles.js +15 -6
- package/node/components/NewStepper/index.d.ts +1 -0
- package/node/components/NewStepper/index.js +3 -1
- package/node/components/NewStepper/public.d.ts +1 -0
- package/node/components/NewStepper/public.js +3 -1
- package/node/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
- package/node/components/PageLayoutSection/PageLayoutSection.js +12 -3
- package/node/components/PageLayoutSection/constants.d.ts +5 -0
- package/node/components/PageLayoutSection/constants.js +9 -0
- package/node/components/PageLayoutSection/styles.d.ts +1 -1
- package/node/components/PageLayoutSection/styles.js +7 -2
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
- package/package.json +1 -1
- package/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
- package/components/DataGrid/useLogic/hooks/useClassnames/index.js +0 -1
- package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
- package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -14
- package/node/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
- package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
- package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -18
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { descriptionClassnames } from '../Description/constants';
|
|
2
2
|
import { styled } from '../styled';
|
|
3
|
+
import { typographyClassnames } from '../Typography/constants';
|
|
3
4
|
import { descriptionCellClassnames } from './constants';
|
|
4
5
|
export const Wrapper = styled.div `
|
|
5
6
|
display: flex;
|
|
@@ -20,15 +21,23 @@ export const IconWrapper = styled.div `
|
|
|
20
21
|
width: 24px;
|
|
21
22
|
height: 24px;
|
|
22
23
|
}
|
|
24
|
+
|
|
25
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
23
28
|
`;
|
|
24
29
|
export const ItemWrapper = styled.div `
|
|
25
30
|
display: flex;
|
|
26
31
|
flex-direction: column;
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
.${
|
|
33
|
+
& .${descriptionClassnames.root} {
|
|
34
|
+
& .${typographyClassnames.root} {
|
|
30
35
|
font-size: unset;
|
|
31
36
|
color: unset;
|
|
32
37
|
}
|
|
33
38
|
}
|
|
39
|
+
|
|
40
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
41
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
42
|
+
}
|
|
34
43
|
`;
|
|
@@ -5,6 +5,10 @@ export type PageLayoutSectionProps = {
|
|
|
5
5
|
* Название класса, применяется к корневому компоненту
|
|
6
6
|
*/
|
|
7
7
|
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Отключает боковые отступы на мобильных разрешениях
|
|
10
|
+
*/
|
|
11
|
+
isNoMobileSidePadding?: boolean;
|
|
8
12
|
};
|
|
9
13
|
/**
|
|
10
14
|
* Секция страницы. На десктопе между секциями отображается разделитель или отступ. На мобильных разрешениях секции оформляются как карточки.
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { classNames } from '../utils/classNames';
|
|
4
|
+
import { cva } from '../utils/cva';
|
|
5
|
+
import { pageLayoutSectionClassnames } from './constants';
|
|
6
|
+
import { Section, SectionWrapper } from './styles';
|
|
7
|
+
const sectionWrapperCva = cva(pageLayoutSectionClassnames.wrapper, {
|
|
8
|
+
variants: {
|
|
9
|
+
isNoMobileSidePadding: {
|
|
10
|
+
true: pageLayoutSectionClassnames.isNoMobileSidePadding,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
4
14
|
/**
|
|
5
15
|
* Секция страницы. На десктопе между секциями отображается разделитель или отступ. На мобильных разрешениях секции оформляются как карточки.
|
|
6
16
|
*
|
|
@@ -13,7 +23,6 @@ import { Section, SectionInner } from './styles';
|
|
|
13
23
|
* </PageLayoutSectionContainer>
|
|
14
24
|
* } />
|
|
15
25
|
*/
|
|
16
|
-
export const PageLayoutSection = forwardRef((
|
|
17
|
-
|
|
18
|
-
return (_jsx(Section, { className: className, ref: ref, children: _jsx(SectionInner, { children: children }) }));
|
|
26
|
+
export const PageLayoutSection = forwardRef(({ children, className, isNoMobileSidePadding = false }, ref) => {
|
|
27
|
+
return (_jsx(Section, { className: classNames(className, pageLayoutSectionClassnames.root), ref: ref, children: _jsx(SectionWrapper, { className: sectionWrapperCva({ isNoMobileSidePadding }), children: children }) }));
|
|
19
28
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createUIKitClassname } from '../utils/createUIKitClassname';
|
|
2
|
+
export const pageLayoutSectionClassnames = {
|
|
3
|
+
root: createUIKitClassname('page-layout__section'),
|
|
4
|
+
wrapper: createUIKitClassname('page-layout__section-wrapper'),
|
|
5
|
+
isNoMobileSidePadding: createUIKitClassname('page-layout__section-wrapper_no-mobile-side-padding'),
|
|
6
|
+
};
|
|
@@ -3,7 +3,7 @@ export declare const Section: import("../styled").StyledComponent<{
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const SectionWrapper: import("../styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { styled } from '../styled';
|
|
2
|
+
import { pageLayoutSectionClassnames } from './constants';
|
|
2
3
|
export const Section = styled.section `
|
|
3
4
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
4
5
|
margin: ${({ theme }) => theme.spacing(0, 4)};
|
|
@@ -8,7 +9,7 @@ export const Section = styled.section `
|
|
|
8
9
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
9
10
|
}
|
|
10
11
|
`;
|
|
11
|
-
export const
|
|
12
|
+
export const SectionWrapper = styled.div `
|
|
12
13
|
padding: ${({ theme }) => theme.spacing(0, 6)};
|
|
13
14
|
|
|
14
15
|
${({ theme }) => theme.breakpoints.down('laptop')} {
|
|
@@ -17,5 +18,9 @@ export const SectionInner = styled.div `
|
|
|
17
18
|
|
|
18
19
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
19
20
|
padding: ${({ theme }) => theme.spacing(4)};
|
|
21
|
+
|
|
22
|
+
&.${pageLayoutSectionClassnames.isNoMobileSidePadding} {
|
|
23
|
+
padding: ${({ theme }) => theme.spacing(4, 0)};
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
`;
|
|
@@ -13,9 +13,13 @@ type Props = {
|
|
|
13
13
|
* Используется вместе с хуком `useLoadingState`
|
|
14
14
|
*/
|
|
15
15
|
isShowLoader?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Класс применяемый для корневого элемента
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
16
20
|
};
|
|
17
21
|
/**
|
|
18
22
|
* Дефолтный лоадер загрузки
|
|
19
23
|
*/
|
|
20
|
-
export declare const LoadingPlaceholder: ({ title, content, isShowLoader, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const LoadingPlaceholder: ({ title, content, isShowLoader, className, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
25
|
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Loader } from '../../Loader';
|
|
3
3
|
import { Typography } from '../../Typography';
|
|
4
|
+
import { classNames } from '../../utils/classNames';
|
|
4
5
|
import { loadingPlaceholderClassnames } from './constants';
|
|
5
6
|
import { LoadingContainer } from './styles';
|
|
6
7
|
/**
|
|
7
8
|
* Дефолтный лоадер загрузки
|
|
8
9
|
*/
|
|
9
|
-
export const LoadingPlaceholder = ({ title, content, isShowLoader = true, }) => {
|
|
10
|
+
export const LoadingPlaceholder = ({ title, content, isShowLoader = true, className, }) => {
|
|
10
11
|
if (!isShowLoader) {
|
|
11
|
-
return _jsx(LoadingContainer, { className: loadingPlaceholderClassnames.root });
|
|
12
|
+
return (_jsx(LoadingContainer, { className: classNames(loadingPlaceholderClassnames.root, className) }));
|
|
12
13
|
}
|
|
13
14
|
if (content) {
|
|
14
|
-
return (_jsx(LoadingContainer, { className: loadingPlaceholderClassnames.root, children: content }));
|
|
15
|
+
return (_jsx(LoadingContainer, { className: classNames(loadingPlaceholderClassnames.root, className), children: content }));
|
|
15
16
|
}
|
|
16
|
-
return (_jsxs(LoadingContainer, { className: loadingPlaceholderClassnames.root, children: [_jsx(Loader, {}), title && _jsx(Typography, { variant: "h4", children: title })] }));
|
|
17
|
+
return (_jsxs(LoadingContainer, { className: classNames(loadingPlaceholderClassnames.root, className), children: [_jsx(Loader, {}), title && _jsx(Typography, { variant: "h4", children: title })] }));
|
|
17
18
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ContentStateProps } from './types';
|
|
2
|
-
export declare const ContentState: ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, }: ContentStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ContentState: ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, loadingPlaceholderClassname, }: ContentStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,13 +8,13 @@ const LoadingPlaceholder_1 = require("../placeholders/LoadingPlaceholder");
|
|
|
8
8
|
const Placeholder_1 = require("../placeholders/Placeholder");
|
|
9
9
|
const Typography_1 = require("../Typography");
|
|
10
10
|
const useLogic_1 = require("./useLogic");
|
|
11
|
-
const ContentState = ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, }) => {
|
|
11
|
+
const ContentState = ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, loadingPlaceholderClassname, }) => {
|
|
12
12
|
const { imagesMap, isLoadingPhase, isShowLoader } = (0, useLogic_1.useLogic)({
|
|
13
13
|
isLoading,
|
|
14
14
|
isSmoothLoading,
|
|
15
15
|
});
|
|
16
16
|
if (isLoadingPhase) {
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(LoadingPlaceholder_1.LoadingPlaceholder, { content: loadingContent, title: loadingTitle, isShowLoader: isShowLoader }));
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(LoadingPlaceholder_1.LoadingPlaceholder, { content: loadingContent, title: loadingTitle, isShowLoader: isShowLoader, className: loadingPlaceholderClassname }));
|
|
18
18
|
}
|
|
19
19
|
if (isCustom && customState) {
|
|
20
20
|
return (0, jsx_runtime_1.jsx)(Placeholder_1.Placeholder, { ...customState });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { BodyProps } from './types';
|
|
2
|
-
export declare const Body: <TData extends Record<string, unknown>>(
|
|
2
|
+
export declare const Body: <TData extends Record<string, unknown>>({ rows, selectedRows, minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps }: BodyProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,21 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Body = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const classNames_1 = require("../../utils/classNames");
|
|
6
|
+
const cva_1 = require("../../utils/cva");
|
|
7
7
|
const Row_1 = require("../Row");
|
|
8
8
|
const RowContext_1 = require("../Row/RowContext");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
9
10
|
const styles_1 = require("./styles");
|
|
11
|
+
const useLogic_1 = require("./useLogic");
|
|
10
12
|
const INITIAL_LEVEL = 0;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const bodyCva = (0, cva_1.cva)(constants_1.bodyClassnames.root, {
|
|
14
|
+
variants: {
|
|
15
|
+
disableMinHeight: {
|
|
16
|
+
true: constants_1.bodyClassnames.disableMinHeight,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const Body = ({ rows, selectedRows = [], minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps }) => {
|
|
21
|
+
const { disableMinHeight, bodyCssVars } = (0, useLogic_1.useLogic)({ minDisplayRows });
|
|
15
22
|
const renderedRows = rows.map(({ children, options, ...row }) => {
|
|
16
23
|
const rowId = row[keyId];
|
|
17
24
|
const isSelected = Boolean(selectedRows?.find((selectedRow) => selectedRow[keyId] === rowId));
|
|
18
25
|
return ((0, jsx_runtime_1.jsx)(RowContext_1.RowContextProvider, { children: (0, jsx_runtime_1.jsx)(Row_1.Row, { row: row, selectedRows: selectedRows, options: options, keyId: keyId, level: INITIAL_LEVEL, nestedChildren: children, isSelected: isSelected, ...rowProps }, rowId) }, rowId));
|
|
19
26
|
});
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className,
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: (0, classNames_1.classNames)(className, bodyCva({ disableMinHeight })), style: bodyCssVars, children: rows.length ? renderedRows : noDataPlaceholder }));
|
|
21
28
|
};
|
|
22
29
|
exports.Body = Body;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bodyClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
5
|
+
exports.bodyClassnames = {
|
|
6
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__body'),
|
|
7
|
+
disableMinHeight: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__body_disable-min-height'),
|
|
8
|
+
};
|
|
@@ -2,7 +2,4 @@
|
|
|
2
2
|
export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
-
} & {
|
|
6
|
-
$minDisplayRows: number;
|
|
7
|
-
$disableMinHeight?: boolean | undefined;
|
|
8
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
@@ -3,20 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Wrapper = void 0;
|
|
4
4
|
const styled_1 = require("../../styled");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const constants_2 = require("./constants");
|
|
6
7
|
exports.Wrapper = styled_1.styled.ul `
|
|
8
|
+
--min-display-rows: 0;
|
|
9
|
+
|
|
7
10
|
overflow-y: auto;
|
|
8
11
|
|
|
9
12
|
width: fit-content;
|
|
10
13
|
min-width: 100%;
|
|
11
14
|
height: 100%;
|
|
12
|
-
min-height:
|
|
15
|
+
min-height: calc(var(--min-display-rows) * ${constants_1.MIN_ROW_HEIGHT}px);
|
|
13
16
|
margin: 0;
|
|
14
17
|
padding: 0;
|
|
15
18
|
|
|
16
19
|
list-style-type: none;
|
|
17
20
|
|
|
21
|
+
&.${constants_2.bodyClassnames.disableMinHeight} {
|
|
22
|
+
min-height: unset;
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
&.${constants_1.dataGridClassnames.bodyEmpty} {
|
|
19
26
|
display: flex;
|
|
20
27
|
align-items: center;
|
|
21
28
|
}
|
|
29
|
+
|
|
30
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
31
|
+
overflow: initial;
|
|
32
|
+
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
22
35
|
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -14,4 +14,4 @@ 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
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./useLogic"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type CellValue } from '../../types';
|
|
3
|
+
import type { BodyProps } from '../types';
|
|
4
|
+
type UseLogicParams<TData extends Record<string, CellValue>> = Pick<BodyProps<TData>, 'minDisplayRows'>;
|
|
5
|
+
export declare const useLogic: <TData extends Record<string, unknown>>({ minDisplayRows, }: UseLogicParams<TData>) => {
|
|
6
|
+
disableMinHeight: boolean | undefined;
|
|
7
|
+
bodyCssVars: CSSProperties;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ConfigProvider_1 = require("../../../ConfigProvider");
|
|
6
|
+
const useLogic = ({ minDisplayRows, }) => {
|
|
7
|
+
const { components } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
|
|
8
|
+
const disableMinHeight = components?.dataGrid?.defaultProps?.disableMinHeight;
|
|
9
|
+
const bodyCssVars = !disableMinHeight && minDisplayRows
|
|
10
|
+
? {
|
|
11
|
+
'--min-display-rows': minDisplayRows,
|
|
12
|
+
}
|
|
13
|
+
: {};
|
|
14
|
+
return {
|
|
15
|
+
disableMinHeight,
|
|
16
|
+
bodyCssVars,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.useLogic = useLogic;
|
|
@@ -5,16 +5,32 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const OverflowTypography_1 = require("../../OverflowTypography");
|
|
6
6
|
const personalDataSecurity_1 = require("../../personalDataSecurity");
|
|
7
7
|
const classNames_1 = require("../../utils/classNames");
|
|
8
|
+
const cva_1 = require("../../utils/cva");
|
|
8
9
|
const getInertProps_1 = require("../../utils/getInertProps");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
9
11
|
const styles_1 = require("./styles");
|
|
10
12
|
const useLogic_1 = require("./useLogic");
|
|
13
|
+
const cellCva = (0, cva_1.cva)(constants_1.dataGridCellClassnames.root, {
|
|
14
|
+
variants: {
|
|
15
|
+
isHideOnMobile: {
|
|
16
|
+
true: constants_1.dataGridCellClassnames.isHideOnMobile,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const cellContentCva = (0, cva_1.cva)(constants_1.dataGridCellClassnames.cellContent, {
|
|
21
|
+
variants: {
|
|
22
|
+
isActionColumn: {
|
|
23
|
+
true: constants_1.dataGridCellClassnames.actionColumn,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
11
27
|
const Cell = (props) => {
|
|
12
|
-
const { formattedValue, hasStartAdornment } = (0, useLogic_1.useLogic)(props);
|
|
28
|
+
const { formattedValue, hasStartAdornment, isActionColumn, label } = (0, useLogic_1.useLogic)(props);
|
|
13
29
|
const { className, startAdornment, row, cell, isDisabled, isHidePersonalData, } = props;
|
|
14
30
|
const { renderCell, align = 'left' } = cell;
|
|
15
31
|
const hidePersonalDataClassname = (0, personalDataSecurity_1.useHidePersonalData)({
|
|
16
32
|
isEnabled: isHidePersonalData === true,
|
|
17
33
|
});
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isDisabled": isDisabled, "$align": align, "$hasStartAdornment": hasStartAdornment, className: (0, classNames_1.classNames)(className, hidePersonalDataClassname), ...(0, getInertProps_1.getInertProps)(isDisabled), children: [startAdornment && startAdornment, renderCell?.(row), !renderCell && ((0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue }) }))] }));
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isDisabled": isDisabled, "$align": align, "$hasStartAdornment": hasStartAdornment, className: (0, classNames_1.classNames)(className, hidePersonalDataClassname, cellCva({ isHideOnMobile: cell.isHideOnMobile })), ...(0, getInertProps_1.getInertProps)(isDisabled), children: [startAdornment && startAdornment, (0, jsx_runtime_1.jsxs)(styles_1.CellContent, { className: cellContentCva({ isActionColumn }), children: [(0, jsx_runtime_1.jsx)(styles_1.ColumnLabel, { variant: "caption", color: "textSecondary", className: constants_1.dataGridCellClassnames.columnLabel, children: label }), renderCell?.(row), !renderCell && ((0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue }) }))] })] }));
|
|
19
35
|
};
|
|
20
36
|
exports.Cell = Cell;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataGridCellClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
5
|
+
exports.dataGridCellClassnames = {
|
|
6
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell'),
|
|
7
|
+
isHideOnMobile: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell_hide-on-mobile'),
|
|
8
|
+
columnLabel: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell-column-label'),
|
|
9
|
+
actionColumn: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell_action-column'),
|
|
10
|
+
cellContent: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__cell-content'),
|
|
11
|
+
};
|
|
@@ -9,4 +9,18 @@ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/type
|
|
|
9
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
10
10
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
11
11
|
} & HeadCellProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const ColumnLabel: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../Typography/types").TypographyPropsBase & {
|
|
13
|
+
color?: import("../../Typography").TypographyColor | undefined;
|
|
14
|
+
variant?: import("../../Typography").TypographyVariant | undefined;
|
|
15
|
+
colorIntensity?: import("../../Typography").Intensity | undefined;
|
|
16
|
+
component?: import("../../Typography/types").ComponentProp | undefined;
|
|
17
|
+
isUpperCase?: boolean | undefined;
|
|
18
|
+
withoutCalt?: boolean | undefined;
|
|
19
|
+
} & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
|
|
20
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
export declare const CellContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
26
|
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Wrapper = void 0;
|
|
3
|
+
exports.CellContent = exports.ColumnLabel = exports.Wrapper = void 0;
|
|
4
4
|
const styled_1 = require("../../styled");
|
|
5
|
+
const Typography_1 = require("../../Typography");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
7
|
+
const constants_2 = require("../Row/constants");
|
|
6
8
|
const utils_1 = require("../utils");
|
|
9
|
+
const constants_3 = require("./constants");
|
|
7
10
|
exports.Wrapper = (0, styled_1.styled)('div', {
|
|
8
11
|
shouldForwardProp: (prop) => !['$align', '$isDisabled', '$hasStartAdornment'].includes(prop),
|
|
9
12
|
}) `
|
|
@@ -16,4 +19,48 @@ exports.Wrapper = (0, styled_1.styled)('div', {
|
|
|
16
19
|
padding: ${({ theme, $hasStartAdornment }) => $hasStartAdornment ? theme.spacing(1, 2, 1, 0) : theme.spacing(1, 2)};
|
|
17
20
|
|
|
18
21
|
opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};
|
|
22
|
+
|
|
23
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
|
|
26
|
+
min-height: unset;
|
|
27
|
+
padding: 0;
|
|
28
|
+
|
|
29
|
+
&.${constants_3.dataGridCellClassnames.isHideOnMobile} {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
& .${constants_2.dataGridRowClassnames.checkbox} {
|
|
35
|
+
align-self: flex-start;
|
|
36
|
+
order: 1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
exports.ColumnLabel = (0, styled_1.styled)(Typography_1.Typography) `
|
|
41
|
+
display: none;
|
|
42
|
+
|
|
43
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
exports.CellContent = styled_1.styled.div `
|
|
48
|
+
min-width: 0;
|
|
49
|
+
|
|
50
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
54
|
+
align-items: flex-start;
|
|
55
|
+
|
|
56
|
+
width: 100%;
|
|
57
|
+
|
|
58
|
+
&.${constants_3.dataGridCellClassnames.actionColumn} {
|
|
59
|
+
align-items: flex-end;
|
|
60
|
+
|
|
61
|
+
& .${constants_3.dataGridCellClassnames.columnLabel} {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
19
66
|
`;
|
|
@@ -4,5 +4,7 @@ type UseLogicParams<TData extends Record<string, CellValue>> = CellProps<TData>;
|
|
|
4
4
|
export declare const useLogic: <TData extends Record<string, unknown>>({ row, cell, emptyCellValue, startAdornment, }: UseLogicParams<TData>) => {
|
|
5
5
|
formattedValue: unknown;
|
|
6
6
|
hasStartAdornment: boolean;
|
|
7
|
+
isActionColumn: boolean;
|
|
8
|
+
label: string | undefined;
|
|
7
9
|
};
|
|
8
10
|
export {};
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
|
|
6
|
-
const { format, field } = cell;
|
|
6
|
+
const { format, field, label } = cell;
|
|
7
7
|
const isValidValue = (value) => {
|
|
8
8
|
return Boolean(value) || value === 0;
|
|
9
9
|
};
|
|
@@ -17,6 +17,7 @@ const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
|
|
|
17
17
|
return emptyCellValue;
|
|
18
18
|
}, [field, format, row, emptyCellValue]);
|
|
19
19
|
const hasStartAdornment = Boolean(startAdornment);
|
|
20
|
-
|
|
20
|
+
const isActionColumn = cell.field === 'actions';
|
|
21
|
+
return { formattedValue, hasStartAdornment, isActionColumn, label };
|
|
21
22
|
};
|
|
22
23
|
exports.useLogic = useLogic;
|
|
@@ -5,6 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const ConfigProvider_1 = require("../ConfigProvider");
|
|
7
7
|
const ContentState_1 = require("../ContentState");
|
|
8
|
+
const classNames_1 = require("../utils/classNames");
|
|
9
|
+
const cva_1 = require("../utils/cva");
|
|
8
10
|
const getInertProps_1 = require("../utils/getInertProps");
|
|
9
11
|
const Body_1 = require("./Body");
|
|
10
12
|
const constants_1 = require("./constants");
|
|
@@ -12,17 +14,42 @@ const DataGridContext_1 = require("./DataGridContext");
|
|
|
12
14
|
const enums_1 = require("./enums");
|
|
13
15
|
const Head_1 = require("./Head");
|
|
14
16
|
const Loader_1 = require("./Loader");
|
|
17
|
+
const MobileSkeleton_1 = require("./MobileSkeleton");
|
|
15
18
|
const NoData_1 = require("./NoData");
|
|
16
19
|
const PinnedSections_1 = require("./PinnedSections");
|
|
17
20
|
const styles_1 = require("./styles");
|
|
18
21
|
const useLogic_1 = require("./useLogic");
|
|
22
|
+
const pinnedSectionsCva = (0, cva_1.cva)(constants_1.dataGridClassnames.pinnedSections, {
|
|
23
|
+
variants: {
|
|
24
|
+
isDisabled: {
|
|
25
|
+
true: constants_1.dataGridClassnames.disabled,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const dataGridCva = (0, cva_1.cva)(constants_1.dataGridClassnames.root, {
|
|
30
|
+
variants: {
|
|
31
|
+
hasPinnedColumns: {
|
|
32
|
+
true: constants_1.dataGridClassnames.dataGridHasPinnedSections,
|
|
33
|
+
},
|
|
34
|
+
isAllowHorizontalScroll: {
|
|
35
|
+
true: constants_1.dataGridClassnames.isAllowHorizontalScroll,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const bodyCva = (0, cva_1.cva)(constants_1.dataGridClassnames.body, {
|
|
40
|
+
variants: {
|
|
41
|
+
isNoData: {
|
|
42
|
+
true: constants_1.dataGridClassnames.bodyEmpty,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
19
46
|
const DataGrid = (props) => {
|
|
20
|
-
const { isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns,
|
|
47
|
+
const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, } = (0, useLogic_1.useLogic)(props);
|
|
21
48
|
const { emptySymbol } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
|
|
22
|
-
const { columns, selectedRows = [],
|
|
49
|
+
const { columns, selectedRows = [], minDisplayRows = constants_1.MIN_DISPLAY_ROWS_BY_DEFAULT, variant = enums_1.Variant.Tree, footer, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, } = props;
|
|
23
50
|
const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
|
|
24
51
|
const { isInitialExpanded = false, expandedLevel = constants_1.EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = constants_1.INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
|
|
25
|
-
const
|
|
52
|
+
const Wrapper = isDataGridDisabled
|
|
26
53
|
? styles_1.DisabledDataGridWrapper
|
|
27
54
|
: styles_1.DataGridWrapper;
|
|
28
55
|
const renderedPlaceholder = (0, react_1.useCallback)(() => {
|
|
@@ -50,11 +77,18 @@ const DataGrid = (props) => {
|
|
|
50
77
|
...rowHoverProps,
|
|
51
78
|
};
|
|
52
79
|
const renderTableContent = () => {
|
|
53
|
-
if (!hasPinnedColumns) {
|
|
54
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
80
|
+
if (!hasPinnedColumns || isMobile) {
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, { ...(0, getInertProps_1.getInertProps)(isDataGridDisabled), className: constants_1.dataGridClassnames.wrapper, children: [headPreAddon, !isHideHead && ((0, jsx_runtime_1.jsx)(Head_1.Head, { ...headProps, columns: headColumns, gridColumns: gridColumns })), (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, loadingContent: isMobile && (0, jsx_runtime_1.jsx)(MobileSkeleton_1.MobileSkeleton, { ...mobileSkeletonProps }), children: (0, jsx_runtime_1.jsx)(Body_1.Body, { ...commonBodyProps, columns: columns, gridColumns: gridColumns, className: bodyCva({
|
|
82
|
+
isNoData,
|
|
83
|
+
}) }) })] }));
|
|
55
84
|
}
|
|
56
|
-
return ((0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, children: (0, jsx_runtime_1.jsx)(PinnedSections_1.PinnedSections, { sections: sections, className:
|
|
85
|
+
return ((0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { ...contentStateProps, children: (0, jsx_runtime_1.jsx)(PinnedSections_1.PinnedSections, { sections: sections, className: pinnedSectionsCva({
|
|
86
|
+
isDisabled: isDataGridDisabled,
|
|
87
|
+
}), isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
|
|
57
88
|
};
|
|
58
|
-
return ((0, jsx_runtime_1.jsx)(DataGridContext_1.DataGridContextProvider, { isLoading: isLoading, children: (0, jsx_runtime_1.jsxs)(styles_1.Container, { ref: containerRef,
|
|
89
|
+
return ((0, jsx_runtime_1.jsx)(DataGridContext_1.DataGridContextProvider, { isLoading: isLoading, children: (0, jsx_runtime_1.jsxs)(styles_1.Container, { ref: containerRef, style: containerCssVars, className: (0, classNames_1.classNames)(dataGridClassName, dataGridCva({
|
|
90
|
+
isAllowHorizontalScroll,
|
|
91
|
+
hasPinnedColumns,
|
|
92
|
+
})), children: [renderTableContent(), (0, jsx_runtime_1.jsx)(Loader_1.Loader, { ...loaderProps }), footer && footer] }) }));
|
|
59
93
|
};
|
|
60
94
|
exports.DataGrid = DataGrid;
|
|
@@ -32,6 +32,6 @@ const Head = (props) => {
|
|
|
32
32
|
onSelectAllRows,
|
|
33
33
|
handleSort,
|
|
34
34
|
]);
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: constants_1.dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { role: "heading", className: constants_1.dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
|
|
36
36
|
};
|
|
37
37
|
exports.Head = Head;
|