feat(data-table): support radio, selectable variants with batch actions

This commit is contained in:
Eric Liu 2020-10-24 13:37:00 -07:00
commit f43b132088
15 changed files with 662 additions and 156 deletions

40
types/index.d.ts vendored
View file

@ -849,6 +849,31 @@ export class DataTable extends CarbonSvelteComponent {
*/
expandedRowIds?: string[];
/**
* Set to `true` for the radio selection variant
* @default false
*/
radio?: boolean;
/**
* Set to `true` for the selectable variant
* Automatically set to `true` if `radio` or `batchSelection` are `true`
* @default false
*/
selectable?: boolean;
/**
* Set to `true` to enable batch selection
* @default false
*/
batchSelection?: boolean;
/**
* Specify the row ids to be selected
* @default []
*/
selectedRowIds?: string[];
/**
* Set to `true` to enable a sticky header
* @default false
@ -5091,6 +5116,21 @@ export class Toolbar extends CarbonSvelteComponent {
$$slot_def: { default: {} };
}
export class ToolbarBatchActions extends CarbonSvelteComponent {
$$prop_def: {
/**
* Override the total items selected text
*/
formatTotalSelected?: (totalSelected: number) => string;
};
$$slot_def: { default: {} };
}
export class ToolbarContent extends CarbonSvelteComponent {
$$slot_def: { default: {} };
}
export class ToolbarSearch extends CarbonSvelteComponent {
$$prop_def: {
/**