import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { TimeAxisDisplayType_$type } from "./TimeAxisDisplayType";
import { IgxTimeAxisBaseComponent } from "./igx-time-axis-base-component";
import { IgxCategoryAxisBaseComponent } from "./igx-category-axis-base-component";
import { IgxAxisComponent } from "./igx-axis-component";
import { CategoryDateTimeXAxis } from "./CategoryDateTimeXAxis";
import { ensureEnum } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents a category-based horizontal X axis that uses a DateTime scale.
*
* `CategoryDateTimeXAxis` class represents a category-based horizontal X axis that uses a DateTime scale.
*
* ```html
* <igx-data-chart
*     [dataSource]="data">
*     <igx-time-x-axis
* 		dateTimeMemberPath="date"
* 		#xAxis>
*     </igx-time-x-axis>
* </igx-data-chart>
* ```
*
* ```ts
* let xAxis = new IgxTimeXAxisComponent();
* xAxis.dataTimeMemberPath="date";
* this.chart.axes.add(xAxis);
* ```
*/
export let IgxCategoryDateTimeXAxisComponent = /*@__PURE__*/ (() => {
    class IgxCategoryDateTimeXAxisComponent extends IgxTimeAxisBaseComponent {
        constructor() {
            super();
            this._actualIntervalChange = null;
            this._actualMinorIntervalChange = null;
        }
        createImplementation() {
            return new CategoryDateTimeXAxis();
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        /**
         * Gets if the current axis is a continuous rather than a discrete scale
        */
        get isContinuous() {
            return this.i.cc;
        }
        /**
         * Gets or sets the axis display type.
         * Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points.
         * Discrete display type will not use a constant interval, but will align each label with its data point.
        *
        * `displayType` property is used for axis display type.
        *
        * Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points. Discrete display type will not use a constant interval, but will align each label with its data point.
        *
        * ```html
        * <igx-data-chart
        *     [dataSource]="data">
        *     <igx-time-x-axis
        * 		dateTimeMemberPath="date"
        * 		displayType ="continuous"
        * 		#xAxis>
        *     </igx-time-x-axis>
        * </igx-data-chart>
        * ```
        */
        get displayType() {
            return this.i.nn;
        }
        set displayType(v) {
            this.i.nn = ensureEnum(TimeAxisDisplayType_$type, v);
        }
        /**
         * Gets or sets the X axis time interval.
        *
        * `Interval` property is used to get/sets the frequency of displayed labels.
        *
        * ```html
        * <igx-data-chart
        *     [dataSource]="data">
        *     <igx-time-x-axis
        * 		dateTimeMemberPath="date"
        * 		interval=2
        * 		#xAxis>
        *     </igx-time-x-axis>
        * </igx-data-chart>
        * ```
        */
        get interval() {
            return this.i.nx;
        }
        set interval(v) {
            this.i.nx = +v;
        }
        /**
         * Gets the effective value for the current Interval.
        */
        get actualInterval() {
            return this.i.nu;
        }
        set actualInterval(v) {
            this.i.nu = +v;
        }
        /**
         * Gets or sets the frequency of displayed minor lines.
         * The set value is a factor that determines how the minor lines will be displayed.
        */
        get minorInterval() {
            return this.i.ny;
        }
        set minorInterval(v) {
            this.i.ny = +v;
        }
        /**
         * Gets the effective value for the current MinorInterval.
        */
        get actualMinorInterval() {
            return this.i.nv;
        }
        set actualMinorInterval(v) {
            this.i.nv = +v;
        }
        /**
         * Gets if the current axis is of category date time axis type
        */
        get isCategoryDateTime() {
            return this.i.cb;
        }
        scrollIntoView(minimum, maximum) {
            this.i.n4(minimum, maximum);
        }
        get actualIntervalChange() {
            if (this._actualIntervalChange == null) {
                this._actualIntervalChange = new EventEmitter();
                this.i.propertyChanged = delegateCombine(this.i.propertyChanged, (o, e) => {
                    let iv = e;
                    let ext = this.actualInterval;
                    if (this.beforeActualIntervalChange) {
                        this.beforeActualIntervalChange(this, ext);
                    }
                    this._actualIntervalChange.emit(ext);
                });
            }
            return this._actualIntervalChange;
        }
        get actualMinorIntervalChange() {
            if (this._actualMinorIntervalChange == null) {
                this._actualMinorIntervalChange = new EventEmitter();
                this.i.propertyChanged = delegateCombine(this.i.propertyChanged, (o, e) => {
                    let iv = e;
                    let ext = this.actualMinorInterval;
                    if (this.beforeActualMinorIntervalChange) {
                        this.beforeActualMinorIntervalChange(this, ext);
                    }
                    this._actualMinorIntervalChange.emit(ext);
                });
            }
            return this._actualMinorIntervalChange;
        }
    }
    IgxCategoryDateTimeXAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxCategoryDateTimeXAxisComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxCategoryDateTimeXAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxCategoryDateTimeXAxisComponent, selector: "igx-category-date-time-x-axis", inputs: { displayType: "displayType", interval: "interval", actualInterval: "actualInterval", minorInterval: "minorInterval", actualMinorInterval: "actualMinorInterval" }, outputs: { actualIntervalChange: "actualIntervalChange", actualMinorIntervalChange: "actualMinorIntervalChange" }, providers: [{ provide: IgxTimeAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxAxisComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxCategoryDateTimeXAxisComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxCategoryDateTimeXAxisComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-category-date-time-x-axis',
                    template: ``,
                    providers: [{ provide: IgxTimeAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxAxisComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { displayType: [{
                type: Input
            }], interval: [{
                type: Input
            }], actualInterval: [{
                type: Input
            }], minorInterval: [{
                type: Input
            }], actualMinorInterval: [{
                type: Input
            }], actualIntervalChange: [{
                type: Output
            }], actualMinorIntervalChange: [{
                type: Output
            }] } });
