'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-c57a47e8.js');

const ListItemCheckbox = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.disabled = false;
        /**
         * Coupe le text par defaut.
         */
        this.textWrap = false;
        this.change = core.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 (core.h("materials-list-item", { disabled: this.disabled, onClick: () => this.toggleCheckbox(), itemEndStyle: this.itemEndStyle, itemStartStyle: this.itemStartStyle, noPadding: this.noPadding, size: this.size }, core.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();
            } }), core.h("label", { class: { 'mdc-typography': true, 'gmv-label-nowrap': !this.textWrap }, title: this.label }, this.label), core.h("div", { slot: "item-start" }, core.h("slot", { name: "item-start" })), core.h("div", { slot: "item-end" }, core.h("slot", { name: "item-end" }))));
    }
    get host() { return core.getElement(this); }
    static get style() { return ":host .gmv-label-nowrap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"; }
};

exports.materials_list_item_checkbox = ListItemCheckbox;
