@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
|
@@ -1524,11 +1524,7 @@ class ActionDescriptor {
|
|
|
1524
1524
|
this._parentType = parentType;
|
|
1525
1525
|
this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
|
|
1526
1526
|
this._parentProperty = parentProperty;
|
|
1527
|
-
|
|
1528
|
-
this._i18nModelActionBaseKey = this._parentTypeName
|
|
1529
|
-
? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
|
|
1530
|
-
: `${this._model.typeName}.actions.${actionName}`;
|
|
1531
|
-
}
|
|
1527
|
+
this.setI18nModelActionBaseKey();
|
|
1532
1528
|
let displayName = actionName;
|
|
1533
1529
|
if (this._model)
|
|
1534
1530
|
displayName = `${this._model.typeName}.${displayName}`;
|
|
@@ -1636,6 +1632,13 @@ class ActionDescriptor {
|
|
|
1636
1632
|
get positionTableviewCategories() {
|
|
1637
1633
|
return this._positionTableviewCategories;
|
|
1638
1634
|
}
|
|
1635
|
+
setI18nModelActionBaseKey(base) {
|
|
1636
|
+
if (this._parentTypeName || this._model) {
|
|
1637
|
+
this._i18nModelActionBaseKey = this._parentTypeName
|
|
1638
|
+
? `${this._parentTypeName}.actions.${this._parentProperty}_${this._actionName}`
|
|
1639
|
+
: `${base !== null && base !== void 0 ? base : this._model.i18nBaseKey}.actions.${this._actionName}`;
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1639
1642
|
withDataProvider(dataProvider) {
|
|
1640
1643
|
this._dataProvider = dataProvider;
|
|
1641
1644
|
return this;
|
|
@@ -1735,10 +1738,17 @@ class ActionDescriptor {
|
|
|
1735
1738
|
this._positionTableviewCategories = positionTableviewCategories;
|
|
1736
1739
|
return this;
|
|
1737
1740
|
}
|
|
1741
|
+
withI18nBase(base) {
|
|
1742
|
+
if (typeof base !== 'string') {
|
|
1743
|
+
base = TypeUtil.findTypeName(base);
|
|
1744
|
+
}
|
|
1745
|
+
this.setI18nModelActionBaseKey(base);
|
|
1746
|
+
return this;
|
|
1747
|
+
}
|
|
1738
1748
|
}
|
|
1739
1749
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1740
|
-
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
1741
|
-
const model = modelType ? new ModelDescriptor(modelType, idProperty, titleProperty) : null;
|
|
1750
|
+
constructor(actionName, modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
1751
|
+
const model = modelType ? new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey) : null;
|
|
1742
1752
|
super(model, actionName);
|
|
1743
1753
|
}
|
|
1744
1754
|
}
|
|
@@ -2867,13 +2877,13 @@ class ColumnDynamicDescriptor extends ColumnDescriptor {
|
|
|
2867
2877
|
}
|
|
2868
2878
|
|
|
2869
2879
|
class EditorDescriptor {
|
|
2870
|
-
constructor(modelType, idProperty, titleProperty, tableviewEditorType = TableviewEditorTypeEnum.None) {
|
|
2880
|
+
constructor(modelType, idProperty, titleProperty, tableviewEditorType = TableviewEditorTypeEnum.None, i18nBaseKey) {
|
|
2871
2881
|
this._tabs = [];
|
|
2872
2882
|
this._groups = [];
|
|
2873
2883
|
this._fields = [];
|
|
2874
2884
|
this._disabled = false;
|
|
2875
2885
|
this._modelType = modelType;
|
|
2876
|
-
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2886
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
2877
2887
|
this._tableviewEditorType = tableviewEditorType;
|
|
2878
2888
|
}
|
|
2879
2889
|
/**
|
|
@@ -2918,7 +2928,7 @@ class EditorDescriptor {
|
|
|
2918
2928
|
createTabGroup(name, title) {
|
|
2919
2929
|
const tabGroup = new FieldTabGroupDescriptor(this, name);
|
|
2920
2930
|
if (!title) {
|
|
2921
|
-
title = I18nUtils.Type.getTabKey(this.model.
|
|
2931
|
+
title = I18nUtils.Type.getTabKey(this.model.i18nBaseKey, name);
|
|
2922
2932
|
}
|
|
2923
2933
|
tabGroup.withTitle(title);
|
|
2924
2934
|
this.createTabGroupDescriptor(tabGroup);
|
|
@@ -2928,7 +2938,7 @@ class EditorDescriptor {
|
|
|
2928
2938
|
const fieldGroup = new FieldGroupDescriptor(this, name);
|
|
2929
2939
|
if (title !== null) {
|
|
2930
2940
|
if (!title) {
|
|
2931
|
-
title = I18nUtils.Type.getGroupKey(this.model.
|
|
2941
|
+
title = I18nUtils.Type.getGroupKey(this.model.i18nBaseKey, name);
|
|
2932
2942
|
}
|
|
2933
2943
|
fieldGroup.withTitle(title);
|
|
2934
2944
|
}
|
|
@@ -3176,7 +3186,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
3176
3186
|
this._size = FieldSizeEnum.Normal;
|
|
3177
3187
|
this._eventsSubject = new Subject();
|
|
3178
3188
|
this._property = property;
|
|
3179
|
-
this._label = I18nUtils.Type.getPropertyKey(this._editor.model.
|
|
3189
|
+
this._label = I18nUtils.Type.getPropertyKey(this._editor.model.i18nBaseKey, property);
|
|
3180
3190
|
}
|
|
3181
3191
|
get property() {
|
|
3182
3192
|
return this._property;
|
|
@@ -4026,12 +4036,13 @@ class FieldValidationDescriptor {
|
|
|
4026
4036
|
}
|
|
4027
4037
|
|
|
4028
4038
|
class ModelDescriptor {
|
|
4029
|
-
constructor(modelType, idProperty, titleProperty) {
|
|
4030
|
-
var _a, _b;
|
|
4039
|
+
constructor(modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
4040
|
+
var _a, _b, _c;
|
|
4031
4041
|
this._type = modelType;
|
|
4032
4042
|
this._idPropertyName = (_a = idProperty !== null && idProperty !== void 0 ? idProperty : ModelUtil.findIdAttribute(modelType)) !== null && _a !== void 0 ? _a : undefined;
|
|
4033
4043
|
this._titlePropertyName = (_b = titleProperty !== null && titleProperty !== void 0 ? titleProperty : ModelUtil.findTitleAttribute(modelType)) !== null && _b !== void 0 ? _b : undefined;
|
|
4034
4044
|
this._typeName = TypeUtil.findTypeName(this._type);
|
|
4045
|
+
this._i18nBaseKey = (_c = (typeof i18nBaseKey === 'string' || typeof i18nBaseKey === 'undefined' ? i18nBaseKey : TypeUtil.findTypeName(i18nBaseKey))) !== null && _c !== void 0 ? _c : this._typeName;
|
|
4035
4046
|
}
|
|
4036
4047
|
get type() {
|
|
4037
4048
|
return this._type;
|
|
@@ -4039,6 +4050,9 @@ class ModelDescriptor {
|
|
|
4039
4050
|
get typeName() {
|
|
4040
4051
|
return this._typeName;
|
|
4041
4052
|
}
|
|
4053
|
+
get i18nBaseKey() {
|
|
4054
|
+
return this._i18nBaseKey;
|
|
4055
|
+
}
|
|
4042
4056
|
get idPropertyName() {
|
|
4043
4057
|
return this._idPropertyName;
|
|
4044
4058
|
}
|
|
@@ -4053,6 +4067,13 @@ class ModelDescriptor {
|
|
|
4053
4067
|
this._titlePropertyName = titleProperty;
|
|
4054
4068
|
return this;
|
|
4055
4069
|
}
|
|
4070
|
+
withI18nBase(base) {
|
|
4071
|
+
if (typeof base !== 'string') {
|
|
4072
|
+
base = TypeUtil.findTypeName(base);
|
|
4073
|
+
}
|
|
4074
|
+
this._i18nBaseKey = base;
|
|
4075
|
+
return this;
|
|
4076
|
+
}
|
|
4056
4077
|
copy() {
|
|
4057
4078
|
const model = new ModelDescriptor(this._type, this._idPropertyName, this._titlePropertyName);
|
|
4058
4079
|
return model;
|
|
@@ -4060,7 +4081,7 @@ class ModelDescriptor {
|
|
|
4060
4081
|
}
|
|
4061
4082
|
|
|
4062
4083
|
class TableDescriptor {
|
|
4063
|
-
constructor(modelType, idProperty, titleProperty) {
|
|
4084
|
+
constructor(modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
4064
4085
|
var _a;
|
|
4065
4086
|
this._filterDisplay = TableFilterDisplayEnum.Menu;
|
|
4066
4087
|
this._paginationMode = TablePaginationModeEnum.Pagination;
|
|
@@ -4078,7 +4099,7 @@ class TableDescriptor {
|
|
|
4078
4099
|
this._hasGridlines = false;
|
|
4079
4100
|
this._autoGenerated = false;
|
|
4080
4101
|
this._modelType = modelType;
|
|
4081
|
-
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
4102
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
4082
4103
|
this._dataKeyProperty = (_a = idProperty !== null && idProperty !== void 0 ? idProperty : ModelUtil.findIdAttribute(modelType)) !== null && _a !== void 0 ? _a : undefined;
|
|
4083
4104
|
}
|
|
4084
4105
|
/**
|
|
@@ -4521,15 +4542,15 @@ class TableDynamicDescriptor extends TableDescriptor {
|
|
|
4521
4542
|
}
|
|
4522
4543
|
|
|
4523
4544
|
class TableviewDescriptor {
|
|
4524
|
-
constructor(modelType, idProperty, titleProperty) {
|
|
4545
|
+
constructor(modelType, idProperty, titleProperty, i18nBaseKey) {
|
|
4525
4546
|
this._modelType = modelType;
|
|
4526
|
-
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
4527
|
-
this._table = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
4528
|
-
this._detailsEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Details);
|
|
4547
|
+
this._model = new ModelDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
4548
|
+
this._table = new TableDescriptor(modelType, idProperty, titleProperty, i18nBaseKey);
|
|
4549
|
+
this._detailsEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Details, i18nBaseKey);
|
|
4529
4550
|
this._detailsEditor.withDisabled();
|
|
4530
|
-
this._addEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Add);
|
|
4531
|
-
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Edit);
|
|
4532
|
-
this._tableTitle = `${this._model.
|
|
4551
|
+
this._addEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Add, i18nBaseKey);
|
|
4552
|
+
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewEditorTypeEnum.Edit, i18nBaseKey);
|
|
4553
|
+
this._tableTitle = `${this._model.i18nBaseKey}.name`;
|
|
4533
4554
|
}
|
|
4534
4555
|
/**
|
|
4535
4556
|
* generates descriptor from attribute definition of openaapi model
|
|
@@ -5155,19 +5176,6 @@ class EnumUtil {
|
|
|
5155
5176
|
}
|
|
5156
5177
|
}
|
|
5157
5178
|
|
|
5158
|
-
const typeNameDecoratorPropertyName = 'typeName';
|
|
5159
|
-
function TypeName(typeName) {
|
|
5160
|
-
return function (target) {
|
|
5161
|
-
target[typeNameDecoratorPropertyName] = typeName;
|
|
5162
|
-
};
|
|
5163
|
-
}
|
|
5164
|
-
const enumNameDecoratorPropertyName = 'enumName';
|
|
5165
|
-
function EnumName(typeName) {
|
|
5166
|
-
return function (target) {
|
|
5167
|
-
target[enumNameDecoratorPropertyName] = typeName;
|
|
5168
|
-
};
|
|
5169
|
-
}
|
|
5170
|
-
|
|
5171
5179
|
class TypeUtil {
|
|
5172
5180
|
/**
|
|
5173
5181
|
* Defines type name decorator.
|
|
@@ -5175,15 +5183,8 @@ class TypeUtil {
|
|
|
5175
5183
|
* @param typeName Name of the type.
|
|
5176
5184
|
*/
|
|
5177
5185
|
static defineReflectTypeName(targetType, typeName) {
|
|
5178
|
-
if (!
|
|
5179
|
-
typeName
|
|
5180
|
-
if (!typeName) {
|
|
5181
|
-
console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
|
|
5182
|
-
return;
|
|
5183
|
-
}
|
|
5184
|
-
}
|
|
5185
|
-
if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
|
|
5186
|
-
Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
|
|
5186
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectTypeNameKey, targetType)) {
|
|
5187
|
+
Reflect.defineMetadata(TypeUtil.reflectTypeNameKey, typeName, targetType);
|
|
5187
5188
|
}
|
|
5188
5189
|
}
|
|
5189
5190
|
/**
|
|
@@ -5192,56 +5193,80 @@ class TypeUtil {
|
|
|
5192
5193
|
* @param enumName Name of the enum.
|
|
5193
5194
|
*/
|
|
5194
5195
|
static defineReflectEnumName(targetType, enumName) {
|
|
5195
|
-
if (!Reflect.hasOwnMetadata(
|
|
5196
|
-
Reflect.defineMetadata(
|
|
5196
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectEnumNameKey, targetType)) {
|
|
5197
|
+
Reflect.defineMetadata(TypeUtil.reflectEnumNameKey, enumName, targetType);
|
|
5197
5198
|
}
|
|
5198
5199
|
}
|
|
5199
5200
|
/**
|
|
5200
|
-
*
|
|
5201
|
+
* Defines type's id property.
|
|
5202
|
+
* @param targetType class.
|
|
5203
|
+
* @param typeName Name of the type.
|
|
5204
|
+
*/
|
|
5205
|
+
static defineReflectTypeIdProperty(targetType, idProperty) {
|
|
5206
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectTypeIdPropertyKey, targetType)) {
|
|
5207
|
+
Reflect.defineMetadata(TypeUtil.reflectTypeIdPropertyKey, idProperty, targetType);
|
|
5208
|
+
}
|
|
5209
|
+
}
|
|
5210
|
+
/**
|
|
5211
|
+
* Defines type's id property.
|
|
5212
|
+
* @param targetType class.
|
|
5213
|
+
* @param typeName Name of the type.
|
|
5214
|
+
*/
|
|
5215
|
+
static defineReflectTypeTitleProperty(targetType, titleProperty) {
|
|
5216
|
+
if (!Reflect.hasOwnMetadata(TypeUtil.reflectTypeTitlePropertyKey, targetType)) {
|
|
5217
|
+
Reflect.defineMetadata(TypeUtil.reflectTypeTitlePropertyKey, titleProperty, targetType);
|
|
5218
|
+
}
|
|
5219
|
+
}
|
|
5220
|
+
/**
|
|
5221
|
+
* Gets type name from reflect metadata.
|
|
5201
5222
|
* @param type Class.
|
|
5202
5223
|
*/
|
|
5203
5224
|
static findTypeName(type) {
|
|
5204
|
-
|
|
5205
|
-
if (
|
|
5206
|
-
return
|
|
5207
|
-
}
|
|
5208
|
-
decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
|
|
5209
|
-
if (decoratorName) {
|
|
5210
|
-
return decoratorName;
|
|
5225
|
+
const typeName = Reflect.getMetadata(TypeUtil.reflectTypeNameKey, type);
|
|
5226
|
+
if (typeName) {
|
|
5227
|
+
return typeName;
|
|
5211
5228
|
}
|
|
5229
|
+
console.warn('Reflect metadata could not be found for type, you might experience some issues in production build.', type);
|
|
5212
5230
|
return type.name;
|
|
5213
5231
|
}
|
|
5232
|
+
/**
|
|
5233
|
+
* Gets type name from either decorator or reflect metadata.
|
|
5234
|
+
* @param type Class.
|
|
5235
|
+
*/
|
|
5236
|
+
static typeNameExists(type) {
|
|
5237
|
+
return Reflect.hasOwnMetadata(TypeUtil.reflectTypeNameKey, type);
|
|
5238
|
+
}
|
|
5214
5239
|
/**
|
|
5215
5240
|
* Gets enum name from either decorator or reflect metadata.
|
|
5216
5241
|
* @param enumType Class.
|
|
5217
5242
|
*/
|
|
5218
5243
|
static findEnumName(enumType) {
|
|
5219
|
-
|
|
5220
|
-
if (
|
|
5221
|
-
return
|
|
5222
|
-
}
|
|
5223
|
-
decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
|
|
5224
|
-
if (decoratorName) {
|
|
5225
|
-
return decoratorName;
|
|
5244
|
+
const enumName = Reflect.getMetadata(TypeUtil.reflectEnumNameKey, enumType);
|
|
5245
|
+
if (enumName) {
|
|
5246
|
+
return enumName;
|
|
5226
5247
|
}
|
|
5248
|
+
console.warn('Reflect metadata could not be found for enum, you might experience some issues in production build.', enumType);
|
|
5227
5249
|
throw new Error('Could not fined enum name');
|
|
5228
5250
|
}
|
|
5229
5251
|
/**
|
|
5230
|
-
*
|
|
5252
|
+
* Gets type's id property from reflect metadata.
|
|
5231
5253
|
* @param type Class.
|
|
5232
5254
|
*/
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
return type[typeNameDecoratorPropertyName];
|
|
5255
|
+
static findTypeIdProperty(type) {
|
|
5256
|
+
return Reflect.getMetadata(TypeUtil.reflectTypeIdPropertyKey, type);
|
|
5236
5257
|
}
|
|
5237
5258
|
/**
|
|
5238
|
-
*
|
|
5239
|
-
* @param type
|
|
5259
|
+
* Gets type's title property from reflect metadata.
|
|
5260
|
+
* @param type Class.
|
|
5240
5261
|
*/
|
|
5241
|
-
static
|
|
5242
|
-
return type
|
|
5262
|
+
static findTypeTitleProperty(type) {
|
|
5263
|
+
return Reflect.getMetadata(TypeUtil.reflectTypeTitlePropertyKey, type);
|
|
5243
5264
|
}
|
|
5244
5265
|
}
|
|
5266
|
+
TypeUtil.reflectTypeNameKey = 'typeName';
|
|
5267
|
+
TypeUtil.reflectTypeIdPropertyKey = 'typeIdProperty';
|
|
5268
|
+
TypeUtil.reflectTypeTitlePropertyKey = 'typeTitleProperty';
|
|
5269
|
+
TypeUtil.reflectEnumNameKey = 'enumName';
|
|
5245
5270
|
|
|
5246
5271
|
var I18nUtils;
|
|
5247
5272
|
(function (I18nUtils) {
|
|
@@ -5354,17 +5379,17 @@ var I18nUtils;
|
|
|
5354
5379
|
return I18nUtils.Common.get(translate, i18nParams, ...keys);
|
|
5355
5380
|
}
|
|
5356
5381
|
static getName(translate, model, singular) {
|
|
5357
|
-
return I18nUtils.Type.getName(translate, model.
|
|
5382
|
+
return I18nUtils.Type.getName(translate, model.i18nBaseKey, singular);
|
|
5358
5383
|
}
|
|
5359
5384
|
static getNameAsync(translate, model, singular) {
|
|
5360
|
-
return I18nUtils.Type.getNameAsync(translate, model.
|
|
5385
|
+
return I18nUtils.Type.getNameAsync(translate, model.i18nBaseKey, singular);
|
|
5361
5386
|
}
|
|
5362
5387
|
static getParams(translate, model, item, params = {}) {
|
|
5363
|
-
const i18nParams = I18nUtils.Type.getParams(translate, model === null || model === void 0 ? void 0 : model.
|
|
5388
|
+
const i18nParams = I18nUtils.Type.getParams(translate, model === null || model === void 0 ? void 0 : model.i18nBaseKey, item, params);
|
|
5364
5389
|
return I18nUtils.Model.populateParams(model === null || model === void 0 ? void 0 : model.idPropertyName, model === null || model === void 0 ? void 0 : model.titlePropertyName, item, i18nParams);
|
|
5365
5390
|
}
|
|
5366
5391
|
static getParamsAsync(translate, model, item, params = {}) {
|
|
5367
|
-
return I18nUtils.Type.getParamsAsync(translate, model === null || model === void 0 ? void 0 : model.
|
|
5392
|
+
return I18nUtils.Type.getParamsAsync(translate, model === null || model === void 0 ? void 0 : model.i18nBaseKey, item, params).pipe(map(i18nParams => I18nUtils.Model.populateParams(model === null || model === void 0 ? void 0 : model.idPropertyName, model === null || model === void 0 ? void 0 : model.titlePropertyName, item, i18nParams)));
|
|
5368
5393
|
}
|
|
5369
5394
|
static populateParams(idProperty, titleProperty, item, params = {}) {
|
|
5370
5395
|
const paramsRes = Object.assign(Object.assign({}, params), { itemId: '', itemTitle: '' });
|
|
@@ -5383,7 +5408,7 @@ var I18nUtils;
|
|
|
5383
5408
|
if (customKey) {
|
|
5384
5409
|
keys.push(customKey);
|
|
5385
5410
|
}
|
|
5386
|
-
const modelActionKey = I18nUtils.Type.getPath(model.
|
|
5411
|
+
const modelActionKey = I18nUtils.Type.getPath(model.i18nBaseKey, ...keyPath);
|
|
5387
5412
|
keys.push(modelActionKey);
|
|
5388
5413
|
if (fallbackKey) {
|
|
5389
5414
|
keys.push(fallbackKey);
|
|
@@ -5479,6 +5504,10 @@ var I18nUtils;
|
|
|
5479
5504
|
class ModelUtil {
|
|
5480
5505
|
static findIdAttribute(classType) {
|
|
5481
5506
|
var _a;
|
|
5507
|
+
const typeIdProp = TypeUtil.findTypeIdProperty(classType);
|
|
5508
|
+
if (typeIdProp) {
|
|
5509
|
+
return typeIdProp;
|
|
5510
|
+
}
|
|
5482
5511
|
const objSerializer = ObjectSerializer.get();
|
|
5483
5512
|
const attributes = objSerializer.findAttributesDefinitionByClassType(classType);
|
|
5484
5513
|
if (!attributes) {
|
|
@@ -5493,6 +5522,10 @@ class ModelUtil {
|
|
|
5493
5522
|
}
|
|
5494
5523
|
static findTitleAttribute(classType) {
|
|
5495
5524
|
var _a;
|
|
5525
|
+
const typeTitleProp = TypeUtil.findTypeTitleProperty(classType);
|
|
5526
|
+
if (typeTitleProp) {
|
|
5527
|
+
return typeTitleProp;
|
|
5528
|
+
}
|
|
5496
5529
|
const objSerializer = ObjectSerializer.get();
|
|
5497
5530
|
const attributes = objSerializer.findAttributesDefinitionByClassType(classType);
|
|
5498
5531
|
if (!attributes) {
|
|
@@ -5654,7 +5687,7 @@ class ObjectSerializer {
|
|
|
5654
5687
|
}
|
|
5655
5688
|
findAttributesDefinition(typeName) {
|
|
5656
5689
|
const typeDef = this.findType(typeName);
|
|
5657
|
-
if (!typeDef) {
|
|
5690
|
+
if (!typeDef || typeof typeDef.getAttributeTypeMap !== 'function') {
|
|
5658
5691
|
return null;
|
|
5659
5692
|
}
|
|
5660
5693
|
return typeDef.getAttributeTypeMap();
|
|
@@ -5674,21 +5707,25 @@ class ObjectSerializer {
|
|
|
5674
5707
|
}
|
|
5675
5708
|
}
|
|
5676
5709
|
registerType(type, optTypeName) {
|
|
5677
|
-
// try to find name from
|
|
5678
|
-
let typeName
|
|
5679
|
-
if (
|
|
5710
|
+
// try to find name from metadata
|
|
5711
|
+
let typeName;
|
|
5712
|
+
if (TypeUtil.typeNameExists(type)) {
|
|
5680
5713
|
// defined name from optional type name
|
|
5714
|
+
typeName = TypeUtil.findTypeName(type);
|
|
5715
|
+
}
|
|
5716
|
+
else if (optTypeName) {
|
|
5681
5717
|
typeName = optTypeName;
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5718
|
+
// register metadata
|
|
5719
|
+
TypeUtil.defineReflectTypeName(type, typeName);
|
|
5720
|
+
}
|
|
5721
|
+
if (!typeName) {
|
|
5722
|
+
console.warn(`Registering type ${type} failed, because typeName could not be determined and optional name was not provided.`);
|
|
5723
|
+
return;
|
|
5686
5724
|
}
|
|
5687
5725
|
if (typeof this._typeMap[typeName] !== 'undefined') {
|
|
5688
5726
|
console.warn(`Registering type ${type} under key ${typeName} skipped, because type already exists for this key.`);
|
|
5689
5727
|
}
|
|
5690
5728
|
else {
|
|
5691
|
-
TypeUtil.defineReflectTypeName(type, typeName);
|
|
5692
5729
|
this._typeMap[typeName] = type;
|
|
5693
5730
|
}
|
|
5694
5731
|
}
|
|
@@ -6568,7 +6605,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
6568
6605
|
|
|
6569
6606
|
class MngI18nPropertyPipe {
|
|
6570
6607
|
transform(property, model) {
|
|
6571
|
-
return I18nUtils.Type.getPropertyKey(model.
|
|
6608
|
+
return I18nUtils.Type.getPropertyKey(model.i18nBaseKey, property);
|
|
6572
6609
|
}
|
|
6573
6610
|
}
|
|
6574
6611
|
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -8936,7 +8973,7 @@ class MngActionEditorComponent {
|
|
|
8936
8973
|
this.subscriptions = [];
|
|
8937
8974
|
}
|
|
8938
8975
|
ngOnInit() {
|
|
8939
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
8976
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
8940
8977
|
if ((_a = this.dialogConfig) === null || _a === void 0 ? void 0 : _a.data) {
|
|
8941
8978
|
if (this.dialogConfig.data.actionInstance) {
|
|
8942
8979
|
this.instance = this.dialogConfig.data.actionInstance;
|
|
@@ -8995,7 +9032,7 @@ class MngActionEditorComponent {
|
|
|
8995
9032
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
8996
9033
|
this.footerRightActions = this.footerRightActions.reverse();
|
|
8997
9034
|
this.loadItemWithDataProvider();
|
|
8998
|
-
if (typeof this.viewContainer.getEditorReset$ === 'function') {
|
|
9035
|
+
if (typeof ((_r = this.viewContainer) === null || _r === void 0 ? void 0 : _r.getEditorReset$) === 'function') {
|
|
8999
9036
|
const viewContainerEditor = this.viewContainer;
|
|
9000
9037
|
viewContainerEditor.getEditorReset$().subscribe({
|
|
9001
9038
|
next: e => {
|
|
@@ -10011,10 +10048,10 @@ class MngTableComponent {
|
|
|
10011
10048
|
}
|
|
10012
10049
|
}
|
|
10013
10050
|
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 });
|
|
10014
|
-
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 });
|
|
10051
|
+
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 });
|
|
10015
10052
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
10016
10053
|
type: Component,
|
|
10017
|
-
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" }]
|
|
10054
|
+
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" }]
|
|
10018
10055
|
}], ctorParameters: function () {
|
|
10019
10056
|
return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
10020
10057
|
type: Optional
|
|
@@ -12864,6 +12901,27 @@ class TableviewRouteBuilder {
|
|
|
12864
12901
|
}
|
|
12865
12902
|
}
|
|
12866
12903
|
|
|
12904
|
+
function TypeName(typeName) {
|
|
12905
|
+
return function (target) {
|
|
12906
|
+
TypeUtil.defineReflectTypeName(target, typeName);
|
|
12907
|
+
};
|
|
12908
|
+
}
|
|
12909
|
+
function IdProperty() {
|
|
12910
|
+
return function (target, prop) {
|
|
12911
|
+
TypeUtil.defineReflectTypeIdProperty(target, prop);
|
|
12912
|
+
};
|
|
12913
|
+
}
|
|
12914
|
+
function TitleProperty() {
|
|
12915
|
+
return function (target, prop) {
|
|
12916
|
+
TypeUtil.defineReflectTypeTitleProperty(target, prop);
|
|
12917
|
+
};
|
|
12918
|
+
}
|
|
12919
|
+
function EnumName(typeName) {
|
|
12920
|
+
return function (target) {
|
|
12921
|
+
TypeUtil.defineReflectEnumName(target, typeName);
|
|
12922
|
+
};
|
|
12923
|
+
}
|
|
12924
|
+
|
|
12867
12925
|
/*
|
|
12868
12926
|
* Public API Surface of mng-commons
|
|
12869
12927
|
*/
|
|
@@ -12872,5 +12930,5 @@ class TableviewRouteBuilder {
|
|
|
12872
12930
|
* Generated bundle index. Do not edit.
|
|
12873
12931
|
*/
|
|
12874
12932
|
|
|
12875
|
-
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,
|
|
12933
|
+
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 };
|
|
12876
12934
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|