mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore: complete first pass of apply jsdoc annotations to component props
This commit is contained in:
parent
566a281d81
commit
f30755b237
97 changed files with 2327 additions and 259 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue