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,12 +1,67 @@
|
|||
<script>
|
||||
/**
|
||||
* @typedef {{ id: string; text: string; }} ComboBoxItem
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the combobox items
|
||||
* @type {ComboBoxItem[]} [items=[]]
|
||||
*/
|
||||
export let items = [];
|
||||
|
||||
/**
|
||||
* Override the display of a combobox item
|
||||
* @type {(item: ComboBoxItem) => string;} [itemToString = (item: ComboBoxItem) => string;]
|
||||
*/
|
||||
export let itemToString = (item) => item.text || item.id;
|
||||
|
||||
/**
|
||||
* Set the selected item by value index
|
||||
* @type {number} [selectedIndex=-1]
|
||||
*/
|
||||
export let selectedIndex = -1;
|
||||
|
||||
/**
|
||||
* Specify the selected combobox value
|
||||
* @type {string} [value=""]
|
||||
*/
|
||||
export let value = "";
|
||||
|
||||
/**
|
||||
* Set the size of the combobox
|
||||
* @type {"sm" | "xl"} [size]
|
||||
*/
|
||||
export let size = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the combobox
|
||||
* @type {boolean} [disabled=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Specify the title text of the combobox
|
||||
* @type {string} [titleText=""]
|
||||
*/
|
||||
export let titleText = "";
|
||||
|
||||
/**
|
||||
* Specify the placeholder text
|
||||
* @type {string} [placeholder=""]
|
||||
*/
|
||||
export let placeholder = "";
|
||||
|
||||
/**
|
||||
* Specify the helper text
|
||||
* @type {string} [helperText=""]
|
||||
*/
|
||||
export let helperText = "";
|
||||
|
||||
/**
|
||||
* Set an id for the list box component
|
||||
* @type {string} [id]
|
||||
* Specify the invalid state text
|
||||
* @type {string} [invalidText=""]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
export let invalidText = "";
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
|
@ -15,23 +70,45 @@
|
|||
export let invalid = false;
|
||||
|
||||
/**
|
||||
* Specify the invalid state text
|
||||
* @type {string} [invalidText=""]
|
||||
* Set to `true` to enable the light variant
|
||||
* @type {boolean} [light=false]
|
||||
*/
|
||||
export let invalidText = "";
|
||||
|
||||
export let items = [];
|
||||
export let itemToString = (item) => item.text || item.id;
|
||||
export let light = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to open the combobox menu dropdown
|
||||
* @type {boolean} [open=false]
|
||||
*/
|
||||
export let open = false;
|
||||
export let placeholder = "";
|
||||
export let selectedIndex = -1;
|
||||
|
||||
/**
|
||||
* Determine if an item should be filtered given the current combobox value
|
||||
* @type {(item: ComboBoxItem, value: string) => boolean} [shouldFilterItem=() => true]
|
||||
*/
|
||||
export let shouldFilterItem = () => true;
|
||||
export let size = undefined;
|
||||
export let titleText = "";
|
||||
|
||||
/**
|
||||
* Override the default translation ids
|
||||
* @type {(id: any) => string;} [translateWithId]
|
||||
*/
|
||||
export let translateWithId = undefined;
|
||||
export let value = "";
|
||||
|
||||
/**
|
||||
* Set an id for the list box component
|
||||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* Specify a name attribute for the input
|
||||
* @type {string} [name]
|
||||
*/
|
||||
export let name = undefined;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the input HTML element
|
||||
* @type {null | HTMLInputElement} [ref=null]
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
import { afterUpdate } from "svelte";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue