import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
export class CsSwitchComponent {
    constructor() {
        this.ngValueChange = new EventEmitter();
    }
    valueChanged() {
        this.ngValueChange.emit(this.ngValue);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CsSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CsSwitchComponent, selector: "app-cs-switch", inputs: { disabled: "disabled", ngValue: "ngValue", value: "value", tooltipMessage: "tooltipMessage", position: "position" }, outputs: { ngValueChange: "ngValueChange" }, ngImport: i0, template: "<label class=\"cs-switch\" [class.top]=\"position == 'top'\">\n  <!-- [class.large]=\"large\" -->\n  <span class=\"value\" [class.disabled]=\"disabled\">\n    <ng-content></ng-content>\n  </span>\n  <!-- [class.last]=\"last\" -->\n  <span class=\"switch\" *ngIf=\"tooltipMessage === '' || tooltipMessage === undefined\">\n    <input type=\"checkbox\" [(ngModel)]=\"ngValue\" (ngModelChange)=\"valueChanged()\" [disabled]=\"disabled\" />\n    <span class=\"switch-box\" [class.disabled]=\"disabled\">\n      <span class=\"switch-ball\"></span>\n    </span>\n  </span>\n  <span class=\"switch\" *ngIf=\"tooltipMessage !== '' && tooltipMessage !== undefined\">\n    <input type=\"checkbox\" [(ngModel)]=\"ngValue\" (ngModelChange)=\"valueChanged()\" [disabled]=\"disabled\" />\n    <span class=\"switch-box\" [class.disabled]=\"disabled\">\n      <span class=\"switch-ball\"></span>\n    </span>\n  </span>\n</label>\n", styles: ["label.cs-switch{position:relative;display:flex;align-items:center;justify-content:space-between;width:100%;margin:0;padding:0}label.cs-switch.top{align-items:flex-start}label.cs-switch span.value{font-size:12px;color:#161b2f;font-weight:400;display:flex;justify-content:space-between;width:calc(100% - 35px);align-items:flex-start}label.cs-switch span.value:empty{display:none}label.cs-switch span.switch{position:relative;display:block;width:28px;min-width:28px;height:16px}label.cs-switch span.switch input{position:absolute;opacity:0;margin:0;width:100%;height:100%;z-index:1;cursor:pointer}label.cs-switch span.switch input:checked+span.switch-box{background:#34aa44;border:1px solid #34aa44}label.cs-switch span.switch input:checked+span.switch-box .switch-ball{left:13px;border-color:#34aa44}label.cs-switch span.switch-box{height:100%;width:100%;border-radius:11px;background:#dbdbdb;border:1px solid #dbdbdb;display:block;transition:all .2s ease-in-out}label.cs-switch span.switch-ball{height:14px;width:14px;background:#fff;border-radius:50%;border:1px solid #dbdbdb;display:block;position:absolute;left:1px;top:1px;bottom:1px;transition:all .2s ease-in-out}:disabled{pointer-events:none;opacity:.2}.disabled{pointer-events:none;opacity:.2}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CsSwitchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-cs-switch', template: "<label class=\"cs-switch\" [class.top]=\"position == 'top'\">\n  <!-- [class.large]=\"large\" -->\n  <span class=\"value\" [class.disabled]=\"disabled\">\n    <ng-content></ng-content>\n  </span>\n  <!-- [class.last]=\"last\" -->\n  <span class=\"switch\" *ngIf=\"tooltipMessage === '' || tooltipMessage === undefined\">\n    <input type=\"checkbox\" [(ngModel)]=\"ngValue\" (ngModelChange)=\"valueChanged()\" [disabled]=\"disabled\" />\n    <span class=\"switch-box\" [class.disabled]=\"disabled\">\n      <span class=\"switch-ball\"></span>\n    </span>\n  </span>\n  <span class=\"switch\" *ngIf=\"tooltipMessage !== '' && tooltipMessage !== undefined\">\n    <input type=\"checkbox\" [(ngModel)]=\"ngValue\" (ngModelChange)=\"valueChanged()\" [disabled]=\"disabled\" />\n    <span class=\"switch-box\" [class.disabled]=\"disabled\">\n      <span class=\"switch-ball\"></span>\n    </span>\n  </span>\n</label>\n", styles: ["label.cs-switch{position:relative;display:flex;align-items:center;justify-content:space-between;width:100%;margin:0;padding:0}label.cs-switch.top{align-items:flex-start}label.cs-switch span.value{font-size:12px;color:#161b2f;font-weight:400;display:flex;justify-content:space-between;width:calc(100% - 35px);align-items:flex-start}label.cs-switch span.value:empty{display:none}label.cs-switch span.switch{position:relative;display:block;width:28px;min-width:28px;height:16px}label.cs-switch span.switch input{position:absolute;opacity:0;margin:0;width:100%;height:100%;z-index:1;cursor:pointer}label.cs-switch span.switch input:checked+span.switch-box{background:#34aa44;border:1px solid #34aa44}label.cs-switch span.switch input:checked+span.switch-box .switch-ball{left:13px;border-color:#34aa44}label.cs-switch span.switch-box{height:100%;width:100%;border-radius:11px;background:#dbdbdb;border:1px solid #dbdbdb;display:block;transition:all .2s ease-in-out}label.cs-switch span.switch-ball{height:14px;width:14px;background:#fff;border-radius:50%;border:1px solid #dbdbdb;display:block;position:absolute;left:1px;top:1px;bottom:1px;transition:all .2s ease-in-out}:disabled{pointer-events:none;opacity:.2}.disabled{pointer-events:none;opacity:.2}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
                type: Input
            }], ngValue: [{
                type: Input
            }], value: [{
                type: Input
            }], ngValueChange: [{
                type: Output
            }], tooltipMessage: [{
                type: Input
            }], position: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3Mtc3dpdGNoLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3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