mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props
This commit is contained in:
parent
d38e6d8be6
commit
75d4b4cf03
219 changed files with 5168 additions and 5259 deletions
193
types/DataTable/DataTable.d.ts
vendored
193
types/DataTable/DataTable.d.ts
vendored
|
@ -11,106 +11,107 @@ interface Header {
|
|||
|
||||
type Headers = Header[];
|
||||
|
||||
export interface DataTableProps {
|
||||
/**
|
||||
* Specify the data table headers
|
||||
* @default []
|
||||
*/
|
||||
headers?: Headers;
|
||||
|
||||
/**
|
||||
* Specify the rows the data table should render
|
||||
* keys defined in `headers` are used for the row ids
|
||||
* @default []
|
||||
*/
|
||||
rows?: Object[];
|
||||
|
||||
/**
|
||||
* Set the size of the data table
|
||||
*/
|
||||
size?: "compact" | "short" | "tall";
|
||||
|
||||
/**
|
||||
* Specify the title of the data table
|
||||
* @default ""
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Specify the description of the data table
|
||||
* @default ""
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to use zebra styles
|
||||
* @default false
|
||||
*/
|
||||
zebra?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` for the sortable variant
|
||||
* @default false
|
||||
*/
|
||||
sortable?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` for the expandable variant
|
||||
* Automatically set to `true` if `batchExpansion` is `true`
|
||||
* @default false
|
||||
*/
|
||||
expandable?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable batch expansion
|
||||
* @default false
|
||||
*/
|
||||
batchExpansion?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the row ids to be expanded
|
||||
* @default []
|
||||
*/
|
||||
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
|
||||
*/
|
||||
stickyHeader?: boolean;
|
||||
}
|
||||
|
||||
export default class DataTable {
|
||||
$$prop_def: {
|
||||
/**
|
||||
* Specify the data table headers
|
||||
* @default []
|
||||
*/
|
||||
headers?: Headers;
|
||||
|
||||
/**
|
||||
* Specify the rows the data table should render
|
||||
* keys defined in `headers` are used for the row ids
|
||||
* @default []
|
||||
*/
|
||||
rows?: Object[];
|
||||
|
||||
/**
|
||||
* Set the size of the data table
|
||||
*/
|
||||
size?: "compact" | "short" | "tall";
|
||||
|
||||
/**
|
||||
* Specify the title of the data table
|
||||
* @default ""
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Specify the description of the data table
|
||||
* @default ""
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to use zebra styles
|
||||
* @default false
|
||||
*/
|
||||
zebra?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` for the sortable variant
|
||||
* @default false
|
||||
*/
|
||||
sortable?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` for the expandable variant
|
||||
* Automatically set to `true` if `batchExpansion` is `true`
|
||||
* @default false
|
||||
*/
|
||||
expandable?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable batch expansion
|
||||
* @default false
|
||||
*/
|
||||
batchExpansion?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the row ids to be expanded
|
||||
* @default []
|
||||
*/
|
||||
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
|
||||
*/
|
||||
stickyHeader?: boolean;
|
||||
};
|
||||
|
||||
$$prop_def: DataTableProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
["expanded-row"]: { row: Object };
|
||||
["cell-header"]: { header: Header };
|
||||
cell: { row: Object; cell: Object };
|
||||
["cell-header"]: { header: Header };
|
||||
["expanded-row"]: { row: Object };
|
||||
};
|
||||
|
||||
$on(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue