@mediusinc/mng-commons 0.2.8 → 0.2.13

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 (67) hide show
  1. package/README.md +46 -0
  2. package/assets/i18n/en.json +202 -151
  3. package/assets/i18n/sl.json +202 -151
  4. package/esm2020/lib/api/utils/object-serializer.util.mjs +12 -7
  5. package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +2 -2
  6. package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +2 -4
  7. package/esm2020/lib/components/form/editor/form-editor.component.mjs +1 -1
  8. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  9. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +9 -8
  10. package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
  11. package/esm2020/lib/components/layout/menu-item.component.mjs +59 -17
  12. package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +1 -1
  13. package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +3 -3
  14. package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +2 -1
  15. package/esm2020/lib/components/tableview/table/table.component.mjs +5 -4
  16. package/esm2020/lib/components/tableview/tableview.component.mjs +1 -1
  17. package/esm2020/lib/config/formly.config.mjs +10 -1
  18. package/esm2020/lib/data-providers/base.data-provider.mjs +1 -8
  19. package/esm2020/lib/descriptors/editor.descriptor.mjs +113 -66
  20. package/esm2020/lib/descriptors/table.descriptor.mjs +130 -42
  21. package/esm2020/lib/descriptors/tableview.descriptor.mjs +9 -6
  22. package/esm2020/lib/mng-commons.module.mjs +8 -2
  23. package/esm2020/lib/models/enum.model.mjs +2 -0
  24. package/esm2020/lib/models/index.mjs +3 -1
  25. package/esm2020/lib/models/menu.model.mjs +2 -0
  26. package/esm2020/lib/pipes/enum.pipe.mjs +22 -0
  27. package/esm2020/lib/pipes/i18n-property.pipe.mjs +18 -0
  28. package/esm2020/lib/pipes/index.mjs +3 -1
  29. package/esm2020/lib/router/route-builder.mjs +86 -17
  30. package/esm2020/lib/services/commons.service.mjs +1 -1
  31. package/esm2020/lib/types/type.decorator.mjs +7 -1
  32. package/esm2020/lib/types/type.model.mjs +1 -1
  33. package/esm2020/lib/utils/editor-formly.util.mjs +10 -1
  34. package/esm2020/lib/utils/enum.util.mjs +82 -0
  35. package/esm2020/lib/utils/i18n.util.mjs +38 -26
  36. package/esm2020/lib/utils/index.mjs +2 -1
  37. package/esm2020/lib/utils/type.util.mjs +39 -2
  38. package/esm2020/public-api.mjs +2 -1
  39. package/fesm2015/mediusinc-mng-commons.mjs +643 -197
  40. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  41. package/fesm2020/mediusinc-mng-commons.mjs +637 -196
  42. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  43. package/lib/api/utils/object-serializer.util.d.ts +1 -0
  44. package/lib/components/layout/menu-item.component.d.ts +13 -5
  45. package/lib/components/tableview/table/column-value/column-value.component.d.ts +1 -0
  46. package/lib/data-providers/base.data-provider.d.ts +0 -3
  47. package/lib/descriptors/editor.descriptor.d.ts +43 -28
  48. package/lib/descriptors/table.descriptor.d.ts +37 -16
  49. package/lib/descriptors/tableview.descriptor.d.ts +9 -8
  50. package/lib/mng-commons.module.d.ts +70 -68
  51. package/lib/models/enum.model.d.ts +5 -0
  52. package/lib/models/index.d.ts +2 -0
  53. package/lib/models/menu.model.d.ts +25 -0
  54. package/lib/pipes/enum.pipe.d.ts +7 -0
  55. package/lib/pipes/i18n-property.pipe.d.ts +8 -0
  56. package/lib/pipes/index.d.ts +2 -0
  57. package/lib/router/route-builder.d.ts +9 -5
  58. package/lib/services/commons.service.d.ts +6 -6
  59. package/lib/types/type.decorator.d.ts +2 -0
  60. package/lib/types/type.model.d.ts +2 -2
  61. package/lib/utils/enum.util.d.ts +50 -0
  62. package/lib/utils/i18n.util.d.ts +6 -2
  63. package/lib/utils/index.d.ts +1 -0
  64. package/lib/utils/type.util.d.ts +22 -1
  65. package/package.json +2 -2
  66. package/public-api.d.ts +1 -0
  67. package/scss/mng-overrides/_layout_forms.scss +5 -0
@@ -6,7 +6,7 @@ import { Injectable, InjectionToken, Inject, Component, ChangeDetectionStrategy,
6
6
  import * as i2$3 from '@angular/forms';
7
7
  import { Validators, FormGroup, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
8
8
  import * as i1 from '@angular/router';
9
- import { NavigationEnd, RouterModule } from '@angular/router';
9
+ import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
10
10
  import * as i3 from '@ngx-formly/core';
11
11
  import { FieldType, FieldWrapper, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
12
12
  import * as i2$2 from '@ngx-translate/core';
@@ -36,14 +36,15 @@ import { DynamicDialogModule, DialogService } from 'primeng/dynamicdialog';
36
36
  import * as i1$5 from 'primeng/fieldset';
37
37
  import { FieldsetModule } from 'primeng/fieldset';
38
38
  import { FileUploadModule } from 'primeng/fileupload';
39
+ import * as i6$1 from 'primeng/inputmask';
39
40
  import { InputMaskModule } from 'primeng/inputmask';
40
41
  import * as i1$3 from 'primeng/inputnumber';
41
42
  import { InputNumberModule } from 'primeng/inputnumber';
42
43
  import * as i2$5 from 'primeng/inputswitch';
43
44
  import { InputSwitchModule } from 'primeng/inputswitch';
44
- import * as i9$1 from 'primeng/inputtext';
45
+ import * as i10$1 from 'primeng/inputtext';
45
46
  import { InputTextModule } from 'primeng/inputtext';
46
- import * as i8$1 from 'primeng/inputtextarea';
47
+ import * as i9$1 from 'primeng/inputtextarea';
47
48
  import { InputTextareaModule } from 'primeng/inputtextarea';
48
49
  import * as i3$1 from 'primeng/messages';
49
50
  import { MessagesModule } from 'primeng/messages';
@@ -67,11 +68,11 @@ import { TagModule } from 'primeng/tag';
67
68
  import * as i7$1 from 'primeng/toast';
68
69
  import { ToastModule } from 'primeng/toast';
69
70
  import { ToggleButtonModule } from 'primeng/togglebutton';
70
- import * as i8$2 from 'primeng/toolbar';
71
+ import * as i8$1 from 'primeng/toolbar';
71
72
  import { ToolbarModule } from 'primeng/toolbar';
72
73
  import * as i10 from 'primeng/tooltip';
73
74
  import { TooltipModule } from 'primeng/tooltip';
74
- import { of, throwError, Observable, from, BehaviorSubject, Subject, ReplaySubject } from 'rxjs';
75
+ import { of, throwError, Observable, from, BehaviorSubject, Subject, ReplaySubject, distinctUntilChanged, combineLatest } from 'rxjs';
75
76
  import 'reflect-metadata';
76
77
  import { mergeMap, map, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
77
78
  import * as i4 from '@angular/platform-browser';
@@ -427,17 +428,10 @@ class DataProvider {
427
428
  get modelType() {
428
429
  return this._modelType;
429
430
  }
430
- get enumName() {
431
- return this._enumName;
432
- }
433
431
  withServiceType(type) {
434
432
  this._serviceType = type;
435
433
  return this;
436
434
  }
437
- withEnumName(enumName) {
438
- this._enumName = enumName;
439
- return this;
440
- }
441
435
  }
442
436
 
443
437
  class EditorDataProvider extends DataProvider {
@@ -766,29 +760,33 @@ class EditorDescriptor {
766
760
  this._disabled = false;
767
761
  this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
768
762
  }
763
+ get disabled() {
764
+ return this._disabled;
765
+ }
769
766
  get model() {
770
767
  return this._model;
771
768
  }
772
769
  get tabs() {
773
770
  return this._tabs;
774
771
  }
775
- get disabled() {
776
- return this._disabled;
777
- }
778
772
  get fields() {
779
773
  return this._fields;
780
774
  }
781
775
  createTabGroup(name, title) {
782
776
  const tabGroup = new FieldTabGroupDescriptor(this, name);
783
- if (title) {
784
- tabGroup.withTitle(title);
777
+ if (!title) {
778
+ title = I18nUtil.getModelTabKey(this.model, name);
785
779
  }
780
+ tabGroup.withTitle(title);
786
781
  this.createTabGroupDescriptor(tabGroup);
787
782
  return tabGroup;
788
783
  }
789
784
  createFieldGroup(name, title) {
790
785
  const fieldGroup = new FieldGroupDescriptor(this, name);
791
- if (title) {
786
+ if (title !== null) {
787
+ if (!title) {
788
+ title = I18nUtil.getModelGroupKey(this.model, name);
789
+ }
792
790
  fieldGroup.withTitle(title);
793
791
  }
794
792
  this.createFieldGroupDescriptor(fieldGroup);
@@ -830,16 +828,8 @@ class EditorDescriptor {
830
828
  this.addFieldDescriptor(field);
831
829
  return field;
832
830
  }
833
- addFieldLookupEnum(property, options) {
834
- const propDef = ObjectSerializer.get().findAttributeDefinitionByClassType(this.model.type, property);
835
- if (!propDef) {
836
- throw new Error(`Property (attribute) definition not found for property ${property} on class type ${this._model.typeName}`);
837
- }
838
- const enumDef = ObjectSerializer.get().findEnum(propDef.type);
839
- if (!enumDef) {
840
- throw new Error(`Enum definition ${propDef.type} not found for property ${property} on class type ${this._model.typeName}`);
841
- }
842
- const field = new FieldLookupEnumDescriptor(this, property, propDef.type, options);
831
+ addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
832
+ const field = new FieldLookupEnumDescriptor(this, property, enumType, options, nameAsValue, optionsTitlePath);
843
833
  this.addFieldDescriptor(field);
844
834
  return field;
845
835
  }
@@ -878,11 +868,6 @@ class EditorDescriptor {
878
868
  editor._disabled = this._disabled;
879
869
  return editor;
880
870
  }
881
- createTabGroupDescriptor(tabGroup) {
882
- this._currentTabGroup = tabGroup;
883
- this._tabs.push(tabGroup);
884
- return this;
885
- }
886
871
  createFieldGroupDescriptor(fieldGroup) {
887
872
  var _a;
888
873
  this.createDefaultTabGroup();
@@ -891,16 +876,21 @@ class EditorDescriptor {
891
876
  (_a = this._currentTabGroup) === null || _a === void 0 ? void 0 : _a.addField(fieldGroup);
892
877
  return this;
893
878
  }
879
+ createTabGroupDescriptor(tabGroup) {
880
+ this._currentTabGroup = tabGroup;
881
+ this._tabs.push(tabGroup);
882
+ return this;
883
+ }
894
884
  createDefaultGroup() {
895
885
  var _a;
896
886
  this.createDefaultTabGroup();
897
887
  if (((_a = this._currentTabGroup) === null || _a === void 0 ? void 0 : _a.fields.length) === 0) {
898
- this.createFieldGroup(EditorDescriptor.defaultGroupName);
888
+ this.createFieldGroup(EditorDescriptor.defaultGroupName, null);
899
889
  }
900
890
  }
901
891
  createDefaultTabGroup() {
902
892
  if (this._tabs.length === 0) {
903
- this.createTabGroup(EditorDescriptor.defaultGroupName);
893
+ this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
904
894
  }
905
895
  }
906
896
  }
@@ -921,10 +911,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
921
911
  this._className = '';
922
912
  this._validators = [];
923
913
  this._property = property;
924
- this._label = this._editor.model.typeName + '.properties.' + property;
925
- }
926
- get property() {
927
- return this._property;
914
+ this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
928
915
  }
929
916
  get group() {
930
917
  return this._group;
@@ -941,6 +928,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
941
928
  get disabled() {
942
929
  return this._disabled;
943
930
  }
931
+ get defaultValue() {
932
+ return this._defaultValue;
933
+ }
944
934
  get className() {
945
935
  return this._className;
946
936
  }
@@ -956,6 +946,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
956
946
  get disabledFunction() {
957
947
  return this._disabledFunction;
958
948
  }
949
+ get property() {
950
+ return this._property;
951
+ }
959
952
  withLabel(label) {
960
953
  this._label = label;
961
954
  return this;
@@ -975,6 +968,10 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
975
968
  }
976
969
  return this;
977
970
  }
971
+ withDefaultValue(defaultValue) {
972
+ this._defaultValue = defaultValue;
973
+ return this;
974
+ }
978
975
  withClassName(className) {
979
976
  this._className = className;
980
977
  return this;
@@ -996,6 +993,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
996
993
  obj._placeholder = this._placeholder;
997
994
  obj._required = this._required;
998
995
  obj._disabled = this._disabled;
996
+ obj._defaultValue = this._defaultValue;
999
997
  obj._disabledFunction = this._disabledFunction;
1000
998
  obj._className = this._className;
1001
999
  obj._getter = this._getter;
@@ -1014,8 +1012,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
1014
1012
  get fieldType() {
1015
1013
  return this._fieldType;
1016
1014
  }
1017
- get numberStep() {
1018
- return this._numberStep;
1015
+ get rows() {
1016
+ return this._rows;
1019
1017
  }
1020
1018
  get numberMin() {
1021
1019
  return this._numberMin;
@@ -1023,8 +1021,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
1023
1021
  get numberMax() {
1024
1022
  return this._numberMax;
1025
1023
  }
1026
- get rows() {
1027
- return this._rows;
1024
+ get numberStep() {
1025
+ return this._numberStep;
1028
1026
  }
1029
1027
  get numberMinFractionDigits() {
1030
1028
  return this._numberMinFractionDigits;
@@ -1056,6 +1054,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
1056
1054
  get pattern() {
1057
1055
  return this._pattern;
1058
1056
  }
1057
+ get mask() {
1058
+ return this._mask;
1059
+ }
1060
+ get slotChar() {
1061
+ return this._slotChar;
1062
+ }
1063
+ get customComponentName() {
1064
+ return this._customComponentName;
1065
+ }
1059
1066
  asText(minLength, maxLength, pattern, isEmail) {
1060
1067
  this._fieldType = FieldInputDescriptor.TypeEnum.Text;
1061
1068
  this._minLength = minLength;
@@ -1087,9 +1094,19 @@ class FieldInputDescriptor extends AFieldDescriptor {
1087
1094
  this._fieldType = FieldInputDescriptor.TypeEnum.Switch;
1088
1095
  return this;
1089
1096
  }
1090
- asRadio(options) {
1097
+ asRadio(options, optionsTitlePath) {
1098
+ this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
1099
+ this._radioOptions = options.map(o => ({ value: o, title: `${optionsTitlePath ? `${optionsTitlePath}.` : ''}${o}` }));
1100
+ return this;
1101
+ }
1102
+ asRadioFromEnum(enumType, optionsTitlePath, values, nameAsValue = false) {
1091
1103
  this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
1092
- this._radioOptions = options;
1104
+ if (typeof optionsTitlePath === 'undefined') {
1105
+ optionsTitlePath = TypeUtil.findEnumName(enumType);
1106
+ }
1107
+ this._radioOptions = Array.isArray(values)
1108
+ ? EnumUtil.fromValuesAsEnumValueArray(enumType, values, nameAsValue, optionsTitlePath !== null && optionsTitlePath !== void 0 ? optionsTitlePath : undefined)
1109
+ : EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath !== null && optionsTitlePath !== void 0 ? optionsTitlePath : undefined);
1093
1110
  return this;
1094
1111
  }
1095
1112
  asDatePicker(format, min, max, showTime) {
@@ -1100,6 +1117,17 @@ class FieldInputDescriptor extends AFieldDescriptor {
1100
1117
  this._datePickerShowTime = showTime !== null && showTime !== void 0 ? showTime : false;
1101
1118
  return this;
1102
1119
  }
1120
+ asMask(mask, slotChar) {
1121
+ this._fieldType = FieldInputDescriptor.TypeEnum.Mask;
1122
+ this._mask = mask;
1123
+ this._slotChar = slotChar;
1124
+ return this;
1125
+ }
1126
+ asCustomComponent(customComponentName) {
1127
+ this._fieldType = FieldInputDescriptor.TypeEnum.Custom;
1128
+ this._customComponentName = customComponentName;
1129
+ return this;
1130
+ }
1103
1131
  copy() {
1104
1132
  const field = new FieldInputDescriptor(this._editor, this._property);
1105
1133
  this.copyFieldsTo(field);
@@ -1110,7 +1138,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
1110
1138
  field._numberStep = this._numberStep;
1111
1139
  field._numberMinFractionDigits = this._numberMinFractionDigits;
1112
1140
  field._numberMaxFractionDigits = this._numberMaxFractionDigits;
1113
- field._radioOptions = this._radioOptions;
1141
+ field._radioOptions = [...this._radioOptions];
1114
1142
  field._datePickerFormat = this._datePickerFormat;
1115
1143
  field._datePickerMin = this._datePickerMin;
1116
1144
  field._datePickerMax = this._datePickerMax;
@@ -1118,6 +1146,9 @@ class FieldInputDescriptor extends AFieldDescriptor {
1118
1146
  field._maxLength = this._maxLength;
1119
1147
  field._minLength = this._minLength;
1120
1148
  field._pattern = this._pattern;
1149
+ field._mask = this._mask;
1150
+ field._slotChar = this._slotChar;
1151
+ field._customComponentName = this._customComponentName;
1121
1152
  return field;
1122
1153
  }
1123
1154
  }
@@ -1130,6 +1161,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
1130
1161
  TypeEnum[TypeEnum["Switch"] = 3] = "Switch";
1131
1162
  TypeEnum[TypeEnum["Radio"] = 4] = "Radio";
1132
1163
  TypeEnum[TypeEnum["Datepicker"] = 5] = "Datepicker";
1164
+ TypeEnum[TypeEnum["Mask"] = 6] = "Mask";
1165
+ TypeEnum[TypeEnum["Custom"] = 7] = "Custom";
1133
1166
  })(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
1134
1167
  })(FieldInputDescriptor || (FieldInputDescriptor = {}));
1135
1168
  class FieldLookupDescriptor extends AFieldDescriptor {
@@ -1139,9 +1172,6 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1139
1172
  this._modelType = modelType;
1140
1173
  ModelUtil.trySetLookupItemsProperties(this);
1141
1174
  }
1142
- get modelType() {
1143
- return this._modelType;
1144
- }
1145
1175
  get lookupType() {
1146
1176
  return this._lookupType;
1147
1177
  }
@@ -1157,6 +1187,9 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1157
1187
  get dataProvider() {
1158
1188
  return this._dataProvider;
1159
1189
  }
1190
+ get modelType() {
1191
+ return this._modelType;
1192
+ }
1160
1193
  withItemsLabelProperty(itemsLabelProperty) {
1161
1194
  this._itemsLabelProperty = itemsLabelProperty;
1162
1195
  return this;
@@ -1205,17 +1238,26 @@ class FieldLookupDescriptor extends AFieldDescriptor {
1205
1238
  })(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
1206
1239
  })(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
1207
1240
  class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
1208
- constructor(editor, property, enumName, options) {
1241
+ constructor(editor, property, enumType, options, nameAsValue = false, optionsTitlePath) {
1209
1242
  super(editor, property, null);
1210
- this._enumName = enumName;
1211
- const dataProvider = new LookupDataProvider(null).withEnumName(enumName).withLookup(() => of(options));
1243
+ this._enumType = enumType;
1244
+ if (typeof optionsTitlePath === 'undefined') {
1245
+ optionsTitlePath = TypeUtil.findEnumName(enumType);
1246
+ }
1247
+ const optionEnumValues = Array.isArray(options)
1248
+ ? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath !== null && optionsTitlePath !== void 0 ? optionsTitlePath : undefined)
1249
+ : EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath !== null && optionsTitlePath !== void 0 ? optionsTitlePath : undefined);
1250
+ const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
1212
1251
  this.withLookupDataProvider(dataProvider);
1252
+ this.withItemsLabelProperty('title');
1253
+ this.withItemsValueProperty('value');
1254
+ this.withDataKeyProperty('value');
1213
1255
  }
1214
- get enumName() {
1215
- return this._enumName;
1256
+ get enumType() {
1257
+ return this._enumType;
1216
1258
  }
1217
1259
  copy() {
1218
- const field = new FieldLookupEnumDescriptor(this._editor, this._property, this._enumName, []);
1260
+ const field = new FieldLookupEnumDescriptor(this._editor, this._property, this._enumType, []);
1219
1261
  this.copyFieldsTo(field);
1220
1262
  field._lookupType = this._lookupType;
1221
1263
  field._itemsLabelProperty = this._itemsLabelProperty;
@@ -1239,11 +1281,8 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
1239
1281
  this._lookupTableDescriptor = lookupTableDescriptor;
1240
1282
  this._actions.push(FieldManyToManyEditorDescriptor.ActionEnum.Add, FieldManyToManyEditorDescriptor.ActionEnum.Delete);
1241
1283
  }
1242
- get mainTableDescriptor() {
1243
- return this._mainTableDescriptor;
1244
- }
1245
- get lookupTableDescriptor() {
1246
- return this._lookupTableDescriptor;
1284
+ get fieldType() {
1285
+ return this._fieldType;
1247
1286
  }
1248
1287
  get lookupTableDataProvider() {
1249
1288
  return this._lookupTableDataProvider;
@@ -1251,9 +1290,6 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
1251
1290
  get actions() {
1252
1291
  return this._actions;
1253
1292
  }
1254
- get fieldType() {
1255
- return this._fieldType;
1256
- }
1257
1293
  get hasLookupExcludeValues() {
1258
1294
  return this._hasLookupExcludeValues;
1259
1295
  }
@@ -1263,6 +1299,12 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
1263
1299
  get excludeValueProperty() {
1264
1300
  return this._excludeValueProperty;
1265
1301
  }
1302
+ get mainTableDescriptor() {
1303
+ return this._mainTableDescriptor;
1304
+ }
1305
+ get lookupTableDescriptor() {
1306
+ return this._lookupTableDescriptor;
1307
+ }
1266
1308
  withLookup(getAll, serviceType) {
1267
1309
  const dataProvider = new TableviewDataProvider(this._model.type);
1268
1310
  if (serviceType) {
@@ -1318,6 +1360,12 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
1318
1360
  this._tableviewDescriptor = tableviewDescriptor;
1319
1361
  this._actions.push(FieldManyEditorDescriptor.ActionEnum.Add, FieldManyEditorDescriptor.ActionEnum.Edit, FieldManyEditorDescriptor.ActionEnum.Delete);
1320
1362
  }
1363
+ get fieldType() {
1364
+ return this._fieldType;
1365
+ }
1366
+ get actions() {
1367
+ return this._actions;
1368
+ }
1321
1369
  get tableviewDescriptor() {
1322
1370
  return this._tableviewDescriptor;
1323
1371
  }
@@ -1333,12 +1381,6 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
1333
1381
  get editorForUpdate() {
1334
1382
  return this._tableviewDescriptor.editEditor;
1335
1383
  }
1336
- get fieldType() {
1337
- return this._fieldType;
1338
- }
1339
- get actions() {
1340
- return this._actions;
1341
- }
1342
1384
  withActions(actions = []) {
1343
1385
  this.actions.push(...actions);
1344
1386
  return this;
@@ -1371,6 +1413,12 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
1371
1413
  this._name = `${this.baseName}${name}`;
1372
1414
  this._default = name === EditorDescriptor.defaultGroupName;
1373
1415
  }
1416
+ get title() {
1417
+ return this._title;
1418
+ }
1419
+ get validators() {
1420
+ return this._validators;
1421
+ }
1374
1422
  get baseName() {
1375
1423
  return `${this.groupName()}_`;
1376
1424
  }
@@ -1380,12 +1428,6 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
1380
1428
  get default() {
1381
1429
  return this._default;
1382
1430
  }
1383
- get title() {
1384
- return this._title;
1385
- }
1386
- get validators() {
1387
- return this._validators;
1388
- }
1389
1431
  withTitle(title) {
1390
1432
  this._title = title;
1391
1433
  return this;
@@ -1498,6 +1540,7 @@ class TableDescriptor {
1498
1540
  this._filterDisplay = TableDescriptor.FilterDisplayEnum.Menu;
1499
1541
  this._paginationMode = TableDescriptor.PaginationModeEnum.Pagination;
1500
1542
  this._columns = [];
1543
+ this._hideHeader = false;
1501
1544
  this._hasDefaultSort = false;
1502
1545
  this._defaultSortProperty = [];
1503
1546
  this._defaultSortAsc = [];
@@ -1505,9 +1548,6 @@ class TableDescriptor {
1505
1548
  this._tableFullHeightOffset = 315;
1506
1549
  this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
1507
1550
  }
1508
- get model() {
1509
- return this._model;
1510
- }
1511
1551
  get filterDisplay() {
1512
1552
  return this._filterDisplay;
1513
1553
  }
@@ -1520,6 +1560,9 @@ class TableDescriptor {
1520
1560
  get title() {
1521
1561
  return this._title;
1522
1562
  }
1563
+ get hideHeader() {
1564
+ return this._hideHeader;
1565
+ }
1523
1566
  get dataKeyProperty() {
1524
1567
  return this._dataKeyProperty;
1525
1568
  }
@@ -1538,6 +1581,9 @@ class TableDescriptor {
1538
1581
  get tableFullHeightOffset() {
1539
1582
  return this._tableFullHeightOffset;
1540
1583
  }
1584
+ get model() {
1585
+ return this._model;
1586
+ }
1541
1587
  addColumnDescriptor(column) {
1542
1588
  this._columns.push(column);
1543
1589
  this.setDataKeyFromColumn();
@@ -1570,6 +1616,13 @@ class TableDescriptor {
1570
1616
  this.setDataKeyFromColumn();
1571
1617
  return column;
1572
1618
  }
1619
+ addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
1620
+ const column = new ColumnDescriptor(this, property);
1621
+ column.asEnum(enumType, nameAsValue, titlePath);
1622
+ this._columns.push(column);
1623
+ this.setDataKeyFromColumn();
1624
+ return column;
1625
+ }
1573
1626
  addColumnObject(property, modelType, displayProperty) {
1574
1627
  const column = new ColumnDescriptor(this, property);
1575
1628
  column.withModelType(modelType);
@@ -1590,6 +1643,10 @@ class TableDescriptor {
1590
1643
  this._title = title;
1591
1644
  return this;
1592
1645
  }
1646
+ withHideHeader(hideHeader = true) {
1647
+ this._hideHeader = hideHeader;
1648
+ return this;
1649
+ }
1593
1650
  withDataKeyProperty(property) {
1594
1651
  this._dataKeyProperty = property;
1595
1652
  return this;
@@ -1608,21 +1665,22 @@ class TableDescriptor {
1608
1665
  this._tableFullHeightOffset = tableFullHeightOffset;
1609
1666
  return this;
1610
1667
  }
1611
- setDataKeyFromColumn() {
1612
- if (!this._dataKeyProperty && this._columns.length === 1) {
1613
- this._dataKeyProperty = this._columns[0].property;
1614
- }
1615
- }
1616
1668
  copy() {
1617
1669
  const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
1618
1670
  descriptor._columns = this.columns.map(c => c.copy());
1619
1671
  descriptor._title = this._title;
1672
+ descriptor._hideHeader = this._hideHeader;
1620
1673
  descriptor._dataKeyProperty = this._dataKeyProperty;
1621
1674
  descriptor._defaultSortProperty = this._defaultSortProperty.map(p => p);
1622
1675
  descriptor._defaultSortAsc = this._defaultSortAsc.map(p => p);
1623
1676
  descriptor._filterDisplay = this._filterDisplay;
1624
1677
  return descriptor;
1625
1678
  }
1679
+ setDataKeyFromColumn() {
1680
+ if (!this._dataKeyProperty && this._columns.length === 1) {
1681
+ this._dataKeyProperty = this._columns[0].property;
1682
+ }
1683
+ }
1626
1684
  }
1627
1685
  (function (TableDescriptor) {
1628
1686
  let PaginationModeEnum;
@@ -1641,36 +1699,46 @@ class ColumnDescriptor {
1641
1699
  this._modelType = null;
1642
1700
  this._columnType = ColumnDescriptor.TypeEnum.String;
1643
1701
  this._isSortEnabled = false;
1702
+ this._enumNameAsValue = false;
1644
1703
  this._table = table;
1645
1704
  this._property = property;
1646
1705
  }
1647
- get table() {
1648
- return this._table;
1649
- }
1650
- get property() {
1651
- return this._property;
1652
- }
1653
1706
  get modelType() {
1654
1707
  return this._modelType;
1655
1708
  }
1656
- get displayPropertyPath() {
1657
- return this._displayPropertyPath;
1709
+ get columnType() {
1710
+ return this._columnType;
1658
1711
  }
1659
1712
  get title() {
1660
1713
  return this._title;
1661
1714
  }
1715
+ get displayPropertyPath() {
1716
+ return this._displayPropertyPath;
1717
+ }
1662
1718
  get isSortEnabled() {
1663
1719
  return this._isSortEnabled;
1664
1720
  }
1665
- get columnType() {
1666
- return this._columnType;
1667
- }
1668
1721
  get filterDescriptor() {
1669
1722
  return this._filterDescriptor;
1670
1723
  }
1671
1724
  get displayFormat() {
1672
1725
  return this._displayFormat;
1673
1726
  }
1727
+ get table() {
1728
+ return this._table;
1729
+ }
1730
+ get property() {
1731
+ return this._property;
1732
+ }
1733
+ get enumType() {
1734
+ return this._enumType;
1735
+ }
1736
+ get enumTitlePath() {
1737
+ return this._enumTitlePath;
1738
+ }
1739
+ get enumNameAsValue() {
1740
+ return this._enumNameAsValue;
1741
+ }
1674
1742
  asType(type = ColumnDescriptor.TypeEnum.String) {
1675
1743
  this._columnType = type;
1676
1744
  return this;
@@ -1689,6 +1757,16 @@ class ColumnDescriptor {
1689
1757
  this._columnType = ColumnDescriptor.TypeEnum.Boolean;
1690
1758
  return this;
1691
1759
  }
1760
+ asEnum(enumType, nameAsValue = false, titlePath) {
1761
+ this._columnType = ColumnDescriptor.TypeEnum.Enum;
1762
+ this._enumType = enumType;
1763
+ this._enumNameAsValue = nameAsValue;
1764
+ if (typeof titlePath === 'undefined') {
1765
+ titlePath = TypeUtil.findEnumName(enumType);
1766
+ }
1767
+ this._enumTitlePath = titlePath;
1768
+ return this;
1769
+ }
1692
1770
  withModelType(modelType) {
1693
1771
  this._modelType = modelType;
1694
1772
  return this;
@@ -1703,7 +1781,23 @@ class ColumnDescriptor {
1703
1781
  }
1704
1782
  withFilter() {
1705
1783
  this._filterDescriptor = new FilterDescriptor(this._property);
1706
- this._filterDescriptor.asFilterType(this._columnType);
1784
+ let filterType;
1785
+ switch (this._columnType) {
1786
+ case ColumnDescriptor.TypeEnum.Number:
1787
+ filterType = FilterDescriptor.TypeEnum.Number;
1788
+ break;
1789
+ case ColumnDescriptor.TypeEnum.Boolean:
1790
+ filterType = FilterDescriptor.TypeEnum.Boolean;
1791
+ break;
1792
+ case ColumnDescriptor.TypeEnum.Date:
1793
+ filterType = FilterDescriptor.TypeEnum.Date;
1794
+ break;
1795
+ case ColumnDescriptor.TypeEnum.String:
1796
+ default:
1797
+ filterType = FilterDescriptor.TypeEnum.String;
1798
+ break;
1799
+ }
1800
+ this._filterDescriptor.asFilterType(filterType);
1707
1801
  return this._filterDescriptor;
1708
1802
  }
1709
1803
  withFilterLookup() {
@@ -1711,6 +1805,14 @@ class ColumnDescriptor {
1711
1805
  this._filterDescriptor = filterDescriptor;
1712
1806
  return filterDescriptor;
1713
1807
  }
1808
+ withFilterLookupEnum(options) {
1809
+ if (this._columnType !== ColumnDescriptor.TypeEnum.Enum || !this._enumType) {
1810
+ throw new Error(`Column ${this._property} is not of type enum or enum type is undefined.`);
1811
+ }
1812
+ const filterDescriptor = new FilterLookupEnumDescriptor(this._property, this._enumType, options, this._enumNameAsValue, this._enumTitlePath);
1813
+ this._filterDescriptor = filterDescriptor;
1814
+ return filterDescriptor;
1815
+ }
1714
1816
  withSort(isEnabled = true) {
1715
1817
  this._isSortEnabled = isEnabled;
1716
1818
  return this;
@@ -1733,6 +1835,7 @@ class ColumnDescriptor {
1733
1835
  TypeEnum[TypeEnum["Number"] = 1] = "Number";
1734
1836
  TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
1735
1837
  TypeEnum[TypeEnum["Date"] = 3] = "Date";
1838
+ TypeEnum[TypeEnum["Enum"] = 4] = "Enum";
1736
1839
  })(TypeEnum = ColumnDescriptor.TypeEnum || (ColumnDescriptor.TypeEnum = {}));
1737
1840
  })(ColumnDescriptor || (ColumnDescriptor = {}));
1738
1841
  class FilterDescriptor {
@@ -1742,9 +1845,6 @@ class FilterDescriptor {
1742
1845
  this._className = '';
1743
1846
  this._property = property;
1744
1847
  }
1745
- get property() {
1746
- return this._property;
1747
- }
1748
1848
  get filterType() {
1749
1849
  return this._filterType;
1750
1850
  }
@@ -1760,6 +1860,9 @@ class FilterDescriptor {
1760
1860
  get className() {
1761
1861
  return this._className;
1762
1862
  }
1863
+ get property() {
1864
+ return this._property;
1865
+ }
1763
1866
  asFilterType(filterType) {
1764
1867
  this._filterType = filterType;
1765
1868
  return this;
@@ -1784,17 +1887,17 @@ class FilterDescriptor {
1784
1887
  this._matchModes = matchModes;
1785
1888
  return this;
1786
1889
  }
1890
+ copy() {
1891
+ const descriptor = new FilterDescriptor(this._property);
1892
+ this.copyFieldsTo(descriptor);
1893
+ return descriptor;
1894
+ }
1787
1895
  copyFieldsTo(descriptor) {
1788
1896
  descriptor._filterType = this._filterType;
1789
1897
  descriptor._filterProperty = this._filterProperty;
1790
1898
  descriptor._placeholder = this._placeholder;
1791
1899
  descriptor._className = this._className;
1792
1900
  }
1793
- copy() {
1794
- const descriptor = new FilterDescriptor(this._property);
1795
- this.copyFieldsTo(descriptor);
1796
- return descriptor;
1797
- }
1798
1901
  }
1799
1902
  (function (FilterDescriptor) {
1800
1903
  let TypeEnum;
@@ -1804,6 +1907,7 @@ class FilterDescriptor {
1804
1907
  TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
1805
1908
  TypeEnum[TypeEnum["Date"] = 3] = "Date";
1806
1909
  TypeEnum[TypeEnum["Lookup"] = 4] = "Lookup";
1910
+ TypeEnum[TypeEnum["LookupEnum"] = 5] = "LookupEnum";
1807
1911
  })(TypeEnum = FilterDescriptor.TypeEnum || (FilterDescriptor.TypeEnum = {}));
1808
1912
  let MatchModeEnum;
1809
1913
  (function (MatchModeEnum) {
@@ -1835,12 +1939,12 @@ class FilterLookupDescriptor extends FilterDescriptor {
1835
1939
  this._filterType = FilterDescriptor.TypeEnum.Lookup;
1836
1940
  ModelUtil.trySetLookupItemsProperties(this);
1837
1941
  }
1838
- get modelType() {
1839
- return this._modelType;
1840
- }
1841
1942
  get lookupType() {
1842
1943
  return this._lookupType;
1843
1944
  }
1945
+ get dataProvider() {
1946
+ return this._dataProvider;
1947
+ }
1844
1948
  get itemsLabelProperty() {
1845
1949
  return this._itemsLabelProperty;
1846
1950
  }
@@ -1850,12 +1954,15 @@ class FilterLookupDescriptor extends FilterDescriptor {
1850
1954
  get dataKeyProperty() {
1851
1955
  return this._dataKeyProperty;
1852
1956
  }
1853
- get dataProvider() {
1854
- return this._dataProvider;
1855
- }
1856
1957
  get multiselect() {
1857
1958
  return this._multiselect;
1858
1959
  }
1960
+ get dropdownClassName() {
1961
+ return this._dropdownClassName;
1962
+ }
1963
+ get modelType() {
1964
+ return this._modelType;
1965
+ }
1859
1966
  withItemsLabelProperty(itemsLabelProperty) {
1860
1967
  this._itemsLabelProperty = itemsLabelProperty;
1861
1968
  return this;
@@ -1868,9 +1975,6 @@ class FilterLookupDescriptor extends FilterDescriptor {
1868
1975
  this._dataKeyProperty = dataKeyProperty;
1869
1976
  return this;
1870
1977
  }
1871
- get dropdownClassName() {
1872
- return this._dropdownClassName;
1873
- }
1874
1978
  withLookup(lookup, serviceType) {
1875
1979
  const dataProvider = new LookupDataProvider(this._modelType);
1876
1980
  if (serviceType) {
@@ -1896,6 +2000,11 @@ class FilterLookupDescriptor extends FilterDescriptor {
1896
2000
  this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Autocomplete;
1897
2001
  return this;
1898
2002
  }
2003
+ copy() {
2004
+ const descriptor = new FilterLookupDescriptor(this._property, this._modelType);
2005
+ this.copyFieldsTo(descriptor);
2006
+ return descriptor;
2007
+ }
1899
2008
  copyFieldsTo(descriptor) {
1900
2009
  super.copyFieldsTo(descriptor);
1901
2010
  descriptor._dataProvider = this._dataProvider;
@@ -1904,10 +2013,30 @@ class FilterLookupDescriptor extends FilterDescriptor {
1904
2013
  descriptor._itemsValueProperty = this._itemsValueProperty;
1905
2014
  descriptor._dataKeyProperty = this._dataKeyProperty;
1906
2015
  }
2016
+ }
2017
+ class FilterLookupEnumDescriptor extends FilterLookupDescriptor {
2018
+ constructor(property, enumType, options, nameAsValue = false, optionsTitlePath) {
2019
+ super(property, null);
2020
+ this._enumType = enumType;
2021
+ if (typeof optionsTitlePath === 'undefined') {
2022
+ optionsTitlePath = TypeUtil.findEnumName(enumType);
2023
+ }
2024
+ const optionEnumValues = Array.isArray(options)
2025
+ ? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath !== null && optionsTitlePath !== void 0 ? optionsTitlePath : undefined)
2026
+ : EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath !== null && optionsTitlePath !== void 0 ? optionsTitlePath : undefined);
2027
+ const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
2028
+ this.withLookupDataProvider(dataProvider);
2029
+ this.withItemsLabelProperty('title');
2030
+ this.withItemsValueProperty('value');
2031
+ this.withDataKeyProperty('value');
2032
+ }
2033
+ get enumType() {
2034
+ return this._enumType;
2035
+ }
1907
2036
  copy() {
1908
- const descriptor = new FilterLookupDescriptor(this._property, this._modelType);
1909
- this.copyFieldsTo(descriptor);
1910
- return descriptor;
2037
+ const field = new FilterLookupEnumDescriptor(this._property, this._enumType, []);
2038
+ this.copyFieldsTo(field);
2039
+ return field;
1911
2040
  }
1912
2041
  }
1913
2042
  (function (FilterLookupDescriptor) {
@@ -1928,9 +2057,6 @@ class TableviewDescriptor {
1928
2057
  this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty);
1929
2058
  this._tableTitle = `${this._model.typeName}.name`;
1930
2059
  }
1931
- get model() {
1932
- return this._model;
1933
- }
1934
2060
  get table() {
1935
2061
  return this._table;
1936
2062
  }
@@ -1946,6 +2072,9 @@ class TableviewDescriptor {
1946
2072
  get tableTitle() {
1947
2073
  return this._tableTitle;
1948
2074
  }
2075
+ get model() {
2076
+ return this._model;
2077
+ }
1949
2078
  withTableDescriptor(descriptor) {
1950
2079
  this._table = descriptor;
1951
2080
  return this;
@@ -1987,6 +2116,9 @@ class TableviewDescriptor {
1987
2116
  addColumnBoolean(property) {
1988
2117
  return this._table.addColumnBoolean(property);
1989
2118
  }
2119
+ addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
2120
+ return this._table.addColumnEnum(property, enumType, nameAsValue, titlePath);
2121
+ }
1990
2122
  addColumnObject(property, modelType, displayProperty) {
1991
2123
  return this._table.addColumnObject(property, modelType, displayProperty);
1992
2124
  }
@@ -2020,8 +2152,8 @@ class TableviewDescriptor {
2020
2152
  this._editEditor.addFieldDescriptor(field);
2021
2153
  return field;
2022
2154
  }
2023
- addFieldLookupEnum(property, options) {
2024
- const field = this._viewEditor.addFieldLookupEnum(property, options);
2155
+ addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
2156
+ const field = this._viewEditor.addFieldLookupEnum(property, enumType, options, nameAsValue, optionsTitlePath);
2025
2157
  this._addEditor.addFieldDescriptor(field);
2026
2158
  this._editEditor.addFieldDescriptor(field);
2027
2159
  return field;
@@ -2159,6 +2291,12 @@ class EditorFormlyUtil {
2159
2291
  case FieldInputDescriptor.TypeEnum.Datepicker:
2160
2292
  field.type = 'datepicker';
2161
2293
  break;
2294
+ case FieldInputDescriptor.TypeEnum.Mask:
2295
+ field.type = 'mask';
2296
+ break;
2297
+ case FieldInputDescriptor.TypeEnum.Custom:
2298
+ field.type = descriptor.customComponentName;
2299
+ break;
2162
2300
  default:
2163
2301
  field.type = 'input';
2164
2302
  field.templateOptions.minLength = descriptor.minLength;
@@ -2202,6 +2340,9 @@ class EditorFormlyUtil {
2202
2340
  else {
2203
2341
  field.expressionProperties['templateOptions.disabled'] = 'formState.disabled';
2204
2342
  }
2343
+ if (typeof descriptor.defaultValue !== 'undefined') {
2344
+ field.defaultValue = descriptor.defaultValue;
2345
+ }
2205
2346
  for (const validator of descriptor.validators) {
2206
2347
  field.validators[validator.name] = { expression: validator.expression, message: validator.message };
2207
2348
  }
@@ -2209,6 +2350,90 @@ class EditorFormlyUtil {
2209
2350
  }
2210
2351
  }
2211
2352
 
2353
+ class EnumUtil {
2354
+ /**
2355
+ * Returns array of names for constants in enum.
2356
+ * @param enumType Enum object.
2357
+ */
2358
+ static getConstantNames(enumType) {
2359
+ return EnumUtil.getConstantNamesFromEnumObject(enumType);
2360
+ }
2361
+ /**
2362
+ * Returns array of names for constants in enum.
2363
+ * @param enumObj Enum object.
2364
+ */
2365
+ static getConstantNamesFromEnumObject(enumObj) {
2366
+ // in number enum, the numbers are also represented in objects and should be filtered out
2367
+ return Object.keys(enumObj).filter(v => isNaN(+v));
2368
+ }
2369
+ /**
2370
+ * Returns array of string values for constants in enum.
2371
+ * @param enumType Enum object.
2372
+ */
2373
+ static getConstantValuesAsString(enumType) {
2374
+ return Object.keys(enumType).map(v => enumType[v]);
2375
+ }
2376
+ /**
2377
+ * Returns array of number values for constants in enum.
2378
+ * @param enumType Enum object.
2379
+ */
2380
+ static getConstantValuesAsNumber(enumType) {
2381
+ return Object.keys(enumType)
2382
+ .filter(v => !isNaN(+v))
2383
+ .map(v => +v);
2384
+ }
2385
+ /**
2386
+ * Returns array of type EnumValue for all constants in enum.
2387
+ * @param enumType Enum object.
2388
+ * @param nameAsValue If use name of constant as value (optional, default: false).
2389
+ * @param titlePath Base path for title to use as translation (optional).
2390
+ */
2391
+ static fromConstantsAsEnumValueArray(enumType, nameAsValue = false, titlePath) {
2392
+ return EnumUtil.getConstantNames(enumType).map(n => ({ name: n, title: `${titlePath ? `${titlePath}.` : ''}${n}`, value: nameAsValue ? n : enumType[n] }));
2393
+ }
2394
+ /**
2395
+ * Returns array of type EnumValue for provided values in enum.
2396
+ * @param enumType Enum object.
2397
+ * @param nameAsValue If use name of constant as value (optional, default: false).
2398
+ * @param titlePath Base path for title to use as translation (optional).
2399
+ */
2400
+ static fromValuesAsEnumValueArray(enumType, values, nameAsValue = false, titlePath) {
2401
+ return values.map(v => {
2402
+ const k = EnumUtil.getConstantName(enumType, v);
2403
+ return { name: k, title: `${titlePath ? `${titlePath}.` : ''}${k}`, value: nameAsValue ? k : v };
2404
+ });
2405
+ }
2406
+ /**
2407
+ * Gets constant name for value.
2408
+ * @param enumType Enum object.
2409
+ * @param value Value of enum constant.
2410
+ */
2411
+ static getConstantName(enumType, value) {
2412
+ var _a;
2413
+ if (typeof value === 'string') {
2414
+ return (_a = this.getConstantNames(enumType).find(c => enumType[c] === value)) !== null && _a !== void 0 ? _a : null;
2415
+ }
2416
+ else {
2417
+ return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
2418
+ }
2419
+ }
2420
+ /**
2421
+ * Gets constant name for value.
2422
+ * @param enumObj Enum object.
2423
+ * @param value Value of enum constant.
2424
+ */
2425
+ static getConstantNameFromEnumObject(enumObj, value) {
2426
+ var _a;
2427
+ const enumObjAny = enumObj;
2428
+ if (typeof value === 'string') {
2429
+ return (_a = this.getConstantNamesFromEnumObject(enumObj).find(c => enumObjAny[c] === value)) !== null && _a !== void 0 ? _a : null;
2430
+ }
2431
+ else {
2432
+ return typeof enumObjAny[value] !== 'undefined' ? enumObjAny[value] : null;
2433
+ }
2434
+ }
2435
+ }
2436
+
2212
2437
  class I18nUtil {
2213
2438
  static instantModelTranslation(translate, model, keyPath, customKey, item, fallbackKey, i18nParams) {
2214
2439
  const keys = I18nUtil.getModelKeysByPriority(model, keyPath, customKey, fallbackKey);
@@ -2216,6 +2441,15 @@ class I18nUtil {
2216
2441
  const i18n = translate.instant(keys, I18nUtil.getModelI18nParams(model, item, i18nModelName !== null && i18nModelName !== void 0 ? i18nModelName : undefined, i18nParams));
2217
2442
  return I18nUtil.selectKeyByPriority(keys, i18n);
2218
2443
  }
2444
+ static getModelTabKey(model, tab) {
2445
+ return I18nUtil.getModelKeyPath(model, `tabs.${tab}`);
2446
+ }
2447
+ static getModelGroupKey(model, group) {
2448
+ return I18nUtil.getModelKeyPath(model, `groups.${group}`);
2449
+ }
2450
+ static getModelPropertyKey(model, property) {
2451
+ return I18nUtil.getModelKeyPath(model, `properties.${property}`);
2452
+ }
2219
2453
  static instantActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, functionNameKey, i18nParams) {
2220
2454
  const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
2221
2455
  const i18nModelName = I18nUtil.instantModelName(translate, action === null || action === void 0 ? void 0 : action.model, true);
@@ -2230,31 +2464,6 @@ class I18nUtil {
2230
2464
  const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
2231
2465
  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)));
2232
2466
  }
2233
- static getModelKeysByPriority(model, keyPath, customKey, fallbackKey) {
2234
- const keys = [];
2235
- if (customKey) {
2236
- keys.push(customKey);
2237
- }
2238
- const modelActionKey = `${model.typeName}.${keyPath}`;
2239
- keys.push(modelActionKey);
2240
- if (fallbackKey) {
2241
- keys.push(fallbackKey);
2242
- }
2243
- return keys;
2244
- }
2245
- static getActionKeysByPriority(action, keyPath, customKey, fallbackKey) {
2246
- const keys = [];
2247
- if (customKey) {
2248
- keys.push(customKey);
2249
- }
2250
- const modelActionKey = `${action.i18nModelActionBaseKey}.${keyPath}`;
2251
- const actionKey = `${action.actionName}.${keyPath}`;
2252
- keys.push(modelActionKey, actionKey);
2253
- if (fallbackKey) {
2254
- keys.push(fallbackKey);
2255
- }
2256
- return keys;
2257
- }
2258
2467
  static getModelI18nParams(model, item, i18nModelName, i18nParameters = {}) {
2259
2468
  i18nParameters.itemId = '';
2260
2469
  i18nParameters.itemTitle = '';
@@ -2311,6 +2520,34 @@ class I18nUtil {
2311
2520
  keys.push(`${model === null || model === void 0 ? void 0 : model.typeName}.name`);
2312
2521
  return keys;
2313
2522
  }
2523
+ static getModelKeysByPriority(model, keyPath, customKey, fallbackKey) {
2524
+ const keys = [];
2525
+ if (customKey) {
2526
+ keys.push(customKey);
2527
+ }
2528
+ const modelActionKey = I18nUtil.getModelKeyPath(model, keyPath);
2529
+ keys.push(modelActionKey);
2530
+ if (fallbackKey) {
2531
+ keys.push(fallbackKey);
2532
+ }
2533
+ return keys;
2534
+ }
2535
+ static getModelKeyPath(model, keyPath) {
2536
+ return `${model.typeName}.${keyPath}`;
2537
+ }
2538
+ static getActionKeysByPriority(action, keyPath, customKey, fallbackKey) {
2539
+ const keys = [];
2540
+ if (customKey) {
2541
+ keys.push(customKey);
2542
+ }
2543
+ const modelActionKey = `${action.i18nModelActionBaseKey}.${keyPath}`;
2544
+ const actionKey = `${action.actionName}.${keyPath}`;
2545
+ keys.push(modelActionKey, actionKey);
2546
+ if (fallbackKey) {
2547
+ keys.push(fallbackKey);
2548
+ }
2549
+ return keys;
2550
+ }
2314
2551
  static selectKeyByPriority(keys, i18n) {
2315
2552
  for (const key of keys) {
2316
2553
  if (key !== i18n[key]) {
@@ -2440,8 +2677,19 @@ function TypeName(typeName) {
2440
2677
  target[typeNameDecoratorPropertyName] = typeName;
2441
2678
  };
2442
2679
  }
2680
+ const enumNameDecoratorPropertyName = 'enumName';
2681
+ function EnumName(typeName) {
2682
+ return function (target) {
2683
+ target[enumNameDecoratorPropertyName] = typeName;
2684
+ };
2685
+ }
2443
2686
 
2444
2687
  class TypeUtil {
2688
+ /**
2689
+ * Defines type name decorator.
2690
+ * @param targetType class.
2691
+ * @param typeName Name of the type.
2692
+ */
2445
2693
  static defineReflectTypeName(targetType, typeName) {
2446
2694
  if (!typeName) {
2447
2695
  typeName = TypeUtil.getDecoratorTypeName(targetType);
@@ -2454,6 +2702,16 @@ class TypeUtil {
2454
2702
  Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
2455
2703
  }
2456
2704
  }
2705
+ /**
2706
+ * Defines enum name decorator.
2707
+ * @param targetType enum object.
2708
+ * @param enumName Name of the enum.
2709
+ */
2710
+ static defineReflectEnumName(targetType, enumName) {
2711
+ if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
2712
+ Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
2713
+ }
2714
+ }
2457
2715
  /**
2458
2716
  * Gets type name from either decorator or reflect metadata.
2459
2717
  * @param type Class.
@@ -2469,6 +2727,21 @@ class TypeUtil {
2469
2727
  }
2470
2728
  return type.name;
2471
2729
  }
2730
+ /**
2731
+ * Gets enum name from either decorator or reflect metadata.
2732
+ * @param enumType Class.
2733
+ */
2734
+ static findEnumName(enumType) {
2735
+ let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
2736
+ if (decoratorName) {
2737
+ return decoratorName;
2738
+ }
2739
+ decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
2740
+ if (decoratorName) {
2741
+ return decoratorName;
2742
+ }
2743
+ throw new Error('Could not fined enum name');
2744
+ }
2472
2745
  /**
2473
2746
  * Get value from decorator defined property name
2474
2747
  * @param type Class.
@@ -2477,6 +2750,13 @@ class TypeUtil {
2477
2750
  static getDecoratorTypeName(type) {
2478
2751
  return type[typeNameDecoratorPropertyName];
2479
2752
  }
2753
+ /**
2754
+ * Get value from decorator defined property name
2755
+ * @param type Enum object.
2756
+ */
2757
+ static getDecoratorEnumName(type) {
2758
+ return type[enumNameDecoratorPropertyName];
2759
+ }
2480
2760
  }
2481
2761
 
2482
2762
  class ObjectSerializer {
@@ -2560,12 +2840,17 @@ class ObjectSerializer {
2560
2840
  }
2561
2841
  registerEnums(enums) {
2562
2842
  for (const key in enums) {
2563
- if (typeof this._enumMap[key] !== 'undefined') {
2564
- console.warn(`Registering enum ${key} skipped, because enum already exists.`);
2565
- }
2566
- else {
2567
- this._enumMap[key] = enums[key];
2568
- }
2843
+ this.registerEnum(enums[key], key);
2844
+ }
2845
+ }
2846
+ registerEnum(enumType, enumName) {
2847
+ // try to find name from decorator
2848
+ if (typeof this._enumMap[enumName] !== 'undefined') {
2849
+ console.warn(`Registering enum ${enumName} skipped, because enum already exists.`);
2850
+ }
2851
+ else {
2852
+ TypeUtil.defineReflectEnumName(enumType, enumName);
2853
+ this._enumMap[enumName] = enumType;
2569
2854
  }
2570
2855
  }
2571
2856
  findCorrectType(data, expectedType) {
@@ -4193,10 +4478,9 @@ class MngDropdownComponent {
4193
4478
  }
4194
4479
  }
4195
4480
  writeValue(obj) {
4481
+ var _a;
4196
4482
  this.dropdownFormControl.setValue(obj, { emitEvent: false });
4197
- if (this.primeDropdown) {
4198
- this.primeDropdown.writeValue(obj);
4199
- }
4483
+ (_a = this.primeDropdown) === null || _a === void 0 ? void 0 : _a.writeValue(obj);
4200
4484
  }
4201
4485
  }
4202
4486
  MngDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
@@ -4390,10 +4674,10 @@ class MngFormlyFieldInputComponent extends FieldType {
4390
4674
  }
4391
4675
  }
4392
4676
  MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4393
- MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"> </p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let category of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"p-field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"category\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"category\" class=\"mng-radio-button-label\">{{ category }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.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: i8$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i9$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4677
+ MngFormlyFieldInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldInputComponent, selector: "mng-formly-field-input", usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n", components: [{ type: i1$3.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }, { type: i2$5.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$3.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5.Calendar, selector: "p-calendar", inputs: ["style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "view", "defaultDate", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { type: i6$1.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown"] }], directives: [{ type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$3.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: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10$1.InputText, selector: "[pInputText]" }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4394
4678
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
4395
4679
  type: Component,
4396
- args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"> </p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let category of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"p-field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"category\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"category\" class=\"mng-radio-button-label\">{{ category }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
4680
+ args: [{ selector: 'mng-formly-field-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"to.type\">\n <p-inputNumber\n *ngSwitchCase=\"'number'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [min]=\"$any(descriptor.numberMin)\"\n [max]=\"$any(descriptor.numberMax)\"\n [step]=\"$any(descriptor.numberStep)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-inputSwitch>\n <small *ngIf=\"showError\" class=\"p-error\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </small>\n </div>\n\n <ng-container *ngSwitchCase=\"'radio'\">\n <div *ngFor=\"let option of descriptor.radioOptions\" [id]=\"$any(key)\" class=\"field-radiobutton\">\n <p-radioButton [name]=\"$any(key)\" [value]=\"option.value\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\"></p-radioButton>\n <label [for]=\"option.value\" class=\"mng-radio-button-label\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [rows]=\"descriptor.rows ?? 3\" pInputTextarea> </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [dateFormat]=\"$any(descriptor.datePickerFormat)\"\n [minDate]=\"$any(descriptor.datePickerMin)\"\n [maxDate]=\"$any(descriptor.datePickerMax)\"\n [showTime]=\"descriptor.datePickerShowTime\"\n [showIcon]=\"true\">\n </p-calendar>\n\n <p-inputMask\n *ngSwitchCase=\"'mask'\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [mask]=\"$any(descriptor.mask)\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [slotChar]=\"$any(descriptor.slotChar)\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
4397
4681
  }] });
4398
4682
 
4399
4683
  class MngFormlyFieldDropdownComponent extends FieldType {
@@ -4403,10 +4687,10 @@ class MngFormlyFieldDropdownComponent extends FieldType {
4403
4687
  }
4404
4688
  }
4405
4689
  MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4406
- MngFormlyFieldDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldDropdownComponent, selector: "mng-formly-field-dropdown", usesInheritance: true, ngImport: i0, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n", components: [{ type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4690
+ MngFormlyFieldDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldDropdownComponent, selector: "mng-formly-field-dropdown", usesInheritance: true, ngImport: i0, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n", components: [{ type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4407
4691
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, decorators: [{
4408
4692
  type: Component,
4409
- args: [{ selector: 'mng-formly-field-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n" }]
4693
+ args: [{ selector: 'mng-formly-field-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-dropdown\n [id]=\"$any(key)\"\n [formControl]=\"dFormControl\"\n [formlyAttributes]=\"field\"\n [placeholder]=\"$any(descriptor.placeholder)\"\n [dataProvider]=\"descriptor.dataProvider\"\n [itemsLabelProperty]=\"$any(descriptor.itemsLabelProperty)\"\n [itemsValueProperty]=\"$any(descriptor.itemsValueProperty)\"\n [showClear]=\"!this.to.required\"\n [dataKeyProperty]=\"$any(descriptor.dataKeyProperty)\">\n</mng-dropdown>\n" }]
4410
4694
  }] });
4411
4695
 
4412
4696
  class MngTableLoadEvent {
@@ -4491,10 +4775,10 @@ class MngTableColumnFilterComponent {
4491
4775
  }
4492
4776
  }
4493
4777
  MngTableColumnFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, deps: [{ token: i2$1.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
4494
- MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (change)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i2$2.TranslatePipe } });
4778
+ MngTableColumnFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: { descriptor: "descriptor", display: "display" }, ngImport: i0, template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n", components: [{ type: i4$4.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping"] }, { type: MngAutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "multiselect", "placeholder", "className", "dropdownClassName"], outputs: ["valueChange"] }, { type: MngDropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "dataKeyProperty", "itemsLabelProperty", "itemsValueProperty", "multiselect", "placeholder", "showClear", "className", "dropdownClassName"], outputs: ["valueChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i2$2.TranslatePipe } });
4495
4779
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
4496
4780
  type: Component,
4497
- args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (change)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
4781
+ args: [{ selector: 'mng-table-column-filter', template: "<p-columnFilter\n class=\"ml-auto\"\n [type]=\"primeType\"\n matchMode=\"equals\"\n [field]=\"descriptor.property\"\n [display]=\"primeDisplay\"\n [matchMode]=\"primeDefaultMatchMode\"\n [matchModeOptions]=\"$any(primeMatchModes)\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showMatchModes]=\"true\"\n [showOperator]=\"false\"\n [showAddButton]=\"false\"\n [hideOnClear]=\"true\">\n <ng-template *ngIf=\"lookupDescriptor\" pTemplate=\"filter\" let-value let-filterCallback=\"filterCallback\">\n <ng-container [ngSwitch]=\"lookupDescriptor.lookupType\">\n <mng-autocomplete\n *ngSwitchCase=\"lookupTypeAutocomplete\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n (valueChange)=\"autocompleteFilter($event, filterCallback)\">\n </mng-autocomplete>\n <mng-dropdown\n *ngSwitchCase=\"lookupTypeDropdown\"\n [ngModel]=\"value\"\n [dataProvider]=\"lookupDescriptor.dataProvider\"\n [dataKeyProperty]=\"lookupDescriptor.dataKeyProperty\"\n [itemsLabelProperty]=\"lookupDescriptor.itemsLabelProperty\"\n [itemsValueProperty]=\"lookupDescriptor.itemsValueProperty\"\n [multiselect]=\"lookupDescriptor.multiselect\"\n [placeholder]=\"descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookupDescriptor.className\"\n [dropdownClassName]=\"lookupDescriptor.dropdownClassName\"\n [showClear]=\"true\"\n (valueChange)=\"filterCallback($event)\">\n </mng-dropdown>\n </ng-container>\n </ng-template>\n</p-columnFilter>\n" }]
4498
4782
  }], ctorParameters: function () { return [{ type: i2$1.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
4499
4783
  type: Input
4500
4784
  }], display: [{
@@ -4561,6 +4845,7 @@ class MngTableColumnValueComponent {
4561
4845
  this.columnTypeNumber = ColumnDescriptor.TypeEnum.Number;
4562
4846
  this.columnTypeBoolean = ColumnDescriptor.TypeEnum.Boolean;
4563
4847
  this.columnTypeDate = ColumnDescriptor.TypeEnum.Date;
4848
+ this.columnTypeEnum = ColumnDescriptor.TypeEnum.Enum;
4564
4849
  }
4565
4850
  }
4566
4851
  MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -4574,6 +4859,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
4574
4859
  type: Input
4575
4860
  }] } });
4576
4861
 
4862
+ class MngI18nPropertyPipe {
4863
+ transform(property, model) {
4864
+ return I18nUtil.getModelPropertyKey(model, property);
4865
+ }
4866
+ }
4867
+ MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4868
+ MngI18nPropertyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, name: "i18nProperty" });
4869
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, decorators: [{
4870
+ type: Pipe,
4871
+ args: [{
4872
+ name: 'i18nProperty',
4873
+ pure: true
4874
+ }]
4875
+ }] });
4876
+
4577
4877
  var TypeEnum = FilterDescriptor.TypeEnum;
4578
4878
  var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
4579
4879
  class MngTableComponent {
@@ -4827,10 +5127,10 @@ class MngTableComponent {
4827
5127
  }
4828
5128
  }
4829
5129
  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: i2$2.TranslateService }, { token: TableviewComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
4830
- 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", selectionEnabled: "selectionEnabled" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, 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 sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else defaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #defaultCaption>\n <h5 class=\"p-m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr>\n <th *ngIf=\"selectionEnabled\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </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 {{ descriptor.model.typeName + '.properties.' + col.property | 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 {{ descriptor.model.typeName + '.properties.' + col.property | 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\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\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\"></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\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate\" class=\"text-right\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\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 ? 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 ? 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$4.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$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5130
+ 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", selectionEnabled: "selectionEnabled" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, 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 sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else defaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #defaultCaption>\n <h5 class=\"p-m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </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.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.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\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\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\"></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\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate\" class=\"text-right\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\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 ? 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 ? 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$4.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$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4831
5131
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
4832
5132
  type: Component,
4833
- 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 sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else defaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #defaultCaption>\n <h5 class=\"p-m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr>\n <th *ngIf=\"selectionEnabled\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </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 {{ descriptor.model.typeName + '.properties.' + col.property | 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 {{ descriptor.model.typeName + '.properties.' + col.property | 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\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\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\"></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\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate\" class=\"text-right\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\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 ? 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 ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
5133
+ 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 sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else defaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #defaultCaption>\n <h5 class=\"p-m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </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.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.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\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\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\"></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\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" class=\"clickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate\" class=\"text-right\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\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 ? 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 ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
4834
5134
  }], ctorParameters: function () {
4835
5135
  return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: TableviewComponentService, decorators: [{
4836
5136
  type: Optional
@@ -5075,10 +5375,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5075
5375
  class MngFormlyFieldTabsComponent extends FieldType {
5076
5376
  }
5077
5377
  MngFormlyFieldTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
5078
- MngFormlyFieldTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTabsComponent, selector: "mng-formly-field-tabs", usesInheritance: true, ngImport: i0, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label!\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n", components: [{ type: i1$4.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i1$4.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: i3.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5378
+ MngFormlyFieldTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTabsComponent, selector: "mng-formly-field-tabs", usesInheritance: true, ngImport: i0, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label! | translate\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n", components: [{ type: i1$4.TabView, selector: "p-tabView", inputs: ["orientation", "style", "styleClass", "controlClose", "scrollable", "activeIndex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { type: i1$4.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { type: i3.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i2$2.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
5079
5379
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, decorators: [{
5080
5380
  type: Component,
5081
- args: [{ selector: 'mng-formly-field-tabs', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label!\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n" }]
5381
+ args: [{ selector: 'mng-formly-field-tabs', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-tabView>\n <p-tabPanel\n *ngFor=\"let tab of field.fieldGroup; let i = index; let last = last\"\n [header]=\"tab.templateOptions?.label! | translate\"\n [headerStyleClass]=\"$any(formControl!.valid ? 'p-tabview-title' : null)\">\n <ng-template pTemplate=\"header\">\n <span\n class=\"p-tabview-title\"\n [class.p-tabview-title-error]=\"formState.submittedOn && formState['tab_' + (tab.id ? tab.id : tab.templateOptions?.label!) + '_invalid']\"\n >{{ tab.templateOptions?.label! | translate }}</span\n >\n </ng-template>\n <formly-field [field]=\"tab\"></formly-field>\n </p-tabPanel>\n</p-tabView>\n" }]
5082
5382
  }] });
5083
5383
 
5084
5384
  class MngFormlyFieldFieldsetComponent extends FieldType {
@@ -5322,8 +5622,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5322
5622
  }], ctorParameters: function () { return [{ type: MngCommonsService }]; } });
5323
5623
 
5324
5624
  class MngMenuItemComponent {
5325
- constructor(router, mngCommons, mainLayoutService) {
5625
+ constructor(injector, router, route, mngCommons, mainLayoutService) {
5626
+ this.injector = injector;
5326
5627
  this.router = router;
5628
+ this.route = route;
5327
5629
  this.mngCommons = mngCommons;
5328
5630
  this.mainLayoutService = mainLayoutService;
5329
5631
  this.index = 0;
@@ -5332,6 +5634,8 @@ class MngMenuItemComponent {
5332
5634
  this.key = '';
5333
5635
  this.active = false;
5334
5636
  this.hover = false;
5637
+ this.isAllowedSubject = new BehaviorSubject(true);
5638
+ this.isAllowed$ = this.isAllowedSubject.asObservable().pipe(distinctUntilChanged());
5335
5639
  }
5336
5640
  ngOnInit() {
5337
5641
  if (!this.mngCommons.menuModeIsSlim && this.item.routerLink) {
@@ -5355,14 +5659,20 @@ class MngMenuItemComponent {
5355
5659
  this.menuResetSubscription = this.mngCommons.menuReset$.subscribe(() => {
5356
5660
  this.active = false;
5357
5661
  });
5358
- this.routerEventsSubscription = this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
5359
- if (this.mngCommons.menuModeIsSlim && !this.mainLayoutService.isMobile()) {
5360
- this.active = false;
5662
+ this.routerEventsSubscription = this.router.events.subscribe(next => {
5663
+ if (next instanceof GuardsCheckEnd && next.shouldActivate) {
5664
+ this.checkIfMenuItemIsAllowedFromGuard(next.state);
5361
5665
  }
5362
- else {
5363
- this.updateActiveStateFromRoute();
5666
+ else if (next instanceof NavigationEnd) {
5667
+ if (this.mngCommons.menuModeIsSlim && !this.mainLayoutService.isMobile()) {
5668
+ this.active = false;
5669
+ }
5670
+ else {
5671
+ this.updateActiveStateFromRoute();
5672
+ }
5364
5673
  }
5365
5674
  });
5675
+ this.checkIfMenuItemIsAllowedFromGuard(this.router.routerState.snapshot);
5366
5676
  }
5367
5677
  updateActiveStateFromRoute() {
5368
5678
  if (this.itemUrl) {
@@ -5384,10 +5694,6 @@ class MngMenuItemComponent {
5384
5694
  }
5385
5695
  // notify other items
5386
5696
  this.mngCommons.menuChangeActiveKey(this.key);
5387
- // execute command
5388
- if (this.item.command) {
5389
- this.item.command({ originalEvent: event, item: this.item });
5390
- }
5391
5697
  // toggle active state
5392
5698
  if (this.item.items) {
5393
5699
  this.active = !this.active;
@@ -5416,14 +5722,50 @@ class MngMenuItemComponent {
5416
5722
  }
5417
5723
  }
5418
5724
  ngOnDestroy() {
5419
- var _a, _b, _c;
5725
+ var _a, _b, _c, _d;
5420
5726
  (_a = this.menuSourceSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
5421
5727
  (_b = this.menuResetSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
5422
5728
  (_c = this.routerEventsSubscription) === null || _c === void 0 ? void 0 : _c.unsubscribe();
5729
+ (_d = this.guardsSubscription) === null || _d === void 0 ? void 0 : _d.unsubscribe();
5730
+ }
5731
+ checkIfMenuItemIsAllowedFromGuard(routerState) {
5732
+ var _a, _b;
5733
+ (_a = this.guardsSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
5734
+ if ((_b = this.item.guards) === null || _b === void 0 ? void 0 : _b.length) {
5735
+ const obs = [];
5736
+ for (const guard of this.item.guards) {
5737
+ const tokenInjectedInstance = this.injector.get(guard);
5738
+ if (tokenInjectedInstance && 'canActivate' in tokenInjectedInstance) {
5739
+ const guardInstance = tokenInjectedInstance;
5740
+ const canActivateRes = guardInstance.canActivate(this.route.snapshot, routerState);
5741
+ let canActivateObs;
5742
+ if (canActivateRes instanceof Observable) {
5743
+ canActivateObs = canActivateRes;
5744
+ }
5745
+ else if (canActivateRes instanceof Promise) {
5746
+ canActivateObs = from(canActivateRes);
5747
+ }
5748
+ else {
5749
+ canActivateObs = of(canActivateRes);
5750
+ }
5751
+ obs.push(canActivateObs.pipe(first(), map(res => res === true) // if url tree is present, that means redirect and implies not allowed
5752
+ ));
5753
+ }
5754
+ }
5755
+ this.guardsSubscription = combineLatest(obs)
5756
+ .pipe(first())
5757
+ .subscribe(next => {
5758
+ const result = next.every(n => n === true);
5759
+ this.isAllowedSubject.next(result);
5760
+ });
5761
+ }
5762
+ else {
5763
+ this.isAllowedSubject.next(true);
5764
+ }
5423
5765
  }
5424
5766
  }
5425
- MngMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuItemComponent, deps: [{ token: i1.Router }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5426
- MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false\" class=\"layout-menuitem-root-text\">{{ item.label | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false\"\n [attr.href]=\"item.url\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClass\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i2$2.TranslatePipe, "async": i4$1.AsyncPipe }, animations: [
5767
+ MngMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMenuItemComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
5768
+ MngMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "root", "class.active-menuitem": "active" } }, ngImport: i0, template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n", components: [{ type: MngMenuItemComponent, selector: "[mng-menuitem]", inputs: ["item", "index", "root", "parentKey"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Ripple, selector: "[pRipple]" }, { type: i4$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4$1.AsyncPipe, "translate": i2$2.TranslatePipe }, animations: [
5427
5769
  trigger('children', [
5428
5770
  state('void', style({
5429
5771
  height: '0px'
@@ -5475,8 +5817,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5475
5817
  transition('hiddenAnimated => visibleAnimated', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')),
5476
5818
  transition('void => visibleAnimated, visibleAnimated => void', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
5477
5819
  ])
5478
- ], template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false\" class=\"layout-menuitem-root-text\">{{ item.label | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false\"\n [attr.href]=\"item.url\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.class\"\n pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClass\"></li>\n </ng-template>\n </ul>\n</ng-container>\n" }]
5479
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: MngCommonsService }, { type: MngMainLayoutComponentService }]; }, propDecorators: { item: [{
5820
+ ], template: "<ng-container>\n <div *ngIf=\"root && item.visible !== false && (isAllowed$ | async) === true\" class=\"layout-menuitem-root-text\">{{ item.label! | translate }}</div>\n <a\n *ngIf=\"(!item.routerLink || item.items) && item.visible !== false && (isAllowed$ | async) === true\"\n [attr.href]=\"item.href\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (keydown.enter)=\"itemClick($event)\"\n [routerLink]=\"item.routerLink\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <a\n *ngIf=\"item.routerLink && !item.items && item.visible !== false && (isAllowed$ | async) === true\"\n (click)=\"itemClick($event)\"\n (mouseenter)=\"hover = true\"\n (mouseleave)=\"hover = false\"\n [routerLink]=\"item.routerLink\"\n routerLinkActive=\"active-menuitem-routerlink\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [attr.target]=\"item.target\"\n [attr.tabindex]=\"0\"\n [ngClass]=\"item.className ?? ''\"\n pRipple>\n <i [ngClass]=\"item.icon ?? ''\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{ item.label! | translate }}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n <span class=\"menuitem-badge\" *ngIf=\"item.badge\">{{ item.badge }}</span>\n </a>\n <ul\n *ngIf=\"((item.items && active) || (item.items && (mngCommons.menuModeIsStatic$ | async) && (root || active))) && item.visible !== false && (isAllowed$ | async) === true\"\n [@children]=\"\n (mngCommons.menuModeIsSlim$ | async) && (mainLayoutService.isMobile$ | async) === false && root\n ? active\n ? 'visible'\n : 'hidden'\n : (mngCommons.menuModeIsStatic$ | async) && root && (mainLayoutService.isMobile$ | async) === false\n ? 'visible'\n : active\n ? 'visibleAnimated'\n : 'hiddenAnimated'\n \">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li mng-menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeClassName\"></li>\n </ng-template>\n </ul>\n</ng-container>\n" }]
5821
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: MngCommonsService }, { type: MngMainLayoutComponentService }]; }, propDecorators: { item: [{
5480
5822
  type: Input
5481
5823
  }], index: [{
5482
5824
  type: Input
@@ -5647,7 +5989,7 @@ class MngTableviewComponent {
5647
5989
  }
5648
5990
  }
5649
5991
  MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2$1.MessageService }, { token: i2$2.TranslateService }, { token: i2.DialogService }, { token: i2$1.ConfirmationService }, { token: MngActionService }, { token: TableviewComponentService }], target: i0.ɵɵFactoryTarget.Component });
5650
- 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, TableviewComponentService], 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 [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-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: i7$1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i8$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionEnabled"], outputs: ["tableLoad", "cellClick", "selectionChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.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": i2$2.TranslatePipe } });
5992
+ 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, TableviewComponentService], 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 [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-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: i7$1.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i8$1.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionEnabled"], outputs: ["tableLoad", "cellClick", "selectionChange"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4$1.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": i2$2.TranslatePipe } });
5651
5993
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
5652
5994
  type: Component,
5653
5995
  args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, TableviewComponentService], 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 [descriptor]=\"descriptor.table\" [dataProvider]=\"dataProvider\" [useQueryParams]=\"true\" (cellClick)=\"onTableCellClick($event)\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-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" }]
@@ -5712,6 +6054,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
5712
6054
  args: [{ selector: 'mng-tableview-route', template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n" }]
5713
6055
  }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
5714
6056
 
6057
+ class MngEnumPipe {
6058
+ transform(value, enumObj, i18nPath, nameAsValue = false) {
6059
+ const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
6060
+ if (typeof i18nPath === 'undefined') {
6061
+ i18nPath = TypeUtil.findEnumName(enumObj);
6062
+ }
6063
+ return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
6064
+ }
6065
+ }
6066
+ MngEnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
6067
+ MngEnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, name: "enum" });
6068
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, decorators: [{
6069
+ type: Pipe,
6070
+ args: [{
6071
+ name: 'enum',
6072
+ pure: true
6073
+ }]
6074
+ }] });
6075
+
5715
6076
  function mngCommonsInitializerProvider(mngCommons) {
5716
6077
  return () => mngCommons.initialize();
5717
6078
  }
@@ -5801,6 +6162,15 @@ const formlyTypesConfig = [
5801
6162
  }
5802
6163
  }
5803
6164
  },
6165
+ {
6166
+ name: 'mask',
6167
+ extends: 'input',
6168
+ defaultOptions: {
6169
+ templateOptions: {
6170
+ type: 'mask'
6171
+ }
6172
+ }
6173
+ },
5804
6174
  {
5805
6175
  name: 'dropdown',
5806
6176
  component: MngFormlyFieldDropdownComponent,
@@ -5957,7 +6327,9 @@ const declarations = [
5957
6327
  MngTemplateDirective,
5958
6328
  // pipes
5959
6329
  MngPropertyPathPipe,
6330
+ MngEnumPipe,
5960
6331
  MngBooleanPipe,
6332
+ MngI18nPropertyPipe,
5961
6333
  // layout components
5962
6334
  MngBreadcrumbComponent,
5963
6335
  MngFooterComponent,
@@ -6048,7 +6420,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6048
6420
  MngTemplateDirective,
6049
6421
  // pipes
6050
6422
  MngPropertyPathPipe,
6423
+ MngEnumPipe,
6051
6424
  MngBooleanPipe,
6425
+ MngI18nPropertyPipe,
6052
6426
  // layout components
6053
6427
  MngBreadcrumbComponent,
6054
6428
  MngFooterComponent,
@@ -6159,7 +6533,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
6159
6533
  MngTemplateDirective,
6160
6534
  // pipes
6161
6535
  MngPropertyPathPipe,
6536
+ MngEnumPipe,
6162
6537
  MngBooleanPipe,
6538
+ MngI18nPropertyPipe,
6163
6539
  // layout components
6164
6540
  MngBreadcrumbComponent,
6165
6541
  MngFooterComponent,
@@ -6378,8 +6754,12 @@ class RoutesBuilder {
6378
6754
  addRouteRedirect(path, redirectTo, pathMatch = 'prefix') {
6379
6755
  return this.addRouteBuilder(RouteBuilder.createRedirect(path, redirectTo, pathMatch));
6380
6756
  }
6381
- addLazyRoute(path, loadChildren) {
6382
- return this.addRouteBuilder(RouteBuilder.createFromRoute({ path: path, loadChildren: loadChildren }));
6757
+ addLazyRoute(path, loadChildren, canLoad) {
6758
+ const route = { path: path, loadChildren: loadChildren };
6759
+ if (canLoad === null || canLoad === void 0 ? void 0 : canLoad.length) {
6760
+ route.canLoad = canLoad;
6761
+ }
6762
+ return this.addRouteBuilder(RouteBuilder.createFromRoute(route));
6383
6763
  }
6384
6764
  addRoute(path, component) {
6385
6765
  return this.addRouteBuilder(RouteBuilder.create(path, component));
@@ -6520,11 +6900,32 @@ class RouteBuilder {
6520
6900
  this.withBreadcrumb(title);
6521
6901
  return this;
6522
6902
  }
6903
+ withCanActivate(diToken) {
6904
+ if (!this.route.canActivate) {
6905
+ this.route.canActivate = [];
6906
+ }
6907
+ this.route.canActivate.push(diToken);
6908
+ return this;
6909
+ }
6910
+ withCanDeactivate(diToken) {
6911
+ if (!this.route.canDeactivate) {
6912
+ this.route.canDeactivate = [];
6913
+ }
6914
+ this.route.canDeactivate.push(diToken);
6915
+ return this;
6916
+ }
6917
+ withResolver(diToken, name) {
6918
+ if (!this.route.resolve) {
6919
+ this.route.resolve = {};
6920
+ }
6921
+ this.route.resolve[name] = diToken;
6922
+ return this;
6923
+ }
6523
6924
  withData(data) {
6524
6925
  this.route.data = data;
6525
6926
  return this;
6526
6927
  }
6527
- withPrimeMenuItem(menuItem) {
6928
+ withMngMenuItem(menuItem) {
6528
6929
  this.menuItem = menuItem;
6529
6930
  return this;
6530
6931
  }
@@ -6595,35 +6996,62 @@ class RouteBuilder {
6595
6996
  }
6596
6997
  }
6597
6998
  }
6999
+ if (this.route.canActivate) {
7000
+ angularRoute.canActivate = [...this.route.canActivate];
7001
+ }
7002
+ if (this.route.canActivateChild) {
7003
+ angularRoute.canActivateChild = [...this.route.canActivateChild];
7004
+ }
7005
+ if (this.route.canLoad) {
7006
+ angularRoute.canLoad = [...this.route.canLoad];
7007
+ }
7008
+ if (this.route.canDeactivate) {
7009
+ angularRoute.canDeactivate = [...this.route.canDeactivate];
7010
+ }
7011
+ if (this.route.resolve) {
7012
+ angularRoute.resolve = Object.assign({}, this.route.resolve);
7013
+ }
6598
7014
  return angularRoute;
6599
7015
  }
6600
7016
  buildMenu() {
6601
7017
  var _a, _b;
6602
- const menuItem = this.menuItem ? Object.assign({}, this.menuItem) : null;
7018
+ const menuItemBuild = this.menuItem ? Object.assign({}, this.menuItem) : null;
6603
7019
  const routeChildrenMenuItems = this.children.flatMap(child => child.buildMenu());
6604
7020
  const menuItemChildren = [];
6605
- const finalMenuItemChildren = [];
6606
- if (menuItem === null || menuItem === void 0 ? void 0 : menuItem.items) {
6607
- finalMenuItemChildren.push(...menuItem.items);
7021
+ const menuItemChildrenBuild = [];
7022
+ if (menuItemBuild === null || menuItemBuild === void 0 ? void 0 : menuItemBuild.items) {
7023
+ menuItemChildrenBuild.push(...menuItemBuild.items);
6608
7024
  }
6609
7025
  for (const menuItemChild of this.menuItemChildren) {
6610
7026
  const finalMenuItemChild = Object.assign({}, menuItemChild);
6611
7027
  if (!finalMenuItemChild.routerLink) {
6612
7028
  finalMenuItemChild.routerLink = this.routePath;
6613
7029
  }
7030
+ if (typeof finalMenuItemChild.routerLink === 'string') {
7031
+ finalMenuItemChild.routerLink = [finalMenuItemChild.routerLink];
7032
+ }
6614
7033
  finalMenuItemChild.routerLink = RouteUtil.removeEmptyPathSegments(finalMenuItemChild.routerLink);
6615
7034
  menuItemChildren.push(finalMenuItemChild);
6616
7035
  }
6617
- finalMenuItemChildren.push(...menuItemChildren, ...routeChildrenMenuItems);
6618
- if (!menuItem) {
6619
- return finalMenuItemChildren;
7036
+ menuItemChildrenBuild.push(...menuItemChildren, ...routeChildrenMenuItems);
7037
+ if (!menuItemBuild) {
7038
+ return menuItemChildrenBuild;
7039
+ }
7040
+ menuItemBuild.label = (_a = menuItemBuild.label) !== null && _a !== void 0 ? _a : this.pageTitle;
7041
+ if (typeof menuItemBuild.routerLink === 'string') {
7042
+ menuItemBuild.routerLink = [menuItemBuild.routerLink];
7043
+ }
7044
+ menuItemBuild.routerLink = RouteUtil.removeEmptyPathSegments((_b = menuItemBuild.routerLink) !== null && _b !== void 0 ? _b : this.routePath);
7045
+ if (menuItemChildrenBuild.length > 0) {
7046
+ menuItemBuild.items = menuItemChildrenBuild;
6620
7047
  }
6621
- menuItem.label = (_a = menuItem.label) !== null && _a !== void 0 ? _a : this.pageTitle;
6622
- menuItem.routerLink = RouteUtil.removeEmptyPathSegments((_b = menuItem.routerLink) !== null && _b !== void 0 ? _b : this.routePath);
6623
- if (finalMenuItemChildren.length > 0) {
6624
- menuItem.items = finalMenuItemChildren;
7048
+ if (!menuItemBuild.guards) {
7049
+ const guards = this.findMenuItemGuards();
7050
+ if (guards.length > 0) {
7051
+ menuItemBuild.guards = guards;
7052
+ }
6625
7053
  }
6626
- return [menuItem];
7054
+ return [menuItemBuild];
6627
7055
  }
6628
7056
  createMenuItem(icon, label, routerLink) {
6629
7057
  const menuItem = {};
@@ -6641,13 +7069,31 @@ class RouteBuilder {
6641
7069
  adjustMenuRouterLinksFromBuilder(menuItems) {
6642
7070
  for (const menuItem of menuItems) {
6643
7071
  if (menuItem.routerLink) {
6644
- menuItem.routerLink = RouteUtil.appendPathToBasePath(this.routePath, menuItem.routerLink);
7072
+ menuItem.routerLink = RouteUtil.appendPathToBasePath(this.routePath, typeof menuItem.routerLink === 'string' ? [menuItem.routerLink] : menuItem.routerLink);
6645
7073
  }
6646
7074
  if (Array.isArray(menuItem.items)) {
6647
7075
  this.adjustMenuRouterLinksFromBuilder(menuItem.items);
6648
7076
  }
6649
7077
  }
6650
7078
  }
7079
+ findMenuItemGuards() {
7080
+ var _a;
7081
+ const guards = [];
7082
+ if ((_a = this.route.canActivate) === null || _a === void 0 ? void 0 : _a.length) {
7083
+ guards.push(...this.route.canActivate);
7084
+ }
7085
+ if (this.parent) {
7086
+ // Check for parent guards that should be included in decision to hide menu item!
7087
+ // Some parent routes might have guards, but no menu items, so this guards must be taken into account here,
7088
+ // because there is no parent menu item to hide.
7089
+ this.parent.findMenuItemGuards().forEach(g => {
7090
+ if (guards.indexOf(g) < 0) {
7091
+ guards.push(g);
7092
+ }
7093
+ });
7094
+ }
7095
+ return guards;
7096
+ }
6651
7097
  }
6652
7098
 
6653
7099
  /*
@@ -6658,5 +7104,5 @@ class RouteBuilder {
6658
7104
  * Generated bundle index. Do not edit.
6659
7105
  */
6660
7106
 
6661
- export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
7107
+ export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngCrudApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusQueryResultBase, MediusQueryResultWithObject, MediusRestUtil, MngActionComponent, MngActionDialogComponent, MngActionRouteComponent, MngActionService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngPropertyPathPipe, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, ModelDescriptor, ModelUtil, ObjectSerializer, RouteBuilder, RoutesBuilder, TableDescriptor, TableviewComponentService, TableviewDataProvider, TableviewDescriptor, ToastUtil, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
6662
7108
  //# sourceMappingURL=mediusinc-mng-commons.mjs.map