@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,640 lines • 61 kB
JavaScript
import * as moment_ from 'moment';
import { __spread, __extends } from 'tslib';
import { Router, NavigationEnd, ActivatedRoute, RouterModule } from '@angular/router';
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { isUndefined, assign, isArray, filter, includes, get, find, flatMap, forEach, isNil, orderBy, sumBy, isObject, isString, remove, map, pick, isEqual } from 'lodash';
import { Pipe, NgModule, Component, Input, EventEmitter, Output, forwardRef, ElementRef, Renderer, Directive, HostListener } from '@angular/core';
import { CommonModule } from '@angular/common';
/**
* @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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: NgModule, args: [{
imports: [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 EventEmitter();
this.goNext = new EventEmitter();
this.goPage = new 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: 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: Input }],
page: [{ type: Input }],
count: [{ type: Input }],
perPage: [{ type: Input }],
loading: [{ type: Input }],
goPrev: [{ type: Output }],
goNext: [{ type: Output }],
goPage: [{ type: 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: 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 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: 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 },
{ type: ActivatedRoute }
]; };
SearchFormComponent.propDecorators = {
placeHolder: [{ type: Input }]
};
return SearchFormComponent;
}());
/**
* @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 Model = /** @class */ (function () {
function Model() {
}
/**
* @param {?=} options
* @param {?=} keep_function
* @return {?}
*/
Model.prototype.bind = /**
* @param {?=} options
* @param {?=} keep_function
* @return {?}
*/
function (options, keep_function) {
var _this = this;
if (options === void 0) { options = {}; }
if (keep_function === void 0) { keep_function = false; }
// tslint:disable-next-line:forin
for (var k in options) {
/** @type {?} */
var v = options[k];
if (typeof v === 'function') {
if (keep_function === true) {
this[k] = v;
}
continue;
}
if (v !== null && v !== undefined) {
if (typeof this[k] === 'function') {
this[k] = this[k](v);
}
else {
this[k] = v;
}
}
Object.getOwnPropertyNames(this).forEach(function (property) {
if (options[property] === null || options[property] === undefined) {
delete _this[property];
}
else {
/** @type {?} */
var proto = Object.getPrototypeOf(_this);
// tslint:disable-next-line:prefer-const
/** @type {?} */
var method = _this.camelCase('get_' + property);
proto[method] = function () {
return this[property];
};
}
});
}
};
/**
* @template THIS
* @this {THIS}
* @param {?} fields
* @return {THIS}
*/
Model.prototype._backup = /**
* @template THIS
* @this {THIS}
* @param {?} fields
* @return {THIS}
*/
function (fields) {
/** @type {?} */
var data = pick((/** @type {?} */ (this)), fields);
((/** @type {?} */ ((/** @type {?} */ (this)))))._origin = { fields: fields, data: data };
return (/** @type {?} */ (this));
};
/**
* @return {?}
*/
Model.prototype._isChanged = /**
* @return {?}
*/
function () {
/** @type {?} */
var data = pick(this, ((/** @type {?} */ (this)))._origin.fields);
return !isEqual(data, ((/** @type {?} */ (this)))._origin.data);
};
/**
* @param {?} string
* @return {?}
*/
Model.prototype.camelCase = /**
* @param {?} string
* @return {?}
*/
function (string) {
string = string.toLowerCase();
string = string.replace(/[^a-z0-9]/g, ' ');
string = string.replace(/\s{2}/g, '');
string = string.replace(/\w+/g, function (match) {
return match.replace(/\b./, function (item) { return item.toUpperCase(); });
});
string = string.replace(/\s/g, '');
string = string.replace(/\b./, function (item) { return item.toLowerCase(); });
return string;
};
return Model;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var LengthAwarePaginator = /** @class */ (function (_super) {
__extends(LengthAwarePaginator, _super);
function LengthAwarePaginator(options) {
var _this = _super.call(this) || this;
_this.bind(options);
return _this;
}
/**
* @return {?}
*/
LengthAwarePaginator.prototype.getTotalPages = /**
* @return {?}
*/
function () {
throw new Error('Method not implemented.');
};
/**
* @return {?}
*/
LengthAwarePaginator.prototype.getTotal = /**
* @return {?}
*/
function () {
throw new Error('Method not implemented.');
};
return LengthAwarePaginator;
}(Model));
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var LengthAwarePaginatorComponent = /** @class */ (function () {
function LengthAwarePaginatorComponent(router, activeRoute) {
var _this = this;
this.name = 'page';
this.current_page = 1;
this.pages = [];
this.numberPageInBetween = 5;
this.pagesInBetween = [];
this.router = router;
this.activeRoute = activeRoute;
this.navigationSubscription = this.router.events.subscribe(function (e) {
if (e instanceof 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: 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 },
{ type: ActivatedRoute }
]; };
LengthAwarePaginatorComponent.propDecorators = {
alwaysDisplay: [{ type: Input }],
paginator: [{ type: Input }],
name: [{ type: 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 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: 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 },
{ type: ActivatedRoute }
]; };
SortByFieldComponent.propDecorators = {
field: [{ type: Input }],
allowMulti: [{ type: Input }],
default: [{ type: Input }],
options: [{ type: Input }],
callback: [{ type: 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 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: 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 },
{ type: ActivatedRoute }
]; };
PerPageComponent.propDecorators = {
perPage: [{ type: Input }],
name: [{ type: Input }],
page: [{ type: 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: 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: NG_VALUE_ACCESSOR,
useExisting: 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: ElementRef },
{ type: Renderer }
]; };
CustomSelectionComponent.propDecorators = {
_value: [{ type: Input }],
options: [{ type: 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: Directive, args: [{
// tslint:disable-next-line:directive-selector
selector: '[autoresize]'
},] }
];
AutoresizeDirective.ctorParameters = function () { return [
{ type: ElementRef }
]; };
AutoresizeDirective.propDecorators = {
autoresize: [{ type: Input }],
onInput: [{ type: 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: NgModule, args: [{
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
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: 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: Input }],
paginator: [{ type: 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: NgModule, args: [{
imports: [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
*/
export { DirectivesModule, PipesModule, Exception, ActivityLogComponent, VicodersActivityLogModule, AutoresizeDirective as ɵr, CustomSelectionComponent as ɵk, LengthAwarePaginatorComponent as ɵl, LoaderComponent as ɵq, PaginationComponent as ɵp, PerPageComponent as ɵm, SearchFormComponent as ɵn, SortByFieldComponent as ɵo, FilterByPipe as ɵd, FindByPipe as ɵh, FlatMapPipe as ɵg, HasItemPipe as ɵa, IsArrayPipe as ɵc, LengthPipe as ɵb, OrderByPipe as ɵe, ReadableTimePipe as ɵj, SumByPipe as ɵf, TimeFormatPipe as ɵi };
//# sourceMappingURL=vicoders-angular.js.map