import { h, } from "@stencil/core";
export class ListEntry {
    host;
    value;
    label;
    type;
    ifxListEntryChange;
    valueChanged(newValue) {
        if (newValue) {
            this.host.setAttribute("value", "true");
        }
        else {
            this.host.removeAttribute("value");
        }
    }
    handleFilterEntryChange(event) {
        this.value = event.detail;
        this.ifxListEntryChange.emit({
            label: this.label,
            value: this.value,
            type: this.type,
        });
    }
    render() {
        return (h("div", { key: 'a0d358cc3ceb8abcf9690041c1e7ee4ea3c04c43', class: "wrapper" }, this.type === "checkbox" ? (h("div", { class: "list-entry" }, h("ifx-checkbox", { size: "s", checked: this.value }, this.label))) : (h("div", { class: "list-entry" }, h("ifx-radio-button", { size: "s", checked: this.value }, this.label)))));
    }
    static get is() { return "ifx-list-entry"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["list-entry.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["list-entry.css"]
        };
    }
    static get properties() {
        return {
            "value": {
                "type": "boolean",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "value"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "type"
            }
        };
    }
    static get events() {
        return [{
                "method": "ifxListEntryChange",
                "name": "ifxListEntryChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
    static get elementRef() { return "host"; }
    static get watchers() {
        return [{
                "propName": "value",
                "methodName": "valueChanged"
            }];
    }
    static get listeners() {
        return [{
                "name": "ifxChange",
                "method": "handleFilterEntryChange",
                "target": undefined,
                "capture": false,
                "passive": false
            }];
    }
}
//# sourceMappingURL=list-entry.js.map
