import * as i0 from '@angular/core';
import { EventEmitter, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import * as i1 from '@angular/forms';
import { FormsModule } from '@angular/forms';
import { FD_FORM_FIELD_CONTROL } from '@fundamental-ngx/cdk/forms';
import { SliderComponent as SliderComponent$1 } from '@fundamental-ngx/core/slider';
import { BaseInput } from '@fundamental-ngx/platform/shared';
import { ContentDensityModule } from '@fundamental-ngx/core/content-density';

/** Switch change event instance */
class SliderChangeEvent {
}
class SliderComponent extends BaseInput {
    constructor() {
        super(...arguments);
        /** Minimum value. */
        this.min = 0;
        /** Maximum value. */
        this.max = 100;
        /** Step value. */
        this.step = 1;
        /** Jump value. */
        this.jump = 10;
        /** Put a label on every N-th tickmark. */
        this.tickmarksBetweenLabels = 1;
        /**
         * Slider mode.
         * Options include: 'single' | 'range'
         * The default is set to 'single'
         */
        this.mode = 'single';
        /** Toggles the visibility of tick marks. */
        this.showTicks = false;
        /** Toggles the visibility of tick mark labels. Must be used in conjunction with 'showTicks' */
        this.showTicksLabels = false;
        /** Array of custom values to use for Slider. */
        this.customValues = [];
        /** Hides display of colored progress bar. */
        this.hideProgressBar = false;
        /** Whether the slider should be rendered vertically. */
        this.vertical = false;
        /**
         * Event fired when the state of the slider changes.
         * *$event* can be used to retrieve the new state of the slider.
         */
        this.sliderChange = new EventEmitter();
    }
    /** value for slider control */
    set value(selectValue) {
        this.setValue(selectValue);
    }
    get value() {
        return this.getValue();
    }
    /** @hidden */
    _onModelChange(modelValue) {
        this._emitChangeEvent(modelValue);
        this.onTouched();
        this.stateChanges.next('Slider: onValueChange');
    }
    /** @hidden
     * Method to emit change event
     */
    _emitChangeEvent(modelValue) {
        const event = new SliderChangeEvent();
        event.source = this;
        event.payload = modelValue;
        // setting value, it will call setValue()
        this.value = modelValue;
        this.sliderChange.emit(event);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SliderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: SliderComponent, isStandalone: true, selector: "fdp-slider", inputs: { class: "class", min: "min", max: "max", step: "step", jump: "jump", tickmarksBetweenLabels: "tickmarksBetweenLabels", mode: "mode", showTicks: "showTicks", showTicksLabels: "showTicksLabels", customValues: "customValues", tooltipMode: "tooltipMode", hideProgressBar: "hideProgressBar", vertical: "vertical", value: "value" }, outputs: { sliderChange: "sliderChange" }, providers: [{ provide: FD_FORM_FIELD_CONTROL, useExisting: SliderComponent, multi: true }], usesInheritance: true, ngImport: i0, template: "<fd-slider\n    [id]=\"id\"\n    [class]=\"class\"\n    [ariaLabel]=\"ariaLabel\"\n    [ariaLabelledBy]=\"ariaLabelledBy\"\n    [min]=\"min\"\n    [max]=\"max\"\n    [step]=\"step\"\n    [jump]=\"jump\"\n    [mode]=\"mode\"\n    [disabled]=\"disabled\"\n    [showTicks]=\"showTicks\"\n    [showTicksLabels]=\"showTicksLabels\"\n    [tickmarksBetweenLabels]=\"tickmarksBetweenLabels\"\n    [customValues]=\"customValues\"\n    [tooltipMode]=\"tooltipMode\"\n    [hideProgressBar]=\"hideProgressBar\"\n    [ngModel]=\"value\"\n    [vertical]=\"vertical\"\n    (ngModelChange)=\"_onModelChange($event)\"\n></fd-slider>\n", dependencies: [{ kind: "component", type: SliderComponent$1, selector: "fd-slider", inputs: ["id", "class", "ariaLabelledBy", "ariaLabel", "min", "max", "step", "jump", "tickmarksBetweenLabels", "mode", "showTicks", "showTicksLabels", "customValues", "tooltipMode", "hideProgressBar", "disabled", "vertical", "value"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SliderComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fdp-slider', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: FD_FORM_FIELD_CONTROL, useExisting: SliderComponent, multi: true }], imports: [SliderComponent$1, FormsModule], template: "<fd-slider\n    [id]=\"id\"\n    [class]=\"class\"\n    [ariaLabel]=\"ariaLabel\"\n    [ariaLabelledBy]=\"ariaLabelledBy\"\n    [min]=\"min\"\n    [max]=\"max\"\n    [step]=\"step\"\n    [jump]=\"jump\"\n    [mode]=\"mode\"\n    [disabled]=\"disabled\"\n    [showTicks]=\"showTicks\"\n    [showTicksLabels]=\"showTicksLabels\"\n    [tickmarksBetweenLabels]=\"tickmarksBetweenLabels\"\n    [customValues]=\"customValues\"\n    [tooltipMode]=\"tooltipMode\"\n    [hideProgressBar]=\"hideProgressBar\"\n    [ngModel]=\"value\"\n    [vertical]=\"vertical\"\n    (ngModelChange)=\"_onModelChange($event)\"\n></fd-slider>\n" }]
        }], propDecorators: { class: [{
                type: Input
            }], min: [{
                type: Input
            }], max: [{
                type: Input
            }], step: [{
                type: Input
            }], jump: [{
                type: Input
            }], tickmarksBetweenLabels: [{
                type: Input
            }], mode: [{
                type: Input
            }], showTicks: [{
                type: Input
            }], showTicksLabels: [{
                type: Input
            }], customValues: [{
                type: Input
            }], tooltipMode: [{
                type: Input
            }], hideProgressBar: [{
                type: Input
            }], vertical: [{
                type: Input
            }], sliderChange: [{
                type: Output
            }], value: [{
                type: Input
            }] } });

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
class PlatformSliderModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformSliderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: PlatformSliderModule, imports: [ContentDensityModule, SliderComponent], exports: [SliderComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformSliderModule, imports: [ContentDensityModule, SliderComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformSliderModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [ContentDensityModule, SliderComponent],
                    exports: [SliderComponent]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { PlatformSliderModule, SliderChangeEvent, SliderComponent };
//# sourceMappingURL=fundamental-ngx-platform-slider.mjs.map
