@stratio/egeo
Version:
1,609 lines (1,599 loc) • 756 kB
JavaScript
import { __spread, __values, __extends, __decorate, __metadata, __rest, __assign } from 'tslib';
import { CommonModule, formatDate } from '@angular/common';
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, ComponentFactoryResolver, Input, HostBinding, Output, ViewChild, ViewContainerRef, Pipe, NgModule, ChangeDetectorRef, ElementRef, HostListener, forwardRef, ViewEncapsulation, Renderer2, Directive, ViewChildren, Injector, ANALYZE_FOR_ENTRY_COMPONENTS, ContentChildren, Optional } from '@angular/core';
import { Subject, BehaviorSubject, Observable, of } from 'rxjs';
import { trigger, state, style, transition, animate } from '@angular/animations';
import { takeRight, set, cloneDeep, keys, forEach, values, omit, has, range, flatten, get, throttle, differenceBy, includes, xorBy, clone, sortBy } from 'lodash';
import { map, catchError, zip, debounceTime } from 'rxjs/operators';
import { NG_VALUE_ACCESSOR, Validators, NG_VALIDATORS, FormControl, FormsModule, ReactiveFormsModule, NgControl, FormArray, FormGroup, NgModel } from '@angular/forms';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import 'prismjs';
import 'prismjs/components/prism-typescript';
import { DomSanitizer } from '@angular/platform-browser';
import { Router, NavigationEnd, RouterModule } from '@angular/router';
import { VirtualScrollerModule } from 'ngx-virtual-scroller';
/**
* @fileoverview added by tsickle
* Generated from: lib/st-alerts/st-alerts.model.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @enum {number} */
var STALERT_SEVERITY = {
SUCCESS: 0, WARNING: 1, ERROR: 2, INFO: 3,
};
STALERT_SEVERITY[STALERT_SEVERITY.SUCCESS] = 'SUCCESS';
STALERT_SEVERITY[STALERT_SEVERITY.WARNING] = 'WARNING';
STALERT_SEVERITY[STALERT_SEVERITY.ERROR] = 'ERROR';
STALERT_SEVERITY[STALERT_SEVERITY.INFO] = 'INFO';
var StAlertLink = /** @class */ (function () {
function StAlertLink() {
}
return StAlertLink;
}());
if (false) {
/** @type {?} */
StAlertLink.prototype.title;
/** @type {?} */
StAlertLink.prototype.link;
}
var StAlert = /** @class */ (function () {
function StAlert(id, title, message, severity, timeout, extendedTimeout, link) {
this.id = id;
this.title = title;
this.message = message;
this.severity = severity;
this.timeout = timeout;
this.extendedTimeout = extendedTimeout;
this.link = link;
this._readed = false;
this._opacity = 0;
this._opacityState = new Subject();
this._removeEvent = new Subject();
}
Object.defineProperty(StAlert.prototype, "opacity", {
get: /**
* @return {?}
*/
function () {
return this._opacityState.asObservable();
},
enumerable: true,
configurable: true
});
Object.defineProperty(StAlert.prototype, "removeAlertEvent", {
get: /**
* @return {?}
*/
function () {
return this._removeEvent.asObservable();
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
StAlert.prototype.notify = /**
* @return {?}
*/
function () {
this.setVisible(true);
};
/**
* @return {?}
*/
StAlert.prototype.pauseNotify = /**
* @return {?}
*/
function () {
this._opacity = 1;
this._readed = true;
this.clearAnimation();
this.stopLife();
this._opacityState.next(this._opacity);
};
/**
* @return {?}
*/
StAlert.prototype.continueNotify = /**
* @return {?}
*/
function () {
this.startLife();
};
/**
* @return {?}
*/
StAlert.prototype.cancel = /**
* @return {?}
*/
function () {
this.setVisible(false);
};
/**
* @private
* @param {?} increase
* @return {?}
*/
StAlert.prototype.setVisible = /**
* @private
* @param {?} increase
* @return {?}
*/
function (increase) {
var _this = this;
this.clearAnimation();
this._changeVisibilityInterval = window.setInterval((/**
* @return {?}
*/
function () { return _this.modifyVisibility(increase); }), 50);
};
/**
* @private
* @param {?} increase
* @return {?}
*/
StAlert.prototype.modifyVisibility = /**
* @private
* @param {?} increase
* @return {?}
*/
function (increase) {
this._opacity += increase ? 0.1 : -0.1;
if (this._opacity >= 1 || this._opacity <= 0) {
this.clearAnimation();
if (increase) {
this.startLife();
}
else {
this.notifyForRemove();
}
}
this._opacityState.next(this._opacity);
};
/**
* @private
* @return {?}
*/
StAlert.prototype.notifyForRemove = /**
* @private
* @return {?}
*/
function () {
this._opacityState.complete();
this._removeEvent.next(this);
this._removeEvent.complete();
};
/**
* @private
* @return {?}
*/
StAlert.prototype.clearAnimation = /**
* @private
* @return {?}
*/
function () {
window.clearInterval(this._changeVisibilityInterval);
};
/**
* @private
* @return {?}
*/
StAlert.prototype.stopLife = /**
* @private
* @return {?}
*/
function () {
window.clearTimeout(this._lifeTimeout);
};
/**
* @private
* @return {?}
*/
StAlert.prototype.startLife = /**
* @private
* @return {?}
*/
function () {
var _this = this;
/** @type {?} */
var timeout = this._readed ? this.extendedTimeout : this.timeout;
this._lifeTimeout = window.setTimeout((/**
* @return {?}
*/
function () { return _this.setVisible(false); }), timeout);
};
return StAlert;
}());
if (false) {
/**
* @type {?}
* @private
*/
StAlert.prototype._changeVisibilityInterval;
/**
* @type {?}
* @private
*/
StAlert.prototype._lifeTimeout;
/**
* @type {?}
* @private
*/
StAlert.prototype._readed;
/**
* @type {?}
* @private
*/
StAlert.prototype._opacity;
/**
* @type {?}
* @private
*/
StAlert.prototype._opacityState;
/**
* @type {?}
* @private
*/
StAlert.prototype._removeEvent;
/** @type {?} */
StAlert.prototype.id;
/** @type {?} */
StAlert.prototype.title;
/** @type {?} */
StAlert.prototype.message;
/** @type {?} */
StAlert.prototype.severity;
/** @type {?} */
StAlert.prototype.timeout;
/** @type {?} */
StAlert.prototype.extendedTimeout;
/** @type {?} */
StAlert.prototype.link;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/st-alerts/st-alerts.service.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var StAlertsService = /** @class */ (function () {
function StAlertsService() {
this._alertsList = [];
this._nextId = 0;
this._alertsStream = new BehaviorSubject([]);
}
Object.defineProperty(StAlertsService.prototype, "alertList", {
get: /**
* @return {?}
*/
function () {
return this._alertsStream.asObservable();
},
enumerable: true,
configurable: true
});
/**
* @param {?} title
* @param {?} message
* @param {?} severity
* @param {?=} link
* @param {?=} timeout
* @param {?=} extendedTimeout
* @return {?}
*/
StAlertsService.prototype.notifyAlert = /**
* @param {?} title
* @param {?} message
* @param {?} severity
* @param {?=} link
* @param {?=} timeout
* @param {?=} extendedTimeout
* @return {?}
*/
function (title, message, severity, link, timeout, extendedTimeout) {
var _this = this;
timeout = timeout !== undefined ? timeout : 5000;
extendedTimeout = extendedTimeout !== undefined ? extendedTimeout : 4000;
/** @type {?} */
var alert = new StAlert(this._nextId, title, message, severity, timeout, extendedTimeout, link);
alert.removeAlertEvent.subscribe((/**
* @param {?} alertToRemove
* @return {?}
*/
function (alertToRemove) { return _this.onNotifyRemove(alertToRemove); }));
this.insertAlert(alert);
this._nextId++;
};
/**
* @private
* @param {?} alert
* @return {?}
*/
StAlertsService.prototype.insertAlert = /**
* @private
* @param {?} alert
* @return {?}
*/
function (alert) {
this._alertsList.push(alert);
this._alertsStream.next(this._alertsList);
};
/**
* @private
* @param {?} alert
* @return {?}
*/
StAlertsService.prototype.onNotifyRemove = /**
* @private
* @param {?} alert
* @return {?}
*/
function (alert) {
/** @type {?} */
var pos = this._alertsList.findIndex((/**
* @param {?} internalAlert
* @return {?}
*/
function (internalAlert) { return internalAlert.id === alert.id; }));
this._alertsList.splice(pos, 1);
this._alertsStream.next(this._alertsList);
};
StAlertsService.decorators = [
{ type: Injectable }
];
return StAlertsService;
}());
if (false) {
/**
* @type {?}
* @private
*/
StAlertsService.prototype._alertsList;
/**
* @type {?}
* @private
*/
StAlertsService.prototype._nextId;
/**
* @type {?}
* @private
*/
StAlertsService.prototype._alertsStream;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/st-modal/st-modal.model.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @enum {number} */
var StModalResponse = {
YES: 0, NO: 1, CLOSE: 2,
};
StModalResponse[StModalResponse.YES] = 'YES';
StModalResponse[StModalResponse.NO] = 'NO';
StModalResponse[StModalResponse.CLOSE] = 'CLOSE';
/** @enum {number} */
var StModalBasicType = {
DELETE: 0, CONFIRM: 1, INFO: 2, WARNING: 3,
};
StModalBasicType[StModalBasicType.DELETE] = 'DELETE';
StModalBasicType[StModalBasicType.CONFIRM] = 'CONFIRM';
StModalBasicType[StModalBasicType.INFO] = 'INFO';
StModalBasicType[StModalBasicType.WARNING] = 'WARNING';
var StModalButton = /** @class */ (function () {
function StModalButton() {
}
return StModalButton;
}());
if (false) {
/** @type {?} */
StModalButton.prototype.response;
/** @type {?} */
StModalButton.prototype.responseValue;
/** @type {?} */
StModalButton.prototype.leftIcon;
/** @type {?} */
StModalButton.prototype.rightIcon;
/** @type {?} */
StModalButton.prototype.classes;
/** @type {?} */
StModalButton.prototype.closeOnClick;
/** @type {?} */
StModalButton.prototype.label;
}
var StModalConfig = /** @class */ (function () {
function StModalConfig() {
}
return StModalConfig;
}());
if (false) {
/** @type {?} */
StModalConfig.prototype.fullscreen;
/** @type {?} */
StModalConfig.prototype.modalTitle;
/** @type {?} */
StModalConfig.prototype.messageTitle;
/** @type {?} */
StModalConfig.prototype.message;
/** @type {?} */
StModalConfig.prototype.html;
/** @type {?} */
StModalConfig.prototype.inputs;
/** @type {?} */
StModalConfig.prototype.outputs;
/** @type {?} */
StModalConfig.prototype.buttons;
/** @type {?} */
StModalConfig.prototype.maxWidth;
/** @type {?} */
StModalConfig.prototype.minWidth;
/** @type {?} */
StModalConfig.prototype.empty;
/** @type {?} */
StModalConfig.prototype.showCloseBtn;
/** @type {?} */
StModalConfig.prototype.iconStatus;
}
var StModalButtonResponse = /** @class */ (function () {
function StModalButtonResponse() {
}
return StModalButtonResponse;
}());
if (false) {
/** @type {?} */
StModalButtonResponse.prototype.response;
/** @type {?} */
StModalButtonResponse.prototype.close;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/utils/window-service.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @return {?}
*/
function getWindow() {
return window;
}
var StWindowRefService = /** @class */ (function () {
function StWindowRefService() {
}
Object.defineProperty(StWindowRefService.prototype, "nativeWindow", {
get: /**
* @return {?}
*/
function () {
return getWindow();
},
enumerable: true,
configurable: true
});
StWindowRefService.decorators = [
{ type: Injectable }
];
return StWindowRefService;
}());
/**
* @fileoverview added by tsickle
* Generated from: lib/st-modal/st-modal.component.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var StModalComponent = /** @class */ (function () {
function StModalComponent(cfr, windowRef) {
this.cfr = cfr;
this.windowRef = windowRef;
this.disabledAnimation = true;
this.click = new EventEmitter();
this.endAnimation = new EventEmitter();
this.defaultMaxWidth = 600;
this.defaultMinWidth = 400;
this.visibility = 'visible';
this._subscriptions = [];
}
Object.defineProperty(StModalComponent.prototype, "hasIcon", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.iconStatus;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "isFullscreen", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.fullscreen;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "title", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.modalTitle;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "buttons", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.buttons || [];
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "isMessageModal", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.message && this.modalConfig.message.length > 0;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "isComplexMessageModal", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.html && this.modalConfig.html.length > 0;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "html", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.html;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "message", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.message;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "messageTitle", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.messageTitle;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "modalStyles", {
get: /**
* @return {?}
*/
function () {
/** @type {?} */
var maxWidth = this.modalConfig.maxWidth || this.defaultMaxWidth;
/** @type {?} */
var minWidth = this.modalConfig.minWidth || this.defaultMinWidth;
/** @type {?} */
var width = this.getModalActualWidth(maxWidth, minWidth);
return { 'max-width': maxWidth + "px", 'min-width': minWidth + "px", 'width': width + "px" };
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "emptyModal", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig && this.modalConfig.empty;
},
enumerable: true,
configurable: true
});
Object.defineProperty(StModalComponent.prototype, "showCloseBtn", {
get: /**
* @return {?}
*/
function () {
return this.modalConfig.showCloseBtn;
},
enumerable: true,
configurable: true
});
/**
* @param {?} event
* @return {?}
*/
StModalComponent.prototype.animationDone = /**
* @param {?} event
* @return {?}
*/
function (event) {
if (event.toState === 'hidden') {
this.endAnimation.emit(true);
}
};
/**
* @param {?} event
* @return {?}
*/
StModalComponent.prototype.onClickButtons = /**
* @param {?} event
* @return {?}
*/
function (event) {
var _this = this;
this.visibility = 'hidden';
this._subscriptions.push(this.endAnimation.subscribe((/**
* @param {?} data
* @return {?}
*/
function (data) {
if (data) {
_this.click.emit(event);
}
})));
};
/**
* @return {?}
*/
StModalComponent.prototype.onClose = /**
* @return {?}
*/
function () {
var _this = this;
this.visibility = 'hidden';
this._subscriptions.push(this.endAnimation.subscribe((/**
* @param {?} data
* @return {?}
*/
function (data) {
if (data) {
_this.click.emit({
response: StModalResponse.CLOSE,
close: true
});
}
})));
};
/** DYNAMIC MODAL BODY COMPONENT LOAD */
/**
* DYNAMIC MODAL BODY COMPONENT LOAD
* @return {?}
*/
StModalComponent.prototype.ngAfterViewInit = /**
* DYNAMIC MODAL BODY COMPONENT LOAD
* @return {?}
*/
function () {
this.target = this.emptyModal ? this.targetEmpty : this.targetContent;
if (this.component && !(this.modalConfig.html || this.modalConfig.message)) {
this.loadBody();
}
this.windowRef.nativeWindow.document.body.classList.add('st-modal-overlay');
};
/**
* @return {?}
*/
StModalComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this.componentRef) {
this.componentRef.destroy();
}
this.windowRef.nativeWindow.document.body.classList.remove('st-modal-overlay');
if (this._subscriptions.length > 0) {
this._subscriptions.forEach((/**
* @param {?} subscription
* @return {?}
*/
function (subscription) {
if (subscription) {
subscription.unsubscribe();
}
}));
}
};
/**
* @private
* @param {?} maxWidth
* @param {?=} minWidth
* @return {?}
*/
StModalComponent.prototype.getModalActualWidth = /**
* @private
* @param {?} maxWidth
* @param {?=} minWidth
* @return {?}
*/
function (maxWidth, minWidth) {
/** @type {?} */
var screenWidth = this.windowRef.nativeWindow.screen.width;
return screenWidth > maxWidth ? maxWidth : (screenWidth < minWidth ? minWidth : screenWidth);
};
/**
* @private
* @return {?}
*/
StModalComponent.prototype.loadBody = /**
* @private
* @return {?}
*/
function () {
if (!this.componentRef) {
this.target.clear();
/** @type {?} */
var compFactory = this.cfr.resolveComponentFactory(this.component);
this.componentRef = this.target.createComponent(compFactory);
this.bindModalInputs();
}
};
/**
* @private
* @return {?}
*/
StModalComponent.prototype.bindModalInputs = /**
* @private
* @return {?}
*/
function () {
var _this = this;
Object.keys(this.modalConfig.inputs).forEach((/**
* @param {?} key
* @return {?}
*/
function (key) {
_this.componentRef.instance[key] = ((/** @type {?} */ (_this.modalConfig.inputs)))[key];
}));
Object.keys(this.modalConfig.outputs).forEach((/**
* @param {?} key
* @return {?}
*/
function (key) {
_this.componentRef.instance[key].subscribe(((/** @type {?} */ (_this.modalConfig.outputs)))[key]);
}));
this.componentRef.changeDetectorRef.detectChanges();
};
StModalComponent.decorators = [
{ type: Component, args: [{
selector: 'st-modal',
template: "<!--\n\n \u00A9 2017 Stratio Big Data Inc., Sucursal en Espa\u00F1a.\n\n This software is licensed under the Apache License, Version 2.0.\n This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n See the terms of the License for more details.\n\n SPDX-License-Identifier: Apache-2.0.\n\n-->\n<div class=\"st-modal-container\" [@state]=\"visibility\" (@state.done)=\"animationDone($event)\" [@.disabled]=\"disabledAnimation\">\n <section *ngIf=\"emptyModal\" class=\"st-modal\" [ngClass]=\"{'st-modal-fullscreen': isFullscreen}\" [ngStyle]=\"modalStyles\" [hidden]=\"emptyModal\">\n <div #stModalBodyEmpty></div>\n </section>\n <section *ngIf=\"!emptyModal\" class=\"st-modal\" [ngClass]=\"{'st-modal-fullscreen': isFullscreen}\" [ngStyle]=\"modalStyles\" [hidden]=\"!emptyModal\">\n <div class=\"st-modal-header\">\n <div class=\"container\">\n <span class=\"status-icon\" [ngClass]=\"hasIcon\" *ngIf=\"hasIcon\"></span>\n <p class=\"title\">{{title}}</p> <span class=\"close-button\" *ngIf=\"showCloseBtn\" (click)=\"onClose()\"></span>\n\n <st-modal-buttons *ngIf=\"isFullscreen\" [buttonConfig]=\"buttons\" [fullscreen]=\"isFullscreen\" (click)=\"onClickButtons($event)\"></st-modal-buttons>\n </div>\n </div>\n <div class=\"st-modal-body\">\n <div class=\"container\">\n\n <div *ngIf=\"isMessageModal\" class=\"message\">\n <h1 id=\"st-modal-message-plain-title\" class=\"st-modal-message-plain-title\">{{messageTitle}}</h1>\n <p id=\"st-modal-message-plain-message\" class=\"st-modal-message-plain-message\">{{message}}</p>\n </div>\n <div *ngIf=\"isComplexMessageModal\" [innerHTML]=\"html\" id=\"st-modal-message-html\"></div>\n <div #stModalBody id=\"st-modal-message-component\"></div>\n\n </div>\n </div>\n <footer class=\"st-modal-footer\" *ngIf=\"buttons && buttons.length > 0\">\n <div class=\"container\">\n <st-modal-buttons *ngIf=\"!isFullscreen\" [buttonConfig]=\"buttons\" (click)=\"onClickButtons($event)\"></st-modal-buttons>\n </div>\n </footer>\n </section>\n</div>\n",
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [
trigger('state', [
state('void, hidden', style({ opacity: 0 })),
state('visible', style({ opacity: 1 })),
transition('* => visible', [
style({ opacity: 0 }),
animate(300)
]),
transition('* => hidden', [
style({ opacity: 1 }),
animate(300)
])
])
],
styles: ["@charset \"UTF-8\";.st-modal-container{display:flex;height:100vh;left:0;position:fixed;top:0;width:100%}.st-modal-container .st-modal{-ms-grid-row-align:center;align-self:center;display:flex;flex-direction:column;margin:auto}.st-modal-container .st-modal.st-modal-fullscreen{min-height:100vh;max-height:100vh;min-width:100%;max-width:100%}.st-modal-container .st-modal .st-modal-header{display:flex;flex-direction:row;height:70px;width:100%}.st-modal-container .st-modal .st-modal-header .container{display:flex;margin-right:auto;margin-left:auto;width:100%;align-items:center;flex-wrap:nowrap}.st-modal-container .st-modal .st-modal-header .container .status-icon{padding-right:1.05rem}.st-modal-container .st-modal .st-modal-header .container .status-icon.delete:before{content:var(--egeo-st-modal__delete-icon--content, \"\uE043\")}.st-modal-container .st-modal .st-modal-header .container .status-icon.alert:before{content:var(--egeo-st-modal__warning-icon--content, \"\uE613\")}.st-modal-container .st-modal .st-modal-header .container .close-button{font-size:var(--egeo-st-modal__close-icon--font-size,inherit);color:var(--egeo-st-modal__close-icon--color,inherit)}.st-modal-container .st-modal .st-modal-header .container .close-button:before{content:var(--egeo-st-modal__close-icon--content, \"\uE117\")}.st-modal-container .st-modal st-modal-buttons{display:flex;justify-content:flex-end;margin-left:auto}.st-modal-container .st-modal .container{min-width:auto}"]
}] }
];
/** @nocollapse */
StModalComponent.ctorParameters = function () { return [
{ type: ComponentFactoryResolver },
{ type: StWindowRefService }
]; };
StModalComponent.propDecorators = {
modalConfig: [{ type: Input }],
component: [{ type: Input }],
disabledAnimation: [{ type: HostBinding, args: ['@.disabled',] }, { type: Input }],
click: [{ type: Output }],
endAnimation: [{ type: Output }],
targetContent: [{ type: ViewChild, args: ['stModalBody', { read: ViewContainerRef, static: false },] }],
targetEmpty: [{ type: ViewChild, args: ['stModalBodyEmpty', { read: ViewContainerRef, static: false },] }]
};
return StModalComponent;
}());
if (false) {
/** @type {?} */
StModalComponent.prototype.modalConfig;
/** @type {?} */
StModalComponent.prototype.component;
/** @type {?} */
StModalComponent.prototype.disabledAnimation;
/** @type {?} */
StModalComponent.prototype.click;
/** @type {?} */
StModalComponent.prototype.endAnimation;
/** @type {?} */
StModalComponent.prototype.targetContent;
/** @type {?} */
StModalComponent.prototype.targetEmpty;
/** @type {?} */
StModalComponent.prototype.defaultMaxWidth;
/** @type {?} */
StModalComponent.prototype.defaultMinWidth;
/** @type {?} */
StModalComponent.prototype.target;
/** @type {?} */
StModalComponent.prototype.visibility;
/**
* @type {?}
* @private
*/
StModalComponent.prototype.componentRef;
/**
* @type {?}
* @private
*/
StModalComponent.prototype._subscriptions;
/**
* @type {?}
* @private
*/
StModalComponent.prototype.cfr;
/**
* @type {?}
* @private
*/
StModalComponent.prototype.windowRef;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/st-modal/st-modal.service.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var StModalService = /** @class */ (function () {
function StModalService(_cfr) {
this._cfr = _cfr;
this._containerRef = undefined;
this.dynamicModal = undefined;
}
Object.defineProperty(StModalService.prototype, "container", {
/* External API */
set: /* External API */
/**
* @param {?} container
* @return {?}
*/
function (container) {
this._containerRef = container;
},
enumerable: true,
configurable: true
});
// - Public methods
// - Public methods
/**
* @param {?} config
* @param {?=} component
* @param {?=} disabledAnimation
* @return {?}
*/
StModalService.prototype.show =
// - Public methods
/**
* @param {?} config
* @param {?=} component
* @param {?=} disabledAnimation
* @return {?}
*/
function (config, component, disabledAnimation) {
/** @type {?} */
var errors = this.canCreateModal(config, component);
if (errors && errors.length > 0) {
throw new Error(errors.join(' '));
}
this.notifyButtonInteraction = new Subject();
this.createModal(this.createConfig(config), component, disabledAnimation);
return this.notifyButtonInteraction.asObservable();
};
/**
* @param {?} type
* @param {?} modalTitle
* @param {?} messageTitle
* @param {?} message
* @param {?} okButton
* @param {?=} cancelButton
* @param {?=} maxWidth
* @param {?=} minWidth
* @param {?=} icon
* @param {?=} showCloseBtn
* @return {?}
*/
StModalService.prototype.showBasicModal = /**
* @param {?} type
* @param {?} modalTitle
* @param {?} messageTitle
* @param {?} message
* @param {?} okButton
* @param {?=} cancelButton
* @param {?=} maxWidth
* @param {?=} minWidth
* @param {?=} icon
* @param {?=} showCloseBtn
* @return {?}
*/
function (type, modalTitle, messageTitle, message, okButton, cancelButton, maxWidth, minWidth, icon, showCloseBtn) {
if (cancelButton === void 0) { cancelButton = ''; }
if (maxWidth === void 0) { maxWidth = 600; }
if (minWidth === void 0) { minWidth = 400; }
if (icon === void 0) { icon = ''; }
if (showCloseBtn === void 0) { showCloseBtn = false; }
/** @type {?} */
var iconStatus;
/** @type {?} */
var buttons = [{
label: okButton,
classes: (type === StModalBasicType.DELETE) ? 'button-critical' : 'button-primary',
responseValue: StModalResponse.YES,
closeOnClick: true
}];
if (type !== StModalBasicType.INFO) {
buttons.unshift({
label: cancelButton,
classes: (type === StModalBasicType.DELETE) ? 'button-borderless' : 'button-secondary',
responseValue: StModalResponse.NO,
closeOnClick: true
});
}
switch (type) {
case StModalBasicType.DELETE:
iconStatus = 'delete';
break;
case StModalBasicType.WARNING:
iconStatus = 'alert';
break;
default:
iconStatus = icon;
break;
}
return this.show({
fullscreen: false,
message: message,
messageTitle: messageTitle,
modalTitle: modalTitle,
buttons: buttons,
maxWidth: maxWidth,
minWidth: minWidth,
showCloseBtn: showCloseBtn,
iconStatus: iconStatus
});
};
/**
* @return {?}
*/
StModalService.prototype.close = /**
* @return {?}
*/
function () {
this.destroy();
};
/* INTERNAL METHODS FOR WORK WITH MODALS */
/* INTERNAL METHODS FOR WORK WITH MODALS */
/**
* @private
* @param {?} modalConfig
* @param {?=} component
* @param {?=} disabledAnimation
* @return {?}
*/
StModalService.prototype.createModal = /* INTERNAL METHODS FOR WORK WITH MODALS */
/**
* @private
* @param {?} modalConfig
* @param {?=} component
* @param {?=} disabledAnimation
* @return {?}
*/
function (modalConfig, component, disabledAnimation) {
/** @type {?} */
var stModalFactory = this._cfr.resolveComponentFactory(StModalComponent);
if (stModalFactory) {
this._containerRef.clear();
this.dynamicModal = this._containerRef.createComponent(stModalFactory);
this.bindVars(modalConfig, component, disabledAnimation);
}
};
/**
* @private
* @return {?}
*/
StModalService.prototype.destroy = /**
* @private
* @return {?}
*/
function () {
if (this.dynamicModal) {
this.dynamicModal.destroy();
this.dynamicModal = undefined;
this.notifyButtonInteraction.next(StModalResponse.CLOSE);
this.notifyButtonInteraction.complete();
}
};
/**
* @private
* @param {?} modalConfig
* @param {?} component
* @param {?} disabledAnimation
* @return {?}
*/
StModalService.prototype.bindVars = /**
* @private
* @param {?} modalConfig
* @param {?} component
* @param {?} disabledAnimation
* @return {?}
*/
function (modalConfig, component, disabledAnimation) {
this.dynamicModal.instance.component = component;
this.dynamicModal.instance.click.subscribe(this.notify.bind(this));
this.dynamicModal.instance.modalConfig = modalConfig;
this.dynamicModal.instance.disabledAnimation = (disabledAnimation !== null) ? disabledAnimation : true;
this.dynamicModal.changeDetectorRef.detectChanges();
};
/**
* @private
* @param {?} buttonResponse
* @return {?}
*/
StModalService.prototype.notify = /**
* @private
* @param {?} buttonResponse
* @return {?}
*/
function (buttonResponse) {
this.notifyButtonInteraction.next(buttonResponse.response);
if (buttonResponse.close) {
this.close();
}
};
/**
* @private
* @param {?} config
* @param {?=} component
* @return {?}
*/
StModalService.prototype.canCreateModal = /**
* @private
* @param {?} config
* @param {?=} component
* @return {?}
*/
function (config, component) {
/** @type {?} */
var errors = [];
if (!this._containerRef) {
errors.push("[ERROR]: StModalService => Cant find container, are you sure you declarate in MAIN APP component in html and typescript?");
}
if (this.dynamicModal !== undefined) {
errors.push("[ERROR]: StModalService => Can't create modal beacause already exists one. Are you sure that you call close method?)");
}
if (!component && !config.message && !config.html) {
errors.push("[ERROR]: StModalService => Can't find message, html or component to show in modal");
}
return errors;
};
/**
* @private
* @param {?} config
* @return {?}
*/
StModalService.prototype.createConfig = /**
* @private
* @param {?} config
* @return {?}
*/
function (config) {
/** @type {?} */
var defaultConfig = {
fullscreen: false,
inputs: {},
outputs: {},
modalTitle: 'Default title',
messageTitle: 'Default subtitle',
buttons: [],
message: undefined,
html: undefined,
maxWidth: undefined,
minWidth: undefined,
empty: false
};
/** @type {?} */
var checkedConfig = Object.assign({}, defaultConfig, config);
checkedConfig.buttons = this.checkButtons(checkedConfig.buttons);
return checkedConfig;
};
/**
* @private
* @param {?} buttons
* @return {?}
*/
StModalService.prototype.checkButtons = /**
* @private
* @param {?} buttons
* @return {?}
*/
function (buttons) {
return buttons.map((/**
* @param {?} button
* @return {?}
*/
function (button) { return Object.assign({}, { label: 'Button', closeOnClick: false }, button); }));
};
StModalService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
StModalService.ctorParameters = function () { return [
{ type: ComponentFactoryResolver }
]; };
return StModalService;
}());
if (false) {
/**
* @type {?}
* @private
*/
StModalService.prototype._containerRef;
/**
* @type {?}
* @private
*/
StModalService.prototype.dynamicModal;
/**
* @type {?}
* @private
*/
StModalService.prototype.notifyButtonInteraction;
/**
* @type {?}
* @private
*/
StModalService.prototype._cfr;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/st-pagination/st-pagination.service.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var StPaginationService = /** @class */ (function () {
function StPaginationService() {
}
/**
* @param {?} items
* @param {?} currentPage
* @param {?} perPage
* @return {?}
*/
StPaginationService.prototype.newPage = /**
* @param {?} items
* @param {?} currentPage
* @param {?} perPage
* @return {?}
*/
function (items, currentPage, perPage) {
if (currentPage === 1) {
this.initItem = 0;
}
else {
this.initItem = perPage * (currentPage - 1);
}
if (perPage >= items.length) {
return Object.assign([], items);
}
if (this.initItem >= items.length) {
this.initItem = items.length - (perPage + 1);
return Object.assign([], takeRight(items, perPage));
}
this.lastItem = (this.initItem + perPage);
return Object.assign([], items.slice(this.initItem, this.lastItem));
};
StPaginationService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
StPaginationService.ctorParameters = function () { return []; };
return StPaginationService;
}());
if (false) {
/**
* @type {?}
* @private
*/
StPaginationService.prototype.initItem;
/**
* @type {?}
* @private
*/
StPaginationService.prototype.lastItem;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/utils/egeo-resolver/egeo-resolve.service.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var EgeoResolveService = /** @class */ (function () {
function EgeoResolveService() {
}
/**
* @param {?} object
* @param {?} key
* @param {?=} searchedValue
* @return {?}
*/
EgeoResolveService.prototype.getKeys = /**
* @param {?} object
* @param {?} key
* @param {?=} searchedValue
* @return {?}
*/
function (object, key, searchedValue) {
return this.searchInDeep(object, key, searchedValue);
};
/**
* @param {?} object
* @param {?} resolved
* @return {?}
*/
EgeoResolveService.prototype.setKeys = /**
* @param {?} object
* @param {?} resolved
* @return {?}
*/
function (object, resolved) {
resolved.forEach((/**
* @param {?} element
* @return {?}
*/
function (element) { return set(object, element.path, element.resolved); }));
};
/**
* @param {?} object
* @param {?} translateService
* @return {?}
*/
EgeoResolveService.prototype.translate = /**
* @param {?} object
* @param {?} translateService
* @return {?}
*/
function (object, translateService) {
var _this = this;
/** @type {?} */
var keys = this.getKeys(object, 'translate');
// If not found translateable elements, return the same because if not, translate service broke on try to translate an empty array.
if (keys && keys.length > 0) {
/** @type {?} */
var toTranslate = this.extractTranslationKeys(keys);
return translateService.get(toTranslate).pipe(// return object translation
map((/**
* @param {?} translation
* @return {?}
*/
function (translation) { return _this.remapObjectWithTranslations(translation, keys, object); })));
}
else {
return Observable.create((/**
* @param {?} observer
* @return {?}
*/
function (observer) {
observer.next(object);
observer.complete();
}));
}
};
/**
* @param {?} keys
* @param {?} translateService
* @return {?}
*/
EgeoResolveService.prototype.translateArrayOfKeys = /**
* @param {?} keys
* @param {?} translateService
* @return {?}
*/
function (keys, translateService) {
var _this = this;
return translateService.get(keys).pipe(map((/**
* @param {?} translation
* @return {?}
*/
function (translation) { return _this.remapArrayWithTranslations(translation, keys); })));
};
/**
* @private
* @param {?} translations
* @param {?} originalArray
* @return {?}
*/
EgeoResolveService.prototype.remapArrayWithTranslations = /**
* @private
* @param {?} translations
* @param {?} originalArray
* @return {?}
*/
function (translations, originalArray) {
return originalArray.map((/**
* @param {?} key
* @return {?}
*/
function (key) { return translations[key] ? translations[key] : key; }));
};
/**
* @private
* @param {?} translations
* @param {?} resolverKeys
* @param {?} object
* @return {?}
*/
EgeoResolveService.prototype.remapObjectWithTranslations = /**
* @private
* @param {?} translations
* @param {?} resolverKeys
* @param {?} object
* @return {?}
*/
function (translations, resolverKeys, object) {
var _this = this;
/** @type {?} */
var newObj = cloneDeep(object);
if (translations || keys(translations).length > 0) {
forEach(resolverKeys, (/**
* @param {?} resolvKey
* @return {?}
*/
function (resolvKey) {
set(newObj, resolvKey.path, _this.getTranslationFromTranslatedKey(translations, resolvKey));
}));
}
return newObj;
};
/**
* @private
* @param {?} translations
* @param {?} resolverKey
* @return {?}
*/
EgeoResolveService.prototype.getTranslationFromTranslatedKey = /**
* @private
* @param {?} translations
* @param {?} resolverKey
* @return {?}
*/
function (translations, resolverKey) {
/** @type {?} */
var translationElementKey = resolverKey && resolverKey.toResolve && resolverKey.toResolve.key ? resolverKey.toResolve.key : '';
return translations[translationElementKey] ? translations[translationElementKey] : translationElementKey;
};
/**
* @private
* @param {?} list
* @return {?}
*/
EgeoResolveService.prototype.extractTranslationKeys = /**
* @private
* @param {?} list
* @return {?}
*/
function (list) {
return list.map((/**
* @param {?} element
* @return {?}
*/
function (element) { return (/** @type {?} */ (values(omit(element.toResolve, 'translate'))[0])); }));
};
/**
* @private
* @param {?} object
* @param {?} key
* @param {?} searchedValue
* @param {?=} path
* @return {?}
*/
EgeoResolveService.prototype.searchInDeep = /**
* @private
* @param {?} object
* @param {?} key
* @param {?} searchedValue
* @param {?=} path
* @return {?}
*/
function (object, key, searchedValue, path) {
var _this = this;
if (path === void 0) { path = ''; }
/** @type {?} */
var result = [];
if (has(object, key)) { // If we found key, return object.
if (searchedValue !== undefined) {
if (object[key] === searchedValue) {
result.push({ path: path, toResolve: object });
}
}
else {
result.push({ path: path, toResolve: object });
}
}
/** @type {?} */
var i = 0;
forEach(object, (/**
* @param {?} value
* @param {?} objKey
* @return {?}
*/
function (value, objKey) {
if (typeof value === 'object') {
result = __spread(result, _this.searchInDeep(value, key, searchedValue, _this.getPath(path, object, i, objKey)));
}
i++;
}));
return result;
};
// Build path for future replace
// Build path for future replace
/**
* @private
* @param {?} actualPath
* @param {?} obj
* @param {?} pos
* @param {?} key
* @return {?}
*/
EgeoResolveService.prototype.getPath =
// Build path for future replace
/**
* @private
* @param {?} actualPath
* @param {?} obj
* @param {?} pos
* @param {?} key
* @return {?}
*/
function (actualPath, obj, pos, key) {
if (this.isArray(obj)) {
actualPath = actualPath + "[" + pos + "]";
}
else {
actualPath = actualPath === '' ? key : actualPath + "." + key;
}
return actualPath;
};
/**
* @private
* @param {?} value
* @return {?}
*/
EgeoResolveService.prototype.isArray = /**
* @private
* @param {?} value
* @return {?}
*/
function (value) {
return Object.prototype.toString.call(value) === '[object Array]';
};
EgeoResolveService.decorators = [
{ type: Injectable }
];
return EgeoResolveService;
}());
/**
* @fileoverview added by tsickle
* Generated from: lib/utils/unique-dispatcher.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var SelectOneDispatcher = /** @class */ (function () {
function SelectOneDispatcher() {
this.listeners = [];
}
/**
* @param {?} id
* @param {?} name
* @return {?}
*/
SelectOneDispatcher.prototype.notify = /**
* @param {?} id
* @param {?} name
* @return {?}
*/
function (id, name) {
var e_1, _a;
try {
for (var _b = __values(this.listeners), _c = _b.next(); !_c.done; _c = _b.next()) {
var listener = _c.value;
listener(id, name);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
};
/**
* @param {?} listener
* @return {?}
*/
SelectOneDispatcher.prototype.listen = /**
* @param {?} listener
* @return {?}
*/
function (listener) {
this.listeners.push(listener);
};
SelectOneDispatcher.decorators = [
{ type: Injectable }
];
return SelectOneDispatcher;
}());
if (false) {
/**
* @type {?}
* @private
*/
SelectOneDispatcher.prototype.listeners;
}
/**
* @fileoverview added by tsickle
* Generated from: lib/pipes/search-filter/search-filter.pipe.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var StFilterList = /** @class */ (function () {
function StFilterList() {
}
/**
* @param {?} list
* @param {?} field
* @param {?} search
* @return {?}
*/
StFilterList.prototype.transform = /**
* @param {?} list
* @param {?} field
* @param {?} search
* @return {?}
*/
function (list, field, search) {
var _this = this;
this.checkParams(field);
if (!search) {
return list;
}
if (list && list.length > 0 && field) {
return list.filter((/**
* @param {?} element
* @return {?}
*/
function (element) { return _this.contains(element, field, search); }));
}
else {
return [];
}
};
/**
* @private
* @param {?} element
* @param {?} field
* @param {?} search
* @return {?}
*/
StFilterList.prototype.contains = /**
*