export class RouterMenu {
    componentDidLoad() {
        this.postRender();
    }
    componentDidUpdate() {
        this.postRender();
    }
    postRender() {
        this.change.emit({ data: this.getData(), el: this.el });
    }
    setData(data, extend = false) {
        if (!this.data)
            this.data = {};
        if (extend) {
            Object.keys(data).forEach((k) => {
                this.data[k] = data[k];
            });
            return;
        }
        this.data = data;
    }
    getData() {
        return this.data;
    }
    render() {
        if (this.dataJson) {
            this.data = JSON.parse(this.dataJson);
        }
        return (h("div", null, "ema-router-menu"));
    }
    static get is() { return "ema-router-menu"; }
    static get properties() { return {
        "data": {
            "state": true
        },
        "dataJson": {
            "type": String,
            "attr": "data-json"
        },
        "el": {
            "elementRef": true
        },
        "getData": {
            "method": true
        },
        "setData": {
            "method": true
        },
        "state": {
            "state": true
        }
    }; }
    static get events() { return [{
            "name": "change",
            "method": "change",
            "bubbles": true,
            "cancelable": true,
            "composed": true
        }]; }
}
