@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "0.18.11",
4
+ "version": "0.18.16",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -19,4 +19,5 @@ export declare abstract class AppInMemoryTable<T extends IEntity<T, ID>, F = any
19
19
  setValue(value: T[], opts?: {
20
20
  emitEvent?: boolean;
21
21
  }): void;
22
+ protected equals(t1: T, t2: T): boolean;
22
23
  }
@@ -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 previouslySavedEditedRowId: number;
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
- protected editRow(event: Event | undefined, row: TableElement<T>, opts?: {
281
- focusColumn?: string;
282
- }): boolean;
283
- selectRowById(id: number): void;
284
- selectRowByData(data: T): void;
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 openRow(id: ID, row: TableElement<T>): Promise<boolean>;
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 t1
350
- * @param t2
360
+ * @param d1
361
+ * @param d2
351
362
  * @protected
352
363
  */
353
- protected dataEquals(t1: T, t2: T): boolean;
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 equals(d1: T, d2: T): boolean;
48
+ protected markAsSaving(): void;
49
+ protected markAsSaved(): void;
47
50
  }