@sumaris-net/ngx-components 1.19.2 → 1.20.0-rc2
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/bundles/sumaris-net.ngx-components.umd.js +325 -169
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +7 -0
- package/esm2015/src/app/admin/users/list/users.js +5 -1
- package/esm2015/src/app/core/auth/form/form-auth.js +26 -20
- package/esm2015/src/app/core/core.module.js +3 -1
- package/esm2015/src/app/core/form/form.class.js +27 -7
- package/esm2015/src/app/core/services/model/entity.model.js +5 -1
- package/esm2015/src/app/core/table/entities-table-datasource.class.js +164 -119
- package/esm2015/src/app/core/table/memory-table.class.js +3 -3
- package/esm2015/src/app/core/table/table.class.js +4 -5
- package/esm2015/src/app/shared/validator/validators.js +2 -2
- package/fesm2015/sumaris-net.ngx-components.js +224 -146
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +2 -2
- package/src/app/core/auth/form/form-auth.d.ts +1 -1
- package/src/app/core/form/form.class.d.ts +8 -1
- package/src/app/core/services/model/entity.model.d.ts +1 -0
- package/src/app/core/table/entities-table-datasource.class.d.ts +20 -26
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sumaris-net/ngx-components",
|
|
3
3
|
"description": "SUMARiS Angular components",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.20.0-rc2",
|
|
5
5
|
"author": "contact@e-is.pro",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"readmeFilename": "README.md",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">= 12.22.8",
|
|
30
|
-
"npm": ">=
|
|
30
|
+
"npm": ">= 7.20.0",
|
|
31
31
|
"yarn": ">= 1.22.0"
|
|
32
32
|
},
|
|
33
33
|
"cordova": {
|
|
@@ -27,7 +27,7 @@ export declare class AuthForm extends AppForm<AuthData> implements OnInit {
|
|
|
27
27
|
constructor(injector: Injector, platform: PlatformService, formBuilder: FormBuilder, settings: LocalSettingsService, configService: ConfigService, modalCtrl: ModalController, network: NetworkService, cd: ChangeDetectorRef, environment: any);
|
|
28
28
|
ngOnInit(): void;
|
|
29
29
|
cancel(): void;
|
|
30
|
-
doSubmit(event?: UIEvent): void
|
|
30
|
+
doSubmit(event?: UIEvent): Promise<void>;
|
|
31
31
|
register(): void;
|
|
32
32
|
protected markForCheck(): void;
|
|
33
33
|
}
|
|
@@ -60,7 +60,14 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
|
|
|
60
60
|
ngOnInit(): void;
|
|
61
61
|
ngOnDestroy(): void;
|
|
62
62
|
cancel(): void;
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param event
|
|
66
|
+
* @param opts allow to skip validation check, using {checkValid: false}
|
|
67
|
+
*/
|
|
68
|
+
doSubmit(event: any, opts?: {
|
|
69
|
+
checkValid?: boolean;
|
|
70
|
+
}): Promise<void>;
|
|
64
71
|
setForm(form: FormGroup): void;
|
|
65
72
|
setValue(data: T, opts?: {
|
|
66
73
|
emitEvent?: boolean;
|
|
@@ -46,6 +46,7 @@ export declare abstract class Entity<T extends Entity<T, ID, AO, FO>, ID = numbe
|
|
|
46
46
|
export declare function isInstanceOf<T>(obj: any, constructor: new (...args: any[]) => T): obj is T;
|
|
47
47
|
export declare abstract class EntityUtils {
|
|
48
48
|
static isEntity<T extends IEntity<any>>(obj: T | any): obj is T;
|
|
49
|
+
static isNotEntity<T extends IEntity<any>>(obj: T | any): boolean;
|
|
49
50
|
static isNotEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
50
51
|
static isEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
51
52
|
static equals<T extends IEntity<any> | any>(o1: T, o2: T, checkAttribute?: keyof T): boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TableDataSource, TableElement, ValidatorService } from '@e-is/ngx-material-table';
|
|
2
2
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
3
3
|
import { Entity, IEntity } from '../services/model/entity.model';
|
|
4
|
-
import { OnDestroy } from '@angular/core';
|
|
5
4
|
import { SortDirection } from '@angular/material/sort';
|
|
6
5
|
import { CollectionViewer } from '@angular/cdk/collections';
|
|
7
6
|
import { TableDataSourceOptions } from '@e-is/ngx-material-table/src/app/ngx-material-table/table-data-source';
|
|
@@ -11,30 +10,24 @@ export declare interface AppTableDataServiceOptions<O extends EntitiesServiceWat
|
|
|
11
10
|
saveOnlyDirtyRows?: boolean;
|
|
12
11
|
readOnly?: boolean;
|
|
13
12
|
}
|
|
14
|
-
export
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
prependNewElements?: boolean;
|
|
17
|
-
suppressErrors?: boolean;
|
|
18
|
-
keepOriginalDataAfterConfirm?: boolean;
|
|
13
|
+
export interface AppTableDataSourceOptions<T extends Entity<T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions> extends TableDataSourceOptions {
|
|
19
14
|
onRowCreated?: (row: TableElement<T>) => Promise<void> | void;
|
|
20
|
-
dataServiceOptions?: AppTableDataServiceOptions<
|
|
15
|
+
dataServiceOptions?: AppTableDataServiceOptions<WO>;
|
|
21
16
|
debug?: boolean;
|
|
17
|
+
[key: string]: any;
|
|
22
18
|
}
|
|
23
|
-
export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any, ID = number,
|
|
24
|
-
readonly dataService: IEntitiesService<T, F,
|
|
19
|
+
export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any, ID = number, V extends ValidatorService = ValidatorService, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, O extends AppTableDataSourceOptions<T, ID, WO> = AppTableDataSourceOptions<T, ID, WO>> extends TableDataSource<T, V, O> {
|
|
20
|
+
readonly dataService: IEntitiesService<T, F, WO>;
|
|
25
21
|
private readonly _logTypeName;
|
|
26
|
-
private readonly _options;
|
|
27
22
|
protected readonly _debug: boolean;
|
|
28
23
|
protected _creating: boolean;
|
|
29
24
|
protected _saving: boolean;
|
|
30
|
-
protected _useValidator: boolean;
|
|
31
25
|
protected _stopWatching$: Subject<any>;
|
|
32
26
|
protected _editingRowCount: number;
|
|
33
27
|
protected _fetchMoreFn: FetchMoreFn<LoadResult<T>>;
|
|
34
28
|
loadingSubject: BehaviorSubject<boolean>;
|
|
35
|
-
get serviceOptions(): AppTableDataServiceOptions<
|
|
36
|
-
set serviceOptions(value: AppTableDataServiceOptions<
|
|
37
|
-
get options(): AppTableDataSourceOptions<T, ID, O>;
|
|
29
|
+
get serviceOptions(): AppTableDataServiceOptions<WO>;
|
|
30
|
+
set serviceOptions(value: AppTableDataServiceOptions<WO>);
|
|
38
31
|
get loaded(): boolean;
|
|
39
32
|
get loading(): boolean;
|
|
40
33
|
/**
|
|
@@ -42,28 +35,29 @@ export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any,
|
|
|
42
35
|
*
|
|
43
36
|
* @param dataService A service to load and save data
|
|
44
37
|
* @param dataType Type of data contained by the Table. If not specified, then `data` with at least one element must be specified.
|
|
45
|
-
* @param environment
|
|
46
38
|
* @param validatorService Service that create instances of the FormGroup used to validate row fields.
|
|
47
39
|
* @param config Additional configuration for table.
|
|
48
40
|
*/
|
|
49
|
-
constructor(dataType: new () => T, dataService: IEntitiesService<T, F,
|
|
50
|
-
|
|
41
|
+
constructor(dataType: new () => T, dataService: IEntitiesService<T, F, WO>, validatorService?: V, config?: O);
|
|
42
|
+
disconnect(collectionViewer?: CollectionViewer): void;
|
|
51
43
|
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>): Observable<LoadResult<T>>;
|
|
52
44
|
save(): Promise<boolean>;
|
|
45
|
+
protected getDataFromRows(rows: TableElement<T>[], options?: {
|
|
46
|
+
originalData: boolean;
|
|
47
|
+
toEntity: boolean;
|
|
48
|
+
}): T[];
|
|
49
|
+
toEntity(data: T | any): T;
|
|
53
50
|
updateDatasource(data: T[], opts?: {
|
|
54
51
|
emitEvent: boolean;
|
|
55
|
-
}): void
|
|
56
|
-
createNew(insertAt?: number): void;
|
|
57
|
-
connect(collectionViewer: CollectionViewer): Observable<TableElement<T>[] | ReadonlyArray<TableElement<T>>>;
|
|
58
|
-
disconnect(collectionViewer?: CollectionViewer): void;
|
|
52
|
+
}): Promise<void>;
|
|
59
53
|
waitIdle(debounceTimeMs?: number): Promise<any>;
|
|
60
|
-
confirmCreate(row: TableElement<T>): boolean
|
|
61
|
-
confirmEdit(row: TableElement<T>): boolean
|
|
62
|
-
startEdit(row: TableElement<T>):
|
|
63
|
-
|
|
54
|
+
confirmCreate(row: TableElement<T>): Promise<boolean>;
|
|
55
|
+
confirmEdit(row: TableElement<T>): Promise<boolean>;
|
|
56
|
+
startEdit(row: TableElement<T>): Promise<boolean>;
|
|
57
|
+
cancel(row: TableElement<T>): Promise<boolean>;
|
|
64
58
|
handleError(error: any, message: string): Observable<LoadResult<T>>;
|
|
65
59
|
handleErrorPromise(error: any): void;
|
|
66
|
-
delete(id: number):
|
|
60
|
+
delete(id: number): Promise<boolean>;
|
|
67
61
|
deleteAll(rows: TableElement<T>[]): Promise<any>;
|
|
68
62
|
getRows(): Promise<TableElement<T>[]>;
|
|
69
63
|
asyncCreateNew(insertAt?: number): Promise<void>;
|