UNPKG

@scania/tegel

Version:
71 lines (70 loc) 2.91 kB
import { h, Host } from "@stencil/core"; import inheritAriaAttributes from "../../../utils/inheritAriaAttributes"; export class TdsHeaderLauncherButton { constructor() { /** If the button should appear active. Can be used when the button is * triggering a dropdown, and the dropdown is open, for example. */ this.active = false; } render() { this.ariaAttributes = Object.assign(Object.assign({}, this.ariaAttributes), inheritAriaAttributes(this.host)); const buttonProps = Object.assign({}, this.ariaAttributes); return (h(Host, { key: 'b8f411243958b59899d67a8d991a1ffca34a82d0' }, h("tds-header-item", { key: '025b3aa6d6eee7f9cdb6c19cc672ab9df149741e', active: this.active }, h("button", Object.assign({ key: '7571c417caba3e5a472f58a893f6033c4102ae09' }, buttonProps, { "aria-label": this.tdsAriaLabel }), h("tds-icon", { key: 'f6477e6f48ca3eb5550f92123f0edc90a3f4e108', class: "icon", name: "bento", size: "20px", "svg-title": this.tdsAriaLabel }))))); } static get is() { return "tds-header-launcher-button"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["header-launcher-button.scss"] }; } static get styleUrls() { return { "$": ["header-launcher-button.css"] }; } static get properties() { return { "active": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "If the button should appear active. Can be used when the button is\ntriggering a dropdown, and the dropdown is open, for example." }, "getter": false, "setter": false, "reflect": false, "attribute": "active", "defaultValue": "false" }, "tdsAriaLabel": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string | undefined", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Value to be used by the aria-label attribute" }, "getter": false, "setter": false, "reflect": false, "attribute": "tds-aria-label" } }; } static get elementRef() { return "host"; } }