@mediusinc/mng-commons 0.17.0 → 0.17.2
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/utils/object-serializer.util.mjs +14 -10
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +2 -2
- package/esm2020/lib/components/tableview/table/table.component.mjs +3 -3
- package/esm2020/lib/descriptors/action.descriptor.mjs +18 -8
- package/esm2020/lib/descriptors/editor.descriptor.mjs +5 -5
- package/esm2020/lib/descriptors/field.descriptor.mjs +2 -2
- package/esm2020/lib/descriptors/model.descriptor.mjs +13 -2
- package/esm2020/lib/descriptors/table.descriptor.mjs +3 -3
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +8 -8
- package/esm2020/lib/pipes/i18n-property.pipe.mjs +2 -2
- package/esm2020/lib/types/type.decorator.mjs +14 -5
- package/esm2020/lib/utils/i18n.util.mjs +6 -6
- package/esm2020/lib/utils/model.util.mjs +10 -1
- package/esm2020/lib/utils/type.util.mjs +52 -36
- package/fesm2015/mediusinc-mng-commons.mjs +148 -90
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +146 -88
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/descriptors/action.descriptor.d.ts +4 -2
- package/lib/descriptors/editor.descriptor.d.ts +1 -1
- package/lib/descriptors/model.descriptor.d.ts +4 -1
- package/lib/descriptors/table.descriptor.d.ts +1 -1
- package/lib/descriptors/tableview.descriptor.d.ts +1 -1
- package/lib/types/type.decorator.d.ts +2 -2
- package/lib/utils/type.util.d.ts +28 -7
- package/package.json +1 -1
- package/scss/mng-overrides/_layout_dialog.scss +16 -5
- package/version-info.json +5 -5
|
@@ -1511,11 +1511,7 @@ class ActionDescriptor {
|
|
|
1511
1511
|
this._parentType = parentType;
|
|
1512
1512
|
this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
|
|
1513
1513
|
this._parentProperty = parentProperty;
|
|
1514
|
-
|
|
1515
|
-
this._i18nModelActionBaseKey = this._parentTypeName
|
|
1516
|
-
? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
|
|
1517
|
-
: `${this._model.typeName}.actions.${actionName}`;
|
|
1518
|
-
}
|
|
1514
|
+
this.setI18nModelActionBaseKey();
|
|
1519
1515
|
let displayName = actionName;
|
|
1520
1516
|
if (this._model)
|
|
1521
1517
|
displayName = `${this._model.typeName}.${displayName}`;
|
|
@@ -1623,6 +1619,13 @@ class ActionDescriptor {
|
|
|
1623
1619
|
get positionTableviewCategories() {
|
|
1624
1620
|
return this._positionTableviewCategories;
|
|
1625
1621
|
}
|
|
1622
|
+
setI18nModelActionBaseKey(base) {
|
|
1623
|
+
if (this._parentTypeName || this._model) {
|
|
1624
|
+
this._i18nModelActionBaseKey = this._parentTypeName
|
|
1625
|
+
? `${this._parentTypeName}.actions.${this._parentProperty}_${this._actionName}`
|
|
1626
|
+
: `${base ?? this._model.i18nBaseKey}.actions.${this._actionName}`;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1626
1629
|
withDataProvider(dataProvider) {
|
|
1627
1630
|
this._dataProvider = dataProvider;
|
|
1628
1631
|
return this;
|
|
@@ -1720,10 +1723,17 @@ class ActionDescriptor {
|
|
|
1720
1723
|
this._positionTableviewCategories = positionTableviewCategories;
|
|
1721
1724
|
return this;
|
|
1722
1725
|
}
|
|
1726
|
+
withI18nBase(base) {
|
|
1727
|
+
if (typeof base !== 'string') {
|
|
1728
|
+
base = TypeUtil.findTypeName(base);
|
|
1729
|
+
}
|
|
1730
|
+
this.setI18nModelActionBaseKey(base);
|
|
1731
|
+
return this;
|
|
1732
|
+
}
|
|
1723
1733
|
}
|
|
1724
1734
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1725
|
-
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
1726
|
-
const model = modelType ? new ModelDescriptor(modelType, idProperty, titleProperty) : null;
|
|
1735
|
+
constructor(actionName, modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
1736
|
+
const model = modelType ? new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey) : null;
|
|
1727
1737
|
super(model, actionName);
|
|
1728
1738
|
}
|
|
1729
1739
|
}
|
|
@@ -2847,13 +2857,13 @@ class ColumnDynamicDescriptor extends ColumnDescriptor {
|
|
|
2847
2857
|
}
|
|
2848
2858
|
|
|
2849
2859
|
class EditorDescriptor {
|
|
2850
|
-
constructor(modelType, idProperty, titleProperty, tableviewEditorType = TableviewEditorTypeEnum.None) {
|
|
2860
|
+
constructor(modelType, idProperty, titleProperty, tableviewEditorType = TableviewEditorTypeEnum.None, i18nBaseKey) {
|
|
2851
2861
|
this._tabs = [];
|
|
2852
2862
|
this._groups = [];
|
|
2853
2863
|
this._fields = [];
|
|
2854
2864
|
this._disabled = false;
|
|
2855
2865
|
this._modelType = modelType;
|
|
2856
|
-
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2866
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
2857
2867
|
this._tableviewEditorType = tableviewEditorType;
|
|
2858
2868
|
}
|
|
2859
2869
|
/**
|
|
@@ -2898,7 +2908,7 @@ class EditorDescriptor {
|
|
|
2898
2908
|
createTabGroup(name, title) {
|
|
2899
2909
|
const tabGroup = new FieldTabGroupDescriptor(this, name);
|
|
2900
2910
|
if (!title) {
|
|
2901
|
-
title = I18nUtils.Type.getTabKey(this.model.
|
|
2911
|
+
title = I18nUtils.Type.getTabKey(this.model.i18nBaseKey, name);
|
|
2902
2912
|
}
|
|
2903
2913
|
tabGroup.withTitle(title);
|
|
2904
2914
|
this.createTabGroupDescriptor(tabGroup);
|
|
@@ -2908,7 +2918,7 @@ class EditorDescriptor {
|
|
|
2908
2918
|
const fieldGroup = new FieldGroupDescriptor(this, name);
|
|
2909
2919
|
if (title !== null) {
|
|
2910
2920
|
if (!title) {
|
|
2911
|
-
title = I18nUtils.Type.getGroupKey(this.model.
|
|
2921
|
+
title = I18nUtils.Type.getGroupKey(this.model.i18nBaseKey, name);
|
|
2912
2922
|
}
|
|
2913
2923
|
fieldGroup.withTitle(title);
|
|
2914
2924
|
}
|
|
@@ -3151,7 +3161,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
3151
3161
|
this._size = FieldSizeEnum.Normal;
|
|
3152
3162
|
this._eventsSubject = new Subject();
|
|
3153
3163
|
this._property = property;
|
|
3154
|
-
this._label = I18nUtils.Type.getPropertyKey(this._editor.model.
|
|
3164
|
+
this._label = I18nUtils.Type.getPropertyKey(this._editor.model.i18nBaseKey, property);
|
|
3155
3165
|
}
|
|
3156
3166
|
get property() {
|
|
3157
3167
|
return this._property;
|
|
@@ -4000,11 +4010,12 @@ class FieldValidationDescriptor {
|
|
|
4000
4010
|
}
|
|
4001
4011
|
|
|
4002
4012
|
class ModelDescriptor {
|
|
4003
|
-
constructor(modelType, idProperty, titleProperty) {
|
|
4013
|
+
constructor(modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
4004
4014
|
this._type = modelType;
|
|
4005
4015
|
this._idPropertyName = idProperty ?? ModelUtil.findIdAttribute(modelType) ?? undefined;
|
|
4006
4016
|
this._titlePropertyName = titleProperty ?? ModelUtil.findTitleAttribute(modelType) ?? undefined;
|
|
4007
4017
|
this._typeName = TypeUtil.findTypeName(this._type);
|
|
4018
|
+
this._i18nBaseKey = (typeof i18nBaseKey === 'string' || typeof i18nBaseKey === 'undefined' ? i18nBaseKey : TypeUtil.findTypeName(i18nBaseKey)) ?? this._typeName;
|
|
4008
4019
|
}
|
|
4009
4020
|
get type() {
|
|
4010
4021
|
return this._type;
|
|
@@ -4012,6 +4023,9 @@ class ModelDescriptor {
|
|
|
4012
4023
|
get typeName() {
|
|
4013
4024
|
return this._typeName;
|
|
4014
4025
|
}
|
|
4026
|
+
get i18nBaseKey() {
|
|
4027
|
+
return this._i18nBaseKey;
|
|
4028
|
+
}
|
|
4015
4029
|
get idPropertyName() {
|
|
4016
4030
|
return this._idPropertyName;
|
|
4017
4031
|
}
|
|
@@ -4026,6 +4040,13 @@ class ModelDescriptor {
|
|
|
4026
4040
|
this._titlePropertyName = titleProperty;
|
|
4027
4041
|
return this;
|
|
4028
4042
|
}
|
|
4043
|
+
withI18nBase(base) {
|
|
4044
|
+
if (typeof base !== 'string') {
|
|
4045
|
+
base = TypeUtil.findTypeName(base);
|
|
4046
|
+
}
|
|
4047
|
+
this._i18nBaseKey = base;
|
|
4048
|
+
return this;
|
|
4049
|
+
}
|
|
4029
4050
|
copy() {
|
|
4030
4051
|
const model = new ModelDescriptor(this._type, this._idPropertyName, this._titlePropertyName);
|
|
4031
4052
|
return model;
|
|
@@ -4033,7 +4054,7 @@ class ModelDescriptor {
|
|
|
4033
4054
|
}
|
|
4034
4055
|
|
|
4035
4056
|
class TableDescriptor {
|
|
4036
|
-
constructor(modelType, idProperty, titleProperty) {
|
|
4057
|
+
constructor(modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
4037
4058
|
this._filterDisplay = TableFilterDisplayEnum.Menu;
|
|
4038
4059
|
this._paginationMode = TablePaginationModeEnum.Pagination;
|
|
4039
4060
|
this._rowsPerPageOptions = [25, 50, 100];
|
|
@@ -4050,7 +4071,7 @@ class TableDescriptor {
|
|
|
4050
4071
|
this._hasGridlines = false;
|
|
4051
4072
|
this._autoGenerated = false;
|
|
4052
4073
|
this._modelType = modelType;
|
|
4053
|
-
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
4074
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
4054
4075
|
this._dataKeyProperty = idProperty ?? ModelUtil.findIdAttribute(modelType) ?? undefined;
|
|
4055
4076
|
}
|
|
4056
4077
|
/**
|
|
@@ -4490,15 +4511,15 @@ class TableDynamicDescriptor extends TableDescriptor {
|
|
|
4490
4511
|
}
|
|
4491
4512
|
|
|
4492
4513
|
class TableviewDescriptor {
|
|
4493
|
-
constructor(modelType, idProperty, titleProperty) {
|
|
4514
|
+
constructor(modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
4494
4515
|
this._modelType = modelType;
|
|
4495
|
-
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
4496
|
-
this._table = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
4497
|
-
this._detailsEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Details);
|
|
4516
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
4517
|
+
this._table = new TableDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
4518
|
+
this._detailsEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Details, i18nBaseKey);
|
|
4498
4519
|
this._detailsEditor.withDisabled();
|
|
4499
|
-
this._addEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Add);
|
|
4500
|
-
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Edit);
|
|
4501
|
-
this._tableTitle = `${this._model.
|
|
4520
|
+
this._addEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Add, i18nBaseKey);
|
|
4521
|
+
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Edit, i18nBaseKey);
|
|
4522
|
+
this._tableTitle = `${this._model.i18nBaseKey}.name`;
|
|
4502
4523
|
}
|
|
4503
4524
|
/**
|
|
4504
4525
|
* generates descriptor from attribute definition of openaapi model
|
|
@@ -5121,19 +5142,6 @@ class EnumUtil {
|
|
|
5121
5142
|
}
|
|
5122
5143
|
}
|
|
5123
5144
|
|
|
5124
|
-
const typeNameDecoratorPropertyName = 'typeName';
|
|
5125
|
-
function TypeName(typeName) {
|
|
5126
|
-
return function (target) {
|
|
5127
|
-
target[typeNameDecoratorPropertyName] = typeName;
|
|
5128
|
-
};
|
|
5129
|
-
}
|
|
5130
|
-
const enumNameDecoratorPropertyName = 'enumName';
|
|
5131
|
-
function EnumName(typeName) {
|
|
5132
|
-
return function (target) {
|
|
5133
|
-
target[enumNameDecoratorPropertyName] = typeName;
|
|
5134
|
-
};
|
|
5135
|
-
}
|
|
5136
|
-
|
|
5137
5145
|
class TypeUtil {
|
|
5138
5146
|
/**
|
|
5139
5147
|
* Defines type name decorator.
|
|
@@ -5141,15 +5149,8 @@ class TypeUtil {
|
|
|
5141
5149
|
* @param typeName Name of the type.
|
|
5142
5150
|
*/
|
|
5143
5151
|
static defineReflectTypeName(targetType, typeName) {
|
|
5144
|
-
if (!
|
|
5145
|
-
typeName
|
|
5146
|
-
if (!typeName) {
|
|
5147
|
-
console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
|
|
5148
|
-
return;
|
|
5149
|
-
}
|
|
5150
|
-
}
|
|
5151
|
-
if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
|
|
5152
|
-
Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
|
|
5152
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectTypeNameKey, targetType)) {
|
|
5153
|
+
Reflect.defineMetadata(TypeUtil.reflectTypeNameKey, typeName, targetType);
|
|
5153
5154
|
}
|
|
5154
5155
|
}
|
|
5155
5156
|
/**
|
|
@@ -5158,56 +5159,80 @@ class TypeUtil {
|
|
|
5158
5159
|
* @param enumName Name of the enum.
|
|
5159
5160
|
*/
|
|
5160
5161
|
static defineReflectEnumName(targetType, enumName) {
|
|
5161
|
-
if (!Reflect.hasOwnMetadata(
|
|
5162
|
-
Reflect.defineMetadata(
|
|
5162
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectEnumNameKey, targetType)) {
|
|
5163
|
+
Reflect.defineMetadata(TypeUtil.reflectEnumNameKey, enumName, targetType);
|
|
5163
5164
|
}
|
|
5164
5165
|
}
|
|
5165
5166
|
/**
|
|
5166
|
-
*
|
|
5167
|
+
* Defines type's id property.
|
|
5168
|
+
* @param targetType class.
|
|
5169
|
+
* @param typeName Name of the type.
|
|
5170
|
+
*/
|
|
5171
|
+
static defineReflectTypeIdProperty(targetType, idProperty) {
|
|
5172
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectTypeIdPropertyKey, targetType)) {
|
|
5173
|
+
Reflect.defineMetadata(TypeUtil.reflectTypeIdPropertyKey, idProperty, targetType);
|
|
5174
|
+
}
|
|
5175
|
+
}
|
|
5176
|
+
/**
|
|
5177
|
+
* Defines type's id property.
|
|
5178
|
+
* @param targetType class.
|
|
5179
|
+
* @param typeName Name of the type.
|
|
5180
|
+
*/
|
|
5181
|
+
static defineReflectTypeTitleProperty(targetType, titleProperty) {
|
|
5182
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectTypeTitlePropertyKey, targetType)) {
|
|
5183
|
+
Reflect.defineMetadata(TypeUtil.reflectTypeTitlePropertyKey, titleProperty, targetType);
|
|
5184
|
+
}
|
|
5185
|
+
}
|
|
5186
|
+
/**
|
|
5187
|
+
* Gets type name from reflect metadata.
|
|
5167
5188
|
* @param type Class.
|
|
5168
5189
|
*/
|
|
5169
5190
|
static findTypeName(type) {
|
|
5170
|
-
|
|
5171
|
-
if (
|
|
5172
|
-
return
|
|
5173
|
-
}
|
|
5174
|
-
decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
|
|
5175
|
-
if (decoratorName) {
|
|
5176
|
-
return decoratorName;
|
|
5191
|
+
const typeName = Reflect.getMetadata(TypeUtil.reflectTypeNameKey, type);
|
|
5192
|
+
if (typeName) {
|
|
5193
|
+
return typeName;
|
|
5177
5194
|
}
|
|
5195
|
+
console.warn('Reflect metadata could not be found for type, you might experience some issues in production build.', type);
|
|
5178
5196
|
return type.name;
|
|
5179
5197
|
}
|
|
5198
|
+
/**
|
|
5199
|
+
* Gets type name from either decorator or reflect metadata.
|
|
5200
|
+
* @param type Class.
|
|
5201
|
+
*/
|
|
5202
|
+
static typeNameExists(type) {
|
|
5203
|
+
return Reflect.hasOwnMetadata(TypeUtil.reflectTypeNameKey, type);
|
|
5204
|
+
}
|
|
5180
5205
|
/**
|
|
5181
5206
|
* Gets enum name from either decorator or reflect metadata.
|
|
5182
5207
|
* @param enumType Class.
|
|
5183
5208
|
*/
|
|
5184
5209
|
static findEnumName(enumType) {
|
|
5185
|
-
|
|
5186
|
-
if (
|
|
5187
|
-
return
|
|
5188
|
-
}
|
|
5189
|
-
decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
|
|
5190
|
-
if (decoratorName) {
|
|
5191
|
-
return decoratorName;
|
|
5210
|
+
const enumName = Reflect.getMetadata(TypeUtil.reflectEnumNameKey, enumType);
|
|
5211
|
+
if (enumName) {
|
|
5212
|
+
return enumName;
|
|
5192
5213
|
}
|
|
5214
|
+
console.warn('Reflect metadata could not be found for enum, you might experience some issues in production build.', enumType);
|
|
5193
5215
|
throw new Error('Could not fined enum name');
|
|
5194
5216
|
}
|
|
5195
5217
|
/**
|
|
5196
|
-
*
|
|
5218
|
+
* Gets type's id property from reflect metadata.
|
|
5197
5219
|
* @param type Class.
|
|
5198
5220
|
*/
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
return type[typeNameDecoratorPropertyName];
|
|
5221
|
+
static findTypeIdProperty(type) {
|
|
5222
|
+
return Reflect.getMetadata(TypeUtil.reflectTypeIdPropertyKey, type);
|
|
5202
5223
|
}
|
|
5203
5224
|
/**
|
|
5204
|
-
*
|
|
5205
|
-
* @param type
|
|
5225
|
+
* Gets type's title property from reflect metadata.
|
|
5226
|
+
* @param type Class.
|
|
5206
5227
|
*/
|
|
5207
|
-
static
|
|
5208
|
-
return type
|
|
5228
|
+
static findTypeTitleProperty(type) {
|
|
5229
|
+
return Reflect.getMetadata(TypeUtil.reflectTypeTitlePropertyKey, type);
|
|
5209
5230
|
}
|
|
5210
5231
|
}
|
|
5232
|
+
TypeUtil.reflectTypeNameKey = 'typeName';
|
|
5233
|
+
TypeUtil.reflectTypeIdPropertyKey = 'typeIdProperty';
|
|
5234
|
+
TypeUtil.reflectTypeTitlePropertyKey = 'typeTitleProperty';
|
|
5235
|
+
TypeUtil.reflectEnumNameKey = 'enumName';
|
|
5211
5236
|
|
|
5212
5237
|
var I18nUtils;
|
|
5213
5238
|
(function (I18nUtils) {
|
|
@@ -5320,17 +5345,17 @@ var I18nUtils;
|
|
|
5320
5345
|
return I18nUtils.Common.get(translate, i18nParams, ...keys);
|
|
5321
5346
|
}
|
|
5322
5347
|
static getName(translate, model, singular) {
|
|
5323
|
-
return I18nUtils.Type.getName(translate, model.
|
|
5348
|
+
return I18nUtils.Type.getName(translate, model.i18nBaseKey, singular);
|
|
5324
5349
|
}
|
|
5325
5350
|
static getNameAsync(translate, model, singular) {
|
|
5326
|
-
return I18nUtils.Type.getNameAsync(translate, model.
|
|
5351
|
+
return I18nUtils.Type.getNameAsync(translate, model.i18nBaseKey, singular);
|
|
5327
5352
|
}
|
|
5328
5353
|
static getParams(translate, model, item, params = {}) {
|
|
5329
|
-
const i18nParams = I18nUtils.Type.getParams(translate, model?.
|
|
5354
|
+
const i18nParams = I18nUtils.Type.getParams(translate, model?.i18nBaseKey, item, params);
|
|
5330
5355
|
return I18nUtils.Model.populateParams(model?.idPropertyName, model?.titlePropertyName, item, i18nParams);
|
|
5331
5356
|
}
|
|
5332
5357
|
static getParamsAsync(translate, model, item, params = {}) {
|
|
5333
|
-
return I18nUtils.Type.getParamsAsync(translate, model?.
|
|
5358
|
+
return I18nUtils.Type.getParamsAsync(translate, model?.i18nBaseKey, item, params).pipe(map(i18nParams => I18nUtils.Model.populateParams(model?.idPropertyName, model?.titlePropertyName, item, i18nParams)));
|
|
5334
5359
|
}
|
|
5335
5360
|
static populateParams(idProperty, titleProperty, item, params = {}) {
|
|
5336
5361
|
const paramsRes = { ...params, itemId: '', itemTitle: '' };
|
|
@@ -5349,7 +5374,7 @@ var I18nUtils;
|
|
|
5349
5374
|
if (customKey) {
|
|
5350
5375
|
keys.push(customKey);
|
|
5351
5376
|
}
|
|
5352
|
-
const modelActionKey = I18nUtils.Type.getPath(model.
|
|
5377
|
+
const modelActionKey = I18nUtils.Type.getPath(model.i18nBaseKey, ...keyPath);
|
|
5353
5378
|
keys.push(modelActionKey);
|
|
5354
5379
|
if (fallbackKey) {
|
|
5355
5380
|
keys.push(fallbackKey);
|
|
@@ -5441,6 +5466,10 @@ var I18nUtils;
|
|
|
5441
5466
|
|
|
5442
5467
|
class ModelUtil {
|
|
5443
5468
|
static findIdAttribute(classType) {
|
|
5469
|
+
const typeIdProp = TypeUtil.findTypeIdProperty(classType);
|
|
5470
|
+
if (typeIdProp) {
|
|
5471
|
+
return typeIdProp;
|
|
5472
|
+
}
|
|
5444
5473
|
const objSerializer = ObjectSerializer.get();
|
|
5445
5474
|
const attributes = objSerializer.findAttributesDefinitionByClassType(classType);
|
|
5446
5475
|
if (!attributes) {
|
|
@@ -5454,6 +5483,10 @@ class ModelUtil {
|
|
|
5454
5483
|
return idAttribute?.name ?? null;
|
|
5455
5484
|
}
|
|
5456
5485
|
static findTitleAttribute(classType) {
|
|
5486
|
+
const typeTitleProp = TypeUtil.findTypeTitleProperty(classType);
|
|
5487
|
+
if (typeTitleProp) {
|
|
5488
|
+
return typeTitleProp;
|
|
5489
|
+
}
|
|
5457
5490
|
const objSerializer = ObjectSerializer.get();
|
|
5458
5491
|
const attributes = objSerializer.findAttributesDefinitionByClassType(classType);
|
|
5459
5492
|
if (!attributes) {
|
|
@@ -5615,7 +5648,7 @@ class ObjectSerializer {
|
|
|
5615
5648
|
}
|
|
5616
5649
|
findAttributesDefinition(typeName) {
|
|
5617
5650
|
const typeDef = this.findType(typeName);
|
|
5618
|
-
if (!typeDef) {
|
|
5651
|
+
if (!typeDef || typeof typeDef.getAttributeTypeMap !== 'function') {
|
|
5619
5652
|
return null;
|
|
5620
5653
|
}
|
|
5621
5654
|
return typeDef.getAttributeTypeMap();
|
|
@@ -5635,21 +5668,25 @@ class ObjectSerializer {
|
|
|
5635
5668
|
}
|
|
5636
5669
|
}
|
|
5637
5670
|
registerType(type, optTypeName) {
|
|
5638
|
-
// try to find name from
|
|
5639
|
-
let typeName
|
|
5640
|
-
if (
|
|
5671
|
+
// try to find name from metadata
|
|
5672
|
+
let typeName;
|
|
5673
|
+
if (TypeUtil.typeNameExists(type)) {
|
|
5641
5674
|
// defined name from optional type name
|
|
5675
|
+
typeName = TypeUtil.findTypeName(type);
|
|
5676
|
+
}
|
|
5677
|
+
else if (optTypeName) {
|
|
5642
5678
|
typeName = optTypeName;
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5679
|
+
// register metadata
|
|
5680
|
+
TypeUtil.defineReflectTypeName(type, typeName);
|
|
5681
|
+
}
|
|
5682
|
+
if (!typeName) {
|
|
5683
|
+
console.warn(`Registering type ${type} failed, because typeName could not be determined and optional name was not provided.`);
|
|
5684
|
+
return;
|
|
5647
5685
|
}
|
|
5648
5686
|
if (typeof this._typeMap[typeName] !== 'undefined') {
|
|
5649
5687
|
console.warn(`Registering type ${type} under key ${typeName} skipped, because type already exists for this key.`);
|
|
5650
5688
|
}
|
|
5651
5689
|
else {
|
|
5652
|
-
TypeUtil.defineReflectTypeName(type, typeName);
|
|
5653
5690
|
this._typeMap[typeName] = type;
|
|
5654
5691
|
}
|
|
5655
5692
|
}
|
|
@@ -6521,7 +6558,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
6521
6558
|
|
|
6522
6559
|
class MngI18nPropertyPipe {
|
|
6523
6560
|
transform(property, model) {
|
|
6524
|
-
return I18nUtils.Type.getPropertyKey(model.
|
|
6561
|
+
return I18nUtils.Type.getPropertyKey(model.i18nBaseKey, property);
|
|
6525
6562
|
}
|
|
6526
6563
|
}
|
|
6527
6564
|
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -8903,7 +8940,7 @@ class MngActionEditorComponent {
|
|
|
8903
8940
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
8904
8941
|
this.footerRightActions = this.footerRightActions.reverse();
|
|
8905
8942
|
this.loadItemWithDataProvider();
|
|
8906
|
-
if (typeof this.viewContainer
|
|
8943
|
+
if (typeof this.viewContainer?.getEditorReset$ === 'function') {
|
|
8907
8944
|
const viewContainerEditor = this.viewContainer;
|
|
8908
8945
|
viewContainerEditor.getEditorReset$().subscribe({
|
|
8909
8946
|
next: e => {
|
|
@@ -9893,10 +9930,10 @@ class MngTableComponent {
|
|
|
9893
9930
|
}
|
|
9894
9931
|
}
|
|
9895
9932
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.TranslateService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
9896
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { initialDescriptor: ["descriptor", "initialDescriptor"], items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, 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 }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + 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$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\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 sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\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\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" pFrozenColumn>\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=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\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=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\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 [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 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 ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$3.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", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "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"] }, { kind: "directive", type: i6$3.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i6$3.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "component", type: i6$3.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$3.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$3.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$3.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }, { kind: "pipe", type: MngClassMapPipe, name: "mngClassMapPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9933
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { initialDescriptor: ["descriptor", "initialDescriptor"], items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, 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 }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + 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$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\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 sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualScrollItemSize]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\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\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" pFrozenColumn>\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=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\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=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\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 [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 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 ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$3.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", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "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"] }, { kind: "directive", type: i6$3.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i6$3.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "component", type: i6$3.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$3.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$3.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$3.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }, { kind: "pipe", type: MngClassMapPipe, name: "mngClassMapPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9897
9934
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
9898
9935
|
type: Component,
|
|
9899
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + 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$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\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 sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\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\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" pFrozenColumn>\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=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\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=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\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 [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 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 ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
9936
|
+
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"tableFullHeightOffset ? 'calc(100vh - ' + 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$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\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 sortMode=\"multiple\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [scrollable]=\"true\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualScrollItemSize]=\"$any(rowHeight)\"\n scrollHeight=\"flex\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\">\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\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" pFrozenColumn>\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=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\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=\"min-width: 36px\" pFrozenColumn></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\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=\"showInlineActionsColumn\" pFrozenColumn></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\" pFrozenColumn>\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <span class=\"p-column-title\">{{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}</span>\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td\n *ngIf=\"showInlineActionsColumn\"\n class=\"column-action justify-content-end text-right\"\n [style.min-width.px]=\"columnActionMinWidth\"\n pFrozenColumn\n alignFrozen=\"right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\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 [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 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 ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template *ngIf=\"footerTemplate\" pTemplate=\"summary\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\" [ngTemplateOutletContext]=\"{queryResult: queryResult}\"></ng-container>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
9900
9937
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
9901
9938
|
type: Optional
|
|
9902
9939
|
}] }]; }, propDecorators: { initialDescriptor: [{
|
|
@@ -12710,6 +12747,27 @@ class TableviewRouteBuilder {
|
|
|
12710
12747
|
}
|
|
12711
12748
|
}
|
|
12712
12749
|
|
|
12750
|
+
function TypeName(typeName) {
|
|
12751
|
+
return function (target) {
|
|
12752
|
+
TypeUtil.defineReflectTypeName(target, typeName);
|
|
12753
|
+
};
|
|
12754
|
+
}
|
|
12755
|
+
function IdProperty() {
|
|
12756
|
+
return function (target, prop) {
|
|
12757
|
+
TypeUtil.defineReflectTypeIdProperty(target, prop);
|
|
12758
|
+
};
|
|
12759
|
+
}
|
|
12760
|
+
function TitleProperty() {
|
|
12761
|
+
return function (target, prop) {
|
|
12762
|
+
TypeUtil.defineReflectTypeTitleProperty(target, prop);
|
|
12763
|
+
};
|
|
12764
|
+
}
|
|
12765
|
+
function EnumName(typeName) {
|
|
12766
|
+
return function (target) {
|
|
12767
|
+
TypeUtil.defineReflectEnumName(target, typeName);
|
|
12768
|
+
};
|
|
12769
|
+
}
|
|
12770
|
+
|
|
12713
12771
|
/*
|
|
12714
12772
|
* Public API Surface of mng-commons
|
|
12715
12773
|
*/
|
|
@@ -12718,5 +12776,5 @@ class TableviewRouteBuilder {
|
|
|
12718
12776
|
* Generated bundle index. Do not edit.
|
|
12719
12777
|
*/
|
|
12720
12778
|
|
|
12721
|
-
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionButtonDescriptor, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DateUtil, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, EnumeratePipeI18nHelper, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DATE_RANGE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDateRangeComponent, MngDropdownComponent, MngEnumPipe, MngEnumerateAsyncPipe, MngEnumeratePipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StyleLevelEnum, StyleSizeEnum, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewEditorTypeEnum, TableviewRouteBuilder, TypeName, TypeUtil,
|
|
12779
|
+
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionButtonDescriptor, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DateUtil, DefaultMngErrorMapperService, DynamicTableviewDataProvider, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, EnumeratePipeI18nHelper, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, IdProperty, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DATE_RANGE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngClassMapPipe, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDateRangeComponent, MngDropdownComponent, MngEnumPipe, MngEnumerateAsyncPipe, MngEnumeratePipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StyleLevelEnum, StyleSizeEnum, StylesUtil, TableDataProvider, TableDescriptor, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewEditorTypeEnum, TableviewRouteBuilder, TitleProperty, TypeName, TypeUtil, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase };
|
|
12722
12780
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|