@mediusinc/mng-commons 0.2.8 → 0.2.9
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.
- package/README.md +46 -0
- package/assets/i18n/en.json +202 -151
- package/assets/i18n/sl.json +202 -151
- package/esm2020/lib/api/utils/object-serializer.util.mjs +12 -7
- package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +2 -2
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +1 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
- package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +5 -4
- package/esm2020/lib/components/tableview/tableview.component.mjs +1 -1
- package/esm2020/lib/data-providers/base.data-provider.mjs +1 -8
- package/esm2020/lib/descriptors/editor.descriptor.mjs +87 -66
- package/esm2020/lib/descriptors/table.descriptor.mjs +51 -42
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +6 -6
- package/esm2020/lib/mng-commons.module.mjs +5 -2
- package/esm2020/lib/models/enum.model.mjs +2 -0
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/pipes/i18n-property.pipe.mjs +18 -0
- package/esm2020/lib/pipes/index.mjs +2 -1
- package/esm2020/lib/types/type.decorator.mjs +7 -1
- package/esm2020/lib/types/type.model.mjs +1 -1
- package/esm2020/lib/utils/editor-formly.util.mjs +4 -1
- package/esm2020/lib/utils/enum.util.mjs +61 -0
- package/esm2020/lib/utils/i18n.util.mjs +38 -26
- package/esm2020/lib/utils/index.mjs +2 -1
- package/esm2020/lib/utils/type.util.mjs +39 -2
- package/fesm2015/mediusinc-mng-commons.mjs +321 -154
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +320 -154
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/object-serializer.util.d.ts +1 -0
- package/lib/data-providers/base.data-provider.d.ts +0 -3
- package/lib/descriptors/editor.descriptor.d.ts +32 -27
- package/lib/descriptors/table.descriptor.d.ts +15 -12
- package/lib/descriptors/tableview.descriptor.d.ts +8 -8
- package/lib/mng-commons.module.d.ts +68 -67
- package/lib/models/enum.model.d.ts +5 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/pipes/i18n-property.pipe.d.ts +8 -0
- package/lib/pipes/index.d.ts +1 -0
- package/lib/types/type.decorator.d.ts +2 -0
- package/lib/types/type.model.d.ts +2 -2
- package/lib/utils/enum.util.d.ts +39 -0
- package/lib/utils/i18n.util.d.ts +6 -2
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/type.util.d.ts +22 -1
- package/package.json +2 -2
- package/scss/mng-overrides/_layout_forms.scss +5 -0
|
@@ -416,17 +416,10 @@ class DataProvider {
|
|
|
416
416
|
get modelType() {
|
|
417
417
|
return this._modelType;
|
|
418
418
|
}
|
|
419
|
-
get enumName() {
|
|
420
|
-
return this._enumName;
|
|
421
|
-
}
|
|
422
419
|
withServiceType(type) {
|
|
423
420
|
this._serviceType = type;
|
|
424
421
|
return this;
|
|
425
422
|
}
|
|
426
|
-
withEnumName(enumName) {
|
|
427
|
-
this._enumName = enumName;
|
|
428
|
-
return this;
|
|
429
|
-
}
|
|
430
423
|
}
|
|
431
424
|
|
|
432
425
|
class EditorDataProvider extends DataProvider {
|
|
@@ -755,29 +748,33 @@ class EditorDescriptor {
|
|
|
755
748
|
this._disabled = false;
|
|
756
749
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
757
750
|
}
|
|
751
|
+
get disabled() {
|
|
752
|
+
return this._disabled;
|
|
753
|
+
}
|
|
758
754
|
get model() {
|
|
759
755
|
return this._model;
|
|
760
756
|
}
|
|
761
757
|
get tabs() {
|
|
762
758
|
return this._tabs;
|
|
763
759
|
}
|
|
764
|
-
get disabled() {
|
|
765
|
-
return this._disabled;
|
|
766
|
-
}
|
|
767
760
|
get fields() {
|
|
768
761
|
return this._fields;
|
|
769
762
|
}
|
|
770
763
|
createTabGroup(name, title) {
|
|
771
764
|
const tabGroup = new FieldTabGroupDescriptor(this, name);
|
|
772
|
-
if (title) {
|
|
773
|
-
|
|
765
|
+
if (!title) {
|
|
766
|
+
title = I18nUtil.getModelTabKey(this.model, name);
|
|
774
767
|
}
|
|
768
|
+
tabGroup.withTitle(title);
|
|
775
769
|
this.createTabGroupDescriptor(tabGroup);
|
|
776
770
|
return tabGroup;
|
|
777
771
|
}
|
|
778
772
|
createFieldGroup(name, title) {
|
|
779
773
|
const fieldGroup = new FieldGroupDescriptor(this, name);
|
|
780
|
-
if (title) {
|
|
774
|
+
if (title !== null) {
|
|
775
|
+
if (!title) {
|
|
776
|
+
title = I18nUtil.getModelGroupKey(this.model, name);
|
|
777
|
+
}
|
|
781
778
|
fieldGroup.withTitle(title);
|
|
782
779
|
}
|
|
783
780
|
this.createFieldGroupDescriptor(fieldGroup);
|
|
@@ -817,16 +814,8 @@ class EditorDescriptor {
|
|
|
817
814
|
this.addFieldDescriptor(field);
|
|
818
815
|
return field;
|
|
819
816
|
}
|
|
820
|
-
addFieldLookupEnum(property, options) {
|
|
821
|
-
const
|
|
822
|
-
if (!propDef) {
|
|
823
|
-
throw new Error(`Property (attribute) definition not found for property ${property} on class type ${this._model.typeName}`);
|
|
824
|
-
}
|
|
825
|
-
const enumDef = ObjectSerializer.get().findEnum(propDef.type);
|
|
826
|
-
if (!enumDef) {
|
|
827
|
-
throw new Error(`Enum definition ${propDef.type} not found for property ${property} on class type ${this._model.typeName}`);
|
|
828
|
-
}
|
|
829
|
-
const field = new FieldLookupEnumDescriptor(this, property, propDef.type, options);
|
|
817
|
+
addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
818
|
+
const field = new FieldLookupEnumDescriptor(this, property, enumType, options, nameAsValue, optionsTitlePath);
|
|
830
819
|
this.addFieldDescriptor(field);
|
|
831
820
|
return field;
|
|
832
821
|
}
|
|
@@ -865,11 +854,6 @@ class EditorDescriptor {
|
|
|
865
854
|
editor._disabled = this._disabled;
|
|
866
855
|
return editor;
|
|
867
856
|
}
|
|
868
|
-
createTabGroupDescriptor(tabGroup) {
|
|
869
|
-
this._currentTabGroup = tabGroup;
|
|
870
|
-
this._tabs.push(tabGroup);
|
|
871
|
-
return this;
|
|
872
|
-
}
|
|
873
857
|
createFieldGroupDescriptor(fieldGroup) {
|
|
874
858
|
this.createDefaultTabGroup();
|
|
875
859
|
this._currentGroup = fieldGroup;
|
|
@@ -877,15 +861,20 @@ class EditorDescriptor {
|
|
|
877
861
|
this._currentTabGroup?.addField(fieldGroup);
|
|
878
862
|
return this;
|
|
879
863
|
}
|
|
864
|
+
createTabGroupDescriptor(tabGroup) {
|
|
865
|
+
this._currentTabGroup = tabGroup;
|
|
866
|
+
this._tabs.push(tabGroup);
|
|
867
|
+
return this;
|
|
868
|
+
}
|
|
880
869
|
createDefaultGroup() {
|
|
881
870
|
this.createDefaultTabGroup();
|
|
882
871
|
if (this._currentTabGroup?.fields.length === 0) {
|
|
883
|
-
this.createFieldGroup(EditorDescriptor.defaultGroupName);
|
|
872
|
+
this.createFieldGroup(EditorDescriptor.defaultGroupName, null);
|
|
884
873
|
}
|
|
885
874
|
}
|
|
886
875
|
createDefaultTabGroup() {
|
|
887
876
|
if (this._tabs.length === 0) {
|
|
888
|
-
this.createTabGroup(EditorDescriptor.defaultGroupName);
|
|
877
|
+
this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
|
|
889
878
|
}
|
|
890
879
|
}
|
|
891
880
|
}
|
|
@@ -906,10 +895,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
906
895
|
this._className = '';
|
|
907
896
|
this._validators = [];
|
|
908
897
|
this._property = property;
|
|
909
|
-
this._label = this._editor.model
|
|
910
|
-
}
|
|
911
|
-
get property() {
|
|
912
|
-
return this._property;
|
|
898
|
+
this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
|
|
913
899
|
}
|
|
914
900
|
get group() {
|
|
915
901
|
return this._group;
|
|
@@ -926,6 +912,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
926
912
|
get disabled() {
|
|
927
913
|
return this._disabled;
|
|
928
914
|
}
|
|
915
|
+
get defaultValue() {
|
|
916
|
+
return this._defaultValue;
|
|
917
|
+
}
|
|
929
918
|
get className() {
|
|
930
919
|
return this._className;
|
|
931
920
|
}
|
|
@@ -941,6 +930,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
941
930
|
get disabledFunction() {
|
|
942
931
|
return this._disabledFunction;
|
|
943
932
|
}
|
|
933
|
+
get property() {
|
|
934
|
+
return this._property;
|
|
935
|
+
}
|
|
944
936
|
withLabel(label) {
|
|
945
937
|
this._label = label;
|
|
946
938
|
return this;
|
|
@@ -960,6 +952,10 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
960
952
|
}
|
|
961
953
|
return this;
|
|
962
954
|
}
|
|
955
|
+
withDefaultValue(defaultValue) {
|
|
956
|
+
this._defaultValue = defaultValue;
|
|
957
|
+
return this;
|
|
958
|
+
}
|
|
963
959
|
withClassName(className) {
|
|
964
960
|
this._className = className;
|
|
965
961
|
return this;
|
|
@@ -981,6 +977,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
981
977
|
obj._placeholder = this._placeholder;
|
|
982
978
|
obj._required = this._required;
|
|
983
979
|
obj._disabled = this._disabled;
|
|
980
|
+
obj._defaultValue = this._defaultValue;
|
|
984
981
|
obj._disabledFunction = this._disabledFunction;
|
|
985
982
|
obj._className = this._className;
|
|
986
983
|
obj._getter = this._getter;
|
|
@@ -999,8 +996,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
999
996
|
get fieldType() {
|
|
1000
997
|
return this._fieldType;
|
|
1001
998
|
}
|
|
1002
|
-
get
|
|
1003
|
-
return this.
|
|
999
|
+
get rows() {
|
|
1000
|
+
return this._rows;
|
|
1004
1001
|
}
|
|
1005
1002
|
get numberMin() {
|
|
1006
1003
|
return this._numberMin;
|
|
@@ -1008,8 +1005,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1008
1005
|
get numberMax() {
|
|
1009
1006
|
return this._numberMax;
|
|
1010
1007
|
}
|
|
1011
|
-
get
|
|
1012
|
-
return this.
|
|
1008
|
+
get numberStep() {
|
|
1009
|
+
return this._numberStep;
|
|
1013
1010
|
}
|
|
1014
1011
|
get numberMinFractionDigits() {
|
|
1015
1012
|
return this._numberMinFractionDigits;
|
|
@@ -1072,9 +1069,19 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1072
1069
|
this._fieldType = FieldInputDescriptor.TypeEnum.Switch;
|
|
1073
1070
|
return this;
|
|
1074
1071
|
}
|
|
1075
|
-
asRadio(options) {
|
|
1072
|
+
asRadio(options, optionsTitlePath) {
|
|
1073
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
|
|
1074
|
+
this._radioOptions = options.map(o => ({ value: o, title: `${optionsTitlePath ? `${optionsTitlePath}.` : ''}${o}` }));
|
|
1075
|
+
return this;
|
|
1076
|
+
}
|
|
1077
|
+
asRadioFromEnum(enumType, optionsTitlePath, values, nameAsValue = false) {
|
|
1076
1078
|
this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
|
|
1077
|
-
|
|
1079
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
1080
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1081
|
+
}
|
|
1082
|
+
this._radioOptions = Array.isArray(values)
|
|
1083
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, values, nameAsValue, optionsTitlePath ?? undefined)
|
|
1084
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1078
1085
|
return this;
|
|
1079
1086
|
}
|
|
1080
1087
|
asDatePicker(format, min, max, showTime) {
|
|
@@ -1095,7 +1102,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1095
1102
|
field._numberStep = this._numberStep;
|
|
1096
1103
|
field._numberMinFractionDigits = this._numberMinFractionDigits;
|
|
1097
1104
|
field._numberMaxFractionDigits = this._numberMaxFractionDigits;
|
|
1098
|
-
field._radioOptions = this._radioOptions;
|
|
1105
|
+
field._radioOptions = [...this._radioOptions];
|
|
1099
1106
|
field._datePickerFormat = this._datePickerFormat;
|
|
1100
1107
|
field._datePickerMin = this._datePickerMin;
|
|
1101
1108
|
field._datePickerMax = this._datePickerMax;
|
|
@@ -1124,9 +1131,6 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1124
1131
|
this._modelType = modelType;
|
|
1125
1132
|
ModelUtil.trySetLookupItemsProperties(this);
|
|
1126
1133
|
}
|
|
1127
|
-
get modelType() {
|
|
1128
|
-
return this._modelType;
|
|
1129
|
-
}
|
|
1130
1134
|
get lookupType() {
|
|
1131
1135
|
return this._lookupType;
|
|
1132
1136
|
}
|
|
@@ -1142,6 +1146,9 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1142
1146
|
get dataProvider() {
|
|
1143
1147
|
return this._dataProvider;
|
|
1144
1148
|
}
|
|
1149
|
+
get modelType() {
|
|
1150
|
+
return this._modelType;
|
|
1151
|
+
}
|
|
1145
1152
|
withItemsLabelProperty(itemsLabelProperty) {
|
|
1146
1153
|
this._itemsLabelProperty = itemsLabelProperty;
|
|
1147
1154
|
return this;
|
|
@@ -1190,17 +1197,25 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1190
1197
|
})(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
|
|
1191
1198
|
})(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
|
|
1192
1199
|
class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
1193
|
-
constructor(editor, property,
|
|
1200
|
+
constructor(editor, property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
1194
1201
|
super(editor, property, null);
|
|
1195
|
-
this.
|
|
1196
|
-
|
|
1202
|
+
this._enumType = enumType;
|
|
1203
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
1204
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1205
|
+
}
|
|
1206
|
+
const optionEnumValues = Array.isArray(options)
|
|
1207
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
|
|
1208
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1209
|
+
const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
|
|
1197
1210
|
this.withLookupDataProvider(dataProvider);
|
|
1211
|
+
this.withItemsLabelProperty('title');
|
|
1212
|
+
this.withItemsValueProperty('value');
|
|
1198
1213
|
}
|
|
1199
|
-
get
|
|
1200
|
-
return this.
|
|
1214
|
+
get enumType() {
|
|
1215
|
+
return this._enumType;
|
|
1201
1216
|
}
|
|
1202
1217
|
copy() {
|
|
1203
|
-
const field = new FieldLookupEnumDescriptor(this._editor, this._property, this.
|
|
1218
|
+
const field = new FieldLookupEnumDescriptor(this._editor, this._property, this._enumType, []);
|
|
1204
1219
|
this.copyFieldsTo(field);
|
|
1205
1220
|
field._lookupType = this._lookupType;
|
|
1206
1221
|
field._itemsLabelProperty = this._itemsLabelProperty;
|
|
@@ -1224,11 +1239,8 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1224
1239
|
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
1225
1240
|
this._actions.push(FieldManyToManyEditorDescriptor.ActionEnum.Add, FieldManyToManyEditorDescriptor.ActionEnum.Delete);
|
|
1226
1241
|
}
|
|
1227
|
-
get
|
|
1228
|
-
return this.
|
|
1229
|
-
}
|
|
1230
|
-
get lookupTableDescriptor() {
|
|
1231
|
-
return this._lookupTableDescriptor;
|
|
1242
|
+
get fieldType() {
|
|
1243
|
+
return this._fieldType;
|
|
1232
1244
|
}
|
|
1233
1245
|
get lookupTableDataProvider() {
|
|
1234
1246
|
return this._lookupTableDataProvider;
|
|
@@ -1236,9 +1248,6 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1236
1248
|
get actions() {
|
|
1237
1249
|
return this._actions;
|
|
1238
1250
|
}
|
|
1239
|
-
get fieldType() {
|
|
1240
|
-
return this._fieldType;
|
|
1241
|
-
}
|
|
1242
1251
|
get hasLookupExcludeValues() {
|
|
1243
1252
|
return this._hasLookupExcludeValues;
|
|
1244
1253
|
}
|
|
@@ -1248,6 +1257,12 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1248
1257
|
get excludeValueProperty() {
|
|
1249
1258
|
return this._excludeValueProperty;
|
|
1250
1259
|
}
|
|
1260
|
+
get mainTableDescriptor() {
|
|
1261
|
+
return this._mainTableDescriptor;
|
|
1262
|
+
}
|
|
1263
|
+
get lookupTableDescriptor() {
|
|
1264
|
+
return this._lookupTableDescriptor;
|
|
1265
|
+
}
|
|
1251
1266
|
withLookup(getAll, serviceType) {
|
|
1252
1267
|
const dataProvider = new TableviewDataProvider(this._model.type);
|
|
1253
1268
|
if (serviceType) {
|
|
@@ -1303,6 +1318,12 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1303
1318
|
this._tableviewDescriptor = tableviewDescriptor;
|
|
1304
1319
|
this._actions.push(FieldManyEditorDescriptor.ActionEnum.Add, FieldManyEditorDescriptor.ActionEnum.Edit, FieldManyEditorDescriptor.ActionEnum.Delete);
|
|
1305
1320
|
}
|
|
1321
|
+
get fieldType() {
|
|
1322
|
+
return this._fieldType;
|
|
1323
|
+
}
|
|
1324
|
+
get actions() {
|
|
1325
|
+
return this._actions;
|
|
1326
|
+
}
|
|
1306
1327
|
get tableviewDescriptor() {
|
|
1307
1328
|
return this._tableviewDescriptor;
|
|
1308
1329
|
}
|
|
@@ -1318,12 +1339,6 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1318
1339
|
get editorForUpdate() {
|
|
1319
1340
|
return this._tableviewDescriptor.editEditor;
|
|
1320
1341
|
}
|
|
1321
|
-
get fieldType() {
|
|
1322
|
-
return this._fieldType;
|
|
1323
|
-
}
|
|
1324
|
-
get actions() {
|
|
1325
|
-
return this._actions;
|
|
1326
|
-
}
|
|
1327
1342
|
withActions(actions = []) {
|
|
1328
1343
|
this.actions.push(...actions);
|
|
1329
1344
|
return this;
|
|
@@ -1356,6 +1371,12 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
|
1356
1371
|
this._name = `${this.baseName}${name}`;
|
|
1357
1372
|
this._default = name === EditorDescriptor.defaultGroupName;
|
|
1358
1373
|
}
|
|
1374
|
+
get title() {
|
|
1375
|
+
return this._title;
|
|
1376
|
+
}
|
|
1377
|
+
get validators() {
|
|
1378
|
+
return this._validators;
|
|
1379
|
+
}
|
|
1359
1380
|
get baseName() {
|
|
1360
1381
|
return `${this.groupName()}_`;
|
|
1361
1382
|
}
|
|
@@ -1365,12 +1386,6 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
|
1365
1386
|
get default() {
|
|
1366
1387
|
return this._default;
|
|
1367
1388
|
}
|
|
1368
|
-
get title() {
|
|
1369
|
-
return this._title;
|
|
1370
|
-
}
|
|
1371
|
-
get validators() {
|
|
1372
|
-
return this._validators;
|
|
1373
|
-
}
|
|
1374
1389
|
withTitle(title) {
|
|
1375
1390
|
this._title = title;
|
|
1376
1391
|
return this;
|
|
@@ -1482,6 +1497,7 @@ class TableDescriptor {
|
|
|
1482
1497
|
this._filterDisplay = TableDescriptor.FilterDisplayEnum.Menu;
|
|
1483
1498
|
this._paginationMode = TableDescriptor.PaginationModeEnum.Pagination;
|
|
1484
1499
|
this._columns = [];
|
|
1500
|
+
this._hideHeader = false;
|
|
1485
1501
|
this._hasDefaultSort = false;
|
|
1486
1502
|
this._defaultSortProperty = [];
|
|
1487
1503
|
this._defaultSortAsc = [];
|
|
@@ -1489,9 +1505,6 @@ class TableDescriptor {
|
|
|
1489
1505
|
this._tableFullHeightOffset = 315;
|
|
1490
1506
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
1491
1507
|
}
|
|
1492
|
-
get model() {
|
|
1493
|
-
return this._model;
|
|
1494
|
-
}
|
|
1495
1508
|
get filterDisplay() {
|
|
1496
1509
|
return this._filterDisplay;
|
|
1497
1510
|
}
|
|
@@ -1504,6 +1517,9 @@ class TableDescriptor {
|
|
|
1504
1517
|
get title() {
|
|
1505
1518
|
return this._title;
|
|
1506
1519
|
}
|
|
1520
|
+
get hideHeader() {
|
|
1521
|
+
return this._hideHeader;
|
|
1522
|
+
}
|
|
1507
1523
|
get dataKeyProperty() {
|
|
1508
1524
|
return this._dataKeyProperty;
|
|
1509
1525
|
}
|
|
@@ -1522,6 +1538,9 @@ class TableDescriptor {
|
|
|
1522
1538
|
get tableFullHeightOffset() {
|
|
1523
1539
|
return this._tableFullHeightOffset;
|
|
1524
1540
|
}
|
|
1541
|
+
get model() {
|
|
1542
|
+
return this._model;
|
|
1543
|
+
}
|
|
1525
1544
|
addColumnDescriptor(column) {
|
|
1526
1545
|
this._columns.push(column);
|
|
1527
1546
|
this.setDataKeyFromColumn();
|
|
@@ -1574,6 +1593,10 @@ class TableDescriptor {
|
|
|
1574
1593
|
this._title = title;
|
|
1575
1594
|
return this;
|
|
1576
1595
|
}
|
|
1596
|
+
withHideHeader(hideHeader = true) {
|
|
1597
|
+
this._hideHeader = hideHeader;
|
|
1598
|
+
return this;
|
|
1599
|
+
}
|
|
1577
1600
|
withDataKeyProperty(property) {
|
|
1578
1601
|
this._dataKeyProperty = property;
|
|
1579
1602
|
return this;
|
|
@@ -1592,21 +1615,22 @@ class TableDescriptor {
|
|
|
1592
1615
|
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
1593
1616
|
return this;
|
|
1594
1617
|
}
|
|
1595
|
-
setDataKeyFromColumn() {
|
|
1596
|
-
if (!this._dataKeyProperty && this._columns.length === 1) {
|
|
1597
|
-
this._dataKeyProperty = this._columns[0].property;
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
1618
|
copy() {
|
|
1601
1619
|
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
1602
1620
|
descriptor._columns = this.columns.map(c => c.copy());
|
|
1603
1621
|
descriptor._title = this._title;
|
|
1622
|
+
descriptor._hideHeader = this._hideHeader;
|
|
1604
1623
|
descriptor._dataKeyProperty = this._dataKeyProperty;
|
|
1605
1624
|
descriptor._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
1606
1625
|
descriptor._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
1607
1626
|
descriptor._filterDisplay = this._filterDisplay;
|
|
1608
1627
|
return descriptor;
|
|
1609
1628
|
}
|
|
1629
|
+
setDataKeyFromColumn() {
|
|
1630
|
+
if (!this._dataKeyProperty && this._columns.length === 1) {
|
|
1631
|
+
this._dataKeyProperty = this._columns[0].property;
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1610
1634
|
}
|
|
1611
1635
|
(function (TableDescriptor) {
|
|
1612
1636
|
let PaginationModeEnum;
|
|
@@ -1628,33 +1652,33 @@ class ColumnDescriptor {
|
|
|
1628
1652
|
this._table = table;
|
|
1629
1653
|
this._property = property;
|
|
1630
1654
|
}
|
|
1631
|
-
get table() {
|
|
1632
|
-
return this._table;
|
|
1633
|
-
}
|
|
1634
|
-
get property() {
|
|
1635
|
-
return this._property;
|
|
1636
|
-
}
|
|
1637
1655
|
get modelType() {
|
|
1638
1656
|
return this._modelType;
|
|
1639
1657
|
}
|
|
1640
|
-
get
|
|
1641
|
-
return this.
|
|
1658
|
+
get columnType() {
|
|
1659
|
+
return this._columnType;
|
|
1642
1660
|
}
|
|
1643
1661
|
get title() {
|
|
1644
1662
|
return this._title;
|
|
1645
1663
|
}
|
|
1664
|
+
get displayPropertyPath() {
|
|
1665
|
+
return this._displayPropertyPath;
|
|
1666
|
+
}
|
|
1646
1667
|
get isSortEnabled() {
|
|
1647
1668
|
return this._isSortEnabled;
|
|
1648
1669
|
}
|
|
1649
|
-
get columnType() {
|
|
1650
|
-
return this._columnType;
|
|
1651
|
-
}
|
|
1652
1670
|
get filterDescriptor() {
|
|
1653
1671
|
return this._filterDescriptor;
|
|
1654
1672
|
}
|
|
1655
1673
|
get displayFormat() {
|
|
1656
1674
|
return this._displayFormat;
|
|
1657
1675
|
}
|
|
1676
|
+
get table() {
|
|
1677
|
+
return this._table;
|
|
1678
|
+
}
|
|
1679
|
+
get property() {
|
|
1680
|
+
return this._property;
|
|
1681
|
+
}
|
|
1658
1682
|
asType(type = ColumnDescriptor.TypeEnum.String) {
|
|
1659
1683
|
this._columnType = type;
|
|
1660
1684
|
return this;
|
|
@@ -1725,9 +1749,6 @@ class FilterDescriptor {
|
|
|
1725
1749
|
this._className = '';
|
|
1726
1750
|
this._property = property;
|
|
1727
1751
|
}
|
|
1728
|
-
get property() {
|
|
1729
|
-
return this._property;
|
|
1730
|
-
}
|
|
1731
1752
|
get filterType() {
|
|
1732
1753
|
return this._filterType;
|
|
1733
1754
|
}
|
|
@@ -1743,6 +1764,9 @@ class FilterDescriptor {
|
|
|
1743
1764
|
get className() {
|
|
1744
1765
|
return this._className;
|
|
1745
1766
|
}
|
|
1767
|
+
get property() {
|
|
1768
|
+
return this._property;
|
|
1769
|
+
}
|
|
1746
1770
|
asFilterType(filterType) {
|
|
1747
1771
|
this._filterType = filterType;
|
|
1748
1772
|
return this;
|
|
@@ -1767,17 +1791,17 @@ class FilterDescriptor {
|
|
|
1767
1791
|
this._matchModes = matchModes;
|
|
1768
1792
|
return this;
|
|
1769
1793
|
}
|
|
1794
|
+
copy() {
|
|
1795
|
+
const descriptor = new FilterDescriptor(this._property);
|
|
1796
|
+
this.copyFieldsTo(descriptor);
|
|
1797
|
+
return descriptor;
|
|
1798
|
+
}
|
|
1770
1799
|
copyFieldsTo(descriptor) {
|
|
1771
1800
|
descriptor._filterType = this._filterType;
|
|
1772
1801
|
descriptor._filterProperty = this._filterProperty;
|
|
1773
1802
|
descriptor._placeholder = this._placeholder;
|
|
1774
1803
|
descriptor._className = this._className;
|
|
1775
1804
|
}
|
|
1776
|
-
copy() {
|
|
1777
|
-
const descriptor = new FilterDescriptor(this._property);
|
|
1778
|
-
this.copyFieldsTo(descriptor);
|
|
1779
|
-
return descriptor;
|
|
1780
|
-
}
|
|
1781
1805
|
}
|
|
1782
1806
|
(function (FilterDescriptor) {
|
|
1783
1807
|
let TypeEnum;
|
|
@@ -1818,12 +1842,12 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1818
1842
|
this._filterType = FilterDescriptor.TypeEnum.Lookup;
|
|
1819
1843
|
ModelUtil.trySetLookupItemsProperties(this);
|
|
1820
1844
|
}
|
|
1821
|
-
get modelType() {
|
|
1822
|
-
return this._modelType;
|
|
1823
|
-
}
|
|
1824
1845
|
get lookupType() {
|
|
1825
1846
|
return this._lookupType;
|
|
1826
1847
|
}
|
|
1848
|
+
get dataProvider() {
|
|
1849
|
+
return this._dataProvider;
|
|
1850
|
+
}
|
|
1827
1851
|
get itemsLabelProperty() {
|
|
1828
1852
|
return this._itemsLabelProperty;
|
|
1829
1853
|
}
|
|
@@ -1833,12 +1857,15 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1833
1857
|
get dataKeyProperty() {
|
|
1834
1858
|
return this._dataKeyProperty;
|
|
1835
1859
|
}
|
|
1836
|
-
get dataProvider() {
|
|
1837
|
-
return this._dataProvider;
|
|
1838
|
-
}
|
|
1839
1860
|
get multiselect() {
|
|
1840
1861
|
return this._multiselect;
|
|
1841
1862
|
}
|
|
1863
|
+
get dropdownClassName() {
|
|
1864
|
+
return this._dropdownClassName;
|
|
1865
|
+
}
|
|
1866
|
+
get modelType() {
|
|
1867
|
+
return this._modelType;
|
|
1868
|
+
}
|
|
1842
1869
|
withItemsLabelProperty(itemsLabelProperty) {
|
|
1843
1870
|
this._itemsLabelProperty = itemsLabelProperty;
|
|
1844
1871
|
return this;
|
|
@@ -1851,9 +1878,6 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1851
1878
|
this._dataKeyProperty = dataKeyProperty;
|
|
1852
1879
|
return this;
|
|
1853
1880
|
}
|
|
1854
|
-
get dropdownClassName() {
|
|
1855
|
-
return this._dropdownClassName;
|
|
1856
|
-
}
|
|
1857
1881
|
withLookup(lookup, serviceType) {
|
|
1858
1882
|
const dataProvider = new LookupDataProvider(this._modelType);
|
|
1859
1883
|
if (serviceType) {
|
|
@@ -1879,6 +1903,11 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1879
1903
|
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Autocomplete;
|
|
1880
1904
|
return this;
|
|
1881
1905
|
}
|
|
1906
|
+
copy() {
|
|
1907
|
+
const descriptor = new FilterLookupDescriptor(this._property, this._modelType);
|
|
1908
|
+
this.copyFieldsTo(descriptor);
|
|
1909
|
+
return descriptor;
|
|
1910
|
+
}
|
|
1882
1911
|
copyFieldsTo(descriptor) {
|
|
1883
1912
|
super.copyFieldsTo(descriptor);
|
|
1884
1913
|
descriptor._dataProvider = this._dataProvider;
|
|
@@ -1887,11 +1916,6 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1887
1916
|
descriptor._itemsValueProperty = this._itemsValueProperty;
|
|
1888
1917
|
descriptor._dataKeyProperty = this._dataKeyProperty;
|
|
1889
1918
|
}
|
|
1890
|
-
copy() {
|
|
1891
|
-
const descriptor = new FilterLookupDescriptor(this._property, this._modelType);
|
|
1892
|
-
this.copyFieldsTo(descriptor);
|
|
1893
|
-
return descriptor;
|
|
1894
|
-
}
|
|
1895
1919
|
}
|
|
1896
1920
|
(function (FilterLookupDescriptor) {
|
|
1897
1921
|
let LookupTypeEnum;
|
|
@@ -1911,9 +1935,6 @@ class TableviewDescriptor {
|
|
|
1911
1935
|
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty);
|
|
1912
1936
|
this._tableTitle = `${this._model.typeName}.name`;
|
|
1913
1937
|
}
|
|
1914
|
-
get model() {
|
|
1915
|
-
return this._model;
|
|
1916
|
-
}
|
|
1917
1938
|
get table() {
|
|
1918
1939
|
return this._table;
|
|
1919
1940
|
}
|
|
@@ -1929,6 +1950,9 @@ class TableviewDescriptor {
|
|
|
1929
1950
|
get tableTitle() {
|
|
1930
1951
|
return this._tableTitle;
|
|
1931
1952
|
}
|
|
1953
|
+
get model() {
|
|
1954
|
+
return this._model;
|
|
1955
|
+
}
|
|
1932
1956
|
withTableDescriptor(descriptor) {
|
|
1933
1957
|
this._table = descriptor;
|
|
1934
1958
|
return this;
|
|
@@ -2003,8 +2027,8 @@ class TableviewDescriptor {
|
|
|
2003
2027
|
this._editEditor.addFieldDescriptor(field);
|
|
2004
2028
|
return field;
|
|
2005
2029
|
}
|
|
2006
|
-
addFieldLookupEnum(property, options) {
|
|
2007
|
-
const field = this._viewEditor.addFieldLookupEnum(property, options);
|
|
2030
|
+
addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
2031
|
+
const field = this._viewEditor.addFieldLookupEnum(property, enumType, options, nameAsValue, optionsTitlePath);
|
|
2008
2032
|
this._addEditor.addFieldDescriptor(field);
|
|
2009
2033
|
this._editEditor.addFieldDescriptor(field);
|
|
2010
2034
|
return field;
|
|
@@ -2185,6 +2209,9 @@ class EditorFormlyUtil {
|
|
|
2185
2209
|
else {
|
|
2186
2210
|
field.expressionProperties['templateOptions.disabled'] = 'formState.disabled';
|
|
2187
2211
|
}
|
|
2212
|
+
if (typeof descriptor.defaultValue !== 'undefined') {
|
|
2213
|
+
field.defaultValue = descriptor.defaultValue;
|
|
2214
|
+
}
|
|
2188
2215
|
for (const validator of descriptor.validators) {
|
|
2189
2216
|
field.validators[validator.name] = { expression: validator.expression, message: validator.message };
|
|
2190
2217
|
}
|
|
@@ -2192,6 +2219,67 @@ class EditorFormlyUtil {
|
|
|
2192
2219
|
}
|
|
2193
2220
|
}
|
|
2194
2221
|
|
|
2222
|
+
class EnumUtil {
|
|
2223
|
+
/**
|
|
2224
|
+
* Returns array of names for constants in enum.
|
|
2225
|
+
* @param enumType Enum object.
|
|
2226
|
+
*/
|
|
2227
|
+
static getConstantNames(enumType) {
|
|
2228
|
+
// in number enum, the numbers are also represented in objects and should be filtered out
|
|
2229
|
+
return Object.keys(enumType).filter(v => isNaN(+v));
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* Returns array of string values for constants in enum.
|
|
2233
|
+
* @param enumType Enum object.
|
|
2234
|
+
*/
|
|
2235
|
+
static getConstantValuesAsString(enumType) {
|
|
2236
|
+
return Object.keys(enumType).map(v => enumType[v]);
|
|
2237
|
+
}
|
|
2238
|
+
/**
|
|
2239
|
+
* Returns array of number values for constants in enum.
|
|
2240
|
+
* @param enumType Enum object.
|
|
2241
|
+
*/
|
|
2242
|
+
static getConstantValuesAsNumber(enumType) {
|
|
2243
|
+
return Object.keys(enumType)
|
|
2244
|
+
.filter(v => !isNaN(+v))
|
|
2245
|
+
.map(v => +v);
|
|
2246
|
+
}
|
|
2247
|
+
/**
|
|
2248
|
+
* Returns array of type EnumValue for all constants in enum.
|
|
2249
|
+
* @param enumType Enum object.
|
|
2250
|
+
* @param nameAsValue If use name of constant as value (optional, default: false).
|
|
2251
|
+
* @param titlePath Base path for title to use as translation (optional).
|
|
2252
|
+
*/
|
|
2253
|
+
static fromConstantsAsEnumValueArray(enumType, nameAsValue = false, titlePath) {
|
|
2254
|
+
return EnumUtil.getConstantNames(enumType).map(n => ({ name: n, title: `${titlePath ? `${titlePath}.` : ''}${n}`, value: nameAsValue ? n : enumType[n] }));
|
|
2255
|
+
}
|
|
2256
|
+
/**
|
|
2257
|
+
* Returns array of type EnumValue for provided values in enum.
|
|
2258
|
+
* @param enumType Enum object.
|
|
2259
|
+
* @param nameAsValue If use name of constant as value (optional, default: false).
|
|
2260
|
+
* @param titlePath Base path for title to use as translation (optional).
|
|
2261
|
+
*/
|
|
2262
|
+
static fromValuesAsEnumValueArray(enumType, values, nameAsValue = false, titlePath) {
|
|
2263
|
+
return values.map(v => {
|
|
2264
|
+
const k = EnumUtil.getConstantName(enumType, v);
|
|
2265
|
+
return { name: k, title: `${titlePath ? `${titlePath}.` : ''}${k}`, value: nameAsValue ? k : v };
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Gets constant name for value.
|
|
2270
|
+
* @param enumType Enum object.
|
|
2271
|
+
* @param value Value of enum constant.
|
|
2272
|
+
*/
|
|
2273
|
+
static getConstantName(enumType, value) {
|
|
2274
|
+
if (typeof value === 'string') {
|
|
2275
|
+
return this.getConstantNames(enumType).find(c => enumType[c] === value) ?? null;
|
|
2276
|
+
}
|
|
2277
|
+
else {
|
|
2278
|
+
return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2195
2283
|
class I18nUtil {
|
|
2196
2284
|
static instantModelTranslation(translate, model, keyPath, customKey, item, fallbackKey, i18nParams) {
|
|
2197
2285
|
const keys = I18nUtil.getModelKeysByPriority(model, keyPath, customKey, fallbackKey);
|
|
@@ -2199,6 +2287,15 @@ class I18nUtil {
|
|
|
2199
2287
|
const i18n = translate.instant(keys, I18nUtil.getModelI18nParams(model, item, i18nModelName ?? undefined, i18nParams));
|
|
2200
2288
|
return I18nUtil.selectKeyByPriority(keys, i18n);
|
|
2201
2289
|
}
|
|
2290
|
+
static getModelTabKey(model, tab) {
|
|
2291
|
+
return I18nUtil.getModelKeyPath(model, `tabs.${tab}`);
|
|
2292
|
+
}
|
|
2293
|
+
static getModelGroupKey(model, group) {
|
|
2294
|
+
return I18nUtil.getModelKeyPath(model, `groups.${group}`);
|
|
2295
|
+
}
|
|
2296
|
+
static getModelPropertyKey(model, property) {
|
|
2297
|
+
return I18nUtil.getModelKeyPath(model, `properties.${property}`);
|
|
2298
|
+
}
|
|
2202
2299
|
static instantActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, functionNameKey, i18nParams) {
|
|
2203
2300
|
const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
|
|
2204
2301
|
const i18nModelName = I18nUtil.instantModelName(translate, action?.model, true);
|
|
@@ -2213,31 +2310,6 @@ class I18nUtil {
|
|
|
2213
2310
|
const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
|
|
2214
2311
|
return I18nUtil.getModelName(translate, action?.model, oneTime, true).pipe(mergeMap(i18nModelName => translate.get(keys, I18nUtil.getActionI18nParams(action, item, i18nModelName ?? undefined))), map(i18n => I18nUtil.selectKeyByPriority(keys, i18n)));
|
|
2215
2312
|
}
|
|
2216
|
-
static getModelKeysByPriority(model, keyPath, customKey, fallbackKey) {
|
|
2217
|
-
const keys = [];
|
|
2218
|
-
if (customKey) {
|
|
2219
|
-
keys.push(customKey);
|
|
2220
|
-
}
|
|
2221
|
-
const modelActionKey = `${model.typeName}.${keyPath}`;
|
|
2222
|
-
keys.push(modelActionKey);
|
|
2223
|
-
if (fallbackKey) {
|
|
2224
|
-
keys.push(fallbackKey);
|
|
2225
|
-
}
|
|
2226
|
-
return keys;
|
|
2227
|
-
}
|
|
2228
|
-
static getActionKeysByPriority(action, keyPath, customKey, fallbackKey) {
|
|
2229
|
-
const keys = [];
|
|
2230
|
-
if (customKey) {
|
|
2231
|
-
keys.push(customKey);
|
|
2232
|
-
}
|
|
2233
|
-
const modelActionKey = `${action.i18nModelActionBaseKey}.${keyPath}`;
|
|
2234
|
-
const actionKey = `${action.actionName}.${keyPath}`;
|
|
2235
|
-
keys.push(modelActionKey, actionKey);
|
|
2236
|
-
if (fallbackKey) {
|
|
2237
|
-
keys.push(fallbackKey);
|
|
2238
|
-
}
|
|
2239
|
-
return keys;
|
|
2240
|
-
}
|
|
2241
2313
|
static getModelI18nParams(model, item, i18nModelName, i18nParameters = {}) {
|
|
2242
2314
|
i18nParameters.itemId = '';
|
|
2243
2315
|
i18nParameters.itemTitle = '';
|
|
@@ -2294,6 +2366,34 @@ class I18nUtil {
|
|
|
2294
2366
|
keys.push(`${model?.typeName}.name`);
|
|
2295
2367
|
return keys;
|
|
2296
2368
|
}
|
|
2369
|
+
static getModelKeysByPriority(model, keyPath, customKey, fallbackKey) {
|
|
2370
|
+
const keys = [];
|
|
2371
|
+
if (customKey) {
|
|
2372
|
+
keys.push(customKey);
|
|
2373
|
+
}
|
|
2374
|
+
const modelActionKey = I18nUtil.getModelKeyPath(model, keyPath);
|
|
2375
|
+
keys.push(modelActionKey);
|
|
2376
|
+
if (fallbackKey) {
|
|
2377
|
+
keys.push(fallbackKey);
|
|
2378
|
+
}
|
|
2379
|
+
return keys;
|
|
2380
|
+
}
|
|
2381
|
+
static getModelKeyPath(model, keyPath) {
|
|
2382
|
+
return `${model.typeName}.${keyPath}`;
|
|
2383
|
+
}
|
|
2384
|
+
static getActionKeysByPriority(action, keyPath, customKey, fallbackKey) {
|
|
2385
|
+
const keys = [];
|
|
2386
|
+
if (customKey) {
|
|
2387
|
+
keys.push(customKey);
|
|
2388
|
+
}
|
|
2389
|
+
const modelActionKey = `${action.i18nModelActionBaseKey}.${keyPath}`;
|
|
2390
|
+
const actionKey = `${action.actionName}.${keyPath}`;
|
|
2391
|
+
keys.push(modelActionKey, actionKey);
|
|
2392
|
+
if (fallbackKey) {
|
|
2393
|
+
keys.push(fallbackKey);
|
|
2394
|
+
}
|
|
2395
|
+
return keys;
|
|
2396
|
+
}
|
|
2297
2397
|
static selectKeyByPriority(keys, i18n) {
|
|
2298
2398
|
for (const key of keys) {
|
|
2299
2399
|
if (key !== i18n[key]) {
|
|
@@ -2417,8 +2517,19 @@ function TypeName(typeName) {
|
|
|
2417
2517
|
target[typeNameDecoratorPropertyName] = typeName;
|
|
2418
2518
|
};
|
|
2419
2519
|
}
|
|
2520
|
+
const enumNameDecoratorPropertyName = 'enumName';
|
|
2521
|
+
function EnumName(typeName) {
|
|
2522
|
+
return function (target) {
|
|
2523
|
+
target[enumNameDecoratorPropertyName] = typeName;
|
|
2524
|
+
};
|
|
2525
|
+
}
|
|
2420
2526
|
|
|
2421
2527
|
class TypeUtil {
|
|
2528
|
+
/**
|
|
2529
|
+
* Defines type name decorator.
|
|
2530
|
+
* @param targetType class.
|
|
2531
|
+
* @param typeName Name of the type.
|
|
2532
|
+
*/
|
|
2422
2533
|
static defineReflectTypeName(targetType, typeName) {
|
|
2423
2534
|
if (!typeName) {
|
|
2424
2535
|
typeName = TypeUtil.getDecoratorTypeName(targetType);
|
|
@@ -2431,6 +2542,16 @@ class TypeUtil {
|
|
|
2431
2542
|
Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
|
|
2432
2543
|
}
|
|
2433
2544
|
}
|
|
2545
|
+
/**
|
|
2546
|
+
* Defines enum name decorator.
|
|
2547
|
+
* @param targetType enum object.
|
|
2548
|
+
* @param enumName Name of the enum.
|
|
2549
|
+
*/
|
|
2550
|
+
static defineReflectEnumName(targetType, enumName) {
|
|
2551
|
+
if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
|
|
2552
|
+
Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2434
2555
|
/**
|
|
2435
2556
|
* Gets type name from either decorator or reflect metadata.
|
|
2436
2557
|
* @param type Class.
|
|
@@ -2446,6 +2567,21 @@ class TypeUtil {
|
|
|
2446
2567
|
}
|
|
2447
2568
|
return type.name;
|
|
2448
2569
|
}
|
|
2570
|
+
/**
|
|
2571
|
+
* Gets enum name from either decorator or reflect metadata.
|
|
2572
|
+
* @param enumType Class.
|
|
2573
|
+
*/
|
|
2574
|
+
static findEnumName(enumType) {
|
|
2575
|
+
let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
|
|
2576
|
+
if (decoratorName) {
|
|
2577
|
+
return decoratorName;
|
|
2578
|
+
}
|
|
2579
|
+
decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
|
|
2580
|
+
if (decoratorName) {
|
|
2581
|
+
return decoratorName;
|
|
2582
|
+
}
|
|
2583
|
+
throw new Error('Could not fined enum name');
|
|
2584
|
+
}
|
|
2449
2585
|
/**
|
|
2450
2586
|
* Get value from decorator defined property name
|
|
2451
2587
|
* @param type Class.
|
|
@@ -2454,6 +2590,13 @@ class TypeUtil {
|
|
|
2454
2590
|
static getDecoratorTypeName(type) {
|
|
2455
2591
|
return type[typeNameDecoratorPropertyName];
|
|
2456
2592
|
}
|
|
2593
|
+
/**
|
|
2594
|
+
* Get value from decorator defined property name
|
|
2595
|
+
* @param type Enum object.
|
|
2596
|
+
*/
|
|
2597
|
+
static getDecoratorEnumName(type) {
|
|
2598
|
+
return type[enumNameDecoratorPropertyName];
|
|
2599
|
+
}
|
|
2457
2600
|
}
|
|
2458
2601
|
|
|
2459
2602
|
class ObjectSerializer {
|
|
@@ -2541,12 +2684,17 @@ class ObjectSerializer {
|
|
|
2541
2684
|
}
|
|
2542
2685
|
registerEnums(enums) {
|
|
2543
2686
|
for (const key in enums) {
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2687
|
+
this.registerEnum(enums[key], key);
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
registerEnum(enumType, enumName) {
|
|
2691
|
+
// try to find name from decorator
|
|
2692
|
+
if (typeof this._enumMap[enumName] !== 'undefined') {
|
|
2693
|
+
console.warn(`Registering enum ${enumName} skipped, because enum already exists.`);
|
|
2694
|
+
}
|
|
2695
|
+
else {
|
|
2696
|
+
TypeUtil.defineReflectEnumName(enumType, enumName);
|
|
2697
|
+
this._enumMap[enumName] = enumType;
|
|
2550
2698
|
}
|
|
2551
2699
|
}
|
|
2552
2700
|
findCorrectType(data, expectedType) {
|
|
@@ -4338,10 +4486,10 @@ class MngFormlyFieldInputComponent extends FieldType {
|
|
|
4338
4486
|
}
|
|
4339
4487
|
}
|
|
4340
4488
|
MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4341
|
-
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\"
|
|
4489
|
+
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 <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 });
|
|
4342
4490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
|
|
4343
4491
|
type: Component,
|
|
4344
|
-
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\"
|
|
4492
|
+
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 <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
|
|
4345
4493
|
}] });
|
|
4346
4494
|
|
|
4347
4495
|
class MngFormlyFieldDropdownComponent extends FieldType {
|
|
@@ -4521,6 +4669,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4521
4669
|
type: Input
|
|
4522
4670
|
}] } });
|
|
4523
4671
|
|
|
4672
|
+
class MngI18nPropertyPipe {
|
|
4673
|
+
transform(property, model) {
|
|
4674
|
+
return I18nUtil.getModelPropertyKey(model, property);
|
|
4675
|
+
}
|
|
4676
|
+
}
|
|
4677
|
+
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4678
|
+
MngI18nPropertyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, name: "i18nProperty" });
|
|
4679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, decorators: [{
|
|
4680
|
+
type: Pipe,
|
|
4681
|
+
args: [{
|
|
4682
|
+
name: 'i18nProperty',
|
|
4683
|
+
pure: true
|
|
4684
|
+
}]
|
|
4685
|
+
}] });
|
|
4686
|
+
|
|
4524
4687
|
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
4525
4688
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
4526
4689
|
class MngTableComponent {
|
|
@@ -4772,10 +4935,10 @@ class MngTableComponent {
|
|
|
4772
4935
|
}
|
|
4773
4936
|
}
|
|
4774
4937
|
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 });
|
|
4775
|
-
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 });
|
|
4938
|
+
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 });
|
|
4776
4939
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
4777
4940
|
type: Component,
|
|
4778
|
-
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 {{
|
|
4941
|
+
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" }]
|
|
4779
4942
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: TableviewComponentService, decorators: [{
|
|
4780
4943
|
type: Optional
|
|
4781
4944
|
}] }]; }, propDecorators: { descriptor: [{
|
|
@@ -5016,10 +5179,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5016
5179
|
class MngFormlyFieldTabsComponent extends FieldType {
|
|
5017
5180
|
}
|
|
5018
5181
|
MngFormlyFieldTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5019
|
-
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
|
|
5182
|
+
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 });
|
|
5020
5183
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, decorators: [{
|
|
5021
5184
|
type: Component,
|
|
5022
|
-
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
|
|
5185
|
+
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" }]
|
|
5023
5186
|
}] });
|
|
5024
5187
|
|
|
5025
5188
|
class MngFormlyFieldFieldsetComponent extends FieldType {
|
|
@@ -5887,6 +6050,7 @@ const declarations = [
|
|
|
5887
6050
|
// pipes
|
|
5888
6051
|
MngPropertyPathPipe,
|
|
5889
6052
|
MngBooleanPipe,
|
|
6053
|
+
MngI18nPropertyPipe,
|
|
5890
6054
|
// layout components
|
|
5891
6055
|
MngBreadcrumbComponent,
|
|
5892
6056
|
MngFooterComponent,
|
|
@@ -5978,6 +6142,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
5978
6142
|
// pipes
|
|
5979
6143
|
MngPropertyPathPipe,
|
|
5980
6144
|
MngBooleanPipe,
|
|
6145
|
+
MngI18nPropertyPipe,
|
|
5981
6146
|
// layout components
|
|
5982
6147
|
MngBreadcrumbComponent,
|
|
5983
6148
|
MngFooterComponent,
|
|
@@ -6087,6 +6252,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
6087
6252
|
// pipes
|
|
6088
6253
|
MngPropertyPathPipe,
|
|
6089
6254
|
MngBooleanPipe,
|
|
6255
|
+
MngI18nPropertyPipe,
|
|
6090
6256
|
// layout components
|
|
6091
6257
|
MngBreadcrumbComponent,
|
|
6092
6258
|
MngFooterComponent,
|
|
@@ -6584,5 +6750,5 @@ class RouteBuilder {
|
|
|
6584
6750
|
* Generated bundle index. Do not edit.
|
|
6585
6751
|
*/
|
|
6586
6752
|
|
|
6587
|
-
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 };
|
|
6753
|
+
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, 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, 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 };
|
|
6588
6754
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|