mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(data-table): support radio, selectable variants with batch actions
This commit is contained in:
parent
611d72bcf3
commit
f43b132088
15 changed files with 662 additions and 156 deletions
43
src/Checkbox/InlineCheckbox.svelte
Normal file
43
src/Checkbox/InlineCheckbox.svelte
Normal 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>
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue