UNPKG

@telekom/scale-components

Version:

Scale is the digital design system for Telekom products and experiences.

352 lines (351 loc) 8.68 kB
/** * @license * Scale https://github.com/telekom/scale * * Copyright (c) 2021 Egor Kirpichev and contributors, Deutsche Telekom AG * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { Component, h, Prop, Host, State, Element } from '@stencil/core'; export class Shell { constructor() { this.portalName = ''; this.claimLang = 'de'; this.mainNavigation = []; this.iconNavigation = []; this.userNavigation = []; this.sectorNavigation = []; this.addonNavigation = []; this.activeRouteId = ''; this.activeSectorId = ''; this.sticky = false; this.scrolled = false; } componentWillLoad() { this.hasSlotHeader = !!this.hostElement.querySelector('[slot="header"]'); } render() { return (h(Host, null, this.styles && h("style", null, this.styles), h("div", { part: "base", class: "shell" }, this.hasSlotHeader ? (h("slot", { name: "header" })) : (h("scale-app-header", { logoClick: this.logoClick, logoAriaDescribedBy: this.logoAriaDescribedBy, logoHref: this.logoHref, logoTitle: this.logoTitle, logoHideTitle: this.logoHideTitle, portalName: this.portalName, mainNavigation: this.mainNavigation, iconNavigation: this.iconNavigation, userNavigation: this.userNavigation, sectorNavigation: this.sectorNavigation, addonNavigation: this.addonNavigation, activeRouteId: this.activeRouteId, activeSectorId: this.activeSectorId, claimLang: this.claimLang, sticky: this.sticky, userMenuAriaLabel: this.userMenuAriaLabel })), h("main", { class: "content" }, h("slot", null)), h("slot", { name: "footer" })))); } static get is() { return "scale-app-shell"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["app-shell.css"] }; } static get styleUrls() { return { "$": ["app-shell.css"] }; } static get properties() { return { "portalName": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "portal-name", "reflect": false, "defaultValue": "''" }, "claimLang": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "claim-lang", "reflect": false, "defaultValue": "'de'" }, "logoHref": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "logo-href", "reflect": false }, "logoTitle": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "logo-title", "reflect": false }, "logoHideTitle": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "logo-hide-title", "reflect": false }, "logoClick": { "type": "any", "mutable": false, "complexType": { "original": "any", "resolved": "any", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "logo-click", "reflect": false }, "logoAriaDescribedBy": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "logo-aria-described-by", "reflect": false }, "mainNavigation": { "type": "any", "mutable": false, "complexType": { "original": "any", "resolved": "any", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "main-navigation", "reflect": false, "defaultValue": "[]" }, "iconNavigation": { "type": "any", "mutable": false, "complexType": { "original": "any", "resolved": "any", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "icon-navigation", "reflect": false, "defaultValue": "[]" }, "userNavigation": { "type": "any", "mutable": false, "complexType": { "original": "any", "resolved": "any", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "user-navigation", "reflect": false, "defaultValue": "[]" }, "sectorNavigation": { "type": "any", "mutable": false, "complexType": { "original": "any", "resolved": "any", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "sector-navigation", "reflect": false, "defaultValue": "[]" }, "addonNavigation": { "type": "any", "mutable": false, "complexType": { "original": "any", "resolved": "any", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "addon-navigation", "reflect": false, "defaultValue": "[]" }, "activeRouteId": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "active-route-id", "reflect": false, "defaultValue": "''" }, "activeSectorId": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "active-sector-id", "reflect": false, "defaultValue": "''" }, "userMenuAriaLabel": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "user-menu-aria-label", "reflect": false }, "sticky": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "" }, "attribute": "sticky", "reflect": false, "defaultValue": "false" }, "styles": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "(optional) Injected CSS styles" }, "attribute": "styles", "reflect": false } }; } static get states() { return { "scrolled": {} }; } static get elementRef() { return "hostElement"; } }