@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);
@@ -705,6 +716,9 @@ class ActionEditorDescriptor extends ActionDescriptor {
705
716
  return this;
706
717
  }
707
718
  withServiceType(serviceType) {
719
+ if (!this._model) {
720
+ throw new Error(`Cannot set data provider if no model type is provided for action ${this._actionName}`);
721
+ }
708
722
  this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
709
723
  return this;
710
724
  }
@@ -763,7 +777,7 @@ class ActionEditorSubmitDescriptor extends ActionDescriptor {
763
777
  })(ActionEditorSubmitDescriptor || (ActionEditorSubmitDescriptor = {}));
764
778
  class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
765
779
  constructor(editorDescriptor) {
766
- super(editorDescriptor, 'details');
780
+ super(editorDescriptor, ActionEditorDetailsDescriptor.ACTION_NAME);
767
781
  this.withPosition(ActionPositionEnum.RowClick);
768
782
  this.withRouteTrigger(':itemId');
769
783
  this.withFetchFunction(ctx => {
@@ -787,9 +801,10 @@ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
787
801
  return this;
788
802
  }
789
803
  }
804
+ ActionEditorDetailsDescriptor.ACTION_NAME = 'details';
790
805
  class ActionEditorAddDescriptor extends ActionEditorDescriptor {
791
806
  constructor(editorDescriptor) {
792
- super(editorDescriptor, 'add');
807
+ super(editorDescriptor, ActionEditorAddDescriptor.ACTION_NAME);
793
808
  this.withPosition(ActionPositionEnum.ToolbarLeft);
794
809
  this.withRouteTrigger('add');
795
810
  this.withSubmitFunction(ctx => { var _a, _b; return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.create) ? ctx.dataProvider.create((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)); });
@@ -812,9 +827,10 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
812
827
  return this;
813
828
  }
814
829
  }
830
+ ActionEditorAddDescriptor.ACTION_NAME = 'add';
815
831
  class ActionEditorEditDescriptor extends ActionEditorDescriptor {
816
832
  constructor(editorDescriptor) {
817
- super(editorDescriptor, 'edit');
833
+ super(editorDescriptor, ActionEditorEditDescriptor.ACTION_NAME);
818
834
  this.withPosition(ActionPositionEnum.RowInline);
819
835
  this.withTitle(null);
820
836
  this.withRouteTrigger(':itemId/edit');
@@ -848,9 +864,10 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
848
864
  return this;
849
865
  }
850
866
  }
867
+ ActionEditorEditDescriptor.ACTION_NAME = 'edit';
851
868
  class ActionDeleteDescriptor extends ActionDescriptor {
852
869
  constructor(model) {
853
- super(model, 'delete');
870
+ super(model, ActionDeleteDescriptor.ACTION_NAME);
854
871
  this.withPosition(ActionPositionEnum.RowInline);
855
872
  this.withTitle(null);
856
873
  this.withRunFunction(ctx => {
@@ -876,9 +893,10 @@ class ActionDeleteDescriptor extends ActionDescriptor {
876
893
  return this;
877
894
  }
878
895
  }
896
+ ActionDeleteDescriptor.ACTION_NAME = 'delete';
879
897
  class ActionLinkDescriptor extends ActionDescriptor {
880
- constructor(model) {
881
- super(model, 'link');
898
+ constructor(model = null, actionName = 'link') {
899
+ super(model, actionName);
882
900
  this._url = '';
883
901
  this._pathSegments = [];
884
902
  this._replaceUrl = false;
@@ -1424,7 +1442,7 @@ class EditorDescriptor {
1424
1442
  createTabGroup(name, title) {
1425
1443
  const tabGroup = new FieldTabGroupDescriptor(this, name);
1426
1444
  if (!title) {
1427
- title = I18nUtil.getModelTabKey(this.model, name);
1445
+ title = I18nUtils.Type.getTabKey(this.model.typeName, name);
1428
1446
  }
1429
1447
  tabGroup.withTitle(title);
1430
1448
  this.createTabGroupDescriptor(tabGroup);
@@ -1434,7 +1452,7 @@ class EditorDescriptor {
1434
1452
  const fieldGroup = new FieldGroupDescriptor(this, name);
1435
1453
  if (title !== null) {
1436
1454
  if (!title) {
1437
- title = I18nUtil.getModelGroupKey(this.model, name);
1455
+ title = I18nUtils.Type.getGroupKey(this.model.typeName, name);
1438
1456
  }
1439
1457
  fieldGroup.withTitle(title);
1440
1458
  }
@@ -1616,7 +1634,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
1616
1634
  this._size = FieldDescriptor.SizeEnum.Normal;
1617
1635
  this._eventsSubject = new Subject();
1618
1636
  this._property = property;
1619
- this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
1637
+ this._label = I18nUtils.Type.getPropertyKey(this._editor.model.typeName, property);
1620
1638
  }
1621
1639
  get property() {
1622
1640
  return this._property;
@@ -2950,169 +2968,326 @@ class EnumUtil {
2950
2968
  }
2951
2969
  }
2952
2970
 
2953
- class I18nUtil {
2954
- static instantModelTranslation(translate, model, keyPath, customKey, item, fallbackKey, i18nParams) {
2955
- const keys = I18nUtil.getModelKeysByPriority(model, keyPath, customKey, fallbackKey);
2956
- const i18nModelName = I18nUtil.instantModelName(translate, model, true);
2957
- const i18n = translate.instant(keys, I18nUtil.getModelI18nParams(model, item, i18nModelName !== null && i18nModelName !== void 0 ? i18nModelName : undefined, i18nParams));
2958
- return I18nUtil.selectKeyByPriority(keys, i18n);
2959
- }
2960
- static getModelTabKey(model, tab) {
2961
- return I18nUtil.getModelKeyPath(model, `tabs.${tab}`);
2971
+ const typeNameDecoratorPropertyName = 'typeName';
2972
+ function TypeName(typeName) {
2973
+ return function (target) {
2974
+ target[typeNameDecoratorPropertyName] = typeName;
2975
+ };
2976
+ }
2977
+ const enumNameDecoratorPropertyName = 'enumName';
2978
+ function EnumName(typeName) {
2979
+ return function (target) {
2980
+ target[enumNameDecoratorPropertyName] = typeName;
2981
+ };
2982
+ }
2983
+
2984
+ class TypeUtil {
2985
+ /**
2986
+ * Defines type name decorator.
2987
+ * @param targetType class.
2988
+ * @param typeName Name of the type.
2989
+ */
2990
+ static defineReflectTypeName(targetType, typeName) {
2991
+ if (!typeName) {
2992
+ typeName = TypeUtil.getDecoratorTypeName(targetType);
2993
+ if (!typeName) {
2994
+ console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
2995
+ return;
2996
+ }
2997
+ }
2998
+ if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
2999
+ Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
3000
+ }
2962
3001
  }
2963
- static getModelGroupKey(model, group) {
2964
- return I18nUtil.getModelKeyPath(model, `groups.${group}`);
3002
+ /**
3003
+ * Defines enum name decorator.
3004
+ * @param targetType enum object.
3005
+ * @param enumName Name of the enum.
3006
+ */
3007
+ static defineReflectEnumName(targetType, enumName) {
3008
+ if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
3009
+ Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
3010
+ }
2965
3011
  }
2966
- static getModelPropertyKey(model, property) {
2967
- return I18nUtil.getModelKeyPath(model, `properties.${property}`);
3012
+ /**
3013
+ * Gets type name from either decorator or reflect metadata.
3014
+ * @param type Class.
3015
+ */
3016
+ static findTypeName(type) {
3017
+ let decoratorName = TypeUtil.getDecoratorTypeName(type);
3018
+ if (decoratorName) {
3019
+ return decoratorName;
3020
+ }
3021
+ decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
3022
+ if (decoratorName) {
3023
+ return decoratorName;
3024
+ }
3025
+ return type.name;
2968
3026
  }
2969
- static instantActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, functionNameKey, i18nParams) {
2970
- const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
2971
- const i18nModelName = I18nUtil.instantModelName(translate, action === null || action === void 0 ? void 0 : action.model, true);
2972
- const i18nFunctionTitle = I18nUtil.getFunctionTitle(translate, functionNameKey);
2973
- const i18n = translate.instant(keys, I18nUtil.getActionI18nParams(action, item, i18nModelName !== null && i18nModelName !== void 0 ? i18nModelName : undefined, i18nParams, i18nFunctionTitle));
2974
- return I18nUtil.selectKeyByPriority(keys, i18n);
3027
+ /**
3028
+ * Gets enum name from either decorator or reflect metadata.
3029
+ * @param enumType Class.
3030
+ */
3031
+ static findEnumName(enumType) {
3032
+ let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
3033
+ if (decoratorName) {
3034
+ return decoratorName;
3035
+ }
3036
+ decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
3037
+ if (decoratorName) {
3038
+ return decoratorName;
3039
+ }
3040
+ throw new Error('Could not fined enum name');
2975
3041
  }
2976
- static streamActionTranslation(translate, action, keyPath, customKey, item, fallbackKey) {
2977
- return I18nUtil.getActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, false);
3042
+ /**
3043
+ * Get value from decorator defined property name
3044
+ * @param type Class.
3045
+ */
3046
+ // eslint-disable-next-line @typescript-eslint/ban-types
3047
+ static getDecoratorTypeName(type) {
3048
+ return type[typeNameDecoratorPropertyName];
2978
3049
  }
2979
- static getActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, oneTime = true) {
2980
- const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
2981
- return I18nUtil.getModelName(translate, action === null || action === void 0 ? void 0 : action.model, oneTime, true).pipe(mergeMap(i18nModelName => translate.get(keys, I18nUtil.getActionI18nParams(action, item, i18nModelName !== null && i18nModelName !== void 0 ? i18nModelName : undefined))), map(i18n => I18nUtil.selectKeyByPriority(keys, i18n)));
3050
+ /**
3051
+ * Get value from decorator defined property name
3052
+ * @param type Enum object.
3053
+ */
3054
+ static getDecoratorEnumName(type) {
3055
+ return type[enumNameDecoratorPropertyName];
2982
3056
  }
2983
- static getModelI18nParams(model, item, i18nModelName, i18nParameters = {}) {
2984
- i18nParameters.itemId = '';
2985
- i18nParameters.itemTitle = '';
2986
- if (i18nModelName) {
2987
- i18nParameters.modelName = i18nModelName;
2988
- }
2989
- if (item) {
2990
- if (model.idPropertyName && item[model.idPropertyName]) {
2991
- i18nParameters.itemId = item[model.idPropertyName];
3057
+ }
3058
+
3059
+ var I18nUtils;
3060
+ (function (I18nUtils) {
3061
+ class Common {
3062
+ static getAsync(translate, params, ...keys) {
3063
+ return translate.stream(keys, params).pipe(map(i18n => I18nUtils.Common.selectI18n(keys, i18n)));
3064
+ }
3065
+ static get(translate, params, ...keys) {
3066
+ const i18n = translate.instant(keys, params);
3067
+ return I18nUtils.Common.selectI18n(keys, i18n);
3068
+ }
3069
+ static populateParams(item, params = {}) {
3070
+ const paramsRes = Object.assign({}, params);
3071
+ if (item) {
3072
+ paramsRes.item = item;
2992
3073
  }
2993
- if (model.titlePropertyName && item[model.titlePropertyName]) {
2994
- i18nParameters.itemTitle = item[model.titlePropertyName];
3074
+ return paramsRes;
3075
+ }
3076
+ static selectI18n(keys, i18n) {
3077
+ for (const key of keys) {
3078
+ if (key !== i18n[key]) {
3079
+ return i18n[key];
3080
+ }
2995
3081
  }
3082
+ return null;
2996
3083
  }
2997
- return i18nParameters;
2998
3084
  }
2999
- static getActionI18nParams(action, item, i18nModelName, i18nParameters = {}, functionTitle) {
3000
- i18nParameters.itemId = '';
3001
- i18nParameters.itemTitle = '';
3002
- if (functionTitle) {
3003
- i18nParameters.functionTitle = functionTitle;
3085
+ I18nUtils.Common = Common;
3086
+ class Type {
3087
+ static getClassNameAsync(translate, classType, singular) {
3088
+ const typeName = TypeUtil.findTypeName(classType);
3089
+ return I18nUtils.Type.getNameAsync(translate, typeName, singular);
3004
3090
  }
3005
- if (i18nModelName) {
3006
- i18nParameters.modelName = i18nModelName;
3091
+ static getClassName(translate, classType, singular) {
3092
+ const typeName = TypeUtil.findTypeName(classType);
3093
+ return I18nUtils.Type.getName(translate, typeName, singular);
3007
3094
  }
3008
- if (item) {
3009
- if (action.model.idPropertyName && item[action.model.idPropertyName]) {
3010
- i18nParameters.itemId = item[action.model.idPropertyName];
3011
- }
3012
- if (action.model.titlePropertyName && item[action.model.titlePropertyName]) {
3013
- i18nParameters.itemTitle = item[action.model.titlePropertyName];
3095
+ static getNameAsync(translate, typeName, singular) {
3096
+ const keys = I18nUtils.Type.getNameKeys(typeName, singular);
3097
+ return I18nUtils.Common.getAsync(translate, undefined, ...keys);
3098
+ }
3099
+ static getName(translate, typeName, singular) {
3100
+ const keys = I18nUtils.Type.getNameKeys(typeName, singular);
3101
+ return I18nUtils.Common.get(translate, undefined, ...keys);
3102
+ }
3103
+ static getClassTabKey(classType, tab) {
3104
+ const typeName = TypeUtil.findTypeName(classType);
3105
+ return I18nUtils.Type.getTabKey(typeName, tab);
3106
+ }
3107
+ static getTabKey(typeName, tab) {
3108
+ return I18nUtils.Type.getPath(typeName, 'tabs', tab);
3109
+ }
3110
+ static getClassGroupKey(classType, group) {
3111
+ const typeName = TypeUtil.findTypeName(classType);
3112
+ return I18nUtils.Type.getGroupKey(typeName, group);
3113
+ }
3114
+ static getGroupKey(typeName, group) {
3115
+ return I18nUtils.Type.getPath(typeName, 'groups', group);
3116
+ }
3117
+ static getClassPropertyKey(classType, property) {
3118
+ const typeName = TypeUtil.findTypeName(classType);
3119
+ return I18nUtils.Type.getPropertyKey(typeName, property);
3120
+ }
3121
+ static getPropertyKey(typeName, property) {
3122
+ return I18nUtils.Type.getPath(typeName, 'properties', property);
3123
+ }
3124
+ static getClassPath(classType, ...path) {
3125
+ const typeName = TypeUtil.findTypeName(classType);
3126
+ return I18nUtils.Type.getPath(typeName, ...path);
3127
+ }
3128
+ static getPath(typeName, ...path) {
3129
+ return `${typeName}.${path.join('.')}`;
3130
+ }
3131
+ static getClassParams(translate, classType, item, params = {}) {
3132
+ const typeName = TypeUtil.findTypeName(classType);
3133
+ return I18nUtils.Type.getParams(translate, typeName, item, params);
3134
+ }
3135
+ static getParams(translate, typeName, item, params = {}) {
3136
+ const i18nTypeName = typeName ? I18nUtils.Type.getName(translate, typeName, true) : null;
3137
+ return I18nUtils.Type.populateParams(i18nTypeName !== null && i18nTypeName !== void 0 ? i18nTypeName : undefined, item, params);
3138
+ }
3139
+ static getClassParamsAsync(translate, classType, item, params = {}) {
3140
+ const typeName = TypeUtil.findTypeName(classType);
3141
+ return I18nUtils.Type.getParamsAsync(translate, typeName, item, params);
3142
+ }
3143
+ static getParamsAsync(translate, typeName, item, params = {}) {
3144
+ return (typeName ? I18nUtils.Type.getNameAsync(translate, typeName, true) : of(null)).pipe(map(i18nTypeName => I18nUtils.Type.populateParams(i18nTypeName !== null && i18nTypeName !== void 0 ? i18nTypeName : undefined, item, params)));
3145
+ }
3146
+ static populateParams(i18nTypeName, item, params = {}) {
3147
+ const paramsRes = Object.assign({}, params);
3148
+ if (i18nTypeName) {
3149
+ paramsRes.typeName = i18nTypeName;
3014
3150
  }
3151
+ return I18nUtils.Common.populateParams(item, paramsRes);
3015
3152
  }
3016
- return i18nParameters;
3017
- }
3018
- static instantErrorI18nTranslation(translate, error, i18nParameters = {}) {
3019
- i18nParameters.errorStatus = '';
3020
- i18nParameters.errorMessage = '';
3021
- if (error.messageCode) {
3022
- const params = I18nUtil.getErrorI18nParams(error);
3023
- const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
3024
- const i18ns = translate.instant(keys, params);
3025
- const i18n = I18nUtil.selectKeyByPriority(keys, i18ns);
3026
- if (i18n) {
3027
- return i18n;
3153
+ static getNameKeys(typeName, singular) {
3154
+ const keys = [];
3155
+ if (typeof singular !== 'undefined') {
3156
+ keys.push(singular ? `${typeName}.nameSingular` : `${typeName}.namePlural`);
3028
3157
  }
3158
+ keys.push(`${typeName}.name`);
3159
+ return keys;
3029
3160
  }
3030
- return translate.instant(error.message);
3031
3161
  }
3032
- static getErrorI18nParams(error, i18nParameters = {}) {
3033
- i18nParameters.errorStatus = '';
3034
- i18nParameters.errorMessage = '';
3035
- if (error.status) {
3036
- i18nParameters.errorStatus = error.status;
3162
+ I18nUtils.Type = Type;
3163
+ class Model {
3164
+ static get(translate, model, keyPath, customKey, item, fallbackKey, params) {
3165
+ const keys = I18nUtils.Model.getKeysByPriority(model, keyPath, customKey, fallbackKey);
3166
+ const i18nParams = I18nUtils.Model.getParams(translate, model, item, params);
3167
+ return I18nUtils.Common.get(translate, i18nParams, ...keys);
3037
3168
  }
3038
- if (error.message) {
3039
- i18nParameters.errorMessage = error.message;
3169
+ static getName(translate, model, singular) {
3170
+ return I18nUtils.Type.getName(translate, model.typeName, singular);
3040
3171
  }
3041
- if (error.statusDescription) {
3042
- i18nParameters.errorStatusDescription = error.statusDescription;
3172
+ static getNameAsync(translate, model, singular) {
3173
+ return I18nUtils.Type.getNameAsync(translate, model.typeName, singular);
3043
3174
  }
3044
- return i18nParameters;
3045
- }
3046
- static instantModelName(translate, model, singular) {
3047
- const keys = I18nUtil.getModelNameKeys(model, singular);
3048
- const i18n = translate.instant(keys);
3049
- return I18nUtil.selectKeyByPriority(keys, i18n);
3050
- }
3051
- static getModelName(translate, model, oneTime = true, singular) {
3052
- const keys = I18nUtil.getModelNameKeys(model, singular);
3053
- const obs = translate.stream(keys);
3054
- if (oneTime) {
3055
- obs.pipe(first());
3175
+ static getParams(translate, model, item, params = {}) {
3176
+ const i18nParams = I18nUtils.Type.getParams(translate, model === null || model === void 0 ? void 0 : model.typeName, item, params);
3177
+ return I18nUtils.Model.populateParams(model === null || model === void 0 ? void 0 : model.idPropertyName, model === null || model === void 0 ? void 0 : model.titlePropertyName, item, i18nParams);
3056
3178
  }
3057
- return obs.pipe(map(i18n => I18nUtil.selectKeyByPriority(keys, i18n)));
3058
- }
3059
- static getModelNameKeys(model, singular) {
3060
- const keys = [];
3061
- if (singular !== undefined) {
3062
- keys.push(singular ? `${model === null || model === void 0 ? void 0 : model.typeName}.nameSingular` : `${model === null || model === void 0 ? void 0 : model.typeName}.namePlural`);
3179
+ static getParamsAsync(translate, model, item, params = {}) {
3180
+ return I18nUtils.Type.getParamsAsync(translate, model === null || model === void 0 ? void 0 : model.typeName, item, params).pipe(map(i18nParams => I18nUtils.Model.populateParams(model === null || model === void 0 ? void 0 : model.idPropertyName, model === null || model === void 0 ? void 0 : model.titlePropertyName, item, i18nParams)));
3063
3181
  }
3064
- keys.push(`${model === null || model === void 0 ? void 0 : model.typeName}.name`);
3065
- return keys;
3066
- }
3067
- static getModelKeysByPriority(model, keyPath, customKey, fallbackKey) {
3068
- const keys = [];
3069
- if (customKey) {
3070
- keys.push(customKey);
3182
+ static populateParams(idProperty, titleProperty, item, params = {}) {
3183
+ const paramsRes = Object.assign(Object.assign({}, params), { itemId: '', itemTitle: '' });
3184
+ if (item) {
3185
+ if (idProperty && item[idProperty]) {
3186
+ paramsRes.itemId = item[idProperty];
3187
+ }
3188
+ if (titleProperty && item[titleProperty]) {
3189
+ paramsRes.itemTitle = item[titleProperty];
3190
+ }
3191
+ }
3192
+ return paramsRes;
3071
3193
  }
3072
- const modelActionKey = I18nUtil.getModelKeyPath(model, keyPath);
3073
- keys.push(modelActionKey);
3074
- if (fallbackKey) {
3075
- keys.push(fallbackKey);
3194
+ static getKeysByPriority(model, keyPath, customKey, fallbackKey) {
3195
+ const keys = [];
3196
+ if (customKey) {
3197
+ keys.push(customKey);
3198
+ }
3199
+ const modelActionKey = I18nUtils.Type.getPath(model.typeName, ...keyPath);
3200
+ keys.push(modelActionKey);
3201
+ if (fallbackKey) {
3202
+ keys.push(fallbackKey);
3203
+ }
3204
+ return keys;
3076
3205
  }
3077
- return keys;
3078
3206
  }
3079
- static getModelKeyPath(model, keyPath) {
3080
- return `${model.typeName}.${keyPath}`;
3081
- }
3082
- static getActionKeysByPriority(action, keyPath, customKey, fallbackKey) {
3083
- const keys = [];
3084
- if (customKey) {
3085
- keys.push(customKey);
3207
+ I18nUtils.Model = Model;
3208
+ class Action {
3209
+ static get(translate, action, actionPathKeys, customKey, item, fallbackKey, params) {
3210
+ const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
3211
+ const i18nParams = I18nUtils.Action.getParams(translate, action, item, params);
3212
+ return I18nUtils.Common.get(translate, i18nParams, ...keys);
3213
+ }
3214
+ static getAsync(translate, action, actionPathKeys, customKey, item, fallbackKey, params) {
3215
+ return I18nUtils.Action.getParamsAsync(translate, action, item, params).pipe(mergeMap(i18nParams => {
3216
+ const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
3217
+ return I18nUtils.Common.getAsync(translate, i18nParams, ...keys);
3218
+ }));
3086
3219
  }
3087
- const modelActionKey = `${action.i18nModelActionBaseKey}.${keyPath}`;
3088
- const actionKey = `${action.actionName}.${keyPath}`;
3089
- keys.push(modelActionKey, actionKey);
3090
- if (fallbackKey) {
3091
- keys.push(fallbackKey);
3220
+ static getTitleAsync(translate, action, item) {
3221
+ return I18nUtils.Action.getAsync(translate, action, 'title', undefined, item);
3092
3222
  }
3093
- return keys;
3094
- }
3095
- static selectKeyByPriority(keys, i18n) {
3096
- for (const key of keys) {
3097
- if (key !== i18n[key]) {
3098
- return i18n[key];
3223
+ static getEditorTitleAsync(translate, action, item) {
3224
+ var _a;
3225
+ return I18nUtils.Action.getAsync(translate, action, ['editor.title', 'title'], (_a = action.editorTitle) !== null && _a !== void 0 ? _a : undefined, item);
3226
+ }
3227
+ static getParams(translate, action, item, params = {}) {
3228
+ var _a;
3229
+ const i18nParams = I18nUtils.Model.getParams(translate, (_a = action.model) !== null && _a !== void 0 ? _a : undefined, item, params);
3230
+ return I18nUtils.Action.populateParams(i18nParams);
3231
+ }
3232
+ static getParamsAsync(translate, action, item, params = {}) {
3233
+ var _a;
3234
+ return I18nUtils.Model.getParamsAsync(translate, (_a = action.model) !== null && _a !== void 0 ? _a : undefined, item, params).pipe(map(i18nParams => I18nUtils.Action.populateParams(i18nParams)));
3235
+ }
3236
+ static populateParams(params = {}) {
3237
+ params = Object.assign({}, params);
3238
+ return params;
3239
+ }
3240
+ static getKeysByPriority(action, actionPathKeys, customKey, fallbackKey) {
3241
+ const keys = [];
3242
+ if (customKey) {
3243
+ keys.push(customKey);
3099
3244
  }
3245
+ if (!Array.isArray(actionPathKeys)) {
3246
+ actionPathKeys = [actionPathKeys];
3247
+ }
3248
+ actionPathKeys.forEach(k => {
3249
+ const modelActionKey = `${action.i18nModelActionBaseKey}.${k}`;
3250
+ const actionKey = `${action.actionName}.${k}`;
3251
+ keys.push(modelActionKey, actionKey);
3252
+ });
3253
+ if (fallbackKey) {
3254
+ keys.push(fallbackKey);
3255
+ }
3256
+ return keys;
3100
3257
  }
3101
- return null;
3102
3258
  }
3103
- static getFunctionTitle(translate, functionTitle) {
3104
- if (functionTitle) {
3105
- const translation = translate.instant(`mngAction.functions.${functionTitle}.title`);
3106
- if (translation === functionTitle) {
3107
- return null;
3259
+ I18nUtils.Action = Action;
3260
+ class Error {
3261
+ static get(translate, error, params = {}) {
3262
+ const i18nParams = I18nUtils.Error.getParams(error, params);
3263
+ if (error.messageCode) {
3264
+ const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
3265
+ const i18n = I18nUtils.Common.get(translate, i18nParams, ...keys);
3266
+ if (i18n) {
3267
+ return i18n;
3268
+ }
3108
3269
  }
3109
- return translation;
3270
+ return I18nUtils.Common.get(translate, i18nParams, error.message);
3110
3271
  }
3111
- else {
3112
- return null;
3272
+ static getParams(error, params = {}) {
3273
+ const paramsRes = Object.assign({}, params);
3274
+ paramsRes.errorStatus = '';
3275
+ paramsRes.errorMessage = '';
3276
+ if (error.status) {
3277
+ paramsRes.errorStatus = error.status;
3278
+ }
3279
+ if (error.message) {
3280
+ paramsRes.errorMessage = error.message;
3281
+ }
3282
+ if (error.statusDescription) {
3283
+ paramsRes.errorStatusDescription = error.statusDescription;
3284
+ }
3285
+ paramsRes.error = error;
3286
+ return paramsRes;
3113
3287
  }
3114
3288
  }
3115
- }
3289
+ I18nUtils.Error = Error;
3290
+ })(I18nUtils || (I18nUtils = {}));
3116
3291
 
3117
3292
  class ModelUtil {
3118
3293
  static findIdAttribute(classType) {
@@ -3188,7 +3363,7 @@ class NotificationUtil {
3188
3363
  }
3189
3364
  return notification;
3190
3365
  }
3191
- static tableNotificationError(translationService, table, error, viewContainer) {
3366
+ static tableNotificationError(translate, table, error, viewContainer) {
3192
3367
  var _a, _b;
3193
3368
  const params = {};
3194
3369
  if (error === null || error === void 0 ? void 0 : error.message) {
@@ -3197,122 +3372,33 @@ class NotificationUtil {
3197
3372
  else {
3198
3373
  params.errorMessage = '.';
3199
3374
  }
3200
- console.log(params);
3201
- const tableErrorTitle = (_a = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params)) !== null && _a !== void 0 ? _a : undefined;
3202
- const tableErrorMessage = (_b = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params)) !== null && _b !== void 0 ? _b : undefined;
3375
+ const tableErrorTitle = (_a = I18nUtils.Model.get(translate, table.model, 'table.error.title', undefined, undefined, 'general.error', params)) !== null && _a !== void 0 ? _a : undefined;
3376
+ const tableErrorMessage = (_b = I18nUtils.Model.get(translate, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params)) !== null && _b !== void 0 ? _b : undefined;
3203
3377
  return NotificationUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
3204
3378
  }
3205
- static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
3379
+ static actionNotificationSuccess(translate, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
3206
3380
  var _a, _b;
3207
- const actionSuccessTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName)) !== null && _a !== void 0 ? _a : undefined;
3208
- const actionSuccessMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName)) !== null && _b !== void 0 ? _b : undefined;
3381
+ const actionSuccessTitle = (_a = I18nUtils.Action.get(translate, action, 'success.title', customTitleKey, item, 'general.success', functionName)) !== null && _a !== void 0 ? _a : undefined;
3382
+ const actionSuccessMessage = (_b = I18nUtils.Action.get(translate, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName)) !== null && _b !== void 0 ? _b : undefined;
3209
3383
  return NotificationUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
3210
3384
  }
3211
- static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
3212
- var _a, _b;
3385
+ static actionNotificationError(translate, action, error, functionName, viewContainer, item, severity = 'error') {
3386
+ var _a, _b, _c;
3213
3387
  const params = {
3214
- errorMessage: I18nUtil.instantErrorI18nTranslation(translationService, error)
3388
+ errorMessage: (_a = I18nUtils.Error.get(translate, error)) !== null && _a !== void 0 ? _a : error.message
3215
3389
  };
3216
- const actionErrorTitle = (_a = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params)) !== null && _a !== void 0 ? _a : undefined;
3217
- const actionErrorMessage = (_b = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params)) !== null && _b !== void 0 ? _b : undefined;
3218
- return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
3390
+ const actionErrorTitle = (_b = I18nUtils.Action.get(translate, action, [`error.${functionName}.title`, 'error.title'], action.runNotificationErrorTitle, item, 'general.error', params)) !== null && _b !== void 0 ? _b : undefined;
3391
+ const actionErrorMessage = (_c = I18nUtils.Action.get(translate, action, [`error.${functionName}.message`, 'error.message'], action.runNotificationErrorMessage, item, 'general.errorMessage', params)) !== null && _c !== void 0 ? _c : undefined;
3392
+ return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, severity);
3219
3393
  }
3220
- static getFormEditorWarningMessage(translationService, title, message) {
3394
+ static getFormEditorWarningMessage(translate, title, message) {
3221
3395
  var _a, _b;
3222
- const actionErrorTitle = (_a = translationService.instant(title)) !== null && _a !== void 0 ? _a : undefined;
3223
- const actionErrorMessage = (_b = translationService.instant(message)) !== null && _b !== void 0 ? _b : undefined;
3396
+ const actionErrorTitle = (_a = translate.instant(title)) !== null && _a !== void 0 ? _a : undefined;
3397
+ const actionErrorMessage = (_b = translate.instant(message)) !== null && _b !== void 0 ? _b : undefined;
3224
3398
  return { severity: 'warn', summary: actionErrorTitle, detail: actionErrorMessage };
3225
3399
  }
3226
3400
  }
3227
3401
 
3228
- const typeNameDecoratorPropertyName = 'typeName';
3229
- function TypeName(typeName) {
3230
- return function (target) {
3231
- target[typeNameDecoratorPropertyName] = typeName;
3232
- };
3233
- }
3234
- const enumNameDecoratorPropertyName = 'enumName';
3235
- function EnumName(typeName) {
3236
- return function (target) {
3237
- target[enumNameDecoratorPropertyName] = typeName;
3238
- };
3239
- }
3240
-
3241
- class TypeUtil {
3242
- /**
3243
- * Defines type name decorator.
3244
- * @param targetType class.
3245
- * @param typeName Name of the type.
3246
- */
3247
- static defineReflectTypeName(targetType, typeName) {
3248
- if (!typeName) {
3249
- typeName = TypeUtil.getDecoratorTypeName(targetType);
3250
- if (!typeName) {
3251
- console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
3252
- return;
3253
- }
3254
- }
3255
- if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
3256
- Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
3257
- }
3258
- }
3259
- /**
3260
- * Defines enum name decorator.
3261
- * @param targetType enum object.
3262
- * @param enumName Name of the enum.
3263
- */
3264
- static defineReflectEnumName(targetType, enumName) {
3265
- if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
3266
- Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
3267
- }
3268
- }
3269
- /**
3270
- * Gets type name from either decorator or reflect metadata.
3271
- * @param type Class.
3272
- */
3273
- static findTypeName(type) {
3274
- let decoratorName = TypeUtil.getDecoratorTypeName(type);
3275
- if (decoratorName) {
3276
- return decoratorName;
3277
- }
3278
- decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
3279
- if (decoratorName) {
3280
- return decoratorName;
3281
- }
3282
- return type.name;
3283
- }
3284
- /**
3285
- * Gets enum name from either decorator or reflect metadata.
3286
- * @param enumType Class.
3287
- */
3288
- static findEnumName(enumType) {
3289
- let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
3290
- if (decoratorName) {
3291
- return decoratorName;
3292
- }
3293
- decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
3294
- if (decoratorName) {
3295
- return decoratorName;
3296
- }
3297
- throw new Error('Could not fined enum name');
3298
- }
3299
- /**
3300
- * Get value from decorator defined property name
3301
- * @param type Class.
3302
- */
3303
- // eslint-disable-next-line @typescript-eslint/ban-types
3304
- static getDecoratorTypeName(type) {
3305
- return type[typeNameDecoratorPropertyName];
3306
- }
3307
- /**
3308
- * Get value from decorator defined property name
3309
- * @param type Enum object.
3310
- */
3311
- static getDecoratorEnumName(type) {
3312
- return type[enumNameDecoratorPropertyName];
3313
- }
3314
- }
3315
-
3316
3402
  class ObjectSerializer {
3317
3403
  constructor() {
3318
3404
  this._primitives = ['string', 'boolean', 'double', 'integer', 'long', 'float', 'number', 'any'];
@@ -3743,6 +3829,8 @@ const MNG_BROWSER_STORAGE_IT = new InjectionToken('Browser storage', {
3743
3829
  factory: () => localStorage
3744
3830
  });
3745
3831
 
3832
+ const MNG_COMMONS_INITIALIZER_IT = new InjectionToken('MNG Commons Initializer');
3833
+
3746
3834
  const ACTION_EDITOR_DIALOG_COMPONENT_SETTING = new InjectionToken('ACTION_EDITOR_DIALOG_COMPONENT_SETTING');
3747
3835
 
3748
3836
  const MNG_MODULE_CONFIG_IT = new InjectionToken('MngModuleConfig');
@@ -3854,7 +3942,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
3854
3942
 
3855
3943
  class MngI18nPropertyPipe {
3856
3944
  transform(property, model) {
3857
- return I18nUtil.getModelPropertyKey(model, property);
3945
+ return I18nUtils.Type.getPropertyKey(model.typeName, property);
3858
3946
  }
3859
3947
  }
3860
3948
  MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -4018,24 +4106,20 @@ class MngActionExecutorService {
4018
4106
  rejectVisible: false
4019
4107
  };
4020
4108
  if (action.runConfirmationTitle !== null) {
4021
- confirmParams.header =
4022
- (_a = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation')) !== null && _a !== void 0 ? _a : undefined;
4109
+ confirmParams.header = (_a = I18nUtils.Action.get(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation')) !== null && _a !== void 0 ? _a : undefined;
4023
4110
  }
4024
4111
  if (action.runConfirmationMessage !== null) {
4025
- confirmParams.message =
4026
- (_b = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.message', action.runConfirmationMessage, item, 'general.confirmation')) !== null && _b !== void 0 ? _b : undefined;
4112
+ confirmParams.message = (_b = I18nUtils.Action.get(this.translate, action, 'confirm.message', action.runConfirmationMessage, item, 'general.confirmation')) !== null && _b !== void 0 ? _b : undefined;
4027
4113
  }
4028
4114
  if (action.runConfirmationIcon !== null) {
4029
4115
  confirmParams.icon = action.runConfirmationIcon === undefined ? 'pi pi-exclamation-triangle' : action.runConfirmationIcon;
4030
4116
  }
4031
4117
  if (action.runConfirmationAcceptTitle !== null) {
4032
- confirmParams.acceptLabel =
4033
- (_c = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.accept', action.runConfirmationAcceptTitle, item, 'general.yes')) !== null && _c !== void 0 ? _c : undefined;
4118
+ confirmParams.acceptLabel = (_c = I18nUtils.Action.get(this.translate, action, 'confirm.accept', action.runConfirmationAcceptTitle, item, 'general.yes')) !== null && _c !== void 0 ? _c : undefined;
4034
4119
  confirmParams.acceptVisible = true;
4035
4120
  }
4036
4121
  if (action.runConfirmationRejectTitle !== null) {
4037
- confirmParams.rejectLabel =
4038
- (_d = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.reject', action.runConfirmationRejectTitle, item, 'general.no')) !== null && _d !== void 0 ? _d : undefined;
4122
+ confirmParams.rejectLabel = (_d = I18nUtils.Action.get(this.translate, action, 'confirm.reject', action.runConfirmationRejectTitle, item, 'general.no')) !== null && _d !== void 0 ? _d : undefined;
4039
4123
  confirmParams.rejectVisible = true;
4040
4124
  }
4041
4125
  const observable = new Observable(observer => {
@@ -4229,13 +4313,17 @@ class MngActionExecutorService {
4229
4313
  * @param action Action descriptor.
4230
4314
  * @param event Target table click event.
4231
4315
  * @param route Currently activate route.
4316
+ * @param tableDescriptor Table descriptor.
4317
+ * @param dataKeyProperty Data key property.
4232
4318
  */
4233
- triggerRowClickAction(action, event, route) {
4234
- if (!action.model.idPropertyName) {
4235
- throw new Error(`Row click action ${action.actionName} can not be triggered, because model id property name is not defined.`);
4319
+ triggerRowClickAction(action, event, route, tableDescriptor, dataKeyProperty) {
4320
+ var _a, _b, _c;
4321
+ const idProperty = (_c = (_a = dataKeyProperty !== null && dataKeyProperty !== void 0 ? dataKeyProperty : tableDescriptor === null || tableDescriptor === void 0 ? void 0 : tableDescriptor.dataKeyProperty) !== null && _a !== void 0 ? _a : (_b = action === null || action === void 0 ? void 0 : action.model) === null || _b === void 0 ? void 0 : _b.idPropertyName) !== null && _c !== void 0 ? _c : dataKeyProperty;
4322
+ if (!idProperty) {
4323
+ throw new Error(`Row click action ${action.actionName} can not be triggered, because id property could not be found.`);
4236
4324
  }
4237
4325
  const rowItem = event === null || event === void 0 ? void 0 : event.rowItem;
4238
- return this.triggerAction(action, rowItem[action.model.idPropertyName], event.rowItem, undefined, route);
4326
+ return this.triggerAction(action, rowItem[idProperty], event.rowItem, undefined, route);
4239
4327
  }
4240
4328
  /**
4241
4329
  * Triggers action with optional data (item, itemId, ...) and currently activated route.
@@ -4317,7 +4405,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4317
4405
  class MngConfigurationService {
4318
4406
  constructor(http) {
4319
4407
  this.http = http;
4320
- this.jsonEnvironments = [];
4408
+ this.jsonSources = [];
4321
4409
  this.configuration = Object.assign({}, this.projectEnvironment);
4322
4410
  }
4323
4411
  static init(httpClient) {
@@ -4344,23 +4432,57 @@ class MngConfigurationService {
4344
4432
  * Adds new config source from JSON file.
4345
4433
  * @param url Url to JSON file.
4346
4434
  */
4347
- addJsonSource(url = this.projectEnvironment.configurationJsonSource) {
4435
+ addJsonSource(url = this.projectEnvironment.configurationJsonSource, load = false) {
4348
4436
  if (!url) {
4349
- console.warn('No path to configuration file specified. Setting default.');
4437
+ console.debug('No path to configuration file specified. Setting default.');
4350
4438
  url = 'assets/config/env{{environment}}.json';
4351
4439
  }
4352
- const envName = this.projectEnvironment.name || (this.projectEnvironment.production ? 'prod' : 'dev');
4353
- url = url.replace('{{environment}}', '.' + envName);
4354
- return this.http.get(url).pipe(catchError(err => {
4355
- console.warn('Error loading configuration file:' + err.message + '. Falling back to env.json');
4356
- const pathSegments = url.split('/');
4357
- pathSegments[pathSegments.length - 1] = 'env.json';
4358
- return this.http.get(pathSegments.join('/'));
4359
- }), map(res => {
4360
- this.jsonEnvironments.push(res);
4361
- this.mergeConfigs();
4362
- return true;
4363
- }));
4440
+ const sourceInfo = {
4441
+ url: url,
4442
+ isEnvironment: false,
4443
+ isLoaded: false
4444
+ };
4445
+ this.jsonSources.push(sourceInfo);
4446
+ console.debug(`Added JSON source: ${url}`);
4447
+ if (load) {
4448
+ return this.loadJsonSources();
4449
+ }
4450
+ else {
4451
+ return of(true);
4452
+ }
4453
+ }
4454
+ loadJsonSources() {
4455
+ return combineLatest(this.jsonSources
4456
+ .filter(source => !source.isLoaded)
4457
+ .map(sourceInfo => {
4458
+ var _a;
4459
+ let url = sourceInfo.url;
4460
+ if (url.indexOf('{{environment}}') >= 0) {
4461
+ sourceInfo.isEnvironment = true;
4462
+ sourceInfo.environment = this.projectEnvironment.name || (this.projectEnvironment.production ? 'prod' : 'dev');
4463
+ url = url.replace('{{environment}}', '.' + sourceInfo.environment);
4464
+ }
4465
+ console.debug(`Loading JSON source: ${sourceInfo.url} with env ${(_a = sourceInfo.environment) !== null && _a !== void 0 ? _a : '/'}`);
4466
+ return this.http.get(url).pipe(catchError((err) => {
4467
+ var _a;
4468
+ if (sourceInfo.isEnvironment) {
4469
+ const noEnvUrl = sourceInfo.url.replace('{{environment}}', '');
4470
+ sourceInfo.environment = null;
4471
+ console.debug(`Reloading JSON source: ${sourceInfo.url} with env ${(_a = sourceInfo.environment) !== null && _a !== void 0 ? _a : '/'}`);
4472
+ return this.http.get(noEnvUrl);
4473
+ }
4474
+ else {
4475
+ const message = `Configuration file ${url} not loaded (${err.status}): ${err.message}.`;
4476
+ console.error(message);
4477
+ return throwError(() => new Error(message));
4478
+ }
4479
+ }), map(configuration => {
4480
+ sourceInfo.configuration = configuration;
4481
+ sourceInfo.isLoaded = true;
4482
+ console.debug(`JSON source loaded: ${sourceInfo.url}`);
4483
+ return true;
4484
+ }));
4485
+ })).pipe(map(sourceResults => sourceResults.every(sr => sr)), tap(sourceResults => this.mergeConfigs()));
4364
4486
  }
4365
4487
  /**
4366
4488
  * Get configuration.
@@ -4380,9 +4502,10 @@ class MngConfigurationService {
4380
4502
  */
4381
4503
  mergeConfigs() {
4382
4504
  let config = Object.assign({}, this.projectEnvironment);
4383
- if (this.jsonEnvironments.length) {
4384
- for (const je of this.jsonEnvironments) {
4385
- config = Object.assign(Object.assign({}, config), je);
4505
+ const jsonConfigs = this.jsonSources.filter(source => source.isLoaded && typeof source.configuration === 'object').map(source => source.configuration);
4506
+ if (jsonConfigs.length) {
4507
+ for (const jsonConfig of jsonConfigs) {
4508
+ config = Object.assign(Object.assign({}, config), jsonConfig);
4386
4509
  }
4387
4510
  }
4388
4511
  this.configuration = config;
@@ -4391,7 +4514,7 @@ class MngConfigurationService {
4391
4514
  MngConfigurationService._instance = null;
4392
4515
 
4393
4516
  class MngCommonsService {
4394
- constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage) {
4517
+ constructor(router, primengConfig, translate, titleService, configurationService, moduleConfig, localStorage, commonsInitializers) {
4395
4518
  this.router = router;
4396
4519
  this.primengConfig = primengConfig;
4397
4520
  this.translate = translate;
@@ -4399,6 +4522,9 @@ class MngCommonsService {
4399
4522
  this.configurationService = configurationService;
4400
4523
  this.moduleConfig = moduleConfig;
4401
4524
  this.localStorage = localStorage;
4525
+ this.commonsInitializers = commonsInitializers;
4526
+ // internal
4527
+ this.isInitialized = false;
4402
4528
  // menu
4403
4529
  this._menuMode = 'sidebar';
4404
4530
  this._menuModeSubject = new BehaviorSubject(this._menuMode);
@@ -4534,53 +4660,70 @@ class MngCommonsService {
4534
4660
  return this.userSubject.asObservable();
4535
4661
  }
4536
4662
  initialize() {
4537
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
4538
- // menu
4539
- this._menuMode = (_c = (_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.menu) === null || _b === void 0 ? void 0 : _b.mode) !== null && _c !== void 0 ? _c : 'sidebar';
4540
- this._menuModeSubject.next(this._menuMode);
4541
- this._menuItems = (_f = (_e = (_d = this.moduleConfig) === null || _d === void 0 ? void 0 : _d.menu) === null || _e === void 0 ? void 0 : _e.menuItems) !== null && _f !== void 0 ? _f : [];
4542
- this._menuPinEnabled = (_j = (_h = (_g = this.moduleConfig) === null || _g === void 0 ? void 0 : _g.menu) === null || _h === void 0 ? void 0 : _h.pinEnabled) !== null && _j !== void 0 ? _j : false;
4543
- // visual
4544
- this._colorScheme = (_m = (_l = (_k = this.moduleConfig) === null || _k === void 0 ? void 0 : _k.app) === null || _l === void 0 ? void 0 : _l.colorScheme) !== null && _m !== void 0 ? _m : 'light';
4545
- // ripple
4546
- this.primengConfig.ripple = true;
4547
- this.primengConfig.filterMatchModeOptions = {
4548
- text: [
4549
- FilterDescriptor.MatchModeEnum.Contains,
4550
- FilterDescriptor.MatchModeEnum.Equals,
4551
- FilterDescriptor.MatchModeEnum.NotEquals,
4552
- FilterDescriptor.MatchModeEnum.StartsWith,
4553
- FilterDescriptor.MatchModeEnum.EndsWith
4554
- ],
4555
- numeric: [
4556
- FilterDescriptor.MatchModeEnum.Equals,
4557
- FilterDescriptor.MatchModeEnum.NotEquals,
4558
- FilterDescriptor.MatchModeEnum.LessThanOrEqualTo,
4559
- FilterDescriptor.MatchModeEnum.GreaterThanOrEqualTo
4560
- ],
4561
- date: [
4562
- FilterDescriptor.MatchModeEnum.DateIs,
4563
- FilterDescriptor.MatchModeEnum.DateIsNot,
4564
- FilterDescriptor.MatchModeEnum.DateBefore,
4565
- FilterDescriptor.MatchModeEnum.DateAfter
4566
- ]
4567
- };
4568
- // translate
4569
- this.translate.langs = this.appLanguages;
4570
- this.translate.use(this.appLanguage);
4571
- this.translate.get('mngPrime').subscribe(value => this.primengConfig.setTranslation(value));
4572
- this.router.events
4573
- .pipe(
4574
- // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
4575
- filter(event => event instanceof NavigationEnd))
4576
- .subscribe(() => {
4577
- this.updateBreadcrumbs();
4578
- this.setPageTitle();
4579
- });
4580
- this.translate.onLangChange.subscribe(() => {
4581
- this.updateBreadcrumbs();
4582
- this.setPageTitle();
4583
- });
4663
+ if (this.isInitialized) {
4664
+ return of(false);
4665
+ }
4666
+ console.debug(`Initializing @mediusinc/mng-commons.`);
4667
+ return this.configurationService.loadJsonSources().pipe(mergeMap$1(jsonSourcesRes => {
4668
+ if (this.commonsInitializers) {
4669
+ console.debug(`Initializing @mediusinc/mng-commons initializers.`);
4670
+ return combineLatest(this.commonsInitializers.map(ci => ci())).pipe(map(res => res));
4671
+ }
4672
+ else {
4673
+ return of(true);
4674
+ }
4675
+ }), map(() => {
4676
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
4677
+ // menu
4678
+ this._menuMode = (_c = (_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.menu) === null || _b === void 0 ? void 0 : _b.mode) !== null && _c !== void 0 ? _c : 'sidebar';
4679
+ this._menuModeSubject.next(this._menuMode);
4680
+ this._menuItems = (_f = (_e = (_d = this.moduleConfig) === null || _d === void 0 ? void 0 : _d.menu) === null || _e === void 0 ? void 0 : _e.menuItems) !== null && _f !== void 0 ? _f : [];
4681
+ this._menuPinEnabled = (_j = (_h = (_g = this.moduleConfig) === null || _g === void 0 ? void 0 : _g.menu) === null || _h === void 0 ? void 0 : _h.pinEnabled) !== null && _j !== void 0 ? _j : false;
4682
+ // visual
4683
+ this._colorScheme = (_m = (_l = (_k = this.moduleConfig) === null || _k === void 0 ? void 0 : _k.app) === null || _l === void 0 ? void 0 : _l.colorScheme) !== null && _m !== void 0 ? _m : 'light';
4684
+ // ripple
4685
+ this.primengConfig.ripple = true;
4686
+ this.primengConfig.filterMatchModeOptions = {
4687
+ text: [
4688
+ FilterDescriptor.MatchModeEnum.Contains,
4689
+ FilterDescriptor.MatchModeEnum.Equals,
4690
+ FilterDescriptor.MatchModeEnum.NotEquals,
4691
+ FilterDescriptor.MatchModeEnum.StartsWith,
4692
+ FilterDescriptor.MatchModeEnum.EndsWith
4693
+ ],
4694
+ numeric: [
4695
+ FilterDescriptor.MatchModeEnum.Equals,
4696
+ FilterDescriptor.MatchModeEnum.NotEquals,
4697
+ FilterDescriptor.MatchModeEnum.LessThanOrEqualTo,
4698
+ FilterDescriptor.MatchModeEnum.GreaterThanOrEqualTo
4699
+ ],
4700
+ date: [
4701
+ FilterDescriptor.MatchModeEnum.DateIs,
4702
+ FilterDescriptor.MatchModeEnum.DateIsNot,
4703
+ FilterDescriptor.MatchModeEnum.DateBefore,
4704
+ FilterDescriptor.MatchModeEnum.DateAfter
4705
+ ]
4706
+ };
4707
+ // translate
4708
+ this.translate.langs = this.appLanguages;
4709
+ this.translate.use(this.appLanguage);
4710
+ this.translate.get('mngPrime').subscribe(value => this.primengConfig.setTranslation(value));
4711
+ this.router.events
4712
+ .pipe(
4713
+ // Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
4714
+ filter(event => event instanceof NavigationEnd))
4715
+ .subscribe(() => {
4716
+ this.updateBreadcrumbs();
4717
+ this.setPageTitle();
4718
+ });
4719
+ this.translate.onLangChange.subscribe(() => {
4720
+ this.updateBreadcrumbs();
4721
+ this.setPageTitle();
4722
+ });
4723
+ console.debug(`@mediusinc/mng-commons initialization complete.`);
4724
+ return true;
4725
+ }));
4726
+ this.isInitialized = true;
4584
4727
  }
4585
4728
  // MENU actions
4586
4729
  menuChangeActiveKey(key) {
@@ -4720,7 +4863,7 @@ class MngCommonsService {
4720
4863
  return titlePieces.join(' - ');
4721
4864
  }
4722
4865
  }
4723
- 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 });
4866
+ 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 });
4724
4867
  MngCommonsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService });
4725
4868
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngCommonsService, decorators: [{
4726
4869
  type: Injectable
@@ -4731,6 +4874,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4731
4874
  }] }, { type: Storage, decorators: [{
4732
4875
  type: Inject,
4733
4876
  args: [MNG_BROWSER_STORAGE_IT]
4877
+ }] }, { type: undefined, decorators: [{
4878
+ type: Inject,
4879
+ args: [MNG_COMMONS_INITIALIZER_IT]
4880
+ }, {
4881
+ type: Optional
4734
4882
  }] }];
4735
4883
  } });
4736
4884
 
@@ -4746,7 +4894,7 @@ class MngViewContainerComponentService {
4746
4894
  set dataProvider(dataProvider) {
4747
4895
  this._dataProvider = dataProvider;
4748
4896
  }
4749
- get reloadTable$() {
4897
+ get reloadTable() {
4750
4898
  return this._reloadTableSubject.asObservable();
4751
4899
  }
4752
4900
  triggerTableReload(event) {
@@ -4797,8 +4945,8 @@ class MngActionComponent {
4797
4945
  const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, (_c = this.viewContainer) !== null && _c !== void 0 ? _c : undefined, this, this.actionData);
4798
4946
  this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
4799
4947
  this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
4800
- this.$label = this.hasNoTitle ? of(null) : I18nUtil.streamActionTranslation(this.translate, this.action, 'title', (_e = (_d = this.action) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : undefined, this.item);
4801
- this.$tooltip = I18nUtil.streamActionTranslation(this.translate, this.action, 'tooltip', (_g = (_f = this.action) === null || _f === void 0 ? void 0 : _f.tooltip) !== null && _g !== void 0 ? _g : undefined, this.item);
4948
+ this.$label = this.hasNoTitle ? of(null) : I18nUtils.Action.getAsync(this.translate, this.action, 'title', (_e = (_d = this.action) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : undefined, this.item);
4949
+ this.$tooltip = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', (_g = (_f = this.action) === null || _f === void 0 ? void 0 : _f.tooltip) !== null && _g !== void 0 ? _g : undefined, this.item);
4802
4950
  if (this.action instanceof ActionLinkDescriptor) {
4803
4951
  this.actionLink = this.action;
4804
4952
  }
@@ -5825,11 +5973,7 @@ class MngActionEditorComponent {
5825
5973
  }
5826
5974
  return;
5827
5975
  }
5828
- const subscription = I18nUtil.streamActionTranslation(this.translate, this.action, 'editor.title', this.action.editorTitle, this.item)
5829
- .pipe(mergeMap(i18nDialogTitle => i18nDialogTitle === null
5830
- ? I18nUtil.getActionTranslation(this.translate, this.action, 'title', undefined, this.item)
5831
- : of(i18nDialogTitle)))
5832
- .subscribe(t => {
5976
+ const subscription = I18nUtils.Action.getEditorTitleAsync(this.translate, this.action, this.item).subscribe(t => {
5833
5977
  this.title = t !== null && t !== void 0 ? t : undefined;
5834
5978
  if (this.dialogConfig) {
5835
5979
  requestAnimationFrame(() => {
@@ -6100,6 +6244,8 @@ class MngTableComponent {
6100
6244
  this.subscriptions = [];
6101
6245
  }
6102
6246
  ngOnInit() {
6247
+ var _a, _b;
6248
+ this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
6103
6249
  this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
6104
6250
  if (this.descriptor.paginationMode === PaginationModeEnum.InfiniteScroll) {
6105
6251
  this.infiniteScroll = true;
@@ -6246,8 +6392,7 @@ class MngTableComponent {
6246
6392
  this.isSortChanged = false;
6247
6393
  this.dataProviderLoadingSubject.next(false);
6248
6394
  }, err => {
6249
- var _a;
6250
- NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, (_a = this.viewContainerService) !== null && _a !== void 0 ? _a : undefined);
6395
+ NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainer);
6251
6396
  const emptyQueryResult = new MediusQueryResult();
6252
6397
  emptyQueryResult.pageData = [];
6253
6398
  emptyQueryResult.allDataCount = 0;
@@ -6315,7 +6460,7 @@ class MngTableComponent {
6315
6460
  }
6316
6461
  }
6317
6462
  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 });
6318
- 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 });
6463
+ 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 });
6319
6464
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
6320
6465
  type: Component,
6321
6466
  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" }]
@@ -6341,6 +6486,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
6341
6486
  type: Input
6342
6487
  }], isColumnClickable: [{
6343
6488
  type: Input
6489
+ }], viewContainerInit: [{
6490
+ type: Input,
6491
+ args: ['viewContainer']
6344
6492
  }], captionComponent: [{
6345
6493
  type: Input
6346
6494
  }], columnActionComponent: [{
@@ -6393,7 +6541,7 @@ class MngTableviewComponent {
6393
6541
  if (this.dataProvider) {
6394
6542
  this.viewContainerService.dataProvider = this.dataProvider;
6395
6543
  }
6396
- const reloadTableSubscription = this.viewContainerService.reloadTable$.subscribe(() => {
6544
+ const reloadTableSubscription = this.viewContainerService.reloadTable.subscribe(() => {
6397
6545
  this.reloadTable();
6398
6546
  });
6399
6547
  this.subscriptions.push(reloadTableSubscription);
@@ -6431,13 +6579,13 @@ class MngTableviewComponent {
6431
6579
  onTableCellClick(event) {
6432
6580
  if (this.rowClickActions.length) {
6433
6581
  for (const action of this.rowClickActions) {
6434
- this.actionExecutor.triggerRowClickAction(action, event, this.route);
6582
+ this.actionExecutor.triggerRowClickAction(action, event, this.route, this.descriptor.table);
6435
6583
  }
6436
6584
  }
6437
6585
  }
6438
6586
  }
6439
6587
  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 });
6440
- 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 } });
6588
+ 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 } });
6441
6589
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
6442
6590
  type: Component,
6443
6591
  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" }]
@@ -6692,7 +6840,7 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
6692
6840
  }
6693
6841
  }
6694
6842
  MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
6695
- 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 });
6843
+ 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 });
6696
6844
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
6697
6845
  type: Component,
6698
6846
  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" }]
@@ -6847,7 +6995,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
6847
6995
  }
6848
6996
  }
6849
6997
  MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
6850
- 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 });
6998
+ 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 });
6851
6999
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
6852
7000
  type: Component,
6853
7001
  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"] }]
@@ -6961,7 +7109,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
6961
7109
  }
6962
7110
  }
6963
7111
  MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
6964
- 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 });
7112
+ 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 });
6965
7113
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
6966
7114
  type: Component,
6967
7115
  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" }]
@@ -7536,12 +7684,21 @@ const mngConfigurationServiceProvider = (httpClient, moduleConfig) => {
7536
7684
  };
7537
7685
  function mngConfigJsonAppInitializerProvider(configService, moduleConfig) {
7538
7686
  return () => {
7539
- var _a, _b, _c;
7687
+ var _a, _b;
7540
7688
  if ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.configuration) === null || _a === void 0 ? void 0 : _a.skipJsonSourceInit) {
7541
7689
  return of(false);
7542
7690
  }
7543
7691
  else {
7544
- return configService.addJsonSource((_c = (_b = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.configuration) === null || _b === void 0 ? void 0 : _b.jsonSource) !== null && _c !== void 0 ? _c : undefined);
7692
+ const jsonSource = (_b = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.configuration) === null || _b === void 0 ? void 0 : _b.jsonSource;
7693
+ if (!jsonSource) {
7694
+ return configService.addJsonSource();
7695
+ }
7696
+ else if (Array.isArray(jsonSource)) {
7697
+ return combineLatest(jsonSource.map(source => configService.addJsonSource(source))).pipe(map(sourcesRes => sourcesRes.every(s => s)));
7698
+ }
7699
+ else {
7700
+ return configService.addJsonSource(jsonSource);
7701
+ }
7545
7702
  }
7546
7703
  };
7547
7704
  }
@@ -8696,5 +8853,5 @@ class RouteDataBuilder {
8696
8853
  * Generated bundle index. Do not edit.
8697
8854
  */
8698
8855
 
8699
- 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 };
8856
+ 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 };
8700
8857
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map