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,12 +1,12 @@
<script>
/**
* Set the size of list box
* Set the size of the list box
* @type {"sm" | "xl"} [size]
*/
export let size = undefined;
/**
* Set the type of list box
* Set the type of the list box
* @type {"default" | "inline"} [type="default"]
*/
export let type = "default";

View file

@ -1,8 +1,37 @@
<script>
/**
* Set to `true` to disable the list box field
* @type {boolean} [disabled=false]
*/
export let disabled = false;
/**
* Specify the role attribute
* @type {string} [role="combobox"]
*/
export let role = "combobox";
/**
* Specify the tabindex
* @type {string} [tabindex="-1"]
*/
export let tabindex = "-1";
/**
* @typedef {"close" | "open"} ListBoxFieldTranslationId
*/
/**
* Default translation ids
* @constant
* @type {{ close: "close"; open: "open"; }}
*/
export const translationIds = { close: "close", open: "open" };
/**
* Override the default translation ids
* @type {(id: ListBoxFieldTranslationId) => string;} [translateWithId = (id) => string;]
*/
export let translateWithId = (id) => defaultTranslations[id];
/**

View file

@ -1,13 +1,32 @@
<script>
export const translationIds = { close: "close", open: "open" };
/**
* Set to `true` to open the list box menu icon
* @type {boolean} [open=false]
*/
export let open = false;
export let translateWithId = id => defaultTranslations[id];
/**
* Default translation ids
* @constant
* @type {{ close: "close"; open: "open" }}
*/
export const translationIds = { close: "close", open: "open" };
/**
* @typedef {"close" | "open"} ListBoxMenuIconTranslationId
*/
/**
* Override the default translation ids
* @type {(id: ListBoxMenuIconTranslationId) => string;} [translateWithId = (id) => string;]
*/
export let translateWithId = (id) => defaultTranslations[id];
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16";
const defaultTranslations = {
[translationIds.close]: "Close menu",
[translationIds.open]: "Open menu"
[translationIds.open]: "Open menu",
};
$: description = open ? translateWithId("close") : translateWithId("open");

View file

@ -1,5 +1,14 @@
<script>
/**
* Set to `true` to enable the active state
* @type {boolean} [active=false]
*/
export let active = false;
/**
* Set to `true` to enable the highlighted state
* @type {boolean} [highlighted=false]
*/
export let highlighted = false;
</script>

View file

@ -1,10 +1,34 @@
<script>
/**
* Specify the number of selected items
* @type {*} [selectionCount]
*/
export let selectionCount = undefined;
/**
* Set to `true` to disable the list box selection
* @type {boolean} [disabled=false]
*/
export let disabled = false;
/**
* @typedef {"clearAll" | "clearSelection"} ListBoxSelectionTranslationId
*/
/**
* Default translation ids
* @constant
* @type {{ clearAll: "clearAll"; clearSelection: "clearSelection" }}
*/
export const translationIds = {
clearAll: "clearAll",
clearSelection: "clearSelection",
};
export let disabled = false;
export let selectionCount = undefined;
/**
* Override the default translation ids
* @type {(id: ListBoxSelectionTranslationId) => string;} [translateWithId = (id) => string;]
*/
export let translateWithId = (id) => defaultTranslations[id];
/**