@mediusinc/mng-commons 3.0.0-rc.0 → 3.0.0-rc.10

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.
Files changed (139) hide show
  1. package/README.md +11 -10
  2. package/assets/i18n/en.json +5 -1
  3. package/assets/i18n/sl.json +5 -1
  4. package/dev-scripts/version-info.js +13 -6
  5. package/esm2022/index.mjs +3 -1
  6. package/esm2022/lib/api/utils/object-serializer.util.mjs +11 -4
  7. package/esm2022/lib/components/action/action.component.mjs +18 -6
  8. package/esm2022/lib/components/action/editor/action-editor.component.mjs +83 -18
  9. package/esm2022/lib/components/action/models/action-execution.model.mjs +14 -37
  10. package/esm2022/lib/components/action/route/action-route.component.mjs +9 -2
  11. package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +18 -5
  12. package/esm2022/lib/components/form/dropdown/dropdown.component.mjs +21 -8
  13. package/esm2022/lib/components/form/editor/form-editor.component.mjs +9 -8
  14. package/esm2022/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.mjs +22 -4
  15. package/esm2022/lib/components/form/formly/fields/formly-field-custom/formly-field-custom.component.mjs +20 -35
  16. package/esm2022/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +43 -15
  17. package/esm2022/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +11 -4
  18. package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +8 -6
  19. package/esm2022/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +16 -7
  20. package/esm2022/lib/components/form/models/field-action-context.model.mjs +1 -1
  21. package/esm2022/lib/components/form/models/index.mjs +2 -1
  22. package/esm2022/lib/components/layout/menu-item.component.mjs +1 -2
  23. package/esm2022/lib/components/tableview/table/table.component.mjs +57 -55
  24. package/esm2022/lib/descriptors/action/action-button.descriptor.mjs +10 -2
  25. package/esm2022/lib/descriptors/action/action.descriptor.mjs +19 -8
  26. package/esm2022/lib/descriptors/editor/editor.descriptor.mjs +3 -3
  27. package/esm2022/lib/descriptors/editor/field.descriptor.mjs +18 -4
  28. package/esm2022/lib/descriptors/filter/filter.descriptor.mjs +7 -6
  29. package/esm2022/lib/descriptors/table/column.descriptor.mjs +3 -3
  30. package/esm2022/lib/descriptors/table/table.descriptor.mjs +35 -4
  31. package/esm2022/lib/descriptors/tableview/tableview.descriptor.mjs +3 -3
  32. package/esm2022/lib/error/error.handler.mjs +20 -0
  33. package/esm2022/lib/error/index.mjs +2 -0
  34. package/esm2022/lib/guards/index.mjs +2 -0
  35. package/esm2022/lib/guards/unsaved-changes.guard.mjs +4 -0
  36. package/esm2022/lib/models/action-editor.model.mjs +2 -0
  37. package/esm2022/lib/models/can-component-deactivate.model.mjs +2 -0
  38. package/esm2022/lib/models/config.model.mjs +1 -1
  39. package/esm2022/lib/models/error.model.mjs +44 -2
  40. package/esm2022/lib/models/index.mjs +4 -2
  41. package/esm2022/lib/models/log.model.mjs +10 -0
  42. package/esm2022/lib/models/version.model.mjs +1 -1
  43. package/esm2022/lib/pipes/json-path.pipe.mjs +8 -4
  44. package/esm2022/lib/provide-commons.mjs +22 -16
  45. package/esm2022/lib/router/route-builder.mjs +4 -4
  46. package/esm2022/lib/router/routes-builder.mjs +3 -3
  47. package/esm2022/lib/router/tableview-route-builder.mjs +4 -1
  48. package/esm2022/lib/security/authorization.service.mjs +5 -4
  49. package/esm2022/lib/security/authorization.util.mjs +3 -3
  50. package/esm2022/lib/services/action-error-mapper.service.mjs +20 -0
  51. package/esm2022/lib/services/action-executor.service.mjs +97 -57
  52. package/esm2022/lib/services/commons.service.mjs +16 -25
  53. package/esm2022/lib/services/configuration.service.mjs +56 -32
  54. package/esm2022/lib/services/index.mjs +4 -2
  55. package/esm2022/lib/services/internal/commons-init.service.mjs +49 -23
  56. package/esm2022/lib/services/log-publisher-console.service.mjs +40 -0
  57. package/esm2022/lib/services/logger.service.mjs +130 -0
  58. package/esm2022/lib/services/providers/index.mjs +1 -2
  59. package/esm2022/lib/services/router.service.mjs +106 -25
  60. package/esm2022/lib/services/tokens/index.mjs +2 -1
  61. package/esm2022/lib/services/tokens/log-publisher.token.mjs +3 -0
  62. package/esm2022/lib/services/version.service.mjs +7 -2
  63. package/esm2022/lib/utils/action-data-provider.util.mjs +7 -7
  64. package/esm2022/lib/utils/editor-formly.util.mjs +2 -1
  65. package/esm2022/lib/utils/error.util.mjs +247 -0
  66. package/esm2022/lib/utils/i18n.util.mjs +7 -9
  67. package/esm2022/lib/utils/index.mjs +2 -1
  68. package/esm2022/lib/utils/notification.util.mjs +3 -2
  69. package/esm2022/lib/utils/object.util.mjs +32 -5
  70. package/esm2022/lib/utils/route.util.mjs +3 -3
  71. package/esm2022/lib/utils/string.util.mjs +33 -2
  72. package/esm2022/lib/utils/tableview.util.mjs +3 -3
  73. package/esm2022/lib/utils/type.util.mjs +5 -5
  74. package/fesm2022/mediusinc-mng-commons.mjs +4374 -3516
  75. package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
  76. package/index.d.ts +1 -0
  77. package/lib/api/utils/object-serializer.util.d.ts +1 -0
  78. package/lib/components/action/action.component.d.ts +1 -0
  79. package/lib/components/action/editor/action-editor.component.d.ts +17 -6
  80. package/lib/components/action/models/action-execution.model.d.ts +6 -4
  81. package/lib/components/action/route/action-route.component.d.ts +4 -1
  82. package/lib/components/form/autocomplete/autocomplete.component.d.ts +1 -0
  83. package/lib/components/form/dropdown/dropdown.component.d.ts +1 -0
  84. package/lib/components/form/editor/form-editor.component.d.ts +1 -0
  85. package/lib/components/form/formly/fields/formly-field-action/formly-field-action.component.d.ts +3 -0
  86. package/lib/components/form/formly/fields/formly-field-custom/formly-field-custom.component.d.ts +1 -0
  87. package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +2 -0
  88. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -0
  89. package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
  90. package/lib/components/form/models/field-action-context.model.d.ts +7 -0
  91. package/lib/components/form/models/index.d.ts +1 -0
  92. package/lib/components/tableview/table/table.component.d.ts +2 -0
  93. package/lib/descriptors/action/action-button.descriptor.d.ts +4 -1
  94. package/lib/descriptors/action/action.descriptor.d.ts +3 -0
  95. package/lib/descriptors/editor/field.descriptor.d.ts +12 -8
  96. package/lib/descriptors/table/column.descriptor.d.ts +1 -1
  97. package/lib/descriptors/table/table.descriptor.d.ts +27 -5
  98. package/lib/error/error.handler.d.ts +6 -0
  99. package/lib/error/index.d.ts +1 -0
  100. package/lib/guards/index.d.ts +1 -0
  101. package/lib/guards/unsaved-changes.guard.d.ts +3 -0
  102. package/lib/models/action-editor.model.d.ts +4 -0
  103. package/lib/models/can-component-deactivate.model.d.ts +4 -0
  104. package/lib/models/config.model.d.ts +2 -1
  105. package/lib/models/error.model.d.ts +44 -8
  106. package/lib/models/index.d.ts +3 -1
  107. package/lib/models/log.model.d.ts +40 -0
  108. package/lib/models/version.model.d.ts +1 -1
  109. package/lib/pipes/json-path.pipe.d.ts +1 -0
  110. package/lib/security/authorization.service.d.ts +1 -0
  111. package/lib/services/action-error-mapper.service.d.ts +18 -0
  112. package/lib/services/action-executor.service.d.ts +12 -6
  113. package/lib/services/commons.service.d.ts +9 -14
  114. package/lib/services/configuration.service.d.ts +13 -5
  115. package/lib/services/index.d.ts +3 -1
  116. package/lib/services/internal/commons-init.service.d.ts +8 -8
  117. package/lib/services/log-publisher-console.service.d.ts +4 -0
  118. package/lib/services/logger.service.d.ts +33 -0
  119. package/lib/services/providers/index.d.ts +0 -1
  120. package/lib/services/router.service.d.ts +17 -2
  121. package/lib/services/tokens/index.d.ts +1 -0
  122. package/lib/services/tokens/log-publisher.token.d.ts +3 -0
  123. package/lib/services/version.service.d.ts +1 -0
  124. package/lib/utils/error.util.d.ts +116 -0
  125. package/lib/utils/i18n.util.d.ts +3 -3
  126. package/lib/utils/index.d.ts +1 -0
  127. package/lib/utils/notification.util.d.ts +2 -2
  128. package/lib/utils/object.util.d.ts +6 -4
  129. package/lib/utils/string.util.d.ts +5 -0
  130. package/package.json +6 -3
  131. package/scss/common/theme/designer/_components.scss +1 -1
  132. package/scss/mng-overrides/_theme_dialog.scss +7 -0
  133. package/scss/mng-overrides/_theme_tableview.scss +15 -0
  134. package/esm2022/lib/models/error-internal.model.mjs +0 -27
  135. package/esm2022/lib/services/error-mapper.service.mjs +0 -14
  136. package/esm2022/lib/services/providers/config-service.provider.mjs +0 -31
  137. package/lib/models/error-internal.model.d.ts +0 -29
  138. package/lib/services/error-mapper.service.d.ts +0 -7
  139. package/lib/services/providers/config-service.provider.d.ts +0 -6
package/index.d.ts CHANGED
@@ -39,3 +39,4 @@ export * from './lib/security/model';
39
39
  export * from './lib/types';
40
40
  export * from './lib/styles';
41
41
  export * from './lib/styles/models';
42
+ export * from './lib/error';
@@ -2,6 +2,7 @@ import { ClassType } from '../../types';
2
2
  import { AttributeDef, SerializableTypeMap } from '../models';
3
3
  export declare class ObjectSerializer {
4
4
  private static _instance;
5
+ private readonly _logCategory;
5
6
  private readonly _primitives;
6
7
  private readonly _typeMap;
7
8
  private readonly _enumMap;
@@ -64,6 +64,7 @@ export declare class MngActionComponent<T, S> implements OnInit, OnChanges, OnDe
64
64
  subactions: MenuItem[];
65
65
  private subactionSubscriptions;
66
66
  actionOrSubactionHasRunConfirmation: boolean;
67
+ private instance?;
67
68
  constructor(routeService: ActivatedRoute, translate: TranslateService, authorization: MngAuthorizationService, actionExecutor: MngActionExecutorService, confirmationService: ConfirmationService, viewContainerService: MngViewContainerComponentService<T, S> | null);
68
69
  ngOnInit(): void;
69
70
  ngOnChanges(changes: SimpleChanges): void;
@@ -1,27 +1,34 @@
1
1
  import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges } from '@angular/core';
2
2
  import { ActivatedRoute } from '@angular/router';
3
3
  import { TranslateService } from '@ngx-translate/core';
4
- import { DynamicDialogConfig } from 'primeng/dynamicdialog';
4
+ import { ConfirmationService } from 'primeng/api';
5
+ import { DialogService, DynamicDialogConfig } from 'primeng/dynamicdialog';
5
6
  import { Observable } from 'rxjs';
6
7
  import { IEditorDataProvider } from '../../../data-providers';
7
8
  import { ActionDescriptor, ActionEditorDescriptor } from '../../../descriptors/action';
8
- import { ActionEditorSubmitTypeEnum } from '../../../descriptors/types';
9
+ import { ActionActivationTriggerEnum, ActionEditorSubmitTypeEnum } from '../../../descriptors/types';
9
10
  import { MngTemplateDirective } from '../../../directives';
10
- import { IViewContainer } from '../../../models';
11
+ import { IActionEditorComponent, IViewContainer } from '../../../models';
11
12
  import { MngActionExecutorService, MngCommonsService, MngViewContainerComponentService } from '../../../services';
12
13
  import { IdType } from '../../../types';
13
14
  import { MngFormEditorComponent } from '../../form';
14
15
  import { MngFormEditorSubmitEvent } from '../../form/models';
15
16
  import { ActionData } from '../models';
16
17
  import * as i0 from "@angular/core";
17
- export declare class MngActionEditorComponent<T, S> implements OnInit, OnChanges, OnDestroy {
18
+ export declare class MngActionEditorComponent<T, S> implements OnInit, OnChanges, OnDestroy, IActionEditorComponent {
18
19
  private translate;
19
20
  private actionExecutor;
20
21
  private mngCommonsService;
22
+ private confirmationService;
23
+ private dialogService;
21
24
  private dialogConfig;
22
25
  private viewContainerService;
26
+ protected readonly ActionActivationTriggerEnum: typeof ActionActivationTriggerEnum;
27
+ readonly cmpId: string;
28
+ readonly confirmDialogKey: string;
23
29
  readonly actionEditorSubmitTypeSubmit = ActionEditorSubmitTypeEnum.Submit;
24
30
  readonly actionDefaultLoadingInput: Observable<boolean>;
31
+ private readonly logger;
25
32
  action: ActionEditorDescriptor<T>;
26
33
  itemIdInit?: IdType;
27
34
  itemInit?: T;
@@ -59,7 +66,7 @@ export declare class MngActionEditorComponent<T, S> implements OnInit, OnChanges
59
66
  dialogRoute?: ActivatedRoute;
60
67
  private sourceComponent;
61
68
  private subscriptions;
62
- constructor(translate: TranslateService, actionExecutor: MngActionExecutorService, mngCommonsService: MngCommonsService, dialogConfig: DynamicDialogConfig | null, viewContainerService: MngViewContainerComponentService<T, S> | null);
69
+ constructor(translate: TranslateService, actionExecutor: MngActionExecutorService, mngCommonsService: MngCommonsService, confirmationService: ConfirmationService, dialogService: DialogService, dialogConfig: DynamicDialogConfig | null, viewContainerService: MngViewContainerComponentService<T, S> | null);
63
70
  ngOnInit(): void;
64
71
  ngOnChanges(changes: SimpleChanges): void;
65
72
  ngOnDestroy(): void;
@@ -75,7 +82,11 @@ export declare class MngActionEditorComponent<T, S> implements OnInit, OnChanges
75
82
  private initializeViewContainer;
76
83
  private setEditorEnabled;
77
84
  private processActionInstance;
85
+ private beforeWindowUnload;
86
+ private onEscapePressed;
87
+ private showUnsavedChangesConfirmationDialog;
88
+ closeWithUnsavedChangesConfirmation(callFromGuard?: boolean): Observable<boolean>;
78
89
  private unsetInstance;
79
- static ɵfac: i0.ɵɵFactoryDeclaration<MngActionEditorComponent<any, any>, [null, null, null, { optional: true; }, { optional: true; }]>;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<MngActionEditorComponent<any, any>, [null, null, null, null, null, { optional: true; }, { optional: true; }]>;
80
91
  static ɵcmp: i0.ɵɵComponentDeclaration<MngActionEditorComponent<any, any>, "mng-action-editor", never, { "action": { "alias": "action"; "required": true; }; "itemIdInit": { "alias": "itemId"; "required": false; }; "itemInit": { "alias": "item"; "required": false; }; "actionData": { "alias": "actionData"; "required": false; }; "dataProvider": { "alias": "dataProvider"; "required": false; }; "viewContainerInit": { "alias": "viewContainer"; "required": false; }; }, { "actionRunEventEmitter": "actionSubmit"; "actionCancelEventEmitter": "actionCancel"; }, ["templates"], never, true, never>;
81
92
  }
@@ -5,7 +5,7 @@ import { BehaviorSubject, Observable, ReplaySubject, Subscription } from 'rxjs';
5
5
  import { MediusQueryParam } from '../../../api/models';
6
6
  import { IDataProvider } from '../../../data-providers';
7
7
  import { ActionDescriptor } from '../../../descriptors/action';
8
- import { IViewContainer, MngError } from '../../../models';
8
+ import { IActionEditorComponent, IMngError, IViewContainer } from '../../../models';
9
9
  import { IdType } from '../../../types';
10
10
  export declare class ActionError {
11
11
  readonly error: any;
@@ -17,11 +17,11 @@ export declare class ActionError {
17
17
  * Action execution instance containing data about execution state of action
18
18
  */
19
19
  export declare class ActionInstance<T, S> {
20
- debug: boolean;
21
20
  readonly instanceId: string;
22
21
  readonly instanceLongName: string;
23
22
  readonly action: ActionDescriptor<T>;
24
23
  readonly createdDate: Date;
24
+ private readonly logger;
25
25
  readonly isRunLoadingSubject: BehaviorSubject<boolean>;
26
26
  triggerParameters?: ActionParameters<T>;
27
27
  activationParameters?: ActionParameters<T>;
@@ -35,11 +35,12 @@ export declare class ActionInstance<T, S> {
35
35
  private _result?;
36
36
  private _error?;
37
37
  activationDialogRef?: DynamicDialogRef;
38
+ activationEditorComponentRef?: IActionEditorComponent;
38
39
  private _reactivationInstanceSubject;
39
40
  previousInstance?: ActionInstance<T, S>;
40
41
  nextActionInstance?: ActionInstance<unknown, unknown>;
41
42
  errorActionInstance?: ActionInstance<T, S>;
42
- constructor(action: ActionDescriptor<T>, state?: ActionInstanceStateEnum, debug?: boolean);
43
+ constructor(action: ActionDescriptor<T>, state?: ActionInstanceStateEnum);
43
44
  get isRunLoading$(): Observable<boolean>;
44
45
  get context(): ActionContext<T, S> | undefined;
45
46
  get execution$(): Observable<T | null | undefined>;
@@ -73,6 +74,7 @@ export declare class ActionContext<T, S> {
73
74
  readonly serviceInstance?: S | undefined;
74
75
  private readonly executionSubject;
75
76
  private readonly executionIsRunningSubject;
77
+ private readonly logger;
76
78
  readonly contextLongName: string;
77
79
  previousActionInstance?: ActionInstance<unknown, unknown>;
78
80
  confirmation?: Confirmation;
@@ -84,7 +86,7 @@ export declare class ActionContext<T, S> {
84
86
  executionStart(): void;
85
87
  executionNext(next: T | null | undefined, finish?: boolean): void;
86
88
  executionComplete(): void;
87
- executionError(err: MngError): void;
89
+ executionError(err: IMngError): void;
88
90
  finish(): void;
89
91
  isClosed(): boolean;
90
92
  }
@@ -1,11 +1,13 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { ConfirmationService } from 'primeng/api';
4
+ import { Observable } from 'rxjs';
4
5
  import { ActionDescriptor } from '../../../descriptors/action';
6
+ import { CanComponentDeactivate } from '../../../models';
5
7
  import { MngActionExecutorService, MngNavigationService, MngViewContainerComponentService } from '../../../services';
6
8
  import { IActionConfirmationService } from '../models';
7
9
  import * as i0 from "@angular/core";
8
- export declare class MngActionRouteComponent<T, S> implements OnInit, OnDestroy, IActionConfirmationService {
10
+ export declare class MngActionRouteComponent<T, S> implements OnInit, OnDestroy, CanComponentDeactivate, IActionConfirmationService {
9
11
  private router;
10
12
  private route;
11
13
  private confirmationService;
@@ -28,6 +30,7 @@ export declare class MngActionRouteComponent<T, S> implements OnInit, OnDestroy,
28
30
  private untriggerAction;
29
31
  private findActionForRoute;
30
32
  private processActionInstance;
33
+ canDeactivate(): Observable<boolean>;
31
34
  private unsetInstance;
32
35
  static ɵfac: i0.ɵɵFactoryDeclaration<MngActionRouteComponent<any, any>, [null, null, null, null, null, { optional: true; }]>;
33
36
  static ɵcmp: i0.ɵɵComponentDeclaration<MngActionRouteComponent<any, any>, "mng-action-route", never, {}, {}, never, never, true, never>;
@@ -11,6 +11,7 @@ export declare class MngAutocompleteComponent implements OnInit, OnDestroy, Cont
11
11
  private injector;
12
12
  private translate;
13
13
  private formlyWrapper;
14
+ private readonly logger;
14
15
  dataProvider?: ILookupDataProvider<any, any>;
15
16
  dataKeyProperty?: string;
16
17
  itemsValuePropertyInit?: string;
@@ -11,6 +11,7 @@ export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlV
11
11
  private injector;
12
12
  private translate;
13
13
  private formlyWrapper;
14
+ private readonly logger;
14
15
  dataProvider?: ILookupDataProvider<any, any>;
15
16
  dataKeyProperty?: string;
16
17
  itemsLabelPropertyInit?: string;
@@ -13,6 +13,7 @@ import * as i0 from "@angular/core";
13
13
  export declare class MngFormEditorComponent<T> implements IFormEditorComponent<T>, OnInit, OnChanges, OnDestroy {
14
14
  private mngCommonsService;
15
15
  private translateService;
16
+ private readonly logger;
16
17
  descriptor?: EditorDescriptor<T>;
17
18
  submitLoading: Observable<boolean> | boolean;
18
19
  item?: T;
@@ -1,13 +1,16 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { FieldType } from '@ngx-formly/core';
3
3
  import { FieldActionDescriptor } from '../../../../../descriptors/editor';
4
+ import { FieldActionResultMessage } from '../../../models';
4
5
  import { MngFormlyFieldConfig } from '../../models';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class MngFormlyFieldActionComponent<ET> extends FieldType<MngFormlyFieldConfig> implements OnInit {
7
8
  descriptor: FieldActionDescriptor<ET>;
8
9
  buttonClass: string;
10
+ actionMessage?: FieldActionResultMessage;
9
11
  ngOnInit(): void;
10
12
  onClick(): void;
13
+ private processResult;
11
14
  static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldActionComponent<any>, never>;
12
15
  static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldActionComponent<any>, "mng-formly-field-action", never, {}, {}, never, never, true, never>;
13
16
  }
@@ -5,6 +5,7 @@ import { MngFormlyFieldConfig } from '../../models';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class MngFormlyFieldCustomComponent<ET> extends FieldType<MngFormlyFieldConfig> implements OnInit {
7
7
  descriptor: FieldInputDescriptor<ET>;
8
+ inputs: Record<string, any>;
8
9
  ngOnInit(): void;
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldCustomComponent<any>, never>;
10
11
  static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldCustomComponent<any>, "mng-formly-field-custom", never, {}, {}, never, never, true, never>;
@@ -28,6 +28,8 @@ export declare class MngFormlyFieldInputComponent<ET> extends FieldType<MngForml
28
28
  removeImageUrlAt(idx: number): void;
29
29
  onImageUrlLoadError(): void;
30
30
  private updateFileFormControl;
31
+ isFileImageSvg(file: File): boolean;
32
+ getFileDocumentTypeIcon(file: File): "pi-video" | "pi-volume-up" | "pi-file-pdf" | "pi-file-word" | "pi-file-excel" | "pi-file";
31
33
  static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldInputComponent<any>, never>;
32
34
  static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldInputComponent<any>, "mng-formly-field-input", never, {}, {}, never, never, true, never>;
33
35
  }
@@ -13,6 +13,7 @@ import * as i0 from "@angular/core";
13
13
  export declare class MngFormlyFieldLookupDialogComponent<T, ET> extends FieldType<MngFormlyFieldConfig> implements OnInit, AfterViewInit, OnDestroy {
14
14
  private injector;
15
15
  mngTable?: MngTableComponent<any, any>;
16
+ private readonly logger;
16
17
  descriptor: FieldLookupDescriptor<T, ET>;
17
18
  config: FieldLookupConfig;
18
19
  fieldLabelFormControl: FormControl;
@@ -9,6 +9,7 @@ import { MngFormlyFieldConfig } from '../../models';
9
9
  import * as i0 from "@angular/core";
10
10
  export declare class MngFormlyFieldTableDialogMultiselectComponent<T, ET> extends FieldType<MngFormlyFieldConfig> implements OnInit, AfterViewInit, OnDestroy {
11
11
  private injector;
12
+ private readonly logger;
12
13
  descriptor: FieldManyToManyEditorDescriptor<T, ET>;
13
14
  itemsSubject: Subject<Array<T>>;
14
15
  itemsAsync: Observable<Array<T>>;
@@ -15,3 +15,10 @@ export interface FieldActionContext<ET> {
15
15
  formState: any;
16
16
  };
17
17
  }
18
+ export interface FieldActionResult {
19
+ message?: FieldActionResultMessage;
20
+ }
21
+ export interface FieldActionResultMessage {
22
+ content: string;
23
+ severity?: 'success' | 'warn' | 'error';
24
+ }
@@ -1,2 +1,3 @@
1
+ export * from './field-action-context.model';
1
2
  export * from './form-editor.event';
2
3
  export * from './form-editor.interface';
@@ -27,6 +27,7 @@ export declare class MngTableComponent<T, S> implements OnInit, OnChanges, After
27
27
  private localStorageService;
28
28
  readonly filterDisplayRow: TableFilterDisplayEnum;
29
29
  readonly cmpTypeName = "MngTableComponent";
30
+ private readonly logger;
30
31
  initialDescriptor: TableDescriptor<T>;
31
32
  descriptor?: TableDescriptor<T>;
32
33
  items?: Observable<Array<T>> | Array<T>;
@@ -122,6 +123,7 @@ export declare class MngTableComponent<T, S> implements OnInit, OnChanges, After
122
123
  onTableColumnResize({ element }: any): void;
123
124
  private loadTableWithDataProvider;
124
125
  private loadTableFromRouteUpdate;
126
+ private setMainAndRelatedDescriptors;
125
127
  private updatePrimeSortAndFilter;
126
128
  private createFilterMeta;
127
129
  private createSortMeta;
@@ -6,17 +6,20 @@ export declare class ActionButtonDescriptor {
6
6
  private _styleClass;
7
7
  private _badge?;
8
8
  private _tooltip?;
9
+ private _tooltipPosition?;
9
10
  withLabel(label?: string | null): this;
10
11
  withIcon(icon: string | null): this;
11
12
  withIconPosition(iconPosition: 'left' | 'right'): this;
12
13
  withStyleClass(style: ButtonStyleBuilder): this;
13
14
  withBadge(badge: string): this;
14
- withTooltip(tooltip: string): this;
15
+ withTooltip(tooltip: string, position?: 'top' | 'bottom' | 'left' | 'right'): this;
16
+ withTooltipPosition(position: 'top' | 'bottom' | 'left' | 'right'): this;
15
17
  get label(): string | null | undefined;
16
18
  get icon(): string | null | undefined;
17
19
  get iconPosition(): "left" | "right";
18
20
  get styleClass(): ButtonStyleBuilder;
19
21
  get badge(): string | undefined;
20
22
  get tooltip(): string | undefined;
23
+ get tooltipPosition(): "top" | "bottom" | "left" | "right" | undefined;
21
24
  copy(): ActionButtonDescriptor;
22
25
  }
@@ -133,6 +133,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
133
133
  protected _editorComponent?: Type<any>;
134
134
  protected _resubmitEnabled?: boolean;
135
135
  protected _resubmitRefetch: boolean;
136
+ protected _unsavedChangesConfirmation: boolean;
136
137
  constructor(editorDescriptor: EditorDescriptor<T>, actionName: string, parentType?: ClassType<unknown>, parentProperty?: string);
137
138
  get editorTitle(): string | null | undefined;
138
139
  get editorTitleParams(): any;
@@ -150,6 +151,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
150
151
  get editorComponent(): Type<any> | undefined;
151
152
  get resubmitEnabled(): boolean | undefined;
152
153
  get resubmitRefetch(): boolean;
154
+ get unsavedChangesConfirmation(): boolean;
153
155
  withEditorTitle(title: string | null, params?: any): this;
154
156
  withDataProvider(dataProvider: IEditorDataProvider<T, any>): this;
155
157
  withServiceType<S>(serviceType: Type<S>): this;
@@ -163,6 +165,7 @@ export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
163
165
  withEditorActions(actions: ActionDescriptor<T>[]): this;
164
166
  withEditorComponent(editorComponent: Type<any>): this;
165
167
  withResubmit(enabled?: boolean, refetch?: boolean): this;
168
+ withUnsavedChangesConfirmation(unsavedChangesConfirmation?: boolean): this;
166
169
  }
167
170
  export declare class ActionEditorSubmitDescriptor<T> extends ActionDescriptor<T> {
168
171
  private readonly _editorAction;
@@ -5,8 +5,7 @@ import { Observable, Subject } from 'rxjs';
5
5
  import { MediusQueryParam, MediusQueryResult } from '../../api/models';
6
6
  import { AMngFormlyCustomFieldComponent } from '../../components/form/formly/fields/';
7
7
  import { MngFormlyFieldConfig, MngFormlyHookFn } from '../../components/form/formly/models';
8
- import { MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../../components/form/models';
9
- import { FieldActionContext } from '../../components/form/models/field-action-context.model';
8
+ import { FieldActionContext, FieldActionResult, MngFormFieldEvent, MngFormFieldEventData, MngFormFieldEventTypeEnum } from '../../components/form/models';
10
9
  import { ILookupDataProvider, ITableDataProvider } from '../../data-providers';
11
10
  import { EnumValue } from '../../models';
12
11
  import { StyleLevelEnum } from '../../styles/models';
@@ -70,9 +69,9 @@ export declare abstract class AFieldDescriptor<T, ET, VT = T> extends AGenericFi
70
69
  get setter(): ((item: ET, value: VT) => void) | undefined;
71
70
  get validations(): FieldValidationDescriptor[];
72
71
  get asyncValidations(): FieldValidationDescriptor[];
73
- get requiredExpression(): string | ((field?: FormlyFieldConfig<import("@ngx-formly/core").FormlyFieldProps & {
72
+ get requiredExpression(): string | Observable<boolean> | ((field?: FormlyFieldConfig<import("@ngx-formly/core").FormlyFieldProps & {
74
73
  [additionalProperties: string]: any;
75
- }> | undefined) => boolean) | Observable<boolean> | undefined;
74
+ }> | undefined) => boolean) | undefined;
76
75
  get disabledExpression(): string | Observable<boolean> | ((field?: FormlyFieldConfig<import("@ngx-formly/core").FormlyFieldProps & {
77
76
  [additionalProperties: string]: any;
78
77
  }> | undefined) => boolean) | undefined;
@@ -159,6 +158,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
159
158
  private _imageUrlInputHiddenOnDisabled;
160
159
  private _customComponentName?;
161
160
  private _customComponentType?;
161
+ private _customComponentInputs?;
162
162
  private _customComponentWrappers;
163
163
  constructor(editor: EditorDescriptor<ET>, property: string);
164
164
  /**
@@ -195,11 +195,12 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
195
195
  get imageUrlInputVisibleOnDisabled(): boolean;
196
196
  get customComponentName(): string | undefined;
197
197
  get customComponentType(): Type<AMngFormlyCustomFieldComponent> | undefined;
198
+ get customComponentInputs(): Record<string, any> | undefined;
198
199
  get customComponentWrappers(): string[];
199
200
  get locale(): string | undefined;
200
201
  get currency(): string | undefined;
201
202
  get currencyFromProperty(): string | undefined;
202
- get currencyDisplay(): "symbol" | "code" | "name";
203
+ get currencyDisplay(): "symbol" | "name" | "code";
203
204
  asHidden(): this;
204
205
  asLabel(): this;
205
206
  asText(): this;
@@ -214,7 +215,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
214
215
  asFile(multiple?: boolean, maxFileSize?: number, accept?: string): this;
215
216
  asImageFile(multiple?: boolean, maxFileSize?: number, accept?: string): this;
216
217
  asImageUrl(multiple?: boolean, preview?: boolean, inputVisibleOnDisabled?: boolean): this;
217
- asCustomComponent(customComponent: string | Type<AMngFormlyCustomFieldComponent>, useWrappers?: string[]): this;
218
+ asCustomComponent(customComponent: string | Type<AMngFormlyCustomFieldComponent>, wrappers?: string[], componentInputs?: Record<string, any>): this;
218
219
  withNumberValidation(min?: number, max?: number, step?: number, autoCorrect?: boolean): this;
219
220
  withLocale(locale: string): this;
220
221
  withNumberFractions(min?: number, max?: number): this;
@@ -228,13 +229,16 @@ export declare class FieldActionDescriptor<ET> extends AFieldDescriptor<void, ET
228
229
  protected readonly _fieldActionName: string;
229
230
  protected readonly _fieldActionNameLong: string;
230
231
  protected _button: ActionButtonDescriptor;
231
- protected _runFunction?: (ctx: FieldActionContext<ET>) => void;
232
+ protected _runFunction?: (ctx: FieldActionContext<ET>) => void | FieldActionResult | Observable<FieldActionResult>;
233
+ private _wrappers;
232
234
  constructor(editor: EditorDescriptor<ET>, property: string);
233
235
  get button(): ActionButtonDescriptor;
234
- get runFunction(): ((ctx: FieldActionContext<ET>) => void) | undefined;
236
+ get runFunction(): ((ctx: FieldActionContext<ET>) => void | FieldActionResult | Observable<FieldActionResult>) | undefined;
237
+ get wrappers(): string[];
235
238
  withButtonDescriptor(button: ActionButtonDescriptor): this;
236
239
  withButton(label?: string | null, icon?: string | null, styleLevel?: StyleLevelEnum, styleText?: boolean): this;
237
240
  withRunFunction(fn: (ctx: FieldActionContext<ET>) => void): this;
241
+ withWrappers(wrappers: string[]): this;
238
242
  copy(): FieldActionDescriptor<ET>;
239
243
  }
240
244
  export declare class FieldLookupDescriptor<T, ET> extends AFieldDescriptor<T, ET> implements ILookupDescriptor<T> {
@@ -70,7 +70,7 @@ export declare class ColumnDescriptor<T, TT> {
70
70
  get customComponentType(): Type<IColumnValueComponent<TT>> | undefined;
71
71
  get locale(): string | undefined;
72
72
  get currencyCode(): string | undefined;
73
- get currencyDisplay(): "symbol" | "code" | "name" | undefined;
73
+ get currencyDisplay(): "symbol" | "name" | "code" | undefined;
74
74
  get currencyFromProperty(): string | undefined;
75
75
  get hasCopyToClipboard(): boolean;
76
76
  get template(): string | undefined;
@@ -1,8 +1,7 @@
1
1
  import { Type } from '@angular/core';
2
2
  import { MediusQueryResult } from '../../api/models';
3
3
  import { ILookupDataProvider } from '../../data-providers';
4
- import { IColumnValueComponent } from '../../models';
5
- import { TableviewAttributeDef } from '../../models/tableview-attr.model';
4
+ import { IColumnValueComponent, TableviewAttributeDef } from '../../models';
6
5
  import { ClassType, EnumType } from '../../types';
7
6
  import { ModelDescriptor } from '../model.descriptor';
8
7
  import { ColumnDisplayTypeEnum, ColumnTypeEnum, TableDynamicColumnsModeEnum, TableFilterDisplayEnum, TablePaginationModeEnum, TableSizeEnum } from '../types';
@@ -32,6 +31,8 @@ export declare class TableDescriptor<T> {
32
31
  private _hasGridlines;
33
32
  private _hasResizableColumns;
34
33
  private _columnResizeMode;
34
+ private _selectionColumnFrozen?;
35
+ private _actionColumnFrozen?;
35
36
  private _headerClassName?;
36
37
  private _rowClassName?;
37
38
  private _rowClassNameMapFn?;
@@ -79,6 +80,8 @@ export declare class TableDescriptor<T> {
79
80
  get columnResizeMode(): "fit" | "expand";
80
81
  get rowClassName(): string | undefined;
81
82
  get rowClassNameMapFn(): ((className?: string | undefined, item?: T | undefined) => string) | undefined;
83
+ get selectionColumnFrozen(): boolean | undefined;
84
+ get actionColumnFrozen(): boolean | undefined;
82
85
  get headerClassName(): string | undefined;
83
86
  get isLocalized(): boolean;
84
87
  get localizationLocaleProperty(): string | undefined;
@@ -104,8 +107,16 @@ export declare class TableDescriptor<T> {
104
107
  withHideHeader(hideHeader?: boolean): this;
105
108
  withDataKeyProperty(property: string): this;
106
109
  withLoading(text?: string, icon?: string | null): this;
107
- withColumnsReorderable(columnsReorderable?: boolean): this;
108
- withColumnsToggleable(columnsToggleable?: boolean): this;
110
+ /**
111
+ * Helper method that enables/disables reorderable property on all columns currently in the descriptor.
112
+ * @param columnsReorderable: boolean
113
+ */
114
+ withCurrentColumnsReorderable(columnsReorderable?: boolean): this;
115
+ /**
116
+ * Helper method that enables/disables toggleable property on all columns currently in the descriptor.
117
+ * @param columnsToggleable: boolean
118
+ */
119
+ withCurrentColumnsToggleable(columnsToggleable?: boolean): this;
109
120
  withDefaultSort(property: string, asc?: boolean): this;
110
121
  withClassName(className: string): this;
111
122
  withSize(size?: TableSizeEnum): this;
@@ -113,7 +124,18 @@ export declare class TableDescriptor<T> {
113
124
  withRowHeight(rowHeight: number): this;
114
125
  withHover(hover: boolean): this;
115
126
  withGridlines(gridlines: boolean): this;
116
- withResizableColumns(resizableColumns?: boolean, columnResizeMode?: 'fit' | 'expand'): this;
127
+ /**
128
+ * Method that enables/disabled column resize feature with columnResizeMode on all columns.
129
+ * @param resizableColumns True if enabled
130
+ * @param columnResizeMode 'fit' or 'expand' mode
131
+ */
132
+ withColumnsResizable(resizableColumns?: boolean, columnResizeMode?: 'fit' | 'expand'): this;
133
+ /**
134
+ * Sets column to (un)frozen.
135
+ * @param selectionColumnFrozen True to freeze selection column, false to unfreeze it.
136
+ * @param actionColumnFrozen True to freeze action column, false to unfreeze it.
137
+ */
138
+ withColumnFrozen(selectionColumnFrozen?: boolean, actionColumnFrozen?: boolean): this;
117
139
  withRowClassName(rowClassName?: string, classNameMapFn?: (className?: string, item?: T) => string): this;
118
140
  withHeaderClassName(headerClassName: string): this;
119
141
  withLocalized(): this;
@@ -0,0 +1,6 @@
1
+ import { ErrorHandler } from '@angular/core';
2
+ export declare class MngErrorHandler implements ErrorHandler {
3
+ private static readonly logCategory;
4
+ private readonly logger;
5
+ handleError(error: any): void;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './error.handler';
@@ -0,0 +1 @@
1
+ export * from './unsaved-changes.guard';
@@ -0,0 +1,3 @@
1
+ import { CanDeactivateFn } from '@angular/router';
2
+ import { CanComponentDeactivate } from '../models';
3
+ export declare const unsavedChangesGuard: CanDeactivateFn<CanComponentDeactivate>;
@@ -0,0 +1,4 @@
1
+ import { Observable } from 'rxjs';
2
+ export interface IActionEditorComponent {
3
+ closeWithUnsavedChangesConfirmation(callFromGuard: boolean): Observable<boolean>;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { Observable } from 'rxjs';
2
+ export interface CanComponentDeactivate {
3
+ canDeactivate: () => Observable<boolean>;
4
+ }
@@ -3,6 +3,7 @@ import { ValidatorOption, WrapperOption } from '@ngx-formly/core/lib/models/conf
3
3
  import { TranslateService } from '@ngx-translate/core';
4
4
  import { MenuItem } from 'primeng/api';
5
5
  import { MngFormlyTypeConfig } from '../components/form/formly/models';
6
+ import { MngLogConfig } from './log.model';
6
7
  import { VersionConfigType } from './version.model';
7
8
  export interface MngModuleConfig {
8
9
  app?: {
@@ -55,7 +56,7 @@ export interface MngModuleConfig {
55
56
  filtersDateOnlyDisabled?: boolean;
56
57
  };
57
58
  actions?: {
58
- debugLog?: boolean;
59
59
  debugInstances?: boolean;
60
60
  };
61
+ log?: MngLogConfig;
61
62
  }
@@ -1,14 +1,50 @@
1
- import { Message } from 'primeng/api';
2
- import { IdType } from '../types';
3
- export interface MngError extends Error {
4
- id?: IdType;
1
+ import { HttpErrorResponse } from '@angular/common/http';
2
+ import { ActionContext } from '../components/action/models';
3
+ export type MngErrorTypes = 'MngInternalError' | 'MngActionError' | 'MngHttpError';
4
+ /**
5
+ * Main use for mng error from action execution.
6
+ * If http error is thrown, add it in cause.
7
+ */
8
+ export interface IMngError extends Error {
9
+ type: MngErrorTypes;
5
10
  messageCode?: number | string;
6
11
  message: string;
7
- notification?: Message;
8
12
  details?: any;
9
- status?: number;
10
- statusDescription?: string;
11
13
  stack?: string;
12
- url?: string;
14
+ cause?: Error | unknown;
15
+ }
16
+ export interface MngErrorBaseOptions {
17
+ name?: string;
18
+ messageCode?: number | string;
19
+ details?: any;
13
20
  cause?: Error;
21
+ stack?: string;
22
+ location?: string;
23
+ }
24
+ export declare abstract class AMngErrorBase extends Error implements IMngError {
25
+ abstract readonly type: MngErrorTypes;
26
+ readonly messageCode?: number | string;
27
+ readonly location?: string;
28
+ readonly details?: any;
29
+ protected constructor(message: string, options?: MngErrorBaseOptions);
30
+ }
31
+ export declare class MngInternalError extends AMngErrorBase implements IMngError {
32
+ readonly type = "MngInternalError";
33
+ constructor(message: string, options?: MngErrorBaseOptions);
34
+ }
35
+ export declare class MngHttpError extends AMngErrorBase implements IMngError {
36
+ readonly type = "MngHttpError";
37
+ readonly httpError: HttpErrorResponse;
38
+ constructor(message: string, httpError: HttpErrorResponse, options?: MngErrorBaseOptions);
39
+ }
40
+ export interface MngActionErrorOptions extends MngErrorBaseOptions {
41
+ actionContext?: ActionContext<any, any>;
42
+ httpError?: HttpErrorResponse;
43
+ }
44
+ export declare class MngActionError extends AMngErrorBase implements IMngError {
45
+ readonly type = "MngActionError";
46
+ readonly actionId: string;
47
+ readonly actionContext?: ActionContext<any, any>;
48
+ readonly httpError?: HttpErrorResponse;
49
+ constructor(message: string, actionName: string, options?: MngActionErrorOptions);
14
50
  }
@@ -2,9 +2,11 @@ export * from './column-value.model';
2
2
  export * from './config.model';
3
3
  export * from './enum.model';
4
4
  export * from './error.model';
5
+ export * from './log.model';
5
6
  export * from './menu.model';
6
7
  export * from './user.model';
7
8
  export * from './version.model';
8
9
  export * from './view-container.model';
9
10
  export * from './tableview-attr.model';
10
- export * from './error-internal.model';
11
+ export * from './can-component-deactivate.model';
12
+ export * from './action-editor.model';