mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore: add more type docs
This commit is contained in:
parent
773b18d314
commit
c3f924c25a
45 changed files with 517 additions and 50 deletions
|
@ -11,6 +11,10 @@
|
|||
*/
|
||||
export let type = "default";
|
||||
|
||||
/**
|
||||
* Set to `true` to open the list box
|
||||
* @type {boolean} [open=false]
|
||||
*/
|
||||
export let open = false;
|
||||
|
||||
/**
|
||||
|
@ -18,8 +22,23 @@
|
|||
* @type {boolean} [light=false]
|
||||
*/
|
||||
export let light = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the list box
|
||||
* @type {boolean} [disable=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
* @type {boolean} [invalid=false]
|
||||
*/
|
||||
export let invalid = false;
|
||||
|
||||
/**
|
||||
* Specify the invalid state text
|
||||
* @type {string} [invalidText=""]
|
||||
*/
|
||||
export let invalidText = "";
|
||||
</script>
|
||||
|
||||
|
|
|
@ -10,6 +10,11 @@
|
|||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* Obtain a reference to the top-level HTML element
|
||||
* @type {null | HTMLElement} [ref=null]
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
import { getContext } from "svelte";
|
||||
|
|
|
@ -4,13 +4,11 @@
|
|||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
$: menuId = `menu-${id}`;
|
||||
</script>
|
||||
|
||||
<div
|
||||
role="listbox"
|
||||
id={menuId}
|
||||
id="menu-{id}"
|
||||
class:bx--list-box__menu={true}
|
||||
{...$$restProps}>
|
||||
<slot />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue