chore: complete first pass of apply jsdoc annotations to component props

This commit is contained in:
Eric Liu 2020-07-26 17:42:12 -07:00
commit f30755b237
97 changed files with 2327 additions and 259 deletions

View file

@ -1,14 +1,28 @@
<script>
/**
* Specify the value of the radio button
* @type {string} [value=""]
*/
export let value = "";
/**
* Set to `true` to check the radio button
* @type {boolean} [checked=false]
*/
export let checked = false;
/**
* Set to `true` to disable the radio button
* @type {boolean} [disabled=false]
*/
export let disabled = false;
/**
* Set an id for the input element
* @type {string} [id]
* Specify the label position
* @type {"right" | "left"} [labelPosition="right"]
*/
export let id = "ccs-" + Math.random().toString(36);
export let labelPosition = "right"; // "left" | "right"
export let labelPosition = "right";
/**
* Specify the label text
* @type {string} [labelText=""]
@ -20,8 +34,25 @@
* @type {boolean} [hideLabel=false]
*/
export let hideLabel = false;
/**
* Set an id for the input element
* @type {string} [id]
*/
export let id = "ccs-" + Math.random().toString(36);
/**
* Specify a name attribute for the checkbox input
* @type {string} [name=""]
*/
export let name = "";
/**
* Obtain a reference to the input HTML element
* @type {null | HTMLInputElement} [ref=null]
*/
export let ref = null;
import { getContext } from "svelte";
import { writable } from "svelte/store";
@ -42,6 +73,7 @@
class:bx--radio-button-wrapper--label-left={labelPosition === 'left'}
{...$$restProps}>
<input
bind:this={ref}
type="radio"
{id}
{name}