@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.
- 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/dropdown/dropdown.component.mjs +2 -4
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +1 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +9 -8
- package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
- package/esm2020/lib/components/layout/menu-item.component.mjs +59 -17
- package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +1 -1
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +2 -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/config/formly.config.mjs +10 -1
- package/esm2020/lib/data-providers/base.data-provider.mjs +1 -8
- package/esm2020/lib/descriptors/editor.descriptor.mjs +113 -66
- package/esm2020/lib/descriptors/table.descriptor.mjs +130 -42
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +9 -6
- package/esm2020/lib/mng-commons.module.mjs +8 -2
- package/esm2020/lib/models/enum.model.mjs +2 -0
- package/esm2020/lib/models/index.mjs +3 -1
- package/esm2020/lib/models/menu.model.mjs +2 -0
- package/esm2020/lib/pipes/enum.pipe.mjs +22 -0
- package/esm2020/lib/pipes/i18n-property.pipe.mjs +18 -0
- package/esm2020/lib/pipes/index.mjs +3 -1
- package/esm2020/lib/router/route-builder.mjs +86 -17
- package/esm2020/lib/services/commons.service.mjs +1 -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 +10 -1
- package/esm2020/lib/utils/enum.util.mjs +82 -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/esm2020/public-api.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +643 -197
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +637 -196
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/object-serializer.util.d.ts +1 -0
- package/lib/components/layout/menu-item.component.d.ts +13 -5
- package/lib/components/tableview/table/column-value/column-value.component.d.ts +1 -0
- package/lib/data-providers/base.data-provider.d.ts +0 -3
- package/lib/descriptors/editor.descriptor.d.ts +43 -28
- package/lib/descriptors/table.descriptor.d.ts +37 -16
- package/lib/descriptors/tableview.descriptor.d.ts +9 -8
- package/lib/mng-commons.module.d.ts +70 -68
- package/lib/models/enum.model.d.ts +5 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/menu.model.d.ts +25 -0
- package/lib/pipes/enum.pipe.d.ts +7 -0
- package/lib/pipes/i18n-property.pipe.d.ts +8 -0
- package/lib/pipes/index.d.ts +2 -0
- package/lib/router/route-builder.d.ts +9 -5
- package/lib/services/commons.service.d.ts +6 -6
- 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 +50 -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/public-api.d.ts +1 -0
- 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
|
|
45
|
+
import * as i10$1 from 'primeng/inputtext';
|
|
45
46
|
import { InputTextModule } from 'primeng/inputtext';
|
|
46
|
-
import * as
|
|
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$
|
|
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';
|
|
@@ -416,17 +417,10 @@ class DataProvider {
|
|
|
416
417
|
get modelType() {
|
|
417
418
|
return this._modelType;
|
|
418
419
|
}
|
|
419
|
-
get enumName() {
|
|
420
|
-
return this._enumName;
|
|
421
|
-
}
|
|
422
420
|
withServiceType(type) {
|
|
423
421
|
this._serviceType = type;
|
|
424
422
|
return this;
|
|
425
423
|
}
|
|
426
|
-
withEnumName(enumName) {
|
|
427
|
-
this._enumName = enumName;
|
|
428
|
-
return this;
|
|
429
|
-
}
|
|
430
424
|
}
|
|
431
425
|
|
|
432
426
|
class EditorDataProvider extends DataProvider {
|
|
@@ -755,29 +749,33 @@ class EditorDescriptor {
|
|
|
755
749
|
this._disabled = false;
|
|
756
750
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
757
751
|
}
|
|
752
|
+
get disabled() {
|
|
753
|
+
return this._disabled;
|
|
754
|
+
}
|
|
758
755
|
get model() {
|
|
759
756
|
return this._model;
|
|
760
757
|
}
|
|
761
758
|
get tabs() {
|
|
762
759
|
return this._tabs;
|
|
763
760
|
}
|
|
764
|
-
get disabled() {
|
|
765
|
-
return this._disabled;
|
|
766
|
-
}
|
|
767
761
|
get fields() {
|
|
768
762
|
return this._fields;
|
|
769
763
|
}
|
|
770
764
|
createTabGroup(name, title) {
|
|
771
765
|
const tabGroup = new FieldTabGroupDescriptor(this, name);
|
|
772
|
-
if (title) {
|
|
773
|
-
|
|
766
|
+
if (!title) {
|
|
767
|
+
title = I18nUtil.getModelTabKey(this.model, name);
|
|
774
768
|
}
|
|
769
|
+
tabGroup.withTitle(title);
|
|
775
770
|
this.createTabGroupDescriptor(tabGroup);
|
|
776
771
|
return tabGroup;
|
|
777
772
|
}
|
|
778
773
|
createFieldGroup(name, title) {
|
|
779
774
|
const fieldGroup = new FieldGroupDescriptor(this, name);
|
|
780
|
-
if (title) {
|
|
775
|
+
if (title !== null) {
|
|
776
|
+
if (!title) {
|
|
777
|
+
title = I18nUtil.getModelGroupKey(this.model, name);
|
|
778
|
+
}
|
|
781
779
|
fieldGroup.withTitle(title);
|
|
782
780
|
}
|
|
783
781
|
this.createFieldGroupDescriptor(fieldGroup);
|
|
@@ -817,16 +815,8 @@ class EditorDescriptor {
|
|
|
817
815
|
this.addFieldDescriptor(field);
|
|
818
816
|
return field;
|
|
819
817
|
}
|
|
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);
|
|
818
|
+
addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
819
|
+
const field = new FieldLookupEnumDescriptor(this, property, enumType, options, nameAsValue, optionsTitlePath);
|
|
830
820
|
this.addFieldDescriptor(field);
|
|
831
821
|
return field;
|
|
832
822
|
}
|
|
@@ -865,11 +855,6 @@ class EditorDescriptor {
|
|
|
865
855
|
editor._disabled = this._disabled;
|
|
866
856
|
return editor;
|
|
867
857
|
}
|
|
868
|
-
createTabGroupDescriptor(tabGroup) {
|
|
869
|
-
this._currentTabGroup = tabGroup;
|
|
870
|
-
this._tabs.push(tabGroup);
|
|
871
|
-
return this;
|
|
872
|
-
}
|
|
873
858
|
createFieldGroupDescriptor(fieldGroup) {
|
|
874
859
|
this.createDefaultTabGroup();
|
|
875
860
|
this._currentGroup = fieldGroup;
|
|
@@ -877,15 +862,20 @@ class EditorDescriptor {
|
|
|
877
862
|
this._currentTabGroup?.addField(fieldGroup);
|
|
878
863
|
return this;
|
|
879
864
|
}
|
|
865
|
+
createTabGroupDescriptor(tabGroup) {
|
|
866
|
+
this._currentTabGroup = tabGroup;
|
|
867
|
+
this._tabs.push(tabGroup);
|
|
868
|
+
return this;
|
|
869
|
+
}
|
|
880
870
|
createDefaultGroup() {
|
|
881
871
|
this.createDefaultTabGroup();
|
|
882
872
|
if (this._currentTabGroup?.fields.length === 0) {
|
|
883
|
-
this.createFieldGroup(EditorDescriptor.defaultGroupName);
|
|
873
|
+
this.createFieldGroup(EditorDescriptor.defaultGroupName, null);
|
|
884
874
|
}
|
|
885
875
|
}
|
|
886
876
|
createDefaultTabGroup() {
|
|
887
877
|
if (this._tabs.length === 0) {
|
|
888
|
-
this.createTabGroup(EditorDescriptor.defaultGroupName);
|
|
878
|
+
this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
|
|
889
879
|
}
|
|
890
880
|
}
|
|
891
881
|
}
|
|
@@ -906,10 +896,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
906
896
|
this._className = '';
|
|
907
897
|
this._validators = [];
|
|
908
898
|
this._property = property;
|
|
909
|
-
this._label = this._editor.model
|
|
910
|
-
}
|
|
911
|
-
get property() {
|
|
912
|
-
return this._property;
|
|
899
|
+
this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
|
|
913
900
|
}
|
|
914
901
|
get group() {
|
|
915
902
|
return this._group;
|
|
@@ -926,6 +913,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
926
913
|
get disabled() {
|
|
927
914
|
return this._disabled;
|
|
928
915
|
}
|
|
916
|
+
get defaultValue() {
|
|
917
|
+
return this._defaultValue;
|
|
918
|
+
}
|
|
929
919
|
get className() {
|
|
930
920
|
return this._className;
|
|
931
921
|
}
|
|
@@ -941,6 +931,9 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
941
931
|
get disabledFunction() {
|
|
942
932
|
return this._disabledFunction;
|
|
943
933
|
}
|
|
934
|
+
get property() {
|
|
935
|
+
return this._property;
|
|
936
|
+
}
|
|
944
937
|
withLabel(label) {
|
|
945
938
|
this._label = label;
|
|
946
939
|
return this;
|
|
@@ -960,6 +953,10 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
960
953
|
}
|
|
961
954
|
return this;
|
|
962
955
|
}
|
|
956
|
+
withDefaultValue(defaultValue) {
|
|
957
|
+
this._defaultValue = defaultValue;
|
|
958
|
+
return this;
|
|
959
|
+
}
|
|
963
960
|
withClassName(className) {
|
|
964
961
|
this._className = className;
|
|
965
962
|
return this;
|
|
@@ -981,6 +978,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
981
978
|
obj._placeholder = this._placeholder;
|
|
982
979
|
obj._required = this._required;
|
|
983
980
|
obj._disabled = this._disabled;
|
|
981
|
+
obj._defaultValue = this._defaultValue;
|
|
984
982
|
obj._disabledFunction = this._disabledFunction;
|
|
985
983
|
obj._className = this._className;
|
|
986
984
|
obj._getter = this._getter;
|
|
@@ -999,8 +997,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
999
997
|
get fieldType() {
|
|
1000
998
|
return this._fieldType;
|
|
1001
999
|
}
|
|
1002
|
-
get
|
|
1003
|
-
return this.
|
|
1000
|
+
get rows() {
|
|
1001
|
+
return this._rows;
|
|
1004
1002
|
}
|
|
1005
1003
|
get numberMin() {
|
|
1006
1004
|
return this._numberMin;
|
|
@@ -1008,8 +1006,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1008
1006
|
get numberMax() {
|
|
1009
1007
|
return this._numberMax;
|
|
1010
1008
|
}
|
|
1011
|
-
get
|
|
1012
|
-
return this.
|
|
1009
|
+
get numberStep() {
|
|
1010
|
+
return this._numberStep;
|
|
1013
1011
|
}
|
|
1014
1012
|
get numberMinFractionDigits() {
|
|
1015
1013
|
return this._numberMinFractionDigits;
|
|
@@ -1041,6 +1039,15 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1041
1039
|
get pattern() {
|
|
1042
1040
|
return this._pattern;
|
|
1043
1041
|
}
|
|
1042
|
+
get mask() {
|
|
1043
|
+
return this._mask;
|
|
1044
|
+
}
|
|
1045
|
+
get slotChar() {
|
|
1046
|
+
return this._slotChar;
|
|
1047
|
+
}
|
|
1048
|
+
get customComponentName() {
|
|
1049
|
+
return this._customComponentName;
|
|
1050
|
+
}
|
|
1044
1051
|
asText(minLength, maxLength, pattern, isEmail) {
|
|
1045
1052
|
this._fieldType = FieldInputDescriptor.TypeEnum.Text;
|
|
1046
1053
|
this._minLength = minLength;
|
|
@@ -1072,9 +1079,19 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1072
1079
|
this._fieldType = FieldInputDescriptor.TypeEnum.Switch;
|
|
1073
1080
|
return this;
|
|
1074
1081
|
}
|
|
1075
|
-
asRadio(options) {
|
|
1082
|
+
asRadio(options, optionsTitlePath) {
|
|
1083
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
|
|
1084
|
+
this._radioOptions = options.map(o => ({ value: o, title: `${optionsTitlePath ? `${optionsTitlePath}.` : ''}${o}` }));
|
|
1085
|
+
return this;
|
|
1086
|
+
}
|
|
1087
|
+
asRadioFromEnum(enumType, optionsTitlePath, values, nameAsValue = false) {
|
|
1076
1088
|
this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
|
|
1077
|
-
|
|
1089
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
1090
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1091
|
+
}
|
|
1092
|
+
this._radioOptions = Array.isArray(values)
|
|
1093
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, values, nameAsValue, optionsTitlePath ?? undefined)
|
|
1094
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1078
1095
|
return this;
|
|
1079
1096
|
}
|
|
1080
1097
|
asDatePicker(format, min, max, showTime) {
|
|
@@ -1085,6 +1102,17 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1085
1102
|
this._datePickerShowTime = showTime ?? false;
|
|
1086
1103
|
return this;
|
|
1087
1104
|
}
|
|
1105
|
+
asMask(mask, slotChar) {
|
|
1106
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Mask;
|
|
1107
|
+
this._mask = mask;
|
|
1108
|
+
this._slotChar = slotChar;
|
|
1109
|
+
return this;
|
|
1110
|
+
}
|
|
1111
|
+
asCustomComponent(customComponentName) {
|
|
1112
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Custom;
|
|
1113
|
+
this._customComponentName = customComponentName;
|
|
1114
|
+
return this;
|
|
1115
|
+
}
|
|
1088
1116
|
copy() {
|
|
1089
1117
|
const field = new FieldInputDescriptor(this._editor, this._property);
|
|
1090
1118
|
this.copyFieldsTo(field);
|
|
@@ -1095,7 +1123,7 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1095
1123
|
field._numberStep = this._numberStep;
|
|
1096
1124
|
field._numberMinFractionDigits = this._numberMinFractionDigits;
|
|
1097
1125
|
field._numberMaxFractionDigits = this._numberMaxFractionDigits;
|
|
1098
|
-
field._radioOptions = this._radioOptions;
|
|
1126
|
+
field._radioOptions = [...this._radioOptions];
|
|
1099
1127
|
field._datePickerFormat = this._datePickerFormat;
|
|
1100
1128
|
field._datePickerMin = this._datePickerMin;
|
|
1101
1129
|
field._datePickerMax = this._datePickerMax;
|
|
@@ -1103,6 +1131,9 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1103
1131
|
field._maxLength = this._maxLength;
|
|
1104
1132
|
field._minLength = this._minLength;
|
|
1105
1133
|
field._pattern = this._pattern;
|
|
1134
|
+
field._mask = this._mask;
|
|
1135
|
+
field._slotChar = this._slotChar;
|
|
1136
|
+
field._customComponentName = this._customComponentName;
|
|
1106
1137
|
return field;
|
|
1107
1138
|
}
|
|
1108
1139
|
}
|
|
@@ -1115,6 +1146,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
1115
1146
|
TypeEnum[TypeEnum["Switch"] = 3] = "Switch";
|
|
1116
1147
|
TypeEnum[TypeEnum["Radio"] = 4] = "Radio";
|
|
1117
1148
|
TypeEnum[TypeEnum["Datepicker"] = 5] = "Datepicker";
|
|
1149
|
+
TypeEnum[TypeEnum["Mask"] = 6] = "Mask";
|
|
1150
|
+
TypeEnum[TypeEnum["Custom"] = 7] = "Custom";
|
|
1118
1151
|
})(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
|
|
1119
1152
|
})(FieldInputDescriptor || (FieldInputDescriptor = {}));
|
|
1120
1153
|
class FieldLookupDescriptor extends AFieldDescriptor {
|
|
@@ -1124,9 +1157,6 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1124
1157
|
this._modelType = modelType;
|
|
1125
1158
|
ModelUtil.trySetLookupItemsProperties(this);
|
|
1126
1159
|
}
|
|
1127
|
-
get modelType() {
|
|
1128
|
-
return this._modelType;
|
|
1129
|
-
}
|
|
1130
1160
|
get lookupType() {
|
|
1131
1161
|
return this._lookupType;
|
|
1132
1162
|
}
|
|
@@ -1142,6 +1172,9 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1142
1172
|
get dataProvider() {
|
|
1143
1173
|
return this._dataProvider;
|
|
1144
1174
|
}
|
|
1175
|
+
get modelType() {
|
|
1176
|
+
return this._modelType;
|
|
1177
|
+
}
|
|
1145
1178
|
withItemsLabelProperty(itemsLabelProperty) {
|
|
1146
1179
|
this._itemsLabelProperty = itemsLabelProperty;
|
|
1147
1180
|
return this;
|
|
@@ -1190,17 +1223,26 @@ class FieldLookupDescriptor extends AFieldDescriptor {
|
|
|
1190
1223
|
})(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
|
|
1191
1224
|
})(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
|
|
1192
1225
|
class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
1193
|
-
constructor(editor, property,
|
|
1226
|
+
constructor(editor, property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
1194
1227
|
super(editor, property, null);
|
|
1195
|
-
this.
|
|
1196
|
-
|
|
1228
|
+
this._enumType = enumType;
|
|
1229
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
1230
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1231
|
+
}
|
|
1232
|
+
const optionEnumValues = Array.isArray(options)
|
|
1233
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
|
|
1234
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1235
|
+
const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
|
|
1197
1236
|
this.withLookupDataProvider(dataProvider);
|
|
1237
|
+
this.withItemsLabelProperty('title');
|
|
1238
|
+
this.withItemsValueProperty('value');
|
|
1239
|
+
this.withDataKeyProperty('value');
|
|
1198
1240
|
}
|
|
1199
|
-
get
|
|
1200
|
-
return this.
|
|
1241
|
+
get enumType() {
|
|
1242
|
+
return this._enumType;
|
|
1201
1243
|
}
|
|
1202
1244
|
copy() {
|
|
1203
|
-
const field = new FieldLookupEnumDescriptor(this._editor, this._property, this.
|
|
1245
|
+
const field = new FieldLookupEnumDescriptor(this._editor, this._property, this._enumType, []);
|
|
1204
1246
|
this.copyFieldsTo(field);
|
|
1205
1247
|
field._lookupType = this._lookupType;
|
|
1206
1248
|
field._itemsLabelProperty = this._itemsLabelProperty;
|
|
@@ -1224,11 +1266,8 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1224
1266
|
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
1225
1267
|
this._actions.push(FieldManyToManyEditorDescriptor.ActionEnum.Add, FieldManyToManyEditorDescriptor.ActionEnum.Delete);
|
|
1226
1268
|
}
|
|
1227
|
-
get
|
|
1228
|
-
return this.
|
|
1229
|
-
}
|
|
1230
|
-
get lookupTableDescriptor() {
|
|
1231
|
-
return this._lookupTableDescriptor;
|
|
1269
|
+
get fieldType() {
|
|
1270
|
+
return this._fieldType;
|
|
1232
1271
|
}
|
|
1233
1272
|
get lookupTableDataProvider() {
|
|
1234
1273
|
return this._lookupTableDataProvider;
|
|
@@ -1236,9 +1275,6 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1236
1275
|
get actions() {
|
|
1237
1276
|
return this._actions;
|
|
1238
1277
|
}
|
|
1239
|
-
get fieldType() {
|
|
1240
|
-
return this._fieldType;
|
|
1241
|
-
}
|
|
1242
1278
|
get hasLookupExcludeValues() {
|
|
1243
1279
|
return this._hasLookupExcludeValues;
|
|
1244
1280
|
}
|
|
@@ -1248,6 +1284,12 @@ class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1248
1284
|
get excludeValueProperty() {
|
|
1249
1285
|
return this._excludeValueProperty;
|
|
1250
1286
|
}
|
|
1287
|
+
get mainTableDescriptor() {
|
|
1288
|
+
return this._mainTableDescriptor;
|
|
1289
|
+
}
|
|
1290
|
+
get lookupTableDescriptor() {
|
|
1291
|
+
return this._lookupTableDescriptor;
|
|
1292
|
+
}
|
|
1251
1293
|
withLookup(getAll, serviceType) {
|
|
1252
1294
|
const dataProvider = new TableviewDataProvider(this._model.type);
|
|
1253
1295
|
if (serviceType) {
|
|
@@ -1303,6 +1345,12 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1303
1345
|
this._tableviewDescriptor = tableviewDescriptor;
|
|
1304
1346
|
this._actions.push(FieldManyEditorDescriptor.ActionEnum.Add, FieldManyEditorDescriptor.ActionEnum.Edit, FieldManyEditorDescriptor.ActionEnum.Delete);
|
|
1305
1347
|
}
|
|
1348
|
+
get fieldType() {
|
|
1349
|
+
return this._fieldType;
|
|
1350
|
+
}
|
|
1351
|
+
get actions() {
|
|
1352
|
+
return this._actions;
|
|
1353
|
+
}
|
|
1306
1354
|
get tableviewDescriptor() {
|
|
1307
1355
|
return this._tableviewDescriptor;
|
|
1308
1356
|
}
|
|
@@ -1318,12 +1366,6 @@ class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
|
1318
1366
|
get editorForUpdate() {
|
|
1319
1367
|
return this._tableviewDescriptor.editEditor;
|
|
1320
1368
|
}
|
|
1321
|
-
get fieldType() {
|
|
1322
|
-
return this._fieldType;
|
|
1323
|
-
}
|
|
1324
|
-
get actions() {
|
|
1325
|
-
return this._actions;
|
|
1326
|
-
}
|
|
1327
1369
|
withActions(actions = []) {
|
|
1328
1370
|
this.actions.push(...actions);
|
|
1329
1371
|
return this;
|
|
@@ -1356,6 +1398,12 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
|
1356
1398
|
this._name = `${this.baseName}${name}`;
|
|
1357
1399
|
this._default = name === EditorDescriptor.defaultGroupName;
|
|
1358
1400
|
}
|
|
1401
|
+
get title() {
|
|
1402
|
+
return this._title;
|
|
1403
|
+
}
|
|
1404
|
+
get validators() {
|
|
1405
|
+
return this._validators;
|
|
1406
|
+
}
|
|
1359
1407
|
get baseName() {
|
|
1360
1408
|
return `${this.groupName()}_`;
|
|
1361
1409
|
}
|
|
@@ -1365,12 +1413,6 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
|
1365
1413
|
get default() {
|
|
1366
1414
|
return this._default;
|
|
1367
1415
|
}
|
|
1368
|
-
get title() {
|
|
1369
|
-
return this._title;
|
|
1370
|
-
}
|
|
1371
|
-
get validators() {
|
|
1372
|
-
return this._validators;
|
|
1373
|
-
}
|
|
1374
1416
|
withTitle(title) {
|
|
1375
1417
|
this._title = title;
|
|
1376
1418
|
return this;
|
|
@@ -1482,6 +1524,7 @@ class TableDescriptor {
|
|
|
1482
1524
|
this._filterDisplay = TableDescriptor.FilterDisplayEnum.Menu;
|
|
1483
1525
|
this._paginationMode = TableDescriptor.PaginationModeEnum.Pagination;
|
|
1484
1526
|
this._columns = [];
|
|
1527
|
+
this._hideHeader = false;
|
|
1485
1528
|
this._hasDefaultSort = false;
|
|
1486
1529
|
this._defaultSortProperty = [];
|
|
1487
1530
|
this._defaultSortAsc = [];
|
|
@@ -1489,9 +1532,6 @@ class TableDescriptor {
|
|
|
1489
1532
|
this._tableFullHeightOffset = 315;
|
|
1490
1533
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
1491
1534
|
}
|
|
1492
|
-
get model() {
|
|
1493
|
-
return this._model;
|
|
1494
|
-
}
|
|
1495
1535
|
get filterDisplay() {
|
|
1496
1536
|
return this._filterDisplay;
|
|
1497
1537
|
}
|
|
@@ -1504,6 +1544,9 @@ class TableDescriptor {
|
|
|
1504
1544
|
get title() {
|
|
1505
1545
|
return this._title;
|
|
1506
1546
|
}
|
|
1547
|
+
get hideHeader() {
|
|
1548
|
+
return this._hideHeader;
|
|
1549
|
+
}
|
|
1507
1550
|
get dataKeyProperty() {
|
|
1508
1551
|
return this._dataKeyProperty;
|
|
1509
1552
|
}
|
|
@@ -1522,6 +1565,9 @@ class TableDescriptor {
|
|
|
1522
1565
|
get tableFullHeightOffset() {
|
|
1523
1566
|
return this._tableFullHeightOffset;
|
|
1524
1567
|
}
|
|
1568
|
+
get model() {
|
|
1569
|
+
return this._model;
|
|
1570
|
+
}
|
|
1525
1571
|
addColumnDescriptor(column) {
|
|
1526
1572
|
this._columns.push(column);
|
|
1527
1573
|
this.setDataKeyFromColumn();
|
|
@@ -1554,6 +1600,13 @@ class TableDescriptor {
|
|
|
1554
1600
|
this.setDataKeyFromColumn();
|
|
1555
1601
|
return column;
|
|
1556
1602
|
}
|
|
1603
|
+
addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
|
|
1604
|
+
const column = new ColumnDescriptor(this, property);
|
|
1605
|
+
column.asEnum(enumType, nameAsValue, titlePath);
|
|
1606
|
+
this._columns.push(column);
|
|
1607
|
+
this.setDataKeyFromColumn();
|
|
1608
|
+
return column;
|
|
1609
|
+
}
|
|
1557
1610
|
addColumnObject(property, modelType, displayProperty) {
|
|
1558
1611
|
const column = new ColumnDescriptor(this, property);
|
|
1559
1612
|
column.withModelType(modelType);
|
|
@@ -1574,6 +1627,10 @@ class TableDescriptor {
|
|
|
1574
1627
|
this._title = title;
|
|
1575
1628
|
return this;
|
|
1576
1629
|
}
|
|
1630
|
+
withHideHeader(hideHeader = true) {
|
|
1631
|
+
this._hideHeader = hideHeader;
|
|
1632
|
+
return this;
|
|
1633
|
+
}
|
|
1577
1634
|
withDataKeyProperty(property) {
|
|
1578
1635
|
this._dataKeyProperty = property;
|
|
1579
1636
|
return this;
|
|
@@ -1592,21 +1649,22 @@ class TableDescriptor {
|
|
|
1592
1649
|
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
1593
1650
|
return this;
|
|
1594
1651
|
}
|
|
1595
|
-
setDataKeyFromColumn() {
|
|
1596
|
-
if (!this._dataKeyProperty && this._columns.length === 1) {
|
|
1597
|
-
this._dataKeyProperty = this._columns[0].property;
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
1652
|
copy() {
|
|
1601
1653
|
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
1602
1654
|
descriptor._columns = this.columns.map(c => c.copy());
|
|
1603
1655
|
descriptor._title = this._title;
|
|
1656
|
+
descriptor._hideHeader = this._hideHeader;
|
|
1604
1657
|
descriptor._dataKeyProperty = this._dataKeyProperty;
|
|
1605
1658
|
descriptor._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
1606
1659
|
descriptor._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
1607
1660
|
descriptor._filterDisplay = this._filterDisplay;
|
|
1608
1661
|
return descriptor;
|
|
1609
1662
|
}
|
|
1663
|
+
setDataKeyFromColumn() {
|
|
1664
|
+
if (!this._dataKeyProperty && this._columns.length === 1) {
|
|
1665
|
+
this._dataKeyProperty = this._columns[0].property;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1610
1668
|
}
|
|
1611
1669
|
(function (TableDescriptor) {
|
|
1612
1670
|
let PaginationModeEnum;
|
|
@@ -1625,36 +1683,46 @@ class ColumnDescriptor {
|
|
|
1625
1683
|
this._modelType = null;
|
|
1626
1684
|
this._columnType = ColumnDescriptor.TypeEnum.String;
|
|
1627
1685
|
this._isSortEnabled = false;
|
|
1686
|
+
this._enumNameAsValue = false;
|
|
1628
1687
|
this._table = table;
|
|
1629
1688
|
this._property = property;
|
|
1630
1689
|
}
|
|
1631
|
-
get table() {
|
|
1632
|
-
return this._table;
|
|
1633
|
-
}
|
|
1634
|
-
get property() {
|
|
1635
|
-
return this._property;
|
|
1636
|
-
}
|
|
1637
1690
|
get modelType() {
|
|
1638
1691
|
return this._modelType;
|
|
1639
1692
|
}
|
|
1640
|
-
get
|
|
1641
|
-
return this.
|
|
1693
|
+
get columnType() {
|
|
1694
|
+
return this._columnType;
|
|
1642
1695
|
}
|
|
1643
1696
|
get title() {
|
|
1644
1697
|
return this._title;
|
|
1645
1698
|
}
|
|
1699
|
+
get displayPropertyPath() {
|
|
1700
|
+
return this._displayPropertyPath;
|
|
1701
|
+
}
|
|
1646
1702
|
get isSortEnabled() {
|
|
1647
1703
|
return this._isSortEnabled;
|
|
1648
1704
|
}
|
|
1649
|
-
get columnType() {
|
|
1650
|
-
return this._columnType;
|
|
1651
|
-
}
|
|
1652
1705
|
get filterDescriptor() {
|
|
1653
1706
|
return this._filterDescriptor;
|
|
1654
1707
|
}
|
|
1655
1708
|
get displayFormat() {
|
|
1656
1709
|
return this._displayFormat;
|
|
1657
1710
|
}
|
|
1711
|
+
get table() {
|
|
1712
|
+
return this._table;
|
|
1713
|
+
}
|
|
1714
|
+
get property() {
|
|
1715
|
+
return this._property;
|
|
1716
|
+
}
|
|
1717
|
+
get enumType() {
|
|
1718
|
+
return this._enumType;
|
|
1719
|
+
}
|
|
1720
|
+
get enumTitlePath() {
|
|
1721
|
+
return this._enumTitlePath;
|
|
1722
|
+
}
|
|
1723
|
+
get enumNameAsValue() {
|
|
1724
|
+
return this._enumNameAsValue;
|
|
1725
|
+
}
|
|
1658
1726
|
asType(type = ColumnDescriptor.TypeEnum.String) {
|
|
1659
1727
|
this._columnType = type;
|
|
1660
1728
|
return this;
|
|
@@ -1673,6 +1741,16 @@ class ColumnDescriptor {
|
|
|
1673
1741
|
this._columnType = ColumnDescriptor.TypeEnum.Boolean;
|
|
1674
1742
|
return this;
|
|
1675
1743
|
}
|
|
1744
|
+
asEnum(enumType, nameAsValue = false, titlePath) {
|
|
1745
|
+
this._columnType = ColumnDescriptor.TypeEnum.Enum;
|
|
1746
|
+
this._enumType = enumType;
|
|
1747
|
+
this._enumNameAsValue = nameAsValue;
|
|
1748
|
+
if (typeof titlePath === 'undefined') {
|
|
1749
|
+
titlePath = TypeUtil.findEnumName(enumType);
|
|
1750
|
+
}
|
|
1751
|
+
this._enumTitlePath = titlePath;
|
|
1752
|
+
return this;
|
|
1753
|
+
}
|
|
1676
1754
|
withModelType(modelType) {
|
|
1677
1755
|
this._modelType = modelType;
|
|
1678
1756
|
return this;
|
|
@@ -1687,7 +1765,23 @@ class ColumnDescriptor {
|
|
|
1687
1765
|
}
|
|
1688
1766
|
withFilter() {
|
|
1689
1767
|
this._filterDescriptor = new FilterDescriptor(this._property);
|
|
1690
|
-
|
|
1768
|
+
let filterType;
|
|
1769
|
+
switch (this._columnType) {
|
|
1770
|
+
case ColumnDescriptor.TypeEnum.Number:
|
|
1771
|
+
filterType = FilterDescriptor.TypeEnum.Number;
|
|
1772
|
+
break;
|
|
1773
|
+
case ColumnDescriptor.TypeEnum.Boolean:
|
|
1774
|
+
filterType = FilterDescriptor.TypeEnum.Boolean;
|
|
1775
|
+
break;
|
|
1776
|
+
case ColumnDescriptor.TypeEnum.Date:
|
|
1777
|
+
filterType = FilterDescriptor.TypeEnum.Date;
|
|
1778
|
+
break;
|
|
1779
|
+
case ColumnDescriptor.TypeEnum.String:
|
|
1780
|
+
default:
|
|
1781
|
+
filterType = FilterDescriptor.TypeEnum.String;
|
|
1782
|
+
break;
|
|
1783
|
+
}
|
|
1784
|
+
this._filterDescriptor.asFilterType(filterType);
|
|
1691
1785
|
return this._filterDescriptor;
|
|
1692
1786
|
}
|
|
1693
1787
|
withFilterLookup() {
|
|
@@ -1695,6 +1789,14 @@ class ColumnDescriptor {
|
|
|
1695
1789
|
this._filterDescriptor = filterDescriptor;
|
|
1696
1790
|
return filterDescriptor;
|
|
1697
1791
|
}
|
|
1792
|
+
withFilterLookupEnum(options) {
|
|
1793
|
+
if (this._columnType !== ColumnDescriptor.TypeEnum.Enum || !this._enumType) {
|
|
1794
|
+
throw new Error(`Column ${this._property} is not of type enum or enum type is undefined.`);
|
|
1795
|
+
}
|
|
1796
|
+
const filterDescriptor = new FilterLookupEnumDescriptor(this._property, this._enumType, options, this._enumNameAsValue, this._enumTitlePath);
|
|
1797
|
+
this._filterDescriptor = filterDescriptor;
|
|
1798
|
+
return filterDescriptor;
|
|
1799
|
+
}
|
|
1698
1800
|
withSort(isEnabled = true) {
|
|
1699
1801
|
this._isSortEnabled = isEnabled;
|
|
1700
1802
|
return this;
|
|
@@ -1716,6 +1818,7 @@ class ColumnDescriptor {
|
|
|
1716
1818
|
TypeEnum[TypeEnum["Number"] = 1] = "Number";
|
|
1717
1819
|
TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
|
|
1718
1820
|
TypeEnum[TypeEnum["Date"] = 3] = "Date";
|
|
1821
|
+
TypeEnum[TypeEnum["Enum"] = 4] = "Enum";
|
|
1719
1822
|
})(TypeEnum = ColumnDescriptor.TypeEnum || (ColumnDescriptor.TypeEnum = {}));
|
|
1720
1823
|
})(ColumnDescriptor || (ColumnDescriptor = {}));
|
|
1721
1824
|
class FilterDescriptor {
|
|
@@ -1725,9 +1828,6 @@ class FilterDescriptor {
|
|
|
1725
1828
|
this._className = '';
|
|
1726
1829
|
this._property = property;
|
|
1727
1830
|
}
|
|
1728
|
-
get property() {
|
|
1729
|
-
return this._property;
|
|
1730
|
-
}
|
|
1731
1831
|
get filterType() {
|
|
1732
1832
|
return this._filterType;
|
|
1733
1833
|
}
|
|
@@ -1743,6 +1843,9 @@ class FilterDescriptor {
|
|
|
1743
1843
|
get className() {
|
|
1744
1844
|
return this._className;
|
|
1745
1845
|
}
|
|
1846
|
+
get property() {
|
|
1847
|
+
return this._property;
|
|
1848
|
+
}
|
|
1746
1849
|
asFilterType(filterType) {
|
|
1747
1850
|
this._filterType = filterType;
|
|
1748
1851
|
return this;
|
|
@@ -1767,17 +1870,17 @@ class FilterDescriptor {
|
|
|
1767
1870
|
this._matchModes = matchModes;
|
|
1768
1871
|
return this;
|
|
1769
1872
|
}
|
|
1873
|
+
copy() {
|
|
1874
|
+
const descriptor = new FilterDescriptor(this._property);
|
|
1875
|
+
this.copyFieldsTo(descriptor);
|
|
1876
|
+
return descriptor;
|
|
1877
|
+
}
|
|
1770
1878
|
copyFieldsTo(descriptor) {
|
|
1771
1879
|
descriptor._filterType = this._filterType;
|
|
1772
1880
|
descriptor._filterProperty = this._filterProperty;
|
|
1773
1881
|
descriptor._placeholder = this._placeholder;
|
|
1774
1882
|
descriptor._className = this._className;
|
|
1775
1883
|
}
|
|
1776
|
-
copy() {
|
|
1777
|
-
const descriptor = new FilterDescriptor(this._property);
|
|
1778
|
-
this.copyFieldsTo(descriptor);
|
|
1779
|
-
return descriptor;
|
|
1780
|
-
}
|
|
1781
1884
|
}
|
|
1782
1885
|
(function (FilterDescriptor) {
|
|
1783
1886
|
let TypeEnum;
|
|
@@ -1787,6 +1890,7 @@ class FilterDescriptor {
|
|
|
1787
1890
|
TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
|
|
1788
1891
|
TypeEnum[TypeEnum["Date"] = 3] = "Date";
|
|
1789
1892
|
TypeEnum[TypeEnum["Lookup"] = 4] = "Lookup";
|
|
1893
|
+
TypeEnum[TypeEnum["LookupEnum"] = 5] = "LookupEnum";
|
|
1790
1894
|
})(TypeEnum = FilterDescriptor.TypeEnum || (FilterDescriptor.TypeEnum = {}));
|
|
1791
1895
|
let MatchModeEnum;
|
|
1792
1896
|
(function (MatchModeEnum) {
|
|
@@ -1818,12 +1922,12 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1818
1922
|
this._filterType = FilterDescriptor.TypeEnum.Lookup;
|
|
1819
1923
|
ModelUtil.trySetLookupItemsProperties(this);
|
|
1820
1924
|
}
|
|
1821
|
-
get modelType() {
|
|
1822
|
-
return this._modelType;
|
|
1823
|
-
}
|
|
1824
1925
|
get lookupType() {
|
|
1825
1926
|
return this._lookupType;
|
|
1826
1927
|
}
|
|
1928
|
+
get dataProvider() {
|
|
1929
|
+
return this._dataProvider;
|
|
1930
|
+
}
|
|
1827
1931
|
get itemsLabelProperty() {
|
|
1828
1932
|
return this._itemsLabelProperty;
|
|
1829
1933
|
}
|
|
@@ -1833,12 +1937,15 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1833
1937
|
get dataKeyProperty() {
|
|
1834
1938
|
return this._dataKeyProperty;
|
|
1835
1939
|
}
|
|
1836
|
-
get dataProvider() {
|
|
1837
|
-
return this._dataProvider;
|
|
1838
|
-
}
|
|
1839
1940
|
get multiselect() {
|
|
1840
1941
|
return this._multiselect;
|
|
1841
1942
|
}
|
|
1943
|
+
get dropdownClassName() {
|
|
1944
|
+
return this._dropdownClassName;
|
|
1945
|
+
}
|
|
1946
|
+
get modelType() {
|
|
1947
|
+
return this._modelType;
|
|
1948
|
+
}
|
|
1842
1949
|
withItemsLabelProperty(itemsLabelProperty) {
|
|
1843
1950
|
this._itemsLabelProperty = itemsLabelProperty;
|
|
1844
1951
|
return this;
|
|
@@ -1851,9 +1958,6 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1851
1958
|
this._dataKeyProperty = dataKeyProperty;
|
|
1852
1959
|
return this;
|
|
1853
1960
|
}
|
|
1854
|
-
get dropdownClassName() {
|
|
1855
|
-
return this._dropdownClassName;
|
|
1856
|
-
}
|
|
1857
1961
|
withLookup(lookup, serviceType) {
|
|
1858
1962
|
const dataProvider = new LookupDataProvider(this._modelType);
|
|
1859
1963
|
if (serviceType) {
|
|
@@ -1879,6 +1983,11 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1879
1983
|
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Autocomplete;
|
|
1880
1984
|
return this;
|
|
1881
1985
|
}
|
|
1986
|
+
copy() {
|
|
1987
|
+
const descriptor = new FilterLookupDescriptor(this._property, this._modelType);
|
|
1988
|
+
this.copyFieldsTo(descriptor);
|
|
1989
|
+
return descriptor;
|
|
1990
|
+
}
|
|
1882
1991
|
copyFieldsTo(descriptor) {
|
|
1883
1992
|
super.copyFieldsTo(descriptor);
|
|
1884
1993
|
descriptor._dataProvider = this._dataProvider;
|
|
@@ -1887,10 +1996,30 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1887
1996
|
descriptor._itemsValueProperty = this._itemsValueProperty;
|
|
1888
1997
|
descriptor._dataKeyProperty = this._dataKeyProperty;
|
|
1889
1998
|
}
|
|
1999
|
+
}
|
|
2000
|
+
class FilterLookupEnumDescriptor extends FilterLookupDescriptor {
|
|
2001
|
+
constructor(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
2002
|
+
super(property, null);
|
|
2003
|
+
this._enumType = enumType;
|
|
2004
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
2005
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
2006
|
+
}
|
|
2007
|
+
const optionEnumValues = Array.isArray(options)
|
|
2008
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
|
|
2009
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
2010
|
+
const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
|
|
2011
|
+
this.withLookupDataProvider(dataProvider);
|
|
2012
|
+
this.withItemsLabelProperty('title');
|
|
2013
|
+
this.withItemsValueProperty('value');
|
|
2014
|
+
this.withDataKeyProperty('value');
|
|
2015
|
+
}
|
|
2016
|
+
get enumType() {
|
|
2017
|
+
return this._enumType;
|
|
2018
|
+
}
|
|
1890
2019
|
copy() {
|
|
1891
|
-
const
|
|
1892
|
-
this.copyFieldsTo(
|
|
1893
|
-
return
|
|
2020
|
+
const field = new FilterLookupEnumDescriptor(this._property, this._enumType, []);
|
|
2021
|
+
this.copyFieldsTo(field);
|
|
2022
|
+
return field;
|
|
1894
2023
|
}
|
|
1895
2024
|
}
|
|
1896
2025
|
(function (FilterLookupDescriptor) {
|
|
@@ -1911,9 +2040,6 @@ class TableviewDescriptor {
|
|
|
1911
2040
|
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty);
|
|
1912
2041
|
this._tableTitle = `${this._model.typeName}.name`;
|
|
1913
2042
|
}
|
|
1914
|
-
get model() {
|
|
1915
|
-
return this._model;
|
|
1916
|
-
}
|
|
1917
2043
|
get table() {
|
|
1918
2044
|
return this._table;
|
|
1919
2045
|
}
|
|
@@ -1929,6 +2055,9 @@ class TableviewDescriptor {
|
|
|
1929
2055
|
get tableTitle() {
|
|
1930
2056
|
return this._tableTitle;
|
|
1931
2057
|
}
|
|
2058
|
+
get model() {
|
|
2059
|
+
return this._model;
|
|
2060
|
+
}
|
|
1932
2061
|
withTableDescriptor(descriptor) {
|
|
1933
2062
|
this._table = descriptor;
|
|
1934
2063
|
return this;
|
|
@@ -1970,6 +2099,9 @@ class TableviewDescriptor {
|
|
|
1970
2099
|
addColumnBoolean(property) {
|
|
1971
2100
|
return this._table.addColumnBoolean(property);
|
|
1972
2101
|
}
|
|
2102
|
+
addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
|
|
2103
|
+
return this._table.addColumnEnum(property, enumType, nameAsValue, titlePath);
|
|
2104
|
+
}
|
|
1973
2105
|
addColumnObject(property, modelType, displayProperty) {
|
|
1974
2106
|
return this._table.addColumnObject(property, modelType, displayProperty);
|
|
1975
2107
|
}
|
|
@@ -2003,8 +2135,8 @@ class TableviewDescriptor {
|
|
|
2003
2135
|
this._editEditor.addFieldDescriptor(field);
|
|
2004
2136
|
return field;
|
|
2005
2137
|
}
|
|
2006
|
-
addFieldLookupEnum(property, options) {
|
|
2007
|
-
const field = this._viewEditor.addFieldLookupEnum(property, options);
|
|
2138
|
+
addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
2139
|
+
const field = this._viewEditor.addFieldLookupEnum(property, enumType, options, nameAsValue, optionsTitlePath);
|
|
2008
2140
|
this._addEditor.addFieldDescriptor(field);
|
|
2009
2141
|
this._editEditor.addFieldDescriptor(field);
|
|
2010
2142
|
return field;
|
|
@@ -2142,6 +2274,12 @@ class EditorFormlyUtil {
|
|
|
2142
2274
|
case FieldInputDescriptor.TypeEnum.Datepicker:
|
|
2143
2275
|
field.type = 'datepicker';
|
|
2144
2276
|
break;
|
|
2277
|
+
case FieldInputDescriptor.TypeEnum.Mask:
|
|
2278
|
+
field.type = 'mask';
|
|
2279
|
+
break;
|
|
2280
|
+
case FieldInputDescriptor.TypeEnum.Custom:
|
|
2281
|
+
field.type = descriptor.customComponentName;
|
|
2282
|
+
break;
|
|
2145
2283
|
default:
|
|
2146
2284
|
field.type = 'input';
|
|
2147
2285
|
field.templateOptions.minLength = descriptor.minLength;
|
|
@@ -2185,6 +2323,9 @@ class EditorFormlyUtil {
|
|
|
2185
2323
|
else {
|
|
2186
2324
|
field.expressionProperties['templateOptions.disabled'] = 'formState.disabled';
|
|
2187
2325
|
}
|
|
2326
|
+
if (typeof descriptor.defaultValue !== 'undefined') {
|
|
2327
|
+
field.defaultValue = descriptor.defaultValue;
|
|
2328
|
+
}
|
|
2188
2329
|
for (const validator of descriptor.validators) {
|
|
2189
2330
|
field.validators[validator.name] = { expression: validator.expression, message: validator.message };
|
|
2190
2331
|
}
|
|
@@ -2192,6 +2333,88 @@ class EditorFormlyUtil {
|
|
|
2192
2333
|
}
|
|
2193
2334
|
}
|
|
2194
2335
|
|
|
2336
|
+
class EnumUtil {
|
|
2337
|
+
/**
|
|
2338
|
+
* Returns array of names for constants in enum.
|
|
2339
|
+
* @param enumType Enum object.
|
|
2340
|
+
*/
|
|
2341
|
+
static getConstantNames(enumType) {
|
|
2342
|
+
return EnumUtil.getConstantNamesFromEnumObject(enumType);
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* Returns array of names for constants in enum.
|
|
2346
|
+
* @param enumObj Enum object.
|
|
2347
|
+
*/
|
|
2348
|
+
static getConstantNamesFromEnumObject(enumObj) {
|
|
2349
|
+
// in number enum, the numbers are also represented in objects and should be filtered out
|
|
2350
|
+
return Object.keys(enumObj).filter(v => isNaN(+v));
|
|
2351
|
+
}
|
|
2352
|
+
/**
|
|
2353
|
+
* Returns array of string values for constants in enum.
|
|
2354
|
+
* @param enumType Enum object.
|
|
2355
|
+
*/
|
|
2356
|
+
static getConstantValuesAsString(enumType) {
|
|
2357
|
+
return Object.keys(enumType).map(v => enumType[v]);
|
|
2358
|
+
}
|
|
2359
|
+
/**
|
|
2360
|
+
* Returns array of number values for constants in enum.
|
|
2361
|
+
* @param enumType Enum object.
|
|
2362
|
+
*/
|
|
2363
|
+
static getConstantValuesAsNumber(enumType) {
|
|
2364
|
+
return Object.keys(enumType)
|
|
2365
|
+
.filter(v => !isNaN(+v))
|
|
2366
|
+
.map(v => +v);
|
|
2367
|
+
}
|
|
2368
|
+
/**
|
|
2369
|
+
* Returns array of type EnumValue for all constants in enum.
|
|
2370
|
+
* @param enumType Enum object.
|
|
2371
|
+
* @param nameAsValue If use name of constant as value (optional, default: false).
|
|
2372
|
+
* @param titlePath Base path for title to use as translation (optional).
|
|
2373
|
+
*/
|
|
2374
|
+
static fromConstantsAsEnumValueArray(enumType, nameAsValue = false, titlePath) {
|
|
2375
|
+
return EnumUtil.getConstantNames(enumType).map(n => ({ name: n, title: `${titlePath ? `${titlePath}.` : ''}${n}`, value: nameAsValue ? n : enumType[n] }));
|
|
2376
|
+
}
|
|
2377
|
+
/**
|
|
2378
|
+
* Returns array of type EnumValue for provided values in enum.
|
|
2379
|
+
* @param enumType Enum object.
|
|
2380
|
+
* @param nameAsValue If use name of constant as value (optional, default: false).
|
|
2381
|
+
* @param titlePath Base path for title to use as translation (optional).
|
|
2382
|
+
*/
|
|
2383
|
+
static fromValuesAsEnumValueArray(enumType, values, nameAsValue = false, titlePath) {
|
|
2384
|
+
return values.map(v => {
|
|
2385
|
+
const k = EnumUtil.getConstantName(enumType, v);
|
|
2386
|
+
return { name: k, title: `${titlePath ? `${titlePath}.` : ''}${k}`, value: nameAsValue ? k : v };
|
|
2387
|
+
});
|
|
2388
|
+
}
|
|
2389
|
+
/**
|
|
2390
|
+
* Gets constant name for value.
|
|
2391
|
+
* @param enumType Enum object.
|
|
2392
|
+
* @param value Value of enum constant.
|
|
2393
|
+
*/
|
|
2394
|
+
static getConstantName(enumType, value) {
|
|
2395
|
+
if (typeof value === 'string') {
|
|
2396
|
+
return this.getConstantNames(enumType).find(c => enumType[c] === value) ?? null;
|
|
2397
|
+
}
|
|
2398
|
+
else {
|
|
2399
|
+
return typeof enumType[value] !== 'undefined' ? enumType[value] : null;
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Gets constant name for value.
|
|
2404
|
+
* @param enumObj Enum object.
|
|
2405
|
+
* @param value Value of enum constant.
|
|
2406
|
+
*/
|
|
2407
|
+
static getConstantNameFromEnumObject(enumObj, value) {
|
|
2408
|
+
const enumObjAny = enumObj;
|
|
2409
|
+
if (typeof value === 'string') {
|
|
2410
|
+
return this.getConstantNamesFromEnumObject(enumObj).find(c => enumObjAny[c] === value) ?? null;
|
|
2411
|
+
}
|
|
2412
|
+
else {
|
|
2413
|
+
return typeof enumObjAny[value] !== 'undefined' ? enumObjAny[value] : null;
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2195
2418
|
class I18nUtil {
|
|
2196
2419
|
static instantModelTranslation(translate, model, keyPath, customKey, item, fallbackKey, i18nParams) {
|
|
2197
2420
|
const keys = I18nUtil.getModelKeysByPriority(model, keyPath, customKey, fallbackKey);
|
|
@@ -2199,6 +2422,15 @@ class I18nUtil {
|
|
|
2199
2422
|
const i18n = translate.instant(keys, I18nUtil.getModelI18nParams(model, item, i18nModelName ?? undefined, i18nParams));
|
|
2200
2423
|
return I18nUtil.selectKeyByPriority(keys, i18n);
|
|
2201
2424
|
}
|
|
2425
|
+
static getModelTabKey(model, tab) {
|
|
2426
|
+
return I18nUtil.getModelKeyPath(model, `tabs.${tab}`);
|
|
2427
|
+
}
|
|
2428
|
+
static getModelGroupKey(model, group) {
|
|
2429
|
+
return I18nUtil.getModelKeyPath(model, `groups.${group}`);
|
|
2430
|
+
}
|
|
2431
|
+
static getModelPropertyKey(model, property) {
|
|
2432
|
+
return I18nUtil.getModelKeyPath(model, `properties.${property}`);
|
|
2433
|
+
}
|
|
2202
2434
|
static instantActionTranslation(translate, action, keyPath, customKey, item, fallbackKey, functionNameKey, i18nParams) {
|
|
2203
2435
|
const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
|
|
2204
2436
|
const i18nModelName = I18nUtil.instantModelName(translate, action?.model, true);
|
|
@@ -2213,31 +2445,6 @@ class I18nUtil {
|
|
|
2213
2445
|
const keys = I18nUtil.getActionKeysByPriority(action, keyPath, customKey, fallbackKey);
|
|
2214
2446
|
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
2447
|
}
|
|
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
2448
|
static getModelI18nParams(model, item, i18nModelName, i18nParameters = {}) {
|
|
2242
2449
|
i18nParameters.itemId = '';
|
|
2243
2450
|
i18nParameters.itemTitle = '';
|
|
@@ -2294,6 +2501,34 @@ class I18nUtil {
|
|
|
2294
2501
|
keys.push(`${model?.typeName}.name`);
|
|
2295
2502
|
return keys;
|
|
2296
2503
|
}
|
|
2504
|
+
static getModelKeysByPriority(model, keyPath, customKey, fallbackKey) {
|
|
2505
|
+
const keys = [];
|
|
2506
|
+
if (customKey) {
|
|
2507
|
+
keys.push(customKey);
|
|
2508
|
+
}
|
|
2509
|
+
const modelActionKey = I18nUtil.getModelKeyPath(model, keyPath);
|
|
2510
|
+
keys.push(modelActionKey);
|
|
2511
|
+
if (fallbackKey) {
|
|
2512
|
+
keys.push(fallbackKey);
|
|
2513
|
+
}
|
|
2514
|
+
return keys;
|
|
2515
|
+
}
|
|
2516
|
+
static getModelKeyPath(model, keyPath) {
|
|
2517
|
+
return `${model.typeName}.${keyPath}`;
|
|
2518
|
+
}
|
|
2519
|
+
static getActionKeysByPriority(action, keyPath, customKey, fallbackKey) {
|
|
2520
|
+
const keys = [];
|
|
2521
|
+
if (customKey) {
|
|
2522
|
+
keys.push(customKey);
|
|
2523
|
+
}
|
|
2524
|
+
const modelActionKey = `${action.i18nModelActionBaseKey}.${keyPath}`;
|
|
2525
|
+
const actionKey = `${action.actionName}.${keyPath}`;
|
|
2526
|
+
keys.push(modelActionKey, actionKey);
|
|
2527
|
+
if (fallbackKey) {
|
|
2528
|
+
keys.push(fallbackKey);
|
|
2529
|
+
}
|
|
2530
|
+
return keys;
|
|
2531
|
+
}
|
|
2297
2532
|
static selectKeyByPriority(keys, i18n) {
|
|
2298
2533
|
for (const key of keys) {
|
|
2299
2534
|
if (key !== i18n[key]) {
|
|
@@ -2417,8 +2652,19 @@ function TypeName(typeName) {
|
|
|
2417
2652
|
target[typeNameDecoratorPropertyName] = typeName;
|
|
2418
2653
|
};
|
|
2419
2654
|
}
|
|
2655
|
+
const enumNameDecoratorPropertyName = 'enumName';
|
|
2656
|
+
function EnumName(typeName) {
|
|
2657
|
+
return function (target) {
|
|
2658
|
+
target[enumNameDecoratorPropertyName] = typeName;
|
|
2659
|
+
};
|
|
2660
|
+
}
|
|
2420
2661
|
|
|
2421
2662
|
class TypeUtil {
|
|
2663
|
+
/**
|
|
2664
|
+
* Defines type name decorator.
|
|
2665
|
+
* @param targetType class.
|
|
2666
|
+
* @param typeName Name of the type.
|
|
2667
|
+
*/
|
|
2422
2668
|
static defineReflectTypeName(targetType, typeName) {
|
|
2423
2669
|
if (!typeName) {
|
|
2424
2670
|
typeName = TypeUtil.getDecoratorTypeName(targetType);
|
|
@@ -2431,6 +2677,16 @@ class TypeUtil {
|
|
|
2431
2677
|
Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
|
|
2432
2678
|
}
|
|
2433
2679
|
}
|
|
2680
|
+
/**
|
|
2681
|
+
* Defines enum name decorator.
|
|
2682
|
+
* @param targetType enum object.
|
|
2683
|
+
* @param enumName Name of the enum.
|
|
2684
|
+
*/
|
|
2685
|
+
static defineReflectEnumName(targetType, enumName) {
|
|
2686
|
+
if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
|
|
2687
|
+
Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2434
2690
|
/**
|
|
2435
2691
|
* Gets type name from either decorator or reflect metadata.
|
|
2436
2692
|
* @param type Class.
|
|
@@ -2446,6 +2702,21 @@ class TypeUtil {
|
|
|
2446
2702
|
}
|
|
2447
2703
|
return type.name;
|
|
2448
2704
|
}
|
|
2705
|
+
/**
|
|
2706
|
+
* Gets enum name from either decorator or reflect metadata.
|
|
2707
|
+
* @param enumType Class.
|
|
2708
|
+
*/
|
|
2709
|
+
static findEnumName(enumType) {
|
|
2710
|
+
let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
|
|
2711
|
+
if (decoratorName) {
|
|
2712
|
+
return decoratorName;
|
|
2713
|
+
}
|
|
2714
|
+
decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
|
|
2715
|
+
if (decoratorName) {
|
|
2716
|
+
return decoratorName;
|
|
2717
|
+
}
|
|
2718
|
+
throw new Error('Could not fined enum name');
|
|
2719
|
+
}
|
|
2449
2720
|
/**
|
|
2450
2721
|
* Get value from decorator defined property name
|
|
2451
2722
|
* @param type Class.
|
|
@@ -2454,6 +2725,13 @@ class TypeUtil {
|
|
|
2454
2725
|
static getDecoratorTypeName(type) {
|
|
2455
2726
|
return type[typeNameDecoratorPropertyName];
|
|
2456
2727
|
}
|
|
2728
|
+
/**
|
|
2729
|
+
* Get value from decorator defined property name
|
|
2730
|
+
* @param type Enum object.
|
|
2731
|
+
*/
|
|
2732
|
+
static getDecoratorEnumName(type) {
|
|
2733
|
+
return type[enumNameDecoratorPropertyName];
|
|
2734
|
+
}
|
|
2457
2735
|
}
|
|
2458
2736
|
|
|
2459
2737
|
class ObjectSerializer {
|
|
@@ -2541,12 +2819,17 @@ class ObjectSerializer {
|
|
|
2541
2819
|
}
|
|
2542
2820
|
registerEnums(enums) {
|
|
2543
2821
|
for (const key in enums) {
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2822
|
+
this.registerEnum(enums[key], key);
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2825
|
+
registerEnum(enumType, enumName) {
|
|
2826
|
+
// try to find name from decorator
|
|
2827
|
+
if (typeof this._enumMap[enumName] !== 'undefined') {
|
|
2828
|
+
console.warn(`Registering enum ${enumName} skipped, because enum already exists.`);
|
|
2829
|
+
}
|
|
2830
|
+
else {
|
|
2831
|
+
TypeUtil.defineReflectEnumName(enumType, enumName);
|
|
2832
|
+
this._enumMap[enumName] = enumType;
|
|
2550
2833
|
}
|
|
2551
2834
|
}
|
|
2552
2835
|
findCorrectType(data, expectedType) {
|
|
@@ -4143,9 +4426,7 @@ class MngDropdownComponent {
|
|
|
4143
4426
|
}
|
|
4144
4427
|
writeValue(obj) {
|
|
4145
4428
|
this.dropdownFormControl.setValue(obj, { emitEvent: false });
|
|
4146
|
-
|
|
4147
|
-
this.primeDropdown.writeValue(obj);
|
|
4148
|
-
}
|
|
4429
|
+
this.primeDropdown?.writeValue(obj);
|
|
4149
4430
|
}
|
|
4150
4431
|
}
|
|
4151
4432
|
MngDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngDropdownComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -4338,10 +4619,10 @@ class MngFormlyFieldInputComponent extends FieldType {
|
|
|
4338
4619
|
}
|
|
4339
4620
|
}
|
|
4340
4621
|
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\"
|
|
4622
|
+
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 });
|
|
4342
4623
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
|
|
4343
4624
|
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\"
|
|
4625
|
+
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" }]
|
|
4345
4626
|
}] });
|
|
4346
4627
|
|
|
4347
4628
|
class MngFormlyFieldDropdownComponent extends FieldType {
|
|
@@ -4351,10 +4632,10 @@ class MngFormlyFieldDropdownComponent extends FieldType {
|
|
|
4351
4632
|
}
|
|
4352
4633
|
}
|
|
4353
4634
|
MngFormlyFieldDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4354
|
-
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 });
|
|
4635
|
+
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 });
|
|
4355
4636
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldDropdownComponent, decorators: [{
|
|
4356
4637
|
type: Component,
|
|
4357
|
-
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" }]
|
|
4638
|
+
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" }]
|
|
4358
4639
|
}] });
|
|
4359
4640
|
|
|
4360
4641
|
class MngTableLoadEvent {
|
|
@@ -4438,10 +4719,10 @@ class MngTableColumnFilterComponent {
|
|
|
4438
4719
|
}
|
|
4439
4720
|
}
|
|
4440
4721
|
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 });
|
|
4441
|
-
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 (
|
|
4722
|
+
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 } });
|
|
4442
4723
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnFilterComponent, decorators: [{
|
|
4443
4724
|
type: Component,
|
|
4444
|
-
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 (
|
|
4725
|
+
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" }]
|
|
4445
4726
|
}], ctorParameters: function () { return [{ type: i2$1.PrimeNGConfig }]; }, propDecorators: { descriptor: [{
|
|
4446
4727
|
type: Input
|
|
4447
4728
|
}], display: [{
|
|
@@ -4508,6 +4789,7 @@ class MngTableColumnValueComponent {
|
|
|
4508
4789
|
this.columnTypeNumber = ColumnDescriptor.TypeEnum.Number;
|
|
4509
4790
|
this.columnTypeBoolean = ColumnDescriptor.TypeEnum.Boolean;
|
|
4510
4791
|
this.columnTypeDate = ColumnDescriptor.TypeEnum.Date;
|
|
4792
|
+
this.columnTypeEnum = ColumnDescriptor.TypeEnum.Enum;
|
|
4511
4793
|
}
|
|
4512
4794
|
}
|
|
4513
4795
|
MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -4521,6 +4803,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4521
4803
|
type: Input
|
|
4522
4804
|
}] } });
|
|
4523
4805
|
|
|
4806
|
+
class MngI18nPropertyPipe {
|
|
4807
|
+
transform(property, model) {
|
|
4808
|
+
return I18nUtil.getModelPropertyKey(model, property);
|
|
4809
|
+
}
|
|
4810
|
+
}
|
|
4811
|
+
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4812
|
+
MngI18nPropertyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, name: "i18nProperty" });
|
|
4813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, decorators: [{
|
|
4814
|
+
type: Pipe,
|
|
4815
|
+
args: [{
|
|
4816
|
+
name: 'i18nProperty',
|
|
4817
|
+
pure: true
|
|
4818
|
+
}]
|
|
4819
|
+
}] });
|
|
4820
|
+
|
|
4524
4821
|
var TypeEnum = FilterDescriptor.TypeEnum;
|
|
4525
4822
|
var PaginationModeEnum = TableDescriptor.PaginationModeEnum;
|
|
4526
4823
|
class MngTableComponent {
|
|
@@ -4772,10 +5069,10 @@ class MngTableComponent {
|
|
|
4772
5069
|
}
|
|
4773
5070
|
}
|
|
4774
5071
|
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 });
|
|
5072
|
+
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
5073
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
4777
5074
|
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 {{
|
|
5075
|
+
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
5076
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$2.TranslateService }, { type: TableviewComponentService, decorators: [{
|
|
4780
5077
|
type: Optional
|
|
4781
5078
|
}] }]; }, propDecorators: { descriptor: [{
|
|
@@ -5016,10 +5313,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5016
5313
|
class MngFormlyFieldTabsComponent extends FieldType {
|
|
5017
5314
|
}
|
|
5018
5315
|
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
|
|
5316
|
+
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
5317
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTabsComponent, decorators: [{
|
|
5021
5318
|
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
|
|
5319
|
+
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
5320
|
}] });
|
|
5024
5321
|
|
|
5025
5322
|
class MngFormlyFieldFieldsetComponent extends FieldType {
|
|
@@ -5263,8 +5560,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5263
5560
|
}], ctorParameters: function () { return [{ type: MngCommonsService }]; } });
|
|
5264
5561
|
|
|
5265
5562
|
class MngMenuItemComponent {
|
|
5266
|
-
constructor(router, mngCommons, mainLayoutService) {
|
|
5563
|
+
constructor(injector, router, route, mngCommons, mainLayoutService) {
|
|
5564
|
+
this.injector = injector;
|
|
5267
5565
|
this.router = router;
|
|
5566
|
+
this.route = route;
|
|
5268
5567
|
this.mngCommons = mngCommons;
|
|
5269
5568
|
this.mainLayoutService = mainLayoutService;
|
|
5270
5569
|
this.index = 0;
|
|
@@ -5273,6 +5572,8 @@ class MngMenuItemComponent {
|
|
|
5273
5572
|
this.key = '';
|
|
5274
5573
|
this.active = false;
|
|
5275
5574
|
this.hover = false;
|
|
5575
|
+
this.isAllowedSubject = new BehaviorSubject(true);
|
|
5576
|
+
this.isAllowed$ = this.isAllowedSubject.asObservable().pipe(distinctUntilChanged());
|
|
5276
5577
|
}
|
|
5277
5578
|
ngOnInit() {
|
|
5278
5579
|
if (!this.mngCommons.menuModeIsSlim && this.item.routerLink) {
|
|
@@ -5296,14 +5597,20 @@ class MngMenuItemComponent {
|
|
|
5296
5597
|
this.menuResetSubscription = this.mngCommons.menuReset$.subscribe(() => {
|
|
5297
5598
|
this.active = false;
|
|
5298
5599
|
});
|
|
5299
|
-
this.routerEventsSubscription = this.router.events.
|
|
5300
|
-
if (
|
|
5301
|
-
this.
|
|
5600
|
+
this.routerEventsSubscription = this.router.events.subscribe(next => {
|
|
5601
|
+
if (next instanceof GuardsCheckEnd && next.shouldActivate) {
|
|
5602
|
+
this.checkIfMenuItemIsAllowedFromGuard(next.state);
|
|
5302
5603
|
}
|
|
5303
|
-
else {
|
|
5304
|
-
this.
|
|
5604
|
+
else if (next instanceof NavigationEnd) {
|
|
5605
|
+
if (this.mngCommons.menuModeIsSlim && !this.mainLayoutService.isMobile()) {
|
|
5606
|
+
this.active = false;
|
|
5607
|
+
}
|
|
5608
|
+
else {
|
|
5609
|
+
this.updateActiveStateFromRoute();
|
|
5610
|
+
}
|
|
5305
5611
|
}
|
|
5306
5612
|
});
|
|
5613
|
+
this.checkIfMenuItemIsAllowedFromGuard(this.router.routerState.snapshot);
|
|
5307
5614
|
}
|
|
5308
5615
|
updateActiveStateFromRoute() {
|
|
5309
5616
|
if (this.itemUrl) {
|
|
@@ -5325,10 +5632,6 @@ class MngMenuItemComponent {
|
|
|
5325
5632
|
}
|
|
5326
5633
|
// notify other items
|
|
5327
5634
|
this.mngCommons.menuChangeActiveKey(this.key);
|
|
5328
|
-
// execute command
|
|
5329
|
-
if (this.item.command) {
|
|
5330
|
-
this.item.command({ originalEvent: event, item: this.item });
|
|
5331
|
-
}
|
|
5332
5635
|
// toggle active state
|
|
5333
5636
|
if (this.item.items) {
|
|
5334
5637
|
this.active = !this.active;
|
|
@@ -5360,10 +5663,45 @@ class MngMenuItemComponent {
|
|
|
5360
5663
|
this.menuSourceSubscription?.unsubscribe();
|
|
5361
5664
|
this.menuResetSubscription?.unsubscribe();
|
|
5362
5665
|
this.routerEventsSubscription?.unsubscribe();
|
|
5666
|
+
this.guardsSubscription?.unsubscribe();
|
|
5667
|
+
}
|
|
5668
|
+
checkIfMenuItemIsAllowedFromGuard(routerState) {
|
|
5669
|
+
this.guardsSubscription?.unsubscribe();
|
|
5670
|
+
if (this.item.guards?.length) {
|
|
5671
|
+
const obs = [];
|
|
5672
|
+
for (const guard of this.item.guards) {
|
|
5673
|
+
const tokenInjectedInstance = this.injector.get(guard);
|
|
5674
|
+
if (tokenInjectedInstance && 'canActivate' in tokenInjectedInstance) {
|
|
5675
|
+
const guardInstance = tokenInjectedInstance;
|
|
5676
|
+
const canActivateRes = guardInstance.canActivate(this.route.snapshot, routerState);
|
|
5677
|
+
let canActivateObs;
|
|
5678
|
+
if (canActivateRes instanceof Observable) {
|
|
5679
|
+
canActivateObs = canActivateRes;
|
|
5680
|
+
}
|
|
5681
|
+
else if (canActivateRes instanceof Promise) {
|
|
5682
|
+
canActivateObs = from(canActivateRes);
|
|
5683
|
+
}
|
|
5684
|
+
else {
|
|
5685
|
+
canActivateObs = of(canActivateRes);
|
|
5686
|
+
}
|
|
5687
|
+
obs.push(canActivateObs.pipe(first(), map(res => res === true) // if url tree is present, that means redirect and implies not allowed
|
|
5688
|
+
));
|
|
5689
|
+
}
|
|
5690
|
+
}
|
|
5691
|
+
this.guardsSubscription = combineLatest(obs)
|
|
5692
|
+
.pipe(first())
|
|
5693
|
+
.subscribe(next => {
|
|
5694
|
+
const result = next.every(n => n === true);
|
|
5695
|
+
this.isAllowedSubject.next(result);
|
|
5696
|
+
});
|
|
5697
|
+
}
|
|
5698
|
+
else {
|
|
5699
|
+
this.isAllowedSubject.next(true);
|
|
5700
|
+
}
|
|
5363
5701
|
}
|
|
5364
5702
|
}
|
|
5365
|
-
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 });
|
|
5366
|
-
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.
|
|
5703
|
+
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 });
|
|
5704
|
+
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: [
|
|
5367
5705
|
trigger('children', [
|
|
5368
5706
|
state('void', style({
|
|
5369
5707
|
height: '0px'
|
|
@@ -5415,8 +5753,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5415
5753
|
transition('hiddenAnimated => visibleAnimated', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)')),
|
|
5416
5754
|
transition('void => visibleAnimated, visibleAnimated => void', animate('400ms cubic-bezier(0.86, 0, 0.07, 1)'))
|
|
5417
5755
|
])
|
|
5418
|
-
], 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.
|
|
5419
|
-
}], ctorParameters: function () { return [{ type: i1.Router }, { type: MngCommonsService }, { type: MngMainLayoutComponentService }]; }, propDecorators: { item: [{
|
|
5756
|
+
], 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" }]
|
|
5757
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: MngCommonsService }, { type: MngMainLayoutComponentService }]; }, propDecorators: { item: [{
|
|
5420
5758
|
type: Input
|
|
5421
5759
|
}], index: [{
|
|
5422
5760
|
type: Input
|
|
@@ -5585,7 +5923,7 @@ class MngTableviewComponent {
|
|
|
5585
5923
|
}
|
|
5586
5924
|
}
|
|
5587
5925
|
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 });
|
|
5588
|
-
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$
|
|
5926
|
+
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 } });
|
|
5589
5927
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
5590
5928
|
type: Component,
|
|
5591
5929
|
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" }]
|
|
@@ -5649,6 +5987,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
5649
5987
|
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" }]
|
|
5650
5988
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }]; } });
|
|
5651
5989
|
|
|
5990
|
+
class MngEnumPipe {
|
|
5991
|
+
transform(value, enumObj, i18nPath, nameAsValue = false) {
|
|
5992
|
+
const enumConstantName = nameAsValue ? value : EnumUtil.getConstantNameFromEnumObject(enumObj, value);
|
|
5993
|
+
if (typeof i18nPath === 'undefined') {
|
|
5994
|
+
i18nPath = TypeUtil.findEnumName(enumObj);
|
|
5995
|
+
}
|
|
5996
|
+
return i18nPath ? `${i18nPath}.${enumConstantName}` : enumConstantName;
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
MngEnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6000
|
+
MngEnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, name: "enum" });
|
|
6001
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngEnumPipe, decorators: [{
|
|
6002
|
+
type: Pipe,
|
|
6003
|
+
args: [{
|
|
6004
|
+
name: 'enum',
|
|
6005
|
+
pure: true
|
|
6006
|
+
}]
|
|
6007
|
+
}] });
|
|
6008
|
+
|
|
5652
6009
|
function mngCommonsInitializerProvider(mngCommons) {
|
|
5653
6010
|
return () => mngCommons.initialize();
|
|
5654
6011
|
}
|
|
@@ -5736,6 +6093,15 @@ const formlyTypesConfig = [
|
|
|
5736
6093
|
}
|
|
5737
6094
|
}
|
|
5738
6095
|
},
|
|
6096
|
+
{
|
|
6097
|
+
name: 'mask',
|
|
6098
|
+
extends: 'input',
|
|
6099
|
+
defaultOptions: {
|
|
6100
|
+
templateOptions: {
|
|
6101
|
+
type: 'mask'
|
|
6102
|
+
}
|
|
6103
|
+
}
|
|
6104
|
+
},
|
|
5739
6105
|
{
|
|
5740
6106
|
name: 'dropdown',
|
|
5741
6107
|
component: MngFormlyFieldDropdownComponent,
|
|
@@ -5886,7 +6252,9 @@ const declarations = [
|
|
|
5886
6252
|
MngTemplateDirective,
|
|
5887
6253
|
// pipes
|
|
5888
6254
|
MngPropertyPathPipe,
|
|
6255
|
+
MngEnumPipe,
|
|
5889
6256
|
MngBooleanPipe,
|
|
6257
|
+
MngI18nPropertyPipe,
|
|
5890
6258
|
// layout components
|
|
5891
6259
|
MngBreadcrumbComponent,
|
|
5892
6260
|
MngFooterComponent,
|
|
@@ -5977,7 +6345,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
5977
6345
|
MngTemplateDirective,
|
|
5978
6346
|
// pipes
|
|
5979
6347
|
MngPropertyPathPipe,
|
|
6348
|
+
MngEnumPipe,
|
|
5980
6349
|
MngBooleanPipe,
|
|
6350
|
+
MngI18nPropertyPipe,
|
|
5981
6351
|
// layout components
|
|
5982
6352
|
MngBreadcrumbComponent,
|
|
5983
6353
|
MngFooterComponent,
|
|
@@ -6086,7 +6456,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
6086
6456
|
MngTemplateDirective,
|
|
6087
6457
|
// pipes
|
|
6088
6458
|
MngPropertyPathPipe,
|
|
6459
|
+
MngEnumPipe,
|
|
6089
6460
|
MngBooleanPipe,
|
|
6461
|
+
MngI18nPropertyPipe,
|
|
6090
6462
|
// layout components
|
|
6091
6463
|
MngBreadcrumbComponent,
|
|
6092
6464
|
MngFooterComponent,
|
|
@@ -6305,8 +6677,12 @@ class RoutesBuilder {
|
|
|
6305
6677
|
addRouteRedirect(path, redirectTo, pathMatch = 'prefix') {
|
|
6306
6678
|
return this.addRouteBuilder(RouteBuilder.createRedirect(path, redirectTo, pathMatch));
|
|
6307
6679
|
}
|
|
6308
|
-
addLazyRoute(path, loadChildren) {
|
|
6309
|
-
|
|
6680
|
+
addLazyRoute(path, loadChildren, canLoad) {
|
|
6681
|
+
const route = { path: path, loadChildren: loadChildren };
|
|
6682
|
+
if (canLoad?.length) {
|
|
6683
|
+
route.canLoad = canLoad;
|
|
6684
|
+
}
|
|
6685
|
+
return this.addRouteBuilder(RouteBuilder.createFromRoute(route));
|
|
6310
6686
|
}
|
|
6311
6687
|
addRoute(path, component) {
|
|
6312
6688
|
return this.addRouteBuilder(RouteBuilder.create(path, component));
|
|
@@ -6446,11 +6822,32 @@ class RouteBuilder {
|
|
|
6446
6822
|
this.withBreadcrumb(title);
|
|
6447
6823
|
return this;
|
|
6448
6824
|
}
|
|
6825
|
+
withCanActivate(diToken) {
|
|
6826
|
+
if (!this.route.canActivate) {
|
|
6827
|
+
this.route.canActivate = [];
|
|
6828
|
+
}
|
|
6829
|
+
this.route.canActivate.push(diToken);
|
|
6830
|
+
return this;
|
|
6831
|
+
}
|
|
6832
|
+
withCanDeactivate(diToken) {
|
|
6833
|
+
if (!this.route.canDeactivate) {
|
|
6834
|
+
this.route.canDeactivate = [];
|
|
6835
|
+
}
|
|
6836
|
+
this.route.canDeactivate.push(diToken);
|
|
6837
|
+
return this;
|
|
6838
|
+
}
|
|
6839
|
+
withResolver(diToken, name) {
|
|
6840
|
+
if (!this.route.resolve) {
|
|
6841
|
+
this.route.resolve = {};
|
|
6842
|
+
}
|
|
6843
|
+
this.route.resolve[name] = diToken;
|
|
6844
|
+
return this;
|
|
6845
|
+
}
|
|
6449
6846
|
withData(data) {
|
|
6450
6847
|
this.route.data = data;
|
|
6451
6848
|
return this;
|
|
6452
6849
|
}
|
|
6453
|
-
|
|
6850
|
+
withMngMenuItem(menuItem) {
|
|
6454
6851
|
this.menuItem = menuItem;
|
|
6455
6852
|
return this;
|
|
6456
6853
|
}
|
|
@@ -6522,34 +6919,61 @@ class RouteBuilder {
|
|
|
6522
6919
|
}
|
|
6523
6920
|
}
|
|
6524
6921
|
}
|
|
6922
|
+
if (this.route.canActivate) {
|
|
6923
|
+
angularRoute.canActivate = [...this.route.canActivate];
|
|
6924
|
+
}
|
|
6925
|
+
if (this.route.canActivateChild) {
|
|
6926
|
+
angularRoute.canActivateChild = [...this.route.canActivateChild];
|
|
6927
|
+
}
|
|
6928
|
+
if (this.route.canLoad) {
|
|
6929
|
+
angularRoute.canLoad = [...this.route.canLoad];
|
|
6930
|
+
}
|
|
6931
|
+
if (this.route.canDeactivate) {
|
|
6932
|
+
angularRoute.canDeactivate = [...this.route.canDeactivate];
|
|
6933
|
+
}
|
|
6934
|
+
if (this.route.resolve) {
|
|
6935
|
+
angularRoute.resolve = { ...this.route.resolve };
|
|
6936
|
+
}
|
|
6525
6937
|
return angularRoute;
|
|
6526
6938
|
}
|
|
6527
6939
|
buildMenu() {
|
|
6528
|
-
const
|
|
6940
|
+
const menuItemBuild = this.menuItem ? { ...this.menuItem } : null;
|
|
6529
6941
|
const routeChildrenMenuItems = this.children.flatMap(child => child.buildMenu());
|
|
6530
6942
|
const menuItemChildren = [];
|
|
6531
|
-
const
|
|
6532
|
-
if (
|
|
6533
|
-
|
|
6943
|
+
const menuItemChildrenBuild = [];
|
|
6944
|
+
if (menuItemBuild?.items) {
|
|
6945
|
+
menuItemChildrenBuild.push(...menuItemBuild.items);
|
|
6534
6946
|
}
|
|
6535
6947
|
for (const menuItemChild of this.menuItemChildren) {
|
|
6536
6948
|
const finalMenuItemChild = { ...menuItemChild };
|
|
6537
6949
|
if (!finalMenuItemChild.routerLink) {
|
|
6538
6950
|
finalMenuItemChild.routerLink = this.routePath;
|
|
6539
6951
|
}
|
|
6952
|
+
if (typeof finalMenuItemChild.routerLink === 'string') {
|
|
6953
|
+
finalMenuItemChild.routerLink = [finalMenuItemChild.routerLink];
|
|
6954
|
+
}
|
|
6540
6955
|
finalMenuItemChild.routerLink = RouteUtil.removeEmptyPathSegments(finalMenuItemChild.routerLink);
|
|
6541
6956
|
menuItemChildren.push(finalMenuItemChild);
|
|
6542
6957
|
}
|
|
6543
|
-
|
|
6544
|
-
if (!
|
|
6545
|
-
return
|
|
6958
|
+
menuItemChildrenBuild.push(...menuItemChildren, ...routeChildrenMenuItems);
|
|
6959
|
+
if (!menuItemBuild) {
|
|
6960
|
+
return menuItemChildrenBuild;
|
|
6961
|
+
}
|
|
6962
|
+
menuItemBuild.label = menuItemBuild.label ?? this.pageTitle;
|
|
6963
|
+
if (typeof menuItemBuild.routerLink === 'string') {
|
|
6964
|
+
menuItemBuild.routerLink = [menuItemBuild.routerLink];
|
|
6965
|
+
}
|
|
6966
|
+
menuItemBuild.routerLink = RouteUtil.removeEmptyPathSegments(menuItemBuild.routerLink ?? this.routePath);
|
|
6967
|
+
if (menuItemChildrenBuild.length > 0) {
|
|
6968
|
+
menuItemBuild.items = menuItemChildrenBuild;
|
|
6546
6969
|
}
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6970
|
+
if (!menuItemBuild.guards) {
|
|
6971
|
+
const guards = this.findMenuItemGuards();
|
|
6972
|
+
if (guards.length > 0) {
|
|
6973
|
+
menuItemBuild.guards = guards;
|
|
6974
|
+
}
|
|
6551
6975
|
}
|
|
6552
|
-
return [
|
|
6976
|
+
return [menuItemBuild];
|
|
6553
6977
|
}
|
|
6554
6978
|
createMenuItem(icon, label, routerLink) {
|
|
6555
6979
|
const menuItem = {};
|
|
@@ -6567,13 +6991,30 @@ class RouteBuilder {
|
|
|
6567
6991
|
adjustMenuRouterLinksFromBuilder(menuItems) {
|
|
6568
6992
|
for (const menuItem of menuItems) {
|
|
6569
6993
|
if (menuItem.routerLink) {
|
|
6570
|
-
menuItem.routerLink = RouteUtil.appendPathToBasePath(this.routePath, menuItem.routerLink);
|
|
6994
|
+
menuItem.routerLink = RouteUtil.appendPathToBasePath(this.routePath, typeof menuItem.routerLink === 'string' ? [menuItem.routerLink] : menuItem.routerLink);
|
|
6571
6995
|
}
|
|
6572
6996
|
if (Array.isArray(menuItem.items)) {
|
|
6573
6997
|
this.adjustMenuRouterLinksFromBuilder(menuItem.items);
|
|
6574
6998
|
}
|
|
6575
6999
|
}
|
|
6576
7000
|
}
|
|
7001
|
+
findMenuItemGuards() {
|
|
7002
|
+
const guards = [];
|
|
7003
|
+
if (this.route.canActivate?.length) {
|
|
7004
|
+
guards.push(...this.route.canActivate);
|
|
7005
|
+
}
|
|
7006
|
+
if (this.parent) {
|
|
7007
|
+
// Check for parent guards that should be included in decision to hide menu item!
|
|
7008
|
+
// Some parent routes might have guards, but no menu items, so this guards must be taken into account here,
|
|
7009
|
+
// because there is no parent menu item to hide.
|
|
7010
|
+
this.parent.findMenuItemGuards().forEach(g => {
|
|
7011
|
+
if (guards.indexOf(g) < 0) {
|
|
7012
|
+
guards.push(g);
|
|
7013
|
+
}
|
|
7014
|
+
});
|
|
7015
|
+
}
|
|
7016
|
+
return guards;
|
|
7017
|
+
}
|
|
6577
7018
|
}
|
|
6578
7019
|
|
|
6579
7020
|
/*
|
|
@@ -6584,5 +7025,5 @@ class RouteBuilder {
|
|
|
6584
7025
|
* Generated bundle index. Do not edit.
|
|
6585
7026
|
*/
|
|
6586
7027
|
|
|
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 };
|
|
7028
|
+
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 };
|
|
6588
7029
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|