import { h } from "@stencil/core";
export class DgaSlideoutMenu {
    constructor() {
        this.backgroundColor = 'gray';
        this.anchor = 'right';
        this.open = false;
        this.scrollbar = true;
    }
    // componentDidRender() {
    //     if (this.el.children.length > 0) {
    //         this.el.children
    //         .namedItem('DgaSlideoutMenuHeader')
    //         .setAttribute('slot', 'sideout-menu-header');
    //       this.el.children
    //         .namedItem('DgaSideoutMenuItems')
    //         .setAttribute('slot', 'sideout-menu-items');
    //       this.el.children
    //         .namedItem('DgaSideoutMenuActions')
    //         .setAttribute('slot', 'sideout-menu-actions');
    //     }
    //   }
    componentWillLoad() {
        this.el.childNodes.forEach(item => {
            const el = item;
            //   if(el.tagName === 'DGA-SECOND-NAV-HEADER-CONTENT' && this.hideContent === true) {
            //     el.style.display = 'none';
            //   }
            //   if(el.tagName === 'DGA-SECOND-NAV-HEADER-ACTIONS' && this.hideActions === true) {
            //     el.style.display = 'none';
            //   }
            if (el.tagName === 'DGA-SLIDEOUT-MENU-HEADER' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'slideout-menu-header');
                // Pass onClose to header component
                el.setAttribute('on-close', 'true');
                el.addEventListener('closeClick', () => {
                    if (this.onClose) {
                        this.onClose();
                    }
                });
            }
            if (el.tagName === 'DGA-SLIDEOUT-MENU-ITEMS' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'slideout-menu-items');
            }
            if (el.tagName === 'DGA-SLIDEOUT-MENU-ACTIONS' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'slideout-menu-actions');
            }
        });
    }
    disconnectedCallback() {
        // Clean up listeners
        this.el.childNodes.forEach(item => {
            const el = item;
            if (el.tagName === 'DGA-SLIDEOUT-MENU-HEADER') {
                el.removeEventListener('closeClick', this.onClose);
            }
        });
    }
    render() {
        return (h("div", { key: '60e3ca857793dd890e940c11269faf8b024dae32', class: `dga-slideout-menu dga-slideout-menu--${this.anchor} dga-slideout-menu--${this.backgroundColor} ${this.open ? "active" : ""}` }, h("slot", { key: '7cb960be56fb19777eb4b77e7afcd39b4d6f5635', name: "slideout-menu-header" }), h("div", { key: '727a0ebc4b157bbbd71851c15cf6e50db72b1fd5', class: "dga-slideout-menu__body" }, h("div", { key: '53c01b92f1c3c8a109794400f8e5e397cb4066a9', class: {
                'dga-slideout-menu__items': true,
                'dga-slideout-menu__items--hide-scrollbar': !this.scrollbar,
            } }, h("slot", { key: '6bd31139e04a3e46a91eef43ea640b2046a2ddf5', name: "slideout-menu-items" })), h("dga-divider", { key: '591a5aea5d52c0dc3c4754286faf3a0e2c84c527' }), h("slot", { key: 'ed3bab813386af2d428c165af6515f72f3755b4f', name: "slideout-menu-actions" }))));
    }
    static get is() { return "dga-slideout-menu"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-slideout-menu.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-slideout-menu.css"]
        };
    }
    static get properties() {
        return {
            "backgroundColor": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'gray' | 'white'",
                    "resolved": "\"gray\" | \"white\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "background-color",
                "reflect": false,
                "defaultValue": "'gray'"
            },
            "anchor": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'left'|'right'",
                    "resolved": "\"left\" | \"right\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "anchor",
                "reflect": false,
                "defaultValue": "'right'"
            },
            "open": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "open",
                "reflect": true,
                "defaultValue": "false"
            },
            "scrollbar": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "scrollbar",
                "reflect": false,
                "defaultValue": "true"
            },
            "onClose": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "() => void",
                    "resolved": "() => void",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            }
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=dga-slideout-menu.js.map
