import { r as registerInstance, d as createEvent, h, c as getElement } from './core-3f33e631.js';
import { T as Tunnel } from './i18n.provider-106e9203.js';

const BooleanFilterPanel = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.anjFilterChange = createEvent(this, "anjFilterChange", 7);
    }
    async reset() {
        this.element.querySelector('form').reset();
    }
    onSubmit(e) {
        e.preventDefault();
        const check = e.target.querySelector('input');
        this.anjFilterChange.emit({ field: this.field, type: 'equals', query: check.checked });
    }
    render() {
        return (h("form", { onSubmit: (e) => this.onSubmit(e) }, h("anj-checkbox-group", null, h("anj-checkbox", { name: "query" }, this.translator('Show only true'))), h("anj-button-group", { align: "right" }, h("anj-button", { context: "text", type: "submit" }, this.translator('Apply')))));
    }
    get element() { return getElement(this); }
    static get style() { return ".sc-anj-boolean-filter-panel-h {\n  display: block;\n  padding: 1rem;\n}\n.sc-anj-boolean-filter-panel-h anj-button-group.sc-anj-boolean-filter-panel {\n  margin-bottom: 0;\n}"; }
};
Tunnel.injectProps(BooleanFilterPanel, ['translator']);

export { BooleanFilterPanel as anj_boolean_filter_panel };
