nuxeo-development-framework 0.0.8-bos → 0.0.9-bos

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.
@@ -15,9 +15,10 @@ import * as i1$2 from 'legacy-ngx-treeview';
15
15
  import { TreeviewModule, TreeviewItem, DefaultTreeviewI18n, TreeviewConfig, TreeviewHelper, DropdownTreeviewComponent, TreeviewI18n } from 'legacy-ngx-treeview';
16
16
  import * as i1$3 from 'ngx-toastr';
17
17
  import { ToastrModule, Toast } from 'ngx-toastr';
18
- import { ReplaySubject, iif, of, combineLatest, throwError, Observable, forkJoin, BehaviorSubject, from, pipe, Subject, isObservable, EMPTY, concat, map as map$1, distinctUntilChanged as distinctUntilChanged$1, filter as filter$2, takeUntil as takeUntil$1, catchError as catchError$1, fromEvent, take as take$1, switchMap as switchMap$1, tap as tap$1 } from 'rxjs';
18
+ import { ReplaySubject, iif, of, combineLatest, throwError, Observable, forkJoin, BehaviorSubject, from, firstValueFrom, pipe, Subject, isObservable, EMPTY, concat, map as map$1, distinctUntilChanged as distinctUntilChanged$1, filter as filter$2, takeUntil as takeUntil$1, catchError as catchError$1, fromEvent, take as take$1, switchMap as switchMap$1, tap as tap$1 } from 'rxjs';
19
+ import * as _ from 'lodash';
20
+ import ___default, { orderBy, reduce, mergeWith, isArray, merge, omit, cloneDeep, keys, trim, get, set, values, filter, sortBy, each, unionWith, isEqual, isNil, includes, isObject as isObject$1, isDate, isBoolean, isNumber, flatMap, map as map$2 } from 'lodash';
19
21
  import { map, retry, catchError, distinctUntilChanged, takeUntil, take, tap, switchMap, first, delay, expand, last, skip, debounceTime, filter as filter$1, finalize, startWith, retryWhen, concatMap, mergeMap } from 'rxjs/operators';
20
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
21
22
  import CryptoJS from 'crypto-js';
22
23
  import { __decorate, __param } from 'tslib';
23
24
  import Nuxeo from 'nuxeo';
@@ -25,8 +26,6 @@ import doFetch from 'nuxeo/lib/deps/fetch';
25
26
  import Unmarshallers from 'nuxeo/lib/unmarshallers/unmarshallers';
26
27
  import qs from 'querystring';
27
28
  import * as i3 from 'ngx-cookie-service';
28
- import * as _ from 'lodash';
29
- import ___default, { merge, omit, cloneDeep, keys, trim, get, set, values, filter, sortBy, each, unionWith, isEqual, isNil, includes, isObject as isObject$1, isDate, isBoolean, isNumber, flatMap, map as map$2 } from 'lodash';
30
29
  import * as i1$4 from '@angular/router';
31
30
  import { RoutesRecognized, ActivatedRoute, Router, RouterModule, NavigationStart } from '@angular/router';
32
31
  import * as i2$4 from '@angular/material/core';
@@ -96,6 +95,7 @@ import _isEqual from 'lodash/isEqual';
96
95
  import * as i6 from '@swimlane/ngx-datatable';
97
96
  import { ColumnMode, DatatableComponent, NgxDatatableModule } from '@swimlane/ngx-datatable';
98
97
  import { SelectionModel } from '@angular/cdk/collections';
98
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
99
99
  import * as i2$5 from '@angular/material/button-toggle';
100
100
  import { MatButtonToggleModule } from '@angular/material/button-toggle';
101
101
  import * as i8$2 from '@angular/cdk/drag-drop';
@@ -215,7 +215,8 @@ class TranslateLoaderService {
215
215
  return this.providers.find((x) => x.name === name) ? true : false;
216
216
  }
217
217
  fetchLanguageFile(lang, component, fallbackUrl) {
218
- const translationUrl = fallbackUrl || `${component.path}/${this.prefix}/${lang}${this.suffix}?v=${Date.now()}`;
218
+ const translationUrl = fallbackUrl ||
219
+ `${component.path}/${this.prefix}/${lang}${this.suffix}?v=${Date.now()}`;
219
220
  return this.http.get(translationUrl).pipe(map((res) => {
220
221
  component.json[lang] = res;
221
222
  }), retry(3), catchError(() => {
@@ -251,24 +252,16 @@ class TranslateLoaderService {
251
252
  return (this.queue[lang] || []).find((x) => x === name) ? true : false;
252
253
  }
253
254
  getFullTranslationJSON(lang) {
254
- let result = {};
255
- this.providers
256
- .slice(0)
257
- .sort((a, b) => {
258
- if (a.name === 'app') {
259
- return 1;
260
- }
261
- if (b.name === 'app') {
262
- return -1;
263
- }
264
- return a.name.localeCompare(b.name);
265
- })
266
- .forEach((model) => {
267
- if (model.json && model.json[lang]) {
268
- result = this.merge(result, model.json[lang]);
269
- }
270
- });
271
- return result;
255
+ const sortedProviders = orderBy(this.providers, [
256
+ (p) => p.name === 'app', // push "app" last
257
+ 'name',
258
+ ], ['asc', 'asc']);
259
+ return reduce(sortedProviders, (result, provider) => {
260
+ const translation = provider?.json?.[lang];
261
+ return translation
262
+ ? mergeWith(result, translation, this._mergeCustomizer)
263
+ : result;
264
+ }, {});
272
265
  }
273
266
  getTranslation(lang) {
274
267
  let hasFailures = false;
@@ -279,7 +272,7 @@ class TranslateLoaderService {
279
272
  hasFailures = true;
280
273
  return of(error);
281
274
  }));
282
- })
275
+ }),
283
276
  ];
284
277
  return new Observable((observer) => {
285
278
  if (batch.length > 0) {
@@ -307,22 +300,11 @@ class TranslateLoaderService {
307
300
  }
308
301
  });
309
302
  }
310
- merge(...objects) {
311
- const result = {};
312
- objects.forEach((source) => {
313
- Object.keys(source).forEach((prop) => {
314
- if (prop in result && Array.isArray(result[prop])) {
315
- result[prop] = result[prop].concat(source[prop]);
316
- }
317
- else if (prop in result && typeof result[prop] === 'object') {
318
- result[prop] = this.merge(result[prop], source[prop]);
319
- }
320
- else {
321
- result[prop] = source[prop];
322
- }
323
- });
324
- });
325
- return result;
303
+ _mergeCustomizer(objValue, srcValue) {
304
+ if (isArray(objValue) && isArray(srcValue)) {
305
+ return [...objValue, ...srcValue];
306
+ }
307
+ return undefined;
326
308
  }
327
309
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TranslateLoaderService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
328
310
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TranslateLoaderService, providedIn: 'root' }); }
@@ -330,7 +312,7 @@ class TranslateLoaderService {
330
312
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TranslateLoaderService, decorators: [{
331
313
  type: Injectable,
332
314
  args: [{
333
- providedIn: 'root'
315
+ providedIn: 'root',
334
316
  }]
335
317
  }], ctorParameters: () => [{ type: i1.HttpClient }] });
336
318
 
@@ -1118,42 +1100,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1118
1100
 
1119
1101
  const TRANSLATION_PROVIDER = new InjectionToken('Injection token for translation providers.');
1120
1102
  class TranslationService {
1121
- constructor(translate, rendererFactory, localStorage, userPreferencesService, appConfig, nuxeoService, environment, providers) {
1103
+ constructor(translate, http, rendererFactory, localStorage, userPreferencesService, appConfig, nuxeoService, environment, providers) {
1122
1104
  this.translate = translate;
1105
+ this.http = http;
1123
1106
  this.rendererFactory = rendererFactory;
1124
1107
  this.localStorage = localStorage;
1108
+ this.userPreferencesService = userPreferencesService;
1125
1109
  this.appConfig = appConfig;
1126
1110
  this.nuxeoService = nuxeoService;
1127
1111
  this.environment = environment;
1112
+ this.providers = providers;
1128
1113
  this.isArabic = new BehaviorSubject(false);
1129
1114
  this.isArabic$ = this.isArabic.asObservable();
1130
- this.appConfig.configLoaded.pipe(takeUntilDestroyed()).subscribe(() => {
1131
- this.translationApiName = this.appConfig.myConfiguration['translationApi'] ? this.appConfig.myConfiguration['translationApi'] : null;
1132
- });
1133
- this.customLoader = this.translate.currentLoader;
1134
- this.renderer = rendererFactory.createRenderer(null, null);
1115
+ this._cacheMap = new Map();
1116
+ this._init();
1117
+ }
1118
+ async _getTranslationApiName() {
1119
+ const config = await firstValueFrom(this.appConfig.configLoaded.pipe(map((_) => this.appConfig.myConfiguration)));
1120
+ return config['translationApi'] || 'AC_UA_CTS_Translation_GetOrCreate';
1121
+ }
1122
+ async _init() {
1135
1123
  this.defaultLang = 'en';
1136
- translate.setDefaultLang(this.defaultLang);
1124
+ this.translationApiName = await this._getTranslationApiName();
1125
+ this.customLoader = this.translate.currentLoader;
1137
1126
  this.customLoader.setDefaultLang(this.defaultLang);
1138
- if (providers && providers.length > 0) {
1139
- for (const provider of providers) {
1127
+ this.translate.setDefaultLang(this.defaultLang);
1128
+ this.renderer = this.rendererFactory.createRenderer(null, null);
1129
+ if (this.providers && this.providers.length > 0) {
1130
+ for (const provider of this.providers) {
1140
1131
  this.addTranslationFolder(provider.name, provider.source);
1141
1132
  }
1142
1133
  }
1143
- userPreferencesService
1134
+ this.userPreferencesService
1144
1135
  .select(UserPreferenceValues.Locale)
1145
1136
  .subscribe((locale) => {
1146
1137
  if (locale) {
1147
1138
  this.userLang = locale.split('-')[0];
1148
1139
  }
1149
- if (this.nuxeoService.nuxeoClient) {
1150
- if (this.userLang) {
1151
- this.loadTranslation(this.userLang, this.defaultLang);
1152
- }
1153
- else {
1154
- this.loadTranslation(this.defaultLang);
1155
- }
1156
- }
1140
+ this.loadTranslation(this.userLang || this.defaultLang);
1157
1141
  });
1158
1142
  }
1159
1143
  /**
@@ -1171,40 +1155,47 @@ class TranslationService {
1171
1155
  * @param lang Language code for the language to load
1172
1156
  * @param fallback Language code to fall back to if the first one was unavailable
1173
1157
  */
1174
- loadTranslation(lang, fallback) {
1158
+ loadTranslation(lang) {
1159
+ this.isArabic.next(lang === Lang.Arabic);
1175
1160
  if (lang === Lang.Arabic) {
1176
1161
  this.renderer.addClass(document.body, 'rtl');
1177
- this.isArabic.next(true);
1178
1162
  }
1179
1163
  else {
1180
1164
  this.renderer.removeClass(document.body, 'rtl');
1181
- this.isArabic.next(false);
1182
- }
1183
- const arabicFile$ = this.getOrCreateTranslationFile('ar');
1184
- const englishFile$ = this.getOrCreateTranslationFile('en');
1185
- this.loadSub?.unsubscribe();
1186
- this.loadSub = forkJoin([
1187
- arabicFile$,
1188
- englishFile$,
1189
- this.translate.getTranslation(lang),
1190
- ]).subscribe({
1191
- next: (res) => {
1192
- this.arabicFile = res[0];
1193
- this.englishFile = res[1];
1194
- this.translate.use(lang);
1195
- let ArorEnFile = lang === 'en'
1196
- ? JSON.parse(res[1].properties['note:note'])
1197
- : JSON.parse(res[0].properties['note:note']);
1198
- this.translate.setTranslation(this.translate.currentLang, { ...ArorEnFile }, true);
1199
- this.onTranslationChanged(lang);
1200
- },
1201
- error: () => {
1202
- if (fallback && fallback !== lang) {
1203
- this.loadTranslation(fallback);
1204
- }
1205
- }
1165
+ }
1166
+ if (this._cacheMap.has(lang)) {
1167
+ this.translate.getTranslation(lang).subscribe((res) => {
1168
+ this._setTranslations(lang, this._cacheMap.get(lang));
1169
+ this._use(lang);
1170
+ });
1171
+ return;
1172
+ }
1173
+ forkJoin({
1174
+ arabic: this.getOrCreateTranslationFile('ar'),
1175
+ english: this.getOrCreateTranslationFile('en'),
1176
+ default: this.translate.getTranslation(lang),
1177
+ }).subscribe(({ arabic, english }) => {
1178
+ this.arabicFile = arabic;
1179
+ this.englishFile = english;
1180
+ this._setTranslations('ar', this._parseTranslations(arabic));
1181
+ this._setTranslations('en', this._parseTranslations(english));
1182
+ this._use(lang);
1206
1183
  });
1207
1184
  }
1185
+ _parseTranslations(file) {
1186
+ return JSON.parse(file.properties['note:note'] || '{}');
1187
+ }
1188
+ _use(lang) {
1189
+ this.translate.use(lang);
1190
+ this.onTranslationChanged(lang);
1191
+ }
1192
+ _setTranslations(lang, translations) {
1193
+ if (!translations || !Object.keys(translations).length) {
1194
+ return;
1195
+ }
1196
+ this.translate.setTranslation(lang, translations, true);
1197
+ this._cacheMap.set(lang, translations);
1198
+ }
1208
1199
  /**
1209
1200
  * Triggers a notification callback when the translation language changes.
1210
1201
  * @param lang The new language code
@@ -1243,19 +1234,14 @@ class TranslationService {
1243
1234
  return key ? this.translate.instant(key, interpolateParams) : '';
1244
1235
  }
1245
1236
  getOrCreateTranslationFile(lang) {
1246
- return from(this.nuxeoService.nuxeoClient
1247
- .operation(this.translationApiName ? this.translationApiName : 'AC_UA_Translation_GetOrCreate', {
1248
- url: `${this.environment.nuxeo}${this.environment.customAutomation}`,
1249
- })
1250
- .params({ language: lang })
1251
- .execute({
1237
+ const url = `${this.environment.nuxeo}${this.environment.customAutomation}/${this.translationApiName}`;
1238
+ return this.http
1239
+ .post(url, { params: { language: lang }, context: {} }, {
1252
1240
  headers: {
1253
1241
  properties: '*',
1254
1242
  },
1255
- })).pipe(catchError((err) => {
1256
- console.log(err);
1257
- throw err;
1258
- }));
1243
+ })
1244
+ .pipe(retry(2));
1259
1245
  }
1260
1246
  updateTranslationFile(doc, params = {}) {
1261
1247
  return from(this.nuxeoService.nuxeoClient
@@ -1269,7 +1255,7 @@ class TranslationService {
1269
1255
  throw err;
1270
1256
  }));
1271
1257
  }
1272
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TranslationService, deps: [{ token: i1$1.TranslateService }, { token: i0.RendererFactory2 }, { token: LocalStoragService }, { token: UserPreferencesService }, { token: AppConfigService }, { token: NuxeoService }, { token: 'environment' }, { token: TRANSLATION_PROVIDER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1258
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TranslationService, deps: [{ token: i1$1.TranslateService }, { token: i1.HttpClient }, { token: i0.RendererFactory2 }, { token: LocalStoragService }, { token: UserPreferencesService }, { token: AppConfigService }, { token: NuxeoService }, { token: 'environment' }, { token: TRANSLATION_PROVIDER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1273
1259
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TranslationService, providedIn: 'root' }); }
1274
1260
  }
1275
1261
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TranslationService, decorators: [{
@@ -1277,7 +1263,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
1277
1263
  args: [{
1278
1264
  providedIn: 'root',
1279
1265
  }]
1280
- }], ctorParameters: () => [{ type: i1$1.TranslateService }, { type: i0.RendererFactory2 }, { type: LocalStoragService }, { type: UserPreferencesService }, { type: AppConfigService }, { type: NuxeoService }, { type: undefined, decorators: [{
1266
+ }], ctorParameters: () => [{ type: i1$1.TranslateService }, { type: i1.HttpClient }, { type: i0.RendererFactory2 }, { type: LocalStoragService }, { type: UserPreferencesService }, { type: AppConfigService }, { type: NuxeoService }, { type: undefined, decorators: [{
1281
1267
  type: Inject,
1282
1268
  args: ['environment']
1283
1269
  }] }, { type: undefined, decorators: [{
@@ -8389,7 +8375,6 @@ class DynamicFormSelectItemComponent {
8389
8375
  this.ngSelectComponent.handleClearClick();
8390
8376
  }
8391
8377
  onFocus(event) {
8392
- console.log(this.ngSelectComponent, event);
8393
8378
  }
8394
8379
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DynamicFormSelectItemComponent, deps: [{ token: i1$1.TranslateService }, { token: i2$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
8395
8380
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: DynamicFormSelectItemComponent, isStandalone: false, selector: "app-dynamic-form-selectitem", inputs: { id: "id", notFoundText: "notFoundText", loadingText: "loadingText", label: "label", bindValue: "bindValue", bindLabel: "bindLabel", data: "data", placeholder: "placeholder", multiple: "multiple", searchable: "searchable", closeOnSelect: "closeOnSelect", hideSelectedItems: "hideSelectedItems", disabled: "disabled", clear: "clear", voc: "voc", vocId: "vocId", loading: "loading" }, outputs: { onSelectItems: "onSelectItems" }, viewQueries: [{ propertyName: "ngSelectComponent", first: true, predicate: NgSelectComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"label\">\r\n <div>\r\n <label class=\"select-label\" [attr.for]=\"id\"\r\n >{{ label | translate\r\n }}<span *ngIf=\"isRequired()\" class=\"text-danger mx-1\">*</span></label\r\n >\r\n </div>\r\n</ng-container>\r\n<ng-select\r\n [id]=\"id\"\r\n [items]=\"buffer\"\r\n [bindLabel]=\"bindLabel\"\r\n [bindValue]=\"bindValue\"\r\n [placeholder]=\"placeholder\"\r\n [multiple]=\"multiple\"\r\n [clearable]=\"clear\"\r\n [notFoundText]=\"notFoundText || ('noData' | translate)\"\r\n [loadingText]=\"loadingText || ('gettingData' | translate)\"\r\n [searchable]=\"searchable\"\r\n [closeOnSelect]=\"closeOnSelect\"\r\n [hideSelected]=\"hideSelectedItems\"\r\n [searchFn]=\"onSearch\"\r\n [loading]=\"loading\"\r\n (scrollToEnd)=\"onScrollToEnd()\"\r\n [disabled]=\"disabled\"\r\n (change)=\"emitSelection($event)\"\r\n [(ngModel)]=\"selection\"\r\n (focus)=\"onFocus($event)\"\r\n>\r\n <!-- template for viewing options in single and multi select -->\r\n <ng-template\r\n ng-option-tmp\r\n let-item=\"item\"\r\n let-item$=\"item$\"\r\n let-index=\"index\"\r\n >\r\n <div class=\"option-wrapper\">\r\n <span class=\"check-box-wrapper\" *ngIf=\"multiple\">\r\n <input\r\n id=\"item-{{ index }}\"\r\n type=\"checkbox\"\r\n [ngModel]=\"item$.selected\"\r\n />\r\n <span class=\"icon-wrapper\">\r\n <span class=\"bi bi-check2 icon\"></span>\r\n </span>\r\n </span>\r\n <span\r\n *ngIf=\"!voc\"\r\n class=\"label-wrapper\"\r\n [title]=\"item[bindLabel] | translate\"\r\n >\r\n {{ item[bindLabel] | translate }}\r\n </span>\r\n <span\r\n *ngIf=\"voc\"\r\n class=\"label-wrapper\"\r\n [title]=\"'vocabulary.' + vocId + '.' + item[bindValue] | translate\"\r\n >\r\n {{ \"vocabulary.\" + vocId + \".\" + item[bindValue] | translate }}\r\n </span>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- template for viewing single select selected value -->\r\n <ng-template ng-label-tmp let-item=\"item\">\r\n <span\r\n *ngIf=\"!voc\"\r\n [title]=\"(bindLabel ? item[bindLabel] : item) | translate\"\r\n >\r\n {{ (bindLabel ? item[bindLabel] : item) | translate }}\r\n </span>\r\n <span\r\n *ngIf=\"voc\"\r\n [title]=\"'vocabulary.' + vocId + '.' + item[bindValue] | translate\"\r\n >\r\n {{ \"vocabulary.\" + vocId + \".\" + item[bindValue] | translate }}\r\n </span>\r\n </ng-template>\r\n\r\n <!-- template for viewing multi select selected values -->\r\n <ng-template ng-multi-label-tmp let-items=\"items\" let-clear=\"clear\">\r\n <div class=\"ng-value\" *ngFor=\"let item of items ? items : []\">\r\n <span\r\n *ngIf=\"!voc\"\r\n class=\"ng-value-label\"\r\n [title]=\"(bindLabel ? item[bindLabel] : item) | translate\"\r\n >\r\n {{ (bindLabel ? item[bindLabel] : item) | translate }}\r\n </span>\r\n <span\r\n *ngIf=\"voc\"\r\n [title]=\"'vocabulary.' + vocId + '.' + item[bindValue] | translate\"\r\n >\r\n {{ \"vocabulary.\" + vocId + \".\" + item[bindValue] | translate }}\r\n </span>\r\n <span\r\n *ngIf=\"clear\"\r\n class=\"ng-value-icon right\"\r\n (click)=\"clear(item)\"\r\n aria-hidden=\"true\"\r\n >\u00D7</span\r\n >\r\n </div>\r\n </ng-template>\r\n</ng-select>\r\n<mat-error\r\n [attr.data-automation-id]=\"'card-textitem-error-'\"\r\n class=\"app-textitem-editable-error\"\r\n *ngIf=\"hasErrors()\"\r\n>\r\n <ul>\r\n <li *ngIf=\"control.errors.required\">\r\n {{ \"VALIDATORS.REQUIRED\" | translate }}\r\n </li>\r\n </ul>\r\n</mat-error>\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:700;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}.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,.my-dynamic-viewer .direction-img .outgoing,.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,.my-dynamic-viewer.vertical .my-value{width:auto}.my-dynamic-viewer.with-out-label{width:100%!important}.select-label{color:#646f85;font-size:13px;margin-bottom:5px}.ng-select-container{border:1px solid #ccc!important;border-radius:5px!important;background-color:#8f98aa1a!important;height:40px!important;box-shadow:none!important}.ng-select-container .ng-value-container{padding:0 10px!important}.ng-select-container .ng-value-container .ng-placeholder{padding:0 5px;font-size:12px;margin-top:-3px}.ng-select-container .ng-value-container .ng-value{color:#495057}.ng-select-container .ng-arrow-wrapper{padding:0 20px}.ng-select-container .ng-input{left:10px;right:10px;width:auto}.ng-select-disabled .ng-select-container{background-color:#e9ecef!important}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .option-wrapper .check-box-wrapper{position:relative}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .option-wrapper .check-box-wrapper input{visibility:hidden;width:20px;height:20px}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .option-wrapper .check-box-wrapper .icon-wrapper{position:absolute;top:0;left:0;width:20px;height:20px;border:1px solid #2e62df;display:flex;justify-content:center;align-items:center}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .option-wrapper .check-box-wrapper .icon-wrapper .icon{color:#2e62df;display:none;justify-content:center;align-items:center;font-weight:700}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option-selected .option-wrapper .check-box-wrapper .icon-wrapper .icon{display:flex}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option-selected .option-wrapper .label-wrapper{color:#2e62df}.ng-select-container.ng-has-value{border-color:#1a96c6!important}.ng-select .ng-select-focused:not(.ng-select-opened) .ng-select-container{border-color:#ccc;box-shadow:none}.rtl .ng-select .ng-select-container .ng-value-container .ng-input{padding-left:50px!important;padding-right:0!important}\n"], dependencies: [{ kind: "directive", type: i1$5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i3$5.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "tabFocusOnClearButton", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i3$5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i3$5.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "directive", type: i3$5.NgMultiLabelTemplateDirective, selector: "[ng-multi-label-tmp]" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
@@ -21582,8 +21567,7 @@ class FiltersPanelComponent extends BaseFiltersPanel {
21582
21567
  this.nuxeoService = nuxeoService;
21583
21568
  this.currentLang = this._translateService.currentLang;
21584
21569
  this.direction$ = this._translateService.onLangChange.pipe(startWith({ lang: this._translateService.currentLang }), map((lang) => {
21585
- this.currentLang = lang.lang;
21586
- return lang.lang === "ar" ? "rtl" : "ltr";
21570
+ return lang.lang === 'ar' ? 'rtl' : 'ltr';
21587
21571
  }));
21588
21572
  this._fieldsSub = new BehaviorSubject([]);
21589
21573
  this._activeQuerySub = new BehaviorSubject(null);
@@ -21592,6 +21576,12 @@ class FiltersPanelComponent extends BaseFiltersPanel {
21592
21576
  this.FieldRenderType = AGGREGATION_FIELD_TYPES;
21593
21577
  this.visibleFields = {};
21594
21578
  this.formGroup = new UntypedFormGroup({});
21579
+ this._translateService.onLangChange
21580
+ .pipe(takeUntil(this.destroy$))
21581
+ .subscribe((lang) => {
21582
+ this.currentLang = lang.lang;
21583
+ this._evaluateConditions();
21584
+ });
21595
21585
  }
21596
21586
  trackByFieldKey(_, field) {
21597
21587
  return field?.config?.fieldKey;
@@ -21693,7 +21683,7 @@ class FiltersPanelComponent extends BaseFiltersPanel {
21693
21683
  }
21694
21684
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FiltersPanelComponent, decorators: [{
21695
21685
  type: Component,
21696
- args: [{ selector: "app-filters-panel", changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div [formGroup]=\"formGroup\" class=\"filters-panel\" [dir]=\"direction$ | async\">\r\n\t<div class=\"reset-filter reset-container\">\r\n\t\t<button mat-stroked-button class=\"w-full\" (click)=\"resetFilters()\" [disabled]=\"!hasValues\">\r\n\t\t\t{{ 'BUTTONS.clearFilter' | translate }}\r\n\t\t</button>\r\n\t</div>\r\n\t<ng-container *ngFor=\"let field of fields | filterByRoles; trackBy: trackByFieldKey\">\r\n\t\t<ng-container *permission=\"{ name: field.config?.permission }\">\r\n\t\t\t<ng-container *ngIf=\"visibleFields[field.config.fieldKey]\">\r\n\t\t\t\t<app-predicate-field\r\n\t\t\t\t\t*ngIf=\"field.type == fieldTypes.predicate\"\r\n\t\t\t\t\t[fieldConfig]=\"field.config\"\r\n\t\t\t\t\t[formControlName]=\"field.config.fieldKey\"\r\n\t\t\t\t></app-predicate-field>\r\n\t\t\t\t<app-aggregation-field\r\n\t\t\t\t\t*ngIf=\"field.type == fieldTypes.aggregation && !!aggregations\"\r\n\t\t\t\t\t[formControlName]=\"field.config.fieldKey\"\r\n\t\t\t\t\t[fieldConfig]=\"field.config\"\r\n\t\t\t\t\t[aggregation]=\"aggregations[field.config.aggregation]\"\r\n\t\t\t\t\t[contentTemplate]=\"getContentTemplate(field.config.render.type)\"\r\n\t\t\t\t></app-aggregation-field>\r\n\t\t\t\t<app-custom-field\r\n\t\t\t\t\t*ngIf=\"field.type == fieldTypes.custom\"\r\n\t\t\t\t\t[fieldConfig]=\"field.config\"\r\n\t\t\t\t\t[formControlName]=\"field.config.fieldKey\"\r\n\t\t\t\t\t[aggregations]=\"aggregations\"\r\n\t\t\t\t\t[contentTemplate]=\"customTemplate || customTemplateRef\"\r\n\t\t\t\t></app-custom-field>\r\n\t\t\t</ng-container>\r\n\t\t</ng-container>\r\n\t</ng-container>\r\n</div>\r\n", styles: [".filters-panel{display:var(--filters-panel-display, flex);flex-direction:var(--filters-panel-direction, column);gap:var(--filters-panel-gap, .5rem);flex-wrap:var(--filters-panel-wrap, wrap);max-width:100%;box-sizing:border-box}.filters-panel ::ng-deep .mat-internal-form-field{width:var(--mat-internal-form-field-width, 100%)}.filters-panel ::ng-deep .mat-internal-form-field>label{flex-grow:1}.aggregation-field{padding-inline:var(--af-padding-inline, var(--ff-padding-inline, .5rem));padding-block:var(--af-padding-block, var(--ff-padding-block, 0));max-width:100%}.reset-container{display:var(--reset-filter-panel-display, flex);padding-block:var(--reset-filter-panel-padding-block, .5rem);padding-inline:var(--reset-filter-panel-padding-inline, .5rem);position:sticky;top:var(--reset-filter-panel-position-top, -8px);z-index:4;background:var(--reset-filter-panel-bg, #fff)}.reset-container button.mat-button-base{background-color:var(--reset-filter-panel-btn-bg, transparent);border-color:var(--reset-filter-panel-btn-bg, #e2e8f0);color:var(--reset-filter-panel-btn-color, currentColor)}\n"] }]
21686
+ args: [{ selector: 'app-filters-panel', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div [formGroup]=\"formGroup\" class=\"filters-panel\" [dir]=\"direction$ | async\">\r\n\t<div class=\"reset-filter reset-container\">\r\n\t\t<button mat-stroked-button class=\"w-full\" (click)=\"resetFilters()\" [disabled]=\"!hasValues\">\r\n\t\t\t{{ 'BUTTONS.clearFilter' | translate }}\r\n\t\t</button>\r\n\t</div>\r\n\t<ng-container *ngFor=\"let field of fields | filterByRoles; trackBy: trackByFieldKey\">\r\n\t\t<ng-container *permission=\"{ name: field.config?.permission }\">\r\n\t\t\t<ng-container *ngIf=\"visibleFields[field.config.fieldKey]\">\r\n\t\t\t\t<app-predicate-field\r\n\t\t\t\t\t*ngIf=\"field.type == fieldTypes.predicate\"\r\n\t\t\t\t\t[fieldConfig]=\"field.config\"\r\n\t\t\t\t\t[formControlName]=\"field.config.fieldKey\"\r\n\t\t\t\t></app-predicate-field>\r\n\t\t\t\t<app-aggregation-field\r\n\t\t\t\t\t*ngIf=\"field.type == fieldTypes.aggregation && !!aggregations\"\r\n\t\t\t\t\t[formControlName]=\"field.config.fieldKey\"\r\n\t\t\t\t\t[fieldConfig]=\"field.config\"\r\n\t\t\t\t\t[aggregation]=\"aggregations[field.config.aggregation]\"\r\n\t\t\t\t\t[contentTemplate]=\"getContentTemplate(field.config.render.type)\"\r\n\t\t\t\t></app-aggregation-field>\r\n\t\t\t\t<app-custom-field\r\n\t\t\t\t\t*ngIf=\"field.type == fieldTypes.custom\"\r\n\t\t\t\t\t[fieldConfig]=\"field.config\"\r\n\t\t\t\t\t[formControlName]=\"field.config.fieldKey\"\r\n\t\t\t\t\t[aggregations]=\"aggregations\"\r\n\t\t\t\t\t[contentTemplate]=\"customTemplate || customTemplateRef\"\r\n\t\t\t\t></app-custom-field>\r\n\t\t\t</ng-container>\r\n\t\t</ng-container>\r\n\t</ng-container>\r\n</div>\r\n", styles: [".filters-panel{display:var(--filters-panel-display, flex);flex-direction:var(--filters-panel-direction, column);gap:var(--filters-panel-gap, .5rem);flex-wrap:var(--filters-panel-wrap, wrap);max-width:100%;box-sizing:border-box}.filters-panel ::ng-deep .mat-internal-form-field{width:var(--mat-internal-form-field-width, 100%)}.filters-panel ::ng-deep .mat-internal-form-field>label{flex-grow:1}.aggregation-field{padding-inline:var(--af-padding-inline, var(--ff-padding-inline, .5rem));padding-block:var(--af-padding-block, var(--ff-padding-block, 0));max-width:100%}.reset-container{display:var(--reset-filter-panel-display, flex);padding-block:var(--reset-filter-panel-padding-block, .5rem);padding-inline:var(--reset-filter-panel-padding-inline, .5rem);position:sticky;top:var(--reset-filter-panel-position-top, -8px);z-index:4;background:var(--reset-filter-panel-bg, #fff)}.reset-container button.mat-button-base{background-color:var(--reset-filter-panel-btn-bg, transparent);border-color:var(--reset-filter-panel-btn-bg, #e2e8f0);color:var(--reset-filter-panel-btn-color, currentColor)}\n"] }]
21697
21687
  }], ctorParameters: () => [{ type: i1$1.TranslateService }, { type: NuxeoService }], propDecorators: { aggregations: [{
21698
21688
  type: Input
21699
21689
  }], fields: [{