mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
refactor: update/fix JSDoc props
This commit is contained in:
parent
3c04f122b0
commit
d38e6d8be6
204 changed files with 992 additions and 2359 deletions
|
@ -1,51 +1,38 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to disable the list box field
|
||||
* @type {boolean} [disabled=false]
|
||||
* @typedef {"close" | "open"} ListBoxFieldTranslationId
|
||||
*/
|
||||
|
||||
/** Set to `true` to disable the list box field */
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Specify the role attribute
|
||||
* @type {string} [role="combobox"]
|
||||
*/
|
||||
/** Specify the role attribute */
|
||||
export let role = "combobox";
|
||||
|
||||
/**
|
||||
* Specify the tabindex
|
||||
* @type {string} [tabindex="-1"]
|
||||
*/
|
||||
/** Specify the tabindex */
|
||||
export let tabindex = "-1";
|
||||
|
||||
/**
|
||||
* Default translation ids
|
||||
* @constant
|
||||
* @type {{ close: "close"; open: "open"; }}
|
||||
*/
|
||||
/** Default translation ids */
|
||||
export const translationIds = { close: "close", open: "open" };
|
||||
|
||||
/**
|
||||
* Override the default translation ids
|
||||
* @type {(id: ListBoxFieldTranslationId) => string} [translateWithId = (id) => string]
|
||||
* @type {(id: ListBoxFieldTranslationId) => string}
|
||||
*/
|
||||
export let translateWithId = (id) => defaultTranslations[id];
|
||||
|
||||
/**
|
||||
* Set an id for the top-level element
|
||||
* @type {string} [id]
|
||||
* @type {string}
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* Obtain a reference to the top-level HTML element
|
||||
* @type {null | HTMLElement} [ref=null]
|
||||
* @type {null | HTMLDivElement}
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
/**
|
||||
* @typedef {"close" | "open"} ListBoxFieldTranslationId
|
||||
*/
|
||||
|
||||
import { getContext } from "svelte";
|
||||
|
||||
const defaultTranslations = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue