@mediusinc/mng-commons 0.2.22 → 0.3.1
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/models/filter-param.model.mjs +1 -2
- package/esm2020/lib/api/models/mappers.mjs +2 -6
- package/esm2020/lib/api/models/query-mode.model.mjs +1 -2
- package/esm2020/lib/api/models/query-param.model.mjs +3 -4
- package/esm2020/lib/api/models/query-result.model.mjs +6 -34
- package/esm2020/lib/api/services/api.abstract.service.mjs +34 -0
- package/esm2020/lib/api/services/crud-api.abstract.service.mjs +15 -32
- package/esm2020/lib/api/services/get-all-api.abstract.service.mjs +23 -0
- package/esm2020/lib/api/services/index.mjs +3 -1
- package/esm2020/lib/components/action/action.component.mjs +2 -2
- package/esm2020/lib/components/action/editor/action-editor.component.mjs +3 -3
- package/esm2020/lib/components/tableview/route/tableview-route.component.mjs +30 -9
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +16 -3
- package/esm2020/lib/config/models/mng-config.model.mjs +1 -1
- package/esm2020/lib/descriptors/editor.descriptor.mjs +11 -12
- package/esm2020/lib/descriptors/table.descriptor.mjs +6 -1
- package/esm2020/lib/descriptors/tableview.descriptor.mjs +5 -5
- package/esm2020/lib/pipes/enum.pipe.mjs +4 -1
- package/esm2020/lib/router/route-builder.mjs +31 -25
- package/esm2020/lib/services/action-executor.service.mjs +5 -4
- package/fesm2015/mediusinc-mng-commons.mjs +172 -119
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +169 -118
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/query-result.model.d.ts +4 -17
- package/lib/api/services/api.abstract.service.d.ts +19 -0
- package/lib/api/services/crud-api.abstract.service.d.ts +3 -11
- package/lib/api/services/get-all-api.abstract.service.d.ts +11 -0
- package/lib/api/services/index.d.ts +2 -0
- package/lib/components/tableview/route/tableview-route.component.d.ts +4 -1
- package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +1 -0
- package/lib/descriptors/editor.descriptor.d.ts +4 -6
- package/lib/descriptors/tableview.descriptor.d.ts +2 -2
- package/lib/router/route-builder.d.ts +2 -0
- package/package.json +1 -1
- /package/{assets/templates → templates}/tableview-route.component.html +0 -0
|
@@ -10,27 +10,14 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import { AttributeDef } from './serialization.model';
|
|
13
|
-
export declare class
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
static discriminator
|
|
17
|
-
static attributeTypeMap: Array<AttributeDef>;
|
|
18
|
-
}
|
|
19
|
-
export declare class MediusQueryResultWithObject extends MediusQueryResultBase {
|
|
20
|
-
'pageData'?: Array<object>;
|
|
21
|
-
static discriminator: string | undefined;
|
|
22
|
-
static attributeTypeMap: Array<AttributeDef>;
|
|
23
|
-
static getAttributeTypeMap(): AttributeDef[];
|
|
24
|
-
}
|
|
25
|
-
export declare class MediusQueryResult<T> extends MediusQueryResultBase implements IMediusQueryResult<T> {
|
|
26
|
-
'pageData'?: Array<T>;
|
|
27
|
-
static discriminator: string | undefined;
|
|
28
|
-
static attributeTypeMapBase: Array<AttributeDef>;
|
|
13
|
+
export declare class MediusQueryResult<T> implements IMediusQueryResult<T> {
|
|
14
|
+
allDataCount?: number;
|
|
15
|
+
pageData?: Array<T>;
|
|
16
|
+
static discriminator?: string;
|
|
29
17
|
static attributeTypeMap: Array<AttributeDef>;
|
|
30
18
|
static getAttributeTypeMap(): AttributeDef[];
|
|
31
19
|
}
|
|
32
20
|
export interface IMediusQueryResult<T> {
|
|
33
|
-
selectInTwoSteps?: boolean;
|
|
34
21
|
allDataCount?: number;
|
|
35
22
|
pageData?: Array<T>;
|
|
36
23
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { ClassType } from '../../types';
|
|
3
|
+
import { MediusQueryParam } from '../models';
|
|
4
|
+
import { ObjectSerializer } from '../utils';
|
|
5
|
+
export declare abstract class AMngApiService<T> {
|
|
6
|
+
protected type: ClassType<T>;
|
|
7
|
+
protected http: HttpClient;
|
|
8
|
+
protected readonly objectSerializer: ObjectSerializer;
|
|
9
|
+
protected constructor(type: ClassType<T>, http: HttpClient);
|
|
10
|
+
protected abstract getBasePath(): string;
|
|
11
|
+
protected abstract getServiceBasePath(): string;
|
|
12
|
+
protected getUrl(...pathSegments: Array<string>): string;
|
|
13
|
+
protected deserialize(item: any): T;
|
|
14
|
+
protected serialize(item: T): any;
|
|
15
|
+
protected serializeQueryParam(queryParam: MediusQueryParam, type?: string): any;
|
|
16
|
+
protected deserializeQueryResult<QR>(item: any, qrType: ClassType<QR>): QR;
|
|
17
|
+
protected deserializeClass<C>(item: any, type: ClassType<C>): C;
|
|
18
|
+
protected serializeClass<C>(item: C, type: ClassType<C>): any;
|
|
19
|
+
}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ClassType } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class AMngCrudApiService<T, QRT extends MediusQueryResult<
|
|
7
|
-
protected type: ClassType<T>;
|
|
8
|
-
protected queryResultType: ClassType<QRT>;
|
|
9
|
-
protected http: HttpClient;
|
|
10
|
-
protected readonly objectSerializer: ObjectSerializer;
|
|
4
|
+
import { MediusQueryResult } from '../models';
|
|
5
|
+
import { AMngGetAllApiService } from './get-all-api.abstract.service';
|
|
6
|
+
export declare abstract class AMngCrudApiService<T, QRT extends MediusQueryResult<any>> extends AMngGetAllApiService<T, QRT> {
|
|
11
7
|
protected constructor(type: ClassType<T>, queryResultType: ClassType<QRT>, http: HttpClient);
|
|
12
8
|
createPost(item: T, params?: HttpParams): Observable<T>;
|
|
13
|
-
getAllPost(queryParamBody?: MediusQueryParam, params?: HttpParams): Observable<QRT>;
|
|
14
9
|
getByIdGet(id: any, params?: HttpParams): Observable<T>;
|
|
15
10
|
updatePut(id: any, item: T, params?: HttpParams): Observable<T>;
|
|
16
11
|
removeDelete(id: any, item?: T, params?: HttpParams): Observable<any>;
|
|
17
|
-
protected abstract getBasePath(): string;
|
|
18
|
-
protected abstract getServiceBasePath(): string;
|
|
19
|
-
protected getGetAllPostPath(): string;
|
|
20
12
|
protected getCreatePostPath(): string;
|
|
21
13
|
protected getUpdatePutPath(id: any, item: T): string;
|
|
22
14
|
protected getGetByIdGetPath(id: any): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ClassType } from '../../types';
|
|
4
|
+
import { MediusQueryParam, MediusQueryResult } from '../models';
|
|
5
|
+
import { AMngApiService } from './api.abstract.service';
|
|
6
|
+
export declare abstract class AMngGetAllApiService<T, QRT extends MediusQueryResult<any>> extends AMngApiService<T> {
|
|
7
|
+
protected queryResultType: ClassType<QRT>;
|
|
8
|
+
protected constructor(type: ClassType<T>, queryResultType: ClassType<QRT>, http: HttpClient);
|
|
9
|
+
getAllPost(queryParamBody?: MediusQueryParam, params?: HttpParams): Observable<QRT>;
|
|
10
|
+
protected getGetAllPostPath(): string;
|
|
11
|
+
}
|
|
@@ -6,10 +6,13 @@ import { AMngTableviewRouteComponent } from './tableview-route.abstract.componen
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class MngTableviewRouteComponent<T, S> extends AMngTableviewRouteComponent<T, S> implements OnInit {
|
|
8
8
|
private route;
|
|
9
|
+
descriptorInit?: TableviewDescriptor<T>;
|
|
10
|
+
dataProviderInit?: ITableviewDataProvider<T, S>;
|
|
11
|
+
actionsInit?: Array<ActionDescriptor<T>>;
|
|
9
12
|
constructor(route: ActivatedRoute);
|
|
10
13
|
protected createTableviewDescriptor(): TableviewDescriptor<T>;
|
|
11
14
|
protected createTableviewDataProvider(): ITableviewDataProvider<T, S>;
|
|
12
15
|
protected createActionDescriptors(): Array<ActionDescriptor<T>>;
|
|
13
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableviewRouteComponent<any, any>, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableviewRouteComponent<any, any>, "mng-tableview-route", never, {}, {}, never, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableviewRouteComponent<any, any>, "mng-tableview-route", never, { "descriptorInit": "descriptor"; "dataProviderInit": "dataProvider"; "actionsInit": "actions"; }, {}, never, never>;
|
|
15
18
|
}
|
|
@@ -22,6 +22,7 @@ export declare class MngTableColumnFilterComponent<T> implements OnInit {
|
|
|
22
22
|
constructor(primeConfig: PrimeNGConfig);
|
|
23
23
|
ngOnInit(): void;
|
|
24
24
|
autocompleteFilter(value: T, filterCallback: Function): void;
|
|
25
|
+
dropdownFilter(value: T, filterCallback: Function): void;
|
|
25
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTableColumnFilterComponent<any>, never>;
|
|
26
27
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngTableColumnFilterComponent<any>, "mng-table-column-filter", never, { "descriptor": "descriptor"; "display": "display"; }, {}, never, never>;
|
|
27
28
|
}
|
|
@@ -33,8 +33,8 @@ export declare class EditorDescriptor<T> {
|
|
|
33
33
|
getField(property: string): AFieldDescriptor<any, T> | null;
|
|
34
34
|
addFieldLookup<FT>(property: string, modelType: ClassType<FT>): FieldLookupDescriptor<FT, T>;
|
|
35
35
|
addFieldLookupEnum(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null): FieldLookupEnumDescriptor<T>;
|
|
36
|
-
addFieldManyEditor<FT>(property: string,
|
|
37
|
-
addFieldManyToManyEditor<FT>(property: string,
|
|
36
|
+
addFieldManyEditor<FT>(property: string, tableviewDescriptor: TableviewDescriptor<FT>): FieldManyEditorDescriptor<FT, T>;
|
|
37
|
+
addFieldManyToManyEditor<FT>(property: string, mainTableDescriptor: TableDescriptor<FT>, lookupTableDescriptor: TableDescriptor<FT>): FieldManyToManyEditorDescriptor<FT, T>;
|
|
38
38
|
withDisabled(disabled?: boolean): this;
|
|
39
39
|
addValidator(name: string, expression: (control: AbstractControl) => boolean): void;
|
|
40
40
|
copy(): EditorDescriptor<T>;
|
|
@@ -239,7 +239,6 @@ export declare class FieldLookupEnumDescriptor<ET> extends FieldLookupDescriptor
|
|
|
239
239
|
copy(): FieldLookupEnumDescriptor<ET>;
|
|
240
240
|
}
|
|
241
241
|
export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
|
|
242
|
-
private readonly _model;
|
|
243
242
|
private readonly _mainTableDescriptor;
|
|
244
243
|
private readonly _lookupTableDescriptor;
|
|
245
244
|
private _fieldType;
|
|
@@ -248,7 +247,7 @@ export declare class FieldManyToManyEditorDescriptor<T, ET> extends AFieldDescri
|
|
|
248
247
|
private _hasLookupExcludeValues;
|
|
249
248
|
private _excludeFilterProperty;
|
|
250
249
|
private _excludeValueProperty;
|
|
251
|
-
constructor(editor: EditorDescriptor<ET>, property: string,
|
|
250
|
+
constructor(editor: EditorDescriptor<ET>, property: string, mainTableDescriptor: TableDescriptor<T>, lookupTableDescriptor: TableDescriptor<T>);
|
|
252
251
|
get fieldType(): FieldManyToManyEditorDescriptor.TypeEnum;
|
|
253
252
|
get lookupTableDataProvider(): ITableDataProvider<T, any> | null;
|
|
254
253
|
get actions(): FieldManyToManyEditorDescriptor.ActionEnum[];
|
|
@@ -273,12 +272,11 @@ export declare namespace FieldManyToManyEditorDescriptor {
|
|
|
273
272
|
}
|
|
274
273
|
}
|
|
275
274
|
export declare class FieldManyEditorDescriptor<T, ET> extends AFieldDescriptor<T, ET> {
|
|
276
|
-
private readonly _modelType;
|
|
277
275
|
private readonly _tableviewDescriptor;
|
|
278
276
|
private _fieldType;
|
|
279
277
|
private _fieldActions;
|
|
280
278
|
private _actions;
|
|
281
|
-
constructor(editor: EditorDescriptor<ET>, property: string,
|
|
279
|
+
constructor(editor: EditorDescriptor<ET>, property: string, tableviewDescriptor: TableviewDescriptor<T>);
|
|
282
280
|
get fieldType(): FieldManyEditorDescriptor.TypeEnum;
|
|
283
281
|
get fieldActions(): FieldManyEditorDescriptor.ActionEnum[];
|
|
284
282
|
get actions(): ActionDescriptor<T>[];
|
|
@@ -34,7 +34,7 @@ export declare class TableviewDescriptor<T> {
|
|
|
34
34
|
addField(property: string): FieldInputDescriptor<T>;
|
|
35
35
|
addFieldLookup<FT>(property: string, modelType: ClassType<FT>): FieldLookupDescriptor<FT, T>;
|
|
36
36
|
addFieldLookupEnum(property: string, enumType: EnumType, options?: Array<EnumConstantType>, nameAsValue?: boolean, optionsTitlePath?: string | null): FieldLookupEnumDescriptor<T>;
|
|
37
|
-
addFieldManyEditor<FT>(property: string,
|
|
38
|
-
addFieldManyToManyEditor<FT>(property: string,
|
|
37
|
+
addFieldManyEditor<FT>(property: string, tableviewDescriptor: TableviewDescriptor<FT>): FieldManyEditorDescriptor<FT, T>;
|
|
38
|
+
addFieldManyToManyEditor<FT>(property: string, mainTableDescriptor: TableDescriptor<FT>, lookupTableDescriptor: TableDescriptor<FT>): FieldManyToManyEditorDescriptor<FT, T>;
|
|
39
39
|
copy(): TableviewDescriptor<T>;
|
|
40
40
|
}
|
|
@@ -36,7 +36,9 @@ export declare class RouteBuilder {
|
|
|
36
36
|
private constructor();
|
|
37
37
|
static create(path: string, component: Type<any>): RouteBuilder;
|
|
38
38
|
static createRedirect(path: string, redirectTo: string, pathMatch?: 'full' | 'prefix'): RouteBuilder;
|
|
39
|
+
static createLazyRoute(path: string, loadChildren: LoadChildren, canLoad?: Array<any>): RouteBuilder;
|
|
39
40
|
static createFromRoute(route: Route): RouteBuilder;
|
|
41
|
+
static createLayoutRoute(path: string, layoutComponent?: typeof MngMainLayoutComponent, topbarComponent?: Type<any>, breadcrumbComponent?: Type<any>, menuComponent?: Type<any>, footerComponent?: Type<any>): RouteBuilder;
|
|
40
42
|
static createTableviewRoutes<T, S>(path: string, descriptor: TableviewDescriptor<T>, dataProvider: ITableviewDataProvider<T, S>, actions?: Array<ActionDescriptor<T>>, hasDetails?: boolean, hasEdit?: boolean, hasAdd?: boolean): RouteBuilder;
|
|
41
43
|
static createTableviewRoutesFromComponent(path: string, component: Type<any>, hasDetails?: boolean, hasEdit?: boolean, hasAdd?: boolean): RouteBuilder;
|
|
42
44
|
private static addActionsSubroutesToTableviewParent;
|
package/package.json
CHANGED
|
File without changes
|