@mediusinc/mng-commons 0.2.17 → 0.2.20

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 (96) hide show
  1. package/assets/i18n/en.json +7 -5
  2. package/assets/i18n/sl.json +23 -21
  3. package/esm2020/lib/api/services/crud-api.abstract.service.mjs +22 -17
  4. package/esm2020/lib/components/action/action.component.mjs +50 -23
  5. package/esm2020/lib/components/action/editor/action-editor.component.mjs +239 -0
  6. package/esm2020/lib/components/action/index.mjs +2 -2
  7. package/esm2020/lib/components/action/models/action-execution.model.mjs +3 -3
  8. package/esm2020/lib/components/action/route/action-route.component.mjs +19 -38
  9. package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +9 -6
  10. package/esm2020/lib/components/form/editor/form-editor.component.mjs +56 -4
  11. package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
  12. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  13. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  14. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +179 -0
  15. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +28 -9
  16. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +12 -9
  17. package/esm2020/lib/components/form/formly/fields/index.mjs +2 -1
  18. package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
  19. package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +4 -3
  20. package/esm2020/lib/components/form/models/form-editor.event.mjs +28 -1
  21. package/esm2020/lib/components/layout/main-layout.component.mjs +1 -1
  22. package/esm2020/lib/components/layout/topbar.component.mjs +1 -1
  23. package/esm2020/lib/components/tableview/table/table.component.mjs +37 -12
  24. package/esm2020/lib/components/tableview/tableview.component.mjs +28 -21
  25. package/esm2020/lib/config/formly.config.mjs +7 -2
  26. package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
  27. package/esm2020/lib/data-providers/table.data-provider.mjs +17 -2
  28. package/esm2020/lib/descriptors/action.descriptor.mjs +146 -2
  29. package/esm2020/lib/descriptors/editor.descriptor.interface.mjs +2 -0
  30. package/esm2020/lib/descriptors/editor.descriptor.mjs +122 -27
  31. package/esm2020/lib/directives/component.directive.mjs +8 -3
  32. package/esm2020/lib/mng-commons.module.mjs +21 -11
  33. package/esm2020/lib/models/error.model.mjs +2 -0
  34. package/esm2020/lib/models/index.mjs +3 -1
  35. package/esm2020/lib/models/view-container.model.mjs +2 -0
  36. package/esm2020/lib/services/action-executor.service.mjs +343 -0
  37. package/esm2020/lib/services/error-mapper.service.mjs +14 -0
  38. package/esm2020/lib/services/index.mjs +4 -2
  39. package/esm2020/lib/services/tokens/default-setting.token.mjs +3 -0
  40. package/esm2020/lib/services/tokens/index.mjs +2 -1
  41. package/esm2020/lib/services/view-container.component.service.mjs +35 -0
  42. package/esm2020/lib/utils/editor-formly.util.mjs +14 -3
  43. package/esm2020/lib/utils/i18n.util.mjs +29 -1
  44. package/esm2020/lib/utils/toast.util.mjs +18 -14
  45. package/esm2020/public-api.mjs +1 -2
  46. package/fesm2015/mediusinc-mng-commons.mjs +1818 -994
  47. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  48. package/fesm2020/mediusinc-mng-commons.mjs +1805 -998
  49. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  50. package/lib/api/services/crud-api.abstract.service.d.ts +9 -8
  51. package/lib/components/action/action.component.d.ts +16 -9
  52. package/lib/components/action/editor/action-editor.component.d.ts +59 -0
  53. package/lib/components/action/index.d.ts +1 -1
  54. package/lib/components/action/models/action-execution.model.d.ts +3 -3
  55. package/lib/components/action/route/action-route.component.d.ts +5 -6
  56. package/lib/components/form/editor/form-editor.component.d.ts +7 -2
  57. package/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +45 -0
  58. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +2 -0
  59. package/lib/components/form/formly/fields/index.d.ts +1 -0
  60. package/lib/components/form/models/form-editor.event.d.ts +32 -0
  61. package/lib/components/tableview/table/table.component.d.ts +14 -6
  62. package/lib/components/tableview/tableview.component.d.ts +9 -7
  63. package/lib/data-providers/table.data-provider.d.ts +9 -1
  64. package/lib/descriptors/action.descriptor.d.ts +71 -16
  65. package/lib/descriptors/editor.descriptor.d.ts +59 -18
  66. package/lib/descriptors/editor.descriptor.interface.d.ts +9 -0
  67. package/lib/directives/component.directive.d.ts +5 -4
  68. package/lib/mng-commons.module.d.ts +55 -54
  69. package/lib/models/error.model.d.ts +12 -0
  70. package/lib/models/index.d.ts +2 -0
  71. package/lib/models/view-container.model.d.ts +6 -0
  72. package/lib/services/{action.service.d.ts → action-executor.service.d.ts} +25 -18
  73. package/lib/services/error-mapper.service.d.ts +7 -0
  74. package/lib/services/index.d.ts +3 -1
  75. package/lib/services/tokens/default-setting.token.d.ts +2 -0
  76. package/lib/services/tokens/index.d.ts +1 -0
  77. package/lib/services/view-container.component.service.d.ts +22 -0
  78. package/lib/utils/i18n.util.d.ts +3 -0
  79. package/lib/utils/toast.util.d.ts +5 -4
  80. package/package.json +1 -1
  81. package/public-api.d.ts +0 -1
  82. package/scss/mng-overrides/_layout_forms.scss +2 -0
  83. package/scss/mng-overrides/_mixins.scss +7 -0
  84. package/scss/mng-overrides/_theme_button.scss +57 -0
  85. package/scss/mng-overrides/_theme_dropdown.scss +17 -0
  86. package/scss/mng-overrides/_theme_styles.scss +2 -0
  87. package/scss/mng-overrides/_theme_toolbar.scss +5 -0
  88. package/scss/theme/default/_mng-variables-theme-dark.scss +3 -0
  89. package/scss/theme/default/_mng-variables-theme-light.scss +3 -0
  90. package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -151
  91. package/esm2020/lib/components/tableview/services/index.mjs +0 -2
  92. package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +0 -21
  93. package/esm2020/lib/services/action.service.mjs +0 -273
  94. package/lib/components/action/dialog/action-dialog.component.d.ts +0 -47
  95. package/lib/components/tableview/services/index.d.ts +0 -1
  96. package/lib/components/tableview/services/tableview.component.service.d.ts +0 -14
@@ -1,23 +1,24 @@
1
- import { HttpClient } from '@angular/common/http';
1
+ import { HttpClient, HttpParams } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
3
  import { ClassType } from '../../types';
4
4
  import { MediusQueryParam, MediusQueryResult } from '../models';
5
+ import { ObjectSerializer } from '../utils';
5
6
  export declare abstract class AMngCrudApiService<T, QRT extends MediusQueryResult<T>> {
6
7
  protected type: ClassType<T>;
7
8
  protected queryResultType: ClassType<QRT>;
8
9
  protected http: HttpClient;
9
- private readonly objectSerializer;
10
+ protected readonly objectSerializer: ObjectSerializer;
10
11
  protected constructor(type: ClassType<T>, queryResultType: ClassType<QRT>, http: HttpClient);
11
- createPost(item: T): Observable<T>;
12
- getAllPost(queryParam?: MediusQueryParam): Observable<QRT>;
13
- getByIdGet(id: any): Observable<T>;
14
- updatePut(id: any, item: T): Observable<T>;
15
- removeDelete(id: any, item: T): Observable<any>;
12
+ createPost(item: T, params?: HttpParams): Observable<T>;
13
+ getAllPost(queryParamBody?: MediusQueryParam, params?: HttpParams): Observable<QRT>;
14
+ getByIdGet(id: any, params?: HttpParams): Observable<T>;
15
+ updatePut(id: any, item: T, params?: HttpParams): Observable<T>;
16
+ removeDelete(id: any, item?: T, params?: HttpParams): Observable<any>;
16
17
  protected abstract getBasePath(): string;
17
18
  protected abstract getServiceBasePath(): string;
18
19
  protected getGetAllPostPath(): string;
19
20
  protected getCreatePostPath(): string;
20
21
  protected getUpdatePutPath(id: any, item: T): string;
21
22
  protected getGetByIdGetPath(id: any): string;
22
- protected getRemoveDeletePath(id: any, item: T): string;
23
+ protected getRemoveDeletePath(id: any, item?: T): string;
23
24
  }
@@ -1,24 +1,30 @@
1
- import { OnInit } from '@angular/core';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { ActivatedRoute } from '@angular/router';
3
3
  import { TranslateService } from '@ngx-translate/core';
4
4
  import { ConfirmationService } from 'primeng/api';
5
5
  import { Observable } from 'rxjs';
6
+ import { IDataProvider } from '../../data-providers';
6
7
  import { ActionDescriptor } from '../../descriptors';
7
- import { MngActionService } from '../../services';
8
+ import { IViewContainer } from '../../models';
9
+ import { MngActionExecutorService, MngViewContainerComponentService } from '../../services';
8
10
  import { IdType } from '../../types';
9
- import { TableviewComponentService } from '../tableview/services';
10
- import { ActionData, IActionConfirmationService } from './models';
11
+ import { ActionData, ActionTriggerResult, IActionConfirmationService } from './models';
11
12
  import * as i0 from "@angular/core";
12
13
  export declare class MngActionComponent<T, S> implements OnInit, IActionConfirmationService {
13
14
  private route;
14
15
  private translate;
15
- private actionService;
16
+ private actionExecutor;
16
17
  private confirmationService;
17
- private tableviewService;
18
+ private viewContainerService;
18
19
  action: ActionDescriptor<T>;
19
20
  item?: T;
20
21
  itemId?: IdType;
21
22
  actionData?: ActionData;
23
+ dataProvider?: IDataProvider<T, S>;
24
+ inputDisabled: Observable<boolean>;
25
+ inputLoading: Observable<boolean>;
26
+ viewContainerInit?: IViewContainer<T, S>;
27
+ triggerEventEmitter: EventEmitter<ActionTriggerResult<T, S, IDataProvider<T, S>>>;
22
28
  private loadingSubject;
23
29
  $loading: Observable<boolean>;
24
30
  cmpId: string;
@@ -26,11 +32,12 @@ export declare class MngActionComponent<T, S> implements OnInit, IActionConfirma
26
32
  $isEnabled: Observable<boolean>;
27
33
  $label: Observable<string | null>;
28
34
  $tooltip: Observable<string | null>;
29
- constructor(route: ActivatedRoute, translate: TranslateService, actionService: MngActionService, confirmationService: ConfirmationService, tableviewService: TableviewComponentService<T, S>);
35
+ private viewContainer?;
36
+ constructor(route: ActivatedRoute, translate: TranslateService, actionExecutor: MngActionExecutorService, confirmationService: ConfirmationService, viewContainerService: MngViewContainerComponentService<T, S> | null);
30
37
  ngOnInit(): void;
31
38
  triggerAction(event: Event): void;
32
39
  getConfirmationService(): ConfirmationService;
33
40
  getConfirmationServiceInstanceKey(action: ActionDescriptor<any>): string;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<MngActionComponent<any, any>, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<MngActionComponent<any, any>, "mng-action", never, { "action": "action"; "item": "item"; "itemId": "itemId"; "actionData": "actionData"; }, {}, never, never>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<MngActionComponent<any, any>, [null, null, null, null, { optional: true; }]>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngActionComponent<any, any>, "mng-action", never, { "action": "action"; "item": "item"; "itemId": "itemId"; "actionData": "actionData"; "dataProvider": "dataProvider"; "inputDisabled": "disabled"; "inputLoading": "loading"; "viewContainerInit": "viewContainer"; }, { "triggerEventEmitter": "trigger"; }, never, never>;
36
43
  }
@@ -0,0 +1,59 @@
1
+ import { ElementRef, EventEmitter, Injector, OnDestroy, OnInit, QueryList } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog';
4
+ import { Observable } from 'rxjs';
5
+ import { IDataProvider, IEditorDataProvider } from '../../../data-providers';
6
+ import { ActionDescriptor, ActionEditorDescriptor } from '../../../descriptors';
7
+ import { MngTemplateDirective } from '../../../directives';
8
+ import { IViewContainer } from '../../../models';
9
+ import { MngActionExecutorService, MngCommonsService, MngNavigationService, MngViewContainerComponentService } from '../../../services';
10
+ import { IdType } from '../../../types';
11
+ import { MngFormEditorComponent } from '../../form';
12
+ import { MngFormEditorSubmitEvent } from '../../form/models';
13
+ import { ActionData, ActionRunResult } from '../models';
14
+ import * as i0 from "@angular/core";
15
+ export declare class MngActionEditorComponent<T, S> implements OnInit, OnDestroy {
16
+ private injector;
17
+ private translate;
18
+ private actionExecutor;
19
+ private mngCommonsService;
20
+ private navigationService;
21
+ private dialogRef;
22
+ private dialogConfig;
23
+ private viewContainerService;
24
+ action: ActionEditorDescriptor<T>;
25
+ itemId?: IdType;
26
+ item?: T;
27
+ actionData?: ActionData;
28
+ dataProvider?: IEditorDataProvider<T, S>;
29
+ viewContainerInit?: IViewContainer<T, S>;
30
+ actionRunEventEmitter: EventEmitter<ActionRunResult<T, S, IDataProvider<T, S>>>;
31
+ templates: QueryList<MngTemplateDirective>;
32
+ submitButtonElementRef: ElementRef;
33
+ editorComponent: MngFormEditorComponent<T>;
34
+ cmpId: string;
35
+ title?: string;
36
+ isDialog: boolean;
37
+ isSaveButton: boolean;
38
+ toolbarLeftActions: ActionDescriptor<T>[];
39
+ toolbarRightActions: ActionDescriptor<T>[];
40
+ footerLeftActions: ActionDescriptor<T>[];
41
+ footerRightActions: ActionDescriptor<T>[];
42
+ private loadingSubject;
43
+ loading$: Observable<boolean>;
44
+ private submitLoadingSubject;
45
+ submitLoading$: Observable<boolean>;
46
+ viewContainer?: IViewContainer<T, S>;
47
+ private sourceComponent;
48
+ private subscriptions;
49
+ constructor(injector: Injector, translate: TranslateService, actionExecutor: MngActionExecutorService, mngCommonsService: MngCommonsService, navigationService: MngNavigationService, dialogRef: DynamicDialogRef | null, dialogConfig: DynamicDialogConfig | null, viewContainerService: MngViewContainerComponentService<T, S> | null);
50
+ ngOnInit(): void;
51
+ ngOnDestroy(): void;
52
+ onSubmit(event: MngFormEditorSubmitEvent<T>): void;
53
+ cancel(result?: ActionRunResult<T, S, IDataProvider<T, S>>): void;
54
+ triggerSubmit(): void;
55
+ private loadItemWithDataProvider;
56
+ private setTitle;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<MngActionEditorComponent<any, any>, [null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
58
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngActionEditorComponent<any, any>, "mng-action-editor", never, { "action": "action"; "itemId": "itemId"; "item": "item"; "actionData": "actionData"; "dataProvider": "dataProvider"; "viewContainerInit": "viewContainer"; }, { "actionRunEventEmitter": "actionSubmit"; }, ["templates"], never>;
59
+ }
@@ -1,3 +1,3 @@
1
1
  export * from './action.component';
2
2
  export * from './route/action-route.component';
3
- export * from './dialog/action-dialog.component';
3
+ export * from './editor/action-editor.component';
@@ -1,8 +1,8 @@
1
1
  import { DynamicDialogRef } from 'primeng/dynamicdialog';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IDataProvider } from '../../../data-providers';
4
+ import { IViewContainer } from '../../../models';
4
5
  import { IdType } from '../../../types';
5
- import { TableviewComponentService } from '../../tableview/services';
6
6
  export declare class ActionExecContext<T, S, DP extends IDataProvider<T, S>> {
7
7
  readonly dataProvider?: DP | undefined;
8
8
  readonly serviceInstance?: S | undefined;
@@ -12,12 +12,12 @@ export declare class ActionExecContext<T, S, DP extends IDataProvider<T, S>> {
12
12
  actionData?: ActionData | undefined;
13
13
  } | undefined;
14
14
  readonly sourceComponent: any;
15
- readonly tableview: TableviewComponentService<T, S> | null;
15
+ readonly viewContainer: IViewContainer<T, S> | null;
16
16
  constructor(dataProvider?: DP | undefined, serviceInstance?: S | undefined, data?: {
17
17
  item?: T | undefined;
18
18
  itemId?: IdType | undefined;
19
19
  actionData?: ActionData | undefined;
20
- } | undefined, sourceComponent?: any, tableview?: TableviewComponentService<T, S> | null);
20
+ } | undefined, sourceComponent?: any, viewContainer?: IViewContainer<T, S> | null);
21
21
  }
22
22
  export declare class ActionError {
23
23
  readonly error: any;
@@ -2,8 +2,7 @@ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { ConfirmationService } from 'primeng/api';
4
4
  import { ActionDescriptor } from '../../../descriptors';
5
- import { MngActionService, MngNavigationService } from '../../../services';
6
- import { TableviewComponentService } from '../../tableview/services';
5
+ import { MngActionExecutorService, MngNavigationService, MngViewContainerComponentService } from '../../../services';
7
6
  import { IActionConfirmationService } from '../models';
8
7
  import * as i0 from "@angular/core";
9
8
  export declare class MngActionRouteComponent<T, S> implements OnInit, OnDestroy, IActionConfirmationService {
@@ -11,15 +10,15 @@ export declare class MngActionRouteComponent<T, S> implements OnInit, OnDestroy,
11
10
  private route;
12
11
  private confirmationService;
13
12
  private navigationService;
14
- private actionService;
15
- private tableviewService;
13
+ private actionExecutor;
14
+ private viewContainerService;
16
15
  cmpId: string;
17
16
  private actions;
18
17
  private activeAction?;
19
18
  private dialogRef?;
20
19
  private dialogCloseSubscription?;
21
20
  private subscriptions;
22
- constructor(router: Router, route: ActivatedRoute, confirmationService: ConfirmationService, navigationService: MngNavigationService, actionService: MngActionService, tableviewService: TableviewComponentService<T, S>);
21
+ constructor(router: Router, route: ActivatedRoute, confirmationService: ConfirmationService, navigationService: MngNavigationService, actionExecutor: MngActionExecutorService, viewContainerService: MngViewContainerComponentService<T, S> | null);
23
22
  ngOnInit(): void;
24
23
  ngOnDestroy(): void;
25
24
  getConfirmationService(): ConfirmationService;
@@ -27,6 +26,6 @@ export declare class MngActionRouteComponent<T, S> implements OnInit, OnDestroy,
27
26
  private activateAction;
28
27
  private deactivateAction;
29
28
  private findActiveAction;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<MngActionRouteComponent<any, any>, never>;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<MngActionRouteComponent<any, any>, [null, null, null, null, null, { optional: true; }]>;
31
30
  static ɵcmp: i0.ɵɵComponentDeclaration<MngActionRouteComponent<any, any>, "mng-action-route", never, {}, {}, never, never>;
32
31
  }
@@ -1,5 +1,5 @@
1
1
  import { ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
2
- import { FormGroup } from '@angular/forms';
2
+ import { AbstractControl, FormGroup } from '@angular/forms';
3
3
  import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
4
4
  import { TranslateService } from '@ngx-translate/core';
5
5
  import { Message } from 'primeng/api';
@@ -32,8 +32,13 @@ export declare class MngFormEditorComponent<T> implements OnInit, OnDestroy {
32
32
  submit(): void;
33
33
  onSubmit(event: Event): void;
34
34
  getFormValue(): T;
35
+ getFormField(key: string): AbstractControl | null;
36
+ setFormFieldValue(key: string, value: any): void;
37
+ patchFormFieldValue(key: string, value: any): void;
38
+ resetFormFieldValue(key: string, value?: any): void;
39
+ private findFormField;
35
40
  private isAnyFieldInvalid;
36
- private updateFormModel;
41
+ private resetFormModel;
37
42
  private updateFormState;
38
43
  static ɵfac: i0.ɵɵFactoryDeclaration<MngFormEditorComponent<any>, never>;
39
44
  static ɵcmp: i0.ɵɵComponentDeclaration<MngFormEditorComponent<any>, "mng-form-editor", never, { "descriptor": "descriptor"; "submitLoading": "submitLoading"; "item": "item"; "isSubmitButtonVisible": "isSubmitButtonVisible"; "isFormDisabled": "isFormDisabled"; }, { "formSubmitEventEmitter": "formSubmit"; }, ["templates"], never>;
@@ -0,0 +1,45 @@
1
+ import { AfterViewInit, Injector, OnDestroy, OnInit } from '@angular/core';
2
+ import { FormControl } from '@angular/forms';
3
+ import { FieldType } from '@ngx-formly/core';
4
+ import { Message } from 'primeng/api';
5
+ import { Observable, Subject } from 'rxjs';
6
+ import { MediusQueryResult } from '../../../../../api/models';
7
+ import { FieldLookupDescriptor } from '../../../../../descriptors';
8
+ import { FieldLookupConfig } from '../../../../../descriptors/editor.descriptor.interface';
9
+ import { MngTableComponent } from '../../../../tableview';
10
+ import * as i0 from "@angular/core";
11
+ export declare class MngFormlyFieldLookupDialogComponent<T, ET> extends FieldType implements OnInit, AfterViewInit, OnDestroy {
12
+ private injector;
13
+ mngTable?: MngTableComponent<any, any>;
14
+ descriptor: FieldLookupDescriptor<T, ET>;
15
+ config: FieldLookupConfig;
16
+ fieldLabelFormControl: FormControl;
17
+ itemsSubject: Subject<T>;
18
+ itemsAsync: Observable<T>;
19
+ addItemsSubject: Subject<MediusQueryResult<T>>;
20
+ addItemsAsync: Observable<MediusQueryResult<T>>;
21
+ dialogUseDataProvider: boolean;
22
+ private dialogDataProviderService;
23
+ private dialogIsLoadingSubject;
24
+ isDialogVisible: boolean;
25
+ dialogAreItemsLoaded: boolean;
26
+ dialogSelectedItem: any;
27
+ dialogMessages: Message[];
28
+ dialogIsLoading$: Observable<boolean>;
29
+ private lookupDataProviderSubscription?;
30
+ private subscriptions;
31
+ constructor(injector: Injector);
32
+ ngOnInit(): void;
33
+ ngAfterViewInit(): void;
34
+ ngOnDestroy(): void;
35
+ openSelectDialog(): void;
36
+ onSelectionChange(item: any): void;
37
+ onCaptionCmpInst(instance: any): void;
38
+ onColumnActionCmpInst(instance: any): void;
39
+ clear(): void;
40
+ hideDialog(): void;
41
+ addItem(): void;
42
+ private setFieldLabelValue;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldLookupDialogComponent<any, any>, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldLookupDialogComponent<any, any>, "mng-formly-field-lookup-dialog", never, {}, {}, never, never>;
45
+ }
@@ -10,6 +10,8 @@ export declare class MngFormlyFieldTableDialogFormComponent<T, ET> extends Field
10
10
  toolbarActions: Array<ActionDescriptor<T>>;
11
11
  rowActions: Array<ActionDescriptor<T>>;
12
12
  private subscriptions;
13
+ private isDisabledSubject;
14
+ private isEnabled$;
13
15
  ngOnInit(): void;
14
16
  ngOnDestroy(): void;
15
17
  static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldTableDialogFormComponent<any, any>, never>;
@@ -1,6 +1,7 @@
1
1
  export * from './formly-field-autocomplete/formly-field-autocomplete.component';
2
2
  export * from './formly-field-input/formly-field-input.component';
3
3
  export * from './formly-field-dropdown/formly-field-dropdown.component';
4
+ export * from './formly-field-lookup-dialog/formly-field-lookup-dialog.component';
4
5
  export * from './formly-field-table-dialog-form/formly-field-table-dialog-form.component';
5
6
  export * from './formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component';
6
7
  export * from './formly-field-tabs/formly-field-tabs.component';
@@ -1,5 +1,37 @@
1
+ import { Type } from '@angular/core';
1
2
  export declare class MngFormEditorSubmitEvent<T> {
2
3
  readonly formItem: T;
3
4
  success: boolean;
4
5
  constructor(formItem: T);
5
6
  }
7
+ export declare enum MngFormFieldEventTypeEnum {
8
+ Component = 0,
9
+ ValueChange = 1,
10
+ DataProvider = 2,
11
+ Dialog = 3,
12
+ Other = 4
13
+ }
14
+ export declare class MngFormFieldEventComponentSubtype {
15
+ static readonly ON_INIT = "Component.OnInit";
16
+ static readonly ON_VIEW_INIT = "Component.OnViewInit";
17
+ static readonly ON_CONTENT_INIT = "Component.OnContentInit";
18
+ static readonly ON_DESTROY = "Component.OnDestroy";
19
+ }
20
+ export declare class MngFormFieldEventDialogSubtype {
21
+ static readonly VISIBILITY = "Dialog.Visibility";
22
+ static readonly TABLE_CAPTION_COMPONENT_INSTANCE = "Dialog.MngTable.CaptionComponentInstance";
23
+ static readonly TABLE_COLUMN_ACTIONS_COMPONENT_INSTANCE = "Dialog.MngTable.ColumnActionsComponentInstance";
24
+ }
25
+ export interface MngFormFieldEventData<T, ET> {
26
+ eventSubtype?: string;
27
+ value?: T;
28
+ formValue?: ET;
29
+ [key: string]: any;
30
+ }
31
+ export declare class MngFormFieldEvent<T, ET> {
32
+ readonly type: MngFormFieldEventTypeEnum;
33
+ readonly componentType: Type<any>;
34
+ readonly componentInstance: any;
35
+ readonly data: MngFormFieldEventData<T, ET>;
36
+ constructor(type: MngFormFieldEventTypeEnum, componentType: Type<any>, componentInstance: any, data?: MngFormFieldEventData<T, ET>);
37
+ }
@@ -1,4 +1,4 @@
1
- import { AfterContentInit, EventEmitter, Injector, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core';
1
+ import { AfterContentInit, EventEmitter, Injector, OnDestroy, OnInit, QueryList, TemplateRef, Type } from '@angular/core';
2
2
  import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { TranslateService } from '@ngx-translate/core';
4
4
  import { LazyLoadEvent, SortMeta } from 'primeng/api';
@@ -8,16 +8,16 @@ import { Observable } from 'rxjs';
8
8
  import { MediusQueryResult } from '../../../api/models';
9
9
  import { ITableDataProvider } from '../../../data-providers';
10
10
  import { ColumnDescriptor, TableDescriptor } from '../../../descriptors';
11
- import { MngTemplateDirective } from '../../../directives';
11
+ import { MngComponentDirective, MngTemplateDirective } from '../../../directives';
12
+ import { MngViewContainerComponentService } from '../../../services';
12
13
  import { MngTableCellClickEvent, MngTableLoadEvent } from '../models';
13
- import { TableviewComponentService } from '../services';
14
14
  import * as i0 from "@angular/core";
15
15
  export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit, OnDestroy {
16
16
  private injector;
17
17
  private router;
18
18
  private activatedRoute;
19
19
  private translate;
20
- private tableviewService;
20
+ private viewContainerService;
21
21
  readonly filterDisplayRow: TableDescriptor.FilterDisplayEnum;
22
22
  readonly filterDisplayMenu: TableDescriptor.FilterDisplayEnum;
23
23
  descriptor: TableDescriptor<T>;
@@ -26,11 +26,17 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
26
26
  loading?: Observable<boolean> | boolean;
27
27
  dataProvider?: ITableDataProvider<T, any>;
28
28
  useQueryParams: boolean;
29
+ selectionMode: string;
29
30
  selectionEnabled: boolean;
31
+ captionComponent?: Type<any>;
32
+ columnActionComponent?: Type<any>;
30
33
  loadEventEmitter: EventEmitter<MngTableLoadEvent>;
31
34
  cellClickEventEmitter: EventEmitter<MngTableCellClickEvent<T>>;
32
35
  selectionChangeEventEmitter: EventEmitter<T[]>;
36
+ captionCmpInstEventEmitter: EventEmitter<any>;
37
+ columnActionCmpInstEventEmitter: EventEmitter<any>;
33
38
  templates: QueryList<MngTemplateDirective>;
39
+ components: QueryList<MngComponentDirective<any>>;
34
40
  primeTable: Table;
35
41
  captionTemplate?: TemplateRef<any>;
36
42
  columnActionTemplate?: TemplateRef<any>;
@@ -62,7 +68,7 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
62
68
  private isSortChanged;
63
69
  private filterDescriptors;
64
70
  private subscriptions;
65
- constructor(injector: Injector, router: Router, activatedRoute: ActivatedRoute, translate: TranslateService, tableviewService: TableviewComponentService<T, S>);
71
+ constructor(injector: Injector, router: Router, activatedRoute: ActivatedRoute, translate: TranslateService, viewContainerService: MngViewContainerComponentService<T, S> | null);
66
72
  ngOnInit(): void;
67
73
  ngAfterContentInit(): void;
68
74
  ngOnDestroy(): void;
@@ -72,10 +78,12 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
72
78
  onTableFilter(event: any): void;
73
79
  onCellClick(col: ColumnDescriptor<any, T>, item: T, idx: number): void;
74
80
  onSelectionChange(event: Array<T>): void;
81
+ onCaptionCmpInst<C>(instance: C): void;
82
+ onColumnActionCmpInst<C>(instance: C): void;
75
83
  private loadTableWithDataProvider;
76
84
  private loadTableFromRouteUpdate;
77
85
  private updatePrimeSortAndFilter;
78
86
  private getDefaultSortMeta;
79
87
  static ɵfac: i0.ɵɵFactoryDeclaration<MngTableComponent<any, any>, [null, null, null, null, { optional: true; }]>;
80
- static ɵcmp: i0.ɵɵComponentDeclaration<MngTableComponent<any, any>, "mng-table", never, { "descriptor": "descriptor"; "items": "items"; "queryResult": "queryResult"; "loading": "loading"; "dataProvider": "dataProvider"; "useQueryParams": "useQueryParams"; "selectionEnabled": "selectionEnabled"; }, { "loadEventEmitter": "tableLoad"; "cellClickEventEmitter": "cellClick"; "selectionChangeEventEmitter": "selectionChange"; }, ["templates"], never>;
88
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngTableComponent<any, any>, "mng-table", never, { "descriptor": "descriptor"; "items": "items"; "queryResult": "queryResult"; "loading": "loading"; "dataProvider": "dataProvider"; "useQueryParams": "useQueryParams"; "selectionMode": "selectionMode"; "selectionEnabled": "selectionEnabled"; "captionComponent": "captionComponent"; "columnActionComponent": "columnActionComponent"; }, { "loadEventEmitter": "tableLoad"; "cellClickEventEmitter": "cellClick"; "selectionChangeEventEmitter": "selectionChange"; "captionCmpInstEventEmitter": "captionComponentInstance"; "columnActionCmpInstEventEmitter": "columnActionComponentInstance"; }, ["templates"], never>;
81
89
  }
@@ -3,21 +3,21 @@ import { ActivatedRoute } from '@angular/router';
3
3
  import { TranslateService } from '@ngx-translate/core';
4
4
  import { ConfirmationService, MessageService } from 'primeng/api';
5
5
  import { DialogService } from 'primeng/dynamicdialog';
6
- import { ITableviewDataProvider } from '../../data-providers';
6
+ import { IDataProvider, ITableviewDataProvider } from '../../data-providers';
7
7
  import { ActionDescriptor, TableviewDescriptor } from '../../descriptors';
8
- import { MngActionService } from '../../services';
8
+ import { IViewContainer } from '../../models';
9
+ import { MngActionExecutorService, MngViewContainerComponentService } from '../../services';
9
10
  import { MngTableCellClickEvent } from './models';
10
- import { TableviewComponentService } from './services';
11
11
  import { MngTableComponent } from './table/table.component';
12
12
  import * as i0 from "@angular/core";
13
- export declare class MngTableviewComponent<T, S> implements OnInit, OnDestroy {
13
+ export declare class MngTableviewComponent<T, S> implements OnInit, OnDestroy, IViewContainer<T, S> {
14
14
  private route;
15
15
  private messageService;
16
16
  private translateService;
17
17
  private dialogService;
18
18
  private confirmationService;
19
- private actionService;
20
- private tableviewService;
19
+ private actionExecutor;
20
+ private viewContainerService;
21
21
  descriptor: TableviewDescriptor<T>;
22
22
  dataProvider?: ITableviewDataProvider<T, S>;
23
23
  actions: Array<ActionDescriptor<T>>;
@@ -27,9 +27,11 @@ export declare class MngTableviewComponent<T, S> implements OnInit, OnDestroy {
27
27
  toolbarLeftActions: ActionDescriptor<T>[];
28
28
  toolbarRightActions: ActionDescriptor<T>[];
29
29
  private subscriptions;
30
- constructor(route: ActivatedRoute, messageService: MessageService, translateService: TranslateService, dialogService: DialogService, confirmationService: ConfirmationService, actionService: MngActionService, tableviewService: TableviewComponentService<T, S>);
30
+ constructor(route: ActivatedRoute, messageService: MessageService, translateService: TranslateService, dialogService: DialogService, confirmationService: ConfirmationService, actionExecutor: MngActionExecutorService, viewContainerService: MngViewContainerComponentService<T, S>);
31
31
  ngOnInit(): void;
32
32
  ngOnDestroy(): void;
33
+ getMessageService(): MessageService;
34
+ getDataProvider(): IDataProvider<T, S> | undefined;
33
35
  reloadTable(): void;
34
36
  onTableCellClick(event: MngTableCellClickEvent<T>): void;
35
37
  static ɵfac: i0.ɵɵFactoryDeclaration<MngTableviewComponent<any, any>, never>;
@@ -1,6 +1,14 @@
1
+ import { Type } from '@angular/core';
1
2
  import { Observable } from 'rxjs';
2
3
  import { MediusQueryParam, MediusQueryResult } from '../api/models';
3
- import { IDataProvider } from './base.data-provider';
4
+ import { ClassType } from '../types';
5
+ import { DataProvider, IDataProvider } from './base.data-provider';
4
6
  export interface ITableDataProvider<T, S> extends IDataProvider<T, S> {
5
7
  getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
6
8
  }
9
+ export declare class TableDataProvider<T, S> extends DataProvider<T, S> implements ITableDataProvider<T, S> {
10
+ protected _getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
11
+ constructor(modelType: ClassType<T>, serviceType?: Type<S>);
12
+ get getAll(): (queryParam: MediusQueryParam, service?: S | undefined) => Observable<MediusQueryResult<T>>;
13
+ withGetAll(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>): this;
14
+ }