feat(data-table): add ToolbarMenu

Requires menuRef from OverflowMenu to be exported.
This commit is contained in:
Eric Liu 2020-10-26 07:43:54 -07:00
commit c39427670a
10 changed files with 305 additions and 72 deletions

View file

@ -106,12 +106,12 @@
* @type {null | HTMLInputElement} [ref=null]
*/
export let ref = null;
/**
* Obtain a reference to the list HTML element
* @type {null | HTMLDivElement} [ref=null]
*/
export let listRef = null
/**
* Obtain a reference to the list HTML element
* @type {null | HTMLDivElement} [ref=null]
*/
export let listRef = null;
/**
* @typedef {{ id: string; text: string; }} ComboBoxItem
@ -290,7 +290,12 @@
/>
</ListBoxField>
{#if open}
<ListBoxMenu aria-label="{ariaLabel}" id="{id}" on:scroll bind:ref={listRef}>
<ListBoxMenu
aria-label="{ariaLabel}"
id="{id}"
on:scroll
bind:ref="{listRef}"
>
{#each filteredItems as item, i (item.id)}
<ListBoxMenuItem
id="{item.id}"