import { h } from '@stencil/core';
import { getThumbnail } from '../utils';
export class Facet {
    constructor() {
        this.detail = true;
        this.widget = 'item';
    }
    setFacet() {
        this.glFormFacet.emit({
            label: this.label,
            value: this.value
        });
    }
    render() {
        if (this.widget === 'header')
            return (h("ion-list-header", null, this.label));
        return (h("ion-item", { button: true, onClick: () => this.setFacet(), detail: this.detail },
            getThumbnail(this),
            h("ion-label", { "text-wrap": true }, this.label)));
    }
    static get is() { return "gl-facet"; }
    static get properties() { return {
        "detail": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "detail",
            "reflect": false,
            "defaultValue": "true"
        },
        "image": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "image",
            "reflect": false
        },
        "label": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "label",
            "reflect": false
        },
        "value": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "value",
            "reflect": false
        },
        "widget": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "'header' | 'item'",
                "resolved": "\"header\" | \"item\"",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "widget",
            "reflect": false,
            "defaultValue": "'item'"
        }
    }; }
    static get events() { return [{
            "method": "glFormFacet",
            "name": "glFormFacet",
            "bubbles": true,
            "cancelable": true,
            "composed": true,
            "docs": {
                "tags": [],
                "text": ""
            },
            "complexType": {
                "original": "any",
                "resolved": "any",
                "references": {}
            }
        }]; }
    static get elementRef() { return "el"; }
}
