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

View file

@ -0,0 +1,43 @@
<script>
/**
* Specify whether the checkbox is checked
* @type {boolean} [checked=false]
*/
export let checked = false;
/**
* Specify whether the checkbox is indeterminate
* @type {boolean} [indeterminate=false]
*/
export let indeterminate = false;
/**
* Specify the title attribute for the label element
* @type {string} [title]
*/
export let title = undefined;
/**
* Set an id for the input label
* @type {string} [id]
*/
export let id = "ccs-" + Math.random().toString(36);
</script>
<input
type="checkbox"
class:bx--checkbox="{true}"
checked="{indeterminate ? false : checked}"
indeterminate="{indeterminate}"
id="{id}"
{...$$restProps}
aria-label="{undefined}"
aria-checked="{indeterminate ? 'mixed' : checked}"
on:change
/>
<label
for="{id}"
title="{title}"
aria-label="{$$props['aria-label']}"
class:bx--checkbox-label="{true}"
></label>

View file

@ -1,2 +1,3 @@
export { default as Checkbox } from "./Checkbox.svelte";
export { default as CheckboxSkeleton } from "./Checkbox.Skeleton.svelte";
export { default as InlineCheckbox } from "./InlineCheckbox.svelte";