@sumaris-net/ngx-components 2.0.0-rc3 → 2.0.0-rc4
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 +13 -0
- package/esm2020/src/app/core/form/editor.class.mjs +4 -1
- package/esm2020/src/app/core/form/entity-editor-modal.class.mjs +19 -5
- package/esm2020/src/app/core/form/form.class.mjs +4 -1
- package/esm2020/src/app/core/form/form.utils.mjs +3 -3
- package/esm2020/src/app/core/icon/icon.component.mjs +2 -2
- package/esm2020/src/app/core/services/model/peer.model.mjs +3 -3
- package/esm2020/src/app/core/services/model/referential.model.mjs +11 -3
- package/esm2020/src/app/core/table/entities-table-datasource.class.mjs +1 -1
- package/esm2020/src/app/core/table/table.class.mjs +162 -159
- package/esm2020/src/app/shared/events.mjs +2 -2
- package/esm2020/src/app/shared/graph/graph-colors.mjs +17 -63
- package/esm2020/src/app/shared/material/autocomplete/material.autocomplete.mjs +3 -5
- package/esm2020/src/app/shared/material/chips/material.chips.mjs +2 -3
- package/esm2020/src/app/shared/material/material.animations.mjs +1 -1
- package/esm2020/src/app/shared/material/material.testing.module.mjs +18 -6
- package/esm2020/src/app/shared/observables.mjs +29 -22
- package/esm2020/src/app/shared/services/memory-entity-service.class.mjs +12 -6
- package/esm2020/src/app/shared/testing/observable.test.mjs +96 -0
- package/fesm2015/sumaris-net.ngx-components.mjs +489 -422
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +359 -266
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/editor.class.d.ts +1 -0
- package/src/app/core/form/entity-editor-modal.class.d.ts +13 -4
- package/src/app/core/form/form.class.d.ts +1 -0
- package/src/app/core/form/form.utils.d.ts +2 -2
- package/src/app/core/services/model/referential.model.d.ts +6 -1
- package/src/app/core/table/table.class.d.ts +34 -47
- package/src/app/shared/events.d.ts +4 -4
- package/src/app/shared/graph/graph-colors.d.ts +8 -8
- package/src/app/shared/material/material.testing.module.d.ts +9 -8
- package/src/app/shared/observables.d.ts +1 -1
- package/src/app/shared/services/memory-entity-service.class.d.ts +5 -0
- package/src/app/shared/testing/observable.test.d.ts +25 -0
- package/src/theme/_ionic.globals.scss +4 -0
- package/src/theme/_material.globals.scss +3 -1
- package/src/theme/_mixins.scss +3 -3
package/package.json
CHANGED
|
@@ -88,6 +88,7 @@ export declare abstract class AppEditor<T = any, ID = number, O = any> implement
|
|
|
88
88
|
get error(): string;
|
|
89
89
|
set error(error: string);
|
|
90
90
|
get saving(): boolean;
|
|
91
|
+
get destroyed(): boolean;
|
|
91
92
|
toolbar: ToolbarToken | null;
|
|
92
93
|
formButtonsBar: FormButtonsBarToken | null;
|
|
93
94
|
content: IonContent;
|
|
@@ -13,11 +13,12 @@ import { FormErrorTranslator } from '../../shared/validator/form-error-adapter.c
|
|
|
13
13
|
import { AppErrorWithDetails } from './entity-editor.class';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
15
15
|
export interface IEntityEditorModalOptions<T extends Entity<T, ID> = Entity<any, any>, ID = number> {
|
|
16
|
-
|
|
16
|
+
isNew: boolean;
|
|
17
17
|
data: T;
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
onAfterModalInit?: <M extends AppEntityEditorModal<T, ID>>(modal: M) => void | Promise<void>;
|
|
20
20
|
onDelete?: (event: Event, data: T) => Promise<boolean>;
|
|
21
|
+
usageMode: UsageMode;
|
|
21
22
|
mobile: boolean;
|
|
22
23
|
i18nSuffix?: string;
|
|
23
24
|
}
|
|
@@ -28,7 +29,7 @@ export declare abstract class AppEntityEditorModal<T extends Entity<T, ID>, ID =
|
|
|
28
29
|
protected dataType: new () => T;
|
|
29
30
|
private _usageMode;
|
|
30
31
|
protected _logPrefix: any;
|
|
31
|
-
protected
|
|
32
|
+
protected _isNew: boolean;
|
|
32
33
|
protected readonly dateFormat: DateFormatPipe;
|
|
33
34
|
protected readonly cd: ChangeDetectorRef;
|
|
34
35
|
protected readonly settings: LocalSettingsService;
|
|
@@ -43,8 +44,16 @@ export declare abstract class AppEntityEditorModal<T extends Entity<T, ID>, ID =
|
|
|
43
44
|
onAfterModalInit: <M extends AppEntityEditorModal<T, ID>>(modal: M) => void | Promise<void>;
|
|
44
45
|
onDelete: (event: Event, data: T) => Promise<boolean>;
|
|
45
46
|
i18nSuffix: string;
|
|
46
|
-
set
|
|
47
|
+
set isNew(value: boolean);
|
|
48
|
+
get isNew(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated use isNew instead
|
|
51
|
+
*/
|
|
47
52
|
get isNewData(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated use isNew instead
|
|
55
|
+
*/
|
|
56
|
+
set isNewData(value: boolean);
|
|
48
57
|
set disabled(value: boolean);
|
|
49
58
|
get disabled(): boolean;
|
|
50
59
|
get isOnFieldMode(): boolean;
|
|
@@ -118,5 +127,5 @@ export declare abstract class AppEntityEditorModal<T extends Entity<T, ID>, ID =
|
|
|
118
127
|
*/
|
|
119
128
|
private openFirstInvalidTab;
|
|
120
129
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppEntityEditorModal<any, any, any>, never>;
|
|
121
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AppEntityEditorModal<any, any, any>, never, never, { "data": "data"; "mobile": "mobile"; "usageMode": "usageMode"; "onAfterModalInit": "onAfterModalInit"; "onDelete": "onDelete"; "i18nSuffix": "i18nSuffix"; "isNewData": "isNewData"; "disabled": "disabled"; }, {}, never, never, false>;
|
|
130
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AppEntityEditorModal<any, any, any>, never, never, { "data": "data"; "mobile": "mobile"; "usageMode": "usageMode"; "onAfterModalInit": "onAfterModalInit"; "onDelete": "onDelete"; "i18nSuffix": "i18nSuffix"; "isNew": "isNew"; "isNewData": "isNewData"; "disabled": "disabled"; }, {}, never, never, false>;
|
|
122
131
|
}
|
|
@@ -63,6 +63,7 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
|
|
|
63
63
|
onlySelf?: boolean;
|
|
64
64
|
emitEvent?: boolean;
|
|
65
65
|
}): void;
|
|
66
|
+
get destroyed(): boolean;
|
|
66
67
|
debug: boolean;
|
|
67
68
|
tabindex: number;
|
|
68
69
|
errorTranslatorOptions: FormErrorTranslatorOptions;
|
|
@@ -2,7 +2,7 @@ import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup
|
|
|
2
2
|
import { Entity } from '../services/model/entity.model';
|
|
3
3
|
import { filterNumberInput, selectInputContent } from '../../shared/inputs';
|
|
4
4
|
import { WaitForOptions } from '../../shared/observables';
|
|
5
|
-
import {
|
|
5
|
+
import { clearValueInArray, copyEntity2Form, disableControls, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, pushValueInArray, removeValueInArray, resizeArray, updateValueAndValidity, waitIdle, waitWhilePending } from '../../shared/forms';
|
|
6
6
|
export declare type IAppFormGetter = () => IAppForm;
|
|
7
7
|
export declare interface OnReady {
|
|
8
8
|
ngOnReady(): any;
|
|
@@ -258,7 +258,7 @@ export declare class AppFormUtils {
|
|
|
258
258
|
static updateValueAndValidity: typeof updateValueAndValidity;
|
|
259
259
|
static getFormErrors: typeof getFormErrors;
|
|
260
260
|
static isForm(object: any): object is IAppForm;
|
|
261
|
-
static
|
|
261
|
+
static pushValueInArray: typeof pushValueInArray;
|
|
262
262
|
static removeValueInArray: typeof removeValueInArray;
|
|
263
263
|
static resizeArray: typeof resizeArray;
|
|
264
264
|
static clearValueInArray: typeof clearValueInArray;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
2
|
import { Entity, EntityAsObjectOptions, IEntity } from './entity.model';
|
|
3
|
+
import { IconRef } from '../../../shared/types';
|
|
3
4
|
export declare function referentialToString(obj: Referential | any, properties?: string[]): string | undefined;
|
|
4
5
|
export declare function referentialsToString(values: Referential[], properties?: string[], separator?: string): string;
|
|
5
6
|
export declare interface IStatus {
|
|
@@ -8,7 +9,7 @@ export declare interface IStatus {
|
|
|
8
9
|
label: string;
|
|
9
10
|
}
|
|
10
11
|
export declare const StatusList: Readonly<IStatus[]>;
|
|
11
|
-
export declare const StatusById: Readonly<import("
|
|
12
|
+
export declare const StatusById: Readonly<import("../../../shared/types").KeyValueType<IStatus>>;
|
|
12
13
|
export declare interface IReferentialRef<T extends IEntity<T, ID> = IEntity<any, any>, ID = number> extends IEntity<T, ID> {
|
|
13
14
|
label: string;
|
|
14
15
|
name: string;
|
|
@@ -16,6 +17,7 @@ export declare interface IReferentialRef<T extends IEntity<T, ID> = IEntity<any,
|
|
|
16
17
|
levelId?: number;
|
|
17
18
|
statusId: number;
|
|
18
19
|
entityName: string;
|
|
20
|
+
icon?: IconRef;
|
|
19
21
|
}
|
|
20
22
|
export declare abstract class BaseReferential<T extends BaseReferential<T, ID, AO>, ID = number, AO extends ReferentialAsObjectOptions = ReferentialAsObjectOptions, FO = any> extends Entity<T, ID, AO, FO> implements IReferentialRef<T, ID> {
|
|
21
23
|
label: string;
|
|
@@ -28,6 +30,7 @@ export declare abstract class BaseReferential<T extends BaseReferential<T, ID, A
|
|
|
28
30
|
levelId: number;
|
|
29
31
|
parentId: number;
|
|
30
32
|
entityName: string;
|
|
33
|
+
icon?: IconRef;
|
|
31
34
|
constructor(__typename?: string);
|
|
32
35
|
asObject(opts?: AO): any;
|
|
33
36
|
fromObject(source: any, opts?: FO): void;
|
|
@@ -44,6 +47,7 @@ export declare class ReferentialUtils {
|
|
|
44
47
|
}
|
|
45
48
|
export interface ReferentialAsObjectOptions extends EntityAsObjectOptions {
|
|
46
49
|
keepEntityName?: boolean;
|
|
50
|
+
keepIcon?: boolean;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
53
|
* Used to store an entity locally
|
|
@@ -61,6 +65,7 @@ export declare class ReferentialRef<T extends ReferentialRef<any, ID> = Referent
|
|
|
61
65
|
statusId: number;
|
|
62
66
|
levelId: number;
|
|
63
67
|
entityName: string;
|
|
68
|
+
icon?: IconRef;
|
|
64
69
|
constructor();
|
|
65
70
|
asObject(opts?: O): any;
|
|
66
71
|
fromObject(source: any, opts?: FO): void;
|
|
@@ -14,13 +14,13 @@ import { Location } from '@angular/common';
|
|
|
14
14
|
import { IAppForm } from '../form/form.utils';
|
|
15
15
|
import { LocalSettingsService } from '../services/local-settings.service';
|
|
16
16
|
import { TranslateService } from '@ngx-translate/core';
|
|
17
|
+
import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete.config';
|
|
17
18
|
import { CompletableEvent } from '../../shared/events';
|
|
18
19
|
import { WaitForOptions } from '../../shared/observables';
|
|
19
20
|
import { ShowToastOptions } from '../../shared/toast/toasts';
|
|
20
21
|
import { CdkColumnDef } from '@angular/cdk/table';
|
|
21
22
|
import { LoadResult } from '../../shared/services/entity-service.class';
|
|
22
23
|
import { FormErrorTranslator, FormErrorTranslatorOptions, IFormControlPathTranslator } from '../../shared/validator/form-error-adapter.class';
|
|
23
|
-
import { MatAutocompleteConfigHolder, MatAutocompleteFieldAddOptions, MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete.config';
|
|
24
24
|
import * as i0 from "@angular/core";
|
|
25
25
|
export declare const SETTINGS_DISPLAY_COLUMNS = "displayColumns";
|
|
26
26
|
export declare const SETTINGS_SORTED_COLUMN = "sortedColumn";
|
|
@@ -41,7 +41,7 @@ export interface IModalDetailOptions<T = any> {
|
|
|
41
41
|
isNew: boolean;
|
|
42
42
|
data: T;
|
|
43
43
|
disabled: boolean;
|
|
44
|
-
onDelete?: (event:
|
|
44
|
+
onDelete?: (event: UIEvent, data: T) => Promise<boolean>;
|
|
45
45
|
}
|
|
46
46
|
export declare type SaveActionType = 'delete' | 'sort' | 'filter';
|
|
47
47
|
export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = number> implements OnInit, OnDestroy, AfterViewInit, IAppForm, IFormControlPathTranslator {
|
|
@@ -126,6 +126,10 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
126
126
|
get filter(): F;
|
|
127
127
|
get empty(): boolean;
|
|
128
128
|
onRefresh: EventEmitter<any>;
|
|
129
|
+
onOpenIdAndRow: EventEmitter<{
|
|
130
|
+
id: ID;
|
|
131
|
+
row: TableElement<T>;
|
|
132
|
+
}>;
|
|
129
133
|
onOpenRow: EventEmitter<TableElement<T>>;
|
|
130
134
|
onNewRow: EventEmitter<any>;
|
|
131
135
|
onStartEditingRow: EventEmitter<TableElement<T>>;
|
|
@@ -215,6 +219,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
215
219
|
private _paginator;
|
|
216
220
|
set paginator(value: MatPaginator);
|
|
217
221
|
get paginator(): MatPaginator;
|
|
222
|
+
get destroyed(): boolean;
|
|
218
223
|
table: MatTable<T>;
|
|
219
224
|
childPaginator: MatPaginator;
|
|
220
225
|
sort: MatSort;
|
|
@@ -232,20 +237,20 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
232
237
|
setFilter(filter: F, opts?: {
|
|
233
238
|
emitEvent?: boolean;
|
|
234
239
|
}): void;
|
|
235
|
-
confirmAndAdd(event?: Event, row?: TableElement<T>): Promise<boolean>;
|
|
236
|
-
confirmAndBackward(event?: Event, row?: TableElement<T>):
|
|
237
|
-
confirmAndForward(event?: Event, row?: TableElement<T>): Promise<boolean>;
|
|
240
|
+
confirmAndAdd(event?: Event, row?: TableElement<T>): boolean | Promise<boolean>;
|
|
241
|
+
confirmAndBackward(event?: Event, row?: TableElement<T>): boolean;
|
|
242
|
+
confirmAndForward(event?: Event, row?: TableElement<T>): boolean | Promise<boolean>;
|
|
238
243
|
/**
|
|
239
244
|
* Confirm the creation of the given row, or if not specified the currently edited row
|
|
240
245
|
*
|
|
241
246
|
* @param event
|
|
242
247
|
* @param row
|
|
243
248
|
*/
|
|
244
|
-
confirmEditCreate(event?: Event, row?: TableElement<T>):
|
|
245
|
-
cancelOrDelete(event: Event
|
|
249
|
+
confirmEditCreate(event?: Event, row?: TableElement<T>): boolean;
|
|
250
|
+
cancelOrDelete(event: Event, row: TableElement<T>, opts?: {
|
|
246
251
|
interactive?: boolean;
|
|
247
252
|
keepEditing?: boolean;
|
|
248
|
-
}):
|
|
253
|
+
}): void;
|
|
249
254
|
addRow(event?: Event, insertAt?: number, opts?: {
|
|
250
255
|
focusColumn?: string;
|
|
251
256
|
editing?: boolean;
|
|
@@ -255,7 +260,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
255
260
|
}): Promise<boolean>;
|
|
256
261
|
cancel(event?: Event, opts?: {
|
|
257
262
|
interactive?: boolean;
|
|
258
|
-
}):
|
|
263
|
+
}): void;
|
|
259
264
|
duplicateRow(event?: Event, row?: TableElement<T>, opts?: {
|
|
260
265
|
skipProperties?: string[];
|
|
261
266
|
}): Promise<boolean>;
|
|
@@ -263,7 +268,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
263
268
|
isAllSelected(): boolean;
|
|
264
269
|
/** Selects all rows if they are not all selected; otherwise clear selection. */
|
|
265
270
|
masterToggle(): Promise<void>;
|
|
266
|
-
deleteSelection(event:
|
|
271
|
+
deleteSelection(event: UIEvent): Promise<number>;
|
|
267
272
|
/**
|
|
268
273
|
*
|
|
269
274
|
* @param event
|
|
@@ -271,7 +276,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
271
276
|
* @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
|
|
272
277
|
* And to force deletion even if table is busy
|
|
273
278
|
*/
|
|
274
|
-
deleteRow(event:
|
|
279
|
+
deleteRow(event: UIEvent | null, row: TableElement<T>, opts?: {
|
|
275
280
|
interactive?: boolean;
|
|
276
281
|
}): Promise<boolean>;
|
|
277
282
|
/**
|
|
@@ -281,7 +286,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
281
286
|
* @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
|
|
282
287
|
* And to force deletion even if table is busy
|
|
283
288
|
*/
|
|
284
|
-
deleteRows(event:
|
|
289
|
+
deleteRows(event: UIEvent | null, rows: TableElement<T>[], opts?: {
|
|
285
290
|
interactive?: boolean;
|
|
286
291
|
}): Promise<number>;
|
|
287
292
|
selectRowById(id: number): Promise<boolean>;
|
|
@@ -290,19 +295,19 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
290
295
|
* @param data
|
|
291
296
|
*/
|
|
292
297
|
selectRowByData(data: T): Promise<boolean>;
|
|
293
|
-
clickRow(event:
|
|
294
|
-
moveRow(id: number, direction: number):
|
|
298
|
+
clickRow(event: UIEvent | undefined, row: TableElement<T>): boolean;
|
|
299
|
+
moveRow(id: number, direction: number): void;
|
|
295
300
|
ready(opts?: WaitForOptions): Promise<void>;
|
|
296
301
|
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
297
302
|
openSelectColumnsModal(event?: Event): Promise<any>;
|
|
298
303
|
trackByFn(index: number, row: TableElement<T>): number;
|
|
299
304
|
doRefresh(event?: CompletableEvent): void;
|
|
300
305
|
getCurrentColumns(): ColumnItem[];
|
|
301
|
-
escapeEditingRow(event?: Event, row?: TableElement<T>):
|
|
306
|
+
escapeEditingRow(event?: Event, row?: TableElement<T>): void;
|
|
302
307
|
translateControlPath(path: string): string;
|
|
303
|
-
protected
|
|
308
|
+
protected editRow(event: Event | undefined, row: TableElement<T>, opts?: {
|
|
304
309
|
focusColumn?: string;
|
|
305
|
-
}):
|
|
310
|
+
}): boolean;
|
|
306
311
|
/**
|
|
307
312
|
* Try to select row, by row.id, or by data. WIll use EntityUtils.equals()
|
|
308
313
|
* @param id
|
|
@@ -328,8 +333,8 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
328
333
|
* @param row
|
|
329
334
|
* @protected
|
|
330
335
|
*/
|
|
331
|
-
protected
|
|
332
|
-
protected openNewRowDetail(event?:
|
|
336
|
+
protected openRow(id: ID, row: TableElement<T>): Promise<boolean>;
|
|
337
|
+
protected openNewRowDetail(event?: any): Promise<boolean>;
|
|
333
338
|
protected getRequiredColumns(): string[];
|
|
334
339
|
protected getUserColumns(): string[];
|
|
335
340
|
protected getSortedColumn(): MatSortable;
|
|
@@ -346,11 +351,11 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
346
351
|
protected registerAutocompleteField<E = any, EF = any>(fieldName: string, options?: MatAutocompleteFieldAddOptions<E, EF>): MatAutocompleteFieldConfig<E, EF>;
|
|
347
352
|
protected getI18nColumnName(columnName: string): string;
|
|
348
353
|
protected generateTableId(): string;
|
|
349
|
-
protected
|
|
354
|
+
protected addRowToTable(insertAt?: number, opts?: {
|
|
350
355
|
focusColumn?: string;
|
|
351
356
|
editing?: boolean;
|
|
352
357
|
emitEvent?: boolean;
|
|
353
|
-
}): Promise<TableElement<T
|
|
358
|
+
}): Promise<TableElement<T> | undefined>;
|
|
354
359
|
protected registerCellValueChanges(name: string, formPath?: string, emitInitialValue?: boolean): Observable<any>;
|
|
355
360
|
protected setShowColumn(columnName: string, show: boolean, opts?: {
|
|
356
361
|
emitEvent?: boolean;
|
|
@@ -358,9 +363,9 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
358
363
|
protected getShowColumn(columnName: string): boolean;
|
|
359
364
|
protected startsWithUpperCase(input: string, search: string): boolean;
|
|
360
365
|
protected markForCheck(): void;
|
|
361
|
-
protected askDeleteConfirmation(event?:
|
|
362
|
-
protected askCancelConfirmation(event?:
|
|
363
|
-
protected askRestoreConfirmation(event?:
|
|
366
|
+
protected askDeleteConfirmation(event?: UIEvent, rows?: TableElement<T>[]): Promise<boolean>;
|
|
367
|
+
protected askCancelConfirmation(event?: UIEvent, rows?: TableElement<T>[]): Promise<boolean>;
|
|
368
|
+
protected askRestoreConfirmation(event?: UIEvent): Promise<boolean>;
|
|
364
369
|
protected showToast(opts: ShowToastOptions): Promise<import("@ionic/core").OverlayEventDetail<any>>;
|
|
365
370
|
protected resetError(opts?: {
|
|
366
371
|
emitEvent?: boolean;
|
|
@@ -382,30 +387,12 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
382
387
|
onlySelf?: boolean;
|
|
383
388
|
emitEVent?: boolean;
|
|
384
389
|
}): void;
|
|
385
|
-
/**
|
|
386
|
-
* @deprecated Use startEditRow instead
|
|
387
|
-
*/
|
|
388
|
-
protected editRow(event: Event | undefined, row: TableElement<T>, opts?: {
|
|
389
|
-
focusColumn?: string;
|
|
390
|
-
}): Promise<boolean>;
|
|
391
|
-
/**
|
|
392
|
-
* @deprecated use openRowDetail() instead)
|
|
393
|
-
*/
|
|
394
|
-
protected openRow(id: ID, row: TableElement<T>): Promise<boolean>;
|
|
395
|
-
/**
|
|
396
|
-
* @deprecated use createNewRow() instead
|
|
397
|
-
*/
|
|
398
|
-
protected addRowToTable(insertAt?: number, opts?: {
|
|
399
|
-
focusColumn?: string;
|
|
400
|
-
editing?: boolean;
|
|
401
|
-
emitEvent?: boolean;
|
|
402
|
-
}): Promise<TableElement<T>>;
|
|
403
390
|
private listenSortAndPaginationEvents;
|
|
404
|
-
private
|
|
391
|
+
private editRowById;
|
|
405
392
|
private setLoading;
|
|
406
|
-
private
|
|
407
|
-
private
|
|
408
|
-
private
|
|
393
|
+
private deleteNewRow;
|
|
394
|
+
private deleteExistingRow;
|
|
395
|
+
private cancelExistingRow;
|
|
409
396
|
private checkIfRowPristine;
|
|
410
397
|
private checkIfPristine;
|
|
411
398
|
private applyFilter;
|
|
@@ -413,5 +400,5 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
413
400
|
private startCellValueChanges;
|
|
414
401
|
private stopCellValueChanges;
|
|
415
402
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppTable<any, any, any>, never>;
|
|
416
|
-
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>;
|
|
403
|
+
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"; "onOpenIdAndRow": "onOpenIdAndRow"; "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>;
|
|
417
404
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
export interface PromiseEventPayload<
|
|
4
|
-
success: (
|
|
3
|
+
export interface PromiseEventPayload<R = any> {
|
|
4
|
+
success: (R: any) => void;
|
|
5
5
|
error: (err: any) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare type PromiseEvent<
|
|
8
|
-
export declare function createPromiseEventEmitter<
|
|
7
|
+
export declare type PromiseEvent<R = any, D = void> = CustomEvent<PromiseEventPayload<R> & D>;
|
|
8
|
+
export declare function createPromiseEventEmitter<R = any, D = void>(): EventEmitter<PromiseEvent<R, D>>;
|
|
9
9
|
export declare function createPromiseEvent<T = void, D = void>(eventType: string, promise: PromiseEventPayload<T>, initArg?: CustomEventInit<D>): PromiseEvent<T, D>;
|
|
10
10
|
export declare function emitPromiseEvent<T = any, D = void>(emitter: EventEmitter<PromiseEvent<T, D>>, eventType: string, initArg?: CustomEventInit<D>): Promise<T>;
|
|
11
11
|
export interface CompletableEvent extends Event {
|
|
@@ -20,21 +20,20 @@ export declare class Color {
|
|
|
20
20
|
rgba(opacity?: number): string;
|
|
21
21
|
}
|
|
22
22
|
export declare interface ColorGradientOptions {
|
|
23
|
-
opacity?: number;
|
|
24
23
|
startColor?: number[];
|
|
25
24
|
mainColor?: number[];
|
|
26
25
|
mainColorIndex?: number;
|
|
27
26
|
endColor?: number[];
|
|
28
|
-
format?: 'rgb' | 'hex' | 'array';
|
|
29
27
|
}
|
|
30
28
|
export declare interface ColorScaleOptions extends ColorGradientOptions {
|
|
29
|
+
opacity?: number;
|
|
31
30
|
min?: number;
|
|
32
31
|
max?: number;
|
|
33
32
|
upperMax?: boolean;
|
|
34
33
|
}
|
|
35
34
|
export declare interface ColorScaleLegendItem {
|
|
36
|
-
label: string;
|
|
37
|
-
color:
|
|
35
|
+
label: string | number[];
|
|
36
|
+
color: Color;
|
|
38
37
|
}
|
|
39
38
|
export declare interface ColorScaleLegend {
|
|
40
39
|
items: ColorScaleLegendItem[];
|
|
@@ -43,7 +42,6 @@ export declare interface ColorScaleLegend {
|
|
|
43
42
|
* Helper class for colors scale
|
|
44
43
|
*/
|
|
45
44
|
export declare class ColorScale {
|
|
46
|
-
private colorArray;
|
|
47
45
|
static custom: (count: number, options?: ColorScaleOptions) => ColorScale;
|
|
48
46
|
static default(): ColorScale;
|
|
49
47
|
/**
|
|
@@ -56,8 +54,10 @@ export declare class ColorScale {
|
|
|
56
54
|
private _legendItems;
|
|
57
55
|
get min(): number;
|
|
58
56
|
get max(): number;
|
|
59
|
-
constructor(colorArray:
|
|
57
|
+
constructor(colorArray: number[][], options?: ColorScaleOptions);
|
|
60
58
|
get legend(): ColorScaleLegend;
|
|
61
|
-
getValueColor(value: number):
|
|
62
|
-
|
|
59
|
+
getValueColor(value: number): Color;
|
|
60
|
+
getLegendForValue(value: number): ColorScaleLegendItem;
|
|
61
|
+
getLegendAtIndex(index: number): ColorScaleLegendItem;
|
|
62
|
+
protected computeLegendItems(colorArray: number[][]): ColorScaleLegendItem[];
|
|
63
63
|
}
|
|
@@ -8,16 +8,17 @@ import * as i5 from "./numpad/testing/numpad.test";
|
|
|
8
8
|
import * as i6 from "./swipe/testing/swipe.test";
|
|
9
9
|
import * as i7 from "./chips/testing/chips.test";
|
|
10
10
|
import * as i8 from "./badge/badge.test";
|
|
11
|
-
import * as i9 from "
|
|
12
|
-
import * as i10 from "@
|
|
13
|
-
import * as i11 from "@angular
|
|
14
|
-
import * as i12 from "
|
|
15
|
-
import * as i13 from "
|
|
16
|
-
import * as i14 from "@
|
|
17
|
-
import * as i15 from "
|
|
11
|
+
import * as i9 from "../testing/observable.test";
|
|
12
|
+
import * as i10 from "@angular/common";
|
|
13
|
+
import * as i11 from "@ionic/angular";
|
|
14
|
+
import * as i12 from "@angular/forms";
|
|
15
|
+
import * as i13 from "./material.module";
|
|
16
|
+
import * as i14 from "@ngx-translate/core";
|
|
17
|
+
import * as i15 from "@angular/router";
|
|
18
|
+
import * as i16 from "../pipes/pipes.module";
|
|
18
19
|
export declare const SHARED_MATERIAL_TESTING_PAGES: TestingPage[];
|
|
19
20
|
export declare class MaterialTestingModule {
|
|
20
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialTestingModule, never>;
|
|
21
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialTestingModule, [typeof i1.DateTimeTestPage, typeof i2.DateTestPage, typeof i3.AutocompleteTestPage, typeof i4.LatLongTestPage, typeof i5.NumpadTestPage, typeof i6.SwipeTestPage, typeof i7.ChipsTestPage, typeof i8.MatBadgeTestPage], [typeof
|
|
22
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialTestingModule, [typeof i1.DateTimeTestPage, typeof i2.DateTestPage, typeof i3.AutocompleteTestPage, typeof i4.LatLongTestPage, typeof i5.NumpadTestPage, typeof i6.SwipeTestPage, typeof i7.ChipsTestPage, typeof i8.MatBadgeTestPage, typeof i9.ObservableTestPage], [typeof i10.CommonModule, typeof i11.IonicModule, typeof i12.ReactiveFormsModule, typeof i13.SharedMaterialModule, typeof i14.TranslateModule, typeof i15.RouterModule, typeof i16.SharedPipesModule], [typeof i13.SharedMaterialModule, typeof i15.RouterModule, typeof i1.DateTimeTestPage, typeof i2.DateTestPage, typeof i3.AutocompleteTestPage, typeof i4.LatLongTestPage, typeof i5.NumpadTestPage, typeof i6.SwipeTestPage, typeof i7.ChipsTestPage, typeof i9.ObservableTestPage]>;
|
|
22
23
|
static ɵinj: i0.ɵɵInjectorDeclaration<MaterialTestingModule>;
|
|
23
24
|
}
|
|
@@ -3,7 +3,7 @@ import { Predicate } from '@angular/core';
|
|
|
3
3
|
export declare interface FirstOptions {
|
|
4
4
|
timeout?: number;
|
|
5
5
|
stop?: Observable<any>;
|
|
6
|
-
stopError?: boolean;
|
|
6
|
+
stopError?: boolean | string | Error;
|
|
7
7
|
}
|
|
8
8
|
export declare interface WaitForOptions extends FirstOptions {
|
|
9
9
|
dueTime?: number;
|
|
@@ -51,6 +51,11 @@ export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any,
|
|
|
51
51
|
* Count data stored by the service (without hidden data).
|
|
52
52
|
* @param opts
|
|
53
53
|
*/
|
|
54
|
+
/**
|
|
55
|
+
* Count data stored by the service (without hidden data).
|
|
56
|
+
* @param opts
|
|
57
|
+
* @deprecated TODO Please rename this getter into visibleCount (and create count = hiddenCount + visibleCount)
|
|
58
|
+
*/
|
|
54
59
|
get count(): number;
|
|
55
60
|
get hiddenCount(): number;
|
|
56
61
|
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FirstOptions, WaitForOptions } from '../observables';
|
|
3
|
+
import { Observable, Subject } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ObservableTestPage implements OnDestroy {
|
|
6
|
+
_stopSubject: Subject<void>;
|
|
7
|
+
$value: Subject<any>;
|
|
8
|
+
runningTaskCount: number;
|
|
9
|
+
taskId: number;
|
|
10
|
+
options: Partial<FirstOptions>;
|
|
11
|
+
resultDiv: ElementRef;
|
|
12
|
+
constructor();
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
setOptions(opts: any): void;
|
|
15
|
+
setOptionsError(errorMessage: any): void;
|
|
16
|
+
firstNotNilPromise(opts?: FirstOptions): Promise<void>;
|
|
17
|
+
waitForTrue(opts?: WaitForOptions): Promise<void>;
|
|
18
|
+
execute<T, O extends WaitForOptions = WaitForOptions>(fn: (o: Observable<any>, opts: O) => Promise<T>, opts?: O, logPrefix?: string): Promise<void>;
|
|
19
|
+
emit(value: any): void;
|
|
20
|
+
stop(): void;
|
|
21
|
+
log(message: string, ...args: any): void;
|
|
22
|
+
appendLog(message: string): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ObservableTestPage, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ObservableTestPage, "app-observable-test", never, {}, {}, never, never, false>;
|
|
25
|
+
}
|
|
@@ -75,6 +75,10 @@ $ion-grid-padding: 16px !default;
|
|
|
75
75
|
$ion-padding: 16px !default;
|
|
76
76
|
$ion-margin: 16px !default;
|
|
77
77
|
|
|
78
|
+
// Default height
|
|
79
|
+
// --------------------------------------------------
|
|
80
|
+
$ion-toolbar-height: 56px !default;
|
|
81
|
+
|
|
78
82
|
// --------------------------------------------------
|
|
79
83
|
// Default General Colors
|
|
80
84
|
// --------------------------------------------------
|
|
@@ -66,7 +66,9 @@ $candy-app-warn: mat.define-palette(mat.$red-palette);
|
|
|
66
66
|
$candy-app-theme: mat.define-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
// Expose some
|
|
69
|
+
// Expose some variables
|
|
70
70
|
$mat-tab-link-height: 48px !default;
|
|
71
71
|
$mat-tab-bar-height: 48px !default;
|
|
72
72
|
$mat-tab-animation-duration: 200ms !default;
|
|
73
|
+
$mat-mat-toolbar-height-desktop: 64px !default;
|
|
74
|
+
$mat-mat-toolbar-height-mobile: 56px !default;
|
package/src/theme/_mixins.scss
CHANGED
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
--expansion-panel-padding: var(--ion-padding);
|
|
103
103
|
--expansion-panel-header-padding: var(--ion-padding);
|
|
104
104
|
|
|
105
|
-
--mat-toolbar-height: #{
|
|
105
|
+
--mat-toolbar-height: #{$mat-mat-toolbar-height-desktop};
|
|
106
106
|
--mat-paginator-height: mat.$paginator-height;
|
|
107
|
-
--ion-toolbar-height: #{
|
|
107
|
+
--ion-toolbar-height: #{$ion-toolbar-height};
|
|
108
108
|
|
|
109
109
|
--app-table-header-height: #{$app-table-header-height};
|
|
110
110
|
--app-toolbar-height: #{$app-toolbar-height};
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
@mixin css-variables-to-root-mobile() {
|
|
119
|
-
--mat-toolbar-height: #{
|
|
119
|
+
--mat-toolbar-height: #{$mat-mat-toolbar-height-mobile};
|
|
120
120
|
|
|
121
121
|
// Disable form footer, in mobile
|
|
122
122
|
--app-form-buttons-bar-height: 0px;
|