import { r as registerInstance, c as createEvent, h } from './chunk-7400f9fd.js';
var DatatableHeader = /** @class */ (function () {
    function DatatableHeader(hostRef) {
        registerInstance(this, hostRef);
        this.selectAll = createEvent(this, "selectAll", 7);
    }
    DatatableHeader.prototype.watchSelected = function () {
        this.selectAll.emit(this.selected);
    };
    /**
     * Définir le checkbox du header
     */
    DatatableHeader.prototype.renderSelectBox = function () {
        var _this = this;
        if (this.selectable) {
            return h("materials-checkbox", { color: "primary", onChange: function () {
                    _this.selected = !_this.selected;
                }, onClick: function (e) { return e.stopPropagation(); }, checked: this.selected });
        }
    };
    DatatableHeader.prototype.getClasses = function () {
        return {
            'container': true,
            'container-background-primary': this.color === 'primary',
            'container-background-secondary': this.color === 'secondary',
        };
    };
    DatatableHeader.prototype.render = function () {
        return (h("div", { class: this.getClasses() }, this.renderSelectBox(), h("slot", null)));
    };
    Object.defineProperty(DatatableHeader, "watchers", {
        get: function () {
            return {
                "selected": ["watchSelected"]
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DatatableHeader, "style", {
        get: function () { 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}"; },
        enumerable: true,
        configurable: true
    });
    return DatatableHeader;
}());
export { DatatableHeader as materials_datatable_header };
