@ceed/cds 1.24.1-next.2 → 1.25.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/dist/components/DataTable/components.d.ts +2 -1
- package/dist/components/DataTable/styled.d.ts +3 -1
- package/dist/components/DataTable/types.d.ts +1 -0
- package/dist/components/data-display/DataTable.md +76 -0
- package/dist/index.browser.js +2 -2
- package/dist/index.browser.js.map +3 -3
- package/dist/index.cjs +31 -19
- package/dist/index.js +31 -19
- package/framer/index.js +1 -1
- package/package.json +12 -16
- package/README.md +0 -51
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import type { ObjectLike, ColumnDef, Sort } from './types';
|
|
3
|
-
export declare const TextEllipsis: ({ children }: {
|
|
3
|
+
export declare const TextEllipsis: ({ children, lineClamp }: {
|
|
4
4
|
children: ReactNode;
|
|
5
|
+
lineClamp?: number | undefined;
|
|
5
6
|
}) => React.JSX.Element;
|
|
6
7
|
export declare const CellTextEllipsis: ({ children }: {
|
|
7
8
|
children: ReactNode;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
export declare const EllipsisDiv: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/joy").Theme
|
|
2
|
+
export declare const EllipsisDiv: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/joy").Theme> & {
|
|
3
|
+
lineClamp?: number | undefined;
|
|
4
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
5
|
export declare const OverlayWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/joy").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, keyof React.ClassAttributes<HTMLTableRowElement> | keyof React.HTMLAttributes<HTMLTableRowElement>>, {}>;
|
|
4
6
|
export declare const VirtualizedTableBody: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/joy").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, keyof React.ClassAttributes<HTMLTableSectionElement> | keyof React.HTMLAttributes<HTMLTableSectionElement>>, {}>;
|
|
5
7
|
export declare const StyledTableRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/joy").Theme> & {
|
|
@@ -103,6 +103,7 @@ export type BaseColumnDef<T extends Record<PropertyKey, V>, V, ID> = {
|
|
|
103
103
|
description?: string;
|
|
104
104
|
cellClassName?: TableCellClassNamePropType<T, T[K]>;
|
|
105
105
|
headerClassName?: TableColumnHeaderClassNamePropType<T, T[K]>;
|
|
106
|
+
headerLineClamp?: 1 | 2;
|
|
106
107
|
};
|
|
107
108
|
}[keyof T];
|
|
108
109
|
export type AutocompleteColumnDef<T extends Record<PropertyKey, string>, ID> = BaseColumnDef<T, string, ID> & {
|
|
@@ -895,6 +895,82 @@ const columns = [
|
|
|
895
895
|
];
|
|
896
896
|
```
|
|
897
897
|
|
|
898
|
+
### Two-Line Headers (headerLineClamp)
|
|
899
|
+
|
|
900
|
+
Setting `headerLineClamp: 2` on a column allows the header text to wrap up to 2 lines. Text exceeding 2 lines is truncated with an ellipsis, and a tooltip is displayed on hover when truncation occurs.
|
|
901
|
+
|
|
902
|
+
```tsx
|
|
903
|
+
<Box sx={{
|
|
904
|
+
width: 500
|
|
905
|
+
}}>
|
|
906
|
+
<DataTable rows={manyRows} columns={[{
|
|
907
|
+
field: 'dessert',
|
|
908
|
+
headerName: 'Dessert Name (100g serving)',
|
|
909
|
+
headerLineClamp: 2,
|
|
910
|
+
width: '120px'
|
|
911
|
+
}, {
|
|
912
|
+
field: 'calories',
|
|
913
|
+
headerName: 'Calories (kcal)',
|
|
914
|
+
headerLineClamp: 2,
|
|
915
|
+
type: 'number',
|
|
916
|
+
width: '80px'
|
|
917
|
+
}, {
|
|
918
|
+
field: 'fat',
|
|
919
|
+
headerName: 'Fat Content (grams)',
|
|
920
|
+
headerLineClamp: 2,
|
|
921
|
+
type: 'number',
|
|
922
|
+
width: '80px'
|
|
923
|
+
}, {
|
|
924
|
+
field: 'carbs',
|
|
925
|
+
headerName: 'Total Carbohydrates (g)',
|
|
926
|
+
headerLineClamp: 2,
|
|
927
|
+
type: 'number',
|
|
928
|
+
width: '90px'
|
|
929
|
+
}, {
|
|
930
|
+
field: 'protein',
|
|
931
|
+
headerName: 'Protein Amount (g)',
|
|
932
|
+
type: 'number',
|
|
933
|
+
width: '120px'
|
|
934
|
+
}]} stickyHeader slotProps={{
|
|
935
|
+
background: {
|
|
936
|
+
style: {
|
|
937
|
+
height: '400px'
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}} />
|
|
941
|
+
</Box>
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
```tsx
|
|
945
|
+
const columns = [
|
|
946
|
+
{
|
|
947
|
+
field: 'calories',
|
|
948
|
+
headerName: 'Calories (kcal)',
|
|
949
|
+
headerLineClamp: 2,
|
|
950
|
+
type: 'number',
|
|
951
|
+
width: '80px',
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
field: 'fat',
|
|
955
|
+
headerName: 'Fat Content (grams)',
|
|
956
|
+
headerLineClamp: 2,
|
|
957
|
+
type: 'number',
|
|
958
|
+
width: '80px',
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
field: 'protein',
|
|
962
|
+
headerName: 'Protein (g)', // no headerLineClamp — single line (default)
|
|
963
|
+
type: 'number',
|
|
964
|
+
},
|
|
965
|
+
];
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
#### Notes
|
|
969
|
+
|
|
970
|
+
- `headerLineClamp` is opt-in per column. Columns without it remain single-line.
|
|
971
|
+
- Supported values: `1 | 2`.
|
|
972
|
+
- Works with all existing features: sorting, pinning, resizing, and column grouping.
|
|
973
|
+
|
|
898
974
|
## Editing Features
|
|
899
975
|
|
|
900
976
|
### Inline Editing
|