import { Component, Input, EventEmitter, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
var _c0 = function (a0) { return { "al-checkbox--disabled": a0 }; };
var AlCheckboxComponent = /** @class */ (function () {
    function AlCheckboxComponent() {
        this.label = '';
        this.checked = false;
        this.disabled = false;
        this.changed = new EventEmitter();
    }
    AlCheckboxComponent.prototype.ngOnInit = function () {
        this.checkboxId = "checkbox_" + AlCheckboxComponent.checkboxIndex++;
    };
    AlCheckboxComponent.prototype.changeCheck = function (event) {
        this.changed.emit(event.target.checked);
    };
    AlCheckboxComponent.checkboxIndex = 0;
    /** @nocollapse */ AlCheckboxComponent.ɵfac = function AlCheckboxComponent_Factory(t) { return new (t || AlCheckboxComponent)(); };
    /** @nocollapse */ AlCheckboxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AlCheckboxComponent, selectors: [["al-checkbox"]], inputs: { label: "label", checked: "checked", disabled: "disabled" }, outputs: { changed: "changed" }, decls: 7, vars: 8, consts: [[1, "al-checkbox", 3, "ngClass"], ["type", "checkbox", "value", "", 1, "al-checkbox__input", 3, "checked", "disabled", "id", "change"], [1, "al-checkbox__box"], ["viewBox", "0 0 20 20", 1, "al-checkbox__icon"], ["d", "M0 11l2-2 5 5L18 3l2 2L7 18z"], [1, "al-checkbox__label", 3, "for"]], template: function AlCheckboxComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵelementStart(1, "input", 1);
            i0.ɵɵlistener("change", function AlCheckboxComponent_Template_input_change_1_listener($event) { return ctx.changeCheck($event); });
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(2, "div", 2);
            i0.ɵɵnamespaceSVG();
            i0.ɵɵelementStart(3, "svg", 3);
            i0.ɵɵelement(4, "path", 4);
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵnamespaceHTML();
            i0.ɵɵelementStart(5, "label", 5);
            i0.ɵɵtext(6);
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0, ctx.disabled));
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("checked", ctx.checked)("disabled", ctx.disabled)("id", ctx.checkboxId);
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("for", ctx.checkboxId);
            i0.ɵɵadvance(1);
            i0.ɵɵtextInterpolate1(" ", ctx.label, " ");
        } }, directives: [i1.NgClass], styles: [".al-checkbox[_ngcontent-%COMP%]{position:relative;display:inline-flex;justify-content:flex-start;align-items:flex-start;margin-bottom:8px;cursor:pointer}.al-checkbox__label[_ngcontent-%COMP%]{font-size:14px;line-height:20px;padding-left:8px;cursor:pointer}.al-checkbox__input[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:20px;height:20px;margin:0;border:0;opacity:0;cursor:pointer}.al-checkbox__box[_ngcontent-%COMP%]{display:flex;flex-shrink:0;justify-content:center;align-items:center;width:20px;height:20px;background-color:#fff;cursor:pointer;box-shadow:inset 0 0 0 1px #a8a8a8;border-radius:3px;transition:250ms}.al-checkbox__icon[_ngcontent-%COMP%]{fill:currentColor;width:12px;height:12px;color:#fff;pointer-events:none}.al-checkbox--disabled[_ngcontent-%COMP%]   .al-checkbox__box[_ngcontent-%COMP%], .al-checkbox--disabled[_ngcontent-%COMP%]   .al-checkbox__input[_ngcontent-%COMP%], .al-checkbox--disabled[_ngcontent-%COMP%]   .al-checkbox__label[_ngcontent-%COMP%]{cursor:not-allowed}.al-checkbox__input[_ngcontent-%COMP%]:checked + .al-checkbox__box[_ngcontent-%COMP%]{background-color:#3167c4;box-shadow:none}.al-checkbox__input[_ngcontent-%COMP%]:focus + .al-checkbox__box[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 1px #3167c4,0 0 0 2px #fff,0 0 0 4px #3167c4}.al-checkbox__input[_ngcontent-%COMP%]:disabled + .al-checkbox__box[_ngcontent-%COMP%]{background-color:#f6f6f6;box-shadow:none}.al-checkbox__input[_ngcontent-%COMP%]:checked:disabled + .al-checkbox__box[_ngcontent-%COMP%]   .al-checkbox__icon[_ngcontent-%COMP%]{color:#cbcbcb}.al-checkbox__input[_ngcontent-%COMP%]:not(:checked):disabled + .al-checkbox__box[_ngcontent-%COMP%]   .al-checkbox__icon[_ngcontent-%COMP%]{color:transparent}.al-checkbox--full-width[_nghost-%COMP%]{width:100%}.al-checkbox--full-width[_nghost-%COMP%]   .al-checkbox[_ngcontent-%COMP%]{width:100%}.al-checkbox--full-width[_nghost-%COMP%]   .al-checkbox__label[_ngcontent-%COMP%]{width:100%}"] });
    return AlCheckboxComponent;
}());
export { AlCheckboxComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(AlCheckboxComponent, [{
        type: Component,
        args: [{
                selector: 'al-checkbox',
                templateUrl: './al-checkbox.component.html',
                styleUrls: ['./al-checkbox.component.scss']
            }]
    }], null, { label: [{
            type: Input
        }], checked: [{
            type: Input
        }], disabled: [{
            type: Input
        }], changed: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWwtY2hlY2tib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGFsL25nLWdlbmVyaWMtY29tcG9uZW50cy8iLCJzb3VyY2VzIjpbImFsLWNoZWNrYm94L2FsLWNoZWNrYm94LmNvbXBvbmVudC50cyIsImFsLWNoZWNrYm94L2FsLWNoZWNrYm94LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFVLFlBQVksRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7QUFFL0U7SUFBQTtRQVNhLFVBQUssR0FBVyxFQUFFLENBQUM7UUFDbkIsWUFBTyxHQUFZLEtBQUssQ0FBQztRQUN6QixhQUFRLEdBQVksS0FBSyxDQUFDO1FBQ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