import { Component, Input, Output, EventEmitter, HostListener, ChangeDetectionStrategy } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
export class SwitchComponent {
    constructor() {
        this.size = 'small';
        this.changed = new EventEmitter();
    }
    onToggle() {
        if (this.disable) {
            return;
        }
        this.checked = !this.checked;
        this.changed.emit(this.checked);
    }
}
SwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
SwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: SwitchComponent, selector: "uno-switch", inputs: { checked: "checked", disable: "disable", minWidth: "minWidth", size: "size", enabledText: "enabledText", disabledText: "disabledText" }, outputs: { changed: "changed" }, host: { listeners: { "click": "onToggle()" } }, ngImport: i0, template: `
        <div class="switch-container" [style.minWidth]="minWidth">
            <span class="switch"
                [class.checked]="checked"
                [class.disabled]="disable"
                [class.switch-large]="size === 'large'"
                [class.switch-medium]="size === 'medium'"
                [class.switch-small]="size === 'small'">

                <mark></mark>
            </span>
            <span *ngIf="checked && enabledText" class="uno-switch-boolean enabled-text">{{ enabledText }}</span>
            <span *ngIf="!checked && disabledText" class="uno-switch-boolean disabled-text">{{ disabledText }}</span>
        </div>
    `, isInline: true, styles: [".switch-container{display:inline-flex}.switch{position:relative;box-sizing:content-box;margin:0 10px -4px 0;cursor:pointer;box-shadow:#dfdfdf 0 0 inset;transition:.3s ease-out all;-webkit-transition:.3s ease-out all;background-color:var(--light-blue-grey)}mark{background-color:inherit;border-radius:100%;background-color:var(--white);position:absolute;top:1px;left:1px;transition:.3s ease-out all;-webkit-transition:.3s ease-out all}.switch.checked mark{border:none;background:var(--white)}.disabled{opacity:.5;cursor:not-allowed}.switch-large{width:80px;height:30px;border-radius:38px}.switch-large mark{width:26px;height:26px;margin-top:1px;margin-left:1px}.switch-large.checked mark{left:51px}.switch-large.checked{background-color:var(--dark-lime-green)}.switch-medium{width:40px;height:24px;border-radius:20px}.switch-medium mark{width:20px;height:20px;margin-top:1px;margin-left:1px}.switch-medium.checked mark{left:17px}.switch-medium.checked{background-color:var(--dark-lime-green)}.switch-small{width:30px;height:18px;border-radius:20px}.switch-small mark{width:14px;height:14px;margin-top:1px;margin-left:1px}.switch-small.checked mark{left:13px}.switch-small.checked{background-color:var(--dark-lime-green)}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SwitchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'uno-switch', template: `
        <div class="switch-container" [style.minWidth]="minWidth">
            <span class="switch"
                [class.checked]="checked"
                [class.disabled]="disable"
                [class.switch-large]="size === 'large'"
                [class.switch-medium]="size === 'medium'"
                [class.switch-small]="size === 'small'">

                <mark></mark>
            </span>
            <span *ngIf="checked && enabledText" class="uno-switch-boolean enabled-text">{{ enabledText }}</span>
            <span *ngIf="!checked && disabledText" class="uno-switch-boolean disabled-text">{{ disabledText }}</span>
        </div>
    `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".switch-container{display:inline-flex}.switch{position:relative;box-sizing:content-box;margin:0 10px -4px 0;cursor:pointer;box-shadow:#dfdfdf 0 0 inset;transition:.3s ease-out all;-webkit-transition:.3s ease-out all;background-color:var(--light-blue-grey)}mark{background-color:inherit;border-radius:100%;background-color:var(--white);position:absolute;top:1px;left:1px;transition:.3s ease-out all;-webkit-transition:.3s ease-out all}.switch.checked mark{border:none;background:var(--white)}.disabled{opacity:.5;cursor:not-allowed}.switch-large{width:80px;height:30px;border-radius:38px}.switch-large mark{width:26px;height:26px;margin-top:1px;margin-left:1px}.switch-large.checked mark{left:51px}.switch-large.checked{background-color:var(--dark-lime-green)}.switch-medium{width:40px;height:24px;border-radius:20px}.switch-medium mark{width:20px;height:20px;margin-top:1px;margin-left:1px}.switch-medium.checked mark{left:17px}.switch-medium.checked{background-color:var(--dark-lime-green)}.switch-small{width:30px;height:18px;border-radius:20px}.switch-small mark{width:14px;height:14px;margin-top:1px;margin-left:1px}.switch-small.checked mark{left:13px}.switch-small.checked{background-color:var(--dark-lime-green)}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { checked: [{
                type: Input
            }], disable: [{
                type: Input
            }], minWidth: [{
                type: Input
            }], size: [{
                type: Input
            }], enabledText: [{
                type: Input
            }], disabledText: [{
                type: Input
            }], changed: [{
                type: Output
            }], onToggle: [{
                type: HostListener,
                args: ['click']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Vuby11aS1saWIvc3JjL2xpYi9zd2l0Y2gvc3dpdGNoLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLFlBQVksRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7O0FBc0I5RyxNQUFNLE9BQU8sZUFBZTtJQVl4QjtRQVBnQixTQUFJLEdBQWlDLE9BQU8sQ0FBQztRQUs1QyxZQUFPLEdBQUcsSUFBSSxZQUFZLEVBQVcsQ0FBQztJQUV2QyxDQUFDO0lBRU0sUUFBUTtRQUMzQixJQUFJLElBQUksQ0FBQyxPQUFPLEVBQUU7WUFDZCxPQUFPO1NBQ1Y7UUFFRCxJQUFJLENBQUMsT0FBTyxHQUFHLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztRQUM3QixJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJ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