nuxeo-development-framework 4.0.5 → 4.0.6

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.
Files changed (25) hide show
  1. package/bundles/nuxeo-development-framework.umd.js +1582 -1627
  2. package/bundles/nuxeo-development-framework.umd.js.map +1 -1
  3. package/esm2015/lib/components/diagrams/utilities/index.js +1 -2
  4. package/esm2015/lib/shared/components/base/base.component.js +15 -17
  5. package/esm2015/lib/shared/components/nuxeo-dialog/confirmation/ndf-confirmation-dialog.component.js +7 -7
  6. package/esm2015/lib/shared/components/nuxeo-dialog/nuxeo-dialog.module.js +8 -4
  7. package/esm2015/lib/shared/components/nuxeo-dialog/nuxeo.dialog.js +29 -31
  8. package/esm2015/lib/shared/components/nuxeo-dialog/services/nuxeo-dialog.service.js +15 -15
  9. package/esm2015/lib/shared/services/base/base.service.js +23 -23
  10. package/esm2015/lib/shared/services/base/cache-base.service.js +23 -23
  11. package/esm2015/lib/shared/services/base/http-base.service.js +10 -10
  12. package/fesm2015/nuxeo-development-framework.js +1129 -1156
  13. package/fesm2015/nuxeo-development-framework.js.map +1 -1
  14. package/lib/components/diagrams/utilities/index.d.ts +0 -1
  15. package/lib/shared/components/base/base.component.d.ts +11 -13
  16. package/lib/shared/components/nuxeo-dialog/confirmation/ndf-confirmation-dialog.component.d.ts +3 -3
  17. package/lib/shared/components/nuxeo-dialog/nuxeo-dialog.module.d.ts +2 -1
  18. package/lib/shared/components/nuxeo-dialog/nuxeo.dialog.d.ts +7 -8
  19. package/lib/shared/components/nuxeo-dialog/services/nuxeo-dialog.service.d.ts +3 -3
  20. package/lib/shared/services/base/base.service.d.ts +6 -6
  21. package/lib/shared/services/base/cache-base.service.d.ts +4 -4
  22. package/lib/shared/services/base/http-base.service.d.ts +4 -4
  23. package/package.json +1 -1
  24. package/esm2015/lib/components/diagrams/utilities/export-graph.js +0 -28
  25. 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, Input, ContentChild, ViewChild, ChangeDetectorRef, Pipe, ViewEncapsulation, EventEmitter, Output, HostListener, Self, SkipSelf, ChangeDetectionStrategy, ViewContainerRef, forwardRef, APP_INITIALIZER, TemplateRef } from '@angular/core';
2
+ import { Component, NgModule, Injectable, Directive, Inject, InjectionToken, Optional, ChangeDetectorRef, Input, ContentChild, ViewChild, EventEmitter, Output, HostListener, Pipe, ViewEncapsulation, 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, first, debounceTime, mergeMap, toArray, delay, reduce, concatMap, finalize, filter as filter$1 } from 'rxjs/operators';
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 { merge } from 'lodash-es';
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 { coerceBooleanProperty } from '@angular/cdk/coercion';
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 == "ar";
1602
+ return this.currentLang == 'ar';
1764
1603
  }
1765
1604
  get isArabic$() {
1766
- return this.translateService.onLangChange.pipe(map((event) => event.lang == "ar"));
1605
+ return this.translateService.onLangChange.pipe(map((event) => event.lang == 'ar'));
1767
1606
  }
1768
1607
  get direction() {
1769
- return this.translateService.currentLang === "ar" ? "rtl" : "ltr";
1608
+ return this.translateService.currentLang === 'ar' ? 'rtl' : 'ltr';
1770
1609
  }
1771
1610
  }
1772
1611
  _BaseComponent_loading = new WeakMap();
@@ -1904,100 +1743,692 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1904
1743
  type: Input
1905
1744
  }] } });
1906
1745
 
1907
- class NuxeoDialogModule {
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
- NuxeoDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1910
- NuxeoDialogModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, declarations: [NdfNuxeoDialog, NdfConfirmationDialogComponent], imports: [CommonModule,
1911
- TranslateModule,
1912
- MatIconModule,
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
+ SetDirRtlDirectivedir = 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
- declarations: [NdfNuxeoDialog, NdfConfirmationDialogComponent],
1926
- imports: [
1927
- CommonModule,
1928
- TranslateModule,
1929
- MatIconModule,
1930
- MatDialogModule,
1931
- MatTooltipModule
1932
- ],
1933
- exports: [NdfNuxeoDialog, NdfConfirmationDialogComponent]
1767
+ selector: '[SetDirRtl]',
1934
1768
  }]
1935
- }] });
1936
-
1937
- class NuxeoMapper {
1938
- static schemaToModel(properties) {
1939
- const mappedProperties = {};
1940
- for (const key in properties) {
1941
- if (properties.hasOwnProperty(key)) {
1942
- const [prefix, propertyKey] = key.split(':');
1943
- if (!mappedProperties[prefix]) {
1944
- mappedProperties[prefix] = {};
1945
- }
1946
- mappedProperties[prefix][propertyKey] =
1947
- properties[key];
1948
- }
1949
- }
1950
- return mappedProperties;
1951
- }
1952
- static modelToSchema(model) {
1953
- const packedProperties = {};
1954
- for (const schemaKey in model) {
1955
- if (model.hasOwnProperty(schemaKey)) {
1956
- const schemaProperties = model[schemaKey];
1957
- for (const propertyKey in schemaProperties) {
1958
- if (schemaProperties.hasOwnProperty(propertyKey)) {
1959
- packedProperties[`${schemaKey}:${propertyKey}`] =
1960
- schemaProperties[propertyKey];
1961
- }
1962
- }
1963
- }
1964
- }
1965
- return packedProperties;
1966
- }
1967
- }
1968
-
1969
- const ENTITY_TYPE = 'entity-type';
1769
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: TranslationService }]; } });
1970
1770
 
1971
- var _HttpBaseService_http;
1972
- class HttpBaseService {
1771
+ class NdfNuxeoDialog extends BaseComponent {
1973
1772
  constructor(injector) {
1974
- _HttpBaseService_http.set(this, void 0);
1975
- __classPrivateFieldSet(this, _HttpBaseService_http, injector.get(HttpClient), "f");
1976
- }
1977
- get environment() {
1978
- return EnvManager.environment;
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);
1979
1780
  }
1980
- get(endpointOrOptions, params = undefined, headers = undefined, responseType = undefined) {
1981
- var _a, _b, _c;
1982
- let url;
1983
- if (typeof endpointOrOptions === "string") {
1984
- url = endpointOrOptions;
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');
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
+ });
1985
1800
  }
1986
1801
  else {
1987
- const options = endpointOrOptions;
1988
- url = options.endpoint;
1989
- params = (_a = options.params) !== null && _a !== void 0 ? _a : undefined;
1990
- headers = (_b = options.headers) !== null && _b !== void 0 ? _b : undefined;
1991
- responseType = (_c = options.responseType) !== null && _c !== void 0 ? _c : undefined;
1802
+ this.dialogRef.close();
1992
1803
  }
1993
- return __classPrivateFieldGet(this, _HttpBaseService_http, "f")
1994
- .get(url, { headers, params, responseType })
1995
- .pipe(map((response) => response), this.catchErrors());
1996
1804
  }
1997
- post(endpointOrOptions, payload = undefined, params = undefined, headers = undefined, responseType = undefined) {
1998
- var _a, _b, _c, _d;
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 } });
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
+ }]
1825
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { dialogTitle: [{
1826
+ type: Input
1827
+ }], subTitle: [{
1828
+ type: Input
1829
+ }], loaderMode: [{
1830
+ type: Input
1831
+ }], contentTemplate: [{
1832
+ type: ContentChild,
1833
+ args: ['contentTemplate']
1834
+ }], actionsTemplate: [{
1835
+ type: ContentChild,
1836
+ args: ['actionsTemplate']
1837
+ }], dialogBody: [{
1838
+ type: ViewChild,
1839
+ args: ['dialogBody']
1840
+ }] } });
1841
+
1842
+ class NdfConfirmationDialogComponent extends BaseDialogComponent {
1843
+ constructor(injector) {
1844
+ super(injector);
1845
+ }
1846
+ }
1847
+ NdfConfirmationDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfConfirmationDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1848
+ 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: ["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 } });
1849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NdfConfirmationDialogComponent, decorators: [{
1850
+ type: Component,
1851
+ args: [{
1852
+ selector: 'ndf-confirmation-dialog',
1853
+ templateUrl: './ndf-confirmation-dialog.component.html',
1854
+ styleUrls: ['./ndf-confirmation-dialog.component.scss']
1855
+ }]
1856
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
1857
+
1858
+ /** @ignore */
1859
+ class ClickOutsideDirective {
1860
+ constructor(elementRef) {
1861
+ this.elementRef = elementRef;
1862
+ this.clickOutside = new EventEmitter();
1863
+ }
1864
+ onClick(target) {
1865
+ const clickedInside = this.elementRef.nativeElement.contains(target);
1866
+ if (!clickedInside) {
1867
+ this.clickOutside.emit(target);
1868
+ }
1869
+ }
1870
+ }
1871
+ ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1872
+ 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 });
1873
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ClickOutsideDirective, decorators: [{
1874
+ type: Directive,
1875
+ args: [{
1876
+ selector: '[clickOutside]'
1877
+ }]
1878
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
1879
+ type: Output
1880
+ }], onClick: [{
1881
+ type: HostListener,
1882
+ args: ['window:click', ['$event.target']]
1883
+ }] } });
1884
+
1885
+ /** @ignore */
1886
+ class SetRtlDirective {
1887
+ constructor(elRef, renderer, translation) {
1888
+ this.elRef = elRef;
1889
+ this.renderer = renderer;
1890
+ this.translation = translation;
1891
+ this.switchClassBasedOnLanguage();
1892
+ }
1893
+ /*Switch rtl class based on the chosen language from Translation Service*/
1894
+ switchClassBasedOnLanguage() {
1895
+ this.translation.isArabic.subscribe((arabic) => {
1896
+ arabic
1897
+ ? this.renderer.addClass(this.elRef.nativeElement, 'rtl')
1898
+ : this.renderer.removeClass(this.elRef.nativeElement, 'rtl');
1899
+ });
1900
+ }
1901
+ }
1902
+ 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 });
1903
+ SetRtlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: SetRtlDirective, selector: "[SetRtl]", ngImport: i0 });
1904
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetRtlDirective, decorators: [{
1905
+ type: Directive,
1906
+ args: [{
1907
+ selector: '[SetRtl]',
1908
+ }]
1909
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: TranslationService }]; } });
1910
+
1911
+ class EvaluatorsService {
1912
+ constructor(nuxeoService, appConfigService) {
1913
+ this.nuxeoService = nuxeoService;
1914
+ this.appConfigService = appConfigService;
1915
+ this.context = { entity: null, getEvaluator: null, user: null };
1916
+ this.asyncEvery = (arr, predicate) => __awaiter(this, void 0, void 0, function* () {
1917
+ for (let e of arr) {
1918
+ if (!(yield predicate(e))) {
1919
+ return false;
1920
+ }
1921
+ }
1922
+ return true;
1923
+ });
1924
+ this.asyncSome = (arr, predicate) => __awaiter(this, void 0, void 0, function* () {
1925
+ for (let e of arr) {
1926
+ if (yield predicate(e)) {
1927
+ return true;
1928
+ }
1929
+ }
1930
+ return false;
1931
+ });
1932
+ // tslint:disable-next-line:member-ordering
1933
+ this.evaluators = {
1934
+ AND: (context, args) => __awaiter(this, void 0, void 0, function* () {
1935
+ if (!args || args.length === 0) {
1936
+ return false;
1937
+ }
1938
+ return yield this.asyncEvery(args, (arg) => __awaiter(this, void 0, void 0, function* () {
1939
+ const evaluator = yield context.getEvaluator(arg.value);
1940
+ if (!evaluator) {
1941
+ console.warn("evaluator not found: " + arg.value);
1942
+ return false;
1943
+ }
1944
+ return yield evaluator(context, arg.parameters || []);
1945
+ }));
1946
+ }),
1947
+ OR: (context, args) => __awaiter(this, void 0, void 0, function* () {
1948
+ if (!args || args.length === 0) {
1949
+ return false;
1950
+ }
1951
+ return yield this.asyncSome(args, (arg) => __awaiter(this, void 0, void 0, function* () {
1952
+ const evaluator = yield context.getEvaluator(arg.value);
1953
+ if (!evaluator) {
1954
+ console.warn("evaluator not found: " + arg.value);
1955
+ return false;
1956
+ }
1957
+ const res = yield evaluator(context, arg.parameters || []);
1958
+ return res;
1959
+ }));
1960
+ }),
1961
+ isStatus: (context, args) => __awaiter(this, void 0, void 0, function* () {
1962
+ if (args.indexOf(context.entity.state) > -1) {
1963
+ return true;
1964
+ }
1965
+ else {
1966
+ return false;
1967
+ }
1968
+ }),
1969
+ isCreator: (context, args) => __awaiter(this, void 0, void 0, function* () {
1970
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1971
+ //check if user loged in is the creator of that corresp
1972
+ let owner;
1973
+ if ((_b = (_a = context.entity.properties.owner) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.username) {
1974
+ owner = (_d = (_c = context.entity.properties.owner) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.username;
1975
+ }
1976
+ 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) {
1977
+ owner = (_h = (_g = context.entity.properties["corr:owner"]) === null || _g === void 0 ? void 0 : _g.properties) === null || _h === void 0 ? void 0 : _h.username;
1978
+ }
1979
+ else if (context.entity.properties.owner) {
1980
+ owner = context.entity.properties.owner;
1981
+ }
1982
+ else if (context.entity.properties["corr:owner"]) {
1983
+ owner = context.entity.properties["corr:owner"];
1984
+ }
1985
+ if (owner === context.user.properties.username) {
1986
+ return true;
1987
+ }
1988
+ else {
1989
+ return false;
1990
+ }
1991
+ }),
1992
+ isUserInrole: (context, args) => __awaiter(this, void 0, void 0, function* () {
1993
+ const result = yield this.nuxeoService
1994
+ .isUserInRole(args, "")
1995
+ .pipe(first())
1996
+ .toPromise();
1997
+ return result;
1998
+ }),
1999
+ };
2000
+ this.getEvaluator = (key) => __awaiter(this, void 0, void 0, function* () {
2001
+ const eva = this.evaluators;
2002
+ if (key && key.startsWith("!")) {
2003
+ const fn = eva[key.substring(1)];
2004
+ return (context, args) => __awaiter(this, void 0, void 0, function* () {
2005
+ const result = yield fn(context, ...args);
2006
+ return !result;
2007
+ });
2008
+ }
2009
+ return eva[key];
2010
+ });
2011
+ this.appConfigService.configLoaded.subscribe((ready) => {
2012
+ if (ready) {
2013
+ this.conditions = this.getAllRules();
2014
+ }
2015
+ });
2016
+ }
2017
+ setEvaluators(evaluators) {
2018
+ this.evaluators = Object.assign(Object.assign({}, this.evaluators), evaluators);
2019
+ }
2020
+ getEvaluators() {
2021
+ return this.evaluators;
2022
+ }
2023
+ // ----------------------------------------------------
2024
+ evaluateRule(ruleId, context) {
2025
+ return __awaiter(this, void 0, void 0, function* () {
2026
+ const ruleRef = this.getRuleById(ruleId);
2027
+ context = context || this.context;
2028
+ context["getEvaluator"] = this.getEvaluator;
2029
+ if (ruleRef) {
2030
+ const evaluator = yield this.getEvaluator(ruleRef.type);
2031
+ if (evaluator) {
2032
+ return yield evaluator(context, ruleRef.parameters);
2033
+ }
2034
+ }
2035
+ else {
2036
+ const evaluator = yield this.getEvaluator(ruleId);
2037
+ if (evaluator) {
2038
+ return yield evaluator(context);
2039
+ }
2040
+ }
2041
+ });
2042
+ }
2043
+ getRuleById(id) {
2044
+ return this.conditions[id] ? Object.assign({}, this.conditions[id]) : null;
2045
+ }
2046
+ getAllRules() {
2047
+ return this.appConfigService.conditons;
2048
+ }
2049
+ }
2050
+ 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 });
2051
+ EvaluatorsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvaluatorsService, providedIn: "root" });
2052
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvaluatorsService, decorators: [{
2053
+ type: Injectable,
2054
+ args: [{ providedIn: "root" }]
2055
+ }], ctorParameters: function () { return [{ type: NuxeoService }, { type: AppConfigService }]; } });
2056
+
2057
+ /**
2058
+ * Permission directive shows or hides an element,
2059
+ * based on a predefined structured condition object in the [conditions.json]{@link ../additional-documentation/conditions-file.html} file.
2060
+ * it will evaluate the rule and shows or hides an element based on the result.
2061
+ * this directive can evaluate rules against a document object as well,
2062
+ * check [conditions.json]{@link ../additional-documentation/conditions-file.html} for more information
2063
+ * @example
2064
+ * <div *permission="{ name: 'conditionKey', entity: nuxeoDocumentObject }">
2065
+ * Element with permissions
2066
+ * </duv>
2067
+ * <div *permission="{ name: 'conditionKey2' }">
2068
+ * Element with permissions 2
2069
+ * </duv>
2070
+ * @title
2071
+ * Permission
2072
+ */
2073
+ class PermissionsDirective {
2074
+ constructor(nuxeoService, eltRef, viewContainerRef, templateRef, appConfigService, evaluatorsService) {
2075
+ this.nuxeoService = nuxeoService;
2076
+ this.eltRef = eltRef;
2077
+ this.viewContainerRef = viewContainerRef;
2078
+ this.templateRef = templateRef;
2079
+ this.appConfigService = appConfigService;
2080
+ this.evaluatorsService = evaluatorsService;
2081
+ this.isVisible = false;
2082
+ this.context = { entity: null, getEvaluator: null, user: null };
2083
+ }
2084
+ ngOnInit() {
2085
+ this.context.getEvaluator = this.evaluatorsService.getEvaluator;
2086
+ if (!this.permission.name) {
2087
+ if (!this.isVisible) {
2088
+ this.isVisible = true;
2089
+ this.viewContainerRef.createEmbeddedView(this.templateRef);
2090
+ }
2091
+ }
2092
+ else {
2093
+ this.context.entity = this.permission.entity;
2094
+ this.context.user = this.permission.user || this.nuxeoService.nuxeoClient.user;
2095
+ this.evaluatorsService.evaluateRule(this.permission.name, this.context).then((result) => {
2096
+ if (result) {
2097
+ if (!this.isVisible) {
2098
+ this.isVisible = true;
2099
+ this.viewContainerRef.createEmbeddedView(this.templateRef);
2100
+ }
2101
+ }
2102
+ else {
2103
+ this.isVisible = false;
2104
+ this.viewContainerRef.clear();
2105
+ }
2106
+ });
2107
+ }
2108
+ }
2109
+ }
2110
+ 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 });
2111
+ PermissionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: PermissionsDirective, selector: "[permission]", inputs: { permission: "permission" }, ngImport: i0 });
2112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PermissionsDirective, decorators: [{
2113
+ type: Directive,
2114
+ args: [{
2115
+ selector: '[permission]'
2116
+ }]
2117
+ }], ctorParameters: function () { return [{ type: NuxeoService }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: AppConfigService }, { type: EvaluatorsService }]; }, propDecorators: { permission: [{
2118
+ type: Input
2119
+ }] } });
2120
+
2121
+ class AppHasRoleDirective {
2122
+ constructor(viewContainerRef, templateRef, nuxeoService) {
2123
+ this.viewContainerRef = viewContainerRef;
2124
+ this.templateRef = templateRef;
2125
+ this.nuxeoService = nuxeoService;
2126
+ this.stop$ = new Subject();
2127
+ this.isVisible = false;
2128
+ }
2129
+ ngOnInit() {
2130
+ var _a;
2131
+ if ((_a = this.appHasRole) === null || _a === void 0 ? void 0 : _a.role) {
2132
+ this.nuxeoService.isUserInRole(this.appHasRole.role, this.appHasRole.code).subscribe(data => {
2133
+ if (data || !this.appHasRole) {
2134
+ // If it is already visible (which can happen if
2135
+ // his roles changed) we do not need to add it a second time
2136
+ if (!this.isVisible) {
2137
+ // We update the `isVisible` property and add the
2138
+ // templateRef to the view using the
2139
+ // 'createEmbeddedView' method of the viewContainerRef
2140
+ this.isVisible = true;
2141
+ this.viewContainerRef.createEmbeddedView(this.templateRef);
2142
+ }
2143
+ }
2144
+ else {
2145
+ // If the user does not have the role,
2146
+ // we update the `isVisible` property and clear
2147
+ // the contents of the viewContainerRef
2148
+ this.isVisible = false;
2149
+ this.viewContainerRef.clear();
2150
+ }
2151
+ });
2152
+ }
2153
+ else {
2154
+ if (!this.isVisible) {
2155
+ // We update the `isVisible` property and add the
2156
+ // templateRef to the view using the
2157
+ // 'createEmbeddedView' method of the viewContainerRef
2158
+ this.isVisible = true;
2159
+ this.viewContainerRef.createEmbeddedView(this.templateRef);
2160
+ }
2161
+ }
2162
+ }
2163
+ ngOnChanges() {
2164
+ this.ngOnInit();
2165
+ }
2166
+ }
2167
+ 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 });
2168
+ AppHasRoleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: AppHasRoleDirective, selector: "[appHasRole]", inputs: { appHasRole: "appHasRole" }, usesOnChanges: true, ngImport: i0 });
2169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AppHasRoleDirective, decorators: [{
2170
+ type: Directive,
2171
+ args: [{
2172
+ selector: '[appHasRole]'
2173
+ }]
2174
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: NuxeoService }]; }, propDecorators: { appHasRole: [{
2175
+ type: Input
2176
+ }] } });
2177
+
2178
+ class DragAndDropDirective {
2179
+ constructor() {
2180
+ this.fileDroped = new EventEmitter();
2181
+ }
2182
+ onDragOver(evt) {
2183
+ evt.preventDefault();
2184
+ evt.stopPropagation();
2185
+ }
2186
+ onDragLeave(evt) {
2187
+ evt.preventDefault();
2188
+ evt.stopPropagation();
2189
+ }
2190
+ onDrop(evt) {
2191
+ let files = [];
2192
+ evt.preventDefault();
2193
+ evt.stopPropagation();
2194
+ if (evt.dataTransfer.files.length) {
2195
+ for (const file of evt.dataTransfer.files) {
2196
+ files.push(file);
2197
+ }
2198
+ this.fileDroped.emit(files);
2199
+ }
2200
+ }
2201
+ }
2202
+ DragAndDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DragAndDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2203
+ 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 });
2204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DragAndDropDirective, decorators: [{
2205
+ type: Directive,
2206
+ args: [{
2207
+ selector: '[appDragAndDrop]'
2208
+ }]
2209
+ }], ctorParameters: function () { return []; }, propDecorators: { fileDroped: [{
2210
+ type: Output
2211
+ }], onDragOver: [{
2212
+ type: HostListener,
2213
+ args: ['dragover', ['$event']]
2214
+ }], onDragLeave: [{
2215
+ type: HostListener,
2216
+ args: ['dragleave', ['$event']]
2217
+ }], onDrop: [{
2218
+ type: HostListener,
2219
+ args: ['drop', ['$event']]
2220
+ }] } });
2221
+
2222
+ /**
2223
+ * @title
2224
+ * Directives Module
2225
+ */
2226
+ class DirectiveModule {
2227
+ }
2228
+ DirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2229
+ DirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, declarations: [ClickOutsideDirective,
2230
+ SetRtlDirective,
2231
+ PermissionsDirective,
2232
+ SetDirRtlDirective,
2233
+ AppHasRoleDirective,
2234
+ DragAndDropDirective], imports: [CommonModule], exports: [ClickOutsideDirective,
2235
+ SetRtlDirective,
2236
+ PermissionsDirective,
2237
+ SetDirRtlDirective,
2238
+ AppHasRoleDirective,
2239
+ DragAndDropDirective] });
2240
+ DirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, providers: [], imports: [[CommonModule]] });
2241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, decorators: [{
2242
+ type: NgModule,
2243
+ args: [{
2244
+ declarations: [
2245
+ ClickOutsideDirective,
2246
+ SetRtlDirective,
2247
+ PermissionsDirective,
2248
+ SetDirRtlDirective,
2249
+ AppHasRoleDirective,
2250
+ DragAndDropDirective
2251
+ ],
2252
+ imports: [CommonModule],
2253
+ exports: [
2254
+ ClickOutsideDirective,
2255
+ SetRtlDirective,
2256
+ PermissionsDirective,
2257
+ SetDirRtlDirective,
2258
+ AppHasRoleDirective,
2259
+ DragAndDropDirective
2260
+ ],
2261
+ providers: []
2262
+ }]
2263
+ }] });
2264
+
2265
+ class NuxeoDialogModule {
2266
+ }
2267
+ NuxeoDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2268
+ NuxeoDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, declarations: [NdfNuxeoDialog, NdfConfirmationDialogComponent], imports: [CommonModule,
2269
+ TranslateModule,
2270
+ MatIconModule,
2271
+ MatDialogModule,
2272
+ MatTooltipModule,
2273
+ DirectiveModule], exports: [NdfNuxeoDialog, NdfConfirmationDialogComponent] });
2274
+ NuxeoDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, imports: [[
2275
+ CommonModule,
2276
+ TranslateModule,
2277
+ MatIconModule,
2278
+ MatDialogModule,
2279
+ MatTooltipModule,
2280
+ DirectiveModule
2281
+ ]] });
2282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogModule, decorators: [{
2283
+ type: NgModule,
2284
+ args: [{
2285
+ declarations: [NdfNuxeoDialog, NdfConfirmationDialogComponent],
2286
+ imports: [
2287
+ CommonModule,
2288
+ TranslateModule,
2289
+ MatIconModule,
2290
+ MatDialogModule,
2291
+ MatTooltipModule,
2292
+ DirectiveModule
2293
+ ],
2294
+ exports: [NdfNuxeoDialog, NdfConfirmationDialogComponent]
2295
+ }]
2296
+ }] });
2297
+
2298
+ const defaultConfirmConfig = {
2299
+ title: 'confirmDialog.confirm',
2300
+ message: 'confirmDialog.generalConfirmMsg',
2301
+ icon: {
2302
+ show: true,
2303
+ name: 'heroicons_outline:exclamation',
2304
+ color: 'warn'
2305
+ },
2306
+ actions: {
2307
+ confirm: {
2308
+ show: true,
2309
+ label: 'BUTTONS.confirm',
2310
+ color: 'warn',
2311
+ fn: () => {
2312
+ return of(false);
2313
+ }
2314
+ },
2315
+ moreActions: []
2316
+ }
2317
+ };
2318
+
2319
+ var _NuxeoDialogService_instances, _NuxeoDialogService_getPanelClass;
2320
+ class NuxeoDialogService {
2321
+ constructor(dialog) {
2322
+ this.dialog = dialog;
2323
+ _NuxeoDialogService_instances.add(this);
2324
+ }
2325
+ open(options) {
2326
+ var _a, _b, _c, _d;
2327
+ return this.dialog.open(options.component, {
2328
+ width: (options === null || options === void 0 ? void 0 : options.width) || 'auto',
2329
+ height: (options === null || options === void 0 ? void 0 : options.height) || 'auto',
2330
+ minWidth: '35%',
2331
+ panelClass: ['ndf-dialog', ...__classPrivateFieldGet(this, _NuxeoDialogService_instances, "m", _NuxeoDialogService_getPanelClass).call(this, options === null || options === void 0 ? void 0 : options.panelClass)],
2332
+ disableClose: true,
2333
+ data: Object.assign({ dialogConfig: {
2334
+ title: (_a = options.config) === null || _a === void 0 ? void 0 : _a.title,
2335
+ subTitle: (_b = options.config) === null || _b === void 0 ? void 0 : _b.subTitle,
2336
+ contentTemplate: (_c = options.config) === null || _c === void 0 ? void 0 : _c.contentTemplate,
2337
+ actionsTemplate: (_d = options.config) === null || _d === void 0 ? void 0 : _d.actionsTemplate
2338
+ } }, (options.data || {}))
2339
+ });
2340
+ }
2341
+ showConfirm(config) {
2342
+ // Merge the user config with the default config
2343
+ const confirmConfig = merge({}, defaultConfirmConfig, config);
2344
+ const options = {
2345
+ component: NdfConfirmationDialogComponent,
2346
+ data: Object.assign({}, confirmConfig),
2347
+ panelClass: 'ndf-confirmation-dialog-panel'
2348
+ };
2349
+ return this.open(options);
2350
+ }
2351
+ }
2352
+ _NuxeoDialogService_instances = new WeakSet(), _NuxeoDialogService_getPanelClass = function _NuxeoDialogService_getPanelClass(panelClass) {
2353
+ let classes = [''];
2354
+ if (panelClass) {
2355
+ classes = Array.isArray(panelClass) ? panelClass : [panelClass];
2356
+ }
2357
+ return classes;
2358
+ };
2359
+ 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 });
2360
+ NuxeoDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, providedIn: 'root' });
2361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: NuxeoDialogService, decorators: [{
2362
+ type: Injectable,
2363
+ args: [{
2364
+ providedIn: 'root'
2365
+ }]
2366
+ }], ctorParameters: function () { return [{ type: i1$3.MatDialog }]; } });
2367
+
2368
+ class NuxeoMapper {
2369
+ static schemaToModel(properties) {
2370
+ const mappedProperties = {};
2371
+ for (const key in properties) {
2372
+ if (properties.hasOwnProperty(key)) {
2373
+ const [prefix, propertyKey] = key.split(':');
2374
+ if (!mappedProperties[prefix]) {
2375
+ mappedProperties[prefix] = {};
2376
+ }
2377
+ mappedProperties[prefix][propertyKey] =
2378
+ properties[key];
2379
+ }
2380
+ }
2381
+ return mappedProperties;
2382
+ }
2383
+ static modelToSchema(model) {
2384
+ const packedProperties = {};
2385
+ for (const schemaKey in model) {
2386
+ if (model.hasOwnProperty(schemaKey)) {
2387
+ const schemaProperties = model[schemaKey];
2388
+ for (const propertyKey in schemaProperties) {
2389
+ if (schemaProperties.hasOwnProperty(propertyKey)) {
2390
+ packedProperties[`${schemaKey}:${propertyKey}`] =
2391
+ schemaProperties[propertyKey];
2392
+ }
2393
+ }
2394
+ }
2395
+ }
2396
+ return packedProperties;
2397
+ }
2398
+ }
2399
+
2400
+ const ENTITY_TYPE = 'entity-type';
2401
+
2402
+ var _HttpBaseService_http;
2403
+ class HttpBaseService {
2404
+ constructor(injector) {
2405
+ _HttpBaseService_http.set(this, void 0);
2406
+ __classPrivateFieldSet(this, _HttpBaseService_http, injector.get(HttpClient), "f");
2407
+ }
2408
+ get environment() {
2409
+ return EnvManager.environment;
2410
+ }
2411
+ get(endpointOrOptions, params = undefined, headers = undefined, responseType = undefined) {
2412
+ var _a, _b, _c;
2413
+ let url;
2414
+ if (typeof endpointOrOptions === 'string') {
2415
+ url = endpointOrOptions;
2416
+ }
2417
+ else {
2418
+ const options = endpointOrOptions;
2419
+ url = options.endpoint;
2420
+ params = (_a = options.params) !== null && _a !== void 0 ? _a : undefined;
2421
+ headers = (_b = options.headers) !== null && _b !== void 0 ? _b : undefined;
2422
+ responseType = (_c = options.responseType) !== null && _c !== void 0 ? _c : undefined;
2423
+ }
2424
+ return __classPrivateFieldGet(this, _HttpBaseService_http, "f")
2425
+ .get(url, { headers, params, responseType })
2426
+ .pipe(map((response) => response), this.catchErrors());
2427
+ }
2428
+ post(endpointOrOptions, payload = undefined, params = undefined, headers = undefined, responseType = undefined) {
2429
+ var _a, _b, _c, _d;
1999
2430
  let url;
2000
- if (typeof endpointOrOptions === "string") {
2431
+ if (typeof endpointOrOptions === 'string') {
2001
2432
  url = endpointOrOptions;
2002
2433
  }
2003
2434
  else {
@@ -2015,7 +2446,7 @@ class HttpBaseService {
2015
2446
  put(endpointOrOptions, payload = undefined, params = undefined, headers = undefined, responseType = undefined) {
2016
2447
  var _a, _b, _c, _d;
2017
2448
  let url;
2018
- if (typeof endpointOrOptions === "string") {
2449
+ if (typeof endpointOrOptions === 'string') {
2019
2450
  url = endpointOrOptions;
2020
2451
  }
2021
2452
  else {
@@ -2033,7 +2464,7 @@ class HttpBaseService {
2033
2464
  patch(endpointOrOptions, payload = undefined, params = undefined, headers = undefined, responseType = undefined) {
2034
2465
  var _a, _b, _c, _d;
2035
2466
  let url;
2036
- if (typeof endpointOrOptions === "string") {
2467
+ if (typeof endpointOrOptions === 'string') {
2037
2468
  url = endpointOrOptions;
2038
2469
  }
2039
2470
  else {
@@ -2051,7 +2482,7 @@ class HttpBaseService {
2051
2482
  delete(endpointOrOptions, params = undefined, headers = undefined, responseType = undefined) {
2052
2483
  var _a, _b, _c;
2053
2484
  let url;
2054
- if (typeof endpointOrOptions === "string") {
2485
+ if (typeof endpointOrOptions === 'string') {
2055
2486
  url = endpointOrOptions;
2056
2487
  }
2057
2488
  else {
@@ -2149,10 +2580,10 @@ class CacheBaseService {
2149
2580
  .filter((key) => {
2150
2581
  var _a;
2151
2582
  const options = {
2152
- cacheKey: key.replace(prefix, ""),
2583
+ cacheKey: key.replace(prefix, ''),
2153
2584
  userName: userName,
2154
2585
  request: DEFAULT_CACHE_OPTIONS.REQUEST,
2155
- prepareDataBeforeCaching: DEFAULT_CACHE_OPTIONS.PREPARE_DATA,
2586
+ prepareDataBeforeCaching: DEFAULT_CACHE_OPTIONS.PREPARE_DATA
2156
2587
  };
2157
2588
  const firstFetchingDate = (_a = __classPrivateFieldGet(this, _CacheBaseService_instances, "m", _CacheBaseService_getItem).call(this, options)) === null || _a === void 0 ? void 0 : _a.firstFetchingDate;
2158
2589
  if (!firstFetchingDate)
@@ -2185,7 +2616,7 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
2185
2616
  __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
2617
  const params = {
2187
2618
  [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(),
2619
+ [options.minCompareDateKey]: __classPrivateFieldGet(this, _CacheBaseService_instances, "m", _CacheBaseService_add1SecondToModifiedDate).call(this, new Date(__classPrivateFieldGet(this, _CacheBaseService_fetchedItems, "f")[options.cacheKey].lastModifiedDate)).toISOString()
2189
2620
  };
2190
2621
  __classPrivateFieldGet(this, _CacheBaseService_fetchedItems, "f")[options.cacheKey].params = params;
2191
2622
  observable = options.request(params);
@@ -2215,7 +2646,7 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
2215
2646
  data: _fetchedItems.data,
2216
2647
  lastModifiedDate: _fetchedItems.lastModifiedDate,
2217
2648
  firstFetchingDate: _fetchedItems.firstFetchingDate,
2218
- resultsCount: _fetchedItems[options.resultsCount],
2649
+ resultsCount: _fetchedItems[options.resultsCount]
2219
2650
  }, options);
2220
2651
  }
2221
2652
  return _fetchedItems;
@@ -2223,7 +2654,7 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
2223
2654
  const result = _cloneDeep({
2224
2655
  [options.mappedDataKey]: res.data,
2225
2656
  [options.lastModifiedDateKey]: res.lastModifiedDate,
2226
- [options.resultsCount]: res[options.resultsCount],
2657
+ [options.resultsCount]: res[options.resultsCount]
2227
2658
  });
2228
2659
  res.onFinishFetching.next(result);
2229
2660
  return result;
@@ -2344,14 +2775,14 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
2344
2775
  DEFAULT_TTL_CONFIG.UNIT =
2345
2776
  ((_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
2777
  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) == "YES";
2778
+ ((_f = (_e = EnvManager.environment) === null || _e === void 0 ? void 0 : _e.cache) === null || _f === void 0 ? void 0 : _f.autoCheck) == 'YES';
2348
2779
  DEFAULT_TTL_CONFIG.RETRY =
2349
2780
  ((_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
2781
  }, _CacheBaseService_add1SecondToModifiedDate = function _CacheBaseService_add1SecondToModifiedDate(date) {
2351
2782
  let newDate = new Date(date.getTime());
2352
2783
  newDate.setSeconds(newDate.getSeconds() + 1);
2353
2784
  return newDate;
2354
- }, _CacheBaseService_clear = function _CacheBaseService_clear(userName, keyOrAll = "") {
2785
+ }, _CacheBaseService_clear = function _CacheBaseService_clear(userName, keyOrAll = '') {
2355
2786
  Object.keys(window.localStorage)
2356
2787
  .filter((q) => q.startsWith(`${userName}__${DEFAULT_CACHE_OPTIONS.PREFIX}${keyOrAll}`))
2357
2788
  .forEach((key) => {
@@ -2370,11 +2801,11 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
2370
2801
  }, _CacheBaseService_setItemInMap = function _CacheBaseService_setItemInMap(key, val) {
2371
2802
  const empty = {
2372
2803
  data: [],
2373
- firstFetchingDate: "",
2374
- lastModifiedDate: "",
2804
+ firstFetchingDate: '',
2805
+ lastModifiedDate: '',
2375
2806
  resultsCount: 0,
2376
2807
  fetchingItemsFromTheServer: false,
2377
- onFinishFetching: new Subject(),
2808
+ onFinishFetching: new Subject()
2378
2809
  };
2379
2810
  let value = val ? val : empty;
2380
2811
  __classPrivateFieldGet(this, _CacheBaseService_fetchedItems, "f")[key] = value;
@@ -2398,11 +2829,11 @@ _CacheBaseService_fetchedItems = new WeakMap(), _CacheBaseService_instances = ne
2398
2829
  }
2399
2830
  };
2400
2831
  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: "root" });
2832
+ CacheBaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CacheBaseService, providedIn: 'root' });
2402
2833
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CacheBaseService, decorators: [{
2403
2834
  type: Injectable,
2404
2835
  args: [{
2405
- providedIn: "root",
2836
+ providedIn: 'root'
2406
2837
  }]
2407
2838
  }], ctorParameters: function () { return [{ type: UserPreferencesService }, { type: UtilityService }]; } });
2408
2839
 
@@ -2459,7 +2890,7 @@ class BaseService extends HttpBaseService {
2459
2890
  automation(operationOrOptions, input = undefined, params = undefined, context = undefined, headers = undefined, isCustomAutomation = false) {
2460
2891
  var _a, _b, _c, _d;
2461
2892
  let operation;
2462
- if (typeof operationOrOptions === "string") {
2893
+ if (typeof operationOrOptions === 'string') {
2463
2894
  operation = operationOrOptions;
2464
2895
  }
2465
2896
  else {
@@ -2474,7 +2905,7 @@ class BaseService extends HttpBaseService {
2474
2905
  return from(__classPrivateFieldGet(this, _BaseService_nuxeoService, "f").nuxeoClient
2475
2906
  .operation(operation, Object.assign({}, (isCustomAutomation
2476
2907
  ? {
2477
- url: `${this.environment.nuxeo}${this.environment.customAutomation}`,
2908
+ url: `${this.environment.nuxeo}${this.environment.customAutomation}`
2478
2909
  }
2479
2910
  : {})))
2480
2911
  .input(input ? input : undefined)
@@ -2483,22 +2914,22 @@ class BaseService extends HttpBaseService {
2483
2914
  .execute({ headers: headers ? Object.assign({}, headers) : undefined })).pipe(map((response) => response), this.catchErrors());
2484
2915
  }
2485
2916
  customAutomation(operationOrOptions, input = undefined, params = undefined, context = undefined, headers = undefined) {
2486
- if (typeof operationOrOptions == "object") {
2917
+ if (typeof operationOrOptions == 'object') {
2487
2918
  operationOrOptions.isCustomAutomation = true;
2488
2919
  }
2489
2920
  return this.automation(operationOrOptions, input, params, context, headers, true);
2490
2921
  }
2491
- request(endpointOrOptions, queryParams = undefined, headers = undefined, payload = undefined, type = "get") {
2922
+ request(endpointOrOptions, queryParams = undefined, headers = undefined, payload = undefined, type = 'get') {
2492
2923
  var _a, _b, _c, _d;
2493
2924
  let endpoint;
2494
- if (typeof endpointOrOptions === "string") {
2925
+ if (typeof endpointOrOptions === 'string') {
2495
2926
  endpoint = endpointOrOptions;
2496
2927
  }
2497
2928
  else {
2498
2929
  const options = endpointOrOptions;
2499
2930
  endpoint = options.endpoint;
2500
2931
  queryParams = (_a = options.queryParams) !== null && _a !== void 0 ? _a : undefined;
2501
- type = (_b = options.type) !== null && _b !== void 0 ? _b : "get";
2932
+ type = (_b = options.type) !== null && _b !== void 0 ? _b : 'get';
2502
2933
  headers = (_c = options.headers) !== null && _c !== void 0 ? _c : undefined;
2503
2934
  payload = (_d = options.payload) !== null && _d !== void 0 ? _d : undefined;
2504
2935
  }
@@ -2506,13 +2937,13 @@ class BaseService extends HttpBaseService {
2506
2937
  .request(endpoint)
2507
2938
  .queryParams(queryParams ? Object.assign({}, queryParams) : undefined)[type]({
2508
2939
  headers: headers ? Object.assign({}, headers) : undefined,
2509
- body: payload ? Object.assign({}, payload) : undefined,
2940
+ body: payload ? Object.assign({}, payload) : undefined
2510
2941
  })).pipe(map((response) => response), this.catchErrors());
2511
2942
  }
2512
2943
  query(pageProviderOrOptions, params = undefined, headers = undefined) {
2513
2944
  var _a, _b;
2514
2945
  let pageProvider;
2515
- if (typeof pageProviderOrOptions === "string") {
2946
+ if (typeof pageProviderOrOptions === 'string') {
2516
2947
  pageProvider = pageProviderOrOptions;
2517
2948
  }
2518
2949
  else {
@@ -2523,7 +2954,7 @@ class BaseService extends HttpBaseService {
2523
2954
  }
2524
2955
  return __classPrivateFieldGet(this, _BaseService_callApiService, "f")
2525
2956
  .query(Object.assign({ pageProvider }, (params ? params : {})), {
2526
- headers: headers ? Object.assign({}, headers) : undefined,
2957
+ headers: headers ? Object.assign({}, headers) : undefined
2527
2958
  })
2528
2959
  .pipe(map((response) => response), this.catchErrors());
2529
2960
  }
@@ -2535,7 +2966,7 @@ class BaseService extends HttpBaseService {
2535
2966
  return this.query({
2536
2967
  pageProvider: options.pageProvider,
2537
2968
  params: Object.assign(Object.assign({}, (options.params ? options.params : {})), (params ? params : {})),
2538
- headers: options.headers,
2969
+ headers: options.headers
2539
2970
  });
2540
2971
  };
2541
2972
  return __classPrivateFieldGet(this, _BaseService_cacheBaseService, "f").startFetchingItems(Object.assign(Object.assign({}, options), { userName: this.userName, request: request }));
@@ -2547,7 +2978,7 @@ class BaseService extends HttpBaseService {
2547
2978
  payload: options.payload,
2548
2979
  params: Object.assign(Object.assign({}, (options.params ? options.params : {})), (params ? params : {})),
2549
2980
  headers: options.headers,
2550
- responseType: options.responseType,
2981
+ responseType: options.responseType
2551
2982
  });
2552
2983
  };
2553
2984
  return __classPrivateFieldGet(this, _BaseService_cacheBaseService, "f").startFetchingItems(Object.assign(Object.assign({}, options), { userName: this.userName, request: request }));
@@ -2574,10 +3005,10 @@ class BaseService extends HttpBaseService {
2574
3005
  }
2575
3006
  _BaseService_nuxeoService = new WeakMap(), _BaseService_callApiService = new WeakMap(), _BaseService_cacheBaseService = new WeakMap();
2576
3007
  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: "root" });
3008
+ BaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseService, providedIn: 'root' });
2578
3009
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseService, decorators: [{
2579
3010
  type: Injectable,
2580
- args: [{ providedIn: "root" }]
3011
+ args: [{ providedIn: 'root' }]
2581
3012
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
2582
3013
 
2583
3014
  /**
@@ -2589,925 +3020,493 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
2589
3020
  * <img [attr.src]="user.avatar | secure | async" />
2590
3021
  * ~~~
2591
3022
  * @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
- * ![Screenshot-1](../screenshots/avatar1.png) ![Screenshot-2](../screenshots/avatar2.png)
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
- * ...
3023
+ * Safe URL
2852
3024
  */
2853
- class MultiValuePipe {
3025
+ class SecurePipe {
3026
+ constructor(http, sanitizer) {
3027
+ this.http = http;
3028
+ this.sanitizer = sanitizer;
3029
+ }
2854
3030
  /**
2855
3031
  *
2856
- * @param values array of strings
2857
- * @param valueSeparator seperator to place between elements
2858
- * @returns the joining of all array items seperated with seperator
3032
+ * @param url Resource URL
3033
+ * @returns Safe URL
2859
3034
  */
2860
- transform(values, valueSeparator = MultiValuePipe.DEFAULT_SEPARATOR) {
2861
- if (values && values instanceof Array) {
2862
- return values.join(valueSeparator);
2863
- }
2864
- return values;
3035
+ transform(url) {
3036
+ return this.http
3037
+ .get(url, { responseType: 'blob' }).pipe(map(val => this.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(val))));
2865
3038
  }
2866
3039
  }
2867
- MultiValuePipe.DEFAULT_SEPARATOR = ', ';
2868
- MultiValuePipefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2869
- MultiValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, name: "multiValue" });
2870
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, decorators: [{
3040
+ 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 });
3041
+ SecurePipepipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, name: "secure" });
3042
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SecurePipe, decorators: [{
2871
3043
  type: Pipe,
2872
- args: [{ name: 'multiValue' }]
2873
- }] });
3044
+ args: [{
3045
+ name: 'secure'
3046
+ }]
3047
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i2$3.DomSanitizer }]; } });
2874
3048
 
2875
3049
  /**
2876
- * transforms file size into translated appropriate units
3050
+ * A component to display user avatar if exists, or initials if not
2877
3051
  *
2878
- * ### In template example:
2879
- * ~~~html
2880
- * <!-- in template -->
2881
- * <p>{{ file.sizeInBytes | FileSize}}</p>
2882
- * ~~~
3052
+ * ![Screenshot-1](../screenshots/avatar1.png) ![Screenshot-2](../screenshots/avatar2.png)
2883
3053
  * @title
2884
- * File Size
2885
- *
3054
+ * User Avatar
2886
3055
  * @example
2887
- * ...
2888
- * constructor(... private FileSizePipe: fileSizePiple ...){
2889
- * const sizeString = this.fileSizePiple.transform(sizeInBytes);
2890
- * }
2891
- * ...
3056
+ *
3057
+ * <cts-avatar [user]="user"></cts-avatar>
2892
3058
  */
2893
- class FileSizePipe {
2894
- constructor(translation) {
2895
- this.translation = translation;
3059
+ class AvatarComponent {
3060
+ constructor() { }
3061
+ ngOnInit() {
3062
+ var _a, _b, _c, _d;
3063
+ 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
3064
  }
2897
- /**
2898
- *
2899
- * @param paramByte Size in Bytes
2900
- * @optional @param decimals Decimals to show
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');
3065
+ stringToHslColor(str, s, l) {
3066
+ var hash = 0;
3067
+ for (var i = 0; i < str.length; i++) {
3068
+ hash = str.charCodeAt(i) + ((hash << 5) - hash);
2913
3069
  }
2914
- 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));
2915
- const i18nSize = this.translation.instant(`FILE_SIZE.${sizes[i]}`);
2916
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + i18nSize;
3070
+ var h = hash % 360;
3071
+ this.backgroundColor = 'hsl(' + h + ', ' + s + '%, ' + l + '%)';
3072
+ }
3073
+ getInitials() {
3074
+ var _a;
3075
+ return ((_a = this.user) === null || _a === void 0 ? void 0 : _a.properties)
3076
+ ? (this.user.properties.initials = [
3077
+ this.user.properties.firstName
3078
+ ? this.user.properties.firstName[0].toUpperCase()
3079
+ : '',
3080
+ this.user.properties.lastName
3081
+ ? this.user.properties.lastName[0].toUpperCase()
3082
+ : '',
3083
+ ].join(''))
3084
+ : '';
2917
3085
  }
2918
3086
  }
2919
- FileSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, deps: [{ token: TranslationService }], target: i0.ɵɵFactoryTarget.Pipe });
2920
- FileSizePipepipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, name: "FileSize", pure: false });
2921
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, decorators: [{
2922
- type: Pipe,
3087
+ AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3088
+ AvatarComponentcmp = 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 } });
3089
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarComponent, decorators: [{
3090
+ type: Component,
2923
3091
  args: [{
2924
- name: 'FileSize',
2925
- pure: false
3092
+ selector: 'cts-avatar',
3093
+ templateUrl: './avatar.component.html',
3094
+ styleUrls: ['./avatar.component.scss']
2926
3095
  }]
2927
- }], ctorParameters: function () { return [{ type: TranslationService }]; } });
3096
+ }], ctorParameters: function () { return []; }, propDecorators: { user: [{
3097
+ type: Input
3098
+ }] } });
2928
3099
 
2929
3100
  /**
2930
- * Transforms and formats date into hijri
3101
+ * Transforms date to localized date string
2931
3102
  *
2932
3103
  * ### In template example:
2933
3104
  * ~~~html
2934
3105
  * <!-- in template -->
2935
- * <p>{{ dateObject | hijriDate : {format:'iYYYY iMMMM iD'}}}</p>
3106
+ * <p>
3107
+ * {{ dateObject | localizedDate: "EEEE, MMMM dd, yyyy" }}
3108
+ * </p>
2936
3109
  * ~~~
2937
3110
  * @title
2938
- * Hijri Date
3111
+ * Localized Date
2939
3112
  *
2940
3113
  * @example
2941
3114
  * ...
2942
- * constructor(... private HijriDatePipe: hijriDatePipe ...){
2943
- * const formattedHijriDate = this.hijriDatePipe.transform(dateObject, 'iYYYY iMMMM iD');
3115
+ * constructor(... private LocalizedDatePipe: localizedDatePipe ...){
3116
+ * const localizedDateString = this.localizedDatePipe.transform(dateObject, 'EEEE, MMMM dd, yyyy');
2944
3117
  * }
2945
3118
  * ...
2946
3119
  */
2947
- class HijriDatePipe {
2948
- constructor() {
2949
- this.defaultFormat = "iYYYY iMMMM iD";
3120
+ class LocalizedDatePipe {
3121
+ constructor(userPreferenceService) {
3122
+ this.userPreferenceService = userPreferenceService;
3123
+ this.defaultLocale = LocalizedDatePipe.DEFAULT_LOCALE;
3124
+ this.defaultFormat = LocalizedDatePipe.DEFAULT_DATE_FORMAT;
3125
+ this.onDestroy$ = new Subject();
3126
+ if (this.userPreferenceService) {
3127
+ this.userPreferenceService
3128
+ .select(UserPreferenceValues.Locale)
3129
+ .pipe(takeUntil(this.onDestroy$))
3130
+ .subscribe(locale => {
3131
+ if (locale) {
3132
+ this.defaultLocale = locale;
3133
+ }
3134
+ });
3135
+ }
2950
3136
  }
2951
3137
  /**
2952
3138
  *
2953
- * @param value Date object
2954
- * @param format Format
2955
- * @returns formatted hijri date string
3139
+ * @param value date object
3140
+ * @param format format
3141
+ * @param locale locale to convert to
3142
+ * @returns localized date string
2956
3143
  */
2957
- transform(value, format) {
2958
- const actualFormat = format || this.defaultFormat;
2959
- const m = moment_(value, 'iYYYY/iM/iD'); // Parse a Hijri date.
2960
- return m.format("iD iMMMM iYYYY");
2961
- }
2962
- }
2963
- HijriDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2964
- HijriDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, name: "hijriDate" });
2965
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, decorators: [{
2966
- type: Pipe,
2967
- args: [{
2968
- name: 'hijriDate'
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
- * ![Screenshot-1](../screenshots/card.png)
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;
3144
+ transform(value, format, locale) {
3145
+ try {
3146
+ const actualFormat = format || this.defaultFormat;
3147
+ const actualLocale = locale || this.defaultLocale;
3148
+ const datePipe = new DatePipe(actualLocale);
3149
+ return datePipe.transform(value, actualFormat, 'GMT+3');
3150
+ }
3151
+ catch (e) {
3152
+ console.warn(e);
3153
+ return value;
3154
+ }
3155
+ }
3156
+ /** @ignore */
3157
+ ngOnDestroy() {
3158
+ this.onDestroy$.next(true);
3159
+ this.onDestroy$.complete();
3044
3160
  }
3045
- ngOnInit() { }
3046
3161
  }
3047
- CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3048
- 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 });
3049
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardComponent, decorators: [{
3050
- type: Component,
3162
+ LocalizedDatePipe.DEFAULT_LOCALE = 'en-US';
3163
+ LocalizedDatePipe.DEFAULT_DATE_FORMAT = 'dd MMMM yyyy hh:mm a';
3164
+ LocalizedDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, deps: [{ token: UserPreferencesService }], target: i0.ɵɵFactoryTarget.Pipe });
3165
+ LocalizedDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, name: "localizedDate", pure: false });
3166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LocalizedDatePipe, decorators: [{
3167
+ type: Pipe,
3051
3168
  args: [{
3052
- selector: 'app-card',
3053
- templateUrl: './card.component.html',
3054
- styleUrls: ['./card.component.scss'],
3055
- encapsulation: ViewEncapsulation.None,
3169
+ name: 'localizedDate',
3170
+ pure: false
3056
3171
  }]
3057
- }], ctorParameters: function () { return []; }, propDecorators: { noBody: [{
3058
- type: Input
3059
- }], dark: [{
3060
- type: Input
3061
- }] } });
3172
+ }], ctorParameters: function () { return [{ type: UserPreferencesService }]; } });
3062
3173
 
3063
3174
  /**
3175
+ * Transforms html string into safe html to be rendered in the view
3176
+ *
3177
+ * ### In template example:
3178
+ * ~~~html
3179
+ * <!-- in template -->
3180
+ * <span [innerHTML]="htmlString | safeHtml"></span>
3181
+ * ~~~
3064
3182
  * @title
3065
- * Card Module
3183
+ * Safe HTML
3066
3184
  */
3067
- class CardModule {
3068
- }
3069
- CardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
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();
3185
+ class SafeHtmlPipe {
3186
+ constructor(sanitized) {
3187
+ this.sanitized = sanitized;
3116
3188
  }
3117
- /*Switch rtl class based on the chosen language from Translation Service*/
3118
- switchClassBasedOnLanguage() {
3119
- this.translation.isArabic.subscribe((arabic) => {
3120
- arabic
3121
- ? this.renderer.addClass(this.elRef.nativeElement, 'rtl')
3122
- : this.renderer.removeClass(this.elRef.nativeElement, 'rtl');
3123
- });
3189
+ /**
3190
+ *
3191
+ * @param value HTML String
3192
+ * @returns Safe HTML
3193
+ */
3194
+ transform(value) {
3195
+ return this.sanitized.bypassSecurityTrustHtml(value);
3124
3196
  }
3125
3197
  }
3126
- 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 });
3127
- SetRtlDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: SetRtlDirective, selector: "[SetRtl]", ngImport: i0 });
3128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetRtlDirective, decorators: [{
3129
- type: Directive,
3130
- args: [{
3131
- selector: '[SetRtl]',
3132
- }]
3133
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: TranslationService }]; } });
3198
+ 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 });
3199
+ SafeHtmlPipepipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
3200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SafeHtmlPipe, decorators: [{
3201
+ type: Pipe,
3202
+ args: [{ name: 'safeHtml' }]
3203
+ }], ctorParameters: function () { return [{ type: i2$3.DomSanitizer }]; } });
3134
3204
 
3135
- class EvaluatorsService {
3136
- constructor(nuxeoService, appConfigService) {
3137
- this.nuxeoService = nuxeoService;
3138
- this.appConfigService = appConfigService;
3139
- this.context = { entity: null, getEvaluator: null, user: null };
3140
- this.asyncEvery = (arr, predicate) => __awaiter(this, void 0, void 0, function* () {
3141
- for (let e of arr) {
3142
- if (!(yield predicate(e))) {
3143
- return false;
3144
- }
3145
- }
3146
- return true;
3147
- });
3148
- this.asyncSome = (arr, predicate) => __awaiter(this, void 0, void 0, function* () {
3149
- for (let e of arr) {
3150
- if (yield predicate(e)) {
3151
- return true;
3152
- }
3153
- }
3154
- return false;
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
- }
3205
+ /**
3206
+ * Converts date into how long time ago string
3207
+ *
3208
+ * ### In template example:
3209
+ * ~~~html
3210
+ * <!-- in template -->
3211
+ * <span>{{ dateObject | timeAgo }}</span>
3212
+ * ~~~
3213
+ * @title
3214
+ * Time Ago
3215
+ */
3216
+ class TimeAgoPipe {
3217
+ constructor(userPreferenceService) {
3218
+ this.userPreferenceService = userPreferenceService;
3219
+ this.onDestroy$ = new Subject();
3220
+ this.userPreferenceService
3221
+ .select(UserPreferenceValues.Locale)
3222
+ .pipe(takeUntil(this.onDestroy$))
3223
+ .subscribe(locale => {
3224
+ this.defaultLocale = locale || TimeAgoPipe.DEFAULT_LOCALE;
3265
3225
  });
3226
+ this.defaultDateTimeFormat = TimeAgoPipe.DEFAULT_DATE_TIME_FORMAT;
3266
3227
  }
3267
- getRuleById(id) {
3268
- return this.conditions[id] ? Object.assign({}, this.conditions[id]) : null;
3228
+ /**
3229
+ *
3230
+ * @param value date object
3231
+ * @param locale locale to be transformed to
3232
+ * @returns Time ago string (15 minutes ago)
3233
+ */
3234
+ transform(value, locale) {
3235
+ if (value !== null && value !== undefined) {
3236
+ const actualLocale = locale || this.defaultLocale;
3237
+ const then = moment$5(value);
3238
+ //const diff = moment().locale(actualLocale).diff(then, 'days');
3239
+ return then.locale(actualLocale).fromNow();
3240
+ // if ( diff > 7) {
3241
+ // const datePipe: DatePipe = new DatePipe(actualLocale);
3242
+ // return datePipe.transform(value, this.defaultDateTimeFormat);
3243
+ // } else {
3244
+ // return then.locale(actualLocale).fromNow();
3245
+ // }
3246
+ }
3247
+ return '';
3269
3248
  }
3270
- getAllRules() {
3271
- return this.appConfigService.conditons;
3249
+ /** @ignore */
3250
+ ngOnDestroy() {
3251
+ this.onDestroy$.next(true);
3252
+ this.onDestroy$.complete();
3272
3253
  }
3273
3254
  }
3274
- 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 });
3275
- EvaluatorsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvaluatorsService, providedIn: "root" });
3276
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: EvaluatorsService, decorators: [{
3277
- type: Injectable,
3278
- args: [{ providedIn: "root" }]
3279
- }], ctorParameters: function () { return [{ type: NuxeoService }, { type: AppConfigService }]; } });
3255
+ TimeAgoPipe.DEFAULT_LOCALE = 'en-US';
3256
+ TimeAgoPipe.DEFAULT_DATE_TIME_FORMAT = 'dd/MM/yyyy HH:mm';
3257
+ TimeAgoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, deps: [{ token: UserPreferencesService }], target: i0.ɵɵFactoryTarget.Pipe });
3258
+ TimeAgoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, name: "timeAgo" });
3259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TimeAgoPipe, decorators: [{
3260
+ type: Pipe,
3261
+ args: [{
3262
+ name: 'timeAgo'
3263
+ }]
3264
+ }], ctorParameters: function () { return [{ type: UserPreferencesService }]; } });
3280
3265
 
3281
3266
  /**
3282
- * Permission directive shows or hides an element,
3283
- * based on a predefined structured condition object in the [conditions.json]{@link ../additional-documentation/conditions-file.html} file.
3284
- * it will evaluate the rule and shows or hides an element based on the result.
3285
- * this directive can evaluate rules against a document object as well,
3286
- * check [conditions.json]{@link ../additional-documentation/conditions-file.html} for more information
3267
+ * Transforms array of strings to single string seperated with seperator
3268
+ *
3269
+ * ### In template example:
3270
+ * ~~~html
3271
+ * <!-- in template -->
3272
+ * <p>{{ ['string 1','string 2', 'string 3'] | multiValue : {valueSeparator:', '}}}</p>
3273
+ * ~~~
3274
+ * @title
3275
+ * Multi Value
3276
+ *
3287
3277
  * @example
3288
- * <div *permission="{ name: 'conditionKey', entity: nuxeoDocumentObject }">
3289
- * Element with permissions
3290
- * </duv>
3291
- * <div *permission="{ name: 'conditionKey2' }">
3292
- * Element with permissions 2
3293
- * </duv>
3278
+ * ...
3279
+ * constructor(... private MultiValuePipe: multiValuePipe ...){
3280
+ * const MultiValueString = this.multiValuePipe.transform(['string 1','string 2', 'string 3'], ', ');
3281
+ * }
3282
+ * ...
3283
+ */
3284
+ class MultiValuePipe {
3285
+ /**
3286
+ *
3287
+ * @param values array of strings
3288
+ * @param valueSeparator seperator to place between elements
3289
+ * @returns the joining of all array items seperated with seperator
3290
+ */
3291
+ transform(values, valueSeparator = MultiValuePipe.DEFAULT_SEPARATOR) {
3292
+ if (values && values instanceof Array) {
3293
+ return values.join(valueSeparator);
3294
+ }
3295
+ return values;
3296
+ }
3297
+ }
3298
+ MultiValuePipe.DEFAULT_SEPARATOR = ', ';
3299
+ MultiValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3300
+ MultiValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, name: "multiValue" });
3301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MultiValuePipe, decorators: [{
3302
+ type: Pipe,
3303
+ args: [{ name: 'multiValue' }]
3304
+ }] });
3305
+
3306
+ /**
3307
+ * transforms file size into translated appropriate units
3308
+ *
3309
+ * ### In template example:
3310
+ * ~~~html
3311
+ * <!-- in template -->
3312
+ * <p>{{ file.sizeInBytes | FileSize}}</p>
3313
+ * ~~~
3294
3314
  * @title
3295
- * Permission
3315
+ * File Size
3316
+ *
3317
+ * @example
3318
+ * ...
3319
+ * constructor(... private FileSizePipe: fileSizePiple ...){
3320
+ * const sizeString = this.fileSizePiple.transform(sizeInBytes);
3321
+ * }
3322
+ * ...
3296
3323
  */
3297
- class PermissionsDirective {
3298
- constructor(nuxeoService, eltRef, viewContainerRef, templateRef, appConfigService, evaluatorsService) {
3299
- this.nuxeoService = nuxeoService;
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 };
3324
+ class FileSizePipe {
3325
+ constructor(translation) {
3326
+ this.translation = translation;
3307
3327
  }
3308
- ngOnInit() {
3309
- this.context.getEvaluator = this.evaluatorsService.getEvaluator;
3310
- if (!this.permission.name) {
3311
- if (!this.isVisible) {
3312
- this.isVisible = true;
3313
- this.viewContainerRef.createEmbeddedView(this.templateRef);
3314
- }
3328
+ /**
3329
+ *
3330
+ * @param paramByte Size in Bytes
3331
+ * @optional @param decimals Decimals to show
3332
+ * @returns translated size string
3333
+ */
3334
+ transform(paramByte, decimals = 2) {
3335
+ if (paramByte == null) {
3336
+ return '';
3315
3337
  }
3316
- else {
3317
- this.context.entity = this.permission.entity;
3318
- this.context.user = this.permission.user || this.nuxeoService.nuxeoClient.user;
3319
- this.evaluatorsService.evaluateRule(this.permission.name, this.context).then((result) => {
3320
- if (result) {
3321
- if (!this.isVisible) {
3322
- this.isVisible = true;
3323
- this.viewContainerRef.createEmbeddedView(this.templateRef);
3324
- }
3325
- }
3326
- else {
3327
- this.isVisible = false;
3328
- this.viewContainerRef.clear();
3329
- }
3330
- });
3338
+ const bytes = parseInt(paramByte, 10);
3339
+ if (isNaN(bytes)) {
3340
+ return '';
3341
+ }
3342
+ if (bytes === 0) {
3343
+ return '0 ' + this.translation.instant('FILE_SIZE.BYTES');
3331
3344
  }
3345
+ 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));
3346
+ const i18nSize = this.translation.instant(`FILE_SIZE.${sizes[i]}`);
3347
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + i18nSize;
3332
3348
  }
3333
3349
  }
3334
- 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 });
3335
- PermissionsDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: PermissionsDirective, selector: "[permission]", inputs: { permission: "permission" }, ngImport: i0 });
3336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PermissionsDirective, decorators: [{
3337
- type: Directive,
3350
+ FileSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, deps: [{ token: TranslationService }], target: i0.ɵɵFactoryTarget.Pipe });
3351
+ FileSizePipepipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, name: "FileSize", pure: false });
3352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FileSizePipe, decorators: [{
3353
+ type: Pipe,
3338
3354
  args: [{
3339
- selector: '[permission]'
3355
+ name: 'FileSize',
3356
+ pure: false
3340
3357
  }]
3341
- }], ctorParameters: function () { return [{ type: NuxeoService }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: AppConfigService }, { type: EvaluatorsService }]; }, propDecorators: { permission: [{
3342
- type: Input
3343
- }] } });
3358
+ }], ctorParameters: function () { return [{ type: TranslationService }]; } });
3344
3359
 
3345
- /** @ignore */
3346
- class SetDirRtlDirective {
3347
- constructor(elRef, renderer, translation) {
3348
- this.elRef = elRef;
3349
- this.renderer = renderer;
3350
- this.translation = translation;
3351
- this.switchDirBasedOnLanguage();
3360
+ /**
3361
+ * Transforms and formats date into hijri
3362
+ *
3363
+ * ### In template example:
3364
+ * ~~~html
3365
+ * <!-- in template -->
3366
+ * <p>{{ dateObject | hijriDate : {format:'iYYYY iMMMM iD'}}}</p>
3367
+ * ~~~
3368
+ * @title
3369
+ * Hijri Date
3370
+ *
3371
+ * @example
3372
+ * ...
3373
+ * constructor(... private HijriDatePipe: hijriDatePipe ...){
3374
+ * const formattedHijriDate = this.hijriDatePipe.transform(dateObject, 'iYYYY iMMMM iD');
3375
+ * }
3376
+ * ...
3377
+ */
3378
+ class HijriDatePipe {
3379
+ constructor() {
3380
+ this.defaultFormat = "iYYYY iMMMM iD";
3352
3381
  }
3353
- switchDirBasedOnLanguage() {
3354
- this.translation.isArabic.subscribe((arabic) => {
3355
- arabic
3356
- ? this.renderer.setAttribute(this.elRef.nativeElement, 'dir', 'rtl')
3357
- : this.renderer.setAttribute(this.elRef.nativeElement, 'dir', 'ltr');
3358
- });
3382
+ /**
3383
+ *
3384
+ * @param value Date object
3385
+ * @param format Format
3386
+ * @returns formatted hijri date string
3387
+ */
3388
+ transform(value, format) {
3389
+ const actualFormat = format || this.defaultFormat;
3390
+ const m = moment_(value, 'iYYYY/iM/iD'); // Parse a Hijri date.
3391
+ return m.format("iD iMMMM iYYYY");
3359
3392
  }
3360
3393
  }
3361
- 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 });
3362
- SetDirRtlDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: SetDirRtlDirective, selector: "[SetDirRtl]", ngImport: i0 });
3363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SetDirRtlDirective, decorators: [{
3364
- type: Directive,
3394
+ HijriDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3395
+ HijriDatePipepipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, name: "hijriDate" });
3396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: HijriDatePipe, decorators: [{
3397
+ type: Pipe,
3398
+ args: [{
3399
+ name: 'hijriDate'
3400
+ }]
3401
+ }] });
3402
+
3403
+ /**
3404
+ * @title
3405
+ * Pipes Module
3406
+ */
3407
+ class PipesModule {
3408
+ }
3409
+ PipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3410
+ 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] });
3411
+ PipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, providers: [TimeAgoPipe, MultiValuePipe], imports: [[CommonModule]] });
3412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PipesModule, decorators: [{
3413
+ type: NgModule,
3365
3414
  args: [{
3366
- selector: '[SetDirRtl]',
3415
+ declarations: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe],
3416
+ imports: [CommonModule],
3417
+ exports: [SecurePipe, LocalizedDatePipe, SafeHtmlPipe, TimeAgoPipe, MultiValuePipe, FileSizePipe, HijriDatePipe],
3418
+ providers: [TimeAgoPipe, MultiValuePipe],
3367
3419
  }]
3368
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: TranslationService }]; } });
3420
+ }] });
3369
3421
 
3370
- class AppHasRoleDirective {
3371
- constructor(viewContainerRef, templateRef, nuxeoService) {
3372
- this.viewContainerRef = viewContainerRef;
3373
- this.templateRef = templateRef;
3374
- this.nuxeoService = nuxeoService;
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
- }
3422
+ /**
3423
+ * @title
3424
+ * Avatar Module
3425
+ */
3426
+ class AvatarModule {
3415
3427
  }
3416
- 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 });
3417
- AppHasRoleDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: AppHasRoleDirective, selector: "[appHasRole]", inputs: { appHasRole: "appHasRole" }, usesOnChanges: true, ngImport: i0 });
3418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AppHasRoleDirective, decorators: [{
3419
- type: Directive,
3428
+ AvatarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3429
+ AvatarModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, declarations: [AvatarComponent], imports: [CommonModule,
3430
+ PipesModule], exports: [AvatarComponent] });
3431
+ AvatarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, imports: [[
3432
+ CommonModule,
3433
+ PipesModule
3434
+ ]] });
3435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AvatarModule, decorators: [{
3436
+ type: NgModule,
3420
3437
  args: [{
3421
- selector: '[appHasRole]'
3438
+ declarations: [AvatarComponent],
3439
+ imports: [
3440
+ CommonModule,
3441
+ PipesModule
3442
+ ],
3443
+ exports: [
3444
+ AvatarComponent
3445
+ ]
3422
3446
  }]
3423
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: NuxeoService }]; }, propDecorators: { appHasRole: [{
3424
- type: Input
3425
- }] } });
3447
+ }] });
3426
3448
 
3427
- class DragAndDropDirective {
3449
+ /**
3450
+ * A reusable card component to display various types of contents
3451
+ *
3452
+ * ![Screenshot-1](../screenshots/card.png)
3453
+ * @title
3454
+ * Card
3455
+ * @example
3456
+ *
3457
+ * <app-card>
3458
+ * <h3 class="title">
3459
+ * Card title
3460
+ * </h3>
3461
+ * <div class="my-toolbar">
3462
+ * <button class="btn-primary"> Action Button </button>
3463
+ * </div>
3464
+ * <div class="body">
3465
+ * </div>
3466
+ * </app-card>
3467
+ */
3468
+ class CardComponent {
3469
+ /** enable/disable shadow */
3428
3470
  constructor() {
3429
- this.fileDroped = new EventEmitter();
3430
- }
3431
- onDragOver(evt) {
3432
- evt.preventDefault();
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
- }
3471
+ /** card has no body */
3472
+ this.noBody = false;
3473
+ /** is card dark */
3474
+ this.dark = false;
3449
3475
  }
3476
+ ngOnInit() { }
3450
3477
  }
3451
- DragAndDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DragAndDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3452
- DragAndDropDirectivedir = 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 });
3453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DragAndDropDirective, decorators: [{
3454
- type: Directive,
3478
+ CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3479
+ CardComponentcmp = 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 });
3480
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardComponent, decorators: [{
3481
+ type: Component,
3455
3482
  args: [{
3456
- selector: '[appDragAndDrop]'
3483
+ selector: 'app-card',
3484
+ templateUrl: './card.component.html',
3485
+ styleUrls: ['./card.component.scss'],
3486
+ encapsulation: ViewEncapsulation.None,
3457
3487
  }]
3458
- }], ctorParameters: function () { return []; }, propDecorators: { fileDroped: [{
3459
- type: Output
3460
- }], onDragOver: [{
3461
- type: HostListener,
3462
- args: ['dragover', ['$event']]
3463
- }], onDragLeave: [{
3464
- type: HostListener,
3465
- args: ['dragleave', ['$event']]
3466
- }], onDrop: [{
3467
- type: HostListener,
3468
- args: ['drop', ['$event']]
3488
+ }], ctorParameters: function () { return []; }, propDecorators: { noBody: [{
3489
+ type: Input
3490
+ }], dark: [{
3491
+ type: Input
3469
3492
  }] } });
3470
3493
 
3471
3494
  /**
3472
3495
  * @title
3473
- * Directives Module
3496
+ * Card Module
3474
3497
  */
3475
- class DirectiveModule {
3498
+ class CardModule {
3476
3499
  }
3477
- DirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3478
- DirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DirectiveModule, declarations: [ClickOutsideDirective,
3479
- SetRtlDirective,
3480
- PermissionsDirective,
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: [{
3500
+ CardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3501
+ CardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, declarations: [CardComponent], imports: [CommonModule], exports: [CardComponent] });
3502
+ CardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, providers: [], imports: [[CommonModule]] });
3503
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CardModule, decorators: [{
3491
3504
  type: NgModule,
3492
3505
  args: [{
3493
- declarations: [
3494
- ClickOutsideDirective,
3495
- SetRtlDirective,
3496
- PermissionsDirective,
3497
- SetDirRtlDirective,
3498
- AppHasRoleDirective,
3499
- DragAndDropDirective
3500
- ],
3506
+ declarations: [CardComponent],
3501
3507
  imports: [CommonModule],
3502
- exports: [
3503
- ClickOutsideDirective,
3504
- SetRtlDirective,
3505
- PermissionsDirective,
3506
- SetDirRtlDirective,
3507
- AppHasRoleDirective,
3508
- DragAndDropDirective
3509
- ],
3510
- providers: []
3508
+ exports: [CardComponent],
3509
+ providers: [],
3511
3510
  }]
3512
3511
  }] });
3513
3512
 
@@ -28546,54 +28545,6 @@ const createDiagramEditor = (container, injector, config) => __awaiter(void 0, v
28546
28545
  };
28547
28546
  });
28548
28547
 
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
28548
  /**
28598
28549
  *
28599
28550
  * @param node
@@ -28686,6 +28637,28 @@ const _updateConnections = (outputs, inputs, editor) => __awaiter(void 0, void 0
28686
28637
  yield editor.addConnection(connection);
28687
28638
  });
28688
28639
 
28640
+ function serializePort(port) {
28641
+ return {
28642
+ id: port.id,
28643
+ label: port.label,
28644
+ socket: {
28645
+ name: port.socket.name,
28646
+ },
28647
+ };
28648
+ }
28649
+ function serializeControl(control) {
28650
+ if (control instanceof ClassicPreset.InputControl) {
28651
+ return {
28652
+ __type: 'ClassicPreset.InputControl',
28653
+ id: control.id,
28654
+ readonly: control.readonly,
28655
+ type: control.type,
28656
+ value: control.value,
28657
+ };
28658
+ }
28659
+ return null;
28660
+ }
28661
+
28689
28662
  class DiagramService {
28690
28663
  /**
28691
28664
  *
@@ -31734,5 +31707,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
31734
31707
  * Generated bundle index. Do not edit.
31735
31708
  */
31736
31709
 
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$, exportGraph, extensionJsonsFactory, filterEnabled, getConnections, getValue, mergeArrays, mergeObjects, minute$1 as minute, provideExtensionConfig, reduceEmptyMenus, reduceSeparators, removeConnections, removeNode, removeNodeAndConnections, serializeControl, serializePort, sortByOrder };
31710
+ 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
31711
  //# sourceMappingURL=nuxeo-development-framework.js.map