import { Host, h } from "@stencil/core";
export class CpslSelectItem {
    constructor() {
        this.handleItemClick = () => {
            this.cpslSelectItemClick.emit(this.value);
        };
        this.selected = undefined;
        this.value = undefined;
    }
    render() {
        return (h(Host, { key: 'db1ce801d1f8811645959e158e37fc3deafeb3f1' }, h("div", { key: 'f92eafcaa73a769a63d7f699ed6f96f0baf2acb2', part: "outer-container", class: "outer-container", onClick: e => {
                var _a;
                const targetId = (_a = e.target.id) !== null && _a !== void 0 ? _a : '';
                if (targetId === 'ignore-click') {
                    return;
                }
                this.handleItemClick();
                e.stopPropagation();
            } }, h("div", { key: '654cfd18c8662a4417c70cfd43a1591c5e1af29c', part: "inner-container", class: { 'inner-container': true, 'selected': this.selected } }, h("slot", { key: 'c3dc201669ae577827edcf08c59a330ad1a17877' })))));
    }
    static get is() { return "cpsl-select-item"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["cpsl-select-item.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["cpsl-select-item.css"]
        };
    }
    static get properties() {
        return {
            "selected": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Whether the item is selected or not."
                },
                "attribute": "selected",
                "reflect": false
            },
            "value": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Value of the item."
                },
                "attribute": "value",
                "reflect": false
            }
        };
    }
    static get events() {
        return [{
                "method": "cpslSelectItemClick",
                "name": "cpslSelectItemClick",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [{
                            "name": "internal",
                            "text": undefined
                        }],
                    "text": "Called when item is clicked."
                },
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=cpsl-select-item.js.map
