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

@ -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'}"