nuxeo-development-framework 4.0.5 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/nuxeo-development-framework.umd.js +1546 -1589
- package/bundles/nuxeo-development-framework.umd.js.map +1 -1
- package/esm2015/lib/components/diagrams/utilities/index.js +1 -2
- package/esm2015/lib/shared/components/base/base.component.js +15 -17
- package/esm2015/lib/shared/components/nuxeo-dialog/confirmation/ndf-confirmation-dialog.component.js +4 -3
- package/esm2015/lib/shared/components/nuxeo-dialog/nuxeo-dialog.module.js +8 -4
- package/esm2015/lib/shared/components/nuxeo-dialog/nuxeo.dialog.js +12 -13
- package/esm2015/lib/shared/components/nuxeo-dialog/services/nuxeo-dialog.service.js +15 -15
- package/esm2015/lib/shared/services/base/base.service.js +23 -23
- package/esm2015/lib/shared/services/base/cache-base.service.js +23 -23
- package/esm2015/lib/shared/services/base/http-base.service.js +10 -10
- package/fesm2015/nuxeo-development-framework.js +1106 -1131
- package/fesm2015/nuxeo-development-framework.js.map +1 -1
- package/lib/components/diagrams/utilities/index.d.ts +0 -1
- package/lib/shared/components/base/base.component.d.ts +11 -13
- package/lib/shared/components/nuxeo-dialog/nuxeo-dialog.module.d.ts +2 -1
- package/lib/shared/components/nuxeo-dialog/nuxeo.dialog.d.ts +3 -4
- package/lib/shared/components/nuxeo-dialog/services/nuxeo-dialog.service.d.ts +3 -3
- package/lib/shared/services/base/base.service.d.ts +6 -6
- package/lib/shared/services/base/cache-base.service.d.ts +4 -4
- package/lib/shared/services/base/http-base.service.d.ts +4 -4
- package/package.json +1 -1
- package/esm2015/lib/components/diagrams/utilities/export-graph.js +0 -28
- package/lib/components/diagrams/utilities/export-graph.d.ts +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, NgModule, Injectable, Directive, Inject, InjectionToken, Optional,
|
|
2
|
+
import { Component, NgModule, Injectable, Directive, Inject, InjectionToken, Optional, ChangeDetectorRef, Input, ViewEncapsulation, ContentChild, ViewChild, EventEmitter, Output, HostListener, Pipe, Self, SkipSelf, ChangeDetectionStrategy, ViewContainerRef, forwardRef, APP_INITIALIZER, TemplateRef } from '@angular/core';
|
|
3
3
|
import * as i4$1 from '@angular/common';
|
|
4
4
|
import { CommonModule, APP_BASE_HREF, DatePipe, registerLocaleData, DOCUMENT } from '@angular/common';
|
|
5
5
|
import * as i1$2 from '@angular/common/http';
|
|
@@ -14,7 +14,7 @@ import * as i1$4 from '@angular/router';
|
|
|
14
14
|
import { ActivatedRoute, Router, RouterModule, RoutesRecognized } from '@angular/router';
|
|
15
15
|
import * as i1 from '@ngx-translate/core';
|
|
16
16
|
import { TranslateService, TranslateModule, TranslateStore, TranslateLoader } from '@ngx-translate/core';
|
|
17
|
-
import { map, distinctUntilChanged, takeUntil, catchError, take, tap, switchMap, retry, expand, last,
|
|
17
|
+
import { map, distinctUntilChanged, takeUntil, catchError, take, tap, switchMap, first, retry, expand, last, debounceTime, mergeMap, toArray, delay, reduce, concatMap, finalize, filter as filter$1 } from 'rxjs/operators';
|
|
18
18
|
import { trigger, state, style, transition, animate, AUTO_STYLE, animation, useAnimation } from '@angular/animations';
|
|
19
19
|
import * as i1$1 from 'ngx-toastr';
|
|
20
20
|
import { Toast, ToastrModule } from 'ngx-toastr';
|
|
@@ -23,12 +23,12 @@ import * as i4 from '@angular/cdk/bidi';
|
|
|
23
23
|
import * as i2 from 'keycloak-angular';
|
|
24
24
|
import { KeycloakAngularModule } from 'keycloak-angular';
|
|
25
25
|
import * as i3 from 'ngx-cookie-service';
|
|
26
|
-
import {
|
|
26
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
27
27
|
import * as i2$1 from '@angular/material/icon';
|
|
28
28
|
import { MatIconModule } from '@angular/material/icon';
|
|
29
29
|
import * as i2$2 from '@angular/material/tooltip';
|
|
30
30
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
31
|
-
import {
|
|
31
|
+
import { merge } from 'lodash-es';
|
|
32
32
|
import * as moment$4 from 'moment';
|
|
33
33
|
import { isMoment } from 'moment';
|
|
34
34
|
import _omit from 'lodash/omit';
|
|
@@ -1573,166 +1573,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1573
1573
|
}]
|
|
1574
1574
|
}], ctorParameters: function () { return [{ type: UtilityService }]; } });
|
|
1575
1575
|
|
|
1576
|
-
const defaultConfirmConfig = {
|
|
1577
|
-
title: 'confirmDialog.confirm',
|
|
1578
|
-
message: 'confirmDialog.generalConfirmMsg',
|
|
1579
|
-
icon: {
|
|
1580
|
-
show: true,
|
|
1581
|
-
name: 'heroicons_outline:exclamation',
|
|
1582
|
-
color: 'warn'
|
|
1583
|
-
},
|
|
1584
|
-
actions: {
|
|
1585
|
-
confirm: {
|
|
1586
|
-
show: true,
|
|
1587
|
-
label: 'BUTTONS.confirm',
|
|
1588
|
-
color: 'warn',
|
|
1589
|
-
fn: () => {
|
|
1590
|
-
return of(false);
|
|
1591
|
-
}
|
|
1592
|
-
},
|
|
1593
|
-
moreActions: []
|
|
1594
|
-
}
|
|
1595
|
-
};
|
|
1596
|
-
|
|
1597
|
-
class NdfNuxeoDialog extends DestroySubject$1 {
|
|
1598
|
-
constructor(injector) {
|
|
1599
|
-
super();
|
|
1600
|
-
this.loading = false;
|
|
1601
|
-
this.dialogTitle = "";
|
|
1602
|
-
this.subTitle = "";
|
|
1603
|
-
this.loaderMode = "spinner";
|
|
1604
|
-
this.dialogBodyTopOffset = 0;
|
|
1605
|
-
this.data = injector.get(MAT_DIALOG_DATA, null);
|
|
1606
|
-
this.dialogRef = injector.get(MatDialogRef, null);
|
|
1607
|
-
}
|
|
1608
|
-
executeAction(action, ...params) {
|
|
1609
|
-
this.dialogBodyTopOffset = this.dialogBody.nativeElement.scrollTop;
|
|
1610
|
-
if (action) {
|
|
1611
|
-
if (!this.isArrowFunction(action)) {
|
|
1612
|
-
throw new Error("The action should be arrow function");
|
|
1613
|
-
}
|
|
1614
|
-
this.loading = true;
|
|
1615
|
-
//TODO here we should find a way to test if actions instance of DialogActionType
|
|
1616
|
-
const result = action(...params);
|
|
1617
|
-
if (!isObservable(result)) {
|
|
1618
|
-
this.loading = false;
|
|
1619
|
-
throw new Error("The action you used should return an Observable");
|
|
1620
|
-
}
|
|
1621
|
-
result.pipe(takeUntil(this.destroy$)).subscribe((value) => {
|
|
1622
|
-
this.loading = false;
|
|
1623
|
-
this.dialogRef.close(value);
|
|
1624
|
-
}, (err) => {
|
|
1625
|
-
this.loading = false;
|
|
1626
|
-
});
|
|
1627
|
-
}
|
|
1628
|
-
else {
|
|
1629
|
-
this.dialogRef.close();
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1632
|
-
isArrowFunction(fn) {
|
|
1633
|
-
const strFn = fn.toString();
|
|
1634
|
-
const firstIndex = strFn.indexOf(")");
|
|
1635
|
-
const lastIndex = strFn.indexOf("{") + 1;
|
|
1636
|
-
const target = strFn.substring(firstIndex, lastIndex).replace(" ", "");
|
|
1637
|
-
return target.includes("=>");
|
|
1638
|
-
}
|
|
1639
|
-
onClose() {
|
|
1640
|
-
this.dialogRef.close();
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
NdfNuxeoDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfNuxeoDialog, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1644
|
-
NdfNuxeoDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfNuxeoDialog, selector: "ndf-nuxeo-dialog", inputs: { loading: "loading", dialogTitle: "dialogTitle", subTitle: "subTitle", loaderMode: "loaderMode" }, queries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true }, { propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true }], viewQueries: [{ propertyName: "dialogBody", first: true, predicate: ["dialogBody"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div SetDirRtl class=\"ndf-dialog-wrapper\">\r\n\t<div class=\"dialog-header\">\r\n\t\t<div class=\"flex flex-col\">\r\n\t\t\t<span>{{ data?.dialogConfig?.title || dialogTitle }}</span>\r\n\t\t\t<span class=\"text-base font-normal\"\r\n\t\t\t\t>{{ data?.dialogConfig?.subTitle || subTitle }}</span\r\n\t\t\t>\r\n\t\t</div>\r\n\t\t<button\r\n\t\t\tclass=\"flex items-center justify-center rounded-full bg-anti-flash-white w-10 h-10\"\r\n\t\t\t(click)=\"executeAction()\"\r\n\t\t\tmatTooltip=\"{{'BUTTONS.CLOSE' | translate}}\"\r\n\t\t>\r\n\t\t\t<mat-icon class=\"icon-size-3.5\" [svgIcon]=\"'icons:cancel-icon'\">\r\n\t\t\t</mat-icon>\r\n\t\t</button>\r\n\t</div>\r\n\t<div #dialogBody class=\"dialog-body\" [ngClass]=\"{'overflow-hidden': loading}\">\r\n\t\t<ng-container\r\n\t\t\t*ngTemplateOutlet=\"data?.dialogConfig?.contentTemplate || contentTemplate\"\r\n\t\t></ng-container>\r\n\t\t<ng-container *ngIf=\"loading\">\r\n\t\t\t<div\r\n\t\t\t\tclass=\"overlay bg-gray-300 opacity-40 z-999\"\r\n\t\t\t\t[ngStyle]=\"{'top': dialogBodyTopOffset + 'px'}\"\r\n\t\t\t></div>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"overlay z-9999\"\r\n\t\t\t\t*ngIf=\"loaderMode === 'spinner'\"\r\n\t\t\t\t[ngStyle]=\"{'top': dialogBodyTopOffset + 'px'}\"\r\n\t\t\t>\r\n\t\t\t\t<mat-spinner\r\n\t\t\t\t\t[value]=\"90\"\r\n\t\t\t\t\t[strokeWidth]=\"4\"\r\n\t\t\t\t\toverlay=\"true\"\r\n\t\t\t\t\t[diameter]=\"40\"\r\n\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t>\r\n\t\t\t\t</mat-spinner>\r\n\t\t\t</div>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"block w-full h-px absolute inset-0 z-9999\"\r\n\t\t\t\t*ngIf=\"loaderMode === 'progressBar'\"\r\n\t\t\t>\r\n\t\t\t\t<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n\t\t\t</div>\r\n\t\t</ng-container>\r\n\t</div>\r\n\t<div class=\"flex w-full justify-end p-6 pt-0 gap-x-4\">\r\n\t\t<button class=\"cancelation-button\" (click)=\"executeAction()\">\r\n\t\t\t{{\"BUTTONS.CANCEL\" | translate}}\r\n\t\t</button>\r\n\t\t<ng-container\r\n\t\t\t*ngTemplateOutlet=\"(data?.dialogConfig?.actionsTemplate || actionsTemplate); context: { dialog: this }\"\r\n\t\t></ng-container>\r\n\t</div>\r\n</div>\r\n", styles: ["::ng-deep .ndf-dialog .mat-dialog-container{overflow:hidden!important;border-radius:8px!important}.ndf-dialog-wrapper{@apply flex flex-col;}.ndf-dialog-wrapper .dialog-header{@apply flex h-20 p-6 justify-between items-center w-full bg-vapor text-blue-munsell text-xl not-italic font-bold leading-7;}.ndf-dialog-wrapper .dialog-body{height:auto;max-height:calc(100vh - 208px);@apply flex flex-col gap-y-4 p-6 overflow-y-auto relative z-99;}.ndf-dialog-wrapper .overlay{@apply flex w-full h-full items-center justify-center absolute left-0 bottom-0 right-0;}\n"], components: [{ type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "translate": i1.TranslatePipe } });
|
|
1645
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfNuxeoDialog, decorators: [{
|
|
1646
|
-
type: Component,
|
|
1647
|
-
args: [{
|
|
1648
|
-
selector: "ndf-nuxeo-dialog",
|
|
1649
|
-
templateUrl: "./nuxeo.dialog.html",
|
|
1650
|
-
styleUrls: ["./nuxeo.dialog.scss"],
|
|
1651
|
-
}]
|
|
1652
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { loading: [{
|
|
1653
|
-
type: Input
|
|
1654
|
-
}], dialogTitle: [{
|
|
1655
|
-
type: Input
|
|
1656
|
-
}], subTitle: [{
|
|
1657
|
-
type: Input
|
|
1658
|
-
}], loaderMode: [{
|
|
1659
|
-
type: Input
|
|
1660
|
-
}], contentTemplate: [{
|
|
1661
|
-
type: ContentChild,
|
|
1662
|
-
args: ["contentTemplate"]
|
|
1663
|
-
}], actionsTemplate: [{
|
|
1664
|
-
type: ContentChild,
|
|
1665
|
-
args: ["actionsTemplate"]
|
|
1666
|
-
}], dialogBody: [{
|
|
1667
|
-
type: ViewChild,
|
|
1668
|
-
args: ["dialogBody"]
|
|
1669
|
-
}] } });
|
|
1670
|
-
|
|
1671
|
-
class NdfConfirmationDialogComponent extends BaseDialogComponent {
|
|
1672
|
-
constructor(injector) {
|
|
1673
|
-
super(injector);
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
NdfConfirmationDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfConfirmationDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1677
|
-
NdfConfirmationDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfConfirmationDialogComponent, selector: "ndf-confirmation-dialog", usesInheritance: true, ngImport: i0, template: "<ndf-nuxeo-dialog dialogTitle=\"{{ dialogData.title | translate }}\">\r\n\t<ng-template #contentTemplate>\r\n\t\t<!-- Content -->\r\n\t\t<div class=\"flex flex-row gap-x-2 items-center\">\r\n\t\t\t<!-- Icon -->\r\n\t\t\t<ng-container *ngIf=\"dialogData.icon.show\">\r\n\t\t\t\t<div\r\n\t\t\t\t\tclass=\"flex flex-0 items-center justify-center w-10 h-10 sm:mr-4 rounded-full\"\r\n\t\t\t\t\t[ngClass]=\"{\r\n\t\t\t\t\t\tprimaryIcon: dialogData.icon.color === 'primary',\r\n\t\t\t\t\t\taccentIcon: dialogData.icon.color === 'accent',\r\n\t\t\t\t\t\twarnIcon: dialogData.icon.color === 'warn',\r\n\t\t\t\t\t\tbasicIcon: dialogData.icon.color === 'basic',\r\n\t\t\t\t\t\tinfoIcon: dialogData.icon.color === 'info',\r\n\t\t\t\t\t\tsuccessIcon: dialogData.icon.color === 'success',\r\n\t\t\t\t\t\twarningIcon: dialogData.icon.color === 'warning',\r\n\t\t\t\t\t\terrorIcon: dialogData.icon.color === 'error'\r\n\t\t\t\t\t}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<mat-icon\r\n\t\t\t\t\t\tclass=\"text-current\"\r\n\t\t\t\t\t\t[svgIcon]=\"dialogData.icon.name\"\r\n\t\t\t\t\t></mat-icon>\r\n\t\t\t\t</div>\r\n\t\t\t</ng-container>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"text-secondary\"\r\n\t\t\t\t[innerHtml]=\"dialogData.message | translate\"\r\n\t\t\t></div>\r\n\t\t</div>\r\n\t</ng-template>\r\n\r\n\t<ng-template #actionsTemplate let-dialog=\"dialog\">\r\n\t\t<ng-container *ngIf=\"dialogData.actions.confirm.show\">\r\n\t\t\t<button\r\n\t\t\t\t(click)=\"dialog.executeAction(dialogData.actions.confirm.fn)\"\r\n\t\t\t\tclass=\"submission-button\"\r\n\t\t\t\t[color]=\"dialogData.actions.confirm.color\"\r\n\t\t\t\t[disabled]=\"dialog.loading\"\r\n\t\t\t>\r\n\t\t\t\t{{ dialogData.actions.confirm.label | translate }}\r\n\t\t\t</button>\r\n\t\t</ng-container>\r\n\t\t<ng-container *ngIf=\"dialogData.actions.moreActions.length\">\r\n\t\t\t<ng-container *ngFor=\"let btn of dialogData.actions.moreActions\">\r\n\t\t\t\t<button\r\n\t\t\t\t\t(click)=\"dialog.executeAction(btn.fn)\"\r\n\t\t\t\t\tclass=\"submission-button\"\r\n\t\t\t\t\t[color]=\"btn.color\"\r\n\t\t\t\t\t[disabled]=\"dialog.loading\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ btn.label | translate }}\r\n\t\t\t\t</button>\r\n\t\t\t</ng-container>\r\n\t\t</ng-container>\r\n\t</ng-template>\r\n</ndf-nuxeo-dialog>\r\n", styles: [".primaryIcon{@apply text-primary-600 bg-primary-100 dark:text-primary-50 dark:bg-primary-600;}.accentIcon{@apply text-accent-600 bg-accent-100 dark:text-accent-50 dark:bg-accent-600;}.warnIcon{@apply text-warn-600 bg-warn-100 dark:text-warn-50 dark:bg-warn-600;}.basicIcon{@apply text-gray-600 bg-gray-100 dark:text-gray-50 dark:bg-gray-600;}.infoIcon{@apply text-blue-600 bg-blue-100 dark:text-blue-50 dark:bg-blue-600;}.successIcon{@apply text-green-500 bg-green-100 dark:text-green-50 dark:bg-green-500;}.warningIcon{@apply text-amber-500 bg-amber-100 dark:text-amber-50 dark:bg-amber-500;}.errorIcon{@apply text-red-600 bg-red-100 dark:text-red-50 dark:bg-red-600;}::ng-deep .ndf-confirmation-dialog-panel{min-width:25%!important}\n"], components: [{ type: NdfNuxeoDialog, selector: "ndf-nuxeo-dialog", inputs: ["loading", "dialogTitle", "subTitle", "loaderMode"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1.TranslatePipe } });
|
|
1678
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfConfirmationDialogComponent, decorators: [{
|
|
1679
|
-
type: Component,
|
|
1680
|
-
args: [{
|
|
1681
|
-
selector: "ndf-confirmation-dialog",
|
|
1682
|
-
templateUrl: "./ndf-confirmation-dialog.component.html",
|
|
1683
|
-
styleUrls: ["./ndf-confirmation-dialog.component.scss"],
|
|
1684
|
-
}]
|
|
1685
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
1686
|
-
|
|
1687
|
-
var _NuxeoDialogService_instances, _NuxeoDialogService_getPanelClass;
|
|
1688
|
-
class NuxeoDialogService {
|
|
1689
|
-
constructor(dialog) {
|
|
1690
|
-
this.dialog = dialog;
|
|
1691
|
-
_NuxeoDialogService_instances.add(this);
|
|
1692
|
-
}
|
|
1693
|
-
open(options) {
|
|
1694
|
-
var _a, _b, _c, _d;
|
|
1695
|
-
return this.dialog.open(options.component, {
|
|
1696
|
-
width: (options === null || options === void 0 ? void 0 : options.width) || "auto",
|
|
1697
|
-
height: (options === null || options === void 0 ? void 0 : options.height) || "auto",
|
|
1698
|
-
minWidth: "35%",
|
|
1699
|
-
panelClass: ["ndf-dialog", ...__classPrivateFieldGet(this, _NuxeoDialogService_instances, "m", _NuxeoDialogService_getPanelClass).call(this, options === null || options === void 0 ? void 0 : options.panelClass)],
|
|
1700
|
-
disableClose: true,
|
|
1701
|
-
data: Object.assign({ dialogConfig: {
|
|
1702
|
-
title: (_a = options.config) === null || _a === void 0 ? void 0 : _a.title,
|
|
1703
|
-
subTitle: (_b = options.config) === null || _b === void 0 ? void 0 : _b.subTitle,
|
|
1704
|
-
contentTemplate: (_c = options.config) === null || _c === void 0 ? void 0 : _c.contentTemplate,
|
|
1705
|
-
actionsTemplate: (_d = options.config) === null || _d === void 0 ? void 0 : _d.actionsTemplate,
|
|
1706
|
-
} }, (options.data || {})),
|
|
1707
|
-
});
|
|
1708
|
-
}
|
|
1709
|
-
showConfirm(config) {
|
|
1710
|
-
// Merge the user config with the default config
|
|
1711
|
-
const confirmConfig = merge({}, defaultConfirmConfig, config);
|
|
1712
|
-
const options = {
|
|
1713
|
-
component: NdfConfirmationDialogComponent,
|
|
1714
|
-
data: Object.assign({}, confirmConfig),
|
|
1715
|
-
panelClass: "ndf-confirmation-dialog-panel",
|
|
1716
|
-
};
|
|
1717
|
-
return this.open(options);
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
_NuxeoDialogService_instances = new WeakSet(), _NuxeoDialogService_getPanelClass = function _NuxeoDialogService_getPanelClass(panelClass) {
|
|
1721
|
-
let classes = [""];
|
|
1722
|
-
if (panelClass) {
|
|
1723
|
-
classes = Array.isArray(panelClass) ? panelClass : [panelClass];
|
|
1724
|
-
}
|
|
1725
|
-
return classes;
|
|
1726
|
-
};
|
|
1727
|
-
NuxeoDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1728
|
-
NuxeoDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, providedIn: "root" });
|
|
1729
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, decorators: [{
|
|
1730
|
-
type: Injectable,
|
|
1731
|
-
args: [{
|
|
1732
|
-
providedIn: "root",
|
|
1733
|
-
}]
|
|
1734
|
-
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }]; } });
|
|
1735
|
-
|
|
1736
1576
|
var _BaseComponent_loading;
|
|
1737
1577
|
class BaseComponent extends DestroySubject$1 {
|
|
1738
1578
|
constructor(injector) {
|
|
@@ -1747,7 +1587,6 @@ class BaseComponent extends DestroySubject$1 {
|
|
|
1747
1587
|
this.mainFolderService = injector.get(MainfolderService);
|
|
1748
1588
|
this.userPreferencesService = injector.get(UserPreferencesService);
|
|
1749
1589
|
this.appConfigService = injector.get(AppConfigService);
|
|
1750
|
-
this.nuxeoDialogService = injector.get(NuxeoDialogService);
|
|
1751
1590
|
this.adapter = injector.get(AdapterService);
|
|
1752
1591
|
}
|
|
1753
1592
|
set loading(value) {
|
|
@@ -1760,13 +1599,13 @@ class BaseComponent extends DestroySubject$1 {
|
|
|
1760
1599
|
return this.translateService.currentLang;
|
|
1761
1600
|
}
|
|
1762
1601
|
get isArabic() {
|
|
1763
|
-
return this.currentLang ==
|
|
1602
|
+
return this.currentLang == 'ar';
|
|
1764
1603
|
}
|
|
1765
1604
|
get isArabic$() {
|
|
1766
|
-
return this.translateService.onLangChange.pipe(map((event) => event.lang ==
|
|
1605
|
+
return this.translateService.onLangChange.pipe(map((event) => event.lang == 'ar'));
|
|
1767
1606
|
}
|
|
1768
1607
|
get direction() {
|
|
1769
|
-
return this.translateService.currentLang ===
|
|
1608
|
+
return this.translateService.currentLang === 'ar' ? 'rtl' : 'ltr';
|
|
1770
1609
|
}
|
|
1771
1610
|
}
|
|
1772
1611
|
_BaseComponent_loading = new WeakMap();
|
|
@@ -1904,70 +1743,664 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1904
1743
|
type: Input
|
|
1905
1744
|
}] } });
|
|
1906
1745
|
|
|
1907
|
-
|
|
1746
|
+
/** @ignore */
|
|
1747
|
+
class SetDirRtlDirective {
|
|
1748
|
+
constructor(elRef, renderer, translation) {
|
|
1749
|
+
this.elRef = elRef;
|
|
1750
|
+
this.renderer = renderer;
|
|
1751
|
+
this.translation = translation;
|
|
1752
|
+
this.switchDirBasedOnLanguage();
|
|
1753
|
+
}
|
|
1754
|
+
switchDirBasedOnLanguage() {
|
|
1755
|
+
this.translation.isArabic.subscribe((arabic) => {
|
|
1756
|
+
arabic
|
|
1757
|
+
? this.renderer.setAttribute(this.elRef.nativeElement, 'dir', 'rtl')
|
|
1758
|
+
: this.renderer.setAttribute(this.elRef.nativeElement, 'dir', 'ltr');
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1908
1761
|
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
MatDialogModule,
|
|
1914
|
-
MatTooltipModule], exports: [NdfNuxeoDialog, NdfConfirmationDialogComponent] });
|
|
1915
|
-
NuxeoDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, imports: [[
|
|
1916
|
-
CommonModule,
|
|
1917
|
-
TranslateModule,
|
|
1918
|
-
MatIconModule,
|
|
1919
|
-
MatDialogModule,
|
|
1920
|
-
MatTooltipModule
|
|
1921
|
-
]] });
|
|
1922
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, decorators: [{
|
|
1923
|
-
type: NgModule,
|
|
1762
|
+
SetDirRtlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetDirRtlDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: TranslationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1763
|
+
SetDirRtlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: SetDirRtlDirective, selector: "[SetDirRtl]", ngImport: i0 });
|
|
1764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetDirRtlDirective, decorators: [{
|
|
1765
|
+
type: Directive,
|
|
1924
1766
|
args: [{
|
|
1925
|
-
|
|
1926
|
-
imports: [
|
|
1927
|
-
CommonModule,
|
|
1928
|
-
TranslateModule,
|
|
1929
|
-
MatIconModule,
|
|
1930
|
-
MatDialogModule,
|
|
1931
|
-
MatTooltipModule
|
|
1932
|
-
],
|
|
1933
|
-
exports: [NdfNuxeoDialog, NdfConfirmationDialogComponent]
|
|
1767
|
+
selector: '[SetDirRtl]',
|
|
1934
1768
|
}]
|
|
1935
|
-
}] });
|
|
1769
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: TranslationService }]; } });
|
|
1936
1770
|
|
|
1937
|
-
class
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
mappedProperties[prefix][propertyKey] =
|
|
1947
|
-
properties[key];
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
return mappedProperties;
|
|
1771
|
+
class NdfNuxeoDialog extends BaseComponent {
|
|
1772
|
+
constructor(injector) {
|
|
1773
|
+
super(injector);
|
|
1774
|
+
this.dialogTitle = "";
|
|
1775
|
+
this.subTitle = "";
|
|
1776
|
+
this.loaderMode = "spinner";
|
|
1777
|
+
this.dialogBodyTopOffset = 0;
|
|
1778
|
+
this.data = injector.get(MAT_DIALOG_DATA, null);
|
|
1779
|
+
this.dialogRef = injector.get(MatDialogRef, null);
|
|
1951
1780
|
}
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
if (
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1781
|
+
executeAction(action, ...params) {
|
|
1782
|
+
this.dialogBodyTopOffset = this.dialogBody.nativeElement.scrollTop;
|
|
1783
|
+
if (action) {
|
|
1784
|
+
if (!this.isArrowFunction(action)) {
|
|
1785
|
+
throw new Error("The action should be arrow function");
|
|
1786
|
+
}
|
|
1787
|
+
this.loading = true;
|
|
1788
|
+
//TODO here we should find a way to test if actions instance of DialogActionType
|
|
1789
|
+
const result = action(...params);
|
|
1790
|
+
if (!isObservable(result)) {
|
|
1791
|
+
this.loading = false;
|
|
1792
|
+
throw new Error("The action you used should return an Observable");
|
|
1963
1793
|
}
|
|
1794
|
+
result.pipe(takeUntil(this.destroy$)).subscribe((value) => {
|
|
1795
|
+
this.loading = false;
|
|
1796
|
+
this.dialogRef.close(value);
|
|
1797
|
+
}, (err) => {
|
|
1798
|
+
this.loading = false;
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
else {
|
|
1802
|
+
this.dialogRef.close();
|
|
1964
1803
|
}
|
|
1965
|
-
return packedProperties;
|
|
1966
1804
|
}
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1805
|
+
isArrowFunction(fn) {
|
|
1806
|
+
const strFn = fn.toString();
|
|
1807
|
+
const firstIndex = strFn.indexOf(")");
|
|
1808
|
+
const lastIndex = strFn.indexOf("{") + 1;
|
|
1809
|
+
const target = strFn.substring(firstIndex, lastIndex).replace(" ", "");
|
|
1810
|
+
return target.includes("=>");
|
|
1811
|
+
}
|
|
1812
|
+
onClose() {
|
|
1813
|
+
this.dialogRef.close();
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
NdfNuxeoDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfNuxeoDialog, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1817
|
+
NdfNuxeoDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfNuxeoDialog, selector: "ndf-nuxeo-dialog", inputs: { dialogTitle: "dialogTitle", subTitle: "subTitle", loaderMode: "loaderMode" }, queries: [{ propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true }, { propertyName: "actionsTemplate", first: true, predicate: ["actionsTemplate"], descendants: true }], viewQueries: [{ propertyName: "dialogBody", first: true, predicate: ["dialogBody"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div SetDirRtl class=\"ndf-dialog-wrapper\">\r\n\t<div class=\"dialog-header\">\r\n\t\t<div class=\"flex flex-col\">\r\n\t\t\t<span>{{ data?.dialogConfig?.title || dialogTitle }}</span>\r\n\t\t\t<span class=\"text-base font-normal\"\r\n\t\t\t\t>{{ data?.dialogConfig?.subTitle || subTitle }}</span\r\n\t\t\t>\r\n\t\t</div>\r\n\t\t<button\r\n\t\t\tclass=\"flex items-center justify-center rounded-full bg-anti-flash-white w-10 h-10\"\r\n\t\t\t(click)=\"executeAction()\"\r\n\t\t\tmatTooltip=\"{{'BUTTONS.CLOSE' | translate}}\"\r\n\t\t>\r\n\t\t\t<mat-icon class=\"icon-size-3.5\" [svgIcon]=\"'icons:cancel-icon'\">\r\n\t\t\t</mat-icon>\r\n\t\t</button>\r\n\t</div>\r\n\t<div #dialogBody class=\"dialog-body\" [ngClass]=\"{'overflow-hidden': loading}\">\r\n\t\t<ng-container\r\n\t\t\t*ngTemplateOutlet=\"data?.dialogConfig?.contentTemplate || contentTemplate\"\r\n\t\t></ng-container>\r\n\t\t<ng-container *ngIf=\"loading\">\r\n\t\t\t<div\r\n\t\t\t\tclass=\"overlay bg-gray-300 opacity-40 z-999\"\r\n\t\t\t\t[ngStyle]=\"{'top': dialogBodyTopOffset + 'px'}\"\r\n\t\t\t></div>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"overlay z-9999\"\r\n\t\t\t\t*ngIf=\"loaderMode === 'spinner'\"\r\n\t\t\t\t[ngStyle]=\"{'top': dialogBodyTopOffset + 'px'}\"\r\n\t\t\t>\r\n\t\t\t\t<mat-spinner\r\n\t\t\t\t\t[value]=\"90\"\r\n\t\t\t\t\t[strokeWidth]=\"4\"\r\n\t\t\t\t\toverlay=\"true\"\r\n\t\t\t\t\t[diameter]=\"40\"\r\n\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t>\r\n\t\t\t\t</mat-spinner>\r\n\t\t\t</div>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"block w-full h-px absolute inset-0 z-9999\"\r\n\t\t\t\t*ngIf=\"loaderMode === 'progressBar'\"\r\n\t\t\t>\r\n\t\t\t\t<mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n\t\t\t</div>\r\n\t\t</ng-container>\r\n\t</div>\r\n\t<div class=\"flex w-full justify-end p-6 pt-0 gap-x-4\">\r\n\t\t<button class=\"cancelation-button\" (click)=\"executeAction()\">\r\n\t\t\t{{\"BUTTONS.CANCEL\" | translate}}\r\n\t\t</button>\r\n\t\t<ng-container\r\n\t\t\t*ngTemplateOutlet=\"(data?.dialogConfig?.actionsTemplate || actionsTemplate); context: { dialog: this }\"\r\n\t\t></ng-container>\r\n\t</div>\r\n</div>\r\n", styles: ["::ng-deep .ndf-dialog .mat-dialog-container{overflow:hidden!important;border-radius:8px!important}.ndf-dialog-wrapper{@apply flex flex-col;}.ndf-dialog-wrapper .dialog-header{@apply flex h-20 p-6 justify-between items-center w-full bg-vapor text-blue-munsell text-xl not-italic font-bold leading-7;}.ndf-dialog-wrapper .dialog-body{height:auto;max-height:calc(100vh - 208px);@apply flex flex-col gap-y-4 p-6 overflow-y-auto relative z-99;}.ndf-dialog-wrapper .overlay{@apply flex w-full h-full items-center justify-center absolute left-0 bottom-0 right-0;}\n"], components: [{ type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: SetDirRtlDirective, selector: "[SetDirRtl]" }, { type: i2$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "translate": i1.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
1818
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfNuxeoDialog, decorators: [{
|
|
1819
|
+
type: Component,
|
|
1820
|
+
args: [{
|
|
1821
|
+
selector: "ndf-nuxeo-dialog",
|
|
1822
|
+
templateUrl: "./nuxeo.dialog.html",
|
|
1823
|
+
styleUrls: ["./nuxeo.dialog.scss"],
|
|
1824
|
+
encapsulation: ViewEncapsulation.None,
|
|
1825
|
+
}]
|
|
1826
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { dialogTitle: [{
|
|
1827
|
+
type: Input
|
|
1828
|
+
}], subTitle: [{
|
|
1829
|
+
type: Input
|
|
1830
|
+
}], loaderMode: [{
|
|
1831
|
+
type: Input
|
|
1832
|
+
}], contentTemplate: [{
|
|
1833
|
+
type: ContentChild,
|
|
1834
|
+
args: ["contentTemplate"]
|
|
1835
|
+
}], actionsTemplate: [{
|
|
1836
|
+
type: ContentChild,
|
|
1837
|
+
args: ["actionsTemplate"]
|
|
1838
|
+
}], dialogBody: [{
|
|
1839
|
+
type: ViewChild,
|
|
1840
|
+
args: ["dialogBody"]
|
|
1841
|
+
}] } });
|
|
1842
|
+
|
|
1843
|
+
class NdfConfirmationDialogComponent extends BaseDialogComponent {
|
|
1844
|
+
constructor(injector) {
|
|
1845
|
+
super(injector);
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
NdfConfirmationDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfConfirmationDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1849
|
+
NdfConfirmationDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: NdfConfirmationDialogComponent, selector: "ndf-confirmation-dialog", usesInheritance: true, ngImport: i0, template: "<ndf-nuxeo-dialog dialogTitle=\"{{ dialogData.title | translate }}\">\r\n\t<ng-template #contentTemplate>\r\n\t\t<!-- Content -->\r\n\t\t<div class=\"flex flex-row gap-x-2 items-center\">\r\n\t\t\t<!-- Icon -->\r\n\t\t\t<ng-container *ngIf=\"dialogData.icon.show\">\r\n\t\t\t\t<div\r\n\t\t\t\t\tclass=\"flex flex-0 items-center justify-center w-10 h-10 sm:mr-4 rounded-full\"\r\n\t\t\t\t\t[ngClass]=\"{\r\n\t\t\t\t\t\tprimaryIcon: dialogData.icon.color === 'primary',\r\n\t\t\t\t\t\taccentIcon: dialogData.icon.color === 'accent',\r\n\t\t\t\t\t\twarnIcon: dialogData.icon.color === 'warn',\r\n\t\t\t\t\t\tbasicIcon: dialogData.icon.color === 'basic',\r\n\t\t\t\t\t\tinfoIcon: dialogData.icon.color === 'info',\r\n\t\t\t\t\t\tsuccessIcon: dialogData.icon.color === 'success',\r\n\t\t\t\t\t\twarningIcon: dialogData.icon.color === 'warning',\r\n\t\t\t\t\t\terrorIcon: dialogData.icon.color === 'error'\r\n\t\t\t\t\t}\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<mat-icon\r\n\t\t\t\t\t\tclass=\"text-current\"\r\n\t\t\t\t\t\t[svgIcon]=\"dialogData.icon.name\"\r\n\t\t\t\t\t></mat-icon>\r\n\t\t\t\t</div>\r\n\t\t\t</ng-container>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"text-secondary\"\r\n\t\t\t\t[innerHtml]=\"dialogData.message | translate\"\r\n\t\t\t></div>\r\n\t\t</div>\r\n\t</ng-template>\r\n\r\n\t<ng-template #actionsTemplate let-dialog=\"dialog\">\r\n\t\t<ng-container *ngIf=\"dialogData.actions.confirm.show\">\r\n\t\t\t<button\r\n\t\t\t\t(click)=\"dialog.executeAction(dialogData.actions.confirm.fn)\"\r\n\t\t\t\tclass=\"submission-button\"\r\n\t\t\t\t[color]=\"dialogData.actions.confirm.color\"\r\n\t\t\t\t[disabled]=\"dialog.loading\"\r\n\t\t\t>\r\n\t\t\t\t{{ dialogData.actions.confirm.label | translate }}\r\n\t\t\t</button>\r\n\t\t</ng-container>\r\n\t\t<ng-container *ngIf=\"dialogData.actions.moreActions.length\">\r\n\t\t\t<ng-container *ngFor=\"let btn of dialogData.actions.moreActions\">\r\n\t\t\t\t<button\r\n\t\t\t\t\t(click)=\"dialog.executeAction(btn.fn)\"\r\n\t\t\t\t\tclass=\"submission-button\"\r\n\t\t\t\t\t[color]=\"btn.color\"\r\n\t\t\t\t\t[disabled]=\"dialog.loading\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ btn.label | translate }}\r\n\t\t\t\t</button>\r\n\t\t\t</ng-container>\r\n\t\t</ng-container>\r\n\t</ng-template>\r\n</ndf-nuxeo-dialog>\r\n", styles: [".ndf-dialog-wrapper .primaryIcon{@apply text-primary-600 bg-primary-100 dark:text-primary-50 dark:bg-primary-600;}.ndf-dialog-wrapper .accentIcon{@apply text-accent-600 bg-accent-100 dark:text-accent-50 dark:bg-accent-600;}.ndf-dialog-wrapper .warnIcon{@apply text-warn-600 bg-warn-100 dark:text-warn-50 dark:bg-warn-600;}.ndf-dialog-wrapper .basicIcon{@apply text-gray-600 bg-gray-100 dark:text-gray-50 dark:bg-gray-600;}.ndf-dialog-wrapper .infoIcon{@apply text-blue-600 bg-blue-100 dark:text-blue-50 dark:bg-blue-600;}.ndf-dialog-wrapper .successIcon{@apply text-green-500 bg-green-100 dark:text-green-50 dark:bg-green-500;}.ndf-dialog-wrapper .warningIcon{@apply text-amber-500 bg-amber-100 dark:text-amber-50 dark:bg-amber-500;}.ndf-dialog-wrapper .errorIcon{@apply text-red-600 bg-red-100 dark:text-red-50 dark:bg-red-600;}::ng-deep .ndf-confirmation-dialog-panel{min-width:25%!important}\n"], components: [{ type: NdfNuxeoDialog, selector: "ndf-nuxeo-dialog", inputs: ["dialogTitle", "subTitle", "loaderMode"] }, { type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
1850
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfConfirmationDialogComponent, decorators: [{
|
|
1851
|
+
type: Component,
|
|
1852
|
+
args: [{
|
|
1853
|
+
selector: "ndf-confirmation-dialog",
|
|
1854
|
+
templateUrl: "./ndf-confirmation-dialog.component.html",
|
|
1855
|
+
styleUrls: ["./ndf-confirmation-dialog.component.scss"],
|
|
1856
|
+
encapsulation: ViewEncapsulation.None,
|
|
1857
|
+
}]
|
|
1858
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
1859
|
+
|
|
1860
|
+
/** @ignore */
|
|
1861
|
+
class ClickOutsideDirective {
|
|
1862
|
+
constructor(elementRef) {
|
|
1863
|
+
this.elementRef = elementRef;
|
|
1864
|
+
this.clickOutside = new EventEmitter();
|
|
1865
|
+
}
|
|
1866
|
+
onClick(target) {
|
|
1867
|
+
const clickedInside = this.elementRef.nativeElement.contains(target);
|
|
1868
|
+
if (!clickedInside) {
|
|
1869
|
+
this.clickOutside.emit(target);
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1874
|
+
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "window:click": "onClick($event.target)" } }, ngImport: i0 });
|
|
1875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
1876
|
+
type: Directive,
|
|
1877
|
+
args: [{
|
|
1878
|
+
selector: '[clickOutside]'
|
|
1879
|
+
}]
|
|
1880
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
|
|
1881
|
+
type: Output
|
|
1882
|
+
}], onClick: [{
|
|
1883
|
+
type: HostListener,
|
|
1884
|
+
args: ['window:click', ['$event.target']]
|
|
1885
|
+
}] } });
|
|
1886
|
+
|
|
1887
|
+
/** @ignore */
|
|
1888
|
+
class SetRtlDirective {
|
|
1889
|
+
constructor(elRef, renderer, translation) {
|
|
1890
|
+
this.elRef = elRef;
|
|
1891
|
+
this.renderer = renderer;
|
|
1892
|
+
this.translation = translation;
|
|
1893
|
+
this.switchClassBasedOnLanguage();
|
|
1894
|
+
}
|
|
1895
|
+
/*Switch rtl class based on the chosen language from Translation Service*/
|
|
1896
|
+
switchClassBasedOnLanguage() {
|
|
1897
|
+
this.translation.isArabic.subscribe((arabic) => {
|
|
1898
|
+
arabic
|
|
1899
|
+
? this.renderer.addClass(this.elRef.nativeElement, 'rtl')
|
|
1900
|
+
: this.renderer.removeClass(this.elRef.nativeElement, 'rtl');
|
|
1901
|
+
});
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
SetRtlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetRtlDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: TranslationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1905
|
+
SetRtlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: SetRtlDirective, selector: "[SetRtl]", ngImport: i0 });
|
|
1906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetRtlDirective, decorators: [{
|
|
1907
|
+
type: Directive,
|
|
1908
|
+
args: [{
|
|
1909
|
+
selector: '[SetRtl]',
|
|
1910
|
+
}]
|
|
1911
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: TranslationService }]; } });
|
|
1912
|
+
|
|
1913
|
+
class EvaluatorsService {
|
|
1914
|
+
constructor(nuxeoService, appConfigService) {
|
|
1915
|
+
this.nuxeoService = nuxeoService;
|
|
1916
|
+
this.appConfigService = appConfigService;
|
|
1917
|
+
this.context = { entity: null, getEvaluator: null, user: null };
|
|
1918
|
+
this.asyncEvery = (arr, predicate) => __awaiter(this, void 0, void 0, function* () {
|
|
1919
|
+
for (let e of arr) {
|
|
1920
|
+
if (!(yield predicate(e))) {
|
|
1921
|
+
return false;
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
return true;
|
|
1925
|
+
});
|
|
1926
|
+
this.asyncSome = (arr, predicate) => __awaiter(this, void 0, void 0, function* () {
|
|
1927
|
+
for (let e of arr) {
|
|
1928
|
+
if (yield predicate(e)) {
|
|
1929
|
+
return true;
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
return false;
|
|
1933
|
+
});
|
|
1934
|
+
// tslint:disable-next-line:member-ordering
|
|
1935
|
+
this.evaluators = {
|
|
1936
|
+
AND: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
1937
|
+
if (!args || args.length === 0) {
|
|
1938
|
+
return false;
|
|
1939
|
+
}
|
|
1940
|
+
return yield this.asyncEvery(args, (arg) => __awaiter(this, void 0, void 0, function* () {
|
|
1941
|
+
const evaluator = yield context.getEvaluator(arg.value);
|
|
1942
|
+
if (!evaluator) {
|
|
1943
|
+
console.warn("evaluator not found: " + arg.value);
|
|
1944
|
+
return false;
|
|
1945
|
+
}
|
|
1946
|
+
return yield evaluator(context, arg.parameters || []);
|
|
1947
|
+
}));
|
|
1948
|
+
}),
|
|
1949
|
+
OR: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
1950
|
+
if (!args || args.length === 0) {
|
|
1951
|
+
return false;
|
|
1952
|
+
}
|
|
1953
|
+
return yield this.asyncSome(args, (arg) => __awaiter(this, void 0, void 0, function* () {
|
|
1954
|
+
const evaluator = yield context.getEvaluator(arg.value);
|
|
1955
|
+
if (!evaluator) {
|
|
1956
|
+
console.warn("evaluator not found: " + arg.value);
|
|
1957
|
+
return false;
|
|
1958
|
+
}
|
|
1959
|
+
const res = yield evaluator(context, arg.parameters || []);
|
|
1960
|
+
return res;
|
|
1961
|
+
}));
|
|
1962
|
+
}),
|
|
1963
|
+
isStatus: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
1964
|
+
if (args.indexOf(context.entity.state) > -1) {
|
|
1965
|
+
return true;
|
|
1966
|
+
}
|
|
1967
|
+
else {
|
|
1968
|
+
return false;
|
|
1969
|
+
}
|
|
1970
|
+
}),
|
|
1971
|
+
isCreator: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
1972
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1973
|
+
//check if user loged in is the creator of that corresp
|
|
1974
|
+
let owner;
|
|
1975
|
+
if ((_b = (_a = context.entity.properties.owner) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.username) {
|
|
1976
|
+
owner = (_d = (_c = context.entity.properties.owner) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.username;
|
|
1977
|
+
}
|
|
1978
|
+
else if ((_f = (_e = context.entity.properties["corr:owner"]) === null || _e === void 0 ? void 0 : _e.properties) === null || _f === void 0 ? void 0 : _f.username) {
|
|
1979
|
+
owner = (_h = (_g = context.entity.properties["corr:owner"]) === null || _g === void 0 ? void 0 : _g.properties) === null || _h === void 0 ? void 0 : _h.username;
|
|
1980
|
+
}
|
|
1981
|
+
else if (context.entity.properties.owner) {
|
|
1982
|
+
owner = context.entity.properties.owner;
|
|
1983
|
+
}
|
|
1984
|
+
else if (context.entity.properties["corr:owner"]) {
|
|
1985
|
+
owner = context.entity.properties["corr:owner"];
|
|
1986
|
+
}
|
|
1987
|
+
if (owner === context.user.properties.username) {
|
|
1988
|
+
return true;
|
|
1989
|
+
}
|
|
1990
|
+
else {
|
|
1991
|
+
return false;
|
|
1992
|
+
}
|
|
1993
|
+
}),
|
|
1994
|
+
isUserInrole: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
1995
|
+
const result = yield this.nuxeoService
|
|
1996
|
+
.isUserInRole(args, "")
|
|
1997
|
+
.pipe(first())
|
|
1998
|
+
.toPromise();
|
|
1999
|
+
return result;
|
|
2000
|
+
}),
|
|
2001
|
+
};
|
|
2002
|
+
this.getEvaluator = (key) => __awaiter(this, void 0, void 0, function* () {
|
|
2003
|
+
const eva = this.evaluators;
|
|
2004
|
+
if (key && key.startsWith("!")) {
|
|
2005
|
+
const fn = eva[key.substring(1)];
|
|
2006
|
+
return (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
2007
|
+
const result = yield fn(context, ...args);
|
|
2008
|
+
return !result;
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
return eva[key];
|
|
2012
|
+
});
|
|
2013
|
+
this.appConfigService.configLoaded.subscribe((ready) => {
|
|
2014
|
+
if (ready) {
|
|
2015
|
+
this.conditions = this.getAllRules();
|
|
2016
|
+
}
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
setEvaluators(evaluators) {
|
|
2020
|
+
this.evaluators = Object.assign(Object.assign({}, this.evaluators), evaluators);
|
|
2021
|
+
}
|
|
2022
|
+
getEvaluators() {
|
|
2023
|
+
return this.evaluators;
|
|
2024
|
+
}
|
|
2025
|
+
// ----------------------------------------------------
|
|
2026
|
+
evaluateRule(ruleId, context) {
|
|
2027
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2028
|
+
const ruleRef = this.getRuleById(ruleId);
|
|
2029
|
+
context = context || this.context;
|
|
2030
|
+
context["getEvaluator"] = this.getEvaluator;
|
|
2031
|
+
if (ruleRef) {
|
|
2032
|
+
const evaluator = yield this.getEvaluator(ruleRef.type);
|
|
2033
|
+
if (evaluator) {
|
|
2034
|
+
return yield evaluator(context, ruleRef.parameters);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
else {
|
|
2038
|
+
const evaluator = yield this.getEvaluator(ruleId);
|
|
2039
|
+
if (evaluator) {
|
|
2040
|
+
return yield evaluator(context);
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
getRuleById(id) {
|
|
2046
|
+
return this.conditions[id] ? Object.assign({}, this.conditions[id]) : null;
|
|
2047
|
+
}
|
|
2048
|
+
getAllRules() {
|
|
2049
|
+
return this.appConfigService.conditons;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
EvaluatorsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvaluatorsService, deps: [{ token: NuxeoService }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2053
|
+
EvaluatorsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvaluatorsService, providedIn: "root" });
|
|
2054
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvaluatorsService, decorators: [{
|
|
2055
|
+
type: Injectable,
|
|
2056
|
+
args: [{ providedIn: "root" }]
|
|
2057
|
+
}], ctorParameters: function () { return [{ type: NuxeoService }, { type: AppConfigService }]; } });
|
|
2058
|
+
|
|
2059
|
+
/**
|
|
2060
|
+
* Permission directive shows or hides an element,
|
|
2061
|
+
* based on a predefined structured condition object in the [conditions.json]{@link ../additional-documentation/conditions-file.html} file.
|
|
2062
|
+
* it will evaluate the rule and shows or hides an element based on the result.
|
|
2063
|
+
* this directive can evaluate rules against a document object as well,
|
|
2064
|
+
* check [conditions.json]{@link ../additional-documentation/conditions-file.html} for more information
|
|
2065
|
+
* @example
|
|
2066
|
+
* <div *permission="{ name: 'conditionKey', entity: nuxeoDocumentObject }">
|
|
2067
|
+
* Element with permissions
|
|
2068
|
+
* </duv>
|
|
2069
|
+
* <div *permission="{ name: 'conditionKey2' }">
|
|
2070
|
+
* Element with permissions 2
|
|
2071
|
+
* </duv>
|
|
2072
|
+
* @title
|
|
2073
|
+
* Permission
|
|
2074
|
+
*/
|
|
2075
|
+
class PermissionsDirective {
|
|
2076
|
+
constructor(nuxeoService, eltRef, viewContainerRef, templateRef, appConfigService, evaluatorsService) {
|
|
2077
|
+
this.nuxeoService = nuxeoService;
|
|
2078
|
+
this.eltRef = eltRef;
|
|
2079
|
+
this.viewContainerRef = viewContainerRef;
|
|
2080
|
+
this.templateRef = templateRef;
|
|
2081
|
+
this.appConfigService = appConfigService;
|
|
2082
|
+
this.evaluatorsService = evaluatorsService;
|
|
2083
|
+
this.isVisible = false;
|
|
2084
|
+
this.context = { entity: null, getEvaluator: null, user: null };
|
|
2085
|
+
}
|
|
2086
|
+
ngOnInit() {
|
|
2087
|
+
this.context.getEvaluator = this.evaluatorsService.getEvaluator;
|
|
2088
|
+
if (!this.permission.name) {
|
|
2089
|
+
if (!this.isVisible) {
|
|
2090
|
+
this.isVisible = true;
|
|
2091
|
+
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
else {
|
|
2095
|
+
this.context.entity = this.permission.entity;
|
|
2096
|
+
this.context.user = this.permission.user || this.nuxeoService.nuxeoClient.user;
|
|
2097
|
+
this.evaluatorsService.evaluateRule(this.permission.name, this.context).then((result) => {
|
|
2098
|
+
if (result) {
|
|
2099
|
+
if (!this.isVisible) {
|
|
2100
|
+
this.isVisible = true;
|
|
2101
|
+
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
else {
|
|
2105
|
+
this.isVisible = false;
|
|
2106
|
+
this.viewContainerRef.clear();
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
PermissionsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PermissionsDirective, deps: [{ token: NuxeoService }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: AppConfigService }, { token: EvaluatorsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2113
|
+
PermissionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: PermissionsDirective, selector: "[permission]", inputs: { permission: "permission" }, ngImport: i0 });
|
|
2114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PermissionsDirective, decorators: [{
|
|
2115
|
+
type: Directive,
|
|
2116
|
+
args: [{
|
|
2117
|
+
selector: '[permission]'
|
|
2118
|
+
}]
|
|
2119
|
+
}], ctorParameters: function () { return [{ type: NuxeoService }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: AppConfigService }, { type: EvaluatorsService }]; }, propDecorators: { permission: [{
|
|
2120
|
+
type: Input
|
|
2121
|
+
}] } });
|
|
2122
|
+
|
|
2123
|
+
class AppHasRoleDirective {
|
|
2124
|
+
constructor(viewContainerRef, templateRef, nuxeoService) {
|
|
2125
|
+
this.viewContainerRef = viewContainerRef;
|
|
2126
|
+
this.templateRef = templateRef;
|
|
2127
|
+
this.nuxeoService = nuxeoService;
|
|
2128
|
+
this.stop$ = new Subject();
|
|
2129
|
+
this.isVisible = false;
|
|
2130
|
+
}
|
|
2131
|
+
ngOnInit() {
|
|
2132
|
+
var _a;
|
|
2133
|
+
if ((_a = this.appHasRole) === null || _a === void 0 ? void 0 : _a.role) {
|
|
2134
|
+
this.nuxeoService.isUserInRole(this.appHasRole.role, this.appHasRole.code).subscribe(data => {
|
|
2135
|
+
if (data || !this.appHasRole) {
|
|
2136
|
+
// If it is already visible (which can happen if
|
|
2137
|
+
// his roles changed) we do not need to add it a second time
|
|
2138
|
+
if (!this.isVisible) {
|
|
2139
|
+
// We update the `isVisible` property and add the
|
|
2140
|
+
// templateRef to the view using the
|
|
2141
|
+
// 'createEmbeddedView' method of the viewContainerRef
|
|
2142
|
+
this.isVisible = true;
|
|
2143
|
+
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
else {
|
|
2147
|
+
// If the user does not have the role,
|
|
2148
|
+
// we update the `isVisible` property and clear
|
|
2149
|
+
// the contents of the viewContainerRef
|
|
2150
|
+
this.isVisible = false;
|
|
2151
|
+
this.viewContainerRef.clear();
|
|
2152
|
+
}
|
|
2153
|
+
});
|
|
2154
|
+
}
|
|
2155
|
+
else {
|
|
2156
|
+
if (!this.isVisible) {
|
|
2157
|
+
// We update the `isVisible` property and add the
|
|
2158
|
+
// templateRef to the view using the
|
|
2159
|
+
// 'createEmbeddedView' method of the viewContainerRef
|
|
2160
|
+
this.isVisible = true;
|
|
2161
|
+
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
ngOnChanges() {
|
|
2166
|
+
this.ngOnInit();
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
AppHasRoleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AppHasRoleDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: NuxeoService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2170
|
+
AppHasRoleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: AppHasRoleDirective, selector: "[appHasRole]", inputs: { appHasRole: "appHasRole" }, usesOnChanges: true, ngImport: i0 });
|
|
2171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AppHasRoleDirective, decorators: [{
|
|
2172
|
+
type: Directive,
|
|
2173
|
+
args: [{
|
|
2174
|
+
selector: '[appHasRole]'
|
|
2175
|
+
}]
|
|
2176
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: NuxeoService }]; }, propDecorators: { appHasRole: [{
|
|
2177
|
+
type: Input
|
|
2178
|
+
}] } });
|
|
2179
|
+
|
|
2180
|
+
class DragAndDropDirective {
|
|
2181
|
+
constructor() {
|
|
2182
|
+
this.fileDroped = new EventEmitter();
|
|
2183
|
+
}
|
|
2184
|
+
onDragOver(evt) {
|
|
2185
|
+
evt.preventDefault();
|
|
2186
|
+
evt.stopPropagation();
|
|
2187
|
+
}
|
|
2188
|
+
onDragLeave(evt) {
|
|
2189
|
+
evt.preventDefault();
|
|
2190
|
+
evt.stopPropagation();
|
|
2191
|
+
}
|
|
2192
|
+
onDrop(evt) {
|
|
2193
|
+
let files = [];
|
|
2194
|
+
evt.preventDefault();
|
|
2195
|
+
evt.stopPropagation();
|
|
2196
|
+
if (evt.dataTransfer.files.length) {
|
|
2197
|
+
for (const file of evt.dataTransfer.files) {
|
|
2198
|
+
files.push(file);
|
|
2199
|
+
}
|
|
2200
|
+
this.fileDroped.emit(files);
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
DragAndDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DragAndDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2205
|
+
DragAndDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: DragAndDropDirective, selector: "[appDragAndDrop]", outputs: { fileDroped: "fileDroped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0 });
|
|
2206
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DragAndDropDirective, decorators: [{
|
|
2207
|
+
type: Directive,
|
|
2208
|
+
args: [{
|
|
2209
|
+
selector: '[appDragAndDrop]'
|
|
2210
|
+
}]
|
|
2211
|
+
}], ctorParameters: function () { return []; }, propDecorators: { fileDroped: [{
|
|
2212
|
+
type: Output
|
|
2213
|
+
}], onDragOver: [{
|
|
2214
|
+
type: HostListener,
|
|
2215
|
+
args: ['dragover', ['$event']]
|
|
2216
|
+
}], onDragLeave: [{
|
|
2217
|
+
type: HostListener,
|
|
2218
|
+
args: ['dragleave', ['$event']]
|
|
2219
|
+
}], onDrop: [{
|
|
2220
|
+
type: HostListener,
|
|
2221
|
+
args: ['drop', ['$event']]
|
|
2222
|
+
}] } });
|
|
2223
|
+
|
|
2224
|
+
/**
|
|
2225
|
+
* @title
|
|
2226
|
+
* Directives Module
|
|
2227
|
+
*/
|
|
2228
|
+
class DirectiveModule {
|
|
2229
|
+
}
|
|
2230
|
+
DirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2231
|
+
DirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, declarations: [ClickOutsideDirective,
|
|
2232
|
+
SetRtlDirective,
|
|
2233
|
+
PermissionsDirective,
|
|
2234
|
+
SetDirRtlDirective,
|
|
2235
|
+
AppHasRoleDirective,
|
|
2236
|
+
DragAndDropDirective], imports: [CommonModule], exports: [ClickOutsideDirective,
|
|
2237
|
+
SetRtlDirective,
|
|
2238
|
+
PermissionsDirective,
|
|
2239
|
+
SetDirRtlDirective,
|
|
2240
|
+
AppHasRoleDirective,
|
|
2241
|
+
DragAndDropDirective] });
|
|
2242
|
+
DirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, providers: [], imports: [[CommonModule]] });
|
|
2243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, decorators: [{
|
|
2244
|
+
type: NgModule,
|
|
2245
|
+
args: [{
|
|
2246
|
+
declarations: [
|
|
2247
|
+
ClickOutsideDirective,
|
|
2248
|
+
SetRtlDirective,
|
|
2249
|
+
PermissionsDirective,
|
|
2250
|
+
SetDirRtlDirective,
|
|
2251
|
+
AppHasRoleDirective,
|
|
2252
|
+
DragAndDropDirective
|
|
2253
|
+
],
|
|
2254
|
+
imports: [CommonModule],
|
|
2255
|
+
exports: [
|
|
2256
|
+
ClickOutsideDirective,
|
|
2257
|
+
SetRtlDirective,
|
|
2258
|
+
PermissionsDirective,
|
|
2259
|
+
SetDirRtlDirective,
|
|
2260
|
+
AppHasRoleDirective,
|
|
2261
|
+
DragAndDropDirective
|
|
2262
|
+
],
|
|
2263
|
+
providers: []
|
|
2264
|
+
}]
|
|
2265
|
+
}] });
|
|
2266
|
+
|
|
2267
|
+
class NuxeoDialogModule {
|
|
2268
|
+
}
|
|
2269
|
+
NuxeoDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2270
|
+
NuxeoDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, declarations: [NdfNuxeoDialog, NdfConfirmationDialogComponent], imports: [CommonModule,
|
|
2271
|
+
TranslateModule,
|
|
2272
|
+
MatIconModule,
|
|
2273
|
+
MatDialogModule,
|
|
2274
|
+
MatTooltipModule,
|
|
2275
|
+
DirectiveModule], exports: [NdfNuxeoDialog, NdfConfirmationDialogComponent] });
|
|
2276
|
+
NuxeoDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, imports: [[
|
|
2277
|
+
CommonModule,
|
|
2278
|
+
TranslateModule,
|
|
2279
|
+
MatIconModule,
|
|
2280
|
+
MatDialogModule,
|
|
2281
|
+
MatTooltipModule,
|
|
2282
|
+
DirectiveModule
|
|
2283
|
+
]] });
|
|
2284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, decorators: [{
|
|
2285
|
+
type: NgModule,
|
|
2286
|
+
args: [{
|
|
2287
|
+
declarations: [NdfNuxeoDialog, NdfConfirmationDialogComponent],
|
|
2288
|
+
imports: [
|
|
2289
|
+
CommonModule,
|
|
2290
|
+
TranslateModule,
|
|
2291
|
+
MatIconModule,
|
|
2292
|
+
MatDialogModule,
|
|
2293
|
+
MatTooltipModule,
|
|
2294
|
+
DirectiveModule
|
|
2295
|
+
],
|
|
2296
|
+
exports: [NdfNuxeoDialog, NdfConfirmationDialogComponent]
|
|
2297
|
+
}]
|
|
2298
|
+
}] });
|
|
2299
|
+
|
|
2300
|
+
const defaultConfirmConfig = {
|
|
2301
|
+
title: 'confirmDialog.confirm',
|
|
2302
|
+
message: 'confirmDialog.generalConfirmMsg',
|
|
2303
|
+
icon: {
|
|
2304
|
+
show: true,
|
|
2305
|
+
name: 'heroicons_outline:exclamation',
|
|
2306
|
+
color: 'warn'
|
|
2307
|
+
},
|
|
2308
|
+
actions: {
|
|
2309
|
+
confirm: {
|
|
2310
|
+
show: true,
|
|
2311
|
+
label: 'BUTTONS.confirm',
|
|
2312
|
+
color: 'warn',
|
|
2313
|
+
fn: () => {
|
|
2314
|
+
return of(false);
|
|
2315
|
+
}
|
|
2316
|
+
},
|
|
2317
|
+
moreActions: []
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
|
|
2321
|
+
var _NuxeoDialogService_instances, _NuxeoDialogService_getPanelClass;
|
|
2322
|
+
class NuxeoDialogService {
|
|
2323
|
+
constructor(dialog) {
|
|
2324
|
+
this.dialog = dialog;
|
|
2325
|
+
_NuxeoDialogService_instances.add(this);
|
|
2326
|
+
}
|
|
2327
|
+
open(options) {
|
|
2328
|
+
var _a, _b, _c, _d;
|
|
2329
|
+
return this.dialog.open(options.component, {
|
|
2330
|
+
width: (options === null || options === void 0 ? void 0 : options.width) || 'auto',
|
|
2331
|
+
height: (options === null || options === void 0 ? void 0 : options.height) || 'auto',
|
|
2332
|
+
minWidth: '35%',
|
|
2333
|
+
panelClass: ['ndf-dialog', ...__classPrivateFieldGet(this, _NuxeoDialogService_instances, "m", _NuxeoDialogService_getPanelClass).call(this, options === null || options === void 0 ? void 0 : options.panelClass)],
|
|
2334
|
+
disableClose: true,
|
|
2335
|
+
data: Object.assign({ dialogConfig: {
|
|
2336
|
+
title: (_a = options.config) === null || _a === void 0 ? void 0 : _a.title,
|
|
2337
|
+
subTitle: (_b = options.config) === null || _b === void 0 ? void 0 : _b.subTitle,
|
|
2338
|
+
contentTemplate: (_c = options.config) === null || _c === void 0 ? void 0 : _c.contentTemplate,
|
|
2339
|
+
actionsTemplate: (_d = options.config) === null || _d === void 0 ? void 0 : _d.actionsTemplate
|
|
2340
|
+
} }, (options.data || {}))
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
showConfirm(config) {
|
|
2344
|
+
// Merge the user config with the default config
|
|
2345
|
+
const confirmConfig = merge({}, defaultConfirmConfig, config);
|
|
2346
|
+
const options = {
|
|
2347
|
+
component: NdfConfirmationDialogComponent,
|
|
2348
|
+
data: Object.assign({}, confirmConfig),
|
|
2349
|
+
panelClass: 'ndf-confirmation-dialog-panel'
|
|
2350
|
+
};
|
|
2351
|
+
return this.open(options);
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
_NuxeoDialogService_instances = new WeakSet(), _NuxeoDialogService_getPanelClass = function _NuxeoDialogService_getPanelClass(panelClass) {
|
|
2355
|
+
let classes = [''];
|
|
2356
|
+
if (panelClass) {
|
|
2357
|
+
classes = Array.isArray(panelClass) ? panelClass : [panelClass];
|
|
2358
|
+
}
|
|
2359
|
+
return classes;
|
|
2360
|
+
};
|
|
2361
|
+
NuxeoDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2362
|
+
NuxeoDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, providedIn: 'root' });
|
|
2363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, decorators: [{
|
|
2364
|
+
type: Injectable,
|
|
2365
|
+
args: [{
|
|
2366
|
+
providedIn: 'root'
|
|
2367
|
+
}]
|
|
2368
|
+
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }]; } });
|
|
2369
|
+
|
|
2370
|
+
class NuxeoMapper {
|
|
2371
|
+
static schemaToModel(properties) {
|
|
2372
|
+
const mappedProperties = {};
|
|
2373
|
+
for (const key in properties) {
|
|
2374
|
+
if (properties.hasOwnProperty(key)) {
|
|
2375
|
+
const [prefix, propertyKey] = key.split(':');
|
|
2376
|
+
if (!mappedProperties[prefix]) {
|
|
2377
|
+
mappedProperties[prefix] = {};
|
|
2378
|
+
}
|
|
2379
|
+
mappedProperties[prefix][propertyKey] =
|
|
2380
|
+
properties[key];
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
return mappedProperties;
|
|
2384
|
+
}
|
|
2385
|
+
static modelToSchema(model) {
|
|
2386
|
+
const packedProperties = {};
|
|
2387
|
+
for (const schemaKey in model) {
|
|
2388
|
+
if (model.hasOwnProperty(schemaKey)) {
|
|
2389
|
+
const schemaProperties = model[schemaKey];
|
|
2390
|
+
for (const propertyKey in schemaProperties) {
|
|
2391
|
+
if (schemaProperties.hasOwnProperty(propertyKey)) {
|
|
2392
|
+
packedProperties[`${schemaKey}:${propertyKey}`] =
|
|
2393
|
+
schemaProperties[propertyKey];
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
return packedProperties;
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
const ENTITY_TYPE = 'entity-type';
|
|
2403
|
+
|
|
1971
2404
|
var _HttpBaseService_http;
|
|
1972
2405
|
class HttpBaseService {
|
|
1973
2406
|
constructor(injector) {
|
|
@@ -1980,7 +2413,7 @@ class HttpBaseService {
|
|
|
1980
2413
|
get(endpointOrOptions, params = undefined, headers = undefined, responseType = undefined) {
|
|
1981
2414
|
var _a, _b, _c;
|
|
1982
2415
|
let url;
|
|
1983
|
-
if (typeof endpointOrOptions ===
|
|
2416
|
+
if (typeof endpointOrOptions === 'string') {
|
|
1984
2417
|
url = endpointOrOptions;
|
|
1985
2418
|
}
|
|
1986
2419
|
else {
|
|
@@ -1997,7 +2430,7 @@ class HttpBaseService {
|
|
|
1997
2430
|
post(endpointOrOptions, payload = undefined, params = undefined, headers = undefined, responseType = undefined) {
|
|
1998
2431
|
var _a, _b, _c, _d;
|
|
1999
2432
|
let url;
|
|
2000
|
-
if (typeof endpointOrOptions ===
|
|
2433
|
+
if (typeof endpointOrOptions === 'string') {
|
|
2001
2434
|
url = endpointOrOptions;
|
|
2002
2435
|
}
|
|
2003
2436
|
else {
|
|
@@ -2015,7 +2448,7 @@ class HttpBaseService {
|
|
|
2015
2448
|
put(endpointOrOptions, payload = undefined, params = undefined, headers = undefined, responseType = undefined) {
|
|
2016
2449
|
var _a, _b, _c, _d;
|
|
2017
2450
|
let url;
|
|
2018
|
-
if (typeof endpointOrOptions ===
|
|
2451
|
+
if (typeof endpointOrOptions === 'string') {
|
|
2019
2452
|
url = endpointOrOptions;
|
|
2020
2453
|
}
|
|
2021
2454
|
else {
|
|
@@ -2033,7 +2466,7 @@ class HttpBaseService {
|
|
|
2033
2466
|
patch(endpointOrOptions, payload = undefined, params = undefined, headers = undefined, responseType = undefined) {
|
|
2034
2467
|
var _a, _b, _c, _d;
|
|
2035
2468
|
let url;
|
|
2036
|
-
if (typeof endpointOrOptions ===
|
|
2469
|
+
if (typeof endpointOrOptions === 'string') {
|
|
2037
2470
|
url = endpointOrOptions;
|
|
2038
2471
|
}
|
|
2039
2472
|
else {
|
|
@@ -2051,7 +2484,7 @@ class HttpBaseService {
|
|
|
2051
2484
|
delete(endpointOrOptions, params = undefined, headers = undefined, responseType = undefined) {
|
|
2052
2485
|
var _a, _b, _c;
|
|
2053
2486
|
let url;
|
|
2054
|
-
if (typeof endpointOrOptions ===
|
|
2487
|
+
if (typeof endpointOrOptions === 'string') {
|
|
2055
2488
|
url = endpointOrOptions;
|
|
2056
2489
|
}
|
|
2057
2490
|
else {
|
|
@@ -2149,10 +2582,10 @@ class CacheBaseService {
|
|
|
2149
2582
|
.filter((key) => {
|
|
2150
2583
|
var _a;
|
|
2151
2584
|
const options = {
|
|
2152
|
-
cacheKey: key.replace(prefix,
|
|
2585
|
+
cacheKey: key.replace(prefix, ''),
|
|
2153
2586
|
userName: userName,
|
|
2154
2587
|
request: DEFAULT_CACHE_OPTIONS.REQUEST,
|
|
2155
|
-
prepareDataBeforeCaching: DEFAULT_CACHE_OPTIONS.PREPARE_DATA
|
|
2588
|
+
prepareDataBeforeCaching: DEFAULT_CACHE_OPTIONS.PREPARE_DATA
|
|
2156
2589
|
};
|
|
2157
2590
|
const firstFetchingDate = (_a = __classPrivateFieldGet(this, _CacheBaseService_instances, "m", _CacheBaseService_getItem).call(this, options)) === null || _a === void 0 ? void 0 : _a.firstFetchingDate;
|
|
2158
2591
|
if (!firstFetchingDate)
|
|
@@ -2185,7 +2618,7 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
|
|
|
2185
2618
|
__classPrivateFieldGet(this, _CacheBaseService_instances, "m", _CacheBaseService_setItemInMap).call(this, options.cacheKey, Object.assign(Object.assign({}, cachedItem), { fetchingItemsFromTheServer: false, onFinishFetching: new Subject(), request: options.request }));
|
|
2186
2619
|
const params = {
|
|
2187
2620
|
[options.pageKey]: 0,
|
|
2188
|
-
[options.minCompareDateKey]: __classPrivateFieldGet(this, _CacheBaseService_instances, "m", _CacheBaseService_add1SecondToModifiedDate).call(this, new Date(__classPrivateFieldGet(this, _CacheBaseService_fetchedItems, "f")[options.cacheKey].lastModifiedDate)).toISOString()
|
|
2621
|
+
[options.minCompareDateKey]: __classPrivateFieldGet(this, _CacheBaseService_instances, "m", _CacheBaseService_add1SecondToModifiedDate).call(this, new Date(__classPrivateFieldGet(this, _CacheBaseService_fetchedItems, "f")[options.cacheKey].lastModifiedDate)).toISOString()
|
|
2189
2622
|
};
|
|
2190
2623
|
__classPrivateFieldGet(this, _CacheBaseService_fetchedItems, "f")[options.cacheKey].params = params;
|
|
2191
2624
|
observable = options.request(params);
|
|
@@ -2215,7 +2648,7 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
|
|
|
2215
2648
|
data: _fetchedItems.data,
|
|
2216
2649
|
lastModifiedDate: _fetchedItems.lastModifiedDate,
|
|
2217
2650
|
firstFetchingDate: _fetchedItems.firstFetchingDate,
|
|
2218
|
-
resultsCount: _fetchedItems[options.resultsCount]
|
|
2651
|
+
resultsCount: _fetchedItems[options.resultsCount]
|
|
2219
2652
|
}, options);
|
|
2220
2653
|
}
|
|
2221
2654
|
return _fetchedItems;
|
|
@@ -2223,7 +2656,7 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
|
|
|
2223
2656
|
const result = _cloneDeep({
|
|
2224
2657
|
[options.mappedDataKey]: res.data,
|
|
2225
2658
|
[options.lastModifiedDateKey]: res.lastModifiedDate,
|
|
2226
|
-
[options.resultsCount]: res[options.resultsCount]
|
|
2659
|
+
[options.resultsCount]: res[options.resultsCount]
|
|
2227
2660
|
});
|
|
2228
2661
|
res.onFinishFetching.next(result);
|
|
2229
2662
|
return result;
|
|
@@ -2344,14 +2777,14 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
|
|
|
2344
2777
|
DEFAULT_TTL_CONFIG.UNIT =
|
|
2345
2778
|
((_d = (_c = EnvManager.environment) === null || _c === void 0 ? void 0 : _c.cache) === null || _d === void 0 ? void 0 : _d.ttlUnit) || DEFAULT_TTL_CONFIG.UNIT;
|
|
2346
2779
|
DEFAULT_TTL_CONFIG.AUTO_CHECK =
|
|
2347
|
-
((_f = (_e = EnvManager.environment) === null || _e === void 0 ? void 0 : _e.cache) === null || _f === void 0 ? void 0 : _f.autoCheck) ==
|
|
2780
|
+
((_f = (_e = EnvManager.environment) === null || _e === void 0 ? void 0 : _e.cache) === null || _f === void 0 ? void 0 : _f.autoCheck) == 'YES';
|
|
2348
2781
|
DEFAULT_TTL_CONFIG.RETRY =
|
|
2349
2782
|
((_h = (_g = EnvManager.environment) === null || _g === void 0 ? void 0 : _g.cache) === null || _h === void 0 ? void 0 : _h.retry) || DEFAULT_TTL_CONFIG.RETRY;
|
|
2350
2783
|
}, _CacheBaseService_add1SecondToModifiedDate = function _CacheBaseService_add1SecondToModifiedDate(date) {
|
|
2351
2784
|
let newDate = new Date(date.getTime());
|
|
2352
2785
|
newDate.setSeconds(newDate.getSeconds() + 1);
|
|
2353
2786
|
return newDate;
|
|
2354
|
-
}, _CacheBaseService_clear = function _CacheBaseService_clear(userName, keyOrAll =
|
|
2787
|
+
}, _CacheBaseService_clear = function _CacheBaseService_clear(userName, keyOrAll = '') {
|
|
2355
2788
|
Object.keys(window.localStorage)
|
|
2356
2789
|
.filter((q) => q.startsWith(`${userName}__${DEFAULT_CACHE_OPTIONS.PREFIX}${keyOrAll}`))
|
|
2357
2790
|
.forEach((key) => {
|
|
@@ -2370,11 +2803,11 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
|
|
|
2370
2803
|
}, _CacheBaseService_setItemInMap = function _CacheBaseService_setItemInMap(key, val) {
|
|
2371
2804
|
const empty = {
|
|
2372
2805
|
data: [],
|
|
2373
|
-
firstFetchingDate:
|
|
2374
|
-
lastModifiedDate:
|
|
2806
|
+
firstFetchingDate: '',
|
|
2807
|
+
lastModifiedDate: '',
|
|
2375
2808
|
resultsCount: 0,
|
|
2376
2809
|
fetchingItemsFromTheServer: false,
|
|
2377
|
-
onFinishFetching: new Subject()
|
|
2810
|
+
onFinishFetching: new Subject()
|
|
2378
2811
|
};
|
|
2379
2812
|
let value = val ? val : empty;
|
|
2380
2813
|
__classPrivateFieldGet(this, _CacheBaseService_fetchedItems, "f")[key] = value;
|
|
@@ -2398,11 +2831,11 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
|
|
|
2398
2831
|
}
|
|
2399
2832
|
};
|
|
2400
2833
|
CacheBaseService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CacheBaseService, deps: [{ token: UserPreferencesService }, { token: UtilityService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2401
|
-
CacheBaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CacheBaseService, providedIn:
|
|
2834
|
+
CacheBaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CacheBaseService, providedIn: 'root' });
|
|
2402
2835
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CacheBaseService, decorators: [{
|
|
2403
2836
|
type: Injectable,
|
|
2404
2837
|
args: [{
|
|
2405
|
-
providedIn:
|
|
2838
|
+
providedIn: 'root'
|
|
2406
2839
|
}]
|
|
2407
2840
|
}], ctorParameters: function () { return [{ type: UserPreferencesService }, { type: UtilityService }]; } });
|
|
2408
2841
|
|
|
@@ -2459,7 +2892,7 @@ class BaseService extends HttpBaseService {
|
|
|
2459
2892
|
automation(operationOrOptions, input = undefined, params = undefined, context = undefined, headers = undefined, isCustomAutomation = false) {
|
|
2460
2893
|
var _a, _b, _c, _d;
|
|
2461
2894
|
let operation;
|
|
2462
|
-
if (typeof operationOrOptions ===
|
|
2895
|
+
if (typeof operationOrOptions === 'string') {
|
|
2463
2896
|
operation = operationOrOptions;
|
|
2464
2897
|
}
|
|
2465
2898
|
else {
|
|
@@ -2474,7 +2907,7 @@ class BaseService extends HttpBaseService {
|
|
|
2474
2907
|
return from(__classPrivateFieldGet(this, _BaseService_nuxeoService, "f").nuxeoClient
|
|
2475
2908
|
.operation(operation, Object.assign({}, (isCustomAutomation
|
|
2476
2909
|
? {
|
|
2477
|
-
url: `${this.environment.nuxeo}${this.environment.customAutomation}
|
|
2910
|
+
url: `${this.environment.nuxeo}${this.environment.customAutomation}`
|
|
2478
2911
|
}
|
|
2479
2912
|
: {})))
|
|
2480
2913
|
.input(input ? input : undefined)
|
|
@@ -2483,22 +2916,22 @@ class BaseService extends HttpBaseService {
|
|
|
2483
2916
|
.execute({ headers: headers ? Object.assign({}, headers) : undefined })).pipe(map((response) => response), this.catchErrors());
|
|
2484
2917
|
}
|
|
2485
2918
|
customAutomation(operationOrOptions, input = undefined, params = undefined, context = undefined, headers = undefined) {
|
|
2486
|
-
if (typeof operationOrOptions ==
|
|
2919
|
+
if (typeof operationOrOptions == 'object') {
|
|
2487
2920
|
operationOrOptions.isCustomAutomation = true;
|
|
2488
2921
|
}
|
|
2489
2922
|
return this.automation(operationOrOptions, input, params, context, headers, true);
|
|
2490
2923
|
}
|
|
2491
|
-
request(endpointOrOptions, queryParams = undefined, headers = undefined, payload = undefined, type =
|
|
2924
|
+
request(endpointOrOptions, queryParams = undefined, headers = undefined, payload = undefined, type = 'get') {
|
|
2492
2925
|
var _a, _b, _c, _d;
|
|
2493
2926
|
let endpoint;
|
|
2494
|
-
if (typeof endpointOrOptions ===
|
|
2927
|
+
if (typeof endpointOrOptions === 'string') {
|
|
2495
2928
|
endpoint = endpointOrOptions;
|
|
2496
2929
|
}
|
|
2497
2930
|
else {
|
|
2498
2931
|
const options = endpointOrOptions;
|
|
2499
2932
|
endpoint = options.endpoint;
|
|
2500
2933
|
queryParams = (_a = options.queryParams) !== null && _a !== void 0 ? _a : undefined;
|
|
2501
|
-
type = (_b = options.type) !== null && _b !== void 0 ? _b :
|
|
2934
|
+
type = (_b = options.type) !== null && _b !== void 0 ? _b : 'get';
|
|
2502
2935
|
headers = (_c = options.headers) !== null && _c !== void 0 ? _c : undefined;
|
|
2503
2936
|
payload = (_d = options.payload) !== null && _d !== void 0 ? _d : undefined;
|
|
2504
2937
|
}
|
|
@@ -2506,13 +2939,13 @@ class BaseService extends HttpBaseService {
|
|
|
2506
2939
|
.request(endpoint)
|
|
2507
2940
|
.queryParams(queryParams ? Object.assign({}, queryParams) : undefined)[type]({
|
|
2508
2941
|
headers: headers ? Object.assign({}, headers) : undefined,
|
|
2509
|
-
body: payload ? Object.assign({}, payload) : undefined
|
|
2942
|
+
body: payload ? Object.assign({}, payload) : undefined
|
|
2510
2943
|
})).pipe(map((response) => response), this.catchErrors());
|
|
2511
2944
|
}
|
|
2512
2945
|
query(pageProviderOrOptions, params = undefined, headers = undefined) {
|
|
2513
2946
|
var _a, _b;
|
|
2514
2947
|
let pageProvider;
|
|
2515
|
-
if (typeof pageProviderOrOptions ===
|
|
2948
|
+
if (typeof pageProviderOrOptions === 'string') {
|
|
2516
2949
|
pageProvider = pageProviderOrOptions;
|
|
2517
2950
|
}
|
|
2518
2951
|
else {
|
|
@@ -2523,7 +2956,7 @@ class BaseService extends HttpBaseService {
|
|
|
2523
2956
|
}
|
|
2524
2957
|
return __classPrivateFieldGet(this, _BaseService_callApiService, "f")
|
|
2525
2958
|
.query(Object.assign({ pageProvider }, (params ? params : {})), {
|
|
2526
|
-
headers: headers ? Object.assign({}, headers) : undefined
|
|
2959
|
+
headers: headers ? Object.assign({}, headers) : undefined
|
|
2527
2960
|
})
|
|
2528
2961
|
.pipe(map((response) => response), this.catchErrors());
|
|
2529
2962
|
}
|
|
@@ -2535,7 +2968,7 @@ class BaseService extends HttpBaseService {
|
|
|
2535
2968
|
return this.query({
|
|
2536
2969
|
pageProvider: options.pageProvider,
|
|
2537
2970
|
params: Object.assign(Object.assign({}, (options.params ? options.params : {})), (params ? params : {})),
|
|
2538
|
-
headers: options.headers
|
|
2971
|
+
headers: options.headers
|
|
2539
2972
|
});
|
|
2540
2973
|
};
|
|
2541
2974
|
return __classPrivateFieldGet(this, _BaseService_cacheBaseService, "f").startFetchingItems(Object.assign(Object.assign({}, options), { userName: this.userName, request: request }));
|
|
@@ -2547,7 +2980,7 @@ class BaseService extends HttpBaseService {
|
|
|
2547
2980
|
payload: options.payload,
|
|
2548
2981
|
params: Object.assign(Object.assign({}, (options.params ? options.params : {})), (params ? params : {})),
|
|
2549
2982
|
headers: options.headers,
|
|
2550
|
-
responseType: options.responseType
|
|
2983
|
+
responseType: options.responseType
|
|
2551
2984
|
});
|
|
2552
2985
|
};
|
|
2553
2986
|
return __classPrivateFieldGet(this, _BaseService_cacheBaseService, "f").startFetchingItems(Object.assign(Object.assign({}, options), { userName: this.userName, request: request }));
|
|
@@ -2574,10 +3007,10 @@ class BaseService extends HttpBaseService {
|
|
|
2574
3007
|
}
|
|
2575
3008
|
_BaseService_nuxeoService = new WeakMap(), _BaseService_callApiService = new WeakMap(), _BaseService_cacheBaseService = new WeakMap();
|
|
2576
3009
|
BaseService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2577
|
-
BaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseService, providedIn:
|
|
3010
|
+
BaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseService, providedIn: 'root' });
|
|
2578
3011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseService, decorators: [{
|
|
2579
3012
|
type: Injectable,
|
|
2580
|
-
args: [{ providedIn:
|
|
3013
|
+
args: [{ providedIn: 'root' }]
|
|
2581
3014
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
2582
3015
|
|
|
2583
3016
|
/**
|
|
@@ -2589,925 +3022,493 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
2589
3022
|
* <img [attr.src]="user.avatar | secure | async" />
|
|
2590
3023
|
* ~~~
|
|
2591
3024
|
* @title
|
|
2592
|
-
* Safe URL
|
|
2593
|
-
*/
|
|
2594
|
-
class SecurePipe {
|
|
2595
|
-
constructor(http, sanitizer) {
|
|
2596
|
-
this.http = http;
|
|
2597
|
-
this.sanitizer = sanitizer;
|
|
2598
|
-
}
|
|
2599
|
-
/**
|
|
2600
|
-
*
|
|
2601
|
-
* @param url Resource URL
|
|
2602
|
-
* @returns Safe URL
|
|
2603
|
-
*/
|
|
2604
|
-
transform(url) {
|
|
2605
|
-
return this.http
|
|
2606
|
-
.get(url, { responseType: 'blob' }).pipe(map(val => this.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(val))));
|
|
2607
|
-
}
|
|
2608
|
-
}
|
|
2609
|
-
SecurePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, deps: [{ token: i1$2.HttpClient }, { token: i2$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2610
|
-
SecurePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, name: "secure" });
|
|
2611
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, decorators: [{
|
|
2612
|
-
type: Pipe,
|
|
2613
|
-
args: [{
|
|
2614
|
-
name: 'secure'
|
|
2615
|
-
}]
|
|
2616
|
-
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i2$3.DomSanitizer }]; } });
|
|
2617
|
-
|
|
2618
|
-
/**
|
|
2619
|
-
* A component to display user avatar if exists, or initials if not
|
|
2620
|
-
*
|
|
2621
|
-
*  
|
|
2622
|
-
* @title
|
|
2623
|
-
* User Avatar
|
|
2624
|
-
* @example
|
|
2625
|
-
*
|
|
2626
|
-
* <cts-avatar [user]="user"></cts-avatar>
|
|
2627
|
-
*/
|
|
2628
|
-
class AvatarComponent {
|
|
2629
|
-
constructor() { }
|
|
2630
|
-
ngOnInit() {
|
|
2631
|
-
var _a, _b, _c, _d;
|
|
2632
|
-
this.stringToHslColor(`${(_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.firstName} ${(_d = (_c = this.user) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.lastName}`, 30, 80);
|
|
2633
|
-
}
|
|
2634
|
-
stringToHslColor(str, s, l) {
|
|
2635
|
-
var hash = 0;
|
|
2636
|
-
for (var i = 0; i < str.length; i++) {
|
|
2637
|
-
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
|
2638
|
-
}
|
|
2639
|
-
var h = hash % 360;
|
|
2640
|
-
this.backgroundColor = 'hsl(' + h + ', ' + s + '%, ' + l + '%)';
|
|
2641
|
-
}
|
|
2642
|
-
getInitials() {
|
|
2643
|
-
var _a;
|
|
2644
|
-
return ((_a = this.user) === null || _a === void 0 ? void 0 : _a.properties)
|
|
2645
|
-
? (this.user.properties.initials = [
|
|
2646
|
-
this.user.properties.firstName
|
|
2647
|
-
? this.user.properties.firstName[0].toUpperCase()
|
|
2648
|
-
: '',
|
|
2649
|
-
this.user.properties.lastName
|
|
2650
|
-
? this.user.properties.lastName[0].toUpperCase()
|
|
2651
|
-
: '',
|
|
2652
|
-
].join(''))
|
|
2653
|
-
: '';
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2657
|
-
AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AvatarComponent, selector: "cts-avatar", inputs: { user: "user" }, ngImport: i0, template: "<div class=\"avatar-wrapper\">\r\n <ng-container *ngIf=\"user?.avatar?.length; else initials\">\r\n <img *ngIf=\"user.avatar | secure | async as obs; else initials\" [attr.src]=\"obs\" alt=\"user image\" />\r\n </ng-container>\r\n\r\n <ng-template #initials>\r\n <div class=\"avatar-name \" [ngStyle]=\"{ 'background-color': backgroundColor }\">\r\n <span>{{\r\n this.getInitials()\r\n }}</span>\r\n </div>\r\n </ng-template>\r\n</div>\r\n", styles: [".avatar-wrapper{width:100%;height:100%;border-radius:100%;overflow:hidden}.avatar-wrapper img{width:100%;height:100%;object-fit:cover}.avatar-wrapper .avatar-name{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.avatar-wrapper .avatar-name span{font-size:16px;font-weight:bold;color:#fff}.avatar-out-container{width:50px;height:50px;border-radius:50%;overflow:hidden;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}\n"], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4$1.AsyncPipe, "secure": SecurePipe } });
|
|
2658
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
2659
|
-
type: Component,
|
|
2660
|
-
args: [{
|
|
2661
|
-
selector: 'cts-avatar',
|
|
2662
|
-
templateUrl: './avatar.component.html',
|
|
2663
|
-
styleUrls: ['./avatar.component.scss']
|
|
2664
|
-
}]
|
|
2665
|
-
}], ctorParameters: function () { return []; }, propDecorators: { user: [{
|
|
2666
|
-
type: Input
|
|
2667
|
-
}] } });
|
|
2668
|
-
|
|
2669
|
-
/**
|
|
2670
|
-
* Transforms date to localized date string
|
|
2671
|
-
*
|
|
2672
|
-
* ### In template example:
|
|
2673
|
-
* ~~~html
|
|
2674
|
-
* <!-- in template -->
|
|
2675
|
-
* <p>
|
|
2676
|
-
* {{ dateObject | localizedDate: "EEEE, MMMM dd, yyyy" }}
|
|
2677
|
-
* </p>
|
|
2678
|
-
* ~~~
|
|
2679
|
-
* @title
|
|
2680
|
-
* Localized Date
|
|
2681
|
-
*
|
|
2682
|
-
* @example
|
|
2683
|
-
* ...
|
|
2684
|
-
* constructor(... private LocalizedDatePipe: localizedDatePipe ...){
|
|
2685
|
-
* const localizedDateString = this.localizedDatePipe.transform(dateObject, 'EEEE, MMMM dd, yyyy');
|
|
2686
|
-
* }
|
|
2687
|
-
* ...
|
|
2688
|
-
*/
|
|
2689
|
-
class LocalizedDatePipe {
|
|
2690
|
-
constructor(userPreferenceService) {
|
|
2691
|
-
this.userPreferenceService = userPreferenceService;
|
|
2692
|
-
this.defaultLocale = LocalizedDatePipe.DEFAULT_LOCALE;
|
|
2693
|
-
this.defaultFormat = LocalizedDatePipe.DEFAULT_DATE_FORMAT;
|
|
2694
|
-
this.onDestroy$ = new Subject();
|
|
2695
|
-
if (this.userPreferenceService) {
|
|
2696
|
-
this.userPreferenceService
|
|
2697
|
-
.select(UserPreferenceValues.Locale)
|
|
2698
|
-
.pipe(takeUntil(this.onDestroy$))
|
|
2699
|
-
.subscribe(locale => {
|
|
2700
|
-
if (locale) {
|
|
2701
|
-
this.defaultLocale = locale;
|
|
2702
|
-
}
|
|
2703
|
-
});
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
/**
|
|
2707
|
-
*
|
|
2708
|
-
* @param value date object
|
|
2709
|
-
* @param format format
|
|
2710
|
-
* @param locale locale to convert to
|
|
2711
|
-
* @returns localized date string
|
|
2712
|
-
*/
|
|
2713
|
-
transform(value, format, locale) {
|
|
2714
|
-
try {
|
|
2715
|
-
const actualFormat = format || this.defaultFormat;
|
|
2716
|
-
const actualLocale = locale || this.defaultLocale;
|
|
2717
|
-
const datePipe = new DatePipe(actualLocale);
|
|
2718
|
-
return datePipe.transform(value, actualFormat, 'GMT+3');
|
|
2719
|
-
}
|
|
2720
|
-
catch (e) {
|
|
2721
|
-
console.warn(e);
|
|
2722
|
-
return value;
|
|
2723
|
-
}
|
|
2724
|
-
}
|
|
2725
|
-
/** @ignore */
|
|
2726
|
-
ngOnDestroy() {
|
|
2727
|
-
this.onDestroy$.next(true);
|
|
2728
|
-
this.onDestroy$.complete();
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
LocalizedDatePipe.DEFAULT_LOCALE = 'en-US';
|
|
2732
|
-
LocalizedDatePipe.DEFAULT_DATE_FORMAT = 'dd MMMM yyyy hh:mm a';
|
|
2733
|
-
LocalizedDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, deps: [{ token: UserPreferencesService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2734
|
-
LocalizedDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, name: "localizedDate", pure: false });
|
|
2735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, decorators: [{
|
|
2736
|
-
type: Pipe,
|
|
2737
|
-
args: [{
|
|
2738
|
-
name: 'localizedDate',
|
|
2739
|
-
pure: false
|
|
2740
|
-
}]
|
|
2741
|
-
}], ctorParameters: function () { return [{ type: UserPreferencesService }]; } });
|
|
2742
|
-
|
|
2743
|
-
/**
|
|
2744
|
-
* Transforms html string into safe html to be rendered in the view
|
|
2745
|
-
*
|
|
2746
|
-
* ### In template example:
|
|
2747
|
-
* ~~~html
|
|
2748
|
-
* <!-- in template -->
|
|
2749
|
-
* <span [innerHTML]="htmlString | safeHtml"></span>
|
|
2750
|
-
* ~~~
|
|
2751
|
-
* @title
|
|
2752
|
-
* Safe HTML
|
|
2753
|
-
*/
|
|
2754
|
-
class SafeHtmlPipe {
|
|
2755
|
-
constructor(sanitized) {
|
|
2756
|
-
this.sanitized = sanitized;
|
|
2757
|
-
}
|
|
2758
|
-
/**
|
|
2759
|
-
*
|
|
2760
|
-
* @param value HTML String
|
|
2761
|
-
* @returns Safe HTML
|
|
2762
|
-
*/
|
|
2763
|
-
transform(value) {
|
|
2764
|
-
return this.sanitized.bypassSecurityTrustHtml(value);
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
|
-
SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i2$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2768
|
-
SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
|
|
2769
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, decorators: [{
|
|
2770
|
-
type: Pipe,
|
|
2771
|
-
args: [{ name: 'safeHtml' }]
|
|
2772
|
-
}], ctorParameters: function () { return [{ type: i2$3.DomSanitizer }]; } });
|
|
2773
|
-
|
|
2774
|
-
/**
|
|
2775
|
-
* Converts date into how long time ago string
|
|
2776
|
-
*
|
|
2777
|
-
* ### In template example:
|
|
2778
|
-
* ~~~html
|
|
2779
|
-
* <!-- in template -->
|
|
2780
|
-
* <span>{{ dateObject | timeAgo }}</span>
|
|
2781
|
-
* ~~~
|
|
2782
|
-
* @title
|
|
2783
|
-
* Time Ago
|
|
2784
|
-
*/
|
|
2785
|
-
class TimeAgoPipe {
|
|
2786
|
-
constructor(userPreferenceService) {
|
|
2787
|
-
this.userPreferenceService = userPreferenceService;
|
|
2788
|
-
this.onDestroy$ = new Subject();
|
|
2789
|
-
this.userPreferenceService
|
|
2790
|
-
.select(UserPreferenceValues.Locale)
|
|
2791
|
-
.pipe(takeUntil(this.onDestroy$))
|
|
2792
|
-
.subscribe(locale => {
|
|
2793
|
-
this.defaultLocale = locale || TimeAgoPipe.DEFAULT_LOCALE;
|
|
2794
|
-
});
|
|
2795
|
-
this.defaultDateTimeFormat = TimeAgoPipe.DEFAULT_DATE_TIME_FORMAT;
|
|
2796
|
-
}
|
|
2797
|
-
/**
|
|
2798
|
-
*
|
|
2799
|
-
* @param value date object
|
|
2800
|
-
* @param locale locale to be transformed to
|
|
2801
|
-
* @returns Time ago string (15 minutes ago)
|
|
2802
|
-
*/
|
|
2803
|
-
transform(value, locale) {
|
|
2804
|
-
if (value !== null && value !== undefined) {
|
|
2805
|
-
const actualLocale = locale || this.defaultLocale;
|
|
2806
|
-
const then = moment$5(value);
|
|
2807
|
-
//const diff = moment().locale(actualLocale).diff(then, 'days');
|
|
2808
|
-
return then.locale(actualLocale).fromNow();
|
|
2809
|
-
// if ( diff > 7) {
|
|
2810
|
-
// const datePipe: DatePipe = new DatePipe(actualLocale);
|
|
2811
|
-
// return datePipe.transform(value, this.defaultDateTimeFormat);
|
|
2812
|
-
// } else {
|
|
2813
|
-
// return then.locale(actualLocale).fromNow();
|
|
2814
|
-
// }
|
|
2815
|
-
}
|
|
2816
|
-
return '';
|
|
2817
|
-
}
|
|
2818
|
-
/** @ignore */
|
|
2819
|
-
ngOnDestroy() {
|
|
2820
|
-
this.onDestroy$.next(true);
|
|
2821
|
-
this.onDestroy$.complete();
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
TimeAgoPipe.DEFAULT_LOCALE = 'en-US';
|
|
2825
|
-
TimeAgoPipe.DEFAULT_DATE_TIME_FORMAT = 'dd/MM/yyyy HH:mm';
|
|
2826
|
-
TimeAgoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, deps: [{ token: UserPreferencesService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2827
|
-
TimeAgoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, name: "timeAgo" });
|
|
2828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, decorators: [{
|
|
2829
|
-
type: Pipe,
|
|
2830
|
-
args: [{
|
|
2831
|
-
name: 'timeAgo'
|
|
2832
|
-
}]
|
|
2833
|
-
}], ctorParameters: function () { return [{ type: UserPreferencesService }]; } });
|
|
2834
|
-
|
|
2835
|
-
/**
|
|
2836
|
-
* Transforms array of strings to single string seperated with seperator
|
|
2837
|
-
*
|
|
2838
|
-
* ### In template example:
|
|
2839
|
-
* ~~~html
|
|
2840
|
-
* <!-- in template -->
|
|
2841
|
-
* <p>{{ ['string 1','string 2', 'string 3'] | multiValue : {valueSeparator:', '}}}</p>
|
|
2842
|
-
* ~~~
|
|
2843
|
-
* @title
|
|
2844
|
-
* Multi Value
|
|
2845
|
-
*
|
|
2846
|
-
* @example
|
|
2847
|
-
* ...
|
|
2848
|
-
* constructor(... private MultiValuePipe: multiValuePipe ...){
|
|
2849
|
-
* const MultiValueString = this.multiValuePipe.transform(['string 1','string 2', 'string 3'], ', ');
|
|
2850
|
-
* }
|
|
2851
|
-
* ...
|
|
3025
|
+
* Safe URL
|
|
2852
3026
|
*/
|
|
2853
|
-
class
|
|
3027
|
+
class SecurePipe {
|
|
3028
|
+
constructor(http, sanitizer) {
|
|
3029
|
+
this.http = http;
|
|
3030
|
+
this.sanitizer = sanitizer;
|
|
3031
|
+
}
|
|
2854
3032
|
/**
|
|
2855
3033
|
*
|
|
2856
|
-
* @param
|
|
2857
|
-
* @
|
|
2858
|
-
* @returns the joining of all array items seperated with seperator
|
|
3034
|
+
* @param url Resource URL
|
|
3035
|
+
* @returns Safe URL
|
|
2859
3036
|
*/
|
|
2860
|
-
transform(
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
}
|
|
2864
|
-
return values;
|
|
3037
|
+
transform(url) {
|
|
3038
|
+
return this.http
|
|
3039
|
+
.get(url, { responseType: 'blob' }).pipe(map(val => this.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(val))));
|
|
2865
3040
|
}
|
|
2866
3041
|
}
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, decorators: [{
|
|
3042
|
+
SecurePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, deps: [{ token: i1$2.HttpClient }, { token: i2$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3043
|
+
SecurePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, name: "secure" });
|
|
3044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, decorators: [{
|
|
2871
3045
|
type: Pipe,
|
|
2872
|
-
args: [{
|
|
2873
|
-
|
|
3046
|
+
args: [{
|
|
3047
|
+
name: 'secure'
|
|
3048
|
+
}]
|
|
3049
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i2$3.DomSanitizer }]; } });
|
|
2874
3050
|
|
|
2875
3051
|
/**
|
|
2876
|
-
*
|
|
3052
|
+
* A component to display user avatar if exists, or initials if not
|
|
2877
3053
|
*
|
|
2878
|
-
*
|
|
2879
|
-
* ~~~html
|
|
2880
|
-
* <!-- in template -->
|
|
2881
|
-
* <p>{{ file.sizeInBytes | FileSize}}</p>
|
|
2882
|
-
* ~~~
|
|
3054
|
+
*  
|
|
2883
3055
|
* @title
|
|
2884
|
-
*
|
|
2885
|
-
*
|
|
3056
|
+
* User Avatar
|
|
2886
3057
|
* @example
|
|
2887
|
-
*
|
|
2888
|
-
*
|
|
2889
|
-
* const sizeString = this.fileSizePiple.transform(sizeInBytes);
|
|
2890
|
-
* }
|
|
2891
|
-
* ...
|
|
3058
|
+
*
|
|
3059
|
+
* <cts-avatar [user]="user"></cts-avatar>
|
|
2892
3060
|
*/
|
|
2893
|
-
class
|
|
2894
|
-
constructor(
|
|
2895
|
-
|
|
3061
|
+
class AvatarComponent {
|
|
3062
|
+
constructor() { }
|
|
3063
|
+
ngOnInit() {
|
|
3064
|
+
var _a, _b, _c, _d;
|
|
3065
|
+
this.stringToHslColor(`${(_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.firstName} ${(_d = (_c = this.user) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.lastName}`, 30, 80);
|
|
2896
3066
|
}
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
* @returns translated size string
|
|
2902
|
-
*/
|
|
2903
|
-
transform(paramByte, decimals = 2) {
|
|
2904
|
-
if (paramByte == null) {
|
|
2905
|
-
return '';
|
|
2906
|
-
}
|
|
2907
|
-
const bytes = parseInt(paramByte, 10);
|
|
2908
|
-
if (isNaN(bytes)) {
|
|
2909
|
-
return '';
|
|
2910
|
-
}
|
|
2911
|
-
if (bytes === 0) {
|
|
2912
|
-
return '0 ' + this.translation.instant('FILE_SIZE.BYTES');
|
|
3067
|
+
stringToHslColor(str, s, l) {
|
|
3068
|
+
var hash = 0;
|
|
3069
|
+
for (var i = 0; i < str.length; i++) {
|
|
3070
|
+
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
|
2913
3071
|
}
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
3072
|
+
var h = hash % 360;
|
|
3073
|
+
this.backgroundColor = 'hsl(' + h + ', ' + s + '%, ' + l + '%)';
|
|
3074
|
+
}
|
|
3075
|
+
getInitials() {
|
|
3076
|
+
var _a;
|
|
3077
|
+
return ((_a = this.user) === null || _a === void 0 ? void 0 : _a.properties)
|
|
3078
|
+
? (this.user.properties.initials = [
|
|
3079
|
+
this.user.properties.firstName
|
|
3080
|
+
? this.user.properties.firstName[0].toUpperCase()
|
|
3081
|
+
: '',
|
|
3082
|
+
this.user.properties.lastName
|
|
3083
|
+
? this.user.properties.lastName[0].toUpperCase()
|
|
3084
|
+
: '',
|
|
3085
|
+
].join(''))
|
|
3086
|
+
: '';
|
|
2917
3087
|
}
|
|
2918
3088
|
}
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
2922
|
-
type:
|
|
3089
|
+
AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3090
|
+
AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AvatarComponent, selector: "cts-avatar", inputs: { user: "user" }, ngImport: i0, template: "<div class=\"avatar-wrapper\">\r\n <ng-container *ngIf=\"user?.avatar?.length; else initials\">\r\n <img *ngIf=\"user.avatar | secure | async as obs; else initials\" [attr.src]=\"obs\" alt=\"user image\" />\r\n </ng-container>\r\n\r\n <ng-template #initials>\r\n <div class=\"avatar-name \" [ngStyle]=\"{ 'background-color': backgroundColor }\">\r\n <span>{{\r\n this.getInitials()\r\n }}</span>\r\n </div>\r\n </ng-template>\r\n</div>\r\n", styles: [".avatar-wrapper{width:100%;height:100%;border-radius:100%;overflow:hidden}.avatar-wrapper img{width:100%;height:100%;object-fit:cover}.avatar-wrapper .avatar-name{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.avatar-wrapper .avatar-name span{font-size:16px;font-weight:bold;color:#fff}.avatar-out-container{width:50px;height:50px;border-radius:50%;overflow:hidden;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}\n"], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4$1.AsyncPipe, "secure": SecurePipe } });
|
|
3091
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
3092
|
+
type: Component,
|
|
2923
3093
|
args: [{
|
|
2924
|
-
|
|
2925
|
-
|
|
3094
|
+
selector: 'cts-avatar',
|
|
3095
|
+
templateUrl: './avatar.component.html',
|
|
3096
|
+
styleUrls: ['./avatar.component.scss']
|
|
2926
3097
|
}]
|
|
2927
|
-
}], ctorParameters: function () { return [
|
|
3098
|
+
}], ctorParameters: function () { return []; }, propDecorators: { user: [{
|
|
3099
|
+
type: Input
|
|
3100
|
+
}] } });
|
|
2928
3101
|
|
|
2929
3102
|
/**
|
|
2930
|
-
* Transforms
|
|
3103
|
+
* Transforms date to localized date string
|
|
2931
3104
|
*
|
|
2932
3105
|
* ### In template example:
|
|
2933
3106
|
* ~~~html
|
|
2934
3107
|
* <!-- in template -->
|
|
2935
|
-
* <p>
|
|
3108
|
+
* <p>
|
|
3109
|
+
* {{ dateObject | localizedDate: "EEEE, MMMM dd, yyyy" }}
|
|
3110
|
+
* </p>
|
|
2936
3111
|
* ~~~
|
|
2937
3112
|
* @title
|
|
2938
|
-
*
|
|
3113
|
+
* Localized Date
|
|
2939
3114
|
*
|
|
2940
3115
|
* @example
|
|
2941
3116
|
* ...
|
|
2942
|
-
* constructor(... private
|
|
2943
|
-
* const
|
|
3117
|
+
* constructor(... private LocalizedDatePipe: localizedDatePipe ...){
|
|
3118
|
+
* const localizedDateString = this.localizedDatePipe.transform(dateObject, 'EEEE, MMMM dd, yyyy');
|
|
2944
3119
|
* }
|
|
2945
3120
|
* ...
|
|
2946
3121
|
*/
|
|
2947
|
-
class
|
|
2948
|
-
constructor() {
|
|
2949
|
-
this.
|
|
3122
|
+
class LocalizedDatePipe {
|
|
3123
|
+
constructor(userPreferenceService) {
|
|
3124
|
+
this.userPreferenceService = userPreferenceService;
|
|
3125
|
+
this.defaultLocale = LocalizedDatePipe.DEFAULT_LOCALE;
|
|
3126
|
+
this.defaultFormat = LocalizedDatePipe.DEFAULT_DATE_FORMAT;
|
|
3127
|
+
this.onDestroy$ = new Subject();
|
|
3128
|
+
if (this.userPreferenceService) {
|
|
3129
|
+
this.userPreferenceService
|
|
3130
|
+
.select(UserPreferenceValues.Locale)
|
|
3131
|
+
.pipe(takeUntil(this.onDestroy$))
|
|
3132
|
+
.subscribe(locale => {
|
|
3133
|
+
if (locale) {
|
|
3134
|
+
this.defaultLocale = locale;
|
|
3135
|
+
}
|
|
3136
|
+
});
|
|
3137
|
+
}
|
|
2950
3138
|
}
|
|
2951
3139
|
/**
|
|
2952
3140
|
*
|
|
2953
|
-
* @param value
|
|
2954
|
-
* @param format
|
|
2955
|
-
* @
|
|
3141
|
+
* @param value date object
|
|
3142
|
+
* @param format format
|
|
3143
|
+
* @param locale locale to convert to
|
|
3144
|
+
* @returns localized date string
|
|
2956
3145
|
*/
|
|
2957
|
-
transform(value, format) {
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
* @title
|
|
2974
|
-
* Pipes Module
|
|
2975
|
-
*/
|
|
2976
|
-
class PipesModule {
|
|
2977
|
-
}
|
|
2978
|
-
PipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2979
|
-
PipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, declarations: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe], imports: [CommonModule], exports: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe] });
|
|
2980
|
-
PipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, providers: [TimeAgoPipe, MultiValuePipe], imports: [[CommonModule]] });
|
|
2981
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, decorators: [{
|
|
2982
|
-
type: NgModule,
|
|
2983
|
-
args: [{
|
|
2984
|
-
declarations: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe],
|
|
2985
|
-
imports: [CommonModule],
|
|
2986
|
-
exports: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe],
|
|
2987
|
-
providers: [TimeAgoPipe, MultiValuePipe],
|
|
2988
|
-
}]
|
|
2989
|
-
}] });
|
|
2990
|
-
|
|
2991
|
-
/**
|
|
2992
|
-
* @title
|
|
2993
|
-
* Avatar Module
|
|
2994
|
-
*/
|
|
2995
|
-
class AvatarModule {
|
|
2996
|
-
}
|
|
2997
|
-
AvatarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2998
|
-
AvatarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, declarations: [AvatarComponent], imports: [CommonModule,
|
|
2999
|
-
PipesModule], exports: [AvatarComponent] });
|
|
3000
|
-
AvatarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, imports: [[
|
|
3001
|
-
CommonModule,
|
|
3002
|
-
PipesModule
|
|
3003
|
-
]] });
|
|
3004
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, decorators: [{
|
|
3005
|
-
type: NgModule,
|
|
3006
|
-
args: [{
|
|
3007
|
-
declarations: [AvatarComponent],
|
|
3008
|
-
imports: [
|
|
3009
|
-
CommonModule,
|
|
3010
|
-
PipesModule
|
|
3011
|
-
],
|
|
3012
|
-
exports: [
|
|
3013
|
-
AvatarComponent
|
|
3014
|
-
]
|
|
3015
|
-
}]
|
|
3016
|
-
}] });
|
|
3017
|
-
|
|
3018
|
-
/**
|
|
3019
|
-
* A reusable card component to display various types of contents
|
|
3020
|
-
*
|
|
3021
|
-
* 
|
|
3022
|
-
* @title
|
|
3023
|
-
* Card
|
|
3024
|
-
* @example
|
|
3025
|
-
*
|
|
3026
|
-
* <app-card>
|
|
3027
|
-
* <h3 class="title">
|
|
3028
|
-
* Card title
|
|
3029
|
-
* </h3>
|
|
3030
|
-
* <div class="my-toolbar">
|
|
3031
|
-
* <button class="btn-primary"> Action Button </button>
|
|
3032
|
-
* </div>
|
|
3033
|
-
* <div class="body">
|
|
3034
|
-
* </div>
|
|
3035
|
-
* </app-card>
|
|
3036
|
-
*/
|
|
3037
|
-
class CardComponent {
|
|
3038
|
-
/** enable/disable shadow */
|
|
3039
|
-
constructor() {
|
|
3040
|
-
/** card has no body */
|
|
3041
|
-
this.noBody = false;
|
|
3042
|
-
/** is card dark */
|
|
3043
|
-
this.dark = false;
|
|
3146
|
+
transform(value, format, locale) {
|
|
3147
|
+
try {
|
|
3148
|
+
const actualFormat = format || this.defaultFormat;
|
|
3149
|
+
const actualLocale = locale || this.defaultLocale;
|
|
3150
|
+
const datePipe = new DatePipe(actualLocale);
|
|
3151
|
+
return datePipe.transform(value, actualFormat, 'GMT+3');
|
|
3152
|
+
}
|
|
3153
|
+
catch (e) {
|
|
3154
|
+
console.warn(e);
|
|
3155
|
+
return value;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
/** @ignore */
|
|
3159
|
+
ngOnDestroy() {
|
|
3160
|
+
this.onDestroy$.next(true);
|
|
3161
|
+
this.onDestroy$.complete();
|
|
3044
3162
|
}
|
|
3045
|
-
ngOnInit() { }
|
|
3046
3163
|
}
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
i0.ɵɵ
|
|
3050
|
-
|
|
3164
|
+
LocalizedDatePipe.DEFAULT_LOCALE = 'en-US';
|
|
3165
|
+
LocalizedDatePipe.DEFAULT_DATE_FORMAT = 'dd MMMM yyyy hh:mm a';
|
|
3166
|
+
LocalizedDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, deps: [{ token: UserPreferencesService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3167
|
+
LocalizedDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, name: "localizedDate", pure: false });
|
|
3168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, decorators: [{
|
|
3169
|
+
type: Pipe,
|
|
3051
3170
|
args: [{
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
styleUrls: ['./card.component.scss'],
|
|
3055
|
-
encapsulation: ViewEncapsulation.None,
|
|
3171
|
+
name: 'localizedDate',
|
|
3172
|
+
pure: false
|
|
3056
3173
|
}]
|
|
3057
|
-
}], ctorParameters: function () { return []; }
|
|
3058
|
-
type: Input
|
|
3059
|
-
}], dark: [{
|
|
3060
|
-
type: Input
|
|
3061
|
-
}] } });
|
|
3174
|
+
}], ctorParameters: function () { return [{ type: UserPreferencesService }]; } });
|
|
3062
3175
|
|
|
3063
3176
|
/**
|
|
3177
|
+
* Transforms html string into safe html to be rendered in the view
|
|
3178
|
+
*
|
|
3179
|
+
* ### In template example:
|
|
3180
|
+
* ~~~html
|
|
3181
|
+
* <!-- in template -->
|
|
3182
|
+
* <span [innerHTML]="htmlString | safeHtml"></span>
|
|
3183
|
+
* ~~~
|
|
3064
3184
|
* @title
|
|
3065
|
-
*
|
|
3185
|
+
* Safe HTML
|
|
3066
3186
|
*/
|
|
3067
|
-
class
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
CardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, declarations: [CardComponent], imports: [CommonModule], exports: [CardComponent] });
|
|
3071
|
-
CardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, providers: [], imports: [[CommonModule]] });
|
|
3072
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, decorators: [{
|
|
3073
|
-
type: NgModule,
|
|
3074
|
-
args: [{
|
|
3075
|
-
declarations: [CardComponent],
|
|
3076
|
-
imports: [CommonModule],
|
|
3077
|
-
exports: [CardComponent],
|
|
3078
|
-
providers: [],
|
|
3079
|
-
}]
|
|
3080
|
-
}] });
|
|
3081
|
-
|
|
3082
|
-
/** @ignore */
|
|
3083
|
-
class ClickOutsideDirective {
|
|
3084
|
-
constructor(elementRef) {
|
|
3085
|
-
this.elementRef = elementRef;
|
|
3086
|
-
this.clickOutside = new EventEmitter();
|
|
3087
|
-
}
|
|
3088
|
-
onClick(target) {
|
|
3089
|
-
const clickedInside = this.elementRef.nativeElement.contains(target);
|
|
3090
|
-
if (!clickedInside) {
|
|
3091
|
-
this.clickOutside.emit(target);
|
|
3092
|
-
}
|
|
3093
|
-
}
|
|
3094
|
-
}
|
|
3095
|
-
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3096
|
-
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "window:click": "onClick($event.target)" } }, ngImport: i0 });
|
|
3097
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
3098
|
-
type: Directive,
|
|
3099
|
-
args: [{
|
|
3100
|
-
selector: '[clickOutside]'
|
|
3101
|
-
}]
|
|
3102
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
|
|
3103
|
-
type: Output
|
|
3104
|
-
}], onClick: [{
|
|
3105
|
-
type: HostListener,
|
|
3106
|
-
args: ['window:click', ['$event.target']]
|
|
3107
|
-
}] } });
|
|
3108
|
-
|
|
3109
|
-
/** @ignore */
|
|
3110
|
-
class SetRtlDirective {
|
|
3111
|
-
constructor(elRef, renderer, translation) {
|
|
3112
|
-
this.elRef = elRef;
|
|
3113
|
-
this.renderer = renderer;
|
|
3114
|
-
this.translation = translation;
|
|
3115
|
-
this.switchClassBasedOnLanguage();
|
|
3187
|
+
class SafeHtmlPipe {
|
|
3188
|
+
constructor(sanitized) {
|
|
3189
|
+
this.sanitized = sanitized;
|
|
3116
3190
|
}
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3191
|
+
/**
|
|
3192
|
+
*
|
|
3193
|
+
* @param value HTML String
|
|
3194
|
+
* @returns Safe HTML
|
|
3195
|
+
*/
|
|
3196
|
+
transform(value) {
|
|
3197
|
+
return this.sanitized.bypassSecurityTrustHtml(value);
|
|
3124
3198
|
}
|
|
3125
3199
|
}
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
3129
|
-
type:
|
|
3130
|
-
args: [{
|
|
3131
|
-
|
|
3132
|
-
}]
|
|
3133
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: TranslationService }]; } });
|
|
3200
|
+
SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i2$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3201
|
+
SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
|
|
3202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, decorators: [{
|
|
3203
|
+
type: Pipe,
|
|
3204
|
+
args: [{ name: 'safeHtml' }]
|
|
3205
|
+
}], ctorParameters: function () { return [{ type: i2$3.DomSanitizer }]; } });
|
|
3134
3206
|
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
this.
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
});
|
|
3156
|
-
// tslint:disable-next-line:member-ordering
|
|
3157
|
-
this.evaluators = {
|
|
3158
|
-
AND: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
3159
|
-
if (!args || args.length === 0) {
|
|
3160
|
-
return false;
|
|
3161
|
-
}
|
|
3162
|
-
return yield this.asyncEvery(args, (arg) => __awaiter(this, void 0, void 0, function* () {
|
|
3163
|
-
const evaluator = yield context.getEvaluator(arg.value);
|
|
3164
|
-
if (!evaluator) {
|
|
3165
|
-
console.warn("evaluator not found: " + arg.value);
|
|
3166
|
-
return false;
|
|
3167
|
-
}
|
|
3168
|
-
return yield evaluator(context, arg.parameters || []);
|
|
3169
|
-
}));
|
|
3170
|
-
}),
|
|
3171
|
-
OR: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
3172
|
-
if (!args || args.length === 0) {
|
|
3173
|
-
return false;
|
|
3174
|
-
}
|
|
3175
|
-
return yield this.asyncSome(args, (arg) => __awaiter(this, void 0, void 0, function* () {
|
|
3176
|
-
const evaluator = yield context.getEvaluator(arg.value);
|
|
3177
|
-
if (!evaluator) {
|
|
3178
|
-
console.warn("evaluator not found: " + arg.value);
|
|
3179
|
-
return false;
|
|
3180
|
-
}
|
|
3181
|
-
const res = yield evaluator(context, arg.parameters || []);
|
|
3182
|
-
return res;
|
|
3183
|
-
}));
|
|
3184
|
-
}),
|
|
3185
|
-
isStatus: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
3186
|
-
if (args.indexOf(context.entity.state) > -1) {
|
|
3187
|
-
return true;
|
|
3188
|
-
}
|
|
3189
|
-
else {
|
|
3190
|
-
return false;
|
|
3191
|
-
}
|
|
3192
|
-
}),
|
|
3193
|
-
isCreator: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
3194
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3195
|
-
//check if user loged in is the creator of that corresp
|
|
3196
|
-
let owner;
|
|
3197
|
-
if ((_b = (_a = context.entity.properties.owner) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.username) {
|
|
3198
|
-
owner = (_d = (_c = context.entity.properties.owner) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.username;
|
|
3199
|
-
}
|
|
3200
|
-
else if ((_f = (_e = context.entity.properties["corr:owner"]) === null || _e === void 0 ? void 0 : _e.properties) === null || _f === void 0 ? void 0 : _f.username) {
|
|
3201
|
-
owner = (_h = (_g = context.entity.properties["corr:owner"]) === null || _g === void 0 ? void 0 : _g.properties) === null || _h === void 0 ? void 0 : _h.username;
|
|
3202
|
-
}
|
|
3203
|
-
else if (context.entity.properties.owner) {
|
|
3204
|
-
owner = context.entity.properties.owner;
|
|
3205
|
-
}
|
|
3206
|
-
else if (context.entity.properties["corr:owner"]) {
|
|
3207
|
-
owner = context.entity.properties["corr:owner"];
|
|
3208
|
-
}
|
|
3209
|
-
if (owner === context.user.properties.username) {
|
|
3210
|
-
return true;
|
|
3211
|
-
}
|
|
3212
|
-
else {
|
|
3213
|
-
return false;
|
|
3214
|
-
}
|
|
3215
|
-
}),
|
|
3216
|
-
isUserInrole: (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
3217
|
-
const result = yield this.nuxeoService
|
|
3218
|
-
.isUserInRole(args, "")
|
|
3219
|
-
.pipe(first())
|
|
3220
|
-
.toPromise();
|
|
3221
|
-
return result;
|
|
3222
|
-
}),
|
|
3223
|
-
};
|
|
3224
|
-
this.getEvaluator = (key) => __awaiter(this, void 0, void 0, function* () {
|
|
3225
|
-
const eva = this.evaluators;
|
|
3226
|
-
if (key && key.startsWith("!")) {
|
|
3227
|
-
const fn = eva[key.substring(1)];
|
|
3228
|
-
return (context, args) => __awaiter(this, void 0, void 0, function* () {
|
|
3229
|
-
const result = yield fn(context, ...args);
|
|
3230
|
-
return !result;
|
|
3231
|
-
});
|
|
3232
|
-
}
|
|
3233
|
-
return eva[key];
|
|
3234
|
-
});
|
|
3235
|
-
this.appConfigService.configLoaded.subscribe((ready) => {
|
|
3236
|
-
if (ready) {
|
|
3237
|
-
this.conditions = this.getAllRules();
|
|
3238
|
-
}
|
|
3239
|
-
});
|
|
3240
|
-
}
|
|
3241
|
-
setEvaluators(evaluators) {
|
|
3242
|
-
this.evaluators = Object.assign(Object.assign({}, this.evaluators), evaluators);
|
|
3243
|
-
}
|
|
3244
|
-
getEvaluators() {
|
|
3245
|
-
return this.evaluators;
|
|
3246
|
-
}
|
|
3247
|
-
// ----------------------------------------------------
|
|
3248
|
-
evaluateRule(ruleId, context) {
|
|
3249
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3250
|
-
const ruleRef = this.getRuleById(ruleId);
|
|
3251
|
-
context = context || this.context;
|
|
3252
|
-
context["getEvaluator"] = this.getEvaluator;
|
|
3253
|
-
if (ruleRef) {
|
|
3254
|
-
const evaluator = yield this.getEvaluator(ruleRef.type);
|
|
3255
|
-
if (evaluator) {
|
|
3256
|
-
return yield evaluator(context, ruleRef.parameters);
|
|
3257
|
-
}
|
|
3258
|
-
}
|
|
3259
|
-
else {
|
|
3260
|
-
const evaluator = yield this.getEvaluator(ruleId);
|
|
3261
|
-
if (evaluator) {
|
|
3262
|
-
return yield evaluator(context);
|
|
3263
|
-
}
|
|
3264
|
-
}
|
|
3207
|
+
/**
|
|
3208
|
+
* Converts date into how long time ago string
|
|
3209
|
+
*
|
|
3210
|
+
* ### In template example:
|
|
3211
|
+
* ~~~html
|
|
3212
|
+
* <!-- in template -->
|
|
3213
|
+
* <span>{{ dateObject | timeAgo }}</span>
|
|
3214
|
+
* ~~~
|
|
3215
|
+
* @title
|
|
3216
|
+
* Time Ago
|
|
3217
|
+
*/
|
|
3218
|
+
class TimeAgoPipe {
|
|
3219
|
+
constructor(userPreferenceService) {
|
|
3220
|
+
this.userPreferenceService = userPreferenceService;
|
|
3221
|
+
this.onDestroy$ = new Subject();
|
|
3222
|
+
this.userPreferenceService
|
|
3223
|
+
.select(UserPreferenceValues.Locale)
|
|
3224
|
+
.pipe(takeUntil(this.onDestroy$))
|
|
3225
|
+
.subscribe(locale => {
|
|
3226
|
+
this.defaultLocale = locale || TimeAgoPipe.DEFAULT_LOCALE;
|
|
3265
3227
|
});
|
|
3228
|
+
this.defaultDateTimeFormat = TimeAgoPipe.DEFAULT_DATE_TIME_FORMAT;
|
|
3266
3229
|
}
|
|
3267
|
-
|
|
3268
|
-
|
|
3230
|
+
/**
|
|
3231
|
+
*
|
|
3232
|
+
* @param value date object
|
|
3233
|
+
* @param locale locale to be transformed to
|
|
3234
|
+
* @returns Time ago string (15 minutes ago)
|
|
3235
|
+
*/
|
|
3236
|
+
transform(value, locale) {
|
|
3237
|
+
if (value !== null && value !== undefined) {
|
|
3238
|
+
const actualLocale = locale || this.defaultLocale;
|
|
3239
|
+
const then = moment$5(value);
|
|
3240
|
+
//const diff = moment().locale(actualLocale).diff(then, 'days');
|
|
3241
|
+
return then.locale(actualLocale).fromNow();
|
|
3242
|
+
// if ( diff > 7) {
|
|
3243
|
+
// const datePipe: DatePipe = new DatePipe(actualLocale);
|
|
3244
|
+
// return datePipe.transform(value, this.defaultDateTimeFormat);
|
|
3245
|
+
// } else {
|
|
3246
|
+
// return then.locale(actualLocale).fromNow();
|
|
3247
|
+
// }
|
|
3248
|
+
}
|
|
3249
|
+
return '';
|
|
3269
3250
|
}
|
|
3270
|
-
|
|
3271
|
-
|
|
3251
|
+
/** @ignore */
|
|
3252
|
+
ngOnDestroy() {
|
|
3253
|
+
this.onDestroy$.next(true);
|
|
3254
|
+
this.onDestroy$.complete();
|
|
3272
3255
|
}
|
|
3273
3256
|
}
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
i0.ɵɵ
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3257
|
+
TimeAgoPipe.DEFAULT_LOCALE = 'en-US';
|
|
3258
|
+
TimeAgoPipe.DEFAULT_DATE_TIME_FORMAT = 'dd/MM/yyyy HH:mm';
|
|
3259
|
+
TimeAgoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, deps: [{ token: UserPreferencesService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3260
|
+
TimeAgoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, name: "timeAgo" });
|
|
3261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, decorators: [{
|
|
3262
|
+
type: Pipe,
|
|
3263
|
+
args: [{
|
|
3264
|
+
name: 'timeAgo'
|
|
3265
|
+
}]
|
|
3266
|
+
}], ctorParameters: function () { return [{ type: UserPreferencesService }]; } });
|
|
3280
3267
|
|
|
3281
3268
|
/**
|
|
3282
|
-
*
|
|
3283
|
-
*
|
|
3284
|
-
*
|
|
3285
|
-
*
|
|
3286
|
-
*
|
|
3269
|
+
* Transforms array of strings to single string seperated with seperator
|
|
3270
|
+
*
|
|
3271
|
+
* ### In template example:
|
|
3272
|
+
* ~~~html
|
|
3273
|
+
* <!-- in template -->
|
|
3274
|
+
* <p>{{ ['string 1','string 2', 'string 3'] | multiValue : {valueSeparator:', '}}}</p>
|
|
3275
|
+
* ~~~
|
|
3276
|
+
* @title
|
|
3277
|
+
* Multi Value
|
|
3278
|
+
*
|
|
3287
3279
|
* @example
|
|
3288
|
-
*
|
|
3289
|
-
*
|
|
3290
|
-
*
|
|
3291
|
-
*
|
|
3292
|
-
*
|
|
3293
|
-
|
|
3280
|
+
* ...
|
|
3281
|
+
* constructor(... private MultiValuePipe: multiValuePipe ...){
|
|
3282
|
+
* const MultiValueString = this.multiValuePipe.transform(['string 1','string 2', 'string 3'], ', ');
|
|
3283
|
+
* }
|
|
3284
|
+
* ...
|
|
3285
|
+
*/
|
|
3286
|
+
class MultiValuePipe {
|
|
3287
|
+
/**
|
|
3288
|
+
*
|
|
3289
|
+
* @param values array of strings
|
|
3290
|
+
* @param valueSeparator seperator to place between elements
|
|
3291
|
+
* @returns the joining of all array items seperated with seperator
|
|
3292
|
+
*/
|
|
3293
|
+
transform(values, valueSeparator = MultiValuePipe.DEFAULT_SEPARATOR) {
|
|
3294
|
+
if (values && values instanceof Array) {
|
|
3295
|
+
return values.join(valueSeparator);
|
|
3296
|
+
}
|
|
3297
|
+
return values;
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
MultiValuePipe.DEFAULT_SEPARATOR = ', ';
|
|
3301
|
+
MultiValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3302
|
+
MultiValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, name: "multiValue" });
|
|
3303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, decorators: [{
|
|
3304
|
+
type: Pipe,
|
|
3305
|
+
args: [{ name: 'multiValue' }]
|
|
3306
|
+
}] });
|
|
3307
|
+
|
|
3308
|
+
/**
|
|
3309
|
+
* transforms file size into translated appropriate units
|
|
3310
|
+
*
|
|
3311
|
+
* ### In template example:
|
|
3312
|
+
* ~~~html
|
|
3313
|
+
* <!-- in template -->
|
|
3314
|
+
* <p>{{ file.sizeInBytes | FileSize}}</p>
|
|
3315
|
+
* ~~~
|
|
3294
3316
|
* @title
|
|
3295
|
-
*
|
|
3317
|
+
* File Size
|
|
3318
|
+
*
|
|
3319
|
+
* @example
|
|
3320
|
+
* ...
|
|
3321
|
+
* constructor(... private FileSizePipe: fileSizePiple ...){
|
|
3322
|
+
* const sizeString = this.fileSizePiple.transform(sizeInBytes);
|
|
3323
|
+
* }
|
|
3324
|
+
* ...
|
|
3296
3325
|
*/
|
|
3297
|
-
class
|
|
3298
|
-
constructor(
|
|
3299
|
-
this.
|
|
3300
|
-
this.eltRef = eltRef;
|
|
3301
|
-
this.viewContainerRef = viewContainerRef;
|
|
3302
|
-
this.templateRef = templateRef;
|
|
3303
|
-
this.appConfigService = appConfigService;
|
|
3304
|
-
this.evaluatorsService = evaluatorsService;
|
|
3305
|
-
this.isVisible = false;
|
|
3306
|
-
this.context = { entity: null, getEvaluator: null, user: null };
|
|
3326
|
+
class FileSizePipe {
|
|
3327
|
+
constructor(translation) {
|
|
3328
|
+
this.translation = translation;
|
|
3307
3329
|
}
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3330
|
+
/**
|
|
3331
|
+
*
|
|
3332
|
+
* @param paramByte Size in Bytes
|
|
3333
|
+
* @optional @param decimals Decimals to show
|
|
3334
|
+
* @returns translated size string
|
|
3335
|
+
*/
|
|
3336
|
+
transform(paramByte, decimals = 2) {
|
|
3337
|
+
if (paramByte == null) {
|
|
3338
|
+
return '';
|
|
3315
3339
|
}
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
this.isVisible = true;
|
|
3323
|
-
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
3324
|
-
}
|
|
3325
|
-
}
|
|
3326
|
-
else {
|
|
3327
|
-
this.isVisible = false;
|
|
3328
|
-
this.viewContainerRef.clear();
|
|
3329
|
-
}
|
|
3330
|
-
});
|
|
3340
|
+
const bytes = parseInt(paramByte, 10);
|
|
3341
|
+
if (isNaN(bytes)) {
|
|
3342
|
+
return '';
|
|
3343
|
+
}
|
|
3344
|
+
if (bytes === 0) {
|
|
3345
|
+
return '0 ' + this.translation.instant('FILE_SIZE.BYTES');
|
|
3331
3346
|
}
|
|
3347
|
+
const k = 1024, dm = decimals || 2, sizes = ['BYTES', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3348
|
+
const i18nSize = this.translation.instant(`FILE_SIZE.${sizes[i]}`);
|
|
3349
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + i18nSize;
|
|
3332
3350
|
}
|
|
3333
3351
|
}
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
3337
|
-
type:
|
|
3352
|
+
FileSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, deps: [{ token: TranslationService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3353
|
+
FileSizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, name: "FileSize", pure: false });
|
|
3354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, decorators: [{
|
|
3355
|
+
type: Pipe,
|
|
3338
3356
|
args: [{
|
|
3339
|
-
|
|
3357
|
+
name: 'FileSize',
|
|
3358
|
+
pure: false
|
|
3340
3359
|
}]
|
|
3341
|
-
}], ctorParameters: function () { return [{ type:
|
|
3342
|
-
type: Input
|
|
3343
|
-
}] } });
|
|
3360
|
+
}], ctorParameters: function () { return [{ type: TranslationService }]; } });
|
|
3344
3361
|
|
|
3345
|
-
/**
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3362
|
+
/**
|
|
3363
|
+
* Transforms and formats date into hijri
|
|
3364
|
+
*
|
|
3365
|
+
* ### In template example:
|
|
3366
|
+
* ~~~html
|
|
3367
|
+
* <!-- in template -->
|
|
3368
|
+
* <p>{{ dateObject | hijriDate : {format:'iYYYY iMMMM iD'}}}</p>
|
|
3369
|
+
* ~~~
|
|
3370
|
+
* @title
|
|
3371
|
+
* Hijri Date
|
|
3372
|
+
*
|
|
3373
|
+
* @example
|
|
3374
|
+
* ...
|
|
3375
|
+
* constructor(... private HijriDatePipe: hijriDatePipe ...){
|
|
3376
|
+
* const formattedHijriDate = this.hijriDatePipe.transform(dateObject, 'iYYYY iMMMM iD');
|
|
3377
|
+
* }
|
|
3378
|
+
* ...
|
|
3379
|
+
*/
|
|
3380
|
+
class HijriDatePipe {
|
|
3381
|
+
constructor() {
|
|
3382
|
+
this.defaultFormat = "iYYYY iMMMM iD";
|
|
3352
3383
|
}
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3384
|
+
/**
|
|
3385
|
+
*
|
|
3386
|
+
* @param value Date object
|
|
3387
|
+
* @param format Format
|
|
3388
|
+
* @returns formatted hijri date string
|
|
3389
|
+
*/
|
|
3390
|
+
transform(value, format) {
|
|
3391
|
+
const actualFormat = format || this.defaultFormat;
|
|
3392
|
+
const m = moment_(value, 'iYYYY/iM/iD'); // Parse a Hijri date.
|
|
3393
|
+
return m.format("iD iMMMM iYYYY");
|
|
3359
3394
|
}
|
|
3360
3395
|
}
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
3364
|
-
type:
|
|
3396
|
+
HijriDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3397
|
+
HijriDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, name: "hijriDate" });
|
|
3398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, decorators: [{
|
|
3399
|
+
type: Pipe,
|
|
3400
|
+
args: [{
|
|
3401
|
+
name: 'hijriDate'
|
|
3402
|
+
}]
|
|
3403
|
+
}] });
|
|
3404
|
+
|
|
3405
|
+
/**
|
|
3406
|
+
* @title
|
|
3407
|
+
* Pipes Module
|
|
3408
|
+
*/
|
|
3409
|
+
class PipesModule {
|
|
3410
|
+
}
|
|
3411
|
+
PipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3412
|
+
PipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, declarations: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe], imports: [CommonModule], exports: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe] });
|
|
3413
|
+
PipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, providers: [TimeAgoPipe, MultiValuePipe], imports: [[CommonModule]] });
|
|
3414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, decorators: [{
|
|
3415
|
+
type: NgModule,
|
|
3365
3416
|
args: [{
|
|
3366
|
-
|
|
3417
|
+
declarations: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe],
|
|
3418
|
+
imports: [CommonModule],
|
|
3419
|
+
exports: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe],
|
|
3420
|
+
providers: [TimeAgoPipe, MultiValuePipe],
|
|
3367
3421
|
}]
|
|
3368
|
-
}]
|
|
3422
|
+
}] });
|
|
3369
3423
|
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
this.stop$ = new Subject();
|
|
3376
|
-
this.isVisible = false;
|
|
3377
|
-
}
|
|
3378
|
-
ngOnInit() {
|
|
3379
|
-
var _a;
|
|
3380
|
-
if ((_a = this.appHasRole) === null || _a === void 0 ? void 0 : _a.role) {
|
|
3381
|
-
this.nuxeoService.isUserInRole(this.appHasRole.role, this.appHasRole.code).subscribe(data => {
|
|
3382
|
-
if (data || !this.appHasRole) {
|
|
3383
|
-
// If it is already visible (which can happen if
|
|
3384
|
-
// his roles changed) we do not need to add it a second time
|
|
3385
|
-
if (!this.isVisible) {
|
|
3386
|
-
// We update the `isVisible` property and add the
|
|
3387
|
-
// templateRef to the view using the
|
|
3388
|
-
// 'createEmbeddedView' method of the viewContainerRef
|
|
3389
|
-
this.isVisible = true;
|
|
3390
|
-
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
3391
|
-
}
|
|
3392
|
-
}
|
|
3393
|
-
else {
|
|
3394
|
-
// If the user does not have the role,
|
|
3395
|
-
// we update the `isVisible` property and clear
|
|
3396
|
-
// the contents of the viewContainerRef
|
|
3397
|
-
this.isVisible = false;
|
|
3398
|
-
this.viewContainerRef.clear();
|
|
3399
|
-
}
|
|
3400
|
-
});
|
|
3401
|
-
}
|
|
3402
|
-
else {
|
|
3403
|
-
if (!this.isVisible) {
|
|
3404
|
-
// We update the `isVisible` property and add the
|
|
3405
|
-
// templateRef to the view using the
|
|
3406
|
-
// 'createEmbeddedView' method of the viewContainerRef
|
|
3407
|
-
this.isVisible = true;
|
|
3408
|
-
this.viewContainerRef.createEmbeddedView(this.templateRef);
|
|
3409
|
-
}
|
|
3410
|
-
}
|
|
3411
|
-
}
|
|
3412
|
-
ngOnChanges() {
|
|
3413
|
-
this.ngOnInit();
|
|
3414
|
-
}
|
|
3424
|
+
/**
|
|
3425
|
+
* @title
|
|
3426
|
+
* Avatar Module
|
|
3427
|
+
*/
|
|
3428
|
+
class AvatarModule {
|
|
3415
3429
|
}
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3430
|
+
AvatarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3431
|
+
AvatarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, declarations: [AvatarComponent], imports: [CommonModule,
|
|
3432
|
+
PipesModule], exports: [AvatarComponent] });
|
|
3433
|
+
AvatarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, imports: [[
|
|
3434
|
+
CommonModule,
|
|
3435
|
+
PipesModule
|
|
3436
|
+
]] });
|
|
3437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, decorators: [{
|
|
3438
|
+
type: NgModule,
|
|
3420
3439
|
args: [{
|
|
3421
|
-
|
|
3440
|
+
declarations: [AvatarComponent],
|
|
3441
|
+
imports: [
|
|
3442
|
+
CommonModule,
|
|
3443
|
+
PipesModule
|
|
3444
|
+
],
|
|
3445
|
+
exports: [
|
|
3446
|
+
AvatarComponent
|
|
3447
|
+
]
|
|
3422
3448
|
}]
|
|
3423
|
-
}]
|
|
3424
|
-
type: Input
|
|
3425
|
-
}] } });
|
|
3449
|
+
}] });
|
|
3426
3450
|
|
|
3427
|
-
|
|
3451
|
+
/**
|
|
3452
|
+
* A reusable card component to display various types of contents
|
|
3453
|
+
*
|
|
3454
|
+
* 
|
|
3455
|
+
* @title
|
|
3456
|
+
* Card
|
|
3457
|
+
* @example
|
|
3458
|
+
*
|
|
3459
|
+
* <app-card>
|
|
3460
|
+
* <h3 class="title">
|
|
3461
|
+
* Card title
|
|
3462
|
+
* </h3>
|
|
3463
|
+
* <div class="my-toolbar">
|
|
3464
|
+
* <button class="btn-primary"> Action Button </button>
|
|
3465
|
+
* </div>
|
|
3466
|
+
* <div class="body">
|
|
3467
|
+
* </div>
|
|
3468
|
+
* </app-card>
|
|
3469
|
+
*/
|
|
3470
|
+
class CardComponent {
|
|
3471
|
+
/** enable/disable shadow */
|
|
3428
3472
|
constructor() {
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
evt.stopPropagation();
|
|
3434
|
-
}
|
|
3435
|
-
onDragLeave(evt) {
|
|
3436
|
-
evt.preventDefault();
|
|
3437
|
-
evt.stopPropagation();
|
|
3438
|
-
}
|
|
3439
|
-
onDrop(evt) {
|
|
3440
|
-
let files = [];
|
|
3441
|
-
evt.preventDefault();
|
|
3442
|
-
evt.stopPropagation();
|
|
3443
|
-
if (evt.dataTransfer.files.length) {
|
|
3444
|
-
for (const file of evt.dataTransfer.files) {
|
|
3445
|
-
files.push(file);
|
|
3446
|
-
}
|
|
3447
|
-
this.fileDroped.emit(files);
|
|
3448
|
-
}
|
|
3473
|
+
/** card has no body */
|
|
3474
|
+
this.noBody = false;
|
|
3475
|
+
/** is card dark */
|
|
3476
|
+
this.dark = false;
|
|
3449
3477
|
}
|
|
3478
|
+
ngOnInit() { }
|
|
3450
3479
|
}
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
3454
|
-
type:
|
|
3480
|
+
CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3481
|
+
CardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CardComponent, selector: "app-card", inputs: { noBody: "noBody", dark: "dark" }, ngImport: i0, template: "<div\r\n class=\"app-card\"\r\n [ngClass]=\"{\r\n 'dark-app-card ': dark\r\n }\"\r\n>\r\n <div class=\"card-inner\">\r\n <div\r\n [ngClass]=\"{\r\n hidden: title.childNodes.length == 0 && toolbar.childNodes.length == 0\r\n }\"\r\n class=\"card-title\"\r\n >\r\n <div class=\"title-padder\">\r\n <!-- title Area -->\r\n <span #title>\r\n <ng-content select=\".title\"></ng-content>\r\n </span>\r\n <!-- toolbar Area -->\r\n <div class=\"my-toolbar\" #toolbar>\r\n <ng-content select=\".my-toolbar\"></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- body area -->\r\n <div class=\"card-body\" *ngIf=\"!noBody\">\r\n <ng-content select=\".body\"></ng-content>\r\n </div>\r\n <div class=\"no-items\">\r\n <p class=\"message\">\r\n <ng-content select=\".no-content\"></ng-content>\r\n </p>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".bi{margin:0!important}.memo-sorting-wrapper{width:265px;margin:0 10px;height:100%;display:flex}.memo-sorting-wrapper .sorting-direction{width:65px;height:40px;background-color:#465573;color:#fff;font-size:20px;display:flex;justify-content:center;align-items:center;cursor:pointer}.memo-sorting-wrapper .memo-sorting-trigger{width:calc(100% - 65px);height:100%;background-color:transparent;border:1px solid lightgrey;display:flex;justify-content:space-between;align-items:center;padding:0 15px;font-size:14px}.memo-sorting-wrapper .memo-sorting-trigger i{font-size:16px;color:gray}.memo-sorting-menu{width:200px}.my-button{border:1px solid #465573;color:#465573;border-radius:5px;background-color:transparent;font-weight:bold;min-width:80px;height:40px}.my-button.reset{border:none}.my-button:hover{color:#fff;background-color:#465573}.my-button:hover.reset{color:#465573;border:1px solid #465573;background-color:#fff}.app-property-value .app-input-wrapper label{color:#646f85;font-size:13px;margin-bottom:5px}.app-property-value .app-input-wrapper label .text-danger{font-size:16px;line-height:14px;margin:0 5px!important}.app-property-value .app-input-wrapper .form-control{border:1px solid #ccc;border-radius:5px;background-color:#8f98aa1a;height:40px}.app-property-value .app-input-wrapper .form-control:disabled{background-color:#e9ecef!important}.app-property-value .app-input-wrapper .form-control:focus{border:1px solid #1a96c6;box-shadow:0 0 4px #79c3c26b!important}.app-property-value .app-input-wrapper .app-textitem-editable-error .error-containers{list-style:none;padding:0;margin:0;font-size:14px}.app-property-value .app-input-wrapper .app-textitem-editable-error .error-containers .error{margin-top:5px}.autocomplete-container .input-container input:focus,hijri-gregorian-datepicker .form-group .input-group .form-control:focus,.ng-select.ng-select-focused .ng-select-container{border:1px solid #1a96c6!important;box-shadow:0 0 4px #79c3c26b!important}input::placeholder{font-size:12px}.form-control:focus{box-shadow:none!important}.mat-stepper-horizontal{margin-top:-25px}.mat-stepper-horizontal .mat-horizontal-stepper-header-container .mat-step-header.cdk-program-focused{background-color:transparent}.mat-stepper-horizontal .mat-horizontal-stepper-header-container .mat-step-header .mat-step-icon-selected{background-color:transparent;color:#fff;background-image:linear-gradient(to right,#0dbab5,#1a96c6)}@media only screen and (max-width: 576px){.mat-stepper-horizontal .mat-horizontal-stepper-header-container .mat-step-header .mat-step-label .mat-step-text-label{white-space:pre-wrap;overflow:visible}}.mat-stepper-horizontal .mat-horizontal-content-container{overflow:visible}@media only screen and (max-width: 768px){.mat-stepper-horizontal .mat-horizontal-content-container{padding:0 0 24px}}.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:first-child:after,.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:last-child:before{display:none}.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:first-child:before{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;width:calc(50% - 20px);left:0}.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:last-child:after{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;width:calc(50% - 20px);right:0}.form-wrapper{padding:30px 15px;border:1px solid #dde0e2}.form-wrapper .buttons-wrapper{display:flex;justify-content:space-between}.form-wrapper .buttons-wrapper .action-buttons-wrapper{display:flex}.form-wrapper .buttons-wrapper button{background-image:linear-gradient(to right,#0dbab5,#1a96c6);height:40px;color:#fff;border:none;width:125px;margin-top:20px;border-radius:5px}.form-wrapper .buttons-wrapper button:disabled{opacity:.4;cursor:not-allowed}.form-wrapper .buttons-wrapper button:hover{opacity:.7}.form-wrapper .upload-wrapper{display:flex;flex-direction:column;justify-content:flex-end}.form-wrapper .upload-wrapper label{color:#8f98aa;font-size:14px}.form-wrapper .upload-wrapper button{padding:10px;border:1px solid lightgray}.form-wrapper .upload-wrapper button span{margin:0 10px}.renameFileComponent .form-wrapper{padding:30px 15px;border:none!important}.renameFileComponent .form-wrapper .buttons-wrapper{display:flex;justify-content:space-between}.renameFileComponent .form-wrapper .buttons-wrapper .action-buttons-wrapper{display:flex}.renameFileComponent .form-wrapper .buttons-wrapper button{background-image:linear-gradient(to right,#0dbab5,#1a96c6);height:40px;color:#fff;border:none;width:125px;margin-top:20px;border-radius:5px}.renameFileComponent .form-wrapper .buttons-wrapper button:disabled{opacity:.4;cursor:not-allowed}.renameFileComponent .form-wrapper .buttons-wrapper button:hover{opacity:.7}.renameFileComponent .form-wrapper .upload-wrapper{display:flex;flex-direction:column;justify-content:flex-end}.renameFileComponent .form-wrapper .upload-wrapper label{color:#8f98aa;font-size:14px}.renameFileComponent .form-wrapper .upload-wrapper button{padding:10px;border:1px solid lightgray}.renameFileComponent .form-wrapper .upload-wrapper button span{margin:0 10px}.my-dynamic-viewer{display:flex;align-items:center;font-size:12px;min-height:30px}.my-dynamic-viewer .my-label{font-size:12px;font-weight:500;width:150px;word-break:break-word}@media (max-width: 992px){.my-dynamic-viewer .my-label{width:50%}}.my-dynamic-viewer .my-value{width:calc(100% - 150px);word-break:break-word}@media (max-width: 992px){.my-dynamic-viewer .my-value{width:50%}}.my-dynamic-viewer .direction-img{font-size:14px}.my-dynamic-viewer .direction-img .incoming{display:none}.my-dynamic-viewer .direction-img .outgoing{display:none}.my-dynamic-viewer .direction-img .internal{display:none}.my-dynamic-viewer.draft .my-value{color:#596973}.my-dynamic-viewer.inProgress .my-value{color:#3c3cf0}.my-dynamic-viewer.registered .my-value{color:#4f008c}.my-dynamic-viewer.archived .my-value{color:#fbb62c}.my-dynamic-viewer.closed .my-value{color:#00dca5}.my-dynamic-viewer.approved .my-value{color:#06a57e}.my-dynamic-viewer.assigned .my-value{color:#fd6670}.my-dynamic-viewer.sent .my-value{color:#3c3cf0}.my-dynamic-viewer.published .my-value{color:#00dca5}.my-dynamic-viewer.Outgoing .my-value{display:flex}.my-dynamic-viewer.Outgoing .my-value .direction-img .outgoing{color:#fbb62c;margin:1px 5px;display:flex}.my-dynamic-viewer.Outgoing .my-value .text{margin:0 5px}.my-dynamic-viewer.Internal .my-value{display:flex}.my-dynamic-viewer.Internal .my-value .direction-img .internal{color:#3c3cf0;margin:1px 5px;display:flex}.my-dynamic-viewer.Internal .my-value .text{margin:0 5px}.my-dynamic-viewer.Incoming .my-value{display:flex}.my-dynamic-viewer.Incoming .my-value .direction-img .incoming{color:#00dca5;display:flex}.my-dynamic-viewer.Incoming .my-value .text{margin:-3px 5px 0}.my-dynamic-viewer.vertical{display:block}.my-dynamic-viewer.vertical .my-label{width:auto}.my-dynamic-viewer.vertical .my-value{width:auto}.my-dynamic-viewer.with-out-label{width:100%!important}.app-card{border-radius:5px;display:flex;flex-direction:column;background:#ffffff;position:relative;padding:24px 0 0}.app-card .card-inner{display:flex;flex-direction:column}.card-title{height:auto;border:0px solid;border-color:#465573;color:#465573;border-inline-start-width:8px}.card-title h1,.card-title h2,.card-title h3,.card-title h4,.card-title h5,.card-title h6,.card-title span,.card-title p{font-size:18px}.title-padder{padding:0 24px;display:flex;align-items:center;justify-content:space-between}.dark-app-card{background:#465573}.dark-app-card .card-title{border-color:#fff;color:#fff}.my-toolbar{display:flex}.my-toolbar .add-button{border-radius:5px;width:65px;height:40px;background-color:#465573;color:#fff;font-size:20px;display:flex;justify-content:center;align-items:center}.my-toolbar .add-button .icon{font-size:30px;font-weight:bold}.my-toolbar .add-button .edit{font-size:25px}.no-items{display:flex;justify-content:center}.no-items .message{text-align:center;color:#b4bac6;font-size:20px}\n"], directives: [{ type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardComponent, decorators: [{
|
|
3483
|
+
type: Component,
|
|
3455
3484
|
args: [{
|
|
3456
|
-
selector: '
|
|
3485
|
+
selector: 'app-card',
|
|
3486
|
+
templateUrl: './card.component.html',
|
|
3487
|
+
styleUrls: ['./card.component.scss'],
|
|
3488
|
+
encapsulation: ViewEncapsulation.None,
|
|
3457
3489
|
}]
|
|
3458
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
3459
|
-
type:
|
|
3460
|
-
}],
|
|
3461
|
-
type:
|
|
3462
|
-
args: ['dragover', ['$event']]
|
|
3463
|
-
}], onDragLeave: [{
|
|
3464
|
-
type: HostListener,
|
|
3465
|
-
args: ['dragleave', ['$event']]
|
|
3466
|
-
}], onDrop: [{
|
|
3467
|
-
type: HostListener,
|
|
3468
|
-
args: ['drop', ['$event']]
|
|
3490
|
+
}], ctorParameters: function () { return []; }, propDecorators: { noBody: [{
|
|
3491
|
+
type: Input
|
|
3492
|
+
}], dark: [{
|
|
3493
|
+
type: Input
|
|
3469
3494
|
}] } });
|
|
3470
3495
|
|
|
3471
3496
|
/**
|
|
3472
3497
|
* @title
|
|
3473
|
-
*
|
|
3498
|
+
* Card Module
|
|
3474
3499
|
*/
|
|
3475
|
-
class
|
|
3500
|
+
class CardModule {
|
|
3476
3501
|
}
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
SetDirRtlDirective,
|
|
3482
|
-
AppHasRoleDirective,
|
|
3483
|
-
DragAndDropDirective], imports: [CommonModule], exports: [ClickOutsideDirective,
|
|
3484
|
-
SetRtlDirective,
|
|
3485
|
-
PermissionsDirective,
|
|
3486
|
-
SetDirRtlDirective,
|
|
3487
|
-
AppHasRoleDirective,
|
|
3488
|
-
DragAndDropDirective] });
|
|
3489
|
-
DirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, providers: [], imports: [[CommonModule]] });
|
|
3490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, decorators: [{
|
|
3502
|
+
CardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3503
|
+
CardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, declarations: [CardComponent], imports: [CommonModule], exports: [CardComponent] });
|
|
3504
|
+
CardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, providers: [], imports: [[CommonModule]] });
|
|
3505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, decorators: [{
|
|
3491
3506
|
type: NgModule,
|
|
3492
3507
|
args: [{
|
|
3493
|
-
declarations: [
|
|
3494
|
-
ClickOutsideDirective,
|
|
3495
|
-
SetRtlDirective,
|
|
3496
|
-
PermissionsDirective,
|
|
3497
|
-
SetDirRtlDirective,
|
|
3498
|
-
AppHasRoleDirective,
|
|
3499
|
-
DragAndDropDirective
|
|
3500
|
-
],
|
|
3508
|
+
declarations: [CardComponent],
|
|
3501
3509
|
imports: [CommonModule],
|
|
3502
|
-
exports: [
|
|
3503
|
-
|
|
3504
|
-
SetRtlDirective,
|
|
3505
|
-
PermissionsDirective,
|
|
3506
|
-
SetDirRtlDirective,
|
|
3507
|
-
AppHasRoleDirective,
|
|
3508
|
-
DragAndDropDirective
|
|
3509
|
-
],
|
|
3510
|
-
providers: []
|
|
3510
|
+
exports: [CardComponent],
|
|
3511
|
+
providers: [],
|
|
3511
3512
|
}]
|
|
3512
3513
|
}] });
|
|
3513
3514
|
|
|
@@ -28546,54 +28547,6 @@ const createDiagramEditor = (container, injector, config) => __awaiter(void 0, v
|
|
|
28546
28547
|
};
|
|
28547
28548
|
});
|
|
28548
28549
|
|
|
28549
|
-
function serializePort(port) {
|
|
28550
|
-
return {
|
|
28551
|
-
id: port.id,
|
|
28552
|
-
label: port.label,
|
|
28553
|
-
socket: {
|
|
28554
|
-
name: port.socket.name,
|
|
28555
|
-
},
|
|
28556
|
-
};
|
|
28557
|
-
}
|
|
28558
|
-
function serializeControl(control) {
|
|
28559
|
-
if (control instanceof ClassicPreset.InputControl) {
|
|
28560
|
-
return {
|
|
28561
|
-
__type: 'ClassicPreset.InputControl',
|
|
28562
|
-
id: control.id,
|
|
28563
|
-
readonly: control.readonly,
|
|
28564
|
-
type: control.type,
|
|
28565
|
-
value: control.value,
|
|
28566
|
-
};
|
|
28567
|
-
}
|
|
28568
|
-
return null;
|
|
28569
|
-
}
|
|
28570
|
-
|
|
28571
|
-
function exportGraph(editor) {
|
|
28572
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28573
|
-
const data = { nodes: [] };
|
|
28574
|
-
const nodes = editor.getNodes();
|
|
28575
|
-
for (const node of nodes) {
|
|
28576
|
-
const inputsEntries = Object.entries(node.inputs).map(([key, input]) => {
|
|
28577
|
-
return [key, input && serializePort(input)];
|
|
28578
|
-
});
|
|
28579
|
-
const outputsEntries = Object.entries(node.outputs).map(([key, output]) => {
|
|
28580
|
-
return [key, output && serializePort(output)];
|
|
28581
|
-
});
|
|
28582
|
-
const controlsEntries = Object.entries(node.controls).map(([key, control]) => {
|
|
28583
|
-
return [key, control && serializeControl(control)];
|
|
28584
|
-
});
|
|
28585
|
-
// data.nodes.push({
|
|
28586
|
-
// id: node.id,
|
|
28587
|
-
// label: node.label,
|
|
28588
|
-
// outputs: Object.fromEntries(outputsEntries),
|
|
28589
|
-
// inputs: Object.fromEntries(inputsEntries),
|
|
28590
|
-
// controls: Object.fromEntries(controlsEntries),
|
|
28591
|
-
// });
|
|
28592
|
-
}
|
|
28593
|
-
return data;
|
|
28594
|
-
});
|
|
28595
|
-
}
|
|
28596
|
-
|
|
28597
28550
|
/**
|
|
28598
28551
|
*
|
|
28599
28552
|
* @param node
|
|
@@ -28686,6 +28639,28 @@ const _updateConnections = (outputs, inputs, editor) => __awaiter(void 0, void 0
|
|
|
28686
28639
|
yield editor.addConnection(connection);
|
|
28687
28640
|
});
|
|
28688
28641
|
|
|
28642
|
+
function serializePort(port) {
|
|
28643
|
+
return {
|
|
28644
|
+
id: port.id,
|
|
28645
|
+
label: port.label,
|
|
28646
|
+
socket: {
|
|
28647
|
+
name: port.socket.name,
|
|
28648
|
+
},
|
|
28649
|
+
};
|
|
28650
|
+
}
|
|
28651
|
+
function serializeControl(control) {
|
|
28652
|
+
if (control instanceof ClassicPreset.InputControl) {
|
|
28653
|
+
return {
|
|
28654
|
+
__type: 'ClassicPreset.InputControl',
|
|
28655
|
+
id: control.id,
|
|
28656
|
+
readonly: control.readonly,
|
|
28657
|
+
type: control.type,
|
|
28658
|
+
value: control.value,
|
|
28659
|
+
};
|
|
28660
|
+
}
|
|
28661
|
+
return null;
|
|
28662
|
+
}
|
|
28663
|
+
|
|
28689
28664
|
class DiagramService {
|
|
28690
28665
|
/**
|
|
28691
28666
|
*
|
|
@@ -31734,5 +31709,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
31734
31709
|
* Generated bundle index. Do not edit.
|
|
31735
31710
|
*/
|
|
31736
31711
|
|
|
31737
|
-
export { ActivitiesLogComponent, ActivitiesLogModule, ActivityLineComponent, AdapterService, AddPermissionsDialogComponent, AddToCollectionComponent, AppConfigService, AppHasRoleDirective, AttachmentItemComponent, AttachmentItemModule, AttachmentModalModule, AttachmentsComponent, AttachmentsListComponent, AttachmentsPageProviderComponent, AvatarComponent, AvatarModule, BaseColumnComponent, BaseComponent, BaseDialogComponent, BaseNodeClass, BaseSelector, BaseService, BooleanViewerComponent, ButtonComponent, CachingExpiryUnit, CallApiService, CardComponent, CardModule, ChartDataService, CircleNode, CircleNodeComponent, ClickOutsideDirective, ClipboardComponent, CommentApiService, CommentsDashletComponent, CommentsModule, ComponentRegisterService, ComponentTranslationModel, ConfirmCallerDialogComponent, ConfirmCallerModule, ConfirmDialogComponent, ConfirmationDialogComponent, ConfirmationDialogModule, Connection, ContentActionType, ContentNode, ContentNodeComponent, CopyComponent, CorrespondenceRelationComponent, CorrespondenceRelationModule, CorrespondenceRelationService, CorrespondenceTagsComponent, CreateDirectoryComponent, CreateEntityComponent, CreateEntityModule, CreateModalComponent, CreationTypeComponent, CtsTagsModule, CustomConnectionComponent, CustomDocumentViewerComponent, CustomPpViewerComponent, CustomSocketComponent, CustomToastrModule, CustomToastrService, CutomeVocViewerComponent, DIAGRAM_DEFAULT_OPTIONS, DIAGRAM_HEIGHT, DataViewerComponent, DateFormatterService, DateHelperService, DateViewerComponent, DeleteComponent, DepartmentApiService, DepartmentFormComponent, DepartmentManagementService, DepartmentViewerComponent, DestroySubject$1 as DestroySubject, DiagramDirective, DiagramPluginsService, DiagramService, DiagramsModule, DialogMangmentService, DirectiveModule, DisplaySuitableIconComponent, DisplaySuitableIconModule, DocumentScanService, DocumentTemplatesConstants, DocumentTemplatesService, DocumentUploadComponent, DocumentsComponent, DocumentsConstants, DocumentsListComponent, DocumentsModule, DocumentsService, DragAndDropDirective, DropdownViewerComponent, DynamicChartComponent, DynamicChartModule, DynamicColumnComponent, DynamicFieldsRendererComponent, DynamicFieldsRendererModule, DynamicFilterComponent, DynamicFilterModule, DynamicFormBoolItemComponent, DynamicFormBuilderComponent, DynamicFormCheckboxItemComponent, DynamicFormComponent, DynamicFormDateItemComponent, DynamicFormDepartmentComponent, DynamicFormFieldComponent, DynamicFormHijriDateitemComponent, DynamicFormMapItemComponent, DynamicFormModule, DynamicFormOptionsComponent, DynamicFormSelectItemComponent, DynamicFormSelectTagComponent, DynamicFormSelectUserFilterComponent, DynamicFormSelectUsersComponent, DynamicFormService, DynamicFormSlideToggleitemComponent, DynamicFormTextItemComponent, DynamicFormTextareaComponent, DynamicFormViewerComponent, DynamicFormVocabularyItemComponent, DynamicSearchComponent, DynamicSearchModule, DynamicSingleChartComponent, DynamicTableComponent, DynamicTableModule, DynamicTableService, DynamicTabsComponent, DynamicTabsModule, DynamicViewModule, ENTITY_TYPE, EXTENSION_JSONS, EnvManager, EvaluatorsService, ExtensionLoaderService, ExtensionService, FILTER_DATES_TYPE, FileGridInfiniteScrollDirective, FileManagerAbstract, FileManagerAdapter, FileManagerPaginationConfig, FileManagerService, FileMangerModule, FileSizePipe, FilterComponent, FilterModule, FolderModalComponent, FolderishType, FormBuilderService, GlobalAdminService, GlobalPdfTron, GregorianDatepickerComponent, HijriDatePipe, HijriDatepickerComponent, HijriGregorianDatepickerComponent, IN_OUT_DIRECTION, IconService, InitializationService, ItemListComponent, Lang, LatestActivityComponent, LatestActivityModule, LibrarySharedModule, ListViewerComponent, LoanRequestComponent, LocalStoragService, LocalizedDatePipe, MESSAGE_TYPE, MY_MOMENT_FORMATS, MainfolderService, MessageService, MomentDateAdapter, MoveComponent, MultiValuePipe, MultipleDynamicFormViewerComponent, MutipleDynamicFormViewerModule, NODE_CIRCLE_SIZE, NODE_HEIGHT, NODE_MARGIN, NODE_STATUS, NODE_TYPE, NODE_WIDTH, NOTIFICATIONS_LIST_OPTIONS, NOTIFICATION_ICON, NOTIFICATION_ITEM, NOTIFICATION_STATUS, NOTIFY_EVENT, NdfConfirmationDialogComponent, NdfNuxeoDialog, NgxHijriGregorianDatepickerModule, NoDataComponent, NodeIconComponent, NodeInputsComponent, NodeOutputsComponent, NotificationIconDirective, NotificationItemComponent, NotificationItemDirective, NotificationSourceSelectComponent, NotificationStatusToggleComponent, NotificationToastComponent, NotificationsButtonComponent, NotificationsDateSelectComponent, NotificationsListComponent, NotificationsListContainerComponent, NotificationsModule, NotificationsService, NotificationsSettingsContainerComponent, NuxeoCoreModule, NuxeoDevelopmentFrameworkComponent, NuxeoDevelopmentFrameworkModule, NuxeoDevelopmentFrameworkService, NuxeoDialogModule, NuxeoDialogService, NuxeoMapper, NuxeoService, PAGINATION_MODE, PANEL_MODE, PaginationComponent, PaginationModule, PdfTronModule, PdftronComponent, PdftronService, PermissionService, PermissionsComponent, PermissionsDirective, PermissionsModule, PermissionsTemplateComponent, PipesModule, PublishDialogComponent, PublishingDocumentService, ReadMoreComponent, RecentlyViewedService, RemoveButtonComponent, RenameComponent, RolesService, SOCKET_WIDTH, SUBSCRIPTION_STATE, SafeHtmlPipe, ScanComponent, ScanModalComponent, SearchAutocompleteComponent, SecurePipe, SelectComponent, SelectModule, SelectUsersByDepartmentModule, SelectUsersByDepartmentsComponent, SetDirRtlDirective, SetRtlDirective, ShareDialogComponent, SharedDocsService, SharedServicesModule, SidepanelComponent, SingleActivityComponent, Socket, SpinnerComponent, StatusIconComponent, TRANSLATION_PROVIDER, TableComponent, TableModule, TagsApiService, TemplateModalComponent, TemplateNode, TemplateNodeComponent, TimeAgoPipe, ToastsModule, TransferDocComponent, TranslateLoaderService, TranslatedVocabularySelectComponent, TranslationService, TreeviewSelectComponent, UpdateModalComponent, UploadFileService, UploadManagmentService, UserCardComponent, UserComponent, UserModule, UserPreferenceValues, UserPreferencesService, UserService, UsersCardComponent, UsersCardModule, UtilityService, VersionsComponent, ViewerFilesService, ViewerLogComponent, ViewerLogModule, VocabularyApiService, VocabularyComponent, VocabularyModule, WorkflowService, ZoomControlComponent, appInitializer, departmentCacheBuster$,
|
|
31712
|
+
export { ActivitiesLogComponent, ActivitiesLogModule, ActivityLineComponent, AdapterService, AddPermissionsDialogComponent, AddToCollectionComponent, AppConfigService, AppHasRoleDirective, AttachmentItemComponent, AttachmentItemModule, AttachmentModalModule, AttachmentsComponent, AttachmentsListComponent, AttachmentsPageProviderComponent, AvatarComponent, AvatarModule, BaseColumnComponent, BaseComponent, BaseDialogComponent, BaseNodeClass, BaseSelector, BaseService, BooleanViewerComponent, ButtonComponent, CachingExpiryUnit, CallApiService, CardComponent, CardModule, ChartDataService, CircleNode, CircleNodeComponent, ClickOutsideDirective, ClipboardComponent, CommentApiService, CommentsDashletComponent, CommentsModule, ComponentRegisterService, ComponentTranslationModel, ConfirmCallerDialogComponent, ConfirmCallerModule, ConfirmDialogComponent, ConfirmationDialogComponent, ConfirmationDialogModule, Connection, ContentActionType, ContentNode, ContentNodeComponent, CopyComponent, CorrespondenceRelationComponent, CorrespondenceRelationModule, CorrespondenceRelationService, CorrespondenceTagsComponent, CreateDirectoryComponent, CreateEntityComponent, CreateEntityModule, CreateModalComponent, CreationTypeComponent, CtsTagsModule, CustomConnectionComponent, CustomDocumentViewerComponent, CustomPpViewerComponent, CustomSocketComponent, CustomToastrModule, CustomToastrService, CutomeVocViewerComponent, DIAGRAM_DEFAULT_OPTIONS, DIAGRAM_HEIGHT, DataViewerComponent, DateFormatterService, DateHelperService, DateViewerComponent, DeleteComponent, DepartmentApiService, DepartmentFormComponent, DepartmentManagementService, DepartmentViewerComponent, DestroySubject$1 as DestroySubject, DiagramDirective, DiagramPluginsService, DiagramService, DiagramsModule, DialogMangmentService, DirectiveModule, DisplaySuitableIconComponent, DisplaySuitableIconModule, DocumentScanService, DocumentTemplatesConstants, DocumentTemplatesService, DocumentUploadComponent, DocumentsComponent, DocumentsConstants, DocumentsListComponent, DocumentsModule, DocumentsService, DragAndDropDirective, DropdownViewerComponent, DynamicChartComponent, DynamicChartModule, DynamicColumnComponent, DynamicFieldsRendererComponent, DynamicFieldsRendererModule, DynamicFilterComponent, DynamicFilterModule, DynamicFormBoolItemComponent, DynamicFormBuilderComponent, DynamicFormCheckboxItemComponent, DynamicFormComponent, DynamicFormDateItemComponent, DynamicFormDepartmentComponent, DynamicFormFieldComponent, DynamicFormHijriDateitemComponent, DynamicFormMapItemComponent, DynamicFormModule, DynamicFormOptionsComponent, DynamicFormSelectItemComponent, DynamicFormSelectTagComponent, DynamicFormSelectUserFilterComponent, DynamicFormSelectUsersComponent, DynamicFormService, DynamicFormSlideToggleitemComponent, DynamicFormTextItemComponent, DynamicFormTextareaComponent, DynamicFormViewerComponent, DynamicFormVocabularyItemComponent, DynamicSearchComponent, DynamicSearchModule, DynamicSingleChartComponent, DynamicTableComponent, DynamicTableModule, DynamicTableService, DynamicTabsComponent, DynamicTabsModule, DynamicViewModule, ENTITY_TYPE, EXTENSION_JSONS, EnvManager, EvaluatorsService, ExtensionLoaderService, ExtensionService, FILTER_DATES_TYPE, FileGridInfiniteScrollDirective, FileManagerAbstract, FileManagerAdapter, FileManagerPaginationConfig, FileManagerService, FileMangerModule, FileSizePipe, FilterComponent, FilterModule, FolderModalComponent, FolderishType, FormBuilderService, GlobalAdminService, GlobalPdfTron, GregorianDatepickerComponent, HijriDatePipe, HijriDatepickerComponent, HijriGregorianDatepickerComponent, IN_OUT_DIRECTION, IconService, InitializationService, ItemListComponent, Lang, LatestActivityComponent, LatestActivityModule, LibrarySharedModule, ListViewerComponent, LoanRequestComponent, LocalStoragService, LocalizedDatePipe, MESSAGE_TYPE, MY_MOMENT_FORMATS, MainfolderService, MessageService, MomentDateAdapter, MoveComponent, MultiValuePipe, MultipleDynamicFormViewerComponent, MutipleDynamicFormViewerModule, NODE_CIRCLE_SIZE, NODE_HEIGHT, NODE_MARGIN, NODE_STATUS, NODE_TYPE, NODE_WIDTH, NOTIFICATIONS_LIST_OPTIONS, NOTIFICATION_ICON, NOTIFICATION_ITEM, NOTIFICATION_STATUS, NOTIFY_EVENT, NdfConfirmationDialogComponent, NdfNuxeoDialog, NgxHijriGregorianDatepickerModule, NoDataComponent, NodeIconComponent, NodeInputsComponent, NodeOutputsComponent, NotificationIconDirective, NotificationItemComponent, NotificationItemDirective, NotificationSourceSelectComponent, NotificationStatusToggleComponent, NotificationToastComponent, NotificationsButtonComponent, NotificationsDateSelectComponent, NotificationsListComponent, NotificationsListContainerComponent, NotificationsModule, NotificationsService, NotificationsSettingsContainerComponent, NuxeoCoreModule, NuxeoDevelopmentFrameworkComponent, NuxeoDevelopmentFrameworkModule, NuxeoDevelopmentFrameworkService, NuxeoDialogModule, NuxeoDialogService, NuxeoMapper, NuxeoService, PAGINATION_MODE, PANEL_MODE, PaginationComponent, PaginationModule, PdfTronModule, PdftronComponent, PdftronService, PermissionService, PermissionsComponent, PermissionsDirective, PermissionsModule, PermissionsTemplateComponent, PipesModule, PublishDialogComponent, PublishingDocumentService, ReadMoreComponent, RecentlyViewedService, RemoveButtonComponent, RenameComponent, RolesService, SOCKET_WIDTH, SUBSCRIPTION_STATE, SafeHtmlPipe, ScanComponent, ScanModalComponent, SearchAutocompleteComponent, SecurePipe, SelectComponent, SelectModule, SelectUsersByDepartmentModule, SelectUsersByDepartmentsComponent, SetDirRtlDirective, SetRtlDirective, ShareDialogComponent, SharedDocsService, SharedServicesModule, SidepanelComponent, SingleActivityComponent, Socket, SpinnerComponent, StatusIconComponent, TRANSLATION_PROVIDER, TableComponent, TableModule, TagsApiService, TemplateModalComponent, TemplateNode, TemplateNodeComponent, TimeAgoPipe, ToastsModule, TransferDocComponent, TranslateLoaderService, TranslatedVocabularySelectComponent, TranslationService, TreeviewSelectComponent, UpdateModalComponent, UploadFileService, UploadManagmentService, UserCardComponent, UserComponent, UserModule, UserPreferenceValues, UserPreferencesService, UserService, UsersCardComponent, UsersCardModule, UtilityService, VersionsComponent, ViewerFilesService, ViewerLogComponent, ViewerLogModule, VocabularyApiService, VocabularyComponent, VocabularyModule, WorkflowService, ZoomControlComponent, appInitializer, departmentCacheBuster$, extensionJsonsFactory, filterEnabled, getConnections, getValue, mergeArrays, mergeObjects, minute$1 as minute, provideExtensionConfig, reduceEmptyMenus, reduceSeparators, removeConnections, removeNode, removeNodeAndConnections, serializeControl, serializePort, sortByOrder };
|
|
31738
31713
|
//# sourceMappingURL=nuxeo-development-framework.js.map
|