'use strict';

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

const __chunk_1 = require('./chunk-78439bef.js');

class DatatableHeader {
    constructor(hostRef) {
        __chunk_1.registerInstance(this, hostRef);
        this.selectAll = __chunk_1.createEvent(this, "selectAll", 7);
    }
    watchSelected() {
        this.selectAll.emit(this.selected);
    }
    /**
     * Définir le checkbox du header
     */
    renderSelectBox() {
        if (this.selectable) {
            return __chunk_1.h("materials-checkbox", { color: "primary", onChange: () => {
                    this.selected = !this.selected;
                }, onClick: (e) => e.stopPropagation(), checked: this.selected });
        }
    }
    getClasses() {
        return {
            'container': true,
            'container-background-primary': this.color === 'primary',
            'container-background-secondary': this.color === 'secondary',
        };
    }
    render() {
        return (__chunk_1.h("div", { class: this.getClasses() }, this.renderSelectBox(), __chunk_1.h("slot", null)));
    }
    static get watchers() { return {
        "selected": ["watchSelected"]
    }; }
    static get style() { return ":host{display:block}:host .container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;border-bottom:1px solid #e0e0e0;background-color:var(--mdc-theme-datatable-header,#fff);color:var(--mdc-theme-on-datatable-header,#212121);padding:0 8px}:host materials-checkbox{-ms-flex-item-align:center;align-self:center}"; }
}

exports.materials_datatable_header = DatatableHeader;
