/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
import { AppStateService } from '../../../services/AppStateService';
import { ClientSettingsService } from '../../../services/ClientSettingsService';
import { DisplayStateService } from '../../../services/DisplayStateService';
import { WebPlatformApiService } from './../../../services/WebPlatformApiService';
import { LandingPageUtilities } from './../landing-page/landing-page.utilities';
export class LandingPageSideNavComponent {
    /**
     * @param {?} WebPlatformApiService
     * @param {?} appStateService
     * @param {?} displayStateService
     * @param {?} clientSettingsService
     */
    constructor(WebPlatformApiService, appStateService, displayStateService, clientSettingsService) {
        this.WebPlatformApiService = WebPlatformApiService;
        this.appStateService = appStateService;
        this.displayStateService = displayStateService;
        this.clientSettingsService = clientSettingsService;
    }
    /**
     * @return {?}
     */
    ngAfterViewInit() {
        setTimeout(() => {
            // workaround for ExpressionChangedAfterItHasBeenCheckedError s
            this.lpUtilities = new LandingPageUtilities(this.WebPlatformApiService, this.appStateService, this.displayStateService, this.clientSettingsService, this.Config.config);
            this.lpUtilities.Refresh();
        });
    }
    /**
     * @param {?} newVal
     * @return {?}
     */
    onTagsFilterChange(newVal) {
        // this.lpUtililties.userFilter = newVal;
    }
    /**
     * @param {?} newVal
     * @return {?}
     */
    onGroupFilterChange(newVal) {
        this.lpUtilities.applyGroupFilter(newVal);
    }
    /**
     * @param {?} viewName
     * @return {?}
     */
    onViewChangeHandler(viewName) {
        this.lpUtilities.applyView(viewName);
    }
    /**
     * @param {?} search
     * @return {?}
     */
    onSearchChangeHandler(search) {
        this.lpUtilities.applySearch(search);
    }
}
LandingPageSideNavComponent.decorators = [
    { type: Component, args: [{
                selector: 'app-landing-page-sidenav',
                template: "<ng-container *ngIf=\"lpUtilities\">\r\n  <div *ngIf=\"Config.config === undefined || Config.config.ShowFilterByTags\" class=\"col-12\">\r\n    <div class=\"form-group\">        \r\n      <label for=\"filterByGroupSN\" class=\"col-form-label col-form-label-sm\">Filter by group</label>\r\n      <select class=\"form-control\" id=\"filterByGroupSN\" [ngModel]=\"lpUtilities.userFilter\" (ngModelChange)=\"onGroupFilterChange($event)\">\r\n        <option value=\"all\">-- Show All --</option>\r\n        <option *ngFor=\"let tag of lpUtilities.layoutResultsAll\" [value]=\"tag.groupLabel\">{{tag.groupLabel}}</option>\r\n      </select>\r\n    </div>\r\n  </div>\r\n  <div *ngIf=\"Config.config && Config.config.ShowViewsSelector\" class=\"col-12\">\r\n    <div class=\"form-group\">\r\n      <label for=\"selectViewSN\" class=\"col-form-label col-form-label-sm\">Change View</label>\r\n      <select *ngIf=\"lpUtilities.selectedView\" id=\"selectViewSN\" class=\"form-control\" [ngModel]=\"lpUtilities.selectedView.name\" (ngModelChange)=\"onViewChangeHandler($event)\">\r\n        <option *ngFor=\"let view of lpUtilities.views\" [value]=\"view.name\">{{view.name}}</option>\r\n      </select>\r\n    </div>\r\n  </div>\r\n  <div *ngIf=\"Config.config && Config.config.ShowQuickSearch\">\r\n    <div class=\"form-group\">\r\n      <label for=\"lpSearchInpSN\" class=\"col-form-label col-form-label-sm\">Quick Filter/Search</label>\r\n      <input id=\"lpSearchInp\" type=\"text\" class=\"form-control\" [(ngModel)]=\"searchField\" (ngModelChange)=\"onSearchChangeHandler($event)\">\r\n    </div>\r\n  </div>\r\n  <div *ngIf=\"lpUtilities.layoutResults && lpUtilities.selectedView else noWidgets;\" class=\"landing-page-content\">\r\n    <div *ngFor=\"let group of lpUtilities.layoutResults\">\r\n      <div *ngIf=\"(lpUtilities.userFilter === 'all' || lpUtilities.userFilter === 'tag') && group.tiles.length\">\r\n          <h5>{{group.groupLabel.toUpperCase()}}</h5> \r\n          <div class=\"list-group-flush\">\r\n            <ng-container *ngFor=\"let tile of group.tiles\">\r\n              <a *ngIf=\"tile.context && !tile.external\" [platformRouterLink]=\"tile.context\"\r\n                class=\"list-group-item list-group-item\" title=\"{{tile.description || 'No description set up for this widget !!'}}\">\r\n                {{tile.title}}\r\n              </a>\r\n              <a *ngIf=\"tile.url || tile.external\" [href]=\"tile.url\" target=\"_blank\"\r\n                class=\"list-group-item list-group-item\" title=\"{{tile.description || 'No description set up for this widget !!'}}\">\r\n                {{tile.title}}\r\n              </a>\r\n            </ng-container>\r\n          </div>\r\n          <br/>\r\n      </div>\r\n    </div>  \r\n  </div>\r\n</ng-container>\r\n<ng-template #noWidgets>\r\n    No widgets available for this {{groupByContext ? \"context/widget\" : \"area/widget\"}}\r\n</ng-template>",
                styles: [".list-group-item{font-size:.8rem;padding:.25rem .25rem .25rem .75rem}"]
            }] }
];
/** @nocollapse */
LandingPageSideNavComponent.ctorParameters = () => [
    { type: WebPlatformApiService },
    { type: AppStateService },
    { type: DisplayStateService },
    { type: ClientSettingsService }
];
LandingPageSideNavComponent.propDecorators = {
    Config: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    LandingPageSideNavComponent.prototype.Config;
    /** @type {?} */
    LandingPageSideNavComponent.prototype.searchField;
    /** @type {?} */
    LandingPageSideNavComponent.prototype.lpUtilities;
    /** @type {?} */
    LandingPageSideNavComponent.prototype.groupByContext;
    /** @type {?} */
    LandingPageSideNavComponent.prototype.WebPlatformApiService;
    /** @type {?} */
    LandingPageSideNavComponent.prototype.appStateService;
    /** @type {?} */
    LandingPageSideNavComponent.prototype.displayStateService;
    /** @type {?} */
    LandingPageSideNavComponent.prototype.clientSettingsService;
}

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