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, "text-wrap": true },
            getThumbnail(this),
            h("ion-label", null, this.label)));
    }
    static get is() { return "gl-facet"; }
    static get properties() { return {
        "detail": {
            "type": Boolean,
            "attr": "detail"
        },
        "el": {
            "elementRef": true
        },
        "image": {
            "type": String,
            "attr": "image"
        },
        "label": {
            "type": String,
            "attr": "label"
        },
        "value": {
            "type": String,
            "attr": "value"
        },
        "widget": {
            "type": String,
            "attr": "widget"
        }
    }; }
    static get events() { return [{
            "name": "glFormFacet",
            "method": "glFormFacet",
            "bubbles": true,
            "cancelable": true,
            "composed": true
        }]; }
}
