mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(data-table): add ToolbarMenu
Requires menuRef from OverflowMenu to be exported.
This commit is contained in:
parent
0e9f600672
commit
c39427670a
10 changed files with 305 additions and 72 deletions
|
@ -53,6 +53,18 @@
|
|||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* Obtain a reference to the trigger button element
|
||||
* @type {null | HTMLButtonElement} [ref=null]
|
||||
*/
|
||||
export let buttonRef = null;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the overflow menu element
|
||||
* @type {null | HTMLUListElement} [ref=null]
|
||||
*/
|
||||
export let menuRef = null;
|
||||
|
||||
import { createEventDispatcher, setContext, afterUpdate } from "svelte";
|
||||
import { writable } from "svelte/store";
|
||||
import OverflowMenuVertical16 from "carbon-icons-svelte/lib/OverflowMenuVertical16";
|
||||
|
@ -64,10 +76,8 @@
|
|||
const focusedId = writable(undefined);
|
||||
const currentIndex = writable(-1);
|
||||
|
||||
$: buttonRef = undefined;
|
||||
$: buttonWidth = undefined;
|
||||
$: menuRef = undefined;
|
||||
$: didOpen = false;
|
||||
let buttonWidth = undefined;
|
||||
let didOpen = false;
|
||||
|
||||
setContext("OverflowMenu", {
|
||||
focusedId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue