@mediusinc/mng-commons 0.3.3 → 0.4.0
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/esm2020/lib/api/models/builders/query-param.builder.mjs +7 -2
- package/esm2020/lib/api/services/api.abstract.service.mjs +21 -10
- package/esm2020/lib/api/utils/object-serializer.util.mjs +7 -1
- package/esm2020/lib/components/action/action.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +3 -3
- package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
- package/esm2020/lib/components/layout/topbar.component.mjs +1 -1
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +17 -5
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +1 -10
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +21 -7
- package/esm2020/lib/components/tableview/table/table.component.mjs +3 -3
- package/esm2020/lib/components/tableview/tableview.component.mjs +3 -3
- package/esm2020/lib/descriptors/column.descriptor.mjs +197 -0
- package/esm2020/lib/descriptors/editor.descriptor.mjs +3 -755
- package/esm2020/lib/descriptors/field.descriptor.interface.mjs +2 -0
- package/esm2020/lib/descriptors/field.descriptor.mjs +755 -0
- package/esm2020/lib/descriptors/filter.descriptor.mjs +237 -0
- package/esm2020/lib/descriptors/index.mjs +5 -1
- package/esm2020/lib/descriptors/table.descriptor.mjs +4 -403
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +3 -3
- package/esm2020/lib/directives/component.directive.mjs +18 -2
- package/esm2020/lib/mng-commons.module.mjs +5 -5
- package/esm2020/lib/models/column-value.model.mjs +2 -0
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/pipes/index.mjs +2 -2
- package/esm2020/lib/pipes/json-path.pipe.mjs +80 -0
- package/esm2020/lib/utils/model.util.mjs +16 -15
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +1416 -1282
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +1411 -1279
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/builders/query-param.builder.d.ts +2 -1
- package/lib/api/services/api.abstract.service.d.ts +10 -5
- package/lib/api/utils/object-serializer.util.d.ts +4 -2
- package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -2
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +5 -1
- package/lib/components/tableview/table/column-value/column-value.component.d.ts +5 -1
- package/lib/descriptors/column.descriptor.d.ts +66 -0
- package/lib/descriptors/editor.descriptor.d.ts +1 -299
- package/lib/descriptors/field.descriptor.d.ts +301 -0
- package/lib/descriptors/{editor.descriptor.interface.d.ts → field.descriptor.interface.d.ts} +0 -0
- package/lib/descriptors/filter.descriptor.d.ts +108 -0
- package/lib/descriptors/index.d.ts +4 -0
- package/lib/descriptors/table.descriptor.d.ts +5 -164
- package/lib/descriptors/tableview.descriptor.d.ts +4 -2
- package/lib/directives/component.directive.d.ts +5 -1
- package/lib/mng-commons.module.d.ts +2 -2
- package/lib/models/column-value.model.d.ts +4 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/pipes/index.d.ts +1 -1
- package/lib/pipes/json-path.pipe.d.ts +13 -0
- package/lib/utils/model.util.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/scss/mng-overrides/_layout_action.scss +7 -0
- package/scss/mng-overrides/_layout_dialog.scss +17 -6
- package/scss/mng-overrides/_mixins.scss +60 -0
- package/scss/theme/default/_mng-variables-theme-dark.scss +2 -3
- package/scss/theme/default/_mng-variables-theme-light.scss +2 -3
- package/scss/theme/default/_mng-variables.scss +12 -0
- package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +0 -2
- package/esm2020/lib/pipes/property-path.pipe.mjs +0 -36
- package/lib/pipes/property-path.pipe.d.ts +0 -7
|
@@ -314,6 +314,7 @@ class MediusQueryParamBuilder {
|
|
|
314
314
|
const queryParam = new MediusQueryParam();
|
|
315
315
|
queryParam.itemsPerPage = itemsPerPage;
|
|
316
316
|
queryParam.itemsOffset = itemsOffset;
|
|
317
|
+
queryParam.queryMode = MediusQueryMode.All;
|
|
317
318
|
return new MediusQueryParamBuilder(queryParam);
|
|
318
319
|
}
|
|
319
320
|
withItemsPerPage(itemsPerPage) {
|
|
@@ -324,6 +325,10 @@ class MediusQueryParamBuilder {
|
|
|
324
325
|
this.queryParam.itemsOffset = itemsOffset;
|
|
325
326
|
return this;
|
|
326
327
|
}
|
|
328
|
+
withQueryMode(queryMode) {
|
|
329
|
+
this.queryParam.queryMode = queryMode;
|
|
330
|
+
return this;
|
|
331
|
+
}
|
|
327
332
|
withSort(property, asc = true) {
|
|
328
333
|
if (!this.queryParam.sortProperty || !this.queryParam.sortAsc) {
|
|
329
334
|
this.queryParam.sortProperty = [];
|
|
@@ -949,1550 +954,1583 @@ var ActionLevelEnum;
|
|
|
949
954
|
ActionLevelEnum[ActionLevelEnum["Danger"] = 7] = "Danger";
|
|
950
955
|
})(ActionLevelEnum || (ActionLevelEnum = {}));
|
|
951
956
|
|
|
952
|
-
class
|
|
953
|
-
constructor(
|
|
954
|
-
this.
|
|
955
|
-
this.
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
var MngFormFieldEventTypeEnum;
|
|
959
|
-
(function (MngFormFieldEventTypeEnum) {
|
|
960
|
-
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Component"] = 0] = "Component";
|
|
961
|
-
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["ValueChange"] = 1] = "ValueChange";
|
|
962
|
-
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["DataProvider"] = 2] = "DataProvider";
|
|
963
|
-
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Dialog"] = 3] = "Dialog";
|
|
964
|
-
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Other"] = 4] = "Other";
|
|
965
|
-
})(MngFormFieldEventTypeEnum || (MngFormFieldEventTypeEnum = {}));
|
|
966
|
-
class MngFormFieldEventComponentSubtype {
|
|
967
|
-
}
|
|
968
|
-
MngFormFieldEventComponentSubtype.ON_INIT = 'Component.OnInit';
|
|
969
|
-
MngFormFieldEventComponentSubtype.ON_VIEW_INIT = 'Component.OnViewInit';
|
|
970
|
-
MngFormFieldEventComponentSubtype.ON_CONTENT_INIT = 'Component.OnContentInit';
|
|
971
|
-
MngFormFieldEventComponentSubtype.ON_DESTROY = 'Component.OnDestroy';
|
|
972
|
-
class MngFormFieldEventDialogSubtype {
|
|
973
|
-
}
|
|
974
|
-
MngFormFieldEventDialogSubtype.VISIBILITY = 'Dialog.Visibility';
|
|
975
|
-
MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE = 'Dialog.MngTable.CaptionComponentInstance';
|
|
976
|
-
MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = 'Dialog.MngTable.ColumnActionsComponentInstance';
|
|
977
|
-
class MngFormFieldEvent {
|
|
978
|
-
constructor(type, componentType, componentInstance, data = {}) {
|
|
979
|
-
this.type = type;
|
|
980
|
-
this.componentType = componentType;
|
|
981
|
-
this.componentInstance = componentInstance;
|
|
982
|
-
this.data = data;
|
|
957
|
+
class FilterDescriptor {
|
|
958
|
+
constructor(property) {
|
|
959
|
+
this._filterType = FilterDescriptor.TypeEnum.String;
|
|
960
|
+
this._matchModes = null;
|
|
961
|
+
this._className = '';
|
|
962
|
+
this._property = property;
|
|
983
963
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
class EditorDescriptor {
|
|
987
|
-
constructor(modelType, idProperty, titleProperty, tableviewEditorType = EditorDescriptor.TableviewEditorTypeEnum.None) {
|
|
988
|
-
this._tabs = [];
|
|
989
|
-
this._groups = [];
|
|
990
|
-
this._fields = [];
|
|
991
|
-
this._disabled = false;
|
|
992
|
-
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
993
|
-
this._tableviewEditorType = tableviewEditorType;
|
|
964
|
+
get filterType() {
|
|
965
|
+
return this._filterType;
|
|
994
966
|
}
|
|
995
|
-
get
|
|
996
|
-
return this.
|
|
967
|
+
get filterProperty() {
|
|
968
|
+
return this._filterProperty;
|
|
997
969
|
}
|
|
998
|
-
get
|
|
999
|
-
return this.
|
|
970
|
+
get matchModes() {
|
|
971
|
+
return this._matchModes;
|
|
1000
972
|
}
|
|
1001
|
-
get
|
|
1002
|
-
return this.
|
|
973
|
+
get placeholder() {
|
|
974
|
+
return this._placeholder;
|
|
1003
975
|
}
|
|
1004
|
-
get
|
|
1005
|
-
return this.
|
|
976
|
+
get className() {
|
|
977
|
+
return this._className;
|
|
1006
978
|
}
|
|
1007
|
-
get
|
|
1008
|
-
return this.
|
|
979
|
+
get property() {
|
|
980
|
+
return this._property;
|
|
1009
981
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
title = I18nUtil.getModelTabKey(this.model, name);
|
|
1014
|
-
}
|
|
1015
|
-
tabGroup.withTitle(title);
|
|
1016
|
-
this.createTabGroupDescriptor(tabGroup);
|
|
1017
|
-
return tabGroup;
|
|
982
|
+
asFilterType(filterType) {
|
|
983
|
+
this._filterType = filterType;
|
|
984
|
+
return this;
|
|
1018
985
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
}
|
|
1027
|
-
this.createFieldGroupDescriptor(fieldGroup);
|
|
1028
|
-
return fieldGroup;
|
|
986
|
+
/**
|
|
987
|
+
* Sets different filter property name instead of default property. Use this if API requires different property provided to perform correct filter.
|
|
988
|
+
* @param filterProperty
|
|
989
|
+
*/
|
|
990
|
+
withFilterProperty(filterProperty) {
|
|
991
|
+
this._filterProperty = filterProperty;
|
|
992
|
+
return this;
|
|
1029
993
|
}
|
|
1030
|
-
|
|
1031
|
-
this.
|
|
1032
|
-
this._fields.push(field);
|
|
1033
|
-
this._currentGroup?.addField(field);
|
|
994
|
+
withPlaceholder(placeholder) {
|
|
995
|
+
this._placeholder = placeholder;
|
|
1034
996
|
return this;
|
|
1035
997
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
this
|
|
1039
|
-
return field;
|
|
998
|
+
withClassName(className) {
|
|
999
|
+
this._className = className;
|
|
1000
|
+
return this;
|
|
1040
1001
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
if (fieldIdx < 0) {
|
|
1044
|
-
throw new Error(`Field ${property} does not exist.`);
|
|
1045
|
-
}
|
|
1046
|
-
const field = this._fields[fieldIdx];
|
|
1047
|
-
if (field.group) {
|
|
1048
|
-
const groupFieldIdx = field.group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
1049
|
-
if (groupFieldIdx >= 0) {
|
|
1050
|
-
field.group.fields.splice(groupFieldIdx, 1);
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
this._fields.splice(fieldIdx, 1);
|
|
1002
|
+
withMatchModes(matchModes) {
|
|
1003
|
+
this._matchModes = matchModes;
|
|
1054
1004
|
return this;
|
|
1055
1005
|
}
|
|
1056
|
-
|
|
1057
|
-
|
|
1006
|
+
copy() {
|
|
1007
|
+
const descriptor = new FilterDescriptor(this._property);
|
|
1008
|
+
this.copyFieldsTo(descriptor);
|
|
1009
|
+
return descriptor;
|
|
1058
1010
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
this.
|
|
1062
|
-
|
|
1011
|
+
copyFieldsTo(descriptor) {
|
|
1012
|
+
descriptor._filterType = this._filterType;
|
|
1013
|
+
descriptor._filterProperty = this._filterProperty;
|
|
1014
|
+
descriptor._placeholder = this._placeholder;
|
|
1015
|
+
descriptor._className = this._className;
|
|
1063
1016
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1017
|
+
}
|
|
1018
|
+
(function (FilterDescriptor) {
|
|
1019
|
+
let TypeEnum;
|
|
1020
|
+
(function (TypeEnum) {
|
|
1021
|
+
TypeEnum[TypeEnum["String"] = 0] = "String";
|
|
1022
|
+
TypeEnum[TypeEnum["Number"] = 1] = "Number";
|
|
1023
|
+
TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
|
|
1024
|
+
TypeEnum[TypeEnum["Date"] = 3] = "Date";
|
|
1025
|
+
TypeEnum[TypeEnum["Lookup"] = 4] = "Lookup";
|
|
1026
|
+
TypeEnum[TypeEnum["LookupEnum"] = 5] = "LookupEnum";
|
|
1027
|
+
})(TypeEnum = FilterDescriptor.TypeEnum || (FilterDescriptor.TypeEnum = {}));
|
|
1028
|
+
let MatchModeEnum;
|
|
1029
|
+
(function (MatchModeEnum) {
|
|
1030
|
+
MatchModeEnum["StartsWith"] = "startsWith";
|
|
1031
|
+
MatchModeEnum["Contains"] = "contains";
|
|
1032
|
+
MatchModeEnum["EndsWith"] = "endsWith";
|
|
1033
|
+
MatchModeEnum["Equals"] = "equals";
|
|
1034
|
+
MatchModeEnum["NotEquals"] = "notEquals";
|
|
1035
|
+
MatchModeEnum["In"] = "in";
|
|
1036
|
+
MatchModeEnum["LessThan"] = "lt";
|
|
1037
|
+
MatchModeEnum["LessThanOrEqualTo"] = "lte";
|
|
1038
|
+
MatchModeEnum["GreaterThan"] = "gt";
|
|
1039
|
+
MatchModeEnum["GreaterThanOrEqualTo"] = "gte";
|
|
1040
|
+
MatchModeEnum["Between"] = "between";
|
|
1041
|
+
MatchModeEnum["DateIs"] = "dateIs";
|
|
1042
|
+
MatchModeEnum["DateIsNot"] = "dateIsNot";
|
|
1043
|
+
MatchModeEnum["DateBefore"] = "dateBefore";
|
|
1044
|
+
MatchModeEnum["DateAfter"] = "dateAfter";
|
|
1045
|
+
})(MatchModeEnum = FilterDescriptor.MatchModeEnum || (FilterDescriptor.MatchModeEnum = {}));
|
|
1046
|
+
})(FilterDescriptor || (FilterDescriptor = {}));
|
|
1047
|
+
class FilterLookupDescriptor extends FilterDescriptor {
|
|
1048
|
+
constructor(property, modelType) {
|
|
1049
|
+
super(property);
|
|
1050
|
+
this._modelType = null;
|
|
1051
|
+
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Dropdown;
|
|
1052
|
+
this._itemsLabelTranslate = false;
|
|
1053
|
+
this._multiselect = false;
|
|
1054
|
+
this._dropdownClassName = 'mng-filter-lookup-dropdown';
|
|
1055
|
+
this._autocompleteOpenOnFocus = false;
|
|
1056
|
+
this._autocompleteInlineSearch = false;
|
|
1057
|
+
this._modelType = modelType;
|
|
1058
|
+
this._filterType = FilterDescriptor.TypeEnum.Lookup;
|
|
1059
|
+
ModelUtil.trySetLookupItemsProperties(this);
|
|
1068
1060
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
this.addFieldDescriptor(field);
|
|
1072
|
-
return field;
|
|
1061
|
+
get lookupType() {
|
|
1062
|
+
return this._lookupType;
|
|
1073
1063
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
this.addFieldDescriptor(field);
|
|
1077
|
-
return field;
|
|
1064
|
+
get dataProvider() {
|
|
1065
|
+
return this._dataProvider;
|
|
1078
1066
|
}
|
|
1079
|
-
|
|
1080
|
-
this.
|
|
1081
|
-
return this;
|
|
1067
|
+
get itemsLabelProperty() {
|
|
1068
|
+
return this._itemsLabelProperty;
|
|
1082
1069
|
}
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
this._currentGroup.withValidator(name, expression);
|
|
1086
|
-
}
|
|
1070
|
+
get itemsLabelTranslate() {
|
|
1071
|
+
return this._itemsLabelTranslate;
|
|
1087
1072
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
for (const tabGroup of this._tabs) {
|
|
1091
|
-
editor.createTabGroupDescriptor(tabGroup.copy());
|
|
1092
|
-
}
|
|
1093
|
-
for (const tabGroup of editor._tabs) {
|
|
1094
|
-
for (const fieldGroup of tabGroup.fields) {
|
|
1095
|
-
editor._fields.push(...fieldGroup.fields);
|
|
1096
|
-
}
|
|
1097
|
-
editor._groups.push(...tabGroup.fields);
|
|
1098
|
-
}
|
|
1099
|
-
editor._currentTabGroup = editor._tabs[editor._tabs.length - 1];
|
|
1100
|
-
editor._currentGroup = editor._currentTabGroup.fields[editor._currentTabGroup.fields.length - 1];
|
|
1101
|
-
editor._disabled = this._disabled;
|
|
1102
|
-
return editor;
|
|
1073
|
+
get itemsValueProperty() {
|
|
1074
|
+
return this._itemsValueProperty;
|
|
1103
1075
|
}
|
|
1104
|
-
|
|
1105
|
-
this.
|
|
1106
|
-
this._currentGroup = fieldGroup;
|
|
1107
|
-
this._groups.push(fieldGroup);
|
|
1108
|
-
this._currentTabGroup?.addField(fieldGroup);
|
|
1109
|
-
return this;
|
|
1076
|
+
get dataKeyProperty() {
|
|
1077
|
+
return this._dataKeyProperty;
|
|
1110
1078
|
}
|
|
1111
|
-
|
|
1112
|
-
this.
|
|
1113
|
-
this._tabs.push(tabGroup);
|
|
1114
|
-
return this;
|
|
1079
|
+
get multiselect() {
|
|
1080
|
+
return this._multiselect;
|
|
1115
1081
|
}
|
|
1116
|
-
|
|
1117
|
-
this.
|
|
1118
|
-
if (this._currentTabGroup?.fields.length === 0) {
|
|
1119
|
-
this.createFieldGroup(EditorDescriptor.defaultGroupName, null);
|
|
1120
|
-
}
|
|
1082
|
+
get autocompleteOpenOnFocus() {
|
|
1083
|
+
return this._autocompleteOpenOnFocus;
|
|
1121
1084
|
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
|
|
1125
|
-
}
|
|
1085
|
+
get autocompleteInlineSearch() {
|
|
1086
|
+
return this._autocompleteInlineSearch;
|
|
1126
1087
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
(function (EditorDescriptor) {
|
|
1130
|
-
let TableviewEditorTypeEnum;
|
|
1131
|
-
(function (TableviewEditorTypeEnum) {
|
|
1132
|
-
TableviewEditorTypeEnum[TableviewEditorTypeEnum["None"] = 0] = "None";
|
|
1133
|
-
TableviewEditorTypeEnum[TableviewEditorTypeEnum["View"] = 1] = "View";
|
|
1134
|
-
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Edit"] = 2] = "Edit";
|
|
1135
|
-
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Add"] = 3] = "Add";
|
|
1136
|
-
})(TableviewEditorTypeEnum = EditorDescriptor.TableviewEditorTypeEnum || (EditorDescriptor.TableviewEditorTypeEnum = {}));
|
|
1137
|
-
})(EditorDescriptor || (EditorDescriptor = {}));
|
|
1138
|
-
class AGenericFieldDescriptor {
|
|
1139
|
-
constructor(editor) {
|
|
1140
|
-
this._config = {};
|
|
1141
|
-
this._editor = editor;
|
|
1088
|
+
get dropdownClassName() {
|
|
1089
|
+
return this._dropdownClassName;
|
|
1142
1090
|
}
|
|
1143
|
-
get
|
|
1144
|
-
return this.
|
|
1091
|
+
get modelType() {
|
|
1092
|
+
return this._modelType;
|
|
1145
1093
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1094
|
+
withItemsLabelProperty(itemsLabelProperty, translate = false) {
|
|
1095
|
+
this._itemsLabelProperty = itemsLabelProperty;
|
|
1096
|
+
this._itemsLabelTranslate = translate;
|
|
1097
|
+
return this;
|
|
1148
1098
|
}
|
|
1149
|
-
|
|
1150
|
-
this.
|
|
1099
|
+
withItemsValueProperty(itemsValueProperty) {
|
|
1100
|
+
this._itemsValueProperty = itemsValueProperty;
|
|
1101
|
+
this._dataKeyProperty = itemsValueProperty;
|
|
1102
|
+
return this;
|
|
1103
|
+
}
|
|
1104
|
+
withDataKeyProperty(dataKeyProperty) {
|
|
1105
|
+
this._dataKeyProperty = dataKeyProperty;
|
|
1106
|
+
this._itemsValueProperty = dataKeyProperty;
|
|
1107
|
+
return this;
|
|
1108
|
+
}
|
|
1109
|
+
withLookup(lookup, serviceType) {
|
|
1110
|
+
const dataProvider = new LookupDataProvider(this._modelType);
|
|
1111
|
+
if (serviceType) {
|
|
1112
|
+
dataProvider.withServiceType(serviceType);
|
|
1113
|
+
}
|
|
1114
|
+
dataProvider.withLookup(lookup);
|
|
1115
|
+
this._dataProvider = dataProvider;
|
|
1116
|
+
return this;
|
|
1117
|
+
}
|
|
1118
|
+
withLookupDataProvider(dataProvider) {
|
|
1119
|
+
this._dataProvider = dataProvider;
|
|
1120
|
+
return this;
|
|
1121
|
+
}
|
|
1122
|
+
withMultiselect(multiselect = true) {
|
|
1123
|
+
this._multiselect = multiselect;
|
|
1124
|
+
return this;
|
|
1125
|
+
}
|
|
1126
|
+
withDropdownClassName(dropdownClassName) {
|
|
1127
|
+
this._dropdownClassName = dropdownClassName;
|
|
1128
|
+
return this;
|
|
1129
|
+
}
|
|
1130
|
+
asAutocomplete(openOnFocus = false, inlineSearch = false) {
|
|
1131
|
+
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Autocomplete;
|
|
1132
|
+
this._autocompleteOpenOnFocus = openOnFocus;
|
|
1133
|
+
this._autocompleteInlineSearch = inlineSearch;
|
|
1151
1134
|
return this;
|
|
1152
1135
|
}
|
|
1136
|
+
copy() {
|
|
1137
|
+
const descriptor = new FilterLookupDescriptor(this._property, this._modelType);
|
|
1138
|
+
this.copyFieldsTo(descriptor);
|
|
1139
|
+
return descriptor;
|
|
1140
|
+
}
|
|
1141
|
+
copyFieldsTo(filter) {
|
|
1142
|
+
super.copyFieldsTo(filter);
|
|
1143
|
+
filter._dataProvider = this._dataProvider;
|
|
1144
|
+
filter._lookupType = this._lookupType;
|
|
1145
|
+
filter._itemsLabelProperty = this._itemsLabelProperty;
|
|
1146
|
+
filter._itemsLabelTranslate = this._itemsLabelTranslate;
|
|
1147
|
+
filter._itemsValueProperty = this._itemsValueProperty;
|
|
1148
|
+
filter._dataKeyProperty = this._dataKeyProperty;
|
|
1149
|
+
filter._multiselect = this._multiselect;
|
|
1150
|
+
filter._dropdownClassName = this._dropdownClassName;
|
|
1151
|
+
filter._autocompleteOpenOnFocus = this._autocompleteOpenOnFocus;
|
|
1152
|
+
filter._autocompleteInlineSearch = this._autocompleteInlineSearch;
|
|
1153
|
+
}
|
|
1153
1154
|
}
|
|
1154
|
-
class
|
|
1155
|
-
constructor(
|
|
1156
|
-
super(
|
|
1157
|
-
this.
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
this.
|
|
1166
|
-
this.
|
|
1155
|
+
class FilterLookupEnumDescriptor extends FilterLookupDescriptor {
|
|
1156
|
+
constructor(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
1157
|
+
super(property, null);
|
|
1158
|
+
this._enumType = enumType;
|
|
1159
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
1160
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1161
|
+
}
|
|
1162
|
+
const optionEnumValues = Array.isArray(options)
|
|
1163
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
|
|
1164
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1165
|
+
const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
|
|
1166
|
+
this.withLookupDataProvider(dataProvider);
|
|
1167
|
+
this.withItemsLabelProperty('title', optionsTitlePath !== null);
|
|
1168
|
+
this.withItemsValueProperty('value');
|
|
1167
1169
|
}
|
|
1168
|
-
get
|
|
1169
|
-
return this.
|
|
1170
|
+
get enumType() {
|
|
1171
|
+
return this._enumType;
|
|
1170
1172
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
+
asAutocomplete(openOnFocus = true) {
|
|
1174
|
+
super.asAutocomplete(openOnFocus, true);
|
|
1175
|
+
return this;
|
|
1173
1176
|
}
|
|
1174
|
-
|
|
1175
|
-
|
|
1177
|
+
copy() {
|
|
1178
|
+
const field = new FilterLookupEnumDescriptor(this._property, this._enumType, []);
|
|
1179
|
+
this.copyFieldsTo(field);
|
|
1180
|
+
return field;
|
|
1176
1181
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1182
|
+
}
|
|
1183
|
+
(function (FilterLookupDescriptor) {
|
|
1184
|
+
let LookupTypeEnum;
|
|
1185
|
+
(function (LookupTypeEnum) {
|
|
1186
|
+
LookupTypeEnum[LookupTypeEnum["Dropdown"] = 0] = "Dropdown";
|
|
1187
|
+
LookupTypeEnum[LookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
|
|
1188
|
+
})(LookupTypeEnum = FilterLookupDescriptor.LookupTypeEnum || (FilterLookupDescriptor.LookupTypeEnum = {}));
|
|
1189
|
+
})(FilterLookupDescriptor || (FilterLookupDescriptor = {}));
|
|
1190
|
+
|
|
1191
|
+
class ColumnDescriptor {
|
|
1192
|
+
constructor(table, property) {
|
|
1193
|
+
this._columnType = ColumnDescriptor.TypeEnum.String;
|
|
1194
|
+
this._isSortEnabled = false;
|
|
1195
|
+
this._enumNameAsValue = false;
|
|
1196
|
+
// boolean specifics
|
|
1197
|
+
this._booleanAsIcon = false;
|
|
1198
|
+
this._table = table;
|
|
1199
|
+
this._property = property;
|
|
1179
1200
|
}
|
|
1180
|
-
get
|
|
1181
|
-
return this.
|
|
1201
|
+
get columnType() {
|
|
1202
|
+
return this._columnType;
|
|
1182
1203
|
}
|
|
1183
|
-
get
|
|
1184
|
-
return this.
|
|
1204
|
+
get title() {
|
|
1205
|
+
return this._title;
|
|
1185
1206
|
}
|
|
1186
|
-
get
|
|
1187
|
-
return this.
|
|
1207
|
+
get jsonPath() {
|
|
1208
|
+
return this._jsonPath;
|
|
1188
1209
|
}
|
|
1189
|
-
get
|
|
1190
|
-
return this.
|
|
1210
|
+
get isSortEnabled() {
|
|
1211
|
+
return this._isSortEnabled;
|
|
1191
1212
|
}
|
|
1192
|
-
get
|
|
1193
|
-
return this.
|
|
1213
|
+
get filterDescriptor() {
|
|
1214
|
+
return this._filterDescriptor;
|
|
1194
1215
|
}
|
|
1195
|
-
get
|
|
1196
|
-
return this.
|
|
1216
|
+
get displayFormat() {
|
|
1217
|
+
return this._displayFormat;
|
|
1197
1218
|
}
|
|
1198
|
-
get
|
|
1199
|
-
return this.
|
|
1219
|
+
get table() {
|
|
1220
|
+
return this._table;
|
|
1200
1221
|
}
|
|
1201
|
-
get
|
|
1202
|
-
return this.
|
|
1222
|
+
get property() {
|
|
1223
|
+
return this._property;
|
|
1203
1224
|
}
|
|
1204
|
-
get
|
|
1205
|
-
return this.
|
|
1225
|
+
get enumType() {
|
|
1226
|
+
return this._enumType;
|
|
1206
1227
|
}
|
|
1207
|
-
get
|
|
1208
|
-
return this.
|
|
1228
|
+
get enumTitlePath() {
|
|
1229
|
+
return this._enumTitlePath;
|
|
1209
1230
|
}
|
|
1210
|
-
get
|
|
1211
|
-
return this.
|
|
1231
|
+
get enumNameAsValue() {
|
|
1232
|
+
return this._enumNameAsValue;
|
|
1212
1233
|
}
|
|
1213
|
-
get
|
|
1214
|
-
return this.
|
|
1234
|
+
get booleanAsIcon() {
|
|
1235
|
+
return this._booleanAsIcon;
|
|
1215
1236
|
}
|
|
1216
|
-
get
|
|
1217
|
-
return this.
|
|
1237
|
+
get booleanYes() {
|
|
1238
|
+
return this._booleanYes;
|
|
1218
1239
|
}
|
|
1219
|
-
get
|
|
1220
|
-
return this.
|
|
1240
|
+
get booleanNo() {
|
|
1241
|
+
return this._booleanNo;
|
|
1221
1242
|
}
|
|
1222
|
-
get
|
|
1223
|
-
return this.
|
|
1243
|
+
get objectModelType() {
|
|
1244
|
+
return this._objectModelType;
|
|
1224
1245
|
}
|
|
1225
|
-
get
|
|
1226
|
-
return this.
|
|
1246
|
+
get objectTitleProperty() {
|
|
1247
|
+
return this._objectTitleProperty;
|
|
1227
1248
|
}
|
|
1228
|
-
|
|
1229
|
-
this.
|
|
1230
|
-
return this;
|
|
1249
|
+
get customComponentType() {
|
|
1250
|
+
return this._customComponentType;
|
|
1231
1251
|
}
|
|
1232
|
-
|
|
1233
|
-
this.
|
|
1252
|
+
asType(type = ColumnDescriptor.TypeEnum.String) {
|
|
1253
|
+
this._columnType = type;
|
|
1234
1254
|
return this;
|
|
1235
1255
|
}
|
|
1236
|
-
|
|
1237
|
-
this.
|
|
1256
|
+
asNumber(displayFormat = '1.0-0') {
|
|
1257
|
+
this._columnType = ColumnDescriptor.TypeEnum.Number;
|
|
1258
|
+
this._displayFormat = displayFormat;
|
|
1238
1259
|
return this;
|
|
1239
1260
|
}
|
|
1240
|
-
|
|
1241
|
-
this.
|
|
1242
|
-
|
|
1243
|
-
this._requiredExpression = requiredExpression;
|
|
1244
|
-
}
|
|
1261
|
+
asDate(displayFormat = 'dd.MM.yyyy') {
|
|
1262
|
+
this._columnType = ColumnDescriptor.TypeEnum.Date;
|
|
1263
|
+
this._displayFormat = displayFormat;
|
|
1245
1264
|
return this;
|
|
1246
1265
|
}
|
|
1247
|
-
|
|
1248
|
-
this.
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1266
|
+
asBoolean(yes, no, asIcon = false) {
|
|
1267
|
+
this._columnType = ColumnDescriptor.TypeEnum.Boolean;
|
|
1268
|
+
this._booleanAsIcon = asIcon;
|
|
1269
|
+
this._booleanYes = yes;
|
|
1270
|
+
this._booleanNo = no;
|
|
1252
1271
|
return this;
|
|
1253
1272
|
}
|
|
1254
|
-
|
|
1255
|
-
this.
|
|
1273
|
+
asEnum(enumType, nameAsValue = false, titlePath) {
|
|
1274
|
+
this._columnType = ColumnDescriptor.TypeEnum.Enum;
|
|
1275
|
+
this._enumType = enumType;
|
|
1276
|
+
this._enumNameAsValue = nameAsValue;
|
|
1277
|
+
if (typeof titlePath === 'undefined') {
|
|
1278
|
+
titlePath = TypeUtil.findEnumName(enumType);
|
|
1279
|
+
}
|
|
1280
|
+
this._enumTitlePath = titlePath;
|
|
1256
1281
|
return this;
|
|
1257
1282
|
}
|
|
1258
|
-
|
|
1259
|
-
this.
|
|
1283
|
+
asCustomComponent(customComponentType) {
|
|
1284
|
+
this._columnType = ColumnDescriptor.TypeEnum.Custom;
|
|
1285
|
+
this._customComponentType = customComponentType;
|
|
1260
1286
|
return this;
|
|
1261
1287
|
}
|
|
1262
|
-
|
|
1263
|
-
this.
|
|
1288
|
+
withObjectProperty(modelType, titleProperty) {
|
|
1289
|
+
this._objectModelType = modelType;
|
|
1290
|
+
if (!titleProperty) {
|
|
1291
|
+
this._objectTitleProperty = ModelUtil.findTitleAttribute(modelType) ?? undefined;
|
|
1292
|
+
}
|
|
1293
|
+
else {
|
|
1294
|
+
this._objectTitleProperty = titleProperty;
|
|
1295
|
+
}
|
|
1264
1296
|
return this;
|
|
1265
1297
|
}
|
|
1266
|
-
|
|
1267
|
-
this.
|
|
1298
|
+
withTitle(title) {
|
|
1299
|
+
this._title = title;
|
|
1268
1300
|
return this;
|
|
1269
1301
|
}
|
|
1270
|
-
|
|
1271
|
-
this.
|
|
1302
|
+
withJsonPath(path) {
|
|
1303
|
+
this._jsonPath = path;
|
|
1272
1304
|
return this;
|
|
1273
1305
|
}
|
|
1274
|
-
|
|
1275
|
-
this.
|
|
1276
|
-
|
|
1277
|
-
this.
|
|
1278
|
-
|
|
1306
|
+
withFilter(forceSimple = false) {
|
|
1307
|
+
this._filterDescriptor = new FilterDescriptor(this._property);
|
|
1308
|
+
let filterType;
|
|
1309
|
+
if (!forceSimple && this._objectModelType) {
|
|
1310
|
+
return this.withFilterLookup();
|
|
1311
|
+
}
|
|
1312
|
+
switch (this._columnType) {
|
|
1313
|
+
case ColumnDescriptor.TypeEnum.Number:
|
|
1314
|
+
filterType = FilterDescriptor.TypeEnum.Number;
|
|
1315
|
+
break;
|
|
1316
|
+
case ColumnDescriptor.TypeEnum.Boolean:
|
|
1317
|
+
filterType = FilterDescriptor.TypeEnum.Boolean;
|
|
1318
|
+
break;
|
|
1319
|
+
case ColumnDescriptor.TypeEnum.Date:
|
|
1320
|
+
filterType = FilterDescriptor.TypeEnum.Date;
|
|
1321
|
+
break;
|
|
1322
|
+
case ColumnDescriptor.TypeEnum.Enum:
|
|
1323
|
+
if (!forceSimple) {
|
|
1324
|
+
return this.withFilterLookupEnum();
|
|
1325
|
+
}
|
|
1326
|
+
else {
|
|
1327
|
+
filterType = FilterDescriptor.TypeEnum.String;
|
|
1328
|
+
break;
|
|
1329
|
+
}
|
|
1330
|
+
case ColumnDescriptor.TypeEnum.String:
|
|
1331
|
+
case ColumnDescriptor.TypeEnum.Custom:
|
|
1332
|
+
default:
|
|
1333
|
+
filterType = FilterDescriptor.TypeEnum.String;
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
this._filterDescriptor.asFilterType(filterType);
|
|
1337
|
+
return this._filterDescriptor;
|
|
1279
1338
|
}
|
|
1280
|
-
|
|
1281
|
-
this.
|
|
1282
|
-
|
|
1339
|
+
withFilterLookup() {
|
|
1340
|
+
const filterDescriptor = new FilterLookupDescriptor(this._property, this._objectModelType ?? null);
|
|
1341
|
+
this._filterDescriptor = filterDescriptor;
|
|
1342
|
+
return filterDescriptor;
|
|
1283
1343
|
}
|
|
1284
|
-
|
|
1285
|
-
this.
|
|
1344
|
+
withFilterLookupEnum(options) {
|
|
1345
|
+
if (this._columnType !== ColumnDescriptor.TypeEnum.Enum || !this._enumType) {
|
|
1346
|
+
throw new Error(`Column ${this._property} is not of type enum or enum type is undefined.`);
|
|
1347
|
+
}
|
|
1348
|
+
const filterDescriptor = new FilterLookupEnumDescriptor(this._property, this._enumType, options, this._enumNameAsValue, this._enumTitlePath);
|
|
1349
|
+
this._filterDescriptor = filterDescriptor;
|
|
1350
|
+
return filterDescriptor;
|
|
1286
1351
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1352
|
+
withSort(isEnabled = true) {
|
|
1353
|
+
this._isSortEnabled = isEnabled;
|
|
1354
|
+
return this;
|
|
1289
1355
|
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1356
|
+
copy() {
|
|
1357
|
+
const descriptor = new ColumnDescriptor(this._table, this._property);
|
|
1358
|
+
descriptor._jsonPath = this._jsonPath;
|
|
1359
|
+
descriptor._title = this._title;
|
|
1360
|
+
descriptor._isSortEnabled = this._isSortEnabled;
|
|
1361
|
+
descriptor._columnType = this._columnType;
|
|
1362
|
+
descriptor._filterDescriptor = this._filterDescriptor?.copy();
|
|
1363
|
+
descriptor._enumType = this._enumType;
|
|
1364
|
+
descriptor._enumTitlePath = this._enumTitlePath;
|
|
1365
|
+
descriptor._enumNameAsValue = this._enumNameAsValue;
|
|
1366
|
+
descriptor._booleanAsIcon = this._booleanAsIcon;
|
|
1367
|
+
descriptor._booleanYes = this._booleanYes;
|
|
1368
|
+
descriptor._booleanNo = this._booleanNo;
|
|
1369
|
+
descriptor._objectModelType = this._objectModelType;
|
|
1370
|
+
descriptor._objectTitleProperty = this._objectTitleProperty;
|
|
1371
|
+
return descriptor;
|
|
1305
1372
|
}
|
|
1306
1373
|
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
this.
|
|
1323
|
-
this.
|
|
1374
|
+
(function (ColumnDescriptor) {
|
|
1375
|
+
let TypeEnum;
|
|
1376
|
+
(function (TypeEnum) {
|
|
1377
|
+
TypeEnum[TypeEnum["String"] = 0] = "String";
|
|
1378
|
+
TypeEnum[TypeEnum["Number"] = 1] = "Number";
|
|
1379
|
+
TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
|
|
1380
|
+
TypeEnum[TypeEnum["Date"] = 3] = "Date";
|
|
1381
|
+
TypeEnum[TypeEnum["Enum"] = 4] = "Enum";
|
|
1382
|
+
TypeEnum[TypeEnum["Custom"] = 5] = "Custom";
|
|
1383
|
+
})(TypeEnum = ColumnDescriptor.TypeEnum || (ColumnDescriptor.TypeEnum = {}));
|
|
1384
|
+
})(ColumnDescriptor || (ColumnDescriptor = {}));
|
|
1385
|
+
|
|
1386
|
+
class EditorDescriptor {
|
|
1387
|
+
constructor(modelType, idProperty, titleProperty, tableviewEditorType = EditorDescriptor.TableviewEditorTypeEnum.None) {
|
|
1388
|
+
this._tabs = [];
|
|
1389
|
+
this._groups = [];
|
|
1390
|
+
this._fields = [];
|
|
1391
|
+
this._disabled = false;
|
|
1392
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
1393
|
+
this._tableviewEditorType = tableviewEditorType;
|
|
1324
1394
|
}
|
|
1325
|
-
get
|
|
1326
|
-
return this.
|
|
1395
|
+
get model() {
|
|
1396
|
+
return this._model;
|
|
1327
1397
|
}
|
|
1328
|
-
get
|
|
1329
|
-
return this.
|
|
1398
|
+
get tabs() {
|
|
1399
|
+
return this._tabs;
|
|
1330
1400
|
}
|
|
1331
|
-
get
|
|
1332
|
-
return this.
|
|
1401
|
+
get fields() {
|
|
1402
|
+
return this._fields;
|
|
1333
1403
|
}
|
|
1334
|
-
get
|
|
1335
|
-
return this.
|
|
1404
|
+
get tableviewEditorType() {
|
|
1405
|
+
return this._disabled;
|
|
1336
1406
|
}
|
|
1337
|
-
get
|
|
1338
|
-
return this.
|
|
1407
|
+
get disabled() {
|
|
1408
|
+
return this._disabled;
|
|
1339
1409
|
}
|
|
1340
|
-
|
|
1341
|
-
|
|
1410
|
+
createTabGroup(name, title) {
|
|
1411
|
+
const tabGroup = new FieldTabGroupDescriptor(this, name);
|
|
1412
|
+
if (!title) {
|
|
1413
|
+
title = I18nUtil.getModelTabKey(this.model, name);
|
|
1414
|
+
}
|
|
1415
|
+
tabGroup.withTitle(title);
|
|
1416
|
+
this.createTabGroupDescriptor(tabGroup);
|
|
1417
|
+
return tabGroup;
|
|
1342
1418
|
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1419
|
+
createFieldGroup(name, title) {
|
|
1420
|
+
const fieldGroup = new FieldGroupDescriptor(this, name);
|
|
1421
|
+
if (title !== null) {
|
|
1422
|
+
if (!title) {
|
|
1423
|
+
title = I18nUtil.getModelGroupKey(this.model, name);
|
|
1424
|
+
}
|
|
1425
|
+
fieldGroup.withTitle(title);
|
|
1426
|
+
}
|
|
1427
|
+
this.createFieldGroupDescriptor(fieldGroup);
|
|
1428
|
+
return fieldGroup;
|
|
1345
1429
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1430
|
+
addFieldDescriptor(field) {
|
|
1431
|
+
this.createDefaultGroup();
|
|
1432
|
+
this._fields.push(field);
|
|
1433
|
+
this._currentGroup?.addField(field);
|
|
1434
|
+
return this;
|
|
1348
1435
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1436
|
+
addField(property) {
|
|
1437
|
+
const field = new FieldInputDescriptor(this, property);
|
|
1438
|
+
this.addFieldDescriptor(field);
|
|
1439
|
+
return field;
|
|
1351
1440
|
}
|
|
1352
|
-
|
|
1353
|
-
|
|
1441
|
+
removeField(property) {
|
|
1442
|
+
const fieldIdx = this._fields.findIndex(f => f.property === property);
|
|
1443
|
+
if (fieldIdx < 0) {
|
|
1444
|
+
throw new Error(`Field ${property} does not exist.`);
|
|
1445
|
+
}
|
|
1446
|
+
const field = this._fields[fieldIdx];
|
|
1447
|
+
if (field.group) {
|
|
1448
|
+
const groupFieldIdx = field.group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
1449
|
+
if (groupFieldIdx >= 0) {
|
|
1450
|
+
field.group.fields.splice(groupFieldIdx, 1);
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
this._fields.splice(fieldIdx, 1);
|
|
1454
|
+
return this;
|
|
1354
1455
|
}
|
|
1355
|
-
|
|
1356
|
-
return this.
|
|
1456
|
+
getField(property) {
|
|
1457
|
+
return this._fields.find(f => f.property === property) ?? null;
|
|
1357
1458
|
}
|
|
1358
|
-
|
|
1359
|
-
|
|
1459
|
+
addFieldLookup(property, modelType) {
|
|
1460
|
+
const field = new FieldLookupDescriptor(this, property, modelType);
|
|
1461
|
+
this.addFieldDescriptor(field);
|
|
1462
|
+
return field;
|
|
1360
1463
|
}
|
|
1361
|
-
|
|
1362
|
-
|
|
1464
|
+
addFieldLookupEnum(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
1465
|
+
const field = new FieldLookupEnumDescriptor(this, property, enumType, options, nameAsValue, optionsTitlePath);
|
|
1466
|
+
this.addFieldDescriptor(field);
|
|
1467
|
+
return field;
|
|
1363
1468
|
}
|
|
1364
|
-
|
|
1365
|
-
|
|
1469
|
+
addFieldManyEditor(property, tableviewDescriptor) {
|
|
1470
|
+
const field = new FieldManyEditorDescriptor(this, property, tableviewDescriptor);
|
|
1471
|
+
this.addFieldDescriptor(field);
|
|
1472
|
+
return field;
|
|
1366
1473
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1474
|
+
addFieldManyToManyEditor(property, mainTableDescriptor, lookupTableDescriptor) {
|
|
1475
|
+
const field = new FieldManyToManyEditorDescriptor(this, property, mainTableDescriptor, lookupTableDescriptor);
|
|
1476
|
+
this.addFieldDescriptor(field);
|
|
1477
|
+
return field;
|
|
1369
1478
|
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1479
|
+
withDisabled(disabled = true) {
|
|
1480
|
+
this._disabled = disabled;
|
|
1481
|
+
return this;
|
|
1372
1482
|
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1483
|
+
addValidator(name, expression) {
|
|
1484
|
+
if (this._currentGroup) {
|
|
1485
|
+
this._currentGroup.withValidator(name, expression);
|
|
1486
|
+
}
|
|
1375
1487
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1488
|
+
copy() {
|
|
1489
|
+
const editor = new EditorDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
1490
|
+
for (const tabGroup of this._tabs) {
|
|
1491
|
+
editor.createTabGroupDescriptor(tabGroup.copy());
|
|
1492
|
+
}
|
|
1493
|
+
for (const tabGroup of editor._tabs) {
|
|
1494
|
+
for (const fieldGroup of tabGroup.fields) {
|
|
1495
|
+
editor._fields.push(...fieldGroup.fields);
|
|
1496
|
+
}
|
|
1497
|
+
editor._groups.push(...tabGroup.fields);
|
|
1498
|
+
}
|
|
1499
|
+
editor._currentTabGroup = editor._tabs[editor._tabs.length - 1];
|
|
1500
|
+
editor._currentGroup = editor._currentTabGroup.fields[editor._currentTabGroup.fields.length - 1];
|
|
1501
|
+
editor._disabled = this._disabled;
|
|
1502
|
+
return editor;
|
|
1378
1503
|
}
|
|
1379
|
-
|
|
1380
|
-
|
|
1504
|
+
createFieldGroupDescriptor(fieldGroup) {
|
|
1505
|
+
this.createDefaultTabGroup();
|
|
1506
|
+
this._currentGroup = fieldGroup;
|
|
1507
|
+
this._groups.push(fieldGroup);
|
|
1508
|
+
this._currentTabGroup?.addField(fieldGroup);
|
|
1509
|
+
return this;
|
|
1381
1510
|
}
|
|
1382
|
-
|
|
1383
|
-
this.
|
|
1511
|
+
createTabGroupDescriptor(tabGroup) {
|
|
1512
|
+
this._currentTabGroup = tabGroup;
|
|
1513
|
+
this._tabs.push(tabGroup);
|
|
1384
1514
|
return this;
|
|
1385
1515
|
}
|
|
1386
|
-
|
|
1387
|
-
this.
|
|
1388
|
-
this.
|
|
1389
|
-
|
|
1390
|
-
this._pattern = pattern;
|
|
1391
|
-
if (isEmail) {
|
|
1392
|
-
this.withValidator('email', control => !Validators.email(control));
|
|
1516
|
+
createDefaultGroup() {
|
|
1517
|
+
this.createDefaultTabGroup();
|
|
1518
|
+
if (this._currentTabGroup?.fields.length === 0) {
|
|
1519
|
+
this.createFieldGroup(EditorDescriptor.defaultGroupName, null);
|
|
1393
1520
|
}
|
|
1394
|
-
return this;
|
|
1395
1521
|
}
|
|
1396
|
-
|
|
1397
|
-
this.
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
this._maxLength = maxLength;
|
|
1401
|
-
this._pattern = pattern;
|
|
1402
|
-
return this;
|
|
1522
|
+
createDefaultTabGroup() {
|
|
1523
|
+
if (this._tabs.length === 0) {
|
|
1524
|
+
this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
|
|
1525
|
+
}
|
|
1403
1526
|
}
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1527
|
+
}
|
|
1528
|
+
EditorDescriptor.defaultGroupName = '_default';
|
|
1529
|
+
(function (EditorDescriptor) {
|
|
1530
|
+
let TableviewEditorTypeEnum;
|
|
1531
|
+
(function (TableviewEditorTypeEnum) {
|
|
1532
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["None"] = 0] = "None";
|
|
1533
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["View"] = 1] = "View";
|
|
1534
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Edit"] = 2] = "Edit";
|
|
1535
|
+
TableviewEditorTypeEnum[TableviewEditorTypeEnum["Add"] = 3] = "Add";
|
|
1536
|
+
})(TableviewEditorTypeEnum = EditorDescriptor.TableviewEditorTypeEnum || (EditorDescriptor.TableviewEditorTypeEnum = {}));
|
|
1537
|
+
})(EditorDescriptor || (EditorDescriptor = {}));
|
|
1538
|
+
|
|
1539
|
+
class MngFormEditorSubmitEvent {
|
|
1540
|
+
constructor(formItem) {
|
|
1541
|
+
this.formItem = formItem;
|
|
1542
|
+
this.success = true;
|
|
1413
1543
|
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1544
|
+
}
|
|
1545
|
+
var MngFormFieldEventTypeEnum;
|
|
1546
|
+
(function (MngFormFieldEventTypeEnum) {
|
|
1547
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Component"] = 0] = "Component";
|
|
1548
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["ValueChange"] = 1] = "ValueChange";
|
|
1549
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["DataProvider"] = 2] = "DataProvider";
|
|
1550
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Dialog"] = 3] = "Dialog";
|
|
1551
|
+
MngFormFieldEventTypeEnum[MngFormFieldEventTypeEnum["Other"] = 4] = "Other";
|
|
1552
|
+
})(MngFormFieldEventTypeEnum || (MngFormFieldEventTypeEnum = {}));
|
|
1553
|
+
class MngFormFieldEventComponentSubtype {
|
|
1554
|
+
}
|
|
1555
|
+
MngFormFieldEventComponentSubtype.ON_INIT = 'Component.OnInit';
|
|
1556
|
+
MngFormFieldEventComponentSubtype.ON_VIEW_INIT = 'Component.OnViewInit';
|
|
1557
|
+
MngFormFieldEventComponentSubtype.ON_CONTENT_INIT = 'Component.OnContentInit';
|
|
1558
|
+
MngFormFieldEventComponentSubtype.ON_DESTROY = 'Component.OnDestroy';
|
|
1559
|
+
class MngFormFieldEventDialogSubtype {
|
|
1560
|
+
}
|
|
1561
|
+
MngFormFieldEventDialogSubtype.VISIBILITY = 'Dialog.Visibility';
|
|
1562
|
+
MngFormFieldEventDialogSubtype.TABLE_CAPTION_COMPONENT_INSTANCE = 'Dialog.MngTable.CaptionComponentInstance';
|
|
1563
|
+
MngFormFieldEventDialogSubtype.TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = 'Dialog.MngTable.ColumnActionsComponentInstance';
|
|
1564
|
+
class MngFormFieldEvent {
|
|
1565
|
+
constructor(type, componentType, componentInstance, data = {}) {
|
|
1566
|
+
this.type = type;
|
|
1567
|
+
this.componentType = componentType;
|
|
1568
|
+
this.componentInstance = componentInstance;
|
|
1569
|
+
this.data = data;
|
|
1417
1570
|
}
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
class AGenericFieldDescriptor {
|
|
1574
|
+
constructor(editor) {
|
|
1575
|
+
this._config = {};
|
|
1576
|
+
this._editor = editor;
|
|
1422
1577
|
}
|
|
1423
|
-
|
|
1424
|
-
this.
|
|
1425
|
-
if (typeof optionsTitlePath === 'undefined') {
|
|
1426
|
-
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1427
|
-
}
|
|
1428
|
-
this._radioOptions = Array.isArray(values)
|
|
1429
|
-
? EnumUtil.fromValuesAsEnumValueArray(enumType, values, nameAsValue, optionsTitlePath ?? undefined)
|
|
1430
|
-
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1431
|
-
return this;
|
|
1578
|
+
get editor() {
|
|
1579
|
+
return this._editor;
|
|
1432
1580
|
}
|
|
1433
|
-
|
|
1434
|
-
this.
|
|
1435
|
-
this._datePickerFormat = format ? format : 'dd.mm.yy';
|
|
1436
|
-
this._datePickerMin = min;
|
|
1437
|
-
this._datePickerMax = max;
|
|
1438
|
-
this._datePickerShowTime = showTime ?? false;
|
|
1439
|
-
return this;
|
|
1581
|
+
get config() {
|
|
1582
|
+
return this._config;
|
|
1440
1583
|
}
|
|
1441
|
-
|
|
1442
|
-
this.
|
|
1443
|
-
this._mask = mask;
|
|
1444
|
-
this._slotChar = slotChar;
|
|
1584
|
+
withConfig(config) {
|
|
1585
|
+
this._config = config;
|
|
1445
1586
|
return this;
|
|
1446
1587
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1588
|
+
}
|
|
1589
|
+
class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
1590
|
+
constructor(editor, property) {
|
|
1591
|
+
super(editor);
|
|
1592
|
+
this._required = false;
|
|
1593
|
+
this._disabled = false;
|
|
1594
|
+
this._validators = [];
|
|
1595
|
+
this._className = '';
|
|
1596
|
+
this._labelClassName = '';
|
|
1597
|
+
this._inputClassName = '';
|
|
1598
|
+
this._size = FieldDescriptor.SizeEnum.Normal;
|
|
1599
|
+
this._eventsSubject = new Subject();
|
|
1600
|
+
this._property = property;
|
|
1601
|
+
this._label = I18nUtil.getModelPropertyKey(this._editor.model, property);
|
|
1451
1602
|
}
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
this.copyFieldsTo(field);
|
|
1455
|
-
field._fieldType = this._fieldType;
|
|
1456
|
-
field._rows = this._rows;
|
|
1457
|
-
field._numberMin = this._numberMin;
|
|
1458
|
-
field._numberMax = this._numberMax;
|
|
1459
|
-
field._numberStep = this._numberStep;
|
|
1460
|
-
field._numberMinFractionDigits = this._numberMinFractionDigits;
|
|
1461
|
-
field._numberMaxFractionDigits = this._numberMaxFractionDigits;
|
|
1462
|
-
field._numberUseGrouping = this._numberUseGrouping;
|
|
1463
|
-
field._radioOptions = [...this._radioOptions];
|
|
1464
|
-
field._datePickerFormat = this._datePickerFormat;
|
|
1465
|
-
field._datePickerMin = this._datePickerMin;
|
|
1466
|
-
field._datePickerMax = this._datePickerMax;
|
|
1467
|
-
field._datePickerShowTime = this._datePickerShowTime;
|
|
1468
|
-
field._maxLength = this._maxLength;
|
|
1469
|
-
field._minLength = this._minLength;
|
|
1470
|
-
field._pattern = this._pattern;
|
|
1471
|
-
field._mask = this._mask;
|
|
1472
|
-
field._slotChar = this._slotChar;
|
|
1473
|
-
field._customComponentName = this._customComponentName;
|
|
1474
|
-
return field;
|
|
1603
|
+
get property() {
|
|
1604
|
+
return this._property;
|
|
1475
1605
|
}
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
TypeEnum[TypeEnum["Switch"] = 4] = "Switch";
|
|
1485
|
-
TypeEnum[TypeEnum["Radio"] = 5] = "Radio";
|
|
1486
|
-
TypeEnum[TypeEnum["Datepicker"] = 6] = "Datepicker";
|
|
1487
|
-
TypeEnum[TypeEnum["Mask"] = 7] = "Mask";
|
|
1488
|
-
TypeEnum[TypeEnum["Custom"] = 8] = "Custom";
|
|
1489
|
-
})(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
|
|
1490
|
-
})(FieldInputDescriptor || (FieldInputDescriptor = {}));
|
|
1491
|
-
class FieldLookupDescriptor extends AFieldDescriptor {
|
|
1492
|
-
constructor(editor, property, modelType) {
|
|
1493
|
-
super(editor, property);
|
|
1494
|
-
this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Dropdown;
|
|
1495
|
-
this._itemsLabelTranslate = false;
|
|
1496
|
-
this._dropdownClassName = 'mng-filter-lookup-dropdown';
|
|
1497
|
-
this._autocompleteOpenOnFocus = false;
|
|
1498
|
-
this._autocompleteInlineSearch = false;
|
|
1499
|
-
this._modelType = modelType;
|
|
1500
|
-
ModelUtil.trySetLookupItemsProperties(this);
|
|
1606
|
+
get group() {
|
|
1607
|
+
return this._group;
|
|
1608
|
+
}
|
|
1609
|
+
get label() {
|
|
1610
|
+
return this._label;
|
|
1611
|
+
}
|
|
1612
|
+
get placeholder() {
|
|
1613
|
+
return this._placeholder;
|
|
1501
1614
|
}
|
|
1502
|
-
get
|
|
1503
|
-
return this.
|
|
1615
|
+
get helpText() {
|
|
1616
|
+
return this._helpText;
|
|
1504
1617
|
}
|
|
1505
|
-
get
|
|
1506
|
-
return this.
|
|
1618
|
+
get required() {
|
|
1619
|
+
return this._required;
|
|
1507
1620
|
}
|
|
1508
|
-
get
|
|
1509
|
-
return this.
|
|
1621
|
+
get disabled() {
|
|
1622
|
+
return this._disabled;
|
|
1510
1623
|
}
|
|
1511
|
-
get
|
|
1512
|
-
return this.
|
|
1624
|
+
get defaultValue() {
|
|
1625
|
+
return this._defaultValue;
|
|
1513
1626
|
}
|
|
1514
|
-
get
|
|
1515
|
-
return this.
|
|
1627
|
+
get getter() {
|
|
1628
|
+
return this._getter;
|
|
1516
1629
|
}
|
|
1517
|
-
get
|
|
1518
|
-
return this.
|
|
1630
|
+
get setter() {
|
|
1631
|
+
return this._setter;
|
|
1519
1632
|
}
|
|
1520
|
-
get
|
|
1521
|
-
return this.
|
|
1633
|
+
get validators() {
|
|
1634
|
+
return this._validators;
|
|
1522
1635
|
}
|
|
1523
|
-
get
|
|
1524
|
-
return this.
|
|
1636
|
+
get requiredExpression() {
|
|
1637
|
+
return this._requiredExpression;
|
|
1525
1638
|
}
|
|
1526
|
-
get
|
|
1527
|
-
return this.
|
|
1639
|
+
get disabledExpression() {
|
|
1640
|
+
return this._disabledExpression;
|
|
1528
1641
|
}
|
|
1529
|
-
get
|
|
1530
|
-
return this.
|
|
1642
|
+
get hiddenExpression() {
|
|
1643
|
+
return this._hiddenExpression;
|
|
1531
1644
|
}
|
|
1532
|
-
get
|
|
1533
|
-
return this.
|
|
1645
|
+
get className() {
|
|
1646
|
+
return this._className;
|
|
1534
1647
|
}
|
|
1535
|
-
get
|
|
1536
|
-
return this.
|
|
1648
|
+
get labelClassName() {
|
|
1649
|
+
return this._labelClassName;
|
|
1537
1650
|
}
|
|
1538
|
-
get
|
|
1539
|
-
return this.
|
|
1651
|
+
get inputClassName() {
|
|
1652
|
+
return this._inputClassName;
|
|
1540
1653
|
}
|
|
1541
|
-
|
|
1542
|
-
this.
|
|
1543
|
-
this._itemsLabelTranslate = translate;
|
|
1544
|
-
return this;
|
|
1654
|
+
get size() {
|
|
1655
|
+
return this._size;
|
|
1545
1656
|
}
|
|
1546
|
-
|
|
1547
|
-
this.
|
|
1548
|
-
|
|
1657
|
+
get isSizeSmall() {
|
|
1658
|
+
return this._size === FieldDescriptor.SizeEnum.Small;
|
|
1659
|
+
}
|
|
1660
|
+
get isSizeLarge() {
|
|
1661
|
+
return this._size === FieldDescriptor.SizeEnum.Large;
|
|
1662
|
+
}
|
|
1663
|
+
withLabel(label) {
|
|
1664
|
+
this._label = label;
|
|
1549
1665
|
return this;
|
|
1550
1666
|
}
|
|
1551
|
-
|
|
1552
|
-
this.
|
|
1667
|
+
withPlaceholder(placeholder) {
|
|
1668
|
+
this._placeholder = placeholder;
|
|
1553
1669
|
return this;
|
|
1554
1670
|
}
|
|
1555
|
-
|
|
1556
|
-
this.
|
|
1557
|
-
this._itemsValueProperty = undefined;
|
|
1671
|
+
withHelpText(helpText) {
|
|
1672
|
+
this._helpText = helpText;
|
|
1558
1673
|
return this;
|
|
1559
1674
|
}
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
if (
|
|
1563
|
-
|
|
1675
|
+
withRequired(required = true, requiredExpression) {
|
|
1676
|
+
this._required = required;
|
|
1677
|
+
if (requiredExpression) {
|
|
1678
|
+
this._requiredExpression = requiredExpression;
|
|
1564
1679
|
}
|
|
1565
|
-
dataProvider.withLookup(lookup);
|
|
1566
|
-
this._dataProvider = dataProvider;
|
|
1567
1680
|
return this;
|
|
1568
1681
|
}
|
|
1569
|
-
|
|
1570
|
-
this.
|
|
1682
|
+
withDisabled(disabled = true, disabledExpression) {
|
|
1683
|
+
this._disabled = disabled;
|
|
1684
|
+
if (disabledExpression) {
|
|
1685
|
+
this._disabledExpression = disabledExpression;
|
|
1686
|
+
}
|
|
1571
1687
|
return this;
|
|
1572
1688
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
}
|
|
1576
|
-
asAutocomplete(openOnFocus = false, inlineSearch = false) {
|
|
1577
|
-
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Autocomplete;
|
|
1578
|
-
this._autocompleteOpenOnFocus = openOnFocus;
|
|
1579
|
-
this._autocompleteInlineSearch = inlineSearch;
|
|
1689
|
+
withHidden(hiddenExpression) {
|
|
1690
|
+
this._hiddenExpression = hiddenExpression;
|
|
1580
1691
|
return this;
|
|
1581
1692
|
}
|
|
1582
|
-
|
|
1583
|
-
this.
|
|
1584
|
-
this._dialogTableDescriptor = lookupTableDescriptor;
|
|
1585
|
-
this._dialogTableDataProvider = tableDataProvider;
|
|
1693
|
+
withDefaultValue(defaultValue) {
|
|
1694
|
+
this._defaultValue = defaultValue;
|
|
1586
1695
|
return this;
|
|
1587
1696
|
}
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
this
|
|
1591
|
-
field._lookupType = this._lookupType;
|
|
1592
|
-
field._itemsLabelProperty = this._itemsLabelProperty;
|
|
1593
|
-
field._itemsLabelTranslate = this._itemsLabelTranslate;
|
|
1594
|
-
field._itemsValueProperty = this._itemsValueProperty;
|
|
1595
|
-
field._itemsDisabledProperty = this._itemsDisabledProperty;
|
|
1596
|
-
field._dataKeyProperty = this._dataKeyProperty;
|
|
1597
|
-
field._dataProvider = this._dataProvider;
|
|
1598
|
-
field._dropdownClassName = this._dropdownClassName;
|
|
1599
|
-
field._autocompleteOpenOnFocus = this._autocompleteOpenOnFocus;
|
|
1600
|
-
field._autocompleteInlineSearch = this._autocompleteInlineSearch;
|
|
1601
|
-
field._dialogTableDescriptor = this._dialogTableDescriptor;
|
|
1602
|
-
return field;
|
|
1697
|
+
withGetter(getter) {
|
|
1698
|
+
this._getter = getter;
|
|
1699
|
+
return this;
|
|
1603
1700
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
(function (LookupTypeEnum) {
|
|
1608
|
-
LookupTypeEnum[LookupTypeEnum["Dropdown"] = 0] = "Dropdown";
|
|
1609
|
-
LookupTypeEnum[LookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
|
|
1610
|
-
LookupTypeEnum[LookupTypeEnum["Dialog"] = 2] = "Dialog";
|
|
1611
|
-
})(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
|
|
1612
|
-
})(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
|
|
1613
|
-
class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
1614
|
-
constructor(editor, property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
1615
|
-
super(editor, property, null);
|
|
1616
|
-
this._nameAsValue = false;
|
|
1617
|
-
this._enumType = enumType;
|
|
1618
|
-
this._nameAsValue = nameAsValue;
|
|
1619
|
-
if (typeof optionsTitlePath === 'undefined') {
|
|
1620
|
-
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1621
|
-
}
|
|
1622
|
-
this._optionEnumValues = Array.isArray(options)
|
|
1623
|
-
? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
|
|
1624
|
-
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1625
|
-
const dataProvider = new LookupDataProvider(null).withLookup(() => of(this._optionEnumValues));
|
|
1626
|
-
this.withLookupDataProvider(dataProvider);
|
|
1627
|
-
this.withItemsLabelProperty('title', optionsTitlePath !== null);
|
|
1628
|
-
this.withItemsValueProperty('value');
|
|
1629
|
-
this.withItemsDisabledProperty('disabled');
|
|
1701
|
+
withSetter(setter) {
|
|
1702
|
+
this._setter = setter;
|
|
1703
|
+
return this;
|
|
1630
1704
|
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1705
|
+
withValidator(name, expression, message) {
|
|
1706
|
+
this._validators.push(new FieldValidator(name, expression, message));
|
|
1707
|
+
return this;
|
|
1633
1708
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
const option = this._optionEnumValues.find(o => o.value === disabledOptionValue);
|
|
1639
|
-
if (option) {
|
|
1640
|
-
option.disabled = true;
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
}
|
|
1709
|
+
withClassName(className, labelClassName = '', inputClassName = '') {
|
|
1710
|
+
this._className = className;
|
|
1711
|
+
this._labelClassName = labelClassName;
|
|
1712
|
+
this._inputClassName = inputClassName;
|
|
1644
1713
|
return this;
|
|
1645
1714
|
}
|
|
1646
|
-
|
|
1647
|
-
|
|
1715
|
+
withSize(size = FieldDescriptor.SizeEnum.Normal) {
|
|
1716
|
+
this._size = size;
|
|
1648
1717
|
return this;
|
|
1649
1718
|
}
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1719
|
+
nextEvent(type, cmpType, cmpInstance, data) {
|
|
1720
|
+
this._eventsSubject.next(new MngFormFieldEvent(type, cmpType, cmpInstance, data));
|
|
1721
|
+
}
|
|
1722
|
+
get events$() {
|
|
1723
|
+
return this._eventsSubject.asObservable();
|
|
1724
|
+
}
|
|
1725
|
+
copyFieldsTo(obj) {
|
|
1726
|
+
obj._label = this._label;
|
|
1727
|
+
obj._placeholder = this._placeholder;
|
|
1728
|
+
obj._helpText = this._helpText;
|
|
1729
|
+
obj._required = this._required;
|
|
1730
|
+
obj._disabled = this._disabled;
|
|
1731
|
+
obj._defaultValue = this._defaultValue;
|
|
1732
|
+
obj._requiredExpression = this._requiredExpression;
|
|
1733
|
+
obj._hiddenExpression = this._hiddenExpression;
|
|
1734
|
+
obj._disabledExpression = this._disabledExpression;
|
|
1735
|
+
obj._className = this._className;
|
|
1736
|
+
obj._size = this.size;
|
|
1737
|
+
obj._getter = this._getter;
|
|
1738
|
+
obj._setter = this._setter;
|
|
1739
|
+
obj._validators = this._validators;
|
|
1660
1740
|
}
|
|
1661
1741
|
}
|
|
1662
|
-
|
|
1663
|
-
|
|
1742
|
+
var FieldDescriptor;
|
|
1743
|
+
(function (FieldDescriptor) {
|
|
1744
|
+
let SizeEnum;
|
|
1745
|
+
(function (SizeEnum) {
|
|
1746
|
+
SizeEnum[SizeEnum["Small"] = 0] = "Small";
|
|
1747
|
+
SizeEnum[SizeEnum["Normal"] = 1] = "Normal";
|
|
1748
|
+
SizeEnum[SizeEnum["Large"] = 2] = "Large";
|
|
1749
|
+
})(SizeEnum = FieldDescriptor.SizeEnum || (FieldDescriptor.SizeEnum = {}));
|
|
1750
|
+
})(FieldDescriptor || (FieldDescriptor = {}));
|
|
1751
|
+
class FieldInputDescriptor extends AFieldDescriptor {
|
|
1752
|
+
constructor(editor, property) {
|
|
1664
1753
|
super(editor, property);
|
|
1665
|
-
this._fieldType =
|
|
1666
|
-
this.
|
|
1667
|
-
|
|
1668
|
-
this.
|
|
1669
|
-
this.
|
|
1670
|
-
this._excludeValueProperty = '';
|
|
1671
|
-
this._mainTableDescriptor = mainTableDescriptor;
|
|
1672
|
-
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
1673
|
-
this._actions.push(FieldManyToManyEditorDescriptor.ActionEnum.Add, FieldManyToManyEditorDescriptor.ActionEnum.Delete);
|
|
1754
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Text;
|
|
1755
|
+
this._numberUseGrouping = true;
|
|
1756
|
+
// radio specific properties
|
|
1757
|
+
this._radioOptions = [];
|
|
1758
|
+
this._datePickerShowTime = false;
|
|
1674
1759
|
}
|
|
1675
1760
|
get fieldType() {
|
|
1676
1761
|
return this._fieldType;
|
|
1677
1762
|
}
|
|
1678
|
-
get
|
|
1679
|
-
return this.
|
|
1763
|
+
get rows() {
|
|
1764
|
+
return this._rows;
|
|
1765
|
+
}
|
|
1766
|
+
get numberMin() {
|
|
1767
|
+
return this._numberMin;
|
|
1768
|
+
}
|
|
1769
|
+
get numberMax() {
|
|
1770
|
+
return this._numberMax;
|
|
1771
|
+
}
|
|
1772
|
+
get numberStep() {
|
|
1773
|
+
return this._numberStep;
|
|
1774
|
+
}
|
|
1775
|
+
get numberMinFractionDigits() {
|
|
1776
|
+
return this._numberMinFractionDigits;
|
|
1680
1777
|
}
|
|
1681
|
-
get
|
|
1682
|
-
return this.
|
|
1778
|
+
get numberMaxFractionDigits() {
|
|
1779
|
+
return this._numberMaxFractionDigits;
|
|
1683
1780
|
}
|
|
1684
|
-
get
|
|
1685
|
-
return this.
|
|
1781
|
+
get numberUseGrouping() {
|
|
1782
|
+
return this._numberUseGrouping;
|
|
1686
1783
|
}
|
|
1687
|
-
get
|
|
1688
|
-
return this.
|
|
1784
|
+
get radioOptions() {
|
|
1785
|
+
return this._radioOptions;
|
|
1689
1786
|
}
|
|
1690
|
-
get
|
|
1691
|
-
return this.
|
|
1787
|
+
get datePickerFormat() {
|
|
1788
|
+
return this._datePickerFormat;
|
|
1692
1789
|
}
|
|
1693
|
-
get
|
|
1694
|
-
return this.
|
|
1790
|
+
get datePickerMin() {
|
|
1791
|
+
return this._datePickerMin;
|
|
1695
1792
|
}
|
|
1696
|
-
get
|
|
1697
|
-
return this.
|
|
1793
|
+
get datePickerMax() {
|
|
1794
|
+
return this._datePickerMax;
|
|
1698
1795
|
}
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
if (serviceType) {
|
|
1702
|
-
dataProvider.withServiceType(serviceType);
|
|
1703
|
-
}
|
|
1704
|
-
dataProvider.withGetAll(getAll);
|
|
1705
|
-
this._lookupTableDataProvider = dataProvider;
|
|
1706
|
-
return this;
|
|
1796
|
+
get datePickerShowTime() {
|
|
1797
|
+
return this._datePickerShowTime;
|
|
1707
1798
|
}
|
|
1708
|
-
|
|
1709
|
-
this.
|
|
1710
|
-
return this;
|
|
1799
|
+
get maxLength() {
|
|
1800
|
+
return this._maxLength;
|
|
1711
1801
|
}
|
|
1712
|
-
|
|
1713
|
-
this.
|
|
1714
|
-
return this;
|
|
1802
|
+
get minLength() {
|
|
1803
|
+
return this._minLength;
|
|
1715
1804
|
}
|
|
1716
|
-
|
|
1717
|
-
this.
|
|
1718
|
-
this._excludeFilterProperty = filterProperty;
|
|
1719
|
-
this._excludeValueProperty = valueProperty;
|
|
1720
|
-
return this;
|
|
1805
|
+
get pattern() {
|
|
1806
|
+
return this._pattern;
|
|
1721
1807
|
}
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
this.copyFieldsTo(field);
|
|
1725
|
-
field._fieldType = this._fieldType;
|
|
1726
|
-
field._actions = this._actions.map(a => a);
|
|
1727
|
-
field._lookupTableDataProvider = this._lookupTableDataProvider;
|
|
1728
|
-
field._hasLookupExcludeValues = this._hasLookupExcludeValues;
|
|
1729
|
-
field._excludeFilterProperty = this._excludeFilterProperty;
|
|
1730
|
-
field._excludeValueProperty = this._excludeValueProperty;
|
|
1731
|
-
return field;
|
|
1808
|
+
get mask() {
|
|
1809
|
+
return this._mask;
|
|
1732
1810
|
}
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
let TypeEnum;
|
|
1736
|
-
(function (TypeEnum) {
|
|
1737
|
-
TypeEnum[TypeEnum["DialogTableMultiselect"] = 0] = "DialogTableMultiselect";
|
|
1738
|
-
})(TypeEnum = FieldManyToManyEditorDescriptor.TypeEnum || (FieldManyToManyEditorDescriptor.TypeEnum = {}));
|
|
1739
|
-
let ActionEnum;
|
|
1740
|
-
(function (ActionEnum) {
|
|
1741
|
-
ActionEnum[ActionEnum["Add"] = 0] = "Add";
|
|
1742
|
-
ActionEnum[ActionEnum["Delete"] = 1] = "Delete";
|
|
1743
|
-
})(ActionEnum = FieldManyToManyEditorDescriptor.ActionEnum || (FieldManyToManyEditorDescriptor.ActionEnum = {}));
|
|
1744
|
-
})(FieldManyToManyEditorDescriptor || (FieldManyToManyEditorDescriptor = {}));
|
|
1745
|
-
class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
1746
|
-
constructor(editor, property, tableviewDescriptor) {
|
|
1747
|
-
super(editor, property);
|
|
1748
|
-
this._fieldType = FieldManyEditorDescriptor.TypeEnum.DialogEditor;
|
|
1749
|
-
this._fieldActions = [];
|
|
1750
|
-
this._actions = [];
|
|
1751
|
-
// this._modelType = modelType;
|
|
1752
|
-
this._tableviewDescriptor = tableviewDescriptor;
|
|
1753
|
-
this._fieldActions.push(FieldManyEditorDescriptor.ActionEnum.View, FieldManyEditorDescriptor.ActionEnum.Add, FieldManyEditorDescriptor.ActionEnum.Edit, FieldManyEditorDescriptor.ActionEnum.Delete);
|
|
1811
|
+
get slotChar() {
|
|
1812
|
+
return this._slotChar;
|
|
1754
1813
|
}
|
|
1755
|
-
get
|
|
1756
|
-
return this.
|
|
1814
|
+
get customComponentName() {
|
|
1815
|
+
return this._customComponentName;
|
|
1757
1816
|
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1817
|
+
asHidden() {
|
|
1818
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Hidden;
|
|
1819
|
+
return this;
|
|
1760
1820
|
}
|
|
1761
|
-
|
|
1762
|
-
|
|
1821
|
+
asText(minLength, maxLength, pattern, isEmail) {
|
|
1822
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Text;
|
|
1823
|
+
this._minLength = minLength;
|
|
1824
|
+
this._maxLength = maxLength;
|
|
1825
|
+
this._pattern = pattern;
|
|
1826
|
+
if (isEmail) {
|
|
1827
|
+
this.withValidator('email', control => !Validators.email(control));
|
|
1828
|
+
}
|
|
1829
|
+
return this;
|
|
1763
1830
|
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1831
|
+
asTextarea(rows = 3, minLength, maxLength, pattern) {
|
|
1832
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Textarea;
|
|
1833
|
+
this._rows = rows;
|
|
1834
|
+
this._minLength = minLength;
|
|
1835
|
+
this._maxLength = maxLength;
|
|
1836
|
+
this._pattern = pattern;
|
|
1837
|
+
return this;
|
|
1766
1838
|
}
|
|
1767
|
-
|
|
1768
|
-
|
|
1839
|
+
asNumber(step, min, max, minFractionDigits, maxFractionDigits, numberUseGrouping = true) {
|
|
1840
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Number;
|
|
1841
|
+
this._numberStep = step;
|
|
1842
|
+
this._numberMinFractionDigits = minFractionDigits;
|
|
1843
|
+
this._numberMaxFractionDigits = maxFractionDigits;
|
|
1844
|
+
this._numberMin = min ?? Number.MIN_SAFE_INTEGER;
|
|
1845
|
+
this._numberMax = max ?? Number.MAX_SAFE_INTEGER;
|
|
1846
|
+
this._numberUseGrouping = numberUseGrouping;
|
|
1847
|
+
return this;
|
|
1769
1848
|
}
|
|
1770
|
-
|
|
1771
|
-
|
|
1849
|
+
asSwitch() {
|
|
1850
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Switch;
|
|
1851
|
+
return this;
|
|
1772
1852
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1853
|
+
asRadio(options, optionsTitlePath) {
|
|
1854
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
|
|
1855
|
+
this._radioOptions = options.map(o => ({ value: o, title: `${optionsTitlePath ? `${optionsTitlePath}.` : ''}${o}` }));
|
|
1856
|
+
return this;
|
|
1775
1857
|
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1858
|
+
asRadioFromEnum(enumType, optionsTitlePath, values, nameAsValue = false) {
|
|
1859
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Radio;
|
|
1860
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
1861
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
1862
|
+
}
|
|
1863
|
+
this._radioOptions = Array.isArray(values)
|
|
1864
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, values, nameAsValue, optionsTitlePath ?? undefined)
|
|
1865
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
1866
|
+
return this;
|
|
1778
1867
|
}
|
|
1779
|
-
|
|
1780
|
-
this.
|
|
1868
|
+
asDatePicker(format, min, max, showTime) {
|
|
1869
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Datepicker;
|
|
1870
|
+
this._datePickerFormat = format ? format : 'dd.mm.yy';
|
|
1871
|
+
this._datePickerMin = min;
|
|
1872
|
+
this._datePickerMax = max;
|
|
1873
|
+
this._datePickerShowTime = showTime ?? false;
|
|
1781
1874
|
return this;
|
|
1782
1875
|
}
|
|
1783
|
-
|
|
1784
|
-
this.
|
|
1876
|
+
asMask(mask, slotChar) {
|
|
1877
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Mask;
|
|
1878
|
+
this._mask = mask;
|
|
1879
|
+
this._slotChar = slotChar;
|
|
1785
1880
|
return this;
|
|
1786
1881
|
}
|
|
1787
|
-
|
|
1788
|
-
this.
|
|
1882
|
+
asCustomComponent(customComponentName) {
|
|
1883
|
+
this._fieldType = FieldInputDescriptor.TypeEnum.Custom;
|
|
1884
|
+
this._customComponentName = customComponentName;
|
|
1789
1885
|
return this;
|
|
1790
1886
|
}
|
|
1791
1887
|
copy() {
|
|
1792
|
-
const field = new
|
|
1888
|
+
const field = new FieldInputDescriptor(this._editor, this._property);
|
|
1793
1889
|
this.copyFieldsTo(field);
|
|
1794
1890
|
field._fieldType = this._fieldType;
|
|
1795
|
-
field.
|
|
1891
|
+
field._rows = this._rows;
|
|
1892
|
+
field._numberMin = this._numberMin;
|
|
1893
|
+
field._numberMax = this._numberMax;
|
|
1894
|
+
field._numberStep = this._numberStep;
|
|
1895
|
+
field._numberMinFractionDigits = this._numberMinFractionDigits;
|
|
1896
|
+
field._numberMaxFractionDigits = this._numberMaxFractionDigits;
|
|
1897
|
+
field._numberUseGrouping = this._numberUseGrouping;
|
|
1898
|
+
field._radioOptions = [...this._radioOptions];
|
|
1899
|
+
field._datePickerFormat = this._datePickerFormat;
|
|
1900
|
+
field._datePickerMin = this._datePickerMin;
|
|
1901
|
+
field._datePickerMax = this._datePickerMax;
|
|
1902
|
+
field._datePickerShowTime = this._datePickerShowTime;
|
|
1903
|
+
field._maxLength = this._maxLength;
|
|
1904
|
+
field._minLength = this._minLength;
|
|
1905
|
+
field._pattern = this._pattern;
|
|
1906
|
+
field._mask = this._mask;
|
|
1907
|
+
field._slotChar = this._slotChar;
|
|
1908
|
+
field._customComponentName = this._customComponentName;
|
|
1796
1909
|
return field;
|
|
1797
1910
|
}
|
|
1798
1911
|
}
|
|
1799
|
-
(function (
|
|
1912
|
+
(function (FieldInputDescriptor) {
|
|
1800
1913
|
let TypeEnum;
|
|
1801
1914
|
(function (TypeEnum) {
|
|
1802
|
-
TypeEnum[TypeEnum["
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
})(
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
this.
|
|
1817
|
-
this.
|
|
1818
|
-
this.
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
get validators() {
|
|
1824
|
-
return this._validators;
|
|
1825
|
-
}
|
|
1826
|
-
get baseName() {
|
|
1827
|
-
return `${this.groupName()}_`;
|
|
1828
|
-
}
|
|
1829
|
-
get name() {
|
|
1830
|
-
return this._name;
|
|
1831
|
-
}
|
|
1832
|
-
get default() {
|
|
1833
|
-
return this._default;
|
|
1834
|
-
}
|
|
1835
|
-
withTitle(title) {
|
|
1836
|
-
this._title = title;
|
|
1837
|
-
return this;
|
|
1838
|
-
}
|
|
1839
|
-
withValidator(name, expression) {
|
|
1840
|
-
this._validators.push(new FieldValidator(name, expression, undefined));
|
|
1841
|
-
return this;
|
|
1842
|
-
}
|
|
1843
|
-
}
|
|
1844
|
-
class FieldTabGroupDescriptor extends AFieldGroupDescriptor {
|
|
1845
|
-
constructor(editor, name) {
|
|
1846
|
-
super(editor, name);
|
|
1915
|
+
TypeEnum[TypeEnum["Hidden"] = 0] = "Hidden";
|
|
1916
|
+
TypeEnum[TypeEnum["Text"] = 1] = "Text";
|
|
1917
|
+
TypeEnum[TypeEnum["Textarea"] = 2] = "Textarea";
|
|
1918
|
+
TypeEnum[TypeEnum["Number"] = 3] = "Number";
|
|
1919
|
+
TypeEnum[TypeEnum["Switch"] = 4] = "Switch";
|
|
1920
|
+
TypeEnum[TypeEnum["Radio"] = 5] = "Radio";
|
|
1921
|
+
TypeEnum[TypeEnum["Datepicker"] = 6] = "Datepicker";
|
|
1922
|
+
TypeEnum[TypeEnum["Mask"] = 7] = "Mask";
|
|
1923
|
+
TypeEnum[TypeEnum["Custom"] = 8] = "Custom";
|
|
1924
|
+
})(TypeEnum = FieldInputDescriptor.TypeEnum || (FieldInputDescriptor.TypeEnum = {}));
|
|
1925
|
+
})(FieldInputDescriptor || (FieldInputDescriptor = {}));
|
|
1926
|
+
class FieldLookupDescriptor extends AFieldDescriptor {
|
|
1927
|
+
constructor(editor, property, modelType) {
|
|
1928
|
+
super(editor, property);
|
|
1929
|
+
this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Dropdown;
|
|
1930
|
+
this._itemsLabelTranslate = false;
|
|
1931
|
+
this._dropdownClassName = 'mng-filter-lookup-dropdown';
|
|
1932
|
+
this._autocompleteOpenOnFocus = false;
|
|
1933
|
+
this._autocompleteInlineSearch = false;
|
|
1934
|
+
this._modelType = modelType;
|
|
1935
|
+
ModelUtil.trySetLookupItemsProperties(this);
|
|
1847
1936
|
}
|
|
1848
|
-
get
|
|
1849
|
-
return this.
|
|
1937
|
+
get lookupType() {
|
|
1938
|
+
return this._lookupType;
|
|
1850
1939
|
}
|
|
1851
|
-
|
|
1852
|
-
return
|
|
1940
|
+
get itemsLabelProperty() {
|
|
1941
|
+
return this._itemsLabelProperty;
|
|
1853
1942
|
}
|
|
1854
|
-
|
|
1855
|
-
this.
|
|
1856
|
-
return this;
|
|
1943
|
+
get itemsLabelTranslate() {
|
|
1944
|
+
return this._itemsLabelTranslate;
|
|
1857
1945
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
tab._title = this._title;
|
|
1861
|
-
tab._fields = this.fields.map(f => f.copy());
|
|
1862
|
-
return tab;
|
|
1946
|
+
get itemsValueProperty() {
|
|
1947
|
+
return this._itemsValueProperty;
|
|
1863
1948
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
constructor(editor, name) {
|
|
1867
|
-
super(editor, name);
|
|
1949
|
+
get itemsDisabledProperty() {
|
|
1950
|
+
return this._itemsDisabledProperty;
|
|
1868
1951
|
}
|
|
1869
|
-
get
|
|
1870
|
-
return this.
|
|
1952
|
+
get dataKeyProperty() {
|
|
1953
|
+
return this._dataKeyProperty;
|
|
1871
1954
|
}
|
|
1872
|
-
|
|
1873
|
-
return
|
|
1955
|
+
get dataProvider() {
|
|
1956
|
+
return this._dataProvider;
|
|
1874
1957
|
}
|
|
1875
|
-
|
|
1876
|
-
this.
|
|
1877
|
-
return this;
|
|
1958
|
+
get autocompleteOpenOnFocus() {
|
|
1959
|
+
return this._autocompleteOpenOnFocus;
|
|
1878
1960
|
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
group._title = this._title;
|
|
1882
|
-
group._fields = this.fields.map(f => f.copy());
|
|
1883
|
-
return group;
|
|
1961
|
+
get autocompleteInlineSearch() {
|
|
1962
|
+
return this._autocompleteInlineSearch;
|
|
1884
1963
|
}
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
class FieldValidator {
|
|
1888
|
-
constructor(name, expression, message, options) {
|
|
1889
|
-
this._name = name;
|
|
1890
|
-
this._expression = expression;
|
|
1891
|
-
this._message = message;
|
|
1892
|
-
this._options = options;
|
|
1964
|
+
get dropdownClassName() {
|
|
1965
|
+
return this._dropdownClassName;
|
|
1893
1966
|
}
|
|
1894
|
-
get
|
|
1895
|
-
return this.
|
|
1967
|
+
get modelType() {
|
|
1968
|
+
return this._modelType;
|
|
1896
1969
|
}
|
|
1897
|
-
get
|
|
1898
|
-
return this.
|
|
1970
|
+
get dialogTableDescriptor() {
|
|
1971
|
+
return this._dialogTableDescriptor;
|
|
1899
1972
|
}
|
|
1900
|
-
get
|
|
1901
|
-
return this.
|
|
1973
|
+
get dialogTableDataProvider() {
|
|
1974
|
+
return this._dialogTableDataProvider;
|
|
1902
1975
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1976
|
+
withItemsLabelProperty(itemsLabelProperty, translate = false) {
|
|
1977
|
+
this._itemsLabelProperty = itemsLabelProperty;
|
|
1978
|
+
this._itemsLabelTranslate = translate;
|
|
1979
|
+
return this;
|
|
1905
1980
|
}
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
this._type = modelType;
|
|
1911
|
-
this._idPropertyName = idProperty ?? ModelUtil.findIdAttribute(modelType) ?? undefined;
|
|
1912
|
-
this._titlePropertyName = titleProperty ?? ModelUtil.findTitleAttribute(modelType) ?? undefined;
|
|
1913
|
-
this._typeName = TypeUtil.findTypeName(this._type);
|
|
1981
|
+
withItemsValueProperty(itemsValueProperty) {
|
|
1982
|
+
this._itemsValueProperty = itemsValueProperty;
|
|
1983
|
+
this._dataKeyProperty = undefined;
|
|
1984
|
+
return this;
|
|
1914
1985
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1986
|
+
withItemsDisabledProperty(itemsDisabledProperty) {
|
|
1987
|
+
this._itemsDisabledProperty = itemsDisabledProperty;
|
|
1988
|
+
return this;
|
|
1917
1989
|
}
|
|
1918
|
-
|
|
1919
|
-
|
|
1990
|
+
withDataKeyProperty(property) {
|
|
1991
|
+
this._dataKeyProperty = property;
|
|
1992
|
+
this._itemsValueProperty = undefined;
|
|
1993
|
+
return this;
|
|
1920
1994
|
}
|
|
1921
|
-
|
|
1922
|
-
|
|
1995
|
+
withLookup(lookup, serviceType) {
|
|
1996
|
+
const dataProvider = new LookupDataProvider(this._modelType);
|
|
1997
|
+
if (serviceType) {
|
|
1998
|
+
dataProvider.withServiceType(serviceType);
|
|
1999
|
+
}
|
|
2000
|
+
dataProvider.withLookup(lookup);
|
|
2001
|
+
this._dataProvider = dataProvider;
|
|
2002
|
+
return this;
|
|
1923
2003
|
}
|
|
1924
|
-
|
|
1925
|
-
|
|
2004
|
+
withLookupDataProvider(dataProvider) {
|
|
2005
|
+
this._dataProvider = dataProvider;
|
|
2006
|
+
return this;
|
|
1926
2007
|
}
|
|
1927
|
-
|
|
1928
|
-
|
|
2008
|
+
withConfig(config) {
|
|
2009
|
+
return super.withConfig(config);
|
|
2010
|
+
}
|
|
2011
|
+
asAutocomplete(openOnFocus = false, inlineSearch = false) {
|
|
2012
|
+
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Autocomplete;
|
|
2013
|
+
this._autocompleteOpenOnFocus = openOnFocus;
|
|
2014
|
+
this._autocompleteInlineSearch = inlineSearch;
|
|
1929
2015
|
return this;
|
|
1930
2016
|
}
|
|
1931
|
-
|
|
1932
|
-
this.
|
|
2017
|
+
asDialog(lookupTableDescriptor, tableDataProvider) {
|
|
2018
|
+
this._lookupType = FieldLookupDescriptor.LookupTypeEnum.Dialog;
|
|
2019
|
+
this._dialogTableDescriptor = lookupTableDescriptor;
|
|
2020
|
+
this._dialogTableDataProvider = tableDataProvider;
|
|
1933
2021
|
return this;
|
|
1934
2022
|
}
|
|
1935
2023
|
copy() {
|
|
1936
|
-
const
|
|
1937
|
-
|
|
2024
|
+
const field = new FieldLookupDescriptor(this._editor, this._property, this._modelType);
|
|
2025
|
+
this.copyFieldsTo(field);
|
|
2026
|
+
field._lookupType = this._lookupType;
|
|
2027
|
+
field._itemsLabelProperty = this._itemsLabelProperty;
|
|
2028
|
+
field._itemsLabelTranslate = this._itemsLabelTranslate;
|
|
2029
|
+
field._itemsValueProperty = this._itemsValueProperty;
|
|
2030
|
+
field._itemsDisabledProperty = this._itemsDisabledProperty;
|
|
2031
|
+
field._dataKeyProperty = this._dataKeyProperty;
|
|
2032
|
+
field._dataProvider = this._dataProvider;
|
|
2033
|
+
field._dropdownClassName = this._dropdownClassName;
|
|
2034
|
+
field._autocompleteOpenOnFocus = this._autocompleteOpenOnFocus;
|
|
2035
|
+
field._autocompleteInlineSearch = this._autocompleteInlineSearch;
|
|
2036
|
+
field._dialogTableDescriptor = this._dialogTableDescriptor;
|
|
2037
|
+
return field;
|
|
1938
2038
|
}
|
|
1939
2039
|
}
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
this.
|
|
1952
|
-
this.
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
}
|
|
1966
|
-
get hideHeader() {
|
|
1967
|
-
return this._hideHeader;
|
|
1968
|
-
}
|
|
1969
|
-
get dataKeyProperty() {
|
|
1970
|
-
return this._dataKeyProperty;
|
|
1971
|
-
}
|
|
1972
|
-
get hasDefaultSort() {
|
|
1973
|
-
return this._hasDefaultSort;
|
|
1974
|
-
}
|
|
1975
|
-
get defaultSortProperty() {
|
|
1976
|
-
return this._defaultSortProperty;
|
|
1977
|
-
}
|
|
1978
|
-
get defaultSortAsc() {
|
|
1979
|
-
return this._defaultSortAsc;
|
|
1980
|
-
}
|
|
1981
|
-
get rowHeight() {
|
|
1982
|
-
return this._rowHeight;
|
|
2040
|
+
(function (FieldLookupDescriptor) {
|
|
2041
|
+
let LookupTypeEnum;
|
|
2042
|
+
(function (LookupTypeEnum) {
|
|
2043
|
+
LookupTypeEnum[LookupTypeEnum["Dropdown"] = 0] = "Dropdown";
|
|
2044
|
+
LookupTypeEnum[LookupTypeEnum["Autocomplete"] = 1] = "Autocomplete";
|
|
2045
|
+
LookupTypeEnum[LookupTypeEnum["Dialog"] = 2] = "Dialog";
|
|
2046
|
+
})(LookupTypeEnum = FieldLookupDescriptor.LookupTypeEnum || (FieldLookupDescriptor.LookupTypeEnum = {}));
|
|
2047
|
+
})(FieldLookupDescriptor || (FieldLookupDescriptor = {}));
|
|
2048
|
+
class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
2049
|
+
constructor(editor, property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
2050
|
+
super(editor, property, null);
|
|
2051
|
+
this._nameAsValue = false;
|
|
2052
|
+
this._enumType = enumType;
|
|
2053
|
+
this._nameAsValue = nameAsValue;
|
|
2054
|
+
if (typeof optionsTitlePath === 'undefined') {
|
|
2055
|
+
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
2056
|
+
}
|
|
2057
|
+
this._optionEnumValues = Array.isArray(options)
|
|
2058
|
+
? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
|
|
2059
|
+
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
2060
|
+
const dataProvider = new LookupDataProvider(null).withLookup(() => of(this._optionEnumValues));
|
|
2061
|
+
this.withLookupDataProvider(dataProvider);
|
|
2062
|
+
this.withItemsLabelProperty('title', optionsTitlePath !== null);
|
|
2063
|
+
this.withItemsValueProperty('value');
|
|
2064
|
+
this.withItemsDisabledProperty('disabled');
|
|
1983
2065
|
}
|
|
1984
|
-
get
|
|
1985
|
-
return this.
|
|
2066
|
+
get enumType() {
|
|
2067
|
+
return this._enumType;
|
|
1986
2068
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
2069
|
+
withDisabledOptions(...disabledOptions) {
|
|
2070
|
+
for (const disabledOption of disabledOptions) {
|
|
2071
|
+
const disabledOptionValue = this._nameAsValue ? EnumUtil.getConstantName(this._enumType, disabledOption) : disabledOption;
|
|
2072
|
+
if (disabledOptionValue) {
|
|
2073
|
+
const option = this._optionEnumValues.find(o => o.value === disabledOptionValue);
|
|
2074
|
+
if (option) {
|
|
2075
|
+
option.disabled = true;
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
return this;
|
|
1989
2080
|
}
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
this.setDataKeyFromColumn();
|
|
2081
|
+
asAutocomplete(openOnFocus = true) {
|
|
2082
|
+
super.asAutocomplete(openOnFocus, true);
|
|
1993
2083
|
return this;
|
|
1994
2084
|
}
|
|
1995
|
-
|
|
1996
|
-
const
|
|
1997
|
-
this.
|
|
1998
|
-
this.
|
|
1999
|
-
|
|
2085
|
+
copy() {
|
|
2086
|
+
const field = new FieldLookupEnumDescriptor(this._editor, this._property, this._enumType, []);
|
|
2087
|
+
this.copyFieldsTo(field);
|
|
2088
|
+
field._lookupType = this._lookupType;
|
|
2089
|
+
field._itemsLabelProperty = this._itemsLabelProperty;
|
|
2090
|
+
field._itemsValueProperty = this._itemsValueProperty;
|
|
2091
|
+
field._itemsDisabledProperty = this._itemsDisabledProperty;
|
|
2092
|
+
field._dataKeyProperty = this._dataKeyProperty;
|
|
2093
|
+
field._dataProvider = this._dataProvider;
|
|
2094
|
+
return field;
|
|
2000
2095
|
}
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
this.
|
|
2006
|
-
|
|
2096
|
+
}
|
|
2097
|
+
class FieldManyToManyEditorDescriptor extends AFieldDescriptor {
|
|
2098
|
+
constructor(editor, property, mainTableDescriptor, lookupTableDescriptor) {
|
|
2099
|
+
super(editor, property);
|
|
2100
|
+
this._fieldType = FieldManyToManyEditorDescriptor.TypeEnum.DialogTableMultiselect;
|
|
2101
|
+
this._lookupTableDataProvider = null;
|
|
2102
|
+
this._actions = [];
|
|
2103
|
+
this._hasLookupExcludeValues = false;
|
|
2104
|
+
this._excludeFilterProperty = '';
|
|
2105
|
+
this._excludeValueProperty = '';
|
|
2106
|
+
this._mainTableDescriptor = mainTableDescriptor;
|
|
2107
|
+
this._lookupTableDescriptor = lookupTableDescriptor;
|
|
2108
|
+
this._actions.push(FieldManyToManyEditorDescriptor.ActionEnum.Add, FieldManyToManyEditorDescriptor.ActionEnum.Delete);
|
|
2007
2109
|
}
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
column.asDate(displayFormat);
|
|
2011
|
-
this._columns.push(column);
|
|
2012
|
-
this.setDataKeyFromColumn();
|
|
2013
|
-
return column;
|
|
2110
|
+
get fieldType() {
|
|
2111
|
+
return this._fieldType;
|
|
2014
2112
|
}
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
column.asBoolean(yes, no, asIcon);
|
|
2018
|
-
this._columns.push(column);
|
|
2019
|
-
this.setDataKeyFromColumn();
|
|
2020
|
-
return column;
|
|
2113
|
+
get lookupTableDataProvider() {
|
|
2114
|
+
return this._lookupTableDataProvider;
|
|
2021
2115
|
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
column.asEnum(enumType, nameAsValue, titlePath);
|
|
2025
|
-
this._columns.push(column);
|
|
2026
|
-
this.setDataKeyFromColumn();
|
|
2027
|
-
return column;
|
|
2116
|
+
get actions() {
|
|
2117
|
+
return this._actions;
|
|
2028
2118
|
}
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
column.withModelType(modelType);
|
|
2032
|
-
column.withDisplayPropertyPath(displayProperty);
|
|
2033
|
-
this._columns.push(column);
|
|
2034
|
-
this.setDataKeyFromColumn();
|
|
2035
|
-
return column;
|
|
2119
|
+
get hasLookupExcludeValues() {
|
|
2120
|
+
return this._hasLookupExcludeValues;
|
|
2036
2121
|
}
|
|
2037
|
-
|
|
2038
|
-
this.
|
|
2039
|
-
return this;
|
|
2122
|
+
get excludeFilterProperty() {
|
|
2123
|
+
return this._excludeFilterProperty;
|
|
2040
2124
|
}
|
|
2041
|
-
|
|
2042
|
-
this.
|
|
2043
|
-
return this;
|
|
2125
|
+
get excludeValueProperty() {
|
|
2126
|
+
return this._excludeValueProperty;
|
|
2044
2127
|
}
|
|
2045
|
-
|
|
2046
|
-
this.
|
|
2047
|
-
return this;
|
|
2128
|
+
get mainTableDescriptor() {
|
|
2129
|
+
return this._mainTableDescriptor;
|
|
2048
2130
|
}
|
|
2049
|
-
|
|
2050
|
-
this.
|
|
2051
|
-
return this;
|
|
2131
|
+
get lookupTableDescriptor() {
|
|
2132
|
+
return this._lookupTableDescriptor;
|
|
2052
2133
|
}
|
|
2053
|
-
|
|
2054
|
-
|
|
2134
|
+
withLookup(getAll, serviceType) {
|
|
2135
|
+
const dataProvider = new TableviewDataProvider(this._mainTableDescriptor.model.type);
|
|
2136
|
+
if (serviceType) {
|
|
2137
|
+
dataProvider.withServiceType(serviceType);
|
|
2138
|
+
}
|
|
2139
|
+
dataProvider.withGetAll(getAll);
|
|
2140
|
+
this._lookupTableDataProvider = dataProvider;
|
|
2055
2141
|
return this;
|
|
2056
2142
|
}
|
|
2057
|
-
|
|
2058
|
-
this.
|
|
2059
|
-
this._defaultSortProperty.push(property);
|
|
2060
|
-
this._defaultSortAsc.push(asc);
|
|
2143
|
+
withLookupDataProvider(dataProvider) {
|
|
2144
|
+
this._lookupTableDataProvider = dataProvider;
|
|
2061
2145
|
return this;
|
|
2062
2146
|
}
|
|
2063
|
-
|
|
2064
|
-
this.
|
|
2147
|
+
withActions(actions = []) {
|
|
2148
|
+
this.actions.push(...actions);
|
|
2065
2149
|
return this;
|
|
2066
2150
|
}
|
|
2067
|
-
|
|
2068
|
-
this.
|
|
2151
|
+
withLookupExclude(filterProperty, valueProperty, hasLookupExclude = true) {
|
|
2152
|
+
this._hasLookupExcludeValues = hasLookupExclude;
|
|
2153
|
+
this._excludeFilterProperty = filterProperty;
|
|
2154
|
+
this._excludeValueProperty = valueProperty;
|
|
2069
2155
|
return this;
|
|
2070
2156
|
}
|
|
2071
2157
|
copy() {
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
return
|
|
2081
|
-
}
|
|
2082
|
-
setDataKeyFromColumn() {
|
|
2083
|
-
if (!this._dataKeyProperty && this._columns.length === 1) {
|
|
2084
|
-
this._dataKeyProperty = this._columns[0].property;
|
|
2085
|
-
}
|
|
2158
|
+
const field = new FieldManyToManyEditorDescriptor(this._editor, this._property, this._mainTableDescriptor.copy(), this._lookupTableDescriptor.copy());
|
|
2159
|
+
this.copyFieldsTo(field);
|
|
2160
|
+
field._fieldType = this._fieldType;
|
|
2161
|
+
field._actions = this._actions.map(a => a);
|
|
2162
|
+
field._lookupTableDataProvider = this._lookupTableDataProvider;
|
|
2163
|
+
field._hasLookupExcludeValues = this._hasLookupExcludeValues;
|
|
2164
|
+
field._excludeFilterProperty = this._excludeFilterProperty;
|
|
2165
|
+
field._excludeValueProperty = this._excludeValueProperty;
|
|
2166
|
+
return field;
|
|
2086
2167
|
}
|
|
2087
2168
|
}
|
|
2088
|
-
(function (
|
|
2089
|
-
let
|
|
2090
|
-
(function (
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
this.
|
|
2103
|
-
this.
|
|
2104
|
-
this.
|
|
2105
|
-
this.
|
|
2106
|
-
|
|
2107
|
-
this.
|
|
2108
|
-
this._table = table;
|
|
2109
|
-
this._property = property;
|
|
2110
|
-
}
|
|
2111
|
-
get modelType() {
|
|
2112
|
-
return this._modelType;
|
|
2113
|
-
}
|
|
2114
|
-
get columnType() {
|
|
2115
|
-
return this._columnType;
|
|
2116
|
-
}
|
|
2117
|
-
get title() {
|
|
2118
|
-
return this._title;
|
|
2169
|
+
(function (FieldManyToManyEditorDescriptor) {
|
|
2170
|
+
let TypeEnum;
|
|
2171
|
+
(function (TypeEnum) {
|
|
2172
|
+
TypeEnum[TypeEnum["DialogTableMultiselect"] = 0] = "DialogTableMultiselect";
|
|
2173
|
+
})(TypeEnum = FieldManyToManyEditorDescriptor.TypeEnum || (FieldManyToManyEditorDescriptor.TypeEnum = {}));
|
|
2174
|
+
let ActionEnum;
|
|
2175
|
+
(function (ActionEnum) {
|
|
2176
|
+
ActionEnum[ActionEnum["Add"] = 0] = "Add";
|
|
2177
|
+
ActionEnum[ActionEnum["Delete"] = 1] = "Delete";
|
|
2178
|
+
})(ActionEnum = FieldManyToManyEditorDescriptor.ActionEnum || (FieldManyToManyEditorDescriptor.ActionEnum = {}));
|
|
2179
|
+
})(FieldManyToManyEditorDescriptor || (FieldManyToManyEditorDescriptor = {}));
|
|
2180
|
+
class FieldManyEditorDescriptor extends AFieldDescriptor {
|
|
2181
|
+
constructor(editor, property, tableviewDescriptor) {
|
|
2182
|
+
super(editor, property);
|
|
2183
|
+
this._fieldType = FieldManyEditorDescriptor.TypeEnum.DialogEditor;
|
|
2184
|
+
this._fieldActions = [];
|
|
2185
|
+
this._actions = [];
|
|
2186
|
+
// this._modelType = modelType;
|
|
2187
|
+
this._tableviewDescriptor = tableviewDescriptor;
|
|
2188
|
+
this._fieldActions.push(FieldManyEditorDescriptor.ActionEnum.View, FieldManyEditorDescriptor.ActionEnum.Add, FieldManyEditorDescriptor.ActionEnum.Edit, FieldManyEditorDescriptor.ActionEnum.Delete);
|
|
2119
2189
|
}
|
|
2120
|
-
get
|
|
2121
|
-
return this.
|
|
2190
|
+
get fieldType() {
|
|
2191
|
+
return this._fieldType;
|
|
2122
2192
|
}
|
|
2123
|
-
get
|
|
2124
|
-
return this.
|
|
2193
|
+
get fieldActions() {
|
|
2194
|
+
return this._fieldActions;
|
|
2125
2195
|
}
|
|
2126
|
-
get
|
|
2127
|
-
return this.
|
|
2196
|
+
get actions() {
|
|
2197
|
+
return this._actions;
|
|
2128
2198
|
}
|
|
2129
|
-
get
|
|
2130
|
-
return this.
|
|
2199
|
+
get tableviewDescriptor() {
|
|
2200
|
+
return this._tableviewDescriptor;
|
|
2131
2201
|
}
|
|
2132
|
-
get
|
|
2133
|
-
return this.
|
|
2202
|
+
get tableDescriptor() {
|
|
2203
|
+
return this._tableviewDescriptor.table;
|
|
2134
2204
|
}
|
|
2135
|
-
get
|
|
2136
|
-
return this.
|
|
2205
|
+
get editorForCreate() {
|
|
2206
|
+
return this._tableviewDescriptor.addEditor;
|
|
2137
2207
|
}
|
|
2138
|
-
get
|
|
2139
|
-
return this.
|
|
2208
|
+
get editorForRead() {
|
|
2209
|
+
return this._tableviewDescriptor.viewEditor;
|
|
2140
2210
|
}
|
|
2141
|
-
get
|
|
2142
|
-
return this.
|
|
2211
|
+
get editorForUpdate() {
|
|
2212
|
+
return this._tableviewDescriptor.editEditor;
|
|
2143
2213
|
}
|
|
2144
|
-
|
|
2145
|
-
|
|
2214
|
+
withFieldAction(action) {
|
|
2215
|
+
this._fieldActions.push(action);
|
|
2216
|
+
return this;
|
|
2146
2217
|
}
|
|
2147
|
-
|
|
2148
|
-
|
|
2218
|
+
withFieldActions(actions) {
|
|
2219
|
+
this._fieldActions = actions;
|
|
2220
|
+
return this;
|
|
2149
2221
|
}
|
|
2150
|
-
|
|
2151
|
-
|
|
2222
|
+
withAction(action) {
|
|
2223
|
+
this._actions.push(action);
|
|
2224
|
+
return this;
|
|
2152
2225
|
}
|
|
2153
|
-
|
|
2154
|
-
|
|
2226
|
+
copy() {
|
|
2227
|
+
const field = new FieldManyEditorDescriptor(this._editor, this._property, this._tableviewDescriptor.copy());
|
|
2228
|
+
this.copyFieldsTo(field);
|
|
2229
|
+
field._fieldType = this._fieldType;
|
|
2230
|
+
field._fieldActions = this._fieldActions.map(a => a);
|
|
2231
|
+
return field;
|
|
2155
2232
|
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2233
|
+
}
|
|
2234
|
+
(function (FieldManyEditorDescriptor) {
|
|
2235
|
+
let TypeEnum;
|
|
2236
|
+
(function (TypeEnum) {
|
|
2237
|
+
TypeEnum[TypeEnum["DialogEditor"] = 0] = "DialogEditor";
|
|
2238
|
+
})(TypeEnum = FieldManyEditorDescriptor.TypeEnum || (FieldManyEditorDescriptor.TypeEnum = {}));
|
|
2239
|
+
let ActionEnum;
|
|
2240
|
+
(function (ActionEnum) {
|
|
2241
|
+
ActionEnum[ActionEnum["View"] = 0] = "View";
|
|
2242
|
+
ActionEnum[ActionEnum["Add"] = 1] = "Add";
|
|
2243
|
+
ActionEnum[ActionEnum["Edit"] = 2] = "Edit";
|
|
2244
|
+
ActionEnum[ActionEnum["Delete"] = 3] = "Delete";
|
|
2245
|
+
})(ActionEnum = FieldManyEditorDescriptor.ActionEnum || (FieldManyEditorDescriptor.ActionEnum = {}));
|
|
2246
|
+
})(FieldManyEditorDescriptor || (FieldManyEditorDescriptor = {}));
|
|
2247
|
+
class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
2248
|
+
constructor(editor, name) {
|
|
2249
|
+
super(editor);
|
|
2250
|
+
this._fields = [];
|
|
2251
|
+
this._validators = [];
|
|
2252
|
+
this._name = `${this.baseName}${name}`;
|
|
2253
|
+
this._default = name === EditorDescriptor.defaultGroupName;
|
|
2159
2254
|
}
|
|
2160
|
-
|
|
2161
|
-
this.
|
|
2162
|
-
this._displayFormat = displayFormat;
|
|
2163
|
-
return this;
|
|
2255
|
+
get title() {
|
|
2256
|
+
return this._title;
|
|
2164
2257
|
}
|
|
2165
|
-
|
|
2166
|
-
this.
|
|
2167
|
-
this._displayFormat = displayFormat;
|
|
2168
|
-
return this;
|
|
2258
|
+
get validators() {
|
|
2259
|
+
return this._validators;
|
|
2169
2260
|
}
|
|
2170
|
-
|
|
2171
|
-
this.
|
|
2172
|
-
this._booleanAsIcon = asIcon;
|
|
2173
|
-
this._booleanYes = yes;
|
|
2174
|
-
this._booleanNo = no;
|
|
2175
|
-
return this;
|
|
2261
|
+
get baseName() {
|
|
2262
|
+
return `${this.groupName()}_`;
|
|
2176
2263
|
}
|
|
2177
|
-
|
|
2178
|
-
this.
|
|
2179
|
-
this._enumType = enumType;
|
|
2180
|
-
this._enumNameAsValue = nameAsValue;
|
|
2181
|
-
if (typeof titlePath === 'undefined') {
|
|
2182
|
-
titlePath = TypeUtil.findEnumName(enumType);
|
|
2183
|
-
}
|
|
2184
|
-
this._enumTitlePath = titlePath;
|
|
2185
|
-
return this;
|
|
2264
|
+
get name() {
|
|
2265
|
+
return this._name;
|
|
2186
2266
|
}
|
|
2187
|
-
|
|
2188
|
-
this.
|
|
2189
|
-
return this;
|
|
2267
|
+
get default() {
|
|
2268
|
+
return this._default;
|
|
2190
2269
|
}
|
|
2191
2270
|
withTitle(title) {
|
|
2192
2271
|
this._title = title;
|
|
2193
2272
|
return this;
|
|
2194
2273
|
}
|
|
2195
|
-
|
|
2196
|
-
this.
|
|
2274
|
+
withValidator(name, expression) {
|
|
2275
|
+
this._validators.push(new FieldValidator(name, expression, undefined));
|
|
2197
2276
|
return this;
|
|
2198
2277
|
}
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
case ColumnDescriptor.TypeEnum.Number:
|
|
2204
|
-
filterType = FilterDescriptor.TypeEnum.Number;
|
|
2205
|
-
break;
|
|
2206
|
-
case ColumnDescriptor.TypeEnum.Boolean:
|
|
2207
|
-
filterType = FilterDescriptor.TypeEnum.Boolean;
|
|
2208
|
-
break;
|
|
2209
|
-
case ColumnDescriptor.TypeEnum.Date:
|
|
2210
|
-
filterType = FilterDescriptor.TypeEnum.Date;
|
|
2211
|
-
break;
|
|
2212
|
-
case ColumnDescriptor.TypeEnum.String:
|
|
2213
|
-
default:
|
|
2214
|
-
filterType = FilterDescriptor.TypeEnum.String;
|
|
2215
|
-
break;
|
|
2216
|
-
}
|
|
2217
|
-
this._filterDescriptor.asFilterType(filterType);
|
|
2218
|
-
return this._filterDescriptor;
|
|
2278
|
+
}
|
|
2279
|
+
class FieldTabGroupDescriptor extends AFieldGroupDescriptor {
|
|
2280
|
+
constructor(editor, name) {
|
|
2281
|
+
super(editor, name);
|
|
2219
2282
|
}
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
this._filterDescriptor = filterDescriptor;
|
|
2223
|
-
return filterDescriptor;
|
|
2283
|
+
get fields() {
|
|
2284
|
+
return this._fields;
|
|
2224
2285
|
}
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
throw new Error(`Column ${this._property} is not of type enum or enum type is undefined.`);
|
|
2228
|
-
}
|
|
2229
|
-
const filterDescriptor = new FilterLookupEnumDescriptor(this._property, this._enumType, options, this._enumNameAsValue, this._enumTitlePath);
|
|
2230
|
-
this._filterDescriptor = filterDescriptor;
|
|
2231
|
-
return filterDescriptor;
|
|
2286
|
+
groupName() {
|
|
2287
|
+
return 'tab';
|
|
2232
2288
|
}
|
|
2233
|
-
|
|
2234
|
-
this.
|
|
2289
|
+
addField(field) {
|
|
2290
|
+
this._fields.push(field);
|
|
2235
2291
|
return this;
|
|
2236
2292
|
}
|
|
2237
2293
|
copy() {
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
descriptor._columnType = this._columnType;
|
|
2243
|
-
descriptor._filterDescriptor = this._filterDescriptor?.copy();
|
|
2244
|
-
descriptor._enumType = this._enumType;
|
|
2245
|
-
descriptor._enumTitlePath = this._enumTitlePath;
|
|
2246
|
-
descriptor._enumNameAsValue = this._enumNameAsValue;
|
|
2247
|
-
descriptor._booleanAsIcon = this._booleanAsIcon;
|
|
2248
|
-
descriptor._booleanYes = this._booleanYes;
|
|
2249
|
-
descriptor._booleanNo = this._booleanNo;
|
|
2250
|
-
return descriptor;
|
|
2294
|
+
const tab = new FieldTabGroupDescriptor(this._editor, this.name.substring(this.baseName.length));
|
|
2295
|
+
tab._title = this._title;
|
|
2296
|
+
tab._fields = this.fields.map(f => f.copy());
|
|
2297
|
+
return tab;
|
|
2251
2298
|
}
|
|
2252
2299
|
}
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
TypeEnum[TypeEnum["String"] = 0] = "String";
|
|
2257
|
-
TypeEnum[TypeEnum["Number"] = 1] = "Number";
|
|
2258
|
-
TypeEnum[TypeEnum["Boolean"] = 2] = "Boolean";
|
|
2259
|
-
TypeEnum[TypeEnum["Date"] = 3] = "Date";
|
|
2260
|
-
TypeEnum[TypeEnum["Enum"] = 4] = "Enum";
|
|
2261
|
-
})(TypeEnum = ColumnDescriptor.TypeEnum || (ColumnDescriptor.TypeEnum = {}));
|
|
2262
|
-
})(ColumnDescriptor || (ColumnDescriptor = {}));
|
|
2263
|
-
class FilterDescriptor {
|
|
2264
|
-
constructor(property) {
|
|
2265
|
-
this._filterType = FilterDescriptor.TypeEnum.String;
|
|
2266
|
-
this._matchModes = null;
|
|
2267
|
-
this._className = '';
|
|
2268
|
-
this._property = property;
|
|
2300
|
+
class FieldGroupDescriptor extends AFieldGroupDescriptor {
|
|
2301
|
+
constructor(editor, name) {
|
|
2302
|
+
super(editor, name);
|
|
2269
2303
|
}
|
|
2270
|
-
get
|
|
2271
|
-
return this.
|
|
2304
|
+
get fields() {
|
|
2305
|
+
return this._fields;
|
|
2272
2306
|
}
|
|
2273
|
-
|
|
2274
|
-
return
|
|
2307
|
+
groupName() {
|
|
2308
|
+
return 'group';
|
|
2275
2309
|
}
|
|
2276
|
-
|
|
2277
|
-
|
|
2310
|
+
addField(field) {
|
|
2311
|
+
this._fields.push(field);
|
|
2312
|
+
return this;
|
|
2278
2313
|
}
|
|
2279
|
-
|
|
2280
|
-
|
|
2314
|
+
copy() {
|
|
2315
|
+
const group = new FieldGroupDescriptor(this._editor, this.name.substring(this.baseName.length));
|
|
2316
|
+
group._title = this._title;
|
|
2317
|
+
group._fields = this.fields.map(f => f.copy());
|
|
2318
|
+
return group;
|
|
2281
2319
|
}
|
|
2282
|
-
|
|
2283
|
-
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
class FieldValidator {
|
|
2323
|
+
constructor(name, expression, message, options) {
|
|
2324
|
+
this._name = name;
|
|
2325
|
+
this._expression = expression;
|
|
2326
|
+
this._message = message;
|
|
2327
|
+
this._options = options;
|
|
2284
2328
|
}
|
|
2285
|
-
get
|
|
2286
|
-
return this.
|
|
2329
|
+
get name() {
|
|
2330
|
+
return this._name;
|
|
2287
2331
|
}
|
|
2288
|
-
|
|
2289
|
-
this.
|
|
2290
|
-
return this;
|
|
2332
|
+
get expression() {
|
|
2333
|
+
return this._expression;
|
|
2291
2334
|
}
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
* @param filterProperty
|
|
2295
|
-
*/
|
|
2296
|
-
withFilterProperty(filterProperty) {
|
|
2297
|
-
this._filterProperty = filterProperty;
|
|
2298
|
-
return this;
|
|
2335
|
+
get message() {
|
|
2336
|
+
return this._message;
|
|
2299
2337
|
}
|
|
2300
|
-
|
|
2301
|
-
this.
|
|
2302
|
-
return this;
|
|
2338
|
+
get options() {
|
|
2339
|
+
return this._options;
|
|
2303
2340
|
}
|
|
2304
|
-
|
|
2305
|
-
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
class ModelDescriptor {
|
|
2344
|
+
constructor(modelType, idProperty, titleProperty) {
|
|
2345
|
+
this._type = modelType;
|
|
2346
|
+
this._idPropertyName = idProperty ?? ModelUtil.findIdAttribute(modelType) ?? undefined;
|
|
2347
|
+
this._titlePropertyName = titleProperty ?? ModelUtil.findTitleAttribute(modelType) ?? undefined;
|
|
2348
|
+
this._typeName = TypeUtil.findTypeName(this._type);
|
|
2349
|
+
}
|
|
2350
|
+
get type() {
|
|
2351
|
+
return this._type;
|
|
2352
|
+
}
|
|
2353
|
+
get typeName() {
|
|
2354
|
+
return this._typeName;
|
|
2355
|
+
}
|
|
2356
|
+
get idPropertyName() {
|
|
2357
|
+
return this._idPropertyName;
|
|
2358
|
+
}
|
|
2359
|
+
get titlePropertyName() {
|
|
2360
|
+
return this._titlePropertyName;
|
|
2361
|
+
}
|
|
2362
|
+
withIdPropertyName(idProperty) {
|
|
2363
|
+
this._idPropertyName = idProperty;
|
|
2306
2364
|
return this;
|
|
2307
2365
|
}
|
|
2308
|
-
|
|
2309
|
-
this.
|
|
2366
|
+
withTitlePropertyName(titleProperty) {
|
|
2367
|
+
this._titlePropertyName = titleProperty;
|
|
2310
2368
|
return this;
|
|
2311
2369
|
}
|
|
2312
2370
|
copy() {
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2315
|
-
return descriptor;
|
|
2316
|
-
}
|
|
2317
|
-
copyFieldsTo(descriptor) {
|
|
2318
|
-
descriptor._filterType = this._filterType;
|
|
2319
|
-
descriptor._filterProperty = this._filterProperty;
|
|
2320
|
-
descriptor._placeholder = this._placeholder;
|
|
2321
|
-
descriptor._className = this._className;
|
|
2371
|
+
const model = new ModelDescriptor(this._type, this._idPropertyName, this._titlePropertyName);
|
|
2372
|
+
return model;
|
|
2322
2373
|
}
|
|
2323
2374
|
}
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
(
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
})(FilterDescriptor || (FilterDescriptor = {}));
|
|
2353
|
-
class FilterLookupDescriptor extends FilterDescriptor {
|
|
2354
|
-
constructor(property, modelType) {
|
|
2355
|
-
super(property);
|
|
2356
|
-
this._modelType = null;
|
|
2357
|
-
this._lookupType = FilterLookupDescriptor.LookupTypeEnum.Dropdown;
|
|
2358
|
-
this._itemsLabelTranslate = false;
|
|
2359
|
-
this._multiselect = false;
|
|
2360
|
-
this._dropdownClassName = 'mng-filter-lookup-dropdown';
|
|
2361
|
-
this._autocompleteOpenOnFocus = false;
|
|
2362
|
-
this._autocompleteInlineSearch = false;
|
|
2363
|
-
this._modelType = modelType;
|
|
2364
|
-
this._filterType = FilterDescriptor.TypeEnum.Lookup;
|
|
2365
|
-
ModelUtil.trySetLookupItemsProperties(this);
|
|
2375
|
+
|
|
2376
|
+
class TableDescriptor {
|
|
2377
|
+
constructor(modelType, idProperty, titleProperty) {
|
|
2378
|
+
this._filterDisplay = TableDescriptor.FilterDisplayEnum.Menu;
|
|
2379
|
+
this._paginationMode = TableDescriptor.PaginationModeEnum.Pagination;
|
|
2380
|
+
this._columns = [];
|
|
2381
|
+
this._hideHeader = false;
|
|
2382
|
+
this._hasDefaultSort = false;
|
|
2383
|
+
this._defaultSortProperty = [];
|
|
2384
|
+
this._defaultSortAsc = [];
|
|
2385
|
+
this._rowHeight = 45;
|
|
2386
|
+
this._tableFullHeightOffset = 315;
|
|
2387
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2388
|
+
}
|
|
2389
|
+
get filterDisplay() {
|
|
2390
|
+
return this._filterDisplay;
|
|
2391
|
+
}
|
|
2392
|
+
get paginationMode() {
|
|
2393
|
+
return this._paginationMode;
|
|
2394
|
+
}
|
|
2395
|
+
get columns() {
|
|
2396
|
+
return this._columns;
|
|
2397
|
+
}
|
|
2398
|
+
get title() {
|
|
2399
|
+
return this._title;
|
|
2400
|
+
}
|
|
2401
|
+
get hideHeader() {
|
|
2402
|
+
return this._hideHeader;
|
|
2366
2403
|
}
|
|
2367
|
-
get
|
|
2368
|
-
return this.
|
|
2404
|
+
get dataKeyProperty() {
|
|
2405
|
+
return this._dataKeyProperty;
|
|
2369
2406
|
}
|
|
2370
|
-
get
|
|
2371
|
-
return this.
|
|
2407
|
+
get hasDefaultSort() {
|
|
2408
|
+
return this._hasDefaultSort;
|
|
2372
2409
|
}
|
|
2373
|
-
get
|
|
2374
|
-
return this.
|
|
2410
|
+
get defaultSortProperty() {
|
|
2411
|
+
return this._defaultSortProperty;
|
|
2375
2412
|
}
|
|
2376
|
-
get
|
|
2377
|
-
return this.
|
|
2413
|
+
get defaultSortAsc() {
|
|
2414
|
+
return this._defaultSortAsc;
|
|
2378
2415
|
}
|
|
2379
|
-
get
|
|
2380
|
-
return this.
|
|
2416
|
+
get rowHeight() {
|
|
2417
|
+
return this._rowHeight;
|
|
2381
2418
|
}
|
|
2382
|
-
get
|
|
2383
|
-
return this.
|
|
2419
|
+
get tableFullHeightOffset() {
|
|
2420
|
+
return this._tableFullHeightOffset;
|
|
2384
2421
|
}
|
|
2385
|
-
get
|
|
2386
|
-
return this.
|
|
2422
|
+
get model() {
|
|
2423
|
+
return this._model;
|
|
2387
2424
|
}
|
|
2388
|
-
|
|
2389
|
-
|
|
2425
|
+
addColumnDescriptor(column) {
|
|
2426
|
+
this._columns.push(column);
|
|
2427
|
+
this.setDataKeyFromColumn();
|
|
2428
|
+
return this;
|
|
2390
2429
|
}
|
|
2391
|
-
|
|
2392
|
-
|
|
2430
|
+
addColumn(property) {
|
|
2431
|
+
const column = new ColumnDescriptor(this, property);
|
|
2432
|
+
this._columns.push(column);
|
|
2433
|
+
this.setDataKeyFromColumn();
|
|
2434
|
+
return column;
|
|
2393
2435
|
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2436
|
+
addColumnNumber(property, displayFormat) {
|
|
2437
|
+
const column = new ColumnDescriptor(this, property);
|
|
2438
|
+
column.asNumber(displayFormat);
|
|
2439
|
+
this._columns.push(column);
|
|
2440
|
+
this.setDataKeyFromColumn();
|
|
2441
|
+
return column;
|
|
2396
2442
|
}
|
|
2397
|
-
|
|
2398
|
-
|
|
2443
|
+
addColumnDate(property, displayFormat) {
|
|
2444
|
+
const column = new ColumnDescriptor(this, property);
|
|
2445
|
+
column.asDate(displayFormat);
|
|
2446
|
+
this._columns.push(column);
|
|
2447
|
+
this.setDataKeyFromColumn();
|
|
2448
|
+
return column;
|
|
2399
2449
|
}
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2450
|
+
addColumnBoolean(property, yes, no, asIcon = false) {
|
|
2451
|
+
const column = new ColumnDescriptor(this, property);
|
|
2452
|
+
column.asBoolean(yes, no, asIcon);
|
|
2453
|
+
this._columns.push(column);
|
|
2454
|
+
this.setDataKeyFromColumn();
|
|
2455
|
+
return column;
|
|
2456
|
+
}
|
|
2457
|
+
addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
|
|
2458
|
+
const column = new ColumnDescriptor(this, property);
|
|
2459
|
+
column.asEnum(enumType, nameAsValue, titlePath);
|
|
2460
|
+
this._columns.push(column);
|
|
2461
|
+
this.setDataKeyFromColumn();
|
|
2462
|
+
return column;
|
|
2463
|
+
}
|
|
2464
|
+
addColumnCustomComponent(property, customComponentType) {
|
|
2465
|
+
const column = new ColumnDescriptor(this, property);
|
|
2466
|
+
column.asCustomComponent(customComponentType);
|
|
2467
|
+
this._columns.push(column);
|
|
2468
|
+
this.setDataKeyFromColumn();
|
|
2469
|
+
return column;
|
|
2470
|
+
}
|
|
2471
|
+
withFilterDisplay(filterDisplayType) {
|
|
2472
|
+
this._filterDisplay = filterDisplayType;
|
|
2403
2473
|
return this;
|
|
2404
2474
|
}
|
|
2405
|
-
|
|
2406
|
-
this.
|
|
2407
|
-
this._dataKeyProperty = itemsValueProperty;
|
|
2475
|
+
withPaginationMode(paginationMode) {
|
|
2476
|
+
this._paginationMode = paginationMode;
|
|
2408
2477
|
return this;
|
|
2409
2478
|
}
|
|
2410
|
-
|
|
2411
|
-
this.
|
|
2412
|
-
this._itemsValueProperty = dataKeyProperty;
|
|
2479
|
+
withTitle(title) {
|
|
2480
|
+
this._title = title;
|
|
2413
2481
|
return this;
|
|
2414
2482
|
}
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
if (serviceType) {
|
|
2418
|
-
dataProvider.withServiceType(serviceType);
|
|
2419
|
-
}
|
|
2420
|
-
dataProvider.withLookup(lookup);
|
|
2421
|
-
this._dataProvider = dataProvider;
|
|
2483
|
+
withHideHeader(hideHeader = true) {
|
|
2484
|
+
this._hideHeader = hideHeader;
|
|
2422
2485
|
return this;
|
|
2423
2486
|
}
|
|
2424
|
-
|
|
2425
|
-
this.
|
|
2487
|
+
withDataKeyProperty(property) {
|
|
2488
|
+
this._dataKeyProperty = property;
|
|
2426
2489
|
return this;
|
|
2427
2490
|
}
|
|
2428
|
-
|
|
2429
|
-
this.
|
|
2491
|
+
withDefaultSort(property, asc = true) {
|
|
2492
|
+
this._hasDefaultSort = true;
|
|
2493
|
+
this._defaultSortProperty.push(property);
|
|
2494
|
+
this._defaultSortAsc.push(asc);
|
|
2430
2495
|
return this;
|
|
2431
2496
|
}
|
|
2432
|
-
|
|
2433
|
-
this.
|
|
2497
|
+
withRowHeight(rowHeight) {
|
|
2498
|
+
this._rowHeight = rowHeight;
|
|
2434
2499
|
return this;
|
|
2435
2500
|
}
|
|
2436
|
-
|
|
2437
|
-
this.
|
|
2438
|
-
this._autocompleteOpenOnFocus = openOnFocus;
|
|
2439
|
-
this._autocompleteInlineSearch = inlineSearch;
|
|
2501
|
+
withTableFullHeightOffset(tableFullHeightOffset) {
|
|
2502
|
+
this._tableFullHeightOffset = tableFullHeightOffset;
|
|
2440
2503
|
return this;
|
|
2441
2504
|
}
|
|
2442
2505
|
copy() {
|
|
2443
|
-
const descriptor = new
|
|
2444
|
-
this.
|
|
2506
|
+
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
2507
|
+
descriptor._columns = this.columns.map(c => c.copy());
|
|
2508
|
+
descriptor._title = this._title;
|
|
2509
|
+
descriptor._hideHeader = this._hideHeader;
|
|
2510
|
+
descriptor._dataKeyProperty = this._dataKeyProperty;
|
|
2511
|
+
descriptor._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
2512
|
+
descriptor._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
2513
|
+
descriptor._filterDisplay = this._filterDisplay;
|
|
2445
2514
|
return descriptor;
|
|
2446
2515
|
}
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
filter._lookupType = this._lookupType;
|
|
2451
|
-
filter._itemsLabelProperty = this._itemsLabelProperty;
|
|
2452
|
-
filter._itemsLabelTranslate = this._itemsLabelTranslate;
|
|
2453
|
-
filter._itemsValueProperty = this._itemsValueProperty;
|
|
2454
|
-
filter._dataKeyProperty = this._dataKeyProperty;
|
|
2455
|
-
filter._multiselect = this._multiselect;
|
|
2456
|
-
filter._dropdownClassName = this._dropdownClassName;
|
|
2457
|
-
filter._autocompleteOpenOnFocus = this._autocompleteOpenOnFocus;
|
|
2458
|
-
filter._autocompleteInlineSearch = this._autocompleteInlineSearch;
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
class FilterLookupEnumDescriptor extends FilterLookupDescriptor {
|
|
2462
|
-
constructor(property, enumType, options, nameAsValue = false, optionsTitlePath) {
|
|
2463
|
-
super(property, null);
|
|
2464
|
-
this._enumType = enumType;
|
|
2465
|
-
if (typeof optionsTitlePath === 'undefined') {
|
|
2466
|
-
optionsTitlePath = TypeUtil.findEnumName(enumType);
|
|
2516
|
+
setDataKeyFromColumn() {
|
|
2517
|
+
if (!this._dataKeyProperty && this._columns.length === 1) {
|
|
2518
|
+
this._dataKeyProperty = this._columns[0].property;
|
|
2467
2519
|
}
|
|
2468
|
-
const optionEnumValues = Array.isArray(options)
|
|
2469
|
-
? EnumUtil.fromValuesAsEnumValueArray(enumType, options, nameAsValue, optionsTitlePath ?? undefined)
|
|
2470
|
-
: EnumUtil.fromConstantsAsEnumValueArray(enumType, nameAsValue, optionsTitlePath ?? undefined);
|
|
2471
|
-
const dataProvider = new LookupDataProvider(null).withLookup(() => of(optionEnumValues));
|
|
2472
|
-
this.withLookupDataProvider(dataProvider);
|
|
2473
|
-
this.withItemsLabelProperty('title', optionsTitlePath !== null);
|
|
2474
|
-
this.withItemsValueProperty('value');
|
|
2475
|
-
}
|
|
2476
|
-
get enumType() {
|
|
2477
|
-
return this._enumType;
|
|
2478
|
-
}
|
|
2479
|
-
asAutocomplete(openOnFocus = true) {
|
|
2480
|
-
super.asAutocomplete(openOnFocus, true);
|
|
2481
|
-
return this;
|
|
2482
|
-
}
|
|
2483
|
-
copy() {
|
|
2484
|
-
const field = new FilterLookupEnumDescriptor(this._property, this._enumType, []);
|
|
2485
|
-
this.copyFieldsTo(field);
|
|
2486
|
-
return field;
|
|
2487
2520
|
}
|
|
2488
2521
|
}
|
|
2489
|
-
(function (
|
|
2490
|
-
let
|
|
2491
|
-
(function (
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
})(
|
|
2495
|
-
|
|
2522
|
+
(function (TableDescriptor) {
|
|
2523
|
+
let PaginationModeEnum;
|
|
2524
|
+
(function (PaginationModeEnum) {
|
|
2525
|
+
PaginationModeEnum[PaginationModeEnum["Pagination"] = 0] = "Pagination";
|
|
2526
|
+
PaginationModeEnum[PaginationModeEnum["InfiniteScroll"] = 1] = "InfiniteScroll";
|
|
2527
|
+
})(PaginationModeEnum = TableDescriptor.PaginationModeEnum || (TableDescriptor.PaginationModeEnum = {}));
|
|
2528
|
+
let FilterDisplayEnum;
|
|
2529
|
+
(function (FilterDisplayEnum) {
|
|
2530
|
+
FilterDisplayEnum[FilterDisplayEnum["Row"] = 0] = "Row";
|
|
2531
|
+
FilterDisplayEnum[FilterDisplayEnum["Menu"] = 1] = "Menu";
|
|
2532
|
+
})(FilterDisplayEnum = TableDescriptor.FilterDisplayEnum || (TableDescriptor.FilterDisplayEnum = {}));
|
|
2533
|
+
})(TableDescriptor || (TableDescriptor = {}));
|
|
2496
2534
|
|
|
2497
2535
|
var TableviewEditorTypeEnum = EditorDescriptor.TableviewEditorTypeEnum;
|
|
2498
2536
|
class TableviewDescriptor {
|
|
@@ -2567,8 +2605,8 @@ class TableviewDescriptor {
|
|
|
2567
2605
|
addColumnEnum(property, enumType, nameAsValue = false, titlePath) {
|
|
2568
2606
|
return this._table.addColumnEnum(property, enumType, nameAsValue, titlePath);
|
|
2569
2607
|
}
|
|
2570
|
-
|
|
2571
|
-
return this._table.
|
|
2608
|
+
addColumnCustomComponent(property, customComponentType) {
|
|
2609
|
+
return this._table.addColumnCustomComponent(property, customComponentType);
|
|
2572
2610
|
}
|
|
2573
2611
|
createTabGroup(name, title) {
|
|
2574
2612
|
this._viewEditor.createTabGroup(name, title);
|
|
@@ -3062,14 +3100,10 @@ class ModelUtil {
|
|
|
3062
3100
|
if (!attributes) {
|
|
3063
3101
|
return null;
|
|
3064
3102
|
}
|
|
3065
|
-
let idAttribute =
|
|
3103
|
+
let idAttribute = ModelUtil.findAttributeByTypeAndName(attributes, 'string', 'id', 'uuid', 'code', 'sifra');
|
|
3066
3104
|
if (!idAttribute) {
|
|
3067
|
-
// if no id,
|
|
3068
|
-
idAttribute = attributes
|
|
3069
|
-
if (!idAttribute) {
|
|
3070
|
-
// if no id or code, take the first attribute
|
|
3071
|
-
idAttribute = attributes[0];
|
|
3072
|
-
}
|
|
3105
|
+
// if no id or code, take the first attribute
|
|
3106
|
+
idAttribute = attributes[0];
|
|
3073
3107
|
}
|
|
3074
3108
|
return idAttribute?.name ?? null;
|
|
3075
3109
|
}
|
|
@@ -3079,17 +3113,22 @@ class ModelUtil {
|
|
|
3079
3113
|
if (!attributes) {
|
|
3080
3114
|
return null;
|
|
3081
3115
|
}
|
|
3082
|
-
let titleAttribute =
|
|
3116
|
+
let titleAttribute = ModelUtil.findAttributeByTypeAndName(attributes, 'string', 'name', 'ime', 'title', 'naziv');
|
|
3083
3117
|
if (!titleAttribute) {
|
|
3084
|
-
// if no name,
|
|
3085
|
-
titleAttribute = attributes
|
|
3086
|
-
if (!titleAttribute) {
|
|
3087
|
-
// if no name or title, take the first attribute
|
|
3088
|
-
titleAttribute = attributes[0];
|
|
3089
|
-
}
|
|
3118
|
+
// if no name or title, take the first attribute
|
|
3119
|
+
titleAttribute = attributes[0];
|
|
3090
3120
|
}
|
|
3091
3121
|
return titleAttribute?.name ?? null;
|
|
3092
3122
|
}
|
|
3123
|
+
static findAttributeByTypeAndName(attributes, type, ...names) {
|
|
3124
|
+
for (const name of names) {
|
|
3125
|
+
const attribute = attributes.find(a => a.type === type && a.name === name);
|
|
3126
|
+
if (attribute) {
|
|
3127
|
+
return attribute;
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
return null;
|
|
3131
|
+
}
|
|
3093
3132
|
static trySetLookupItemsProperties(lookup, idAsDataKey = true) {
|
|
3094
3133
|
if (lookup.modelType) {
|
|
3095
3134
|
if (!lookup.itemsValueProperty || !lookup.dataKeyProperty) {
|
|
@@ -3386,6 +3425,9 @@ class ObjectSerializer {
|
|
|
3386
3425
|
serializeClass(data, type) {
|
|
3387
3426
|
return this.serialize(data, TypeUtil.findTypeName(type));
|
|
3388
3427
|
}
|
|
3428
|
+
serializeClassArray(data, type) {
|
|
3429
|
+
return this.serialize(data, `Array<${TypeUtil.findTypeName(type)}>`);
|
|
3430
|
+
}
|
|
3389
3431
|
serialize(data, type) {
|
|
3390
3432
|
if (data == undefined) {
|
|
3391
3433
|
return data;
|
|
@@ -3437,6 +3479,9 @@ class ObjectSerializer {
|
|
|
3437
3479
|
deserializeClass(data, type) {
|
|
3438
3480
|
return this.deserialize(data, TypeUtil.findTypeName(type));
|
|
3439
3481
|
}
|
|
3482
|
+
deserializeClassArray(data, type) {
|
|
3483
|
+
return this.deserialize(data, `Array<${TypeUtil.findTypeName(type)}>`);
|
|
3484
|
+
}
|
|
3440
3485
|
deserialize(data, type) {
|
|
3441
3486
|
// polymorphism may change the actual type.
|
|
3442
3487
|
type = this.findCorrectType(data, type);
|
|
@@ -3831,8 +3876,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
3831
3876
|
}]
|
|
3832
3877
|
}] });
|
|
3833
3878
|
|
|
3834
|
-
|
|
3879
|
+
/**
|
|
3880
|
+
* Imitation of JSONPath Syntax. Supports:
|
|
3881
|
+
* - Root object notation with '$'
|
|
3882
|
+
* - Dot notation (e.g.: $.foo.bar), no bracket notation for properties
|
|
3883
|
+
* - Array notation (e.g.: [0])
|
|
3884
|
+
*/
|
|
3885
|
+
class JsonPathPipe {
|
|
3835
3886
|
transform(value, path = '') {
|
|
3887
|
+
if (path === '$') {
|
|
3888
|
+
// only return the root
|
|
3889
|
+
return value;
|
|
3890
|
+
}
|
|
3891
|
+
// Check for leading root object notation
|
|
3892
|
+
if (path.startsWith('$')) {
|
|
3893
|
+
path = path.substring(1);
|
|
3894
|
+
}
|
|
3895
|
+
// Check for leading .
|
|
3896
|
+
if (path.startsWith('.')) {
|
|
3897
|
+
path = path.substring(1);
|
|
3898
|
+
}
|
|
3836
3899
|
if (path.indexOf('.') >= 0) {
|
|
3837
3900
|
const pathSplit = path.split('.');
|
|
3838
3901
|
let currValue = value;
|
|
@@ -3840,6 +3903,32 @@ class MngPropertyPathPipe {
|
|
|
3840
3903
|
if (typeof currValue === 'undefined' || currValue === null) {
|
|
3841
3904
|
return currValue;
|
|
3842
3905
|
}
|
|
3906
|
+
if (!p.length) {
|
|
3907
|
+
// empty path, return current value
|
|
3908
|
+
return currValue;
|
|
3909
|
+
}
|
|
3910
|
+
const leftBracketIdx = p.indexOf('[');
|
|
3911
|
+
if (leftBracketIdx >= 0 && p.endsWith(']')) {
|
|
3912
|
+
// should be reference to array
|
|
3913
|
+
const arrayPath = p.substring(0, leftBracketIdx);
|
|
3914
|
+
const arrayIdx = +p.substring(leftBracketIdx + 1, p.length - 1);
|
|
3915
|
+
const array = currValue[arrayPath];
|
|
3916
|
+
console.log(arrayPath, arrayIdx, array);
|
|
3917
|
+
if (Array.isArray(array)) {
|
|
3918
|
+
if (arrayIdx >= 0 && arrayIdx < array.length) {
|
|
3919
|
+
// valid index, continue on the path
|
|
3920
|
+
currValue = array[arrayIdx];
|
|
3921
|
+
continue;
|
|
3922
|
+
}
|
|
3923
|
+
else {
|
|
3924
|
+
console.warn(`Path ${path} array index at ${p} is not within valid array range`, value);
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
else {
|
|
3928
|
+
console.warn(`Path ${path} array at ${p} is not a valid array`, value);
|
|
3929
|
+
}
|
|
3930
|
+
return undefined;
|
|
3931
|
+
}
|
|
3843
3932
|
else if (typeof currValue === 'object') {
|
|
3844
3933
|
currValue = currValue[p];
|
|
3845
3934
|
}
|
|
@@ -3851,16 +3940,16 @@ class MngPropertyPathPipe {
|
|
|
3851
3940
|
return currValue;
|
|
3852
3941
|
}
|
|
3853
3942
|
else {
|
|
3854
|
-
return
|
|
3943
|
+
return value[path];
|
|
3855
3944
|
}
|
|
3856
3945
|
}
|
|
3857
3946
|
}
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type:
|
|
3947
|
+
JsonPathPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: JsonPathPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3948
|
+
JsonPathPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: JsonPathPipe, name: "jsonPath" });
|
|
3949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: JsonPathPipe, decorators: [{
|
|
3861
3950
|
type: Pipe,
|
|
3862
3951
|
args: [{
|
|
3863
|
-
name: '
|
|
3952
|
+
name: 'jsonPath',
|
|
3864
3953
|
pure: true
|
|
3865
3954
|
}]
|
|
3866
3955
|
}] });
|
|
@@ -4695,10 +4784,10 @@ class MngActionComponent {
|
|
|
4695
4784
|
}
|
|
4696
4785
|
}
|
|
4697
4786
|
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
4698
|
-
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { triggerEventEmitter: "trigger" }, host: { properties: { "class": "this.hostClass" } }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [href]=\"actionLink.url\"\n [target]=\"actionLink.target\"\n [
|
|
4787
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { triggerEventEmitter: "trigger" }, host: { properties: { "class": "this.hostClass" } }, providers: [ConfirmationService], ngImport: i0, template: "<ng-container *ngIf=\"$isVisible | async\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : actionLink.url\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"\n ($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | linkFormatter: itemId:item:action.model:actionData)\n \"\n [queryParams]=\"actionLink.queryParams\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], components: [{ type: i5.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i9.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], pipes: { "async": i4.AsyncPipe, "linkFormatter": MngLinkFormatterPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4699
4788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
4700
4789
|
type: Component,
|
|
4701
|
-
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [href]=\"actionLink.url\"\n [target]=\"actionLink.target\"\n [
|
|
4790
|
+
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"$isVisible | async\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : actionLink.url\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"\n ($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | linkFormatter: itemId:item:action.model:actionData)\n \"\n [queryParams]=\"actionLink.queryParams\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-link]=\"actionLink.isStyleLink\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class.p-button-rounded]=\"hasNoTitle\"\n [class.mng-action-button-icon]=\"hasNoTitle\"\n [class.p-button-text]=\"action.isStyleText\"\n [class.p-button-raised]=\"action.isStyleRaised\"\n [class.p-button-outlined]=\"action.isStyleOutlined\"\n [class.mng-button-xs]=\"action.isSizeExtraSmall\"\n [class.mng-button-sm]=\"action.isSizeSmall\"\n [class.mng-button-lg]=\"action.isSizeLarge\"\n [class.mng-button-xl]=\"action.isSizeExtraLarge\"\n [class.p-button-default]=\"action.level === levelDefault\"\n [class.p-button-primary]=\"action.level === levelPrimary\"\n [class.p-button-secondary]=\"action.level === levelSecondary\"\n [class.p-button-info]=\"action.level === levelInfo\"\n [class.p-button-help]=\"action.level === levelHelp\"\n [class.p-button-success]=\"action.level === levelSuccess\"\n [class.p-button-warning]=\"action.level === levelWarning\"\n [class.p-button-danger]=\"action.level === levelDanger\"></button>\n </ng-template>\n <p-confirmDialog *ngIf=\"action.hasRunConfirmation\" [key]=\"action.actionName + '_' + cmpId\" [baseZIndex]=\"50\" appendTo=\"body\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
4702
4791
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i1$1.TranslateService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
4703
4792
|
type: Optional
|
|
4704
4793
|
}] }]; }, propDecorators: { hostClass: [{
|
|
@@ -4854,11 +4943,25 @@ class MngComponentDirective {
|
|
|
4854
4943
|
ngOnInit() {
|
|
4855
4944
|
this.viewContainerRef.clear();
|
|
4856
4945
|
this.componentRef = this.viewContainerRef.createComponent(this.component);
|
|
4946
|
+
if (this.inputs) {
|
|
4947
|
+
if (this.isCmpInstanceOfColumnValue(this.componentRef.instance)) {
|
|
4948
|
+
this.componentRef.instance.setColumnValue(this.inputs['value'], this.inputs['item'], this.inputs['descriptor']);
|
|
4949
|
+
}
|
|
4950
|
+
else {
|
|
4951
|
+
const instanceAny = this.componentRef;
|
|
4952
|
+
for (const input in this.inputs) {
|
|
4953
|
+
instanceAny[input] = this.inputs[input];
|
|
4954
|
+
}
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4857
4957
|
this.componentInstanceEventEmitter.next(this.componentRef.instance);
|
|
4858
4958
|
}
|
|
4959
|
+
isCmpInstanceOfColumnValue(cmp) {
|
|
4960
|
+
return typeof cmp.setColumnValue === 'function';
|
|
4961
|
+
}
|
|
4859
4962
|
}
|
|
4860
4963
|
MngComponentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4861
|
-
MngComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: MngComponentDirective, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"] }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 });
|
|
4964
|
+
MngComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: MngComponentDirective, selector: "[mngComponent]", inputs: { component: ["mngComponent", "component"], inputs: "inputs" }, outputs: { componentInstanceEventEmitter: "instanceCreated" }, ngImport: i0 });
|
|
4862
4965
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngComponentDirective, decorators: [{
|
|
4863
4966
|
type: Directive,
|
|
4864
4967
|
args: [{
|
|
@@ -4867,6 +4970,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4867
4970
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { component: [{
|
|
4868
4971
|
type: Input,
|
|
4869
4972
|
args: ['mngComponent']
|
|
4973
|
+
}], inputs: [{
|
|
4974
|
+
type: Input
|
|
4870
4975
|
}], componentInstanceEventEmitter: [{
|
|
4871
4976
|
type: Output,
|
|
4872
4977
|
args: ['instanceCreated']
|
|
@@ -5728,10 +5833,10 @@ class MngFormlyFieldInputComponent extends FieldType {
|
|
|
5728
5833
|
}
|
|
5729
5834
|
}
|
|
5730
5835
|
MngFormlyFieldInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5731
|
-
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 [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </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 [inputStyleClass]=\"descriptor.inputClassName\">\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 [styleClass]=\"descriptor.inputClassName\">\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$2.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$3.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3$1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$4.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5$1.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.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10.InputText, selector: "[pInputText]" }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5836
|
+
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 [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n appendTo=\"body\"\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 [inputStyleClass]=\"descriptor.inputClassName\">\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 [styleClass]=\"descriptor.inputClassName\">\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$2.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$3.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabelledBy"], outputs: ["onChange"] }, { type: i3$1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i4$4.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5$1.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.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i10.InputText, selector: "[pInputText]" }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5732
5837
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldInputComponent, decorators: [{
|
|
5733
5838
|
type: Component,
|
|
5734
|
-
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 [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </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 [inputStyleClass]=\"descriptor.inputClassName\">\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 [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
|
|
5839
|
+
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 [useGrouping]=\"$any(descriptor.numberUseGrouping)\"\n [minFractionDigits]=\"descriptor.numberMinFractionDigits || 0\"\n [maxFractionDigits]=\"descriptor.numberMaxFractionDigits || 0\"\n [inputStyleClass]=\"descriptor.inputClassName\">\n </p-inputNumber>\n\n <div *ngSwitchCase=\"'switch'\" class=\"flex flex-column\">\n <label [for]=\"key\" [class]=\"descriptor.labelClassName\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <p-inputSwitch [id]=\"$any(key)\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" [styleClass]=\"descriptor.inputClassName\"></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\n [name]=\"$any(key)\"\n [value]=\"option.value\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [styleClass]=\"descriptor.inputClassName\"></p-radioButton>\n <label [for]=\"option.value\" [class]=\"'mng-radio-button-label ' + descriptor.labelClassName\">{{ option.title | translate }}</label>\n </div>\n </ng-container>\n\n <textarea\n *ngSwitchCase=\"'textarea'\"\n [id]=\"$any(key)\"\n [formControl]=\"iFormControl\"\n [formlyAttributes]=\"field\"\n [rows]=\"descriptor.rows ?? 3\"\n pInputTextarea\n [class]=\"descriptor.inputClassName\">\n </textarea>\n\n <p-calendar\n *ngSwitchCase=\"'datepicker'\"\n appendTo=\"body\"\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 [inputStyleClass]=\"descriptor.inputClassName\">\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 [styleClass]=\"descriptor.inputClassName\">\n </p-inputMask>\n\n <input *ngSwitchDefault pInputText [id]=\"$any(key)\" [type]=\"to.type || 'text'\" [formControl]=\"iFormControl\" [formlyAttributes]=\"field\" />\n</ng-container>\n" }]
|
|
5735
5840
|
}] });
|
|
5736
5841
|
|
|
5737
5842
|
class MngFormlyFieldDropdownComponent extends FieldType {
|
|
@@ -5816,15 +5921,6 @@ class MngTableColumnFilterComponent {
|
|
|
5816
5921
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
5817
5922
|
autocompleteFilter(value, filterCallback) {
|
|
5818
5923
|
filterCallback(value);
|
|
5819
|
-
// if (value) {
|
|
5820
|
-
// let filterValue: any = value;
|
|
5821
|
-
// if (this.lookupDescriptor!.itemsValueProperty) {
|
|
5822
|
-
// filterValue = filterValue[this.lookupDescriptor!.itemsValueProperty];
|
|
5823
|
-
// }
|
|
5824
|
-
// filterCallback(filterValue);
|
|
5825
|
-
// } else {
|
|
5826
|
-
// filterCallback(value);
|
|
5827
|
-
// }
|
|
5828
5924
|
}
|
|
5829
5925
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
5830
5926
|
dropdownFilter(value, filterCallback) {
|
|
@@ -5853,13 +5949,26 @@ class MngTableColumnValueComponent {
|
|
|
5853
5949
|
this.columnTypeBoolean = ColumnDescriptor.TypeEnum.Boolean;
|
|
5854
5950
|
this.columnTypeDate = ColumnDescriptor.TypeEnum.Date;
|
|
5855
5951
|
this.columnTypeEnum = ColumnDescriptor.TypeEnum.Enum;
|
|
5952
|
+
this.columnTypeCustom = ColumnDescriptor.TypeEnum.Custom;
|
|
5953
|
+
this.jsonPath = '$';
|
|
5954
|
+
}
|
|
5955
|
+
ngOnInit() {
|
|
5956
|
+
if (this.descriptor.jsonPath) {
|
|
5957
|
+
this.jsonPath = this.descriptor.jsonPath;
|
|
5958
|
+
}
|
|
5959
|
+
else {
|
|
5960
|
+
this.jsonPath = `$.${this.descriptor.property}`;
|
|
5961
|
+
if (this.descriptor.objectModelType) {
|
|
5962
|
+
this.jsonPath = `$.${this.descriptor.property}.${this.descriptor.objectTitleProperty}`;
|
|
5963
|
+
}
|
|
5964
|
+
}
|
|
5856
5965
|
}
|
|
5857
5966
|
}
|
|
5858
5967
|
MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5859
|
-
MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{
|
|
5968
|
+
MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ item | jsonPath: jsonPath }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ item | jsonPath: jsonPath | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ item | jsonPath: jsonPath | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n <ng-container *ngIf=\"descriptor.booleanAsIcon; else booleanText\"></ng-container>\n <i [class]=\"item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo:true\"></i>\n <ng-template #booleanText>\n {{ item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo | translate }}\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{ item | jsonPath: jsonPath | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue | translate }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCustom\">\n <ng-container\n [mngComponent]=\"descriptor.customComponentType!\"\n [inputs]=\"{\n value: item | jsonPath: jsonPath,\n item: item,\n descriptor: descriptor\n }\"></ng-container>\n </ng-container>\n</ng-container>\n", directives: [{ type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }], pipes: { "jsonPath": JsonPathPipe, "number": i4.DecimalPipe, "date": i4.DatePipe, "boolean": MngBooleanPipe, "translate": i1$1.TranslatePipe, "enum": MngEnumPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5860
5969
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
|
|
5861
5970
|
type: Component,
|
|
5862
|
-
args: [{ selector: 'mng-table-column-value', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{
|
|
5971
|
+
args: [{ selector: 'mng-table-column-value', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ item | jsonPath: jsonPath }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ item | jsonPath: jsonPath | number: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ item | jsonPath: jsonPath | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n <ng-container *ngIf=\"descriptor.booleanAsIcon; else booleanText\"></ng-container>\n <i [class]=\"item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo:true\"></i>\n <ng-template #booleanText>\n {{ item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo | translate }}\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{ item | jsonPath: jsonPath | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue | translate }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCustom\">\n <ng-container\n [mngComponent]=\"descriptor.customComponentType!\"\n [inputs]=\"{\n value: item | jsonPath: jsonPath,\n item: item,\n descriptor: descriptor\n }\"></ng-container>\n </ng-container>\n</ng-container>\n" }]
|
|
5863
5972
|
}], propDecorators: { descriptor: [{
|
|
5864
5973
|
type: Input
|
|
5865
5974
|
}], item: [{
|
|
@@ -6126,10 +6235,10 @@ class MngTableComponent {
|
|
|
6126
6235
|
}
|
|
6127
6236
|
}
|
|
6128
6237
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6129
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", isColumnClickable: "isColumnClickable", captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.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 || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6238
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", isColumnClickable: "isColumnClickable", captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6130
6239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
6131
6240
|
type: Component,
|
|
6132
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.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 || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
6241
|
+
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
6133
6242
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$1.TranslateService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6134
6243
|
type: Optional
|
|
6135
6244
|
}] }]; }, propDecorators: { descriptor: [{
|
|
@@ -6245,10 +6354,10 @@ class MngTableviewComponent {
|
|
|
6245
6354
|
}
|
|
6246
6355
|
}
|
|
6247
6356
|
MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$1.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6248
|
-
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"
|
|
6357
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i1$1.TranslatePipe } });
|
|
6249
6358
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
6250
6359
|
type: Component,
|
|
6251
|
-
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"
|
|
6360
|
+
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
|
|
6252
6361
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2.MessageService }, { type: i1$1.TranslateService }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService }]; }, propDecorators: { descriptor: [{
|
|
6253
6362
|
type: Input
|
|
6254
6363
|
}], dataProvider: [{
|
|
@@ -6268,12 +6377,24 @@ class AMngTableviewRouteComponent {
|
|
|
6268
6377
|
}
|
|
6269
6378
|
createActionDescriptors() {
|
|
6270
6379
|
const actions = [];
|
|
6271
|
-
actions.push(
|
|
6272
|
-
actions.push(
|
|
6273
|
-
actions.push(
|
|
6274
|
-
actions.push(
|
|
6380
|
+
actions.push(this.createActionDescriptorForDetails());
|
|
6381
|
+
actions.push(this.createActionDescriptorForAdd());
|
|
6382
|
+
actions.push(this.createActionDescriptorForEdit());
|
|
6383
|
+
actions.push(this.createActionDescriptorForDelete());
|
|
6275
6384
|
return actions;
|
|
6276
6385
|
}
|
|
6386
|
+
createActionDescriptorForDetails(descriptor = this.descriptor.viewEditor) {
|
|
6387
|
+
return new ActionEditorDetailsDescriptor(descriptor);
|
|
6388
|
+
}
|
|
6389
|
+
createActionDescriptorForAdd(descriptor = this.descriptor.addEditor) {
|
|
6390
|
+
return new ActionEditorAddDescriptor(descriptor);
|
|
6391
|
+
}
|
|
6392
|
+
createActionDescriptorForEdit(descriptor = this.descriptor.editEditor) {
|
|
6393
|
+
return new ActionEditorEditDescriptor(descriptor);
|
|
6394
|
+
}
|
|
6395
|
+
createActionDescriptorForDelete(descriptor = this.descriptor.model) {
|
|
6396
|
+
return new ActionDeleteDescriptor(descriptor);
|
|
6397
|
+
}
|
|
6277
6398
|
}
|
|
6278
6399
|
AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6279
6400
|
AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: AMngTableviewRouteComponent, ngImport: i0 });
|
|
@@ -6480,10 +6601,10 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
|
6480
6601
|
}
|
|
6481
6602
|
}
|
|
6482
6603
|
MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
6483
|
-
MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-
|
|
6604
|
+
MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6484
6605
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
|
|
6485
6606
|
type: Component,
|
|
6486
|
-
args: [{ selector: 'mng-formly-field-lookup-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-
|
|
6607
|
+
args: [{ selector: 'mng-formly-field-lookup-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value\"></i>\n <button pButton pRipple class=\"mng-dropdown-dialog-search-button\" type=\"button\" [label]=\"'general.search' | translate: {item: ''}\" (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
|
|
6487
6608
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { mngTable: [{
|
|
6488
6609
|
type: ViewChild,
|
|
6489
6610
|
args: [MngTableComponent]
|
|
@@ -7252,7 +7373,7 @@ class MngTopbarComponent {
|
|
|
7252
7373
|
}
|
|
7253
7374
|
}
|
|
7254
7375
|
MngTopbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTopbarComponent, deps: [{ token: i1.ActivatedRoute }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7255
|
-
MngTopbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTopbarComponent, selector: "mng-topbar", viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n", components: [{ type: i2$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7376
|
+
MngTopbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTopbarComponent, selector: "mng-topbar", viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n", components: [{ type: i2$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7256
7377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTopbarComponent, decorators: [{
|
|
7257
7378
|
type: Component,
|
|
7258
7379
|
args: [{ selector: 'mng-topbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"layout-topbar\">\n <div class=\"layout-topbar-left\">\n <a\n href=\"#\"\n class=\"topbar-menu-button\"\n (click)=\"mainLayoutService.onMenuButtonClick($event)\"\n *ngIf=\"(mngCommons.menuModeIsOverlay$ | async) || (mainLayoutService.isMobile$ | async)\">\n <i class=\"pi pi-bars\"></i>\n </a>\n\n <ng-container [mngComponent]=\"breadcrumbComponent\"></ng-container>\n </div>\n\n <ng-container [mngComponent]=\"menuComponent\"></ng-container>\n\n <div class=\"layout-topbar-right\">\n <ul class=\"layout-topbar-right-items\">\n <li #profile class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <a href=\"#\" (click)=\"mainLayoutService.onTopbarItemClick($event, profile)\">\n <i class=\"pi pi-fw pi-user\"></i>\n </a>\n <ul class=\"fadeInDown\" *ngIf=\"user\">\n <li role=\"menuitem\">\n <a>\n {{ user?.displayName ?? user?.username }}\n </a>\n </li>\n <li role=\"menuitem\" *ngIf=\"user?.logout || user?.logoutUrl\">\n <a [href]=\"user?.logoutUrl\" (click)=\"logout(user, $event)\">\n <i class=\"pi pi-fw pi-sign-out\"></i>\n <span>{{ 'mngTopbar.logout' | translate }}</span>\n </a>\n </li>\n </ul>\n </li>\n <li *ngIf=\"languages.length > 1\" class=\"profile-item\" [ngClass]=\"{'active-topmenuitem': (mainLayoutService.activeTopbarItem$ | async) === profile}\">\n <i class=\"pi pi-fw pi-globe\"></i>\n <p-dropdown [ngModel]=\"selectedLanguage\" [options]=\"languages\" (onChange)=\"switchLanguage($event.value)\"></p-dropdown>\n </li>\n </ul>\n </div>\n</div>\n" }]
|
|
@@ -7289,7 +7410,7 @@ class MngMainLayoutComponent {
|
|
|
7289
7410
|
}
|
|
7290
7411
|
}
|
|
7291
7412
|
MngMainLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMainLayoutComponent, deps: [{ token: i1.ActivatedRoute }, { token: MngCommonsService }, { token: MngMainLayoutComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7292
|
-
MngMainLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMainLayoutComponent, selector: "mng-main-layout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [MngMainLayoutComponentService], viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n", directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent"], outputs: ["instanceCreated"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7413
|
+
MngMainLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngMainLayoutComponent, selector: "mng-main-layout", host: { listeners: { "window:resize": "onWindowResize($event)" } }, providers: [MngMainLayoutComponentService], viewQueries: [{ propertyName: "templates", predicate: MngTemplateDirective, descendants: true }], ngImport: i0, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n", directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7293
7414
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngMainLayoutComponent, decorators: [{
|
|
7294
7415
|
type: Component,
|
|
7295
7416
|
args: [{ selector: 'mng-main-layout', providers: [MngMainLayoutComponentService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"layout-wrapper\"\n (click)=\"mainLayoutService.onLayoutClick()\"\n [ngClass]=\"{\n 'layout-static': mngCommons.menuModeIsStatic$ | async,\n 'layout-overlay': mngCommons.menuModeIsOverlay$ | async,\n 'layout-slim': mngCommons.menuModeIsSlim$ | async,\n 'layout-sidebar': mngCommons.menuModeIsSidebar$ | async,\n 'layout-sidebar-static': (mngCommons.menuModeIsSidebar$ | async) && (mainLayoutService.sidebarStatic$ | async),\n 'layout-overlay-active': mainLayoutService.overlayMenuActive$ | async,\n 'layout-mobile-active': mainLayoutService.staticMenuMobileActive$ | async,\n 'layout-static-inactive': (mainLayoutService.staticMenuDesktopInactive$ | async) && (mngCommons.menuModeIsStatic$ | async)\n }\">\n <div class=\"layout-main\">\n <ng-container [mngComponent]=\"topbarComponent\"></ng-container>\n\n <ng-container\n *ngIf=\"\n (mainLayoutService.isMobile$ | async) === false &&\n ((mngCommons.menuModeIsStatic$ | async) || (mngCommons.menuModeIsSlim$ | async) || (mngCommons.menuModeIsSidebar$ | async))\n \"\n [mngComponent]=\"menuComponent\">\n </ng-container>\n\n <div class=\"layout-main-content\">\n <router-outlet></router-outlet>\n </div>\n\n <ng-container [mngComponent]=\"footerComponent\"></ng-container>\n </div>\n</div>\n" }]
|
|
@@ -7551,7 +7672,7 @@ const declarations = [
|
|
|
7551
7672
|
MngComponentDirective,
|
|
7552
7673
|
MngTemplateDirective,
|
|
7553
7674
|
// pipes
|
|
7554
|
-
|
|
7675
|
+
JsonPathPipe,
|
|
7555
7676
|
MngEnumPipe,
|
|
7556
7677
|
MngBooleanPipe,
|
|
7557
7678
|
MngI18nPropertyPipe,
|
|
@@ -7655,7 +7776,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
7655
7776
|
MngComponentDirective,
|
|
7656
7777
|
MngTemplateDirective,
|
|
7657
7778
|
// pipes
|
|
7658
|
-
|
|
7779
|
+
JsonPathPipe,
|
|
7659
7780
|
MngEnumPipe,
|
|
7660
7781
|
MngBooleanPipe,
|
|
7661
7782
|
MngI18nPropertyPipe,
|
|
@@ -7768,7 +7889,7 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
7768
7889
|
MngComponentDirective,
|
|
7769
7890
|
MngTemplateDirective,
|
|
7770
7891
|
// pipes
|
|
7771
|
-
|
|
7892
|
+
JsonPathPipe,
|
|
7772
7893
|
MngEnumPipe,
|
|
7773
7894
|
MngBooleanPipe,
|
|
7774
7895
|
MngI18nPropertyPipe,
|
|
@@ -7873,9 +7994,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
7873
7994
|
}]
|
|
7874
7995
|
}] });
|
|
7875
7996
|
|
|
7876
|
-
class
|
|
7877
|
-
constructor(
|
|
7878
|
-
this.type = type;
|
|
7997
|
+
class AMngBaseApiService {
|
|
7998
|
+
constructor(http) {
|
|
7879
7999
|
this.http = http;
|
|
7880
8000
|
this.objectSerializer = ObjectSerializer.get();
|
|
7881
8001
|
}
|
|
@@ -7886,12 +8006,6 @@ class AMngApiService {
|
|
|
7886
8006
|
}
|
|
7887
8007
|
return `${this.getBasePath()}${this.getServiceBasePath()}${path}`;
|
|
7888
8008
|
}
|
|
7889
|
-
deserialize(item) {
|
|
7890
|
-
return this.deserializeClass(item, this.type);
|
|
7891
|
-
}
|
|
7892
|
-
serialize(item) {
|
|
7893
|
-
return this.serializeClass(item, this.type);
|
|
7894
|
-
}
|
|
7895
8009
|
serializeQueryParam(queryParam, type = 'QueryParam') {
|
|
7896
8010
|
return this.objectSerializer.serialize(queryParam, type);
|
|
7897
8011
|
}
|
|
@@ -7901,9 +8015,27 @@ class AMngApiService {
|
|
|
7901
8015
|
deserializeClass(item, type) {
|
|
7902
8016
|
return this.objectSerializer.deserializeClass(item, type);
|
|
7903
8017
|
}
|
|
8018
|
+
deserializeClassArray(item, type) {
|
|
8019
|
+
return this.objectSerializer.deserializeClassArray(item, type);
|
|
8020
|
+
}
|
|
7904
8021
|
serializeClass(item, type) {
|
|
7905
8022
|
return this.objectSerializer.serializeClass(item, type);
|
|
7906
8023
|
}
|
|
8024
|
+
serializeClassArray(item, type) {
|
|
8025
|
+
return this.objectSerializer.serializeClassArray(item, type);
|
|
8026
|
+
}
|
|
8027
|
+
}
|
|
8028
|
+
class AMngApiService extends AMngBaseApiService {
|
|
8029
|
+
constructor(type, http) {
|
|
8030
|
+
super(http);
|
|
8031
|
+
this.type = type;
|
|
8032
|
+
}
|
|
8033
|
+
deserialize(item) {
|
|
8034
|
+
return this.deserializeClass(item, this.type);
|
|
8035
|
+
}
|
|
8036
|
+
serialize(item) {
|
|
8037
|
+
return this.serializeClass(item, this.type);
|
|
8038
|
+
}
|
|
7907
8039
|
}
|
|
7908
8040
|
|
|
7909
8041
|
class AMngGetAllApiService extends AMngApiService {
|
|
@@ -8452,5 +8584,5 @@ class RouteDataBuilder {
|
|
|
8452
8584
|
* Generated bundle index. Do not edit.
|
|
8453
8585
|
*/
|
|
8454
8586
|
|
|
8455
|
-
export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService,
|
|
8587
|
+
export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtil, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
8456
8588
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|