mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +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,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";
|
||||
|
|
|
@ -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];
|
||||
|
||||
/**
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue