UNPKG

v4web-components

Version:
160 lines (159 loc) 5.15 kB
import { h } from '@stencil/core'; export class LabDsNavbar { constructor() { this.collapsed = true; this.menus = undefined; this.user = undefined; this.logo = undefined; this.currentHost = window.location; this.activeUrl = window.location.href; this.activeProductsV4 = undefined; this.activeRedeV4 = undefined; this.openProductsV4 = false; this.openRedeV4 = false; } render() { var _a, _b; let openIconProductsV4 = this.openProductsV4 ? 'expand_less' : 'expand_more'; let openIconRedeV4 = this.openRedeV4 ? 'expand_less' : 'expand_more'; return (h("div", { class: `v4-navbar notranslate` }, h("nav", null, h("ul", null, h("li", { class: `${this.activeProductsV4 ? 'active' : ''} ${this.openProductsV4 ? 'open' : ''} menu-item` }, h("a", { onClick: () => { this.openProductsV4 = !this.openProductsV4; this.openRedeV4 = false; } }, h("div", { class: "menu-option" }, h("lab-ds-icon-not-selectable", { icon: "lightbulb", size: "s-medium" }), ' ', h("span", { class: "title-menu" }, "Produtos V4 ", h("lab-ds-icon-not-selectable", { icon: openIconProductsV4, size: "small" })))), h("ul", { class: "submenu" }, h("slot", { name: "products-v4" }))), h("li", { class: `${this.activeRedeV4 ? 'active' : ''} ${this.openRedeV4 ? 'open' : ''} menu-item` }, h("a", { onClick: () => { this.openRedeV4 = !this.openRedeV4; this.openProductsV4 = false; } }, h("div", { class: "menu-option" }, h("lab-ds-icon-not-selectable", { icon: "share", size: "s-medium" }), ' ', h("span", { class: "title-menu" }, "Rede V4 ", h("lab-ds-icon-not-selectable", { icon: openIconRedeV4, size: "small" })))), h("ul", { class: "submenu" }, h("slot", { name: "rede-v4" }))))), h("div", { class: "footer" }, h("div", { class: "user-data" }, h("span", null, (_a = this.user) === null || _a === void 0 ? void 0 : _a.name), h("span", null, (_b = this.user) === null || _b === void 0 ? void 0 : _b.unitName)), h("img", { width: 20, src: this.logo, alt: "Logo da V4" })))); } static get is() { return "lab-ds-navbar"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["lab-ds-navbar.css"] }; } static get styleUrls() { return { "$": ["lab-ds-navbar.css"] }; } static get properties() { return { "menus": { "type": "unknown", "mutable": false, "complexType": { "original": "Array<INavbarItem>", "resolved": "INavbarItem[]", "references": { "Array": { "location": "global" }, "INavbarItem": { "location": "import", "path": "./menu-item/navbar-item" } } }, "required": false, "optional": false, "docs": { "tags": [], "text": "" } }, "user": { "type": "unknown", "mutable": false, "complexType": { "original": "{ name: string; unitName: string }", "resolved": "{ name: string; unitName: string; }", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" } }, "logo": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "logo", "reflect": false }, "activeUrl": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "active-url", "reflect": false, "defaultValue": "window.location.href" }, "activeProductsV4": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": true, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "active-products-v-4", "reflect": false }, "activeRedeV4": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": true, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "active-rede-v-4", "reflect": false } }; } static get states() { return { "collapsed": {}, "currentHost": {}, "openProductsV4": {}, "openRedeV4": {} }; } } //# sourceMappingURL=lab-ds-navbar.js.map