@astral/ui 4.55.4 → 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/BottomDrawer/styles.js +1 -1
- package/components/CardGridInfinite/Footer/styles.js +1 -1
- package/components/CheckableTag/styles.js +1 -1
- package/components/Checkbox/styles.js +4 -2
- package/components/Chip/styles.js +1 -1
- package/components/CodeField/styles.js +1 -1
- package/components/ComplianceStatus/styles.js +1 -1
- 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/DashboardLayout/DashboardWrapper/styles.js +1 -1
- package/components/DashboardLayout/Header/styles.js +4 -4
- package/components/DashboardLayoutSkeleton/styles.js +1 -1
- package/components/DashboardSidebar/styles.js +2 -2
- package/components/DashboardSidebarSkeleton/styles.js +1 -1
- 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 +5 -1
- 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/PinnedSections/Section/styles.js +2 -2
- package/components/DataGrid/Row/NestedChildren/styles.js +8 -3
- 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 +69 -17
- 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/DateRangePicker/styles.js +1 -1
- package/components/Description/Name/styles.js +1 -1
- package/components/DescriptionCell/styles.js +12 -3
- package/components/DescriptionList/styles.js +4 -2
- package/components/ExpansionPanel/styles.js +1 -1
- package/components/InfiniteDataList/styles.js +1 -1
- package/components/InfiniteTreeList/TreeItem/styles.js +1 -1
- package/components/MenuOrganization/styles.js +2 -2
- package/components/NewStepper/Step/Description/styles.js +1 -1
- package/components/NewStepper/Step/styles.js +2 -2
- 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/PageAside/styles.js +3 -3
- package/components/PageContent/PageContentHeader/styles.js +2 -2
- package/components/PageContent/styles.js +4 -2
- package/components/PageHeader/HeaderContent/styles.js +1 -1
- package/components/PageHeader/styles.js +2 -2
- package/components/PageLayoutLoader/styles.js +1 -1
- package/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
- package/components/PageLayoutSection/PageLayoutSection.js +13 -4
- package/components/PageLayoutSection/PageLayoutSectionContainer/styles.js +1 -1
- 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 +7 -2
- package/components/PagePinnableAside/styles.js +6 -6
- package/components/PdfViewer/PdfPage/styles.js +2 -2
- package/components/Radio/styles.js +4 -2
- package/components/RadioCard/styles.js +13 -5
- package/components/SideDialogActions/styles.js +1 -1
- package/components/SideDialogHeader/styles.js +1 -1
- package/components/SideDialogTitle/styles.js +1 -1
- package/components/Stepper/styles.js +2 -2
- package/components/Tag/styles.js +1 -1
- package/components/Tree/TreeItem/styles.js +3 -3
- package/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +1 -1
- package/components/fileUploading/FileUploaderFile/styles.js +1 -1
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
- package/components/theme/components/MuiButton.js +1 -1
- package/components/theme/components/MuiDivider.d.ts +3 -0
- package/components/theme/components/MuiDivider.js +9 -0
- package/components/theme/components/MuiListItem.d.ts +3 -0
- package/components/theme/components/MuiListItem.js +9 -0
- package/components/theme/components/MuiOutlinedInput.js +2 -2
- package/components/theme/components/MuiPaper.js +1 -1
- package/components/theme/components/MuiStepConnector.js +4 -1
- package/components/theme/components/components.js +4 -0
- package/components/theme/palette/componentsColors/componentsColors.d.ts +3 -0
- package/components/theme/palette/componentsColors/componentsColors.js +3 -0
- package/node/components/BottomDrawer/styles.js +1 -1
- package/node/components/CardGridInfinite/Footer/styles.js +1 -1
- package/node/components/CheckableTag/styles.js +1 -1
- package/node/components/Checkbox/styles.js +4 -2
- package/node/components/Chip/styles.js +1 -1
- package/node/components/CodeField/styles.js +1 -1
- package/node/components/ComplianceStatus/styles.js +1 -1
- 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/DashboardLayout/DashboardWrapper/styles.js +1 -1
- package/node/components/DashboardLayout/Header/styles.js +4 -4
- package/node/components/DashboardLayoutSkeleton/styles.js +1 -1
- package/node/components/DashboardSidebar/styles.js +2 -2
- package/node/components/DashboardSidebarSkeleton/styles.js +1 -1
- 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 +5 -1
- 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/PinnedSections/Section/styles.js +2 -2
- package/node/components/DataGrid/Row/NestedChildren/styles.js +8 -3
- 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 +69 -17
- 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/DateRangePicker/styles.js +1 -1
- package/node/components/Description/Name/styles.js +1 -1
- package/node/components/DescriptionCell/styles.js +15 -6
- package/node/components/DescriptionList/styles.js +4 -2
- package/node/components/ExpansionPanel/styles.js +1 -1
- package/node/components/InfiniteDataList/styles.js +1 -1
- package/node/components/InfiniteTreeList/TreeItem/styles.js +1 -1
- package/node/components/MenuOrganization/styles.js +2 -2
- package/node/components/NewStepper/Step/Description/styles.js +1 -1
- package/node/components/NewStepper/Step/styles.js +2 -2
- 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/PageAside/styles.js +3 -3
- package/node/components/PageContent/PageContentHeader/styles.js +2 -2
- package/node/components/PageContent/styles.js +4 -2
- package/node/components/PageHeader/HeaderContent/styles.js +1 -1
- package/node/components/PageHeader/styles.js +2 -2
- package/node/components/PageLayoutLoader/styles.js +1 -1
- package/node/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
- package/node/components/PageLayoutSection/PageLayoutSection.js +12 -3
- package/node/components/PageLayoutSection/PageLayoutSectionContainer/styles.js +1 -1
- 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 +8 -3
- package/node/components/PagePinnableAside/styles.js +6 -6
- package/node/components/PdfViewer/PdfPage/styles.js +2 -2
- package/node/components/Radio/styles.js +4 -2
- package/node/components/RadioCard/styles.js +13 -5
- package/node/components/SideDialogActions/styles.js +1 -1
- package/node/components/SideDialogHeader/styles.js +1 -1
- package/node/components/SideDialogTitle/styles.js +1 -1
- package/node/components/Stepper/styles.js +2 -2
- package/node/components/Tag/styles.js +1 -1
- package/node/components/Tree/TreeItem/styles.js +3 -3
- package/node/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +1 -1
- package/node/components/fileUploading/FileUploaderFile/styles.js +1 -1
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
- package/node/components/theme/components/MuiButton.js +1 -1
- package/node/components/theme/components/MuiDivider.d.ts +3 -0
- package/node/components/theme/components/MuiDivider.js +12 -0
- package/node/components/theme/components/MuiListItem.d.ts +3 -0
- package/node/components/theme/components/MuiListItem.js +12 -0
- package/node/components/theme/components/MuiOutlinedInput.js +2 -2
- package/node/components/theme/components/MuiPaper.js +1 -1
- package/node/components/theme/components/MuiStepConnector.js +4 -1
- package/node/components/theme/components/components.js +4 -0
- package/node/components/theme/palette/componentsColors/componentsColors.d.ts +3 -0
- package/node/components/theme/palette/componentsColors/componentsColors.js +3 -0
- package/package.json +20 -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
|
@@ -27,7 +27,7 @@ export const Header = styled.header `
|
|
|
27
27
|
height: ${({ drawerHeaderHeight }) => `${drawerHeaderHeight}px`};
|
|
28
28
|
padding: ${({ theme }) => theme.spacing(1, 2, 1, 4)};
|
|
29
29
|
|
|
30
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
30
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
31
31
|
`;
|
|
32
32
|
export const HeaderTitle = styled(Typography) `
|
|
33
33
|
margin-right: ${({ theme }) => theme.spacing(2)};
|
|
@@ -9,7 +9,7 @@ export const Wrapper = styled.footer `
|
|
|
9
9
|
max-height: 76px;
|
|
10
10
|
margin-top: ${({ theme }) => theme.spacing(4)};
|
|
11
11
|
|
|
12
|
-
border-top: 1px solid ${({ theme }) => theme.palette.
|
|
12
|
+
border-top: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
13
13
|
`;
|
|
14
14
|
export const FooterDummy = styled.div `
|
|
15
15
|
min-height: 20px;
|
|
@@ -86,7 +86,7 @@ const getBorder = ({ isChecked, variant, color, theme, disabled, tagState = 'def
|
|
|
86
86
|
if (tagState === 'default') {
|
|
87
87
|
`1px solid ${theme.palette.grey[600]}`;
|
|
88
88
|
}
|
|
89
|
-
return `1px solid ${theme.palette.
|
|
89
|
+
return `1px solid ${theme.palette.components.border.default}`;
|
|
90
90
|
};
|
|
91
91
|
export const Wrapper = styled.label `
|
|
92
92
|
width: fit-content;
|
|
@@ -3,7 +3,7 @@ import { easeOutBackTransition } from '../styled/mixins';
|
|
|
3
3
|
import { CHECKBOX_SIZE, checkboxClassnames, MOBILE_CHECKBOX_SIZE, } from './constants';
|
|
4
4
|
const getOutlineColor = ({ theme, isHover, isDisabled, isError, isChecked, isIndeterminate, }) => {
|
|
5
5
|
if (isDisabled) {
|
|
6
|
-
return theme.palette.
|
|
6
|
+
return theme.palette.components.border.default;
|
|
7
7
|
}
|
|
8
8
|
if (isError) {
|
|
9
9
|
return isHover ? theme.palette.error[700] : theme.palette.error[800];
|
|
@@ -11,7 +11,9 @@ const getOutlineColor = ({ theme, isHover, isDisabled, isError, isChecked, isInd
|
|
|
11
11
|
if (isChecked || isIndeterminate) {
|
|
12
12
|
return isHover ? theme.palette.primary[700] : theme.palette.primary[800];
|
|
13
13
|
}
|
|
14
|
-
return isHover
|
|
14
|
+
return isHover
|
|
15
|
+
? theme.palette.grey[900]
|
|
16
|
+
: theme.palette.components.border.default;
|
|
15
17
|
};
|
|
16
18
|
export const Wrapper = styled('span', {
|
|
17
19
|
shouldForwardProp: (prop) => !['$isDisabled', '$isError', '$isChecked', '$isIndeterminate'].includes(prop),
|
|
@@ -14,7 +14,7 @@ export const Wrapper = styled.div `
|
|
|
14
14
|
padding: ${({ theme }) => theme.spacing(0, 2)};
|
|
15
15
|
|
|
16
16
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
17
|
-
border: 1px solid ${({ theme }) => theme.palette.
|
|
17
|
+
border: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
18
18
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
19
19
|
|
|
20
20
|
transition: ${({ theme }) => theme.transitions.create(['border-color', 'background-color'], {
|
|
@@ -7,7 +7,7 @@ const getBorder = (theme, isDisabled, isError) => {
|
|
|
7
7
|
}
|
|
8
8
|
return isError
|
|
9
9
|
? `1px solid ${theme.palette.error[800]}`
|
|
10
|
-
: `1px solid ${theme.palette.
|
|
10
|
+
: `1px solid ${theme.palette.components.border.default};`;
|
|
11
11
|
};
|
|
12
12
|
export const Wrapper = styled.div `
|
|
13
13
|
display: flex;
|
|
@@ -37,7 +37,7 @@ export const Wrapper = styled.article `
|
|
|
37
37
|
&.${complianceStatusClassnames.outlined} {
|
|
38
38
|
padding: ${({ theme }) => theme.spacing(3)};
|
|
39
39
|
|
|
40
|
-
border: 1px solid ${({ theme }) => theme.palette.
|
|
40
|
+
border: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
43
|
export const Inner = styled('ul') `
|
|
@@ -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;
|
|
@@ -5,13 +5,13 @@ import { LoadingPlaceholder } from '../placeholders/LoadingPlaceholder';
|
|
|
5
5
|
import { Placeholder } from '../placeholders/Placeholder';
|
|
6
6
|
import { Typography } from '../Typography';
|
|
7
7
|
import { useLogic } from './useLogic';
|
|
8
|
-
export const ContentState = ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, }) => {
|
|
8
|
+
export const ContentState = ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, loadingPlaceholderClassname, }) => {
|
|
9
9
|
const { imagesMap, isLoadingPhase, isShowLoader } = useLogic({
|
|
10
10
|
isLoading,
|
|
11
11
|
isSmoothLoading,
|
|
12
12
|
});
|
|
13
13
|
if (isLoadingPhase) {
|
|
14
|
-
return (_jsx(LoadingPlaceholder, { content: loadingContent, title: loadingTitle, isShowLoader: isShowLoader }));
|
|
14
|
+
return (_jsx(LoadingPlaceholder, { content: loadingContent, title: loadingTitle, isShowLoader: isShowLoader, className: loadingPlaceholderClassname }));
|
|
15
15
|
}
|
|
16
16
|
if (isCustom && customState) {
|
|
17
17
|
return _jsx(Placeholder, { ...customState });
|
|
@@ -19,7 +19,7 @@ export const DecorativeHeaderBackground = styled.div `
|
|
|
19
19
|
height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : HEADER_HEIGHT_DESKTOP)};
|
|
20
20
|
|
|
21
21
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
22
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
22
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
23
23
|
|
|
24
24
|
transition: ${({ theme }) => {
|
|
25
25
|
return theme.transitions.create(['height'], {
|
|
@@ -42,7 +42,7 @@ export const HeaderRoot = styled('header', {
|
|
|
42
42
|
padding: ${({ theme }) => theme.spacing(0, 2, 0, 1)};
|
|
43
43
|
|
|
44
44
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
45
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
45
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
46
46
|
|
|
47
47
|
transition: unset;
|
|
48
48
|
}
|
|
@@ -157,14 +157,14 @@ export const PriorityFeatureWrapper = styled.div `
|
|
|
157
157
|
height: ${MOBILE_BUTTON_HEIGHT};
|
|
158
158
|
padding: ${({ theme }) => theme.spacing(3, 4)};
|
|
159
159
|
|
|
160
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
160
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
161
161
|
|
|
162
162
|
&:hover {
|
|
163
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
163
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
&:active {
|
|
167
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
167
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
|
|
@@ -6,7 +6,7 @@ export const Content = styled.div `
|
|
|
6
6
|
min-height: 0;
|
|
7
7
|
|
|
8
8
|
background-color: ${({ theme }) => theme.palette.common.white};
|
|
9
|
-
border: 1px solid ${({ theme }) => theme.palette.
|
|
9
|
+
border: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
10
10
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
11
11
|
|
|
12
12
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -85,7 +85,7 @@ export const SidebarHeader = styled.header `
|
|
|
85
85
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
86
86
|
padding: ${({ theme }) => theme.spacing(4)};
|
|
87
87
|
|
|
88
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
88
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
89
89
|
|
|
90
90
|
/* Причина игнора: Не критично для отображения */
|
|
91
91
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
@@ -148,7 +148,7 @@ export const Footer = styled.footer `
|
|
|
148
148
|
margin-top: auto;
|
|
149
149
|
|
|
150
150
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
151
|
-
border-top: 1px solid ${({ theme }) => theme.palette.
|
|
151
|
+
border-top: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
152
152
|
border-bottom-right-radius: ${({ theme }) => theme.shape.medium};
|
|
153
153
|
border-bottom-left-radius: ${({ theme }) => theme.shape.medium};
|
|
154
154
|
|
|
@@ -12,7 +12,7 @@ export const Wrapper = styled('div', {
|
|
|
12
12
|
padding: ${({ theme, $isPinned }) => $isPinned ? theme.spacing(4, 3) : theme.spacing(4, 2)};
|
|
13
13
|
|
|
14
14
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
15
|
-
border: 1px solid ${({ theme }) => theme.palette.
|
|
15
|
+
border: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
16
16
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
17
17
|
|
|
18
18
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -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;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { classNames } from '../../utils/classNames';
|
|
3
|
+
import { cva } from '../../utils/cva';
|
|
4
4
|
import { Row } from '../Row';
|
|
5
5
|
import { RowContextProvider } from '../Row/RowContext';
|
|
6
|
+
import { bodyClassnames } from './constants';
|
|
6
7
|
import { Wrapper } from './styles';
|
|
8
|
+
import { useLogic } from './useLogic';
|
|
7
9
|
const INITIAL_LEVEL = 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const bodyCva = cva(bodyClassnames.root, {
|
|
11
|
+
variants: {
|
|
12
|
+
disableMinHeight: {
|
|
13
|
+
true: bodyClassnames.disableMinHeight,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export const Body = ({ rows, selectedRows = [], minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps }) => {
|
|
18
|
+
const { disableMinHeight, bodyCssVars } = useLogic({ minDisplayRows });
|
|
12
19
|
const renderedRows = rows.map(({ children, options, ...row }) => {
|
|
13
20
|
const rowId = row[keyId];
|
|
14
21
|
const isSelected = Boolean(selectedRows?.find((selectedRow) => selectedRow[keyId] === rowId));
|
|
15
22
|
return (_jsx(RowContextProvider, { children: _jsx(Row, { row: row, selectedRows: selectedRows, options: options, keyId: keyId, level: INITIAL_LEVEL, nestedChildren: children, isSelected: isSelected, ...rowProps }, rowId) }, rowId));
|
|
16
23
|
});
|
|
17
|
-
return (_jsx(Wrapper, { className: className,
|
|
24
|
+
return (_jsx(Wrapper, { className: classNames(className, bodyCva({ disableMinHeight })), style: bodyCssVars, children: rows.length ? renderedRows : noDataPlaceholder }));
|
|
18
25
|
};
|
|
@@ -2,7 +2,4 @@
|
|
|
2
2
|
export declare const Wrapper: 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
|
-
} & {
|
|
6
|
-
$minDisplayRows: number;
|
|
7
|
-
$disableMinHeight?: boolean | undefined;
|
|
8
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import { styled } from '../../styled';
|
|
2
2
|
import { dataGridClassnames, MIN_ROW_HEIGHT } from '../constants';
|
|
3
|
+
import { bodyClassnames } from './constants';
|
|
3
4
|
export const Wrapper = styled.ul `
|
|
5
|
+
--min-display-rows: 0;
|
|
6
|
+
|
|
4
7
|
overflow-y: auto;
|
|
5
8
|
|
|
6
9
|
width: fit-content;
|
|
7
10
|
min-width: 100%;
|
|
8
11
|
height: 100%;
|
|
9
|
-
min-height:
|
|
12
|
+
min-height: calc(var(--min-display-rows) * ${MIN_ROW_HEIGHT}px);
|
|
10
13
|
margin: 0;
|
|
11
14
|
padding: 0;
|
|
12
15
|
|
|
13
16
|
list-style-type: none;
|
|
14
17
|
|
|
18
|
+
&.${bodyClassnames.disableMinHeight} {
|
|
19
|
+
min-height: unset;
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
&.${dataGridClassnames.bodyEmpty} {
|
|
16
23
|
display: flex;
|
|
17
24
|
align-items: center;
|
|
18
25
|
}
|
|
26
|
+
|
|
27
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
28
|
+
overflow: initial;
|
|
29
|
+
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
19
32
|
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -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,15 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { ConfigContext } from '../../../ConfigProvider';
|
|
3
|
+
export const useLogic = ({ minDisplayRows, }) => {
|
|
4
|
+
const { components } = useContext(ConfigContext);
|
|
5
|
+
const disableMinHeight = components?.dataGrid?.defaultProps?.disableMinHeight;
|
|
6
|
+
const bodyCssVars = !disableMinHeight && minDisplayRows
|
|
7
|
+
? {
|
|
8
|
+
'--min-display-rows': minDisplayRows,
|
|
9
|
+
}
|
|
10
|
+
: {};
|
|
11
|
+
return {
|
|
12
|
+
disableMinHeight,
|
|
13
|
+
bodyCssVars,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,16 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { OverflowTypography } from '../../OverflowTypography';
|
|
3
3
|
import { useHidePersonalData } from '../../personalDataSecurity';
|
|
4
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { cva } from '../../utils/cva';
|
|
5
6
|
import { getInertProps } from '../../utils/getInertProps';
|
|
6
|
-
import {
|
|
7
|
+
import { dataGridCellClassnames } from './constants';
|
|
8
|
+
import { CellContent, ColumnLabel, Wrapper } from './styles';
|
|
7
9
|
import { useLogic } from './useLogic';
|
|
10
|
+
const cellCva = cva(dataGridCellClassnames.root, {
|
|
11
|
+
variants: {
|
|
12
|
+
isHideOnMobile: {
|
|
13
|
+
true: dataGridCellClassnames.isHideOnMobile,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
const cellContentCva = cva(dataGridCellClassnames.cellContent, {
|
|
18
|
+
variants: {
|
|
19
|
+
isActionColumn: {
|
|
20
|
+
true: dataGridCellClassnames.actionColumn,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
8
24
|
export const Cell = (props) => {
|
|
9
|
-
const { formattedValue, hasStartAdornment } = useLogic(props);
|
|
25
|
+
const { formattedValue, hasStartAdornment, isActionColumn, label } = useLogic(props);
|
|
10
26
|
const { className, startAdornment, row, cell, isDisabled, isHidePersonalData, } = props;
|
|
11
27
|
const { renderCell, align = 'left' } = cell;
|
|
12
28
|
const hidePersonalDataClassname = useHidePersonalData({
|
|
13
29
|
isEnabled: isHidePersonalData === true,
|
|
14
30
|
});
|
|
15
|
-
return (_jsxs(Wrapper, { "$isDisabled": isDisabled, "$align": align, "$hasStartAdornment": hasStartAdornment, className: classNames(className, hidePersonalDataClassname), ...getInertProps(isDisabled), children: [startAdornment && startAdornment, renderCell?.(row), !renderCell && (_jsx(OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: _jsx(_Fragment, { children: formattedValue }) }))] }));
|
|
31
|
+
return (_jsxs(Wrapper, { "$isDisabled": isDisabled, "$align": align, "$hasStartAdornment": hasStartAdornment, className: classNames(className, hidePersonalDataClassname, cellCva({ isHideOnMobile: cell.isHideOnMobile })), ...getInertProps(isDisabled), children: [startAdornment && startAdornment, _jsxs(CellContent, { className: cellContentCva({ isActionColumn }), children: [_jsx(ColumnLabel, { variant: "caption", color: "textSecondary", className: dataGridCellClassnames.columnLabel, children: label }), renderCell?.(row), !renderCell && (_jsx(OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: _jsx(_Fragment, { children: formattedValue }) }))] })] }));
|
|
16
32
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createUIKitClassname } from '../../utils/createUIKitClassname';
|
|
2
|
+
export const dataGridCellClassnames = {
|
|
3
|
+
root: createUIKitClassname('data-grid__cell'),
|
|
4
|
+
isHideOnMobile: createUIKitClassname('data-grid__cell_hide-on-mobile'),
|
|
5
|
+
columnLabel: createUIKitClassname('data-grid__cell-column-label'),
|
|
6
|
+
actionColumn: createUIKitClassname('data-grid__cell_action-column'),
|
|
7
|
+
cellContent: createUIKitClassname('data-grid__cell-content'),
|
|
8
|
+
};
|
|
@@ -9,4 +9,18 @@ export declare const Wrapper: import("../../styled").StyledComponent<{
|
|
|
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("../../styled").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("../../styled").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,6 +1,9 @@
|
|
|
1
1
|
import { styled } from '../../styled';
|
|
2
|
+
import { Typography } from '../../Typography';
|
|
2
3
|
import { MIN_ROW_HEIGHT } from '../constants';
|
|
4
|
+
import { dataGridRowClassnames } from '../Row/constants';
|
|
3
5
|
import { alignToJustifyContent } from '../utils';
|
|
6
|
+
import { dataGridCellClassnames } from './constants';
|
|
4
7
|
export const Wrapper = styled('div', {
|
|
5
8
|
shouldForwardProp: (prop) => !['$align', '$isDisabled', '$hasStartAdornment'].includes(prop),
|
|
6
9
|
}) `
|
|
@@ -13,4 +16,48 @@ export const Wrapper = styled('div', {
|
|
|
13
16
|
padding: ${({ theme, $hasStartAdornment }) => $hasStartAdornment ? theme.spacing(1, 2, 1, 0) : theme.spacing(1, 2)};
|
|
14
17
|
|
|
15
18
|
opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};
|
|
19
|
+
|
|
20
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
|
|
23
|
+
min-height: unset;
|
|
24
|
+
padding: 0;
|
|
25
|
+
|
|
26
|
+
&.${dataGridCellClassnames.isHideOnMobile} {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
& .${dataGridRowClassnames.checkbox} {
|
|
32
|
+
align-self: flex-start;
|
|
33
|
+
order: 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
export const ColumnLabel = styled(Typography) `
|
|
38
|
+
display: none;
|
|
39
|
+
|
|
40
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
export const CellContent = styled.div `
|
|
45
|
+
min-width: 0;
|
|
46
|
+
|
|
47
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
&.${dataGridCellClassnames.actionColumn} {
|
|
56
|
+
align-items: flex-end;
|
|
57
|
+
|
|
58
|
+
& .${dataGridCellClassnames.columnLabel} {
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
16
63
|
`;
|
|
@@ -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 {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
export const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
|
|
3
|
-
const { format, field } = cell;
|
|
3
|
+
const { format, field, label } = cell;
|
|
4
4
|
const isValidValue = (value) => {
|
|
5
5
|
return Boolean(value) || value === 0;
|
|
6
6
|
};
|
|
@@ -14,5 +14,6 @@ export const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
|
|
|
14
14
|
return emptyCellValue;
|
|
15
15
|
}, [field, format, row, emptyCellValue]);
|
|
16
16
|
const hasStartAdornment = Boolean(startAdornment);
|
|
17
|
-
|
|
17
|
+
const isActionColumn = cell.field === 'actions';
|
|
18
|
+
return { formattedValue, hasStartAdornment, isActionColumn, label };
|
|
18
19
|
};
|
|
@@ -2,24 +2,51 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useContext } from 'react';
|
|
3
3
|
import { ConfigContext } from '../ConfigProvider';
|
|
4
4
|
import { ContentState } from '../ContentState';
|
|
5
|
+
import { classNames } from '../utils/classNames';
|
|
6
|
+
import { cva } from '../utils/cva';
|
|
5
7
|
import { getInertProps } from '../utils/getInertProps';
|
|
6
8
|
import { Body } from './Body';
|
|
7
|
-
import { EXPANDED_LEVEL_BY_DEFAULT, INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, MIN_DISPLAY_ROWS_BY_DEFAULT, } from './constants';
|
|
9
|
+
import { dataGridClassnames, EXPANDED_LEVEL_BY_DEFAULT, INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, MIN_DISPLAY_ROWS_BY_DEFAULT, } from './constants';
|
|
8
10
|
import { DataGridContextProvider } from './DataGridContext';
|
|
9
11
|
import { Variant } from './enums';
|
|
10
12
|
import { Head } from './Head';
|
|
11
13
|
import { Loader } from './Loader';
|
|
14
|
+
import { MobileSkeleton } from './MobileSkeleton';
|
|
12
15
|
import { NoData } from './NoData';
|
|
13
16
|
import { PinnedSections } from './PinnedSections';
|
|
14
17
|
import { Container, DataGridWrapper, DisabledDataGridWrapper } from './styles';
|
|
15
18
|
import { useLogic } from './useLogic';
|
|
19
|
+
const pinnedSectionsCva = cva(dataGridClassnames.pinnedSections, {
|
|
20
|
+
variants: {
|
|
21
|
+
isDisabled: {
|
|
22
|
+
true: dataGridClassnames.disabled,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const dataGridCva = cva(dataGridClassnames.root, {
|
|
27
|
+
variants: {
|
|
28
|
+
hasPinnedColumns: {
|
|
29
|
+
true: dataGridClassnames.dataGridHasPinnedSections,
|
|
30
|
+
},
|
|
31
|
+
isAllowHorizontalScroll: {
|
|
32
|
+
true: dataGridClassnames.isAllowHorizontalScroll,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const bodyCva = cva(dataGridClassnames.body, {
|
|
37
|
+
variants: {
|
|
38
|
+
isNoData: {
|
|
39
|
+
true: dataGridClassnames.bodyEmpty,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
16
43
|
export const DataGrid = (props) => {
|
|
17
|
-
const { isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns,
|
|
44
|
+
const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, } = useLogic(props);
|
|
18
45
|
const { emptySymbol } = useContext(ConfigContext);
|
|
19
|
-
const { columns, selectedRows = [],
|
|
46
|
+
const { columns, selectedRows = [], minDisplayRows = MIN_DISPLAY_ROWS_BY_DEFAULT, variant = Variant.Tree, footer, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, } = props;
|
|
20
47
|
const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
|
|
21
48
|
const { isInitialExpanded = false, expandedLevel = EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
|
|
22
|
-
const
|
|
49
|
+
const Wrapper = isDataGridDisabled
|
|
23
50
|
? DisabledDataGridWrapper
|
|
24
51
|
: DataGridWrapper;
|
|
25
52
|
const renderedPlaceholder = useCallback(() => {
|
|
@@ -47,10 +74,17 @@ export const DataGrid = (props) => {
|
|
|
47
74
|
...rowHoverProps,
|
|
48
75
|
};
|
|
49
76
|
const renderTableContent = () => {
|
|
50
|
-
if (!hasPinnedColumns) {
|
|
51
|
-
return (_jsxs(
|
|
77
|
+
if (!hasPinnedColumns || isMobile) {
|
|
78
|
+
return (_jsxs(Wrapper, { ...getInertProps(isDataGridDisabled), className: dataGridClassnames.wrapper, children: [headPreAddon, !isHideHead && (_jsx(Head, { ...headProps, columns: headColumns, gridColumns: gridColumns })), _jsx(ContentState, { ...contentStateProps, loadingContent: isMobile && _jsx(MobileSkeleton, { ...mobileSkeletonProps }), children: _jsx(Body, { ...commonBodyProps, columns: columns, gridColumns: gridColumns, className: bodyCva({
|
|
79
|
+
isNoData,
|
|
80
|
+
}) }) })] }));
|
|
52
81
|
}
|
|
53
|
-
return (_jsx(ContentState, { ...contentStateProps, children: _jsx(PinnedSections, { sections: sections, className:
|
|
82
|
+
return (_jsx(ContentState, { ...contentStateProps, children: _jsx(PinnedSections, { sections: sections, className: pinnedSectionsCva({
|
|
83
|
+
isDisabled: isDataGridDisabled,
|
|
84
|
+
}), isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
|
|
54
85
|
};
|
|
55
|
-
return (_jsx(DataGridContextProvider, { isLoading: isLoading, children: _jsxs(Container, { ref: containerRef,
|
|
86
|
+
return (_jsx(DataGridContextProvider, { isLoading: isLoading, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className: classNames(dataGridClassName, dataGridCva({
|
|
87
|
+
isAllowHorizontalScroll,
|
|
88
|
+
hasPinnedColumns,
|
|
89
|
+
})), children: [renderTableContent(), _jsx(Loader, { ...loaderProps }), footer && footer] }) }));
|
|
56
90
|
};
|
|
@@ -29,5 +29,5 @@ export const Head = (props) => {
|
|
|
29
29
|
onSelectAllRows,
|
|
30
30
|
handleSort,
|
|
31
31
|
]);
|
|
32
|
-
return (_jsx(Wrapper, { className: dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
|
|
32
|
+
return (_jsx(Wrapper, { role: "heading", className: dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
|
|
33
33
|
};
|
|
@@ -9,7 +9,11 @@ export const Wrapper = styled('header', {
|
|
|
9
9
|
width: fit-content;
|
|
10
10
|
min-width: 100%;
|
|
11
11
|
|
|
12
|
-
border-bottom: 1px solid ${({ theme }) => theme.palette.
|
|
12
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
13
|
+
|
|
14
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
13
17
|
`;
|
|
14
18
|
export const CheckboxCell = styled.div `
|
|
15
19
|
display: flex;
|
|
@@ -18,6 +18,10 @@ export const LoaderWrapper = styled.div `
|
|
|
18
18
|
position: sticky;
|
|
19
19
|
z-index: ${({ theme }) => theme.zIndex.fab};
|
|
20
20
|
left: 0;
|
|
21
|
+
|
|
22
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
21
25
|
`;
|
|
22
26
|
export const StyledLinearProgress = styled(LinearProgress) `
|
|
23
27
|
height: 2px;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from '../../Skeleton';
|
|
3
|
+
import { Actions, Cell, Root, RowWrapper } from './styles';
|
|
4
|
+
export const MobileSkeleton = ({ cellsCount, rowsCount, }) => {
|
|
5
|
+
return (_jsx(Root, { children: Array.from({ length: rowsCount }, (_, rowIndex) => (_jsxs(RowWrapper
|
|
6
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
|
|
7
|
+
, { children: [Array.from({ length: cellsCount - 1 }, (_cell, cellIndex) => (
|
|
8
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
|
|
9
|
+
_jsxs(Cell, { children: [_jsx(Skeleton, { variant: "rounded", height: 20 }), _jsx(Skeleton, { variant: "rounded", height: 16, width: "50%" })] }, cellIndex))), _jsx(Actions, { children: _jsx(Skeleton, { variant: "rounded", width: "100%", height: 40 }) })] }, rowIndex))) }));
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileSkeleton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileSkeleton';
|