import { r as registerInstance, c as createEvent, h, g as getElement } from './index-0b18a276.js';
var ListItemCheckbox = /** @class */ (function () {
    function ListItemCheckbox(hostRef) {
        registerInstance(this, hostRef);
        this.disabled = false;
        /**
         * Coupe le text par defaut.
         */
        this.textWrap = false;
        this.change = createEvent(this, "change", 7);
    }
    ListItemCheckbox.prototype.componentDidLoad = function () {
        this.materialsCheckbox = this.host.shadowRoot.querySelector('materials-checkbox');
        this.checkboxInput = this.materialsCheckbox.shadowRoot.querySelector('.mdc-checkbox__native-control');
    };
    ListItemCheckbox.prototype.toggleCheckbox = function () {
        if (!this.disabled) {
            this.checked = !this.checked;
            this.checkboxInput.checked = this.checked;
            this.change.emit(this.checked);
        }
    };
    ListItemCheckbox.prototype.render = function () {
        var _this = this;
        return (h("materials-list-item", { disabled: this.disabled, onClick: function () { return _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: function (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" }))));
    };
    Object.defineProperty(ListItemCheckbox.prototype, "host", {
        get: function () { return getElement(this); },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ListItemCheckbox, "style", {
        get: function () { return ":host .gmv-label-nowrap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}"; },
        enumerable: true,
        configurable: true
    });
    return ListItemCheckbox;
}());
export { ListItemCheckbox as materials_list_item_checkbox };
