mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
Merge 2921502122
into b6df277647
This commit is contained in:
commit
a14bf85522
14 changed files with 176 additions and 100 deletions
|
@ -1001,7 +1001,7 @@ export interface DataTableCell {
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
||||||
| :------------------ | :------- | :--------------- | :------- | ------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
| :------------------ | :------- | :--------------- | :------- | ----------------------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
||||||
| selectedRowIds | No | <code>let</code> | Yes | <code>ReadonlyArray<DataTableRowId></code> | <code>[]</code> | Specify the row ids to be selected |
|
| selectedRowIds | No | <code>let</code> | Yes | <code>ReadonlyArray<DataTableRowId></code> | <code>[]</code> | Specify the row ids to be selected |
|
||||||
| selectable | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` for the selectable variant<br />Automatically set to `true` if `radio` or `batchSelection` are `true` |
|
| selectable | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` for the selectable variant<br />Automatically set to `true` if `radio` or `batchSelection` are `true` |
|
||||||
| expandedRowIds | No | <code>let</code> | Yes | <code>ReadonlyArray<DataTableRowId></code> | <code>[]</code> | Specify the row ids to be expanded |
|
| expandedRowIds | No | <code>let</code> | Yes | <code>ReadonlyArray<DataTableRowId></code> | <code>[]</code> | Specify the row ids to be expanded |
|
||||||
|
@ -1010,7 +1010,7 @@ export interface DataTableCell {
|
||||||
| sortKey | No | <code>let</code> | Yes | <code>DataTableKey</code> | <code>null</code> | Specify the header key to sort by |
|
| sortKey | No | <code>let</code> | Yes | <code>DataTableKey</code> | <code>null</code> | Specify the header key to sort by |
|
||||||
| headers | No | <code>let</code> | No | <code>ReadonlyArray<DataTableHeader></code> | <code>[]</code> | Specify the data table headers |
|
| headers | No | <code>let</code> | No | <code>ReadonlyArray<DataTableHeader></code> | <code>[]</code> | Specify the data table headers |
|
||||||
| rows | No | <code>let</code> | No | <code>ReadonlyArray<DataTableRow></code> | <code>[]</code> | Specify the rows the data table should render<br />keys defined in `headers` are used for the row ids |
|
| rows | No | <code>let</code> | No | <code>ReadonlyArray<DataTableRow></code> | <code>[]</code> | Specify the rows the data table should render<br />keys defined in `headers` are used for the row ids |
|
||||||
| size | No | <code>let</code> | No | <code>"compact" | "short" | "medium" | "tall"</code> | <code>undefined</code> | Set the size of the data table |
|
| size | No | <code>let</code> | No | <code>"xs" | "sm" | "md" | "lg" | "xl"</code> | <code>"lg"</code> | Set the size of the data table |
|
||||||
| title | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the title of the data table |
|
| title | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the title of the data table |
|
||||||
| description | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the description of the data table |
|
| description | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the description of the data table |
|
||||||
| zebra | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use zebra styles |
|
| zebra | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use zebra styles |
|
||||||
|
@ -1056,10 +1056,10 @@ export interface DataTableCell {
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
||||||
| :---------- | :------- | :--------------- | :------- | ------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------- |
|
| :---------- | :------- | :--------------- | :------- | ------------------------------------------------------------------ | ------------------ | -------------------------------------------------------------------------------------------- |
|
||||||
| columns | No | <code>let</code> | No | <code>number</code> | <code>5</code> | Specify the number of columns<br />Superseded by `headers` if `headers` is a non-empty array |
|
| columns | No | <code>let</code> | No | <code>number</code> | <code>5</code> | Specify the number of columns<br />Superseded by `headers` if `headers` is a non-empty array |
|
||||||
| rows | No | <code>let</code> | No | <code>number</code> | <code>5</code> | Specify the number of rows |
|
| rows | No | <code>let</code> | No | <code>number</code> | <code>5</code> | Specify the number of rows |
|
||||||
| size | No | <code>let</code> | No | <code>"compact" | "short" | "tall"</code> | <code>undefined</code> | Set the size of the data table |
|
| size | No | <code>let</code> | No | <code>"xs" | "sm" | "md" | "lg" | "xl"</code> | <code>"lg"</code> | Set the size of the data table |
|
||||||
| zebra | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to apply zebra styles to the datatable rows |
|
| zebra | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to apply zebra styles to the datatable rows |
|
||||||
| showHeader | No | <code>let</code> | No | <code>boolean</code> | <code>true</code> | Set to `false` to hide the header |
|
| showHeader | No | <code>let</code> | No | <code>boolean</code> | <code>true</code> | Set to `false` to hide the header |
|
||||||
| headers | No | <code>let</code> | No | <code>ReadonlyArray<string | Partial<DataTableHeader>></code> | <code>[]</code> | Set the column headers<br />Supersedes `columns` if value is a non-empty array |
|
| headers | No | <code>let</code> | No | <code>ReadonlyArray<string | Partial<DataTableHeader>></code> | <code>[]</code> | Set the column headers<br />Supersedes `columns` if value is a non-empty array |
|
||||||
|
@ -3893,8 +3893,8 @@ None.
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
||||||
| :------------- | :------- | :--------------- | :------- | ------------------------------------------------------------------- | ---------------------- | ---------------------------------------------- |
|
| :------------- | :------- | :--------------- | :------- | ----------------------------------------------------------------- | ---------------------- | ---------------------------------------------- |
|
||||||
| size | No | <code>let</code> | No | <code>"compact" | "short" | "medium" | "tall"</code> | <code>undefined</code> | Set the size of the table |
|
| size | No | <code>let</code> | No | <code>"xs" | "sm" | "md" | "lg" | "xl"</code> | <code>"lg"</code> | Set the size of the table |
|
||||||
| zebra | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use zebra styles |
|
| zebra | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use zebra styles |
|
||||||
| useStaticWidth | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use static width |
|
| useStaticWidth | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to use static width |
|
||||||
| sortable | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for the sortable variant |
|
| sortable | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for the sortable variant |
|
||||||
|
|
|
@ -2451,7 +2451,8 @@
|
||||||
"name": "size",
|
"name": "size",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
"description": "Set the size of the data table",
|
"description": "Set the size of the data table",
|
||||||
"type": "\"compact\" | \"short\" | \"medium\" | \"tall\"",
|
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"",
|
||||||
|
"value": "\"lg\"",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"isFunctionDeclaration": false,
|
"isFunctionDeclaration": false,
|
||||||
"isRequired": false,
|
"isRequired": false,
|
||||||
|
@ -2844,7 +2845,8 @@
|
||||||
"name": "size",
|
"name": "size",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
"description": "Set the size of the data table",
|
"description": "Set the size of the data table",
|
||||||
"type": "\"compact\" | \"short\" | \"tall\"",
|
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"",
|
||||||
|
"value": "\"lg\"",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"isFunctionDeclaration": false,
|
"isFunctionDeclaration": false,
|
||||||
"isRequired": false,
|
"isRequired": false,
|
||||||
|
@ -12069,7 +12071,8 @@
|
||||||
"name": "size",
|
"name": "size",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
"description": "Set the size of the table",
|
"description": "Set the size of the table",
|
||||||
"type": "\"compact\" | \"short\" | \"medium\" | \"tall\"",
|
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"",
|
||||||
|
"value": "\"lg\"",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"isFunctionDeclaration": false,
|
"isFunctionDeclaration": false,
|
||||||
"isRequired": false,
|
"isRequired": false,
|
||||||
|
|
|
@ -432,7 +432,7 @@ A maximum height will applied to the datatable to force a scrollbar.
|
||||||
|
|
||||||
## With toolbar (small size)
|
## With toolbar (small size)
|
||||||
|
|
||||||
<DataTable size="short" title="Load balancers" description="Your organization's active load balancers."
|
<DataTable size="sm" title="Load balancers" description="Your organization's active load balancers."
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -570,9 +570,64 @@ Note that in-memory filtering is not optimal for large data sets, where you migh
|
||||||
]}"
|
]}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
## Tall rows
|
## Extra large rows
|
||||||
|
|
||||||
<DataTable size="tall"
|
<DataTable size="xl"
|
||||||
|
headers="{[
|
||||||
|
{ key: "name", value: "Name" },
|
||||||
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
{ key: "port", value: "Port" },
|
||||||
|
{ key: "rule", value: "Rule" }
|
||||||
|
]}"
|
||||||
|
rows="{[
|
||||||
|
{
|
||||||
|
id: "a",
|
||||||
|
name: "Load Balancer 3",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "b",
|
||||||
|
name: "Load Balancer 1",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "c",
|
||||||
|
name: "Load Balancer 2",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "d",
|
||||||
|
name: "Load Balancer 6",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "e",
|
||||||
|
name: "Load Balancer 4",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "f",
|
||||||
|
name: "Load Balancer 5",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
]}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
## Large rows (default)
|
||||||
|
|
||||||
|
<DataTable size="lg"
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -627,7 +682,7 @@ Note that in-memory filtering is not optimal for large data sets, where you migh
|
||||||
|
|
||||||
## Medium rows
|
## Medium rows
|
||||||
|
|
||||||
<DataTable size="medium"
|
<DataTable size="md"
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -680,9 +735,9 @@ Note that in-memory filtering is not optimal for large data sets, where you migh
|
||||||
]}"
|
]}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
## Short rows
|
## Small rows
|
||||||
|
|
||||||
<DataTable size="short"
|
<DataTable size="sm"
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -735,9 +790,9 @@ Note that in-memory filtering is not optimal for large data sets, where you migh
|
||||||
]}"
|
]}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
## Compact rows
|
## Extra small rows
|
||||||
|
|
||||||
<DataTable size="compact"
|
<DataTable size="xs"
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -1138,9 +1193,9 @@ Use `nonExpandableRowIds` to specify the ids for rows that should not be expanda
|
||||||
|
|
||||||
<FileSource src="/framed/DataTable/DataTableExpandableZebra" />
|
<FileSource src="/framed/DataTable/DataTableExpandableZebra" />
|
||||||
|
|
||||||
## Expandable (compact size)
|
## Expandable (extra small size)
|
||||||
|
|
||||||
<DataTable size="compact" expandable
|
<DataTable size="xs" expandable
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -1197,9 +1252,9 @@ Use `nonExpandableRowIds` to specify the ids for rows that should not be expanda
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
|
|
||||||
## Expandable (short size)
|
## Expandable (small size)
|
||||||
|
|
||||||
<DataTable size="short" expandable
|
<DataTable size="sm" expandable
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -1256,9 +1311,9 @@ Use `nonExpandableRowIds` to specify the ids for rows that should not be expanda
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
|
|
||||||
## Expandable (tall size)
|
## Expandable (extra tall size)
|
||||||
|
|
||||||
<DataTable size="tall" expandable
|
<DataTable size="xl" expandable
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
@ -1406,14 +1461,22 @@ Pass an object with `"empty"` set to `true` to render an empty table header colu
|
||||||
|
|
||||||
<DataTableSkeleton showHeader={false} showToolbar={false} />
|
<DataTableSkeleton showHeader={false} showToolbar={false} />
|
||||||
|
|
||||||
## Skeleton (tall size)
|
## Skeleton (extra large size)
|
||||||
|
|
||||||
<DataTableSkeleton showHeader={false} showToolbar={false} size="tall" />
|
<DataTableSkeleton showHeader={false} showToolbar={false} size="xl" />
|
||||||
|
|
||||||
## Skeleton (short size)
|
## Skeleton (large size)
|
||||||
|
|
||||||
<DataTableSkeleton showHeader={false} showToolbar={false} size="short" />
|
<DataTableSkeleton showHeader={false} showToolbar={false} size="lg" />
|
||||||
|
|
||||||
## Skeleton (compact size)
|
## Skeleton (medium size)
|
||||||
|
|
||||||
<DataTableSkeleton showHeader={false} showToolbar={false} size="compact" />
|
<DataTableSkeleton showHeader={false} showToolbar={false} size="md" />
|
||||||
|
|
||||||
|
## Skeleton (small size)
|
||||||
|
|
||||||
|
<DataTableSkeleton showHeader={false} showToolbar={false} size="sm" />
|
||||||
|
|
||||||
|
## Skeleton (extra small size)
|
||||||
|
|
||||||
|
<DataTableSkeleton showHeader={false} showToolbar={false} size="xs" />
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "port", value: "Port" },
|
{ key: "port", value: "Port" },
|
||||||
{ key: "rule", value: "Rule" },
|
{ key: "rule", value: "Rule" },
|
||||||
{ key: "overflow", empty: true },
|
{ key: "overflow", empty: true, columnMenu: true },
|
||||||
];
|
];
|
||||||
|
|
||||||
const rows = [
|
const rows = [
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
<DataTable sortable headers="{headers}" rows="{rows}">
|
<DataTable sortable headers="{headers}" rows="{rows}">
|
||||||
<svelte:fragment slot="cell" let:cell>
|
<svelte:fragment slot="cell" let:cell>
|
||||||
{#if cell.key === "overflow"}
|
{#if cell.key === "overflow"}
|
||||||
<OverflowMenu flipped>
|
<OverflowMenu size="sm" flipped>
|
||||||
<OverflowMenuItem text="Restart" />
|
<OverflowMenuItem text="Restart" />
|
||||||
<OverflowMenuItem
|
<OverflowMenuItem
|
||||||
href="https://cloud.ibm.com/docs/loadbalancer-service"
|
href="https://cloud.ibm.com/docs/loadbalancer-service"
|
||||||
|
|
|
@ -39,9 +39,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size of the data table
|
* Set the size of the data table
|
||||||
* @type {"compact" | "short" | "medium" | "tall"}
|
* @type {"xs" | "sm" | "md" | "lg" | "xl"}
|
||||||
*/
|
*/
|
||||||
export let size = undefined;
|
export let size = "lg";
|
||||||
|
|
||||||
/** Specify the title of the data table */
|
/** Specify the title of the data table */
|
||||||
export let title = "";
|
export let title = "";
|
||||||
|
@ -307,7 +307,7 @@
|
||||||
</th>
|
</th>
|
||||||
{/if}
|
{/if}
|
||||||
{#if selectable && !batchSelection}
|
{#if selectable && !batchSelection}
|
||||||
<th scope="col"></th>
|
<th scope="col" class:bx--table-column-checkbox="{true}"></th>
|
||||||
{/if}
|
{/if}
|
||||||
{#if batchSelection && !radio}
|
{#if batchSelection && !radio}
|
||||||
<th scope="col" class:bx--table-column-checkbox="{true}">
|
<th scope="col" class:bx--table-column-checkbox="{true}">
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size of the data table
|
* Set the size of the data table
|
||||||
* @type {"compact" | "short" | "tall"}
|
* @type {"xs" | "sm" | "md" | "lg" | "xl"}
|
||||||
*/
|
*/
|
||||||
export let size = undefined;
|
export let size = "lg";
|
||||||
|
|
||||||
/** Set to `true` to apply zebra styles to the datatable rows */
|
/** Set to `true` to apply zebra styles to the datatable rows */
|
||||||
export let zebra = false;
|
export let zebra = false;
|
||||||
|
@ -68,9 +68,11 @@
|
||||||
<table
|
<table
|
||||||
class:bx--skeleton="{true}"
|
class:bx--skeleton="{true}"
|
||||||
class:bx--data-table="{true}"
|
class:bx--data-table="{true}"
|
||||||
class:bx--data-table--compact="{size === 'compact'}"
|
class:bx--data-table--xs="{size === 'xs'}"
|
||||||
class:bx--data-table--short="{size === 'short'}"
|
class:bx--data-table--sm="{size === 'sm'}"
|
||||||
class:bx--data-table--tall="{size === 'tall'}"
|
class:bx--data-table--md="{size === 'md'}"
|
||||||
|
class:bx--data-table--lg="{size === 'lg'}"
|
||||||
|
class:bx--data-table--xl="{size === 'xl'}"
|
||||||
class:bx--data-table--zebra="{zebra}"
|
class:bx--data-table--zebra="{zebra}"
|
||||||
on:click
|
on:click
|
||||||
on:mouseover
|
on:mouseover
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Set the size of the table
|
* Set the size of the table
|
||||||
* @type {"compact" | "short" | "medium" | "tall"}
|
* @type {"xs" | "sm" | "md" | "lg" | "xl"}
|
||||||
*/
|
*/
|
||||||
export let size = undefined;
|
export let size = "lg";
|
||||||
|
|
||||||
/** Set to `true` to use zebra styles */
|
/** Set to `true` to use zebra styles */
|
||||||
export let zebra = false;
|
export let zebra = false;
|
||||||
|
@ -28,14 +28,16 @@
|
||||||
<section class:bx--data-table_inner-container="{true}" {...$$restProps}>
|
<section class:bx--data-table_inner-container="{true}" {...$$restProps}>
|
||||||
<table
|
<table
|
||||||
class:bx--data-table="{true}"
|
class:bx--data-table="{true}"
|
||||||
class:bx--data-table--compact="{size === 'compact'}"
|
class:bx--data-table--xs="{size === 'xs'}"
|
||||||
class:bx--data-table--short="{size === 'short'}"
|
class:bx--data-table--sm="{size === 'sm'}"
|
||||||
class:bx--data-table--tall="{size === 'tall'}"
|
class:bx--data-table--md="{size === 'md'}"
|
||||||
class:bx--data-table--md="{size === 'medium'}"
|
class:bx--data-table--lg="{size === 'lg'}"
|
||||||
|
class:bx--data-table--xl="{size === 'xl'}"
|
||||||
class:bx--data-table--sort="{sortable}"
|
class:bx--data-table--sort="{sortable}"
|
||||||
class:bx--data-table--zebra="{zebra}"
|
class:bx--data-table--zebra="{zebra}"
|
||||||
class:bx--data-table--static="{useStaticWidth}"
|
class:bx--data-table--static="{useStaticWidth}"
|
||||||
class:bx--data-table--sticky-header="{stickyHeader}"
|
class:bx--data-table--sticky-header="{stickyHeader}"
|
||||||
|
class:bx--data-table--visible-overflow-menu="{true}"
|
||||||
style="{tableStyle}"
|
style="{tableStyle}"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
@ -44,14 +46,16 @@
|
||||||
{:else}
|
{:else}
|
||||||
<table
|
<table
|
||||||
class:bx--data-table="{true}"
|
class:bx--data-table="{true}"
|
||||||
class:bx--data-table--compact="{size === 'compact'}"
|
class:bx--data-table--xs="{size === 'xs'}"
|
||||||
class:bx--data-table--short="{size === 'short'}"
|
class:bx--data-table--sm="{size === 'sm'}"
|
||||||
class:bx--data-table--tall="{size === 'tall'}"
|
class:bx--data-table--md="{size === 'md'}"
|
||||||
class:bx--data-table--md="{size === 'medium'}"
|
class:bx--data-table--lg="{size === 'lg'}"
|
||||||
|
class:bx--data-table--xl="{size === 'xl'}"
|
||||||
class:bx--data-table--sort="{sortable}"
|
class:bx--data-table--sort="{sortable}"
|
||||||
class:bx--data-table--zebra="{zebra}"
|
class:bx--data-table--zebra="{zebra}"
|
||||||
class:bx--data-table--static="{useStaticWidth}"
|
class:bx--data-table--static="{useStaticWidth}"
|
||||||
class:bx--data-table--sticky-header="{stickyHeader}"
|
class:bx--data-table--sticky-header="{stickyHeader}"
|
||||||
|
class:bx--data-table--visible-overflow-menu="{true}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
style="{tableStyle}"
|
style="{tableStyle}"
|
||||||
>
|
>
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
bind:this="{ref}"
|
bind:this="{ref}"
|
||||||
aria-label="data table toolbar"
|
aria-label="data table toolbar"
|
||||||
class:bx--table-toolbar="{true}"
|
class:bx--table-toolbar="{true}"
|
||||||
class:bx--table-toolbar--small="{size === 'sm'}"
|
class:bx--table-toolbar--sm="{size === 'sm'}"
|
||||||
class:bx--table-toolbar--normal="{size === 'default'}"
|
|
||||||
style:z-index="{1}"
|
style:z-index="{1}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
>
|
>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
bind:menuRef
|
bind:menuRef
|
||||||
icon="{Settings}"
|
icon="{Settings}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class="bx--toolbar-action bx--overflow-menu {$$restProps.class}"
|
class="bx--toolbar-action bx--overflow-menu bx--btn bx--btn--primary {$$restProps.class}"
|
||||||
flipped
|
flipped
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
@ -99,6 +99,7 @@
|
||||||
disabled="{disabled}"
|
disabled="{disabled}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
searchClass="{classes} {$$restProps.class}"
|
searchClass="{classes} {$$restProps.class}"
|
||||||
|
size="lg"
|
||||||
bind:ref
|
bind:ref
|
||||||
bind:value
|
bind:value
|
||||||
on:clear
|
on:clear
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
</DataTable>
|
</DataTable>
|
||||||
|
|
||||||
<DataTable
|
<DataTable
|
||||||
size="short"
|
size="sm"
|
||||||
title="Load balancers"
|
title="Load balancers"
|
||||||
description="Your organization's active load balancers."
|
description="Your organization's active load balancers."
|
||||||
headers="{headers}"
|
headers="{headers}"
|
||||||
|
@ -160,11 +160,13 @@
|
||||||
|
|
||||||
<DataTable zebra headers="{headers}" rows="{rows}" />
|
<DataTable zebra headers="{headers}" rows="{rows}" />
|
||||||
|
|
||||||
<DataTable size="tall" headers="{headers}" rows="{rows}" />
|
<DataTable size="xl" headers="{headers}" rows="{rows}" />
|
||||||
|
|
||||||
<DataTable size="short" headers="{headers}" rows="{rows}" />
|
<DataTable size="md" headers="{headers}" rows="{rows}" />
|
||||||
|
|
||||||
<DataTable size="compact" headers="{headers}" rows="{rows}" />
|
<DataTable size="sm" headers="{headers}" rows="{rows}" />
|
||||||
|
|
||||||
|
<DataTable size="xs" headers="{headers}" rows="{rows}" />
|
||||||
|
|
||||||
<DataTable sortable headers="{headers}" rows="{rows}" />
|
<DataTable sortable headers="{headers}" rows="{rows}" />
|
||||||
|
|
||||||
|
@ -279,8 +281,10 @@
|
||||||
|
|
||||||
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" />
|
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" />
|
||||||
|
|
||||||
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" size="tall" />
|
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" size="xl" />
|
||||||
|
|
||||||
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" size="short" />
|
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" size="md" />
|
||||||
|
|
||||||
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" size="compact" />
|
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" size="sm" />
|
||||||
|
|
||||||
|
<DataTableSkeleton showHeader="{false}" showToolbar="{false}" size="xs" />
|
||||||
|
|
4
types/DataTable/DataTable.svelte.d.ts
vendored
4
types/DataTable/DataTable.svelte.d.ts
vendored
|
@ -58,9 +58,9 @@ export interface DataTableProps extends RestProps {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size of the data table
|
* Set the size of the data table
|
||||||
* @default undefined
|
* @default "lg"
|
||||||
*/
|
*/
|
||||||
size?: "compact" | "short" | "medium" | "tall";
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the title of the data table
|
* Specify the title of the data table
|
||||||
|
|
|
@ -21,9 +21,9 @@ export interface DataTableSkeletonProps extends DataTableHeader, RestProps {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size of the data table
|
* Set the size of the data table
|
||||||
* @default undefined
|
* @default "lg"
|
||||||
*/
|
*/
|
||||||
size?: "compact" | "short" | "tall";
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to apply zebra styles to the datatable rows
|
* Set to `true` to apply zebra styles to the datatable rows
|
||||||
|
|
4
types/DataTable/Table.svelte.d.ts
vendored
4
types/DataTable/Table.svelte.d.ts
vendored
|
@ -6,9 +6,9 @@ type RestProps = SvelteHTMLElements["section"];
|
||||||
export interface TableProps extends RestProps {
|
export interface TableProps extends RestProps {
|
||||||
/**
|
/**
|
||||||
* Set the size of the table
|
* Set the size of the table
|
||||||
* @default undefined
|
* @default "lg"
|
||||||
*/
|
*/
|
||||||
size?: "compact" | "short" | "medium" | "tall";
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to use zebra styles
|
* Set to `true` to use zebra styles
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue