@sumaris-net/ngx-components 2.8.2-beta4 → 2.8.3-beta10
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/doc/changelog.md +3 -1
- package/esm2022/src/app/admin/users/users.mjs +5 -5
- package/esm2022/src/app/core/account/token.table.mjs +3 -3
- package/esm2022/src/app/core/form/form-container.class.mjs +11 -2
- package/esm2022/src/app/core/form/properties/properties.table.mjs +4 -4
- package/esm2022/src/app/core/table/async-table.class.mjs +92 -78
- package/esm2022/src/app/core/table/entities-table-datasource.class.mjs +1 -1
- package/esm2022/src/app/core/table/memory-table.class.mjs +2 -2
- package/esm2022/src/app/core/table/table.class.mjs +26 -24
- package/esm2022/src/app/core/table/testing/table.testing.mjs +3 -3
- package/esm2022/src/app/core/table/testing/table2.testing.mjs +3 -3
- package/esm2022/src/app/shared/functions.mjs +4 -1
- package/fesm2022/sumaris-net.ngx-components.mjs +4410 -4383
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/form-container.class.d.ts +3 -2
- package/src/app/core/table/async-table.class.d.ts +12 -9
- package/src/app/core/table/table.class.d.ts +3 -2
- package/src/app/shared/functions.d.ts +1 -0
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -6,10 +6,11 @@ import { AppTable } from '../table/table.class';
|
|
|
6
6
|
import { AppForm } from './form.class';
|
|
7
7
|
import { AppEditor } from './entity/editor.class';
|
|
8
8
|
import { AbstractControl } from '@angular/forms';
|
|
9
|
+
import { AppAsyncTable } from '../table/async-table.class';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export interface IAppFormContainer<T = any> extends IAppForm<T> {
|
|
11
12
|
children: IAppForm[];
|
|
12
|
-
tables: AppTable<any>[];
|
|
13
|
+
tables: (AppTable<any> | AppAsyncTable<any>)[];
|
|
13
14
|
forms: AppForm<any>[];
|
|
14
15
|
editors: AppEditor<any>[];
|
|
15
16
|
addForm(path: string, form?: IAppForm | IAppFormGetter): void;
|
|
@@ -29,7 +30,7 @@ export declare abstract class AppFormContainer<T = any> implements IAppFormConta
|
|
|
29
30
|
readonly touchedSubject: BehaviorSubject<boolean>;
|
|
30
31
|
readonly errorSubject: BehaviorSubject<string>;
|
|
31
32
|
get children(): IAppForm[];
|
|
32
|
-
get tables(): AppTable<any>[];
|
|
33
|
+
get tables(): (AppTable<any> | AppAsyncTable<any>)[];
|
|
33
34
|
get forms(): AppForm<any>[];
|
|
34
35
|
get editors(): AppEditor<any>[];
|
|
35
36
|
get error(): string;
|
|
@@ -5,7 +5,7 @@ import { MatTable } from '@angular/material/table';
|
|
|
5
5
|
import { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';
|
|
6
6
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
7
7
|
import { IEntity } from '../services/model/entity.model';
|
|
8
|
-
import { AlertController, ModalController, ToastController } from '@ionic/angular';
|
|
8
|
+
import { AlertController, ModalController, NavController, ToastController } from '@ionic/angular';
|
|
9
9
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
10
10
|
import { ColumnItem } from './table-select-columns.component';
|
|
11
11
|
import { Location } from '@angular/common';
|
|
@@ -36,6 +36,7 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
36
36
|
protected allowRowDetail: boolean;
|
|
37
37
|
protected route: ActivatedRoute;
|
|
38
38
|
protected router: Router;
|
|
39
|
+
protected navController: NavController;
|
|
39
40
|
protected location: Location;
|
|
40
41
|
protected settings: LocalSettingsService;
|
|
41
42
|
protected translate: TranslateService;
|
|
@@ -260,11 +261,12 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
260
261
|
}): Promise<number>;
|
|
261
262
|
selectRowById(id: number): Promise<boolean>;
|
|
262
263
|
/**
|
|
263
|
-
* Try to select row by data. Will use
|
|
264
|
+
* Try to select row by data. Will use equals() to find same row's data
|
|
264
265
|
*
|
|
265
266
|
* @param data
|
|
266
267
|
*/
|
|
267
268
|
selectRowByData(data: T): Promise<boolean>;
|
|
269
|
+
toggleSelectRow(event: Event, row: AsyncTableElement<T>): void;
|
|
268
270
|
clickRow(event: Event | undefined, row: AsyncTableElement<T>): Promise<boolean>;
|
|
269
271
|
moveRow(id: number, direction: number): Promise<void>;
|
|
270
272
|
ready(opts?: WaitForOptions): Promise<void>;
|
|
@@ -347,7 +349,7 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
347
349
|
emitEvent?: boolean;
|
|
348
350
|
}): void;
|
|
349
351
|
/**
|
|
350
|
-
* Compare data equality (default by id)
|
|
352
|
+
* Compare data equality (default by id, using EntityUtils.equals())
|
|
351
353
|
* Can be overridden to add additional properties to compare
|
|
352
354
|
*
|
|
353
355
|
* @param d1
|
|
@@ -361,6 +363,13 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
361
363
|
}): void;
|
|
362
364
|
protected getPageSettings<T = any>(propertyName?: string): T;
|
|
363
365
|
protected savePageSettings(value: any, propertyName?: string): Promise<void>;
|
|
366
|
+
protected emitRefresh(value?: any): void;
|
|
367
|
+
/**
|
|
368
|
+
* Initialize the permanent selection model
|
|
369
|
+
*
|
|
370
|
+
* @protected
|
|
371
|
+
*/
|
|
372
|
+
protected initPermanentSelection(): void;
|
|
364
373
|
private listenSortAndPaginationEvents;
|
|
365
374
|
private editRowById;
|
|
366
375
|
private setLoading;
|
|
@@ -373,12 +382,6 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
|
|
|
373
382
|
private listenDatasourceLoading;
|
|
374
383
|
private startCellValueChanges;
|
|
375
384
|
private stopCellValueChanges;
|
|
376
|
-
/**
|
|
377
|
-
* Initialize the permanent selection model
|
|
378
|
-
*
|
|
379
|
-
* @protected
|
|
380
|
-
*/
|
|
381
|
-
private initPermanentSelection;
|
|
382
385
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppAsyncTable<any, any, any>, never>;
|
|
383
386
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AppAsyncTable<any, any, any>, never, never, { "settingsId": { "alias": "settingsId"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "i18nColumnPrefix": { "alias": "i18nColumnPrefix"; "required": false; }; "i18nColumnSuffix": { "alias": "i18nColumnSuffix"; "required": false; }; "autoLoad": { "alias": "autoLoad"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "inlineEdition": { "alias": "inlineEdition"; "required": false; }; "focusFirstColumn": { "alias": "focusFirstColumn"; "required": false; }; "confirmBeforeDelete": { "alias": "confirmBeforeDelete"; "required": false; }; "confirmBeforeCancel": { "alias": "confirmBeforeCancel"; "required": false; }; "undoableDeletion": { "alias": "undoableDeletion"; "required": false; }; "saveBeforeDelete": { "alias": "saveBeforeDelete"; "required": false; }; "keepEditedRowOnSave": { "alias": "keepEditedRowOnSave"; "required": false; }; "saveBeforeSort": { "alias": "saveBeforeSort"; "required": false; }; "saveBeforeFilter": { "alias": "saveBeforeFilter"; "required": false; }; "propagateRowError": { "alias": "propagateRowError"; "required": false; }; "permanentSelectionAllowed": { "alias": "permanentSelectionAllowed"; "required": false; }; "defaultSortBy": { "alias": "defaultSortBy"; "required": false; }; "defaultSortDirection": { "alias": "defaultSortDirection"; "required": false; }; "defaultPageSize": { "alias": "defaultPageSize"; "required": false; }; "defaultPageSizeOptions": { "alias": "defaultPageSizeOptions"; "required": false; }; "focusColumn": { "alias": "focusColumn"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "paginator": { "alias": "paginator"; "required": false; }; }, { "onRefresh": "onRefresh"; "onOpenRow": "onOpenRow"; "onNewRow": "onNewRow"; "onStartEditingRow": "onStartEditingRow"; "onConfirmEditCreateRow": "onConfirmEditCreateRow"; "onCancelOrDeleteRow": "onCancelOrDeleteRow"; "onBeforeDeleteRows": "onBeforeDeleteRows"; "onBeforeCancelRows": "onBeforeCancelRows"; "onBeforeSave": "onBeforeSave"; "onAfterDeletedRows": "onAfterDeletedRows"; "onSort": "onSort"; "onDirty": "onDirty"; "onError": "onError"; }, never, never, false, never>;
|
|
384
387
|
}
|
|
@@ -276,7 +276,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
276
276
|
moveRow(id: number, direction: number): void;
|
|
277
277
|
ready(opts?: WaitForOptions): Promise<void>;
|
|
278
278
|
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
279
|
-
openSelectColumnsModal(
|
|
279
|
+
openSelectColumnsModal(event?: Event): Promise<any>;
|
|
280
280
|
trackByFn(index: number, row: TableElement<T>): number;
|
|
281
281
|
doRefresh(event?: CompletableEvent): void;
|
|
282
282
|
getCurrentColumns(): ColumnItem[];
|
|
@@ -306,7 +306,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
306
306
|
protected saveBeforeAction(saveAction: SaveActionType): Promise<boolean>;
|
|
307
307
|
/**
|
|
308
308
|
* Open a row detail view. By default, will to open row detail page.
|
|
309
|
-
* Can be
|
|
309
|
+
* Can be overridden by subclasses, BUT prefer to subscribe on onOpenRow
|
|
310
310
|
*
|
|
311
311
|
* @param id
|
|
312
312
|
* @param row
|
|
@@ -368,6 +368,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
368
368
|
}): void;
|
|
369
369
|
protected getPageSettings<T = any>(propertyName?: string): T;
|
|
370
370
|
protected savePageSettings(value: any, propertyName?: string): Promise<void>;
|
|
371
|
+
protected emitRefresh(value?: any): void;
|
|
371
372
|
/**
|
|
372
373
|
* Initialize the permanent selection model
|
|
373
374
|
*
|
|
@@ -7,6 +7,7 @@ export declare function isNotNilOrNaN<T>(obj: T | null | undefined): boolean;
|
|
|
7
7
|
export declare function isNilOrNaN<T>(obj: T | null | undefined): boolean;
|
|
8
8
|
export declare function isNotEmptyArray<T>(obj: T[] | null | undefined): boolean;
|
|
9
9
|
export declare function firstArrayValue<T>(obj: T[] | null | undefined): T | undefined;
|
|
10
|
+
export declare function lastArrayValue<T>(obj: T[] | null | undefined): T | undefined;
|
|
10
11
|
export declare function isEmptyArray<T>(obj: T[] | null | undefined): boolean;
|
|
11
12
|
export declare function isNotNilBoolean(obj: any | null | undefined): obj is boolean;
|
|
12
13
|
export declare function isNotNilString(obj: any | null | undefined): obj is string;
|
package/src/assets/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ngx-sumaris-components",
|
|
3
3
|
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "2.8.
|
|
5
|
+
"version": "2.8.3-beta10",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|