mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore: add more prop annotations
This commit is contained in:
parent
8c1ffd4cb0
commit
773b18d314
75 changed files with 877 additions and 137 deletions
|
@ -1,14 +1,68 @@
|
|||
<script>
|
||||
export let skeleton = false;
|
||||
export let indeterminate = false;
|
||||
export let readonly = false;
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Set to `true` to display the skeleton state
|
||||
* @type {boolean} [skeleton=false]
|
||||
*/
|
||||
export let skeleton = false;
|
||||
|
||||
/**
|
||||
* Set to `true` for the checkbox to be read-only
|
||||
* @type {boolean} [readonly=false]
|
||||
*/
|
||||
export let readonly = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the checkbox
|
||||
* @type {boolean} [disabled=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Define the label text
|
||||
* @type {string} [labelText=""]
|
||||
*/
|
||||
export let labelText = "";
|
||||
|
||||
/**
|
||||
* Set to `true` to visually hide the label text
|
||||
* @type {boolean} [hideLabel=false]
|
||||
*/
|
||||
export let hideLabel = false;
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* Set a name for the input element
|
||||
* @type {string} [name=""]
|
||||
*/
|
||||
export let name = "";
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* Obtain a reference to the input HTML element
|
||||
* @type {null | HTMLElement} [ref=null]
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
import { createEventDispatcher } from "svelte";
|
||||
|
@ -49,7 +103,7 @@
|
|||
on:change={() => {
|
||||
checked = !checked;
|
||||
}} />
|
||||
<label class:bx--checkbox-label={true} for={id} {title}>
|
||||
<label for={id} {title} class:bx--checkbox-label={true}>
|
||||
<span
|
||||
class:bx--checkbox-label-text={true}
|
||||
class:bx--visually-hidden={hideLabel}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue