UNPKG

@vicoders/angular

Version:

- [Vicoders Angular Common Module](#vicoders-angular-common-module) - [Install](#install) - [How to use](#how-to-use) - [Pipes](#pipes) - [hasItem](#hasitem) - [isArray](#isarray) - [length](#length) - [orderBy](#orderby)

1,593 lines 68.3 kB
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('moment'), require('@angular/router'), require('@angular/forms'), require('lodash'), require('@angular/core'), require('@angular/common')) :
    typeof define === 'function' && define.amd ? define('@vicoders/angular', ['exports', 'moment', '@angular/router', '@angular/forms', 'lodash', '@angular/core', '@angular/common'], factory) :
    (factory((global.vicoders = global.vicoders || {}, global.vicoders.angular = {}),global.moment_,global.ng.router,global.ng.forms,global._,global.ng.core,global.ng.common));
}(this, (function (exports,moment_,router,forms,_,core,common) { 'use strict';

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var HasItemPipe = /** @class */ (function () {
        function HasItemPipe() {
        }
        /**
         * @param {?} value
         * @param {?=} args
         * @return {?}
         */
        HasItemPipe.prototype.transform = /**
         * @param {?} value
         * @param {?=} args
         * @return {?}
         */
            function (value, args) {
                if (!_.isArray(value)) {
                    return false;
                }
                else {
                    if (value.length === 0) {
                        return false;
                    }
                    else {
                        return true;
                    }
                }
            };
        HasItemPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: "hasItem"
                    },] }
        ];
        return HasItemPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var LengthPipe = /** @class */ (function () {
        function LengthPipe() {
        }
        /**
         * @param {?} value
         * @param {?=} args
         * @return {?}
         */
        LengthPipe.prototype.transform = /**
         * @param {?} value
         * @param {?=} args
         * @return {?}
         */
            function (value, args) {
                if (!_.isArray(value)) {
                    return 0;
                }
                else {
                    return value.length;
                }
            };
        LengthPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: 'length'
                    },] }
        ];
        return LengthPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var FilterByPipe = /** @class */ (function () {
        function FilterByPipe() {
        }
        /**
         * @param {?} arr
         * @param {?} path
         * @param {?} value
         * @param {?} type
         * @return {?}
         */
        FilterByPipe.prototype.transform = /**
         * @param {?} arr
         * @param {?} path
         * @param {?} value
         * @param {?} type
         * @return {?}
         */
            function (arr, path, value, type) {
                if (!_.isArray(arr)) {
                    return null;
                }
                if (_.isArray(value)) {
                    return _.filter(arr, function (item) { return _.includes(value, _.get(item, path)); });
                }
                else {
                    switch (type) {
                        case ">":
                            return _.filter(arr, function (item) { return _.get(item, path) > value; });
                        case "<":
                            return _.filter(arr, function (item) { return _.get(item, path) < value; });
                        case "not":
                            return _.filter(arr, function (item) { return _.get(item, path) !== value; });
                        default:
                            return _.filter(arr, function (item) { return _.get(item, path) === value; });
                    }
                }
            };
        FilterByPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: "filterBy"
                    },] }
        ];
        return FilterByPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var FindByPipe = /** @class */ (function () {
        function FindByPipe() {
        }
        /**
         * @param {?} arr
         * @param {?} path
         * @param {?} value
         * @param {?} type
         * @return {?}
         */
        FindByPipe.prototype.transform = /**
         * @param {?} arr
         * @param {?} path
         * @param {?} value
         * @param {?} type
         * @return {?}
         */
            function (arr, path, value, type) {
                if (!_.isArray(arr)) {
                    return null;
                }
                if (_.isArray(value)) {
                    return _.find(arr, function (item) { return _.includes(value, _.get(item, path)); });
                }
                else {
                    switch (type) {
                        case ">":
                            return _.find(arr, function (item) { return _.get(item, path) > value; });
                        case "<":
                            return _.find(arr, function (item) { return _.get(item, path) < value; });
                        case "not":
                            return _.find(arr, function (item) { return _.get(item, path) !== value; });
                        default:
                            return _.find(arr, function (item) { return _.get(item, path) === value; });
                    }
                }
            };
        FindByPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: "findBy"
                    },] }
        ];
        return FindByPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var IsArrayPipe = /** @class */ (function () {
        function IsArrayPipe() {
        }
        /**
         * @param {?} value
         * @param {?=} args
         * @return {?}
         */
        IsArrayPipe.prototype.transform = /**
         * @param {?} value
         * @param {?=} args
         * @return {?}
         */
            function (value, args) {
                return Array.isArray(value);
            };
        IsArrayPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: "isArray"
                    },] }
        ];
        return IsArrayPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var OrderByPipe = /** @class */ (function () {
        function OrderByPipe() {
        }
        /**
         * @param {?} value
         * @param {...?} criterias
         * @return {?}
         */
        OrderByPipe.prototype.transform = /**
         * @param {?} value
         * @param {...?} criterias
         * @return {?}
         */
            function (value) {
                var criterias = [];
                for (var _i = 1; _i < arguments.length; _i++) {
                    criterias[_i - 1] = arguments[_i];
                }
                /** @type {?} */
                var fields = [];
                /** @type {?} */
                var directions = [];
                _.forEach(criterias, function (item) {
                    fields.push(item[0]);
                    directions.push(item[1]);
                });
                if (_.filter(directions, function (item) { return !_.isNil(item); }).length > 0) {
                    value = _.orderBy.apply(null, [value, fields, directions]);
                }
                else {
                    return value;
                }
                return value;
            };
        OrderByPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: 'orderBy'
                    },] }
        ];
        return OrderByPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var SumByPipe = /** @class */ (function () {
        function SumByPipe() {
        }
        /**
         * @param {?} value
         * @param {?} path
         * @return {?}
         */
        SumByPipe.prototype.transform = /**
         * @param {?} value
         * @param {?} path
         * @return {?}
         */
            function (value, path) {
                if (!_.isArray(value)) {
                    return 0;
                }
                else {
                    if (value.length === 0) {
                        return 0;
                    }
                    else {
                        return _.sumBy(value, function (item) { return Number(_.get(item, path)); });
                    }
                }
            };
        SumByPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: 'sumBy'
                    },] }
        ];
        return SumByPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var FlatMapPipe = /** @class */ (function () {
        function FlatMapPipe() {
        }
        /**
         * @param {?} collection
         * @param {?} callable
         * @return {?}
         */
        FlatMapPipe.prototype.transform = /**
         * @param {?} collection
         * @param {?} callable
         * @return {?}
         */
            function (collection, callable) {
                return _.flatMap(collection, callable);
            };
        FlatMapPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: 'flatMap'
                    },] }
        ];
        return FlatMapPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    /** @type {?} */
    var moment = moment_;
    var TimeFormatPipe = /** @class */ (function () {
        function TimeFormatPipe() {
        }
        /**
         * @param {?} time
         * @param {?} format
         * @return {?}
         */
        TimeFormatPipe.prototype.transform = /**
         * @param {?} time
         * @param {?} format
         * @return {?}
         */
            function (time, format) {
                if (_.isObject(time) && time instanceof moment) {
                    return (( /** @type {?} */(time))).format(format);
                }
                else if (_.isString(time)) {
                    return moment(time).format(format);
                }
                else {
                    return null;
                }
            };
        TimeFormatPipe.decorators = [
            { type: core.Pipe, args: [{
                        name: "timeFormat"
                    },] }
        ];
        return TimeFormatPipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    /** @type {?} */
    var moment$1 = moment_;
    var ReadableTimePipe = /** @class */ (function () {
        function ReadableTimePipe() {
        }
        /**
         * @param {?} time
         * @param {?} locale
         * @return {?}
         */
        ReadableTimePipe.prototype.transform = /**
         * @param {?} time
         * @param {?} locale
         * @return {?}
         */
            function (time, locale) {
                locale = locale || "en";
                /** @type {?} */
                var m = moment$1(time).locale(locale);
                if (m.isValid()) {
                    return m.fromNow();
                }
                return "";
            };
        ReadableTimePipe.decorators = [
            { type: core.Pipe, args: [{
                        name: "readableTime"
                    },] }
        ];
        return ReadableTimePipe;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var PipesModule = /** @class */ (function () {
        function PipesModule() {
        }
        PipesModule.decorators = [
            { type: core.NgModule, args: [{
                        imports: [common.CommonModule],
                        exports: [
                            HasItemPipe,
                            LengthPipe,
                            IsArrayPipe,
                            FilterByPipe,
                            OrderByPipe,
                            SumByPipe,
                            FlatMapPipe,
                            FindByPipe,
                            TimeFormatPipe,
                            ReadableTimePipe
                        ],
                        declarations: [
                            HasItemPipe,
                            LengthPipe,
                            FilterByPipe,
                            IsArrayPipe,
                            OrderByPipe,
                            SumByPipe,
                            FlatMapPipe,
                            FindByPipe,
                            TimeFormatPipe,
                            ReadableTimePipe
                        ]
                    },] }
        ];
        return PipesModule;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var PaginationComponent = /** @class */ (function () {
        function PaginationComponent() {
            this.goPrev = new core.EventEmitter();
            this.goNext = new core.EventEmitter();
            this.goPage = new core.EventEmitter();
        }
        /**
         * @return {?}
         */
        PaginationComponent.prototype.getMin = /**
         * @return {?}
         */
            function () {
                return this.perPage * this.page - this.perPage + 1;
            };
        /**
         * @return {?}
         */
        PaginationComponent.prototype.getMax = /**
         * @return {?}
         */
            function () {
                /** @type {?} */
                var max = this.perPage * this.page;
                if (max > this.count) {
                    max = this.count;
                }
                return max;
            };
        /**
         * @param {?} n
         * @return {?}
         */
        PaginationComponent.prototype.onPage = /**
         * @param {?} n
         * @return {?}
         */
            function (n) {
                this.goPage.emit(n);
            };
        /**
         * @return {?}
         */
        PaginationComponent.prototype.onPrev = /**
         * @return {?}
         */
            function () {
                this.goPrev.emit(true);
            };
        /**
         * @param {?} next
         * @return {?}
         */
        PaginationComponent.prototype.onNext = /**
         * @param {?} next
         * @return {?}
         */
            function (next) {
                this.goNext.emit(next);
            };
        /**
         * @return {?}
         */
        PaginationComponent.prototype.totalPages = /**
         * @return {?}
         */
            function () {
                return Math.ceil(this.count / this.perPage) || 0;
            };
        /**
         * @return {?}
         */
        PaginationComponent.prototype.lastPage = /**
         * @return {?}
         */
            function () {
                return this.perPage * this.page > this.count;
            };
        /**
         * @return {?}
         */
        PaginationComponent.prototype.getPages = /**
         * @return {?}
         */
            function () {
                /** @type {?} */
                var c = Math.ceil(this.count / this.perPage);
                /** @type {?} */
                var p = this.page || 1;
                /** @type {?} */
                var pagesToShow = this.pagesToShow || 9;
                /** @type {?} */
                var pages = [];
                pages.push(p);
                /** @type {?} */
                var times = pagesToShow - 1;
                for (var i = 0; i < times; i++) {
                    if (pages.length < pagesToShow) {
                        if (Math.min.apply(null, pages) > 1) {
                            pages.push(Math.min.apply(null, pages) - 1);
                        }
                    }
                    if (pages.length < pagesToShow) {
                        if (Math.max.apply(null, pages) < c) {
                            pages.push(Math.max.apply(null, pages) + 1);
                        }
                    }
                }
                pages.sort(function (a, b) { return a - b; });
                return pages;
            };
        PaginationComponent.decorators = [
            { type: core.Component, args: [{
                        selector: 'app-pagination',
                        template: "<div class=\"row\">\n  <div class=\"col-md-5 col-sm-7\">\n    <div class=\"description\">\n      <span class=\"page-counts\">{{ getMin() }} - {{ getMax() }} of {{ count }}</span>\n      <span class=\"page-totals\">{{ totalPages() }} pages</span>\n    </div>\n  </div>\n  <div class=\"col-md-7 col-sm-7\">\n    <div class=\"dataTables_paginate paging_simple_numbers\" *ngIf=\"count > 0\">\n\n      <ul class=\"pagination\">\n        <li class=\"paginate_button previous\" [ngClass]=\"{ 'disabled': page === 1 || loading }\">\n          <button class=\"link\" (click)=\"onPrev()\" [disabled]=\"page === 1 || loading\">\n            Previous\n          </button>\n        </li>\n        <li class=\"paginate_button\" *ngFor=\"let pageNum of getPages()\" (click)=\"onPage(pageNum)\" [ngClass]=\"{'active': pageNum === page, 'disabled': loading}\">\n          <a href=\"javascript:;\">{{ pageNum }}</a>\n        </li>\n        <li class=\"paginate_button next\" [ngClass]=\"{ 'disabled': lastPage() || loading }\">\n          <button class=\"link\" (click)=\"onNext(true)\" [disabled]=\"lastPage() || loading\">\n            Next\n          </button>\n        </li>\n      </ul>\n    </div>\n  </div>\n</div>",
                        styles: [""]
                    }] }
        ];
        PaginationComponent.ctorParameters = function () { return []; };
        PaginationComponent.propDecorators = {
            pagesToShow: [{ type: core.Input }],
            page: [{ type: core.Input }],
            count: [{ type: core.Input }],
            perPage: [{ type: core.Input }],
            loading: [{ type: core.Input }],
            goPrev: [{ type: core.Output }],
            goNext: [{ type: core.Output }],
            goPage: [{ type: core.Output }]
        };
        return PaginationComponent;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var LoaderComponent = /** @class */ (function () {
        function LoaderComponent() {
        }
        /**
         * @return {?}
         */
        LoaderComponent.prototype.ngOnInit = /**
         * @return {?}
         */
            function () { };
        LoaderComponent.decorators = [
            { type: core.Component, args: [{
                        // tslint:disable-next-line:component-selector
                        selector: 'loader',
                        template: "<div class=\"preloader-wrapper active small\">\n  <div class=\"spinner-layer spinner-red-only\">\n    <div class=\"circle-clipper left\">\n      <div class=\"circle\"></div>\n    </div>\n    <div class=\"gap-patch\">\n      <div class=\"circle\"></div>\n    </div>\n    <div class=\"circle-clipper right\">\n      <div class=\"circle\"></div>\n    </div>\n  </div>\n</div>\n",
                        styles: [".preloader-wrapper{display:inline-block;position:relative;width:48px;height:48px}.preloader-wrapper.small{width:36px;height:36px}.preloader-wrapper.big{width:64px;height:64px}.preloader-wrapper.active{-webkit-animation:1568ms linear infinite container-rotate;animation:1568ms linear infinite container-rotate}@-webkit-keyframes container-rotate{to{-webkit-transform:rotate(360deg)}}@keyframes container-rotate{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-layer{position:absolute;width:100%;height:100%;opacity:0;border-color:color(\"teal\", \"lighten-1\")}.spinner-blue,.spinner-blue-only{border-color:#4285f4}.spinner-red,.spinner-red-only{border-color:#ef6b59}.spinner-yellow,.spinner-yellow-only{border-color:#f4b400}.spinner-green,.spinner-green-only{border-color:#0f9d58}.active .spinner-layer.spinner-blue{-webkit-animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both blue-fade-in-out;animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both blue-fade-in-out}.active .spinner-layer.spinner-red{-webkit-animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both red-fade-in-out;animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both red-fade-in-out}.active .spinner-layer.spinner-yellow{-webkit-animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both yellow-fade-in-out;animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both yellow-fade-in-out}.active .spinner-layer.spinner-green{-webkit-animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both green-fade-in-out;animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate,5332ms cubic-bezier(.4,0,.2,1) infinite both green-fade-in-out}.active .spinner-layer,.active .spinner-layer.spinner-blue-only,.active .spinner-layer.spinner-green-only,.active .spinner-layer.spinner-red-only,.active .spinner-layer.spinner-yellow-only{opacity:1;-webkit-animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate;animation:5332ms cubic-bezier(.4,0,.2,1) infinite both fill-unfill-rotate}@-webkit-keyframes fill-unfill-rotate{12.5%{-webkit-transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg)}to{-webkit-transform:rotate(1080deg)}}@keyframes fill-unfill-rotate{12.5%{-webkit-transform:rotate(135deg);transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg);transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg);transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg);transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg);transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg);transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg);transform:rotate(945deg)}to{-webkit-transform:rotate(1080deg);transform:rotate(1080deg)}}@-webkit-keyframes blue-fade-in-out{100%,25%,90%,from{opacity:1}26%,89%{opacity:0}}@keyframes blue-fade-in-out{100%,25%,90%,from{opacity:1}26%,89%{opacity:0}}@-webkit-keyframes red-fade-in-out{15%,51%,from{opacity:0}25%,50%{opacity:1}}@keyframes red-fade-in-out{15%,51%,from{opacity:0}25%,50%{opacity:1}}@-webkit-keyframes yellow-fade-in-out{40%,76%,from{opacity:0}50%,75%{opacity:1}}@keyframes yellow-fade-in-out{40%,76%,from{opacity:0}50%,75%{opacity:1}}@-webkit-keyframes green-fade-in-out{100%,65%,from{opacity:0}75%,90%{opacity:1}}@keyframes green-fade-in-out{100%,65%,from{opacity:0}75%,90%{opacity:1}}.gap-patch{position:absolute;top:0;left:45%;width:10%;height:100%;overflow:hidden;border-color:inherit}.gap-patch .circle{width:1000%;left:-450%}.circle-clipper{display:inline-block;position:relative;width:50%;height:100%;overflow:hidden;border-color:inherit}.circle-clipper .circle{width:200%;height:100%;border-width:3px;border-style:solid;border-color:inherit;border-bottom-color:transparent!important;border-radius:50%;-webkit-animation:none;animation:none;position:absolute;top:0;right:0;bottom:0}.circle-clipper.left .circle{left:0;border-right-color:transparent!important;-webkit-transform:rotate(129deg);transform:rotate(129deg)}.circle-clipper.right .circle{left:-100%;border-left-color:transparent!important;-webkit-transform:rotate(-129deg);transform:rotate(-129deg)}.active .circle-clipper.left .circle{-webkit-animation:1333ms cubic-bezier(.4,0,.2,1) infinite both left-spin;animation:1333ms cubic-bezier(.4,0,.2,1) infinite both left-spin}.active .circle-clipper.right .circle{-webkit-animation:1333ms cubic-bezier(.4,0,.2,1) infinite both right-spin;animation:1333ms cubic-bezier(.4,0,.2,1) infinite both right-spin}@-webkit-keyframes left-spin{from,to{-webkit-transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg)}}@keyframes left-spin{from,to{-webkit-transform:rotate(130deg);transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}}@-webkit-keyframes right-spin{from,to{-webkit-transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg)}}@keyframes right-spin{from,to{-webkit-transform:rotate(-130deg);transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}}#spinnerContainer.cooldown{-webkit-animation:1568ms linear infinite container-rotate,.4s cubic-bezier(.4,0,.2,1) fade-out;animation:1568ms linear infinite container-rotate,.4s cubic-bezier(.4,0,.2,1) fade-out}@-webkit-keyframes fade-out{from{opacity:1}to{opacity:0}}@keyframes fade-out{from{opacity:1}to{opacity:0}}loader{display:block;width:100%;text-align:center;padding:20px}loader .preloader-wrapper .spinner-layer .left{float:left}loader .preloader-wrapper .spinner-layer .right{float:right}"]
                    }] }
        ];
        LoaderComponent.ctorParameters = function () { return []; };
        return LoaderComponent;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var SearchFormComponent = /** @class */ (function () {
        function SearchFormComponent(route, activatedRoute) {
            var _this = this;
            this.route = route;
            this.activatedRoute = activatedRoute;
            this.keyword = '';
            // @Output() searching: EventEmitter<string> = new EventEmitter<string>();
            this.placeHolder = 'Search';
            if (_.isUndefined(this.navigationSubscription)) {
                this.navigationSubscription = this.route.events.subscribe(function (e) {
                    if (e instanceof router.NavigationEnd) {
                        if (!_.isUndefined(_this.activatedRoute.snapshot.queryParams.search)) {
                            _this.keyword = _this.activatedRoute.snapshot.queryParams.search;
                        }
                        else {
                            _this.keyword = '';
                        }
                    }
                });
            }
        }
        /**
         * @return {?}
         */
        SearchFormComponent.prototype.ngOnInit = /**
         * @return {?}
         */
            function () { };
        /**
         * @return {?}
         */
        SearchFormComponent.prototype.ngOnDestroy = /**
         * @return {?}
         */
            function () {
                this.navigationSubscription.unsubscribe();
            };
        /**
         * @return {?}
         */
        SearchFormComponent.prototype.onSubmit = /**
         * @return {?}
         */
            function () {
                /** @type {?} */
                var url = window.location.pathname;
                /** @type {?} */
                var queryParams = this.activatedRoute.snapshot.queryParams;
                queryParams = _.assign({}, queryParams, { search: this.keyword });
                /** @type {?} */
                var params = _.assign({}, this.activatedRoute.snapshot.params, { queryParams: queryParams });
                this.route.navigate([url], params);
            };
        SearchFormComponent.decorators = [
            { type: core.Component, args: [{
                        // tslint:disable-next-line:component-selector
                        selector: 'search-form',
                        template: "<form class=\"search-form search-form--inline\" (ngSubmit)=\"onSubmit()\">\n  <div class=\"form-group search-form--inline__submit\">\n    <input type=\"submit\" value=\"Search\" class=\"btn btn-success search-form--inline__btn-submit\">\n  </div>\n  <div class=\"form-group search-form--inline__search\">\n    <input type=\"search\" name=\"keyword\" placeholder=\"{{ placeHolder }}\" class=\"form-control search-form--inline__input-field\" [(ngModel)]=\"keyword\">\n  </div>\n</form>",
                        styles: [""]
                    }] }
        ];
        SearchFormComponent.ctorParameters = function () {
            return [
                { type: router.Router },
                { type: router.ActivatedRoute }
            ];
        };
        SearchFormComponent.propDecorators = {
            placeHolder: [{ type: core.Input }]
        };
        return SearchFormComponent;
    }());

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */
    /* global Reflect, Promise */
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b)
                if (b.hasOwnProperty(p))
                    d[p] = b[p]; };
        return extendStatics(d, b);
    };
    function __extends(d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }
    function __read(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m)
            return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
                ar.push(r.value);
        }
        catch (error) {
            e = { error: error };
        }
        finally {
            try {
                if (r && !r.done && (m = i["return"]))
                    m.call(i);
            }
            finally {
                if (e)
                    throw e.error;
            }
        }
        return ar;
    }
    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var Exception = /** @class */ (function (_super) {
        __extends(Exception, _super);
        function Exception(message) {
            return _super.call(this, message) || this;
        }
        return Exception;
    }(Error));

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var LengthAwarePaginatorComponent = /** @class */ (function () {
        function LengthAwarePaginatorComponent(router$$1, activeRoute) {
            var _this = this;
            this.name = 'page';
            this.current_page = 1;
            this.pages = [];
            this.numberPageInBetween = 5;
            this.pagesInBetween = [];
            this.router = router$$1;
            this.activeRoute = activeRoute;
            this.navigationSubscription = this.router.events.subscribe(function (e) {
                if (e instanceof router.NavigationEnd) {
                    if (!_.isUndefined(_this.activeRoute.snapshot.queryParams.page)) {
                        // tslint:disable-next-line:radix
                        _this.current_page = parseInt(_this.activeRoute.snapshot.queryParams.page);
                    }
                }
            });
        }
        /**
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.ngOnInit = /**
         * @return {?}
         */
            function () {
                if (!_.isUndefined(this.activeRoute.snapshot.queryParams[this.name])) {
                    // tslint:disable-next-line:radix
                    this.current_page = parseInt(this.activeRoute.snapshot.queryParams[this.name]);
                }
            };
        /**
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.ngOnDestroy = /**
         * @return {?}
         */
            function () {
                this.navigationSubscription.unsubscribe();
            };
        /**
         * @param {?} changes
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.ngOnChanges = /**
         * @param {?} changes
         * @return {?}
         */
            function (changes) {
                if (!_.isUndefined(this.paginator)) {
                    /** @type {?} */
                    var pages = [];
                    /** @type {?} */
                    var length_1 = this.paginator.getTotalPages();
                    for (var k = 1; k <= length_1; k++) {
                        pages.push(k);
                    }
                    this.pages = pages;
                    /** @type {?} */
                    var newPagesInBetween = [];
                    if (length_1 - 2 > this.numberPageInBetween) {
                        if (this.isHideLeftShowMore(this.current_page)) {
                            for (var k = 2; k <= this.numberPageInBetween + 1; k++) {
                                newPagesInBetween.push(k);
                            }
                        }
                        else if (this.isHideRightShowMore(this.current_page)) {
                            for (var k = length_1 - this.numberPageInBetween; k <= length_1 - 1; k++) {
                                newPagesInBetween.push(k);
                            }
                        }
                        else {
                            if (this.pagesInBetween.indexOf(this.current_page) > -1) {
                                newPagesInBetween = this.pagesInBetween;
                            }
                            else {
                                for (var k = this.current_page; k <= this.current_page + this.numberPageInBetween - 1; k++) {
                                    newPagesInBetween.push(k);
                                }
                            }
                        }
                    }
                    else {
                        for (var k = 2; k <= length_1 - 1; k++) {
                            newPagesInBetween.push(k);
                        }
                    }
                    this.pagesInBetween = newPagesInBetween;
                }
            };
        /**
         * @param {?} page
         * @param {?=} action
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.resolveParams = /**
         * @param {?} page
         * @param {?=} action
         * @return {?}
         */
            function (page, action) {
                var _a, _b, _c;
                if (!_.isUndefined(action)) {
                    if (action === 'prev') {
                        /** @type {?} */
                        var prevPage = page - 1;
                        return _.assign({}, this.activeRoute.snapshot.queryParams, (_a = {}, _a[this.name] = prevPage, _a));
                    }
                    else if (action === 'next') {
                        /** @type {?} */
                        var nextPage = page + 1;
                        return _.assign({}, this.activeRoute.snapshot.queryParams, (_b = {}, _b[this.name] = nextPage, _b));
                    }
                    else {
                        throw new Exception('only \'prev\' or \'next\' action are allowed');
                    }
                }
                else {
                    return _.assign({}, this.activeRoute.snapshot.queryParams, (_c = {}, _c[this.name] = page, _c));
                }
            };
        /**
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.getCurrentPage = /**
         * @return {?}
         */
            function () {
                return this.current_page;
            };
        /**
         * @param {?} page
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.isCurrentPage = /**
         * @param {?} page
         * @return {?}
         */
            function (page) {
                return page === this.current_page;
            };
        /**
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.shouldActivePrev = /**
         * @return {?}
         */
            function () {
                return this.current_page > 1;
            };
        /**
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.shouldActiveNext = /**
         * @return {?}
         */
            function () {
                return this.current_page < this.paginator.getTotalPages();
            };
        /**
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.getCurrentUrl = /**
         * @return {?}
         */
            function () {
                /** @type {?} */
                var segments = ['/'];
                this.activeRoute.snapshot.pathFromRoot.forEach(function (item) {
                    if (Array.isArray(item.url) && item.url.length > 0) {
                        segments = __spread(segments, item.url.map(function (i) { return i.path; }));
                    }
                });
                return segments;
            };
        /**
         * @param {?} page
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.isHideLeftShowMore = /**
         * @param {?} page
         * @return {?}
         */
            function (page) {
                if (this.pages.length - 2 < this.numberPageInBetween || page <= this.numberPageInBetween + 1) {
                    return true;
                }
                else {
                    return false;
                }
            };
        /**
         * @param {?} page
         * @return {?}
         */
        LengthAwarePaginatorComponent.prototype.isHideRightShowMore = /**
         * @param {?} page
         * @return {?}
         */
            function (page) {
                // if left hide means we know that the left over pages is not more than this.numberPageInBetween
                if (!this.isHideLeftShowMore(page)) {
                    if (this.pages.length - 2 < this.numberPageInBetween || page > this.pages.length - this.numberPageInBetween) {
                        return true;
                    }
                    else {
                        return false;
                    }
                }
                else {
                    if (this.pages.length - 2 < this.numberPageInBetween || page > this.numberPageInBetween + 1) {
                        return true;
                    }
                    else {
                        return false;
                    }
                }
            };
        LengthAwarePaginatorComponent.decorators = [
            { type: core.Component, args: [{
                        // tslint:disable-next-line:component-selector
                        selector: 'length-aware-paginator',
                        template: "<div class=\"row\" *ngIf=\"paginator !== undefined && (alwaysDisplay === true || this.paginator.getTotalPages() > 1)\">\n  <div class=\"col-md-12 col-sm-12 col-xs-12\">\n    <ul class=\"pagination animated fadeIn\">\n      <li class=\"page-item\" *ngIf=\"shouldActivePrev()\">\n        <a class=\"page-link\" [routerLink]=\"getCurrentUrl()\" [queryParams]=\"this.resolveParams(getCurrentPage(), 'prev')\">Prev</a>\n      </li>\n      <li class=\"page-item\" [ngClass]=\"{'active': isCurrentPage(1)}\">\n        <a class=\"page-link\" [routerLink]=\"getCurrentUrl()\" [queryParams]=\"this.resolveParams(1)\">1</a>\n      </li>\n      <li class=\"page-item left-show-more\" *ngIf=\"!isHideLeftShowMore(getCurrentPage())\">\n        <a class=\"page-link\" [routerLink]=\"getCurrentUrl()\" [queryParams]=\"this.resolveParams(pagesInBetween[0] - numberPageInBetween )\">...</a>\n      </li>\n      <li class=\"page-item\" [ngClass]=\"{'active': isCurrentPage(page)}\" *ngFor=\"let page of pagesInBetween\">\n        <a class=\"page-link\" [routerLink]=\"getCurrentUrl()\" [queryParams]=\"this.resolveParams(page)\">{{ page }}</a>\n      </li>\n      <li class=\"page-item right-show-more\" *ngIf=\"!isHideRightShowMore(getCurrentPage())\">\n        <a class=\"page-link\" [routerLink]=\"getCurrentUrl()\" [queryParams]=\"this.resolveParams(pagesInBetween[pagesInBetween.length - 1] + 1)\">...</a>\n      </li>\n      <li class=\"page-item\" [ngClass]=\"{'active': isCurrentPage(pages.length)}\" *ngIf=\"pages.length > 1\">\n        <a class=\"page-link\" [routerLink]=\"getCurrentUrl()\" [queryParams]=\"this.resolveParams(pages.length)\">{{ pages.length }}</a>\n      </li>\n      <li class=\"page-item\" *ngIf=\"shouldActiveNext()\">\n        <a class=\"page-link\" [routerLink]=\"getCurrentUrl()\" [queryParams]=\"this.resolveParams(getCurrentPage(), 'next')\">Next</a>\n      </li>\n    </ul>\n  </div>\n</div>",
                        styles: [""]
                    }] }
        ];
        LengthAwarePaginatorComponent.ctorParameters = function () {
            return [
                { type: router.Router },
                { type: router.ActivatedRoute }
            ];
        };
        LengthAwarePaginatorComponent.propDecorators = {
            alwaysDisplay: [{ type: core.Input }],
            paginator: [{ type: core.Input }],
            name: [{ type: core.Input }]
        };
        return LengthAwarePaginatorComponent;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    /** @type {?} */
    var ASC = 'asc';
    /** @type {?} */
    var DESC = 'desc';
    var SortByFieldComponent = /** @class */ (function () {
        function SortByFieldComponent(route, activatedRoute) {
            this.allowMulti = false;
            this.route = route;
            this.activatedRoute = activatedRoute;
        }
        /**
         * @return {?}
         */
        SortByFieldComponent.prototype.ngOnInit = /**
         * @return {?}
         */
            function () {
                var _this = this;
                if (!_.isUndefined(this.default)) {
                    if (this.default.toLowerCase() === 'asc') {
                        this.direction = ASC;
                    }
                    if (this.default.toLowerCase() === 'desc') {
                        this.direction = DESC;
                    }
                }
                if (!_.isUndefined(this.activatedRoute.snapshot.queryParams.sort)) {
                    /** @type {?} */
                    var fields = this.activatedRoute.snapshot.queryParams.sort.split(',');
                    if (_.includes(fields, this.field) || _.includes(fields, "+" + this.field)) {
                        this.direction = ASC;
                    }
                    else if (_.includes(fields, "-" + this.field)) {
                        this.direction = DESC;
                    }
                }
                this.navigationSubscription = this.route.events.subscribe(function (e) {
                    if (e instanceof router.NavigationEnd) {
                        if (!_.isUndefined(_this.default)) {
                            if (_this.default.toLowerCase() === 'asc') {
                                _this.direction = ASC;
                            }
                            if (_this.default.toLowerCase() === 'desc') {
                                _this.direction = DESC;
                            }
                        }
                        if (!_.isUndefined(_this.activatedRoute.snapshot.queryParams.sort)) {
                            /** @type {?} */
                            var fields = _this.activatedRoute.snapshot.queryParams.sort.split(',');
                            if (_.includes(fields, _this.field) || _.includes(fields, "+" + _this.field)) {
                                _this.direction = ASC;
                            }
                            else if (_.includes(fields, "-" + _this.field)) {
                                _this.direction = DESC;
                            }
                            else {
                                // tslint:disable-next-line:no-unused-expression
                                _this.direction = undefined;
                            }
                        }
                        else {
                            // tslint:disable-next-line:no-unused-expression
                            _this.direction = undefined;
                        }
                    }
                });
            };
        /**
         * @return {?}
         */
        SortByFieldComponent.prototype.ngOnDestroy = /**
         * @return {?}
         */
            function () {
                this.navigationSubscription.unsubscribe();
            };
        /**
         * @return {?}
         */
        SortByFieldComponent.prototype.getDirection = /**
         * @return {?}
         */
            function () {
                return this.direction;
            };
        /**
         * @return {?}
         */
        SortByFieldComponent.prototype.getRouterDirection = /**
         * @return {?}
         */
            function () {
                if (this.direction === ASC) {
                    return '';
                }
                else if (this.direction === DESC) {
                    return '-';
                }
                else {
                    return undefined;
                }
            };
        /**
         * @return {?}
         */
        SortByFieldComponent.prototype.sort = /**
         * @return {?}
         */
            function () {
                var _this = this;
                if (this.direction === ASC) {
                    this.direction = DESC;
                }
                else if (this.direction === DESC) {
                    this.direction = undefined;
                }
                else {
                    this.direction = ASC;
                }
                /** @type {?} */
                var url = this.activatedRoute.snapshot.url;
                /** @type {?} */
                var queryParams = this.activatedRoute.snapshot.queryParams;
                /** @type {?} */
                var fields = [];
                if (this.allowMulti === true) {
                    if (!_.isUndefined(queryParams.sort)) {
                        fields = queryParams.sort.split(',');
                        if (_.includes(fields, this.field) || _.includes(fields, "+" + this.field) || _.includes(fields, "-" + this.field)) {
                            if (this.getRouterDirection() === undefined) {
                                _.remove(fields, function (item) { return item === _this.field || item === "+" + _this.field || item === "-" + _this.field; });
                            }
                            else {
                                fields = _.map(fields, function (item) {
                                    if (item === _this.field || item === "+" + _this.field || item === "-" + _this.field) {
                                        item = "" + _this.getRouterDirection() + _this.field;
                                    }
                                    return item;
                                });
                            }
                        }
                        else {
                            if (this.getRouterDirection() !== undefined) {
                                fields.push("" + this.getRouterDirection() + this.field);
                            }
                        }
                    }
                    else {
                        if (this.getRouterDirection() !== undefined) {
                            fields.push("" + this.getRouterDirection() + this.field);
                        }
                    }
                }
                else {
                    if (this.getRouterDirection() !== undefined) {
                        fields.push("" + this.getRouterDirection() + this.field);
                    }
                }
                _.remove(fields, function (item) { return _.isNil(item) || item === ''; });
                /** @type {?} */
                var extras = { queryParams: { sort: fields.join(','), page: 1 } };
                if (!_.isUndefined(this.options)) {
                    extras = _.assign(this.options, extras);
                }
                if (_.isUndefined(this.callback)) {
                    this.route.navigate([document.location.pathname], _.assign(extras, { queryParamsHandling: 'merge' }));
                }
                else {
                    this.callback(this.field, this.direction, extras);
                }
            };
        SortByFieldComponent.decorators = [
            { type: core.Component, args: [{
                        // tslint:disable-next-line:component-selector
                        selector: 'sort-by-field',
                        template: "<span class=\"sorting fa fa-sort\" [ngClass]=\"{ 'fa-sort-up': direction === 'asc', 'fa-sort-down': direction === 'desc' }\" (click)=\"sort()\"></span>\n",
                        styles: [":host .sorting{cursor:pointer}"]
                    }] }
        ];
        SortByFieldComponent.ctorParameters = function () {
            return [
                { type: router.Router },
                { type: router.ActivatedRoute }
            ];
        };
        SortByFieldComponent.propDecorators = {
            field: [{ type: core.Input }],
            allowMulti: [{ type: core.Input }],
            default: [{ type: core.Input }],
            options: [{ type: core.Input }],
            callback: [{ type: core.Input }]
        };
        return SortByFieldComponent;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var PerPageComponent = /** @class */ (function () {
        function PerPageComponent(route, activatedRoute) {
            var _this = this;
            this.route = route;
            this.activatedRoute = activatedRoute;
            this.limits = [5, 10, 20, 100];
            this.perPage = 20;
            this.navigationSubscription = this.route.events.subscribe(function (e) {
                if (e instanceof router.NavigationEnd) {
                    /** @type {?} */
                    var name_1 = _this.name || 'per_page';
                    if (!_.isUndefined(_this.activatedRoute.snapshot.queryParams[name_1])) {
                        // tslint:disable-next-line:radix
                        _this.perPage = parseInt(_this.activatedRoute.snapshot.queryParams[name_1]);
                        if (!_.includes(_this.limits, _this.perPage)) {
                            _this.limits.push(_this.perPage);
                        }
                        else {
                            _this.limits = [5, 10, 20, 100];
                        }
                    }
                }
            });
        }
        /**
         * @return {?}
         */
        PerPageComponent.prototype.ngOnInit = /**
         * @return {?}
         */
            function () { };
        /**
         * @return {?}
         */
        PerPageComponent.prototype.ngOnDestroy = /**
         * @return {?}
         */
            function () {
                if (!_.isUndefined(this.navigationSubscription)) {
                    this.navigationSubscription.unsubscribe();
                }
            };
        /**
         * @return {?}
         */
        PerPageComponent.prototype.updateLimit = /**
         * @return {?}
         */
            function () {
                /** @type {?} */
                var name = this.name || 'per_page';
                /** @type {?} */
                var page = this.page || 'page';
                /** @type {?} */
                var url = window.location.pathname;
                /** @type {?} */
                var queryParams = this.activatedRoute.snapshot.queryParams;
                /** @type {?} */
                var data = {};
                data[name] = this.perPage;
                data[page] = 1;
                queryParams = _.assign({}, queryParams, data);
                /** @type {?} */
                var params = _.assign({}, this.activatedRoute.snapshot.params, { queryParams: queryParams });
                this.route.navigate([url], params);
            };
        PerPageComponent.decorators = [
            { type: core.Component, args: [{
                        // tslint:disable-next-line:component-selector
                        selector: 'per-page',
                        template: "<label for=\"\">Show</label>\n<select class=\"form-control input-sm\" name=\"perPage\" [(ngModel)]=\"perPage\" (change)=\"updateLimit()\">\n  <option [ngValue]=\"i\" *ngFor=\"let i of limits\">{{ i }}</option>\n</select>\n",
                        styles: [""]
                    }] }
        ];
        PerPageComponent.ctorParameters = function () {
            return [
                { type: router.Router },
                { type: router.ActivatedRoute }
            ];
        };
        PerPageComponent.propDecorators = {
            perPage: [{ type: core.Input }],
            name: [{ type: core.Input }],
            page: [{ type: core.Input }]
        };
        return PerPageComponent;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var CustomSelectionComponent = /** @class */ (function () {
        function CustomSelectionComponent(element, renderer) {
            this.element = element;
            this.renderer = renderer;
            this.onChange = function (val) { };
            this.onTouched = function () { };
            this.disabled = false;
        }
        /**
         * @return {?}
         */
        CustomSelectionComponent.prototype.triggerChanged = /**
         * @return {?}
         */
            function () {
                /** @type {?} */
                var event = new CustomEvent('change', { bubbles: true });
                this.renderer.invokeElementMethod(this.element.nativeElement, 'dispatchEvent', [event]);
            };
        /**
         * @param {?} val
         * @return {?}
         */
        CustomSelectionComponent.prototype.writeValue = /**
         * @param {?} val
         * @return {?}
         */
            function (val) {
                if (val) {
                    this.value = val;
                }
            };
        Object.defineProperty(CustomSelectionComponent.prototype, "value", {
            get: /**
             * @return {?}
             */ function () {
                return this._value;
            },
            set: /**
             * @param {?} val
             * @return {?}
             */ function (val) {
                this.selected = _.find(this.options, function (item) { return item.value === val; });
                this._value = val;
                this.onChange(this._value);
            },
            enumerable: true,
            configurable: true
        });
        /**
         * @param {?} fn
         * @return {?}
         */
        CustomSelectionComponent.prototype.registerOnChange = /**
         * @param {?} fn
         * @return {?}
         */
            function (fn) {
                this.onChange = fn;
            };
        /**
         * @param {?} fn
         * @return {?}
         */
        CustomSelectionComponent.prototype.registerOnTouched = /**
         * @param {?} fn
         * @return {?}
         */
            function (fn) {
                this.onTouched = fn;
            };
        /**
         * @param {?} isDisabled
         * @return {?}
         */
        CustomSelectionComponent.prototype.setDisabledState = /**
         * @param {?} isDisabled
         * @return {?}
         */
            function (isDisabled) {
                this.disabled = isDisabled;
            };
        /**
         * @param {?} opt
         * @return {?}
         */
        CustomSelectionComponent.prototype.change = /**
         * @param {?} opt
         * @return {?}
         */
            function (opt) {
                this.value = opt.value;
                this.triggerChanged();
            };
        CustomSelectionComponent.decorators = [
            { type: core.Component, args: [{
                        // tslint:disable-next-line:component-selector
                        selector: 'custom-selection',
                        template: "<div class=\"dropdown custom-selection\">\n  <button class=\"btn btn-default btn-sm dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n    {{ selected === undefined ? '' : selected.label }}\n  </button>\n  <div class=\"dropdown-menu\">\n    <a class=\"dropdown-item\" *ngFor=\"let option of options\" (click)=\"change(option)\">{{ option.label }}</a>\n  </div>\n</div>\n",
                        providers: [
                            {
                                provide: forms.NG_VALUE_ACCESSOR,
                                useExisting: core.forwardRef(function () { return CustomSelectionComponent; }),
                                multi: true
                            }
                        ],
                        styles: [":host .custom-selection button{border:1px solid #ddd;border-radius:4px}:host .custom-selection button.btn:focus{box-shadow:none;outline:0}:host .custom-selection .dropdown-menu .dropdown-item{cursor:pointer}"]
                    }] }
        ];
        CustomSelectionComponent.ctorParameters = function () {
            return [
                { type: core.ElementRef },
                { type: core.Renderer }
            ];
        };
        CustomSelectionComponent.propDecorators = {
            _value: [{ type: core.Input }],
            options: [{ type: core.Input }]
        };
        return CustomSelectionComponent;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var AutoresizeDirective = /** @class */ (function () {
        function AutoresizeDirective(element) {
            this.element = element;
        }
        /**
         * @param {?} textArea
         * @return {?}
         */
        AutoresizeDirective.prototype.onInput = /**
         * @param {?} textArea
         * @return {?}
         */
            function (textArea) {
                this.adjust();
            };
        /**
         * @return {?}
         */
        AutoresizeDirective.prototype.ngOnInit = /**
         * @return {?}
         */
            function () {
                this.adjust();
            };
        /**
         * @return {?}
         */
        AutoresizeDirective.prototype.adjust = /**
         * @return {?}
         */
            function () {
                /** @type {?} */
                var el = this.element.nativeElement;
                /** @type {?} */
                var newHeight;
                if (el) {
                    el.style.overflow = 'hidden';
                    el.style.height = 'auto';
                    if (this.autoresize) {
                        newHeight = Math.min(el.scrollHeight, this.autoresize);
                    }
                    else {
                        newHeight = el.scrollHeight;
                    }
                    el.style.height = newHeight + 'px';
                }
            };
        AutoresizeDirective.decorators = [
            { type: core.Directive, args: [{
                        // tslint:disable-next-line:directive-selector
                        selector: '[autoresize]'
                    },] }
        ];
        AutoresizeDirective.ctorParameters = function () {
            return [
                { type: core.ElementRef }
            ];
        };
        AutoresizeDirective.propDecorators = {
            autoresize: [{ type: core.Input }],
            onInput: [{ type: core.HostListener, args: ['input', ['$event.target'],] }]
        };
        return AutoresizeDirective;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var DirectivesModule = /** @class */ (function () {
        function DirectivesModule() {
        }
        DirectivesModule.decorators = [
            { type: core.NgModule, args: [{
                        imports: [
                            common.CommonModule,
                            forms.FormsModule,
                            forms.ReactiveFormsModule,
                            router.RouterModule,
                            PipesModule
                        ],
                        exports: [
                            CustomSelectionComponent,
                            LengthAwarePaginatorComponent,
                            PerPageComponent,
                            SearchFormComponent,
                            SortByFieldComponent,
                            PaginationComponent,
                            LoaderComponent,
                            AutoresizeDirective
                        ],
                        declarations: [
                            CustomSelectionComponent,
                            LengthAwarePaginatorComponent,
                            PerPageComponent,
                            SearchFormComponent,
                            SortByFieldComponent,
                            PaginationComponent,
                            LoaderComponent,
                            AutoresizeDirective
                        ]
                    },] }
        ];
        return DirectivesModule;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var ActivityLogComponent = /** @class */ (function () {
        function ActivityLogComponent() {
        }
        /**
         * @return {?}
         */
        ActivityLogComponent.prototype.ngOnInit = /**
         * @return {?}
         */
            function () { };
        ActivityLogComponent.decorators = [
            { type: core.Component, args: [{
                        selector: 'vicoders-activity-log',
                        template: "<table class=\"table table-no-border-top\">\n  <thead>\n    <tr>\n      <th>\n        ID\n        <sort-by-field field=\"id\"></sort-by-field>\n      </th>\n      <th>Th\u1EDDi gian</th>\n      <th>S\u1EF1 ki\u1EC7n</th>\n    </tr>\n  </thead>\n  <tbody *ngIf=\"(items | hasItem)\">\n    <tr *ngFor=\"let item of items\">\n      <td>{{ item.getId() }}</td>\n      <td>\n        {{\n          item.timestamps.created_at.date | timeFormat: \"DD/MM/YYYY HH:mm:ss\"\n        }}\n      </td>\n      <td>{{ item.getDescription() }}</td>\n    </tr>\n  </tbody>\n\n  <tbody *ngIf=\"!(items | hasItem)\">\n    <tr>\n      <td colspan=\"4\" class=\"text-center\">We don't have any record here</td>\n    </tr>\n  </tbody>\n</table>\n<length-aware-paginator *ngIf=\"paginator\" [(paginator)]=\"paginator\"></length-aware-paginator>\n",
                        styles: [""]
                    }] }
        ];
        ActivityLogComponent.ctorParameters = function () { return []; };
        ActivityLogComponent.propDecorators = {
            items: [{ type: core.Input }],
            paginator: [{ type: core.Input }]
        };
        return ActivityLogComponent;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */
    var VicodersActivityLogModule = /** @class */ (function () {
        function VicodersActivityLogModule() {
        }
        VicodersActivityLogModule.decorators = [
            { type: core.NgModule, args: [{
                        imports: [common.CommonModule, DirectivesModule, PipesModule],
                        declarations: [ActivityLogComponent],
                        exports: [ActivityLogComponent]
                    },] }
        ];
        return VicodersActivityLogModule;
    }());

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */

    /**
     * @fileoverview added by tsickle
     * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
     */

    exports.DirectivesModule = DirectivesModule;
    exports.PipesModule = PipesModule;
    exports.Exception = Exception;
    exports.ActivityLogComponent = ActivityLogComponent;
    exports.VicodersActivityLogModule = VicodersActivityLogModule;
    exports.ɵr = AutoresizeDirective;
    exports.ɵk = CustomSelectionComponent;
    exports.ɵl = LengthAwarePaginatorComponent;
    exports.ɵq = LoaderComponent;
    exports.ɵp = PaginationComponent;
    exports.ɵm = PerPageComponent;
    exports.ɵn = SearchFormComponent;
    exports.ɵo = SortByFieldComponent;
    exports.ɵd = FilterByPipe;
    exports.ɵh = FindByPipe;
    exports.ɵg = FlatMapPipe;
    exports.ɵa = HasItemPipe;
    exports.ɵc = IsArrayPipe;
    exports.ɵb = LengthPipe;
    exports.ɵe = OrderByPipe;
    exports.ɵj = ReadableTimePipe;
    exports.ɵf = SumByPipe;
    exports.ɵi = TimeFormatPipe;

    Object.defineProperty(exports, '__esModule', { value: true });

})));

//# sourceMappingURL=vicoders-angular.umd.js.map