mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +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
|
@ -4,9 +4,26 @@
|
|||
* @type {"sm" | "default"} [size="default"]
|
||||
*/
|
||||
export let size = "default";
|
||||
|
||||
import { setContext } from "svelte";
|
||||
|
||||
let ref = null;
|
||||
|
||||
setContext("Toolbar", {
|
||||
setOverflow: (toggled) => {
|
||||
if (ref) {
|
||||
if (toggled) {
|
||||
ref.style.overflow = "visible";
|
||||
} else {
|
||||
ref.removeAttribute("style");
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<section
|
||||
bind:this="{ref}"
|
||||
aria-label="data table toolbar"
|
||||
class:bx--table-toolbar="{true}"
|
||||
class:bx--table-toolbar--small="{size === 'sm'}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue