@main-class/mvvm 3.11.2 → 4.0.0-next.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/fesm2022/main-class-mvvm-model.mjs +71 -91
- package/fesm2022/main-class-mvvm-model.mjs.map +1 -1
- package/fesm2022/main-class-mvvm-view.mjs +299 -254
- package/fesm2022/main-class-mvvm-view.mjs.map +1 -1
- package/fesm2022/main-class-mvvm-viewmodel.mjs +27 -43
- package/fesm2022/main-class-mvvm-viewmodel.mjs.map +1 -1
- package/fesm2022/main-class-mvvm.mjs +2 -9
- package/fesm2022/main-class-mvvm.mjs.map +1 -1
- package/package.json +14 -9
- package/types/main-class-mvvm-model.d.ts +86 -0
- package/types/main-class-mvvm-view.d.ts +89 -0
- package/types/main-class-mvvm-viewmodel.d.ts +25 -0
- package/types/main-class-mvvm.d.ts +4 -0
- package/index.d.ts +0 -5
- package/model/index.d.ts +0 -11
- package/model/src/client/abstract-crud.http-client.d.ts +0 -10
- package/model/src/client/abstract-detail.http-client.d.ts +0 -8
- package/model/src/client/abstract-list.http-client.d.ts +0 -12
- package/model/src/client/crud.client.d.ts +0 -8
- package/model/src/client/detail.client.d.ts +0 -4
- package/model/src/client/list.client.d.ts +0 -8
- package/model/src/data/page.d.ts +0 -19
- package/model/src/data/query.d.ts +0 -18
- package/model/src/repository/abstract-crud.repository.d.ts +0 -9
- package/model/src/repository/abstract-detail.repository.d.ts +0 -5
- package/model/src/repository/abstract-list.repository.d.ts +0 -9
- package/public-api.d.ts +0 -1
- package/view/index.d.ts +0 -4
- package/view/src/abstract-detail-component.d.ts +0 -19
- package/view/src/abstract-form-component.directive.d.ts +0 -44
- package/view/src/abstract-list.component.d.ts +0 -24
- package/view/src/attach-form-transformer.d.ts +0 -10
- package/viewmodel/index.d.ts +0 -4
- package/viewmodel/src/abstract-crud-form.viewmodel.d.ts +0 -9
- package/viewmodel/src/abstract-detail.viewmodel.d.ts +0 -5
- package/viewmodel/src/abstract-list.viewmodel.d.ts +0 -7
- package/viewmodel/src/form.viewmodel.d.ts +0 -4
|
@@ -1,44 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return await this.repository.query(query);
|
|
27
|
-
}
|
|
28
|
-
async delete(id) {
|
|
29
|
-
if (!!this.repository.delete) {
|
|
30
|
-
await this.repository.delete(id);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/*
|
|
36
|
-
* Public API Surface of mvvm
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Generated bundle index. Do not edit.
|
|
41
|
-
*/
|
|
42
|
-
|
|
1
|
+
var AbstractDetailViewmodel = class {
|
|
2
|
+
async get(id) {
|
|
3
|
+
return await this.repository.get(id);
|
|
4
|
+
}
|
|
5
|
+
};
|
|
6
|
+
var AbstractCrudFormViewmodel = class {
|
|
7
|
+
async find(id) {
|
|
8
|
+
return await this.repository.get(id);
|
|
9
|
+
}
|
|
10
|
+
async submit(input) {
|
|
11
|
+
if (!!input.id) return await this.repository.update(input.id, input);
|
|
12
|
+
else return await this.repository.create(input);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var AbstractListViewmodel = class {
|
|
16
|
+
async all() {
|
|
17
|
+
return await this.repository.all();
|
|
18
|
+
}
|
|
19
|
+
async query(query) {
|
|
20
|
+
return await this.repository.query(query);
|
|
21
|
+
}
|
|
22
|
+
async delete(id) {
|
|
23
|
+
if (!!this.repository.delete) await this.repository.delete(id);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
43
26
|
export { AbstractCrudFormViewmodel, AbstractDetailViewmodel, AbstractListViewmodel };
|
|
44
|
-
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=main-class-mvvm-viewmodel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-class-mvvm-viewmodel.mjs","sources":["../../../../projects/main-class/mvvm/viewmodel/src/abstract-detail.viewmodel.ts","../../../../projects/main-class/mvvm/viewmodel/src/abstract-crud-form.viewmodel.ts","../../../../projects/main-class/mvvm/viewmodel/src/abstract-list.viewmodel.ts"
|
|
1
|
+
{"version":3,"file":"main-class-mvvm-viewmodel.mjs","names":[],"sources":["../../../../projects/main-class/mvvm/viewmodel/src/abstract-detail.viewmodel.ts","../../../../projects/main-class/mvvm/viewmodel/src/abstract-crud-form.viewmodel.ts","../../../../projects/main-class/mvvm/viewmodel/src/abstract-list.viewmodel.ts"],"sourcesContent":["import {AbstractDetailRepository} from '@main-class/mvvm/model';\n\nexport abstract class AbstractDetailViewmodel<T> {\n abstract get repository(): AbstractDetailRepository<T>;\n\n async get(id: string): Promise<T> {\n return await this.repository.get(id);\n }\n}\n","import {FormViewModel} from './form.viewmodel';\nimport {AbstractCrudRepository} from '@main-class/mvvm/model';\n\nexport abstract class AbstractCrudFormViewmodel<ENTITY, CREATE = ENTITY, UPDATE = ENTITY> implements FormViewModel<CREATE | UPDATE, ENTITY> {\n\n protected abstract get repository(): AbstractCrudRepository<any, ENTITY, CREATE, UPDATE>;\n\n async find(id: any): Promise<ENTITY> {\n return await this.repository.get(id);\n }\n\n async submit(input: { id: any } & (CREATE | UPDATE)): Promise<ENTITY> {\n if (!!input.id) {\n return await this.repository.update(input.id, input as UPDATE);\n } else {\n return await this.repository.create(input as CREATE);\n }\n }\n\n}\n","import {\n AbstractCrudRepository,\n AbstractListRepository,\n NumericQueryPagination,\n Page,\n Query,\n UndefinedQueryPagination\n} from '@main-class/mvvm/model';\n\nexport abstract class AbstractListViewmodel<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> {\n protected abstract get repository(): AbstractListRepository<QUERY, ENTITY>;\n\n async all(): Promise<ENTITY[]> {\n return await this.repository.all();\n }\n\n async query(query: QUERY): Promise<Page<ENTITY>> {\n return await this.repository.query(query);\n }\n\n async delete(id: any) {\n if (!!(this.repository as AbstractCrudRepository<QUERY, ENTITY>).delete) {\n await (this.repository as AbstractCrudRepository<QUERY, ENTITY>).delete(id);\n }\n }\n\n}\n"],"mappings":"AAEA,IAAsB,0BAAtB,MAA6C;CAG3C,MAAM,IAAI,IAAU;EAClB,OAAO,MAAM,KAAK,WAAW,IAAI,EAAE;CACrC;AACD;ACLD,IAAsB,4BAAtB,MAA+C;CAI3C,MAAM,KAAK,IAAO;EACd,OAAO,MAAM,KAAK,WAAW,IAAI,EAAE;CACvC;CAEA,MAAM,OAAO,OAAsC;EAC/C,IAAI,CAAC,CAAC,MAAM,IACR,OAAO,MAAM,KAAK,WAAW,OAAO,MAAM,IAAI,KAAe;OAE7D,OAAO,MAAM,KAAK,WAAW,OAAO,KAAe;CAE3D;AAEH;ACVD,IAAsB,wBAAtB,MAA2C;CAGzC,MAAM,MAAG;EACP,OAAO,MAAM,KAAK,WAAW,IAAG;CAClC;CAEA,MAAM,MAAM,OAAY;EACtB,OAAO,MAAM,KAAK,WAAW,MAAM,KAAK;CAC1C;CAEA,MAAM,OAAO,IAAO;EAClB,IAAI,CAAC,CAAE,KAAK,WAAqD,QAC/D,MAAO,KAAK,WAAqD,OAAO,EAAE;CAE9E;AAED"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-class-mvvm.mjs","sources":["../../../../projects/main-class/mvvm/public-api.ts"
|
|
1
|
+
{"version":3,"file":"main-class-mvvm.mjs","names":[],"sources":["../../../../projects/main-class/mvvm/public-api.ts"],"sourcesContent":["/*\n * Public API Surface of mvvm\n */\n\nexport const MainClassMvvm = {};\n"],"mappings":"AAIA,MAAa,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@main-class/mvvm",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-next.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
5
|
+
"@angular/common": "^22.0.0",
|
|
6
|
+
"@angular/core": "^22.0.0",
|
|
7
|
+
"@angular/forms": "^22.0.0",
|
|
8
|
+
"@angular/router": "^22.0.0",
|
|
9
|
+
"@main-class/componentes": "^4.0.0-next.0",
|
|
10
|
+
"rxjs": "^7.8.0"
|
|
7
11
|
},
|
|
8
12
|
"dependencies": {
|
|
9
13
|
"tslib": "^2.3.0"
|
|
10
14
|
},
|
|
11
15
|
"module": "fesm2022/main-class-mvvm.mjs",
|
|
12
|
-
"typings": "
|
|
16
|
+
"typings": "types/main-class-mvvm.d.ts",
|
|
13
17
|
"exports": {
|
|
14
18
|
"./package.json": {
|
|
15
19
|
"default": "./package.json"
|
|
16
20
|
},
|
|
17
21
|
".": {
|
|
18
|
-
"types": "./
|
|
22
|
+
"types": "./types/main-class-mvvm.d.ts",
|
|
19
23
|
"default": "./fesm2022/main-class-mvvm.mjs"
|
|
20
24
|
},
|
|
21
25
|
"./model": {
|
|
22
|
-
"types": "./model
|
|
26
|
+
"types": "./types/main-class-mvvm-model.d.ts",
|
|
23
27
|
"default": "./fesm2022/main-class-mvvm-model.mjs"
|
|
24
28
|
},
|
|
25
29
|
"./view": {
|
|
26
|
-
"types": "./view
|
|
30
|
+
"types": "./types/main-class-mvvm-view.d.ts",
|
|
27
31
|
"default": "./fesm2022/main-class-mvvm-view.mjs"
|
|
28
32
|
},
|
|
29
33
|
"./viewmodel": {
|
|
30
|
-
"types": "./viewmodel
|
|
34
|
+
"types": "./types/main-class-mvvm-viewmodel.d.ts",
|
|
31
35
|
"default": "./fesm2022/main-class-mvvm-viewmodel.mjs"
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
|
-
"sideEffects": false
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"type": "module"
|
|
35
40
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
import { HttpClient } from "@angular/common/http";
|
|
6
|
+
export interface NumericQueryPagination {
|
|
7
|
+
type: 'numeric';
|
|
8
|
+
size: number;
|
|
9
|
+
page: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UndefinedQueryPagination {
|
|
12
|
+
type: 'undefined';
|
|
13
|
+
size: number;
|
|
14
|
+
endBefore?: string | 'last';
|
|
15
|
+
startAfter?: string | 'first';
|
|
16
|
+
}
|
|
17
|
+
export interface Query<T extends NumericQueryPagination | UndefinedQueryPagination = NumericQueryPagination> {
|
|
18
|
+
pagination?: T;
|
|
19
|
+
sortBy?: string;
|
|
20
|
+
sortOrientation?: 'asc' | 'desc';
|
|
21
|
+
}
|
|
22
|
+
export interface UndefinedPaginationQuery extends Query<UndefinedQueryPagination> {}
|
|
23
|
+
export interface NumericPagination {
|
|
24
|
+
type: 'numeric';
|
|
25
|
+
size: number;
|
|
26
|
+
total: number;
|
|
27
|
+
page: number;
|
|
28
|
+
hasNext: boolean;
|
|
29
|
+
hasPrevious: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface UndefinedPagination {
|
|
32
|
+
type: 'undefined';
|
|
33
|
+
size: number;
|
|
34
|
+
total?: number;
|
|
35
|
+
nextPageRef?: any;
|
|
36
|
+
previousPageRef?: any;
|
|
37
|
+
}
|
|
38
|
+
export interface Page<T> {
|
|
39
|
+
items: T[];
|
|
40
|
+
pagination: NumericPagination | UndefinedPagination;
|
|
41
|
+
}
|
|
42
|
+
export interface DetailClient<ENTITY> {
|
|
43
|
+
get(id: any): Observable<ENTITY>;
|
|
44
|
+
}
|
|
45
|
+
export interface ListClient<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> extends DetailClient<ENTITY> {
|
|
46
|
+
query(query: QUERY): Observable<Page<ENTITY>>;
|
|
47
|
+
all?(): Observable<ENTITY[]>;
|
|
48
|
+
}
|
|
49
|
+
export interface CrudClient<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY, CREATE = ENTITY, UPDATE = ENTITY> extends ListClient<QUERY, ENTITY> {
|
|
50
|
+
create(create: CREATE): Observable<ENTITY>;
|
|
51
|
+
update(id: any, create: UPDATE): Observable<ENTITY>;
|
|
52
|
+
delete(id: any): Observable<any>;
|
|
53
|
+
}
|
|
54
|
+
export declare abstract class AbstractDetailHttpClient<ENTITY> implements DetailClient<ENTITY> {
|
|
55
|
+
protected httpClient: HttpClient;
|
|
56
|
+
protected abstract basePath: string;
|
|
57
|
+
get(id: any): Observable<ENTITY>;
|
|
58
|
+
}
|
|
59
|
+
export declare abstract class AbstractListHttpClient<QUERY extends Query, ENTITY> extends AbstractDetailHttpClient<ENTITY> implements ListClient<QUERY, ENTITY> {
|
|
60
|
+
protected basePath: string;
|
|
61
|
+
constructor(basePath: string);
|
|
62
|
+
protected parseQueryParams(query: any): any;
|
|
63
|
+
query(query: QUERY): Observable<Page<ENTITY>>;
|
|
64
|
+
all(): Observable<ENTITY[]>;
|
|
65
|
+
}
|
|
66
|
+
export declare abstract class AbstractCrudHttpClient<QUERY extends Query, ENTITY, CREATE = ENTITY, UPDATE = ENTITY> extends AbstractListHttpClient<QUERY, ENTITY> implements CrudClient<QUERY, ENTITY, CREATE, UPDATE> {
|
|
67
|
+
create(create: CREATE): Observable<ENTITY>;
|
|
68
|
+
protected serialize(id: any, json: CREATE | UPDATE): any;
|
|
69
|
+
update(id: any, create: UPDATE): Observable<ENTITY>;
|
|
70
|
+
delete(id: any): Observable<any>;
|
|
71
|
+
}
|
|
72
|
+
export declare abstract class AbstractDetailRepository<ENTITY> {
|
|
73
|
+
protected abstract get client(): DetailClient<ENTITY>;
|
|
74
|
+
get(id: any): Promise<ENTITY>;
|
|
75
|
+
}
|
|
76
|
+
export declare abstract class AbstractListRepository<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> extends AbstractDetailRepository<ENTITY> {
|
|
77
|
+
protected abstract get client(): ListClient<QUERY, ENTITY>;
|
|
78
|
+
query(query: QUERY): Promise<Page<ENTITY>>;
|
|
79
|
+
all(): Promise<ENTITY[]>;
|
|
80
|
+
}
|
|
81
|
+
export declare abstract class AbstractCrudRepository<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY, CREATE = ENTITY, UPDATE = ENTITY> extends AbstractListRepository<QUERY, ENTITY> {
|
|
82
|
+
protected abstract get client(): CrudClient<QUERY, ENTITY, CREATE, UPDATE>;
|
|
83
|
+
create(create: CREATE): Promise<ENTITY>;
|
|
84
|
+
update(id: any, update: UPDATE): Promise<ENTITY>;
|
|
85
|
+
delete(id: any): Promise<any>;
|
|
86
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { OnInit } from "@angular/core";
|
|
6
|
+
import { ActivatedRoute, Router } from "@angular/router";
|
|
7
|
+
import { AbstractDetailViewmodel, AbstractListViewmodel, FormViewModel } from "@main-class/mvvm/viewmodel";
|
|
8
|
+
import { LoaderService } from "@main-class/componentes/loader";
|
|
9
|
+
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
10
|
+
import { MensageriaService } from "@main-class/componentes/core";
|
|
11
|
+
import { NumericQueryPagination, Query, UndefinedQueryPagination } from "@main-class/mvvm/model";
|
|
12
|
+
import { DialogService } from "@main-class/componentes/dialog";
|
|
13
|
+
import { NumericPaginationEvent, Page, PaginatedTableComponent, UndefinedPaginationEvent } from "@main-class/componentes/table";
|
|
14
|
+
import { Subscription } from "rxjs";
|
|
15
|
+
export interface DetailComponentConfig {
|
|
16
|
+
idParamName?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare abstract class AbstractDetailComponent<ENTITY> implements OnInit {
|
|
19
|
+
abstract get viewmodel(): AbstractDetailViewmodel<ENTITY>;
|
|
20
|
+
protected activatedRoute: ActivatedRoute;
|
|
21
|
+
protected loaderService: LoaderService;
|
|
22
|
+
protected config?: DetailComponentConfig;
|
|
23
|
+
entity?: ENTITY;
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
protected detail(id: string): Promise<void>;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDetailComponent<any>, never>;
|
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDetailComponent<any>, never, never, {}, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
29
|
+
export interface FormComponentConfig {
|
|
30
|
+
idParamName?: string;
|
|
31
|
+
formTransformation?: {
|
|
32
|
+
delay?: number;
|
|
33
|
+
upperCase?: boolean;
|
|
34
|
+
removeSpecialCharacters?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare abstract class AbstractFormComponent<I, O> implements OnInit {
|
|
38
|
+
protected abstract get viewmodel(): FormViewModel<I, O>;
|
|
39
|
+
abstract get form(): FormGroup;
|
|
40
|
+
protected fb: FormBuilder;
|
|
41
|
+
protected router: Router;
|
|
42
|
+
protected activatedRoute: ActivatedRoute;
|
|
43
|
+
protected loaderService: LoaderService;
|
|
44
|
+
protected mensageriaService: MensageriaService;
|
|
45
|
+
protected config?: FormComponentConfig;
|
|
46
|
+
ngOnInit(): void;
|
|
47
|
+
get edicao(): boolean;
|
|
48
|
+
protected applyFormValue(id: any, output: O): void;
|
|
49
|
+
confirmacao(): Promise<boolean>;
|
|
50
|
+
onSuccess(output: O): void;
|
|
51
|
+
onError(): void;
|
|
52
|
+
submit(): Promise<void>;
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormComponent<any, any>, never>;
|
|
54
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractFormComponent<any, any>, never, never, {}, {}, never, never, true, never>;
|
|
55
|
+
}
|
|
56
|
+
export declare abstract class AbstractModelFormComponent<T> extends AbstractFormComponent<T, T> {
|
|
57
|
+
onSuccess(output: T): void;
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractModelFormComponent<any>, never>;
|
|
59
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractModelFormComponent<any>, never, never, {}, {}, never, never, true, never>;
|
|
60
|
+
}
|
|
61
|
+
export declare abstract class AbstractCrudFormComponent<ENTITY, CREATE, UPDATE> extends AbstractFormComponent<CREATE | UPDATE, ENTITY> {
|
|
62
|
+
onSuccess(output: ENTITY): void;
|
|
63
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractCrudFormComponent<any, any, any>, never>;
|
|
64
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractCrudFormComponent<any, any, any>, never, never, {}, {}, never, never, true, never>;
|
|
65
|
+
}
|
|
66
|
+
export declare abstract class AbstractListComponent<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> implements OnInit {
|
|
67
|
+
protected abstract get viewmodel(): AbstractListViewmodel<QUERY, ENTITY>;
|
|
68
|
+
protected router: Router;
|
|
69
|
+
protected dialogService: DialogService;
|
|
70
|
+
protected loaderService: LoaderService;
|
|
71
|
+
protected currentQuery: QUERY;
|
|
72
|
+
page?: Page<ENTITY>;
|
|
73
|
+
table: PaginatedTableComponent<ENTITY>;
|
|
74
|
+
private queryTimeout;
|
|
75
|
+
ngOnInit(): void;
|
|
76
|
+
query(query?: QUERY): void;
|
|
77
|
+
paginate(event: NumericPaginationEvent | UndefinedPaginationEvent): void;
|
|
78
|
+
remove(id: any): Promise<void>;
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractListComponent<any, any>, never>;
|
|
80
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractListComponent<any, any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Anexa um "transformer" global ao FormGroup.
|
|
84
|
+
* - Percorre recursivamente FormGroup/FormArray/FormControl
|
|
85
|
+
* - Aplica .trim() apenas em strings de FormControls
|
|
86
|
+
* - Usa debounceTime para não atrapalhar a digitação
|
|
87
|
+
* - Retorna a Subscription para você descartar no OnDestroy
|
|
88
|
+
*/
|
|
89
|
+
export declare function attachFormTransformer(form: FormGroup, delayMs?: number, upperCase?: boolean, removeSpecialCharacters?: boolean): Subscription;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import { AbstractCrudRepository, AbstractDetailRepository, AbstractListRepository, NumericQueryPagination, Page, Query, UndefinedQueryPagination } from "@main-class/mvvm/model";
|
|
5
|
+
export interface FormViewModel<I, O> {
|
|
6
|
+
find?(id: any): Promise<O>;
|
|
7
|
+
submit(input: I): Promise<O>;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class AbstractDetailViewmodel<T> {
|
|
10
|
+
abstract get repository(): AbstractDetailRepository<T>;
|
|
11
|
+
get(id: string): Promise<T>;
|
|
12
|
+
}
|
|
13
|
+
export declare abstract class AbstractCrudFormViewmodel<ENTITY, CREATE = ENTITY, UPDATE = ENTITY> implements FormViewModel<CREATE | UPDATE, ENTITY> {
|
|
14
|
+
protected abstract get repository(): AbstractCrudRepository<any, ENTITY, CREATE, UPDATE>;
|
|
15
|
+
find(id: any): Promise<ENTITY>;
|
|
16
|
+
submit(input: {
|
|
17
|
+
id: any;
|
|
18
|
+
} & (CREATE | UPDATE)): Promise<ENTITY>;
|
|
19
|
+
}
|
|
20
|
+
export declare abstract class AbstractListViewmodel<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> {
|
|
21
|
+
protected abstract get repository(): AbstractListRepository<QUERY, ENTITY>;
|
|
22
|
+
all(): Promise<ENTITY[]>;
|
|
23
|
+
query(query: QUERY): Promise<Page<ENTITY>>;
|
|
24
|
+
delete(id: any): Promise<void>;
|
|
25
|
+
}
|
package/index.d.ts
DELETED
package/model/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './src/data/query';
|
|
2
|
-
export * from './src/data/page';
|
|
3
|
-
export * from './src/client/crud.client';
|
|
4
|
-
export * from './src/client/list.client';
|
|
5
|
-
export * from './src/client/detail.client';
|
|
6
|
-
export * from './src/client/abstract-crud.http-client';
|
|
7
|
-
export * from './src/client/abstract-list.http-client';
|
|
8
|
-
export * from './src/client/abstract-detail.http-client';
|
|
9
|
-
export * from './src/repository/abstract-crud.repository';
|
|
10
|
-
export * from './src/repository/abstract-detail.repository';
|
|
11
|
-
export * from './src/repository/abstract-list.repository';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { Query } from '../data/query';
|
|
3
|
-
import { AbstractListHttpClient } from './abstract-list.http-client';
|
|
4
|
-
import { CrudClient } from './crud.client';
|
|
5
|
-
export declare abstract class AbstractCrudHttpClient<QUERY extends Query, ENTITY, CREATE = ENTITY, UPDATE = ENTITY> extends AbstractListHttpClient<QUERY, ENTITY> implements CrudClient<QUERY, ENTITY, CREATE, UPDATE> {
|
|
6
|
-
create(create: CREATE): Observable<ENTITY>;
|
|
7
|
-
protected serialize(id: any, json: CREATE | UPDATE): any;
|
|
8
|
-
update(id: any, create: UPDATE): Observable<ENTITY>;
|
|
9
|
-
delete(id: any): Observable<any>;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DetailClient } from './detail.client';
|
|
4
|
-
export declare abstract class AbstractDetailHttpClient<ENTITY> implements DetailClient<ENTITY> {
|
|
5
|
-
protected httpClient: HttpClient;
|
|
6
|
-
protected abstract basePath: string;
|
|
7
|
-
get(id: any): Observable<ENTITY>;
|
|
8
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Query } from '../data/query';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { Page } from '../data/page';
|
|
4
|
-
import { AbstractDetailHttpClient } from './abstract-detail.http-client';
|
|
5
|
-
import { ListClient } from './list.client';
|
|
6
|
-
export declare abstract class AbstractListHttpClient<QUERY extends Query, ENTITY> extends AbstractDetailHttpClient<ENTITY> implements ListClient<QUERY, ENTITY> {
|
|
7
|
-
protected basePath: string;
|
|
8
|
-
constructor(basePath: string);
|
|
9
|
-
protected parseQueryParams(query: any): any;
|
|
10
|
-
query(query: QUERY): Observable<Page<ENTITY>>;
|
|
11
|
-
all(): Observable<ENTITY[]>;
|
|
12
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { NumericQueryPagination, Query, UndefinedQueryPagination } from '../data/query';
|
|
3
|
-
import { ListClient } from './list.client';
|
|
4
|
-
export interface CrudClient<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY, CREATE = ENTITY, UPDATE = ENTITY> extends ListClient<QUERY, ENTITY> {
|
|
5
|
-
create(create: CREATE): Observable<ENTITY>;
|
|
6
|
-
update(id: any, create: UPDATE): Observable<ENTITY>;
|
|
7
|
-
delete(id: any): Observable<any>;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { NumericQueryPagination, Query, UndefinedQueryPagination } from '../data/query';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { Page } from '../data/page';
|
|
4
|
-
import { DetailClient } from './detail.client';
|
|
5
|
-
export interface ListClient<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> extends DetailClient<ENTITY> {
|
|
6
|
-
query(query: QUERY): Observable<Page<ENTITY>>;
|
|
7
|
-
all?(): Observable<ENTITY[]>;
|
|
8
|
-
}
|
package/model/src/data/page.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface NumericPagination {
|
|
2
|
-
type: 'numeric';
|
|
3
|
-
size: number;
|
|
4
|
-
total: number;
|
|
5
|
-
page: number;
|
|
6
|
-
hasNext: boolean;
|
|
7
|
-
hasPrevious: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface UndefinedPagination {
|
|
10
|
-
type: 'undefined';
|
|
11
|
-
size: number;
|
|
12
|
-
total?: number;
|
|
13
|
-
nextPageRef?: any;
|
|
14
|
-
previousPageRef?: any;
|
|
15
|
-
}
|
|
16
|
-
export interface Page<T> {
|
|
17
|
-
items: T[];
|
|
18
|
-
pagination: NumericPagination | UndefinedPagination;
|
|
19
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface NumericQueryPagination {
|
|
2
|
-
type: 'numeric';
|
|
3
|
-
size: number;
|
|
4
|
-
page: number;
|
|
5
|
-
}
|
|
6
|
-
export interface UndefinedQueryPagination {
|
|
7
|
-
type: 'undefined';
|
|
8
|
-
size: number;
|
|
9
|
-
endBefore?: string | 'last';
|
|
10
|
-
startAfter?: string | 'first';
|
|
11
|
-
}
|
|
12
|
-
export interface Query<T extends NumericQueryPagination | UndefinedQueryPagination = NumericQueryPagination> {
|
|
13
|
-
pagination?: T;
|
|
14
|
-
sortBy?: string;
|
|
15
|
-
sortOrientation?: 'asc' | 'desc';
|
|
16
|
-
}
|
|
17
|
-
export interface UndefinedPaginationQuery extends Query<UndefinedQueryPagination> {
|
|
18
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NumericQueryPagination, Query, UndefinedQueryPagination } from '../data/query';
|
|
2
|
-
import { AbstractListRepository } from './abstract-list.repository';
|
|
3
|
-
import { CrudClient } from '../client/crud.client';
|
|
4
|
-
export declare abstract class AbstractCrudRepository<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY, CREATE = ENTITY, UPDATE = ENTITY> extends AbstractListRepository<QUERY, ENTITY> {
|
|
5
|
-
protected abstract get client(): CrudClient<QUERY, ENTITY, CREATE, UPDATE>;
|
|
6
|
-
create(create: CREATE): Promise<ENTITY>;
|
|
7
|
-
update(id: any, update: UPDATE): Promise<ENTITY>;
|
|
8
|
-
delete(id: any): Promise<any>;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NumericQueryPagination, Query, UndefinedQueryPagination } from '../data/query';
|
|
2
|
-
import { Page } from '../data/page';
|
|
3
|
-
import { AbstractDetailRepository } from './abstract-detail.repository';
|
|
4
|
-
import { ListClient } from '../client/list.client';
|
|
5
|
-
export declare abstract class AbstractListRepository<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> extends AbstractDetailRepository<ENTITY> {
|
|
6
|
-
protected abstract get client(): ListClient<QUERY, ENTITY>;
|
|
7
|
-
query(query: QUERY): Promise<Page<ENTITY>>;
|
|
8
|
-
all(): Promise<ENTITY[]>;
|
|
9
|
-
}
|
package/public-api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MainClassMvvm: {};
|
package/view/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { ActivatedRoute } from '@angular/router';
|
|
3
|
-
import { AbstractDetailViewmodel } from '@main-class/mvvm/viewmodel';
|
|
4
|
-
import { LoaderService } from '@main-class/componentes/loader';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export interface DetailComponentConfig {
|
|
7
|
-
idParamName?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare abstract class AbstractDetailComponent<ENTITY> implements OnInit {
|
|
10
|
-
abstract get viewmodel(): AbstractDetailViewmodel<ENTITY>;
|
|
11
|
-
protected activatedRoute: ActivatedRoute;
|
|
12
|
-
protected loaderService: LoaderService;
|
|
13
|
-
protected config?: DetailComponentConfig;
|
|
14
|
-
entity?: ENTITY;
|
|
15
|
-
ngOnInit(): void;
|
|
16
|
-
protected detail(id: string): Promise<void>;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDetailComponent<any>, never>;
|
|
18
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDetailComponent<any>, never, never, {}, {}, never, never, true, never>;
|
|
19
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
2
|
-
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
-
import { OnInit } from '@angular/core';
|
|
4
|
-
import { FormViewModel } from '@main-class/mvvm/viewmodel';
|
|
5
|
-
import { LoaderService } from '@main-class/componentes/loader';
|
|
6
|
-
import { MensageriaService } from '@main-class/componentes/core';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export interface FormComponentConfig {
|
|
9
|
-
idParamName?: string;
|
|
10
|
-
formTransformation?: {
|
|
11
|
-
delay?: number;
|
|
12
|
-
upperCase?: boolean;
|
|
13
|
-
removeSpecialCharacters?: boolean;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export declare abstract class AbstractFormComponent<I, O> implements OnInit {
|
|
17
|
-
protected abstract get viewmodel(): FormViewModel<I, O>;
|
|
18
|
-
abstract get form(): FormGroup;
|
|
19
|
-
protected fb: FormBuilder;
|
|
20
|
-
protected router: Router;
|
|
21
|
-
protected activatedRoute: ActivatedRoute;
|
|
22
|
-
protected loaderService: LoaderService;
|
|
23
|
-
protected mensageriaService: MensageriaService;
|
|
24
|
-
protected config?: FormComponentConfig;
|
|
25
|
-
ngOnInit(): void;
|
|
26
|
-
get edicao(): boolean;
|
|
27
|
-
protected applyFormValue(id: any, output: O): void;
|
|
28
|
-
confirmacao(): Promise<boolean>;
|
|
29
|
-
onSuccess(output: O): void;
|
|
30
|
-
onError(): void;
|
|
31
|
-
submit(): Promise<void>;
|
|
32
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormComponent<any, any>, never>;
|
|
33
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractFormComponent<any, any>, never, never, {}, {}, never, never, true, never>;
|
|
34
|
-
}
|
|
35
|
-
export declare abstract class AbstractModelFormComponent<T> extends AbstractFormComponent<T, T> {
|
|
36
|
-
onSuccess(output: T): void;
|
|
37
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractModelFormComponent<any>, never>;
|
|
38
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractModelFormComponent<any>, never, never, {}, {}, never, never, true, never>;
|
|
39
|
-
}
|
|
40
|
-
export declare abstract class AbstractCrudFormComponent<ENTITY, CREATE, UPDATE> extends AbstractFormComponent<CREATE | UPDATE, ENTITY> {
|
|
41
|
-
onSuccess(output: ENTITY): void;
|
|
42
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractCrudFormComponent<any, any, any>, never>;
|
|
43
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractCrudFormComponent<any, any, any>, never, never, {}, {}, never, never, true, never>;
|
|
44
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { AbstractListViewmodel } from '@main-class/mvvm/viewmodel';
|
|
4
|
-
import { NumericQueryPagination, Query, UndefinedQueryPagination } from '@main-class/mvvm/model';
|
|
5
|
-
import { LoaderService } from '@main-class/componentes/loader';
|
|
6
|
-
import { DialogService } from '@main-class/componentes/dialog';
|
|
7
|
-
import { NumericPaginationEvent, Page, PaginatedTableComponent, UndefinedPaginationEvent } from '@main-class/componentes/table';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
export declare abstract class AbstractListComponent<QUERY extends Query<NumericQueryPagination | UndefinedQueryPagination>, ENTITY> implements OnInit {
|
|
10
|
-
protected abstract get viewmodel(): AbstractListViewmodel<QUERY, ENTITY>;
|
|
11
|
-
protected router: Router;
|
|
12
|
-
protected dialogService: DialogService;
|
|
13
|
-
protected loaderService: LoaderService;
|
|
14
|
-
protected currentQuery: QUERY;
|
|
15
|
-
page?: Page<ENTITY>;
|
|
16
|
-
table: PaginatedTableComponent<ENTITY>;
|
|
17
|
-
private queryTimeout;
|
|
18
|
-
ngOnInit(): void;
|
|
19
|
-
query(query?: QUERY): void;
|
|
20
|
-
paginate(event: NumericPaginationEvent | UndefinedPaginationEvent): void;
|
|
21
|
-
remove(id: any): Promise<void>;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractListComponent<any, any>, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractListComponent<any, any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
24
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FormGroup } from '@angular/forms';
|
|
2
|
-
import { Subscription } from 'rxjs';
|
|
3
|
-
/**
|
|
4
|
-
* Anexa um "transformer" global ao FormGroup.
|
|
5
|
-
* - Percorre recursivamente FormGroup/FormArray/FormControl
|
|
6
|
-
* - Aplica .trim() apenas em strings de FormControls
|
|
7
|
-
* - Usa debounceTime para não atrapalhar a digitação
|
|
8
|
-
* - Retorna a Subscription para você descartar no OnDestroy
|
|
9
|
-
*/
|
|
10
|
-
export declare function attachFormTransformer(form: FormGroup, delayMs?: number, upperCase?: boolean, removeSpecialCharacters?: boolean): Subscription;
|
package/viewmodel/index.d.ts
DELETED