@mediusinc/mng-commons 0.12.5 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/api/utils/medius-rest.util.mjs +8 -3
- package/esm2020/lib/components/action/action.component.mjs +22 -9
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +6 -6
- package/esm2020/lib/components/action/models/action-execution.model.mjs +6 -1
- package/esm2020/lib/components/action/models/index.mjs +2 -1
- package/esm2020/lib/components/action/models/tableview-action-default-categories.model.mjs +11 -0
- 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 +11 -14
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +41 -18
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +5 -13
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +5 -2
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +5 -3
- package/esm2020/lib/components/tableview/table/table.component.mjs +48 -20
- package/esm2020/lib/components/tableview/tableview.component.mjs +9 -3
- package/esm2020/lib/data-providers/table.data-provider.mjs +9 -2
- package/esm2020/lib/data-providers/tableview.data-provider.mjs +30 -2
- package/esm2020/lib/descriptors/action/action-confirmation.descriptor.mjs +106 -0
- package/esm2020/lib/descriptors/action.descriptor.mjs +63 -154
- package/esm2020/lib/descriptors/button.descriptor.mjs +111 -0
- package/esm2020/lib/descriptors/column.descriptor.mjs +120 -27
- package/esm2020/lib/descriptors/editor.descriptor.mjs +109 -7
- package/esm2020/lib/descriptors/field.descriptor.mjs +38 -4
- package/esm2020/lib/descriptors/filter.descriptor.mjs +13 -6
- package/esm2020/lib/descriptors/index.mjs +3 -1
- package/esm2020/lib/descriptors/table.descriptor.mjs +282 -16
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +175 -3
- package/esm2020/lib/descriptors/types/table.type.mjs +10 -1
- package/esm2020/lib/mng-commons.module.mjs +24 -5
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/tableview-attr.model.mjs +2 -0
- package/esm2020/lib/pipes/class-map.pipe.mjs +22 -0
- package/esm2020/lib/pipes/getter.pipe.mjs +20 -0
- package/esm2020/lib/pipes/index.mjs +4 -1
- package/esm2020/lib/pipes/template.pipe.mjs +24 -0
- package/esm2020/lib/router/models/router.model.mjs +1 -1
- package/esm2020/lib/router/tableview-route-builder.mjs +41 -17
- 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/lib/utils/tableview.util.mjs +144 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/mediusinc-mng-commons.mjs +1610 -345
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +1590 -335
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/medius-rest.util.d.ts +1 -0
- package/lib/components/action/action.component.d.ts +2 -1
- package/lib/components/action/models/action-execution.model.d.ts +2 -0
- package/lib/components/action/models/index.d.ts +1 -0
- package/lib/components/action/models/tableview-action-default-categories.model.d.ts +10 -0
- 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 +10 -4
- package/lib/components/tableview/route/tableview-route.component.d.ts +0 -5
- package/lib/components/tableview/table/table.component.d.ts +4 -2
- package/lib/components/tableview/tableview.component.d.ts +3 -0
- package/lib/data-providers/table.data-provider.d.ts +6 -1
- package/lib/data-providers/tableview.data-provider.d.ts +16 -2
- package/lib/descriptors/action/action-confirmation.descriptor.d.ts +48 -0
- package/lib/descriptors/action.descriptor.d.ts +30 -83
- package/lib/descriptors/button.descriptor.d.ts +40 -0
- package/lib/descriptors/column.descriptor.d.ts +45 -5
- package/lib/descriptors/editor.descriptor.d.ts +69 -11
- package/lib/descriptors/field.descriptor.d.ts +16 -11
- package/lib/descriptors/filter.descriptor.d.ts +7 -6
- package/lib/descriptors/index.d.ts +2 -0
- package/lib/descriptors/table.descriptor.d.ts +124 -8
- package/lib/descriptors/tableview.descriptor.d.ts +81 -7
- package/lib/descriptors/types/table.type.d.ts +8 -0
- package/lib/mng-commons.module.d.ts +74 -70
- package/lib/models/index.d.ts +1 -0
- package/lib/models/tableview-attr.model.d.ts +9 -0
- package/lib/pipes/class-map.pipe.d.ts +7 -0
- package/lib/pipes/getter.pipe.d.ts +7 -0
- package/lib/pipes/index.d.ts +3 -0
- package/lib/pipes/template.pipe.d.ts +10 -0
- package/lib/router/models/router.model.d.ts +6 -0
- package/lib/router/tableview-route-builder.d.ts +3 -0
- package/lib/styles/button-style.builder.d.ts +43 -2
- package/lib/utils/tableview.util.d.ts +39 -0
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
- package/scss/mng-overrides/_theme_tableview.scss +17 -0
- package/version-info.json +5 -5
|
@@ -3,11 +3,11 @@ import { CommonModule } from '@angular/common';
|
|
|
3
3
|
import * as i1$3 from '@angular/common/http';
|
|
4
4
|
import { HttpErrorResponse, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, LOCALE_ID, ViewChildren, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
6
|
+
import { InjectionToken, Injectable, Pipe, Inject, EventEmitter, Component, ChangeDetectionStrategy, Optional, HostBinding, Input, Output, Directive, ContentChildren, ViewChild, forwardRef, LOCALE_ID, ViewChildren, inject, HostListener, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
7
7
|
import * as i2$1 from '@angular/forms';
|
|
8
8
|
import { Validators, FormGroup, FormArray, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
10
|
-
import { NavigationEnd, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
10
|
+
import { NavigationEnd, ActivatedRoute, GuardsCheckEnd, RouterModule } from '@angular/router';
|
|
11
11
|
import * as i2$2 from '@ngx-formly/core';
|
|
12
12
|
import { FieldWrapper, FieldType, FORMLY_CONFIG, FormlyModule } from '@ngx-formly/core';
|
|
13
13
|
import * as i1$2 from '@ngx-translate/core';
|
|
@@ -534,28 +534,63 @@ class TableDataProvider extends DataProvider {
|
|
|
534
534
|
constructor(modelType, serviceType) {
|
|
535
535
|
super(modelType, serviceType);
|
|
536
536
|
this._getAll = () => of(new MediusQueryResult());
|
|
537
|
+
this._getAllReloadSubject = new Subject();
|
|
537
538
|
}
|
|
538
539
|
get getAll() {
|
|
539
540
|
return this._getAll;
|
|
540
541
|
}
|
|
542
|
+
get getAllReload$() {
|
|
543
|
+
return this._getAllReloadSubject.asObservable();
|
|
544
|
+
}
|
|
541
545
|
withGetAll(getAll) {
|
|
542
546
|
this._getAll = getAll;
|
|
543
547
|
return this;
|
|
544
548
|
}
|
|
549
|
+
getAllReload(queryParam) {
|
|
550
|
+
this._getAllReloadSubject.next(queryParam);
|
|
551
|
+
}
|
|
545
552
|
}
|
|
546
553
|
|
|
547
554
|
class TableviewDataProvider extends EditorDataProvider {
|
|
548
555
|
constructor(modelType, serviceType) {
|
|
549
556
|
super(modelType, serviceType);
|
|
550
557
|
this._getAll = () => of(new MediusQueryResult());
|
|
558
|
+
this._getAllReloadSubject = new Subject();
|
|
551
559
|
}
|
|
552
560
|
get getAll() {
|
|
553
561
|
return this._getAll;
|
|
554
562
|
}
|
|
563
|
+
get getAllReload$() {
|
|
564
|
+
return this._getAllReloadSubject.asObservable();
|
|
565
|
+
}
|
|
566
|
+
withGetAll(getAll) {
|
|
567
|
+
this._getAll = getAll;
|
|
568
|
+
return this;
|
|
569
|
+
}
|
|
570
|
+
getAllReload(queryParam) {
|
|
571
|
+
this._getAllReloadSubject.next(queryParam);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
class DynamicTableviewDataProvider extends TableviewDataProvider {
|
|
575
|
+
constructor() {
|
|
576
|
+
super({});
|
|
577
|
+
this._getAll = () => of(new MediusQueryResult());
|
|
578
|
+
this._fetch = () => of({});
|
|
579
|
+
}
|
|
555
580
|
withGetAll(getAll) {
|
|
556
581
|
this._getAll = getAll;
|
|
557
582
|
return this;
|
|
558
583
|
}
|
|
584
|
+
withFetch(fetch) {
|
|
585
|
+
this._fetch = fetch;
|
|
586
|
+
return this;
|
|
587
|
+
}
|
|
588
|
+
get getAll() {
|
|
589
|
+
return this._getAll;
|
|
590
|
+
}
|
|
591
|
+
get fetch() {
|
|
592
|
+
return this._fetch;
|
|
593
|
+
}
|
|
559
594
|
}
|
|
560
595
|
|
|
561
596
|
class TableviewCrudDataProvider extends TableviewDataProvider {
|
|
@@ -853,6 +888,15 @@ var TableSizeEnum;
|
|
|
853
888
|
TableSizeEnum[TableSizeEnum["Normal"] = 1] = "Normal";
|
|
854
889
|
TableSizeEnum[TableSizeEnum["Large"] = 2] = "Large";
|
|
855
890
|
})(TableSizeEnum || (TableSizeEnum = {}));
|
|
891
|
+
/**
|
|
892
|
+
* EXCLUDE default, all columns has sort and filter on by default, developer EXCLUDES properties from sort/filter
|
|
893
|
+
* INCLUDE_ONLY only selected columns have sort/filter, developers INCLUDES properties
|
|
894
|
+
*/
|
|
895
|
+
var TableDynamicColumnsModeEnum;
|
|
896
|
+
(function (TableDynamicColumnsModeEnum) {
|
|
897
|
+
TableDynamicColumnsModeEnum[TableDynamicColumnsModeEnum["EXCLUDE"] = 0] = "EXCLUDE";
|
|
898
|
+
TableDynamicColumnsModeEnum[TableDynamicColumnsModeEnum["INCLUDE_ONLY"] = 1] = "INCLUDE_ONLY";
|
|
899
|
+
})(TableDynamicColumnsModeEnum || (TableDynamicColumnsModeEnum = {}));
|
|
856
900
|
|
|
857
901
|
class StylesUtil {
|
|
858
902
|
static calculateTableColumnActionWidth(table, actions) {
|
|
@@ -871,7 +915,7 @@ class StylesUtil {
|
|
|
871
915
|
}
|
|
872
916
|
}
|
|
873
917
|
static getActionButtonRoundedWidth(action) {
|
|
874
|
-
switch (action.size) {
|
|
918
|
+
switch (action.buttonDescriptor.styleClass.size) {
|
|
875
919
|
case ActionSizeEnum.ExtraSmall:
|
|
876
920
|
return StylesUtil.BUTTON_ROUNDED_WIDTH_XS;
|
|
877
921
|
case ActionSizeEnum.Small:
|
|
@@ -895,17 +939,18 @@ StylesUtil.TABLE_CELL_PADDING_X_SM = 4;
|
|
|
895
939
|
StylesUtil.TABLE_CELL_PADDING_X_LG = 12;
|
|
896
940
|
|
|
897
941
|
class ButtonStyleBuilder {
|
|
898
|
-
constructor(level, customClass) {
|
|
942
|
+
constructor(level = ActionLevelEnum.Default, customClass) {
|
|
899
943
|
this._size = ActionSizeEnum.Normal;
|
|
900
944
|
this._textButton = false;
|
|
901
945
|
this._outlineButton = false;
|
|
902
946
|
this._raisedButton = false;
|
|
947
|
+
this._roundedStyle = ButtonStyleRoundedEnum.DEFAULT;
|
|
903
948
|
this._actionLevel = level;
|
|
904
949
|
this._customClass = customClass;
|
|
905
950
|
}
|
|
906
951
|
getButtonClass(hasNoTitle = false) {
|
|
907
952
|
const styles = [this.convertActionLevelToStyleClass(), this.convertSizeToStyleClass(), this._customClass];
|
|
908
|
-
if (hasNoTitle) {
|
|
953
|
+
if (hasNoTitle && this._roundedStyle === ButtonStyleRoundedEnum.DEFAULT) {
|
|
909
954
|
styles.push(`p-button-rounded mng-action-button-icon`);
|
|
910
955
|
}
|
|
911
956
|
if (this._textButton) {
|
|
@@ -917,37 +962,78 @@ class ButtonStyleBuilder {
|
|
|
917
962
|
if (this._raisedButton) {
|
|
918
963
|
styles.push(`p-button-raised`);
|
|
919
964
|
}
|
|
965
|
+
if (this._roundedStyle === ButtonStyleRoundedEnum.ROUNDED) {
|
|
966
|
+
styles.push('p-button-rounded');
|
|
967
|
+
}
|
|
920
968
|
return styles.join(' ');
|
|
921
969
|
}
|
|
922
|
-
|
|
970
|
+
/**
|
|
971
|
+
* creates instance of style builder with custom properties
|
|
972
|
+
* @param actionLevel ActionLevelEnum
|
|
973
|
+
* @param size ActionSizeEnum
|
|
974
|
+
* @param textButton if true, text button will be applied
|
|
975
|
+
* @param outlineButton if true, outlined button will be applied
|
|
976
|
+
* @param raisedButton if true, raised button will be applied
|
|
977
|
+
* @param customClass additional custom classes (will be added at generating)
|
|
978
|
+
*/
|
|
979
|
+
create(actionLevel, size, textButton, outlineButton, raisedButton, roundedButton, customClass) {
|
|
923
980
|
this._actionLevel = actionLevel !== null && actionLevel !== void 0 ? actionLevel : this._actionLevel;
|
|
924
981
|
this._size = size !== null && size !== void 0 ? size : this._size;
|
|
925
982
|
this._textButton = textButton !== null && textButton !== void 0 ? textButton : this._textButton;
|
|
926
983
|
this._outlineButton = outlineButton !== null && outlineButton !== void 0 ? outlineButton : this._outlineButton;
|
|
927
984
|
this._raisedButton = raisedButton !== null && raisedButton !== void 0 ? raisedButton : this._raisedButton;
|
|
985
|
+
this._roundedStyle = roundedButton !== null && roundedButton !== void 0 ? roundedButton : this._roundedStyle;
|
|
928
986
|
this._customClass = customClass;
|
|
929
987
|
return this;
|
|
930
988
|
}
|
|
989
|
+
/**
|
|
990
|
+
* sets custom action level and returns this object
|
|
991
|
+
* @param actionLevel
|
|
992
|
+
*/
|
|
931
993
|
withActionLevel(actionLevel) {
|
|
932
994
|
this._actionLevel = actionLevel;
|
|
933
995
|
return this;
|
|
934
996
|
}
|
|
997
|
+
/**
|
|
998
|
+
* sets custom size and return this object
|
|
999
|
+
* @param size
|
|
1000
|
+
*/
|
|
935
1001
|
withSize(size) {
|
|
936
1002
|
this._size = size;
|
|
937
1003
|
return this;
|
|
938
1004
|
}
|
|
1005
|
+
/**
|
|
1006
|
+
* sets text button property
|
|
1007
|
+
* @param withText default true
|
|
1008
|
+
*/
|
|
939
1009
|
withTextButton(withText = true) {
|
|
940
1010
|
this._textButton = withText;
|
|
941
1011
|
return this;
|
|
942
1012
|
}
|
|
1013
|
+
/**
|
|
1014
|
+
* sets outline button property
|
|
1015
|
+
* @param withOutline default true
|
|
1016
|
+
*/
|
|
943
1017
|
withOutlineButton(withOutline = true) {
|
|
944
1018
|
this._outlineButton = withOutline;
|
|
945
1019
|
return this;
|
|
946
1020
|
}
|
|
1021
|
+
/**
|
|
1022
|
+
* sets raised button property
|
|
1023
|
+
* @param withRaised default true
|
|
1024
|
+
*/
|
|
947
1025
|
withRaisedButton(withRaised = true) {
|
|
948
1026
|
this._raisedButton = withRaised;
|
|
949
1027
|
return this;
|
|
950
1028
|
}
|
|
1029
|
+
withRoundedButton(roundedStyle = ButtonStyleRoundedEnum.ROUNDED) {
|
|
1030
|
+
this._roundedStyle = roundedStyle;
|
|
1031
|
+
return this;
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* sets custom style class
|
|
1035
|
+
* @param customClass
|
|
1036
|
+
*/
|
|
951
1037
|
withCustomClass(customClass) {
|
|
952
1038
|
this._customClass = customClass;
|
|
953
1039
|
return this;
|
|
@@ -974,15 +1060,15 @@ class ButtonStyleBuilder {
|
|
|
974
1060
|
convertSizeToStyleClass() {
|
|
975
1061
|
switch (this._size) {
|
|
976
1062
|
case ActionSizeEnum.ExtraSmall:
|
|
977
|
-
return 'mng-button-xs';
|
|
1063
|
+
return 'p-button-sm mng-button-xs';
|
|
978
1064
|
case ActionSizeEnum.Small:
|
|
979
|
-
return 'mng-button-sm';
|
|
1065
|
+
return 'p-button-sm mng-button-sm';
|
|
980
1066
|
case ActionSizeEnum.Normal:
|
|
981
1067
|
return '';
|
|
982
1068
|
case ActionSizeEnum.Large:
|
|
983
|
-
return 'mng-button-lg';
|
|
1069
|
+
return 'p-button-lg mng-button-lg';
|
|
984
1070
|
case ActionSizeEnum.ExtraLarge:
|
|
985
|
-
return 'mng-button-xl';
|
|
1071
|
+
return 'p-button-lg mng-button-xl';
|
|
986
1072
|
}
|
|
987
1073
|
}
|
|
988
1074
|
get actionLevel() {
|
|
@@ -1000,10 +1086,123 @@ class ButtonStyleBuilder {
|
|
|
1000
1086
|
get raisedButton() {
|
|
1001
1087
|
return this._raisedButton;
|
|
1002
1088
|
}
|
|
1089
|
+
get roundedStyle() {
|
|
1090
|
+
return this._roundedStyle;
|
|
1091
|
+
}
|
|
1003
1092
|
get customClass() {
|
|
1004
1093
|
return this._customClass;
|
|
1005
1094
|
}
|
|
1006
1095
|
}
|
|
1096
|
+
var ButtonStyleRoundedEnum;
|
|
1097
|
+
(function (ButtonStyleRoundedEnum) {
|
|
1098
|
+
ButtonStyleRoundedEnum[ButtonStyleRoundedEnum["DEFAULT"] = 0] = "DEFAULT";
|
|
1099
|
+
ButtonStyleRoundedEnum[ButtonStyleRoundedEnum["ROUNDED"] = 1] = "ROUNDED";
|
|
1100
|
+
ButtonStyleRoundedEnum[ButtonStyleRoundedEnum["SQUARE"] = 2] = "SQUARE";
|
|
1101
|
+
})(ButtonStyleRoundedEnum || (ButtonStyleRoundedEnum = {}));
|
|
1102
|
+
|
|
1103
|
+
class ActionConfirmationDialogDescriptor {
|
|
1104
|
+
constructor() {
|
|
1105
|
+
this._closeOnEscape = true; // Defines if dialog closes when esc key is pressed.
|
|
1106
|
+
this._closable = true; // Defines if dialog is closable.
|
|
1107
|
+
this._acceptButtonStyle = new ButtonStyleBuilder(ActionLevelEnum.Default);
|
|
1108
|
+
this._rejectButtonStyle = new ButtonStyleBuilder(ActionLevelEnum.Default).withTextButton();
|
|
1109
|
+
this._icon = 'pi pi-exclamation-triangle';
|
|
1110
|
+
this._acceptIcon = 'pi pi-check';
|
|
1111
|
+
this._rejectIcon = 'pi pi-times';
|
|
1112
|
+
}
|
|
1113
|
+
withIcon(icon) {
|
|
1114
|
+
this._icon = icon;
|
|
1115
|
+
return this;
|
|
1116
|
+
}
|
|
1117
|
+
withTitle(title) {
|
|
1118
|
+
this._title = title;
|
|
1119
|
+
return this;
|
|
1120
|
+
}
|
|
1121
|
+
withMessage(message) {
|
|
1122
|
+
this._message = message;
|
|
1123
|
+
return this;
|
|
1124
|
+
}
|
|
1125
|
+
withAcceptLabel(acceptLabel) {
|
|
1126
|
+
this._acceptLabel = acceptLabel;
|
|
1127
|
+
return this;
|
|
1128
|
+
}
|
|
1129
|
+
withAcceptIcon(acceptIcon) {
|
|
1130
|
+
this._acceptIcon = acceptIcon;
|
|
1131
|
+
return this;
|
|
1132
|
+
}
|
|
1133
|
+
withAcceptButtonStyle(buttonStyle) {
|
|
1134
|
+
this._acceptButtonStyle = buttonStyle;
|
|
1135
|
+
return this;
|
|
1136
|
+
}
|
|
1137
|
+
withRejectLabel(rejectLabel) {
|
|
1138
|
+
this._rejectLabel = rejectLabel;
|
|
1139
|
+
return this;
|
|
1140
|
+
}
|
|
1141
|
+
withRejectIcon(rejectIcon) {
|
|
1142
|
+
this._rejectIcon = rejectIcon;
|
|
1143
|
+
return this;
|
|
1144
|
+
}
|
|
1145
|
+
withRejectButtonStyle(buttonStyle) {
|
|
1146
|
+
this._rejectButtonStyle = buttonStyle;
|
|
1147
|
+
return this;
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* set if dialog can be closed on escaped pressed
|
|
1151
|
+
* if true, then closable is also set to true
|
|
1152
|
+
* @param closeOnEscape
|
|
1153
|
+
*/
|
|
1154
|
+
withCloseOnEscape(closeOnEscape) {
|
|
1155
|
+
if (closeOnEscape) {
|
|
1156
|
+
this._closable = true;
|
|
1157
|
+
}
|
|
1158
|
+
this._closeOnEscape = closeOnEscape;
|
|
1159
|
+
return this;
|
|
1160
|
+
}
|
|
1161
|
+
withClosable(closable) {
|
|
1162
|
+
this._closable = closable;
|
|
1163
|
+
return this;
|
|
1164
|
+
}
|
|
1165
|
+
withRunConfirmationConfigMapFn(runConfirmationConfigMapFn) {
|
|
1166
|
+
this._runConfirmationConfigMapFn = runConfirmationConfigMapFn;
|
|
1167
|
+
return this;
|
|
1168
|
+
}
|
|
1169
|
+
get icon() {
|
|
1170
|
+
return this._icon;
|
|
1171
|
+
}
|
|
1172
|
+
get title() {
|
|
1173
|
+
return this._title;
|
|
1174
|
+
}
|
|
1175
|
+
get message() {
|
|
1176
|
+
return this._message;
|
|
1177
|
+
}
|
|
1178
|
+
get acceptLabel() {
|
|
1179
|
+
return this._acceptLabel;
|
|
1180
|
+
}
|
|
1181
|
+
get acceptIcon() {
|
|
1182
|
+
return this._acceptIcon;
|
|
1183
|
+
}
|
|
1184
|
+
get acceptButtonStyle() {
|
|
1185
|
+
return this._acceptButtonStyle;
|
|
1186
|
+
}
|
|
1187
|
+
get rejectLabel() {
|
|
1188
|
+
return this._rejectLabel;
|
|
1189
|
+
}
|
|
1190
|
+
get rejectIcon() {
|
|
1191
|
+
return this._rejectIcon;
|
|
1192
|
+
}
|
|
1193
|
+
get rejectButtonStyle() {
|
|
1194
|
+
return this._rejectButtonStyle;
|
|
1195
|
+
}
|
|
1196
|
+
get closeOnEscape() {
|
|
1197
|
+
return this._closeOnEscape;
|
|
1198
|
+
}
|
|
1199
|
+
get closable() {
|
|
1200
|
+
return this._closable;
|
|
1201
|
+
}
|
|
1202
|
+
get runConfirmationConfigMapFn() {
|
|
1203
|
+
return this._runConfirmationConfigMapFn;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1007
1206
|
|
|
1008
1207
|
class ActionDescriptor {
|
|
1009
1208
|
constructor(model, actionName, parentType, parentProperty) {
|
|
@@ -1012,10 +1211,12 @@ class ActionDescriptor {
|
|
|
1012
1211
|
this._position = ActionPositionEnum.ToolbarRight;
|
|
1013
1212
|
this._level = ActionLevelEnum.Default;
|
|
1014
1213
|
this._routeUrl = null;
|
|
1015
|
-
this._buttonStyle = new ButtonStyleBuilder(this._level);
|
|
1016
|
-
this._hasRunConfirmation = false;
|
|
1017
1214
|
this._hasRunNotificationSuccess = true;
|
|
1018
1215
|
this._hasRunNotificationError = true;
|
|
1216
|
+
//button
|
|
1217
|
+
this._buttonDescriptor = new ButtonDescriptor();
|
|
1218
|
+
// multiple row selection
|
|
1219
|
+
this._hasItemsSelection = false;
|
|
1019
1220
|
this._model = model;
|
|
1020
1221
|
this._actionName = actionName;
|
|
1021
1222
|
if ((parentType && !parentProperty) || (!parentProperty && parentProperty)) {
|
|
@@ -1064,15 +1265,6 @@ class ActionDescriptor {
|
|
|
1064
1265
|
get routeUrl() {
|
|
1065
1266
|
return this._routeUrl;
|
|
1066
1267
|
}
|
|
1067
|
-
get title() {
|
|
1068
|
-
return this._title;
|
|
1069
|
-
}
|
|
1070
|
-
get icon() {
|
|
1071
|
-
return this._icon;
|
|
1072
|
-
}
|
|
1073
|
-
get tooltip() {
|
|
1074
|
-
return this._tooltip;
|
|
1075
|
-
}
|
|
1076
1268
|
get dataProvider() {
|
|
1077
1269
|
return this._dataProvider;
|
|
1078
1270
|
}
|
|
@@ -1097,83 +1289,14 @@ class ActionDescriptor {
|
|
|
1097
1289
|
get actionNameLong() {
|
|
1098
1290
|
return this._actionNameLong;
|
|
1099
1291
|
}
|
|
1100
|
-
get buttonStyle() {
|
|
1101
|
-
return this._buttonStyle;
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* @deprecated use _buttonStyle instead
|
|
1105
|
-
*/
|
|
1106
1292
|
get className() {
|
|
1107
|
-
return this.
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* @deprecated use _buttonStyle instead
|
|
1111
|
-
*/
|
|
1112
|
-
get isStyleText() {
|
|
1113
|
-
return this._buttonStyle.textButton;
|
|
1114
|
-
}
|
|
1115
|
-
/**
|
|
1116
|
-
* @deprecated use _buttonStyle instead
|
|
1117
|
-
*/
|
|
1118
|
-
get isStyleOutlined() {
|
|
1119
|
-
return this._buttonStyle.outlineButton;
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* @deprecated use _buttonStyle instead
|
|
1123
|
-
*/
|
|
1124
|
-
get isStyleRaised() {
|
|
1125
|
-
return this._buttonStyle.raisedButton;
|
|
1293
|
+
return this.buttonDescriptor.styleClass.customClass;
|
|
1126
1294
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
*/
|
|
1130
|
-
get size() {
|
|
1131
|
-
return this._buttonStyle.size;
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* @deprecated use _buttonStyle instead
|
|
1135
|
-
*/
|
|
1136
|
-
get isSizeExtraSmall() {
|
|
1137
|
-
return this._buttonStyle.size === ActionSizeEnum.ExtraSmall;
|
|
1138
|
-
}
|
|
1139
|
-
/**
|
|
1140
|
-
* @deprecated use _buttonStyle instead
|
|
1141
|
-
*/
|
|
1142
|
-
get isSizeSmall() {
|
|
1143
|
-
return this._buttonStyle.size === ActionSizeEnum.Small;
|
|
1144
|
-
}
|
|
1145
|
-
/**
|
|
1146
|
-
* @deprecated use _buttonStyle instead
|
|
1147
|
-
*/
|
|
1148
|
-
get isSizeLarge() {
|
|
1149
|
-
return this._buttonStyle.size === ActionSizeEnum.Large;
|
|
1150
|
-
}
|
|
1151
|
-
/**
|
|
1152
|
-
* @deprecated use _buttonStyle instead
|
|
1153
|
-
*/
|
|
1154
|
-
get isSizeExtraLarge() {
|
|
1155
|
-
return this._buttonStyle.size === ActionSizeEnum.ExtraLarge;
|
|
1295
|
+
get runConfirmationDialogDescriptor() {
|
|
1296
|
+
return this._runConfirmationDialogDescriptor;
|
|
1156
1297
|
}
|
|
1157
1298
|
get hasRunConfirmation() {
|
|
1158
|
-
return this.
|
|
1159
|
-
}
|
|
1160
|
-
get runConfirmationIcon() {
|
|
1161
|
-
return this._runConfirmationIcon;
|
|
1162
|
-
}
|
|
1163
|
-
get runConfirmationTitle() {
|
|
1164
|
-
return this._runConfirmationTitle;
|
|
1165
|
-
}
|
|
1166
|
-
get runConfirmationMessage() {
|
|
1167
|
-
return this._runConfirmationMessage;
|
|
1168
|
-
}
|
|
1169
|
-
get runConfirmationAcceptTitle() {
|
|
1170
|
-
return this._runConfirmationAcceptTitle;
|
|
1171
|
-
}
|
|
1172
|
-
get runConfirmationRejectTitle() {
|
|
1173
|
-
return this._runConfirmationRejectTitle;
|
|
1174
|
-
}
|
|
1175
|
-
get runConfirmationConfigMapFn() {
|
|
1176
|
-
return this._runConfirmationConfigMapFn;
|
|
1299
|
+
return this._runConfirmationDialogDescriptor !== null && this._runConfirmationDialogDescriptor !== undefined;
|
|
1177
1300
|
}
|
|
1178
1301
|
get hasRunNotificationSuccess() {
|
|
1179
1302
|
return this._hasRunNotificationSuccess;
|
|
@@ -1205,6 +1328,12 @@ class ActionDescriptor {
|
|
|
1205
1328
|
get permissionsRouteType() {
|
|
1206
1329
|
return this._permissionsRouteType;
|
|
1207
1330
|
}
|
|
1331
|
+
get hasItemsSelection() {
|
|
1332
|
+
return this._hasItemsSelection;
|
|
1333
|
+
}
|
|
1334
|
+
get buttonDescriptor() {
|
|
1335
|
+
return this._buttonDescriptor;
|
|
1336
|
+
}
|
|
1208
1337
|
withDataProvider(dataProvider) {
|
|
1209
1338
|
this._dataProvider = dataProvider;
|
|
1210
1339
|
return this;
|
|
@@ -1233,70 +1362,25 @@ class ActionDescriptor {
|
|
|
1233
1362
|
this._routeUrl = routeUrl;
|
|
1234
1363
|
return this;
|
|
1235
1364
|
}
|
|
1236
|
-
|
|
1237
|
-
this.
|
|
1238
|
-
this._buttonStyle = this._buttonStyle.withActionLevel(level);
|
|
1239
|
-
return this;
|
|
1240
|
-
}
|
|
1241
|
-
/**
|
|
1242
|
-
* Overrides default title key with model action key (${model.typeName}.actions.${actionName}). Not relevant if parentType name is provided.
|
|
1243
|
-
*/
|
|
1244
|
-
withModelTitle() {
|
|
1245
|
-
this._title = `${this._i18nModelActionBaseKey}.title`;
|
|
1365
|
+
withPosition(position) {
|
|
1366
|
+
this._position = position;
|
|
1246
1367
|
return this;
|
|
1247
1368
|
}
|
|
1248
1369
|
/**
|
|
1249
|
-
*
|
|
1250
|
-
* @param title Title i18n key or title.
|
|
1370
|
+
* creates confirmation action with default style based on action descriptor
|
|
1251
1371
|
*/
|
|
1252
|
-
|
|
1253
|
-
this.
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
this._icon = icon;
|
|
1258
|
-
return this;
|
|
1259
|
-
}
|
|
1260
|
-
withTooltip(tooltip) {
|
|
1261
|
-
this._tooltip = tooltip;
|
|
1262
|
-
return this;
|
|
1263
|
-
}
|
|
1264
|
-
withClassName(className) {
|
|
1265
|
-
this._buttonStyle = this._buttonStyle.withCustomClass(className);
|
|
1266
|
-
return this;
|
|
1267
|
-
}
|
|
1268
|
-
withSize(size = ActionSizeEnum.Normal) {
|
|
1269
|
-
this._buttonStyle = this._buttonStyle.withSize(size);
|
|
1270
|
-
return this;
|
|
1271
|
-
}
|
|
1272
|
-
withStyle(styleText = false, styleOutlined = false, styleRaised = false) {
|
|
1273
|
-
this._buttonStyle = this._buttonStyle.withOutlineButton(styleOutlined);
|
|
1274
|
-
this._buttonStyle = this._buttonStyle.withRaisedButton(styleRaised);
|
|
1275
|
-
this._buttonStyle = this._buttonStyle.withTextButton(styleText);
|
|
1276
|
-
return this;
|
|
1277
|
-
}
|
|
1278
|
-
withPosition(position) {
|
|
1279
|
-
this._position = position;
|
|
1280
|
-
return this;
|
|
1372
|
+
withRunConfirmation() {
|
|
1373
|
+
this._runConfirmationDialogDescriptor = new ActionConfirmationDialogDescriptor();
|
|
1374
|
+
this._runConfirmationDialogDescriptor.acceptButtonStyle.withActionLevel(this._level);
|
|
1375
|
+
this._runConfirmationDialogDescriptor.rejectButtonStyle.withActionLevel(this._level);
|
|
1376
|
+
return this._runConfirmationDialogDescriptor;
|
|
1281
1377
|
}
|
|
1282
1378
|
/**
|
|
1283
|
-
* Add a
|
|
1284
|
-
* @param
|
|
1285
|
-
* @param title the title of the confirmation dialogue
|
|
1286
|
-
* @param message the message on the confirmation dialogue
|
|
1287
|
-
* @param acceptTitle the title of the accepting button
|
|
1288
|
-
* @param rejectTitle the title of the rejecting button
|
|
1289
|
-
* @param runConfirmationConfigMapFn function used to generate the confirmation dialogue. **WARNING** changing the *accept* and *reject* methods of the *confirmConfig* parameter
|
|
1290
|
-
* may lead to unexpected behaviour
|
|
1379
|
+
* Add a configuration dialogue to action using ActionConfigurationDescriptor
|
|
1380
|
+
* @param confirmationDescriptor descriptor with customizable information for dialog
|
|
1291
1381
|
*/
|
|
1292
|
-
|
|
1293
|
-
this.
|
|
1294
|
-
this._runConfirmationIcon = icon;
|
|
1295
|
-
this._runConfirmationTitle = title;
|
|
1296
|
-
this._runConfirmationMessage = message;
|
|
1297
|
-
this._runConfirmationAcceptTitle = acceptTitle;
|
|
1298
|
-
this._runConfirmationRejectTitle = rejectTitle;
|
|
1299
|
-
this._runConfirmationConfigMapFn = runConfirmationConfigMapFn;
|
|
1382
|
+
withRunConfirmationDescriptor(runConfirmationDialogDescriptor) {
|
|
1383
|
+
this._runConfirmationDialogDescriptor = runConfirmationDialogDescriptor;
|
|
1300
1384
|
return this;
|
|
1301
1385
|
}
|
|
1302
1386
|
withRunNotificationSuccess(title, message, hasNotification = true) {
|
|
@@ -1330,6 +1414,16 @@ class ActionDescriptor {
|
|
|
1330
1414
|
this._permissionsRouteType = permissionsRouteType;
|
|
1331
1415
|
return this;
|
|
1332
1416
|
}
|
|
1417
|
+
withButtonDescriptor(buttonDescriptor) {
|
|
1418
|
+
this._buttonDescriptor = buttonDescriptor;
|
|
1419
|
+
return this;
|
|
1420
|
+
}
|
|
1421
|
+
withItemsSelection(hasSelection = true) {
|
|
1422
|
+
var _a;
|
|
1423
|
+
this._hasItemsSelection = hasSelection;
|
|
1424
|
+
this._isEnabledFunction = (_a = this._isEnabledFunction) !== null && _a !== void 0 ? _a : (ctx => { var _a, _b; return of(((_b = (_a = ctx.parameters.selectedItems) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0); });
|
|
1425
|
+
return this;
|
|
1426
|
+
}
|
|
1333
1427
|
}
|
|
1334
1428
|
class ActionSimpleDescriptor extends ActionDescriptor {
|
|
1335
1429
|
constructor(actionName, modelType, idProperty, titleProperty) {
|
|
@@ -1346,7 +1440,7 @@ class ActionEditorDescriptor extends ActionDescriptor {
|
|
|
1346
1440
|
this._dialogSize = ActionEditorDialogSizeEnum.Normal;
|
|
1347
1441
|
this._type = ActionTypeEnum.Editor;
|
|
1348
1442
|
this._editorDescriptor = editorDescriptor;
|
|
1349
|
-
this._editorActions.push(
|
|
1443
|
+
this._editorActions.push(ActionEditorSubmitDescriptor.forPrimary(this), ActionEditorSubmitDescriptor.forSecondary(this));
|
|
1350
1444
|
}
|
|
1351
1445
|
get editorTitle() {
|
|
1352
1446
|
return this._editorTitle;
|
|
@@ -1453,7 +1547,23 @@ class ActionEditorSubmitDescriptor extends ActionDescriptor {
|
|
|
1453
1547
|
this._editorAction = editorAction;
|
|
1454
1548
|
this._submitType = submitType;
|
|
1455
1549
|
this._position = ActionPositionEnum.FooterRight;
|
|
1456
|
-
this.
|
|
1550
|
+
this.buttonDescriptor.styleClass.withActionLevel(editorAction.level).withTextButton();
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* creates primary action with primary button style
|
|
1554
|
+
* @param editorAction
|
|
1555
|
+
* @param submitType
|
|
1556
|
+
*/
|
|
1557
|
+
static forPrimary(editorAction, submitType = ActionEditorSubmitTypeEnum.Submit) {
|
|
1558
|
+
return new ActionEditorSubmitDescriptor(editorAction, submitType).withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder()));
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* creates secondary button with text button style
|
|
1562
|
+
* @param editorAction
|
|
1563
|
+
* @param submitType
|
|
1564
|
+
*/
|
|
1565
|
+
static forSecondary(editorAction, submitType = ActionEditorSubmitTypeEnum.Cancel) {
|
|
1566
|
+
return new ActionEditorSubmitDescriptor(editorAction, submitType).withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withTextButton()));
|
|
1457
1567
|
}
|
|
1458
1568
|
get submitType() {
|
|
1459
1569
|
return this._submitType;
|
|
@@ -1487,8 +1597,8 @@ class ActionEditorAddDescriptor extends ActionEditorDescriptor {
|
|
|
1487
1597
|
this.withPosition(ActionPositionEnum.ToolbarLeft);
|
|
1488
1598
|
this.withRouteTrigger('add');
|
|
1489
1599
|
this.withSubmitFunction(ActionDataProviderUtil.runCreateOrFail);
|
|
1490
|
-
this.
|
|
1491
|
-
this.withIcon('pi pi-plus');
|
|
1600
|
+
this.buttonDescriptor.styleClass.withActionLevel(ActionLevelEnum.Success);
|
|
1601
|
+
this.buttonDescriptor.withIcon('pi pi-plus');
|
|
1492
1602
|
this.withPermissionsRouteType(Permissions.ActionTypes.ADD);
|
|
1493
1603
|
}
|
|
1494
1604
|
withServiceType(serviceType) {
|
|
@@ -1511,12 +1621,11 @@ class ActionEditorEditDescriptor extends ActionEditorDescriptor {
|
|
|
1511
1621
|
constructor(editorDescriptor) {
|
|
1512
1622
|
super(editorDescriptor, ActionEditorEditDescriptor.ACTION_NAME);
|
|
1513
1623
|
this.withPosition(ActionPositionEnum.RowInline);
|
|
1514
|
-
this.withTitle(null);
|
|
1515
1624
|
this.withRouteTrigger(':itemId/edit');
|
|
1516
1625
|
this.withFetchFunction(ActionDataProviderUtil.runFetchOrFail);
|
|
1517
1626
|
this.withSubmitFunction(ActionDataProviderUtil.runUpdateOrFail);
|
|
1518
|
-
this.withIcon('pi pi-pencil');
|
|
1519
1627
|
this.withPermissionsRouteType(Permissions.ActionTypes.EDIT);
|
|
1628
|
+
this.buttonDescriptor.withLabel(null).withIcon('pi pi-pencil');
|
|
1520
1629
|
}
|
|
1521
1630
|
withServiceType(serviceType) {
|
|
1522
1631
|
return this.withServiceSubmitFunction(serviceType);
|
|
@@ -1538,12 +1647,11 @@ class ActionDeleteDescriptor extends ActionDescriptor {
|
|
|
1538
1647
|
constructor(model) {
|
|
1539
1648
|
super(model, ActionDeleteDescriptor.ACTION_NAME);
|
|
1540
1649
|
this.withPosition(ActionPositionEnum.RowInline);
|
|
1541
|
-
this.withTitle(null);
|
|
1542
1650
|
this.withRunFunction(ActionDataProviderUtil.runDeleteOrFail);
|
|
1543
|
-
this.
|
|
1544
|
-
this.
|
|
1545
|
-
this.withRunConfirmation(undefined);
|
|
1651
|
+
this.buttonDescriptor.styleClass.withActionLevel(ActionLevelEnum.Danger);
|
|
1652
|
+
this.withRunConfirmation();
|
|
1546
1653
|
this.withPermissionsRouteType(Permissions.ActionTypes.DELETE);
|
|
1654
|
+
this.buttonDescriptor.withLabel(null).withIcon('pi pi-trash');
|
|
1547
1655
|
}
|
|
1548
1656
|
withServiceType(serviceType) {
|
|
1549
1657
|
return this.withServiceDeleteFunction(serviceType);
|
|
@@ -1615,11 +1723,152 @@ class ActionLinkDescriptor extends ActionDescriptor {
|
|
|
1615
1723
|
}
|
|
1616
1724
|
}
|
|
1617
1725
|
|
|
1726
|
+
class TableviewUtil {
|
|
1727
|
+
/**
|
|
1728
|
+
* returns attributes from class type and extends to typed def with column and field enum type
|
|
1729
|
+
* @param modelType class type
|
|
1730
|
+
*/
|
|
1731
|
+
static getAttributeDefMap(modelType) {
|
|
1732
|
+
return TableviewUtil.expandAttributeDefWithTableviewTypes(ObjectSerializer.get().findAttributesDefinitionByClassType(modelType));
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* expands AttributeDef to TableviewAttributeDef with defined input and column enum type
|
|
1736
|
+
* @param attributes open api specification model
|
|
1737
|
+
*/
|
|
1738
|
+
static expandAttributeDefWithTableviewTypes(attributes) {
|
|
1739
|
+
if (attributes == null) {
|
|
1740
|
+
throw new Error('AttributeDef is null, problem with ObjectSerializer::findAttributesDefinitionByClassType?');
|
|
1741
|
+
}
|
|
1742
|
+
const objectSerializer = ObjectSerializer.get();
|
|
1743
|
+
const tableviewAttributeDef = [];
|
|
1744
|
+
for (const attribute of attributes) {
|
|
1745
|
+
const enumType = objectSerializer.findEnum(attribute.type);
|
|
1746
|
+
tableviewAttributeDef.push({
|
|
1747
|
+
name: attribute.name,
|
|
1748
|
+
baseName: attribute.baseName,
|
|
1749
|
+
type: attribute.type,
|
|
1750
|
+
columnType: enumType ? ColumnTypeEnum.Enum : TableviewUtil.toColumnType(attribute.type),
|
|
1751
|
+
fieldType: TableviewUtil.toFieldInputType(attribute.type),
|
|
1752
|
+
enumType: objectSerializer.findEnum(attribute.type),
|
|
1753
|
+
classType: objectSerializer.findType(attribute.type)
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
return tableviewAttributeDef;
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* converts column to number or date on value based
|
|
1760
|
+
* @param column column to be transformed
|
|
1761
|
+
* @param value value to check if applicable
|
|
1762
|
+
*/
|
|
1763
|
+
static stringColumnConverter(column, value) {
|
|
1764
|
+
if (typeof value === 'boolean') {
|
|
1765
|
+
return column.asBoolean();
|
|
1766
|
+
}
|
|
1767
|
+
else if (!isNaN(value) && typeof value === 'number') {
|
|
1768
|
+
return column.asNumber();
|
|
1769
|
+
}
|
|
1770
|
+
else if (this._dateRegex.test(value)) {
|
|
1771
|
+
return column.asDate();
|
|
1772
|
+
}
|
|
1773
|
+
else {
|
|
1774
|
+
return column;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* converts string type to column type enum, default is string
|
|
1779
|
+
* @param property
|
|
1780
|
+
*/
|
|
1781
|
+
static toColumnType(property) {
|
|
1782
|
+
const os = ObjectSerializer.get();
|
|
1783
|
+
if (os.findEnum(property)) {
|
|
1784
|
+
property = 'enum';
|
|
1785
|
+
}
|
|
1786
|
+
else if (os.findType(property)) {
|
|
1787
|
+
property = 'class';
|
|
1788
|
+
}
|
|
1789
|
+
switch (property) {
|
|
1790
|
+
case 'number':
|
|
1791
|
+
return ColumnTypeEnum.Number;
|
|
1792
|
+
case 'currency':
|
|
1793
|
+
return ColumnTypeEnum.Currency;
|
|
1794
|
+
case 'boolean':
|
|
1795
|
+
return ColumnTypeEnum.Boolean;
|
|
1796
|
+
case 'date':
|
|
1797
|
+
return ColumnTypeEnum.Date;
|
|
1798
|
+
case 'enum':
|
|
1799
|
+
return ColumnTypeEnum.Enum;
|
|
1800
|
+
case 'custom':
|
|
1801
|
+
return ColumnTypeEnum.Custom;
|
|
1802
|
+
case 'class':
|
|
1803
|
+
return ColumnTypeEnum.String;
|
|
1804
|
+
case 'string':
|
|
1805
|
+
default:
|
|
1806
|
+
return ColumnTypeEnum.String;
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* converts string type to type enum, default is text
|
|
1811
|
+
* @param property
|
|
1812
|
+
*/
|
|
1813
|
+
static toFieldInputType(property) {
|
|
1814
|
+
switch (property) {
|
|
1815
|
+
case 'hidden':
|
|
1816
|
+
return FieldInputTypeEnum.Hidden;
|
|
1817
|
+
case 'label':
|
|
1818
|
+
return FieldInputTypeEnum.Label;
|
|
1819
|
+
case 'textarea':
|
|
1820
|
+
return FieldInputTypeEnum.Textarea;
|
|
1821
|
+
case 'number':
|
|
1822
|
+
return FieldInputTypeEnum.Number;
|
|
1823
|
+
case 'currency':
|
|
1824
|
+
return FieldInputTypeEnum.Currency;
|
|
1825
|
+
case 'switch':
|
|
1826
|
+
case 'boolean':
|
|
1827
|
+
return FieldInputTypeEnum.Switch;
|
|
1828
|
+
case 'radio':
|
|
1829
|
+
return FieldInputTypeEnum.Radio;
|
|
1830
|
+
case 'datepicker':
|
|
1831
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1832
|
+
case 'mask':
|
|
1833
|
+
return FieldInputTypeEnum.Mask;
|
|
1834
|
+
case 'file':
|
|
1835
|
+
return FieldInputTypeEnum.File;
|
|
1836
|
+
case 'custom':
|
|
1837
|
+
return FieldInputTypeEnum.Custom;
|
|
1838
|
+
case 'text':
|
|
1839
|
+
default:
|
|
1840
|
+
return FieldInputTypeEnum.Text;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* convert column type to equivalent field input type
|
|
1845
|
+
* @param type column type
|
|
1846
|
+
*/
|
|
1847
|
+
static toFieldInputTypeFromColumnType(type) {
|
|
1848
|
+
switch (type) {
|
|
1849
|
+
case ColumnTypeEnum.Number:
|
|
1850
|
+
return FieldInputTypeEnum.Number;
|
|
1851
|
+
case ColumnTypeEnum.Currency:
|
|
1852
|
+
return FieldInputTypeEnum.Currency;
|
|
1853
|
+
case ColumnTypeEnum.Boolean:
|
|
1854
|
+
return FieldInputTypeEnum.Switch;
|
|
1855
|
+
case ColumnTypeEnum.Date:
|
|
1856
|
+
return FieldInputTypeEnum.Datepicker;
|
|
1857
|
+
case ColumnTypeEnum.Custom:
|
|
1858
|
+
return FieldInputTypeEnum.Custom;
|
|
1859
|
+
case ColumnTypeEnum.String:
|
|
1860
|
+
case ColumnTypeEnum.Enum:
|
|
1861
|
+
default:
|
|
1862
|
+
return FieldInputTypeEnum.Text;
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
TableviewUtil._dateRegex = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
|
|
1867
|
+
|
|
1618
1868
|
class FilterDescriptor {
|
|
1619
1869
|
constructor(property) {
|
|
1620
1870
|
this._filterType = FilterTypeEnum.String;
|
|
1621
1871
|
this._hasDefaultValue = false;
|
|
1622
|
-
this._defaultFilterMatchMode = FilterMatchModeEnum.Equals;
|
|
1623
1872
|
this._matchModes = null;
|
|
1624
1873
|
this._numberUseGrouping = true;
|
|
1625
1874
|
this._datePickerShowTime = false;
|
|
@@ -1695,13 +1944,11 @@ class FilterDescriptor {
|
|
|
1695
1944
|
this._filterProperty = filterProperty;
|
|
1696
1945
|
return this;
|
|
1697
1946
|
}
|
|
1698
|
-
withDefaultFilter(filterValue, filterValueTo, filterMatchMode
|
|
1947
|
+
withDefaultFilter(filterValue, filterValueTo, filterMatchMode) {
|
|
1699
1948
|
this._hasDefaultValue = true;
|
|
1700
1949
|
this._defaultValue = filterValue;
|
|
1701
1950
|
this._defaultValueTo = filterValueTo;
|
|
1702
|
-
|
|
1703
|
-
this._defaultFilterMatchMode = filterMatchMode;
|
|
1704
|
-
}
|
|
1951
|
+
this._defaultFilterMatchMode = filterMatchMode;
|
|
1705
1952
|
return this;
|
|
1706
1953
|
}
|
|
1707
1954
|
withNumberFractions(min, max) {
|
|
@@ -1848,6 +2095,16 @@ class FilterLookupDescriptor extends FilterDescriptor {
|
|
|
1848
2095
|
this._dropdownClassName = dropdownClassName;
|
|
1849
2096
|
return this;
|
|
1850
2097
|
}
|
|
2098
|
+
withDefaultFilter(filterValue, filterValueTo, filterMatchMode) {
|
|
2099
|
+
this._hasDefaultValue = true;
|
|
2100
|
+
this._defaultValue = filterValue;
|
|
2101
|
+
this._defaultValueTo = filterValueTo;
|
|
2102
|
+
this._defaultFilterMatchMode = filterMatchMode;
|
|
2103
|
+
if (Array.isArray(filterValue) && !this.multiselect) {
|
|
2104
|
+
throw new Error('Array default filter can only be used with a multiselect filter.');
|
|
2105
|
+
}
|
|
2106
|
+
return this;
|
|
2107
|
+
}
|
|
1851
2108
|
asAutocomplete(openOnFocus = false, inlineSearch = false) {
|
|
1852
2109
|
this._lookupType = FilterLookupTypeEnum.Autocomplete;
|
|
1853
2110
|
this._autocompleteOpenOnFocus = openOnFocus;
|
|
@@ -2001,9 +2258,35 @@ class ColumnDescriptor {
|
|
|
2001
2258
|
get hasCopyToClipboard() {
|
|
2002
2259
|
return this._hasCopyToClipboard;
|
|
2003
2260
|
}
|
|
2004
|
-
|
|
2005
|
-
this.
|
|
2006
|
-
|
|
2261
|
+
get template() {
|
|
2262
|
+
return this._template;
|
|
2263
|
+
}
|
|
2264
|
+
get getter() {
|
|
2265
|
+
return this._getter;
|
|
2266
|
+
}
|
|
2267
|
+
/**
|
|
2268
|
+
* converts column to given type with additional arguments
|
|
2269
|
+
* @param type column type enum
|
|
2270
|
+
* @param args any additional arguments for column (optional)
|
|
2271
|
+
*/
|
|
2272
|
+
asType(type, ...args) {
|
|
2273
|
+
switch (type) {
|
|
2274
|
+
case ColumnTypeEnum.Number:
|
|
2275
|
+
return this.asNumber(...args);
|
|
2276
|
+
case ColumnTypeEnum.Currency:
|
|
2277
|
+
return this.asCurrency(...args);
|
|
2278
|
+
case ColumnTypeEnum.Boolean:
|
|
2279
|
+
return this.asBoolean(...args);
|
|
2280
|
+
case ColumnTypeEnum.Date:
|
|
2281
|
+
return this.asDate(...args);
|
|
2282
|
+
case ColumnTypeEnum.Enum:
|
|
2283
|
+
return this.asEnum(args[0], args[1], args[2]);
|
|
2284
|
+
case ColumnTypeEnum.Custom:
|
|
2285
|
+
return this.asCustomComponent(args[0]);
|
|
2286
|
+
case ColumnTypeEnum.String:
|
|
2287
|
+
default:
|
|
2288
|
+
return this;
|
|
2289
|
+
}
|
|
2007
2290
|
}
|
|
2008
2291
|
asNumber(displayFormat = '1.0-0', locale) {
|
|
2009
2292
|
this._columnType = ColumnTypeEnum.Number;
|
|
@@ -2136,33 +2419,99 @@ class ColumnDescriptor {
|
|
|
2136
2419
|
this._hasCopyToClipboard = hasCopyToCliboard;
|
|
2137
2420
|
return this;
|
|
2138
2421
|
}
|
|
2422
|
+
withTemplate(template) {
|
|
2423
|
+
this._template = template;
|
|
2424
|
+
return this;
|
|
2425
|
+
}
|
|
2426
|
+
withGetter(getter) {
|
|
2427
|
+
this._getter = getter;
|
|
2428
|
+
return this;
|
|
2429
|
+
}
|
|
2139
2430
|
copy() {
|
|
2140
|
-
var _a;
|
|
2141
2431
|
const descriptor = new ColumnDescriptor(this._table, this._property);
|
|
2142
|
-
|
|
2432
|
+
this.copyFieldsTo(descriptor);
|
|
2433
|
+
return descriptor;
|
|
2434
|
+
}
|
|
2435
|
+
copyFieldsTo(obj) {
|
|
2436
|
+
var _a;
|
|
2437
|
+
obj._jsonPath = this._jsonPath;
|
|
2438
|
+
obj._title = this._title;
|
|
2439
|
+
obj._isSortEnabled = this._isSortEnabled;
|
|
2440
|
+
obj._columnType = this._columnType;
|
|
2441
|
+
obj._filterDescriptor = (_a = this._filterDescriptor) === null || _a === void 0 ? void 0 : _a.copy();
|
|
2442
|
+
obj._enumType = this._enumType;
|
|
2443
|
+
obj._enumTitlePath = this._enumTitlePath;
|
|
2444
|
+
obj._enumNameAsValue = this._enumNameAsValue;
|
|
2445
|
+
obj._booleanAsIcon = this._booleanAsIcon;
|
|
2446
|
+
obj._booleanYes = this._booleanYes;
|
|
2447
|
+
obj._booleanNo = this._booleanNo;
|
|
2448
|
+
obj._objectModelType = this._objectModelType;
|
|
2449
|
+
obj._objectTitleProperty = this._objectTitleProperty;
|
|
2450
|
+
obj._locale = this._locale;
|
|
2451
|
+
obj._currencyCode = this._currencyCode;
|
|
2452
|
+
obj._currencyDisplay = this._currencyDisplay;
|
|
2453
|
+
obj._currencyFromProperty = this._currencyFromProperty;
|
|
2454
|
+
obj._displayFormat = this._displayFormat;
|
|
2455
|
+
obj._headerClassName = this._headerClassName;
|
|
2456
|
+
obj._className = this._className;
|
|
2457
|
+
obj._width = this._width;
|
|
2458
|
+
obj._minWidth = this._minWidth;
|
|
2459
|
+
obj._maxWidth = this._maxWidth;
|
|
2460
|
+
obj._hasCopyToClipboard = this._hasCopyToClipboard;
|
|
2461
|
+
obj._template = this._template;
|
|
2462
|
+
obj._getter = this._getter;
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
class ColumnDynamicDescriptor extends ColumnDescriptor {
|
|
2466
|
+
// private _filterStatus;
|
|
2467
|
+
constructor(table, property) {
|
|
2468
|
+
super(table, property);
|
|
2469
|
+
this._visibility = true;
|
|
2470
|
+
this._table = table;
|
|
2471
|
+
}
|
|
2472
|
+
get visibility() {
|
|
2473
|
+
return this._visibility;
|
|
2474
|
+
}
|
|
2475
|
+
/**
|
|
2476
|
+
* sets column's title and returns this column
|
|
2477
|
+
* @param title title to be set
|
|
2478
|
+
* @param override should column title if all ready set?
|
|
2479
|
+
*/
|
|
2480
|
+
withTitle(title, override = false) {
|
|
2481
|
+
if (this._title == null || override) {
|
|
2482
|
+
this._title = title;
|
|
2483
|
+
}
|
|
2484
|
+
return this;
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* defines automatic type and returns this column
|
|
2488
|
+
* @param value
|
|
2489
|
+
*/
|
|
2490
|
+
withAutomaticType(value) {
|
|
2491
|
+
TableviewUtil.stringColumnConverter(this, value);
|
|
2492
|
+
return this;
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* sets visibility state for column and returns this column
|
|
2496
|
+
* @param visibility
|
|
2497
|
+
*/
|
|
2498
|
+
withVisibility(visibility) {
|
|
2499
|
+
this._visibility = visibility;
|
|
2500
|
+
return this;
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* creates deep copy of column dynamic descriptor
|
|
2504
|
+
*/
|
|
2505
|
+
copy() {
|
|
2506
|
+
const descriptor = new ColumnDynamicDescriptor(this._table, this._property);
|
|
2507
|
+
this.copyFieldsTo(descriptor);
|
|
2143
2508
|
descriptor._title = this._title;
|
|
2144
|
-
descriptor.
|
|
2145
|
-
descriptor
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
descriptor
|
|
2149
|
-
|
|
2150
|
-
descriptor._booleanAsIcon = this._booleanAsIcon;
|
|
2151
|
-
descriptor._booleanYes = this._booleanYes;
|
|
2152
|
-
descriptor._booleanNo = this._booleanNo;
|
|
2153
|
-
descriptor._objectModelType = this._objectModelType;
|
|
2154
|
-
descriptor._objectTitleProperty = this._objectTitleProperty;
|
|
2155
|
-
descriptor._locale = this._locale;
|
|
2156
|
-
descriptor._currencyCode = this._currencyCode;
|
|
2157
|
-
descriptor._currencyDisplay = this._currencyDisplay;
|
|
2158
|
-
descriptor._currencyFromProperty = this._currencyFromProperty;
|
|
2159
|
-
descriptor._displayFormat = this._displayFormat;
|
|
2160
|
-
descriptor._headerClassName = this._headerClassName;
|
|
2161
|
-
descriptor._className = this._className;
|
|
2162
|
-
descriptor._width = this._width;
|
|
2163
|
-
descriptor._minWidth = this._minWidth;
|
|
2164
|
-
descriptor._maxWidth = this._maxWidth;
|
|
2165
|
-
descriptor._hasCopyToClipboard = this._hasCopyToClipboard;
|
|
2509
|
+
descriptor._visibility = this._visibility;
|
|
2510
|
+
return descriptor;
|
|
2511
|
+
}
|
|
2512
|
+
toColumnDescriptor(tableDescriptor) {
|
|
2513
|
+
const descriptor = new ColumnDescriptor(tableDescriptor, this._property);
|
|
2514
|
+
this.copyFieldsTo(descriptor);
|
|
2166
2515
|
return descriptor;
|
|
2167
2516
|
}
|
|
2168
2517
|
}
|
|
@@ -2173,9 +2522,37 @@ class EditorDescriptor {
|
|
|
2173
2522
|
this._groups = [];
|
|
2174
2523
|
this._fields = [];
|
|
2175
2524
|
this._disabled = false;
|
|
2525
|
+
this._modelType = modelType;
|
|
2176
2526
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
2177
2527
|
this._tableviewEditorType = tableviewEditorType;
|
|
2178
2528
|
}
|
|
2529
|
+
/**
|
|
2530
|
+
* auto generated editor descriptor based on openapi definition
|
|
2531
|
+
* generates all fields from definition
|
|
2532
|
+
* @param modelType class type
|
|
2533
|
+
* @param idProperty
|
|
2534
|
+
* @param titleProperty
|
|
2535
|
+
* @param tableEditorType
|
|
2536
|
+
*/
|
|
2537
|
+
static from(modelType, idProperty, titleProperty, tableEditorType = TableviewTypeEnum.None) {
|
|
2538
|
+
return EditorDescriptor.fromModelWithAttributes(modelType, TableviewUtil.getAttributeDefMap(modelType), titleProperty, idProperty, tableEditorType);
|
|
2539
|
+
}
|
|
2540
|
+
/**
|
|
2541
|
+
* auto generated editor descriptor based on openapi definition
|
|
2542
|
+
* generates only selected fields
|
|
2543
|
+
* @param modelType class type
|
|
2544
|
+
* @param attributes list of selected properties to generate fields based on
|
|
2545
|
+
* @param idProperty
|
|
2546
|
+
* @param titleProperty
|
|
2547
|
+
* @param tableEditorType
|
|
2548
|
+
*/
|
|
2549
|
+
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty, tableEditorType = TableviewTypeEnum.None) {
|
|
2550
|
+
const descriptor = new EditorDescriptor(modelType, idProperty, titleProperty, tableEditorType);
|
|
2551
|
+
attributes
|
|
2552
|
+
.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array'))
|
|
2553
|
+
.forEach(attr => descriptor.upsertFieldFromAttributeDef(attr, descriptor.fields.find(col => col.property === attr.name)));
|
|
2554
|
+
return descriptor;
|
|
2555
|
+
}
|
|
2179
2556
|
get model() {
|
|
2180
2557
|
return this._model;
|
|
2181
2558
|
}
|
|
@@ -2223,20 +2600,23 @@ class EditorDescriptor {
|
|
|
2223
2600
|
this.addFieldDescriptor(field);
|
|
2224
2601
|
return field;
|
|
2225
2602
|
}
|
|
2603
|
+
/**
|
|
2604
|
+
* removes filed if exists in descriptor
|
|
2605
|
+
* @param property field name
|
|
2606
|
+
*/
|
|
2226
2607
|
removeField(property) {
|
|
2227
2608
|
const fieldIdx = this._fields.findIndex(f => f.property === property);
|
|
2228
2609
|
if (fieldIdx < 0) {
|
|
2229
2610
|
throw new Error(`Field ${property} does not exist.`);
|
|
2230
2611
|
}
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2233
|
-
const groupFieldIdx = field.group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
2612
|
+
for (const group of this._groups) {
|
|
2613
|
+
const groupFieldIdx = group.fields.findIndex(f => f instanceof AFieldDescriptor && f.property === property);
|
|
2234
2614
|
if (groupFieldIdx >= 0) {
|
|
2235
|
-
|
|
2615
|
+
group.fields.splice(groupFieldIdx, 1);
|
|
2616
|
+
break;
|
|
2236
2617
|
}
|
|
2237
2618
|
}
|
|
2238
2619
|
this._fields.splice(fieldIdx, 1);
|
|
2239
|
-
return this;
|
|
2240
2620
|
}
|
|
2241
2621
|
getField(property) {
|
|
2242
2622
|
var _a;
|
|
@@ -2312,6 +2692,76 @@ class EditorDescriptor {
|
|
|
2312
2692
|
this.createTabGroup(EditorDescriptor.defaultGroupName, 'general.general');
|
|
2313
2693
|
}
|
|
2314
2694
|
}
|
|
2695
|
+
/**
|
|
2696
|
+
* modifies selected field
|
|
2697
|
+
* do not use it for enums! (use withFieldModifiedEnum instead)
|
|
2698
|
+
* @param property field name
|
|
2699
|
+
* @param fieldType new field type for selected field
|
|
2700
|
+
* @param args additional parameters for field
|
|
2701
|
+
*/
|
|
2702
|
+
withFieldModifiedType(property, fieldType, ...args) {
|
|
2703
|
+
const attribute = TableviewUtil.getAttributeDefMap(this._modelType).find(attribute => attribute.name === property);
|
|
2704
|
+
if (attribute) {
|
|
2705
|
+
attribute.fieldType = fieldType;
|
|
2706
|
+
this.upsertFieldFromAttributeDef(attribute, this.fields.find(fi => fi.property === property), ...args);
|
|
2707
|
+
}
|
|
2708
|
+
return this;
|
|
2709
|
+
}
|
|
2710
|
+
/**
|
|
2711
|
+
* modifies selected field with enum type
|
|
2712
|
+
* @param property field property name
|
|
2713
|
+
* @param enumType type of enum for new field
|
|
2714
|
+
* @param optionsTitlePath
|
|
2715
|
+
* @param values
|
|
2716
|
+
* @param nameAsValue
|
|
2717
|
+
*/
|
|
2718
|
+
withFieldModifiedEnum(property, enumType, optionsTitlePath, values, nameAsValue = false) {
|
|
2719
|
+
const attribute = TableviewUtil.getAttributeDefMap(this._modelType).find(a => a.name === property);
|
|
2720
|
+
if (attribute) {
|
|
2721
|
+
attribute.fieldType = FieldInputTypeEnum.Radio;
|
|
2722
|
+
const field = this.fields.find(f => f.property === property);
|
|
2723
|
+
if (field && field instanceof FieldInputDescriptor) {
|
|
2724
|
+
field.asRadioFromEnum(enumType !== null && enumType !== void 0 ? enumType : ObjectSerializer.get().findEnum(attribute.type), optionsTitlePath, values, nameAsValue);
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
return this;
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* adds lookup to given field
|
|
2731
|
+
* @param property field property name
|
|
2732
|
+
* @param modelType model type of field
|
|
2733
|
+
* @param lookupProvider provider to be added to field
|
|
2734
|
+
* @param titleProperty
|
|
2735
|
+
*/
|
|
2736
|
+
withFieldModifiedLookup(property, modelType, lookupProvider, titleProperty) {
|
|
2737
|
+
this.removeField(property);
|
|
2738
|
+
const field = this.addFieldLookup(property, modelType).asAutocomplete().withLookupDataProvider(lookupProvider);
|
|
2739
|
+
if (titleProperty) {
|
|
2740
|
+
field.withItemsLabelProperty(titleProperty);
|
|
2741
|
+
}
|
|
2742
|
+
return this;
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* generates field based on attribute definition, used for auto model
|
|
2746
|
+
* @param attribute definition
|
|
2747
|
+
* @param field optional, if defined will be replaced, otherwise new will be generated
|
|
2748
|
+
* @param args additional arguments
|
|
2749
|
+
*/
|
|
2750
|
+
upsertFieldFromAttributeDef(attribute, field, ...args) {
|
|
2751
|
+
var _a;
|
|
2752
|
+
if (field == null) {
|
|
2753
|
+
field = this.addField(attribute.name);
|
|
2754
|
+
}
|
|
2755
|
+
if (field instanceof FieldInputDescriptor) {
|
|
2756
|
+
if (attribute.enumType) {
|
|
2757
|
+
return field.asRadioFromEnum(attribute.enumType);
|
|
2758
|
+
}
|
|
2759
|
+
else {
|
|
2760
|
+
return field.asType((_a = attribute.fieldType) !== null && _a !== void 0 ? _a : TableviewUtil.toFieldInputTypeFromColumnType(attribute.columnType), ...args);
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
return field;
|
|
2764
|
+
}
|
|
2315
2765
|
}
|
|
2316
2766
|
EditorDescriptor.defaultGroupName = '_default';
|
|
2317
2767
|
|
|
@@ -2384,9 +2834,6 @@ class AFieldDescriptor extends AGenericFieldDescriptor {
|
|
|
2384
2834
|
get property() {
|
|
2385
2835
|
return this._property;
|
|
2386
2836
|
}
|
|
2387
|
-
get group() {
|
|
2388
|
-
return this._group;
|
|
2389
|
-
}
|
|
2390
2837
|
get label() {
|
|
2391
2838
|
return this._label;
|
|
2392
2839
|
}
|
|
@@ -2550,6 +2997,39 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2550
2997
|
this._fileMultiple = false;
|
|
2551
2998
|
this._fileMaxFileSize = 500000;
|
|
2552
2999
|
}
|
|
3000
|
+
/**
|
|
3001
|
+
* converts field to given type with additional arguments
|
|
3002
|
+
* @param fieldType field type enum
|
|
3003
|
+
* @param args any additional arguments for field (optional)
|
|
3004
|
+
*/
|
|
3005
|
+
asType(fieldType, ...args) {
|
|
3006
|
+
switch (fieldType) {
|
|
3007
|
+
case FieldInputTypeEnum.Hidden:
|
|
3008
|
+
return this.asHidden();
|
|
3009
|
+
case FieldInputTypeEnum.Label:
|
|
3010
|
+
return this.asLabel();
|
|
3011
|
+
case FieldInputTypeEnum.Textarea:
|
|
3012
|
+
return this.asTextarea(...args);
|
|
3013
|
+
case FieldInputTypeEnum.Number:
|
|
3014
|
+
return this.asNumber();
|
|
3015
|
+
case FieldInputTypeEnum.Currency:
|
|
3016
|
+
return this.asCurrency(...args);
|
|
3017
|
+
case FieldInputTypeEnum.Switch:
|
|
3018
|
+
return this.asSwitch();
|
|
3019
|
+
case FieldInputTypeEnum.Radio:
|
|
3020
|
+
return this.asRadio(args[0], args[1]);
|
|
3021
|
+
case FieldInputTypeEnum.Datepicker:
|
|
3022
|
+
return this.asDatePicker(...args);
|
|
3023
|
+
case FieldInputTypeEnum.Mask:
|
|
3024
|
+
return this.asMask(args[0], args[1]);
|
|
3025
|
+
case FieldInputTypeEnum.File:
|
|
3026
|
+
return this.asFile(...args);
|
|
3027
|
+
case FieldInputTypeEnum.Custom:
|
|
3028
|
+
return this.asCustomComponent(args[0]);
|
|
3029
|
+
case FieldInputTypeEnum.Text:
|
|
3030
|
+
return this.asText();
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
2553
3033
|
get fieldType() {
|
|
2554
3034
|
return this._fieldType;
|
|
2555
3035
|
}
|
|
@@ -3084,6 +3564,10 @@ class AFieldGroupDescriptor extends AGenericFieldDescriptor {
|
|
|
3084
3564
|
this._name = `${this.baseName}${name}`;
|
|
3085
3565
|
this._default = name === EditorDescriptor.defaultGroupName;
|
|
3086
3566
|
}
|
|
3567
|
+
removeField(property, filterFunction) {
|
|
3568
|
+
this._fields = filterFunction(this._fields);
|
|
3569
|
+
return this._fields;
|
|
3570
|
+
}
|
|
3087
3571
|
get title() {
|
|
3088
3572
|
return this._title;
|
|
3089
3573
|
}
|
|
@@ -3235,9 +3719,33 @@ class TableDescriptor {
|
|
|
3235
3719
|
this._size = TableSizeEnum.Large;
|
|
3236
3720
|
this._hasHover = true;
|
|
3237
3721
|
this._hasGridlines = false;
|
|
3722
|
+
this._autoGenerated = false;
|
|
3723
|
+
this._modelType = modelType;
|
|
3238
3724
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
3239
3725
|
this._dataKeyProperty = (_a = idProperty !== null && idProperty !== void 0 ? idProperty : ModelUtil.findIdAttribute(modelType)) !== null && _a !== void 0 ? _a : undefined;
|
|
3240
3726
|
}
|
|
3727
|
+
/**
|
|
3728
|
+
* generates descriptor based on modelType attribute definition
|
|
3729
|
+
* @param modelType class type
|
|
3730
|
+
* @param idProperty
|
|
3731
|
+
* @param titleProperty
|
|
3732
|
+
*/
|
|
3733
|
+
static from(modelType, idProperty, titleProperty) {
|
|
3734
|
+
return TableDescriptor.fromModelWithAttributes(modelType, TableviewUtil.getAttributeDefMap(modelType), idProperty, titleProperty);
|
|
3735
|
+
}
|
|
3736
|
+
/**
|
|
3737
|
+
* generates descriptor base on given attribute definition
|
|
3738
|
+
* @param modelType class type
|
|
3739
|
+
* @param attributes attributes from which descriptor is generated
|
|
3740
|
+
* @param idProperty
|
|
3741
|
+
* @param titleProperty
|
|
3742
|
+
*/
|
|
3743
|
+
static fromModelWithAttributes(modelType, attributes, idProperty, titleProperty) {
|
|
3744
|
+
const descriptor = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
3745
|
+
descriptor._autoGenerated = true;
|
|
3746
|
+
attributes.filter(attr => !attr.type.includes('Set') && !attr.type.includes('Array')).forEach(attr => descriptor.upsertColumnFromAttributeDef(attr));
|
|
3747
|
+
return descriptor;
|
|
3748
|
+
}
|
|
3241
3749
|
get filterDisplay() {
|
|
3242
3750
|
return this._filterDisplay;
|
|
3243
3751
|
}
|
|
@@ -3292,6 +3800,18 @@ class TableDescriptor {
|
|
|
3292
3800
|
get hasGridlines() {
|
|
3293
3801
|
return this._hasGridlines;
|
|
3294
3802
|
}
|
|
3803
|
+
get rowClassName() {
|
|
3804
|
+
return this._rowClassName;
|
|
3805
|
+
}
|
|
3806
|
+
get rowClassNameMapFn() {
|
|
3807
|
+
return this._rowClassNameMapFn;
|
|
3808
|
+
}
|
|
3809
|
+
get headerClassName() {
|
|
3810
|
+
return this._headerClassName;
|
|
3811
|
+
}
|
|
3812
|
+
getColumn(property) {
|
|
3813
|
+
return this._columns.find(col => col.property === property);
|
|
3814
|
+
}
|
|
3295
3815
|
addColumnDescriptor(column) {
|
|
3296
3816
|
this._columns.push(column);
|
|
3297
3817
|
return this;
|
|
@@ -3331,6 +3851,10 @@ class TableDescriptor {
|
|
|
3331
3851
|
this._columns.push(column);
|
|
3332
3852
|
return column;
|
|
3333
3853
|
}
|
|
3854
|
+
removeColumn(property) {
|
|
3855
|
+
const columndIdx = this._columns.findIndex(c => c.property === property);
|
|
3856
|
+
this._columns.splice(columndIdx, 1);
|
|
3857
|
+
}
|
|
3334
3858
|
withFilterDisplay(filterDisplayType) {
|
|
3335
3859
|
this._filterDisplay = filterDisplayType;
|
|
3336
3860
|
return this;
|
|
@@ -3385,36 +3909,263 @@ class TableDescriptor {
|
|
|
3385
3909
|
this._rowHeight = rowHeight;
|
|
3386
3910
|
return this;
|
|
3387
3911
|
}
|
|
3388
|
-
withHover(hover) {
|
|
3389
|
-
this._hasHover = hover;
|
|
3390
|
-
return this;
|
|
3912
|
+
withHover(hover) {
|
|
3913
|
+
this._hasHover = hover;
|
|
3914
|
+
return this;
|
|
3915
|
+
}
|
|
3916
|
+
withGridlines(gridlines) {
|
|
3917
|
+
this._hasGridlines = gridlines;
|
|
3918
|
+
return this;
|
|
3919
|
+
}
|
|
3920
|
+
withRowClassName(rowClassName, classNameMapFn) {
|
|
3921
|
+
this._rowClassName = rowClassName;
|
|
3922
|
+
this._rowClassNameMapFn = classNameMapFn;
|
|
3923
|
+
return this;
|
|
3924
|
+
}
|
|
3925
|
+
withHeaderClassName(headerClassName) {
|
|
3926
|
+
this._headerClassName = headerClassName;
|
|
3927
|
+
return this;
|
|
3928
|
+
}
|
|
3929
|
+
copyFieldsTo(obj) {
|
|
3930
|
+
obj._title = this._title;
|
|
3931
|
+
obj._hideHeader = this._hideHeader;
|
|
3932
|
+
obj._dataKeyProperty = this._dataKeyProperty;
|
|
3933
|
+
obj._hasDefaultSort = this._hasDefaultSort;
|
|
3934
|
+
obj._defaultSortProperty = this._defaultSortProperty.map(p => p);
|
|
3935
|
+
obj._defaultSortAsc = this._defaultSortAsc.map(p => p);
|
|
3936
|
+
obj._filterDisplay = this._filterDisplay;
|
|
3937
|
+
obj._className = this._className;
|
|
3938
|
+
obj._size = this._size;
|
|
3939
|
+
obj._tableFullHeightOffset = this._tableFullHeightOffset;
|
|
3940
|
+
obj._rowHeight = this._rowHeight;
|
|
3941
|
+
obj._hasHover = this._hasHover;
|
|
3942
|
+
obj._hasGridlines = this._hasGridlines;
|
|
3943
|
+
}
|
|
3944
|
+
copy() {
|
|
3945
|
+
const descriptor = new TableDescriptor(this.model.type, this.model.idPropertyName, this.model.titlePropertyName);
|
|
3946
|
+
this.copyFieldsTo(descriptor);
|
|
3947
|
+
descriptor._columns = this.columns.map(c => c.copy());
|
|
3948
|
+
return descriptor;
|
|
3949
|
+
}
|
|
3950
|
+
/**
|
|
3951
|
+
* generates column based on attributes
|
|
3952
|
+
* @param attribute attribute map
|
|
3953
|
+
* @param column if provided, replaced by new, otherwise new is created
|
|
3954
|
+
* @param args additional parameters
|
|
3955
|
+
*/
|
|
3956
|
+
upsertColumnFromAttributeDef(attribute, column, ...args) {
|
|
3957
|
+
if (column == null) {
|
|
3958
|
+
column = this.addColumn(attribute.name);
|
|
3959
|
+
}
|
|
3960
|
+
if (attribute.columnType === ColumnTypeEnum.Enum && args.length === 0) {
|
|
3961
|
+
args = [attribute.enumType];
|
|
3962
|
+
}
|
|
3963
|
+
column = column.asType(attribute.columnType, ...args);
|
|
3964
|
+
if (attribute.classType) {
|
|
3965
|
+
column.withObjectProperty(attribute.classType).withSort();
|
|
3966
|
+
}
|
|
3967
|
+
else {
|
|
3968
|
+
column.withSort().withFilter();
|
|
3969
|
+
}
|
|
3970
|
+
return column;
|
|
3971
|
+
}
|
|
3972
|
+
/**
|
|
3973
|
+
* defines modified type of column
|
|
3974
|
+
* DO NOT USE with enum (use withCustomEnumType)
|
|
3975
|
+
* @param property column name
|
|
3976
|
+
* @param columnType modified type
|
|
3977
|
+
* @param args additional attributes
|
|
3978
|
+
*/
|
|
3979
|
+
withColumnModifiedType(property, columnType, ...args) {
|
|
3980
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
3981
|
+
if (attributeDef != null) {
|
|
3982
|
+
attributeDef.columnType = columnType !== null && columnType !== void 0 ? columnType : attributeDef.columnType;
|
|
3983
|
+
this.upsertColumnFromAttributeDef(attributeDef, this.columns.find(col => col.property === attributeDef.name), ...args);
|
|
3984
|
+
}
|
|
3985
|
+
return this;
|
|
3986
|
+
}
|
|
3987
|
+
/**
|
|
3988
|
+
* defines custom enum type for column
|
|
3989
|
+
* @param property column name
|
|
3990
|
+
* @param enumType
|
|
3991
|
+
*/
|
|
3992
|
+
withColumnModifiedEnum(property, enumType) {
|
|
3993
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
3994
|
+
if (attributeDef != null) {
|
|
3995
|
+
attributeDef.columnType = ColumnTypeEnum.Enum;
|
|
3996
|
+
this.upsertColumnFromAttributeDef(attributeDef, this.columns.find(col => col.property === property), enumType !== null && enumType !== void 0 ? enumType : ObjectSerializer.get().findEnum(attributeDef.type));
|
|
3997
|
+
}
|
|
3998
|
+
return this;
|
|
3999
|
+
}
|
|
4000
|
+
/**
|
|
4001
|
+
* modifies column with class and lookup provider
|
|
4002
|
+
* @param property column name
|
|
4003
|
+
* @param lookupProvider lookupProvider for class
|
|
4004
|
+
* @param itemsLabelProperty
|
|
4005
|
+
* @param filterProperty
|
|
4006
|
+
*/
|
|
4007
|
+
withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty) {
|
|
4008
|
+
const column = this.columns.find(col => col.property === property);
|
|
4009
|
+
if (column) {
|
|
4010
|
+
column.withFilterLookup().withLookupDataProvider(lookupProvider);
|
|
4011
|
+
if (column instanceof FilterLookupDescriptor) {
|
|
4012
|
+
if (itemsLabelProperty) {
|
|
4013
|
+
column.withItemsLabelProperty(itemsLabelProperty);
|
|
4014
|
+
}
|
|
4015
|
+
if (filterProperty) {
|
|
4016
|
+
column.withFilterProperty(filterProperty);
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
return this;
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
class TableDynamicDescriptor extends TableDescriptor {
|
|
4024
|
+
constructor(idProperty, titleProperty) {
|
|
4025
|
+
super({}, idProperty, titleProperty);
|
|
4026
|
+
this._excludedColumns = [];
|
|
4027
|
+
this._filterColumns = [];
|
|
4028
|
+
this._sortColumns = [];
|
|
4029
|
+
this._sortColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
4030
|
+
this._filterColumnMode = TableDynamicColumnsModeEnum.EXCLUDE;
|
|
4031
|
+
this._columns = [];
|
|
4032
|
+
this.withTitle('Dynamic table');
|
|
4033
|
+
}
|
|
4034
|
+
get columns() {
|
|
4035
|
+
return this._columns;
|
|
4036
|
+
}
|
|
4037
|
+
/**
|
|
4038
|
+
* defines excluded columns when generating descriptor
|
|
4039
|
+
* @param excludedColumn names of excluded columns
|
|
4040
|
+
*/
|
|
4041
|
+
withColumnsExcluded(excludedColumn) {
|
|
4042
|
+
this._excludedColumns = excludedColumn;
|
|
4043
|
+
return this;
|
|
4044
|
+
}
|
|
4045
|
+
/**
|
|
4046
|
+
* defines column properties on which sort is defined or not depending on sortColumnMode
|
|
4047
|
+
* @param sortOnColumns column names
|
|
4048
|
+
* @param sortColumnMode INCLUDE_ONLY (default) only given columns will have sort, EXCLUDE given columns will NOT have sort
|
|
4049
|
+
*/
|
|
4050
|
+
withColumnsSort(sortOnColumns, sortColumnMode = TableDynamicColumnsModeEnum.INCLUDE_ONLY) {
|
|
4051
|
+
this._sortColumnMode = sortColumnMode;
|
|
4052
|
+
this._sortColumns = sortOnColumns;
|
|
4053
|
+
return this;
|
|
4054
|
+
}
|
|
4055
|
+
/**
|
|
4056
|
+
* defines column properties on which filter is defined or not depending on filterColumnMode
|
|
4057
|
+
* @param filterOnColumn column names
|
|
4058
|
+
* @param filterColumnMode INCLUDE_ONLY (default) only given columns will have filter, EXCLUDE given columns will NOT have filter
|
|
4059
|
+
*/
|
|
4060
|
+
withColumnsFilter(filterOnColumn, filterColumnMode = TableDynamicColumnsModeEnum.INCLUDE_ONLY) {
|
|
4061
|
+
this._filterColumnMode = filterColumnMode;
|
|
4062
|
+
this._filterColumns = filterOnColumn;
|
|
4063
|
+
return this;
|
|
4064
|
+
}
|
|
4065
|
+
/**
|
|
4066
|
+
* sets given type to column with given property and returns this table
|
|
4067
|
+
* @param property column's property
|
|
4068
|
+
* @param type custom type for column
|
|
4069
|
+
* @param args addition arguments for column
|
|
4070
|
+
*/
|
|
4071
|
+
withColumnModifiedType(property, type, ...args) {
|
|
4072
|
+
var _a;
|
|
4073
|
+
const column = (_a = this._columns.find(col => property === col.property)) !== null && _a !== void 0 ? _a : this.addColumn(property).withTitle(property);
|
|
4074
|
+
if (column) {
|
|
4075
|
+
column.asType(type, ...args);
|
|
4076
|
+
}
|
|
4077
|
+
return this;
|
|
4078
|
+
}
|
|
4079
|
+
/**
|
|
4080
|
+
* sets title to column with given property and returns this table
|
|
4081
|
+
* @param property column's property
|
|
4082
|
+
* @param title column's title
|
|
4083
|
+
*/
|
|
4084
|
+
withColumnTitle(property, title) {
|
|
4085
|
+
var _a;
|
|
4086
|
+
const column = (_a = this._columns.find(col => property === col.property)) !== null && _a !== void 0 ? _a : this.addColumn(property);
|
|
4087
|
+
column.withTitle(title, true);
|
|
4088
|
+
return this;
|
|
4089
|
+
}
|
|
4090
|
+
/**
|
|
4091
|
+
* generates columns defined on table based on data fetched from api
|
|
4092
|
+
* @param data data from api
|
|
4093
|
+
*/
|
|
4094
|
+
toTableDescriptorFromData(data) {
|
|
4095
|
+
const tableDescriptor = this.toTableDescriptor();
|
|
4096
|
+
if (data.pageData == null || data.pageData.length == 0) {
|
|
4097
|
+
return tableDescriptor;
|
|
4098
|
+
}
|
|
4099
|
+
const objectModel = data.pageData[0];
|
|
4100
|
+
const entries = Object.entries(objectModel)
|
|
4101
|
+
.filter(([key]) => !this._excludedColumns.includes(key))
|
|
4102
|
+
.filter(([, value]) => !Array.isArray(value)); //exclude arrays and sets
|
|
4103
|
+
for (const [key, value] of entries) {
|
|
4104
|
+
const metaColumn = this._columns.find(col => col.property === key);
|
|
4105
|
+
let column;
|
|
4106
|
+
if (metaColumn) {
|
|
4107
|
+
if (!metaColumn.visibility) {
|
|
4108
|
+
continue;
|
|
4109
|
+
}
|
|
4110
|
+
column = metaColumn.toColumnDescriptor(tableDescriptor);
|
|
4111
|
+
tableDescriptor.addColumnDescriptor(column);
|
|
4112
|
+
}
|
|
4113
|
+
else {
|
|
4114
|
+
column = tableDescriptor.addColumn(key).withTitle(key);
|
|
4115
|
+
TableviewUtil.stringColumnConverter(column, value);
|
|
4116
|
+
}
|
|
4117
|
+
const elementOfSortColumns = this._sortColumns.includes(column.property);
|
|
4118
|
+
if ((this._sortColumnMode === TableDynamicColumnsModeEnum.EXCLUDE && !elementOfSortColumns) ||
|
|
4119
|
+
(this._sortColumnMode === TableDynamicColumnsModeEnum.INCLUDE_ONLY && elementOfSortColumns)) {
|
|
4120
|
+
column.withSort();
|
|
4121
|
+
}
|
|
4122
|
+
const elementOfFilterColumns = this._filterColumns.includes(column.property);
|
|
4123
|
+
if ((this._filterColumnMode === TableDynamicColumnsModeEnum.EXCLUDE && !elementOfFilterColumns) ||
|
|
4124
|
+
(this._filterColumnMode === TableDynamicColumnsModeEnum.INCLUDE_ONLY && elementOfFilterColumns)) {
|
|
4125
|
+
column.withFilter();
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
return tableDescriptor;
|
|
4129
|
+
}
|
|
4130
|
+
/**
|
|
4131
|
+
* adds ColumnDynamicDescriptor to this table
|
|
4132
|
+
* @param property column's property
|
|
4133
|
+
*/
|
|
4134
|
+
addColumn(property) {
|
|
4135
|
+
const column = new ColumnDynamicDescriptor(this, property);
|
|
4136
|
+
this._columns.push(column);
|
|
4137
|
+
return column;
|
|
3391
4138
|
}
|
|
3392
|
-
|
|
3393
|
-
|
|
4139
|
+
removeColumn(property) {
|
|
4140
|
+
var _a;
|
|
4141
|
+
const column = (_a = this.columns.find(col => col.property === property)) !== null && _a !== void 0 ? _a : this.addColumn(property);
|
|
4142
|
+
column.withVisibility(false);
|
|
3394
4143
|
return this;
|
|
3395
4144
|
}
|
|
4145
|
+
/**
|
|
4146
|
+
* creates deep copy of table dynamic descriptor
|
|
4147
|
+
*/
|
|
3396
4148
|
copy() {
|
|
3397
|
-
const descriptor = new
|
|
4149
|
+
const descriptor = new TableDynamicDescriptor(this.model.idPropertyName, this.model.titlePropertyName);
|
|
4150
|
+
this.copyFieldsTo(descriptor);
|
|
3398
4151
|
descriptor._columns = this.columns.map(c => c.copy());
|
|
3399
|
-
descriptor.
|
|
3400
|
-
descriptor.
|
|
3401
|
-
descriptor.
|
|
3402
|
-
descriptor.
|
|
3403
|
-
descriptor.
|
|
3404
|
-
descriptor
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
descriptor
|
|
3408
|
-
|
|
3409
|
-
descriptor._rowHeight = this._rowHeight;
|
|
3410
|
-
descriptor._hasHover = this._hasHover;
|
|
3411
|
-
descriptor._hasGridlines = this._hasGridlines;
|
|
4152
|
+
descriptor._excludedColumns = [...this._excludedColumns];
|
|
4153
|
+
descriptor._filterColumns = [...this._filterColumns];
|
|
4154
|
+
descriptor._sortColumns = [...this._sortColumns];
|
|
4155
|
+
descriptor._filterColumnMode = this._filterColumnMode;
|
|
4156
|
+
descriptor._sortColumnMode = this._sortColumnMode;
|
|
4157
|
+
return descriptor;
|
|
4158
|
+
}
|
|
4159
|
+
toTableDescriptor() {
|
|
4160
|
+
const descriptor = new TableDescriptor({}, this.model.idPropertyName, this.model.titlePropertyName);
|
|
4161
|
+
this.copyFieldsTo(descriptor);
|
|
3412
4162
|
return descriptor;
|
|
3413
4163
|
}
|
|
3414
4164
|
}
|
|
3415
4165
|
|
|
3416
4166
|
class TableviewDescriptor {
|
|
3417
4167
|
constructor(modelType, idProperty, titleProperty) {
|
|
4168
|
+
this._modelType = modelType;
|
|
3418
4169
|
this._model = new ModelDescriptor(modelType, idProperty, titleProperty);
|
|
3419
4170
|
this._table = new TableDescriptor(modelType, idProperty, titleProperty);
|
|
3420
4171
|
this._viewEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewTypeEnum.View);
|
|
@@ -3423,6 +4174,38 @@ class TableviewDescriptor {
|
|
|
3423
4174
|
this._editEditor = new EditorDescriptor(modelType, idProperty, titleProperty, TableviewTypeEnum.Edit);
|
|
3424
4175
|
this._tableTitle = `${this._model.typeName}.name`;
|
|
3425
4176
|
}
|
|
4177
|
+
/**
|
|
4178
|
+
* generates descriptor from attribute definition of openaapi model
|
|
4179
|
+
* @param modelType class type
|
|
4180
|
+
* @param idProperty
|
|
4181
|
+
* @param titleProperty
|
|
4182
|
+
*/
|
|
4183
|
+
static from(modelType, idProperty, titleProperty) {
|
|
4184
|
+
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4185
|
+
descriptor._table = TableDescriptor.from(modelType, idProperty, titleProperty);
|
|
4186
|
+
descriptor._editEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4187
|
+
descriptor._viewEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4188
|
+
descriptor._addEditor = EditorDescriptor.from(modelType, idProperty, titleProperty);
|
|
4189
|
+
return descriptor;
|
|
4190
|
+
}
|
|
4191
|
+
/**
|
|
4192
|
+
* generates descriptor from given attribute definition
|
|
4193
|
+
* @param modelType class type
|
|
4194
|
+
* @param columnAttributes attribute definition to generate columns
|
|
4195
|
+
* @param fieldAttributes attribute definition to generate fields, if undefined columnDefinition is used, if null editors are not generated
|
|
4196
|
+
* @param idProperty
|
|
4197
|
+
* @param titleProperty
|
|
4198
|
+
*/
|
|
4199
|
+
static fromModelWithDefinition(modelType, columnAttributes, fieldAttributes, idProperty, titleProperty) {
|
|
4200
|
+
const descriptor = new TableviewDescriptor(modelType, idProperty, titleProperty);
|
|
4201
|
+
descriptor._table = TableDescriptor.fromModelWithAttributes(modelType, columnAttributes, idProperty, titleProperty);
|
|
4202
|
+
if (fieldAttributes !== null) {
|
|
4203
|
+
descriptor._editEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4204
|
+
descriptor._viewEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4205
|
+
descriptor._addEditor = EditorDescriptor.fromModelWithAttributes(modelType, fieldAttributes !== null && fieldAttributes !== void 0 ? fieldAttributes : columnAttributes, idProperty, titleProperty);
|
|
4206
|
+
}
|
|
4207
|
+
return descriptor;
|
|
4208
|
+
}
|
|
3426
4209
|
get table() {
|
|
3427
4210
|
return this._table;
|
|
3428
4211
|
}
|
|
@@ -3445,6 +4228,12 @@ class TableviewDescriptor {
|
|
|
3445
4228
|
this._table = descriptor;
|
|
3446
4229
|
return this;
|
|
3447
4230
|
}
|
|
4231
|
+
withEditorDescriptors(descriptor) {
|
|
4232
|
+
this._viewEditor = descriptor;
|
|
4233
|
+
this._editEditor = descriptor;
|
|
4234
|
+
this._addEditor = descriptor;
|
|
4235
|
+
return this;
|
|
4236
|
+
}
|
|
3448
4237
|
withViewDescriptor(descriptor) {
|
|
3449
4238
|
this._viewEditor = descriptor;
|
|
3450
4239
|
return this;
|
|
@@ -3473,6 +4262,26 @@ class TableviewDescriptor {
|
|
|
3473
4262
|
addColumn(property) {
|
|
3474
4263
|
return this._table.addColumn(property);
|
|
3475
4264
|
}
|
|
4265
|
+
removeColumn(property) {
|
|
4266
|
+
this._table.removeColumn(property);
|
|
4267
|
+
}
|
|
4268
|
+
getField(property, editorType) {
|
|
4269
|
+
switch (editorType) {
|
|
4270
|
+
case TableviewTypeEnum.Edit:
|
|
4271
|
+
return this._editEditor.getField(property);
|
|
4272
|
+
case TableviewTypeEnum.Add:
|
|
4273
|
+
return this._addEditor.getField(property);
|
|
4274
|
+
case TableviewTypeEnum.View:
|
|
4275
|
+
return this._viewEditor.getField(property);
|
|
4276
|
+
case TableviewTypeEnum.None:
|
|
4277
|
+
return null;
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
removeField(property) {
|
|
4281
|
+
this._editEditor.removeField(property);
|
|
4282
|
+
this._addEditor.removeField(property);
|
|
4283
|
+
this._viewEditor.removeField(property);
|
|
4284
|
+
}
|
|
3476
4285
|
addColumnNumber(property, displayFormat) {
|
|
3477
4286
|
return this._table.addColumnNumber(property, displayFormat);
|
|
3478
4287
|
}
|
|
@@ -3544,6 +4353,227 @@ class TableviewDescriptor {
|
|
|
3544
4353
|
tableview._editEditor = this._editEditor.copy();
|
|
3545
4354
|
return tableview;
|
|
3546
4355
|
}
|
|
4356
|
+
/**
|
|
4357
|
+
* creates column and field with custom type, for example currency
|
|
4358
|
+
* if field exists, it is replaced
|
|
4359
|
+
* DO NOT USE WITH TYPES WHERE ARGS ARE REQUIRED - ERROR WILL BE THROWN
|
|
4360
|
+
* for enum use withEnumType
|
|
4361
|
+
* for custom class use withClassType
|
|
4362
|
+
* @param property name of field
|
|
4363
|
+
* @param columnType required column type
|
|
4364
|
+
* @param fieldType optional, if not provided it is converted from column type
|
|
4365
|
+
*/
|
|
4366
|
+
withModifiedType(property, columnType, fieldType) {
|
|
4367
|
+
if (columnType === ColumnTypeEnum.Enum) {
|
|
4368
|
+
throw new Error('Do not use with types where args are required');
|
|
4369
|
+
}
|
|
4370
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4371
|
+
if (attributeDef != null) {
|
|
4372
|
+
fieldType !== null && fieldType !== void 0 ? fieldType : (fieldType = TableviewUtil.toFieldInputTypeFromColumnType(columnType));
|
|
4373
|
+
attributeDef.fieldType = fieldType;
|
|
4374
|
+
this._table.withColumnModifiedType(property, columnType);
|
|
4375
|
+
this._editEditor.withFieldModifiedType(property, fieldType);
|
|
4376
|
+
this._addEditor.withFieldModifiedType(property, fieldType);
|
|
4377
|
+
this._viewEditor.withFieldModifiedType(property, fieldType);
|
|
4378
|
+
}
|
|
4379
|
+
return this;
|
|
4380
|
+
}
|
|
4381
|
+
/**
|
|
4382
|
+
* creates column with enum type
|
|
4383
|
+
* if fields exists, it is replaced
|
|
4384
|
+
* @param property property name
|
|
4385
|
+
* @param enumType type of enum
|
|
4386
|
+
* @param fieldType type of field, optional, default is Text
|
|
4387
|
+
*/
|
|
4388
|
+
withModifiedEnum(property, enumType, fieldType) {
|
|
4389
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4390
|
+
if (attributeDef != null) {
|
|
4391
|
+
attributeDef.fieldType = fieldType !== null && fieldType !== void 0 ? fieldType : FieldInputTypeEnum.Text;
|
|
4392
|
+
this._table.withColumnModifiedEnum(property, enumType);
|
|
4393
|
+
this._editEditor.withFieldModifiedEnum(property, enumType);
|
|
4394
|
+
this._viewEditor.withFieldModifiedEnum(property, enumType);
|
|
4395
|
+
this._addEditor.withFieldModifiedEnum(property, enumType);
|
|
4396
|
+
}
|
|
4397
|
+
return this;
|
|
4398
|
+
}
|
|
4399
|
+
/**
|
|
4400
|
+
* generates column with custom class type
|
|
4401
|
+
* field is generated only if lookupProvider is provided
|
|
4402
|
+
* @param property property name
|
|
4403
|
+
* @param modelType class type of object
|
|
4404
|
+
* @param titleProperty
|
|
4405
|
+
* @param lookupProvider
|
|
4406
|
+
* @param itemsLabelProperty
|
|
4407
|
+
* @param filterProperty
|
|
4408
|
+
*/
|
|
4409
|
+
withModifiedLookup(property, modelType, lookupProvider, titleProperty, itemsLabelProperty, filterProperty) {
|
|
4410
|
+
var _a, _b, _c;
|
|
4411
|
+
const attributeDef = TableviewUtil.getAttributeDefMap(this._modelType).find(atribute => atribute.name === property);
|
|
4412
|
+
if (attributeDef != null) {
|
|
4413
|
+
modelType !== null && modelType !== void 0 ? modelType : (modelType = (_a = attributeDef.classType) !== null && _a !== void 0 ? _a : ObjectSerializer.get().findType(attributeDef.type));
|
|
4414
|
+
titleProperty !== null && titleProperty !== void 0 ? titleProperty : (titleProperty = (_b = ModelUtil.findTitleAttribute(modelType)) !== null && _b !== void 0 ? _b : undefined);
|
|
4415
|
+
itemsLabelProperty !== null && itemsLabelProperty !== void 0 ? itemsLabelProperty : (itemsLabelProperty = titleProperty);
|
|
4416
|
+
attributeDef.columnType = ColumnTypeEnum.String;
|
|
4417
|
+
attributeDef.fieldType = FieldInputTypeEnum.Text;
|
|
4418
|
+
if (lookupProvider != null) {
|
|
4419
|
+
this._table.withColumnModifiedLookup(property, lookupProvider, itemsLabelProperty, filterProperty);
|
|
4420
|
+
this._addEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4421
|
+
this._viewEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4422
|
+
this._editEditor.withFieldModifiedLookup(property, modelType, lookupProvider, itemsLabelProperty);
|
|
4423
|
+
}
|
|
4424
|
+
else {
|
|
4425
|
+
const column = (_c = this._table.getColumn(property)) !== null && _c !== void 0 ? _c : this.addColumn(property);
|
|
4426
|
+
column.withObjectProperty(modelType, titleProperty);
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
return this;
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
class TableviewDynamicDescriptor extends TableviewDescriptor {
|
|
4433
|
+
constructor(idProperty, titleProperty) {
|
|
4434
|
+
super({}, idProperty, titleProperty);
|
|
4435
|
+
this._table = new TableDynamicDescriptor(idProperty, titleProperty);
|
|
4436
|
+
super._tableTitle = undefined;
|
|
4437
|
+
}
|
|
4438
|
+
get table() {
|
|
4439
|
+
return this._table;
|
|
4440
|
+
}
|
|
4441
|
+
/**
|
|
4442
|
+
* sets custom table descriptor
|
|
4443
|
+
* @param descriptor
|
|
4444
|
+
*/
|
|
4445
|
+
withTableDescriptor(descriptor) {
|
|
4446
|
+
this._table = descriptor;
|
|
4447
|
+
return this;
|
|
4448
|
+
}
|
|
4449
|
+
/**
|
|
4450
|
+
* sets visibility hidden state to column with given property
|
|
4451
|
+
* equals to be removing in auto and base tableview descriptor
|
|
4452
|
+
* * @param property column's property
|
|
4453
|
+
*/
|
|
4454
|
+
removeColumn(property) {
|
|
4455
|
+
this._table.removeColumn(property);
|
|
4456
|
+
return this;
|
|
4457
|
+
}
|
|
4458
|
+
/**
|
|
4459
|
+
* creates depp copy of tableview object and its children
|
|
4460
|
+
*/
|
|
4461
|
+
copy() {
|
|
4462
|
+
const descriptor = new TableviewDynamicDescriptor(this.model.idPropertyName, this.model.titlePropertyName);
|
|
4463
|
+
descriptor._table = this._table.copy();
|
|
4464
|
+
descriptor._tableTitle = this._tableTitle;
|
|
4465
|
+
return descriptor;
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4468
|
+
|
|
4469
|
+
class ButtonDescriptor {
|
|
4470
|
+
constructor() {
|
|
4471
|
+
this._disabled = false;
|
|
4472
|
+
this._iconPosition = 'left';
|
|
4473
|
+
this._styleClass = new ButtonStyleBuilder();
|
|
4474
|
+
this._loading = false;
|
|
4475
|
+
this._loadingIcon = 'pi pi-spinner pi-spin';
|
|
4476
|
+
}
|
|
4477
|
+
withLabel(label) {
|
|
4478
|
+
this._label = label;
|
|
4479
|
+
return this;
|
|
4480
|
+
}
|
|
4481
|
+
withDisabled(disabled = true) {
|
|
4482
|
+
this._disabled = disabled;
|
|
4483
|
+
return this;
|
|
4484
|
+
}
|
|
4485
|
+
withIcon(icon) {
|
|
4486
|
+
this._icon = icon;
|
|
4487
|
+
return this;
|
|
4488
|
+
}
|
|
4489
|
+
withIconPosition(iconPosition) {
|
|
4490
|
+
this._iconPosition = iconPosition;
|
|
4491
|
+
return this;
|
|
4492
|
+
}
|
|
4493
|
+
withStyleClass(style) {
|
|
4494
|
+
this._styleClass = style;
|
|
4495
|
+
return this;
|
|
4496
|
+
}
|
|
4497
|
+
withOnClick(onClick) {
|
|
4498
|
+
this._onClick = onClick;
|
|
4499
|
+
return this;
|
|
4500
|
+
}
|
|
4501
|
+
withOnFocus(onFocus) {
|
|
4502
|
+
this._onFocus = onFocus;
|
|
4503
|
+
return this;
|
|
4504
|
+
}
|
|
4505
|
+
withOnBlur(onBlur) {
|
|
4506
|
+
this._onBlur = onBlur;
|
|
4507
|
+
return this;
|
|
4508
|
+
}
|
|
4509
|
+
withLoading(loading = true) {
|
|
4510
|
+
this._loading = loading;
|
|
4511
|
+
return this;
|
|
4512
|
+
}
|
|
4513
|
+
withLoadingIcon(loadingIcon) {
|
|
4514
|
+
this._loadingIcon = loadingIcon;
|
|
4515
|
+
return this;
|
|
4516
|
+
}
|
|
4517
|
+
withBadge(badge) {
|
|
4518
|
+
this._badge = badge;
|
|
4519
|
+
return this;
|
|
4520
|
+
}
|
|
4521
|
+
withTooltip(tooltip) {
|
|
4522
|
+
this._tooltip = tooltip;
|
|
4523
|
+
return this;
|
|
4524
|
+
}
|
|
4525
|
+
get label() {
|
|
4526
|
+
return this._label;
|
|
4527
|
+
}
|
|
4528
|
+
get disabled() {
|
|
4529
|
+
return this._disabled;
|
|
4530
|
+
}
|
|
4531
|
+
get icon() {
|
|
4532
|
+
return this._icon;
|
|
4533
|
+
}
|
|
4534
|
+
get iconPosition() {
|
|
4535
|
+
return this._iconPosition;
|
|
4536
|
+
}
|
|
4537
|
+
get styleClass() {
|
|
4538
|
+
return this._styleClass;
|
|
4539
|
+
}
|
|
4540
|
+
get onClick() {
|
|
4541
|
+
return this._onClick;
|
|
4542
|
+
}
|
|
4543
|
+
get onFocus() {
|
|
4544
|
+
return this._onFocus;
|
|
4545
|
+
}
|
|
4546
|
+
get onBlur() {
|
|
4547
|
+
return this._onBlur;
|
|
4548
|
+
}
|
|
4549
|
+
get loading() {
|
|
4550
|
+
return this._loading;
|
|
4551
|
+
}
|
|
4552
|
+
get loadingIcon() {
|
|
4553
|
+
return this._loadingIcon;
|
|
4554
|
+
}
|
|
4555
|
+
get badge() {
|
|
4556
|
+
return this._badge;
|
|
4557
|
+
}
|
|
4558
|
+
get tooltip() {
|
|
4559
|
+
return this._tooltip;
|
|
4560
|
+
}
|
|
4561
|
+
copy() {
|
|
4562
|
+
const descriptor = new ButtonDescriptor();
|
|
4563
|
+
descriptor._label = this._label;
|
|
4564
|
+
descriptor._disabled = this._disabled;
|
|
4565
|
+
descriptor._icon = this._icon;
|
|
4566
|
+
descriptor._iconPosition = this._iconPosition;
|
|
4567
|
+
descriptor._styleClass = this._styleClass;
|
|
4568
|
+
descriptor._onClick = this._onClick;
|
|
4569
|
+
descriptor._onFocus = this._onFocus;
|
|
4570
|
+
descriptor._onBlur = this._onBlur;
|
|
4571
|
+
descriptor._loading = this._loading;
|
|
4572
|
+
descriptor._loadingIcon = this._loadingIcon;
|
|
4573
|
+
descriptor._badge = this._badge;
|
|
4574
|
+
descriptor._tooltip = this._tooltip;
|
|
4575
|
+
return descriptor;
|
|
4576
|
+
}
|
|
3547
4577
|
}
|
|
3548
4578
|
|
|
3549
4579
|
class EditorFormlyUtil {
|
|
@@ -4576,7 +5606,6 @@ ObjectSerializer._instance = new ObjectSerializer();
|
|
|
4576
5606
|
|
|
4577
5607
|
class MediusRestUtil {
|
|
4578
5608
|
static fromAngularQueryParamsToMediusQueryParams(params, filterDescriptors, defaultItemsPerPage = 10, defaultOffset = 0) {
|
|
4579
|
-
var _a;
|
|
4580
5609
|
const offset = params['first'] ? parseInt(params['first']) : defaultOffset;
|
|
4581
5610
|
const itemsPerPage = params['rows'] ? parseInt(params['rows']) : defaultItemsPerPage;
|
|
4582
5611
|
const mediusParamsBuilder = MediusQueryParamBuilder.create(itemsPerPage, offset);
|
|
@@ -4609,8 +5638,7 @@ class MediusRestUtil {
|
|
|
4609
5638
|
const filterDescriptor = filterDescriptors.find(f => f.property === field);
|
|
4610
5639
|
const matchMode = MediusRestUtil.getMapping(operator, filterDescriptor === null || filterDescriptor === void 0 ? void 0 : filterDescriptor.filterType, 1);
|
|
4611
5640
|
if (matchMode && filterDescriptor) {
|
|
4612
|
-
|
|
4613
|
-
mediusParamsBuilder.withFilter(fieldFilterProperty, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(matchMode[0]));
|
|
5641
|
+
mediusParamsBuilder.withFilter(filterDescriptor.property, value, valueTo, MediusRestUtil.getMediusFilterMatchTypeFromPrimeMatchMode(matchMode[0]));
|
|
4614
5642
|
}
|
|
4615
5643
|
}
|
|
4616
5644
|
}
|
|
@@ -4667,6 +5695,13 @@ class MediusRestUtil {
|
|
|
4667
5695
|
}
|
|
4668
5696
|
return params;
|
|
4669
5697
|
}
|
|
5698
|
+
static modifyFilterProperties(mediusQueryParams, filterDescriptors) {
|
|
5699
|
+
var _a, _b;
|
|
5700
|
+
for (const filterParam of (_a = mediusQueryParams.filterParams) !== null && _a !== void 0 ? _a : []) {
|
|
5701
|
+
const filterDescriptor = filterDescriptors.find(f => f.property === filterParam.property);
|
|
5702
|
+
filterParam.property = (_b = filterDescriptor === null || filterDescriptor === void 0 ? void 0 : filterDescriptor.filterProperty) !== null && _b !== void 0 ? _b : filterParam.property;
|
|
5703
|
+
}
|
|
5704
|
+
}
|
|
4670
5705
|
static fromPrimeLazyLoadEventToMediusQueryParams(event) {
|
|
4671
5706
|
const queryParamBuilder = MediusQueryParamBuilder.create(event.rows, event.first);
|
|
4672
5707
|
// apply sorting
|
|
@@ -4918,6 +5953,7 @@ class ActionParameters {
|
|
|
4918
5953
|
constructor(itemId, item) {
|
|
4919
5954
|
this.itemId = itemId;
|
|
4920
5955
|
this.item = item;
|
|
5956
|
+
this.selectedItems = [];
|
|
4921
5957
|
}
|
|
4922
5958
|
withActionData(actionData) {
|
|
4923
5959
|
this.actionData = actionData;
|
|
@@ -4939,6 +5975,10 @@ class ActionParameters {
|
|
|
4939
5975
|
this.route = route;
|
|
4940
5976
|
return this;
|
|
4941
5977
|
}
|
|
5978
|
+
withSelectedItems(selectedItems) {
|
|
5979
|
+
this.selectedItems = selectedItems;
|
|
5980
|
+
return this;
|
|
5981
|
+
}
|
|
4942
5982
|
}
|
|
4943
5983
|
var ActionInstanceStateEnum;
|
|
4944
5984
|
(function (ActionInstanceStateEnum) {
|
|
@@ -4962,6 +6002,17 @@ var ActionInstanceStateEnum;
|
|
|
4962
6002
|
ActionInstanceStateEnum[ActionInstanceStateEnum["FinishDismissed"] = 17] = "FinishDismissed"; // action was dismissed by user
|
|
4963
6003
|
})(ActionInstanceStateEnum || (ActionInstanceStateEnum = {}));
|
|
4964
6004
|
|
|
6005
|
+
/**
|
|
6006
|
+
* Default categories for tableview actions
|
|
6007
|
+
*/
|
|
6008
|
+
class TableviewActionDefaultCategories {
|
|
6009
|
+
}
|
|
6010
|
+
TableviewActionDefaultCategories.READ = 'read';
|
|
6011
|
+
TableviewActionDefaultCategories.ADD = 'add';
|
|
6012
|
+
TableviewActionDefaultCategories.EDIT = 'edit';
|
|
6013
|
+
TableviewActionDefaultCategories.DELETE = 'delete';
|
|
6014
|
+
TableviewActionDefaultCategories.DETAILS = 'details';
|
|
6015
|
+
|
|
4965
6016
|
class AuthorizationUtil {
|
|
4966
6017
|
static isPermitted(permissions, userRoles) {
|
|
4967
6018
|
switch (permissions.authorizationType) {
|
|
@@ -5379,6 +6430,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
5379
6430
|
}]
|
|
5380
6431
|
}] });
|
|
5381
6432
|
|
|
6433
|
+
class MngGetterPipe {
|
|
6434
|
+
transform(value, getterFunction) {
|
|
6435
|
+
if (typeof getterFunction === 'function') {
|
|
6436
|
+
return getterFunction(value);
|
|
6437
|
+
}
|
|
6438
|
+
return value;
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
MngGetterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngGetterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6442
|
+
MngGetterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: MngGetterPipe, name: "getter" });
|
|
6443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngGetterPipe, decorators: [{
|
|
6444
|
+
type: Pipe,
|
|
6445
|
+
args: [{
|
|
6446
|
+
name: 'getter',
|
|
6447
|
+
pure: true
|
|
6448
|
+
}]
|
|
6449
|
+
}] });
|
|
6450
|
+
|
|
6451
|
+
class MngTemplatePipe {
|
|
6452
|
+
constructor(parametrizePipe) {
|
|
6453
|
+
this.parametrizePipe = parametrizePipe;
|
|
6454
|
+
}
|
|
6455
|
+
transform(value, template) {
|
|
6456
|
+
if (typeof template === 'string') {
|
|
6457
|
+
return this.parametrizePipe.transform(template, undefined, value);
|
|
6458
|
+
}
|
|
6459
|
+
return value;
|
|
6460
|
+
}
|
|
6461
|
+
}
|
|
6462
|
+
MngTemplatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTemplatePipe, deps: [{ token: MngParametrizePipe }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6463
|
+
MngTemplatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: MngTemplatePipe, name: "template" });
|
|
6464
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTemplatePipe, decorators: [{
|
|
6465
|
+
type: Pipe,
|
|
6466
|
+
args: [{
|
|
6467
|
+
name: 'template',
|
|
6468
|
+
pure: true
|
|
6469
|
+
}]
|
|
6470
|
+
}], ctorParameters: function () { return [{ type: MngParametrizePipe }]; } });
|
|
6471
|
+
|
|
6472
|
+
class MngClassMapPipe {
|
|
6473
|
+
transform(value, classNameMapFn, i) {
|
|
6474
|
+
if (classNameMapFn && typeof classNameMapFn === 'function') {
|
|
6475
|
+
return classNameMapFn(value, i);
|
|
6476
|
+
}
|
|
6477
|
+
else {
|
|
6478
|
+
return value !== null && value !== void 0 ? value : '';
|
|
6479
|
+
}
|
|
6480
|
+
}
|
|
6481
|
+
}
|
|
6482
|
+
MngClassMapPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
6483
|
+
MngClassMapPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, name: "mngClassMapPipe" });
|
|
6484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngClassMapPipe, decorators: [{
|
|
6485
|
+
type: Pipe,
|
|
6486
|
+
args: [{
|
|
6487
|
+
name: 'mngClassMapPipe',
|
|
6488
|
+
pure: true
|
|
6489
|
+
}]
|
|
6490
|
+
}] });
|
|
6491
|
+
|
|
5382
6492
|
class MngActionExecutorService {
|
|
5383
6493
|
constructor(injector, router, dialogService, confirmationService, translate, configurationService, navigationService, errorMapper, parametrize, defaultEditorDialogComponent) {
|
|
5384
6494
|
this.injector = injector;
|
|
@@ -5634,7 +6744,7 @@ class MngActionExecutorService {
|
|
|
5634
6744
|
* @return Action context for run function.
|
|
5635
6745
|
*/
|
|
5636
6746
|
runAction(action, parameters, dataProvider, instance, previousActionInstance) {
|
|
5637
|
-
var _a, _b, _c, _d;
|
|
6747
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5638
6748
|
if (!instance) {
|
|
5639
6749
|
// create new instance if non provided
|
|
5640
6750
|
instance = new ActionInstance(action, ActionInstanceStateEnum.ActivationEnd, this.debug);
|
|
@@ -5642,33 +6752,44 @@ class MngActionExecutorService {
|
|
|
5642
6752
|
const context = this.prepareActionContext(instance, parameters, dataProvider, previousActionInstance);
|
|
5643
6753
|
if (action.hasRunConfirmation) {
|
|
5644
6754
|
const sourceComponent = parameters === null || parameters === void 0 ? void 0 : parameters.sourceComponent;
|
|
6755
|
+
const confirmationDescriptor = action.runConfirmationDialogDescriptor;
|
|
5645
6756
|
if (typeof (sourceComponent === null || sourceComponent === void 0 ? void 0 : sourceComponent.getConfirmationService) !== 'function' || typeof (sourceComponent === null || sourceComponent === void 0 ? void 0 : sourceComponent.getConfirmationServiceInstanceKey) !== 'function') {
|
|
5646
6757
|
throw new Error(`Source component ${sourceComponent} should be implementing IConfirmationService interface to be able to provide confirmation functionality.`);
|
|
5647
6758
|
}
|
|
6759
|
+
const item = parameters.item;
|
|
5648
6760
|
const srcConfirmComponent = sourceComponent;
|
|
5649
6761
|
let confirmParams = {
|
|
5650
6762
|
key: srcConfirmComponent.getConfirmationServiceInstanceKey(action),
|
|
5651
|
-
|
|
5652
|
-
|
|
6763
|
+
icon: confirmationDescriptor.icon,
|
|
6764
|
+
acceptVisible: true,
|
|
6765
|
+
acceptIcon: (_a = confirmationDescriptor.acceptIcon) !== null && _a !== void 0 ? _a : undefined,
|
|
6766
|
+
acceptButtonStyleClass: confirmationDescriptor.acceptButtonStyle.getButtonClass(),
|
|
6767
|
+
rejectVisible: true,
|
|
6768
|
+
rejectIcon: (_b = confirmationDescriptor.rejectIcon) !== null && _b !== void 0 ? _b : undefined,
|
|
6769
|
+
rejectButtonStyleClass: confirmationDescriptor.rejectButtonStyle.getButtonClass(),
|
|
6770
|
+
closeOnEscape: confirmationDescriptor.closeOnEscape
|
|
5653
6771
|
};
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
confirmParams.header = (_a = I18nUtils.Action.get(this.translate, action, 'confirm.title', action.runConfirmationTitle, item, 'general.confirmation')) !== null && _a !== void 0 ? _a : undefined;
|
|
6772
|
+
if (confirmationDescriptor.title !== null) {
|
|
6773
|
+
confirmParams.header = (_c = I18nUtils.Action.get(this.translate, action, 'confirm.title', confirmationDescriptor.title, item, 'general.confirmation')) !== null && _c !== void 0 ? _c : undefined;
|
|
5657
6774
|
}
|
|
5658
|
-
if (
|
|
6775
|
+
if (confirmationDescriptor.message !== null) {
|
|
5659
6776
|
confirmParams.message =
|
|
5660
|
-
(
|
|
6777
|
+
(_d = I18nUtils.Action.get(this.translate, action, 'confirm.message', confirmationDescriptor.message, StringUtil.escapeHtmlAny(item), 'general.confirmation')) !== null && _d !== void 0 ? _d : undefined;
|
|
6778
|
+
}
|
|
6779
|
+
if (confirmationDescriptor.acceptLabel !== null) {
|
|
6780
|
+
confirmParams.acceptLabel = (_e = I18nUtils.Action.get(this.translate, action, 'confirm.accept', confirmationDescriptor.acceptLabel, item, 'general.yes')) !== null && _e !== void 0 ? _e : undefined;
|
|
6781
|
+
}
|
|
6782
|
+
if (confirmationDescriptor.acceptIcon !== null) {
|
|
6783
|
+
confirmParams.acceptIcon = confirmationDescriptor.acceptIcon;
|
|
5661
6784
|
}
|
|
5662
|
-
if (
|
|
5663
|
-
confirmParams.
|
|
6785
|
+
if (confirmationDescriptor.rejectIcon !== null) {
|
|
6786
|
+
confirmParams.rejectIcon = confirmationDescriptor.rejectIcon;
|
|
5664
6787
|
}
|
|
5665
|
-
if (
|
|
5666
|
-
confirmParams.
|
|
5667
|
-
confirmParams.acceptVisible = true;
|
|
6788
|
+
if (confirmationDescriptor.rejectLabel !== null) {
|
|
6789
|
+
confirmParams.rejectLabel = (_f = I18nUtils.Action.get(this.translate, action, 'confirm.reject', confirmationDescriptor.rejectLabel, item, 'general.no')) !== null && _f !== void 0 ? _f : undefined;
|
|
5668
6790
|
}
|
|
5669
|
-
if (
|
|
5670
|
-
confirmParams.
|
|
5671
|
-
confirmParams.rejectVisible = true;
|
|
6791
|
+
if (confirmationDescriptor.rejectLabel === null && confirmationDescriptor.rejectIcon === null) {
|
|
6792
|
+
confirmParams.rejectVisible = false;
|
|
5672
6793
|
}
|
|
5673
6794
|
confirmParams.accept = () => {
|
|
5674
6795
|
instance.state = ActionInstanceStateEnum.RunConfirmationEndAccept;
|
|
@@ -5678,8 +6799,8 @@ class MngActionExecutorService {
|
|
|
5678
6799
|
instance.state = ActionInstanceStateEnum.RunConfirmationEndReject;
|
|
5679
6800
|
this.deactivateAction(instance);
|
|
5680
6801
|
};
|
|
5681
|
-
if (
|
|
5682
|
-
confirmParams =
|
|
6802
|
+
if (confirmationDescriptor.runConfirmationConfigMapFn) {
|
|
6803
|
+
confirmParams = confirmationDescriptor.runConfirmationConfigMapFn(context, confirmParams);
|
|
5683
6804
|
}
|
|
5684
6805
|
context.confirmation = confirmParams;
|
|
5685
6806
|
instance.state = ActionInstanceStateEnum.RunConfirmationStart;
|
|
@@ -5836,7 +6957,7 @@ class MngActionExecutorService {
|
|
|
5836
6957
|
if (actionUrl.startsWith('/')) {
|
|
5837
6958
|
actionUrl = actionUrl.substring(1);
|
|
5838
6959
|
}
|
|
5839
|
-
const actionUrlSegments = this.parametrize.transform(actionUrl, parameters.itemId, parameters.item, parameters.actionData);
|
|
6960
|
+
const actionUrlSegments = this.parametrize.transform(actionUrl, parameters.itemId, parameters.item, parameters.actionData).split('/');
|
|
5840
6961
|
instance.triggerRouteNavigation = from(this.router.navigate([baseUrl, ...actionUrlSegments], { relativeTo: parameters.route, queryParams: parsedUrl.queryParams }));
|
|
5841
6962
|
return instance;
|
|
5842
6963
|
}
|
|
@@ -6358,6 +7479,7 @@ class MngActionComponent {
|
|
|
6358
7479
|
this.isHostHidden = false;
|
|
6359
7480
|
this.inputDisabled = of(false);
|
|
6360
7481
|
this.inputLoading = of(false);
|
|
7482
|
+
this.selectedItems = [];
|
|
6361
7483
|
this.finishEventEmitter = new EventEmitter();
|
|
6362
7484
|
this.loadingSubject = new ReplaySubject(1);
|
|
6363
7485
|
this.$loading = this.loadingSubject.asObservable();
|
|
@@ -6380,7 +7502,7 @@ class MngActionComponent {
|
|
|
6380
7502
|
ngOnInit() {
|
|
6381
7503
|
var _a, _b;
|
|
6382
7504
|
this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
|
|
6383
|
-
this.hasNoTitle = this.action.
|
|
7505
|
+
this.hasNoTitle = this.action.buttonDescriptor.label === null;
|
|
6384
7506
|
this.isEnabledSubject.next(true);
|
|
6385
7507
|
this.isVisibleSubject.next(true);
|
|
6386
7508
|
this.isPermittedSubject.next(true);
|
|
@@ -6403,11 +7525,14 @@ class MngActionComponent {
|
|
|
6403
7525
|
this.isHostHidden = !isVisible || !isPermitted;
|
|
6404
7526
|
});
|
|
6405
7527
|
this.subscriptions.push(hostVisibilitySubscription);
|
|
6406
|
-
this.buttonClass = this.action.
|
|
7528
|
+
this.buttonClass = this.action.buttonDescriptor.styleClass.getButtonClass(this.hasNoTitle);
|
|
6407
7529
|
}
|
|
6408
7530
|
ngOnChanges(changes) {
|
|
6409
|
-
var _a, _b, _c, _d, _e, _f;
|
|
6410
|
-
if (!((_b = (_a = changes['item']) === null || _a === void 0 ? void 0 : _a.firstChange) !== null && _b !== void 0 ? _b : true) ||
|
|
7531
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7532
|
+
if (!((_b = (_a = changes['item']) === null || _a === void 0 ? void 0 : _a.firstChange) !== null && _b !== void 0 ? _b : true) ||
|
|
7533
|
+
!((_d = (_c = changes['itemId']) === null || _c === void 0 ? void 0 : _c.firstChange) !== null && _d !== void 0 ? _d : true) ||
|
|
7534
|
+
!((_f = (_e = changes['actionData']) === null || _e === void 0 ? void 0 : _e.firstChange) !== null && _f !== void 0 ? _f : true) ||
|
|
7535
|
+
(this.action.hasItemsSelection && !((_h = (_g = changes['selectedItems']) === null || _g === void 0 ? void 0 : _g.firstChange) !== null && _h !== void 0 ? _h : true))) {
|
|
6411
7536
|
this.processSubscriptions();
|
|
6412
7537
|
}
|
|
6413
7538
|
}
|
|
@@ -6429,11 +7554,16 @@ class MngActionComponent {
|
|
|
6429
7554
|
.withQueryParam(this.queryParam)
|
|
6430
7555
|
.withRoute(this.route)
|
|
6431
7556
|
.withViewContainer(this.viewContainer)
|
|
6432
|
-
.withSourceComponent(this)
|
|
7557
|
+
.withSourceComponent(this)
|
|
7558
|
+
.withSelectedItems(this.selectedItems);
|
|
6433
7559
|
const instance = this.actionExecutor.triggerAction(this.action, parameters);
|
|
6434
7560
|
this.subscriptions.push(instance.result$.subscribe({
|
|
6435
7561
|
next: () => {
|
|
7562
|
+
var _a;
|
|
6436
7563
|
this.finishEventEmitter.next(instance);
|
|
7564
|
+
if (this.action.hasItemsSelection) {
|
|
7565
|
+
(_a = this.viewContainerService) === null || _a === void 0 ? void 0 : _a.triggerTableReload({});
|
|
7566
|
+
}
|
|
6437
7567
|
}
|
|
6438
7568
|
}));
|
|
6439
7569
|
this.subscriptions.push(instance.error$.subscribe({
|
|
@@ -6454,11 +7584,14 @@ class MngActionComponent {
|
|
|
6454
7584
|
return `${action.actionName}_${this.cmpId}`;
|
|
6455
7585
|
}
|
|
6456
7586
|
processSubscriptions() {
|
|
6457
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
7587
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6458
7588
|
const parameters = new ActionParameters(this.itemId, this.item)
|
|
6459
7589
|
.withActionData(this.actionData)
|
|
6460
7590
|
.withViewContainer((_a = this.viewContainer) !== null && _a !== void 0 ? _a : undefined)
|
|
6461
7591
|
.withSourceComponent(this);
|
|
7592
|
+
if (this.action.hasItemsSelection) {
|
|
7593
|
+
parameters.withSelectedItems(this.selectedItems);
|
|
7594
|
+
}
|
|
6462
7595
|
const context = this.actionExecutor.prepareActionContextValidation(this.action, parameters, this.dataProvider);
|
|
6463
7596
|
if (typeof this.action.isVisibleFunction === 'function') {
|
|
6464
7597
|
(_b = this.isVisibleSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
@@ -6483,21 +7616,21 @@ class MngActionComponent {
|
|
|
6483
7616
|
}
|
|
6484
7617
|
if (!this.hasNoTitle) {
|
|
6485
7618
|
(_f = this.labelSubscription) === null || _f === void 0 ? void 0 : _f.unsubscribe();
|
|
6486
|
-
this.labelSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'title', (
|
|
7619
|
+
this.labelSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'title', (_g = this.action.buttonDescriptor.label) !== null && _g !== void 0 ? _g : undefined, this.item).subscribe({
|
|
6487
7620
|
next: i18n => this.labelSubject.next(i18n)
|
|
6488
7621
|
});
|
|
6489
7622
|
}
|
|
6490
|
-
(
|
|
6491
|
-
this.tooltipSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip',
|
|
7623
|
+
(_h = this.tooltipSubscription) === null || _h === void 0 ? void 0 : _h.unsubscribe();
|
|
7624
|
+
this.tooltipSubscription = I18nUtils.Action.getAsync(this.translate, this.action, 'tooltip', this.action.buttonDescriptor.tooltip, this.item).subscribe({
|
|
6492
7625
|
next: i18n => this.tooltipSubject.next(i18n)
|
|
6493
7626
|
});
|
|
6494
7627
|
}
|
|
6495
7628
|
}
|
|
6496
7629
|
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 });
|
|
6497
|
-
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
|
|
7630
|
+
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"], selectedItems: "selectedItems" }, 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 });
|
|
6498
7631
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionComponent, decorators: [{
|
|
6499
7632
|
type: Component,
|
|
6500
|
-
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
|
|
7633
|
+
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"] }]
|
|
6501
7634
|
}], ctorParameters: function () {
|
|
6502
7635
|
return [{ type: i1.ActivatedRoute }, { type: i1$2.TranslateService }, { type: MngAuthorizationService }, { type: MngActionExecutorService }, { type: i2.ConfirmationService }, { type: MngViewContainerComponentService, decorators: [{
|
|
6503
7636
|
type: Optional
|
|
@@ -6529,6 +7662,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
6529
7662
|
}], viewContainerInit: [{
|
|
6530
7663
|
type: Input,
|
|
6531
7664
|
args: ['viewContainer']
|
|
7665
|
+
}], selectedItems: [{
|
|
7666
|
+
type: Input
|
|
6532
7667
|
}], finishEventEmitter: [{
|
|
6533
7668
|
type: Output,
|
|
6534
7669
|
args: ['finish']
|
|
@@ -6787,13 +7922,14 @@ class MngFormEditorComponent {
|
|
|
6787
7922
|
if (field && field.setter) {
|
|
6788
7923
|
const splitPath = field.property.split('.');
|
|
6789
7924
|
let fieldValue = formValue;
|
|
6790
|
-
for (let i = 0; i < splitPath.length; i++) {
|
|
7925
|
+
for (let i = 0; i < splitPath.length - 1; i++) {
|
|
6791
7926
|
const currentSubPath = splitPath[i];
|
|
6792
7927
|
if (typeof fieldValue[currentSubPath] !== 'object') {
|
|
6793
7928
|
fieldValue[currentSubPath] = {};
|
|
6794
7929
|
}
|
|
6795
7930
|
fieldValue = fieldValue[currentSubPath];
|
|
6796
7931
|
}
|
|
7932
|
+
fieldValue = fieldValue[splitPath[splitPath.length - 1]];
|
|
6797
7933
|
field.setter(formValue, fieldValue);
|
|
6798
7934
|
}
|
|
6799
7935
|
});
|
|
@@ -7466,11 +8602,11 @@ class MngActionEditorComponent {
|
|
|
7466
8602
|
this.setTitle();
|
|
7467
8603
|
for (const action of this.action.editorActions) {
|
|
7468
8604
|
if (action instanceof ActionEditorSubmitDescriptor) {
|
|
7469
|
-
if (typeof action.icon === 'undefined') {
|
|
7470
|
-
action.withIcon(action.submitType === ActionEditorSubmitTypeEnum.Submit ? 'pi pi-check' : 'pi pi-times');
|
|
8605
|
+
if (typeof action.buttonDescriptor.icon === 'undefined') {
|
|
8606
|
+
action.buttonDescriptor.withIcon(action.submitType === ActionEditorSubmitTypeEnum.Submit ? 'pi pi-check' : 'pi pi-times');
|
|
7471
8607
|
}
|
|
7472
|
-
if (typeof action.
|
|
7473
|
-
action.
|
|
8608
|
+
if (typeof action.buttonDescriptor.label === 'undefined') {
|
|
8609
|
+
action.buttonDescriptor.withLabel(action.submitType === ActionEditorSubmitTypeEnum.Submit ? 'general.save' : this.isDialog ? 'general.close' : 'general.cancel');
|
|
7474
8610
|
}
|
|
7475
8611
|
// assign run operations
|
|
7476
8612
|
action.withRunNotificationSuccess(undefined, undefined, false);
|
|
@@ -7598,7 +8734,7 @@ class MngActionEditorComponent {
|
|
|
7598
8734
|
}
|
|
7599
8735
|
}
|
|
7600
8736
|
MngActionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, deps: [{ token: i0.Injector }, { token: i1$2.TranslateService }, { token: MngActionExecutorService }, { token: MngCommonsService }, { token: MngNavigationService }, { token: i3.DynamicDialogRef, optional: true }, { token: i3.DynamicDialogConfig, optional: true }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
7601
|
-
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "component", type: i7$1.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8737
|
+
MngActionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngActionEditorComponent, selector: "mng-action-editor", inputs: { action: "action", itemId: "itemId", item: "item", actionData: "actionData", dataProvider: "dataProvider", viewContainerInit: ["viewContainer", "viewContainerInit"] }, outputs: { actionRunEventEmitter: "actionSubmit", actionCancelEventEmitter: "actionCancel" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "submitButtonElementRef", first: true, predicate: ["submitButton"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: MngFormEditorComponent, descendants: true }], ngImport: i0, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "component", type: i7$1.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: MngFormEditorComponent, selector: "mng-form-editor", inputs: ["descriptor", "submitLoading", "item", "isSubmitButtonVisible", "isFormDisabled"], outputs: ["formSubmit"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7602
8738
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngActionEditorComponent, decorators: [{
|
|
7603
8739
|
type: Component,
|
|
7604
8740
|
args: [{ selector: 'mng-action-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<h5 *ngIf=\"!isDialog && title\">{{ title }}</h5>\n<div class=\"h-full flex flex-column\">\n <div class=\"flex-grow-1\" *ngIf=\"toolbarLeftActions.length > 0 || toolbarRightActions.length > 0\">\n <p-toolbar styleClass=\"mng-action-editor-toolbar\">\n <ng-template pTemplate=\"left\">\n <mng-action *ngFor=\"let action of toolbarLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </ng-template>\n </p-toolbar>\n </div>\n\n <div class=\"flex-grow-1\">\n <div class=\"text-center\" *ngIf=\"loading$ | async\">\n <p-progressSpinner [style]=\"{width: '3rem', height: '3rem'}\" strokeWidth=\"3\"></p-progressSpinner>\n </div>\n <mng-form-editor *ngIf=\"action.editorDescriptor && (loading$ | async) === false\" [descriptor]=\"action.editorDescriptor\" [item]=\"item\" (formSubmit)=\"onSubmit($event)\">\n </mng-form-editor>\n </div>\n\n <div class=\"flex flex-row justify-content-between\">\n <div>\n <mng-action *ngFor=\"let action of footerLeftActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n <div>\n <mng-action *ngFor=\"let action of footerRightActions\" [action]=\"action\" [disabled]=\"submitLoading$\" [viewContainer]=\"viewContainer\"></mng-action>\n </div>\n </div>\n</div>\n" }]
|
|
@@ -7640,6 +8776,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
7640
8776
|
args: [MngFormEditorComponent]
|
|
7641
8777
|
}] } });
|
|
7642
8778
|
|
|
8779
|
+
class MngButtonComponent {
|
|
8780
|
+
constructor() {
|
|
8781
|
+
this.clickEmitter = new EventEmitter();
|
|
8782
|
+
this.focusEmitter = new EventEmitter();
|
|
8783
|
+
this.blurEmitter = new EventEmitter();
|
|
8784
|
+
this.buttonClass = 'p-button';
|
|
8785
|
+
}
|
|
8786
|
+
ngOnInit() {
|
|
8787
|
+
this.buttonClass = `${this.descriptor.styleClass.getButtonClass(this.descriptor.label == null)}`;
|
|
8788
|
+
}
|
|
8789
|
+
onClick(event) {
|
|
8790
|
+
var _a, _b;
|
|
8791
|
+
this.clickEmitter.next(event);
|
|
8792
|
+
(_b = (_a = this.descriptor).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
8793
|
+
}
|
|
8794
|
+
onFocus(event) {
|
|
8795
|
+
var _a, _b;
|
|
8796
|
+
this.focusEmitter.next(event);
|
|
8797
|
+
(_b = (_a = this.descriptor).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
8798
|
+
}
|
|
8799
|
+
onBlur(event) {
|
|
8800
|
+
var _a, _b;
|
|
8801
|
+
this.blurEmitter.next(event);
|
|
8802
|
+
(_b = (_a = this.descriptor).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
8803
|
+
}
|
|
8804
|
+
}
|
|
8805
|
+
MngButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8806
|
+
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 });
|
|
8807
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngButtonComponent, decorators: [{
|
|
8808
|
+
type: Component,
|
|
8809
|
+
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" }]
|
|
8810
|
+
}], propDecorators: { descriptor: [{
|
|
8811
|
+
type: Input
|
|
8812
|
+
}], clickEmitter: [{
|
|
8813
|
+
type: Output,
|
|
8814
|
+
args: ['buttonClick']
|
|
8815
|
+
}], focusEmitter: [{
|
|
8816
|
+
type: Output,
|
|
8817
|
+
args: ['buttonFocus']
|
|
8818
|
+
}], blurEmitter: [{
|
|
8819
|
+
type: Output,
|
|
8820
|
+
args: ['buttonBlur']
|
|
8821
|
+
}] } });
|
|
8822
|
+
|
|
7643
8823
|
class MngFormlyFieldAutocompleteComponent extends FieldType {
|
|
7644
8824
|
constructor() {
|
|
7645
8825
|
super(...arguments);
|
|
@@ -7885,10 +9065,10 @@ class MngTableColumnValueComponent {
|
|
|
7885
9065
|
}
|
|
7886
9066
|
}
|
|
7887
9067
|
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 });
|
|
7888
|
-
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 });
|
|
9068
|
+
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 });
|
|
7889
9069
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableColumnValueComponent, decorators: [{
|
|
7890
9070
|
type: Component,
|
|
7891
|
-
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"] }]
|
|
9071
|
+
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"] }]
|
|
7892
9072
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.MessageService }, { type: i1$2.TranslateService }]; }, propDecorators: { descriptor: [{
|
|
7893
9073
|
type: Input
|
|
7894
9074
|
}], item: [{
|
|
@@ -7916,8 +9096,8 @@ class MngTableColumnFilterComponent {
|
|
|
7916
9096
|
this.primeMatchModes = null;
|
|
7917
9097
|
}
|
|
7918
9098
|
ngOnInit() {
|
|
7919
|
-
var _a;
|
|
7920
|
-
this.primeDefaultMatchMode = this.descriptor.defaultFilterMatchMode;
|
|
9099
|
+
var _a, _b;
|
|
9100
|
+
this.primeDefaultMatchMode = (_a = this.descriptor.defaultFilterMatchMode) !== null && _a !== void 0 ? _a : FilterMatchModeEnum.Equals;
|
|
7921
9101
|
switch (this.descriptor.filterType) {
|
|
7922
9102
|
case FilterTypeEnum.Boolean:
|
|
7923
9103
|
this.primeType = 'boolean';
|
|
@@ -7936,6 +9116,9 @@ class MngTableColumnFilterComponent {
|
|
|
7936
9116
|
this.lookupDescriptor = this.descriptor;
|
|
7937
9117
|
this.primeField = `${this.descriptor.property}${this.lookupDescriptor.itemsValueProperty ? `.${this.lookupDescriptor.itemsValueProperty}` : ''}`;
|
|
7938
9118
|
this.primeMatchModes = [{ value: FilterMatchModeEnum.Equals, label: this.primeConfig.getTranslation(FilterMatchModeEnum.Equals) }];
|
|
9119
|
+
if (this.lookupDescriptor.multiselect) {
|
|
9120
|
+
this.primeDefaultMatchMode = FilterMatchModeEnum.In;
|
|
9121
|
+
}
|
|
7939
9122
|
break;
|
|
7940
9123
|
case FilterTypeEnum.String:
|
|
7941
9124
|
this.primeType = 'text';
|
|
@@ -7947,7 +9130,7 @@ class MngTableColumnFilterComponent {
|
|
|
7947
9130
|
if (!this.primeMatchModes.map(matchMode => matchMode.value).includes(this.primeDefaultMatchMode)) {
|
|
7948
9131
|
this.primeDefaultMatchMode = this.descriptor.matchModes[0];
|
|
7949
9132
|
}
|
|
7950
|
-
this.primeShowMatchMode = ((
|
|
9133
|
+
this.primeShowMatchMode = ((_b = this.primeMatchModes) === null || _b === void 0 ? void 0 : _b.length) > 1;
|
|
7951
9134
|
}
|
|
7952
9135
|
if (this.display === TableFilterDisplayEnum.Menu) {
|
|
7953
9136
|
this.primeDisplay = 'menu';
|
|
@@ -8041,6 +9224,7 @@ class MngTableComponent {
|
|
|
8041
9224
|
this.dataProviderLatestLazyLoadEventVersion = 0;
|
|
8042
9225
|
this.dataProviderLatestQueryParamVersion = 0;
|
|
8043
9226
|
// filter, sort
|
|
9227
|
+
this.hasColumnFilters = false;
|
|
8044
9228
|
this.isFilterChanged = false;
|
|
8045
9229
|
this.isSortChanged = false;
|
|
8046
9230
|
this.filterDescriptors = [];
|
|
@@ -8051,12 +9235,16 @@ class MngTableComponent {
|
|
|
8051
9235
|
this.subscriptions = [];
|
|
8052
9236
|
}
|
|
8053
9237
|
ngOnInit() {
|
|
8054
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
9238
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
8055
9239
|
this.viewContainer = (_b = (_a = this.viewContainerInit) !== null && _a !== void 0 ? _a : this.viewContainerService) !== null && _b !== void 0 ? _b : undefined;
|
|
8056
|
-
|
|
9240
|
+
if (!(this.initialDescriptor instanceof TableDynamicDescriptor)) {
|
|
9241
|
+
this.descriptor = this.initialDescriptor;
|
|
9242
|
+
}
|
|
8057
9243
|
// map row settings
|
|
8058
|
-
this.
|
|
8059
|
-
this.
|
|
9244
|
+
this.filterDescriptors = (_d = (_c = this.descriptor) === null || _c === void 0 ? void 0 : _c.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor)) !== null && _d !== void 0 ? _d : [];
|
|
9245
|
+
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9246
|
+
this.rows = (_f = (_e = this.descriptor) === null || _e === void 0 ? void 0 : _e.defaultNumRows) !== null && _f !== void 0 ? _f : 25;
|
|
9247
|
+
this.rowsPerPageOptions = (_h = (_g = this.descriptor) === null || _g === void 0 ? void 0 : _g.rowsPerPageOptions) !== null && _h !== void 0 ? _h : [25, 50, 100];
|
|
8060
9248
|
// process actions
|
|
8061
9249
|
for (const action of this.actions) {
|
|
8062
9250
|
switch (action.position) {
|
|
@@ -8070,14 +9258,14 @@ class MngTableComponent {
|
|
|
8070
9258
|
}
|
|
8071
9259
|
this.showInlineActionsColumn = typeof this.columnActionComponent !== 'undefined' || this.rowInlineActions.length > 0;
|
|
8072
9260
|
// define all styles
|
|
8073
|
-
this.className = this.descriptor.className;
|
|
8074
|
-
this.tableFullHeightOffset = (
|
|
8075
|
-
this.rowHeight = (
|
|
9261
|
+
this.className = (_k = (_j = this.descriptor) === null || _j === void 0 ? void 0 : _j.className) !== null && _k !== void 0 ? _k : '';
|
|
9262
|
+
this.tableFullHeightOffset = (_m = (_l = this.descriptor) === null || _l === void 0 ? void 0 : _l.tableFullHeightOffset) !== null && _m !== void 0 ? _m : null;
|
|
9263
|
+
this.rowHeight = (_p = (_o = this.descriptor) === null || _o === void 0 ? void 0 : _o.rowHeight) !== null && _p !== void 0 ? _p : null;
|
|
8076
9264
|
if (typeof this.isColumnClickable === 'undefined') {
|
|
8077
9265
|
// define if cell click is being observed via output
|
|
8078
9266
|
this.isColumnClickable = this.rowClickActions.length > 0 || this.cellClickEventEmitter.observed;
|
|
8079
9267
|
}
|
|
8080
|
-
switch (this.descriptor.size) {
|
|
9268
|
+
switch ((_q = this.descriptor) === null || _q === void 0 ? void 0 : _q.size) {
|
|
8081
9269
|
case TableSizeEnum.Small:
|
|
8082
9270
|
this.className += ' p-datatable-sm';
|
|
8083
9271
|
break;
|
|
@@ -8085,18 +9273,18 @@ class MngTableComponent {
|
|
|
8085
9273
|
this.className += ' p-datatable-lg';
|
|
8086
9274
|
break;
|
|
8087
9275
|
}
|
|
8088
|
-
if (this.descriptor.hasGridlines) {
|
|
9276
|
+
if ((_r = this.descriptor) === null || _r === void 0 ? void 0 : _r.hasGridlines) {
|
|
8089
9277
|
this.className += ' p-datatable-gridlines';
|
|
8090
9278
|
}
|
|
8091
|
-
if (!this.columnActionMinWidth) {
|
|
9279
|
+
if (this.descriptor && !this.columnActionMinWidth) {
|
|
8092
9280
|
this.columnActionMinWidth = StylesUtil.calculateTableColumnActionWidth(this.descriptor, this.rowInlineActions);
|
|
8093
9281
|
}
|
|
8094
9282
|
// check if infinite scroll
|
|
8095
|
-
if (this.descriptor.paginationMode === TablePaginationModeEnum.InfiniteScroll) {
|
|
9283
|
+
if (((_s = this.descriptor) === null || _s === void 0 ? void 0 : _s.paginationMode) === TablePaginationModeEnum.InfiniteScroll) {
|
|
8096
9284
|
this.infiniteScroll = true;
|
|
8097
9285
|
this.scrollHeight = 'flex';
|
|
8098
|
-
this.tableFullHeightOffset = (
|
|
8099
|
-
this.rowHeight = (
|
|
9286
|
+
this.tableFullHeightOffset = (_t = this.descriptor.tableFullHeightOffset) !== null && _t !== void 0 ? _t : 315;
|
|
9287
|
+
this.rowHeight = (_u = this.descriptor.rowHeight) !== null && _u !== void 0 ? _u : 45;
|
|
8100
9288
|
this.useQueryParams = false;
|
|
8101
9289
|
}
|
|
8102
9290
|
// check if data provider is supplied, if is, use it primarily
|
|
@@ -8114,6 +9302,12 @@ class MngTableComponent {
|
|
|
8114
9302
|
if (this.dataProvider.serviceType) {
|
|
8115
9303
|
this.dataProviderService = this.injector.get(this.dataProvider.serviceType);
|
|
8116
9304
|
}
|
|
9305
|
+
const reloadSubscription = this.dataProvider.getAllReload$.subscribe({
|
|
9306
|
+
next: () => {
|
|
9307
|
+
this.reload();
|
|
9308
|
+
}
|
|
9309
|
+
});
|
|
9310
|
+
this.subscriptions.push(reloadSubscription);
|
|
8117
9311
|
}
|
|
8118
9312
|
else {
|
|
8119
9313
|
// if query result is provided, use it as secondary source or else try to use items
|
|
@@ -8131,7 +9325,7 @@ class MngTableComponent {
|
|
|
8131
9325
|
return queryResult;
|
|
8132
9326
|
}));
|
|
8133
9327
|
if (!isObservable(this.items)) {
|
|
8134
|
-
this.itemsSubject.next((
|
|
9328
|
+
this.itemsSubject.next((_v = this.items) !== null && _v !== void 0 ? _v : []);
|
|
8135
9329
|
}
|
|
8136
9330
|
}
|
|
8137
9331
|
if (typeof this.loading !== 'undefined') {
|
|
@@ -8140,7 +9334,7 @@ class MngTableComponent {
|
|
|
8140
9334
|
}
|
|
8141
9335
|
const initialQueryParamMap = this.route.snapshot.queryParamMap;
|
|
8142
9336
|
if (this.useQueryParams &&
|
|
8143
|
-
((!initialQueryParamMap.has('sort') && this.descriptor.hasDefaultSort) ||
|
|
9337
|
+
((!initialQueryParamMap.has('sort') && ((_w = this.descriptor) === null || _w === void 0 ? void 0 : _w.hasDefaultSort)) ||
|
|
8144
9338
|
(!initialQueryParamMap.has('filter') && this.filterDescriptors.some(fd => fd.hasDefaultValue)))) {
|
|
8145
9339
|
// default sort/filters are applied, no additional filtering/sorting is specified in query param
|
|
8146
9340
|
// redirect must be done at first step
|
|
@@ -8190,7 +9384,12 @@ class MngTableComponent {
|
|
|
8190
9384
|
}
|
|
8191
9385
|
reload(emitEvent = false, resetParams = false) {
|
|
8192
9386
|
var _a;
|
|
8193
|
-
|
|
9387
|
+
const queryParamsBuilder = resetParams
|
|
9388
|
+
? MediusQueryParamBuilder.create(this.rowsPerPageOptions[0], 0)
|
|
9389
|
+
: MediusQueryParamBuilder.createFromExisting((_a = this.dataProviderLatestQueryParam) !== null && _a !== void 0 ? _a : new MediusQueryParam())
|
|
9390
|
+
.withItemsPerPage(this.rows)
|
|
9391
|
+
.withItemsOffset(this.offset);
|
|
9392
|
+
this.loadTableWithDataProvider(queryParamsBuilder.build(), emitEvent);
|
|
8194
9393
|
}
|
|
8195
9394
|
onTableLazyLoad(event) {
|
|
8196
9395
|
this.dataProviderLatestLazyLoadEvent = event;
|
|
@@ -8257,9 +9456,17 @@ class MngTableComponent {
|
|
|
8257
9456
|
}
|
|
8258
9457
|
this.dataProviderLatestQueryParam = queryParam;
|
|
8259
9458
|
this.dataProviderLatestQueryParamVersion++;
|
|
9459
|
+
MediusRestUtil.modifyFilterProperties(queryParam, this.filterDescriptors);
|
|
8260
9460
|
this.dataProviderSubscription = (_b = this.dataProvider) === null || _b === void 0 ? void 0 : _b.getAll(queryParam, this.dataProviderService).subscribe({
|
|
8261
9461
|
next: res => {
|
|
8262
9462
|
var _a, _b, _c;
|
|
9463
|
+
if (this.initialDescriptor instanceof TableDynamicDescriptor) {
|
|
9464
|
+
this.descriptor = this.initialDescriptor.toTableDescriptorFromData(res);
|
|
9465
|
+
this.filterDescriptors = this.descriptor.columns.filter(c => typeof c.filterDescriptor !== 'undefined').map(c => c.filterDescriptor);
|
|
9466
|
+
this.hasColumnFilters = this.filterDescriptors.length > 0;
|
|
9467
|
+
// } else {
|
|
9468
|
+
// this.descriptor = this.initialDescriptor.onDataReceivedTypeBuilding(res);
|
|
9469
|
+
}
|
|
8263
9470
|
if (this.infiniteScroll) {
|
|
8264
9471
|
if (this.isFilterChanged || this.isSortChanged) {
|
|
8265
9472
|
this.dataProviderInfiniteScrollItems = [];
|
|
@@ -8275,6 +9482,7 @@ class MngTableComponent {
|
|
|
8275
9482
|
this.dataProviderLoadingSubject.next(false);
|
|
8276
9483
|
},
|
|
8277
9484
|
error: err => {
|
|
9485
|
+
// TODO: check what happens on error with no model iniside descriptor
|
|
8278
9486
|
NotificationUtil.tableNotificationError(this.translate, this.descriptor, err, this.viewContainer);
|
|
8279
9487
|
const emptyQueryResult = new MediusQueryResult();
|
|
8280
9488
|
emptyQueryResult.pageData = [];
|
|
@@ -8320,7 +9528,7 @@ class MngTableComponent {
|
|
|
8320
9528
|
const applyDefaultFilters = ((_b = (_a = params.filterParams) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0;
|
|
8321
9529
|
this.filterDescriptors.forEach(f => {
|
|
8322
9530
|
let matchMode;
|
|
8323
|
-
if (f.
|
|
9531
|
+
if (f.defaultFilterMatchMode) {
|
|
8324
9532
|
matchMode = f.defaultFilterMatchMode;
|
|
8325
9533
|
}
|
|
8326
9534
|
else {
|
|
@@ -8372,7 +9580,7 @@ class MngTableComponent {
|
|
|
8372
9580
|
return primeFilterMeta;
|
|
8373
9581
|
}
|
|
8374
9582
|
createSortMeta(mediusQueryParam) {
|
|
8375
|
-
var _a, _b, _c;
|
|
9583
|
+
var _a, _b, _c, _d;
|
|
8376
9584
|
let params;
|
|
8377
9585
|
if (!mediusQueryParam) {
|
|
8378
9586
|
params = new MediusQueryParam();
|
|
@@ -8382,7 +9590,7 @@ class MngTableComponent {
|
|
|
8382
9590
|
}
|
|
8383
9591
|
let sortMeta;
|
|
8384
9592
|
const applyDefaultSorts = ((_b = (_a = params.sortProperty) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0;
|
|
8385
|
-
if (applyDefaultSorts && this.descriptor.hasDefaultSort) {
|
|
9593
|
+
if (applyDefaultSorts && ((_c = this.descriptor) === null || _c === void 0 ? void 0 : _c.hasDefaultSort)) {
|
|
8386
9594
|
sortMeta = this.descriptor.defaultSortProperty.map((p, idx) => ({
|
|
8387
9595
|
field: p,
|
|
8388
9596
|
order: this.descriptor.defaultSortAsc[idx] ? 1 : -1
|
|
@@ -8391,7 +9599,7 @@ class MngTableComponent {
|
|
|
8391
9599
|
else {
|
|
8392
9600
|
sortMeta = [];
|
|
8393
9601
|
}
|
|
8394
|
-
(
|
|
9602
|
+
(_d = params.sortProperty) === null || _d === void 0 ? void 0 : _d.forEach((s, idx) => {
|
|
8395
9603
|
var _a, _b, _c, _d;
|
|
8396
9604
|
const existingIndex = sortMeta.findIndex(value => value.field === s);
|
|
8397
9605
|
if (existingIndex > -1) {
|
|
@@ -8428,16 +9636,17 @@ class MngTableComponent {
|
|
|
8428
9636
|
}
|
|
8429
9637
|
}
|
|
8430
9638
|
MngTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, deps: [{ token: i0.Injector }, { token: i1.Router }, { token: i1.ActivatedRoute }, { token: i1$2.TranslateService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8431
|
-
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { descriptor: "descriptor", items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor.dataKeyProperty)\"\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 [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor.hasHover\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\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=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [class]=\"col.headerClassName\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor.filterDisplay === filterDisplayRow\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor.model.idPropertyName ? item[descriptor.model.idPropertyName] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"descriptor.columns.length + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9639
|
+
MngTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableComponent, selector: "mng-table", inputs: { initialDescriptor: ["descriptor", "initialDescriptor"], items: "items", queryResult: "queryResult", loading: "loading", dataProvider: "dataProvider", useQueryParams: "useQueryParams", selectionMode: "selectionMode", selectionEnabled: "selectionEnabled", actions: "actions", isColumnClickable: "isColumnClickable", viewContainerInit: ["viewContainer", "viewContainerInit"], captionComponent: "captionComponent", columnActionComponent: "columnActionComponent", columnActionMinWidth: "columnActionMinWidth" }, outputs: { loadEventEmitter: "tableLoad", cellClickEventEmitter: "cellClick", selectionChangeEventEmitter: "selectionChange", captionCmpInstEventEmitter: "captionComponentInstance", columnActionCmpInstEventEmitter: "columnActionComponentInstance" }, queries: [{ propertyName: "templates", predicate: MngTemplateDirective }], viewQueries: [{ propertyName: "primeTable", first: true, predicate: Table, descendants: true }, { propertyName: "components", predicate: MngComponentDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$4.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$4.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i6$4.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6$4.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i6$4.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$4.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: MngComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "inputs"], outputs: ["instanceCreated"] }, { kind: "component", type: MngTableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "component", type: MngTableColumnFilterComponent, selector: "mng-table-column-filter", inputs: ["descriptor", "display"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MngI18nPropertyPipe, name: "i18nProperty" }, { kind: "pipe", type: MngClassMapPipe, name: "mngClassMapPipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8432
9640
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableComponent, decorators: [{
|
|
8433
9641
|
type: Component,
|
|
8434
|
-
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor
|
|
9642
|
+
args: [{ selector: 'mng-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [style.height]=\"scrollHeight === 'flex' ? 'calc(100vh - ' + tableFullHeightOffset + 'px)' : null\">\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n <p-table\n *ngIf=\"!useQueryParams || (useQueryParamsInitialized$ | async)\"\n [value]=\"infiniteScroll ? dataProviderInfiniteScrollItems : (queryResult$ | async)?.pageData ?? []\"\n [dataKey]=\"$any(descriptor?.dataKeyProperty ?? null)\"\n [lazy]=\"useDataProvider\"\n [loading]=\"(loading$ | async) ?? false\"\n [paginator]=\"useDataProvider && !infiniteScroll\"\n [rows]=\"$any(infiniteScroll ? 20 : rows)\"\n [first]=\"$any(infiniteScroll ? 0 : offset)\"\n [totalRecords]=\"$any(infiniteScroll ? null : (queryResult$ | async)?.allDataCount ?? 0)\"\n [rowsPerPageOptions]=\"$any(infiniteScroll ? null : rowsPerPageOptions)\"\n [showCurrentPageReport]=\"!infiniteScroll\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"$any(multiSortMeta)\"\n [filters]=\"filterMetadata\"\n [(selection)]=\"selection\"\n (selectionChange)=\"onSelectionChange($event)\"\n [scrollable]=\"infiniteScroll\"\n [virtualScroll]=\"infiniteScroll\"\n [virtualRowHeight]=\"$any(rowHeight)\"\n [scrollHeight]=\"$any(scrollHeight)\"\n [selectionMode]=\"$any(selectionEnabled ? selectionMode : null)\"\n [rowHover]=\"descriptor?.hasHover ?? true\"\n [styleClass]=\"className\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onSort)=\"onTableSort($event)\"\n (onFilter)=\"onTableFilter($event)\"\n sortMode=\"multiple\"\n responsiveLayout=\"scroll\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\">\n <ng-template *ngIf=\"captionTemplate || captionComponent || descriptor?.title\" pTemplate=\"caption\">\n <ng-container *ngIf=\"captionTemplate; else componentOrDefaultCaption\">\n <ng-container *ngTemplateOutlet=\"captionTemplate\"></ng-container>\n </ng-container>\n <ng-template #componentOrDefaultCaption>\n <div *ngIf=\"captionComponent; else defaultCaption\" [mngComponent]=\"captionComponent\" (instanceCreated)=\"onCaptionCmpInst($event)\"></div>\n <ng-template #defaultCaption>\n <h5 class=\"p-0 m-0\">{{ descriptor?.title }}</h5>\n </ng-template>\n </ng-template>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr *ngIf=\"!descriptor?.hideHeader\" class=\"mng-table-header\" [class]=\"descriptor?.headerClassName\">\n <th *ngIf=\"selectionEnabled && selectionMode === 'multiple'\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <ng-container *ngFor=\"let col of descriptor?.columns\">\n <th *ngIf=\"col.isSortEnabled\" [pSortableColumn]=\"col.property\" [style.width.%]=\"col.width\" [style.min-width.px]=\"col.minWidth\" [class]=\"col.headerClassName\">\n <div class=\"flex justify-content-between align-items-center\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <p-sortIcon [field]=\"col.property\"></p-sortIcon>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"!col.isSortEnabled\">\n {{ col.title ?? (col.property | i18nProperty: descriptor!.model) | translate }}\n <ng-container>\n <mng-table-column-filter\n *ngIf=\"col.filterDescriptor && descriptor!.filterDisplay === filterDisplayMenu\"\n class=\"ml-auto\"\n [display]=\"descriptor!.filterDisplay\"\n [descriptor]=\"col.filterDescriptor\">\n </mng-table-column-filter>\n </ng-container>\n </th>\n </ng-container>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n <tr *ngIf=\"descriptor?.filterDisplay === filterDisplayRow && hasColumnFilters\" class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"min-width: 36px\"></th>\n <th\n *ngFor=\"let col of descriptor?.columns\"\n [class]=\"(col.filterDescriptor ? 'mng-column-filter-' + col.filterDescriptor.filterType + ' ' : ' ') + col.filterDescriptor?.columnClassName\"\n [style.width.%]=\"col.filterDescriptor?.columnWidth ?? col.width\"\n [style.min-width.px]=\"col.filterDescriptor?.columnMinWidth ?? col.minWidth\">\n <div class=\"flex\" *ngIf=\"col.filterDescriptor\">\n <mng-table-column-filter [display]=\"descriptor!.filterDisplay\" [descriptor]=\"col.filterDescriptor\"></mng-table-column-filter>\n </div>\n </th>\n <th *ngIf=\"showInlineActionsColumn\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-item let-idx=\"rowIndex\">\n <tr [style.height.px]=\"rowHeight\" [class]=\"descriptor?.rowClassName | mngClassMapPipe: descriptor?.rowClassNameMapFn:item\">\n <td *ngIf=\"selectionEnabled && selectionMode === 'multiple'\" style=\"width: 3rem\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n <td *ngIf=\"selectionEnabled && selectionMode === 'single'\" style=\"width: 3rem\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n <td\n *ngFor=\"let col of descriptor?.columns\"\n (click)=\"onCellClick($event, col, item, idx)\"\n [class]=\"col.className\"\n [class.clickable]=\"isColumnClickable\"\n [style.width.%]=\"col.width\"\n [style.min-width.px]=\"col.minWidth\">\n <mng-table-column-value [descriptor]=\"col\" [item]=\"item\"></mng-table-column-value>\n </td>\n <td *ngIf=\"showInlineActionsColumn\" class=\"column-action text-right\" [style.min-width.px]=\"columnActionMinWidth\">\n <ng-container *ngIf=\"columnActionTemplate; else showColumnActionComponentOrDefault\">\n <ng-container *ngTemplateOutlet=\"columnActionTemplate; context: {rowItem: item, rowIndex: idx}\"></ng-container>\n </ng-container>\n <ng-template #showColumnActionComponentOrDefault>\n <span\n *ngIf=\"columnActionComponent; else defaultColumnActions\"\n [mngComponent]=\"columnActionComponent!\"\n (instanceCreated)=\"onColumnActionCmpInst($event)\"></span>\n </ng-template>\n <ng-template #defaultColumnActions>\n <mng-action\n *ngFor=\"let action of rowInlineActions\"\n [action]=\"action\"\n [item]=\"item\"\n [itemId]=\"descriptor?.model?.idPropertyName ? item[descriptor!.model!.idPropertyName!] : null\"\n [actionData]=\"{itemIndex: idx}\"\n (finish)=\"onActionFinish($event)\">\n </mng-action>\n </ng-template>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"loadingbody\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"emptymessage\">\n <tr [style.height.px]=\"rowHeight\">\n <td [attr.colspan]=\"(descriptor?.columns?.length ?? 0) + (showInlineActionsColumn ? 1 : 0) + (selectionEnabled ? 1 : 0)\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n" }]
|
|
8435
9643
|
}], ctorParameters: function () {
|
|
8436
9644
|
return [{ type: i0.Injector }, { type: i1.Router }, { type: i1.ActivatedRoute }, { type: i1$2.TranslateService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService, decorators: [{
|
|
8437
9645
|
type: Optional
|
|
8438
9646
|
}] }];
|
|
8439
|
-
}, propDecorators: {
|
|
8440
|
-
type: Input
|
|
9647
|
+
}, propDecorators: { initialDescriptor: [{
|
|
9648
|
+
type: Input,
|
|
9649
|
+
args: ['descriptor']
|
|
8441
9650
|
}], items: [{
|
|
8442
9651
|
type: Input
|
|
8443
9652
|
}], queryResult: [{
|
|
@@ -8506,6 +9715,8 @@ class MngTableviewComponent {
|
|
|
8506
9715
|
this.toolbarLeftActions = [];
|
|
8507
9716
|
this.toolbarRightActions = [];
|
|
8508
9717
|
this.subscriptions = [];
|
|
9718
|
+
this.hasItemSelectionAction = false;
|
|
9719
|
+
this.selectedItems = [];
|
|
8509
9720
|
}
|
|
8510
9721
|
ngOnInit() {
|
|
8511
9722
|
this.viewContainerService.actions = this.actions;
|
|
@@ -8533,6 +9744,7 @@ class MngTableviewComponent {
|
|
|
8533
9744
|
}
|
|
8534
9745
|
}
|
|
8535
9746
|
this.toolbarRightActions = this.toolbarRightActions.reverse();
|
|
9747
|
+
this.hasItemSelectionAction = [...this.toolbarLeftActions, ...this.toolbarRightActions].some(e => e.hasItemsSelection);
|
|
8536
9748
|
}
|
|
8537
9749
|
ngOnDestroy() {
|
|
8538
9750
|
this.subscriptions.forEach(s => s.unsubscribe());
|
|
@@ -8550,12 +9762,15 @@ class MngTableviewComponent {
|
|
|
8550
9762
|
onTableLoad(event) {
|
|
8551
9763
|
this.tableQueryParam = event.queryParam;
|
|
8552
9764
|
}
|
|
9765
|
+
selectionChange(selectedItems) {
|
|
9766
|
+
this.selectedItems = selectedItems;
|
|
9767
|
+
}
|
|
8553
9768
|
}
|
|
8554
9769
|
MngTableviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.MessageService }, { token: i1$2.TranslateService }, { token: i3.DialogService }, { token: i2.ConfirmationService }, { token: MngActionExecutorService }, { token: MngViewContainerComponentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
8555
|
-
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", 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\" [queryParam]=\"tableQueryParam\"
|
|
9770
|
+
MngTableviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", 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\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"actions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\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 </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7$4.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i6$2.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
8556
9771
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewComponent, decorators: [{
|
|
8557
9772
|
type: Component,
|
|
8558
|
-
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\" [queryParam]=\"tableQueryParam\"
|
|
9773
|
+
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\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n\n <ng-template pTemplate=\"right\">\n <mng-action *ngFor=\"let action of toolbarRightActions\" [action]=\"action\" [queryParam]=\"tableQueryParam\" [selectedItems]=\"selectedItems\"></mng-action>\n </ng-template>\n </p-toolbar>\n\n <mng-table\n [descriptor]=\"descriptor.table\"\n [dataProvider]=\"dataProvider\"\n [useQueryParams]=\"true\"\n [actions]=\"actions\"\n [selectionEnabled]=\"hasItemSelectionAction\"\n [selectionMode]=\"'multiple'\"\n (tableLoad)=\"onTableLoad($event)\"\n (selectionChange)=\"selectionChange($event)\">\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 </mng-table>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n" }]
|
|
8559
9774
|
}], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i2.MessageService }, { type: i1$2.TranslateService }, { type: i3.DialogService }, { type: i2.ConfirmationService }, { type: MngActionExecutorService }, { type: MngViewContainerComponentService }]; }, propDecorators: { descriptor: [{
|
|
8560
9775
|
type: Input
|
|
8561
9776
|
}], dataProvider: [{
|
|
@@ -8568,37 +9783,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
8568
9783
|
}] } });
|
|
8569
9784
|
|
|
8570
9785
|
class AMngTableviewRouteComponent {
|
|
9786
|
+
constructor() {
|
|
9787
|
+
this.route = inject(ActivatedRoute);
|
|
9788
|
+
}
|
|
9789
|
+
get routeData() {
|
|
9790
|
+
return this.route.snapshot.data;
|
|
9791
|
+
}
|
|
8571
9792
|
ngOnInit() {
|
|
8572
9793
|
this.descriptor = this.createTableviewDescriptor();
|
|
8573
9794
|
this.dataProvider = this.createTableviewDataProvider();
|
|
8574
9795
|
this.actions = this.createActionDescriptors();
|
|
8575
9796
|
}
|
|
8576
9797
|
createActionDescriptors() {
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
9798
|
+
return [
|
|
9799
|
+
this.createActionDescriptorForDetails(),
|
|
9800
|
+
this.createActionDescriptorForAdd(),
|
|
9801
|
+
this.createActionDescriptorForEdit(),
|
|
9802
|
+
this.createActionDescriptorForDelete(),
|
|
9803
|
+
this.createActionDescriptorForRefresh(),
|
|
9804
|
+
this.createActionDescriptorForExport()
|
|
9805
|
+
].filter(e => e != null);
|
|
8584
9806
|
}
|
|
8585
9807
|
createActionDescriptorForDetails(descriptor = this.descriptor.viewEditor) {
|
|
8586
|
-
return new ActionEditorDetailsDescriptor(descriptor);
|
|
9808
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDetails ? new ActionEditorDetailsDescriptor(descriptor) : null;
|
|
8587
9809
|
}
|
|
8588
9810
|
createActionDescriptorForAdd(descriptor = this.descriptor.addEditor) {
|
|
8589
|
-
return new ActionEditorAddDescriptor(descriptor);
|
|
9811
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasAdd ? new ActionEditorAddDescriptor(descriptor) : null;
|
|
8590
9812
|
}
|
|
8591
9813
|
createActionDescriptorForEdit(descriptor = this.descriptor.editEditor) {
|
|
8592
|
-
return new ActionEditorEditDescriptor(descriptor);
|
|
9814
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasEdit ? new ActionEditorEditDescriptor(descriptor) : null;
|
|
8593
9815
|
}
|
|
8594
9816
|
createActionDescriptorForDelete(descriptor = this.descriptor.model) {
|
|
8595
|
-
return new ActionDeleteDescriptor(descriptor);
|
|
9817
|
+
return !this.routeData.tableviewActions || this.routeData.tableviewActions.hasDelete ? new ActionDeleteDescriptor(descriptor) : null;
|
|
8596
9818
|
}
|
|
8597
9819
|
createActionDescriptorForExport(descriptor = this.descriptor.model) {
|
|
8598
|
-
|
|
9820
|
+
const action = new ActionDescriptor(descriptor, 'export')
|
|
8599
9821
|
.withRunFunction(ctx => {
|
|
8600
9822
|
const queryParamBuilder = ctx.parameters.queryParam ? MediusQueryParamBuilder.createFromExisting(ctx.parameters.queryParam) : MediusQueryParamBuilder.create();
|
|
8601
|
-
queryParamBuilder.withItemsOffset(0).withItemsPerPage(
|
|
9823
|
+
queryParamBuilder.withItemsOffset(0).withItemsPerPage(500);
|
|
8602
9824
|
ctx.parameters.withQueryParam(queryParamBuilder.build());
|
|
8603
9825
|
return ActionDataProviderUtil.runGetAllOrFail(ctx).pipe(map(res => {
|
|
8604
9826
|
var _a, _b;
|
|
@@ -8608,24 +9830,30 @@ class AMngTableviewRouteComponent {
|
|
|
8608
9830
|
return undefined;
|
|
8609
9831
|
}));
|
|
8610
9832
|
})
|
|
9833
|
+
.withPosition(ActionPositionEnum.ToolbarRight);
|
|
9834
|
+
action.buttonDescriptor.withIcon('pi pi-upload');
|
|
9835
|
+
return action;
|
|
9836
|
+
}
|
|
9837
|
+
createActionDescriptorForRefresh(descriptor = this.descriptor.model) {
|
|
9838
|
+
const action = new ActionDescriptor(descriptor, 'refresh')
|
|
8611
9839
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
8612
|
-
.
|
|
9840
|
+
.withPermissionsRouteType(Permissions.ActionTypes.READ)
|
|
9841
|
+
.withRunNotificationSuccess(undefined, undefined, false)
|
|
9842
|
+
.withRunFunction((ctx) => {
|
|
9843
|
+
ctx.parameters.viewContainer.triggerTableReload({});
|
|
9844
|
+
return of(null);
|
|
9845
|
+
});
|
|
9846
|
+
action.buttonDescriptor.withIcon('pi pi-refresh').styleClass.withActionLevel(ActionLevelEnum.Secondary);
|
|
9847
|
+
return action;
|
|
8613
9848
|
}
|
|
8614
9849
|
}
|
|
8615
9850
|
AMngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AMngTableviewRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8616
9851
|
AMngTableviewRouteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0", type: AMngTableviewRouteComponent, ngImport: i0 });
|
|
8617
9852
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AMngTableviewRouteComponent, decorators: [{
|
|
8618
9853
|
type: Directive
|
|
8619
|
-
}] });
|
|
9854
|
+
}], ctorParameters: function () { return []; } });
|
|
8620
9855
|
|
|
8621
9856
|
class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
8622
|
-
constructor(route) {
|
|
8623
|
-
super();
|
|
8624
|
-
this.route = route;
|
|
8625
|
-
}
|
|
8626
|
-
get routeData() {
|
|
8627
|
-
return this.route.snapshot.data;
|
|
8628
|
-
}
|
|
8629
9857
|
createTableviewDescriptor() {
|
|
8630
9858
|
var _a, _b;
|
|
8631
9859
|
if (this.descriptorInit) {
|
|
@@ -8658,12 +9886,12 @@ class MngTableviewRouteComponent extends AMngTableviewRouteComponent {
|
|
|
8658
9886
|
(_a = this.tableviewComponent) === null || _a === void 0 ? void 0 : _a.reloadTable();
|
|
8659
9887
|
}
|
|
8660
9888
|
}
|
|
8661
|
-
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, deps:
|
|
9889
|
+
MngTableviewRouteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8662
9890
|
MngTableviewRouteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngTableviewRouteComponent, selector: "mng-tableview-route", inputs: { descriptorInit: ["descriptor", "descriptorInit"], dataProviderInit: ["dataProvider", "dataProviderInit"], actionsInit: ["actions", "actionsInit"] }, viewQueries: [{ propertyName: "tableviewComponent", first: true, predicate: MngTableviewComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: MngTableviewComponent, selector: "mng-tableview", inputs: ["descriptor", "dataProvider", "actions"] }] });
|
|
8663
9891
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngTableviewRouteComponent, decorators: [{
|
|
8664
9892
|
type: Component,
|
|
8665
9893
|
args: [{ selector: 'mng-tableview-route', template: "<div class=\"grid\">\n <div class=\"col-12\">\n <mng-tableview [descriptor]=\"descriptor\" [dataProvider]=\"dataProvider\" [actions]=\"actions\"></mng-tableview>\n </div>\n</div>\n" }]
|
|
8666
|
-
}],
|
|
9894
|
+
}], propDecorators: { descriptorInit: [{
|
|
8667
9895
|
type: Input,
|
|
8668
9896
|
args: ['descriptor']
|
|
8669
9897
|
}], dataProviderInit: [{
|
|
@@ -8863,20 +10091,18 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8863
10091
|
if (hasViewAction) {
|
|
8864
10092
|
const viewAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.viewEditor, 'details', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8865
10093
|
.withPosition(ActionPositionEnum.RowClick)
|
|
8866
|
-
.withTitle(null)
|
|
8867
10094
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
8868
10095
|
.withDialogSize(ActionEditorDialogSizeEnum.Small);
|
|
8869
10096
|
viewAction.withEditorActions([new ActionEditorSubmitDescriptor(viewAction, ActionEditorSubmitTypeEnum.Cancel)]);
|
|
10097
|
+
viewAction.buttonDescriptor.withLabel(null);
|
|
8870
10098
|
this.actions.push(viewAction);
|
|
8871
10099
|
}
|
|
8872
10100
|
if (hasAddAction) {
|
|
8873
10101
|
const addAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.addEditor, 'add', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8874
10102
|
.withPosition(ActionPositionEnum.ToolbarRight)
|
|
8875
|
-
.withTitle(null)
|
|
8876
|
-
.withIcon('pi pi-plus')
|
|
8877
10103
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
8878
10104
|
.withDialogSize(ActionEditorDialogSizeEnum.Small)
|
|
8879
|
-
.withSize(ActionSizeEnum.ExtraSmall)
|
|
10105
|
+
.withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withSize(ActionSizeEnum.ExtraSmall)))
|
|
8880
10106
|
.withSubmitFunction(ctx => {
|
|
8881
10107
|
if (!ctx.parameters.item) {
|
|
8882
10108
|
return throwError(() => new Error(`No item was provided in context, edit cannot be done.`));
|
|
@@ -8889,16 +10115,15 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8889
10115
|
})
|
|
8890
10116
|
.withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
|
|
8891
10117
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
10118
|
+
addAction.buttonDescriptor.withLabel(null).withIcon('pi pi-plus');
|
|
8892
10119
|
this.actions.push(addAction);
|
|
8893
10120
|
}
|
|
8894
10121
|
if (hasEditAction) {
|
|
8895
10122
|
const editAction = new ActionEditorDescriptor(this.descriptor.tableviewDescriptor.editEditor, 'edit', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8896
10123
|
.withPosition(ActionPositionEnum.RowInline)
|
|
8897
|
-
.withTitle(null)
|
|
8898
|
-
.withIcon('pi pi-pencil')
|
|
8899
10124
|
.withDialogClassName('mng-field-dialog mng-action-editor-dialog')
|
|
8900
10125
|
.withDialogSize(ActionEditorDialogSizeEnum.Small)
|
|
8901
|
-
.withSize(ActionSizeEnum.ExtraSmall)
|
|
10126
|
+
.withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder().withSize(ActionSizeEnum.ExtraSmall)))
|
|
8902
10127
|
.withSubmitFunction(ctx => {
|
|
8903
10128
|
var _a;
|
|
8904
10129
|
if (!ctx.parameters.item) {
|
|
@@ -8912,15 +10137,13 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8912
10137
|
})
|
|
8913
10138
|
.withIsVisibleFunction(() => { var _a; return of(!((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.disabled)); })
|
|
8914
10139
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
10140
|
+
editAction.buttonDescriptor.withLabel(null).withIcon('pi pi-pencil');
|
|
8915
10141
|
this.actions.push(editAction);
|
|
8916
10142
|
}
|
|
8917
10143
|
if (hasDeleteAction) {
|
|
8918
10144
|
const deleteAction = new ActionDescriptor(this.descriptor.tableviewDescriptor.model, 'delete', this.descriptor.editor.model.type, this.descriptor.property)
|
|
8919
10145
|
.withPosition(ActionPositionEnum.RowInline)
|
|
8920
|
-
.
|
|
8921
|
-
.withTitle(null)
|
|
8922
|
-
.withIcon('pi pi-trash')
|
|
8923
|
-
.withSize(ActionSizeEnum.ExtraSmall)
|
|
10146
|
+
.withButtonDescriptor(new ButtonDescriptor().withStyleClass(new ButtonStyleBuilder(ActionLevelEnum.Danger).withSize(ActionSizeEnum.ExtraSmall)))
|
|
8924
10147
|
.withRunFunction(ctx => {
|
|
8925
10148
|
var _a;
|
|
8926
10149
|
if (!ctx.parameters.item) {
|
|
@@ -8946,6 +10169,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8946
10169
|
})
|
|
8947
10170
|
.withIsVisibleFunction(() => { var _a; return of(!((_a = this.options) === null || _a === void 0 ? void 0 : _a.formState.disabled)); })
|
|
8948
10171
|
.withIsEnabledFunction(() => this.isEnabled$);
|
|
10172
|
+
deleteAction.buttonDescriptor.withLabel(null).withIcon('pi pi-trash');
|
|
8949
10173
|
this.actions.push(deleteAction);
|
|
8950
10174
|
}
|
|
8951
10175
|
this.actions.push(...this.descriptor.actions);
|
|
@@ -8999,7 +10223,7 @@ class MngFormlyFieldTableDialogFormComponent extends FieldType {
|
|
|
8999
10223
|
}
|
|
9000
10224
|
}
|
|
9001
10225
|
MngFormlyFieldTableDialogFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, deps: [{ token: MngActionExecutorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9002
|
-
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\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</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10226
|
+
MngFormlyFieldTableDialogFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: MngFormlyFieldTableDialogFormComponent, selector: "mng-formly-table-dialog-form-field", usesInheritance: true, ngImport: i0, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\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</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MngTemplateDirective, selector: "[mngTemplate]", inputs: ["type", "mngTemplate"] }, { kind: "component", type: MngTableComponent, selector: "mng-table", inputs: ["descriptor", "items", "queryResult", "loading", "dataProvider", "useQueryParams", "selectionMode", "selectionEnabled", "actions", "isColumnClickable", "viewContainer", "captionComponent", "columnActionComponent", "columnActionMinWidth"], outputs: ["tableLoad", "cellClick", "selectionChange", "captionComponentInstance", "columnActionComponentInstance"] }, { kind: "component", type: MngActionComponent, selector: "mng-action", inputs: ["action", "item", "itemId", "actionData", "queryParam", "dataProvider", "disabled", "loading", "viewContainer", "selectedItems"], outputs: ["finish"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9003
10227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngFormlyFieldTableDialogFormComponent, decorators: [{
|
|
9004
10228
|
type: Component,
|
|
9005
10229
|
args: [{ selector: 'mng-formly-table-dialog-form-field', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mng-table [descriptor]=\"descriptor.tableDescriptor\" [items]=\"items$\" [actions]=\"actions\">\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</mng-table>\n", styles: [".submit-button{display:none!important;visibility:hidden}\n"] }]
|
|
@@ -10126,6 +11350,9 @@ const declarations = [
|
|
|
10126
11350
|
MngBooleanPipe,
|
|
10127
11351
|
MngI18nPropertyPipe,
|
|
10128
11352
|
MngParametrizePipe,
|
|
11353
|
+
MngGetterPipe,
|
|
11354
|
+
MngTemplatePipe,
|
|
11355
|
+
MngClassMapPipe,
|
|
10129
11356
|
// layout components
|
|
10130
11357
|
MngBreadcrumbComponent,
|
|
10131
11358
|
MngFooterComponent,
|
|
@@ -10160,7 +11387,9 @@ const declarations = [
|
|
|
10160
11387
|
MngFormEditorComponent,
|
|
10161
11388
|
MngActionComponent,
|
|
10162
11389
|
MngActionEditorComponent,
|
|
10163
|
-
MngActionRouteComponent
|
|
11390
|
+
MngActionRouteComponent,
|
|
11391
|
+
//button
|
|
11392
|
+
MngButtonComponent
|
|
10164
11393
|
];
|
|
10165
11394
|
class MngCommonsModule {
|
|
10166
11395
|
static forRoot(config) {
|
|
@@ -10186,6 +11415,8 @@ class MngCommonsModule {
|
|
|
10186
11415
|
MngBooleanPipe,
|
|
10187
11416
|
MngI18nPropertyPipe,
|
|
10188
11417
|
MngParametrizePipe,
|
|
11418
|
+
MngGetterPipe,
|
|
11419
|
+
MngTemplatePipe,
|
|
10189
11420
|
// component service
|
|
10190
11421
|
MngMainLayoutComponentService,
|
|
10191
11422
|
MngViewContainerComponentService,
|
|
@@ -10243,6 +11474,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10243
11474
|
MngBooleanPipe,
|
|
10244
11475
|
MngI18nPropertyPipe,
|
|
10245
11476
|
MngParametrizePipe,
|
|
11477
|
+
MngGetterPipe,
|
|
11478
|
+
MngTemplatePipe,
|
|
11479
|
+
MngClassMapPipe,
|
|
10246
11480
|
// layout components
|
|
10247
11481
|
MngBreadcrumbComponent,
|
|
10248
11482
|
MngFooterComponent,
|
|
@@ -10277,7 +11511,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10277
11511
|
MngFormEditorComponent,
|
|
10278
11512
|
MngActionComponent,
|
|
10279
11513
|
MngActionEditorComponent,
|
|
10280
|
-
MngActionRouteComponent
|
|
11514
|
+
MngActionRouteComponent,
|
|
11515
|
+
//button
|
|
11516
|
+
MngButtonComponent
|
|
10281
11517
|
], imports: [
|
|
10282
11518
|
// angular modules
|
|
10283
11519
|
CommonModule,
|
|
@@ -10360,6 +11596,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10360
11596
|
MngBooleanPipe,
|
|
10361
11597
|
MngI18nPropertyPipe,
|
|
10362
11598
|
MngParametrizePipe,
|
|
11599
|
+
MngGetterPipe,
|
|
11600
|
+
MngTemplatePipe,
|
|
11601
|
+
MngClassMapPipe,
|
|
10363
11602
|
// layout components
|
|
10364
11603
|
MngBreadcrumbComponent,
|
|
10365
11604
|
MngFooterComponent,
|
|
@@ -10394,7 +11633,9 @@ MngCommonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
10394
11633
|
MngFormEditorComponent,
|
|
10395
11634
|
MngActionComponent,
|
|
10396
11635
|
MngActionEditorComponent,
|
|
10397
|
-
MngActionRouteComponent
|
|
11636
|
+
MngActionRouteComponent,
|
|
11637
|
+
//button
|
|
11638
|
+
MngButtonComponent] });
|
|
10398
11639
|
MngCommonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: MngCommonsModule, imports: [
|
|
10399
11640
|
// angular modules
|
|
10400
11641
|
CommonModule,
|
|
@@ -11056,6 +12297,7 @@ class TableviewRouteBuilder {
|
|
|
11056
12297
|
this.editPath = ':itemId/edit';
|
|
11057
12298
|
this.hasAdd = true;
|
|
11058
12299
|
this.addPath = 'add';
|
|
12300
|
+
this.hasDelete = true;
|
|
11059
12301
|
}
|
|
11060
12302
|
static fromComponent(path, component) {
|
|
11061
12303
|
const inst = new TableviewRouteBuilder(path);
|
|
@@ -11083,6 +12325,15 @@ class TableviewRouteBuilder {
|
|
|
11083
12325
|
}
|
|
11084
12326
|
return inst;
|
|
11085
12327
|
}
|
|
12328
|
+
withReadOnly(permissions) {
|
|
12329
|
+
if (permissions) {
|
|
12330
|
+
this.withPermissions(permissions);
|
|
12331
|
+
}
|
|
12332
|
+
this.withAdd(false);
|
|
12333
|
+
this.withEdit(false);
|
|
12334
|
+
this.withDelete(false);
|
|
12335
|
+
return this;
|
|
12336
|
+
}
|
|
11086
12337
|
withDetails(hasDetails = true, permissions, path) {
|
|
11087
12338
|
this.hasDetails = hasDetails;
|
|
11088
12339
|
if (permissions) {
|
|
@@ -11113,24 +12364,31 @@ class TableviewRouteBuilder {
|
|
|
11113
12364
|
}
|
|
11114
12365
|
return this;
|
|
11115
12366
|
}
|
|
12367
|
+
withDelete(hasDelete = true, permissions) {
|
|
12368
|
+
this.hasDelete = hasDelete;
|
|
12369
|
+
if (permissions) {
|
|
12370
|
+
this.withPermissions(undefined, undefined, undefined, permissions);
|
|
12371
|
+
}
|
|
12372
|
+
return this;
|
|
12373
|
+
}
|
|
11116
12374
|
withPermissions(read, add, edit, delet, details) {
|
|
11117
12375
|
if (!this.permissions) {
|
|
11118
12376
|
this.permissions = {};
|
|
11119
12377
|
}
|
|
11120
12378
|
if (read) {
|
|
11121
|
-
this.permissions[
|
|
12379
|
+
this.permissions[TableviewActionDefaultCategories.READ] = read;
|
|
11122
12380
|
}
|
|
11123
12381
|
if (add) {
|
|
11124
|
-
this.permissions[
|
|
12382
|
+
this.permissions[TableviewActionDefaultCategories.ADD] = add;
|
|
11125
12383
|
}
|
|
11126
12384
|
if (edit) {
|
|
11127
|
-
this.permissions[
|
|
12385
|
+
this.permissions[TableviewActionDefaultCategories.EDIT] = edit;
|
|
11128
12386
|
}
|
|
11129
12387
|
if (delet) {
|
|
11130
|
-
this.permissions[
|
|
12388
|
+
this.permissions[TableviewActionDefaultCategories.DELETE] = delet;
|
|
11131
12389
|
}
|
|
11132
12390
|
if (details) {
|
|
11133
|
-
this.permissions[
|
|
12391
|
+
this.permissions[TableviewActionDefaultCategories.DETAILS] = details;
|
|
11134
12392
|
}
|
|
11135
12393
|
return this;
|
|
11136
12394
|
}
|
|
@@ -11167,35 +12425,42 @@ class TableviewRouteBuilder {
|
|
|
11167
12425
|
if (this.permissions) {
|
|
11168
12426
|
routeData.tableviewPermissions = Object.assign({}, this.permissions);
|
|
11169
12427
|
}
|
|
12428
|
+
routeData.tableviewActions = {
|
|
12429
|
+
hasAdd: this.hasAdd,
|
|
12430
|
+
hasEdit: this.hasEdit,
|
|
12431
|
+
hasDetails: this.hasDetails,
|
|
12432
|
+
hasDelete: this.hasDelete
|
|
12433
|
+
};
|
|
11170
12434
|
tableviewRouteBuilder.withData(routeData);
|
|
11171
|
-
if ((_a = this.permissions) === null || _a === void 0 ? void 0 : _a[
|
|
11172
|
-
tableviewRouteBuilder.withPermissions(this.permissions[
|
|
12435
|
+
if ((_a = this.permissions) === null || _a === void 0 ? void 0 : _a[TableviewActionDefaultCategories.READ]) {
|
|
12436
|
+
tableviewRouteBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.READ]);
|
|
11173
12437
|
}
|
|
11174
12438
|
// list route
|
|
11175
12439
|
const rootChildRouteBuilder = RouteBuilder.create('', MngActionRouteComponent);
|
|
11176
|
-
|
|
11177
|
-
|
|
12440
|
+
rootChildRouteBuilder.withData(Object.assign({}, routeData));
|
|
12441
|
+
if ((_b = this.permissions) === null || _b === void 0 ? void 0 : _b[TableviewActionDefaultCategories.READ]) {
|
|
12442
|
+
rootChildRouteBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.READ]);
|
|
11178
12443
|
}
|
|
11179
12444
|
tableviewRouteBuilder.addChildBuilder(rootChildRouteBuilder);
|
|
11180
12445
|
// add route
|
|
11181
12446
|
if (this.hasAdd) {
|
|
11182
12447
|
const routeBuilder = RouteBuilder.create(this.addPath, MngActionRouteComponent);
|
|
11183
|
-
if ((_c = this.permissions) === null || _c === void 0 ? void 0 : _c[
|
|
11184
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12448
|
+
if ((_c = this.permissions) === null || _c === void 0 ? void 0 : _c[TableviewActionDefaultCategories.ADD]) {
|
|
12449
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.ADD]);
|
|
11185
12450
|
}
|
|
11186
12451
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11187
12452
|
}
|
|
11188
12453
|
if (this.hasDetails) {
|
|
11189
12454
|
const routeBuilder = RouteBuilder.create(this.detailsPath, MngActionRouteComponent);
|
|
11190
|
-
if ((_d = this.permissions) === null || _d === void 0 ? void 0 : _d[
|
|
11191
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12455
|
+
if ((_d = this.permissions) === null || _d === void 0 ? void 0 : _d[TableviewActionDefaultCategories.DETAILS]) {
|
|
12456
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.DETAILS]);
|
|
11192
12457
|
}
|
|
11193
12458
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11194
12459
|
}
|
|
11195
12460
|
if (this.hasEdit) {
|
|
11196
12461
|
const routeBuilder = RouteBuilder.create(this.editPath, MngActionRouteComponent);
|
|
11197
|
-
if ((_e = this.permissions) === null || _e === void 0 ? void 0 : _e[
|
|
11198
|
-
routeBuilder.withPermissions(this.permissions[
|
|
12462
|
+
if ((_e = this.permissions) === null || _e === void 0 ? void 0 : _e[TableviewActionDefaultCategories.EDIT]) {
|
|
12463
|
+
routeBuilder.withPermissions(this.permissions[TableviewActionDefaultCategories.EDIT]);
|
|
11199
12464
|
}
|
|
11200
12465
|
tableviewRouteBuilder.addChildBuilder(routeBuilder);
|
|
11201
12466
|
}
|
|
@@ -11211,5 +12476,5 @@ class TableviewRouteBuilder {
|
|
|
11211
12476
|
* Generated bundle index. Do not edit.
|
|
11212
12477
|
*/
|
|
11213
12478
|
|
|
11214
|
-
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 };
|
|
12479
|
+
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, ColumnDynamicDescriptor, ColumnTypeEnum, DataProvider, DefaultMngErrorMapperService, DynamicTableviewDataProvider, 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, MngClassMapPipe, 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, TableDynamicColumnsModeEnum, TableDynamicDescriptor, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum, TableviewActionDefaultCategories, TableviewCrudDataProvider, TableviewDataProvider, TableviewDescriptor, TableviewDynamicDescriptor, TableviewRouteBuilder, TableviewTypeEnum, TypeName, TypeUtil, enumNameDecoratorPropertyName, enumsMapBase, formlyTypesConfig, formlyWrappersConfig, getEmailValidationMessage, getFormlyValidationMessages, getMaxLengthValidationMessage, getMinLengthValidationMessage, getRequiredValidationMessage, getTextPatternValidationMessage, mngConfigJsonAppInitializerProvider, mngConfigurationServiceProvider, mngFormlyConfigProvider, primeNgModules, typeMapBase, typeNameDecoratorPropertyName };
|
|
11215
12480
|
//# sourceMappingURL=mediusinc-mng-commons.mjs.map
|