import { CommonModule } from '@angular/common';
import { booleanAttribute, Component, inject, input } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NgmDensityDirective } from '@metad/ocap-angular/core';
import { NgxControlValueAccessor } from 'ngxtension/control-value-accessor';
import * as i0 from "@angular/core";
import * as i1 from "@metad/ocap-angular/core";
import * as i2 from "ngxtension/control-value-accessor";
import * as i3 from "@angular/forms";
let checkboxId = 0;
export class NgmCheckboxComponent {
    constructor() {
        this.id = checkboxId++;
        this.cva = inject(NgxControlValueAccessor);
        // Inputs
        this.label = input();
        this.indeterminate = input(false);
        this.disabled = input(false, {
            transform: booleanAttribute
        });
        this.value$ = this.cva.value$;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NgmCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: NgmCheckboxComponent, isStandalone: true, selector: "ngm-checkbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgmDensityDirective, inputs: ["small", "small", "large", "large"] }, { directive: i2.NgxControlValueAccessor }], ngImport: i0, template: "<input id=\"checkbox-{{id}}\" type=\"checkbox\" class=\"w-5 h-5 appearance-none border cursor-pointer border-gray-300 rounded-md mr-2 enabled:hover:border-indigo-500 enabled:hover:bg-indigo-100 checked:bg-no-repeat checked:bg-center checked:border-indigo-500 checked:bg-indigo-100 disabled:cursor-not-allowed\"\n  [(ngModel)]=\"value$\" [indeterminate]=\"indeterminate()\" [disabled]=\"disabled()\" >\n<label for=\"checkbox-{{id}}\" class=\"grow font-norma cursor-pointer\">\n  {{label()}}\n</label>", styles: [":host{display:flex;align-items:center;justify-content:flex-start}input[type=checkbox]:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='blue'%3E%3Cpath d='M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z'%3E%3C/path%3E%3C/svg%3E\")}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NgmCheckboxComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [
                        CommonModule,
                        FormsModule,
                    ], selector: 'ngm-checkbox', hostDirectives: [
                        {
                            directive: NgmDensityDirective,
                            inputs: ['small', 'large']
                        },
                        NgxControlValueAccessor
                    ], template: "<input id=\"checkbox-{{id}}\" type=\"checkbox\" class=\"w-5 h-5 appearance-none border cursor-pointer border-gray-300 rounded-md mr-2 enabled:hover:border-indigo-500 enabled:hover:bg-indigo-100 checked:bg-no-repeat checked:bg-center checked:border-indigo-500 checked:bg-indigo-100 disabled:cursor-not-allowed\"\n  [(ngModel)]=\"value$\" [indeterminate]=\"indeterminate()\" [disabled]=\"disabled()\" >\n<label for=\"checkbox-{{id}}\" class=\"grow font-norma cursor-pointer\">\n  {{label()}}\n</label>", styles: [":host{display:flex;align-items:center;justify-content:flex-start}input[type=checkbox]:checked{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='blue'%3E%3Cpath d='M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z'%3E%3C/path%3E%3C/svg%3E\")}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9jb21tb24vY2hlY2tib3gvY2hlY2tib3guY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9jb21tb24vY2hlY2tib3gvY2hlY2tib3guY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFBO0FBQzlDLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQTtBQUMxRSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFDNUMsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMEJBQTBCLENBQUE7QUFDOUQsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0sbUNBQW1DLENBQUE7Ozs7O0FBRTNFLElBQUksVUFBVSxHQUFHLENBQUMsQ0FBQTtBQW1CbEIsTUFBTSxPQUFPLG9CQUFvQjtJQWpCakM7UUFtQkUsT0FBRSxHQUFHLFVBQVUsRUFBRSxDQUFBO1FBRVIsUUFBRyxHQUFHLE1BQU0sQ0FBQyx1QkFBdUIsQ0FBQyxDQUFBO1FBRTlDLFNBQVM7UUFDQSxVQUFLLEdBQUcsS0FBSyx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