fix(data-table): export useStaticWidth prop

This commit is contained in:
Eric Y Liu 2021-07-05 12:31:17 -07:00
commit 676eedb1a0
4 changed files with 21 additions and 0 deletions

View file

@ -958,6 +958,7 @@ export interface DataTableCell {
| radio | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for the radio selection variant |
| batchSelection | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable batch selection |
| stickyHeader | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable a sticky header |
| useStaticWidth | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use static width |
### Slots

View file

@ -2095,6 +2095,16 @@
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "useStaticWidth",
"kind": "let",
"description": "Set to `true` to use static width",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": false
}
],
"slots": [

View file

@ -91,6 +91,9 @@
/** Set to `true` to enable a sticky header */
export let stickyHeader = false;
/** Set to `true` to use static width */
export let useStaticWidth = false;
import { createEventDispatcher, setContext } from "svelte";
import { writable, derived } from "svelte/store";
import ChevronRight16 from "carbon-icons-svelte/lib/ChevronRight16/ChevronRight16.svelte";
@ -221,6 +224,7 @@
size="{size}"
stickyHeader="{stickyHeader}"
sortable="{sortable}"
useStaticWidth="{useStaticWidth}"
>
<TableHead>
<TableRow>

View file

@ -129,6 +129,12 @@ export interface DataTableProps
* @default false
*/
stickyHeader?: boolean;
/**
* Set to `true` to use static width
* @default false
*/
useStaticWidth?: boolean;
}
export default class DataTable extends SvelteComponentTyped<