import { Directive, HostBinding } from '@angular/core';
import { IgxDropDirective } from '../../directives/drag-drop/drag-drop.directive';
import * as i0 from "@angular/core";
import * as i1 from "../grouping/group-by-area.directive";
/**
 * @hidden
 */
export class IgxGroupByRowTemplateDirective {
    constructor(template) {
        this.template = template;
    }
}
IgxGroupByRowTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxGroupByRowTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
IgxGroupByRowTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxGroupByRowTemplateDirective, selector: "[igxGroupByRow]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxGroupByRowTemplateDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxGroupByRow]'
                }]
        }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
/**
 * @hidden
 */
export class IgxGridDetailTemplateDirective {
}
IgxGridDetailTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxGridDetailTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxGridDetailTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxGridDetailTemplateDirective, selector: "[igxGridDetail]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxGridDetailTemplateDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxGridDetail]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxRowExpandedIndicatorDirective {
}
IgxRowExpandedIndicatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxRowExpandedIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxRowExpandedIndicatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxRowExpandedIndicatorDirective, selector: "[igxRowExpandedIndicator]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxRowExpandedIndicatorDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxRowExpandedIndicator]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxRowCollapsedIndicatorDirective {
}
IgxRowCollapsedIndicatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxRowCollapsedIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxRowCollapsedIndicatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxRowCollapsedIndicatorDirective, selector: "[igxRowCollapsedIndicator]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxRowCollapsedIndicatorDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxRowCollapsedIndicator]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxHeaderExpandIndicatorDirective {
}
IgxHeaderExpandIndicatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxHeaderExpandIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxHeaderExpandIndicatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxHeaderExpandIndicatorDirective, selector: "[igxHeaderExpandedIndicator]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxHeaderExpandIndicatorDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxHeaderExpandedIndicator]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxHeaderCollapseIndicatorDirective {
}
IgxHeaderCollapseIndicatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxHeaderCollapseIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxHeaderCollapseIndicatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxHeaderCollapseIndicatorDirective, selector: "[igxHeaderCollapsedIndicator]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxHeaderCollapseIndicatorDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxHeaderCollapsedIndicator]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxExcelStyleHeaderIconDirective {
}
IgxExcelStyleHeaderIconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxExcelStyleHeaderIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxExcelStyleHeaderIconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxExcelStyleHeaderIconDirective, selector: "[igxExcelStyleHeaderIcon]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxExcelStyleHeaderIconDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxExcelStyleHeaderIcon]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxSortHeaderIconDirective {
}
IgxSortHeaderIconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxSortHeaderIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxSortHeaderIconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxSortHeaderIconDirective, selector: "[igxSortHeaderIcon]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxSortHeaderIconDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxSortHeaderIcon]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxSortAscendingHeaderIconDirective {
}
IgxSortAscendingHeaderIconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxSortAscendingHeaderIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxSortAscendingHeaderIconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxSortAscendingHeaderIconDirective, selector: "[igxSortAscendingHeaderIcon]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxSortAscendingHeaderIconDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxSortAscendingHeaderIcon]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxSortDescendingHeaderIconDirective {
}
IgxSortDescendingHeaderIconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxSortDescendingHeaderIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
IgxSortDescendingHeaderIconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxSortDescendingHeaderIconDirective, selector: "[igxSortDescendingHeaderIcon]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxSortDescendingHeaderIconDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxSortDescendingHeaderIcon]'
                }]
        }] });
/**
 * @hidden
 */
export class IgxGroupAreaDropDirective extends IgxDropDirective {
    constructor(groupArea, elementRef, renderer, zone) {
        super(elementRef, renderer, zone);
        this.groupArea = groupArea;
        this.elementRef = elementRef;
        this.hovered = false;
    }
    onDragEnter(event) {
        const drag = event.detail.owner;
        const column = drag.column;
        if (!this.columnBelongsToGrid(column)) {
            return;
        }
        const isGrouped = this.groupArea.expressions
            ? this.groupArea.expressions.findIndex((item) => item.fieldName === column.field) !== -1
            : false;
        if (column.groupable && !isGrouped && !column.columnGroup && !!column.field) {
            drag.icon.innerText = 'group_work';
            this.hovered = true;
        }
        else {
            drag.icon.innerText = 'block';
            this.hovered = false;
        }
    }
    onDragLeave(event) {
        const drag = event.detail.owner;
        const column = drag.column;
        if (!this.columnBelongsToGrid(column)) {
            return;
        }
        event.detail.owner.icon.innerText = 'block';
        this.hovered = false;
    }
    closestParentByAttr(elem, attr) {
        return elem.hasAttribute(attr) ?
            elem :
            this.closestParentByAttr(elem.parentElement, attr);
    }
    columnBelongsToGrid(column) {
        const elem = this.elementRef.nativeElement;
        const closestGridID = this.closestParentByAttr(elem, 'igxGroupAreaDrop').getAttribute('gridId');
        if (!column) {
            return false;
        }
        else {
            const grid = column.grid;
            if (!grid || grid.id !== closestGridID) {
                return false;
            }
            return true;
        }
    }
}
IgxGroupAreaDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxGroupAreaDropDirective, deps: [{ token: i1.IgxGroupByAreaDirective }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
IgxGroupAreaDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0", type: IgxGroupAreaDropDirective, selector: "[igxGroupAreaDrop]", host: { properties: { "class.igx-drop-area--hover": "this.hovered" } }, usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IgxGroupAreaDropDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[igxGroupAreaDrop]'
                }]
        }], ctorParameters: function () { return [{ type: i1.IgxGroupByAreaDirective }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { hovered: [{
                type: HostBinding,
                args: ['class.igx-drop-area--hover']
            }] } });
//# sourceMappingURL=data:application/json;base64, 