@mediusinc/mng-commons 4.0.0-rc.1 → 4.0.0-rc.3
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/esm2022/index.mjs +12 -2
- package/esm2022/lib/api/utils/medius-rest.util.mjs +15 -7
- package/esm2022/lib/api/utils/object-serializer.util.mjs +8 -4
- package/esm2022/lib/components/action/action.component.mjs +16 -45
- package/esm2022/lib/components/action/editor/action-editor.component.mjs +60 -434
- package/esm2022/lib/components/action/editor/injector-context/action-editor-injector-context.component.mjs +394 -0
- package/esm2022/lib/components/action/index.mjs +2 -1
- package/esm2022/lib/components/action/localization/data-language-dropdown.component.mjs +6 -7
- package/esm2022/lib/components/action/models/action-component.model.mjs +1 -1
- package/esm2022/lib/components/action/models/action-execution.model.mjs +3 -6
- package/esm2022/lib/components/action/models/index.mjs +1 -2
- package/esm2022/lib/components/action/route/action-route.component.mjs +14 -30
- package/esm2022/lib/components/action/table/action-table.component.mjs +154 -0
- package/esm2022/lib/components/form/editor/form-editor.component.mjs +5 -11
- package/esm2022/lib/components/form/formly/fields/formly-field-custom/formly-field-custom.component.mjs +1 -1
- package/esm2022/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +5 -5
- package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +6 -7
- package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +5 -5
- package/esm2022/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +1 -1
- package/esm2022/lib/components/layout/main-layout.component.mjs +21 -25
- package/esm2022/lib/components/layout/topbar.component.mjs +8 -8
- package/esm2022/lib/components/layoutV2/main-layout.component.mjs +13 -10
- package/esm2022/lib/components/layoutV2/menu-item.component.mjs +48 -5
- package/esm2022/lib/components/layoutV2/menu.component.mjs +13 -4
- package/esm2022/lib/components/layoutV2/services/main-layout.component.service.mjs +11 -2
- package/esm2022/lib/components/layoutV2/sidebar.component.mjs +5 -5
- package/esm2022/lib/components/layoutV2/topbar.component.mjs +7 -12
- package/esm2022/lib/components/notification/notification-wrapper.component.mjs +50 -0
- package/esm2022/lib/components/table/column-filter-full/column-filter-full.component.mjs +466 -0
- package/esm2022/lib/components/table/column-value/column-value.component.mjs +87 -0
- package/esm2022/lib/components/table/models/table.event.mjs +16 -0
- package/esm2022/lib/components/table/models/table.interface.mjs +2 -0
- package/esm2022/lib/components/table/table-column-filter-class/table-column-filter-class.pipe.mjs +25 -0
- package/esm2022/lib/components/table/table.component.mjs +717 -0
- package/esm2022/lib/components/tableview/index.mjs +1 -4
- package/esm2022/lib/components/tableview/route/tableview-route.abstract.component.mjs +5 -5
- package/esm2022/lib/components/tableview/route/tableview-route.component.mjs +3 -9
- package/esm2022/lib/components/tableview/tableview.component.mjs +18 -78
- package/esm2022/lib/descriptors/editor/editor.descriptor.mjs +1 -1
- package/esm2022/lib/descriptors/editor/field-lookup.descriptor.mjs +1 -2
- package/esm2022/lib/descriptors/filter/filter.descriptor.mjs +20 -20
- package/esm2022/lib/descriptors/table/table.descriptor.mjs +16 -17
- package/esm2022/lib/descriptors/tableview/tableview.descriptor.mjs +1 -1
- package/esm2022/lib/directives/component.directive.mjs +8 -4
- package/esm2022/lib/helpers/coercion.mjs +8 -1
- package/esm2022/lib/models/action-editor.model.mjs +1 -1
- package/esm2022/lib/models/config.model.mjs +1 -1
- package/esm2022/lib/models/index.mjs +2 -2
- package/esm2022/lib/models/layout-config.model.mjs +2 -0
- package/esm2022/lib/models/view-container.model.mjs +1 -1
- package/esm2022/lib/provide-commons.mjs +7 -1
- package/esm2022/lib/registry/type.registry.mjs +2 -3
- package/esm2022/lib/router/route-builder.mjs +1 -1
- package/esm2022/lib/services/action/action-executor.service.mjs +725 -0
- package/esm2022/lib/services/action/component-action-executor.service.mjs +19 -0
- package/esm2022/lib/services/action/index.mjs +5 -0
- package/esm2022/lib/services/action/provide-action-executor.mjs +9 -0
- package/esm2022/lib/services/action/root-action-executor.service.mjs +18 -0
- package/esm2022/lib/services/commons.service.mjs +5 -5
- package/esm2022/lib/services/index.mjs +1 -3
- package/esm2022/lib/services/logger.service.mjs +2 -2
- package/esm2022/lib/services/view/index.mjs +3 -0
- package/esm2022/lib/services/view/provide-view-container.mjs +17 -0
- package/esm2022/lib/services/view/view-container.service.mjs +59 -0
- package/esm2022/lib/utils/date.util.mjs +33 -23
- package/esm2022/lib/utils/notification.util.mjs +9 -16
- package/esm2022/lib/utils/string.util.mjs +2 -2
- package/esm2022/lib/utils/tableview.util.mjs +2 -2
- package/fesm2022/mediusinc-mng-commons.mjs +4305 -4121
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/index.d.ts +10 -1
- package/lib/components/action/action.component.d.ts +11 -17
- package/lib/components/action/editor/action-editor.component.d.ts +20 -80
- package/lib/components/action/editor/injector-context/action-editor-injector-context.component.d.ts +80 -0
- package/lib/components/action/index.d.ts +1 -0
- package/lib/components/action/localization/data-language-dropdown.component.d.ts +2 -3
- package/lib/components/action/models/action-component.model.d.ts +0 -2
- package/lib/components/action/models/action-execution.model.d.ts +6 -6
- package/lib/components/action/models/index.d.ts +0 -1
- package/lib/components/action/route/action-route.component.d.ts +6 -12
- package/lib/components/action/table/action-table.component.d.ts +50 -0
- package/lib/components/form/editor/form-editor.component.d.ts +4 -7
- package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +2 -4
- package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -2
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -3
- package/lib/components/layout/main-layout.component.d.ts +4 -7
- package/lib/components/layoutV2/main-layout.component.d.ts +4 -3
- package/lib/components/layoutV2/menu-item.component.d.ts +7 -3
- package/lib/components/layoutV2/menu.component.d.ts +2 -0
- package/lib/components/layoutV2/services/main-layout.component.service.d.ts +3 -0
- package/lib/components/layoutV2/sidebar.component.d.ts +1 -1
- package/lib/components/layoutV2/topbar.component.d.ts +2 -3
- package/lib/components/notification/notification-wrapper.component.d.ts +12 -0
- package/lib/components/{tableview/table → table}/column-filter-full/column-filter-full.component.d.ts +2 -2
- package/lib/components/{tableview/table → table}/column-value/column-value.component.d.ts +3 -3
- package/lib/components/{tableview/table → table}/models/table.interface.d.ts +3 -1
- package/lib/components/table/table-column-filter-class/table-column-filter-class.pipe.d.ts +8 -0
- package/lib/components/table/table.component.d.ts +122 -0
- package/lib/components/tableview/index.d.ts +0 -3
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +2 -3
- package/lib/components/tableview/route/tableview-route.component.d.ts +0 -3
- package/lib/components/tableview/tableview.component.d.ts +4 -20
- package/lib/descriptors/editor/editor.descriptor.d.ts +1 -1
- package/lib/descriptors/filter/filter.descriptor.d.ts +7 -7
- package/lib/descriptors/table/table.descriptor.d.ts +15 -12
- package/lib/descriptors/tableview/tableview.descriptor.d.ts +1 -1
- package/lib/directives/component.directive.d.ts +3 -2
- package/lib/models/action-editor.model.d.ts +11 -0
- package/lib/models/config.model.d.ts +3 -13
- package/lib/models/index.d.ts +1 -1
- package/lib/models/layout-config.model.d.ts +33 -0
- package/lib/models/view-container.model.d.ts +0 -25
- package/lib/router/route-builder.d.ts +1 -1
- package/lib/services/{action-executor.service.d.ts → action/action-executor.service.d.ts} +32 -31
- package/lib/services/action/component-action-executor.service.d.ts +9 -0
- package/lib/services/action/index.d.ts +4 -0
- package/lib/services/action/provide-action-executor.d.ts +2 -0
- package/lib/services/action/root-action-executor.service.d.ts +9 -0
- package/lib/services/index.d.ts +0 -2
- package/lib/services/view/index.d.ts +2 -0
- package/lib/services/view/provide-view-container.d.ts +2 -0
- package/lib/services/view/view-container.service.d.ts +32 -0
- package/lib/utils/date.util.d.ts +12 -2
- package/lib/utils/notification.util.d.ts +6 -6
- package/openapi/angular/README.mustache +226 -0
- package/openapi/angular/api.module.mustache +39 -0
- package/openapi/angular/api.service.mustache +253 -0
- package/openapi/angular/apiInterface.mustache +47 -0
- package/openapi/angular/apis.mustache +12 -0
- package/openapi/angular/configuration.mustache +128 -0
- package/openapi/angular/custom/base-api.service.mustache +14 -0
- package/openapi/angular/custom/helpers.mustache +71 -0
- package/openapi/angular/custom/modelSchema.mustache +46 -0
- package/openapi/angular/custom/schema.mustache +18 -0
- package/openapi/angular/encoder.mustache +20 -0
- package/openapi/angular/git_push.sh.mustache +57 -0
- package/openapi/angular/index.mustache +0 -0
- package/openapi/angular/licenseInfo.mustache +11 -0
- package/openapi/angular/model.mustache +16 -0
- package/openapi/angular/modelAlias.mustache +1 -0
- package/openapi/angular/modelEnum.mustache +24 -0
- package/openapi/angular/modelGeneric.mustache +14 -0
- package/openapi/angular/modelGenericAdditionalProperties.mustache +5 -0
- package/openapi/angular/modelGenericEnums.mustache +30 -0
- package/openapi/angular/modelOneOf.mustache +14 -0
- package/openapi/angular/modelTaggedUnion.mustache +21 -0
- package/openapi/angular/models.mustache +5 -0
- package/openapi/angular/ng-package.mustache +6 -0
- package/openapi/angular/package.mustache +39 -0
- package/openapi/angular/param.mustache +69 -0
- package/openapi/angular/tsconfig.mustache +28 -0
- package/openapi/angular/variables.mustache +9 -0
- package/openapi/{templates → node}/model.mustache +3 -17
- package/package.json +2 -2
- package/scss/mng-commons-dark-v2.scss +1 -1
- package/scss/mng-commons-light-v2.scss +1 -1
- package/scss/mng-overrides/_theme_datatable.scss +24 -10
- package/scss/v2/layout/layout.scss +2 -2
- package/scss/v2/layout/mng/_mng_layout_topbar.scss +2 -0
- package/scss/v2/layout/preloading.scss +8 -8
- package/scss/v2/theme/theme-base/mng/_mng_theme_datatable.scss +24 -9
- package/scss/v2/theme/theme-dark/_variables.scss +24 -12
- package/scss/v2/theme/theme-dark/blue/theme.scss +4 -4
- package/scss/v2/theme/theme-light/_variables.scss +23 -11
- package/scss/v2/theme/theme-light/blue/theme.scss +2 -2
- package/esm2022/lib/components/action/models/action-confirmation-service.model.mjs +0 -2
- package/esm2022/lib/components/tableview/models/index.mjs +0 -2
- package/esm2022/lib/components/tableview/models/table.event.mjs +0 -16
- package/esm2022/lib/components/tableview/table/column-filter-full/column-filter-full.component.mjs +0 -467
- package/esm2022/lib/components/tableview/table/column-value/column-value.component.mjs +0 -87
- package/esm2022/lib/components/tableview/table/models/index.mjs +0 -2
- package/esm2022/lib/components/tableview/table/models/table.interface.mjs +0 -2
- package/esm2022/lib/components/tableview/table/table.component.mjs +0 -752
- package/esm2022/lib/models/menu-config.model.mjs +0 -2
- package/esm2022/lib/services/action-executor.service.mjs +0 -747
- package/esm2022/lib/services/view-container.component.service.mjs +0 -65
- package/lib/components/action/models/action-confirmation-service.model.d.ts +0 -6
- package/lib/components/tableview/models/index.d.ts +0 -1
- package/lib/components/tableview/table/models/index.d.ts +0 -1
- package/lib/components/tableview/table/table.component.d.ts +0 -147
- package/lib/models/menu-config.model.d.ts +0 -15
- package/lib/services/view-container.component.service.d.ts +0 -36
- /package/lib/components/{tableview → table}/models/table.event.d.ts +0 -0
- /package/openapi/{templates → node}/models.mustache +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { MenuItem } from 'primeng/api';
|
|
3
|
+
export type MngMenuMode = 'static' | 'overlay' | 'reveal' | 'drawer' | 'slim' | 'slim-plus';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use MngMenuConfigV2 instead
|
|
6
|
+
*/
|
|
7
|
+
export interface MngLayoutConfig {
|
|
8
|
+
menuMode: 'static' | 'sidebar' | 'slim' | 'overlay';
|
|
9
|
+
menuItems?: MenuItem[];
|
|
10
|
+
pinEnabled?: boolean;
|
|
11
|
+
sidebarSlim?: boolean;
|
|
12
|
+
disableNotificationWrapper?: boolean;
|
|
13
|
+
components?: {
|
|
14
|
+
topbar?: Type<any>;
|
|
15
|
+
menu?: Type<any>;
|
|
16
|
+
footer?: Type<any>;
|
|
17
|
+
breadcrumb?: Type<any>;
|
|
18
|
+
topbarUser?: Type<any>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface MngLayoutConfigV2 {
|
|
22
|
+
menuMode: MngMenuMode;
|
|
23
|
+
menuItems?: MenuItem[];
|
|
24
|
+
ripple?: boolean;
|
|
25
|
+
disableNotificationWrapper?: boolean;
|
|
26
|
+
components?: {
|
|
27
|
+
topbar?: Type<any> | false;
|
|
28
|
+
menu?: Type<any> | false;
|
|
29
|
+
footer?: Type<any> | false;
|
|
30
|
+
breadcrumb?: Type<any> | false;
|
|
31
|
+
topbarUser?: Type<any> | false;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
import { MessageService } from 'primeng/api';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
1
|
import { MediusQueryParam } from '../api/models';
|
|
4
|
-
import { ActionInstance } from '../components/action/models';
|
|
5
|
-
import { IDataProvider } from '../data-providers';
|
|
6
|
-
import { ActionDescriptorInst } from '../descriptors/action';
|
|
7
|
-
export interface IViewContainer<T = any, S = any> {
|
|
8
|
-
getMessageService(): MessageService | undefined;
|
|
9
|
-
getDataProvider(): IDataProvider<T, S> | undefined;
|
|
10
|
-
getActions(): Array<ActionDescriptorInst<T, S>>;
|
|
11
|
-
}
|
|
12
|
-
export interface IViewContainerTable<T = any, S = any> extends IViewContainer<T, S> {
|
|
13
|
-
getTableReload$(): Observable<ViewContainerTableReloadEvent>;
|
|
14
|
-
reloadTable(event: ViewContainerTableReloadEvent): void;
|
|
15
|
-
}
|
|
16
|
-
export interface IViewContainerEditor<T = any, S = any> extends IViewContainer<T, S> {
|
|
17
|
-
getEditorReset$(): Observable<ViewContainerEditorResetEvent<T>>;
|
|
18
|
-
resetEditor(event?: ViewContainerEditorResetEvent<T>): void;
|
|
19
|
-
getEditorClose$(): Observable<ViewContainerEditorCloseEvent<T>>;
|
|
20
|
-
closeEditor(event?: ViewContainerEditorCloseEvent<T>): void;
|
|
21
|
-
}
|
|
22
|
-
export interface IViewActionRouteTriggeredContainer<T = any, S = any> {
|
|
23
|
-
getActionRouteTriggeredInstance(): ActionInstance<T, S> | undefined;
|
|
24
|
-
setActionRouteTriggeredInstance(instance: ActionInstance<T, S>): void;
|
|
25
|
-
unsetActionRouteTriggeredInstance(): void;
|
|
26
|
-
}
|
|
27
2
|
export interface ViewContainerTableReloadEvent {
|
|
28
3
|
emitEvent?: boolean;
|
|
29
4
|
resetParams?: boolean;
|
|
@@ -9,7 +9,7 @@ import { BreadcrumbType, MngRouterData } from './models';
|
|
|
9
9
|
import { RoutesBuilder } from './routes-builder';
|
|
10
10
|
import { TableviewRouteBuilderInternal } from './tableview-route-builder';
|
|
11
11
|
export declare class RouteBuilder {
|
|
12
|
-
|
|
12
|
+
protected readonly route: Route;
|
|
13
13
|
private routePath;
|
|
14
14
|
protected routeData: MngRouterData;
|
|
15
15
|
private root?;
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import { Injector
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
+
import { ConfirmationService, MessageService } from 'primeng/api';
|
|
4
5
|
import { DialogService } from 'primeng/dynamicdialog';
|
|
5
|
-
import { ActionContext, ActionContextValidation, ActionInstance, ActionParameters } from '
|
|
6
|
-
import { IDataProvider
|
|
7
|
-
import { ActionDescriptorInst, ActionEditorDescriptorInst } from '
|
|
8
|
-
import { IActionEditorComponent, IMngError } from '
|
|
9
|
-
import { MngParametrizePipe } from '
|
|
10
|
-
import { MngActionErrorMapperService } from '
|
|
11
|
-
import { MngCommonsService } from '
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
import { ActionContext, ActionContextValidation, ActionInstance, ActionInstanceStateEnum, ActionParameters } from '../../components/action/models';
|
|
7
|
+
import { IDataProvider } from '../../data-providers';
|
|
8
|
+
import { ActionDescriptorInst, ActionEditorDescriptorInst } from '../../descriptors/action';
|
|
9
|
+
import { IActionEditorComponent, IMngError } from '../../models';
|
|
10
|
+
import { MngParametrizePipe } from '../../pipes';
|
|
11
|
+
import { MngActionErrorMapperService } from '../action-error-mapper.service';
|
|
12
|
+
import { MngCommonsService } from '../commons.service';
|
|
13
|
+
import { MngLoggerService } from '../logger.service';
|
|
14
|
+
import { MngNavigationService } from '../navigation.service';
|
|
15
|
+
import { ViewContainer } from '../view';
|
|
16
|
+
export declare abstract class MngActionExecutorService {
|
|
17
|
+
protected readonly injector: Injector;
|
|
18
|
+
protected readonly router: Router;
|
|
19
|
+
protected readonly dialogService: DialogService;
|
|
20
|
+
protected readonly translate: TranslateService;
|
|
21
|
+
protected readonly mngCommons: MngCommonsService;
|
|
22
|
+
protected readonly navigationService: MngNavigationService;
|
|
23
|
+
protected readonly errorMapper: MngActionErrorMapperService;
|
|
24
|
+
protected readonly parametrize: MngParametrizePipe;
|
|
25
|
+
protected readonly defaultEditorDialogComponent: import("@angular/core").Type<any>;
|
|
26
|
+
protected readonly messageService: MessageService;
|
|
27
|
+
protected readonly confirmationService: ConfirmationService;
|
|
28
|
+
protected readonly viewContainer: ViewContainer<any, any> | null;
|
|
29
|
+
protected readonly instancesBufferMax = 100;
|
|
30
|
+
protected logger: MngLoggerService;
|
|
31
|
+
abstract get instances(): ActionInstance<any, any>[];
|
|
29
32
|
/**
|
|
30
33
|
* Prepares action context for usage in validation.
|
|
31
34
|
* @param action Action descriptor.
|
|
@@ -60,7 +63,7 @@ export declare class MngActionExecutorService {
|
|
|
60
63
|
*
|
|
61
64
|
* @return Action context for fetch function.
|
|
62
65
|
*/
|
|
63
|
-
prepareContextForEditorFetch<T, S>(action: ActionEditorDescriptorInst<T>, parameters: ActionParameters<T>, dataProvider?:
|
|
66
|
+
prepareContextForEditorFetch<T, S>(action: ActionEditorDescriptorInst<T>, parameters: ActionParameters<T>, dataProvider?: IDataProvider<T, S>, instance?: ActionInstance<T, S>, previousActionInstance?: ActionInstance<unknown, unknown>): ActionContext<T, S>;
|
|
64
67
|
/**
|
|
65
68
|
* Runs editor action's submit (=main run) function by creating new action context for action instance.
|
|
66
69
|
*
|
|
@@ -72,7 +75,7 @@ export declare class MngActionExecutorService {
|
|
|
72
75
|
*
|
|
73
76
|
* @return Action context for submit (=run) function.
|
|
74
77
|
*/
|
|
75
|
-
prepareContextForEditorSubmit<T, S>(action: ActionEditorDescriptorInst<T>, parameters: ActionParameters<T>, dataProvider?:
|
|
78
|
+
prepareContextForEditorSubmit<T, S>(action: ActionEditorDescriptorInst<T>, parameters: ActionParameters<T>, dataProvider?: IDataProvider<T, S>, instance?: ActionInstance<T, S>, previousActionInstance?: ActionInstance<unknown, unknown>): ActionContext<T, S>;
|
|
76
79
|
/**
|
|
77
80
|
* Prepares action exec context for action of type editor.
|
|
78
81
|
*
|
|
@@ -106,7 +109,7 @@ export declare class MngActionExecutorService {
|
|
|
106
109
|
*
|
|
107
110
|
* @return Action instance - if non provided in parameters, the newly created will be returned.
|
|
108
111
|
*/
|
|
109
|
-
activateAction<T, S>(action: ActionDescriptorInst<T>, parameters: ActionParameters<T>, instance?: ActionInstance<T, S>, previousActionInstance?: ActionInstance<
|
|
112
|
+
activateAction<T, S>(action: ActionDescriptorInst<T>, parameters: ActionParameters<T>, instance?: ActionInstance<T, S>, previousActionInstance?: ActionInstance<any, any>, runContext?: boolean): ActionInstance<T, S>;
|
|
110
113
|
/**
|
|
111
114
|
* To be called when action editor is initialized to correctly activate action.
|
|
112
115
|
* @param action Action descriptor.
|
|
@@ -168,7 +171,5 @@ export declare class MngActionExecutorService {
|
|
|
168
171
|
* @param skipInitializationFromViewContainer If initialization of instance from view container should be skipped.
|
|
169
172
|
* @private
|
|
170
173
|
*/
|
|
171
|
-
|
|
172
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MngActionExecutorService, never>;
|
|
173
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MngActionExecutorService>;
|
|
174
|
+
protected getOrCreateInstance<T, S>(instance: ActionInstance<T, S> | undefined, action?: ActionDescriptorInst<T>, parameters?: ActionParameters<T>, instanceInitialStatus?: ActionInstanceStateEnum, skipInitializationFromViewContainer?: boolean): ActionInstance<T, S>;
|
|
174
175
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionInstance } from '../../components/action/models';
|
|
2
|
+
import { MngActionExecutorService } from './action-executor.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MngComponentActionExecutorService extends MngActionExecutorService {
|
|
5
|
+
private readonly rootActionExecutorService;
|
|
6
|
+
get instances(): ActionInstance<any, any>[];
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MngComponentActionExecutorService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MngComponentActionExecutorService>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionInstance } from '../../components/action/models';
|
|
2
|
+
import { MngActionExecutorService } from './action-executor.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MngRootActionExecutorService extends MngActionExecutorService {
|
|
5
|
+
private readonly _instances;
|
|
6
|
+
get instances(): ActionInstance<any, any>[];
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MngRootActionExecutorService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MngRootActionExecutorService>;
|
|
9
|
+
}
|
package/lib/services/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export * from './action-executor.service';
|
|
2
1
|
export * from './action-error-mapper.service';
|
|
3
2
|
export * from './configuration.service';
|
|
4
3
|
export * from './commons.service';
|
|
5
4
|
export * from './navigation.service';
|
|
6
5
|
export * from './router.service';
|
|
7
6
|
export * from './version.service';
|
|
8
|
-
export * from './view-container.component.service';
|
|
9
7
|
export * from './mng-localstorage-config.service';
|
|
10
8
|
export * from './log-publisher-console.service';
|
|
11
9
|
export * from './logger.service';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ActionInstance } from '../../components/action/models';
|
|
3
|
+
import { IDataProvider } from '../../data-providers';
|
|
4
|
+
import { ActionDescriptorInst } from '../../descriptors/action';
|
|
5
|
+
import { ViewContainerEditorCloseEvent, ViewContainerEditorResetEvent, ViewContainerTableReloadEvent } from '../../models';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Should be used with providers defined within component.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ViewContainer<T, S> {
|
|
11
|
+
private _dataProvider?;
|
|
12
|
+
private _routeTriggeredActionInstance?;
|
|
13
|
+
private actions;
|
|
14
|
+
private _tableReloadSubject;
|
|
15
|
+
private _editorResetSubject;
|
|
16
|
+
private _editorCloseSubject;
|
|
17
|
+
set dataProvider(dataProvider: IDataProvider<T, S>);
|
|
18
|
+
getDataProvider(): IDataProvider<T, S> | undefined;
|
|
19
|
+
getActions(): Array<ActionDescriptorInst<T>>;
|
|
20
|
+
setActions(actions: Array<ActionDescriptorInst<T>>): void;
|
|
21
|
+
getTableReload$(): Observable<ViewContainerTableReloadEvent>;
|
|
22
|
+
reloadTable(event?: ViewContainerTableReloadEvent): void;
|
|
23
|
+
getEditorReset$(): Observable<ViewContainerEditorResetEvent<T>>;
|
|
24
|
+
resetEditor(event?: ViewContainerEditorResetEvent<T> | undefined): void;
|
|
25
|
+
getEditorClose$(): Observable<ViewContainerEditorCloseEvent<T>>;
|
|
26
|
+
closeEditor(event?: ViewContainerEditorCloseEvent<T>): void;
|
|
27
|
+
getRouteTriggeredActionInstance(): ActionInstance<T, S> | undefined;
|
|
28
|
+
setRouteTriggeredActionInstance(instance: ActionInstance<T, S>): void;
|
|
29
|
+
unsetRouteTriggeredActionInstance(): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ViewContainer<any, any>, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ViewContainer<any, any>>;
|
|
32
|
+
}
|
package/lib/utils/date.util.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
export type toIsoStringTypeOptType = 'date' | 'date-time' | 'dateTime';
|
|
2
|
+
export type toIsoStringDateTimeOptsType = {
|
|
3
|
+
utc?: boolean;
|
|
4
|
+
noTimezone?: boolean;
|
|
5
|
+
noMillis?: boolean;
|
|
6
|
+
};
|
|
1
7
|
export declare class DateUtil {
|
|
2
8
|
private static readonly NG_PRIME_FORMAT_SUPPORTED;
|
|
3
9
|
private static readonly NG_PRIME_FORMAT_OTHER;
|
|
4
10
|
private static readonly NG_PRIME_FORMAT_MAP;
|
|
5
|
-
private static
|
|
6
|
-
static toIsoString(
|
|
11
|
+
private static padNumber;
|
|
12
|
+
static toIsoString(value: string | number | Date, type?: 'date'): string;
|
|
13
|
+
static toIsoString(value: string | number | Date, type: 'date-time' | 'dateTime', dateTimeOpts?: toIsoStringDateTimeOptsType): string;
|
|
14
|
+
static toIsoString(value: undefined | null | unknown, type?: 'date'): null;
|
|
15
|
+
static toIsoString(value: undefined | null | unknown, type: 'date-time' | 'dateTime', dateTimeOpts?: toIsoStringDateTimeOptsType): null;
|
|
16
|
+
static toIsoString(value: unknown, type?: toIsoStringTypeOptType, dateTimeOpts?: toIsoStringDateTimeOptsType): string | null;
|
|
7
17
|
static fromPrimeToAngularDateFormat(ngDateFormat: string): string;
|
|
8
18
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TranslateService } from '@ngx-translate/core';
|
|
2
|
-
import { Message } from 'primeng/api';
|
|
2
|
+
import { Message, MessageService } from 'primeng/api';
|
|
3
3
|
import { ActionDescriptor } from '../descriptors/action';
|
|
4
4
|
import { TableDescriptorInst } from '../descriptors/table';
|
|
5
|
-
import { IMngError
|
|
5
|
+
import { IMngError } from '../models';
|
|
6
6
|
export declare class NotificationUtil {
|
|
7
|
-
static notification(
|
|
8
|
-
static tableNotificationError(translate: TranslateService, table: TableDescriptorInst<any>, error: any,
|
|
9
|
-
static actionNotificationSuccess(translate: TranslateService, action: ActionDescriptor, functionName: string, customTitleKey?: string, customMessageKey?: string,
|
|
10
|
-
static actionNotificationError(translate: TranslateService, action: ActionDescriptor, error: IMngError, functionName: string,
|
|
7
|
+
static notification(messageService: MessageService, title?: string, message?: string, severity?: 'success' | 'warn' | 'error', icon?: string): Message;
|
|
8
|
+
static tableNotificationError(translate: TranslateService, table: TableDescriptorInst<any>, error: any, messageService: MessageService): Message;
|
|
9
|
+
static actionNotificationSuccess(translate: TranslateService, action: ActionDescriptor, functionName: string, messageService: MessageService, customTitleKey?: string, customMessageKey?: string, item?: any): Message;
|
|
10
|
+
static actionNotificationError(translate: TranslateService, action: ActionDescriptor, error: IMngError, functionName: string, messageService: MessageService, item?: any, severity?: 'warn' | 'error'): Message;
|
|
11
11
|
static getFormEditorInfoMessage(translate: TranslateService, title: string, message: string, params?: any): Message;
|
|
12
12
|
static getFormEditorWarningMessage(translate: TranslateService, title: string, message: string): Message;
|
|
13
13
|
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
## {{npmName}}@{{npmVersion}}
|
|
2
|
+
|
|
3
|
+
### Building
|
|
4
|
+
|
|
5
|
+
To install the required dependencies and to build the typescript sources run:
|
|
6
|
+
```
|
|
7
|
+
npm install
|
|
8
|
+
npm run build
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### publishing
|
|
12
|
+
|
|
13
|
+
First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)
|
|
14
|
+
|
|
15
|
+
### consuming
|
|
16
|
+
|
|
17
|
+
Navigate to the folder of your consuming project and run one of next commands.
|
|
18
|
+
|
|
19
|
+
_published:_
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install {{npmName}}@{{npmVersion}} --save
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
_without publishing (not recommended):_
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
_It's important to take the tgz file, otherwise you'll get trouble with links on windows_
|
|
32
|
+
|
|
33
|
+
_using `npm link`:_
|
|
34
|
+
|
|
35
|
+
In PATH_TO_GENERATED_PACKAGE/dist:
|
|
36
|
+
```
|
|
37
|
+
npm link
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
In your project:
|
|
41
|
+
```
|
|
42
|
+
npm link {{npmName}}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
|
|
46
|
+
Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
|
|
47
|
+
Published packages are not effected by this issue.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
#### General usage
|
|
51
|
+
|
|
52
|
+
In your Angular project:
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
// without configuring providers
|
|
57
|
+
import { {{apiModuleClassName}} } from '{{npmName}}';
|
|
58
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
59
|
+
|
|
60
|
+
@NgModule({
|
|
61
|
+
imports: [
|
|
62
|
+
{{apiModuleClassName}},
|
|
63
|
+
// make sure to import the HttpClientModule in the AppModule only,
|
|
64
|
+
// see https://github.com/angular/angular/issues/20575
|
|
65
|
+
HttpClientModule
|
|
66
|
+
],
|
|
67
|
+
declarations: [ AppComponent ],
|
|
68
|
+
providers: [],
|
|
69
|
+
bootstrap: [ AppComponent ]
|
|
70
|
+
})
|
|
71
|
+
export class AppModule {}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
// configuring providers
|
|
76
|
+
import { {{apiModuleClassName}}, {{configurationClassName}}, {{configurationParametersInterfaceName}} } from '{{npmName}}';
|
|
77
|
+
|
|
78
|
+
export function apiConfigFactory (): {{configurationClassName}} {
|
|
79
|
+
const params: {{configurationParametersInterfaceName}} = {
|
|
80
|
+
// set configuration parameters here.
|
|
81
|
+
}
|
|
82
|
+
return new {{configurationClassName}}(params);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@NgModule({
|
|
86
|
+
imports: [ {{apiModuleClassName}}.forRoot(apiConfigFactory) ],
|
|
87
|
+
declarations: [ AppComponent ],
|
|
88
|
+
providers: [],
|
|
89
|
+
bootstrap: [ AppComponent ]
|
|
90
|
+
})
|
|
91
|
+
export class AppModule {}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
// configuring providers with an authentication service that manages your access tokens
|
|
96
|
+
import { {{apiModuleClassName}}, {{configurationClassName}} } from '{{npmName}}';
|
|
97
|
+
|
|
98
|
+
@NgModule({
|
|
99
|
+
imports: [ {{apiModuleClassName}} ],
|
|
100
|
+
declarations: [ AppComponent ],
|
|
101
|
+
providers: [
|
|
102
|
+
{
|
|
103
|
+
provide: {{configurationClassName}},
|
|
104
|
+
useFactory: (authService: AuthService) => new {{configurationClassName}}(
|
|
105
|
+
{
|
|
106
|
+
basePath: environment.apiUrl,
|
|
107
|
+
accessToken: authService.getAccessToken.bind(authService)
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
deps: [AuthService],
|
|
111
|
+
multi: false
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
bootstrap: [ AppComponent ]
|
|
115
|
+
})
|
|
116
|
+
export class AppModule {}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
import { DefaultApi } from '{{npmName}}';
|
|
121
|
+
|
|
122
|
+
export class AppComponent {
|
|
123
|
+
constructor(private apiGateway: DefaultApi) { }
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Note: The {{apiModuleClassName}} is restricted to being instantiated once app wide.
|
|
128
|
+
This is to ensure that all services are treated as singletons.
|
|
129
|
+
|
|
130
|
+
#### Using multiple OpenAPI files / APIs / {{apiModuleClassName}}s
|
|
131
|
+
In order to use multiple `{{apiModuleClassName}}s` generated from different OpenAPI files,
|
|
132
|
+
you can create an alias name when importing the modules
|
|
133
|
+
in order to avoid naming conflicts:
|
|
134
|
+
```
|
|
135
|
+
import { {{apiModuleClassName}} } from 'my-api-path';
|
|
136
|
+
import { {{apiModuleClassName}} as OtherApiModule } from 'my-other-api-path';
|
|
137
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
138
|
+
|
|
139
|
+
@NgModule({
|
|
140
|
+
imports: [
|
|
141
|
+
{{apiModuleClassName}},
|
|
142
|
+
OtherApiModule,
|
|
143
|
+
// make sure to import the HttpClientModule in the AppModule only,
|
|
144
|
+
// see https://github.com/angular/angular/issues/20575
|
|
145
|
+
HttpClientModule
|
|
146
|
+
]
|
|
147
|
+
})
|
|
148
|
+
export class AppModule {
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Set service base path
|
|
155
|
+
If different than the generated base path, during app bootstrap, you can provide the base path to your service.
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
import { BASE_PATH } from '{{npmName}}';
|
|
159
|
+
|
|
160
|
+
bootstrap(AppComponent, [
|
|
161
|
+
{ provide: BASE_PATH, useValue: 'https://your-web-service.com' },
|
|
162
|
+
]);
|
|
163
|
+
```
|
|
164
|
+
or
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
import { BASE_PATH } from '{{npmName}}';
|
|
168
|
+
|
|
169
|
+
@NgModule({
|
|
170
|
+
imports: [],
|
|
171
|
+
declarations: [ AppComponent ],
|
|
172
|
+
providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],
|
|
173
|
+
bootstrap: [ AppComponent ]
|
|
174
|
+
})
|
|
175
|
+
export class AppModule {}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
#### Using @angular/cli
|
|
180
|
+
First extend your `src/environments/*.ts` files by adding the corresponding base path:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
export const environment = {
|
|
184
|
+
production: false,
|
|
185
|
+
API_BASE_PATH: 'http://127.0.0.1:8080'
|
|
186
|
+
};
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
In the src/app/app.module.ts:
|
|
190
|
+
```
|
|
191
|
+
import { BASE_PATH } from '{{npmName}}';
|
|
192
|
+
import { environment } from '../environments/environment';
|
|
193
|
+
|
|
194
|
+
@NgModule({
|
|
195
|
+
declarations: [
|
|
196
|
+
AppComponent
|
|
197
|
+
],
|
|
198
|
+
imports: [ ],
|
|
199
|
+
providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
|
|
200
|
+
bootstrap: [ AppComponent ]
|
|
201
|
+
})
|
|
202
|
+
export class AppModule { }
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Customizing path parameter encoding
|
|
206
|
+
|
|
207
|
+
Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
|
|
208
|
+
and Dates for format 'date-time' are encoded correctly.
|
|
209
|
+
|
|
210
|
+
Other styles (e.g. "matrix") are not that easy to encode
|
|
211
|
+
and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
|
|
212
|
+
|
|
213
|
+
To implement your own parameter encoding (or call another library),
|
|
214
|
+
pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
|
|
215
|
+
(see [General Usage](#general-usage) above).
|
|
216
|
+
|
|
217
|
+
Example value for use in your Configuration-Provider:
|
|
218
|
+
```typescript
|
|
219
|
+
new Configuration({
|
|
220
|
+
encodeParam: (param: Param) => myFancyParamEncoder(param),
|
|
221
|
+
})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
|
|
225
|
+
[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
|
|
226
|
+
[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
|
|
2
|
+
import { {{configurationClassName}} } from './configuration';
|
|
3
|
+
import { HttpClient } from '@angular/common/http';
|
|
4
|
+
|
|
5
|
+
{{#isProvidedInNone}}
|
|
6
|
+
{{#apiInfo}}
|
|
7
|
+
{{#apis}}
|
|
8
|
+
import { {{classname}} } from './{{importPath}}';
|
|
9
|
+
{{/apis}}
|
|
10
|
+
{{/apiInfo}}
|
|
11
|
+
{{/isProvidedInNone}}
|
|
12
|
+
|
|
13
|
+
@NgModule({
|
|
14
|
+
imports: [],
|
|
15
|
+
declarations: [],
|
|
16
|
+
exports: [],
|
|
17
|
+
providers: [{{#isProvidedInNone}}
|
|
18
|
+
{{#apiInfo}}{{#apis}}{{classname}}{{^-last}},
|
|
19
|
+
{{/-last}}{{/apis}}{{/apiInfo}} {{/isProvidedInNone}}]
|
|
20
|
+
})
|
|
21
|
+
export class {{apiModuleClassName}} {
|
|
22
|
+
public static forRoot(configurationFactory: () => {{configurationClassName}}): ModuleWithProviders{{#enforceGenericModuleWithProviders}}<{{apiModuleClassName}}>{{/enforceGenericModuleWithProviders}} {
|
|
23
|
+
return {
|
|
24
|
+
ngModule: {{apiModuleClassName}},
|
|
25
|
+
providers: [ { provide: {{configurationClassName}}, useFactory: configurationFactory } ]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
constructor( @Optional() @SkipSelf() parentModule: {{apiModuleClassName}},
|
|
30
|
+
@Optional() http: HttpClient) {
|
|
31
|
+
if (parentModule) {
|
|
32
|
+
throw new Error('{{apiModuleClassName}} is already loaded. Import in your base AppModule only.');
|
|
33
|
+
}
|
|
34
|
+
if (!http) {
|
|
35
|
+
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
|
|
36
|
+
'See also https://github.com/angular/angular/issues/20575');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|