Working on bootstrap menu components.
This commit is contained in:
@ -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)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user