@sumaris-net/ngx-components 0.18.11 → 0.18.16
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/ngx-sumaris-components.umd.js +171 -102
- package/bundles/ngx-sumaris-components.umd.js.map +1 -1
- package/bundles/ngx-sumaris-components.umd.min.js +1 -1
- package/bundles/ngx-sumaris-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/services/model/entity.model.js +2 -1
- package/esm2015/src/app/core/table/memory-table.class.js +4 -1
- package/esm2015/src/app/core/table/table.class.js +77 -46
- package/esm2015/src/app/shared/services/memory-entity-service.class.js +88 -67
- package/fesm2015/ngx-sumaris-components.js +166 -111
- package/fesm2015/ngx-sumaris-components.js.map +1 -1
- package/ngx-sumaris-components.metadata.json +1 -1
- package/package.json +1 -1
- package/src/app/core/table/memory-table.class.d.ts +1 -0
- package/src/app/core/table/table.class.d.ts +21 -10
- package/src/app/shared/services/memory-entity-service.class.d.ts +4 -1
package/package.json
CHANGED
|
@@ -64,7 +64,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
64
64
|
protected alertCtrl: AlertController;
|
|
65
65
|
protected toastController: ToastController;
|
|
66
66
|
protected _focusColumn: string;
|
|
67
|
-
protected
|
|
67
|
+
protected previouslyEditedRowId: number;
|
|
68
68
|
excludesColumns: string[];
|
|
69
69
|
displayedColumns: string[];
|
|
70
70
|
totalRowCount: number | null;
|
|
@@ -277,11 +277,12 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
277
277
|
deleteRows(event: UIEvent | null, rows: TableElement<T>[], opts?: {
|
|
278
278
|
interactive?: boolean;
|
|
279
279
|
}): Promise<number>;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
selectRowById(id: number): Promise<boolean>;
|
|
281
|
+
/**
|
|
282
|
+
* Try to select row by data. Will use dataEquals() (that call EntityUtils.equals()) to find same row's data
|
|
283
|
+
* @param data
|
|
284
|
+
*/
|
|
285
|
+
selectRowByData(data: T): Promise<boolean>;
|
|
285
286
|
clickRow(event: UIEvent | undefined, row: TableElement<T>): boolean;
|
|
286
287
|
moveRow(id: number, direction: number): void;
|
|
287
288
|
openSelectColumnsModal(event?: Event): Promise<any>;
|
|
@@ -289,6 +290,16 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
289
290
|
doRefresh(event?: CompletableEvent): void;
|
|
290
291
|
getCurrentColumns(): ColumnItem[];
|
|
291
292
|
escapeEditingRow(event?: Event, row?: TableElement<T>): void;
|
|
293
|
+
protected editRow(event: Event | undefined, row: TableElement<T>, opts?: {
|
|
294
|
+
focusColumn?: string;
|
|
295
|
+
}): boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Try to select row, by row.id, or by data. WIll use EntityUtils.equals()
|
|
298
|
+
* @param id
|
|
299
|
+
* @param data
|
|
300
|
+
* @protected
|
|
301
|
+
*/
|
|
302
|
+
protected selectRowByIdOrData(id: number, data?: T): Promise<boolean>;
|
|
292
303
|
/**
|
|
293
304
|
* return the selected row if unique in selection
|
|
294
305
|
*/
|
|
@@ -300,7 +311,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
300
311
|
interactive?: boolean;
|
|
301
312
|
}): Promise<boolean>;
|
|
302
313
|
protected saveBeforeAction(saveAction: SaveActionType): Promise<boolean>;
|
|
303
|
-
protected
|
|
314
|
+
protected openRowDetail(id: ID, row: TableElement<T>): Promise<boolean>;
|
|
304
315
|
protected openNewRowDetail(event?: any): Promise<boolean>;
|
|
305
316
|
protected getRequiredColumns(): string[];
|
|
306
317
|
protected getUserColumns(): string[];
|
|
@@ -346,11 +357,11 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
346
357
|
* Compare data equality (default by id)
|
|
347
358
|
* Can be overridden to add additional properties to compare
|
|
348
359
|
*
|
|
349
|
-
* @param
|
|
350
|
-
* @param
|
|
360
|
+
* @param d1
|
|
361
|
+
* @param d2
|
|
351
362
|
* @protected
|
|
352
363
|
*/
|
|
353
|
-
protected
|
|
364
|
+
protected equals(d1: T, d2: T): boolean;
|
|
354
365
|
private setLoading;
|
|
355
366
|
private deleteNewRow;
|
|
356
367
|
private cancelExistingRow;
|
|
@@ -21,6 +21,7 @@ export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any,
|
|
|
21
21
|
dirty: boolean;
|
|
22
22
|
protected data: T[];
|
|
23
23
|
private _hiddenData;
|
|
24
|
+
private _saving;
|
|
24
25
|
private readonly _onChange;
|
|
25
26
|
private readonly _sortFn;
|
|
26
27
|
private readonly _onLoad;
|
|
@@ -41,7 +42,9 @@ export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any,
|
|
|
41
42
|
sort(data: T[], sortBy?: string, sortDirection?: SortDirection): T[];
|
|
42
43
|
asFilter(source: Partial<F>): F;
|
|
43
44
|
addSortByReplacement(source: string, target: string): void;
|
|
45
|
+
equals(d1: T, d2: T): boolean;
|
|
44
46
|
protected filter(data: T[], _filter: F, hiddenData: T[]): T[];
|
|
45
47
|
protected connect(): Observable<LoadResult<T>>;
|
|
46
|
-
protected
|
|
48
|
+
protected markAsSaving(): void;
|
|
49
|
+
protected markAsSaved(): void;
|
|
47
50
|
}
|