@sumaris-net/ngx-components 2.4.56 → 2.4.57
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/src/app/core/services/model/entity.model.mjs +10 -1
- package/esm2020/src/app/core/table/table.class.mjs +58 -22
- package/esm2020/src/app/core/table/table.utils.mjs +18 -1
- package/fesm2015/sumaris-net.ngx-components.mjs +81 -21
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +80 -21
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/model/entity.model.d.ts +3 -0
- package/src/app/core/table/table.class.d.ts +8 -10
- package/src/app/core/table/table.utils.d.ts +4 -0
package/package.json
CHANGED
|
@@ -83,4 +83,7 @@ export declare abstract class EntityUtils {
|
|
|
83
83
|
static isRemote(entity: IEntity<any, any> | Entity<any, any>): boolean;
|
|
84
84
|
static isLocalId(id: number): boolean;
|
|
85
85
|
static isRemoteId(id: number): boolean;
|
|
86
|
+
static getId<T extends IEntity<T, ID> = IEntity<any, any>, ID = any>(entity: T): ID;
|
|
87
|
+
static collectById<T extends IEntity<T, ID>, ID = any>(entities: T[]): ID[];
|
|
88
|
+
static arrayDistinctFilterFn<E extends IEntity<any, any>>(item: E, index: number, values: E[]): boolean;
|
|
86
89
|
}
|
|
@@ -63,15 +63,8 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
63
63
|
*/
|
|
64
64
|
get error$(): Observable<string>;
|
|
65
65
|
set error(error: string);
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated
|
|
68
|
-
*/
|
|
69
|
-
get loading$(): Observable<boolean>;
|
|
70
|
-
/**
|
|
71
|
-
* @deprecated
|
|
72
|
-
*/
|
|
73
|
-
get saving$(): Observable<boolean>;
|
|
74
66
|
selection: SelectionModel<TableElement<T>>;
|
|
67
|
+
permanentSelection: SelectionModel<T>;
|
|
75
68
|
editedRow: TableElement<T>;
|
|
76
69
|
autocompleteFields: {
|
|
77
70
|
[key: string]: MatAutocompleteFieldConfig;
|
|
@@ -87,7 +80,6 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
87
80
|
focusFirstColumn: boolean;
|
|
88
81
|
confirmBeforeDelete: boolean;
|
|
89
82
|
confirmBeforeCancel: boolean;
|
|
90
|
-
clearSelectionBeforeOpen: boolean;
|
|
91
83
|
undoableDeletion: boolean;
|
|
92
84
|
saveBeforeDelete: boolean;
|
|
93
85
|
keepEditedRowOnSave: boolean;
|
|
@@ -106,6 +98,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
106
98
|
set filter(value: F);
|
|
107
99
|
get filter(): F;
|
|
108
100
|
get empty(): boolean;
|
|
101
|
+
get selectedEntities(): T[];
|
|
109
102
|
onRefresh: EventEmitter<any>;
|
|
110
103
|
onOpenRow: EventEmitter<TableElement<T>>;
|
|
111
104
|
onNewRow: EventEmitter<any>;
|
|
@@ -378,6 +371,11 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
378
371
|
private listenDatasourceLoading;
|
|
379
372
|
private startCellValueChanges;
|
|
380
373
|
private stopCellValueChanges;
|
|
374
|
+
/**
|
|
375
|
+
* Initialize the permanent selection model
|
|
376
|
+
* @protected
|
|
377
|
+
*/
|
|
378
|
+
protected initPermanentSelection(): void;
|
|
381
379
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppTable<any, any, any>, never>;
|
|
382
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AppTable<any, any, any>, never, never, { "settingsId": "settingsId"; "debug": "debug"; "i18nColumnPrefix": "i18nColumnPrefix"; "i18nColumnSuffix": "i18nColumnSuffix"; "autoLoad": "autoLoad"; "readOnly": "readOnly"; "inlineEdition": "inlineEdition"; "focusFirstColumn": "focusFirstColumn"; "confirmBeforeDelete": "confirmBeforeDelete"; "confirmBeforeCancel": "confirmBeforeCancel"; "
|
|
380
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AppTable<any, any, any>, never, never, { "settingsId": "settingsId"; "debug": "debug"; "i18nColumnPrefix": "i18nColumnPrefix"; "i18nColumnSuffix": "i18nColumnSuffix"; "autoLoad": "autoLoad"; "readOnly": "readOnly"; "inlineEdition": "inlineEdition"; "focusFirstColumn": "focusFirstColumn"; "confirmBeforeDelete": "confirmBeforeDelete"; "confirmBeforeCancel": "confirmBeforeCancel"; "undoableDeletion": "undoableDeletion"; "saveBeforeDelete": "saveBeforeDelete"; "keepEditedRowOnSave": "keepEditedRowOnSave"; "saveBeforeSort": "saveBeforeSort"; "saveBeforeFilter": "saveBeforeFilter"; "propagateRowError": "propagateRowError"; "defaultSortBy": "defaultSortBy"; "defaultSortDirection": "defaultSortDirection"; "defaultPageSize": "defaultPageSize"; "defaultPageSizeOptions": "defaultPageSizeOptions"; "focusColumn": "focusColumn"; "dataSource": "dataSource"; "filter": "filter"; "disabled": "disabled"; "paginator": "paginator"; }, { "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>;
|
|
383
381
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { AppTable } from './table.class';
|
|
2
2
|
import { TableElement } from '@e-is/ngx-material-table';
|
|
3
3
|
import { AsyncTableElement } from '@e-is/ngx-material-table/src/app/ngx-material-table/async/async-table-element';
|
|
4
|
+
import { IEntity } from '../services/model/entity.model';
|
|
4
5
|
export declare class AppTableUtils {
|
|
5
6
|
static waitIdle(table: AppTable<any, any, any>): Promise<any>;
|
|
6
7
|
static logRowErrors(row: TableElement<any> | AsyncTableElement<any>, logPrefix?: string): void;
|
|
8
|
+
static getEntityId<T extends IEntity<T, ID> = IEntity<any, any>, ID = any>(row: TableElement<T> | AsyncTableElement<T>): ID;
|
|
9
|
+
static getEntityIds<T extends IEntity<T, ID> = IEntity<any, any>, ID = any>(rows: TableElement<T>[] | AsyncTableElement<T>[]): ID[];
|
|
10
|
+
static getEntities<T extends IEntity<T, ID> = IEntity<any, any>, ID = any>(rows: TableElement<T>[] | AsyncTableElement<T>[]): T[];
|
|
7
11
|
}
|