import { h } from '@stencil/core';
export class ListItemCheckbox {
    constructor() {
        this.disabled = false;
        /**
         * Coupe le text par defaut.
         */
        this.textWrap = false;
    }
    componentDidLoad() {
        this.materialsCheckbox = this.host.shadowRoot.querySelector('materials-checkbox');
        this.checkboxInput = this.materialsCheckbox.shadowRoot.querySelector('.mdc-checkbox__native-control');
    }
    toggleCheckbox() {
        if (!this.disabled) {
            this.checked = !this.checked;
            this.checkboxInput.checked = this.checked;
            this.change.emit(this.checked);
        }
    }
    render() {
        return (h("materials-list-item", { disabled: this.disabled, onClick: () => this.toggleCheckbox(), itemEndStyle: this.itemEndStyle, itemStartStyle: this.itemStartStyle, noPadding: this.noPadding, size: this.size },
            h("materials-checkbox", { slot: "item-start", id: "materials-checkbox", color: this.color, value: this.value, checked: this.checked, disabled: this.disabled, onChange: (e) => {
                    e.preventDefault();
                    e.stopPropagation();
                } }),
            h("label", { class: { 'mdc-typography': true, 'gmv-label-nowrap': !this.textWrap }, title: this.label }, this.label),
            h("div", { slot: "item-start" },
                h("slot", { name: "item-start" })),
            h("div", { slot: "item-end" },
                h("slot", { name: "item-end" }))));
    }
    static get is() { return "materials-list-item-checkbox"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() { return {
        "$": ["list-item-checkbox.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["list-item-checkbox.css"]
    }; }
    static get properties() { return {
        "disabled": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "disabled",
            "reflect": false,
            "defaultValue": "false"
        },
        "label": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "label",
            "reflect": false
        },
        "checked": {
            "type": "boolean",
            "mutable": true,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "checked",
            "reflect": false
        },
        "value": {
            "type": "any",
            "mutable": false,
            "complexType": {
                "original": "string | number",
                "resolved": "number | string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "value",
            "reflect": false
        },
        "color": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "color",
            "reflect": false
        },
        "itemStartStyle": {
            "type": "any",
            "mutable": false,
            "complexType": {
                "original": "any",
                "resolved": "any",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "item-start-style",
            "reflect": false
        },
        "itemEndStyle": {
            "type": "any",
            "mutable": false,
            "complexType": {
                "original": "any",
                "resolved": "any",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "item-end-style",
            "reflect": false
        },
        "noPadding": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "no-padding",
            "reflect": false
        },
        "size": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "HTMLMaterialsListItemElement[\"size\"]",
                "resolved": "\"medium\" | \"small\"",
                "references": {
                    "HTMLMaterialsListItemElement": {
                        "location": "global"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "size",
            "reflect": false
        },
        "textWrap": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Coupe le text par defaut."
            },
            "attribute": "text-wrap",
            "reflect": false,
            "defaultValue": "false"
        }
    }; }
    static get events() { return [{
            "method": "change",
            "name": "change",
            "bubbles": true,
            "cancelable": true,
            "composed": true,
            "docs": {
                "tags": [],
                "text": ""
            },
            "complexType": {
                "original": "any",
                "resolved": "any",
                "references": {}
            }
        }]; }
    static get elementRef() { return "host"; }
}
