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: '532ed86577783bc61c40a18de178e63d16cf24c1' }, h("div", { key: 'b8204d608be86196abdb6aa9f87f945a81ed94aa', 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: '39f0db01095055ae5a759d26f35abd862e188f4c', part: "inner-container", class: { 'inner-container': true, 'selected': this.selected } }, h("slot", { key: '2c813c62143a9003c6f45bc979986e375b15f6fe' })))));
    }
    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
