@mediusinc/mng-commons 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/api/utils/medius-rest.util.mjs +8 -3
- package/esm2020/lib/components/action/action.component.mjs +17 -4
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +1 -1
- package/esm2020/lib/components/action/models/action-execution.model.mjs +6 -1
- package/esm2020/lib/components/action/models/index.mjs +2 -1
- package/esm2020/lib/components/action/models/tableview-action-default-categories.model.mjs +11 -0
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +1 -1
- package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +17 -10
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +5 -13
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +5 -2
- package/esm2020/lib/components/tableview/table/table.component.mjs +48 -20
- package/esm2020/lib/components/tableview/tableview.component.mjs +9 -3
- package/esm2020/lib/data-providers/table.data-provider.mjs +9 -2
- package/esm2020/lib/data-providers/tableview.data-provider.mjs +30 -2
- package/esm2020/lib/descriptors/action.descriptor.mjs +11 -1
- package/esm2020/lib/descriptors/column.descriptor.mjs +106 -29
- package/esm2020/lib/descriptors/editor.descriptor.mjs +109 -7
- package/esm2020/lib/descriptors/field.descriptor.mjs +38 -4
- package/esm2020/lib/descriptors/filter.descriptor.mjs +13 -6
- package/esm2020/lib/descriptors/index.mjs +2 -2
- package/esm2020/lib/descriptors/table.descriptor.mjs +282 -16
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +175 -3
- package/esm2020/lib/descriptors/types/table.type.mjs +10 -1
- package/esm2020/lib/mng-commons.module.mjs +5 -1
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/tableview-attr.model.mjs +2 -0
- package/esm2020/lib/pipes/class-map.pipe.mjs +22 -0
- package/esm2020/lib/pipes/index.mjs +2 -1
- package/esm2020/lib/router/models/router.model.mjs +1 -1
- package/esm2020/lib/router/tableview-route-builder.mjs +41 -17
- package/esm2020/lib/services/action-executor.service.mjs +1 -1
- package/esm2020/lib/utils/tableview.util.mjs +144 -0
- package/fesm2015/mediusinc-mng-commons.mjs +1095 -128
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +1077 -117
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/utils/medius-rest.util.d.ts +1 -0
- package/lib/components/action/action.component.d.ts +2 -1
- package/lib/components/action/models/action-execution.model.d.ts +2 -0
- package/lib/components/action/models/index.d.ts +1 -0
- package/lib/components/action/models/tableview-action-default-categories.model.d.ts +10 -0
- package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +9 -4
- package/lib/components/tableview/route/tableview-route.component.d.ts +0 -5
- package/lib/components/tableview/table/table.component.d.ts +4 -2
- package/lib/components/tableview/tableview.component.d.ts +3 -0
- package/lib/data-providers/table.data-provider.d.ts +6 -1
- package/lib/data-providers/tableview.data-provider.d.ts +16 -2
- package/lib/descriptors/action.descriptor.d.ts +4 -0
- package/lib/descriptors/column.descriptor.d.ts +39 -5
- package/lib/descriptors/editor.descriptor.d.ts +69 -11
- package/lib/descriptors/field.descriptor.d.ts +7 -2
- package/lib/descriptors/filter.descriptor.d.ts +7 -6
- package/lib/descriptors/index.d.ts +1 -1
- package/lib/descriptors/table.descriptor.d.ts +124 -8
- package/lib/descriptors/tableview.descriptor.d.ts +81 -7
- package/lib/descriptors/types/table.type.d.ts +8 -0
- package/lib/mng-commons.module.d.ts +72 -71
- package/lib/models/index.d.ts +1 -0
- package/lib/models/tableview-attr.model.d.ts +9 -0
- package/lib/pipes/class-map.pipe.d.ts +7 -0
- package/lib/pipes/index.d.ts +1 -0
- package/lib/router/models/router.model.d.ts +6 -0
- package/lib/router/tableview-route-builder.d.ts +3 -0
- package/lib/utils/tableview.util.d.ts +39 -0
- package/package.json +1 -1
- package/scss/mng-overrides/_theme_tableview.scss +17 -0
- package/version-info.json +5 -5
|
@@ -8,6 +8,7 @@ export declare class MediusRestUtil {
|
|
|
8
8
|
private static readonly matchModeMapping;
|
|
9
9
|
static fromAngularQueryParamsToMediusQueryParams(params: Params, filterDescriptors: Array<FilterDescriptor<any>>, defaultItemsPerPage?: number, defaultOffset?: number): MediusQueryParam;
|
|
10
10
|
static fromPrimeLazyLoadEventToAngularQueryParams(event: LazyLoadEvent, defaultItemsPerPage?: number, defaultOffset?: number): Params;
|
|
11
|
+
static modifyFilterProperties(mediusQueryParams: MediusQueryParam, filterDescriptors: Array<FilterDescriptor<any>>): void;
|
|
11
12
|
static fromPrimeLazyLoadEventToMediusQueryParams(event: LazyLoadEvent): MediusQueryParam;
|
|
12
13
|
static addMediusFilterFromPrimeFilterMetadata(queryParamBuilder: MediusQueryParamBuilder, property: string, filterMetadata: FilterMetadata): void;
|
|
13
14
|
static getMediusFilterMatchTypeFromPrimeMatchMode(matchMode: string, dataType?: FilterTypeEnum): MediusFilterMatchType;
|
|
@@ -30,6 +30,7 @@ export declare class MngActionComponent<T, S> implements OnInit, OnChanges, OnDe
|
|
|
30
30
|
inputDisabled: Observable<boolean>;
|
|
31
31
|
inputLoading: Observable<boolean>;
|
|
32
32
|
viewContainerInit?: IViewContainer<T, S>;
|
|
33
|
+
selectedItems: Array<T>;
|
|
33
34
|
finishEventEmitter: EventEmitter<ActionInstance<T, S>>;
|
|
34
35
|
private loadingSubject;
|
|
35
36
|
$loading: Observable<boolean>;
|
|
@@ -64,5 +65,5 @@ export declare class MngActionComponent<T, S> implements OnInit, OnChanges, OnDe
|
|
|
64
65
|
getConfirmationServiceInstanceKey(action: ActionDescriptor<any>): string;
|
|
65
66
|
private processSubscriptions;
|
|
66
67
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngActionComponent<any, any>, [null, null, null, null, null, { optional: true; }]>;
|
|
67
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngActionComponent<any, any>, "mng-action", never, { "action": "action"; "item": "item"; "itemId": "itemId"; "actionData": "actionData"; "queryParam": "queryParam"; "dataProvider": "dataProvider"; "inputDisabled": "disabled"; "inputLoading": "loading"; "viewContainerInit": "viewContainer"; }, { "finishEventEmitter": "finish"; }, never, never, false>;
|
|
68
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MngActionComponent<any, any>, "mng-action", never, { "action": "action"; "item": "item"; "itemId": "itemId"; "actionData": "actionData"; "queryParam": "queryParam"; "dataProvider": "dataProvider"; "inputDisabled": "disabled"; "inputLoading": "loading"; "viewContainerInit": "viewContainer"; "selectedItems": "selectedItems"; }, { "finishEventEmitter": "finish"; }, never, never, false>;
|
|
68
69
|
}
|
|
@@ -97,12 +97,14 @@ export declare class ActionParameters<T> {
|
|
|
97
97
|
viewContainer?: IViewContainer<T, unknown>;
|
|
98
98
|
sourceComponent?: any;
|
|
99
99
|
route?: ActivatedRoute;
|
|
100
|
+
selectedItems: T[];
|
|
100
101
|
constructor(itemId?: IdType | undefined, item?: T | undefined);
|
|
101
102
|
withActionData(actionData?: ActionData): this;
|
|
102
103
|
withQueryParam(queryParam?: MediusQueryParam): this;
|
|
103
104
|
withViewContainer<S>(viewContainer?: IViewContainer<T, S>): this;
|
|
104
105
|
withSourceComponent(sourceComponent?: any): this;
|
|
105
106
|
withRoute(route?: ActivatedRoute): this;
|
|
107
|
+
withSelectedItems(selectedItems: T[]): this;
|
|
106
108
|
}
|
|
107
109
|
export declare enum ActionInstanceStateEnum {
|
|
108
110
|
TriggerStart = 0,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default categories for tableview actions
|
|
3
|
+
*/
|
|
4
|
+
export declare class TableviewActionDefaultCategories {
|
|
5
|
+
static readonly READ = "read";
|
|
6
|
+
static readonly ADD = "add";
|
|
7
|
+
static readonly EDIT = "edit";
|
|
8
|
+
static readonly DELETE = "delete";
|
|
9
|
+
static readonly DETAILS = "details";
|
|
10
|
+
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute } from '@angular/router';
|
|
2
3
|
import { ITableviewDataProvider } from '../../../data-providers';
|
|
3
4
|
import { ActionDeleteDescriptor, ActionDescriptor, ActionEditorAddDescriptor, ActionEditorDetailsDescriptor, ActionEditorEditDescriptor, EditorDescriptor, ModelDescriptor, TableviewDescriptor } from '../../../descriptors';
|
|
5
|
+
import { MngRouterData } from '../../../router/models';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
7
|
export declare abstract class AMngTableviewRouteComponent<T, S> implements OnInit {
|
|
6
8
|
descriptor: TableviewDescriptor<T>;
|
|
7
9
|
dataProvider: ITableviewDataProvider<T, S>;
|
|
8
10
|
actions: Array<ActionDescriptor<T>>;
|
|
11
|
+
protected route: ActivatedRoute;
|
|
12
|
+
constructor();
|
|
13
|
+
protected get routeData(): MngRouterData;
|
|
9
14
|
ngOnInit(): void;
|
|
10
15
|
protected abstract createTableviewDescriptor(): TableviewDescriptor<T>;
|
|
11
16
|
protected abstract createTableviewDataProvider(): ITableviewDataProvider<T, S>;
|
|
12
17
|
protected createActionDescriptors(): Array<ActionDescriptor<T>>;
|
|
13
|
-
protected createActionDescriptorForDetails(descriptor?: EditorDescriptor<T>): ActionEditorDetailsDescriptor<T
|
|
14
|
-
protected createActionDescriptorForAdd(descriptor?: EditorDescriptor<T>): ActionEditorAddDescriptor<T
|
|
15
|
-
protected createActionDescriptorForEdit(descriptor?: EditorDescriptor<T>): ActionEditorEditDescriptor<T
|
|
16
|
-
protected createActionDescriptorForDelete(descriptor?: ModelDescriptor<T>): ActionDeleteDescriptor<T
|
|
18
|
+
protected createActionDescriptorForDetails(descriptor?: EditorDescriptor<T>): ActionEditorDetailsDescriptor<T> | null;
|
|
19
|
+
protected createActionDescriptorForAdd(descriptor?: EditorDescriptor<T>): ActionEditorAddDescriptor<T> | null;
|
|
20
|
+
protected createActionDescriptorForEdit(descriptor?: EditorDescriptor<T>): ActionEditorEditDescriptor<T> | null;
|
|
21
|
+
protected createActionDescriptorForDelete(descriptor?: ModelDescriptor<T>): ActionDeleteDescriptor<T> | null;
|
|
17
22
|
protected createActionDescriptorForExport(descriptor?: ModelDescriptor<T>): ActionDescriptor<T>;
|
|
18
23
|
protected createActionDescriptorForRefresh(descriptor?: ModelDescriptor<T>): ActionDescriptor<T>;
|
|
19
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<AMngTableviewRouteComponent<any, any>, never>;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
-
import { ActivatedRoute } from '@angular/router';
|
|
3
2
|
import { ITableviewDataProvider } from '../../../data-providers';
|
|
4
3
|
import { ActionDescriptor, TableviewDescriptor } from '../../../descriptors';
|
|
5
|
-
import { MngRouterData } from '../../../router/models';
|
|
6
4
|
import { MngTableviewComponent } from '../tableview.component';
|
|
7
5
|
import { AMngTableviewRouteComponent } from './tableview-route.abstract.component';
|
|
8
6
|
import * as i0 from "@angular/core";
|
|
9
7
|
export declare class MngTableviewRouteComponent<T, S> extends AMngTableviewRouteComponent<T, S> implements OnInit {
|
|
10
|
-
private route;
|
|
11
8
|
descriptorInit?: TableviewDescriptor<T>;
|
|
12
9
|
dataProviderInit?: ITableviewDataProvider<T, S>;
|
|
13
10
|
actionsInit?: Array<ActionDescriptor<T>>;
|
|
14
11
|
tableviewComponent?: MngTableviewComponent<T, S>;
|
|
15
|
-
constructor(route: ActivatedRoute);
|
|
16
|
-
get routeData(): MngRouterData;
|
|
17
12
|
protected createTableviewDescriptor(): TableviewDescriptor<T>;
|
|
18
13
|
protected createTableviewDataProvider(): ITableviewDataProvider<T, S>;
|
|
19
14
|
protected createActionDescriptors(): Array<ActionDescriptor<T>>;
|
|
@@ -23,7 +23,8 @@ export declare class MngTableComponent<T, S> implements OnInit, OnChanges, After
|
|
|
23
23
|
private viewContainerService;
|
|
24
24
|
readonly filterDisplayRow: TableFilterDisplayEnum;
|
|
25
25
|
readonly filterDisplayMenu: TableFilterDisplayEnum;
|
|
26
|
-
|
|
26
|
+
initialDescriptor: TableDescriptor<T>;
|
|
27
|
+
descriptor?: TableDescriptor<T>;
|
|
27
28
|
items?: Observable<Array<T>> | Array<T>;
|
|
28
29
|
queryResult?: Observable<MediusQueryResult<T>> | MediusQueryResult<T>;
|
|
29
30
|
loading?: Observable<boolean> | boolean;
|
|
@@ -75,6 +76,7 @@ export declare class MngTableComponent<T, S> implements OnInit, OnChanges, After
|
|
|
75
76
|
private dataProviderLatestQueryParam?;
|
|
76
77
|
private dataProviderLatestQueryParamVersion;
|
|
77
78
|
private dataProviderSubscription?;
|
|
79
|
+
hasColumnFilters: boolean;
|
|
78
80
|
private isFilterChanged;
|
|
79
81
|
private isSortChanged;
|
|
80
82
|
private filterDescriptors;
|
|
@@ -104,5 +106,5 @@ export declare class MngTableComponent<T, S> implements OnInit, OnChanges, After
|
|
|
104
106
|
private createSortMeta;
|
|
105
107
|
private initializeDataLoadingTriggers;
|
|
106
108
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableComponent<any, any>, [null, null, null, null, null, { optional: true; }]>;
|
|
107
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableComponent<any, any>, "mng-table", never, { "
|
|
109
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableComponent<any, any>, "mng-table", never, { "initialDescriptor": "descriptor"; "items": "items"; "queryResult": "queryResult"; "loading": "loading"; "dataProvider": "dataProvider"; "useQueryParams": "useQueryParams"; "selectionMode": "selectionMode"; "selectionEnabled": "selectionEnabled"; "actions": "actions"; "isColumnClickable": "isColumnClickable"; "viewContainerInit": "viewContainer"; "captionComponent": "captionComponent"; "columnActionComponent": "columnActionComponent"; "columnActionMinWidth": "columnActionMinWidth"; }, { "loadEventEmitter": "tableLoad"; "cellClickEventEmitter": "cellClick"; "selectionChangeEventEmitter": "selectionChange"; "captionCmpInstEventEmitter": "captionComponentInstance"; "columnActionCmpInstEventEmitter": "columnActionComponentInstance"; }, ["templates"], never, false>;
|
|
108
110
|
}
|
|
@@ -29,6 +29,8 @@ export declare class MngTableviewComponent<T, S> implements OnInit, OnDestroy, I
|
|
|
29
29
|
toolbarRightActions: ActionDescriptor<T>[];
|
|
30
30
|
tableQueryParam?: MediusQueryParam;
|
|
31
31
|
private subscriptions;
|
|
32
|
+
hasItemSelectionAction: boolean;
|
|
33
|
+
selectedItems: T[];
|
|
32
34
|
constructor(route: ActivatedRoute, messageService: MessageService, translateService: TranslateService, dialogService: DialogService, confirmationService: ConfirmationService, actionExecutor: MngActionExecutorService, viewContainerService: MngViewContainerComponentService<T, S>);
|
|
33
35
|
ngOnInit(): void;
|
|
34
36
|
ngOnDestroy(): void;
|
|
@@ -36,6 +38,7 @@ export declare class MngTableviewComponent<T, S> implements OnInit, OnDestroy, I
|
|
|
36
38
|
getDataProvider(): IDataProvider<T, S> | undefined;
|
|
37
39
|
reloadTable(): void;
|
|
38
40
|
onTableLoad(event: MngTableLoadEvent): void;
|
|
41
|
+
selectionChange(selectedItems: Array<T>): void;
|
|
39
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableviewComponent<any, any>, never>;
|
|
40
43
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableviewComponent<any, any>, "mng-tableview", never, { "descriptor": "descriptor"; "dataProvider": "dataProvider"; "actions": "actions"; }, {}, never, never, false>;
|
|
41
44
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
3
|
import { MediusQueryParam, MediusQueryResult } from '../api/models';
|
|
4
4
|
import { ClassType } from '../types';
|
|
5
5
|
import { DataProvider, IDataProvider } from './base.data-provider';
|
|
6
6
|
export interface ITableDataProvider<T, S> extends IDataProvider<T, S> {
|
|
7
7
|
getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
|
|
8
|
+
getAllReload(queryParam?: MediusQueryParam): void;
|
|
9
|
+
getAllReload$: Observable<MediusQueryParam | undefined>;
|
|
8
10
|
}
|
|
9
11
|
export declare class TableDataProvider<T, S> extends DataProvider<T, S> implements ITableDataProvider<T, S> {
|
|
10
12
|
protected _getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
|
|
13
|
+
protected _getAllReloadSubject: Subject<MediusQueryParam | undefined>;
|
|
11
14
|
constructor(modelType: ClassType<T>, serviceType?: Type<S>);
|
|
12
15
|
get getAll(): (queryParam: MediusQueryParam, service?: S | undefined) => Observable<MediusQueryResult<T>>;
|
|
16
|
+
get getAllReload$(): Observable<MediusQueryParam | undefined>;
|
|
13
17
|
withGetAll(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>): this;
|
|
18
|
+
getAllReload(queryParam?: MediusQueryParam): void;
|
|
14
19
|
}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
3
|
import { MediusQueryParam, MediusQueryResult } from '../api/models';
|
|
4
|
-
import { ClassType } from '../types';
|
|
4
|
+
import { ClassType, IdType } from '../types';
|
|
5
5
|
import { EditorDataProvider, IEditorDataProvider } from './editor.data-provider';
|
|
6
6
|
import { ITableDataProvider } from './table.data-provider';
|
|
7
7
|
export interface ITableviewDataProvider<T, S> extends IEditorDataProvider<T, S> {
|
|
8
8
|
getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
|
|
9
|
+
getAllReload(queryParam?: MediusQueryParam): void;
|
|
10
|
+
getAllReload$: Observable<MediusQueryParam | undefined>;
|
|
9
11
|
}
|
|
10
12
|
export declare class TableviewDataProvider<T, S> extends EditorDataProvider<T, S> implements ITableviewDataProvider<T, S>, ITableDataProvider<T, S>, IEditorDataProvider<T, S> {
|
|
11
13
|
protected _getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>;
|
|
14
|
+
protected _getAllReloadSubject: Subject<MediusQueryParam | undefined>;
|
|
12
15
|
constructor(modelType: ClassType<T>, serviceType?: Type<S>);
|
|
13
16
|
get getAll(): (queryParam: MediusQueryParam, service?: S | undefined) => Observable<MediusQueryResult<T>>;
|
|
17
|
+
get getAllReload$(): Observable<MediusQueryParam | undefined>;
|
|
14
18
|
withGetAll(getAll: (queryParam: MediusQueryParam, service?: S) => Observable<MediusQueryResult<T>>): this;
|
|
19
|
+
getAllReload(queryParam?: MediusQueryParam): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class DynamicTableviewDataProvider extends TableviewDataProvider<any, any> implements ITableviewDataProvider<any, any>, ITableDataProvider<any, any> {
|
|
22
|
+
protected _getAll: (queryParam: MediusQueryParam) => Observable<MediusQueryResult<any>>;
|
|
23
|
+
protected _fetch: (id: IdType) => Observable<any>;
|
|
24
|
+
constructor();
|
|
25
|
+
withGetAll(getAll: (queryParam: MediusQueryParam) => Observable<MediusQueryResult<any>>): this;
|
|
26
|
+
withFetch(fetch: (id: IdType) => Observable<any>): this;
|
|
27
|
+
get getAll(): (queryParam: MediusQueryParam) => Observable<MediusQueryResult<any>>;
|
|
28
|
+
get fetch(): (id: IdType) => Observable<any>;
|
|
15
29
|
}
|
|
@@ -20,6 +20,7 @@ export declare class ActionDescriptor<T> {
|
|
|
20
20
|
protected _activationTrigger: ActionActivationTriggerEnum;
|
|
21
21
|
protected _position: ActionPositionEnum;
|
|
22
22
|
protected _level: ActionLevelEnum;
|
|
23
|
+
protected _tableviewActionCategory?: string;
|
|
23
24
|
protected _routeUrl: string | null;
|
|
24
25
|
protected _dataProvider?: IDataProvider<T, any>;
|
|
25
26
|
protected _runFunction?: (ctx: ActionContext<T, any>) => Observable<T | undefined | null>;
|
|
@@ -37,6 +38,7 @@ export declare class ActionDescriptor<T> {
|
|
|
37
38
|
protected _permissions?: APermissions;
|
|
38
39
|
protected _permissionsRouteType?: string;
|
|
39
40
|
protected _buttonDescriptor: ButtonDescriptor;
|
|
41
|
+
protected _hasItemsSelection: boolean;
|
|
40
42
|
constructor(model: ModelDescriptor<T> | null, actionName: string, parentType?: ClassType<any>, parentProperty?: string);
|
|
41
43
|
get model(): ModelDescriptor<T> | null;
|
|
42
44
|
get parentTypeName(): string | undefined;
|
|
@@ -67,6 +69,7 @@ export declare class ActionDescriptor<T> {
|
|
|
67
69
|
get onRunErrorAction(): ActionDescriptor<unknown> | undefined;
|
|
68
70
|
get permissions(): APermissions | undefined;
|
|
69
71
|
get permissionsRouteType(): string | undefined;
|
|
72
|
+
get hasItemsSelection(): boolean;
|
|
70
73
|
get buttonDescriptor(): ButtonDescriptor;
|
|
71
74
|
withDataProvider(dataProvider: IDataProvider<T, any>): this;
|
|
72
75
|
withServiceType<S>(serviceType: Type<S>): this;
|
|
@@ -91,6 +94,7 @@ export declare class ActionDescriptor<T> {
|
|
|
91
94
|
withPermissions(permissions: APermissions): this;
|
|
92
95
|
withPermissionsRouteType(permissionsRouteType: string): this;
|
|
93
96
|
withButtonDescriptor(buttonDescriptor: ButtonDescriptor): this;
|
|
97
|
+
withItemsSelection(hasSelection?: boolean): this;
|
|
94
98
|
}
|
|
95
99
|
export declare class ActionSimpleDescriptor<T> extends ActionDescriptor<T> {
|
|
96
100
|
constructor(actionName: string, modelType?: ClassType<T>, idProperty?: string, titleProperty?: string);
|
|
@@ -2,13 +2,13 @@ import { Type } from '@angular/core';
|
|
|
2
2
|
import { IColumnValueComponent } from '../models';
|
|
3
3
|
import { ClassType, EnumConstantType, EnumType } from '../types';
|
|
4
4
|
import { FilterDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor } from './filter.descriptor';
|
|
5
|
-
import { TableDescriptor } from './table.descriptor';
|
|
5
|
+
import { TableDescriptor, TableDynamicDescriptor } from './table.descriptor';
|
|
6
6
|
import { ColumnTypeEnum } from './types';
|
|
7
7
|
export declare class ColumnDescriptor<T, TT> {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
protected readonly _table: TableDescriptor<TT>;
|
|
9
|
+
protected readonly _property: string;
|
|
10
10
|
private _columnType;
|
|
11
|
-
|
|
11
|
+
protected _title?: string;
|
|
12
12
|
private _jsonPath?;
|
|
13
13
|
private _isSortEnabled;
|
|
14
14
|
private _filterDescriptor?;
|
|
@@ -64,7 +64,12 @@ export declare class ColumnDescriptor<T, TT> {
|
|
|
64
64
|
get hasCopyToClipboard(): boolean;
|
|
65
65
|
get template(): string | undefined;
|
|
66
66
|
get getter(): ((item: any) => any) | undefined;
|
|
67
|
-
|
|
67
|
+
/**
|
|
68
|
+
* converts column to given type with additional arguments
|
|
69
|
+
* @param type column type enum
|
|
70
|
+
* @param args any additional arguments for column (optional)
|
|
71
|
+
*/
|
|
72
|
+
asType(type: ColumnTypeEnum, ...args: any[]): this;
|
|
68
73
|
asNumber(displayFormat?: string, locale?: string): this;
|
|
69
74
|
asCurrency(currencyCode?: string, currencyFromProperty?: string, currencyDisplay?: 'symbol' | 'code' | 'name', displayFormat?: string, locale?: string): this;
|
|
70
75
|
asDate(displayFormat?: string): this;
|
|
@@ -85,4 +90,33 @@ export declare class ColumnDescriptor<T, TT> {
|
|
|
85
90
|
withTemplate(template: string): this;
|
|
86
91
|
withGetter(getter?: (item: any) => any): this;
|
|
87
92
|
copy(): ColumnDescriptor<T, TT>;
|
|
93
|
+
protected copyFieldsTo(obj: ColumnDescriptor<T, TT>): void;
|
|
94
|
+
}
|
|
95
|
+
export declare class ColumnDynamicDescriptor extends ColumnDescriptor<any, any> {
|
|
96
|
+
protected _table: TableDynamicDescriptor;
|
|
97
|
+
protected _title: string | undefined;
|
|
98
|
+
private _visibility;
|
|
99
|
+
constructor(table: TableDynamicDescriptor, property: string);
|
|
100
|
+
get visibility(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* sets column's title and returns this column
|
|
103
|
+
* @param title title to be set
|
|
104
|
+
* @param override should column title if all ready set?
|
|
105
|
+
*/
|
|
106
|
+
withTitle(title: string, override?: boolean): this;
|
|
107
|
+
/**
|
|
108
|
+
* defines automatic type and returns this column
|
|
109
|
+
* @param value
|
|
110
|
+
*/
|
|
111
|
+
withAutomaticType(value: string): this;
|
|
112
|
+
/**
|
|
113
|
+
* sets visibility state for column and returns this column
|
|
114
|
+
* @param visibility
|
|
115
|
+
*/
|
|
116
|
+
withVisibility(visibility: boolean): this;
|
|
117
|
+
/**
|
|
118
|
+
* creates deep copy of column dynamic descriptor
|
|
119
|
+
*/
|
|
120
|
+
copy(): ColumnDynamicDescriptor;
|
|
121
|
+
toColumnDescriptor(tableDescriptor: TableDescriptor<any>): ColumnDescriptor<any, any>;
|
|
88
122
|
}
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
+
import { ILookupDataProvider } from '../data-providers';
|
|
2
|
+
import { TableviewAttributeDef } from '../models/tableview-attr.model';
|
|
1
3
|
import { ClassType, EnumConstantType, EnumType, MngFieldValidationMessage, MngFieldValidator } from '../types';
|
|
2
4
|
import { AFieldDescriptor, FieldGroupDescriptor, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, FieldTabGroupDescriptor, ModelDescriptor, TableDescriptor, TableviewDescriptor } from './';
|
|
3
|
-
import { TableviewTypeEnum } from './types';
|
|
5
|
+
import { FieldInputTypeEnum, TableviewTypeEnum } from './types';
|
|
4
6
|
export declare class EditorDescriptor<T> {
|
|
5
7
|
static readonly defaultGroupName = "_default";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
protected readonly _model: ModelDescriptor<T>;
|
|
9
|
+
protected readonly _modelType: ClassType<T>;
|
|
10
|
+
protected readonly _tableviewEditorType: TableviewTypeEnum;
|
|
11
|
+
protected readonly _tabs: Array<FieldTabGroupDescriptor<T>>;
|
|
12
|
+
protected readonly _groups: Array<FieldGroupDescriptor<T>>;
|
|
13
|
+
protected _fields: Array<AFieldDescriptor<any, T>>;
|
|
14
|
+
protected _currentTabGroup?: FieldTabGroupDescriptor<T>;
|
|
15
|
+
protected _currentGroup?: FieldGroupDescriptor<T>;
|
|
16
|
+
protected _disabled: boolean;
|
|
14
17
|
constructor(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableviewEditorType?: TableviewTypeEnum);
|
|
18
|
+
/**
|
|
19
|
+
* auto generated editor descriptor based on openapi definition
|
|
20
|
+
* generates all fields from definition
|
|
21
|
+
* @param modelType class type
|
|
22
|
+
* @param idProperty
|
|
23
|
+
* @param titleProperty
|
|
24
|
+
* @param tableEditorType
|
|
25
|
+
*/
|
|
26
|
+
static from<T>(modelType: ClassType<T>, idProperty?: string, titleProperty?: string, tableEditorType?: TableviewTypeEnum): EditorDescriptor<T>;
|
|
27
|
+
/**
|
|
28
|
+
* auto generated editor descriptor based on openapi definition
|
|
29
|
+
* generates only selected fields
|
|
30
|
+
* @param modelType class type
|
|
31
|
+
* @param attributes list of selected properties to generate fields based on
|
|
32
|
+
* @param idProperty
|
|
33
|
+
* @param titleProperty
|
|
34
|
+
* @param tableEditorType
|
|
35
|
+
*/
|
|
36
|
+
static fromModelWithAttributes<T>(modelType: ClassType<T>, attributes: TableviewAttributeDef[], idProperty?: string, titleProperty?: string, tableEditorType?: TableviewTypeEnum): EditorDescriptor<T>;
|
|
15
37
|
get model(): ModelDescriptor<T>;
|
|
16
38
|
get tabs(): FieldTabGroupDescriptor<T>[];
|
|
17
39
|
get fields(): AFieldDescriptor<any, T>[];
|
|
@@ -21,7 +43,11 @@ export declare class EditorDescriptor<T> {
|
|
|
21
43
|
createFieldGroup(name: string, title?: string | null): FieldGroupDescriptor<T>;
|
|
22
44
|
addFieldDescriptor<FT>(field: AFieldDescriptor<FT, T>): this;
|
|
23
45
|
addField(property: string): FieldInputDescriptor<T>;
|
|
24
|
-
|
|
46
|
+
/**
|
|
47
|
+
* removes filed if exists in descriptor
|
|
48
|
+
* @param property field name
|
|
49
|
+
*/
|
|
50
|
+
removeField(property: string): void;
|
|
25
51
|
getField(property: string): AFieldDescriptor<any, T> | null;
|
|
26
52
|
addFieldLookup<FT>(property: string, modelType: ClassType<FT>): FieldLookupDescriptor<FT, T>;
|
|
27
53
|
addFieldLookupEnum(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null): FieldLookupEnumDescriptor<T>;
|
|
@@ -31,7 +57,39 @@ export declare class EditorDescriptor<T> {
|
|
|
31
57
|
addValidation(name: string, validator?: MngFieldValidator, message?: MngFieldValidationMessage): void;
|
|
32
58
|
copy(): EditorDescriptor<T>;
|
|
33
59
|
createFieldGroupDescriptor(fieldGroup: FieldGroupDescriptor<T>): this;
|
|
34
|
-
|
|
60
|
+
protected createTabGroupDescriptor(tabGroup: FieldTabGroupDescriptor<T>): this;
|
|
35
61
|
private createDefaultGroup;
|
|
36
62
|
private createDefaultTabGroup;
|
|
63
|
+
/**
|
|
64
|
+
* modifies selected field
|
|
65
|
+
* do not use it for enums! (use withFieldModifiedEnum instead)
|
|
66
|
+
* @param property field name
|
|
67
|
+
* @param fieldType new field type for selected field
|
|
68
|
+
* @param args additional parameters for field
|
|
69
|
+
*/
|
|
70
|
+
withFieldModifiedType(property: string, fieldType: FieldInputTypeEnum, ...args: any[]): this;
|
|
71
|
+
/**
|
|
72
|
+
* modifies selected field with enum type
|
|
73
|
+
* @param property field property name
|
|
74
|
+
* @param enumType type of enum for new field
|
|
75
|
+
* @param optionsTitlePath
|
|
76
|
+
* @param values
|
|
77
|
+
* @param nameAsValue
|
|
78
|
+
*/
|
|
79
|
+
withFieldModifiedEnum(property: string, enumType?: EnumType, optionsTitlePath?: string | null, values?: Array<EnumConstantType>, nameAsValue?: boolean): this;
|
|
80
|
+
/**
|
|
81
|
+
* adds lookup to given field
|
|
82
|
+
* @param property field property name
|
|
83
|
+
* @param modelType model type of field
|
|
84
|
+
* @param lookupProvider provider to be added to field
|
|
85
|
+
* @param titleProperty
|
|
86
|
+
*/
|
|
87
|
+
withFieldModifiedLookup<MT>(property: string, modelType: ClassType<MT>, lookupProvider: ILookupDataProvider<any, any>, titleProperty?: string): this;
|
|
88
|
+
/**
|
|
89
|
+
* generates field based on attribute definition, used for auto model
|
|
90
|
+
* @param attribute definition
|
|
91
|
+
* @param field optional, if defined will be replaced, otherwise new will be generated
|
|
92
|
+
* @param args additional arguments
|
|
93
|
+
*/
|
|
94
|
+
private upsertFieldFromAttributeDef;
|
|
37
95
|
}
|
|
@@ -20,7 +20,6 @@ export declare abstract class AGenericFieldDescriptor<ET> {
|
|
|
20
20
|
}
|
|
21
21
|
export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescriptor<ET> {
|
|
22
22
|
protected readonly _property: string;
|
|
23
|
-
protected _group?: AFieldGroupDescriptor<ET>;
|
|
24
23
|
protected _label?: string | null;
|
|
25
24
|
protected _placeholder?: string;
|
|
26
25
|
protected _helpText?: string;
|
|
@@ -43,7 +42,6 @@ export declare abstract class AFieldDescriptor<T, ET> extends AGenericFieldDescr
|
|
|
43
42
|
protected readonly _eventsSubject: Subject<MngFormFieldEvent<T, ET>>;
|
|
44
43
|
protected constructor(editor: EditorDescriptor<ET>, property: string);
|
|
45
44
|
get property(): string;
|
|
46
|
-
get group(): AFieldGroupDescriptor<ET> | undefined;
|
|
47
45
|
get label(): string | null | undefined;
|
|
48
46
|
get placeholder(): string | undefined;
|
|
49
47
|
get helpText(): string | undefined;
|
|
@@ -119,6 +117,12 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
119
117
|
private _fileOnSelectHandler?;
|
|
120
118
|
private _customComponentName?;
|
|
121
119
|
constructor(editor: EditorDescriptor<ET>, property: string);
|
|
120
|
+
/**
|
|
121
|
+
* converts field to given type with additional arguments
|
|
122
|
+
* @param fieldType field type enum
|
|
123
|
+
* @param args any additional arguments for field (optional)
|
|
124
|
+
*/
|
|
125
|
+
asType(fieldType: FieldInputTypeEnum, ...args: any[]): this;
|
|
122
126
|
get fieldType(): FieldInputTypeEnum;
|
|
123
127
|
get rows(): number | undefined;
|
|
124
128
|
get numberMin(): number | undefined;
|
|
@@ -269,6 +273,7 @@ export declare abstract class AFieldGroupDescriptor<ET> extends AGenericFieldDes
|
|
|
269
273
|
protected _fields: AGenericFieldDescriptor<ET>[];
|
|
270
274
|
protected _validations: Array<FieldValidationDescriptor>;
|
|
271
275
|
protected constructor(editor: EditorDescriptor<ET>, name: string);
|
|
276
|
+
removeField(property: string, filterFunction: (fields: AGenericFieldDescriptor<ET>[]) => AGenericFieldDescriptor<ET>[]): AGenericFieldDescriptor<ET>[];
|
|
272
277
|
get title(): string | undefined;
|
|
273
278
|
abstract get fields(): AGenericFieldDescriptor<ET>[];
|
|
274
279
|
get validations(): FieldValidationDescriptor[];
|
|
@@ -10,10 +10,10 @@ export declare class FilterDescriptor<T> {
|
|
|
10
10
|
protected readonly _property: string;
|
|
11
11
|
protected _filterType: FilterTypeEnum;
|
|
12
12
|
protected _filterProperty?: string;
|
|
13
|
-
|
|
14
|
-
protected _defaultFilterMatchMode
|
|
15
|
-
protected _defaultValue?: string;
|
|
16
|
-
|
|
13
|
+
protected _hasDefaultValue: boolean;
|
|
14
|
+
protected _defaultFilterMatchMode?: FilterMatchModeEnum;
|
|
15
|
+
protected _defaultValue?: string | string[];
|
|
16
|
+
protected _defaultValueTo?: string;
|
|
17
17
|
protected _matchModes: string[] | null;
|
|
18
18
|
protected _numberMinFractionDigits?: number;
|
|
19
19
|
protected _numberMaxFractionDigits?: number;
|
|
@@ -28,9 +28,9 @@ export declare class FilterDescriptor<T> {
|
|
|
28
28
|
constructor(property: string);
|
|
29
29
|
get filterType(): FilterTypeEnum;
|
|
30
30
|
get hasDefaultValue(): boolean;
|
|
31
|
-
get defaultValue(): string | undefined;
|
|
31
|
+
get defaultValue(): string | string[] | undefined;
|
|
32
32
|
get defaultValueTo(): string | undefined;
|
|
33
|
-
get defaultFilterMatchMode(): FilterMatchModeEnum;
|
|
33
|
+
get defaultFilterMatchMode(): FilterMatchModeEnum | undefined;
|
|
34
34
|
get filterProperty(): string | undefined;
|
|
35
35
|
get matchModes(): string[] | null;
|
|
36
36
|
get numberMinFractionDigits(): number | undefined;
|
|
@@ -93,6 +93,7 @@ export declare class FilterLookupDescriptor<T> extends FilterDescriptor<T> imple
|
|
|
93
93
|
withLookupDataProvider(dataProvider: ILookupDataProvider<T, any>): this;
|
|
94
94
|
withMultiselect(multiselect?: boolean): this;
|
|
95
95
|
withDropdownClassName(dropdownClassName: string): this;
|
|
96
|
+
withDefaultFilter(filterValue: string | string[], filterValueTo?: string, filterMatchMode?: FilterMatchModeEnum): this;
|
|
96
97
|
asAutocomplete(openOnFocus?: boolean, inlineSearch?: boolean): this;
|
|
97
98
|
copy(): FilterLookupDescriptor<T>;
|
|
98
99
|
protected copyFieldsTo(filter: FilterLookupDescriptor<T>): void;
|
|
@@ -7,5 +7,5 @@ export * from './filter.descriptor';
|
|
|
7
7
|
export * from './model.descriptor';
|
|
8
8
|
export * from './table.descriptor';
|
|
9
9
|
export * from './tableview.descriptor';
|
|
10
|
-
export * from './action/action-confirmation.descriptor';
|
|
11
10
|
export * from './button.descriptor';
|
|
11
|
+
export * from './action/action-confirmation.descriptor';
|