import { r as registerInstance, c as createEvent, h, g as getElement } from './chunk-8105bee0.js';

class ListItemCheckbox {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.disabled = false;
        /**
         * Coupe le text par defaut.
         */
        this.textWrap = false;
        this.change = createEvent(this, "change", 7);
    }
    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" }))));
    }
    get host() { return getElement(this); }
    static get style() { return ":host .gmv-label-nowrap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"; }
}

export { ListItemCheckbox as materials_list_item_checkbox };
