diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 0fe94caf..7bb499c9 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -658,7 +658,7 @@ export interface ComboBoxItem { | Prop name | Kind | Reactive | Type | Default value | Description | | :--------------- | :-------------------- | :------- | :---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| listRef | let | Yes | null | HTMLDivElement | null | Obtain a reference to the list HTML element | +| listRef | let | Yes | HTMLDivElement | null | Obtain a reference to the list HTML element | | ref | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | | open | let | Yes | boolean | false | Set to `true` to open the combobox menu dropdown | | value | let | Yes | string | "" | Specify the selected combobox value | @@ -781,13 +781,13 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :-------- | :--------------- | :------- | :-------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| ref | let | Yes | null | HTMLUListElement | null | Obtain a reference to the unordered list HTML element | -| y | let | Yes | number | 0 | Specify the vertical offset of the menu position | -| x | let | Yes | number | 0 | Specify the horizontal offset of the menu position | -| open | let | Yes | boolean | false | Set to `true` to open the menu
Either `x` and `y` must be greater than zero | -| target | let | No | null | HTMLElement | HTMLElement[] | null | Specify an element or list of elements to trigger the context menu.
If no element is specified, the context menu applies to the entire window | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :-------- | :--------------- | :------- | :-------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| ref | let | Yes | null | HTMLUListElement | null | Obtain a reference to the unordered list HTML element | +| y | let | Yes | number | 0 | Specify the vertical offset of the menu position | +| x | let | Yes | number | 0 | Specify the horizontal offset of the menu position | +| open | let | Yes | boolean | false | Set to `true` to open the menu
Either `x` and `y` must be greater than zero | +| target | let | No | HTMLElement | HTMLElement[] | null | Specify an element or list of elements to trigger the context menu.
If no element is specified, the context menu applies to the entire window | ### Slots @@ -2413,8 +2413,8 @@ export interface MultiSelectItem { | Prop name | Kind | Reactive | Type | Default value | Description | | :---------------- | :--------------- | :------- | :--------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- | -| selectionRef | let | Yes | null | HTMLDivElement | null | Obtain a reference to the selection element | -| fieldRef | let | Yes | null | HTMLDivElement | null | Obtain a reference to the field box element | +| selectionRef | let | Yes | HTMLDivElement | null | Obtain a reference to the selection element | +| fieldRef | let | Yes | HTMLDivElement | null | Obtain a reference to the field box element | | multiSelectRef | let | Yes | null | HTMLDivElement | null | Obtain a reference to the outer div element | | inputRef | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | | open | let | Yes | boolean | false | Set to `true` to open the dropdown | @@ -4612,14 +4612,14 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :--------- | :--------------- | :------- | :---------------------------------------- | ------------------ | --------------------------------------------- | -| ref | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | -| expanded | let | Yes | boolean | false | Set to `true` to expand the search bar | -| value | let | Yes | number | string | "" | Specify the value of the search input | -| persistent | let | No | boolean | false | Set to `true` to keep the search bar expanded | -| disabled | let | No | boolean | false | Set to `true` to disable the search bar | -| tabindex | let | No | string | "0" | Specify the tabindex | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :--------- | :--------------- | :------- | :-------------------------------- | ------------------ | --------------------------------------------- | +| ref | let | Yes | HTMLInputElement | null | Obtain a reference to the input HTML element | +| expanded | let | Yes | boolean | false | Set to `true` to expand the search bar | +| value | let | Yes | number | string | "" | Specify the value of the search input | +| persistent | let | No | boolean | false | Set to `true` to keep the search bar expanded | +| disabled | let | No | boolean | false | Set to `true` to disable the search bar | +| tabindex | let | No | string | "0" | Specify the tabindex | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 35b84000..c9527b8c 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -1604,7 +1604,7 @@ "name": "listRef", "kind": "let", "description": "Obtain a reference to the list HTML element", - "type": "null | HTMLDivElement", + "type": "HTMLDivElement", "value": "null", "isFunction": false, "isFunctionDeclaration": false, @@ -1824,7 +1824,7 @@ "name": "target", "kind": "let", "description": "Specify an element or list of elements to trigger the context menu.\nIf no element is specified, the context menu applies to the entire window", - "type": "null | HTMLElement | HTMLElement[]", + "type": "HTMLElement | HTMLElement[]", "value": "null", "isFunction": false, "isFunctionDeclaration": false, @@ -6700,7 +6700,7 @@ "name": "fieldRef", "kind": "let", "description": "Obtain a reference to the field box element", - "type": "null | HTMLDivElement", + "type": "HTMLDivElement", "value": "null", "isFunction": false, "isFunctionDeclaration": false, @@ -6711,7 +6711,7 @@ "name": "selectionRef", "kind": "let", "description": "Obtain a reference to the selection element", - "type": "null | HTMLDivElement", + "type": "HTMLDivElement", "value": "null", "isFunction": false, "isFunctionDeclaration": false, @@ -12806,7 +12806,7 @@ "name": "ref", "kind": "let", "description": "Obtain a reference to the input HTML element", - "type": "null | HTMLInputElement", + "type": "HTMLInputElement", "value": "null", "isFunction": false, "isFunctionDeclaration": false, diff --git a/src/ComboBox/ComboBox.svelte b/src/ComboBox/ComboBox.svelte index 1a02c276..2486a72e 100644 --- a/src/ComboBox/ComboBox.svelte +++ b/src/ComboBox/ComboBox.svelte @@ -90,7 +90,7 @@ /** * Obtain a reference to the list HTML element - * @type {null | HTMLDivElement} + * @type {HTMLDivElement} */ export let listRef = null; diff --git a/src/ContextMenu/ContextMenu.svelte b/src/ContextMenu/ContextMenu.svelte index c1490844..9397688e 100644 --- a/src/ContextMenu/ContextMenu.svelte +++ b/src/ContextMenu/ContextMenu.svelte @@ -6,7 +6,7 @@ /** * Specify an element or list of elements to trigger the context menu. * If no element is specified, the context menu applies to the entire window - * @type {null | HTMLElement | HTMLElement[]} + * @type {HTMLElement | HTMLElement[]} */ export let target = null; diff --git a/src/DataTable/ToolbarSearch.svelte b/src/DataTable/ToolbarSearch.svelte index 21c0c256..f527cbee 100644 --- a/src/DataTable/ToolbarSearch.svelte +++ b/src/DataTable/ToolbarSearch.svelte @@ -21,7 +21,7 @@ /** * Obtain a reference to the input HTML element - * @type {null | HTMLInputElement} + * @type {HTMLInputElement} */ export let ref = null; diff --git a/src/MultiSelect/MultiSelect.svelte b/src/MultiSelect/MultiSelect.svelte index add3a9a1..1ef2ed70 100644 --- a/src/MultiSelect/MultiSelect.svelte +++ b/src/MultiSelect/MultiSelect.svelte @@ -136,13 +136,13 @@ /** * Obtain a reference to the field box element - * @type {null | HTMLDivElement} + * @type {HTMLDivElement} */ export let fieldRef = null; /** * Obtain a reference to the selection element - * @type {null | HTMLDivElement} + * @type {HTMLDivElement} */ export let selectionRef = null; diff --git a/src/TreeView/TreeViewNode.svelte b/src/TreeView/TreeViewNode.svelte index ffcd4ad1..79bfbeb8 100644 --- a/src/TreeView/TreeViewNode.svelte +++ b/src/TreeView/TreeViewNode.svelte @@ -22,7 +22,7 @@ /** * Finds the nearest parent tree node * @param {HTMLElement} node - * @returns {null | HTMLElement} + * @returns {HTMLElement} */ function findParentTreeNode(node) { if (node.classList.contains("bx--tree-parent-node")) return node; diff --git a/tests/ComboBox.test.svelte b/tests/ComboBox.test.svelte index 919a973b..9ee7eb9d 100644 --- a/tests/ComboBox.test.svelte +++ b/tests/ComboBox.test.svelte @@ -9,6 +9,7 @@ ]; let ref: ComboBox; + let listRef: HTMLDivElement = null; $: ref?.clear(); @@ -19,6 +20,7 @@ titleText="Contact" placeholder="Select contact method" items="{items}" + bind:listRef /> - +
+ +