1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Lexical: Integrated diagram manager, added menu split button

This commit is contained in:
Dan Brown
2024-08-17 10:48:34 +01:00
parent ad6b26ba97
commit 0039f893cc
8 changed files with 103 additions and 9 deletions

View File

@ -0,0 +1,31 @@
import {EditorContainerUiElement, EditorUiElement} from "../core";
import {el} from "../../../utils/dom";
import {EditorButton} from "../buttons";
import {EditorDropdownButton} from "./dropdown-button";
import caretDownIcon from "@icons/caret-down-large.svg";
export class EditorButtonWithMenu extends EditorContainerUiElement {
protected button: EditorButton;
protected dropdownButton: EditorDropdownButton;
constructor(button: EditorButton, menuItems: EditorUiElement[]) {
super([button]);
this.button = button;
this.dropdownButton = new EditorDropdownButton({
button: {label: 'Menu', icon: caretDownIcon},
showOnHover: false,
direction: 'vertical',
}, menuItems);
this.addChildren(this.dropdownButton);
}
buildDOM(): HTMLElement {
return el('div', {
class: 'editor-button-with-menu-container',
}, [
this.button.getDOMElement(),
this.dropdownButton.getDOMElement()
]);
}
}