import { __decorate, __metadata } from "tslib";
import { Component, ElementRef, forwardRef, Injector, ViewEncapsulation } from '@angular/core';
import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
import { MatSliderModule } from '@angular/material/slider';
import { MatTooltipModule } from '@angular/material/tooltip';
import { BooleanInputConverter, NumberInputConverter } from '../../../decorators/input-converter';
import { OFormDataComponent } from '../../o-form-data-component.class';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "@angular/material/slider";
import * as i3 from "@angular/material/tooltip";
export const DEFAULT_INPUTS_O_SLIDER_INPUT = [
    'color',
    'max',
    'min',
    'step',
    'thumbLabel:thumb-label',
    'oDisplayWith:display-with',
    'showTickMarks:show-tick-marks'
];
export class OSliderComponent extends OFormDataComponent {
    ;
    constructor(elRef, injector) {
        super(elRef, injector);
        this.thumbLabel = false;
        this.showTickMarks = false;
        this.step = 1;
        this.oDisplayWith = (value) => `${value}`;
    }
    onClickBlocker(evt) {
        evt.stopPropagation();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: OSliderComponent, deps: [{ token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: OSliderComponent, isStandalone: true, selector: "o-slider", inputs: { color: "color", max: "max", min: "min", step: "step", thumbLabel: ["thumb-label", "thumbLabel"], oDisplayWith: ["display-with", "oDisplayWith"], showTickMarks: ["show-tick-marks", "showTickMarks"] }, host: { classAttribute: "o-slider" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => OSliderComponent), multi: true }], usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"getFormGroup()\" class=\"relative\" [matTooltip]=\"tooltip\" [matTooltipClass]=\"tooltipClass\" [matTooltipPosition]=\"tooltipPosition\"\n  [matTooltipShowDelay]=\"tooltipShowDelay\" [matTooltipHideDelay]=\"tooltipHideDelay\">\n  @switch (true) {\n    @case (thumbLabel && !showTickMarks) {\n      <mat-slider discrete [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\"\n        [displayWith]=\"oDisplayWith\">\n        <input matSliderThumb (change)=\"onChangeEvent($event)\" [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n    @case (!thumbLabel && !showTickMarks) {\n      <mat-slider [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\" [displayWith]=\"oDisplayWith\">\n        <input matSliderThumb (change)=\"onChangeEvent($event)\"  [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n    @case (thumbLabel && showTickMarks) {\n      <mat-slider [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\" discrete\n        [displayWith]=\"oDisplayWith\" showTickMarks>\n        <input matSliderThumb (change)=\"onChangeEvent($event)\" [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n    @case (!thumbLabel && showTickMarks) {\n      <mat-slider [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\" [displayWith]=\"oDisplayWith\"\n        showTickMarks>\n        <input matSliderThumb (change)=\"onChangeEvent($event)\" [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n  }\n  @if (isReadOnly) {\n    <div (click)=\"onClickBlocker($event)\" class=\"read-only-blocker o-flex-fill\"></div>\n  }\n\n</div>\n\n\n", styles: [".o-slider .read-only-blocker{z-index:2;position:absolute;top:0;left:0;right:0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i2.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i2.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
__decorate([
    BooleanInputConverter(),
    __metadata("design:type", Boolean)
], OSliderComponent.prototype, "thumbLabel", void 0);
__decorate([
    BooleanInputConverter(),
    __metadata("design:type", Boolean)
], OSliderComponent.prototype, "showTickMarks", void 0);
__decorate([
    NumberInputConverter(),
    __metadata("design:type", Number)
], OSliderComponent.prototype, "min", void 0);
__decorate([
    NumberInputConverter(),
    __metadata("design:type", Number)
], OSliderComponent.prototype, "max", void 0);
__decorate([
    NumberInputConverter(),
    __metadata("design:type", Number)
], OSliderComponent.prototype, "step", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: OSliderComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [ReactiveFormsModule, MatSliderModule, MatTooltipModule], selector: 'o-slider', host: {
                        class: 'o-slider'
                    }, inputs: DEFAULT_INPUTS_O_SLIDER_INPUT, encapsulation: ViewEncapsulation.None, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => OSliderComponent), multi: true }], template: "<div [formGroup]=\"getFormGroup()\" class=\"relative\" [matTooltip]=\"tooltip\" [matTooltipClass]=\"tooltipClass\" [matTooltipPosition]=\"tooltipPosition\"\n  [matTooltipShowDelay]=\"tooltipShowDelay\" [matTooltipHideDelay]=\"tooltipHideDelay\">\n  @switch (true) {\n    @case (thumbLabel && !showTickMarks) {\n      <mat-slider discrete [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\"\n        [displayWith]=\"oDisplayWith\">\n        <input matSliderThumb (change)=\"onChangeEvent($event)\" [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n    @case (!thumbLabel && !showTickMarks) {\n      <mat-slider [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\" [displayWith]=\"oDisplayWith\">\n        <input matSliderThumb (change)=\"onChangeEvent($event)\"  [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n    @case (thumbLabel && showTickMarks) {\n      <mat-slider [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\" discrete\n        [displayWith]=\"oDisplayWith\" showTickMarks>\n        <input matSliderThumb (change)=\"onChangeEvent($event)\" [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n    @case (!thumbLabel && showTickMarks) {\n      <mat-slider [color]=\"color\" [max]=\"max\" [min]=\"min\" [step]=\"step\" [displayWith]=\"oDisplayWith\"\n        showTickMarks>\n        <input matSliderThumb (change)=\"onChangeEvent($event)\" [id]=\"getAttribute()\" [formControlName]=\"getAttribute()\" />\n      </mat-slider>\n    }\n  }\n  @if (isReadOnly) {\n    <div (click)=\"onClickBlocker($event)\" class=\"read-only-blocker o-flex-fill\"></div>\n  }\n\n</div>\n\n\n", styles: [".o-slider .read-only-blocker{z-index:2;position:absolute;top:0;left:0;right:0}\n"] }]
        }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Injector }], propDecorators: { thumbLabel: [], showTickMarks: [], min: [], max: [], step: [] } });
//# sourceMappingURL=data:application/json;base64, 