import { MXInputBaseValueComponent, AXComponent, AXFocusableComponent, AXValuableComponent, AXClearableComponent } from '@acorex/cdk/common';
import { AXCalendarService } from '@acorex/core/date-time';
import { AXFormatService } from '@acorex/core/format';
import { AXLocaleService } from '@acorex/core/locale';
import { AXPlatform } from '@acorex/core/platform';
import { getWordBoundsAtPosition } from '@acorex/core/utils';
import * as i0 from '@angular/core';
import { inject, signal, input, linkedSignal, viewChild, output, effect, untracked, forwardRef, HostBinding, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import * as i1 from '@angular/forms';
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
import { map } from 'rxjs';

/**
 * A component for date and time input with various custom features.
 *
 * @category Components
 */
class AXDateTimeInputComponent extends MXInputBaseValueComponent {
    constructor() {
        super(...arguments);
        this.platformService = inject(AXPlatform);
        this.formatService = inject(AXFormatService);
        this.localeService = inject(AXLocaleService);
        this.calendarService = inject(AXCalendarService);
        /**
         *  @ignore
         */
        this._editingParts = {
            year: {
                key: 'year',
                placeholder: 'yyyy',
                placeholders: ['YY', 'yy', 'YYYY', 'yyyy'],
                enabled: false,
                default: 2023,
                typedValue: null,
                realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.year.placeholder),
            },
            month: {
                key: 'month',
                placeholder: 'MM',
                placeholders: ['MMM', 'MMMM', 'MM', 'M'],
                enabled: false,
                default: 1,
                typedValue: null,
                realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.month.placeholder),
            },
            day: {
                key: 'day',
                placeholder: 'dd',
                placeholders: ['dd', 'DD', 'd', 'dddd', 'E'],
                enabled: false,
                default: 1,
                typedValue: null,
                realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.day.placeholder),
            },
            hour: {
                key: 'hour',
                placeholder: 'HH',
                placeholders: ['HH', 'H', 'hh', 'h'],
                enabled: false,
                default: 0,
                typedValue: null,
                realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.hour.placeholder),
            },
            minute: {
                key: 'minute',
                placeholder: 'mm',
                placeholders: ['mm', 'm'],
                enabled: false,
                default: 0,
                typedValue: null,
                realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.minute.placeholder),
            },
            second: {
                key: 'second',
                placeholder: 'ss',
                placeholders: ['ss', 's'],
                enabled: false,
                default: 0,
                typedValue: null,
                realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.second.placeholder),
            },
            AMPM: {
                key: 'AMPM',
                placeholder: 'a',
                placeholders: ['a', 'A'],
                enabled: false,
                default: 0,
                typedValue: null,
                realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.AMPM.placeholder),
            },
        };
        /**
         *  @ignore
         */
        this._editingText = signal('', ...(ngDevMode ? [{ debugName: "_editingText" }] : []));
        /**
         *  @ignore
         */
        this._inputChars = [];
        /**
         * Indicates whether typing is allowed in the input field.
         * @defaultValue false
         */
        this.allowTyping = input(false, ...(ngDevMode ? [{ debugName: "allowTyping" }] : []));
        /**
         * @description The calendar type to use for the datetime input.
         */
        this.calendar = input(null, ...(ngDevMode ? [{ debugName: "calendar" }] : []));
        this._calendarSystem = linkedSignal(() => this.calendar(), ...(ngDevMode ? [{ debugName: "_calendarSystem" }] : []));
        this._activePart = signal(null, ...(ngDevMode ? [{ debugName: "_activePart" }] : []));
        // TODO: fix this
        // #effect = effect(() => {
        //   this._activePart()
        //   this._clearInputBuffer();
        // });
        this._editingDate = linkedSignal(() => this.calendarService.now(this._calendarSystem()), ...(ngDevMode ? [{ debugName: "_editingDate" }] : []));
        /**
         *  @ignore
         */
        this.input = viewChild('input', ...(ngDevMode ? [{ debugName: "input" }] : []));
        this.minValue = input(null, ...(ngDevMode ? [{ debugName: "minValue" }] : []));
        this.maxValue = input(null, ...(ngDevMode ? [{ debugName: "maxValue" }] : []));
        /**
         * Emitted when a click event occurs on the datetime box.
         * @event
         */
        this.onClick = output();
        this.picker = input('datetime', ...(ngDevMode ? [{ debugName: "picker" }] : []));
        this._format = linkedSignal(() => this.format(), ...(ngDevMode ? [{ debugName: "_format" }] : []));
        /**
         * @deprecated use locale & mode instead
         */
        this.format = input(...(ngDevMode ? [undefined, { debugName: "format" }] : []));
        this.#effect = effect(() => {
            const profile = this.localeService.activeProfile();
            //
            if (!this.format()) {
                this._format.set(this.format() ?? profile.formats[this.picker()]?.short ?? '');
            }
            //
            if (!this.calendar()) {
                this._calendarSystem.set(profile.calendar.system);
            }
            //
            this._detectParts();
            untracked(() => {
                this._updateText();
            });
        }, ...(ngDevMode ? [{ debugName: "#effect" }] : []));
        /**
         * @description check if page is in rtl or ltr
         */
        this.isRtl = signal(this.platformService.isRtl(), ...(ngDevMode ? [{ debugName: "isRtl" }] : []));
    }
    #effect;
    _detectParts() {
        Object.values(this._editingParts).forEach((e) => {
            e.enabled = false;
        });
        const formatParts = this._format().split(/[^a-zA-Z]+/);
        formatParts.forEach((f) => {
            const found = Object.values(this._editingParts).find((c) => c.placeholders.some((d) => d == f));
            if (found) {
                found.enabled = true;
                found.placeholder = f;
            }
        });
    }
    /**
     * @description listen to direction change to react to it.
     */
    ngOnInit() {
        this.platformService.directionChange.pipe(map((i) => i.data === 'rtl')).subscribe((isRtl) => this.isRtl.set(isRtl));
    }
    /**
     *  @ignore
     */
    _getOrderedParts() {
        // TODO: better spliter format
        const formatParts = this._format().split(/[^a-zA-Z]+/);
        const result = [];
        formatParts.forEach((f) => {
            const found = Object.values(this._editingParts).find((c) => c.placeholders.some((d) => d == f));
            if (found && found.enabled)
                result.push(found);
        });
        return result;
    }
    /**
     *  @ignore
     */
    _clearInputBuffer() {
        this._inputChars = [];
    }
    /**
     *  @ignore
     */
    _updateText() {
        let text = this._format();
        //
        Object.values(this._editingParts).forEach((part) => {
            if (this._activePart() == part.key) {
                if (part.typedValue)
                    text = text.replace(part.placeholder, part.typedValue);
            }
            else {
                if (part.typedValue != part.placeholder && part.typedValue != null) {
                    text = text.replace(part.placeholder, part.realValue());
                }
            }
        });
        this._editingText.set(text == this._format() ? '' : text);
        if (this._activePart()) {
            this._highlightActivePart();
        }
    }
    //TODO: fix this
    /**
     * Sets the internal date value, adjusting it based on editing parts.
     * @param value - The date to set. Returns `undefined` if no value is provided.
     * @ignore
     */
    // override internalSetValue(value?: Date) {
    //   console.log('internalSetValue', value);
    //   if (value) {
    //     let editingDate = this.calendarService.create(value, this._calendarSystem());
    //     let applyChanges = false;
    //     Object.values(this._editingParts).forEach((part) => {
    //       if (!part.enabled) {
    //         editingDate = editingDate.set(part.key as TimeUnit, part.default);
    //         applyChanges = true;
    //       }
    //     });
    //     if (applyChanges) {
    //       return editingDate.date;
    //     }
    //   }
    //   return value;
    // }
    /**
     * Handles changes to the internal date value, updating editing parts and text representation.
     *
     * @param value - The new date value. If not provided, resets editing parts.
     * @ignore
     */
    internalValueChanged(value) {
        if (value && this.calendarService.isValidDate(value)) {
            this._editingDate.set(this.calendarService.create(value, this._calendarSystem()));
        }
        Object.values(this._editingParts).forEach((part) => {
            if (value) {
                if (part.typedValue != part.placeholder)
                    part.typedValue = part.realValue();
            }
            else
                part.typedValue = null;
        });
        this._updateText();
    }
    /**
     *  @ignore
     */
    _handleOnKeydownEvent(e) {
        const ignore = () => {
            if (e.key === 'Tab') {
                return;
            }
            e.preventDefault();
            e.stopPropagation();
        };
        if (!this.allowTyping()) {
            ignore();
            return;
        }
        const input = e.target;
        //
        const orderedParts = this._getOrderedParts();
        const part = this._activePart() ? this._editingParts[this._activePart()] : orderedParts[0];
        const nextPart = part ? orderedParts[orderedParts.indexOf(part) + 1] : null;
        const prevPart = part ? orderedParts[orderedParts.indexOf(part) - 1] : null;
        //
        const goNext = () => {
            this._clearInputBuffer();
            if (nextPart) {
                this._activePart.set(nextPart.key);
                this._highlightActivePart();
            }
        };
        const goPrev = () => {
            this._clearInputBuffer();
            if (prevPart) {
                this._activePart.set(prevPart.key);
                this._highlightActivePart();
            }
        };
        /***************  Handle Left and Right  **************/
        if (e.code === 'ArrowRight' || e.code === 'ArrowLeft') {
            ignore();
            e.code === 'ArrowRight' ? goNext() : goPrev();
        }
        else if ((e.code === 'ArrowUp' || e.code === 'ArrowDown') && !e.ctrlKey) {
            /***************  Handle Up and Down  **************/
            if (this.disabled || this.readonly) {
                ignore();
                return;
            }
            else {
                ignore();
                const sign = e.code === 'ArrowUp' ? +1 : -1;
                this._activePart.set(part.key);
                const newVal = this._editingDate().add(part.key, sign);
                this._editingParts[part.key].typedValue = this.formatService.format(newVal, 'datetime', this._editingParts[part.key].placeholder);
                this._editingDate.set(newVal);
                this._detectValueChanges();
            }
        }
        else if (e.code == 'Backspace' || e.code == 'Delete') {
            /***************  Handle Backspace  **************/
            if (this.disabled || this.readonly) {
                return;
            }
            if (input.value) {
                ignore();
                this._editingParts[part.key].typedValue = this._editingParts[part.key].placeholder;
                this._detectValueChanges();
                goPrev();
            }
        }
        else if (e.code == 'Tab' || e.code == 'Space') {
            /***************  Handle Backspace  **************/
            if (input.value) {
                if (!e.shiftKey && nextPart) {
                    ignore();
                    goNext();
                }
                else if (e.shiftKey && prevPart) {
                    ignore();
                    goPrev();
                }
            }
            // TODO: FiX type in input
        }
        else if (e.key?.trim() && !isNaN(Number(e.key))) {
            ignore();
            return;
            if (this.disabled || this.readonly) {
                return;
            }
            let next = false;
            const editing = this._editingParts[part.key];
            //
            switch (part.key) {
                case 'year': {
                    if (editing.placeholder.length == 2 && this._inputChars.length == 0) {
                        this._inputChars.push(...this.formatService
                            .format(this.calendarService.now(this._calendarSystem()), 'datetime', 'yyyy')
                            .substring(0, 2)
                            .split(''));
                    }
                    if (this._inputChars.length < 4) {
                        editing.typedValue = `${this._inputChars.join('')}${e.key}`;
                        this._inputChars.push(e.key);
                        if (this._inputChars.length > 3) {
                            next = true;
                        }
                    }
                    else {
                        next = true;
                    }
                    editing.typedValue = ('0000' + editing.typedValue).slice(-4);
                    const nv = parseInt(editing.typedValue);
                    //if (nv > 0) {
                    const newVal = this._editingDate().set('year', nv);
                    this._editingDate.set(newVal);
                    this._detectValueChanges();
                    //}
                    break;
                }
                case 'month': {
                    if (this._inputChars.length == 0) {
                        this._inputChars.push(e.key);
                        editing.typedValue = `0${e.key}`;
                        if (parseInt(e.key) > 1) {
                            this._clearInputBuffer();
                            next = true;
                        }
                    }
                    else if (this._inputChars.length == 1) {
                        const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
                        if (newStr > 12) {
                            editing.typedValue = `0${e.key}`;
                        }
                        else {
                            editing.typedValue = newStr.toString();
                        }
                        this._clearInputBuffer();
                        next = true;
                    }
                    editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
                    const nv = parseInt(editing.typedValue);
                    if (nv > 0) {
                        const newVal = this._editingDate().set(part.key, nv);
                        this._editingDate.set(newVal);
                        this._detectValueChanges();
                    }
                    break;
                }
                case 'day': {
                    if (this._inputChars.length == 0) {
                        this._inputChars.push(e.key);
                        editing.typedValue = `0${e.key}`;
                        if (parseInt(e.key) > 3) {
                            this._clearInputBuffer();
                            next = true;
                        }
                    }
                    else if (this._inputChars.length == 1) {
                        const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
                        if (newStr > this._editingDate().month.totalDays) {
                            editing.typedValue = `0${e.key}`;
                        }
                        else {
                            editing.typedValue = newStr.toString();
                        }
                        this._clearInputBuffer();
                        next = true;
                    }
                    editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
                    const nv = parseInt(editing.typedValue);
                    if (nv > 0) {
                        const newVal = this._editingDate().set(part.key, nv);
                        this._editingDate.set(newVal);
                        this._detectValueChanges();
                    }
                    break;
                }
                case 'hour': {
                    if (this._inputChars.length == 0) {
                        this._inputChars.push(e.key);
                        editing.typedValue = `0${e.key}`;
                        if (parseInt(e.key) > 2) {
                            next = true;
                        }
                    }
                    else if (this._inputChars.length == 1) {
                        const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
                        if (newStr > 23) {
                            editing.typedValue = `0${e.key}`;
                        }
                        else {
                            editing.typedValue = newStr.toString();
                        }
                        next = true;
                    }
                    editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
                    const newVal = this._editingDate().set('hour', parseInt(editing.typedValue));
                    this._editingDate.set(newVal);
                    this._detectValueChanges();
                    break;
                }
                case 'minute':
                case 'second':
                    if (this._inputChars.length == 0) {
                        this._inputChars.push(e.key);
                        editing.typedValue = `0${e.key}`;
                        if (parseInt(e.key) > 5) {
                            this._clearInputBuffer();
                            next = true;
                        }
                    }
                    else if (this._inputChars.length == 1) {
                        const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
                        if (newStr > 59) {
                            editing.typedValue = `0${e.key}`;
                        }
                        else {
                            editing.typedValue = newStr.toString();
                        }
                        this._clearInputBuffer();
                        next = true;
                    }
                    editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
                    // eslint-disable-next-line no-case-declarations
                    const newVal = this._editingDate().set(part.key, parseInt(editing.typedValue));
                    this._editingDate.set(newVal);
                    this._detectValueChanges();
                    break;
                default:
            }
            if (next) {
                goNext();
                return;
            }
        }
        /***************  Emit Event  **************/
        super.emitOnKeydownEvent(e);
    }
    /**
     *  @ignore
     */
    _handleKeyUpEvent(e) {
        if (this._activePart()) {
            this._highlightActivePart();
        }
    }
    /**
     *  @ignore
     */
    _handleFocusEvent(e) {
        //this._highlightActivePart();
        super.emitOnFocusEvent(e);
    }
    /**
     *  @ignore
     */
    _handleBlurEvent(e) {
        super.emitOnBlurEvent(e);
    }
    /**
     *  @ignore
     */
    _handleOnInputClickEvent(e) {
        if (this.allowTyping()) {
            setTimeout(() => {
                this._detectPartAtPosition();
            }, 0);
        }
        this.onClick.emit({
            component: this,
            htmlElement: this.getHostElement(),
            nativeEvent: e,
        });
    }
    /**
     *  @ignore
     */
    _detectPartAtPosition() {
        const input = this.input();
        if (!input || !input.value)
            return;
        const sStart = input.selectionEnd || 0;
        const re = /[a-zA-Z0-9]+/gi;
        const valueParts = Array.from(input.value.matchAll(re));
        const orderedParts = this._getOrderedParts();
        const index = valueParts.findIndex((c) => c.index <= sStart && c.index + c[0].length >= sStart);
        this._activePart.set(orderedParts[index].key);
        this._highlightActivePart();
    }
    /**
     *  @ignore
     */
    _highlightActivePart() {
        const input = this.input();
        if (!input || !input.value || !this._activePart())
            return;
        const orderedParts = this._getOrderedParts();
        const index = orderedParts.findIndex((c) => c.key == this._activePart());
        const re = /[a-zA-Z0-9]+/gi;
        const valueParts = Array.from(input.value.matchAll(re));
        const { start, end } = getWordBoundsAtPosition(input.value, valueParts[index]?.index);
        if (input && typeof input.setSelectionRange === 'function') {
            input.setSelectionRange(start, end);
        }
    }
    /**
     *  @ignore
     */
    _detectValueChanges() {
        this.commitValue(this._editingDate().date, true);
    }
    get __hostName() {
        return this.name;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXDateTimeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.9", type: AXDateTimeInputComponent, isStandalone: true, selector: "ax-datetime-input", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, allowTyping: { classPropertyName: "allowTyping", publicName: "allowTyping", isSignal: true, isRequired: false, transformFunction: null }, calendar: { classPropertyName: "calendar", publicName: "calendar", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, picker: { classPropertyName: "picker", publicName: "picker", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange", onClick: "onClick" }, host: { listeners: { "keydown": "_handleOnKeydownEvent($event)", "keyup": "_handleKeyUpEvent($event)" }, properties: { "attr.name": "this.__hostName" } }, providers: [
            { provide: AXComponent, useExisting: AXDateTimeInputComponent },
            { provide: AXFocusableComponent, useExisting: AXDateTimeInputComponent },
            { provide: AXValuableComponent, useExisting: AXDateTimeInputComponent },
            { provide: AXClearableComponent, useExisting: AXDateTimeInputComponent },
            {
                provide: NG_VALUE_ACCESSOR,
                useExisting: forwardRef(() => AXDateTimeInputComponent),
                multi: true,
            },
        ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<input\n  #input\n  id=\"input\"\n  autocomplete=\"off\"\n  autocorrect=\"off\"\n  autocapitalize=\"off\"\n  spellcheck=\"false\"\n  class=\"ax-input\"\n  type=\"text\"\n  [attr.placeholder]=\"placeholder\"\n  [class.ax-state-disabled]=\"disabled\"\n  [class.ax-select-none]=\"!allowTyping()\"\n  [class.ax-state-readonly]=\"readonly\"\n  [disabled]=\"disabled\"\n  [readonly]=\"true\"\n  [ngModel]=\"_editingText()\"\n  (mouseup)=\"_handleOnInputClickEvent($event)\"\n  (blur)=\"_handleBlurEvent($event)\"\n  (focus)=\"_handleFocusEvent($event)\"\n  style=\"display: flex\"\n  [style.justify-items]=\"isRtl() ? 'end' : 'start'\"\n  [tabindex]=\"tabIndex\"\n/>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: [".ax-select-none,.ax-select-none *{-webkit-user-select:none!important;user-select:none!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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.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.3.9", ngImport: i0, type: AXDateTimeInputComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-datetime-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id'], outputs: ['valueChange', 'stateChange', 'onValueChanged', 'onBlur', 'onFocus', 'readonlyChange', 'disabledChange'], providers: [
                        { provide: AXComponent, useExisting: AXDateTimeInputComponent },
                        { provide: AXFocusableComponent, useExisting: AXDateTimeInputComponent },
                        { provide: AXValuableComponent, useExisting: AXDateTimeInputComponent },
                        { provide: AXClearableComponent, useExisting: AXDateTimeInputComponent },
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => AXDateTimeInputComponent),
                            multi: true,
                        },
                    ], imports: [FormsModule], template: "<input\n  #input\n  id=\"input\"\n  autocomplete=\"off\"\n  autocorrect=\"off\"\n  autocapitalize=\"off\"\n  spellcheck=\"false\"\n  class=\"ax-input\"\n  type=\"text\"\n  [attr.placeholder]=\"placeholder\"\n  [class.ax-state-disabled]=\"disabled\"\n  [class.ax-select-none]=\"!allowTyping()\"\n  [class.ax-state-readonly]=\"readonly\"\n  [disabled]=\"disabled\"\n  [readonly]=\"true\"\n  [ngModel]=\"_editingText()\"\n  (mouseup)=\"_handleOnInputClickEvent($event)\"\n  (blur)=\"_handleBlurEvent($event)\"\n  (focus)=\"_handleFocusEvent($event)\"\n  style=\"display: flex\"\n  [style.justify-items]=\"isRtl() ? 'end' : 'start'\"\n  [tabindex]=\"tabIndex\"\n/>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: [".ax-select-none,.ax-select-none *{-webkit-user-select:none!important;user-select:none!important}\n"] }]
        }], propDecorators: { allowTyping: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowTyping", required: false }] }], calendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendar", required: false }] }], input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], picker: [{ type: i0.Input, args: [{ isSignal: true, alias: "picker", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], _handleOnKeydownEvent: [{
                type: HostListener,
                args: ['keydown', ['$event']]
            }], _handleKeyUpEvent: [{
                type: HostListener,
                args: ['keyup', ['$event']]
            }], __hostName: [{
                type: HostBinding,
                args: ['attr.name']
            }] } });

class AXDateTimeInputModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXDateTimeInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.9", ngImport: i0, type: AXDateTimeInputModule, imports: [AXDateTimeInputComponent], exports: [AXDateTimeInputComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXDateTimeInputModule, imports: [AXDateTimeInputComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXDateTimeInputModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [AXDateTimeInputComponent],
                    exports: [AXDateTimeInputComponent],
                }]
        }] });

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

export { AXDateTimeInputComponent, AXDateTimeInputModule };
//# sourceMappingURL=acorex-components-datetime-input.mjs.map
