refactor: update/fix JSDoc props

This commit is contained in:
Eric Liu 2020-11-04 06:04:25 -08:00
commit d38e6d8be6
204 changed files with 992 additions and 2359 deletions

View file

@ -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 = {