Working on bootstrap menu components.

This commit is contained in:
2020-09-18 17:02:02 -07:00
parent 653bacb2c0
commit d4568c1e62
3 changed files with 46 additions and 5 deletions

View File

@ -6,12 +6,34 @@ class DropdownMenu extends IgniteElement {
super();
}
get properties() {
return {
button: null,
buttonClass: "btn btn-simple",
placement: "right",
minWidth: null
};
}
get styles() {
return `
.btn-simple {
border: none;
background-color: transparent;
}
`;
}
render() {
return this.template.child(
new button().class("dropdown-toggle").attribute("data-toggle", "dropdown").child("menu click"),
new ul().class("dropdown-menu").child(
new slot(this)
)
new button().class(this.buttonClass).data("toggle", "dropdown").child(this.button),
new ul()
.class("dropdown-menu")
.class(this.placement, (value) => { return `dropdown-menu-${value}`; })
.style("min-width", this.minWidth, "important", (value) => { return value ? value : "unset"; })
.child(
new slot(this)
)
);
}
}