UNPKG

@kelvininc/ui-components

Version:
263 lines (262 loc) 9.73 kB
import { h, Host } from "@stencil/core"; import { EComponentSize } from "../../utils/types"; export class KvActionButtonIcon { constructor() { /** @inheritdoc */ this.disabled = false; /** @inheritdoc */ this.active = false; /** @inheritdoc */ this.loading = false; /** @inheritdoc */ this.size = EComponentSize.Small; } render() { return (h(Host, { key: 'ec12079db81afec5a3610eb302076288d86a5af0' }, h("div", { key: '1b6bcfb2593c8d3c24035d6dc31ea6e3e1d417b8', class: { 'action-button-icon': true, [`action-button-icon--size-${this.size}`]: true } }, h("kv-action-button", { key: '000c387702ec35707b38e0f0fd539873ff18f5b6', type: this.type, active: this.active, loading: this.loading, size: this.size, disabled: this.disabled, exportparts: "button" }, h("kv-icon", { key: 'fcde377fdf8cd46dd8540b6e72dfc923c68dbd78', name: this.icon, exportparts: "icon" }))))); } static get is() { return "kv-action-button-icon"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["action-button-icon.scss"] }; } static get styleUrls() { return { "$": ["action-button-icon.css"] }; } static get properties() { return { "icon": { "type": "string", "attribute": "icon", "mutable": false, "complexType": { "original": "EIconName", "resolved": "EIconName", "references": { "EIconName": { "location": "import", "path": "../icon/icon.types", "id": "src/components/icon/icon.types.ts::EIconName" } } }, "required": true, "optional": false, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "(required) Button's icon symbol name" }, "getter": false, "setter": false, "reflect": true }, "type": { "type": "string", "attribute": "type", "mutable": false, "complexType": { "original": "EActionButtonType", "resolved": "EActionButtonType.Danger | EActionButtonType.Primary | EActionButtonType.Secondary | EActionButtonType.Tertiary | EActionButtonType.Text", "references": { "EActionButtonType": { "location": "import", "path": "../action-button/action-button.types", "id": "src/components/action-button/action-button.types.ts::EActionButtonType" } } }, "required": true, "optional": false, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "(required) Button's type" }, "getter": false, "setter": false, "reflect": true }, "disabled": { "type": "boolean", "attribute": "disabled", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "(optional) If `true` the button is disabled" }, "getter": false, "setter": false, "reflect": true, "defaultValue": "false" }, "active": { "type": "boolean", "attribute": "active", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "(optional) If `true` the button is active" }, "getter": false, "setter": false, "reflect": true, "defaultValue": "false" }, "loading": { "type": "boolean", "attribute": "loading", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "(optional) If `true` the button is of type loading" }, "getter": false, "setter": false, "reflect": true, "defaultValue": "false" }, "size": { "type": "string", "attribute": "size", "mutable": false, "complexType": { "original": "EComponentSize", "resolved": "EComponentSize.Large | EComponentSize.Small", "references": { "EComponentSize": { "location": "import", "path": "../../utils/types", "id": "src/utils/types/index.ts::EComponentSize" } } }, "required": false, "optional": false, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "(optional) Button's size" }, "getter": false, "setter": false, "reflect": true, "defaultValue": "EComponentSize.Small" } }; } static get events() { return [{ "method": "clickButton", "name": "clickButton", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "Emitted when action button is clicked" }, "complexType": { "original": "MouseEvent", "resolved": "MouseEvent", "references": { "MouseEvent": { "location": "global", "id": "global::MouseEvent" } } } }, { "method": "focusButton", "name": "focusButton", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "Emitted when action button is focused" }, "complexType": { "original": "FocusEvent", "resolved": "FocusEvent", "references": { "FocusEvent": { "location": "global", "id": "global::FocusEvent" } } } }, { "method": "blurButton", "name": "blurButton", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [{ "name": "inheritdoc", "text": undefined }], "text": "Emitted when action button is blur" }, "complexType": { "original": "FocusEvent", "resolved": "FocusEvent", "references": { "FocusEvent": { "location": "global", "id": "global::FocusEvent" } } } }]; } }