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