import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, Input, Output, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import * as i2 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { Destroy, KeyCodes } from '@deja-js/component/core';
import { Subject, ReplaySubject, timer, map, filter, shareReplay, debounceTime, withLatestFrom, tap, switchMap, fromEvent, mergeWith, startWith, delay, takeUntil, combineLatestWith } from 'rxjs';

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
class DejaNumericStepperComponent extends Destroy {
    constructor(elementRef, changeDetectorRef) {
        super();
        this.elementRef = elementRef;
        this.changeDetectorRef = changeDetectorRef;
        this.layout = 'vertical';
        this.increment = new EventEmitter();
        this.decrement = new EventEmitter();
        this.hover = null;
        this.leftUp = null;
        this.leftDown = null;
        this.topUp = null;
        this.topDown = null;
        this.leftShadow = null;
        this.topShadow = null;
        this.widthShadow = null;
        this.heightShadow = null;
        this.disableUp = false;
        this.disableDown = false;
        this.clickArrow$ = new Subject();
        this.show$ = new ReplaySubject(1);
        this.validateArrows$ = new Subject();
        this._arrowIcons = false;
        this._showOnInit = false;
        this.arrowSize = 32;
        this.parentAppearance = null;
    }
    set arrowIcons(value) {
        this._arrowIcons = coerceBooleanProperty(value);
    }
    get arrowIcons() {
        return this._arrowIcons;
    }
    set showOnInit(value) {
        this._showOnInit = coerceBooleanProperty(value);
    }
    get showOnInit() {
        return this._showOnInit;
    }
    ngOnInit() {
        const calcPositions = (linkedElements) => {
            const containerBounds = linkedElements.containerElement?.getBoundingClientRect();
            const formFieldBounds = linkedElements.formFieldElement?.getBoundingClientRect();
            const inputBounds = linkedElements.inputElement.getBoundingClientRect() || formFieldBounds;
            const bounds = this.elementRef.nativeElement.getBoundingClientRect();
            this.validateArrows$.next();
            // Ensure delayed hover in case of the mouse leave accidentally
            linkedElements.formFieldElement.setAttribute('hover', '');
            if (this.layout === 'horizontal') {
                this.heightShadow = Math.min(48, containerBounds?.height || formFieldBounds.height) + 2;
                this.topShadow = (containerBounds?.top ?? inputBounds.top + (inputBounds.height - this.heightShadow) / 2 - 5) - bounds.top;
                this.leftDown = this.leftShadow = formFieldBounds.left - bounds.left - 28;
                this.leftUp = formFieldBounds.right - bounds.left;
                this.widthShadow = this.leftUp - this.leftDown + 28;
                if (this.parentAppearance === 'LEGACY' || this.parentAppearance === 'STANDARD') {
                    this.heightShadow -= 6;
                }
                else if (this.parentAppearance === 'FILL') {
                    this.heightShadow -= 2;
                }
                this.topUp = this.topDown = inputBounds.top + (inputBounds.height - this.arrowSize) / 2 - bounds.top;
            }
            else if (this.layout === 'horizontal-inlay') {
                this.heightShadow = Math.min(48, containerBounds?.height || formFieldBounds.height) + 4;
                this.topShadow = containerBounds?.top ?? (inputBounds.top + (inputBounds.height - this.heightShadow) / 2 - 5) - bounds.top;
                this.leftDown = this.leftShadow = formFieldBounds.left - bounds.left;
                this.leftUp = formFieldBounds.right - bounds.left - 28;
                this.widthShadow = this.leftUp - this.leftDown + 28;
                if (this.parentAppearance === 'LEGACY' || this.parentAppearance === 'STANDARD') {
                    const addedPadding = 6;
                    this.widthShadow += addedPadding * 2;
                    this.leftDown -= addedPadding;
                    this.leftUp += addedPadding;
                    this.heightShadow -= addedPadding;
                    this.leftShadow -= addedPadding;
                }
                else if (this.parentAppearance === 'FILL') {
                    this.heightShadow -= 2;
                }
                this.topUp = this.topDown = inputBounds.top + (inputBounds.height - this.arrowSize) / 2 - bounds.top;
            }
            else {
                this.heightShadow = 90;
                this.topShadow = inputBounds.top - bounds.top + (inputBounds.height - this.heightShadow) / 2;
                this.leftShadow = (containerBounds?.left ?? formFieldBounds.left) - bounds.left;
                this.topUp = this.topShadow;
                this.topDown = this.topShadow + this.heightShadow - this.arrowSize;
                this.widthShadow = containerBounds?.width || formFieldBounds.width;
                this.leftUp = this.leftDown = formFieldBounds.left + (formFieldBounds.width - this.arrowSize) / 2 - bounds.left;
            }
            this.changeDetectorRef.markForCheck();
        };
        const linkedElements$ = timer(100).pipe(map(() => {
            // Find form field
            let parentElement = this.elementRef.nativeElement.parentElement;
            let formFieldElement;
            let containerElement;
            let inputElement;
            // eslint-disable-next-line no-loops/no-loops
            while (parentElement) {
                if (parentElement.tagName === 'MAT-FORM-FIELD' || parentElement.hasAttribute('deja-numeric-stepper-form-field')) {
                    formFieldElement = parentElement;
                }
                if (parentElement.hasAttribute('deja-numeric-stepper-container')) {
                    containerElement = parentElement;
                }
                if (containerElement && formFieldElement) {
                    break;
                }
                parentElement = parentElement.parentElement;
            }
            if (formFieldElement) {
                formFieldElement.setAttribute('deja-numeric-stepper-form-field', this.layout);
                this.parentAppearance = formFieldElement.getAttribute('appearance')?.toUpperCase();
            }
            if (!formFieldElement) {
                console.error('deja-numeric-stepper work only inside a mat-form-field or a [deja-numeric-stepper-form-field] element');
            }
            else {
                inputElement = formFieldElement.getElementsByTagName('INPUT')?.[0] || null;
                if (!inputElement) {
                    console.error('deja-numeric-stepper work only inside a mat-form-field or a [deja-numeric-stepper-form-field] element containing an input element');
                }
            }
            return { formFieldElement, containerElement, inputElement };
        }), filter(containerElements => containerElements.formFieldElement && !!containerElements.inputElement), shareReplay(1));
        const step = (inputElement, event, fn) => {
            if (this[event].observed) {
                this[event].emit();
            }
            else {
                if (inputElement?.type !== 'number') {
                    throw new Error(DejaNumericStepperComponent.TYPE_ERROR);
                }
                if (!inputElement[fn]) {
                    throw new Error(DejaNumericStepperComponent.STEP_FN_ERROR);
                }
                if (!this.input?.ngControl?.control) {
                    throw new Error(DejaNumericStepperComponent.INPUT_ERROR);
                }
                inputElement[fn]();
                this.input.ngControl.control.setValue(+inputElement.value);
            }
            this.validateArrows$.next();
        };
        const step$ = this.clickArrow$.pipe(debounceTime(10), withLatestFrom(linkedElements$), tap(([isUp, linkedElements]) => {
            if (isUp && !this.disableUp) {
                step(linkedElements.inputElement, 'increment', 'stepUp');
            }
            if (!isUp && !this.disableDown) {
                step(linkedElements.inputElement, 'decrement', 'stepDown');
            }
        }), shareReplay({ bufferSize: 1, refCount: false }));
        const valueChange$ = linkedElements$.pipe(switchMap(linkedElements => fromEvent(linkedElements.inputElement, 'input').pipe(mergeWith(step$, fromEvent(linkedElements.inputElement, 'paste'), fromEvent(linkedElements.inputElement, 'keypress')))), debounceTime(50), startWith(null));
        linkedElements$.pipe(switchMap(linkedElements => fromEvent(linkedElements.containerElement || linkedElements.formFieldElement, 'mouseenter').pipe(switchMap(() => valueChange$), mergeWith(this.show$.pipe(delay(200))), tap(() => calcPositions(linkedElements)), switchMap(() => fromEvent(linkedElements.containerElement || linkedElements.formFieldElement, 'mouseleave')), delay(400), tap(() => {
            linkedElements.formFieldElement.removeAttribute('hover');
        }))), takeUntil(this.destroyed$)).subscribe();
        linkedElements$.pipe(switchMap(linkedElements => fromEvent(linkedElements.formFieldElement, 'keydown')), filter(event => event.code === KeyCodes.UpArrow || event.code === KeyCodes.DownArrow), takeUntil(this.destroyed$)).subscribe(event => {
            this.clickArrow$.next(event.code === KeyCodes.UpArrow);
            event.preventDefault();
            return false;
        });
        linkedElements$.pipe(combineLatestWith(this.validateArrows$), debounceTime(1), takeUntil(this.destroyed$)).subscribe(([inputElement]) => {
            if (inputElement.inputElement.disabled) {
                this.disableDown = true;
                this.disableUp = true;
            }
            else {
                const min = inputElement.inputElement.min;
                this.disableDown = min !== '' && !isNaN(+min) && +inputElement.inputElement.value <= +min;
                const max = inputElement.inputElement.max;
                this.disableUp = max !== '' && !isNaN(+max) && +inputElement.inputElement.value >= +max;
            }
            this.changeDetectorRef.markForCheck();
        });
        step$.pipe(takeUntil(this.destroyed$)).subscribe();
        if (this.showOnInit) {
            this.show$.next();
        }
    }
}
DejaNumericStepperComponent.TYPE_ERROR = 'Input element on the same mat-form-field must be type="number". With other input type, use increment or decrement events and implement your proper functions to change the value.';
DejaNumericStepperComponent.STEP_FN_ERROR = 'Input element on the same mat-form-field must implement stepDown/stepUp functions.';
DejaNumericStepperComponent.INPUT_ERROR = 'To use the automatic binding, you must specify the input field with a matInput reference. [input]="matInputRef"';
DejaNumericStepperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DejaNumericStepperComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
DejaNumericStepperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.1", type: DejaNumericStepperComponent, selector: "deja-numeric-stepper", inputs: { layout: "layout", input: "input", arrowIcons: "arrowIcons", showOnInit: "showOnInit" }, outputs: { increment: "increment", decrement: "decrement" }, host: { properties: { "attr.layout": "this.layout", "attr.hover": "this.hover" } }, usesInheritance: true, ngImport: i0, template: "<mat-icon *ngIf=\"leftUp !== null\" class=\"arrow noselect increment\" [attr.disabled]=\"disableUp || null\" [style.left.px]=\"leftUp\" [style.top.px]=\"topUp\" (click)=\"clickArrow$.next(true)\">{{ (!arrowIcons && \"add\") || (layout===\"vertical\" && \"keyboard_arrow_up\") || \"keyboard_arrow_right\" }}</mat-icon>\n<mat-icon *ngIf=\"leftDown !== null\" class=\"arrow noselect decrement\" [attr.disabled]=\"disableDown || null\" [style.left.px]=\"leftDown\" [style.top.px]=\"topDown\" (click)=\"clickArrow$.next(false)\">{{ (!arrowIcons && \"remove\") || (layout===\"vertical\" && \"keyboard_arrow_down\") || \"keyboard_arrow_left\" }}</mat-icon>\n<div *ngIf=\"widthShadow !== null\" class=\"shadow\" [style.left.px]=\"leftShadow\" [style.width.px]=\"widthShadow\" [style.top.px]=\"topShadow\" [style.height.px]=\"heightShadow\"></div>\n", styles: ["[deja-numeric-stepper-container] .mat-form-field .mat-form-field-infix,[deja-numeric-stepper-form-field] .mat-form-field-infix{display:inline-flex;justify-content:center;align-items:center}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=vertical]:not(.disabled):hover .mat-form-field-label-wrapper,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=vertical]:not(.disabled):hover .mat-form-field-label-wrapper{opacity:0!important}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=vertical]:not(.disabled):hover.mat-form-field-invalid .mat-form-field-subscript-wrapper,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=vertical]:not(.disabled):hover.mat-form-field-invalid .mat-form-field-subscript-wrapper{visibility:hidden}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled) input:not([inputAutosize]),[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled) input:not([inputAutosize]){width:calc(100% - 64px)}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([float-label=always]) .mat-form-field-label.mat-empty,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([float-label=always]) .mat-form-field-label.mat-empty{padding-left:23px}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField] .mat-form-field-infix,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField] .mat-form-field-infix{padding:1em 23px}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField].mat-form-field-appearance-outline .mat-form-field-infix,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField].mat-form-field-appearance-outline .mat-form-field-infix{padding:1em 18px}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([inputAutosizeFormField]).mat-form-field-appearance-fill input,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([inputAutosizeFormField]).mat-form-field-appearance-fill input{margin:0 18px}[deja-numeric-stepper-container] .mat-form-field .noselect,[deja-numeric-stepper-form-field] .noselect{-webkit-touch-callout:none;user-select:none}[deja-numeric-stepper-container] .mat-form-field *,[deja-numeric-stepper-form-field] *{transition:opacity .25s ease-out}[deja-numeric-stepper-container] .mat-form-field input::-webkit-inner-spin-button,[deja-numeric-stepper-container] .mat-form-field input::-webkit-outer-spin-button,[deja-numeric-stepper-form-field] input::-webkit-inner-spin-button,[deja-numeric-stepper-form-field] input::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0!important;-moz-appearance:textfield!important}[deja-numeric-stepper-container] .mat-form-field .mat-input-element,[deja-numeric-stepper-form-field] .mat-input-element{text-align:center}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .arrow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .shadow,[deja-numeric-stepper-form-field]:not(.disabled):hover .arrow,[deja-numeric-stepper-form-field]:not(.disabled):hover .shadow{opacity:1}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-outline,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-outline-thick,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-underline,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-outline,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-outline-thick,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-underline{opacity:0!important}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-label-wrapper,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover input,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-label-wrapper,[deja-numeric-stepper-form-field]:not(.disabled):hover input{z-index:10003}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover input,[deja-numeric-stepper-form-field]:not(.disabled):hover input{position:relative}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .arrow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .shadow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled)[hover] .arrow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled)[hover] .shadow,[deja-numeric-stepper-form-field]:not(.disabled):hover .arrow,[deja-numeric-stepper-form-field]:not(.disabled):hover .shadow,[deja-numeric-stepper-form-field]:not(.disabled)[hover] .arrow,[deja-numeric-stepper-form-field]:not(.disabled)[hover] .shadow{visibility:visible}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper,[deja-numeric-stepper-form-field] deja-numeric-stepper{position:relative;z-index:10002}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .arrow,[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .shadow,[deja-numeric-stepper-form-field] deja-numeric-stepper .arrow,[deja-numeric-stepper-form-field] deja-numeric-stepper .shadow{position:absolute;visibility:hidden;opacity:0}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .arrow,[deja-numeric-stepper-form-field] deja-numeric-stepper .arrow{cursor:pointer;display:flex;justify-content:center;align-items:center;box-sizing:border-box;z-index:10004;height:32px;width:32px}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .arrow[disabled=true],[deja-numeric-stepper-form-field] deja-numeric-stepper .arrow[disabled=true]{cursor:default}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .shadow,[deja-numeric-stepper-form-field] deja-numeric-stepper .shadow{border-radius:4px;box-shadow:0 2px 4px #0000004d}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .increment,[deja-numeric-stepper-form-field] deja-numeric-stepper .increment{border-radius:4px 4px 0 0}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .decrement,[deja-numeric-stepper-form-field] deja-numeric-stepper .decrement{border-radius:0 0 4px 4px}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal] .increment,[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal-inlay] .increment,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal] .increment,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal-inlay] .increment{border-radius:0 4px 4px 0}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal] .decrement,[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal-inlay] .decrement,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal] .decrement,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal-inlay] .decrement{border-radius:4px 0 0 4px}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .shadow:after,[deja-numeric-stepper-form-field] deja-numeric-stepper .shadow:after{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DejaNumericStepperComponent, decorators: [{
            type: Component,
            args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'deja-numeric-stepper', encapsulation: ViewEncapsulation.None, template: "<mat-icon *ngIf=\"leftUp !== null\" class=\"arrow noselect increment\" [attr.disabled]=\"disableUp || null\" [style.left.px]=\"leftUp\" [style.top.px]=\"topUp\" (click)=\"clickArrow$.next(true)\">{{ (!arrowIcons && \"add\") || (layout===\"vertical\" && \"keyboard_arrow_up\") || \"keyboard_arrow_right\" }}</mat-icon>\n<mat-icon *ngIf=\"leftDown !== null\" class=\"arrow noselect decrement\" [attr.disabled]=\"disableDown || null\" [style.left.px]=\"leftDown\" [style.top.px]=\"topDown\" (click)=\"clickArrow$.next(false)\">{{ (!arrowIcons && \"remove\") || (layout===\"vertical\" && \"keyboard_arrow_down\") || \"keyboard_arrow_left\" }}</mat-icon>\n<div *ngIf=\"widthShadow !== null\" class=\"shadow\" [style.left.px]=\"leftShadow\" [style.width.px]=\"widthShadow\" [style.top.px]=\"topShadow\" [style.height.px]=\"heightShadow\"></div>\n", styles: ["[deja-numeric-stepper-container] .mat-form-field .mat-form-field-infix,[deja-numeric-stepper-form-field] .mat-form-field-infix{display:inline-flex;justify-content:center;align-items:center}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=vertical]:not(.disabled):hover .mat-form-field-label-wrapper,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=vertical]:not(.disabled):hover .mat-form-field-label-wrapper{opacity:0!important}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=vertical]:not(.disabled):hover.mat-form-field-invalid .mat-form-field-subscript-wrapper,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=vertical]:not(.disabled):hover.mat-form-field-invalid .mat-form-field-subscript-wrapper{visibility:hidden}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled) input:not([inputAutosize]),[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled) input:not([inputAutosize]){width:calc(100% - 64px)}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([float-label=always]) .mat-form-field-label.mat-empty,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([float-label=always]) .mat-form-field-label.mat-empty{padding-left:23px}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField] .mat-form-field-infix,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField] .mat-form-field-infix{padding:1em 23px}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField].mat-form-field-appearance-outline .mat-form-field-infix,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover[inputAutosizeFormField].mat-form-field-appearance-outline .mat-form-field-infix{padding:1em 18px}[deja-numeric-stepper-container] .mat-form-field[deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([inputAutosizeFormField]).mat-form-field-appearance-fill input,[deja-numeric-stepper-form-field][deja-numeric-stepper-form-field=horizontal-inlay]:not(.disabled):hover:not([inputAutosizeFormField]).mat-form-field-appearance-fill input{margin:0 18px}[deja-numeric-stepper-container] .mat-form-field .noselect,[deja-numeric-stepper-form-field] .noselect{-webkit-touch-callout:none;user-select:none}[deja-numeric-stepper-container] .mat-form-field *,[deja-numeric-stepper-form-field] *{transition:opacity .25s ease-out}[deja-numeric-stepper-container] .mat-form-field input::-webkit-inner-spin-button,[deja-numeric-stepper-container] .mat-form-field input::-webkit-outer-spin-button,[deja-numeric-stepper-form-field] input::-webkit-inner-spin-button,[deja-numeric-stepper-form-field] input::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0!important;-moz-appearance:textfield!important}[deja-numeric-stepper-container] .mat-form-field .mat-input-element,[deja-numeric-stepper-form-field] .mat-input-element{text-align:center}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .arrow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .shadow,[deja-numeric-stepper-form-field]:not(.disabled):hover .arrow,[deja-numeric-stepper-form-field]:not(.disabled):hover .shadow{opacity:1}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-outline,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-outline-thick,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-underline,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-outline,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-outline-thick,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-underline{opacity:0!important}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .mat-form-field-label-wrapper,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover input,[deja-numeric-stepper-form-field]:not(.disabled):hover .mat-form-field-label-wrapper,[deja-numeric-stepper-form-field]:not(.disabled):hover input{z-index:10003}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover input,[deja-numeric-stepper-form-field]:not(.disabled):hover input{position:relative}[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .arrow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled):hover .shadow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled)[hover] .arrow,[deja-numeric-stepper-container] .mat-form-field:not(.disabled)[hover] .shadow,[deja-numeric-stepper-form-field]:not(.disabled):hover .arrow,[deja-numeric-stepper-form-field]:not(.disabled):hover .shadow,[deja-numeric-stepper-form-field]:not(.disabled)[hover] .arrow,[deja-numeric-stepper-form-field]:not(.disabled)[hover] .shadow{visibility:visible}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper,[deja-numeric-stepper-form-field] deja-numeric-stepper{position:relative;z-index:10002}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .arrow,[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .shadow,[deja-numeric-stepper-form-field] deja-numeric-stepper .arrow,[deja-numeric-stepper-form-field] deja-numeric-stepper .shadow{position:absolute;visibility:hidden;opacity:0}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .arrow,[deja-numeric-stepper-form-field] deja-numeric-stepper .arrow{cursor:pointer;display:flex;justify-content:center;align-items:center;box-sizing:border-box;z-index:10004;height:32px;width:32px}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .arrow[disabled=true],[deja-numeric-stepper-form-field] deja-numeric-stepper .arrow[disabled=true]{cursor:default}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .shadow,[deja-numeric-stepper-form-field] deja-numeric-stepper .shadow{border-radius:4px;box-shadow:0 2px 4px #0000004d}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .increment,[deja-numeric-stepper-form-field] deja-numeric-stepper .increment{border-radius:4px 4px 0 0}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .decrement,[deja-numeric-stepper-form-field] deja-numeric-stepper .decrement{border-radius:0 0 4px 4px}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal] .increment,[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal-inlay] .increment,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal] .increment,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal-inlay] .increment{border-radius:0 4px 4px 0}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal] .decrement,[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper[layout=horizontal-inlay] .decrement,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal] .decrement,[deja-numeric-stepper-form-field] deja-numeric-stepper[layout=horizontal-inlay] .decrement{border-radius:4px 0 0 4px}[deja-numeric-stepper-container] .mat-form-field deja-numeric-stepper .shadow:after,[deja-numeric-stepper-form-field] deja-numeric-stepper .shadow:after{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { layout: [{
                type: HostBinding,
                args: ['attr.layout']
            }, {
                type: Input
            }], increment: [{
                type: Output
            }], decrement: [{
                type: Output
            }], input: [{
                type: Input
            }], arrowIcons: [{
                type: Input
            }], showOnInit: [{
                type: Input
            }], hover: [{
                type: HostBinding,
                args: ['attr.hover']
            }] } });

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
class DejaNumericStepperModule {
}
DejaNumericStepperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DejaNumericStepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
DejaNumericStepperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: DejaNumericStepperModule, declarations: [DejaNumericStepperComponent], imports: [CommonModule,
        FormsModule,
        MatFormFieldModule,
        MatIconModule,
        MatInputModule,
        ReactiveFormsModule], exports: [DejaNumericStepperComponent] });
DejaNumericStepperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DejaNumericStepperModule, imports: [CommonModule,
        FormsModule,
        MatFormFieldModule,
        MatIconModule,
        MatInputModule,
        ReactiveFormsModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: DejaNumericStepperModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [DejaNumericStepperComponent],
                    exports: [DejaNumericStepperComponent],
                    imports: [
                        CommonModule,
                        FormsModule,
                        MatFormFieldModule,
                        MatIconModule,
                        MatInputModule,
                        ReactiveFormsModule
                    ]
                }]
        }] });

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

export { DejaNumericStepperComponent, DejaNumericStepperModule };
//# sourceMappingURL=deja-js-component-v2-numeric-stepper.mjs.map
