@commercetools-uikit/data-table 19.22.0 → 19.22.1
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/README.md
CHANGED
|
@@ -59,28 +59,44 @@ export default Example;
|
|
|
59
59
|
|
|
60
60
|
## Properties
|
|
61
61
|
|
|
62
|
-
| Props
|
|
63
|
-
|
|
|
64
|
-
| `rows`
|
|
65
|
-
| `columns`
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
62
|
+
| Props | Type | Required | Default | Description |
|
|
63
|
+
| --------- | ---------------------------------------------------------------- | :------: | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `rows` | `Array: Row[]` | ✅ | | The list of data that needs to be rendered in the table. Each object in the list can
have any shape as long as it has a unique identifier.
The data is rendered by using the callback render function `itemRenderer`. |
|
|
65
|
+
| `columns` | `Array: TColumn<Row>[]`<br/>[See signature.](#signature-columns) | | `[]` | Each object requires a unique `key` which should correspond to property key of
the items of `rows` that you want to render under this column, and a `label`
which defines the name shown on the header.
The list of columns to be rendered.Column item shape:``` |
|
|
66
|
+
|
|
67
|
+
{
|
|
68
|
+
key: string;
|
|
69
|
+
label: ReactNode;
|
|
70
|
+
width?: string;
|
|
71
|
+
align?: 'left' | 'center' | 'right';
|
|
72
|
+
onClick?: (event: MouseEventHandler) => void;
|
|
73
|
+
renderItem?: (row: Row, isRowCollapsed: boolean) => ReactNode;
|
|
74
|
+
headerIcon?: ReactNode;
|
|
75
|
+
isTruncated?: boolean;
|
|
76
|
+
isSortable?: boolean;
|
|
77
|
+
disableResizing?: boolean;
|
|
78
|
+
shouldIgnoreRowClick?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
````[Colum signatures with description](/?path=/docs/components-datatable-readme--props#signatures) |
|
|
82
|
+
| `customColumns` | `Array: TColumn<Row>[]`<br/>[See signature.](#signature-customColumns) | | | The columns of the nested items to be rendered in the table. Just like the columns, Each object requires a unique `key` which should correspond to property key of
the items of `rows` that you want to render under this column, and a `label`
which defines the name shown on the header.
The list of columns to be rendered. |
|
|
83
|
+
| `footer` | `ReactNode` | | | Element to render within the `tfoot` (footer) element of the table. |
|
|
84
|
+
| `maxWidth` | `union`<br/>Possible values:<br/>`number , string` | | | The max width (a number of pixels or a css value string with units) for which the table
is allowed to grow. If unset, the table will grow horizontally to fill its parent. |
|
|
85
|
+
| `maxHeight` | `union`<br/>Possible values:<br/>`number , string` | | | The max height (a number of pixels or a css value string with units) for which the table
is allowed to grow. If unset, the table will grow vertically to fill its parent and we are able to have a sticky header. |
|
|
86
|
+
| `onRowClick` | `Function`<br/>[See signature.](#signature-onRowClick) | | | A callback function, called when a user clicks on a row. |
|
|
87
|
+
| `isCondensed` | `boolean` | | `true` | Set this to `true` to reduce the paddings of all cells, allowing the table to display
more data in less space. |
|
|
88
|
+
| `onColumnResized` | `Function`<br/>[See signature.](#signature-onColumnResized) | | | A callback function, called when a column has been resized.
Use this callback to get the resized column widths and save them, to be able to restore the
value once the user comes back to the page. |
|
|
89
|
+
| `disableSelfContainment` | `boolean` | | `false` | Set this to `true` to take control of the containment of the table and doing it on a parent element.
This means that the table will grow in size without adding scrollbars on itself,
both vertically and horizontally and, as a consequence, the `maxHeight` and `maxWidth` props are ignored.
If you need to enforce these constraints, you must also apply them on the parent element.
Additionally, the sticky behaviour of the header will get fixed relatively to the closest
parent element with `position: relative`. |
|
|
90
|
+
| `disableHeaderStickiness` | `boolean` | | | Set this to `true` to prevent the header from being sticky.
The header can be sticky only if the table does not have a `maxHeight` set. |
|
|
91
|
+
| `itemRenderer` | `Function`<br/>[See signature.](#signature-itemRenderer) | | `(row, column) => row[column.key]` | The default function used to render the content of each item in a cell.
In case a column has its own `renderItem` render function, it will take precedence over this function. |
|
|
92
|
+
| `wrapHeaderLabels` | `boolean` | | `true` | Set this to `false` to ensure that every column can render their label in one line.
By default the header cell grows in height in case the label does not fit in one line. |
|
|
93
|
+
| `verticalCellAlignment` | `union`<br/>Possible values:<br/>`'top' , 'center' , 'bottom'` | | `'top'` | The default cell vertical alignment of each row (not the table header). |
|
|
94
|
+
| `horizontalCellAlignment` | `union`<br/>Possible values:<br/>`'left' , 'center' , 'right'` | | `'left'` | The default cell horizontal alignment.
In case a column has its own `align` property, it will take precedence over this value. |
|
|
95
|
+
| `sortedBy` | `string` | | | The key of the column for which the data is currently sorted by. |
|
|
96
|
+
| `onSortChange` | `Function`<br/>[See signature.](#signature-onSortChange) | | | A callback function, called when a sortable column's header is clicked.
It's required when the `isSortable` flag is set on at least one column. |
|
|
97
|
+
| `sortDirection` | `union`<br/>Possible values:<br/>`'desc' , 'asc'` | | | The sorting direction. |
|
|
98
|
+
| `renderNestedRow` | `Function`<br/>[See signature.](#signature-renderNestedRow) | | | Custom row renderer for nested rows. |
|
|
99
|
+
| `maxExpandableHeight` | `number` | | | If this is provided, then it should control the height of the expanded rows. In the event where there is more content than the maxHeight,
a scrollbar should make provision for the overflow. |
|
|
84
100
|
|
|
85
101
|
## Signatures
|
|
86
102
|
|
|
@@ -273,3 +289,4 @@ export default Example;
|
|
|
273
289
|
```ts
|
|
274
290
|
(row: Row) => ReactNode;
|
|
275
291
|
```
|
|
292
|
+
````
|
|
@@ -1010,7 +1010,7 @@ DataTable.displayName = 'DataTable';
|
|
|
1010
1010
|
var DataTable$1 = DataTable;
|
|
1011
1011
|
|
|
1012
1012
|
// NOTE: This string will be replaced on build time with the package version.
|
|
1013
|
-
var version = "19.22.
|
|
1013
|
+
var version = "19.22.1";
|
|
1014
1014
|
|
|
1015
1015
|
Object.defineProperty(exports, 'useRowSelection', {
|
|
1016
1016
|
enumerable: true,
|
|
@@ -787,7 +787,7 @@ DataTable.displayName = 'DataTable';
|
|
|
787
787
|
var DataTable$1 = DataTable;
|
|
788
788
|
|
|
789
789
|
// NOTE: This string will be replaced on build time with the package version.
|
|
790
|
-
var version = "19.22.
|
|
790
|
+
var version = "19.22.1";
|
|
791
791
|
|
|
792
792
|
Object.defineProperty(exports, 'useRowSelection', {
|
|
793
793
|
enumerable: true,
|
|
@@ -987,6 +987,6 @@ DataTable.displayName = 'DataTable';
|
|
|
987
987
|
var DataTable$1 = DataTable;
|
|
988
988
|
|
|
989
989
|
// NOTE: This string will be replaced on build time with the package version.
|
|
990
|
-
var version = "19.22.
|
|
990
|
+
var version = "19.22.1";
|
|
991
991
|
|
|
992
992
|
export { DataTable$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/data-table",
|
|
3
3
|
"description": "A component for rendering tabular data.",
|
|
4
|
-
"version": "19.22.
|
|
4
|
+
"version": "19.22.1",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/accessible-button": "19.22.
|
|
25
|
-
"@commercetools-uikit/data-table-manager": "19.22.
|
|
26
|
-
"@commercetools-uikit/design-system": "19.22.
|
|
27
|
-
"@commercetools-uikit/hooks": "19.22.
|
|
28
|
-
"@commercetools-uikit/icons": "19.22.
|
|
29
|
-
"@commercetools-uikit/secondary-icon-button": "19.22.
|
|
30
|
-
"@commercetools-uikit/utils": "19.22.
|
|
24
|
+
"@commercetools-uikit/accessible-button": "19.22.1",
|
|
25
|
+
"@commercetools-uikit/data-table-manager": "19.22.1",
|
|
26
|
+
"@commercetools-uikit/design-system": "19.22.1",
|
|
27
|
+
"@commercetools-uikit/hooks": "19.22.1",
|
|
28
|
+
"@commercetools-uikit/icons": "19.22.1",
|
|
29
|
+
"@commercetools-uikit/secondary-icon-button": "19.22.1",
|
|
30
|
+
"@commercetools-uikit/utils": "19.22.1",
|
|
31
31
|
"@emotion/react": "^11.10.5",
|
|
32
32
|
"@emotion/styled": "^11.10.5",
|
|
33
33
|
"lodash": "4.17.21",
|