import { CommonModule } from '@angular/common';
import { Component, EventEmitter, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
const SELECTOR_VALUE_ACCESSOR = {
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => TabSelector),
    multi: true,
};
export class TabSelector {
    constructor() {
        this.selectedItem = 1;
        this.onValueChanged = new EventEmitter();
        this.onChanged = (value) => { };
        this.onTouched = () => { };
    }
    writeValue(value) {
        this.selectedItem = value ?? 1;
    }
    registerOnChange(fn) {
        this.onChanged = fn;
    }
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
    }
    valueChanged(value) {
        this.selectedItem = value;
        this.onChanged(this.selectedItem);
        this.onTouched();
        this.onValueChanged.emit(this.selectedItem);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabSelector, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabSelector, isStandalone: true, selector: "tab-selector", inputs: { disabled: "disabled", selectedItem: "selectedItem", displayArray: "displayArray" }, outputs: { onValueChanged: "onValueChanged" }, providers: [SELECTOR_VALUE_ACCESSOR], ngImport: i0, template: "<div class=\"type-field \"  [ngClass]=\"{'two': displayArray?.length === 2, 'four': displayArray?.length === 4}\">\n    <div class=\"type-item\" *ngFor=\"let item of displayArray\" [class.active]=\"selectedItem === item?.value\">\n        <button (click)=\"valueChanged(item?.value)\">{{item?.label}}</button>\n    </div>\n    <span class=\"background-glider\"></span>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";.type-field{background:#f8f8f8;border:1px solid #dbdbdb;border-radius:4px;height:40px;display:flex;align-items:center;justify-content:space-between;padding:4px;position:relative;z-index:1}.type-field.four .type-item:first-of-type{width:6.25rem}.type-field.four .type-item:nth-child(2){width:5.75rem}.type-field.four .type-item:nth-child(2).active~.background-glider{transform:translate(6.4375rem);width:5.75rem}.type-field.four .type-item:nth-child(3){width:8.625rem}.type-field.four .type-item:nth-child(3).active~.background-glider{transform:translate(12.375rem);width:8.625rem}.type-field.four .type-item:last-of-type{width:5.25rem}.type-field.four .type-item:last-of-type.active~.background-glider{transform:translate(21.1875rem);width:5.25rem}.type-field.four .background-glider{width:6.25rem}.type-field.two .type-item{width:50%}.type-field.two .type-item:nth-child(2).active~.background-glider{transform:translate(100%)}.type-field.two .background-glider{width:13rem}.type-field .type-item{position:relative}.type-field .type-item button{background:transparent;border:none;border-radius:0;color:#747576;font-size:11px;font-weight:600;text-transform:uppercase;width:100%;height:32px;padding:0 12px;text-align:center}.type-field .type-item button.disabled{background:transparent!important;color:#dbdbdb!important;filter:unset!important;opacity:unset!important;pointer-events:none}.type-field .type-item .info{color:#1e5dd3;font-size:12px;position:absolute;top:10px;right:12px;cursor:pointer}.type-field .type-item.active button{color:#1e5dd3!important}.type-field .background-glider{background:#fff;border-radius:4px;box-shadow:0 1px 3px #161b2f26;position:absolute;display:flex;height:32px;z-index:-1;transition:.25s ease-out}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabSelector, decorators: [{
            type: Component,
            args: [{ selector: 'tab-selector', providers: [SELECTOR_VALUE_ACCESSOR], standalone: true, imports: [CommonModule], inputs: ['disabled', 'selectedItem', 'displayArray'], outputs: ['onValueChanged'], template: "<div class=\"type-field \"  [ngClass]=\"{'two': displayArray?.length === 2, 'four': displayArray?.length === 4}\">\n    <div class=\"type-item\" *ngFor=\"let item of displayArray\" [class.active]=\"selectedItem === item?.value\">\n        <button (click)=\"valueChanged(item?.value)\">{{item?.label}}</button>\n    </div>\n    <span class=\"background-glider\"></span>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";.type-field{background:#f8f8f8;border:1px solid #dbdbdb;border-radius:4px;height:40px;display:flex;align-items:center;justify-content:space-between;padding:4px;position:relative;z-index:1}.type-field.four .type-item:first-of-type{width:6.25rem}.type-field.four .type-item:nth-child(2){width:5.75rem}.type-field.four .type-item:nth-child(2).active~.background-glider{transform:translate(6.4375rem);width:5.75rem}.type-field.four .type-item:nth-child(3){width:8.625rem}.type-field.four .type-item:nth-child(3).active~.background-glider{transform:translate(12.375rem);width:8.625rem}.type-field.four .type-item:last-of-type{width:5.25rem}.type-field.four .type-item:last-of-type.active~.background-glider{transform:translate(21.1875rem);width:5.25rem}.type-field.four .background-glider{width:6.25rem}.type-field.two .type-item{width:50%}.type-field.two .type-item:nth-child(2).active~.background-glider{transform:translate(100%)}.type-field.two .background-glider{width:13rem}.type-field .type-item{position:relative}.type-field .type-item button{background:transparent;border:none;border-radius:0;color:#747576;font-size:11px;font-weight:600;text-transform:uppercase;width:100%;height:32px;padding:0 12px;text-align:center}.type-field .type-item button.disabled{background:transparent!important;color:#dbdbdb!important;filter:unset!important;opacity:unset!important;pointer-events:none}.type-field .type-item .info{color:#1e5dd3;font-size:12px;position:absolute;top:10px;right:12px;cursor:pointer}.type-field .type-item.active button{color:#1e5dd3!important}.type-field .background-glider{background:#fff;border-radius:4px;box-shadow:0 1px 3px #161b2f26;position:absolute;display:flex;height:32px;z-index:-1;transition:.25s ease-out}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64, 