'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-42b107ae.js');

const Dropdown = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    componentDidLoad() {
        this.materialsMenuEl.setPosition(this.menuPosition);
        if (this.buttonType)
            this.buttonEl[this.buttonType] = true;
    }
    componentWillUpdate() {
        if (this.buttonType)
            this.buttonEl[this.buttonType] = true;
    }
    async openMenu() {
        this.materialsMenuEl.open();
    }
    async closeMenu() {
        this.materialsMenuEl.close();
    }
    async isOpen() {
        return this.materialsMenuEl.isOpen();
    }
    renderIconHelper() {
        return this.iconHelper ? index.h("materials-icon", { style: { 'margin-left': '8px', 'margin-right': '-8px' }, name: this.iconHelper }) : '';
    }
    render() {
        return (index.h("div", null, this.iconOnly &&
            index.h("materials-icon-button", { onClick: () => this.openMenu(), icon: this.icon }), !this.iconOnly &&
            index.h("materials-button", { color: this.color, onClick: () => this.openMenu(), icon: this.icon, ref: el => this.buttonEl = el }, this.menuTitle, this.renderIconHelper()), index.h("materials-menu", { ref: el => this.materialsMenuEl = el }, index.h("slot", null))));
    }
    static get style() { return "materials-list-item > a{color:inherit;text-decoration:none;}materials-menu{white-space:nowrap;}"; }
};

exports.materials_dropdown = Dropdown;
