@mediusinc/mng-commons 0.12.5 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/action/action.component.mjs +7 -7
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +5 -5
- package/esm2020/lib/components/button/button.component.mjs +46 -0
- package/esm2020/lib/components/button/index.mjs +2 -0
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +3 -2
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +10 -13
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +27 -11
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +5 -3
- package/esm2020/lib/descriptors/action/action-confirmation.descriptor.mjs +106 -0
- package/esm2020/lib/descriptors/action.descriptor.mjs +53 -154
- package/esm2020/lib/descriptors/button.descriptor.mjs +111 -0
- package/esm2020/lib/descriptors/column.descriptor.mjs +17 -1
- package/esm2020/lib/descriptors/field.descriptor.mjs +1 -1
- package/esm2020/lib/descriptors/index.mjs +3 -1
- package/esm2020/lib/mng-commons.module.mjs +20 -5
- package/esm2020/lib/pipes/getter.pipe.mjs +20 -0
- package/esm2020/lib/pipes/index.mjs +3 -1
- package/esm2020/lib/pipes/template.pipe.mjs +24 -0
- package/esm2020/lib/services/action-executor.service.mjs +30 -19
- package/esm2020/lib/styles/button-style.builder.mjs +59 -8
- package/esm2020/lib/styles/styles.util.mjs +2 -2
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +515 -217
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +509 -214
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/button/button.component.d.ts +16 -0
- package/lib/components/button/index.d.ts +1 -0
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +1 -0
- package/lib/descriptors/action/action-confirmation.descriptor.d.ts +48 -0
- package/lib/descriptors/action.descriptor.d.ts +26 -83
- package/lib/descriptors/button.descriptor.d.ts +40 -0
- package/lib/descriptors/column.descriptor.d.ts +6 -0
- package/lib/descriptors/field.descriptor.d.ts +9 -9
- package/lib/descriptors/index.d.ts +2 -0
- package/lib/mng-commons.module.d.ts +73 -70
- package/lib/pipes/getter.pipe.d.ts +7 -0
- package/lib/pipes/index.d.ts +2 -0
- package/lib/pipes/template.pipe.d.ts +10 -0
- package/lib/styles/button-style.builder.d.ts +43 -2
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
- package/version-info.json +5 -5
|
@@ -859,7 +859,7 @@ class StylesUtil {
|
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
861
|
static getActionButtonRoundedWidth(action) {
|
|
862
|
-
switch (action.size) {
|
|
862
|
+
switch (action.buttonDescriptor.styleClass.size) {
|
|
863
863
|
case ActionSizeEnum.ExtraSmall:
|
|
864
864
|
return StylesUtil.BUTTON_ROUNDED_WIDTH_XS;
|
|
865
865
|
case ActionSizeEnum.Small:
|
|
@@ -883,17 +883,18 @@ StylesUtil.TABLE_CELL_PADDING_X_SM = 4;
|
|
|
883
883
|
StylesUtil.TABLE_CELL_PADDING_X_LG = 12;
|
|
884
884
|
|
|
885
885
|
class ButtonStyleBuilder {
|
|
886
|
-
constructor(level, customClass) {
|
|
886
|
+
constructor(level = ActionLevelEnum.Default, customClass) {
|
|
887
887
|
this._size = ActionSizeEnum.Normal;
|
|
888
888
|
this._textButton = false;
|
|
889
889
|
this._outlineButton = false;
|
|
890
890
|
this._raisedButton = false;
|
|
891
|
+
this._roundedStyle = ButtonStyleRoundedEnum.DEFAULT;
|
|
891
892
|
this._actionLevel = level;
|
|
892
893
|
this._customClass = customClass;
|
|
893
894
|
}
|
|
894
895
|
getButtonClass(hasNoTitle = false) {
|
|
895
896
|
const styles = [this.convertActionLevelToStyleClass(), this.convertSizeToStyleClass(), this._customClass];
|
|
896
|
-
if (hasNoTitle) {
|
|
897
|
+
if (hasNoTitle && this._roundedStyle === ButtonStyleRoundedEnum.DEFAULT) {
|
|
897
898
|
styles.push(`p-button-rounded mng-action-button-icon`);
|
|
898
899
|
}
|
|
899
900
|
if (this._textButton) {
|
|
@@ -905,37 +906,78 @@ class ButtonStyleBuilder {
|
|
|
905
906
|
if (this._raisedButton) {
|
|
906
907
|
styles.push(`p-button-raised`);
|
|
907
908
|
}
|
|
909
|
+
if (this._roundedStyle === ButtonStyleRoundedEnum.ROUNDED) {
|
|
910
|
+
styles.push('p-button-rounded');
|
|
911
|
+
}
|
|
908
912
|
return styles.join(' ');
|
|
909
913
|
}
|
|
910
|
-
|
|
914
|
+
/**
|
|
915
|
+
* creates instance of style builder with custom properties
|
|
916
|
+
* @param actionLevel ActionLevelEnum
|
|
917
|
+
* @param size ActionSizeEnum
|
|
918
|
+
* @param textButton if true, text button will be applied
|
|
919
|
+
* @param outlineButton if true, outlined button will be applied
|
|
920
|
+
* @param raisedButton if true, raised button will be applied
|
|
921
|
+
* @param customClass additional custom classes (will be added at generating)
|
|
922
|
+
*/
|
|
923
|
+
create(actionLevel, size, textButton, outlineButton, raisedButton, roundedButton, customClass) {
|
|
911
924
|
this._actionLevel = actionLevel ?? this._actionLevel;
|
|
912
925
|
this._size = size ?? this._size;
|
|
913
926
|
this._textButton = textButton ?? this._textButton;
|
|
914
927
|
this._outlineButton = outlineButton ?? this._outlineButton;
|
|
915
928
|
this._raisedButton = raisedButton ?? this._raisedButton;
|
|
929
|
+
this._roundedStyle = roundedButton ?? this._roundedStyle;
|
|
916
930
|
this._customClass = customClass;
|
|
917
931
|
return this;
|
|
918
932
|
}
|
|
933
|
+
/**
|
|
934
|
+
* sets custom action level and returns this object
|
|
935
|
+
* @param actionLevel
|
|
936
|
+
*/
|
|
919
937
|
withActionLevel(actionLevel) {
|
|
920
938
|
this._actionLevel = actionLevel;
|
|
921
939
|
return this;
|
|
922
940
|
}
|
|
941
|
+
/**
|
|
942
|
+
* sets custom size and return this object
|
|
943
|
+
* @param size
|
|
944
|
+
*/
|
|
923
945
|
withSize(size) {
|
|
924
946
|
this._size = size;
|
|
925
947
|
return this;
|
|
926
948
|
}
|
|
949
|
+
/**
|
|
950
|
+
* sets text button property
|
|
951
|
+
* @param withText default true
|
|
952
|
+
*/
|
|
927
953
|
withTextButton(withText = true) {
|
|
928
954
|
this._textButton = withText;
|
|
929
955
|
return this;
|
|
930
956
|
}
|
|
957
|
+
/**
|
|
958
|
+
* sets outline button property
|
|
959
|
+
* @param withOutline default true
|
|
960
|
+
*/
|
|
931
961
|
withOutlineButton(withOutline = true) {
|
|
932
962
|
this._outlineButton = withOutline;
|
|
933
963
|
return this;
|
|
934
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* sets raised button property
|
|
967
|
+
* @param withRaised default true
|
|
968
|
+
*/
|
|
935
969
|
withRaisedButton(withRaised = true) {
|
|
936
970
|
this._raisedButton = withRaised;
|
|
937
971
|
return this;
|
|
938
972
|
}
|
|
973
|
+
withRoundedButton(roundedStyle = ButtonStyleRoundedEnum.ROUNDED) {
|
|
974
|
+
this._roundedStyle = roundedStyle;
|
|
975
|
+
return this;
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* sets custom style class
|
|
979
|
+
* @param customClass
|
|
980
|
+
*/
|
|
939
981
|
withCustomClass(customClass) {
|
|
940
982
|
this._customClass = customClass;
|
|
941
983
|
return this;
|
|
@@ -962,15 +1004,15 @@ class ButtonStyleBuilder {
|
|
|
962
1004
|
convertSizeToStyleClass() {
|
|
963
1005
|
switch (this._size) {
|
|
964
1006
|
case ActionSizeEnum.ExtraSmall:
|
|
965
|
-
return 'mng-button-xs';
|
|
1007
|
+
return 'p-button-sm mng-button-xs';
|
|
966
1008
|
case ActionSizeEnum.Small:
|
|
967
|
-
return 'mng-button-sm';
|
|
1009
|
+
return 'p-button-sm mng-button-sm';
|
|
968
1010
|
case ActionSizeEnum.Normal:
|
|
969
1011
|
return '';
|
|
970
1012
|
case ActionSizeEnum.Large:
|
|
971
|
-
return 'mng-button-lg';
|
|
1013
|
+
return 'p-button-lg mng-button-lg';
|
|
972
1014
|
case ActionSizeEnum.ExtraLarge:
|
|
973
|
-
return 'mng-button-xl';
|
|
1015
|
+
return 'p-button-lg mng-button-xl';
|
|
974
1016
|
}
|
|
975
1017
|
}
|
|
976
1018
|
get actionLevel() {
|
|
@@ -988,10 +1030,123 @@ class ButtonStyleBuilder {
|
|
|
988
1030
|
get raisedButton() {
|
|
989
1031
|
return this._raisedButton;
|
|
990
1032
|
}
|
|
1033
|
+
get roundedStyle() {
|
|
1034
|
+
return this._roundedStyle;
|
|
1035
|
+
}
|
|
991
1036
|
get customClass() {
|
|
992
1037
|
return this._customClass;
|
|
993
1038
|
}
|
|
994
1039
|
}
|
|
1040
|
+
var ButtonStyleRoundedEnum;
|
|
1041
|
+
(function (ButtonStyleRoundedEnum) {
|
|
1042
|
+
ButtonStyleRoundedEnum[ButtonStyleRoundedEnum["DEFAULT"] = 0] = "DEFAULT";
|
|
1043
|
+
ButtonStyleRoundedEnum[ButtonStyleRoundedEnum["ROUNDED"] = 1] = "ROUNDED";
|
|
1044
|
+
ButtonStyleRoundedEnum[ButtonStyleRoundedEnum["SQUARE"] = 2] = "SQUARE";
|
|
1045
|
+
})(ButtonStyleRoundedEnum || (ButtonStyleRoundedEnum = {}));
|
|
1046
|
+
|
|
1047
|
+
class ActionConfirmationDialogDescriptor {
|
|
1048
|
+
constructor() {
|
|
1049
|
+
this._closeOnEscape = true; // Defines if dialog closes when esc key is pressed.
|
|
1050
|
+
this._closable = true; // Defines if dialog is closable.
|
|
1051
|
+
this._acceptButtonStyle = new ButtonStyleBuilder(ActionLevelEnum.Default);
|
|
1052
|
+
this._rejectButtonStyle = new ButtonStyleBuilder(ActionLevelEnum.Default).withTextButton();
|
|
1053
|
+
this._icon = 'pi pi-exclamation-triangle';
|
|
1054
|
+
this._acceptIcon = 'pi pi-check';
|
|
1055
|
+
this._rejectIcon = 'pi pi-times';
|
|
1056
|
+
}
|
|
1057
|
+
withIcon(icon) {
|
|
1058
|
+
this._icon = icon;
|
|
1059
|
+
return this;
|
|
1060
|
+
}
|
|
1061
|
+
withTitle(title) {
|
|
1062
|
+
this._title = title;
|
|
1063
|
+
return this;
|
|
1064
|
+
}
|
|
1065
|
+
withMessage(message) {
|
|
1066
|
+
this._message = message;
|
|
1067
|
+
return this;
|
|
1068
|
+
}
|
|
1069
|
+
withAcceptLabel(acceptLabel) {
|
|
1070
|
+
this._acceptLabel = acceptLabel;
|
|
1071
|
+
return this;
|
|
1072
|
+
}
|
|
1073
|
+
withAcceptIcon(acceptIcon) {
|
|
1074
|
+
this._acceptIcon = acceptIcon;
|
|
1075
|
+
return this;
|
|
1076
|
+
}
|
|
1077
|
+
withAcceptButtonStyle(buttonStyle) {
|
|
1078
|
+
this._acceptButtonStyle = buttonStyle;
|
|
1079
|
+
return this;
|
|
1080
|
+
}
|
|
1081
|
+
withRejectLabel(rejectLabel) {
|
|
1082
|
+
this._rejectLabel = rejectLabel;
|
|
1083
|
+
return this;
|
|
1084
|
+
}
|
|
1085
|
+
withRejectIcon(rejectIcon) {
|
|
1086
|
+
this._rejectIcon = rejectIcon;
|
|
1087
|
+
return this;
|
|
1088
|
+
}
|
|
1089
|
+
withRejectButtonStyle(buttonStyle) {
|
|
1090
|
+
this._rejectButtonStyle = buttonStyle;
|
|
1091
|
+
return this;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* set if dialog can be closed on escaped pressed
|
|
1095
|
+
* if true, then closable is also set to true
|
|
1096
|
+
* @param closeOnEscape
|
|
1097
|
+
*/
|
|
1098
|
+
withCloseOnEscape(closeOnEscape) {
|
|
1099
|
+
if (closeOnEscape) {
|
|
1100
|
+
this._closable = true;
|
|
1101
|
+
}
|
|
1102
|
+
this._closeOnEscape = closeOnEscape;
|
|
1103
|
+
return this;
|
|
1104
|
+
}
|
|
1105
|
+
withClosable(closable) {
|
|
1106
|
+
this._closable = closable;
|
|
1107
|
+
return this;
|
|
1108
|
+
}
|
|
1109
|
+
withRunConfirmationConfigMapFn(runConfirmationConfigMapFn) {
|
|
1110
|
+
this._runConfirmationConfigMapFn = runConfirmationConfigMapFn;
|
|
1111
|
+
return this;
|
|
1112
|
+
}
|
|
1113
|
+
get icon() {
|
|
1114
|
+
return this._icon;
|
|
1115
|
+
}
|
|
1116
|
+
get title() {
|
|
1117
|
+
return this._title;
|
|
1118
|
+
}
|
|
1119
|
+
get message() {
|
|
1120
|
+
return this._message;
|
|
1121
|
+
}
|
|
1122
|
+
get acceptLabel() {
|
|
1123
|
+
return this._acceptLabel;
|
|
1124
|
+
}
|
|
1125
|
+
get acceptIcon() {
|
|
1126
|
+
return this._acceptIcon;
|
|
1127
|
+
}
|
|
1128
|
+
get acceptButtonStyle() {
|
|
1129
|
+
return this._acceptButtonStyle;
|
|
1130
|
+
}
|
|
1131
|
+
get rejectLabel() {
|
|
1132
|
+
return this._rejectLabel;
|
|
1133
|
+
}
|
|
1134
|
+
get rejectIcon() {
|
|
1135
|
+
return this._rejectIcon;
|
|
1136
|
+
}
|
|
1137
|
+
get rejectButtonStyle() {
|
|
1138
|
+
return this._rejectButtonStyle;
|
|
1139
|
+
}
|
|
1140
|
+
get closeOnEscape() {
|
|
1141
|
+
return this._closeOnEscape;
|
|
1142
|
+
}
|
|
1143
|
+
get closable() {
|
|
1144
|
+
return this._closable;
|
|
1145
|
+
}
|
|
1146
|
+
get runConfirmationConfigMapFn() {
|
|
1147
|
+
return this._runConfirmationConfigMapFn;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
995
1150
|
|
|
996
1151
|
class ActionDescriptor {
|
|
997
1152
|
constructor(model, actionName, parentType, parentProperty) {
|
|
@@ -1000,10 +1155,10 @@ class ActionDescriptor {
|
|
|
1000
1155
|
this._position = ActionPositionEnum.ToolbarRight;
|
|
1001
1156
|
this._level = ActionLevelEnum.Default;
|
|
1002
1157
|
this._routeUrl = null;
|
|
1003
|
-
this._buttonStyle = new ButtonStyleBuilder(this._level);
|
|
1004
|
-
this._hasRunConfirmation = false;
|
|
1005
1158
|
this._hasRunNotificationSuccess = true;
|
|
1006
1159
|
this._hasRunNotificationError = true;
|
|
1160
|
+
//button
|
|
1161
|
+
this._buttonDescriptor = new ButtonDescriptor();
|
|
1007
1162
|
this._model = model;
|
|
1008
1163
|
this._actionName = actionName;
|
|
1009
1164
|
if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
|
|
@@ -1052,15 +1207,6 @@ class ActionDescriptor {
|
|
|
1052
1207
|
get routeUrl() {
|
|
1053
1208
|
return this._routeUrl;
|
|
1054
1209
|
}
|
|
1055
|
-
get title() {
|
|
1056
|
-
return this._title;
|
|
1057
|
-
}
|
|
1058
|
-
get icon() {
|
|
1059
|
-
return this._icon;
|
|
1060
|
-
}
|
|
1061
|
-
get tooltip() {
|
|
1062
|
-
return this._tooltip;
|
|
1063
|
-
}
|
|
1064
1210
|
get dataProvider() {
|
|
1065
1211
|
return this._dataProvider;
|
|
1066
1212
|
}
|
|
@@ -1085,83 +1231,14 @@ class ActionDescriptor {
|
|
|
1085
1231
|
get actionNameLong() {
|
|
1086
1232
|
return this._actionNameLong;
|
|
1087
1233
|
}
|
|
1088
|
-
get buttonStyle() {
|
|
1089
|
-
return this._buttonStyle;
|
|
1090
|
-
}
|
|
1091
|
-
/**
|
|
1092
|
-
* @deprecated use _buttonStyle instead
|
|
1093
|
-
*/
|
|
1094
1234
|
get className() {
|
|
1095
|
-
return this.
|
|
1096
|
-
}
|
|
1097
|
-
/**
|
|
1098
|
-
* @deprecated use _buttonStyle instead
|
|
1099
|
-
*/
|
|
1100
|
-
get isStyleText() {
|
|
1101
|
-
return this._buttonStyle.textButton;
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* @deprecated use _buttonStyle instead
|
|
1105
|
-
*/
|
|
1106
|
-
get isStyleOutlined() {
|
|
1107
|
-
return this._buttonStyle.outlineButton;
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* @deprecated use _buttonStyle instead
|
|
1111
|
-
*/
|
|
1112
|
-
get isStyleRaised() {
|
|
1113
|
-
return this._buttonStyle.raisedButton;
|
|
1114
|
-
}
|
|
1115
|
-
/**
|
|
1116
|
-
* @deprecated use _buttonStyle instead
|
|
1117
|
-
*/
|
|
1118
|
-
get size() {
|
|
1119
|
-
return this._buttonStyle.size;
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* @deprecated use _buttonStyle instead
|
|
1123
|
-
*/
|
|
1124
|
-
get isSizeExtraSmall() {
|
|
1125
|
-
return this._buttonStyle.size === ActionSizeEnum.ExtraSmall;
|
|
1235
|
+
return this.buttonDescriptor.styleClass.customClass;
|
|
1126
1236
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
*/
|
|
1130
|
-
get isSizeSmall() {
|
|
1131
|
-
return this._buttonStyle.size === ActionSizeEnum.Small;
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* @deprecated use _buttonStyle instead
|
|
1135
|
-
*/
|
|
1136
|
-
get isSizeLarge() {
|
|
1137
|
-
return this._buttonStyle.size === ActionSizeEnum.Large;
|
|
1138
|
-
}
|
|
1139
|
-
/**
|
|
1140
|
-
* @deprecated use _buttonStyle instead
|
|
1141
|
-
*/
|
|
1142
|
-
get isSizeExtraLarge() {
|
|
1143
|
-
return this._buttonStyle.size === ActionSizeEnum.ExtraLarge;
|
|
1237
|
+
get runConfirmationDialogDescriptor() {
|
|
1238
|
+
return this._runConfirmationDialogDescriptor;
|
|
1144
1239
|
}
|
|
1145
1240
|
get hasRunConfirmation() {
|
|
1146
|
-
return this.
|
|
1147
|
-
}
|
|
1148
|
-
get runConfirmationIcon() {
|
|
1149
|
-
return this._runConfirmationIcon;
|
|
1150
|
-
}
|
|
1151
|
-
get runConfirmationTitle() {
|
|
1152
|
-
return this._runConfirmationTitle;
|
|
1153
|
-
}
|
|
1154
|
-
get runConfirmationMessage() {
|
|
1155
|
-
return this._runConfirmationMessage;
|
|
1156
|
-
}
|
|
1157
|
-
get runConfirmationAcceptTitle() {
|
|
1158
|
-
return this._runConfirmationAcceptTitle;
|
|
1159
|
-
}
|
|
1160
|
-
get runConfirmationRejectTitle() {
|
|
1161
|
-
return this._runConfirmationRejectTitle;
|
|
1162
|
-
}
|
|
1163
|
-
get runConfirmationConfigMapFn() {
|
|
1164
|
-
return this._runConfirmationConfigMapFn;
|
|
1241
|
+
return this._runConfirmationDialogDescriptor !== null && this._runConfirmationDialogDescriptor !== undefined;
|
|
1165
1242
|
}
|
|
1166
1243
|
get hasRunNotificationSuccess() {
|
|
1167
1244
|
return this._hasRunNotificationSuccess;
|
|
@@ -1193,6 +1270,9 @@ class ActionDescriptor {
|
|
|
1193
1270
|
get permissionsRouteType() {
|
|
1194
1271
|
return this._permissionsRouteType;
|
|
1195
1272
|
}
|
|
1273
|
+
get buttonDescriptor() {
|
|
1274
|
+
return this._buttonDescriptor;
|
|
1275
|
+
}
|
|
1196
1276
|
withDataProvider(dataProvider) {
|
|
1197
1277
|
this._dataProvider = dataProvider;
|
|
1198
1278
|
return this;
|
|
@@ -1221,70 +1301,25 @@ class ActionDescriptor {
|
|
|
1221
1301
|
this._routeUrl = routeUrl;
|
|
1222
1302
|
return this;
|
|
1223
1303
|
}
|
|
1224
|
-
|
|
1225
|
-
this.
|
|
1226
|
-
this._buttonStyle = this._buttonStyle.withActionLevel(level);
|
|
1227
|
-
return this;
|
|
1228
|
-
}
|
|
1229
|
-
/**
|
|
1230
|
-
* Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
|
|
1231
|
-
*/
|
|
1232
|
-
withModelTitle() {
|
|
1233
|
-
this._title = `${this._i18nModelActionBaseKey}.title`;
|
|
1304
|
+
withPosition(position) {
|
|
1305
|
+
this._position = position;
|
|
1234
1306
|
return this;
|
|
1235
1307
|
}
|
|
1236
1308
|
/**
|
|
1237
|
-
*
|
|
1238
|
-
* @param title Title i18n key or title.
|
|
1309
|
+
* creates confirmation action with default style based on action descriptor
|
|
1239
1310
|
*/
|
|
1240
|
-
|
|
1241
|
-
this.
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
this._icon = icon;
|
|
1246
|
-
return this;
|
|
1247
|
-
}
|
|
1248
|
-
withTooltip(tooltip) {
|
|
1249
|
-
this._tooltip = tooltip;
|
|
1250
|
-
return this;
|
|
1251
|
-
}
|
|
1252
|
-
withClassName(className) {
|
|
1253
|
-
this._buttonStyle = this._buttonStyle.withCustomClass(className);
|
|
1254
|
-
return this;
|
|
1255
|
-
}
|
|
1256
|
-
withSize(size = ActionSizeEnum.Normal) {
|
|
1257
|
-
this._buttonStyle = this._buttonStyle.withSize(size);
|
|
1258
|
-
return this;
|
|
1259
|
-
}
|
|
1260
|
-
withStyle(styleText = false, styleOutlined = false, styleRaised = false) {
|
|
1261
|
-
this._buttonStyle = this._buttonStyle.withOutlineButton(styleOutlined);
|
|
1262
|
-
this._buttonStyle = this._buttonStyle.withRaisedButton(styleRaised);
|
|
1263
|
-
this._buttonStyle = this._buttonStyle.withTextButton(styleText);
|
|
1264
|
-
return this;
|
|
1265
|
-
}
|
|
1266
|
-
withPosition(position) {
|
|
1267
|
-
this._position = position;
|
|
1268
|
-
return this;
|
|
1311
|
+
withRunConfirmation() {
|
|
1312
|
+
this._runConfirmationDialogDescriptor = new ActionConfirmationDialogDescriptor();
|
|
1313
|
+
this._runConfirmationDialogDescriptor.acceptButtonStyle.withActionLevel(this._level);
|
|
1314
|
+
this._runConfirmationDialogDescriptor.rejectButtonStyle.withActionLevel(this._level);
|
|
1315
|
+
return this._runConfirmationDialogDescriptor;
|
|
1269
1316
|
}
|
|
1270
1317
|
/**
|
|
1271
|
-
* Add a
|
|
1272
|
-
* @param
|
|
1273
|
-
* @param title the title of the confirmation dialogue
|
|
1274
|
-
* @param message the message on the confirmation dialogue
|
|
1275
|
-
* @param acceptTitle the title of the accepting button
|
|
1276
|
-
* @param rejectTitle the title of the rejecting button
|
|
1277
|
-
* @param runConfirmationConfigMapFn function used to generate the confirmation dialogue. **WARNING** changing the *accept* and *reject* methods of the *confirmConfig* parameter
|
|
1278
|
-
* may lead to unexpected behaviour
|
|
1318
|
+
* Add a configuration dialogue to action using ActionConfigurationDescriptor
|
|
1319
|
+
* @param confirmationDescriptor descriptor with customizable information for dialog
|
|
1279
1320
|
*/
|
|
1280
|
-
|
|
1281
|
-
this.
|
|
1282
|
-
this._runConfirmationIcon = icon;
|
|
1283
|
-
this._runConfirmationTitle = title;
|
|
1284
|
-
this._runConfirmationMessage = message;
|
|
1285
|
-
this._runConfirmationAcceptTitle = acceptTitle;
|
|
1286
|
-
this._runConfirmationRejectTitle = rejectTitle;
|
|
1287
|
-
this._runConfirmationConfigMapFn = runConfirmationConfigMapFn;
|
|
1321
|
+
withRunConfirmationDescriptor(runConfirmationDialogDescriptor) {
|
|
1322
|
+
this._runConfirmationDialogDescriptor = runConfirmationDialogDescriptor;
|
|
1288
1323
|
return this;
|
|
1289
1324
|
}
|
|
1290
1325
|
withRunNotificationSuccess(title, message, hasNotification = true) {
|
|
@@ -1318,6 +1353,10 @@ class ActionDescriptor {
|
|
|
1318
1353
|
this._permissionsRouteType = permissionsRouteType;
|
|
1319
1354
|
return this;
|
|
1320
1355
|
}
|
|
1356
|
+
withButtonDescriptor(buttonDescriptor) {
|
|
1357
|
+
this._buttonDescriptor = buttonDescriptor;
|
|
1358
|
+
return this;
|
|
1359
|
+
}
|
|
1321
1360
|
}
|
|
1322
1361
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1323
1362
|
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
@@ -1334,7 +1373,7 @@ class ActionEditorDescriptor extends ActionDescriptor {
|
|
|
1334
1373
|
this._dialogSize = ActionEditorDialogSizeEnum.Normal;
|
|
1335
1374
|
this._type = ActionTypeEnum.Editor;
|
|
1336
1375
|
this._editorDescriptor = editorDescriptor;
|
|
1337
|
-
this._editorActions.push(
|
|
1376
|
+
this._editorActions.push(ActionEditorSubmitDescriptor.forPrimary(this), ActionEditorSubmitDescriptor.forSecondary(this));
|
|
1338
1377
|
}
|
|
1339
1378
|
get editorTitle() {
|
|
1340
1379
|
return this._editorTitle;
|
|
@@ -1440,7 +1479,23 @@ class ActionEditorSubmitDescriptor extends ActionDescriptor {
|
|
|
1440
1479
|
this._editorAction = editorAction;
|
|
1441
1480
|
this._submitType = submitType;
|
|
1442
1481
|
this._position = ActionPositionEnum.FooterRight;
|
|
1443
|
-
this.
|
|
1482
|
+
this.buttonDescriptor.styleClass.withActionLevel(editorAction.level).withTextButton();
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* creates primary action with primary button style
|
|
1486
|
+
* @param editorAction
|
|
1487
|
+
* @param submitType
|
|
1488
|
+
*/
|
|
1489
|
+
static forPrimary(editorAction, submitType = ActionEditorSubmitTypeEnum.Submit) {
|
|
1490
|
+
return new ActionEditorSubmitDescriptor(editorAction, submitType).withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder()));
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* creates secondary button with text button style
|
|
1494
|
+
* @param editorAction
|
|
1495
|
+
* @param submitType
|
|
1496
|
+
*/
|
|
1497
|
+
static forSecondary(editorAction, submitType = ActionEditorSubmitTypeEnum.Cancel) {
|
|
1498
|
+
return new ActionEditorSubmitDescriptor(editorAction, submitType).withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withTextButton()));
|
|
1444
1499
|
}
|
|
1445
1500
|
get submitType() {
|
|
1446
1501
|
return this._submitType;
|
|
@@ -1474,8 +1529,8 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
|
1474
1529
|
this.withPosition(ActionPositionEnum.ToolbarLeft);
|
|
1475
1530
|
this.withRouteTrigger('add');
|
|
1476
1531
|
this.withSubmitFunction(ActionDataProviderUtil.runCreateOrFail);
|
|
1477
|
-
this.
|
|
1478
|
-
this.withIcon('pi pi-plus');
|
|
1532
|
+
this.buttonDescriptor.styleClass.withActionLevel(ActionLevelEnum.Success);
|
|
1533
|
+
this.buttonDescriptor.withIcon('pi pi-plus');
|
|
1479
1534
|
this.withPermissionsRouteType(Permissions.ActionTypes.ADD);
|
|
1480
1535
|
}
|
|
1481
1536
|
withServiceType(serviceType) {
|
|
@@ -1498,12 +1553,11 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
|
1498
1553
|
constructor(editorDescriptor) {
|
|
1499
1554
|
super(editorDescriptor, ActionEditorEditDescriptor.ACTION_NAME);
|
|
1500
1555
|
this.withPosition(ActionPositionEnum.RowInline);
|
|
1501
|
-
this.withTitle(null);
|
|
1502
1556
|
this.withRouteTrigger(':itemId/edit');
|
|
1503
1557
|
this.withFetchFunction(ActionDataProviderUtil.runFetchOrFail);
|
|
1504
1558
|
this.withSubmitFunction(ActionDataProviderUtil.runUpdateOrFail);
|
|
1505
|
-
this.withIcon('pi pi-pencil');
|
|
1506
1559
|
this.withPermissionsRouteType(Permissions.ActionTypes.EDIT);
|
|
1560
|
+
this.buttonDescriptor.withLabel(null).withIcon('pi pi-pencil');
|
|
1507
1561
|
}
|
|
1508
1562
|
withServiceType(serviceType) {
|
|
1509
1563
|
return this.withServiceSubmitFunction(serviceType);
|
|
@@ -1525,12 +1579,11 @@ class ActionDeleteDescriptor extends ActionDescriptor {
|
|
|
1525
1579
|
constructor(model) {
|
|
1526
1580
|
super(model, ActionDeleteDescriptor.ACTION_NAME);
|
|
1527
1581
|
this.withPosition(ActionPositionEnum.RowInline);
|
|
1528
|
-
this.withTitle(null);
|
|
1529
1582
|
this.withRunFunction(ActionDataProviderUtil.runDeleteOrFail);
|
|
1530
|
-
this.
|
|
1531
|
-
this.
|
|
1532
|
-
this.withRunConfirmation(undefined);
|
|
1583
|
+
this.buttonDescriptor.styleClass.withActionLevel(ActionLevelEnum.Danger);
|
|
1584
|
+
this.withRunConfirmation();
|
|
1533
1585
|
this.withPermissionsRouteType(Permissions.ActionTypes.DELETE);
|
|
1586
|
+
this.buttonDescriptor.withLabel(null).withIcon('pi pi-trash');
|
|
1534
1587
|
}
|
|
1535
1588
|
withServiceType(serviceType) {
|
|
1536
1589
|
return this.withServiceDeleteFunction(serviceType);
|
|
@@ -1988,6 +2041,12 @@ class ColumnDescriptor {
|
|
|
1988
2041
|
get hasCopyToClipboard() {
|
|
1989
2042
|
return this._hasCopyToClipboard;
|
|
1990
2043
|
}
|
|
2044
|
+
get template() {
|
|
2045
|
+
return this._template;
|
|
2046
|
+
}
|
|
2047
|
+
get getter() {
|
|
2048
|
+
return this._getter;
|
|
2049
|
+
}
|
|
1991
2050
|
asType(type = ColumnTypeEnum.String) {
|
|
1992
2051
|
this._columnType = type;
|
|
1993
2052
|
return this;
|
|
@@ -2121,6 +2180,14 @@ class ColumnDescriptor {
|
|
|
2121
2180
|
this._hasCopyToClipboard = hasCopyToCliboard;
|
|
2122
2181
|
return this;
|
|
2123
2182
|
}
|
|
2183
|
+
withTemplate(template) {
|
|
2184
|
+
this._template = template;
|
|
2185
|
+
return this;
|
|
2186
|
+
}
|
|
2187
|
+
withGetter(getter) {
|
|
2188
|
+
this._getter = getter;
|
|
2189
|
+
return this;
|
|
2190
|
+
}
|
|
2124
2191
|
copy() {
|
|
2125
2192
|
const descriptor = new ColumnDescriptor(this._table, this._property);
|
|
2126
2193
|
descriptor._jsonPath = this._jsonPath;
|
|
@@ -2147,6 +2214,8 @@ class ColumnDescriptor {
|
|
|
2147
2214
|
descriptor._minWidth = this._minWidth;
|
|
2148
2215
|
descriptor._maxWidth = this._maxWidth;
|
|
2149
2216
|
descriptor._hasCopyToClipboard = this._hasCopyToClipboard;
|
|
2217
|
+
descriptor._template = this._template;
|
|
2218
|
+
descriptor._getter = this._getter;
|
|
2150
2219
|
return descriptor;
|
|
2151
2220
|
}
|
|
2152
2221
|
}
|
|
@@ -3523,6 +3592,116 @@ class TableviewDescriptor {
|
|
|
3523
3592
|
}
|
|
3524
3593
|
}
|
|
3525
3594
|
|
|
3595
|
+
class ButtonDescriptor {
|
|
3596
|
+
constructor() {
|
|
3597
|
+
this._disabled = false;
|
|
3598
|
+
this._iconPosition = 'left';
|
|
3599
|
+
this._styleClass = new ButtonStyleBuilder();
|
|
3600
|
+
this._loading = false;
|
|
3601
|
+
this._loadingIcon = 'pi pi-spinner pi-spin';
|
|
3602
|
+
}
|
|
3603
|
+
withLabel(label) {
|
|
3604
|
+
this._label = label;
|
|
3605
|
+
return this;
|
|
3606
|
+
}
|
|
3607
|
+
withDisabled(disabled = true) {
|
|
3608
|
+
this._disabled = disabled;
|
|
3609
|
+
return this;
|
|
3610
|
+
}
|
|
3611
|
+
withIcon(icon) {
|
|
3612
|
+
this._icon = icon;
|
|
3613
|
+
return this;
|
|
3614
|
+
}
|
|
3615
|
+
withIconPosition(iconPosition) {
|
|
3616
|
+
this._iconPosition = iconPosition;
|
|
3617
|
+
return this;
|
|
3618
|
+
}
|
|
3619
|
+
withStyleClass(style) {
|
|
3620
|
+
this._styleClass = style;
|
|
3621
|
+
return this;
|
|
3622
|
+
}
|
|
3623
|
+
withOnClick(onClick) {
|
|
3624
|
+
this._onClick = onClick;
|
|
3625
|
+
return this;
|
|
3626
|
+
}
|
|
3627
|
+
withOnFocus(onFocus) {
|
|
3628
|
+
this._onFocus = onFocus;
|
|
3629
|
+
return this;
|
|
3630
|
+
}
|
|
3631
|
+
withOnBlur(onBlur) {
|
|
3632
|
+
this._onBlur = onBlur;
|
|
3633
|
+
return this;
|
|
3634
|
+
}
|
|
3635
|
+
withLoading(loading = true) {
|
|
3636
|
+
this._loading = loading;
|
|
3637
|
+
return this;
|
|
3638
|
+
}
|
|
3639
|
+
withLoadingIcon(loadingIcon) {
|
|
3640
|
+
this._loadingIcon = loadingIcon;
|
|
3641
|
+
return this;
|
|
3642
|
+
}
|
|
3643
|
+
withBadge(badge) {
|
|
3644
|
+
this._badge = badge;
|
|
3645
|
+
return this;
|
|
3646
|
+
}
|
|
3647
|
+
withTooltip(tooltip) {
|
|
3648
|
+
this._tooltip = tooltip;
|
|
3649
|
+
return this;
|
|
3650
|
+
}
|
|
3651
|
+
get label() {
|
|
3652
|
+
return this._label;
|
|
3653
|
+
}
|
|
3654
|
+
get disabled() {
|
|
3655
|
+
return this._disabled;
|
|
3656
|
+
}
|
|
3657
|
+
get icon() {
|
|
3658
|
+
return this._icon;
|
|
3659
|
+
}
|
|
3660
|
+
get iconPosition() {
|
|
3661
|
+
return this._iconPosition;
|
|
3662
|
+
}
|
|
3663
|
+
get styleClass() {
|
|
3664
|
+
return this._styleClass;
|
|
3665
|
+
}
|
|
3666
|
+
get onClick() {
|
|
3667
|
+
return this._onClick;
|
|
3668
|
+
}
|
|
3669
|
+
get onFocus() {
|
|
3670
|
+
return this._onFocus;
|
|
3671
|
+
}
|
|
3672
|
+
get onBlur() {
|
|
3673
|
+
return this._onBlur;
|
|
3674
|
+
}
|
|
3675
|
+
get loading() {
|
|
3676
|
+
return this._loading;
|
|
3677
|
+
}
|
|
3678
|
+
get loadingIcon() {
|
|
3679
|
+
return this._loadingIcon;
|
|
3680
|
+
}
|
|
3681
|
+
get badge() {
|
|
3682
|
+
return this._badge;
|
|
3683
|
+
}
|
|
3684
|
+
get tooltip() {
|
|
3685
|
+
return this._tooltip;
|
|
3686
|
+
}
|
|
3687
|
+
copy() {
|
|
3688
|
+
const descriptor = new ButtonDescriptor();
|
|
3689
|
+
descriptor._label = this._label;
|
|
3690
|
+
descriptor._disabled = this._disabled;
|
|
3691
|
+
descriptor._icon = this._icon;
|
|
3692
|
+
descriptor._iconPosition = this._iconPosition;
|
|
3693
|
+
descriptor._styleClass = this._styleClass;
|
|
3694
|
+
descriptor._onClick = this._onClick;
|
|
3695
|
+
descriptor._onFocus = this._onFocus;
|
|
3696
|
+
descriptor._onBlur = this._onBlur;
|
|
3697
|
+
descriptor._loading = this._loading;
|
|
3698
|
+
descriptor._loadingIcon = this._loadingIcon;
|
|
3699
|
+
descriptor._badge = this._badge;
|
|
3700
|
+
descriptor._tooltip = this._tooltip;
|
|
3701
|
+
return descriptor;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3526
3705
|
class EditorFormlyUtil {
|
|
3527
3706
|
static createFormlyConfigFromDescriptor(descriptor) {
|
|
3528
3707
|
const fields = [];
|
|
@@ -5349,6 +5528,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
5349
5528
|
}]
|
|
5350
5529
|
}] });
|
|
5351
5530
|
|
|
5531
|
+
class MngGetterPipe {
|
|
5532
|
+
transform(value, getterFunction) {
|
|
5533
|
+
if (typeof getterFunction === 'function') {
|
|
5534
|
+
return getterFunction(value);
|
|
5535
|
+
}
|
|
5536
|
+
return value;
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5539
|
+
MngGetterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngGetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5540
|
+
MngGetterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: MngGetterPipe, name: "getter" });
|
|
5541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngGetterPipe, decorators: [{
|
|
5542
|
+
type: Pipe,
|
|
5543
|
+
args: [{
|
|
5544
|
+
name: 'getter',
|
|
5545
|
+
pure: true
|
|
5546
|
+
}]
|
|
5547
|
+
}] });
|
|
5548
|
+
|
|
5549
|
+
class MngTemplatePipe {
|
|
5550
|
+
constructor(parametrizePipe) {
|
|
5551
|
+
this.parametrizePipe = parametrizePipe;
|
|
5552
|
+
}
|
|
5553
|
+
transform(value, template) {
|
|
5554
|
+
if (typeof template === 'string') {
|
|
5555
|
+
return this.parametrizePipe.transform(template, undefined, value);
|
|
5556
|
+
}
|
|
5557
|
+
return value;
|
|
5558
|
+
}
|
|
5559
|
+
}
|
|
5560
|
+
MngTemplatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTemplatePipe, deps: [{ token: MngParametrizePipe }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5561
|
+
MngTemplatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: MngTemplatePipe, name: "template" });
|
|
5562
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTemplatePipe, decorators: [{
|
|
5563
|
+
type: Pipe,
|
|
5564
|
+
args: [{
|
|
5565
|
+
name: 'template',
|
|
5566
|
+
pure: true
|
|
5567
|
+
}]
|
|
5568
|
+
}], ctorParameters: function () { return [{ type: MngParametrizePipe }]; } });
|
|
5569
|
+
|
|
5352
5570
|
class MngActionExecutorService {
|
|
5353
5571
|
constructor(injector, router, dialogService, confirmationService, translate, configurationService, navigationService, errorMapper, parametrize, defaultEditorDialogComponent) {
|
|
5354
5572
|
this.injector = injector;
|
|
@@ -5606,34 +5824,45 @@ class MngActionExecutorService {
|
|
|
5606
5824
|
const context = this.prepareActionContext(instance, parameters, dataProvider, previousActionInstance);
|
|
5607
5825
|
if (action.hasRunConfirmation) {
|
|
5608
5826
|
const sourceComponent = parameters?.sourceComponent;
|
|
5827
|
+
const confirmationDescriptor = action.runConfirmationDialogDescriptor;
|
|
5609
5828
|
if (typeof sourceComponent?.getConfirmationService !== 'function' || typeof sourceComponent?.getConfirmationServiceInstanceKey !== 'function') {
|
|
5610
5829
|
throw new Error(`Source component ${sourceComponent} should be implementing IConfirmationService interface to be able to provide confirmation functionality.`);
|
|
5611
5830
|
}
|
|
5831
|
+
const item = parameters.item;
|
|
5612
5832
|
const srcConfirmComponent = sourceComponent;
|
|
5613
5833
|
let confirmParams = {
|
|
5614
5834
|
key: srcConfirmComponent.getConfirmationServiceInstanceKey(action),
|
|
5615
|
-
|
|
5616
|
-
|
|
5835
|
+
icon: confirmationDescriptor.icon,
|
|
5836
|
+
acceptVisible: true,
|
|
5837
|
+
acceptIcon: confirmationDescriptor.acceptIcon ?? undefined,
|
|
5838
|
+
acceptButtonStyleClass: confirmationDescriptor.acceptButtonStyle.getButtonClass(),
|
|
5839
|
+
rejectVisible: true,
|
|
5840
|
+
rejectIcon: confirmationDescriptor.rejectIcon ?? undefined,
|
|
5841
|
+
rejectButtonStyleClass: confirmationDescriptor.rejectButtonStyle.getButtonClass(),
|
|
5842
|
+
closeOnEscape: confirmationDescriptor.closeOnEscape
|
|
5617
5843
|
};
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
confirmParams.header = I18nUtils.Action.get(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation') ?? undefined;
|
|
5844
|
+
if (confirmationDescriptor.title !== null) {
|
|
5845
|
+
confirmParams.header = I18nUtils.Action.get(this.translate, action, 'confirm.title', confirmationDescriptor.title, item, 'general.confirmation') ?? undefined;
|
|
5621
5846
|
}
|
|
5622
|
-
if (
|
|
5847
|
+
if (confirmationDescriptor.message !== null) {
|
|
5623
5848
|
confirmParams.message =
|
|
5624
|
-
I18nUtils.Action.get(this.translate, action, 'confirm.message',
|
|
5849
|
+
I18nUtils.Action.get(this.translate, action, 'confirm.message', confirmationDescriptor.message, StringUtil.escapeHtmlAny(item), 'general.confirmation') ??
|
|
5625
5850
|
undefined;
|
|
5626
5851
|
}
|
|
5627
|
-
if (
|
|
5628
|
-
confirmParams.
|
|
5852
|
+
if (confirmationDescriptor.acceptLabel !== null) {
|
|
5853
|
+
confirmParams.acceptLabel = I18nUtils.Action.get(this.translate, action, 'confirm.accept', confirmationDescriptor.acceptLabel, item, 'general.yes') ?? undefined;
|
|
5854
|
+
}
|
|
5855
|
+
if (confirmationDescriptor.acceptIcon !== null) {
|
|
5856
|
+
confirmParams.acceptIcon = confirmationDescriptor.acceptIcon;
|
|
5857
|
+
}
|
|
5858
|
+
if (confirmationDescriptor.rejectIcon !== null) {
|
|
5859
|
+
confirmParams.rejectIcon = confirmationDescriptor.rejectIcon;
|
|
5629
5860
|
}
|
|
5630
|
-
if (
|
|
5631
|
-
confirmParams.
|
|
5632
|
-
confirmParams.acceptVisible = true;
|
|
5861
|
+
if (confirmationDescriptor.rejectLabel !== null) {
|
|
5862
|
+
confirmParams.rejectLabel = I18nUtils.Action.get(this.translate, action, 'confirm.reject', confirmationDescriptor.rejectLabel, item, 'general.no') ?? undefined;
|
|
5633
5863
|
}
|
|
5634
|
-
if (
|
|
5635
|
-
confirmParams.
|
|
5636
|
-
confirmParams.rejectVisible = true;
|
|
5864
|
+
if (confirmationDescriptor.rejectLabel === null && confirmationDescriptor.rejectIcon === null) {
|
|
5865
|
+
confirmParams.rejectVisible = false;
|
|
5637
5866
|
}
|
|
5638
5867
|
confirmParams.accept = () => {
|
|
5639
5868
|
instance.state = ActionInstanceStateEnum.RunConfirmationEndAccept;
|
|
@@ -5643,8 +5872,8 @@ class MngActionExecutorService {
|
|
|
5643
5872
|
instance.state = ActionInstanceStateEnum.RunConfirmationEndReject;
|
|
5644
5873
|
this.deactivateAction(instance);
|
|
5645
5874
|
};
|
|
5646
|
-
if (
|
|
5647
|
-
confirmParams =
|
|
5875
|
+
if (confirmationDescriptor.runConfirmationConfigMapFn) {
|
|
5876
|
+
confirmParams = confirmationDescriptor.runConfirmationConfigMapFn(context, confirmParams);
|
|
5648
5877
|
}
|
|
5649
5878
|
context.confirmation = confirmParams;
|
|
5650
5879
|
instance.state = ActionInstanceStateEnum.RunConfirmationStart;
|
|
@@ -5798,7 +6027,7 @@ class MngActionExecutorService {
|
|
|
5798
6027
|
if (actionUrl.startsWith('/')) {
|
|
5799
6028
|
actionUrl = actionUrl.substring(1);
|
|
5800
6029
|
}
|
|
5801
|
-
const actionUrlSegments = this.parametrize.transform(actionUrl, parameters.itemId, parameters.item, parameters.actionData);
|
|
6030
|
+
const actionUrlSegments = this.parametrize.transform(actionUrl, parameters.itemId, parameters.item, parameters.actionData).split('/');
|
|
5802
6031
|
instance.triggerRouteNavigation = from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: parameters.route, queryParams: parsedUrl.queryParams }));
|
|
5803
6032
|
return instance;
|
|
5804
6033
|
}
|
|
@@ -6325,7 +6554,7 @@ class MngActionComponent {
|
|
|
6325
6554
|
}
|
|
6326
6555
|
ngOnInit() {
|
|
6327
6556
|
this.viewContainer = this.viewContainerInit ?? this.viewContainerService ?? undefined;
|
|
6328
|
-
this.hasNoTitle = this.action.
|
|
6557
|
+
this.hasNoTitle = this.action.buttonDescriptor.label === null;
|
|
6329
6558
|
this.isEnabledSubject.next(true);
|
|
6330
6559
|
this.isVisibleSubject.next(true);
|
|
6331
6560
|
this.isPermittedSubject.next(true);
|
|
@@ -6348,7 +6577,7 @@ class MngActionComponent {
|
|
|
6348
6577
|
this.isHostHidden = !isVisible || !isPermitted;
|
|
6349
6578
|
});
|
|
6350
6579
|
this.subscriptions.push(hostVisibilitySubscription);
|
|
6351
|
-
this.buttonClass = this.action.
|
|
6580
|
+
this.buttonClass = this.action.buttonDescriptor.styleClass.getButtonClass(this.hasNoTitle);
|
|
6352
6581
|
}
|
|
6353
6582
|
ngOnChanges(changes) {
|
|
6354
6583
|
if (!(changes['item']?.firstChange ?? true) || !(changes['itemId']?.firstChange ?? true) || !(changes['actionData']?.firstChange ?? true)) {
|
|
@@ -6425,21 +6654,21 @@ class MngActionComponent {
|
|
|
6425
6654
|
}
|
|
6426
6655
|
if (!this.hasNoTitle) {
|
|
6427
6656
|
this.labelSubscription?.unsubscribe();
|
|
6428
|
-
this.labelSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'title', this.action
|
|
6657
|
+
this.labelSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'title', this.action.buttonDescriptor.label ?? undefined, this.item).subscribe({
|
|
6429
6658
|
next: i18n => this.labelSubject.next(i18n)
|
|
6430
6659
|
});
|
|
6431
6660
|
}
|
|
6432
6661
|
this.tooltipSubscription?.unsubscribe();
|
|
6433
|
-
this.tooltipSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', this.action
|
|
6662
|
+
this.tooltipSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', this.action.buttonDescriptor.tooltip, this.item).subscribe({
|
|
6434
6663
|
next: i18n => this.tooltipSubject.next(i18n)
|
|
6435
6664
|
});
|
|
6436
6665
|
}
|
|
6437
6666
|
}
|
|
6438
6667
|
MngActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1$2.TranslateService }, { token: MngAuthorizationService }, { token: MngActionExecutorService }, { token: i2.ConfirmationService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6439
|
-
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog
|
|
6668
|
+
MngActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionComponent, selector: "mng-action", inputs: { action: "action", item: "item", itemId: "itemId", actionData: "actionData", queryParam: "queryParam", dataProvider: "dataProvider", inputDisabled: ["disabled", "inputDisabled"], inputLoading: ["loading", "inputLoading"], viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { finishEventEmitter: "finish" }, host: { properties: { "class": "this.hostClass", "class.m-0": "this.isHostHidden" } }, providers: [ConfirmationService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i9.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: MngParametrizePipe, name: "parametrize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6440
6669
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
6441
6670
|
type: Component,
|
|
6442
|
-
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog
|
|
6671
|
+
args: [{ selector: 'mng-action', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfirmationService], template: "<ng-container *ngIf=\"($isVisible | async) && ($isPermitted | async)\">\n <a\n *ngIf=\"actionLink && actionLink.url !== ''; else routerLink\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [href]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.url | parametrize: itemId:item:actionData)\"\n [target]=\"actionLink.target\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n <ng-template #routerLink>\n <a\n *ngIf=\"actionLink; else button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [target]=\"actionLink.target\"\n [replaceUrl]=\"actionLink.replaceUrl\"\n [routerLink]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false) ? null : (actionLink.pathSegments | parametrize: itemId:item:actionData)\"\n [queryParams]=\"actionLink.queryParams | parametrize: itemId:item:actionData\"\n [queryParamsHandling]=\"actionLink.queryParamsHandling\"\n [class.disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n [class]=\"buttonClass\"\n >{{ ($label | async) ?? '' }}</a\n >\n </ng-template>\n <ng-template #button>\n <button\n type=\"button\"\n pButton\n pRipple\n [icon]=\"$any(action.buttonDescriptor.icon)\"\n [label]=\"($label | async) ?? ''\"\n [pTooltip]=\"$any($tooltip | async)\"\n [loading]=\"(($loading | async) ?? false) || ((inputLoading | async) ?? false)\"\n [disabled]=\"($isEnabled | async) === false || ((inputDisabled | async) ?? false)\"\n (click)=\"triggerAction($event)\"\n [class]=\"buttonClass\"></button>\n </ng-template>\n <p-confirmDialog\n *ngIf=\"action.runConfirmationDialogDescriptor\"\n [key]=\"action.actionName + '_' + cmpId\"\n [baseZIndex]=\"50\"\n appendTo=\"body\"\n [closable]=\"action.runConfirmationDialogDescriptor.closable\"></p-confirmDialog>\n</ng-container>\n", styles: [":host{display:inline-block}\n"] }]
|
|
6443
6672
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i1$2.TranslateService }, { type: MngAuthorizationService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6444
6673
|
type: Optional
|
|
6445
6674
|
}] }]; }, propDecorators: { hostClass: [{
|
|
@@ -6720,13 +6949,14 @@ class MngFormEditorComponent {
|
|
|
6720
6949
|
if (field && field.setter) {
|
|
6721
6950
|
const splitPath = field.property.split('.');
|
|
6722
6951
|
let fieldValue = formValue;
|
|
6723
|
-
for (let i = 0; i < splitPath.length; i++) {
|
|
6952
|
+
for (let i = 0; i < splitPath.length - 1; i++) {
|
|
6724
6953
|
const currentSubPath = splitPath[i];
|
|
6725
6954
|
if (typeof fieldValue[currentSubPath] !== 'object') {
|
|
6726
6955
|
fieldValue[currentSubPath] = {};
|
|
6727
6956
|
}
|
|
6728
6957
|
fieldValue = fieldValue[currentSubPath];
|
|
6729
6958
|
}
|
|
6959
|
+
fieldValue = fieldValue[splitPath[splitPath.length - 1]];
|
|
6730
6960
|
field.setter(formValue, fieldValue);
|
|
6731
6961
|
}
|
|
6732
6962
|
});
|
|
@@ -7384,11 +7614,11 @@ class MngActionEditorComponent {
|
|
|
7384
7614
|
this.setTitle();
|
|
7385
7615
|
for (const action of this.action.editorActions) {
|
|
7386
7616
|
if (action instanceof ActionEditorSubmitDescriptor) {
|
|
7387
|
-
if (typeof action.icon === 'undefined') {
|
|
7388
|
-
action.withIcon(action.submitType === ActionEditorSubmitTypeEnum.Submit ? 'pi pi-check' : 'pi pi-times');
|
|
7617
|
+
if (typeof action.buttonDescriptor.icon === 'undefined') {
|
|
7618
|
+
action.buttonDescriptor.withIcon(action.submitType === ActionEditorSubmitTypeEnum.Submit ? 'pi pi-check' : 'pi pi-times');
|
|
7389
7619
|
}
|
|
7390
|
-
if (typeof action.
|
|
7391
|
-
action.
|
|
7620
|
+
if (typeof action.buttonDescriptor.label === 'undefined') {
|
|
7621
|
+
action.buttonDescriptor.withLabel(action.submitType === ActionEditorSubmitTypeEnum.Submit ? 'general.save' : this.isDialog ? 'general.close' : 'general.cancel');
|
|
7392
7622
|
}
|
|
7393
7623
|
// assign run operations
|
|
7394
7624
|
action.withRunNotificationSuccess(undefined, undefined, false);
|
|
@@ -7555,6 +7785,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
7555
7785
|
args: [MngFormEditorComponent]
|
|
7556
7786
|
}] } });
|
|
7557
7787
|
|
|
7788
|
+
class MngButtonComponent {
|
|
7789
|
+
constructor() {
|
|
7790
|
+
this.clickEmitter = new EventEmitter();
|
|
7791
|
+
this.focusEmitter = new EventEmitter();
|
|
7792
|
+
this.blurEmitter = new EventEmitter();
|
|
7793
|
+
this.buttonClass = 'p-button';
|
|
7794
|
+
}
|
|
7795
|
+
ngOnInit() {
|
|
7796
|
+
this.buttonClass = `${this.descriptor.styleClass.getButtonClass(this.descriptor.label == null)}`;
|
|
7797
|
+
}
|
|
7798
|
+
onClick(event) {
|
|
7799
|
+
this.clickEmitter.next(event);
|
|
7800
|
+
this.descriptor.onClick?.(event);
|
|
7801
|
+
}
|
|
7802
|
+
onFocus(event) {
|
|
7803
|
+
this.focusEmitter.next(event);
|
|
7804
|
+
this.descriptor.onFocus?.(event);
|
|
7805
|
+
}
|
|
7806
|
+
onBlur(event) {
|
|
7807
|
+
this.blurEmitter.next(event);
|
|
7808
|
+
this.descriptor.onBlur?.(event);
|
|
7809
|
+
}
|
|
7810
|
+
}
|
|
7811
|
+
MngButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7812
|
+
MngButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngButtonComponent, selector: "mng-button", inputs: { descriptor: "descriptor" }, outputs: { clickEmitter: "buttonClick", focusEmitter: "buttonFocus", blurEmitter: "buttonBlur" }, ngImport: i0, template: "<p-button\n #button\n type=\"button\"\n [label]=\"$any(descriptor.label) | translate\"\n [icon]=\"$any(descriptor.icon)\"\n [iconPos]=\"$any(descriptor.iconPosition)\"\n [loading]=\"$any(descriptor.loading)\"\n [loadingIcon]=\"$any(descriptor.loadingIcon)\"\n [disabled]=\"$any(descriptor.disabled)\"\n [styleClass]=\"buttonClass\"\n [pTooltip]=\"$any(descriptor.tooltip) | translate\"\n [badge]=\"$any(descriptor.badge)\"\n (onClick)=\"onClick($event)\"\n (onBlur)=\"onBlur($event)\"\n (onFocus)=\"onFocus($event)\"></p-button>\n", dependencies: [{ kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i4$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngButtonComponent, decorators: [{
|
|
7814
|
+
type: Component,
|
|
7815
|
+
args: [{ selector: 'mng-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-button\n #button\n type=\"button\"\n [label]=\"$any(descriptor.label) | translate\"\n [icon]=\"$any(descriptor.icon)\"\n [iconPos]=\"$any(descriptor.iconPosition)\"\n [loading]=\"$any(descriptor.loading)\"\n [loadingIcon]=\"$any(descriptor.loadingIcon)\"\n [disabled]=\"$any(descriptor.disabled)\"\n [styleClass]=\"buttonClass\"\n [pTooltip]=\"$any(descriptor.tooltip) | translate\"\n [badge]=\"$any(descriptor.badge)\"\n (onClick)=\"onClick($event)\"\n (onBlur)=\"onBlur($event)\"\n (onFocus)=\"onFocus($event)\"></p-button>\n" }]
|
|
7816
|
+
}], propDecorators: { descriptor: [{
|
|
7817
|
+
type: Input
|
|
7818
|
+
}], clickEmitter: [{
|
|
7819
|
+
type: Output,
|
|
7820
|
+
args: ['buttonClick']
|
|
7821
|
+
}], focusEmitter: [{
|
|
7822
|
+
type: Output,
|
|
7823
|
+
args: ['buttonFocus']
|
|
7824
|
+
}], blurEmitter: [{
|
|
7825
|
+
type: Output,
|
|
7826
|
+
args: ['buttonBlur']
|
|
7827
|
+
}] } });
|
|
7828
|
+
|
|
7558
7829
|
class MngFormlyFieldAutocompleteComponent extends FieldType {
|
|
7559
7830
|
constructor() {
|
|
7560
7831
|
super(...arguments);
|
|
@@ -7792,10 +8063,10 @@ class MngTableColumnValueComponent {
|
|
|
7792
8063
|
}
|
|
7793
8064
|
}
|
|
7794
8065
|
MngTableColumnValueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableColumnValueComponent, deps: [{ token: i0.ElementRef }, { token: i2.MessageService }, { token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
7795
|
-
MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, host: { properties: { "style.max-width.px": "this.styleMaxWidth", "class": "this.className" } }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ item | jsonPath: jsonPath }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ item | jsonPath: jsonPath | number: descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCurrency\">\n {{ item | jsonPath: jsonPath | currency: currency:descriptor.currencyDisplay:descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ item | jsonPath: jsonPath | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n <ng-container *ngIf=\"descriptor.booleanAsIcon; else booleanText\"></ng-container>\n <i [class]=\"item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo:true\"></i>\n <ng-template #booleanText>\n {{ item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo | translate }}\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{ item | jsonPath: jsonPath | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue | translate }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCustom\">\n <ng-container\n [mngComponent]=\"descriptor.customComponentType!\"\n [inputs]=\"{\n value: item | jsonPath: jsonPath,\n item: item,\n descriptor: descriptor\n }\"></ng-container>\n </ng-container>\n</ng-container>\n<div class=\"help-buttons\" *ngIf=\"descriptor.hasCopyToClipboard\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (click)=\"copyToClipboard($event)\"></button>\n</div>\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host:hover .help-buttons{display:block}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1$1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: JsonPathPipe, name: "jsonPath" }, { kind: "pipe", type: MngEnumPipe, name: "enum" }, { kind: "pipe", type: MngBooleanPipe, name: "boolean" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8066
|
+
MngTableColumnValueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: { descriptor: "descriptor", item: "item" }, host: { properties: { "style.max-width.px": "this.styleMaxWidth", "class": "this.className" } }, ngImport: i0, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ item | jsonPath: jsonPath | getter: descriptor.getter | template: descriptor.template }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ item | jsonPath: jsonPath | number: descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCurrency\">\n {{ item | jsonPath: jsonPath | currency: currency:descriptor.currencyDisplay:descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ item | jsonPath: jsonPath | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n <ng-container *ngIf=\"descriptor.booleanAsIcon; else booleanText\"></ng-container>\n <i [class]=\"item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo:true\"></i>\n <ng-template #booleanText>\n {{ item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo | translate }}\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{ item | jsonPath: jsonPath | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue | translate }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCustom\">\n <ng-container\n [mngComponent]=\"descriptor.customComponentType!\"\n [inputs]=\"{\n value: item | jsonPath: jsonPath,\n item: item,\n descriptor: descriptor\n }\"></ng-container>\n </ng-container>\n</ng-container>\n<div class=\"help-buttons\" *ngIf=\"descriptor.hasCopyToClipboard\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (click)=\"copyToClipboard($event)\"></button>\n</div>\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host:hover .help-buttons{display:block}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1$1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: JsonPathPipe, name: "jsonPath" }, { kind: "pipe", type: MngEnumPipe, name: "enum" }, { kind: "pipe", type: MngBooleanPipe, name: "boolean" }, { kind: "pipe", type: MngGetterPipe, name: "getter" }, { kind: "pipe", type: MngTemplatePipe, name: "template" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7796
8067
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
|
|
7797
8068
|
type: Component,
|
|
7798
|
-
args: [{ selector: 'mng-table-column-value', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ item | jsonPath: jsonPath }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ item | jsonPath: jsonPath | number: descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCurrency\">\n {{ item | jsonPath: jsonPath | currency: currency:descriptor.currencyDisplay:descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ item | jsonPath: jsonPath | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n <ng-container *ngIf=\"descriptor.booleanAsIcon; else booleanText\"></ng-container>\n <i [class]=\"item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo:true\"></i>\n <ng-template #booleanText>\n {{ item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo | translate }}\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{ item | jsonPath: jsonPath | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue | translate }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCustom\">\n <ng-container\n [mngComponent]=\"descriptor.customComponentType!\"\n [inputs]=\"{\n value: item | jsonPath: jsonPath,\n item: item,\n descriptor: descriptor\n }\"></ng-container>\n </ng-container>\n</ng-container>\n<div class=\"help-buttons\" *ngIf=\"descriptor.hasCopyToClipboard\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (click)=\"copyToClipboard($event)\"></button>\n</div>\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host:hover .help-buttons{display:block}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"] }]
|
|
8069
|
+
args: [{ selector: 'mng-table-column-value', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"descriptor.columnType\">\n <ng-container *ngSwitchCase=\"columnTypeString\">\n {{ item | jsonPath: jsonPath | getter: descriptor.getter | template: descriptor.template }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeNumber\">\n {{ item | jsonPath: jsonPath | number: descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCurrency\">\n {{ item | jsonPath: jsonPath | currency: currency:descriptor.currencyDisplay:descriptor.displayFormat:descriptor.locale }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeDate\">\n {{ item | jsonPath: jsonPath | date: descriptor.displayFormat }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeBoolean\">\n <ng-container *ngIf=\"descriptor.booleanAsIcon; else booleanText\"></ng-container>\n <i [class]=\"item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo:true\"></i>\n <ng-template #booleanText>\n {{ item | jsonPath: jsonPath | boolean: descriptor.booleanYes:descriptor.booleanNo | translate }}\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeEnum\">\n {{ item | jsonPath: jsonPath | enum: descriptor.enumType:descriptor.enumTitlePath:descriptor.enumNameAsValue | translate }}\n </ng-container>\n <ng-container *ngSwitchCase=\"columnTypeCustom\">\n <ng-container\n [mngComponent]=\"descriptor.customComponentType!\"\n [inputs]=\"{\n value: item | jsonPath: jsonPath,\n item: item,\n descriptor: descriptor\n }\"></ng-container>\n </ng-container>\n</ng-container>\n<div class=\"help-buttons\" *ngIf=\"descriptor.hasCopyToClipboard\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (click)=\"copyToClipboard($event)\"></button>\n</div>\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host:hover .help-buttons{display:block}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"] }]
|
|
7799
8070
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.MessageService }, { type: i1$2.TranslateService }]; }, propDecorators: { descriptor: [{
|
|
7800
8071
|
type: Input
|
|
7801
8072
|
}], item: [{
|
|
@@ -8467,13 +8738,14 @@ class AMngTableviewRouteComponent {
|
|
|
8467
8738
|
this.actions = this.createActionDescriptors();
|
|
8468
8739
|
}
|
|
8469
8740
|
createActionDescriptors() {
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8741
|
+
return [
|
|
8742
|
+
this.createActionDescriptorForDetails(),
|
|
8743
|
+
this.createActionDescriptorForAdd(),
|
|
8744
|
+
this.createActionDescriptorForEdit(),
|
|
8745
|
+
this.createActionDescriptorForDelete(),
|
|
8746
|
+
this.createActionDescriptorForRefresh(),
|
|
8747
|
+
this.createActionDescriptorForExport()
|
|
8748
|
+
];
|
|
8477
8749
|
}
|
|
8478
8750
|
createActionDescriptorForDetails(descriptor = this.descriptor.viewEditor) {
|
|
8479
8751
|
return new ActionEditorDetailsDescriptor(descriptor);
|
|
@@ -8488,7 +8760,7 @@ class AMngTableviewRouteComponent {
|
|
|
8488
8760
|
return new ActionDeleteDescriptor(descriptor);
|
|
8489
8761
|
}
|
|
8490
8762
|
createActionDescriptorForExport(descriptor = this.descriptor.model) {
|
|
8491
|
-
|
|
8763
|
+
const action = new ActionDescriptor(descriptor, 'export')
|
|
8492
8764
|
.withRunFunction(ctx => {
|
|
8493
8765
|
const queryParamBuilder = ctx.parameters.queryParam ? MediusQueryParamBuilder.createFromExisting(ctx.parameters.queryParam) : MediusQueryParamBuilder.create();
|
|
8494
8766
|
queryParamBuilder.withItemsOffset(0).withItemsPerPage(1000);
|
|
@@ -8500,8 +8772,21 @@ class AMngTableviewRouteComponent {
|
|
|
8500
8772
|
return undefined;
|
|
8501
8773
|
}));
|
|
8502
8774
|
})
|
|
8775
|
+
.withPosition(ActionPositionEnum.ToolbarRight);
|
|
8776
|
+
action.buttonDescriptor.withIcon('pi pi-upload');
|
|
8777
|
+
return action;
|
|
8778
|
+
}
|
|
8779
|
+
createActionDescriptorForRefresh(descriptor = this.descriptor.model) {
|
|
8780
|
+
const action = new ActionDescriptor(descriptor, 'refresh')
|
|
8503
8781
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
8504
|
-
.
|
|
8782
|
+
.withPermissionsRouteType(Permissions.ActionTypes.READ)
|
|
8783
|
+
.withRunNotificationSuccess(undefined, undefined, false)
|
|
8784
|
+
.withRunFunction(ctx => {
|
|
8785
|
+
ctx.parameters.viewContainer.triggerTableReload({});
|
|
8786
|
+
return of(null);
|
|
8787
|
+
});
|
|
8788
|
+
action.buttonDescriptor.withIcon('pi pi-refresh').styleClass.withActionLevel(ActionLevelEnum.Secondary);
|
|
8789
|
+
return action;
|
|
8505
8790
|
}
|
|
8506
8791
|
}
|
|
8507
8792
|
AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -8746,20 +9031,18 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8746
9031
|
if (hasViewAction) {
|
|
8747
9032
|
const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.viewEditor, 'details', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8748
9033
|
.withPosition(ActionPositionEnum.RowClick)
|
|
8749
|
-
.withTitle(null)
|
|
8750
9034
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
8751
9035
|
.withDialogSize(ActionEditorDialogSizeEnum.Small);
|
|
8752
9036
|
viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitTypeEnum.Cancel)]);
|
|
9037
|
+
viewAction.buttonDescriptor.withLabel(null);
|
|
8753
9038
|
this.actions.push(viewAction);
|
|
8754
9039
|
}
|
|
8755
9040
|
if (hasAddAction) {
|
|
8756
9041
|
const addAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.addEditor, 'add', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8757
9042
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
8758
|
-
.withTitle(null)
|
|
8759
|
-
.withIcon('pi pi-plus')
|
|
8760
9043
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
8761
9044
|
.withDialogSize(ActionEditorDialogSizeEnum.Small)
|
|
8762
|
-
.withSize(ActionSizeEnum.ExtraSmall)
|
|
9045
|
+
.withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withSize(ActionSizeEnum.ExtraSmall)))
|
|
8763
9046
|
.withSubmitFunction(ctx => {
|
|
8764
9047
|
if (!ctx.parameters.item) {
|
|
8765
9048
|
return throwError(() => new Error(`No item was provided in context, edit cannot be done.`));
|
|
@@ -8772,16 +9055,15 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8772
9055
|
})
|
|
8773
9056
|
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
8774
9057
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
9058
|
+
addAction.buttonDescriptor.withLabel(null).withIcon('pi pi-plus');
|
|
8775
9059
|
this.actions.push(addAction);
|
|
8776
9060
|
}
|
|
8777
9061
|
if (hasEditAction) {
|
|
8778
9062
|
const editAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.editEditor, 'edit', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8779
9063
|
.withPosition(ActionPositionEnum.RowInline)
|
|
8780
|
-
.withTitle(null)
|
|
8781
|
-
.withIcon('pi pi-pencil')
|
|
8782
9064
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
8783
9065
|
.withDialogSize(ActionEditorDialogSizeEnum.Small)
|
|
8784
|
-
.withSize(ActionSizeEnum.ExtraSmall)
|
|
9066
|
+
.withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withSize(ActionSizeEnum.ExtraSmall)))
|
|
8785
9067
|
.withSubmitFunction(ctx => {
|
|
8786
9068
|
if (!ctx.parameters.item) {
|
|
8787
9069
|
return throwError(() => new Error(`No item was provided in context, edit cannot be done.`));
|
|
@@ -8794,15 +9076,13 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8794
9076
|
})
|
|
8795
9077
|
.withIsVisibleFunction(() => of(!this.formControl?.disabled))
|
|
8796
9078
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
9079
|
+
editAction.buttonDescriptor.withLabel(null).withIcon('pi pi-pencil');
|
|
8797
9080
|
this.actions.push(editAction);
|
|
8798
9081
|
}
|
|
8799
9082
|
if (hasDeleteAction) {
|
|
8800
9083
|
const deleteAction = new ActionDescriptor(this.descriptor.tableviewDescriptor.model, 'delete', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8801
9084
|
.withPosition(ActionPositionEnum.RowInline)
|
|
8802
|
-
.
|
|
8803
|
-
.withTitle(null)
|
|
8804
|
-
.withIcon('pi pi-trash')
|
|
8805
|
-
.withSize(ActionSizeEnum.ExtraSmall)
|
|
9085
|
+
.withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder(ActionLevelEnum.Danger).withSize(ActionSizeEnum.ExtraSmall)))
|
|
8806
9086
|
.withRunFunction(ctx => {
|
|
8807
9087
|
if (!ctx.parameters.item) {
|
|
8808
9088
|
return throwError(() => new Error(`No item was provided in context, delete cannot be done.`));
|
|
@@ -8827,6 +9107,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8827
9107
|
})
|
|
8828
9108
|
.withIsVisibleFunction(() => of(!this.options?.formState.disabled))
|
|
8829
9109
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
9110
|
+
deleteAction.buttonDescriptor.withLabel(null).withIcon('pi pi-trash');
|
|
8830
9111
|
this.actions.push(deleteAction);
|
|
8831
9112
|
}
|
|
8832
9113
|
this.actions.push(...this.descriptor.actions);
|
|
@@ -9990,6 +10271,8 @@ const declarations = [
|
|
|
9990
10271
|
MngBooleanPipe,
|
|
9991
10272
|
MngI18nPropertyPipe,
|
|
9992
10273
|
MngParametrizePipe,
|
|
10274
|
+
MngGetterPipe,
|
|
10275
|
+
MngTemplatePipe,
|
|
9993
10276
|
// layout components
|
|
9994
10277
|
MngBreadcrumbComponent,
|
|
9995
10278
|
MngFooterComponent,
|
|
@@ -10024,7 +10307,9 @@ const declarations = [
|
|
|
10024
10307
|
MngFormEditorComponent,
|
|
10025
10308
|
MngActionComponent,
|
|
10026
10309
|
MngActionEditorComponent,
|
|
10027
|
-
MngActionRouteComponent
|
|
10310
|
+
MngActionRouteComponent,
|
|
10311
|
+
//button
|
|
10312
|
+
MngButtonComponent
|
|
10028
10313
|
];
|
|
10029
10314
|
class MngCommonsModule {
|
|
10030
10315
|
static forRoot(config) {
|
|
@@ -10050,6 +10335,8 @@ class MngCommonsModule {
|
|
|
10050
10335
|
MngBooleanPipe,
|
|
10051
10336
|
MngI18nPropertyPipe,
|
|
10052
10337
|
MngParametrizePipe,
|
|
10338
|
+
MngGetterPipe,
|
|
10339
|
+
MngTemplatePipe,
|
|
10053
10340
|
// component service
|
|
10054
10341
|
MngMainLayoutComponentService,
|
|
10055
10342
|
MngViewContainerComponentService,
|
|
@@ -10107,6 +10394,8 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10107
10394
|
MngBooleanPipe,
|
|
10108
10395
|
MngI18nPropertyPipe,
|
|
10109
10396
|
MngParametrizePipe,
|
|
10397
|
+
MngGetterPipe,
|
|
10398
|
+
MngTemplatePipe,
|
|
10110
10399
|
// layout components
|
|
10111
10400
|
MngBreadcrumbComponent,
|
|
10112
10401
|
MngFooterComponent,
|
|
@@ -10141,7 +10430,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10141
10430
|
MngFormEditorComponent,
|
|
10142
10431
|
MngActionComponent,
|
|
10143
10432
|
MngActionEditorComponent,
|
|
10144
|
-
MngActionRouteComponent
|
|
10433
|
+
MngActionRouteComponent,
|
|
10434
|
+
//button
|
|
10435
|
+
MngButtonComponent], imports: [
|
|
10145
10436
|
// angular modules
|
|
10146
10437
|
CommonModule,
|
|
10147
10438
|
RouterModule,
|
|
@@ -10222,6 +10513,8 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10222
10513
|
MngBooleanPipe,
|
|
10223
10514
|
MngI18nPropertyPipe,
|
|
10224
10515
|
MngParametrizePipe,
|
|
10516
|
+
MngGetterPipe,
|
|
10517
|
+
MngTemplatePipe,
|
|
10225
10518
|
// layout components
|
|
10226
10519
|
MngBreadcrumbComponent,
|
|
10227
10520
|
MngFooterComponent,
|
|
@@ -10256,7 +10549,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10256
10549
|
MngFormEditorComponent,
|
|
10257
10550
|
MngActionComponent,
|
|
10258
10551
|
MngActionEditorComponent,
|
|
10259
|
-
MngActionRouteComponent
|
|
10552
|
+
MngActionRouteComponent,
|
|
10553
|
+
//button
|
|
10554
|
+
MngButtonComponent] });
|
|
10260
10555
|
MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngCommonsModule, imports: [
|
|
10261
10556
|
// angular modules
|
|
10262
10557
|
CommonModule,
|
|
@@ -11072,5 +11367,5 @@ class TableviewRouteBuilder {
|
|
|
11072
11367
|
* Generated bundle index. Do not edit.
|
|
11073
11368
|
*/
|
|
11074
11369
|
|
|
11075
|
-
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorDialogSizeEnum, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLevelEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionSizeEnum, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonStyleBuilder, ColumnDescriptor, ColumnTypeEnum, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StylesUtil, TableDataProvider, TableDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewRouteBuilder, TableviewTypeEnum, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
11370
|
+
export { ACTION_EDITOR_DIALOG_COMPONENT_SETTING, AFieldDescriptor, AFieldGroupDescriptor, AGenericFieldDescriptor, AMngApiService, AMngBaseApiService, AMngCrudApiService, AMngGetAllApiService, AMngTableviewRouteComponent, APermissions, ActionActivationTriggerEnum, ActionConfirmationDialogDescriptor, ActionContext, ActionContextValidation, ActionDataProviderUtil, ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDescriptor, ActionEditorDetailsDescriptor, ActionEditorDialogSizeEnum, ActionEditorEditDescriptor, ActionEditorSubmitDescriptor, ActionEditorSubmitTypeEnum, ActionError, ActionInstance, ActionInstanceStateEnum, ActionLevelEnum, ActionLinkDescriptor, ActionParameters, ActionPositionEnum, ActionSimpleDescriptor, ActionSizeEnum, ActionTypeEnum, AuthorizationTypeEnum, AuthorizationUtil, ButtonDescriptor, ButtonStyleBuilder, ButtonStyleRoundedEnum, ColumnDescriptor, ColumnTypeEnum, DataProvider, DefaultMngErrorMapperService, EditorDataProvider, EditorDescriptor, EditorFormlyUtil, EnumName, EnumUtil, FieldGroupDescriptor, FieldGroupTypeEnum, FieldInputDescriptor, FieldInputTypeEnum, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupTypeEnum, FieldManyEditorActionEnum, FieldManyEditorDescriptor, FieldManyEditorTypeEnum, FieldManyToManyEditorActionEnum, FieldManyToManyEditorDescriptor, FieldManyToManyEditorTypeEnum, FieldSizeEnum, FieldTabGroupDescriptor, FieldValidationDescriptor, FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterMatchModeEnum, FilterTypeEnum, I18nUtils, JsonPathPipe, LookupDataProvider, MNG_AUTOCOMPLETE_VALUE_ACCESSOR, MNG_BROWSER_STORAGE_IT, MNG_COMMONS_INITIALIZER_IT, MNG_DROPDOWN_VALUE_ACCESSOR, MNG_MODULE_CONFIG_IT, MediusFilterMatchType, MediusFilterParam, MediusQueryMode, MediusQueryParam, MediusQueryParamBuilder, MediusQueryResult, MediusRestUtil, MngActionComponent, MngActionEditorComponent, MngActionExecutorService, MngActionRouteComponent, MngAuthorizationGuard, MngAuthorizationService, MngAutocompleteComponent, MngBooleanPipe, MngBreadcrumbComponent, MngButtonComponent, MngCommonsModule, MngCommonsService, MngComponentDirective, MngConfigurationService, MngDropdownComponent, MngEnumPipe, MngErrorMapperService, MngFooterComponent, MngFormEditorComponent, MngFormEditorSubmitEvent, MngFormFieldEvent, MngFormFieldEventComponentSubtype, MngFormFieldEventDialogSubtype, MngFormFieldEventTypeEnum, MngFormlyFieldAutocompleteComponent, MngFormlyFieldDropdownComponent, MngFormlyFieldFieldsetComponent, MngFormlyFieldInputComponent, MngFormlyFieldLabelComponent, MngFormlyFieldLookupDialogComponent, MngFormlyFieldTableDialogFormComponent, MngFormlyFieldTableDialogMultiselectComponent, MngFormlyFieldTabsComponent, MngFormlyFieldWrapperComponent, MngFormlyTableWrapperComponent, MngGetterPipe, MngI18nPropertyPipe, MngMainLayoutComponent, MngMainLayoutComponentService, MngMenuComponent, MngMenuItemComponent, MngNavigationService, MngParametrizePipe, MngTableCellClickEvent, MngTableColumnFilterComponent, MngTableColumnValueComponent, MngTableComponent, MngTableLoadEvent, MngTableReloadEvent, MngTableviewComponent, MngTableviewRouteComponent, MngTemplateDirective, MngTemplatePipe, MngTopbarComponent, MngVersionComponent, MngViewContainerComponentService, ModelDescriptor, ModelUtil, NotificationUtil, ObjectSerializer, Permissions, RouteBuilder, RoutesBuilder, StringUtil, StylesUtil, TableDataProvider, TableDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewRouteBuilder, TableviewTypeEnum, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
11076
11371
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|