@mediusinc/mng-commons 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/action/action.component.mjs +28 -6
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +7 -6
- package/esm2020/lib/components/action/models/action-execution.model.mjs +1 -1
- package/esm2020/lib/components/form/editor/form-editor.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +4 -6
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +3 -3
- package/esm2020/lib/descriptors/action.descriptor.mjs +87 -4
- package/esm2020/lib/mng-commons.module.mjs +6 -2
- package/esm2020/lib/models/error.model.mjs +1 -1
- package/esm2020/lib/pipes/index.mjs +2 -1
- package/esm2020/lib/pipes/link-formatter.pipe.mjs +39 -0
- package/esm2020/lib/services/action-executor.service.mjs +33 -39
- package/esm2020/lib/utils/index.mjs +2 -2
- package/esm2020/lib/utils/notification.util.mjs +47 -0
- package/fesm2015/mediusinc-mng-commons.mjs +298 -159
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +297 -158
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/action/action.component.d.ts +12 -1
- package/lib/components/action/models/action-execution.model.d.ts +2 -0
- package/lib/descriptors/action.descriptor.d.ts +35 -1
- package/lib/mng-commons.module.d.ts +69 -68
- package/lib/models/error.model.d.ts +2 -0
- package/lib/pipes/index.d.ts +1 -0
- package/lib/pipes/link-formatter.pipe.d.ts +11 -0
- package/lib/services/action-executor.service.d.ts +5 -3
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/{toast.util.d.ts → notification.util.d.ts} +7 -10
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_button.scss +4 -0
- package/esm2020/lib/utils/toast.util.mjs +0 -44
|
@@ -4,7 +4,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
4
4
|
import { ConfirmationService } from 'primeng/api';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
import { IDataProvider } from '../../data-providers';
|
|
7
|
-
import { ActionDescriptor } from '../../descriptors';
|
|
7
|
+
import { ActionDescriptor, ActionLevelEnum, ActionLinkDescriptor } from '../../descriptors';
|
|
8
8
|
import { IViewContainer } from '../../models';
|
|
9
9
|
import { MngActionExecutorService, MngViewContainerComponentService } from '../../services';
|
|
10
10
|
import { IdType } from '../../types';
|
|
@@ -16,6 +16,15 @@ export declare class MngActionComponent<T, S> implements OnInit, IActionConfirma
|
|
|
16
16
|
private actionExecutor;
|
|
17
17
|
private confirmationService;
|
|
18
18
|
private viewContainerService;
|
|
19
|
+
readonly levelDefault = ActionLevelEnum.Default;
|
|
20
|
+
readonly levelPrimary = ActionLevelEnum.Primary;
|
|
21
|
+
readonly levelSecondary = ActionLevelEnum.Secondary;
|
|
22
|
+
readonly levelInfo = ActionLevelEnum.Info;
|
|
23
|
+
readonly levelHelp = ActionLevelEnum.Help;
|
|
24
|
+
readonly levelSuccess = ActionLevelEnum.Success;
|
|
25
|
+
readonly levelWarning = ActionLevelEnum.Warning;
|
|
26
|
+
readonly levelDanger = ActionLevelEnum.Danger;
|
|
27
|
+
hostClass: string;
|
|
19
28
|
action: ActionDescriptor<T>;
|
|
20
29
|
item?: T;
|
|
21
30
|
itemId?: IdType;
|
|
@@ -33,6 +42,8 @@ export declare class MngActionComponent<T, S> implements OnInit, IActionConfirma
|
|
|
33
42
|
$label: Observable<string | null>;
|
|
34
43
|
$tooltip: Observable<string | null>;
|
|
35
44
|
private viewContainer?;
|
|
45
|
+
actionLink?: ActionLinkDescriptor<T>;
|
|
46
|
+
hasNoTitle: boolean;
|
|
36
47
|
constructor(route: ActivatedRoute, translate: TranslateService, actionExecutor: MngActionExecutorService, confirmationService: ConfirmationService, viewContainerService: MngViewContainerComponentService<T, S> | null);
|
|
37
48
|
ngOnInit(): void;
|
|
38
49
|
triggerAction(event: Event): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Message } from 'primeng/api';
|
|
1
2
|
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { IDataProvider } from '../../../data-providers';
|
|
@@ -29,6 +30,7 @@ export declare class ActionRunResult<T, S, DP extends IDataProvider<T, S>> {
|
|
|
29
30
|
readonly context?: ActionExecContext<T, S, DP> | undefined;
|
|
30
31
|
readonly result?: T | undefined;
|
|
31
32
|
readonly error?: ActionError | undefined;
|
|
33
|
+
notification?: Message;
|
|
32
34
|
constructor(context?: ActionExecContext<T, S, DP> | undefined, result?: T | undefined, error?: ActionError | undefined);
|
|
33
35
|
}
|
|
34
36
|
export declare class ActionActivationResult<T, S, DP extends IDataProvider<T, S>> {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
+
import { Params, QueryParamsHandling } from '@angular/router';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { ActionExecContext } from '../components/action/models';
|
|
4
5
|
import { IDataProvider, IEditorDataProvider } from '../data-providers';
|
|
@@ -18,9 +19,12 @@ export declare class ActionDescriptor<T> {
|
|
|
18
19
|
protected _routeUrl: string | null;
|
|
19
20
|
protected _title?: string | null;
|
|
20
21
|
protected _icon?: string | null;
|
|
22
|
+
protected _tooltip?: string | null;
|
|
21
23
|
protected _className: string;
|
|
22
24
|
protected _size: ActionDescriptor.SizeEnum;
|
|
23
|
-
protected
|
|
25
|
+
protected _isStyleText: boolean;
|
|
26
|
+
protected _isStyleOutlined: boolean;
|
|
27
|
+
protected _isStyleRaised: boolean;
|
|
24
28
|
protected _dataProvider?: IDataProvider<T, any>;
|
|
25
29
|
protected _runFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined>;
|
|
26
30
|
protected _isVisibleFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>;
|
|
@@ -57,6 +61,9 @@ export declare class ActionDescriptor<T> {
|
|
|
57
61
|
get isEnabledFunction(): ((ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>) | undefined;
|
|
58
62
|
get actionName(): string;
|
|
59
63
|
get className(): string;
|
|
64
|
+
get isStyleText(): boolean;
|
|
65
|
+
get isStyleOutlined(): boolean;
|
|
66
|
+
get isStyleRaised(): boolean;
|
|
60
67
|
get size(): ActionDescriptor.SizeEnum;
|
|
61
68
|
get isSizeExtraSmall(): boolean;
|
|
62
69
|
get isSizeSmall(): boolean;
|
|
@@ -94,6 +101,7 @@ export declare class ActionDescriptor<T> {
|
|
|
94
101
|
withTooltip(tooltip: string | null): this;
|
|
95
102
|
withClassName(className: string): this;
|
|
96
103
|
withSize(size?: ActionDescriptor.SizeEnum): this;
|
|
104
|
+
withStyle(styleText?: boolean, styleOutlined?: boolean, styleRaised?: boolean): this;
|
|
97
105
|
withPosition(position: ActionPositionEnum): this;
|
|
98
106
|
withRunConfirmation(icon?: string, title?: string, message?: string, acceptTitle?: string, rejectTitle?: string): this;
|
|
99
107
|
withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean): void;
|
|
@@ -115,6 +123,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
115
123
|
protected _hasFetchNotificationSuccess: boolean;
|
|
116
124
|
protected _fetchNotificationSuccessTitle?: string;
|
|
117
125
|
protected _fetchNotificationSuccessMessage?: string;
|
|
126
|
+
protected _dialogClassName: string;
|
|
118
127
|
protected _dataProvider?: IEditorDataProvider<T, any>;
|
|
119
128
|
protected _fetchFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
|
|
120
129
|
protected _submitFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
|
|
@@ -122,6 +131,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
122
131
|
constructor(editorDescriptor: EditorDescriptor<T>, actionName: string, parentType?: ClassType<any>, parentProperty?: string);
|
|
123
132
|
get editorTitle(): string | null | undefined;
|
|
124
133
|
get editorDescriptor(): EditorDescriptor<T>;
|
|
134
|
+
get dialogClassName(): string;
|
|
125
135
|
get hasFetchNotificationSuccess(): boolean;
|
|
126
136
|
get fetchNotificationSuccessTitle(): string | undefined;
|
|
127
137
|
get fetchNotificationSuccessMessage(): string | undefined;
|
|
@@ -134,6 +144,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
|
|
|
134
144
|
withEditorTitle(title: string | null): this;
|
|
135
145
|
withDataProvider(dataProvider: IEditorDataProvider<T, any>): this;
|
|
136
146
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
147
|
+
withDialogClassName(className: string): this;
|
|
137
148
|
withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T>): this;
|
|
138
149
|
withFetchFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
|
|
139
150
|
withSubmitFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
|
|
@@ -174,6 +185,29 @@ export declare class ActionDeleteDescriptor<T> extends ActionDescriptor<T> {
|
|
|
174
185
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
175
186
|
withServiceDeleteFunction<S>(serviceType: Type<S>, deleteFn?: (id: IdType, item?: T, service?: S) => Observable<T>): this;
|
|
176
187
|
}
|
|
188
|
+
export declare class ActionLinkDescriptor<T> extends ActionDescriptor<T> {
|
|
189
|
+
private _url;
|
|
190
|
+
private _pathSegments;
|
|
191
|
+
private _queryParams?;
|
|
192
|
+
private _queryParamsHandling?;
|
|
193
|
+
private _replaceUrl;
|
|
194
|
+
private _target;
|
|
195
|
+
private _isStyleLink;
|
|
196
|
+
constructor(model: ModelDescriptor<T>);
|
|
197
|
+
get url(): string;
|
|
198
|
+
get pathSegments(): string[];
|
|
199
|
+
get queryParams(): Params | undefined;
|
|
200
|
+
get queryParamsHandling(): QueryParamsHandling | undefined;
|
|
201
|
+
get replaceUrl(): boolean;
|
|
202
|
+
get target(): string;
|
|
203
|
+
get isStyleLink(): boolean;
|
|
204
|
+
withHref(url: string): this;
|
|
205
|
+
withRouterLink(...pathSegments: string[]): this;
|
|
206
|
+
withQueryParams(queryParams: Params, queryParamsHandling?: QueryParamsHandling): this;
|
|
207
|
+
withReplaceUrl(replaceUrl?: boolean): this;
|
|
208
|
+
withTarget(target?: '_self' | '_blank'): this;
|
|
209
|
+
withStyleLink(isStyleLink: boolean): this;
|
|
210
|
+
}
|
|
177
211
|
export declare enum ActionPositionEnum {
|
|
178
212
|
ToolbarLeft = 0,
|
|
179
213
|
ToolbarRight = 1,
|
|
@@ -8,77 +8,78 @@ import * as i3 from "./pipes/property-path.pipe";
|
|
|
8
8
|
import * as i4 from "./pipes/enum.pipe";
|
|
9
9
|
import * as i5 from "./pipes/boolean.pipe";
|
|
10
10
|
import * as i6 from "./pipes/i18n-property.pipe";
|
|
11
|
-
import * as i7 from "./
|
|
12
|
-
import * as i8 from "./components/layout/
|
|
13
|
-
import * as i9 from "./components/layout/
|
|
14
|
-
import * as i10 from "./components/layout/
|
|
15
|
-
import * as i11 from "./components/layout/menu
|
|
16
|
-
import * as i12 from "./components/layout/
|
|
17
|
-
import * as i13 from "./components/
|
|
18
|
-
import * as i14 from "./components/form/
|
|
19
|
-
import * as i15 from "./components/form/
|
|
20
|
-
import * as i16 from "./components/form/formly/wrappers/formly-
|
|
21
|
-
import * as i17 from "./components/form/formly/
|
|
22
|
-
import * as i18 from "./components/form/formly/fields/formly-field-
|
|
23
|
-
import * as i19 from "./components/form/formly/fields/formly-field-
|
|
24
|
-
import * as i20 from "./components/form/formly/fields/formly-field-
|
|
25
|
-
import * as i21 from "./components/form/formly/fields/formly-field-
|
|
26
|
-
import * as i22 from "./components/form/formly/fields/formly-field-table-dialog-
|
|
27
|
-
import * as i23 from "./components/form/formly/fields/formly-field-
|
|
28
|
-
import * as i24 from "./components/form/formly/fields/formly-field-
|
|
29
|
-
import * as i25 from "./components/
|
|
30
|
-
import * as i26 from "./components/tableview/
|
|
31
|
-
import * as i27 from "./components/tableview/
|
|
32
|
-
import * as i28 from "./components/tableview/table/column-
|
|
33
|
-
import * as i29 from "./components/tableview/
|
|
34
|
-
import * as i30 from "./components/
|
|
35
|
-
import * as i31 from "./components/
|
|
36
|
-
import * as i32 from "./components/action/
|
|
37
|
-
import * as i33 from "./components/action/
|
|
38
|
-
import * as i34 from "
|
|
39
|
-
import * as i35 from "@angular/
|
|
40
|
-
import * as i36 from "@angular/
|
|
41
|
-
import * as i37 from "@angular/
|
|
42
|
-
import * as i38 from "@
|
|
43
|
-
import * as i39 from "@ngx-
|
|
44
|
-
import * as i40 from "
|
|
45
|
-
import * as i41 from "primeng/
|
|
46
|
-
import * as i42 from "primeng/
|
|
47
|
-
import * as i43 from "primeng/
|
|
48
|
-
import * as i44 from "primeng/
|
|
49
|
-
import * as i45 from "primeng/
|
|
50
|
-
import * as i46 from "primeng/
|
|
51
|
-
import * as i47 from "primeng/
|
|
52
|
-
import * as i48 from "primeng/
|
|
53
|
-
import * as i49 from "primeng/
|
|
54
|
-
import * as i50 from "primeng/
|
|
55
|
-
import * as i51 from "primeng/
|
|
56
|
-
import * as i52 from "primeng/
|
|
57
|
-
import * as i53 from "primeng/
|
|
58
|
-
import * as i54 from "primeng/
|
|
59
|
-
import * as i55 from "primeng/
|
|
60
|
-
import * as i56 from "primeng/
|
|
61
|
-
import * as i57 from "primeng/
|
|
62
|
-
import * as i58 from "primeng/
|
|
63
|
-
import * as i59 from "primeng/
|
|
64
|
-
import * as i60 from "primeng/
|
|
65
|
-
import * as i61 from "primeng/
|
|
66
|
-
import * as i62 from "primeng/
|
|
67
|
-
import * as i63 from "primeng/
|
|
68
|
-
import * as i64 from "primeng/
|
|
69
|
-
import * as i65 from "primeng/
|
|
70
|
-
import * as i66 from "primeng/
|
|
71
|
-
import * as i67 from "primeng/
|
|
72
|
-
import * as i68 from "primeng/
|
|
73
|
-
import * as i69 from "primeng/
|
|
74
|
-
import * as i70 from "primeng/
|
|
75
|
-
import * as i71 from "primeng/
|
|
76
|
-
import * as i72 from "primeng/
|
|
77
|
-
import * as i73 from "primeng/
|
|
11
|
+
import * as i7 from "./pipes/link-formatter.pipe";
|
|
12
|
+
import * as i8 from "./components/layout/breadcrumb.component";
|
|
13
|
+
import * as i9 from "./components/layout/footer.component";
|
|
14
|
+
import * as i10 from "./components/layout/main-layout.component";
|
|
15
|
+
import * as i11 from "./components/layout/menu.component";
|
|
16
|
+
import * as i12 from "./components/layout/menu-item.component";
|
|
17
|
+
import * as i13 from "./components/layout/topbar.component";
|
|
18
|
+
import * as i14 from "./components/form/autocomplete/autocomplete.component";
|
|
19
|
+
import * as i15 from "./components/form/dropdown/dropdown.component";
|
|
20
|
+
import * as i16 from "./components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component";
|
|
21
|
+
import * as i17 from "./components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component";
|
|
22
|
+
import * as i18 from "./components/form/formly/fields/formly-field-input/formly-field-input.component";
|
|
23
|
+
import * as i19 from "./components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component";
|
|
24
|
+
import * as i20 from "./components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component";
|
|
25
|
+
import * as i21 from "./components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component";
|
|
26
|
+
import * as i22 from "./components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component";
|
|
27
|
+
import * as i23 from "./components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component";
|
|
28
|
+
import * as i24 from "./components/form/formly/fields/formly-field-tabs/formly-field-tabs.component";
|
|
29
|
+
import * as i25 from "./components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component";
|
|
30
|
+
import * as i26 from "./components/tableview/table/table.component";
|
|
31
|
+
import * as i27 from "./components/tableview/tableview.component";
|
|
32
|
+
import * as i28 from "./components/tableview/table/column-value/column-value.component";
|
|
33
|
+
import * as i29 from "./components/tableview/table/column-filter/column-filter.component";
|
|
34
|
+
import * as i30 from "./components/tableview/route/tableview-route.component";
|
|
35
|
+
import * as i31 from "./components/form/editor/form-editor.component";
|
|
36
|
+
import * as i32 from "./components/action/action.component";
|
|
37
|
+
import * as i33 from "./components/action/editor/action-editor.component";
|
|
38
|
+
import * as i34 from "./components/action/route/action-route.component";
|
|
39
|
+
import * as i35 from "@angular/common";
|
|
40
|
+
import * as i36 from "@angular/router";
|
|
41
|
+
import * as i37 from "@angular/common/http";
|
|
42
|
+
import * as i38 from "@angular/forms";
|
|
43
|
+
import * as i39 from "@ngx-translate/core";
|
|
44
|
+
import * as i40 from "@ngx-formly/core";
|
|
45
|
+
import * as i41 from "primeng/autocomplete";
|
|
46
|
+
import * as i42 from "primeng/breadcrumb";
|
|
47
|
+
import * as i43 from "primeng/button";
|
|
48
|
+
import * as i44 from "primeng/calendar";
|
|
49
|
+
import * as i45 from "primeng/card";
|
|
50
|
+
import * as i46 from "primeng/checkbox";
|
|
51
|
+
import * as i47 from "primeng/chip";
|
|
52
|
+
import * as i48 from "primeng/confirmdialog";
|
|
53
|
+
import * as i49 from "primeng/confirmpopup";
|
|
54
|
+
import * as i50 from "primeng/dialog";
|
|
55
|
+
import * as i51 from "primeng/dynamicdialog";
|
|
56
|
+
import * as i52 from "primeng/dropdown";
|
|
57
|
+
import * as i53 from "primeng/fileupload";
|
|
58
|
+
import * as i54 from "primeng/inputnumber";
|
|
59
|
+
import * as i55 from "primeng/inputmask";
|
|
60
|
+
import * as i56 from "primeng/inputswitch";
|
|
61
|
+
import * as i57 from "primeng/inputtext";
|
|
62
|
+
import * as i58 from "primeng/inputtextarea";
|
|
63
|
+
import * as i59 from "primeng/paginator";
|
|
64
|
+
import * as i60 from "primeng/radiobutton";
|
|
65
|
+
import * as i61 from "primeng/ripple";
|
|
66
|
+
import * as i62 from "primeng/selectbutton";
|
|
67
|
+
import * as i63 from "primeng/table";
|
|
68
|
+
import * as i64 from "primeng/tag";
|
|
69
|
+
import * as i65 from "primeng/toast";
|
|
70
|
+
import * as i66 from "primeng/togglebutton";
|
|
71
|
+
import * as i67 from "primeng/toolbar";
|
|
72
|
+
import * as i68 from "primeng/tooltip";
|
|
73
|
+
import * as i69 from "primeng/messages";
|
|
74
|
+
import * as i70 from "primeng/progressspinner";
|
|
75
|
+
import * as i71 from "primeng/tabview";
|
|
76
|
+
import * as i72 from "primeng/fieldset";
|
|
77
|
+
import * as i73 from "primeng/multiselect";
|
|
78
|
+
import * as i74 from "primeng/skeleton";
|
|
78
79
|
export declare const primeNgModules: (typeof InputTextModule)[];
|
|
79
80
|
export declare class MngCommonsModule {
|
|
80
81
|
static forRoot(config: MngModuleConfig): ModuleWithProviders<MngCommonsModule>;
|
|
81
82
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngCommonsModule, never>;
|
|
82
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MngCommonsModule, [typeof i1.MngComponentDirective, typeof i2.MngTemplateDirective, typeof i3.MngPropertyPathPipe, typeof i4.MngEnumPipe, typeof i5.MngBooleanPipe, typeof i6.MngI18nPropertyPipe, typeof i7.
|
|
83
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MngCommonsModule, [typeof i1.MngComponentDirective, typeof i2.MngTemplateDirective, typeof i3.MngPropertyPathPipe, typeof i4.MngEnumPipe, typeof i5.MngBooleanPipe, typeof i6.MngI18nPropertyPipe, typeof i7.MngLinkFormatterPipe, typeof i8.MngBreadcrumbComponent, typeof i9.MngFooterComponent, typeof i10.MngMainLayoutComponent, typeof i11.MngMenuComponent, typeof i12.MngMenuItemComponent, typeof i13.MngTopbarComponent, typeof i14.MngAutocompleteComponent, typeof i15.MngDropdownComponent, typeof i16.MngFormlyFieldWrapperComponent, typeof i17.MngFormlyTableWrapperComponent, typeof i18.MngFormlyFieldInputComponent, typeof i19.MngFormlyFieldDropdownComponent, typeof i20.MngFormlyFieldAutocompleteComponent, typeof i21.MngFormlyFieldLookupDialogComponent, typeof i22.MngFormlyFieldTableDialogMultiselectComponent, typeof i23.MngFormlyFieldTableDialogFormComponent, typeof i24.MngFormlyFieldTabsComponent, typeof i25.MngFormlyFieldFieldsetComponent, typeof i26.MngTableComponent, typeof i27.MngTableviewComponent, typeof i28.MngTableColumnValueComponent, typeof i29.MngTableColumnFilterComponent, typeof i30.MngTableviewRouteComponent, typeof i31.MngFormEditorComponent, typeof i32.MngActionComponent, typeof i33.MngActionEditorComponent, typeof i34.MngActionRouteComponent], [typeof i35.CommonModule, typeof i36.RouterModule, typeof i37.HttpClientModule, typeof i38.ReactiveFormsModule, typeof i39.TranslateModule, typeof i40.FormlyModule, typeof i41.AutoCompleteModule, typeof i42.BreadcrumbModule, typeof i43.ButtonModule, typeof i44.CalendarModule, typeof i45.CardModule, typeof i46.CheckboxModule, typeof i47.ChipModule, typeof i48.ConfirmDialogModule, typeof i49.ConfirmPopupModule, typeof i50.DialogModule, typeof i51.DynamicDialogModule, typeof i52.DropdownModule, typeof i53.FileUploadModule, typeof i54.InputNumberModule, typeof i55.InputMaskModule, typeof i56.InputSwitchModule, typeof i57.InputTextModule, typeof i58.InputTextareaModule, typeof i59.PaginatorModule, typeof i60.RadioButtonModule, typeof i61.RippleModule, typeof i62.SelectButtonModule, typeof i63.TableModule, typeof i64.TagModule, typeof i65.ToastModule, typeof i66.ToggleButtonModule, typeof i67.ToolbarModule, typeof i68.TooltipModule, typeof i69.MessagesModule, typeof i70.ProgressSpinnerModule, typeof i71.TabViewModule, typeof i72.FieldsetModule, typeof i73.MultiSelectModule, typeof i74.SkeletonModule], [typeof i41.AutoCompleteModule, typeof i42.BreadcrumbModule, typeof i43.ButtonModule, typeof i44.CalendarModule, typeof i45.CardModule, typeof i46.CheckboxModule, typeof i47.ChipModule, typeof i48.ConfirmDialogModule, typeof i49.ConfirmPopupModule, typeof i50.DialogModule, typeof i51.DynamicDialogModule, typeof i52.DropdownModule, typeof i53.FileUploadModule, typeof i54.InputNumberModule, typeof i55.InputMaskModule, typeof i56.InputSwitchModule, typeof i57.InputTextModule, typeof i58.InputTextareaModule, typeof i59.PaginatorModule, typeof i60.RadioButtonModule, typeof i61.RippleModule, typeof i62.SelectButtonModule, typeof i63.TableModule, typeof i64.TagModule, typeof i65.ToastModule, typeof i66.ToggleButtonModule, typeof i67.ToolbarModule, typeof i68.TooltipModule, typeof i69.MessagesModule, typeof i70.ProgressSpinnerModule, typeof i71.TabViewModule, typeof i72.FieldsetModule, typeof i73.MultiSelectModule, typeof i74.SkeletonModule, typeof i1.MngComponentDirective, typeof i2.MngTemplateDirective, typeof i3.MngPropertyPathPipe, typeof i4.MngEnumPipe, typeof i5.MngBooleanPipe, typeof i6.MngI18nPropertyPipe, typeof i7.MngLinkFormatterPipe, typeof i8.MngBreadcrumbComponent, typeof i9.MngFooterComponent, typeof i10.MngMainLayoutComponent, typeof i11.MngMenuComponent, typeof i12.MngMenuItemComponent, typeof i13.MngTopbarComponent, typeof i14.MngAutocompleteComponent, typeof i15.MngDropdownComponent, typeof i16.MngFormlyFieldWrapperComponent, typeof i17.MngFormlyTableWrapperComponent, typeof i18.MngFormlyFieldInputComponent, typeof i19.MngFormlyFieldDropdownComponent, typeof i20.MngFormlyFieldAutocompleteComponent, typeof i21.MngFormlyFieldLookupDialogComponent, typeof i22.MngFormlyFieldTableDialogMultiselectComponent, typeof i23.MngFormlyFieldTableDialogFormComponent, typeof i24.MngFormlyFieldTabsComponent, typeof i25.MngFormlyFieldFieldsetComponent, typeof i26.MngTableComponent, typeof i27.MngTableviewComponent, typeof i28.MngTableColumnValueComponent, typeof i29.MngTableColumnFilterComponent, typeof i30.MngTableviewRouteComponent, typeof i31.MngFormEditorComponent, typeof i32.MngActionComponent, typeof i33.MngActionEditorComponent, typeof i34.MngActionRouteComponent]>;
|
|
83
84
|
static ɵinj: i0.ɵɵInjectorDeclaration<MngCommonsModule>;
|
|
84
85
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Message } from 'primeng/api';
|
|
1
2
|
import { IdType } from '../types';
|
|
2
3
|
export interface MngError extends Error {
|
|
3
4
|
id?: IdType;
|
|
4
5
|
messageCode?: number | string;
|
|
5
6
|
message: string;
|
|
7
|
+
notification?: Message;
|
|
6
8
|
details?: any;
|
|
7
9
|
status?: number;
|
|
8
10
|
statusDescription?: string;
|
package/lib/pipes/index.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { ModelDescriptor } from '../descriptors';
|
|
3
|
+
import { ActionData } from '../components/action/models';
|
|
4
|
+
import { IdType } from '../types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class MngLinkFormatterPipe implements PipeTransform {
|
|
7
|
+
private parseUrl;
|
|
8
|
+
transform(value: string | string[], itemId?: IdType, item?: any, model?: ModelDescriptor<any>, actionData?: ActionData): any;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MngLinkFormatterPipe, never>;
|
|
10
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<MngLinkFormatterPipe, "linkFormatter">;
|
|
11
|
+
}
|
|
@@ -8,10 +8,11 @@ import { ActionActivationResult, ActionData, ActionExecContext, ActionRunResult,
|
|
|
8
8
|
import { MngTableCellClickEvent } from '../components/tableview/models';
|
|
9
9
|
import { IDataProvider, IEditorDataProvider } from '../data-providers';
|
|
10
10
|
import { ActionDescriptor, ActionEditorDescriptor } from '../descriptors';
|
|
11
|
-
import { IViewContainer } from '../models';
|
|
11
|
+
import { IViewContainer, MngError } from '../models';
|
|
12
12
|
import { IdType } from '../types';
|
|
13
13
|
import { MngErrorMapperService } from './error-mapper.service';
|
|
14
14
|
import { MngNavigationService } from './navigation.service';
|
|
15
|
+
import { MngLinkFormatterPipe } from '../pipes';
|
|
15
16
|
import * as i0 from "@angular/core";
|
|
16
17
|
export declare class MngActionExecutorService {
|
|
17
18
|
private injector;
|
|
@@ -21,8 +22,9 @@ export declare class MngActionExecutorService {
|
|
|
21
22
|
private translate;
|
|
22
23
|
private navigationService;
|
|
23
24
|
private errorMapper;
|
|
25
|
+
private linkFormatter;
|
|
24
26
|
private defaultEditorDialogComponent;
|
|
25
|
-
constructor(injector: Injector, router: Router, dialogService: DialogService, confirmationService: ConfirmationService, translate: TranslateService, navigationService: MngNavigationService, errorMapper: MngErrorMapperService, defaultEditorDialogComponent: Type<any>);
|
|
27
|
+
constructor(injector: Injector, router: Router, dialogService: DialogService, confirmationService: ConfirmationService, translate: TranslateService, navigationService: MngNavigationService, errorMapper: MngErrorMapperService, linkFormatter: MngLinkFormatterPipe, defaultEditorDialogComponent: Type<any>);
|
|
26
28
|
prepareActionExecContext<T, S>(action: ActionDescriptor<T>, itemId?: IdType, item?: T, dataProvider?: IDataProvider<T, S>, viewContainer?: IViewContainer<T, S>, sourceComponent?: any, actionData?: ActionData): ActionExecContext<T, S, IDataProvider<T, S>>;
|
|
27
29
|
runAction<T, S>(action: ActionDescriptor<T>, itemId?: IdType, item?: T, dataProvider?: IDataProvider<T, S>, sourceComponent?: any, viewContainer?: IViewContainer<T, S>, actionData?: ActionData): Observable<ActionRunResult<T, S, IDataProvider<T, S>>>;
|
|
28
30
|
/**
|
|
@@ -94,7 +96,7 @@ export declare class MngActionExecutorService {
|
|
|
94
96
|
*/
|
|
95
97
|
triggerAction<T, S>(action: ActionDescriptor<T>, itemId?: IdType, item?: T, actionData?: ActionData, route?: ActivatedRoute, viewContainer?: IViewContainer<T, S>, sourceComponent?: any): Observable<ActionTriggerResult<T, S, IDataProvider<T, S>>>;
|
|
96
98
|
deactivateAction<T>(action: ActionDescriptor<T>): void;
|
|
97
|
-
|
|
99
|
+
toMngActionError(error?: any): MngError;
|
|
98
100
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngActionExecutorService, never>;
|
|
99
101
|
static ɵprov: i0.ɵɵInjectableDeclaration<MngActionExecutorService>;
|
|
100
102
|
}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { TranslateService } from '@ngx-translate/core';
|
|
2
|
+
import { Message } from 'primeng/api';
|
|
2
3
|
import { ActionDescriptor, TableDescriptor } from '../descriptors';
|
|
3
4
|
import { IViewContainer, MngError } from '../models';
|
|
4
|
-
export declare class
|
|
5
|
-
static notification(viewContainer?: IViewContainer<any, any>, title?: string, message?: string, severity?: 'success' | 'warn' | 'error'):
|
|
6
|
-
static tableNotificationError(translationService: TranslateService, table: TableDescriptor<any>, error: any, viewContainer?: IViewContainer<any, any>):
|
|
7
|
-
static actionNotificationSuccess(translationService: TranslateService, action: ActionDescriptor<any>, functionName: string, customTitleKey?: string, customMessageKey?: string, viewContainer?: IViewContainer<any, any>, item?: any):
|
|
8
|
-
static actionNotificationError(translationService: TranslateService, action: ActionDescriptor<any>, error: MngError, functionName: string, viewContainer?: IViewContainer<any, any>, item?: any):
|
|
9
|
-
static getFormEditorWarningMessage(translationService: TranslateService, title: string, message: string):
|
|
10
|
-
severity: string;
|
|
11
|
-
summary: any;
|
|
12
|
-
detail: any;
|
|
13
|
-
};
|
|
5
|
+
export declare class NotificationUtil {
|
|
6
|
+
static notification(viewContainer?: IViewContainer<any, any>, title?: string, message?: string, severity?: 'success' | 'warn' | 'error'): Message;
|
|
7
|
+
static tableNotificationError(translationService: TranslateService, table: TableDescriptor<any>, error: any, viewContainer?: IViewContainer<any, any>): Message;
|
|
8
|
+
static actionNotificationSuccess(translationService: TranslateService, action: ActionDescriptor<any>, functionName: string, customTitleKey?: string, customMessageKey?: string, viewContainer?: IViewContainer<any, any>, item?: any): Message;
|
|
9
|
+
static actionNotificationError(translationService: TranslateService, action: ActionDescriptor<any>, error: MngError, functionName: string, viewContainer?: IViewContainer<any, any>, item?: any): Message;
|
|
10
|
+
static getFormEditorWarningMessage(translationService: TranslateService, title: string, message: string): Message;
|
|
14
11
|
}
|
package/package.json
CHANGED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { I18nUtil } from './i18n.util';
|
|
2
|
-
export class ToastUtil {
|
|
3
|
-
static notification(viewContainer, title, message, severity = 'success') {
|
|
4
|
-
const messageService = viewContainer?.getMessageService();
|
|
5
|
-
if (!messageService) {
|
|
6
|
-
console.warn(`No message service was provided through view container, message will not be displayed.`);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
messageService.add({ severity: severity, summary: title, detail: message, life: severity === 'error' ? 10000 : 5000 });
|
|
10
|
-
}
|
|
11
|
-
static tableNotificationError(translationService, table, error, viewContainer) {
|
|
12
|
-
const params = {};
|
|
13
|
-
if (error?.message) {
|
|
14
|
-
params.errorMessage = `: ${error.message}`;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
params.errorMessage = '.';
|
|
18
|
-
}
|
|
19
|
-
console.log(params);
|
|
20
|
-
const tableErrorTitle = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.title', undefined, undefined, 'general.error', params) ?? undefined;
|
|
21
|
-
const tableErrorMessage = I18nUtil.instantModelTranslation(translationService, table.model, 'table.error.message', undefined, undefined, 'general.errorMessage', params) ?? undefined;
|
|
22
|
-
ToastUtil.notification(viewContainer, tableErrorTitle, tableErrorMessage, 'error');
|
|
23
|
-
}
|
|
24
|
-
static actionNotificationSuccess(translationService, action, functionName, customTitleKey, customMessageKey, viewContainer, item) {
|
|
25
|
-
const actionSuccessTitle = I18nUtil.instantActionTranslation(translationService, action, 'success.title', customTitleKey, item, 'general.success', functionName) ?? undefined;
|
|
26
|
-
const actionSuccessMessage = I18nUtil.instantActionTranslation(translationService, action, 'success.message', customMessageKey, item, 'general.successMessage', functionName) ?? undefined;
|
|
27
|
-
ToastUtil.notification(viewContainer, actionSuccessTitle, actionSuccessMessage);
|
|
28
|
-
}
|
|
29
|
-
static actionNotificationError(translationService, action, error, functionName, viewContainer, item) {
|
|
30
|
-
const params = {
|
|
31
|
-
errorMessage: I18nUtil.instantErrorI18nTranslation(translationService, error)
|
|
32
|
-
};
|
|
33
|
-
const actionErrorTitle = I18nUtil.instantActionTranslation(translationService, action, 'error.title', action.runNotificationErrorTitle, item, 'general.error', functionName, params) ??
|
|
34
|
-
undefined;
|
|
35
|
-
const actionErrorMessage = I18nUtil.instantActionTranslation(translationService, action, 'error.message', action.runNotificationErrorMessage, item, 'general.errorMessage', functionName, params) ?? undefined;
|
|
36
|
-
ToastUtil.notification(viewContainer, actionErrorTitle, actionErrorMessage, 'error');
|
|
37
|
-
}
|
|
38
|
-
static getFormEditorWarningMessage(translationService, title, message) {
|
|
39
|
-
const actionErrorTitle = translationService.instant(title) ?? undefined;
|
|
40
|
-
const actionErrorMessage = translationService.instant(message) ?? undefined;
|
|
41
|
-
return { severity: 'warn', summary: actionErrorTitle, detail: actionErrorMessage };
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9hc3QudXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdXRpbHMvdG9hc3QudXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJQSxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sYUFBYSxDQUFDO0FBRXJDLE1BQU0sT0FBTyxTQUFTO0lBQ1gsTUFBTSxDQUFDLFlBQVksQ0FBQyxhQUF3QyxFQUFFLEtBQWMsRUFBRSxPQUFnQixFQUFFLFdBQXlDLFNBQVM7UUFDckosTUFBTSxjQUFjLEdBQUcsYUFBYSxFQUFFLGlCQUFpQixFQUFFLENBQUM7UUFDMUQsSUFBSSxDQUFDLGNBQWMsRUFBRTtZQUNqQixPQUFPLENBQUMsSUFBSSxDQUFDLHdGQUF3RixDQUFDLENBQUM7W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