@mediusinc/mng-commons 0.2.19 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/en.json +16 -15
- package/assets/i18n/sl.json +16 -15
- package/esm2020/lib/api/services/crud-api.abstract.service.mjs +6 -6
- package/esm2020/lib/api/utils/object-serializer.util.mjs +7 -2
- package/esm2020/lib/components/action/action.component.mjs +26 -13
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +79 -22
- package/esm2020/lib/components/action/route/action-route.component.mjs +6 -30
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +66 -15
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +1 -1
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +57 -21
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +1 -1
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +2 -2
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +3 -3
- package/esm2020/lib/components/tableview/table/table.component.mjs +8 -4
- package/esm2020/lib/components/tableview/tableview.component.mjs +13 -13
- package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
- package/esm2020/lib/descriptors/action.descriptor.mjs +40 -2
- package/esm2020/lib/descriptors/editor.descriptor.mjs +74 -16
- package/esm2020/lib/descriptors/table.descriptor.mjs +29 -6
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +7 -6
- package/esm2020/lib/mng-commons.module.mjs +6 -3
- package/esm2020/lib/models/enum.model.mjs +1 -1
- package/esm2020/lib/models/error.model.mjs +2 -0
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/pipes/boolean.pipe.mjs +8 -3
- package/esm2020/lib/services/action-executor.service.mjs +65 -12
- package/esm2020/lib/services/commons.service.mjs +1 -2
- package/esm2020/lib/services/error-mapper.service.mjs +14 -0
- package/esm2020/lib/services/index.mjs +3 -1
- package/esm2020/lib/services/view-container.component.service.mjs +35 -0
- package/esm2020/lib/utils/i18n.util.mjs +29 -1
- package/esm2020/lib/utils/model.util.mjs +9 -7
- package/esm2020/lib/utils/toast.util.mjs +5 -9
- package/fesm2015/mediusinc-mng-commons.mjs +581 -219
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +578 -218
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/components/action/action.component.d.ts +9 -7
- package/lib/components/action/editor/action-editor.component.d.ts +19 -13
- package/lib/components/action/route/action-route.component.d.ts +1 -2
- package/lib/components/form/dropdown/dropdown.component.d.ts +10 -4
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +8 -2
- package/lib/components/tableview/table/table.component.d.ts +3 -2
- package/lib/components/tableview/tableview.component.d.ts +1 -2
- package/lib/descriptors/action.descriptor.d.ts +31 -11
- package/lib/descriptors/editor.descriptor.d.ts +32 -9
- package/lib/descriptors/table.descriptor.d.ts +11 -3
- package/lib/descriptors/tableview.descriptor.d.ts +1 -1
- package/lib/models/enum.model.d.ts +1 -0
- package/lib/models/error.model.d.ts +12 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/pipes/boolean.pipe.d.ts +1 -1
- package/lib/services/action-executor.service.d.ts +11 -4
- package/lib/services/error-mapper.service.d.ts +7 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/{mng-view-container-component.service.d.ts → view-container.component.service.d.ts} +0 -0
- package/lib/utils/i18n.util.d.ts +3 -0
- package/lib/utils/model.util.d.ts +1 -1
- package/lib/utils/toast.util.d.ts +2 -2
- package/package.json +1 -1
- package/scss/mng-overrides/_layout_dialog.scss +0 -7
- package/scss/mng-overrides/_theme_button.scss +0 -1
- package/scss/mng-overrides/_theme_dialog.scss +3 -1
- package/scss/mng-overrides/_theme_styles.scss +1 -0
- package/scss/mng-overrides/_theme_tableview.scss +10 -10
- package/scss/mng-overrides/_theme_toolbar.scss +5 -0
- package/scss/theme/default/_mng-variables-theme-dark.scss +3 -0
- package/scss/theme/default/_mng-variables-theme-light.scss +3 -0
- package/esm2020/lib/services/mng-view-container-component.service.mjs +0 -35
- package/scss/mng-overrides/_variables.scss +0 -2
|
@@ -8,8 +8,10 @@ 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 } from '../models';
|
|
12
12
|
import { IdType } from '../types';
|
|
13
|
+
import { MngErrorMapperService } from './error-mapper.service';
|
|
14
|
+
import { MngNavigationService } from './navigation.service';
|
|
13
15
|
import * as i0 from "@angular/core";
|
|
14
16
|
export declare class MngActionExecutorService {
|
|
15
17
|
private injector;
|
|
@@ -17,8 +19,10 @@ export declare class MngActionExecutorService {
|
|
|
17
19
|
private dialogService;
|
|
18
20
|
private confirmationService;
|
|
19
21
|
private translate;
|
|
22
|
+
private navigationService;
|
|
23
|
+
private errorMapper;
|
|
20
24
|
private defaultEditorDialogComponent;
|
|
21
|
-
constructor(injector: Injector, router: Router, dialogService: DialogService, confirmationService: ConfirmationService, translate: TranslateService, defaultEditorDialogComponent: Type<any>);
|
|
25
|
+
constructor(injector: Injector, router: Router, dialogService: DialogService, confirmationService: ConfirmationService, translate: TranslateService, navigationService: MngNavigationService, errorMapper: MngErrorMapperService, defaultEditorDialogComponent: Type<any>);
|
|
22
26
|
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>>;
|
|
23
27
|
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>>>;
|
|
24
28
|
/**
|
|
@@ -37,13 +41,14 @@ export declare class MngActionExecutorService {
|
|
|
37
41
|
* Runs editor action fetch function.
|
|
38
42
|
*
|
|
39
43
|
* @param action Action descriptor.
|
|
44
|
+
* @param item Item instance (if exists).
|
|
40
45
|
* @param itemId Item id.
|
|
41
46
|
* @param dataProvider Data provider
|
|
42
47
|
* @param sourceComponent Source component from where the fetch function was called.
|
|
43
48
|
* @param viewContainer View container/service. Tableview component.
|
|
44
49
|
* @param actionData Additional action data.
|
|
45
50
|
*/
|
|
46
|
-
runEditorFetch<T, S>(action: ActionEditorDescriptor<T>, itemId?: IdType, dataProvider?: IEditorDataProvider<T, S>, sourceComponent?: any, viewContainer?: IViewContainer<T, S>, actionData?: ActionData): Observable<ActionRunResult<T, S, IEditorDataProvider<T, S>>>;
|
|
51
|
+
runEditorFetch<T, S>(action: ActionEditorDescriptor<T>, item?: T, itemId?: IdType, dataProvider?: IEditorDataProvider<T, S>, sourceComponent?: any, viewContainer?: IViewContainer<T, S>, actionData?: ActionData): Observable<ActionRunResult<T, S, IEditorDataProvider<T, S>>>;
|
|
47
52
|
/**
|
|
48
53
|
* Prepares action exec context for action of type editor.
|
|
49
54
|
*
|
|
@@ -79,7 +84,7 @@ export declare class MngActionExecutorService {
|
|
|
79
84
|
* @param event Target table click event.
|
|
80
85
|
* @param route Currently activate route.
|
|
81
86
|
*/
|
|
82
|
-
triggerRowClickAction<T>(action: ActionDescriptor<T>, event: MngTableCellClickEvent<T>, route
|
|
87
|
+
triggerRowClickAction<T>(action: ActionDescriptor<T>, event: MngTableCellClickEvent<T>, route?: ActivatedRoute): Observable<ActionTriggerResult<T, unknown, IDataProvider<T, unknown>>>;
|
|
83
88
|
/**
|
|
84
89
|
* Triggers action with optional data (item, itemId, ...) and currently activated route.
|
|
85
90
|
*
|
|
@@ -88,6 +93,8 @@ export declare class MngActionExecutorService {
|
|
|
88
93
|
* @param route Optional activated route.
|
|
89
94
|
*/
|
|
90
95
|
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
|
+
deactivateAction<T>(action: ActionDescriptor<T>): void;
|
|
97
|
+
private toMngActionError;
|
|
91
98
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngActionExecutorService, never>;
|
|
92
99
|
static ɵprov: i0.ɵɵInjectableDeclaration<MngActionExecutorService>;
|
|
93
100
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MngError } from '../models';
|
|
2
|
+
export declare abstract class MngErrorMapperService {
|
|
3
|
+
abstract toMngError(error?: any, mngError?: MngError): MngError;
|
|
4
|
+
}
|
|
5
|
+
export declare class DefaultMngErrorMapperService extends MngErrorMapperService {
|
|
6
|
+
toMngError(error?: any, mngError?: MngError): MngError;
|
|
7
|
+
}
|
package/lib/services/index.d.ts
CHANGED
|
File without changes
|
package/lib/utils/i18n.util.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TranslateService } from '@ngx-translate/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ActionDescriptor, ModelDescriptor } from '../descriptors';
|
|
4
|
+
import { MngError } from '../models';
|
|
4
5
|
export declare class I18nUtil {
|
|
5
6
|
static instantModelTranslation(translate: TranslateService, model: ModelDescriptor<any>, keyPath: string, customKey?: string, item?: any, fallbackKey?: string, i18nParams?: any): string | null;
|
|
6
7
|
static getModelTabKey(model: ModelDescriptor<any>, tab: string): string;
|
|
@@ -11,6 +12,8 @@ export declare class I18nUtil {
|
|
|
11
12
|
static getActionTranslation(translate: TranslateService, action: ActionDescriptor<any>, keyPath: string, customKey?: string, item?: any, fallbackKey?: string, oneTime?: boolean): Observable<string | null>;
|
|
12
13
|
static getModelI18nParams(model: ModelDescriptor<any>, item: any, i18nModelName?: string, i18nParameters?: any): any;
|
|
13
14
|
static getActionI18nParams(action: ActionDescriptor<any>, item: any, i18nModelName?: string, i18nParameters?: any, functionTitle?: string): any;
|
|
15
|
+
static instantErrorI18nTranslation(translate: TranslateService, error: MngError, i18nParameters?: any): string | null;
|
|
16
|
+
static getErrorI18nParams(error: MngError, i18nParameters?: any): any;
|
|
14
17
|
static instantModelName(translate: TranslateService, model: ModelDescriptor<any>, singular?: boolean): string | null;
|
|
15
18
|
static getModelName(translate: TranslateService, model: ModelDescriptor<any>, oneTime?: boolean, singular?: boolean): Observable<string | null>;
|
|
16
19
|
static getModelNameKeys(model: ModelDescriptor<any>, singular?: boolean): string[];
|
|
@@ -3,5 +3,5 @@ import { ClassType } from '../types';
|
|
|
3
3
|
export declare class ModelUtil {
|
|
4
4
|
static findIdAttribute<T>(classType: ClassType<T>): string | null;
|
|
5
5
|
static findTitleAttribute<T>(classType: ClassType<T>): string | null;
|
|
6
|
-
static trySetLookupItemsProperties<T>(lookup: ILookupDescriptor<T
|
|
6
|
+
static trySetLookupItemsProperties<T>(lookup: ILookupDescriptor<T>, idAsDataKey?: boolean): void;
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TranslateService } from '@ngx-translate/core';
|
|
2
2
|
import { ActionDescriptor, TableDescriptor } from '../descriptors';
|
|
3
|
-
import { IViewContainer } from '../models';
|
|
3
|
+
import { IViewContainer, MngError } from '../models';
|
|
4
4
|
export declare class ToastUtil {
|
|
5
5
|
static notification(viewContainer?: IViewContainer<any, any>, title?: string, message?: string, severity?: 'success' | 'warn' | 'error'): void;
|
|
6
6
|
static tableNotificationError(translationService: TranslateService, table: TableDescriptor<any>, error: any, viewContainer?: IViewContainer<any, any>): void;
|
|
7
7
|
static actionNotificationSuccess(translationService: TranslateService, action: ActionDescriptor<any>, functionName: string, customTitleKey?: string, customMessageKey?: string, viewContainer?: IViewContainer<any, any>, item?: any): void;
|
|
8
|
-
static actionNotificationError(translationService: TranslateService, action: ActionDescriptor<any>, error:
|
|
8
|
+
static actionNotificationError(translationService: TranslateService, action: ActionDescriptor<any>, error: MngError, functionName: string, viewContainer?: IViewContainer<any, any>, item?: any): void;
|
|
9
9
|
static getFormEditorWarningMessage(translationService: TranslateService, title: string, message: string): {
|
|
10
10
|
severity: string;
|
|
11
11
|
summary: any;
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
.p-dialog {
|
|
2
|
-
&.mng-details-dynamic-dialog
|
|
2
|
+
&.mng-details-dynamic-dialog,
|
|
3
|
+
&.mng-formly-field-table-multiselect-dialog,
|
|
4
|
+
&.mng-formly-field-table-form-dialog {
|
|
3
5
|
.p-dialog-content {
|
|
4
6
|
border-bottom-left-radius: $dialogBorderRadius;
|
|
5
7
|
border-bottom-right-radius: $dialogBorderRadius;
|
|
@@ -34,16 +34,6 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.p-datatable:not(.p-datatable-gridlines) {
|
|
38
|
-
.p-datatable-tbody > tr > td {
|
|
39
|
-
cursor: auto;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.p-datatable-tbody > tr > td.clickable {
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
37
|
/* Responsive */
|
|
48
38
|
.p-datatable-tbody > tr > td .p-column-title {
|
|
49
39
|
display: none;
|
|
@@ -92,3 +82,13 @@
|
|
|
92
82
|
}
|
|
93
83
|
}
|
|
94
84
|
}
|
|
85
|
+
|
|
86
|
+
.p-datatable:not(.p-datatable-gridlines) {
|
|
87
|
+
.p-datatable-tbody > tr > td {
|
|
88
|
+
cursor: auto;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.p-datatable-tbody > tr > td.clickable {
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Subject } from 'rxjs';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "primeng/api";
|
|
5
|
-
/**
|
|
6
|
-
* Should be used with providers defined within component.
|
|
7
|
-
*/
|
|
8
|
-
export class MngViewContainerComponentService {
|
|
9
|
-
constructor(messageService) {
|
|
10
|
-
this.messageService = messageService;
|
|
11
|
-
this.actions = [];
|
|
12
|
-
this._reloadTableSubject = new Subject();
|
|
13
|
-
}
|
|
14
|
-
set dataProvider(dataProvider) {
|
|
15
|
-
this._dataProvider = dataProvider;
|
|
16
|
-
}
|
|
17
|
-
get reloadTable$() {
|
|
18
|
-
return this._reloadTableSubject.asObservable();
|
|
19
|
-
}
|
|
20
|
-
triggerTableReload(event) {
|
|
21
|
-
this._reloadTableSubject.next(event);
|
|
22
|
-
}
|
|
23
|
-
getMessageService() {
|
|
24
|
-
return this.messageService;
|
|
25
|
-
}
|
|
26
|
-
getDataProvider() {
|
|
27
|
-
return this._dataProvider;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
MngViewContainerComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, deps: [{ token: i1.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
31
|
-
MngViewContainerComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService });
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MngViewContainerComponentService, decorators: [{
|
|
33
|
-
type: Injectable
|
|
34
|
-
}], ctorParameters: function () { return [{ type: i1.MessageService }]; } });
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5nLXZpZXctY29udGFpbmVyLWNvbXBvbmVudC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYi9zZXJ2aWNlcy9tbmctdmlldy1jb250YWluZXItY29tcG9uZW50LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUd6QyxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sTUFBTSxDQUFDOzs7QUFNN0I7O0dBRUc7QUFFSCxNQUFNLE9BQU8sZ0NBQWdDO0lBTXpDLFlBQW9CLGNBQThCO1FBQTlCLG1CQUFjLEdBQWQsY0FBYyxDQUFnQjtRQUozQyxZQUFPLEdBQStCLEVBQUUsQ0FBQztRQUV4Qyx3QkFBbUIsR0FBaUIsSUFBSSxPQUFPLEVBQUUsQ0FBQztJQUVMLENBQUM7SUFFdEQsSUFBVyxZQUFZLENBQUMsWUFBaUM7UUFDckQsSUFBSSxDQUFDLGFBQWEsR0FBRyxZQUFZLENBQUM7SUFDdEMsQ0FBQztJQUVELElBQVcsWUFBWTtRQUNuQixPQUFPLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxZQUFZLEVBQUUsQ0FBQztJQUNuRCxDQUFDO0lBRU0sa0JBQWtCLENBQUMsS0FBVTtRQUNoQyxJQUFJLENBQUMsbUJBQW1CLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQ3pDLENBQUM7SUFFTSxpQkFBaUI7UUFDcEIsT0FBTyxJQUFJLENBQUMsY0FBYyxDQUFDO0lBQy9CLENBQUM7SUFFTSxlQU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