mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(data-table): allow custom column widths (#1265)
* feat(data-table): allow header column `width`, `minWidth` values * Run "yarn build:docs" * test(data-table): assert width, minWidth properties * docs(data-table): add "Custom column widths" example
This commit is contained in:
parent
6239c11024
commit
c6f210899b
9 changed files with 90 additions and 14 deletions
|
@ -927,6 +927,8 @@ export interface DataTableEmptyHeader {
|
|||
display?: (item: Value) => DataTableValue;
|
||||
sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1);
|
||||
columnMenu?: boolean;
|
||||
width?: string;
|
||||
minWidth?: string;
|
||||
}
|
||||
|
||||
export interface DataTableNonEmptyHeader {
|
||||
|
@ -935,6 +937,8 @@ export interface DataTableNonEmptyHeader {
|
|||
display?: (item: Value) => DataTableValue;
|
||||
sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1);
|
||||
columnMenu?: boolean;
|
||||
width?: string;
|
||||
minWidth?: string;
|
||||
}
|
||||
|
||||
export type DataTableHeader = DataTableNonEmptyHeader | DataTableEmptyHeader;
|
||||
|
@ -3748,13 +3752,14 @@ None.
|
|||
|
||||
### Props
|
||||
|
||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||
| :------------- | :--------------- | :------- | :------------------------------------------------------------------ | ---------------------- | --------------------------------------- |
|
||||
| size | <code>let</code> | No | <code>"compact" | "short" | "medium" | "tall"</code> | <code>undefined</code> | Set the size of the table |
|
||||
| zebra | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use zebra styles |
|
||||
| useStaticWidth | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use static width |
|
||||
| sortable | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for the sortable variant |
|
||||
| stickyHeader | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable a sticky header |
|
||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||
| :------------- | :--------------- | :------- | :------------------------------------------------------------------ | ---------------------- | ---------------------------------------------- |
|
||||
| size | <code>let</code> | No | <code>"compact" | "short" | "medium" | "tall"</code> | <code>undefined</code> | Set the size of the table |
|
||||
| zebra | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use zebra styles |
|
||||
| useStaticWidth | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use static width |
|
||||
| sortable | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for the sortable variant |
|
||||
| stickyHeader | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable a sticky header |
|
||||
| tableStyle | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Set the style attribute on the `table` element |
|
||||
|
||||
### Slots
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue