@mediusinc/mng-commons 0.4.2 → 0.4.5

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 (46) hide show
  1. package/assets/i18n/en.json +21 -19
  2. package/assets/i18n/sl.json +19 -17
  3. package/esm2020/lib/components/action/action.component.mjs +4 -4
  4. package/esm2020/lib/components/action/editor/action-editor.component.mjs +4 -8
  5. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +1 -1
  6. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +1 -1
  7. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +1 -1
  8. package/esm2020/lib/components/tableview/table/table.component.mjs +7 -3
  9. package/esm2020/lib/components/tableview/tableview.component.mjs +4 -4
  10. package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
  11. package/esm2020/lib/descriptors/action.descriptor.mjs +29 -10
  12. package/esm2020/lib/descriptors/editor.descriptor.mjs +4 -4
  13. package/esm2020/lib/descriptors/field.descriptor.mjs +3 -3
  14. package/esm2020/lib/pipes/i18n-property.pipe.mjs +3 -3
  15. package/esm2020/lib/pipes/link-formatter.pipe.mjs +1 -1
  16. package/esm2020/lib/services/action-executor.service.mjs +13 -14
  17. package/esm2020/lib/services/commons.service.mjs +77 -52
  18. package/esm2020/lib/services/configuration.service.mjs +53 -19
  19. package/esm2020/lib/services/providers/commons-init.provider.mjs +1 -1
  20. package/esm2020/lib/services/providers/config-service.provider.mjs +13 -3
  21. package/esm2020/lib/services/tokens/commons-init.token.mjs +3 -0
  22. package/esm2020/lib/services/tokens/index.mjs +2 -1
  23. package/esm2020/lib/services/view-container.component.service.mjs +2 -2
  24. package/esm2020/lib/utils/i18n.util.mjs +212 -144
  25. package/esm2020/lib/utils/notification.util.mjs +16 -17
  26. package/esm2020/public-api.mjs +3 -1
  27. package/fesm2015/mediusinc-mng-commons.mjs +505 -348
  28. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  29. package/fesm2020/mediusinc-mng-commons.mjs +495 -344
  30. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  31. package/lib/components/tableview/table/table.component.d.ts +4 -1
  32. package/lib/config/models/mng-config.model.d.ts +1 -1
  33. package/lib/descriptors/action.descriptor.d.ts +13 -6
  34. package/lib/pipes/link-formatter.pipe.d.ts +1 -1
  35. package/lib/services/action-executor.service.d.ts +4 -2
  36. package/lib/services/commons.service.d.ts +5 -3
  37. package/lib/services/configuration.service.d.ts +3 -2
  38. package/lib/services/providers/commons-init.provider.d.ts +2 -1
  39. package/lib/services/providers/config-service.provider.d.ts +2 -1
  40. package/lib/services/tokens/commons-init.token.d.ts +3 -0
  41. package/lib/services/tokens/index.d.ts +1 -0
  42. package/lib/services/view-container.component.service.d.ts +1 -1
  43. package/lib/utils/i18n.util.d.ts +52 -21
  44. package/lib/utils/notification.util.d.ts +4 -4
  45. package/package.json +1 -1
  46. package/public-api.d.ts +1 -0
@@ -2,7 +2,7 @@ import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { HttpErrorResponse, HttpClient, HttpClientModule } from '@angular/common/http';
4
4
  import * as i0 from '@angular/core';
5
- import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
5
+ import { InjectionToken, Injectable, Pipe, Inject, Optional, EventEmitter, Component, ChangeDetectionStrategy, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
6
6
  import * as i4$2 from '@angular/forms';
7
7
  import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
8
8
  import * as i1 from '@angular/router';
@@ -72,9 +72,9 @@ import * as i4$3 from 'primeng/toolbar';
72
72
  import { ToolbarModule } from 'primeng/toolbar';
73
73
  import * as i9 from 'primeng/tooltip';
74
74
  import { TooltipModule } from 'primeng/tooltip';
75
- import { throwError, of, Subject, Observable, from, BehaviorSubject, ReplaySubject, switchMap, distinctUntilChanged, combineLatest } from 'rxjs';
75
+ import { throwError, of, Subject, Observable, from, combineLatest, tap, BehaviorSubject, ReplaySubject, mergeMap as mergeMap$1, switchMap, distinctUntilChanged } from 'rxjs';
76
76
  import 'reflect-metadata';
77
- import { mergeMap, map, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
77
+ import { map, mergeMap, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
78
78
  import * as i4$1 from '@angular/platform-browser';
79
79
  import { trigger, state, style, transition, animate } from '@angular/animations';
80
80
 
@@ -418,9 +418,11 @@ class ActionDescriptor {
418
418
  this._parentType = parentType;
419
419
  this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
420
420
  this._parentProperty = parentProperty;
421
- this._i18nModelActionBaseKey = this._parentTypeName
422
- ? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
423
- : `${this._model.typeName}.actions.${actionName}`;
421
+ if (this._parentTypeName || this._model) {
422
+ this._i18nModelActionBaseKey = this._parentTypeName
423
+ ? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
424
+ : `${this._model.typeName}.actions.${actionName}`;
425
+ }
424
426
  }
425
427
  get model() {
426
428
  return this._model;
@@ -547,6 +549,9 @@ class ActionDescriptor {
547
549
  return this;
548
550
  }
549
551
  withServiceType(serviceType) {
552
+ if (!this._model) {
553
+ throw new Error(`Cannot set data provider if no model type is provided for action ${this._actionName}`);
554
+ }
550
555
  this._dataProvider = new DataProvider(this._model.type, serviceType);
551
556
  return this;
552
557
  }
@@ -642,6 +647,12 @@ class ActionDescriptor {
642
647
  SizeEnum[SizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
643
648
  })(SizeEnum = ActionDescriptor.SizeEnum || (ActionDescriptor.SizeEnum = {}));
644
649
  })(ActionDescriptor || (ActionDescriptor = {}));
650
+ class ActionSimpleDescriptor extends ActionDescriptor {
651
+ constructor(actionName, modelType, idProperty, titleProperty) {
652
+ const model = modelType ? new ModelDescriptor(modelType, idProperty, titleProperty) : null;
653
+ super(model, actionName);
654
+ }
655
+ }
645
656
  class ActionEditorDescriptor extends ActionDescriptor {
646
657
  constructor(editorDescriptor, actionName, parentType, parentProperty) {
647
658
  super(editorDescriptor.model, actionName, parentType, parentProperty);
@@ -704,6 +715,9 @@ class ActionEditorDescriptor extends ActionDescriptor {
704
715
  return this;
705
716
  }
706
717
  withServiceType(serviceType) {
718
+ if (!this._model) {
719
+ throw new Error(`Cannot set data provider if no model type is provided for action ${this._actionName}`);
720
+ }
707
721
  this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
708
722
  return this;
709
723
  }
@@ -762,7 +776,7 @@ class ActionEditorSubmitDescriptor extends ActionDescriptor {
762
776
  })(ActionEditorSubmitDescriptor || (ActionEditorSubmitDescriptor = {}));
763
777
  class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
764
778
  constructor(editorDescriptor) {
765
- super(editorDescriptor, 'details');
779
+ super(editorDescriptor, ActionEditorDetailsDescriptor.ACTION_NAME);
766
780
  this.withPosition(ActionPositionEnum.RowClick);
767
781
  this.withRouteTrigger(':itemId');
768
782
  this.withFetchFunction(ctx => ctx.dataProvider?.fetch && ctx.data?.itemId
@@ -783,9 +797,10 @@ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
783
797
  return this;
784
798
  }
785
799
  }
800
+ ActionEditorDetailsDescriptor.ACTION_NAME = 'details';
786
801
  class ActionEditorAddDescriptor extends ActionEditorDescriptor {
787
802
  constructor(editorDescriptor) {
788
- super(editorDescriptor, 'add');
803
+ super(editorDescriptor, ActionEditorAddDescriptor.ACTION_NAME);
789
804
  this.withPosition(ActionPositionEnum.ToolbarLeft);
790
805
  this.withRouteTrigger('add');
791
806
  this.withSubmitFunction(ctx => ctx.dataProvider?.create ? ctx.dataProvider.create(ctx.data?.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)));
@@ -808,9 +823,10 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
808
823
  return this;
809
824
  }
810
825
  }
826
+ ActionEditorAddDescriptor.ACTION_NAME = 'add';
811
827
  class ActionEditorEditDescriptor extends ActionEditorDescriptor {
812
828
  constructor(editorDescriptor) {
813
- super(editorDescriptor, 'edit');
829
+ super(editorDescriptor, ActionEditorEditDescriptor.ACTION_NAME);
814
830
  this.withPosition(ActionPositionEnum.RowInline);
815
831
  this.withTitle(null);
816
832
  this.withRouteTrigger(':itemId/edit');
@@ -838,9 +854,10 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
838
854
  return this;
839
855
  }
840
856
  }
857
+ ActionEditorEditDescriptor.ACTION_NAME = 'edit';
841
858
  class ActionDeleteDescriptor extends ActionDescriptor {
842
859
  constructor(model) {
843
- super(model, 'delete');
860
+ super(model, ActionDeleteDescriptor.ACTION_NAME);
844
861
  this.withPosition(ActionPositionEnum.RowInline);
845
862
  this.withTitle(null);
846
863
  this.withRunFunction(ctx => {
@@ -865,9 +882,10 @@ class ActionDeleteDescriptor extends ActionDescriptor {
865
882
  return this;
866
883
  }
867
884
  }
885
+ ActionDeleteDescriptor.ACTION_NAME = 'delete';
868
886
  class ActionLinkDescriptor extends ActionDescriptor {
869
- constructor(model) {
870
- super(model, 'link');
887
+ constructor(model = null, actionName = 'link') {
888
+ super(model, actionName);
871
889
  this._url = '';
872
890
  this._pathSegments = [];
873
891
  this._replaceUrl = false;
@@ -1410,7 +1428,7 @@ class EditorDescriptor {
1410
1428
  createTabGroup(name, title) {
1411
1429
  const tabGroup = new FieldTabGroupDescriptor(this, name);
1412
1430
  if (!title) {
1413
- title = I18nUtil.getModelTabKey(this.model, name);
1431
+ title = I18nUtils.Type.getTabKey(this.model.typeName, name);
1414
1432
  }
1415
1433
  tabGroup.withTitle(title);
1416
1434
  this.createTabGroupDescriptor(tabGroup);
@@ -1420,7 +1438,7 @@ class EditorDescriptor {
1420
1438
  const fieldGroup = new FieldGroupDescriptor(this, name);
1421
1439
  if (title !== null) {
1422
1440
  if (!title) {
1423
- title = I18nUtil.getModelGroupKey(this.model, name);
1441
+ title = I18nUtils.Type.getGroupKey(this.model.typeName, name);
1424
1442
  }
1425
1443
  fieldGroup.withTitle(title);
1426
1444
  }
@@ -1598,7 +1616,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
1598
1616
  this._size = FieldDescriptor.SizeEnum.Normal;
1599
1617
  this._eventsSubject = new Subject();
1600
1618
  this._property = property;
1601
- this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
1619
+ this._label = I18nUtils.Type.getPropertyKey(this._editor.model.typeName, property);
1602
1620
  }
1603
1621
  get property() {
1604
1622
  return this._property;
@@ -2929,169 +2947,323 @@ class EnumUtil {
2929
2947
  }
2930
2948
  }
2931
2949
 
2932
- class I18nUtil {
2933
- static instantModelTranslation(translate, model, keyPath, customKey, item, fallbackKey, i18nParams) {
2934
- const keys = I18nUtil.getModelKeysByPriority(model, keyPath, customKey, fallbackKey);
2935
- const i18nModelName = I18nUtil.instantModelName(translate, model, true);
2936
- const i18n = translate.instant(keys, I18nUtil.getModelI18nParams(model, item, i18nModelName ?? undefined, i18nParams));
2937
- return I18nUtil.selectKeyByPriority(keys, i18n);
2938
- }
2939
- static getModelTabKey(model, tab) {
2940
- return I18nUtil.getModelKeyPath(model, `tabs.${tab}`);
2950
+ const typeNameDecoratorPropertyName = 'typeName';
2951
+ function TypeName(typeName) {
2952
+ return function (target) {
2953
+ target[typeNameDecoratorPropertyName] = typeName;
2954
+ };
2955
+ }
2956
+ const enumNameDecoratorPropertyName = 'enumName';
2957
+ function EnumName(typeName) {
2958
+ return function (target) {
2959
+ target[enumNameDecoratorPropertyName] = typeName;
2960
+ };
2961
+ }
2962
+
2963
+ class TypeUtil {
2964
+ /**
2965
+ * Defines type name decorator.
2966
+ * @param targetType class.
2967
+ * @param typeName Name of the type.
2968
+ */
2969
+ static defineReflectTypeName(targetType, typeName) {
2970
+ if (!typeName) {
2971
+ typeName = TypeUtil.getDecoratorTypeName(targetType);
2972
+ if (!typeName) {
2973
+ console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
2974
+ return;
2975
+ }
2976
+ }
2977
+ if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
2978
+ Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
2979
+ }
2941
2980
  }
2942
- static getModelGroupKey(model, group) {
2943
- return I18nUtil.getModelKeyPath(model, `groups.${group}`);
2981
+ /**
2982
+ * Defines enum name decorator.
2983
+ * @param targetType enum object.
2984
+ * @param enumName Name of the enum.
2985
+ */
2986
+ static defineReflectEnumName(targetType, enumName) {
2987
+ if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
2988
+ Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
2989
+ }
2944
2990
  }
2945
- static getModelPropertyKey(model, property) {
2946
- return I18nUtil.getModelKeyPath(model, `properties.${property}`);
2991
+ /**
2992
+ * Gets type name from either decorator or reflect metadata.
2993
+ * @param type Class.
2994
+ */
2995
+ static findTypeName(type) {
2996
+ let decoratorName = TypeUtil.getDecoratorTypeName(type);
2997
+ if (decoratorName) {
2998
+ return decoratorName;
2999
+ }
3000
+ decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
3001
+ if (decoratorName) {
3002
+ return decoratorName;
3003
+ }
3004
+ return type.name;
2947
3005
  }
2948
- static instantActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, functionNameKey, i18nParams) {
2949
- const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
2950
- const i18nModelName = I18nUtil.instantModelName(translate, action?.model, true);
2951
- const i18nFunctionTitle = I18nUtil.getFunctionTitle(translate, functionNameKey);
2952
- const i18n = translate.instant(keys, I18nUtil.getActionI18nParams(action, item, i18nModelName ?? undefined, i18nParams, i18nFunctionTitle));
2953
- return I18nUtil.selectKeyByPriority(keys, i18n);
3006
+ /**
3007
+ * Gets enum name from either decorator or reflect metadata.
3008
+ * @param enumType Class.
3009
+ */
3010
+ static findEnumName(enumType) {
3011
+ let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
3012
+ if (decoratorName) {
3013
+ return decoratorName;
3014
+ }
3015
+ decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
3016
+ if (decoratorName) {
3017
+ return decoratorName;
3018
+ }
3019
+ throw new Error('Could not fined enum name');
2954
3020
  }
2955
- static streamActionTranslation(translate, action, keyPath, customKey, item, fallbackKey) {
2956
- return I18nUtil.getActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, false);
3021
+ /**
3022
+ * Get value from decorator defined property name
3023
+ * @param type Class.
3024
+ */
3025
+ // eslint-disable-next-line @typescript-eslint/ban-types
3026
+ static getDecoratorTypeName(type) {
3027
+ return type[typeNameDecoratorPropertyName];
2957
3028
  }
2958
- static getActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, oneTime = true) {
2959
- const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
2960
- return I18nUtil.getModelName(translate, action?.model, oneTime, true).pipe(mergeMap(i18nModelName => translate.get(keys, I18nUtil.getActionI18nParams(action, item, i18nModelName ?? undefined))), map(i18n => I18nUtil.selectKeyByPriority(keys, i18n)));
3029
+ /**
3030
+ * Get value from decorator defined property name
3031
+ * @param type Enum object.
3032
+ */
3033
+ static getDecoratorEnumName(type) {
3034
+ return type[enumNameDecoratorPropertyName];
2961
3035
  }
2962
- static getModelI18nParams(model, item, i18nModelName, i18nParameters = {}) {
2963
- i18nParameters.itemId = '';
2964
- i18nParameters.itemTitle = '';
2965
- if (i18nModelName) {
2966
- i18nParameters.modelName = i18nModelName;
2967
- }
2968
- if (item) {
2969
- if (model.idPropertyName && item[model.idPropertyName]) {
2970
- i18nParameters.itemId = item[model.idPropertyName];
3036
+ }
3037
+
3038
+ var I18nUtils;
3039
+ (function (I18nUtils) {
3040
+ class Common {
3041
+ static getAsync(translate, params, ...keys) {
3042
+ return translate.stream(keys, params).pipe(map(i18n => I18nUtils.Common.selectI18n(keys, i18n)));
3043
+ }
3044
+ static get(translate, params, ...keys) {
3045
+ const i18n = translate.instant(keys, params);
3046
+ return I18nUtils.Common.selectI18n(keys, i18n);
3047
+ }
3048
+ static populateParams(item, params = {}) {
3049
+ const paramsRes = { ...params };
3050
+ if (item) {
3051
+ paramsRes.item = item;
2971
3052
  }
2972
- if (model.titlePropertyName && item[model.titlePropertyName]) {
2973
- i18nParameters.itemTitle = item[model.titlePropertyName];
3053
+ return paramsRes;
3054
+ }
3055
+ static selectI18n(keys, i18n) {
3056
+ for (const key of keys) {
3057
+ if (key !== i18n[key]) {
3058
+ return i18n[key];
3059
+ }
2974
3060
  }
3061
+ return null;
2975
3062
  }
2976
- return i18nParameters;
2977
3063
  }
2978
- static getActionI18nParams(action, item, i18nModelName, i18nParameters = {}, functionTitle) {
2979
- i18nParameters.itemId = '';
2980
- i18nParameters.itemTitle = '';
2981
- if (functionTitle) {
2982
- i18nParameters.functionTitle = functionTitle;
3064
+ I18nUtils.Common = Common;
3065
+ class Type {
3066
+ static getClassNameAsync(translate, classType, singular) {
3067
+ const typeName = TypeUtil.findTypeName(classType);
3068
+ return I18nUtils.Type.getNameAsync(translate, typeName, singular);
2983
3069
  }
2984
- if (i18nModelName) {
2985
- i18nParameters.modelName = i18nModelName;
3070
+ static getClassName(translate, classType, singular) {
3071
+ const typeName = TypeUtil.findTypeName(classType);
3072
+ return I18nUtils.Type.getName(translate, typeName, singular);
2986
3073
  }
2987
- if (item) {
2988
- if (action.model.idPropertyName && item[action.model.idPropertyName]) {
2989
- i18nParameters.itemId = item[action.model.idPropertyName];
2990
- }
2991
- if (action.model.titlePropertyName && item[action.model.titlePropertyName]) {
2992
- i18nParameters.itemTitle = item[action.model.titlePropertyName];
3074
+ static getNameAsync(translate, typeName, singular) {
3075
+ const keys = I18nUtils.Type.getNameKeys(typeName, singular);
3076
+ return I18nUtils.Common.getAsync(translate, undefined, ...keys);
3077
+ }
3078
+ static getName(translate, typeName, singular) {
3079
+ const keys = I18nUtils.Type.getNameKeys(typeName, singular);
3080
+ return I18nUtils.Common.get(translate, undefined, ...keys);
3081
+ }
3082
+ static getClassTabKey(classType, tab) {
3083
+ const typeName = TypeUtil.findTypeName(classType);
3084
+ return I18nUtils.Type.getTabKey(typeName, tab);
3085
+ }
3086
+ static getTabKey(typeName, tab) {
3087
+ return I18nUtils.Type.getPath(typeName, 'tabs', tab);
3088
+ }
3089
+ static getClassGroupKey(classType, group) {
3090
+ const typeName = TypeUtil.findTypeName(classType);
3091
+ return I18nUtils.Type.getGroupKey(typeName, group);
3092
+ }
3093
+ static getGroupKey(typeName, group) {
3094
+ return I18nUtils.Type.getPath(typeName, 'groups', group);
3095
+ }
3096
+ static getClassPropertyKey(classType, property) {
3097
+ const typeName = TypeUtil.findTypeName(classType);
3098
+ return I18nUtils.Type.getPropertyKey(typeName, property);
3099
+ }
3100
+ static getPropertyKey(typeName, property) {
3101
+ return I18nUtils.Type.getPath(typeName, 'properties', property);
3102
+ }
3103
+ static getClassPath(classType, ...path) {
3104
+ const typeName = TypeUtil.findTypeName(classType);
3105
+ return I18nUtils.Type.getPath(typeName, ...path);
3106
+ }
3107
+ static getPath(typeName, ...path) {
3108
+ return `${typeName}.${path.join('.')}`;
3109
+ }
3110
+ static getClassParams(translate, classType, item, params = {}) {
3111
+ const typeName = TypeUtil.findTypeName(classType);
3112
+ return I18nUtils.Type.getParams(translate, typeName, item, params);
3113
+ }
3114
+ static getParams(translate, typeName, item, params = {}) {
3115
+ const i18nTypeName = typeName ? I18nUtils.Type.getName(translate, typeName, true) : null;
3116
+ return I18nUtils.Type.populateParams(i18nTypeName ?? undefined, item, params);
3117
+ }
3118
+ static getClassParamsAsync(translate, classType, item, params = {}) {
3119
+ const typeName = TypeUtil.findTypeName(classType);
3120
+ return I18nUtils.Type.getParamsAsync(translate, typeName, item, params);
3121
+ }
3122
+ static getParamsAsync(translate, typeName, item, params = {}) {
3123
+ return (typeName ? I18nUtils.Type.getNameAsync(translate, typeName, true) : of(null)).pipe(map(i18nTypeName => I18nUtils.Type.populateParams(i18nTypeName ?? undefined, item, params)));
3124
+ }
3125
+ static populateParams(i18nTypeName, item, params = {}) {
3126
+ const paramsRes = { ...params };
3127
+ if (i18nTypeName) {
3128
+ paramsRes.typeName = i18nTypeName;
2993
3129
  }
3130
+ return I18nUtils.Common.populateParams(item, paramsRes);
2994
3131
  }
2995
- return i18nParameters;
2996
- }
2997
- static instantErrorI18nTranslation(translate, error, i18nParameters = {}) {
2998
- i18nParameters.errorStatus = '';
2999
- i18nParameters.errorMessage = '';
3000
- if (error.messageCode) {
3001
- const params = I18nUtil.getErrorI18nParams(error);
3002
- const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
3003
- const i18ns = translate.instant(keys, params);
3004
- const i18n = I18nUtil.selectKeyByPriority(keys, i18ns);
3005
- if (i18n) {
3006
- return i18n;
3132
+ static getNameKeys(typeName, singular) {
3133
+ const keys = [];
3134
+ if (typeof singular !== 'undefined') {
3135
+ keys.push(singular ? `${typeName}.nameSingular` : `${typeName}.namePlural`);
3007
3136
  }
3137
+ keys.push(`${typeName}.name`);
3138
+ return keys;
3008
3139
  }
3009
- return translate.instant(error.message);
3010
3140
  }
3011
- static getErrorI18nParams(error, i18nParameters = {}) {
3012
- i18nParameters.errorStatus = '';
3013
- i18nParameters.errorMessage = '';
3014
- if (error.status) {
3015
- i18nParameters.errorStatus = error.status;
3141
+ I18nUtils.Type = Type;
3142
+ class Model {
3143
+ static get(translate, model, keyPath, customKey, item, fallbackKey, params) {
3144
+ const keys = I18nUtils.Model.getKeysByPriority(model, keyPath, customKey, fallbackKey);
3145
+ const i18nParams = I18nUtils.Model.getParams(translate, model, item, params);
3146
+ return I18nUtils.Common.get(translate, i18nParams, ...keys);
3016
3147
  }
3017
- if (error.message) {
3018
- i18nParameters.errorMessage = error.message;
3148
+ static getName(translate, model, singular) {
3149
+ return I18nUtils.Type.getName(translate, model.typeName, singular);
3019
3150
  }
3020
- if (error.statusDescription) {
3021
- i18nParameters.errorStatusDescription = error.statusDescription;
3151
+ static getNameAsync(translate, model, singular) {
3152
+ return I18nUtils.Type.getNameAsync(translate, model.typeName, singular);
3022
3153
  }
3023
- return i18nParameters;
3024
- }
3025
- static instantModelName(translate, model, singular) {
3026
- const keys = I18nUtil.getModelNameKeys(model, singular);
3027
- const i18n = translate.instant(keys);
3028
- return I18nUtil.selectKeyByPriority(keys, i18n);
3029
- }
3030
- static getModelName(translate, model, oneTime = true, singular) {
3031
- const keys = I18nUtil.getModelNameKeys(model, singular);
3032
- const obs = translate.stream(keys);
3033
- if (oneTime) {
3034
- obs.pipe(first());
3154
+ static getParams(translate, model, item, params = {}) {
3155
+ const i18nParams = I18nUtils.Type.getParams(translate, model?.typeName, item, params);
3156
+ return I18nUtils.Model.populateParams(model?.idPropertyName, model?.titlePropertyName, item, i18nParams);
3035
3157
  }
3036
- return obs.pipe(map(i18n => I18nUtil.selectKeyByPriority(keys, i18n)));
3037
- }
3038
- static getModelNameKeys(model, singular) {
3039
- const keys = [];
3040
- if (singular !== undefined) {
3041
- keys.push(singular ? `${model?.typeName}.nameSingular` : `${model?.typeName}.namePlural`);
3158
+ static getParamsAsync(translate, model, item, params = {}) {
3159
+ return I18nUtils.Type.getParamsAsync(translate, model?.typeName, item, params).pipe(map(i18nParams => I18nUtils.Model.populateParams(model?.idPropertyName, model?.titlePropertyName, item, i18nParams)));
3042
3160
  }
3043
- keys.push(`${model?.typeName}.name`);
3044
- return keys;
3045
- }
3046
- static getModelKeysByPriority(model, keyPath, customKey, fallbackKey) {
3047
- const keys = [];
3048
- if (customKey) {
3049
- keys.push(customKey);
3161
+ static populateParams(idProperty, titleProperty, item, params = {}) {
3162
+ const paramsRes = { ...params, itemId: '', itemTitle: '' };
3163
+ if (item) {
3164
+ if (idProperty && item[idProperty]) {
3165
+ paramsRes.itemId = item[idProperty];
3166
+ }
3167
+ if (titleProperty && item[titleProperty]) {
3168
+ paramsRes.itemTitle = item[titleProperty];
3169
+ }
3170
+ }
3171
+ return paramsRes;
3050
3172
  }
3051
- const modelActionKey = I18nUtil.getModelKeyPath(model, keyPath);
3052
- keys.push(modelActionKey);
3053
- if (fallbackKey) {
3054
- keys.push(fallbackKey);
3173
+ static getKeysByPriority(model, keyPath, customKey, fallbackKey) {
3174
+ const keys = [];
3175
+ if (customKey) {
3176
+ keys.push(customKey);
3177
+ }
3178
+ const modelActionKey = I18nUtils.Type.getPath(model.typeName, ...keyPath);
3179
+ keys.push(modelActionKey);
3180
+ if (fallbackKey) {
3181
+ keys.push(fallbackKey);
3182
+ }
3183
+ return keys;
3055
3184
  }
3056
- return keys;
3057
3185
  }
3058
- static getModelKeyPath(model, keyPath) {
3059
- return `${model.typeName}.${keyPath}`;
3060
- }
3061
- static getActionKeysByPriority(action, keyPath, customKey, fallbackKey) {
3062
- const keys = [];
3063
- if (customKey) {
3064
- keys.push(customKey);
3186
+ I18nUtils.Model = Model;
3187
+ class Action {
3188
+ static get(translate, action, actionPathKeys, customKey, item, fallbackKey, params) {
3189
+ const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
3190
+ const i18nParams = I18nUtils.Action.getParams(translate, action, item, params);
3191
+ return I18nUtils.Common.get(translate, i18nParams, ...keys);
3192
+ }
3193
+ static getAsync(translate, action, actionPathKeys, customKey, item, fallbackKey, params) {
3194
+ return I18nUtils.Action.getParamsAsync(translate, action, item, params).pipe(mergeMap(i18nParams => {
3195
+ const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
3196
+ return I18nUtils.Common.getAsync(translate, i18nParams, ...keys);
3197
+ }));
3065
3198
  }
3066
- const modelActionKey = `${action.i18nModelActionBaseKey}.${keyPath}`;
3067
- const actionKey = `${action.actionName}.${keyPath}`;
3068
- keys.push(modelActionKey, actionKey);
3069
- if (fallbackKey) {
3070
- keys.push(fallbackKey);
3199
+ static getTitleAsync(translate, action, item) {
3200
+ return I18nUtils.Action.getAsync(translate, action, 'title', undefined, item);
3071
3201
  }
3072
- return keys;
3073
- }
3074
- static selectKeyByPriority(keys, i18n) {
3075
- for (const key of keys) {
3076
- if (key !== i18n[key]) {
3077
- return i18n[key];
3202
+ static getEditorTitleAsync(translate, action, item) {
3203
+ return I18nUtils.Action.getAsync(translate, action, ['editor.title', 'title'], action.editorTitle ?? undefined, item);
3204
+ }
3205
+ static getParams(translate, action, item, params = {}) {
3206
+ const i18nParams = I18nUtils.Model.getParams(translate, action.model ?? undefined, item, params);
3207
+ return I18nUtils.Action.populateParams(i18nParams);
3208
+ }
3209
+ static getParamsAsync(translate, action, item, params = {}) {
3210
+ return I18nUtils.Model.getParamsAsync(translate, action.model ?? undefined, item, params).pipe(map(i18nParams => I18nUtils.Action.populateParams(i18nParams)));
3211
+ }
3212
+ static populateParams(params = {}) {
3213
+ params = { ...params };
3214
+ return params;
3215
+ }
3216
+ static getKeysByPriority(action, actionPathKeys, customKey, fallbackKey) {
3217
+ const keys = [];
3218
+ if (customKey) {
3219
+ keys.push(customKey);
3078
3220
  }
3221
+ if (!Array.isArray(actionPathKeys)) {
3222
+ actionPathKeys = [actionPathKeys];
3223
+ }
3224
+ actionPathKeys.forEach(k => {
3225
+ const modelActionKey = `${action.i18nModelActionBaseKey}.${k}`;
3226
+ const actionKey = `${action.actionName}.${k}`;
3227
+ keys.push(modelActionKey, actionKey);
3228
+ });
3229
+ if (fallbackKey) {
3230
+ keys.push(fallbackKey);
3231
+ }
3232
+ return keys;
3079
3233
  }
3080
- return null;
3081
3234
  }
3082
- static getFunctionTitle(translate, functionTitle) {
3083
- if (functionTitle) {
3084
- const translation = translate.instant(`mngAction.functions.${functionTitle}.title`);
3085
- if (translation === functionTitle) {
3086
- return null;
3235
+ I18nUtils.Action = Action;
3236
+ class Error {
3237
+ static get(translate, error, params = {}) {
3238
+ const i18nParams = I18nUtils.Error.getParams(error, params);
3239
+ if (error.messageCode) {
3240
+ const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
3241
+ const i18n = I18nUtils.Common.get(translate, i18nParams, ...keys);
3242
+ if (i18n) {
3243
+ return i18n;
3244
+ }
3087
3245
  }
3088
- return translation;
3246
+ return I18nUtils.Common.get(translate, i18nParams, error.message);
3089
3247
  }
3090
- else {
3091
- return null;
3248
+ static getParams(error, params = {}) {
3249
+ const paramsRes = { ...params };
3250
+ paramsRes.errorStatus = '';
3251
+ paramsRes.errorMessage = '';
3252
+ if (error.status) {
3253
+ paramsRes.errorStatus = error.status;
3254
+ }
3255
+ if (error.message) {
3256
+ paramsRes.errorMessage = error.message;
3257
+ }
3258
+ if (error.statusDescription) {
3259
+ paramsRes.errorStatusDescription = error.statusDescription;
3260
+ }
3261
+ paramsRes.error = error;
3262
+ return paramsRes;
3092
3263
  }
3093
3264
  }
3094
- }
3265
+ I18nUtils.Error = Error;
3266
+ })(I18nUtils || (I18nUtils = {}));
3095
3267
 
3096
3268
  class ModelUtil {
3097
3269
  static findIdAttribute(classType) {
@@ -3164,7 +3336,7 @@ class NotificationUtil {
3164
3336
  }
3165
3337
  return notification;
3166
3338
  }
3167
- static tableNotificationError(translationService, table, error, viewContainer) {
3339
+ static tableNotificationError(translate, table, error, viewContainer) {
3168
3340
  const params = {};
3169
3341
  if (error?.message) {
3170
3342
  params.errorMessage = `: ${error.message}`;
@@ -3172,120 +3344,31 @@ class NotificationUtil {
3172
3344
  else {
3173
3345
  params.errorMessage = '.';
3174
3346
  }
3175
- console.log(params);
3176
- const tableErrorTitle = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params) ?? undefined;
3177
- const tableErrorMessage = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params) ?? undefined;
3347
+ const tableErrorTitle = I18nUtils.Model.get(translate, table.model, 'table.error.title', undefined, undefined, 'general.error', params) ?? undefined;
3348
+ const tableErrorMessage = I18nUtils.Model.get(translate, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params) ?? undefined;
3178
3349
  return NotificationUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
3179
3350
  }
3180
- static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
3181
- const actionSuccessTitle = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName) ?? undefined;
3182
- const actionSuccessMessage = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName) ?? undefined;
3351
+ static actionNotificationSuccess(translate, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
3352
+ const actionSuccessTitle = I18nUtils.Action.get(translate, action, 'success.title', customTitleKey, item, 'general.success', functionName) ?? undefined;
3353
+ const actionSuccessMessage = I18nUtils.Action.get(translate, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName) ?? undefined;
3183
3354
  return NotificationUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
3184
3355
  }
3185
- static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
3356
+ static actionNotificationError(translate, action, error, functionName, viewContainer, item, severity = 'error') {
3186
3357
  const params = {
3187
- errorMessage: I18nUtil.instantErrorI18nTranslation(translationService, error)
3358
+ errorMessage: I18nUtils.Error.get(translate, error) ?? error.message
3188
3359
  };
3189
- const actionErrorTitle = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params) ??
3360
+ const actionErrorTitle = I18nUtils.Action.get(translate, action, [`error.${functionName}.title`, 'error.title'], action.runNotificationErrorTitle, item, 'general.error', params) ?? undefined;
3361
+ const actionErrorMessage = I18nUtils.Action.get(translate, action, [`error.${functionName}.message`, 'error.message'], action.runNotificationErrorMessage, item, 'general.errorMessage', params) ??
3190
3362
  undefined;
3191
- const actionErrorMessage = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params) ?? undefined;
3192
- return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
3363
+ return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, severity);
3193
3364
  }
3194
- static getFormEditorWarningMessage(translationService, title, message) {
3195
- const actionErrorTitle = translationService.instant(title) ?? undefined;
3196
- const actionErrorMessage = translationService.instant(message) ?? undefined;
3365
+ static getFormEditorWarningMessage(translate, title, message) {
3366
+ const actionErrorTitle = translate.instant(title) ?? undefined;
3367
+ const actionErrorMessage = translate.instant(message) ?? undefined;
3197
3368
  return { severity: 'warn', summary: actionErrorTitle, detail: actionErrorMessage };
3198
3369
  }
3199
3370
  }
3200
3371
 
3201
- const typeNameDecoratorPropertyName = 'typeName';
3202
- function TypeName(typeName) {
3203
- return function (target) {
3204
- target[typeNameDecoratorPropertyName] = typeName;
3205
- };
3206
- }
3207
- const enumNameDecoratorPropertyName = 'enumName';
3208
- function EnumName(typeName) {
3209
- return function (target) {
3210
- target[enumNameDecoratorPropertyName] = typeName;
3211
- };
3212
- }
3213
-
3214
- class TypeUtil {
3215
- /**
3216
- * Defines type name decorator.
3217
- * @param targetType class.
3218
- * @param typeName Name of the type.
3219
- */
3220
- static defineReflectTypeName(targetType, typeName) {
3221
- if (!typeName) {
3222
- typeName = TypeUtil.getDecoratorTypeName(targetType);
3223
- if (!typeName) {
3224
- console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
3225
- return;
3226
- }
3227
- }
3228
- if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
3229
- Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
3230
- }
3231
- }
3232
- /**
3233
- * Defines enum name decorator.
3234
- * @param targetType enum object.
3235
- * @param enumName Name of the enum.
3236
- */
3237
- static defineReflectEnumName(targetType, enumName) {
3238
- if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
3239
- Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
3240
- }
3241
- }
3242
- /**
3243
- * Gets type name from either decorator or reflect metadata.
3244
- * @param type Class.
3245
- */
3246
- static findTypeName(type) {
3247
- let decoratorName = TypeUtil.getDecoratorTypeName(type);
3248
- if (decoratorName) {
3249
- return decoratorName;
3250
- }
3251
- decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
3252
- if (decoratorName) {
3253
- return decoratorName;
3254
- }
3255
- return type.name;
3256
- }
3257
- /**
3258
- * Gets enum name from either decorator or reflect metadata.
3259
- * @param enumType Class.
3260
- */
3261
- static findEnumName(enumType) {
3262
- let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
3263
- if (decoratorName) {
3264
- return decoratorName;
3265
- }
3266
- decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
3267
- if (decoratorName) {
3268
- return decoratorName;
3269
- }
3270
- throw new Error('Could not fined enum name');
3271
- }
3272
- /**
3273
- * Get value from decorator defined property name
3274
- * @param type Class.
3275
- */
3276
- // eslint-disable-next-line @typescript-eslint/ban-types
3277
- static getDecoratorTypeName(type) {
3278
- return type[typeNameDecoratorPropertyName];
3279
- }
3280
- /**
3281
- * Get value from decorator defined property name
3282
- * @param type Enum object.
3283
- */
3284
- static getDecoratorEnumName(type) {
3285
- return type[enumNameDecoratorPropertyName];
3286
- }
3287
- }
3288
-
3289
3372
  class ObjectSerializer {
3290
3373
  constructor() {
3291
3374
  this._primitives = ['string', 'boolean', 'double', 'integer', 'long', 'float', 'number', 'any'];
@@ -3716,6 +3799,8 @@ const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3716
3799
  factory: () => localStorage
3717
3800
  });
3718
3801
 
3802
+ const MNG_COMMONS_INITIALIZER_IT = new InjectionToken('MNG Commons Initializer');
3803
+
3719
3804
  const ACTION_EDITOR_DIALOG_COMPONENT_SETTING = new InjectionToken('ACTION_EDITOR_DIALOG_COMPONENT_SETTING');
3720
3805
 
3721
3806
  const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
@@ -3826,7 +3911,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3826
3911
 
3827
3912
  class MngI18nPropertyPipe {
3828
3913
  transform(property, model) {
3829
- return I18nUtil.getModelPropertyKey(model, property);
3914
+ return I18nUtils.Type.getPropertyKey(model.typeName, property);
3830
3915
  }
3831
3916
  }
3832
3917
  MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -3987,24 +4072,20 @@ class MngActionExecutorService {
3987
4072
  rejectVisible: false
3988
4073
  };
3989
4074
  if (action.runConfirmationTitle !== null) {
3990
- confirmParams.header =
3991
- I18nUtil.instantActionTranslation(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation') ?? undefined;
4075
+ confirmParams.header = I18nUtils.Action.get(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation') ?? undefined;
3992
4076
  }
3993
4077
  if (action.runConfirmationMessage !== null) {
3994
- confirmParams.message =
3995
- I18nUtil.instantActionTranslation(this.translate, action, 'confirm.message', action.runConfirmationMessage, item, 'general.confirmation') ?? undefined;
4078
+ confirmParams.message = I18nUtils.Action.get(this.translate, action, 'confirm.message', action.runConfirmationMessage, item, 'general.confirmation') ?? undefined;
3996
4079
  }
3997
4080
  if (action.runConfirmationIcon !== null) {
3998
4081
  confirmParams.icon = action.runConfirmationIcon === undefined ? 'pi pi-exclamation-triangle' : action.runConfirmationIcon;
3999
4082
  }
4000
4083
  if (action.runConfirmationAcceptTitle !== null) {
4001
- confirmParams.acceptLabel =
4002
- I18nUtil.instantActionTranslation(this.translate, action, 'confirm.accept', action.runConfirmationAcceptTitle, item, 'general.yes') ?? undefined;
4084
+ confirmParams.acceptLabel = I18nUtils.Action.get(this.translate, action, 'confirm.accept', action.runConfirmationAcceptTitle, item, 'general.yes') ?? undefined;
4003
4085
  confirmParams.acceptVisible = true;
4004
4086
  }
4005
4087
  if (action.runConfirmationRejectTitle !== null) {
4006
- confirmParams.rejectLabel =
4007
- I18nUtil.instantActionTranslation(this.translate, action, 'confirm.reject', action.runConfirmationRejectTitle, item, 'general.no') ?? undefined;
4088
+ confirmParams.rejectLabel = I18nUtils.Action.get(this.translate, action, 'confirm.reject', action.runConfirmationRejectTitle, item, 'general.no') ?? undefined;
4008
4089
  confirmParams.rejectVisible = true;
4009
4090
  }
4010
4091
  const observable = new Observable(observer => {
@@ -4197,13 +4278,16 @@ class MngActionExecutorService {
4197
4278
  * @param action Action descriptor.
4198
4279
  * @param event Target table click event.
4199
4280
  * @param route Currently activate route.
4281
+ * @param tableDescriptor Table descriptor.
4282
+ * @param dataKeyProperty Data key property.
4200
4283
  */
4201
- triggerRowClickAction(action, event, route) {
4202
- if (!action.model.idPropertyName) {
4203
- throw new Error(`Row click action ${action.actionName} can not be triggered, because model id property name is not defined.`);
4284
+ triggerRowClickAction(action, event, route, tableDescriptor, dataKeyProperty) {
4285
+ const idProperty = dataKeyProperty ?? tableDescriptor?.dataKeyProperty ?? action?.model?.idPropertyName ?? dataKeyProperty;
4286
+ if (!idProperty) {
4287
+ throw new Error(`Row click action ${action.actionName} can not be triggered, because id property could not be found.`);
4204
4288
  }
4205
4289
  const rowItem = event?.rowItem;
4206
- return this.triggerAction(action, rowItem[action.model.idPropertyName], event.rowItem, undefined, route);
4290
+ return this.triggerAction(action, rowItem[idProperty], event.rowItem, undefined, route);
4207
4291
  }
4208
4292
  /**
4209
4293
  * Triggers action with optional data (item, itemId, ...) and currently activated route.
@@ -4280,7 +4364,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4280
4364
  class MngConfigurationService {
4281
4365
  constructor(http) {
4282
4366
  this.http = http;
4283
- this.jsonEnvironments = [];
4367
+ this.jsonSources = [];
4284
4368
  this.configuration = { ...this.projectEnvironment };
4285
4369
  }
4286
4370
  static init(httpClient) {
@@ -4307,23 +4391,55 @@ class MngConfigurationService {
4307
4391
  * Adds new config source from JSON file.
4308
4392
  * @param url Url to JSON file.
4309
4393
  */
4310
- addJsonSource(url = this.projectEnvironment.configurationJsonSource) {
4394
+ addJsonSource(url = this.projectEnvironment.configurationJsonSource, load = false) {
4311
4395
  if (!url) {
4312
- console.warn('No path to configuration file specified. Setting default.');
4396
+ console.debug('No path to configuration file specified. Setting default.');
4313
4397
  url = 'assets/config/env{{environment}}.json';
4314
4398
  }
4315
- const envName = this.projectEnvironment.name || (this.projectEnvironment.production ? 'prod' : 'dev');
4316
- url = url.replace('{{environment}}', '.' + envName);
4317
- return this.http.get(url).pipe(catchError(err => {
4318
- console.warn('Error loading configuration file:' + err.message + '. Falling back to env.json');
4319
- const pathSegments = url.split('/');
4320
- pathSegments[pathSegments.length - 1] = 'env.json';
4321
- return this.http.get(pathSegments.join('/'));
4322
- }), map(res => {
4323
- this.jsonEnvironments.push(res);
4324
- this.mergeConfigs();
4325
- return true;
4326
- }));
4399
+ const sourceInfo = {
4400
+ url: url,
4401
+ isEnvironment: false,
4402
+ isLoaded: false
4403
+ };
4404
+ this.jsonSources.push(sourceInfo);
4405
+ console.debug(`Added JSON source: ${url}`);
4406
+ if (load) {
4407
+ return this.loadJsonSources();
4408
+ }
4409
+ else {
4410
+ return of(true);
4411
+ }
4412
+ }
4413
+ loadJsonSources() {
4414
+ return combineLatest(this.jsonSources
4415
+ .filter(source => !source.isLoaded)
4416
+ .map(sourceInfo => {
4417
+ let url = sourceInfo.url;
4418
+ if (url.indexOf('{{environment}}') >= 0) {
4419
+ sourceInfo.isEnvironment = true;
4420
+ sourceInfo.environment = this.projectEnvironment.name || (this.projectEnvironment.production ? 'prod' : 'dev');
4421
+ url = url.replace('{{environment}}', '.' + sourceInfo.environment);
4422
+ }
4423
+ console.debug(`Loading JSON source: ${sourceInfo.url} with env ${sourceInfo.environment ?? '/'}`);
4424
+ return this.http.get(url).pipe(catchError((err) => {
4425
+ if (sourceInfo.isEnvironment) {
4426
+ const noEnvUrl = sourceInfo.url.replace('{{environment}}', '');
4427
+ sourceInfo.environment = null;
4428
+ console.debug(`Reloading JSON source: ${sourceInfo.url} with env ${sourceInfo.environment ?? '/'}`);
4429
+ return this.http.get(noEnvUrl);
4430
+ }
4431
+ else {
4432
+ const message = `Configuration file ${url} not loaded (${err.status}): ${err.message}.`;
4433
+ console.error(message);
4434
+ return throwError(() => new Error(message));
4435
+ }
4436
+ }), map(configuration => {
4437
+ sourceInfo.configuration = configuration;
4438
+ sourceInfo.isLoaded = true;
4439
+ console.debug(`JSON source loaded: ${sourceInfo.url}`);
4440
+ return true;
4441
+ }));
4442
+ })).pipe(map(sourceResults => sourceResults.every(sr => sr)), tap(sourceResults => this.mergeConfigs()));
4327
4443
  }
4328
4444
  /**
4329
4445
  * Get configuration.
@@ -4343,9 +4459,10 @@ class MngConfigurationService {
4343
4459
  */
4344
4460
  mergeConfigs() {
4345
4461
  let config = { ...this.projectEnvironment };
4346
- if (this.jsonEnvironments.length) {
4347
- for (const je of this.jsonEnvironments) {
4348
- config = { ...config, ...je };
4462
+ const jsonConfigs = this.jsonSources.filter(source => source.isLoaded && typeof source.configuration === 'object').map(source => source.configuration);
4463
+ if (jsonConfigs.length) {
4464
+ for (const jsonConfig of jsonConfigs) {
4465
+ config = { ...config, ...jsonConfig };
4349
4466
  }
4350
4467
  }
4351
4468
  this.configuration = config;
@@ -4354,7 +4471,7 @@ class MngConfigurationService {
4354
4471
  MngConfigurationService._instance = null;
4355
4472
 
4356
4473
  class MngCommonsService {
4357
- constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage) {
4474
+ constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage, commonsInitializers) {
4358
4475
  this.router = router;
4359
4476
  this.primengConfig = primengConfig;
4360
4477
  this.translate = translate;
@@ -4362,6 +4479,9 @@ class MngCommonsService {
4362
4479
  this.configurationService = configurationService;
4363
4480
  this.moduleConfig = moduleConfig;
4364
4481
  this.localStorage = localStorage;
4482
+ this.commonsInitializers = commonsInitializers;
4483
+ // internal
4484
+ this.isInitialized = false;
4365
4485
  // menu
4366
4486
  this._menuMode = 'sidebar';
4367
4487
  this._menuModeSubject = new BehaviorSubject(this._menuMode);
@@ -4489,52 +4609,69 @@ class MngCommonsService {
4489
4609
  return this.userSubject.asObservable();
4490
4610
  }
4491
4611
  initialize() {
4492
- // menu
4493
- this._menuMode = this.moduleConfig?.menu?.mode ?? 'sidebar';
4494
- this._menuModeSubject.next(this._menuMode);
4495
- this._menuItems = this.moduleConfig?.menu?.menuItems ?? [];
4496
- this._menuPinEnabled = this.moduleConfig?.menu?.pinEnabled ?? false;
4497
- // visual
4498
- this._colorScheme = this.moduleConfig?.app?.colorScheme ?? 'light';
4499
- // ripple
4500
- this.primengConfig.ripple = true;
4501
- this.primengConfig.filterMatchModeOptions = {
4502
- text: [
4503
- FilterDescriptor.MatchModeEnum.Contains,
4504
- FilterDescriptor.MatchModeEnum.Equals,
4505
- FilterDescriptor.MatchModeEnum.NotEquals,
4506
- FilterDescriptor.MatchModeEnum.StartsWith,
4507
- FilterDescriptor.MatchModeEnum.EndsWith
4508
- ],
4509
- numeric: [
4510
- FilterDescriptor.MatchModeEnum.Equals,
4511
- FilterDescriptor.MatchModeEnum.NotEquals,
4512
- FilterDescriptor.MatchModeEnum.LessThanOrEqualTo,
4513
- FilterDescriptor.MatchModeEnum.GreaterThanOrEqualTo
4514
- ],
4515
- date: [
4516
- FilterDescriptor.MatchModeEnum.DateIs,
4517
- FilterDescriptor.MatchModeEnum.DateIsNot,
4518
- FilterDescriptor.MatchModeEnum.DateBefore,
4519
- FilterDescriptor.MatchModeEnum.DateAfter
4520
- ]
4521
- };
4522
- // translate
4523
- this.translate.langs = this.appLanguages;
4524
- this.translate.use(this.appLanguage);
4525
- this.translate.get('mngPrime').subscribe(value => this.primengConfig.setTranslation(value));
4526
- this.router.events
4527
- .pipe(
4528
- // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
4529
- filter(event => event instanceof NavigationEnd))
4530
- .subscribe(() => {
4531
- this.updateBreadcrumbs();
4532
- this.setPageTitle();
4533
- });
4534
- this.translate.onLangChange.subscribe(() => {
4535
- this.updateBreadcrumbs();
4536
- this.setPageTitle();
4537
- });
4612
+ if (this.isInitialized) {
4613
+ return of(false);
4614
+ }
4615
+ console.debug(`Initializing @mediusinc/mng-commons.`);
4616
+ return this.configurationService.loadJsonSources().pipe(mergeMap$1(jsonSourcesRes => {
4617
+ if (this.commonsInitializers) {
4618
+ console.debug(`Initializing @mediusinc/mng-commons initializers.`);
4619
+ return combineLatest(this.commonsInitializers.map(ci => ci())).pipe(map(res => res));
4620
+ }
4621
+ else {
4622
+ return of(true);
4623
+ }
4624
+ }), map(() => {
4625
+ // menu
4626
+ this._menuMode = this.moduleConfig?.menu?.mode ?? 'sidebar';
4627
+ this._menuModeSubject.next(this._menuMode);
4628
+ this._menuItems = this.moduleConfig?.menu?.menuItems ?? [];
4629
+ this._menuPinEnabled = this.moduleConfig?.menu?.pinEnabled ?? false;
4630
+ // visual
4631
+ this._colorScheme = this.moduleConfig?.app?.colorScheme ?? 'light';
4632
+ // ripple
4633
+ this.primengConfig.ripple = true;
4634
+ this.primengConfig.filterMatchModeOptions = {
4635
+ text: [
4636
+ FilterDescriptor.MatchModeEnum.Contains,
4637
+ FilterDescriptor.MatchModeEnum.Equals,
4638
+ FilterDescriptor.MatchModeEnum.NotEquals,
4639
+ FilterDescriptor.MatchModeEnum.StartsWith,
4640
+ FilterDescriptor.MatchModeEnum.EndsWith
4641
+ ],
4642
+ numeric: [
4643
+ FilterDescriptor.MatchModeEnum.Equals,
4644
+ FilterDescriptor.MatchModeEnum.NotEquals,
4645
+ FilterDescriptor.MatchModeEnum.LessThanOrEqualTo,
4646
+ FilterDescriptor.MatchModeEnum.GreaterThanOrEqualTo
4647
+ ],
4648
+ date: [
4649
+ FilterDescriptor.MatchModeEnum.DateIs,
4650
+ FilterDescriptor.MatchModeEnum.DateIsNot,
4651
+ FilterDescriptor.MatchModeEnum.DateBefore,
4652
+ FilterDescriptor.MatchModeEnum.DateAfter
4653
+ ]
4654
+ };
4655
+ // translate
4656
+ this.translate.langs = this.appLanguages;
4657
+ this.translate.use(this.appLanguage);
4658
+ this.translate.get('mngPrime').subscribe(value => this.primengConfig.setTranslation(value));
4659
+ this.router.events
4660
+ .pipe(
4661
+ // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
4662
+ filter(event => event instanceof NavigationEnd))
4663
+ .subscribe(() => {
4664
+ this.updateBreadcrumbs();
4665
+ this.setPageTitle();
4666
+ });
4667
+ this.translate.onLangChange.subscribe(() => {
4668
+ this.updateBreadcrumbs();
4669
+ this.setPageTitle();
4670
+ });
4671
+ console.debug(`@mediusinc/mng-commons initialization complete.`);
4672
+ return true;
4673
+ }));
4674
+ this.isInitialized = true;
4538
4675
  }
4539
4676
  // MENU actions
4540
4677
  menuChangeActiveKey(key) {
@@ -4674,7 +4811,7 @@ class MngCommonsService {
4674
4811
  return titlePieces.join(' - ');
4675
4812
  }
4676
4813
  }
4677
- MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2.PrimeNGConfig }, { token: i1$1.TranslateService }, { token: i4$1.Title }, { token: MngConfigurationService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }], target: i0.ɵɵFactoryTarget.Injectable });
4814
+ MngCommonsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, deps: [{ token: i1.Router }, { token: i2.PrimeNGConfig }, { token: i1$1.TranslateService }, { token: i4$1.Title }, { token: MngConfigurationService }, { token: MNG_MODULE_CONFIG_IT }, { token: MNG_BROWSER_STORAGE_IT }, { token: MNG_COMMONS_INITIALIZER_IT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
4678
4815
  MngCommonsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService });
4679
4816
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, decorators: [{
4680
4817
  type: Injectable
@@ -4684,6 +4821,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4684
4821
  }] }, { type: Storage, decorators: [{
4685
4822
  type: Inject,
4686
4823
  args: [MNG_BROWSER_STORAGE_IT]
4824
+ }] }, { type: undefined, decorators: [{
4825
+ type: Inject,
4826
+ args: [MNG_COMMONS_INITIALIZER_IT]
4827
+ }, {
4828
+ type: Optional
4687
4829
  }] }]; } });
4688
4830
 
4689
4831
  /**
@@ -4698,7 +4840,7 @@ class MngViewContainerComponentService {
4698
4840
  set dataProvider(dataProvider) {
4699
4841
  this._dataProvider = dataProvider;
4700
4842
  }
4701
- get reloadTable$() {
4843
+ get reloadTable() {
4702
4844
  return this._reloadTableSubject.asObservable();
4703
4845
  }
4704
4846
  triggerTableReload(event) {
@@ -4748,8 +4890,8 @@ class MngActionComponent {
4748
4890
  const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, this.viewContainer ?? undefined, this, this.actionData);
4749
4891
  this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
4750
4892
  this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
4751
- this.$label = this.hasNoTitle ? of(null) : I18nUtil.streamActionTranslation(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item);
4752
- this.$tooltip = I18nUtil.streamActionTranslation(this.translate, this.action, 'tooltip', this.action?.tooltip ?? undefined, this.item);
4893
+ this.$label = this.hasNoTitle ? of(null) : I18nUtils.Action.getAsync(this.translate, this.action, 'title', this.action?.title ?? undefined, this.item);
4894
+ this.$tooltip = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', this.action?.tooltip ?? undefined, this.item);
4753
4895
  if (this.action instanceof ActionLinkDescriptor) {
4754
4896
  this.actionLink = this.action;
4755
4897
  }
@@ -5755,11 +5897,7 @@ class MngActionEditorComponent {
5755
5897
  }
5756
5898
  return;
5757
5899
  }
5758
- const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'editor.title', this.action.editorTitle, this.item)
5759
- .pipe(mergeMap(i18nDialogTitle => i18nDialogTitle === null
5760
- ? I18nUtil.getActionTranslation(this.translate, this.action, 'title', undefined, this.item)
5761
- : of(i18nDialogTitle)))
5762
- .subscribe(t => {
5900
+ const subscription = I18nUtils.Action.getEditorTitleAsync(this.translate, this.action, this.item).subscribe(t => {
5763
5901
  this.title = t ?? undefined;
5764
5902
  if (this.dialogConfig) {
5765
5903
  requestAnimationFrame(() => {
@@ -6027,6 +6165,7 @@ class MngTableComponent {
6027
6165
  this.subscriptions = [];
6028
6166
  }
6029
6167
  ngOnInit() {
6168
+ this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
6030
6169
  this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
6031
6170
  if (this.descriptor.paginationMode === PaginationModeEnum.InfiniteScroll) {
6032
6171
  this.infiniteScroll = true;
@@ -6169,7 +6308,7 @@ class MngTableComponent {
6169
6308
  this.isSortChanged = false;
6170
6309
  this.dataProviderLoadingSubject.next(false);
6171
6310
  }, err => {
6172
- NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainerService ?? undefined);
6311
+ NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainer);
6173
6312
  const emptyQueryResult = new MediusQueryResult();
6174
6313
  emptyQueryResult.pageData = [];
6175
6314
  emptyQueryResult.allDataCount = 0;
@@ -6235,7 +6374,7 @@ class MngTableComponent {
6235
6374
  }
6236
6375
  }
6237
6376
  MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
6238
- MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", isColumnClickable: "isColumnClickable", captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6377
+ MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6239
6378
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
6240
6379
  type: Component,
6241
6380
  args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
@@ -6259,6 +6398,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
6259
6398
  type: Input
6260
6399
  }], isColumnClickable: [{
6261
6400
  type: Input
6401
+ }], viewContainerInit: [{
6402
+ type: Input,
6403
+ args: ['viewContainer']
6262
6404
  }], captionComponent: [{
6263
6405
  type: Input
6264
6406
  }], columnActionComponent: [{
@@ -6311,7 +6453,7 @@ class MngTableviewComponent {
6311
6453
  if (this.dataProvider) {
6312
6454
  this.viewContainerService.dataProvider = this.dataProvider;
6313
6455
  }
6314
- const reloadTableSubscription = this.viewContainerService.reloadTable$.subscribe(() => {
6456
+ const reloadTableSubscription = this.viewContainerService.reloadTable.subscribe(() => {
6315
6457
  this.reloadTable();
6316
6458
  });
6317
6459
  this.subscriptions.push(reloadTableSubscription);
@@ -6348,13 +6490,13 @@ class MngTableviewComponent {
6348
6490
  onTableCellClick(event) {
6349
6491
  if (this.rowClickActions.length) {
6350
6492
  for (const action of this.rowClickActions) {
6351
- this.actionExecutor.triggerRowClickAction(action, event, this.route);
6493
+ this.actionExecutor.triggerRowClickAction(action, event, this.route, this.descriptor.table);
6352
6494
  }
6353
6495
  }
6354
6496
  }
6355
6497
  }
6356
6498
  MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$1.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
6357
- MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i1$1.TranslatePipe } });
6499
+ MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i1$1.TranslatePipe } });
6358
6500
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
6359
6501
  type: Component,
6360
6502
  args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
@@ -6601,7 +6743,7 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
6601
6743
  }
6602
6744
  }
6603
6745
  MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
6604
- MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6746
+ MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6605
6747
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
6606
6748
  type: Component,
6607
6749
  args: [{ selector: 'mng-formly-field-lookup-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
@@ -6753,7 +6895,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
6753
6895
  }
6754
6896
  }
6755
6897
  MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
6756
- MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" (cellClick)=\"onTableCellClick($event)\" [isColumnClickable]=\"rowInlineActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6898
+ MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" (cellClick)=\"onTableCellClick($event)\" [isColumnClickable]=\"rowInlineActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6757
6899
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
6758
6900
  type: Component,
6759
6901
  args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" (cellClick)=\"onTableCellClick($event)\" [isColumnClickable]=\"rowInlineActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"] }]
@@ -6864,7 +7006,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
6864
7006
  }
6865
7007
  }
6866
7008
  MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
6867
- MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
7009
+ MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
6868
7010
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
6869
7011
  type: Component,
6870
7012
  args: [{ selector: 'mng-formly-table-multiselect-add-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
@@ -7439,7 +7581,16 @@ function mngConfigJsonAppInitializerProvider(configService, moduleConfig) {
7439
7581
  return of(false);
7440
7582
  }
7441
7583
  else {
7442
- return configService.addJsonSource(moduleConfig?.configuration?.jsonSource ?? undefined);
7584
+ const jsonSource = moduleConfig?.configuration?.jsonSource;
7585
+ if (!jsonSource) {
7586
+ return configService.addJsonSource();
7587
+ }
7588
+ else if (Array.isArray(jsonSource)) {
7589
+ return combineLatest(jsonSource.map(source => configService.addJsonSource(source))).pipe(map(sourcesRes => sourcesRes.every(s => s)));
7590
+ }
7591
+ else {
7592
+ return configService.addJsonSource(jsonSource);
7593
+ }
7443
7594
  }
7444
7595
  };
7445
7596
  }
@@ -8584,5 +8735,5 @@ class RouteDataBuilder {
8584
8735
  * Generated bundle index. Do not edit.
8585
8736
  */
8586
8737
 
8587
- export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
8738
+ export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionSimpleDescriptor, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
8588
8739
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map