v4web-components
Version:
Stencil Component Starter
128 lines (127 loc) • 3.36 kB
JavaScript
import { h } from '@stencil/core';
export class LabDsAvatarWithExchange {
constructor() {
this.iconSize = {
'small': 'xx-small',
'medium': 'x-small',
'large': 'small',
'x-large': 'medium',
'xx-large': 'medium',
};
this.size = undefined;
this.imageSRC = undefined;
this.disabled = undefined;
this.name = undefined;
}
handleClick() {
if (this.disabled)
return;
this.clickAvatar.emit();
}
render() {
return (h("div", { onClick: () => this.handleClick(), class: `avatar-with-exchange ${this.disabled ? 'disabled' : ''}` }, h("lab-ds-avatar", { size: this.size, name: this.name, disabled: this.disabled, imageSRC: this.imageSRC }), h("div", { class: "overlay" }), h("lab-ds-icon-not-selectable", { class: "exchange-icon", icon: "photo_camera", size: this.iconSize[this.size] })));
}
static get is() { return "lab-ds-avatar-with-exchange"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() {
return {
"$": ["lab-ds-avatar-with-exchange.css"]
};
}
static get styleUrls() {
return {
"$": ["lab-ds-avatar-with-exchange.css"]
};
}
static get properties() {
return {
"size": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'small' | 'medium' | 'large' | 'x-large' | 'xx-large' | 'x-small'",
"resolved": "\"large\" | \"medium\" | \"small\" | \"x-large\" | \"x-small\" | \"xx-large\"",
"references": {}
},
"required": true,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "size",
"reflect": false
},
"imageSRC": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "image-s-r-c",
"reflect": false
},
"disabled": {
"type": "boolean",
"mutable": false,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "disabled",
"reflect": false
},
"name": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "name",
"reflect": false
}
};
}
static get events() {
return [{
"method": "clickAvatar",
"name": "clickAvatar",
"bubbles": true,
"cancelable": true,
"composed": true,
"docs": {
"tags": [],
"text": ""
},
"complexType": {
"original": "any",
"resolved": "any",
"references": {}
}
}];
}
}
//# sourceMappingURL=lab-ds-avatar-with-exchange.js.map