@mediusinc/mng-commons 0.2.18 → 0.2.21

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 (98) hide show
  1. package/assets/i18n/en.json +16 -15
  2. package/assets/i18n/sl.json +23 -22
  3. package/esm2020/lib/api/services/crud-api.abstract.service.mjs +6 -6
  4. package/esm2020/lib/api/utils/object-serializer.util.mjs +7 -2
  5. package/esm2020/lib/components/action/action.component.mjs +50 -23
  6. package/esm2020/lib/components/action/editor/action-editor.component.mjs +239 -0
  7. package/esm2020/lib/components/action/index.mjs +2 -2
  8. package/esm2020/lib/components/action/models/action-execution.model.mjs +3 -3
  9. package/esm2020/lib/components/action/route/action-route.component.mjs +19 -38
  10. package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +5 -3
  11. package/esm2020/lib/components/form/editor/form-editor.component.mjs +2 -2
  12. package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +3 -3
  13. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
  14. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  15. package/esm2020/lib/components/form/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +3 -3
  16. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +61 -21
  17. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +3 -3
  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 +1 -1
  21. package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +2 -2
  22. package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +1 -1
  23. package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +3 -3
  24. package/esm2020/lib/components/tableview/table/table.component.mjs +13 -9
  25. package/esm2020/lib/components/tableview/tableview.component.mjs +28 -21
  26. package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
  27. package/esm2020/lib/data-providers/table.data-provider.mjs +1 -1
  28. package/esm2020/lib/descriptors/action.descriptor.mjs +151 -2
  29. package/esm2020/lib/descriptors/editor.descriptor.mjs +118 -24
  30. package/esm2020/lib/descriptors/table.descriptor.mjs +21 -4
  31. package/esm2020/lib/descriptors/tableview.descriptor.mjs +7 -6
  32. package/esm2020/lib/mng-commons.module.mjs +17 -10
  33. package/esm2020/lib/models/enum.model.mjs +1 -1
  34. package/esm2020/lib/models/error.model.mjs +2 -0
  35. package/esm2020/lib/models/index.mjs +3 -1
  36. package/esm2020/lib/models/view-container.model.mjs +2 -0
  37. package/esm2020/lib/pipes/boolean.pipe.mjs +8 -3
  38. package/esm2020/lib/services/action-executor.service.mjs +344 -0
  39. package/esm2020/lib/services/error-mapper.service.mjs +14 -0
  40. package/esm2020/lib/services/index.mjs +4 -2
  41. package/esm2020/lib/services/tokens/default-setting.token.mjs +3 -0
  42. package/esm2020/lib/services/tokens/index.mjs +2 -1
  43. package/esm2020/lib/services/view-container.component.service.mjs +35 -0
  44. package/esm2020/lib/utils/i18n.util.mjs +29 -1
  45. package/esm2020/lib/utils/model.util.mjs +9 -7
  46. package/esm2020/lib/utils/toast.util.mjs +18 -14
  47. package/esm2020/public-api.mjs +1 -2
  48. package/fesm2015/mediusinc-mng-commons.mjs +1384 -814
  49. package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
  50. package/fesm2020/mediusinc-mng-commons.mjs +1367 -809
  51. package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
  52. package/lib/components/action/action.component.d.ts +16 -9
  53. package/lib/components/action/editor/action-editor.component.d.ts +59 -0
  54. package/lib/components/action/index.d.ts +1 -1
  55. package/lib/components/action/models/action-execution.model.d.ts +3 -3
  56. package/lib/components/action/route/action-route.component.d.ts +5 -6
  57. package/lib/components/form/dropdown/dropdown.component.d.ts +2 -1
  58. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +8 -2
  59. package/lib/components/tableview/table/table.component.d.ts +5 -4
  60. package/lib/components/tableview/tableview.component.d.ts +9 -7
  61. package/lib/descriptors/action.descriptor.d.ts +72 -16
  62. package/lib/descriptors/editor.descriptor.d.ts +52 -12
  63. package/lib/descriptors/table.descriptor.d.ts +8 -2
  64. package/lib/descriptors/tableview.descriptor.d.ts +1 -1
  65. package/lib/mng-commons.module.d.ts +2 -2
  66. package/lib/models/enum.model.d.ts +1 -0
  67. package/lib/models/error.model.d.ts +12 -0
  68. package/lib/models/index.d.ts +2 -0
  69. package/lib/models/view-container.model.d.ts +6 -0
  70. package/lib/pipes/boolean.pipe.d.ts +1 -1
  71. package/lib/services/{action.service.d.ts → action-executor.service.d.ts} +27 -19
  72. package/lib/services/error-mapper.service.d.ts +7 -0
  73. package/lib/services/index.d.ts +3 -1
  74. package/lib/services/tokens/default-setting.token.d.ts +2 -0
  75. package/lib/services/tokens/index.d.ts +1 -0
  76. package/lib/services/view-container.component.service.d.ts +22 -0
  77. package/lib/utils/i18n.util.d.ts +3 -0
  78. package/lib/utils/model.util.d.ts +1 -1
  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_dialog.scss +0 -7
  83. package/scss/mng-overrides/_layout_forms.scss +2 -0
  84. package/scss/mng-overrides/_mixins.scss +7 -0
  85. package/scss/mng-overrides/_theme_button.scss +57 -0
  86. package/scss/mng-overrides/_theme_dialog.scss +3 -1
  87. package/scss/mng-overrides/_theme_styles.scss +2 -0
  88. package/scss/mng-overrides/_theme_tableview.scss +10 -10
  89. package/scss/mng-overrides/_theme_toolbar.scss +5 -0
  90. package/scss/theme/default/_mng-variables-theme-dark.scss +3 -0
  91. package/scss/theme/default/_mng-variables-theme-light.scss +3 -0
  92. package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -151
  93. package/esm2020/lib/components/tableview/services/index.mjs +0 -2
  94. package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +0 -21
  95. package/esm2020/lib/services/action.service.mjs +0 -273
  96. package/lib/components/action/dialog/action-dialog.component.d.ts +0 -47
  97. package/lib/components/tableview/services/index.d.ts +0 -1
  98. package/lib/components/tableview/services/tableview.component.service.d.ts +0 -14
@@ -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
  }
@@ -11,6 +11,7 @@ export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlV
11
11
  dataKeyProperty?: string;
12
12
  itemsLabelProperty?: string;
13
13
  itemsValueProperty?: string;
14
+ itemsDisabledProperty?: string;
14
15
  multiselect: boolean;
15
16
  placeholder?: string;
16
17
  showClear: boolean;
@@ -34,5 +35,5 @@ export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlV
34
35
  setDisabledState(isDisabled: boolean): void;
35
36
  writeValue(obj: any): void;
36
37
  static ɵfac: i0.ɵɵFactoryDeclaration<MngDropdownComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<MngDropdownComponent, "mng-dropdown", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsLabelProperty": "itemsLabelProperty"; "itemsValueProperty": "itemsValueProperty"; "multiselect": "multiselect"; "placeholder": "placeholder"; "showClear": "showClear"; "selectFirstItem": "selectFirstItem"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<MngDropdownComponent, "mng-dropdown", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsLabelProperty": "itemsLabelProperty"; "itemsValueProperty": "itemsValueProperty"; "itemsDisabledProperty": "itemsDisabledProperty"; "multiselect": "multiselect"; "placeholder": "placeholder"; "showClear": "showClear"; "selectFirstItem": "selectFirstItem"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never>;
38
39
  }
@@ -2,18 +2,24 @@ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { FieldType } from '@ngx-formly/core';
3
3
  import { Observable, Subject } from 'rxjs';
4
4
  import { ActionDescriptor, FieldManyEditorDescriptor } from '../../../../../descriptors';
5
+ import { MngActionExecutorService } from '../../../../../services';
6
+ import { MngTableCellClickEvent } from '../../../../tableview/models';
5
7
  import * as i0 from "@angular/core";
6
8
  export declare class MngFormlyFieldTableDialogFormComponent<T, ET> extends FieldType implements OnInit, OnDestroy {
9
+ private actionExecutor;
7
10
  descriptor: FieldManyEditorDescriptor<T, ET>;
8
11
  itemsSubject: Subject<Array<T>>;
9
12
  items$: Observable<Array<T>>;
10
- toolbarActions: Array<ActionDescriptor<T>>;
11
- rowActions: Array<ActionDescriptor<T>>;
13
+ toolbarRightActions: Array<ActionDescriptor<T>>;
14
+ rowClickActions: Array<ActionDescriptor<T>>;
15
+ rowInlineActions: Array<ActionDescriptor<T>>;
12
16
  private subscriptions;
13
17
  private isDisabledSubject;
14
18
  private isEnabled$;
19
+ constructor(actionExecutor: MngActionExecutorService);
15
20
  ngOnInit(): void;
16
21
  ngOnDestroy(): void;
22
+ onTableCellClick(event: MngTableCellClickEvent<T>): void;
17
23
  static ɵfac: i0.ɵɵFactoryDeclaration<MngFormlyFieldTableDialogFormComponent<any, any>, never>;
18
24
  static ɵcmp: i0.ɵɵComponentDeclaration<MngFormlyFieldTableDialogFormComponent<any, any>, "mng-formly-table-dialog-form-field", never, {}, {}, never, never>;
19
25
  }
@@ -9,15 +9,15 @@ import { MediusQueryResult } from '../../../api/models';
9
9
  import { ITableDataProvider } from '../../../data-providers';
10
10
  import { ColumnDescriptor, TableDescriptor } from '../../../descriptors';
11
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>;
@@ -28,6 +28,7 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
28
28
  useQueryParams: boolean;
29
29
  selectionMode: string;
30
30
  selectionEnabled: boolean;
31
+ isColumnClickable: boolean;
31
32
  captionComponent?: Type<any>;
32
33
  columnActionComponent?: Type<any>;
33
34
  loadEventEmitter: EventEmitter<MngTableLoadEvent>;
@@ -68,7 +69,7 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
68
69
  private isSortChanged;
69
70
  private filterDescriptors;
70
71
  private subscriptions;
71
- constructor(injector: Injector, router: Router, activatedRoute: ActivatedRoute, translate: TranslateService, tableviewService: TableviewComponentService<T, S>);
72
+ constructor(injector: Injector, router: Router, activatedRoute: ActivatedRoute, translate: TranslateService, viewContainerService: MngViewContainerComponentService<T, S> | null);
72
73
  ngOnInit(): void;
73
74
  ngAfterContentInit(): void;
74
75
  ngOnDestroy(): void;
@@ -85,5 +86,5 @@ export declare class MngTableComponent<T, S> implements OnInit, AfterContentInit
85
86
  private updatePrimeSortAndFilter;
86
87
  private getDefaultSortMeta;
87
88
  static ɵfac: i0.ɵɵFactoryDeclaration<MngTableComponent<any, any>, [null, null, null, null, { optional: true; }]>;
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>;
89
+ 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"; "isColumnClickable": "isColumnClickable"; "captionComponent": "captionComponent"; "columnActionComponent": "columnActionComponent"; }, { "loadEventEmitter": "tableLoad"; "cellClickEventEmitter": "cellClick"; "selectionChangeEventEmitter": "selectionChange"; "captionCmpInstEventEmitter": "captionComponentInstance"; "columnActionCmpInstEventEmitter": "columnActionComponentInstance"; }, ["templates"], never>;
89
90
  }
@@ -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,7 +1,8 @@
1
+ import { Type } from '@angular/core';
1
2
  import { Observable } from 'rxjs';
2
3
  import { ActionExecContext } from '../components/action/models';
3
4
  import { IDataProvider, IEditorDataProvider } from '../data-providers';
4
- import { ClassType } from '../types';
5
+ import { ClassType, IdType } from '../types';
5
6
  import { EditorDescriptor, ModelDescriptor } from './';
6
7
  export declare class ActionDescriptor<T> {
7
8
  protected readonly _model: ModelDescriptor<T>;
@@ -16,10 +17,12 @@ export declare class ActionDescriptor<T> {
16
17
  protected _level: ActionLevelEnum;
17
18
  protected _routeUrl: string | null;
18
19
  protected _title?: string | null;
19
- protected _icon?: string;
20
+ protected _icon?: string | null;
20
21
  protected _className: string;
22
+ protected _size: ActionDescriptor.SizeEnum;
21
23
  protected _tooltip?: string | null;
22
- protected _runFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T>;
24
+ protected _dataProvider?: IDataProvider<T, any>;
25
+ protected _runFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined>;
23
26
  protected _isVisibleFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>;
24
27
  protected _isEnabledFunction?: (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>;
25
28
  private _hasRunConfirmation;
@@ -45,13 +48,20 @@ export declare class ActionDescriptor<T> {
45
48
  get level(): ActionLevelEnum;
46
49
  get routeUrl(): string | null;
47
50
  get title(): string | null | undefined;
48
- get icon(): string | undefined;
51
+ get icon(): string | null | undefined;
49
52
  get tooltip(): string | null | undefined;
50
- get runFunction(): (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T>;
53
+ get dataProvider(): IDataProvider<T, any> | undefined;
54
+ get hasRunFunction(): boolean;
55
+ get runFunction(): (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T | undefined>;
51
56
  get isVisibleFunction(): ((ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>) | undefined;
52
57
  get isEnabledFunction(): ((ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<boolean>) | undefined;
53
58
  get actionName(): string;
54
59
  get className(): string;
60
+ get size(): ActionDescriptor.SizeEnum;
61
+ get isSizeExtraSmall(): boolean;
62
+ get isSizeSmall(): boolean;
63
+ get isSizeLarge(): boolean;
64
+ get isSizeExtraLarge(): boolean;
55
65
  get hasRunConfirmation(): boolean;
56
66
  get runConfirmationIcon(): string | undefined;
57
67
  get runConfirmationTitle(): string | undefined;
@@ -64,7 +74,9 @@ export declare class ActionDescriptor<T> {
64
74
  get hasRunNotificationError(): boolean;
65
75
  get runNotificationErrorTitle(): string | undefined;
66
76
  get runNotificationErrorMessage(): string | undefined;
67
- withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T>): this;
77
+ withDataProvider(dataProvider: IDataProvider<T, any>): this;
78
+ withServiceType<S>(serviceType: Type<S>): this;
79
+ withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T | undefined>): this;
68
80
  withIsVisibleFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<boolean>): this;
69
81
  withIsEnabledFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<boolean>): this;
70
82
  withRouteTrigger(routeUrl: string): this;
@@ -78,55 +90,98 @@ export declare class ActionDescriptor<T> {
78
90
  * @param title Title i18n key or title.
79
91
  */
80
92
  withTitle(title: string | null): this;
81
- withIcon(icon: string): this;
93
+ withIcon(icon: string | null): this;
82
94
  withTooltip(tooltip: string | null): this;
83
95
  withClassName(className: string): this;
96
+ withSize(size?: ActionDescriptor.SizeEnum): this;
84
97
  withPosition(position: ActionPositionEnum): this;
85
98
  withRunConfirmation(icon?: string, title?: string, message?: string, acceptTitle?: string, rejectTitle?: string): this;
86
99
  withRunNotificationSuccess(title?: string, message?: string, hasNotification?: boolean): void;
87
100
  withRunNotificationError(title?: string, message?: string, hasNotification?: boolean): void;
88
101
  }
102
+ export declare namespace ActionDescriptor {
103
+ enum SizeEnum {
104
+ ExtraSmall = 0,
105
+ Small = 1,
106
+ Normal = 2,
107
+ Large = 3,
108
+ ExtraLarge = 4
109
+ }
110
+ }
89
111
  export declare class ActionEditorDescriptor<T> extends ActionDescriptor<T> {
90
112
  private readonly _editorDescriptor;
91
- protected _editorTitle?: string;
92
- private _hasFetchNotificationSuccess;
93
- private _fetchNotificationSuccessTitle?;
94
- private _fetchNotificationSuccessMessage?;
113
+ protected _editorActions: ActionDescriptor<T>[];
114
+ protected _editorTitle?: string | null;
115
+ protected _hasFetchNotificationSuccess: boolean;
116
+ protected _fetchNotificationSuccessTitle?: string;
117
+ protected _fetchNotificationSuccessMessage?: string;
118
+ protected _dataProvider?: IEditorDataProvider<T, any>;
95
119
  protected _fetchFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
96
120
  protected _submitFunction?: (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
121
+ protected _editorComponent?: Type<any>;
97
122
  constructor(editorDescriptor: EditorDescriptor<T>, actionName: string, parentType?: ClassType<any>, parentProperty?: string);
98
- get editorTitle(): string | undefined;
123
+ get editorTitle(): string | null | undefined;
99
124
  get editorDescriptor(): EditorDescriptor<T>;
100
125
  get hasFetchNotificationSuccess(): boolean;
101
126
  get fetchNotificationSuccessTitle(): string | undefined;
102
127
  get fetchNotificationSuccessMessage(): string | undefined;
128
+ get dataProvider(): IEditorDataProvider<T, any> | undefined;
103
129
  get runFunction(): (ctx: ActionExecContext<T, any, IDataProvider<T, any>>) => Observable<T>;
104
130
  get fetchFunction(): (ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>;
105
131
  get submitFunction(): ((ctx: ActionExecContext<T, any, IEditorDataProvider<T, any>>) => Observable<T>) | undefined;
106
- withEditorTitle(title: string): this;
132
+ get editorActions(): ActionDescriptor<T>[];
133
+ get editorComponent(): Type<any> | undefined;
134
+ withEditorTitle(title: string | null): this;
135
+ withDataProvider(dataProvider: IEditorDataProvider<T, any>): this;
136
+ withServiceType<S>(serviceType: Type<S>): this;
107
137
  withRunFunction<S>(fn: (ctx: ActionExecContext<T, S, IDataProvider<T, S>>) => Observable<T>): this;
108
138
  withFetchFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
109
139
  withSubmitFunction<S>(fn: (ctx: ActionExecContext<T, S, IEditorDataProvider<T, S>>) => Observable<T>): this;
110
- withFetchNotificationError(title?: string, message?: string, hasNotification?: boolean): void;
140
+ withFetchNotificationError(title?: string, message?: string, hasNotification?: boolean): this;
141
+ withEditorAction(action: ActionDescriptor<T>): this;
142
+ withEditorActions(actions: ActionDescriptor<T>[]): this;
143
+ withEditorComponent(editorComponent: Type<any>): this;
144
+ }
145
+ export declare class ActionEditorSubmitDescriptor<T> extends ActionDescriptor<T> {
146
+ private readonly _editorAction;
147
+ private readonly _submitType;
148
+ constructor(editorAction: ActionEditorDescriptor<T>, submitType?: ActionEditorSubmitDescriptor.TypeEnum);
149
+ get submitType(): ActionEditorSubmitDescriptor.TypeEnum;
150
+ }
151
+ export declare namespace ActionEditorSubmitDescriptor {
152
+ enum TypeEnum {
153
+ Submit = 0,
154
+ Cancel = 1
155
+ }
111
156
  }
112
157
  export declare class ActionEditorDetailsDescriptor<T> extends ActionEditorDescriptor<T> {
113
158
  constructor(editorDescriptor: EditorDescriptor<T>);
159
+ withServiceType<S>(serviceType: Type<S>): this;
160
+ withServiceFetchFunction<S>(serviceType: Type<S>, fetchFn?: (id: IdType, service?: S) => Observable<T>): this;
114
161
  }
115
162
  export declare class ActionEditorAddDescriptor<T> extends ActionEditorDescriptor<T> {
116
163
  constructor(editorDescriptor: EditorDescriptor<T>);
164
+ withServiceType<S>(serviceType: Type<S>): this;
165
+ withServiceSubmitFunction<S>(serviceType: Type<S>, createFn?: (item?: T, service?: S) => Observable<T>, fetchFn?: (id: IdType, service?: S) => Observable<T>): this;
117
166
  }
118
167
  export declare class ActionEditorEditDescriptor<T> extends ActionEditorDescriptor<T> {
119
168
  constructor(editorDescriptor: EditorDescriptor<T>);
169
+ withServiceType<S>(serviceType: Type<S>): this;
170
+ withServiceSubmitFunction<S>(serviceType: Type<S>, updateFn?: (id: IdType, item?: T, service?: S) => Observable<T>, fetchFn?: (id: IdType, service?: S) => Observable<T>): this;
120
171
  }
121
172
  export declare class ActionDeleteDescriptor<T> extends ActionDescriptor<T> {
122
173
  constructor(model: ModelDescriptor<T>);
174
+ withServiceType<S>(serviceType: Type<S>): this;
175
+ withServiceDeleteFunction<S>(serviceType: Type<S>, deleteFn?: (id: IdType, item?: T, service?: S) => Observable<T>): this;
123
176
  }
124
177
  export declare enum ActionPositionEnum {
125
178
  ToolbarLeft = 0,
126
179
  ToolbarRight = 1,
127
180
  TableHeader = 2,
128
181
  RowInline = 3,
129
- RowClick = 4
182
+ RowClick = 4,
183
+ FooterLeft = 5,
184
+ FooterRight = 6
130
185
  }
131
186
  export declare enum ActionActivationTriggerEnum {
132
187
  OnClick = 0,
@@ -134,7 +189,8 @@ export declare enum ActionActivationTriggerEnum {
134
189
  }
135
190
  export declare enum ActionTypeEnum {
136
191
  Direct = 0,
137
- Editor = 1
192
+ Event = 1,
193
+ Editor = 2
138
194
  }
139
195
  export declare enum ActionLevelEnum {
140
196
  Default = 0,