mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
fix(DataTable): useStaticWidth title/description
Signed-off-by: Florian-Schoenherr <florian.schoenherr99@gmail.com>
This commit is contained in:
parent
7e0b8af685
commit
80202bfe66
3 changed files with 11 additions and 1 deletions
|
@ -202,7 +202,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<TableContainer {...$$restProps}>
|
||||
<TableContainer useStaticWidth="{useStaticWidth}" {...$$restProps}>
|
||||
{#if title || $$slots.title || description || $$slots.description}
|
||||
<div class:bx--data-table-header="{true}">
|
||||
{#if title || $$slots.title}
|
||||
|
|
|
@ -7,10 +7,14 @@
|
|||
|
||||
/** Set to `true` to enable a sticky header */
|
||||
export let stickyHeader = false;
|
||||
|
||||
/** Set to `true` to use static width */
|
||||
export let useStaticWidth = false;
|
||||
</script>
|
||||
|
||||
<div
|
||||
class:bx--data-table-container="{true}"
|
||||
class:bx--data-table-container--static="{useStaticWidth}"
|
||||
class:bx--data-table--max-width="{stickyHeader}"
|
||||
{...$$restProps}
|
||||
>
|
||||
|
|
6
types/DataTable/TableContainer.d.ts
vendored
6
types/DataTable/TableContainer.d.ts
vendored
|
@ -20,6 +20,12 @@ export interface TableContainerProps
|
|||
* @default false
|
||||
*/
|
||||
stickyHeader?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to use static width
|
||||
* @default false
|
||||
*/
|
||||
useStaticWidth?: boolean;
|
||||
}
|
||||
|
||||
export default class TableContainer extends SvelteComponentTyped<
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue