@mediusinc/mng-commons 0.4.1 → 0.4.4
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/assets/i18n/en.json +24 -19
- package/assets/i18n/sl.json +22 -17
- package/esm2020/lib/components/action/action.component.mjs +4 -4
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +4 -8
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +1 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +1 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +7 -3
- package/esm2020/lib/components/tableview/tableview.component.mjs +4 -4
- package/esm2020/lib/descriptors/action.descriptor.mjs +29 -10
- package/esm2020/lib/descriptors/editor.descriptor.mjs +4 -4
- package/esm2020/lib/descriptors/field.descriptor.mjs +3 -3
- package/esm2020/lib/pipes/i18n-property.pipe.mjs +3 -3
- package/esm2020/lib/pipes/link-formatter.pipe.mjs +1 -1
- package/esm2020/lib/services/action-executor.service.mjs +13 -14
- package/esm2020/lib/services/view-container.component.service.mjs +2 -2
- package/esm2020/lib/utils/i18n.util.mjs +212 -144
- package/esm2020/lib/utils/notification.util.mjs +16 -17
- package/fesm2015/mediusinc-mng-commons.mjs +363 -277
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +357 -275
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/tableview/table/table.component.d.ts +4 -1
- package/lib/descriptors/action.descriptor.d.ts +13 -6
- package/lib/pipes/link-formatter.pipe.d.ts +1 -1
- package/lib/services/action-executor.service.d.ts +4 -2
- package/lib/services/view-container.component.service.d.ts +1 -1
- package/lib/utils/i18n.util.d.ts +52 -21
- package/lib/utils/notification.util.d.ts +4 -4
- package/package.json +1 -1
|
@@ -74,7 +74,7 @@ import * as i9 from 'primeng/tooltip';
|
|
|
74
74
|
import { TooltipModule } from 'primeng/tooltip';
|
|
75
75
|
import { throwError, of, Subject, Observable, from, BehaviorSubject, ReplaySubject, switchMap, distinctUntilChanged, combineLatest } from 'rxjs';
|
|
76
76
|
import 'reflect-metadata';
|
|
77
|
-
import {
|
|
77
|
+
import { map, mergeMap, first, catchError, filter, finalize, startWith } from 'rxjs/operators';
|
|
78
78
|
import * as i4$1 from '@angular/platform-browser';
|
|
79
79
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
80
80
|
|
|
@@ -418,9 +418,11 @@ class ActionDescriptor {
|
|
|
418
418
|
this._parentType = parentType;
|
|
419
419
|
this._parentTypeName = parentType ? TypeUtil.findTypeName(parentType) : undefined;
|
|
420
420
|
this._parentProperty = parentProperty;
|
|
421
|
-
this.
|
|
422
|
-
|
|
423
|
-
|
|
421
|
+
if (this._parentTypeName || this._model) {
|
|
422
|
+
this._i18nModelActionBaseKey = this._parentTypeName
|
|
423
|
+
? `${this._parentTypeName}.actions.${this._parentProperty}_${actionName}`
|
|
424
|
+
: `${this._model.typeName}.actions.${actionName}`;
|
|
425
|
+
}
|
|
424
426
|
}
|
|
425
427
|
get model() {
|
|
426
428
|
return this._model;
|
|
@@ -547,6 +549,9 @@ class ActionDescriptor {
|
|
|
547
549
|
return this;
|
|
548
550
|
}
|
|
549
551
|
withServiceType(serviceType) {
|
|
552
|
+
if (!this._model) {
|
|
553
|
+
throw new Error(`Cannot set data provider if no model type is provided for action ${this._actionName}`);
|
|
554
|
+
}
|
|
550
555
|
this._dataProvider = new DataProvider(this._model.type, serviceType);
|
|
551
556
|
return this;
|
|
552
557
|
}
|
|
@@ -642,6 +647,12 @@ class ActionDescriptor {
|
|
|
642
647
|
SizeEnum[SizeEnum["ExtraLarge"] = 4] = "ExtraLarge";
|
|
643
648
|
})(SizeEnum = ActionDescriptor.SizeEnum || (ActionDescriptor.SizeEnum = {}));
|
|
644
649
|
})(ActionDescriptor || (ActionDescriptor = {}));
|
|
650
|
+
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
651
|
+
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
652
|
+
const model = modelType ? new ModelDescriptor(modelType, idProperty, titleProperty) : null;
|
|
653
|
+
super(model, actionName);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
645
656
|
class ActionEditorDescriptor extends ActionDescriptor {
|
|
646
657
|
constructor(editorDescriptor, actionName, parentType, parentProperty) {
|
|
647
658
|
super(editorDescriptor.model, actionName, parentType, parentProperty);
|
|
@@ -705,6 +716,9 @@ class ActionEditorDescriptor extends ActionDescriptor {
|
|
|
705
716
|
return this;
|
|
706
717
|
}
|
|
707
718
|
withServiceType(serviceType) {
|
|
719
|
+
if (!this._model) {
|
|
720
|
+
throw new Error(`Cannot set data provider if no model type is provided for action ${this._actionName}`);
|
|
721
|
+
}
|
|
708
722
|
this._dataProvider = new EditorDataProvider(this._model.type, serviceType);
|
|
709
723
|
return this;
|
|
710
724
|
}
|
|
@@ -763,7 +777,7 @@ class ActionEditorSubmitDescriptor extends ActionDescriptor {
|
|
|
763
777
|
})(ActionEditorSubmitDescriptor || (ActionEditorSubmitDescriptor = {}));
|
|
764
778
|
class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
|
|
765
779
|
constructor(editorDescriptor) {
|
|
766
|
-
super(editorDescriptor,
|
|
780
|
+
super(editorDescriptor, ActionEditorDetailsDescriptor.ACTION_NAME);
|
|
767
781
|
this.withPosition(ActionPositionEnum.RowClick);
|
|
768
782
|
this.withRouteTrigger(':itemId');
|
|
769
783
|
this.withFetchFunction(ctx => {
|
|
@@ -787,9 +801,10 @@ class ActionEditorDetailsDescriptor extends ActionEditorDescriptor {
|
|
|
787
801
|
return this;
|
|
788
802
|
}
|
|
789
803
|
}
|
|
804
|
+
ActionEditorDetailsDescriptor.ACTION_NAME = 'details';
|
|
790
805
|
class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
791
806
|
constructor(editorDescriptor) {
|
|
792
|
-
super(editorDescriptor,
|
|
807
|
+
super(editorDescriptor, ActionEditorAddDescriptor.ACTION_NAME);
|
|
793
808
|
this.withPosition(ActionPositionEnum.ToolbarLeft);
|
|
794
809
|
this.withRouteTrigger('add');
|
|
795
810
|
this.withSubmitFunction(ctx => { var _a, _b; return ((_a = ctx.dataProvider) === null || _a === void 0 ? void 0 : _a.create) ? ctx.dataProvider.create((_b = ctx.data) === null || _b === void 0 ? void 0 : _b.item, ctx.serviceInstance) : throwError(new Error(`Data provider create function is missing.`)); });
|
|
@@ -812,9 +827,10 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
|
812
827
|
return this;
|
|
813
828
|
}
|
|
814
829
|
}
|
|
830
|
+
ActionEditorAddDescriptor.ACTION_NAME = 'add';
|
|
815
831
|
class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
816
832
|
constructor(editorDescriptor) {
|
|
817
|
-
super(editorDescriptor,
|
|
833
|
+
super(editorDescriptor, ActionEditorEditDescriptor.ACTION_NAME);
|
|
818
834
|
this.withPosition(ActionPositionEnum.RowInline);
|
|
819
835
|
this.withTitle(null);
|
|
820
836
|
this.withRouteTrigger(':itemId/edit');
|
|
@@ -848,9 +864,10 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
|
848
864
|
return this;
|
|
849
865
|
}
|
|
850
866
|
}
|
|
867
|
+
ActionEditorEditDescriptor.ACTION_NAME = 'edit';
|
|
851
868
|
class ActionDeleteDescriptor extends ActionDescriptor {
|
|
852
869
|
constructor(model) {
|
|
853
|
-
super(model,
|
|
870
|
+
super(model, ActionDeleteDescriptor.ACTION_NAME);
|
|
854
871
|
this.withPosition(ActionPositionEnum.RowInline);
|
|
855
872
|
this.withTitle(null);
|
|
856
873
|
this.withRunFunction(ctx => {
|
|
@@ -876,9 +893,10 @@ class ActionDeleteDescriptor extends ActionDescriptor {
|
|
|
876
893
|
return this;
|
|
877
894
|
}
|
|
878
895
|
}
|
|
896
|
+
ActionDeleteDescriptor.ACTION_NAME = 'delete';
|
|
879
897
|
class ActionLinkDescriptor extends ActionDescriptor {
|
|
880
|
-
constructor(model) {
|
|
881
|
-
super(model,
|
|
898
|
+
constructor(model = null, actionName = 'link') {
|
|
899
|
+
super(model, actionName);
|
|
882
900
|
this._url = '';
|
|
883
901
|
this._pathSegments = [];
|
|
884
902
|
this._replaceUrl = false;
|
|
@@ -1424,7 +1442,7 @@ class EditorDescriptor {
|
|
|
1424
1442
|
createTabGroup(name, title) {
|
|
1425
1443
|
const tabGroup = new FieldTabGroupDescriptor(this, name);
|
|
1426
1444
|
if (!title) {
|
|
1427
|
-
title =
|
|
1445
|
+
title = I18nUtils.Type.getTabKey(this.model.typeName, name);
|
|
1428
1446
|
}
|
|
1429
1447
|
tabGroup.withTitle(title);
|
|
1430
1448
|
this.createTabGroupDescriptor(tabGroup);
|
|
@@ -1434,7 +1452,7 @@ class EditorDescriptor {
|
|
|
1434
1452
|
const fieldGroup = new FieldGroupDescriptor(this, name);
|
|
1435
1453
|
if (title !== null) {
|
|
1436
1454
|
if (!title) {
|
|
1437
|
-
title =
|
|
1455
|
+
title = I18nUtils.Type.getGroupKey(this.model.typeName, name);
|
|
1438
1456
|
}
|
|
1439
1457
|
fieldGroup.withTitle(title);
|
|
1440
1458
|
}
|
|
@@ -1616,7 +1634,7 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
1616
1634
|
this._size = FieldDescriptor.SizeEnum.Normal;
|
|
1617
1635
|
this._eventsSubject = new Subject();
|
|
1618
1636
|
this._property = property;
|
|
1619
|
-
this._label =
|
|
1637
|
+
this._label = I18nUtils.Type.getPropertyKey(this._editor.model.typeName, property);
|
|
1620
1638
|
}
|
|
1621
1639
|
get property() {
|
|
1622
1640
|
return this._property;
|
|
@@ -2950,169 +2968,326 @@ class EnumUtil {
|
|
|
2950
2968
|
}
|
|
2951
2969
|
}
|
|
2952
2970
|
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2971
|
+
const typeNameDecoratorPropertyName = 'typeName';
|
|
2972
|
+
function TypeName(typeName) {
|
|
2973
|
+
return function (target) {
|
|
2974
|
+
target[typeNameDecoratorPropertyName] = typeName;
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
const enumNameDecoratorPropertyName = 'enumName';
|
|
2978
|
+
function EnumName(typeName) {
|
|
2979
|
+
return function (target) {
|
|
2980
|
+
target[enumNameDecoratorPropertyName] = typeName;
|
|
2981
|
+
};
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
class TypeUtil {
|
|
2985
|
+
/**
|
|
2986
|
+
* Defines type name decorator.
|
|
2987
|
+
* @param targetType class.
|
|
2988
|
+
* @param typeName Name of the type.
|
|
2989
|
+
*/
|
|
2990
|
+
static defineReflectTypeName(targetType, typeName) {
|
|
2991
|
+
if (!typeName) {
|
|
2992
|
+
typeName = TypeUtil.getDecoratorTypeName(targetType);
|
|
2993
|
+
if (!typeName) {
|
|
2994
|
+
console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
|
|
2995
|
+
return;
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
|
|
2999
|
+
Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
|
|
3000
|
+
}
|
|
2962
3001
|
}
|
|
2963
|
-
|
|
2964
|
-
|
|
3002
|
+
/**
|
|
3003
|
+
* Defines enum name decorator.
|
|
3004
|
+
* @param targetType enum object.
|
|
3005
|
+
* @param enumName Name of the enum.
|
|
3006
|
+
*/
|
|
3007
|
+
static defineReflectEnumName(targetType, enumName) {
|
|
3008
|
+
if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
|
|
3009
|
+
Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
|
|
3010
|
+
}
|
|
2965
3011
|
}
|
|
2966
|
-
|
|
2967
|
-
|
|
3012
|
+
/**
|
|
3013
|
+
* Gets type name from either decorator or reflect metadata.
|
|
3014
|
+
* @param type Class.
|
|
3015
|
+
*/
|
|
3016
|
+
static findTypeName(type) {
|
|
3017
|
+
let decoratorName = TypeUtil.getDecoratorTypeName(type);
|
|
3018
|
+
if (decoratorName) {
|
|
3019
|
+
return decoratorName;
|
|
3020
|
+
}
|
|
3021
|
+
decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
|
|
3022
|
+
if (decoratorName) {
|
|
3023
|
+
return decoratorName;
|
|
3024
|
+
}
|
|
3025
|
+
return type.name;
|
|
2968
3026
|
}
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
3027
|
+
/**
|
|
3028
|
+
* Gets enum name from either decorator or reflect metadata.
|
|
3029
|
+
* @param enumType Class.
|
|
3030
|
+
*/
|
|
3031
|
+
static findEnumName(enumType) {
|
|
3032
|
+
let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
|
|
3033
|
+
if (decoratorName) {
|
|
3034
|
+
return decoratorName;
|
|
3035
|
+
}
|
|
3036
|
+
decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
|
|
3037
|
+
if (decoratorName) {
|
|
3038
|
+
return decoratorName;
|
|
3039
|
+
}
|
|
3040
|
+
throw new Error('Could not fined enum name');
|
|
2975
3041
|
}
|
|
2976
|
-
|
|
2977
|
-
|
|
3042
|
+
/**
|
|
3043
|
+
* Get value from decorator defined property name
|
|
3044
|
+
* @param type Class.
|
|
3045
|
+
*/
|
|
3046
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
3047
|
+
static getDecoratorTypeName(type) {
|
|
3048
|
+
return type[typeNameDecoratorPropertyName];
|
|
2978
3049
|
}
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
3050
|
+
/**
|
|
3051
|
+
* Get value from decorator defined property name
|
|
3052
|
+
* @param type Enum object.
|
|
3053
|
+
*/
|
|
3054
|
+
static getDecoratorEnumName(type) {
|
|
3055
|
+
return type[enumNameDecoratorPropertyName];
|
|
2982
3056
|
}
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
var I18nUtils;
|
|
3060
|
+
(function (I18nUtils) {
|
|
3061
|
+
class Common {
|
|
3062
|
+
static getAsync(translate, params, ...keys) {
|
|
3063
|
+
return translate.stream(keys, params).pipe(map(i18n => I18nUtils.Common.selectI18n(keys, i18n)));
|
|
3064
|
+
}
|
|
3065
|
+
static get(translate, params, ...keys) {
|
|
3066
|
+
const i18n = translate.instant(keys, params);
|
|
3067
|
+
return I18nUtils.Common.selectI18n(keys, i18n);
|
|
3068
|
+
}
|
|
3069
|
+
static populateParams(item, params = {}) {
|
|
3070
|
+
const paramsRes = Object.assign({}, params);
|
|
3071
|
+
if (item) {
|
|
3072
|
+
paramsRes.item = item;
|
|
2992
3073
|
}
|
|
2993
|
-
|
|
2994
|
-
|
|
3074
|
+
return paramsRes;
|
|
3075
|
+
}
|
|
3076
|
+
static selectI18n(keys, i18n) {
|
|
3077
|
+
for (const key of keys) {
|
|
3078
|
+
if (key !== i18n[key]) {
|
|
3079
|
+
return i18n[key];
|
|
3080
|
+
}
|
|
2995
3081
|
}
|
|
3082
|
+
return null;
|
|
2996
3083
|
}
|
|
2997
|
-
return i18nParameters;
|
|
2998
3084
|
}
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3085
|
+
I18nUtils.Common = Common;
|
|
3086
|
+
class Type {
|
|
3087
|
+
static getClassNameAsync(translate, classType, singular) {
|
|
3088
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3089
|
+
return I18nUtils.Type.getNameAsync(translate, typeName, singular);
|
|
3004
3090
|
}
|
|
3005
|
-
|
|
3006
|
-
|
|
3091
|
+
static getClassName(translate, classType, singular) {
|
|
3092
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3093
|
+
return I18nUtils.Type.getName(translate, typeName, singular);
|
|
3007
3094
|
}
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3095
|
+
static getNameAsync(translate, typeName, singular) {
|
|
3096
|
+
const keys = I18nUtils.Type.getNameKeys(typeName, singular);
|
|
3097
|
+
return I18nUtils.Common.getAsync(translate, undefined, ...keys);
|
|
3098
|
+
}
|
|
3099
|
+
static getName(translate, typeName, singular) {
|
|
3100
|
+
const keys = I18nUtils.Type.getNameKeys(typeName, singular);
|
|
3101
|
+
return I18nUtils.Common.get(translate, undefined, ...keys);
|
|
3102
|
+
}
|
|
3103
|
+
static getClassTabKey(classType, tab) {
|
|
3104
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3105
|
+
return I18nUtils.Type.getTabKey(typeName, tab);
|
|
3106
|
+
}
|
|
3107
|
+
static getTabKey(typeName, tab) {
|
|
3108
|
+
return I18nUtils.Type.getPath(typeName, 'tabs', tab);
|
|
3109
|
+
}
|
|
3110
|
+
static getClassGroupKey(classType, group) {
|
|
3111
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3112
|
+
return I18nUtils.Type.getGroupKey(typeName, group);
|
|
3113
|
+
}
|
|
3114
|
+
static getGroupKey(typeName, group) {
|
|
3115
|
+
return I18nUtils.Type.getPath(typeName, 'groups', group);
|
|
3116
|
+
}
|
|
3117
|
+
static getClassPropertyKey(classType, property) {
|
|
3118
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3119
|
+
return I18nUtils.Type.getPropertyKey(typeName, property);
|
|
3120
|
+
}
|
|
3121
|
+
static getPropertyKey(typeName, property) {
|
|
3122
|
+
return I18nUtils.Type.getPath(typeName, 'properties', property);
|
|
3123
|
+
}
|
|
3124
|
+
static getClassPath(classType, ...path) {
|
|
3125
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3126
|
+
return I18nUtils.Type.getPath(typeName, ...path);
|
|
3127
|
+
}
|
|
3128
|
+
static getPath(typeName, ...path) {
|
|
3129
|
+
return `${typeName}.${path.join('.')}`;
|
|
3130
|
+
}
|
|
3131
|
+
static getClassParams(translate, classType, item, params = {}) {
|
|
3132
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3133
|
+
return I18nUtils.Type.getParams(translate, typeName, item, params);
|
|
3134
|
+
}
|
|
3135
|
+
static getParams(translate, typeName, item, params = {}) {
|
|
3136
|
+
const i18nTypeName = typeName ? I18nUtils.Type.getName(translate, typeName, true) : null;
|
|
3137
|
+
return I18nUtils.Type.populateParams(i18nTypeName !== null && i18nTypeName !== void 0 ? i18nTypeName : undefined, item, params);
|
|
3138
|
+
}
|
|
3139
|
+
static getClassParamsAsync(translate, classType, item, params = {}) {
|
|
3140
|
+
const typeName = TypeUtil.findTypeName(classType);
|
|
3141
|
+
return I18nUtils.Type.getParamsAsync(translate, typeName, item, params);
|
|
3142
|
+
}
|
|
3143
|
+
static getParamsAsync(translate, typeName, item, params = {}) {
|
|
3144
|
+
return (typeName ? I18nUtils.Type.getNameAsync(translate, typeName, true) : of(null)).pipe(map(i18nTypeName => I18nUtils.Type.populateParams(i18nTypeName !== null && i18nTypeName !== void 0 ? i18nTypeName : undefined, item, params)));
|
|
3145
|
+
}
|
|
3146
|
+
static populateParams(i18nTypeName, item, params = {}) {
|
|
3147
|
+
const paramsRes = Object.assign({}, params);
|
|
3148
|
+
if (i18nTypeName) {
|
|
3149
|
+
paramsRes.typeName = i18nTypeName;
|
|
3014
3150
|
}
|
|
3151
|
+
return I18nUtils.Common.populateParams(item, paramsRes);
|
|
3015
3152
|
}
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
i18nParameters.errorMessage = '';
|
|
3021
|
-
if (error.messageCode) {
|
|
3022
|
-
const params = I18nUtil.getErrorI18nParams(error);
|
|
3023
|
-
const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
|
|
3024
|
-
const i18ns = translate.instant(keys, params);
|
|
3025
|
-
const i18n = I18nUtil.selectKeyByPriority(keys, i18ns);
|
|
3026
|
-
if (i18n) {
|
|
3027
|
-
return i18n;
|
|
3153
|
+
static getNameKeys(typeName, singular) {
|
|
3154
|
+
const keys = [];
|
|
3155
|
+
if (typeof singular !== 'undefined') {
|
|
3156
|
+
keys.push(singular ? `${typeName}.nameSingular` : `${typeName}.namePlural`);
|
|
3028
3157
|
}
|
|
3158
|
+
keys.push(`${typeName}.name`);
|
|
3159
|
+
return keys;
|
|
3029
3160
|
}
|
|
3030
|
-
return translate.instant(error.message);
|
|
3031
3161
|
}
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3162
|
+
I18nUtils.Type = Type;
|
|
3163
|
+
class Model {
|
|
3164
|
+
static get(translate, model, keyPath, customKey, item, fallbackKey, params) {
|
|
3165
|
+
const keys = I18nUtils.Model.getKeysByPriority(model, keyPath, customKey, fallbackKey);
|
|
3166
|
+
const i18nParams = I18nUtils.Model.getParams(translate, model, item, params);
|
|
3167
|
+
return I18nUtils.Common.get(translate, i18nParams, ...keys);
|
|
3037
3168
|
}
|
|
3038
|
-
|
|
3039
|
-
|
|
3169
|
+
static getName(translate, model, singular) {
|
|
3170
|
+
return I18nUtils.Type.getName(translate, model.typeName, singular);
|
|
3040
3171
|
}
|
|
3041
|
-
|
|
3042
|
-
|
|
3172
|
+
static getNameAsync(translate, model, singular) {
|
|
3173
|
+
return I18nUtils.Type.getNameAsync(translate, model.typeName, singular);
|
|
3043
3174
|
}
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
const keys = I18nUtil.getModelNameKeys(model, singular);
|
|
3048
|
-
const i18n = translate.instant(keys);
|
|
3049
|
-
return I18nUtil.selectKeyByPriority(keys, i18n);
|
|
3050
|
-
}
|
|
3051
|
-
static getModelName(translate, model, oneTime = true, singular) {
|
|
3052
|
-
const keys = I18nUtil.getModelNameKeys(model, singular);
|
|
3053
|
-
const obs = translate.stream(keys);
|
|
3054
|
-
if (oneTime) {
|
|
3055
|
-
obs.pipe(first());
|
|
3175
|
+
static getParams(translate, model, item, params = {}) {
|
|
3176
|
+
const i18nParams = I18nUtils.Type.getParams(translate, model === null || model === void 0 ? void 0 : model.typeName, item, params);
|
|
3177
|
+
return I18nUtils.Model.populateParams(model === null || model === void 0 ? void 0 : model.idPropertyName, model === null || model === void 0 ? void 0 : model.titlePropertyName, item, i18nParams);
|
|
3056
3178
|
}
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
static getModelNameKeys(model, singular) {
|
|
3060
|
-
const keys = [];
|
|
3061
|
-
if (singular !== undefined) {
|
|
3062
|
-
keys.push(singular ? `${model === null || model === void 0 ? void 0 : model.typeName}.nameSingular` : `${model === null || model === void 0 ? void 0 : model.typeName}.namePlural`);
|
|
3179
|
+
static getParamsAsync(translate, model, item, params = {}) {
|
|
3180
|
+
return I18nUtils.Type.getParamsAsync(translate, model === null || model === void 0 ? void 0 : model.typeName, 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)));
|
|
3063
3181
|
}
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3182
|
+
static populateParams(idProperty, titleProperty, item, params = {}) {
|
|
3183
|
+
const paramsRes = Object.assign(Object.assign({}, params), { itemId: '', itemTitle: '' });
|
|
3184
|
+
if (item) {
|
|
3185
|
+
if (idProperty && item[idProperty]) {
|
|
3186
|
+
paramsRes.itemId = item[idProperty];
|
|
3187
|
+
}
|
|
3188
|
+
if (titleProperty && item[titleProperty]) {
|
|
3189
|
+
paramsRes.itemTitle = item[titleProperty];
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3192
|
+
return paramsRes;
|
|
3071
3193
|
}
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3194
|
+
static getKeysByPriority(model, keyPath, customKey, fallbackKey) {
|
|
3195
|
+
const keys = [];
|
|
3196
|
+
if (customKey) {
|
|
3197
|
+
keys.push(customKey);
|
|
3198
|
+
}
|
|
3199
|
+
const modelActionKey = I18nUtils.Type.getPath(model.typeName, ...keyPath);
|
|
3200
|
+
keys.push(modelActionKey);
|
|
3201
|
+
if (fallbackKey) {
|
|
3202
|
+
keys.push(fallbackKey);
|
|
3203
|
+
}
|
|
3204
|
+
return keys;
|
|
3076
3205
|
}
|
|
3077
|
-
return keys;
|
|
3078
3206
|
}
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3207
|
+
I18nUtils.Model = Model;
|
|
3208
|
+
class Action {
|
|
3209
|
+
static get(translate, action, actionPathKeys, customKey, item, fallbackKey, params) {
|
|
3210
|
+
const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
|
|
3211
|
+
const i18nParams = I18nUtils.Action.getParams(translate, action, item, params);
|
|
3212
|
+
return I18nUtils.Common.get(translate, i18nParams, ...keys);
|
|
3213
|
+
}
|
|
3214
|
+
static getAsync(translate, action, actionPathKeys, customKey, item, fallbackKey, params) {
|
|
3215
|
+
return I18nUtils.Action.getParamsAsync(translate, action, item, params).pipe(mergeMap(i18nParams => {
|
|
3216
|
+
const keys = I18nUtils.Action.getKeysByPriority(action, actionPathKeys, customKey, fallbackKey);
|
|
3217
|
+
return I18nUtils.Common.getAsync(translate, i18nParams, ...keys);
|
|
3218
|
+
}));
|
|
3086
3219
|
}
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
keys.push(modelActionKey, actionKey);
|
|
3090
|
-
if (fallbackKey) {
|
|
3091
|
-
keys.push(fallbackKey);
|
|
3220
|
+
static getTitleAsync(translate, action, item) {
|
|
3221
|
+
return I18nUtils.Action.getAsync(translate, action, 'title', undefined, item);
|
|
3092
3222
|
}
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3223
|
+
static getEditorTitleAsync(translate, action, item) {
|
|
3224
|
+
var _a;
|
|
3225
|
+
return I18nUtils.Action.getAsync(translate, action, ['editor.title', 'title'], (_a = action.editorTitle) !== null && _a !== void 0 ? _a : undefined, item);
|
|
3226
|
+
}
|
|
3227
|
+
static getParams(translate, action, item, params = {}) {
|
|
3228
|
+
var _a;
|
|
3229
|
+
const i18nParams = I18nUtils.Model.getParams(translate, (_a = action.model) !== null && _a !== void 0 ? _a : undefined, item, params);
|
|
3230
|
+
return I18nUtils.Action.populateParams(i18nParams);
|
|
3231
|
+
}
|
|
3232
|
+
static getParamsAsync(translate, action, item, params = {}) {
|
|
3233
|
+
var _a;
|
|
3234
|
+
return I18nUtils.Model.getParamsAsync(translate, (_a = action.model) !== null && _a !== void 0 ? _a : undefined, item, params).pipe(map(i18nParams => I18nUtils.Action.populateParams(i18nParams)));
|
|
3235
|
+
}
|
|
3236
|
+
static populateParams(params = {}) {
|
|
3237
|
+
params = Object.assign({}, params);
|
|
3238
|
+
return params;
|
|
3239
|
+
}
|
|
3240
|
+
static getKeysByPriority(action, actionPathKeys, customKey, fallbackKey) {
|
|
3241
|
+
const keys = [];
|
|
3242
|
+
if (customKey) {
|
|
3243
|
+
keys.push(customKey);
|
|
3244
|
+
}
|
|
3245
|
+
if (!Array.isArray(actionPathKeys)) {
|
|
3246
|
+
actionPathKeys = [actionPathKeys];
|
|
3099
3247
|
}
|
|
3248
|
+
actionPathKeys.forEach(k => {
|
|
3249
|
+
const modelActionKey = `${action.i18nModelActionBaseKey}.${k}`;
|
|
3250
|
+
const actionKey = `${action.actionName}.${k}`;
|
|
3251
|
+
keys.push(modelActionKey, actionKey);
|
|
3252
|
+
});
|
|
3253
|
+
if (fallbackKey) {
|
|
3254
|
+
keys.push(fallbackKey);
|
|
3255
|
+
}
|
|
3256
|
+
return keys;
|
|
3100
3257
|
}
|
|
3101
|
-
return null;
|
|
3102
3258
|
}
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3259
|
+
I18nUtils.Action = Action;
|
|
3260
|
+
class Error {
|
|
3261
|
+
static get(translate, error, params = {}) {
|
|
3262
|
+
const i18nParams = I18nUtils.Error.getParams(error, params);
|
|
3263
|
+
if (error.messageCode) {
|
|
3264
|
+
const keys = [`errors.${error.messageCode}`, `messages.${error.messageCode}`];
|
|
3265
|
+
const i18n = I18nUtils.Common.get(translate, i18nParams, ...keys);
|
|
3266
|
+
if (i18n) {
|
|
3267
|
+
return i18n;
|
|
3268
|
+
}
|
|
3108
3269
|
}
|
|
3109
|
-
return
|
|
3270
|
+
return I18nUtils.Common.get(translate, i18nParams, error.message);
|
|
3110
3271
|
}
|
|
3111
|
-
|
|
3112
|
-
|
|
3272
|
+
static getParams(error, params = {}) {
|
|
3273
|
+
const paramsRes = Object.assign({}, params);
|
|
3274
|
+
paramsRes.errorStatus = '';
|
|
3275
|
+
paramsRes.errorMessage = '';
|
|
3276
|
+
if (error.status) {
|
|
3277
|
+
paramsRes.errorStatus = error.status;
|
|
3278
|
+
}
|
|
3279
|
+
if (error.message) {
|
|
3280
|
+
paramsRes.errorMessage = error.message;
|
|
3281
|
+
}
|
|
3282
|
+
if (error.statusDescription) {
|
|
3283
|
+
paramsRes.errorStatusDescription = error.statusDescription;
|
|
3284
|
+
}
|
|
3285
|
+
paramsRes.error = error;
|
|
3286
|
+
return paramsRes;
|
|
3113
3287
|
}
|
|
3114
3288
|
}
|
|
3115
|
-
|
|
3289
|
+
I18nUtils.Error = Error;
|
|
3290
|
+
})(I18nUtils || (I18nUtils = {}));
|
|
3116
3291
|
|
|
3117
3292
|
class ModelUtil {
|
|
3118
3293
|
static findIdAttribute(classType) {
|
|
@@ -3188,7 +3363,7 @@ class NotificationUtil {
|
|
|
3188
3363
|
}
|
|
3189
3364
|
return notification;
|
|
3190
3365
|
}
|
|
3191
|
-
static tableNotificationError(
|
|
3366
|
+
static tableNotificationError(translate, table, error, viewContainer) {
|
|
3192
3367
|
var _a, _b;
|
|
3193
3368
|
const params = {};
|
|
3194
3369
|
if (error === null || error === void 0 ? void 0 : error.message) {
|
|
@@ -3197,122 +3372,33 @@ class NotificationUtil {
|
|
|
3197
3372
|
else {
|
|
3198
3373
|
params.errorMessage = '.';
|
|
3199
3374
|
}
|
|
3200
|
-
|
|
3201
|
-
const
|
|
3202
|
-
const tableErrorMessage = (_b = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params)) !== null && _b !== void 0 ? _b : undefined;
|
|
3375
|
+
const tableErrorTitle = (_a = I18nUtils.Model.get(translate, table.model, 'table.error.title', undefined, undefined, 'general.error', params)) !== null && _a !== void 0 ? _a : undefined;
|
|
3376
|
+
const tableErrorMessage = (_b = I18nUtils.Model.get(translate, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params)) !== null && _b !== void 0 ? _b : undefined;
|
|
3203
3377
|
return NotificationUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
|
|
3204
3378
|
}
|
|
3205
|
-
static actionNotificationSuccess(
|
|
3379
|
+
static actionNotificationSuccess(translate, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
|
|
3206
3380
|
var _a, _b;
|
|
3207
|
-
const actionSuccessTitle = (_a =
|
|
3208
|
-
const actionSuccessMessage = (_b =
|
|
3381
|
+
const actionSuccessTitle = (_a = I18nUtils.Action.get(translate, action, 'success.title', customTitleKey, item, 'general.success', functionName)) !== null && _a !== void 0 ? _a : undefined;
|
|
3382
|
+
const actionSuccessMessage = (_b = I18nUtils.Action.get(translate, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName)) !== null && _b !== void 0 ? _b : undefined;
|
|
3209
3383
|
return NotificationUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
|
|
3210
3384
|
}
|
|
3211
|
-
static actionNotificationError(
|
|
3212
|
-
var _a, _b;
|
|
3385
|
+
static actionNotificationError(translate, action, error, functionName, viewContainer, item, severity = 'error') {
|
|
3386
|
+
var _a, _b, _c;
|
|
3213
3387
|
const params = {
|
|
3214
|
-
errorMessage:
|
|
3388
|
+
errorMessage: (_a = I18nUtils.Error.get(translate, error)) !== null && _a !== void 0 ? _a : error.message
|
|
3215
3389
|
};
|
|
3216
|
-
const actionErrorTitle = (
|
|
3217
|
-
const actionErrorMessage = (
|
|
3218
|
-
return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage,
|
|
3390
|
+
const actionErrorTitle = (_b = I18nUtils.Action.get(translate, action, [`error.${functionName}.title`, 'error.title'], action.runNotificationErrorTitle, item, 'general.error', params)) !== null && _b !== void 0 ? _b : undefined;
|
|
3391
|
+
const actionErrorMessage = (_c = I18nUtils.Action.get(translate, action, [`error.${functionName}.message`, 'error.message'], action.runNotificationErrorMessage, item, 'general.errorMessage', params)) !== null && _c !== void 0 ? _c : undefined;
|
|
3392
|
+
return NotificationUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, severity);
|
|
3219
3393
|
}
|
|
3220
|
-
static getFormEditorWarningMessage(
|
|
3394
|
+
static getFormEditorWarningMessage(translate, title, message) {
|
|
3221
3395
|
var _a, _b;
|
|
3222
|
-
const actionErrorTitle = (_a =
|
|
3223
|
-
const actionErrorMessage = (_b =
|
|
3396
|
+
const actionErrorTitle = (_a = translate.instant(title)) !== null && _a !== void 0 ? _a : undefined;
|
|
3397
|
+
const actionErrorMessage = (_b = translate.instant(message)) !== null && _b !== void 0 ? _b : undefined;
|
|
3224
3398
|
return { severity: 'warn', summary: actionErrorTitle, detail: actionErrorMessage };
|
|
3225
3399
|
}
|
|
3226
3400
|
}
|
|
3227
3401
|
|
|
3228
|
-
const typeNameDecoratorPropertyName = 'typeName';
|
|
3229
|
-
function TypeName(typeName) {
|
|
3230
|
-
return function (target) {
|
|
3231
|
-
target[typeNameDecoratorPropertyName] = typeName;
|
|
3232
|
-
};
|
|
3233
|
-
}
|
|
3234
|
-
const enumNameDecoratorPropertyName = 'enumName';
|
|
3235
|
-
function EnumName(typeName) {
|
|
3236
|
-
return function (target) {
|
|
3237
|
-
target[enumNameDecoratorPropertyName] = typeName;
|
|
3238
|
-
};
|
|
3239
|
-
}
|
|
3240
|
-
|
|
3241
|
-
class TypeUtil {
|
|
3242
|
-
/**
|
|
3243
|
-
* Defines type name decorator.
|
|
3244
|
-
* @param targetType class.
|
|
3245
|
-
* @param typeName Name of the type.
|
|
3246
|
-
*/
|
|
3247
|
-
static defineReflectTypeName(targetType, typeName) {
|
|
3248
|
-
if (!typeName) {
|
|
3249
|
-
typeName = TypeUtil.getDecoratorTypeName(targetType);
|
|
3250
|
-
if (!typeName) {
|
|
3251
|
-
console.warn(`Type name not provided for target ${targetType}, nor could be retrieved from decorator. Type name was not registered to reflect.`);
|
|
3252
|
-
return;
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
if (!Reflect.hasOwnMetadata(typeNameDecoratorPropertyName, targetType)) {
|
|
3256
|
-
Reflect.defineMetadata(typeNameDecoratorPropertyName, typeName, targetType);
|
|
3257
|
-
}
|
|
3258
|
-
}
|
|
3259
|
-
/**
|
|
3260
|
-
* Defines enum name decorator.
|
|
3261
|
-
* @param targetType enum object.
|
|
3262
|
-
* @param enumName Name of the enum.
|
|
3263
|
-
*/
|
|
3264
|
-
static defineReflectEnumName(targetType, enumName) {
|
|
3265
|
-
if (!Reflect.hasOwnMetadata(enumNameDecoratorPropertyName, targetType)) {
|
|
3266
|
-
Reflect.defineMetadata(enumNameDecoratorPropertyName, enumName, targetType);
|
|
3267
|
-
}
|
|
3268
|
-
}
|
|
3269
|
-
/**
|
|
3270
|
-
* Gets type name from either decorator or reflect metadata.
|
|
3271
|
-
* @param type Class.
|
|
3272
|
-
*/
|
|
3273
|
-
static findTypeName(type) {
|
|
3274
|
-
let decoratorName = TypeUtil.getDecoratorTypeName(type);
|
|
3275
|
-
if (decoratorName) {
|
|
3276
|
-
return decoratorName;
|
|
3277
|
-
}
|
|
3278
|
-
decoratorName = Reflect.getMetadata(typeNameDecoratorPropertyName, type);
|
|
3279
|
-
if (decoratorName) {
|
|
3280
|
-
return decoratorName;
|
|
3281
|
-
}
|
|
3282
|
-
return type.name;
|
|
3283
|
-
}
|
|
3284
|
-
/**
|
|
3285
|
-
* Gets enum name from either decorator or reflect metadata.
|
|
3286
|
-
* @param enumType Class.
|
|
3287
|
-
*/
|
|
3288
|
-
static findEnumName(enumType) {
|
|
3289
|
-
let decoratorName = TypeUtil.getDecoratorEnumName(enumType);
|
|
3290
|
-
if (decoratorName) {
|
|
3291
|
-
return decoratorName;
|
|
3292
|
-
}
|
|
3293
|
-
decoratorName = Reflect.getMetadata(enumNameDecoratorPropertyName, enumType);
|
|
3294
|
-
if (decoratorName) {
|
|
3295
|
-
return decoratorName;
|
|
3296
|
-
}
|
|
3297
|
-
throw new Error('Could not fined enum name');
|
|
3298
|
-
}
|
|
3299
|
-
/**
|
|
3300
|
-
* Get value from decorator defined property name
|
|
3301
|
-
* @param type Class.
|
|
3302
|
-
*/
|
|
3303
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
3304
|
-
static getDecoratorTypeName(type) {
|
|
3305
|
-
return type[typeNameDecoratorPropertyName];
|
|
3306
|
-
}
|
|
3307
|
-
/**
|
|
3308
|
-
* Get value from decorator defined property name
|
|
3309
|
-
* @param type Enum object.
|
|
3310
|
-
*/
|
|
3311
|
-
static getDecoratorEnumName(type) {
|
|
3312
|
-
return type[enumNameDecoratorPropertyName];
|
|
3313
|
-
}
|
|
3314
|
-
}
|
|
3315
|
-
|
|
3316
3402
|
class ObjectSerializer {
|
|
3317
3403
|
constructor() {
|
|
3318
3404
|
this._primitives = ['string', 'boolean', 'double', 'integer', 'long', 'float', 'number', 'any'];
|
|
@@ -3854,7 +3940,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
3854
3940
|
|
|
3855
3941
|
class MngI18nPropertyPipe {
|
|
3856
3942
|
transform(property, model) {
|
|
3857
|
-
return
|
|
3943
|
+
return I18nUtils.Type.getPropertyKey(model.typeName, property);
|
|
3858
3944
|
}
|
|
3859
3945
|
}
|
|
3860
3946
|
MngI18nPropertyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngI18nPropertyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -4018,24 +4104,20 @@ class MngActionExecutorService {
|
|
|
4018
4104
|
rejectVisible: false
|
|
4019
4105
|
};
|
|
4020
4106
|
if (action.runConfirmationTitle !== null) {
|
|
4021
|
-
confirmParams.header =
|
|
4022
|
-
(_a = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation')) !== null && _a !== void 0 ? _a : undefined;
|
|
4107
|
+
confirmParams.header = (_a = I18nUtils.Action.get(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation')) !== null && _a !== void 0 ? _a : undefined;
|
|
4023
4108
|
}
|
|
4024
4109
|
if (action.runConfirmationMessage !== null) {
|
|
4025
|
-
confirmParams.message =
|
|
4026
|
-
(_b = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.message', action.runConfirmationMessage, item, 'general.confirmation')) !== null && _b !== void 0 ? _b : undefined;
|
|
4110
|
+
confirmParams.message = (_b = I18nUtils.Action.get(this.translate, action, 'confirm.message', action.runConfirmationMessage, item, 'general.confirmation')) !== null && _b !== void 0 ? _b : undefined;
|
|
4027
4111
|
}
|
|
4028
4112
|
if (action.runConfirmationIcon !== null) {
|
|
4029
4113
|
confirmParams.icon = action.runConfirmationIcon === undefined ? 'pi pi-exclamation-triangle' : action.runConfirmationIcon;
|
|
4030
4114
|
}
|
|
4031
4115
|
if (action.runConfirmationAcceptTitle !== null) {
|
|
4032
|
-
confirmParams.acceptLabel =
|
|
4033
|
-
(_c = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.accept', action.runConfirmationAcceptTitle, item, 'general.yes')) !== null && _c !== void 0 ? _c : undefined;
|
|
4116
|
+
confirmParams.acceptLabel = (_c = I18nUtils.Action.get(this.translate, action, 'confirm.accept', action.runConfirmationAcceptTitle, item, 'general.yes')) !== null && _c !== void 0 ? _c : undefined;
|
|
4034
4117
|
confirmParams.acceptVisible = true;
|
|
4035
4118
|
}
|
|
4036
4119
|
if (action.runConfirmationRejectTitle !== null) {
|
|
4037
|
-
confirmParams.rejectLabel =
|
|
4038
|
-
(_d = I18nUtil.instantActionTranslation(this.translate, action, 'confirm.reject', action.runConfirmationRejectTitle, item, 'general.no')) !== null && _d !== void 0 ? _d : undefined;
|
|
4120
|
+
confirmParams.rejectLabel = (_d = I18nUtils.Action.get(this.translate, action, 'confirm.reject', action.runConfirmationRejectTitle, item, 'general.no')) !== null && _d !== void 0 ? _d : undefined;
|
|
4039
4121
|
confirmParams.rejectVisible = true;
|
|
4040
4122
|
}
|
|
4041
4123
|
const observable = new Observable(observer => {
|
|
@@ -4229,13 +4311,17 @@ class MngActionExecutorService {
|
|
|
4229
4311
|
* @param action Action descriptor.
|
|
4230
4312
|
* @param event Target table click event.
|
|
4231
4313
|
* @param route Currently activate route.
|
|
4314
|
+
* @param tableDescriptor Table descriptor.
|
|
4315
|
+
* @param dataKeyProperty Data key property.
|
|
4232
4316
|
*/
|
|
4233
|
-
triggerRowClickAction(action, event, route) {
|
|
4234
|
-
|
|
4235
|
-
|
|
4317
|
+
triggerRowClickAction(action, event, route, tableDescriptor, dataKeyProperty) {
|
|
4318
|
+
var _a, _b, _c;
|
|
4319
|
+
const idProperty = (_c = (_a = dataKeyProperty !== null && dataKeyProperty !== void 0 ? dataKeyProperty : tableDescriptor === null || tableDescriptor === void 0 ? void 0 : tableDescriptor.dataKeyProperty) !== null && _a !== void 0 ? _a : (_b = action === null || action === void 0 ? void 0 : action.model) === null || _b === void 0 ? void 0 : _b.idPropertyName) !== null && _c !== void 0 ? _c : dataKeyProperty;
|
|
4320
|
+
if (!idProperty) {
|
|
4321
|
+
throw new Error(`Row click action ${action.actionName} can not be triggered, because id property could not be found.`);
|
|
4236
4322
|
}
|
|
4237
4323
|
const rowItem = event === null || event === void 0 ? void 0 : event.rowItem;
|
|
4238
|
-
return this.triggerAction(action, rowItem[
|
|
4324
|
+
return this.triggerAction(action, rowItem[idProperty], event.rowItem, undefined, route);
|
|
4239
4325
|
}
|
|
4240
4326
|
/**
|
|
4241
4327
|
* Triggers action with optional data (item, itemId, ...) and currently activated route.
|
|
@@ -4746,7 +4832,7 @@ class MngViewContainerComponentService {
|
|
|
4746
4832
|
set dataProvider(dataProvider) {
|
|
4747
4833
|
this._dataProvider = dataProvider;
|
|
4748
4834
|
}
|
|
4749
|
-
get reloadTable
|
|
4835
|
+
get reloadTable() {
|
|
4750
4836
|
return this._reloadTableSubject.asObservable();
|
|
4751
4837
|
}
|
|
4752
4838
|
triggerTableReload(event) {
|
|
@@ -4797,8 +4883,8 @@ class MngActionComponent {
|
|
|
4797
4883
|
const context = this.actionExecutor.prepareActionExecContext(this.action, this.itemId, this.item, this.dataProvider, (_c = this.viewContainer) !== null && _c !== void 0 ? _c : undefined, this, this.actionData);
|
|
4798
4884
|
this.$isVisible = typeof this.action.isVisibleFunction === 'function' ? this.action.isVisibleFunction(context) : of(true);
|
|
4799
4885
|
this.$isEnabled = typeof this.action.isEnabledFunction === 'function' ? this.action.isEnabledFunction(context) : of(true);
|
|
4800
|
-
this.$label = this.hasNoTitle ? of(null) :
|
|
4801
|
-
this.$tooltip =
|
|
4886
|
+
this.$label = this.hasNoTitle ? of(null) : I18nUtils.Action.getAsync(this.translate, this.action, 'title', (_e = (_d = this.action) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : undefined, this.item);
|
|
4887
|
+
this.$tooltip = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', (_g = (_f = this.action) === null || _f === void 0 ? void 0 : _f.tooltip) !== null && _g !== void 0 ? _g : undefined, this.item);
|
|
4802
4888
|
if (this.action instanceof ActionLinkDescriptor) {
|
|
4803
4889
|
this.actionLink = this.action;
|
|
4804
4890
|
}
|
|
@@ -5825,11 +5911,7 @@ class MngActionEditorComponent {
|
|
|
5825
5911
|
}
|
|
5826
5912
|
return;
|
|
5827
5913
|
}
|
|
5828
|
-
const subscription =
|
|
5829
|
-
.pipe(mergeMap(i18nDialogTitle => i18nDialogTitle === null
|
|
5830
|
-
? I18nUtil.getActionTranslation(this.translate, this.action, 'title', undefined, this.item)
|
|
5831
|
-
: of(i18nDialogTitle)))
|
|
5832
|
-
.subscribe(t => {
|
|
5914
|
+
const subscription = I18nUtils.Action.getEditorTitleAsync(this.translate, this.action, this.item).subscribe(t => {
|
|
5833
5915
|
this.title = t !== null && t !== void 0 ? t : undefined;
|
|
5834
5916
|
if (this.dialogConfig) {
|
|
5835
5917
|
requestAnimationFrame(() => {
|
|
@@ -6100,6 +6182,8 @@ class MngTableComponent {
|
|
|
6100
6182
|
this.subscriptions = [];
|
|
6101
6183
|
}
|
|
6102
6184
|
ngOnInit() {
|
|
6185
|
+
var _a, _b;
|
|
6186
|
+
this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
|
|
6103
6187
|
this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
|
|
6104
6188
|
if (this.descriptor.paginationMode === PaginationModeEnum.InfiniteScroll) {
|
|
6105
6189
|
this.infiniteScroll = true;
|
|
@@ -6246,8 +6330,7 @@ class MngTableComponent {
|
|
|
6246
6330
|
this.isSortChanged = false;
|
|
6247
6331
|
this.dataProviderLoadingSubject.next(false);
|
|
6248
6332
|
}, err => {
|
|
6249
|
-
|
|
6250
|
-
NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, (_a = this.viewContainerService) !== null && _a !== void 0 ? _a : undefined);
|
|
6333
|
+
NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainer);
|
|
6251
6334
|
const emptyQueryResult = new MediusQueryResult();
|
|
6252
6335
|
emptyQueryResult.pageData = [];
|
|
6253
6336
|
emptyQueryResult.allDataCount = 0;
|
|
@@ -6315,7 +6398,7 @@ class MngTableComponent {
|
|
|
6315
6398
|
}
|
|
6316
6399
|
}
|
|
6317
6400
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$1.TranslateService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6318
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", isColumnClickable: "isColumnClickable", captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6401
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", components: [{ type: i4$5.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollDelay", "virtualRowHeight", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "minBufferPx", "maxBufferPx", "responsiveLayout", "breakpoint", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { type: i4$5.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { type: i4$5.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { type: i4$5.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { type: i4$5.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { type: i7$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$5.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "async": i4.AsyncPipe, "translate": i1$1.TranslatePipe, "i18nProperty": MngI18nPropertyPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6319
6402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
6320
6403
|
type: Component,
|
|
6321
6404
|
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + descriptor.tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || useQueryParamsInitialized\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [rowHover]=\"true\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n [selectionMode]=\"selectionMode\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor.hideHeader\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 2.25em\"></th>\n <th *ngFor=\"let col of descriptor.columns\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"columnActionTemplate || columnActionComponent\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td *ngFor=\"let col of descriptor.columns\" (click)=\"onCellClick(col, item, idx)\" [class.clickable]=\"isColumnClickable\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"columnActionTemplate || columnActionComponent\" class=\"text-right\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponent\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponent>\n <span [mngComponent]=\"columnActionComponent!\" (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"descriptor.rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (columnActionTemplate || columnActionComponent ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
@@ -6341,6 +6424,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
6341
6424
|
type: Input
|
|
6342
6425
|
}], isColumnClickable: [{
|
|
6343
6426
|
type: Input
|
|
6427
|
+
}], viewContainerInit: [{
|
|
6428
|
+
type: Input,
|
|
6429
|
+
args: ['viewContainer']
|
|
6344
6430
|
}], captionComponent: [{
|
|
6345
6431
|
type: Input
|
|
6346
6432
|
}], columnActionComponent: [{
|
|
@@ -6393,7 +6479,7 @@ class MngTableviewComponent {
|
|
|
6393
6479
|
if (this.dataProvider) {
|
|
6394
6480
|
this.viewContainerService.dataProvider = this.dataProvider;
|
|
6395
6481
|
}
|
|
6396
|
-
const reloadTableSubscription = this.viewContainerService.reloadTable
|
|
6482
|
+
const reloadTableSubscription = this.viewContainerService.reloadTable.subscribe(() => {
|
|
6397
6483
|
this.reloadTable();
|
|
6398
6484
|
});
|
|
6399
6485
|
this.subscriptions.push(reloadTableSubscription);
|
|
@@ -6431,13 +6517,13 @@ class MngTableviewComponent {
|
|
|
6431
6517
|
onTableCellClick(event) {
|
|
6432
6518
|
if (this.rowClickActions.length) {
|
|
6433
6519
|
for (const action of this.rowClickActions) {
|
|
6434
|
-
this.actionExecutor.triggerRowClickAction(action, event, this.route);
|
|
6520
|
+
this.actionExecutor.triggerRowClickAction(action, event, this.route, this.descriptor.table);
|
|
6435
6521
|
}
|
|
6436
6522
|
}
|
|
6437
6523
|
}
|
|
6438
6524
|
}
|
|
6439
6525
|
MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$1.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6440
|
-
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i1$1.TranslatePipe } });
|
|
6526
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngTableviewComponent, selector: "mng-tableview", inputs: { descriptor: "descriptor", dataProvider: "dataProvider", actions: "actions" }, providers: [MessageService, ConfirmationService, MngViewContainerComponentService], viewQueries: [{ propertyName: "tableComponent", first: true, predicate: MngTableComponent, descendants: true }], ngImport: i0, template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", components: [{ type: i6$2.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { type: i4$3.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], pipes: { "translate": i1$1.TranslatePipe } });
|
|
6441
6527
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
6442
6528
|
type: Component,
|
|
6443
6529
|
args: [{ selector: 'mng-tableview', providers: [MessageService, ConfirmationService, MngViewContainerComponentService], template: "<div class=\"mng-tableview\">\n <p-toast></p-toast>\n\n <div class=\"card\">\n <p-toolbar styleClass=\"mb-4\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"> </mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n (cellClick)=\"onTableCellClick($event)\"\n [isColumnClickable]=\"rowClickActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-between table-header\">\n <h5 class=\"p-0 m-0\">{{ descriptor.tableTitle | translate }}</h5>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\">\n </mng-action>\n </ng-template>\n </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
|
|
@@ -6692,7 +6778,7 @@ class MngFormlyFieldLookupDialogComponent extends FieldType {
|
|
|
6692
6778
|
}
|
|
6693
6779
|
}
|
|
6694
6780
|
MngFormlyFieldLookupDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
6695
|
-
MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6781
|
+
MngFormlyFieldLookupDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldLookupDialogComponent, selector: "mng-formly-field-lookup-dialog", viewQueries: [{ propertyName: "mngTable", first: true, predicate: MngTableComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: i4$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.InputText, selector: "[pInputText]" }, { type: i3$1.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6696
6782
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldLookupDialogComponent, decorators: [{
|
|
6697
6783
|
type: Component,
|
|
6698
6784
|
args: [{ selector: 'mng-formly-field-lookup-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'p-inputgroup mng-dropdown-dialog' + descriptor.inputClassName\" [class.p-inputtext-sm]=\"descriptor.isSizeSmall\" [class.p-inputtext-lg]=\"descriptor.isSizeLarge\">\n <input pInputText type=\"text\" [id]=\"$any(key)\" [readonly]=\"true\" [formlyAttributes]=\"field\" [formControl]=\"fieldLabelFormControl\" />\n <i class=\"mng-dropdown-clear-icon pi pi-times\" (click)=\"clear()\" *ngIf=\"!to.required && formControl?.value && !formControl?.disabled\"></i>\n <button\n pButton\n pRipple\n class=\"mng-dropdown-dialog-search-button\"\n type=\"button\"\n [label]=\"'general.search' | translate: {item: ''}\"\n [disabled]=\"formControl?.disabled\"\n (click)=\"openSelectDialog()\"></button>\n</div>\n\n<p-dialog\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.search' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-lookup-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.dialogTableDescriptor!\"\n [dataProvider]=\"descriptor.dialogTableDataProvider\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [selectionMode]=\"'single'\"\n [loading]=\"dialogIsLoading$\"\n [captionComponent]=\"config?.table?.captionComponent\"\n [columnActionComponent]=\"config?.table?.columnActionComponent\"\n (selectionChange)=\"onSelectionChange($event)\"\n (captionComponentInstance)=\"onCaptionCmpInst($event)\"\n (columnActionComponentInstance)=\"onColumnActionCmpInst($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.select' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItem()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
|
|
@@ -6847,7 +6933,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
6847
6933
|
}
|
|
6848
6934
|
}
|
|
6849
6935
|
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6850
|
-
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" (cellClick)=\"onTableCellClick($event)\" [isColumnClickable]=\"rowInlineActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6936
|
+
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" (cellClick)=\"onTableCellClick($event)\" [isColumnClickable]=\"rowInlineActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["trigger"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$1.TranslatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6851
6937
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
6852
6938
|
type: Component,
|
|
6853
6939
|
args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" (cellClick)=\"onTableCellClick($event)\" [isColumnClickable]=\"rowInlineActions.length > 0\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\"></mng-action>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\" let-idx=\"rowIndex\">\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.tableviewDescriptor.model.idPropertyName ? item[descriptor.tableviewDescriptor.model.idPropertyName] : undefined\"\n [actionData]=\"{itemIndex: idx}\">\n </mng-action>\n </ng-template>\n</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"] }]
|
|
@@ -6961,7 +7047,7 @@ class MngFormlyFieldTableDialogMultiselectComponent extends FieldType {
|
|
|
6961
7047
|
}
|
|
6962
7048
|
}
|
|
6963
7049
|
MngFormlyFieldTableDialogMultiselectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
6964
|
-
MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7050
|
+
MngFormlyFieldTableDialogMultiselectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: MngFormlyFieldTableDialogMultiselectComponent, selector: "mng-formly-table-multiselect-add-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n", components: [{ type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { type: i1$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { type: i3$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange"] }], directives: [{ type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i8.Ripple, selector: "[pRipple]" }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }], pipes: { "translate": i1$1.TranslatePipe, "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6965
7051
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngFormlyFieldTableDialogMultiselectComponent, decorators: [{
|
|
6966
7052
|
type: Component,
|
|
6967
7053
|
args: [{ selector: 'mng-formly-table-multiselect-add-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.mainTableDescriptor\" [items]=\"itemsAsync\">\n <ng-template mngTemplate=\"caption\">\n <div class=\"flex flex-column md:flex-row md:justify-content-end align-items-center table-header pt-0\">\n <label class=\"mng-datatable-form-label p-0 m-0\" [for]=\"key\">{{ to?.label! | translate }} <span *ngIf=\"to.required && to['hideRequiredMarker'] !== true\">*</span></label>\n <button\n *ngIf=\"hasAddAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-success mng-button-xs\"\n (click)=\"openAddDialog()\"\n [disabled]=\"formControl!.disabled\"></button>\n </div>\n </ng-template>\n <ng-template mngTemplate=\"columnAction\" let-item=\"rowItem\">\n <button\n *ngIf=\"hasDeleteAction && !options?.formState?.disabled\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-danger mng-button-xs\"\n (click)=\"removeItem(item)\"\n [disabled]=\"formControl!.disabled\"></button>\n </ng-template>\n</mng-table>\n\n<p-dialog\n *ngIf=\"hasAddAction\"\n [(visible)]=\"isDialogVisible\"\n [draggable]=\"false\"\n [header]=\"'general.addItem' | translate: {item: to?.label!}\"\n [modal]=\"true\"\n appendTo=\"body\"\n styleClass=\"p-fluid mng-formly-field-table-multiselect-dialog\">\n <ng-template pTemplate=\"content\">\n <mng-table\n [descriptor]=\"descriptor.mainTableDescriptor\"\n [queryResult]=\"addItemsAsync\"\n [selectionEnabled]=\"true\"\n [loading]=\"dialogIsLoading$\"\n (selectionChange)=\"onSelectionChange($event)\">\n </mng-table>\n <p-messages [value]=\"dialogMessages\"></p-messages>\n </ng-template>\n\n <ng-template pTemplate=\"footer\">\n <button pButton pRipple type=\"button\" [label]=\"'general.cancel' | translate\" icon=\"pi pi-times\" class=\"p-button-text\" (click)=\"hideDialog()\"></button>\n <button\n pButton\n pRipple\n type=\"button\"\n [label]=\"'general.add' | translate\"\n icon=\"pi pi-check\"\n class=\"p-button-text\"\n (click)=\"addItems()\"\n [loading]=\"(dialogIsLoading$ | async) ?? false\"\n [disabled]=\"form.disabled\"></button>\n </ng-template>\n</p-dialog>\n" }]
|
|
@@ -8696,5 +8782,5 @@ class RouteDataBuilder {
|
|
|
8696
8782
|
* Generated bundle index. Do not edit.
|
|
8697
8783
|
*/
|
|
8698
8784
|
|
|
8699
|
-
export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor,
|
|
8785
|
+
export { AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, ActionActivationResult, ActionActivationTriggerEnum, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionError, ActionExecContext, ActionLevelEnum, ActionLinkDescriptor, ActionPositionEnum, ActionRunResult, ActionSimpleDescriptor, ActionTriggerResult, ActionTypeEnum, ColumnDescriptor, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, FieldValidator, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_DROPDOWN_VALUE_ACCESSOR, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngLinkFormatterPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, RouteBuilder, RouteDataBuilder, RoutesBuilder, TableDataProvider, TableDescriptor, TableviewDataProvider, TableviewDescriptor, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngCommonsInitializerProvider, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
8700
8786
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|