import { Component, Input, Output, EventEmitter, HostListener, ChangeDetectionStrategy } from '@angular/core';
import * as i0 from "@angular/core";
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);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SwitchComponent, isStandalone: true, 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>
          @if (checked && enabledText) {
            <span class="uno-switch-boolean enabled-text">{{ enabledText }}</span>
          }
          @if (!checked && disabledText) {
            <span 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-gray-9)}mark{background-color:inherit;border-radius:100%;background-color:var(--light-gray-14);position:absolute;top:1px;left:1px;transition:.3s ease-out all;-webkit-transition:.3s ease-out all}.switch.checked mark{border:none;background:var(--light-gray-14)}.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(--special-green-4)}.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(--special-green-4)}.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(--special-green-4)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", 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>
          @if (checked && enabledText) {
            <span class="uno-switch-boolean enabled-text">{{ enabledText }}</span>
          }
          @if (!checked && disabledText) {
            <span class="uno-switch-boolean disabled-text">{{ disabledText }}</span>
          }
        </div>
        `, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [], 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-gray-9)}mark{background-color:inherit;border-radius:100%;background-color:var(--light-gray-14);position:absolute;top:1px;left:1px;transition:.3s ease-out all;-webkit-transition:.3s ease-out all}.switch.checked mark{border:none;background:var(--light-gray-14)}.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(--special-green-4)}.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(--special-green-4)}.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(--special-green-4)}\n"] }]
        }], ctorParameters: () => [], 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Vuby11aS1saWIvc3JjL2xpYi9zd2l0Y2gvc3dpdGNoLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLFlBQVksRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUE2QjlHLE1BQU0sT0FBTyxlQUFlO0lBWXhCO1FBUGdCLFNBQUksR0FBaUMsT0FBTyxDQUFDO1FBSzVDLFlBQU8sR0FBRyxJQUFJLFlBQVksRUFBVyxDQUFDO0lBRXZDLENBQUM7SUFFTSxRQUFRO1FBQzNCLElBQUksSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO1lBQ2YsT0FBTztRQUNYLENBQUM7UUFFRCxJQUFJLENBQUMsT0FBTyxHQUFHLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztRQUM3QixJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7SUFD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