@scania/tegel
Version:
Tegel Design System
66 lines (65 loc) • 2.65 kB
JavaScript
import { h, Host } from "@stencil/core";
import inheritAriaAttributes from "../../../utils/inheritAriaAttributes";
export class TdsHeaderLauncherButton {
constructor() {
this.active = false;
this.tdsAriaLabel = undefined;
}
render() {
this.ariaAttributes = Object.assign(Object.assign({}, this.ariaAttributes), inheritAriaAttributes(this.host));
const buttonProps = Object.assign({}, this.ariaAttributes);
return (h(Host, { key: '62757385fdf2aa3c51af260f2761714aea4c9727' }, h("tds-header-item", { key: '199a00653122178784999c0b5d643b9b15cd8cc5', active: this.active }, h("button", Object.assign({ key: 'd59e77834e10763d5b1c518d5bcd96e51c4dad58' }, buttonProps, { "aria-label": this.tdsAriaLabel }), h("tds-icon", { key: 'add07749af57c4110b6baeda3944e97ddf36c067', 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."
},
"attribute": "active",
"reflect": false,
"defaultValue": "false"
},
"tdsAriaLabel": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Value to be used by the aria-label attribute"
},
"attribute": "tds-aria-label",
"reflect": false
}
};
}
static get elementRef() { return "host"; }
}