/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import * as tslib_1 from "tslib";
import { CommonModule } from '@angular/common';
import { Component, ContentChild, ContentChildren, ElementRef, EventEmitter, forwardRef, HostBinding, Input, NgModule, Output, QueryList, TemplateRef, ViewChild } from '@angular/core';
import { IgxRippleModule } from '../directives/ripple/ripple.directive';
import { IgxListItemComponent } from './list-item.component';
import { IgxEmptyListTemplateDirective, IgxDataLoadingTemplateDirective } from './list.common';
var /** @type {?} */ NEXT_ID = 0;
/**
 * @record
 */
export function IPanStateChangeEventArgs() { }
function IPanStateChangeEventArgs_tsickle_Closure_declarations() {
    /** @type {?} */
    IPanStateChangeEventArgs.prototype.oldState;
    /** @type {?} */
    IPanStateChangeEventArgs.prototype.newState;
    /** @type {?} */
    IPanStateChangeEventArgs.prototype.item;
}
/**
 * @record
 */
export function IListItemClickEventArgs() { }
function IListItemClickEventArgs_tsickle_Closure_declarations() {
    /** @type {?} */
    IListItemClickEventArgs.prototype.item;
    /** @type {?} */
    IListItemClickEventArgs.prototype.event;
}
/**
 * **Ignite UI for Angular List** -
 * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/list.html)
 *
 * The Ignite UI List displays rows of items and supports one or more header items as well as search and filtering
 * of list items. Each list item is completely templateable and will support any valid HTML or Angular component.
 *
 * Example:
 * ```html
 * <igx-list>
 *   <igx-list-item isHeader="true">Contacts</igx-list-item>
 *   <igx-list-item *ngFor="let contact of contacts">
 *     <span class="name">{{ contact.name }}</span>
 *     <span class="phone">{{ contact.phone }}</span>
 *   </igx-list-item>
 * </igx-list>
 * ```
 */
var IgxListComponent = /** @class */ (function () {
    function IgxListComponent(element) {
        this.element = element;
        /**
         * Sets/gets the `id` of the list.
         * If not set, the `id` of the first list component will be `"igx-list-0"`.
         * ```html
         * <igx-list id = "my-first-list"></igx-list>
         * ```
         * ```typescript
         * let listId =  this.list.id;
         * ```
         * \@memberof IgxListComponent
         */
        this.id = "igx-list-" + NEXT_ID++;
        /**
         * Sets/gets whether the left panning of an item is allowed.
         * Default value is `false`.
         * ```html
         *  <igx-list [allowLeftPanning] = "true"></igx-list>
         * ```
         * ```typescript
         * let isLeftPanningAllowed = this.list.allowLeftPanning;
         * ```
         * \@memberof IgxListComponent
         */
        this.allowLeftPanning = false;
        /**
         * Sets/gets whether the right panning of an item is allowed.
         * Default value is `false`.
         * ```html
         *  <igx-list [allowRightPanning] = "true"></igx-list>
         * ```
         * ```typescript
         * let isRightPanningAllowed = this.list.allowRightPanning;
         * ```
         * \@memberof IgxListComponent
         */
        this.allowRightPanning = false;
        /**
         * Sets/gets whether the list is currently loading data.
         * Set it to display the dataLoadingTemplate while data is being retrieved.
         * Default value is `false`.
         * ```html
         *  <igx-list [isLoading]="true"></igx-list>
         * ```
         * ```typescript
         * let isLoading = this.list.isLoading;
         * ```
         * \@memberof IgxListComponent
         */
        this.isLoading = false;
        /**
         * Emits an event within the current list when left pan gesture is executed on list item.
         * Provides reference to the `IgxListItemComponent` as an event argument.
         * ```html
         * <igx-list [allowLeftPanning]="true" (onLeftPan) = "onLeftPan($event)"></igx-list>
         * ```
         * \@memberof IgxListComponent
         */
        this.onLeftPan = new EventEmitter();
        /**
         * Emits an event within the current list when right pan gesture is executed on list item.
         * Provides reference to the `IgxListItemComponent` as an event argument.
         * ```html
         * <igx-list [allowRightPanning]="true" (onRightPan) = "onRightPan($event)"></igx-list>
         * ```
         * \@memberof IgxListComponent
         */
        this.onRightPan = new EventEmitter();
        /**
         * Emits an event within the current list when pan gesture is executed on list item.
         * Provides references to the `IgxListItemComponent` and `IgxListPanState` as event arguments.
         * ```html
         * <igx-list (onPanStateChange) = "onPanStateChange($event)"></igx-list>
         * ```
         * \@memberof IgxListComponent
         */
        this.onPanStateChange = new EventEmitter();
        /**
         * Emits an event within the current list when a list item has been clicked.
         * Provides references to the `IgxListItemComponent` and `Event` as event arguments.
         *  ```html
         * <igx-list (onItemClicked) = "onItemClicked($event)"></igx-list>
         * ```
         * \@memberof IgxListComponent
         */
        this.onItemClicked = new EventEmitter();
    }
    Object.defineProperty(IgxListComponent.prototype, "role", {
        get: /**
         * Gets the `role` attribute.
         * ```typescript
         * let listRole =  this.list.role;
         * ```
         * \@memberof IgxListComponent
         * @return {?}
         */
        function () {
            return 'list';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxListComponent.prototype, "isListEmpty", {
        get: /**
         * Returns boolean indicating if the list is empty.
         * ```typescript
         * let isEmpty =  this.list.isListEmpty;
         * ```
         * \@memberof IgxListComponent
         * @return {?}
         */
        function () {
            return !this.children || this.children.length === 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxListComponent.prototype, "cssClass", {
        get: /**
         * Returns boolean indicating if the list has a `cssClass` attribute.
         * ```typescript
         * let hasCssClass =  this.list.cssClass;
         * ```
         * \@memberof IgxListComponent
         * @return {?}
         */
        function () {
            return this.children && this.children.length > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxListComponent.prototype, "items", {
        get: /**
         * Returns the `items` in the list excluding the headers.
         * ```typescript
         * let listItems: IgxListItemComponent[] = this.list.items;
         * ```
         * \@memberof IgxListComponent
         * @return {?}
         */
        function () {
            var /** @type {?} */ items = [];
            if (this.children !== undefined) {
                try {
                    for (var _a = tslib_1.__values(this.children.toArray()), _b = _a.next(); !_b.done; _b = _a.next()) {
                        var child = _b.value;
                        if (!child.isHeader) {
                            items.push(child);
                        }
                    }
                }
                catch (e_1_1) { e_1 = { error: e_1_1 }; }
                finally {
                    try {
                        if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
                    }
                    finally { if (e_1) throw e_1.error; }
                }
            }
            return items;
            var e_1, _c;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxListComponent.prototype, "headers", {
        get: /**
         * Returns the headers in the list.
         * ```typescript
         * let listHeaders: IgxListItemComponent[] =  this.list.headers;
         * ```
         * \@memberof IgxListComponent
         * @return {?}
         */
        function () {
            var /** @type {?} */ headers = [];
            if (this.children !== undefined) {
                try {
                    for (var _a = tslib_1.__values(this.children.toArray()), _b = _a.next(); !_b.done; _b = _a.next()) {
                        var child = _b.value;
                        if (child.isHeader) {
                            headers.push(child);
                        }
                    }
                }
                catch (e_2_1) { e_2 = { error: e_2_1 }; }
                finally {
                    try {
                        if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
                    }
                    finally { if (e_2) throw e_2.error; }
                }
            }
            return headers;
            var e_2, _c;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxListComponent.prototype, "context", {
        get: /**
         * Returns the `context` object which represents the `template context` binding into the `list container`
         * by providing the `$implicit` declaration which is the `IgxListComponent` itself.
         * ```typescript
         * let listComponent =  this.list.context;
         * ```
         * @return {?}
         */
        function () {
            return {
                $implicit: this
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxListComponent.prototype, "template", {
        get: /**
         * Returns the `template` of an empty list.
         * ```typescript
         * let listTemplate = this.list.template;
         * ```
         * \@memberof IgxListComponent
         * @return {?}
         */
        function () {
            if (this.isLoading) {
                return this.dataLoadingTemplate ? this.dataLoadingTemplate.template : this.defaultDataLoadingTemplate;
            }
            else {
                return this.emptyListTemplate ? this.emptyListTemplate.template : this.defaultEmptyListTemplate;
            }
        },
        enumerable: true,
        configurable: true
    });
    IgxListComponent.decorators = [
        { type: Component, args: [{
                    selector: 'igx-list',
                    template: "<ng-content></ng-content>\n\n<ng-template #defaultEmptyList>\n    <article class=\"message\">\n        <p>There are no items in the list.</p>\n    </article>\n</ng-template>\n\n<ng-template #defaultDataLoading>\n    <article class=\"message\">\n        <p>Loading data from the server...</p>\n    </article>\n</ng-template>\n\n<ng-container *ngIf=\"!children || children.length === 0\">\n    <ng-container *ngTemplateOutlet=\"template; context: context\">\n    </ng-container>\n</ng-container>\n"
                },] },
    ];
    /** @nocollapse */
    IgxListComponent.ctorParameters = function () { return [
        { type: ElementRef, },
    ]; };
    IgxListComponent.propDecorators = {
        "children": [{ type: ContentChildren, args: [forwardRef(function () { return IgxListItemComponent; }),] },],
        "emptyListTemplate": [{ type: ContentChild, args: [IgxEmptyListTemplateDirective, { read: IgxEmptyListTemplateDirective },] },],
        "dataLoadingTemplate": [{ type: ContentChild, args: [IgxDataLoadingTemplateDirective, { read: IgxDataLoadingTemplateDirective },] },],
        "defaultEmptyListTemplate": [{ type: ViewChild, args: ['defaultEmptyList', { read: TemplateRef },] },],
        "defaultDataLoadingTemplate": [{ type: ViewChild, args: ['defaultDataLoading', { read: TemplateRef },] },],
        "id": [{ type: HostBinding, args: ['attr.id',] }, { type: Input },],
        "allowLeftPanning": [{ type: Input },],
        "allowRightPanning": [{ type: Input },],
        "isLoading": [{ type: Input },],
        "onLeftPan": [{ type: Output },],
        "onRightPan": [{ type: Output },],
        "onPanStateChange": [{ type: Output },],
        "onItemClicked": [{ type: Output },],
        "role": [{ type: HostBinding, args: ['attr.role',] },],
        "isListEmpty": [{ type: HostBinding, args: ['class.igx-list-empty',] },],
        "cssClass": [{ type: HostBinding, args: ['class.igx-list',] },],
    };
    return IgxListComponent;
}());
export { IgxListComponent };
function IgxListComponent_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxListComponent.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxListComponent.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    IgxListComponent.propDecorators;
    /**
     * Returns a collection of all items and headers in the list.
     * ```typescript
     * let listChildren: QueryList = this.list.children;
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.children;
    /** @type {?} */
    IgxListComponent.prototype.emptyListTemplate;
    /**
     * @hidden
     * @type {?}
     */
    IgxListComponent.prototype.dataLoadingTemplate;
    /** @type {?} */
    IgxListComponent.prototype.defaultEmptyListTemplate;
    /**
     * @hidden
     * @type {?}
     */
    IgxListComponent.prototype.defaultDataLoadingTemplate;
    /**
     * Sets/gets the `id` of the list.
     * If not set, the `id` of the first list component will be `"igx-list-0"`.
     * ```html
     * <igx-list id = "my-first-list"></igx-list>
     * ```
     * ```typescript
     * let listId =  this.list.id;
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.id;
    /**
     * Sets/gets whether the left panning of an item is allowed.
     * Default value is `false`.
     * ```html
     *  <igx-list [allowLeftPanning] = "true"></igx-list>
     * ```
     * ```typescript
     * let isLeftPanningAllowed = this.list.allowLeftPanning;
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.allowLeftPanning;
    /**
     * Sets/gets whether the right panning of an item is allowed.
     * Default value is `false`.
     * ```html
     *  <igx-list [allowRightPanning] = "true"></igx-list>
     * ```
     * ```typescript
     * let isRightPanningAllowed = this.list.allowRightPanning;
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.allowRightPanning;
    /**
     * Sets/gets whether the list is currently loading data.
     * Set it to display the dataLoadingTemplate while data is being retrieved.
     * Default value is `false`.
     * ```html
     *  <igx-list [isLoading]="true"></igx-list>
     * ```
     * ```typescript
     * let isLoading = this.list.isLoading;
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.isLoading;
    /**
     * Emits an event within the current list when left pan gesture is executed on list item.
     * Provides reference to the `IgxListItemComponent` as an event argument.
     * ```html
     * <igx-list [allowLeftPanning]="true" (onLeftPan) = "onLeftPan($event)"></igx-list>
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.onLeftPan;
    /**
     * Emits an event within the current list when right pan gesture is executed on list item.
     * Provides reference to the `IgxListItemComponent` as an event argument.
     * ```html
     * <igx-list [allowRightPanning]="true" (onRightPan) = "onRightPan($event)"></igx-list>
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.onRightPan;
    /**
     * Emits an event within the current list when pan gesture is executed on list item.
     * Provides references to the `IgxListItemComponent` and `IgxListPanState` as event arguments.
     * ```html
     * <igx-list (onPanStateChange) = "onPanStateChange($event)"></igx-list>
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.onPanStateChange;
    /**
     * Emits an event within the current list when a list item has been clicked.
     * Provides references to the `IgxListItemComponent` and `Event` as event arguments.
     *  ```html
     * <igx-list (onItemClicked) = "onItemClicked($event)"></igx-list>
     * ```
     * \@memberof IgxListComponent
     * @type {?}
     */
    IgxListComponent.prototype.onItemClicked;
    /** @type {?} */
    IgxListComponent.prototype.element;
}
/**
 * The IgxListModule provides the {\@link IgxListComponent} and the {\@link IgxListItemComponent} inside your application.
 */
var IgxListModule = /** @class */ (function () {
    function IgxListModule() {
    }
    IgxListModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [IgxListComponent, IgxListItemComponent, IgxEmptyListTemplateDirective, IgxDataLoadingTemplateDirective],
                    exports: [IgxListComponent, IgxListItemComponent, IgxEmptyListTemplateDirective, IgxDataLoadingTemplateDirective],
                    imports: [CommonModule, IgxRippleModule]
                },] },
    ];
    return IgxListModule;
}());
export { IgxListModule };
function IgxListModule_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxListModule.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxListModule.ctorParameters;
}

//# sourceMappingURL=data:application/json;base64, 