@sumaris-net/ngx-components 1.20.0-rc5 → 1.20.2
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/README.md +7 -7
- package/bundles/sumaris-net.ngx-components.umd.js +1502 -1316
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +50 -2
- package/esm2015/src/app/admin/services/person.service.js +3 -3
- package/esm2015/src/app/admin/users/list/users.js +1 -5
- package/esm2015/src/app/core/account/account.js +19 -6
- package/esm2015/src/app/core/core.module.js +4 -3
- package/esm2015/src/app/core/form/entity-editor.class.js +33 -11
- package/esm2015/src/app/core/form/form-buttons-bar.component.js +8 -5
- package/esm2015/src/app/core/form/list.form.js +1 -1
- package/esm2015/src/app/core/home/home.js +2 -2
- package/esm2015/src/app/core/install/install-upgrade-card.component.js +10 -40
- package/esm2015/src/app/core/menu/menu.component.js +77 -28
- package/esm2015/src/app/core/menu/menu.service.js +37 -12
- package/esm2015/src/app/core/offline/update-offline-mode-card.component.js +26 -0
- package/esm2015/src/app/core/services/account.service.js +2 -2
- package/esm2015/src/app/core/services/model/entity.model.js +3 -5
- package/esm2015/src/app/core/services/model/filter.model.js +1 -1
- package/esm2015/src/app/core/services/model/referential.model.js +1 -4
- package/esm2015/src/app/core/services/platform.service.js +44 -17
- package/esm2015/src/app/core/services/storage/entities-storage.service.js +36 -35
- package/esm2015/src/app/core/services/storage/entity-store.class.js +4 -5
- package/esm2015/src/app/core/table/entities-table-datasource.class.js +129 -193
- package/esm2015/src/app/core/table/memory-table.class.js +3 -3
- package/esm2015/src/app/core/table/table.class.js +96 -95
- package/esm2015/src/app/core/text-popover/text-form.component.js +1 -1
- package/esm2015/src/app/shared/dates.js +4 -8
- package/esm2015/src/app/shared/files.js +26 -1
- package/esm2015/src/app/shared/form/field.component.js +2 -2
- package/esm2015/src/app/shared/functions.js +5 -2
- package/esm2015/src/app/shared/guard/component-dirty.guard.js +3 -3
- package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +82 -58
- package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +24 -9
- package/esm2015/src/app/shared/material/chips/material.chips.js +3 -2
- package/esm2015/src/app/shared/material/datetime/material.date.js +2 -2
- package/esm2015/src/app/shared/material/datetime/material.dateshort.js +2 -2
- package/esm2015/src/app/shared/material/datetime/material.datetime.js +7 -8
- package/esm2015/src/app/shared/material/datetime/testing/mat-date-time.test.js +6 -4
- package/esm2015/src/app/shared/material/latlong/latlong.utils.js +1 -1
- package/esm2015/src/app/shared/material/latlong/material.latlong.js +57 -51
- package/esm2015/src/app/shared/material/latlong/testing/latlong.test.js +2 -2
- package/esm2015/src/app/shared/material/swipe/material.swipe.js +7 -6
- package/esm2015/src/app/shared/pipes/form.pipes.js +86 -23
- package/esm2015/src/app/shared/pipes/latlong-format.pipe.js +17 -24
- package/esm2015/src/app/shared/pipes/number-format.pipe.js +6 -3
- package/esm2015/src/app/shared/pipes/pipes.module.js +6 -4
- package/esm2015/src/app/shared/platforms.js +2 -1
- package/esm2015/src/app/shared/services/job.utils.js +4 -3
- package/esm2015/src/app/shared/toolbar/toolbar.js +25 -9
- package/esm2015/src/app/shared/validator/validators.js +9 -4
- package/esm2015/src/app/vendor.js +7 -1
- package/esm2015/sumaris-net.ngx-components.js +8 -7
- package/fesm2015/sumaris-net.ngx-components.js +1054 -833
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +2 -2
- package/src/app/core/form/entity-editor.class.d.ts +2 -1
- package/src/app/core/form/form-buttons-bar.component.d.ts +3 -1
- package/src/app/core/install/install-upgrade-card.component.d.ts +1 -6
- package/src/app/core/menu/menu.component.d.ts +12 -7
- package/src/app/core/menu/menu.service.d.ts +15 -6
- package/src/app/core/offline/update-offline-mode-card.component.d.ts +8 -0
- package/src/app/core/services/model/entity.model.d.ts +0 -1
- package/src/app/core/services/model/filter.model.d.ts +1 -1
- package/src/app/core/services/model/referential.model.d.ts +3 -4
- package/src/app/core/services/platform.service.d.ts +1 -0
- package/src/app/core/services/storage/entities-storage.service.d.ts +10 -6
- package/src/app/core/services/storage/entity-store.class.d.ts +2 -2
- package/src/app/core/table/entities-table-datasource.class.d.ts +28 -26
- package/src/app/core/table/table.class.d.ts +2 -2
- package/src/app/shared/dates.d.ts +3 -3
- package/src/app/shared/files.d.ts +10 -0
- package/src/app/shared/functions.d.ts +1 -0
- package/src/app/shared/material/autocomplete/material.autocomplete.d.ts +2 -1
- package/src/app/shared/material/autocomplete/testing/autocomplete.test.d.ts +4 -2
- package/src/app/shared/material/chips/material.chips.d.ts +2 -1
- package/src/app/shared/material/latlong/latlong.utils.d.ts +2 -2
- package/src/app/shared/material/latlong/material.latlong.d.ts +15 -10
- package/src/app/shared/material/swipe/material.swipe.d.ts +4 -3
- package/src/app/shared/pipes/form.pipes.d.ts +20 -4
- package/src/app/shared/pipes/latlong-format.pipe.d.ts +6 -4
- package/src/app/shared/pipes/number-format.pipe.d.ts +3 -1
- package/src/app/shared/toolbar/toolbar.d.ts +5 -2
- package/src/app/shared/validator/validators.d.ts +6 -1
- package/src/app/vendor.d.ts +5 -0
- package/src/assets/i18n/en-US.json +2 -1
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/fr.json +4 -1
- package/src/theme/_ngx-components.globals.scss +1 -0
- package/src/theme/_ngx-components.scss +32 -20
- package/sumaris-net.ngx-components.d.ts +7 -6
- package/sumaris-net.ngx-components.metadata.json +1 -1
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": "1.20.
|
|
4
|
+
"version": "1.20.2",
|
|
5
5
|
"author": "contact@e-is.pro",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"readmeFilename": "README.md",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">= 12.22.8",
|
|
30
|
-
"npm": ">=
|
|
30
|
+
"npm": ">= 8.3.0",
|
|
31
31
|
"yarn": ">= 1.22.0"
|
|
32
32
|
},
|
|
33
33
|
"cordova": {
|
|
@@ -79,6 +79,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
79
79
|
ngOnInit(): void;
|
|
80
80
|
ngAfterViewInit(): void;
|
|
81
81
|
ngOnDestroy(): void;
|
|
82
|
+
waitIdle(opts?: WaitForOptions): Promise<void>;
|
|
82
83
|
/**
|
|
83
84
|
* Load data from the snapshot route
|
|
84
85
|
*
|
|
@@ -94,7 +95,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
94
95
|
load(id?: ID, opts?: EntityServiceLoadOptions & {
|
|
95
96
|
emitEvent?: boolean;
|
|
96
97
|
openTabIndex?: number;
|
|
97
|
-
|
|
98
|
+
updateRoute?: boolean;
|
|
98
99
|
[key: string]: any;
|
|
99
100
|
}): Promise<void>;
|
|
100
101
|
canUserWrite(data: T, opts?: any): boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy } from '@angular/core';
|
|
2
2
|
import { Hotkeys } from '../../shared/hotkeys/hotkeys.service';
|
|
3
|
+
import { MenuService } from '../menu/menu.service';
|
|
3
4
|
export declare abstract class FormButtonsBarToken {
|
|
4
5
|
abstract onCancel: EventEmitter<Event>;
|
|
5
6
|
abstract onSave: EventEmitter<Event>;
|
|
@@ -8,6 +9,7 @@ export declare abstract class FormButtonsBarToken {
|
|
|
8
9
|
}
|
|
9
10
|
export declare class FormButtonsBarComponent implements FormButtonsBarToken, OnDestroy {
|
|
10
11
|
private hotkeys;
|
|
12
|
+
menu: MenuService;
|
|
11
13
|
private _subscription;
|
|
12
14
|
disabled: boolean;
|
|
13
15
|
disabledCancel: boolean;
|
|
@@ -16,6 +18,6 @@ export declare class FormButtonsBarComponent implements FormButtonsBarToken, OnD
|
|
|
16
18
|
onSave: EventEmitter<Event>;
|
|
17
19
|
onNext: EventEmitter<Event>;
|
|
18
20
|
onBack: EventEmitter<Event>;
|
|
19
|
-
constructor(hotkeys: Hotkeys);
|
|
21
|
+
constructor(hotkeys: Hotkeys, menu: MenuService);
|
|
20
22
|
ngOnDestroy(): void;
|
|
21
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectorRef,
|
|
1
|
+
import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { AlertController, ModalController, ToastController } from '@ionic/angular';
|
|
3
3
|
import { ConfigService } from '../services/config.service';
|
|
4
4
|
import { PlatformService } from '../services/platform.service';
|
|
@@ -27,7 +27,6 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
|
|
|
27
27
|
network: NetworkService;
|
|
28
28
|
protected environment: any;
|
|
29
29
|
private _subscription;
|
|
30
|
-
private _showUpdateOfflineFeature;
|
|
31
30
|
loading: boolean;
|
|
32
31
|
hasDownloader: boolean;
|
|
33
32
|
downloading: boolean;
|
|
@@ -40,9 +39,6 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
|
|
|
40
39
|
showUpgradeWarning: boolean;
|
|
41
40
|
showOfflineWarning: boolean;
|
|
42
41
|
showInstallButton: boolean;
|
|
43
|
-
set showUpdateOfflineFeature(value: boolean);
|
|
44
|
-
get showUpdateOfflineFeature(): boolean;
|
|
45
|
-
onUpdateOfflineModeClick: EventEmitter<UIEvent>;
|
|
46
42
|
constructor(modalCtrl: ModalController, configService: ConfigService, toastController: ToastController, alertController: AlertController, translate: TranslateService, cd: ChangeDetectorRef, platform: PlatformService, network: NetworkService, environment: any);
|
|
47
43
|
ngOnInit(): void;
|
|
48
44
|
ngOnDestroy(): void;
|
|
@@ -55,7 +51,6 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
|
|
|
55
51
|
private getCompatibleInstallLinks;
|
|
56
52
|
private getCompatibleUpgradeLinks;
|
|
57
53
|
private getLinks;
|
|
58
|
-
private getFilename;
|
|
59
54
|
private listenDownloadJobs;
|
|
60
55
|
private listenDownloadJob;
|
|
61
56
|
private showDownloadFailedToast;
|
|
@@ -8,7 +8,7 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
8
8
|
import { ConfigService } from '../services/config.service';
|
|
9
9
|
import { HammerSwipeEvent } from '../../shared/gesture/hammer.utils';
|
|
10
10
|
import { PlatformService } from '../services/platform.service';
|
|
11
|
-
import { MenuService } from './menu.service';
|
|
11
|
+
import { MenuService, SplitPaneShowWhen } from './menu.service';
|
|
12
12
|
import { MenuItem } from './menu.model';
|
|
13
13
|
export declare const APP_MENU_ITEMS: InjectionToken<MenuItem[]>;
|
|
14
14
|
export declare class MenuComponent implements OnInit {
|
|
@@ -32,21 +32,26 @@ export declare class MenuComponent implements OnInit {
|
|
|
32
32
|
accountName: string;
|
|
33
33
|
accountAvatar: string;
|
|
34
34
|
accountEmail: string;
|
|
35
|
-
|
|
35
|
+
$items: BehaviorSubject<MenuItem[]>;
|
|
36
|
+
id: string;
|
|
37
|
+
menuId: string;
|
|
38
|
+
side: string;
|
|
39
|
+
contentId: string;
|
|
36
40
|
logo: String;
|
|
37
41
|
appName: String;
|
|
38
|
-
$items: BehaviorSubject<MenuItem[]>;
|
|
39
42
|
appVersion: String;
|
|
40
|
-
side: string;
|
|
41
43
|
splitPane: IonSplitPane;
|
|
42
44
|
constructor(platformService: PlatformService, accountService: AccountService, router: Router, menu: MenuController, modalCtrl: ModalController, alertController: AlertController, translate: TranslateService, configService: ConfigService, cd: ChangeDetectorRef, menuService: MenuService, environment: any, items: MenuItem[]);
|
|
43
45
|
ngOnInit(): Promise<void>;
|
|
44
46
|
onLogin(account: Account): Promise<void>;
|
|
45
47
|
onLogout(skipRedirect?: boolean): Promise<void>;
|
|
46
48
|
logout(): Promise<void>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
enable(value: boolean): Promise<void>;
|
|
50
|
+
open(): Promise<boolean>;
|
|
51
|
+
close(): Promise<boolean>;
|
|
52
|
+
openAboutModal(event?: UIEvent): Promise<void>;
|
|
53
|
+
setSplitPaneWhen(value: SplitPaneShowWhen): Promise<void>;
|
|
54
|
+
toggleSplitPaneShow(event?: UIEvent): Promise<void>;
|
|
50
55
|
doAction(action: string, event: UIEvent): Promise<void>;
|
|
51
56
|
onSwipeRight(event: HammerSwipeEvent): boolean;
|
|
52
57
|
protected refreshMenuItems(): void;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
export declare type SplitPaneShowWhen = boolean | 'lg';
|
|
3
|
+
export declare const DEFAULT_MENU_SHOW_WHEN: SplitPaneShowWhen;
|
|
2
4
|
export declare class MenuService {
|
|
3
|
-
private readonly
|
|
4
|
-
private readonly
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
private readonly _$toggled;
|
|
6
|
+
private readonly _$opened;
|
|
7
|
+
private readonly _$splitPaneWhen;
|
|
8
|
+
private readonly _$enabled;
|
|
9
|
+
get opened(): Observable<boolean>;
|
|
10
|
+
get splitPaneWhen(): Observable<SplitPaneShowWhen>;
|
|
11
|
+
get enabled(): Observable<boolean>;
|
|
12
|
+
toggle(): void;
|
|
13
|
+
enable(value: boolean): void;
|
|
14
|
+
setSplitPaneShowWhen(value: SplitPaneShowWhen): void;
|
|
15
|
+
toggleSplitPaneWhen(): void;
|
|
16
|
+
_markAsOpened(): void;
|
|
17
|
+
_markAsClosed(): void;
|
|
9
18
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy } from '@angular/core';
|
|
2
|
+
export declare class AppUpdateOfflineModeCard implements OnDestroy {
|
|
3
|
+
progressionMessage: string;
|
|
4
|
+
progressionValue: number;
|
|
5
|
+
onUpdateClick: EventEmitter<UIEvent>;
|
|
6
|
+
constructor();
|
|
7
|
+
ngOnDestroy(): void;
|
|
8
|
+
}
|
|
@@ -46,7 +46,6 @@ export declare abstract class Entity<T extends Entity<T, ID, AO, FO>, ID = numbe
|
|
|
46
46
|
export declare function isInstanceOf<T>(obj: any, constructor: new (...args: any[]) => T): obj is T;
|
|
47
47
|
export declare abstract class EntityUtils {
|
|
48
48
|
static isEntity<T extends IEntity<any>>(obj: T | any): obj is T;
|
|
49
|
-
static isNotEntity<T extends IEntity<any>>(obj: T | any): boolean;
|
|
50
49
|
static isNotEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
51
50
|
static isEmpty<T extends IEntity<any> | any>(obj: T, checkedAttribute: keyof T): boolean;
|
|
52
51
|
static equals<T extends IEntity<any> | any>(o1: T, o2: T, checkAttribute?: keyof T): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity, EntityAsObjectOptions, IEntity } from './entity.model';
|
|
2
2
|
import { FilterFn } from '../../../shared/services/entity-service.class';
|
|
3
|
-
export interface IEntityFilter<F extends IEntityFilter<F, T, ID, AO, FO>, T extends IEntity<T,
|
|
3
|
+
export interface IEntityFilter<F extends IEntityFilter<F, T, ID, AO, FO>, T extends IEntity<T, any>, ID = number, AO extends EntityAsObjectOptions = EntityAsObjectOptions, FO = any> extends IEntity<F, ID, AO, FO> {
|
|
4
4
|
asPodObject(): any;
|
|
5
5
|
asFilterFn(): FilterFn<T>;
|
|
6
6
|
isEmpty(): boolean;
|
|
@@ -37,10 +37,9 @@ export declare class Referential<T extends Referential<T, any> = Referential<any
|
|
|
37
37
|
}
|
|
38
38
|
export declare class ReferentialUtils {
|
|
39
39
|
static fromObject(source: any): Referential;
|
|
40
|
-
static isNotEmpty<T extends
|
|
41
|
-
static
|
|
42
|
-
static
|
|
43
|
-
static equals<T extends BaseReferential<any> | ReferentialRef>(o1: T | any, o2: T | any): boolean;
|
|
40
|
+
static isNotEmpty<T extends IReferentialRef<T>>(obj: T | any): boolean;
|
|
41
|
+
static isEmpty<T extends IReferentialRef<T>>(obj: T | any): boolean;
|
|
42
|
+
static equals<T extends IReferentialRef<T>>(o1: T | any, o2: T | any): boolean;
|
|
44
43
|
}
|
|
45
44
|
export interface ReferentialAsObjectOptions extends EntityAsObjectOptions {
|
|
46
45
|
keepEntityName?: boolean;
|
|
@@ -75,6 +75,7 @@ export declare class PlatformService extends StartableService {
|
|
|
75
75
|
filename?: string;
|
|
76
76
|
} & Partial<DownloadRequest>): Observable<string>;
|
|
77
77
|
openFile(filePath: string, fileMimeType: string): Promise<any>;
|
|
78
|
+
protected configureClassList(mobile: boolean, win?: any): void;
|
|
78
79
|
protected configureCordovaPlugins(): void;
|
|
79
80
|
protected configureTranslate(): void;
|
|
80
81
|
protected configureCache(online?: boolean): void;
|
|
@@ -20,8 +20,8 @@ export declare class EntitiesStorage extends StartableService<EntityStorageMap>
|
|
|
20
20
|
private progressBarService;
|
|
21
21
|
private storage;
|
|
22
22
|
protected environment: Environment;
|
|
23
|
-
static TRASH_PREFIX
|
|
24
|
-
static REMOTE_PREFIX
|
|
23
|
+
static readonly TRASH_PREFIX = "Trash#";
|
|
24
|
+
static readonly REMOTE_PREFIX = "Remote#";
|
|
25
25
|
private readonly _typePolicies;
|
|
26
26
|
private readonly _saveTimerPeriod;
|
|
27
27
|
private _$save;
|
|
@@ -29,6 +29,8 @@ export declare class EntitiesStorage extends StartableService<EntityStorageMap>
|
|
|
29
29
|
private _saving;
|
|
30
30
|
get dirty(): boolean;
|
|
31
31
|
constructor(platform: Platform, progressBarService: ProgressBarService, storage: Storage, environment: Environment, typePolicies: EntitiesStorageTypePolicies);
|
|
32
|
+
ngOnStart(): Promise<EntityStorageMap>;
|
|
33
|
+
protected ngOnStop(): Promise<void>;
|
|
32
34
|
watchAll<T extends Entity<T>>(entityName: string, variables: {
|
|
33
35
|
offset?: number;
|
|
34
36
|
size?: number;
|
|
@@ -88,14 +90,16 @@ export declare class EntitiesStorage extends StartableService<EntityStorageMap>
|
|
|
88
90
|
emitEvent?: boolean;
|
|
89
91
|
}): Promise<T>;
|
|
90
92
|
clearTrash(entityName: string): Promise<void>;
|
|
91
|
-
persist(
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
persist(opts?: {
|
|
94
|
+
skipIfPristine: boolean;
|
|
95
|
+
}): Promise<void>;
|
|
94
96
|
protected getEntityStore<T extends IEntity<T, ID>, ID = number>(name: string, opts?: {
|
|
95
97
|
create?: boolean;
|
|
96
98
|
}): EntityStore<T, ID>;
|
|
97
99
|
protected detectEntityName(entityOrName: string | Entity<any, any>): string;
|
|
98
100
|
protected restoreLocally(): Promise<void>;
|
|
99
|
-
protected storeLocally(
|
|
101
|
+
protected storeLocally(opts?: {
|
|
102
|
+
skipIfPristine: boolean;
|
|
103
|
+
}): Promise<void>;
|
|
100
104
|
}
|
|
101
105
|
export {};
|
|
@@ -78,10 +78,10 @@ export declare class EntityStore<T extends IEntity<T, ID>, ID = number, O extend
|
|
|
78
78
|
/**
|
|
79
79
|
*
|
|
80
80
|
* @param opts
|
|
81
|
-
* opts.
|
|
81
|
+
* opts.skipIfPristine = false persist all entities, even if not dirty
|
|
82
82
|
*/
|
|
83
83
|
persist(opts?: {
|
|
84
|
-
skipIfPristine
|
|
84
|
+
skipIfPristine: boolean;
|
|
85
85
|
}): Promise<number>;
|
|
86
86
|
restore(opts?: {
|
|
87
87
|
emitEvent?: boolean;
|
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
import { TableDataSource, TableElement, ValidatorService } from '@e-is/ngx-material-table';
|
|
2
2
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
3
3
|
import { Entity, IEntity } from '../services/model/entity.model';
|
|
4
|
+
import { OnDestroy } from '@angular/core';
|
|
4
5
|
import { SortDirection } from '@angular/material/sort';
|
|
5
6
|
import { CollectionViewer } from '@angular/cdk/collections';
|
|
6
7
|
import { TableDataSourceOptions } from '@e-is/ngx-material-table/src/app/ngx-material-table/table-data-source';
|
|
7
8
|
import { EntitiesServiceWatchOptions, FetchMoreFn, IEntitiesService, LoadResult } from '../../shared/services/entity-service.class';
|
|
8
|
-
import { FormGroup } from '@angular/forms';
|
|
9
9
|
export declare interface AppTableDataServiceOptions<O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions> extends EntitiesServiceWatchOptions {
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
saveOnlyDirtyRows?: boolean;
|
|
12
12
|
readOnly?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
dataServiceOptions?: AppTableDataServiceOptions<WO>;
|
|
16
|
-
debug?: boolean;
|
|
17
|
-
onRowCreated?: (row: TableElement<T>) => Promise<void> | void;
|
|
18
|
-
onRowValidator?: (validator: FormGroup) => Promise<void> | void;
|
|
14
|
+
export declare class AppTableDataSourceOptions<T extends Entity<T, ID>, ID = number, O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions> implements TableDataSourceOptions {
|
|
19
15
|
[key: string]: any;
|
|
16
|
+
prependNewElements?: boolean;
|
|
17
|
+
suppressErrors?: boolean;
|
|
18
|
+
keepOriginalDataAfterConfirm?: boolean;
|
|
19
|
+
onRowCreated?: (row: TableElement<T>) => Promise<void> | void;
|
|
20
|
+
dataServiceOptions?: AppTableDataServiceOptions<O>;
|
|
21
|
+
debug?: boolean;
|
|
20
22
|
}
|
|
21
|
-
export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any, ID = number,
|
|
22
|
-
readonly dataService: IEntitiesService<T, F,
|
|
23
|
+
export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any, ID = number, O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions> extends TableDataSource<T> implements OnDestroy {
|
|
24
|
+
readonly dataService: IEntitiesService<T, F, O>;
|
|
23
25
|
private readonly _logTypeName;
|
|
26
|
+
private readonly _options;
|
|
24
27
|
protected readonly _debug: boolean;
|
|
25
28
|
protected _creating: boolean;
|
|
26
29
|
protected _saving: boolean;
|
|
30
|
+
protected _useValidator: boolean;
|
|
27
31
|
protected _stopWatching$: Subject<any>;
|
|
28
32
|
protected _editingRowCount: number;
|
|
29
33
|
protected _fetchMoreFn: FetchMoreFn<LoadResult<T>>;
|
|
30
34
|
loadingSubject: BehaviorSubject<boolean>;
|
|
31
|
-
get serviceOptions(): AppTableDataServiceOptions<
|
|
32
|
-
set serviceOptions(value: AppTableDataServiceOptions<
|
|
35
|
+
get serviceOptions(): AppTableDataServiceOptions<O>;
|
|
36
|
+
set serviceOptions(value: AppTableDataServiceOptions<O>);
|
|
37
|
+
get options(): AppTableDataSourceOptions<T, ID, O>;
|
|
33
38
|
get loaded(): boolean;
|
|
34
39
|
get loading(): boolean;
|
|
35
40
|
/**
|
|
@@ -37,34 +42,31 @@ export declare class EntitiesTableDataSource<T extends IEntity<T, ID>, F = any,
|
|
|
37
42
|
*
|
|
38
43
|
* @param dataService A service to load and save data
|
|
39
44
|
* @param dataType Type of data contained by the Table. If not specified, then `data` with at least one element must be specified.
|
|
45
|
+
* @param environment
|
|
40
46
|
* @param validatorService Service that create instances of the FormGroup used to validate row fields.
|
|
41
47
|
* @param config Additional configuration for table.
|
|
42
48
|
*/
|
|
43
|
-
constructor(dataType: new () => T, dataService: IEntitiesService<T, F,
|
|
44
|
-
|
|
45
|
-
disconnect(collectionViewer?: CollectionViewer): void;
|
|
49
|
+
constructor(dataType: new () => T, dataService: IEntitiesService<T, F, O>, validatorService?: ValidatorService, config?: AppTableDataSourceOptions<T, ID, O>);
|
|
50
|
+
ngOnDestroy(): void;
|
|
46
51
|
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>): Observable<LoadResult<T>>;
|
|
47
52
|
save(): Promise<boolean>;
|
|
48
|
-
protected getDataFromRows(rows: TableElement<T>[], options?: {
|
|
49
|
-
originalData: boolean;
|
|
50
|
-
toEntity: boolean;
|
|
51
|
-
}): T[];
|
|
52
|
-
toEntity(data: T | any): T;
|
|
53
53
|
updateDatasource(data: T[], opts?: {
|
|
54
54
|
emitEvent: boolean;
|
|
55
|
-
}):
|
|
55
|
+
}): void;
|
|
56
|
+
createNew(insertAt?: number): void;
|
|
57
|
+
connect(collectionViewer: CollectionViewer): Observable<TableElement<T>[] | ReadonlyArray<TableElement<T>>>;
|
|
58
|
+
disconnect(collectionViewer?: CollectionViewer): void;
|
|
56
59
|
waitIdle(debounceTimeMs?: number): Promise<any>;
|
|
57
|
-
confirmCreate(row: TableElement<T>):
|
|
58
|
-
confirmEdit(row: TableElement<T>):
|
|
59
|
-
startEdit(row: TableElement<T>):
|
|
60
|
-
|
|
60
|
+
confirmCreate(row: TableElement<T>): boolean;
|
|
61
|
+
confirmEdit(row: TableElement<T>): boolean;
|
|
62
|
+
startEdit(row: TableElement<T>): void;
|
|
63
|
+
cancelOrDelete(row: TableElement<T>): void;
|
|
61
64
|
handleError(error: any, message: string): Observable<LoadResult<T>>;
|
|
62
65
|
handleErrorPromise(error: any): void;
|
|
63
|
-
delete(id: number):
|
|
66
|
+
delete(id: number): void;
|
|
64
67
|
deleteAll(rows: TableElement<T>[]): Promise<any>;
|
|
65
68
|
getRows(): Promise<TableElement<T>[]>;
|
|
66
|
-
|
|
67
|
-
protected createRowValidator(): Promise<FormGroup>;
|
|
69
|
+
asyncCreateNew(insertAt?: number): Promise<void>;
|
|
68
70
|
getData(): Promise<T[]>;
|
|
69
71
|
fetchMore(opts?: {
|
|
70
72
|
emitEvent: boolean;
|
|
@@ -229,7 +229,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
229
229
|
}): void;
|
|
230
230
|
confirmAndAdd(event?: Event, row?: TableElement<T>): boolean;
|
|
231
231
|
confirmAndBackward(event?: Event, row?: TableElement<T>): boolean;
|
|
232
|
-
confirmAndForward(event?: Event, row?: TableElement<T>): Promise<boolean>;
|
|
232
|
+
confirmAndForward(event?: Event, row?: TableElement<T>): boolean | Promise<boolean>;
|
|
233
233
|
editRowById(event: Event | undefined, id: number, opts?: {
|
|
234
234
|
focusColumn?: string;
|
|
235
235
|
}): Promise<void>;
|
|
@@ -239,7 +239,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
239
239
|
* @param event
|
|
240
240
|
* @param row
|
|
241
241
|
*/
|
|
242
|
-
confirmEditCreate(event?: Event, row?: TableElement<T>):
|
|
242
|
+
confirmEditCreate(event?: Event, row?: TableElement<T>): boolean;
|
|
243
243
|
cancelOrDelete(event: Event, row: TableElement<T>, opts?: {
|
|
244
244
|
interactive?: boolean;
|
|
245
245
|
keepEditing?: boolean;
|
|
@@ -2,9 +2,9 @@ import { Duration, Moment, unitOfTime } from 'moment';
|
|
|
2
2
|
export declare const DATE_UNIX_TIMESTAMP = "X";
|
|
3
3
|
export declare const DATE_UNIX_MS_TIMESTAMP = "x";
|
|
4
4
|
export declare class DateUtils {
|
|
5
|
-
toDateISOString: typeof toDateISOString;
|
|
6
|
-
fromDateISOString: typeof fromDateISOString;
|
|
7
|
-
toDuration: typeof toDuration;
|
|
5
|
+
static toDateISOString: typeof toDateISOString;
|
|
6
|
+
static fromDateISOString: typeof fromDateISOString;
|
|
7
|
+
static toDuration: typeof toDuration;
|
|
8
8
|
static min(date1: Moment, date2: Moment): Moment;
|
|
9
9
|
static max(date1: Moment, date2: Moment): Moment;
|
|
10
10
|
static equals(date1: Moment | string, date2: Moment | string): boolean;
|
|
@@ -3,7 +3,17 @@ import { UploadFilePopoverOptions } from './upload-file/upload-file-popover.comp
|
|
|
3
3
|
import { PopoverController } from '@ionic/angular';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { OverlayEventDetail } from '@ionic/core';
|
|
6
|
+
export declare const MimeTypes: Readonly<{
|
|
7
|
+
ANDROID_APK: string;
|
|
8
|
+
}>;
|
|
6
9
|
export declare class FilesUtils {
|
|
7
10
|
static showUploadPopover<T>(popoverController: PopoverController, event: UIEvent, opts: UploadFilePopoverOptions<T>): Promise<OverlayEventDetail<UploadFile<T>[]>>;
|
|
8
11
|
static readAsText(file: File, encoding?: string): Observable<FileEvent<string>>;
|
|
9
12
|
}
|
|
13
|
+
export declare class UriUtils {
|
|
14
|
+
/**
|
|
15
|
+
* Extract the filename, from an uri (using the last slash)
|
|
16
|
+
* @param uri
|
|
17
|
+
*/
|
|
18
|
+
static getFilename(uri: string): string;
|
|
19
|
+
}
|
|
@@ -37,6 +37,7 @@ export declare function matchUpperCase(input: string, regexp: string): boolean;
|
|
|
37
37
|
*/
|
|
38
38
|
export declare function noTrailingSlash(path: string): string;
|
|
39
39
|
export declare function replaceAll(value: string, searchString: any, replacement: any): string | undefined;
|
|
40
|
+
export declare function escapeRegExp(value: string): string;
|
|
40
41
|
export declare function removeEnd(value: string, end: string): string;
|
|
41
42
|
/**
|
|
42
43
|
* Replace case change by an underscore (.e.g 'myString' becomes 'my_string')
|
|
@@ -4,7 +4,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
|
|
4
4
|
import { LoadResult, SuggestFn, SuggestService } from '../../services/entity-service.class';
|
|
5
5
|
import { InputElement } from '../../inputs';
|
|
6
6
|
import { DisplayFn, EqualsFn } from '../../form/field.model';
|
|
7
|
-
import { FloatLabelType } from '@angular/material/form-field';
|
|
7
|
+
import { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';
|
|
8
8
|
import { MatSelect } from '@angular/material/select';
|
|
9
9
|
import { MatAutocomplete, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
10
10
|
import { IonSearchbar } from '@ionic/angular';
|
|
@@ -51,6 +51,7 @@ export declare class MatAutocompleteField implements OnInit, OnDestroy, InputEle
|
|
|
51
51
|
formControl: FormControl;
|
|
52
52
|
formControlName: string;
|
|
53
53
|
floatLabel: FloatLabelType;
|
|
54
|
+
appearance: MatFormFieldAppearance;
|
|
54
55
|
placeholder: string;
|
|
55
56
|
suggestFn: SuggestFn<any, any>;
|
|
56
57
|
required: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { OnInit } from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnInit } from '@angular/core';
|
|
3
3
|
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
|
4
4
|
import { MatAutocompleteConfigHolder, MatAutocompleteField } from '../material.autocomplete';
|
|
5
5
|
import { LoadResult } from '../../../services/entity-service.class';
|
|
@@ -9,7 +9,7 @@ declare class EntityTestClass {
|
|
|
9
9
|
label: string;
|
|
10
10
|
name: string;
|
|
11
11
|
}
|
|
12
|
-
export declare class AutocompleteTestPage implements OnInit {
|
|
12
|
+
export declare class AutocompleteTestPage implements OnInit, AfterViewInit {
|
|
13
13
|
protected formBuilder: FormBuilder;
|
|
14
14
|
private _items;
|
|
15
15
|
private _$items;
|
|
@@ -21,8 +21,10 @@ export declare class AutocompleteTestPage implements OnInit {
|
|
|
21
21
|
memoryTimer: Timer;
|
|
22
22
|
mode: 'mobile' | 'desktop' | 'memory' | 'temp';
|
|
23
23
|
entitiesArray: FormArray;
|
|
24
|
+
farEntityField: MatAutocompleteField;
|
|
24
25
|
constructor(formBuilder: FormBuilder);
|
|
25
26
|
ngOnInit(): void;
|
|
27
|
+
ngAfterViewInit(): void;
|
|
26
28
|
loadData(): Promise<void>;
|
|
27
29
|
loadItems(): Promise<void>;
|
|
28
30
|
entityToString(item: any): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormControl, FormGroupDirective } from '@angular/forms';
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
|
-
import { FloatLabelType } from '@angular/material/form-field';
|
|
4
|
+
import { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';
|
|
5
5
|
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
6
6
|
import { InputElement } from '../../inputs';
|
|
7
7
|
import { SuggestFn } from '../../services/entity-service.class';
|
|
@@ -19,6 +19,7 @@ export declare class MatChipsField implements OnInit, OnDestroy, InputElement, C
|
|
|
19
19
|
formControl: FormControl;
|
|
20
20
|
formControlName: string;
|
|
21
21
|
floatLabel: FloatLabelType;
|
|
22
|
+
appearance: MatFormFieldAppearance;
|
|
22
23
|
placeholder: string;
|
|
23
24
|
suggestFn: SuggestFn<any, any>;
|
|
24
25
|
required: boolean;
|
|
@@ -8,6 +8,6 @@ export declare class LatLongFormatOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export declare type LatLongFormatFn = (value: number | null, opts?: LatLongFormatOptions) => string;
|
|
10
10
|
export declare const LAT_LONG_DEFAULT_MAX_DECIMALS = 3;
|
|
11
|
-
export declare function formatLatitude(value: number | null, opts?: LatLongFormatOptions): string;
|
|
12
|
-
export declare function formatLongitude(value: number | null, opts?: LatLongFormatOptions): string;
|
|
11
|
+
export declare function formatLatitude(value: number | null, opts?: Partial<LatLongFormatOptions>): string;
|
|
12
|
+
export declare function formatLongitude(value: number | null, opts?: Partial<LatLongFormatOptions>): string;
|
|
13
13
|
export declare function parseLatitudeOrLongitude(input: string, pattern: string, maxDecimals?: number, placeholderChar?: string): number | null;
|
|
@@ -12,11 +12,11 @@ export declare class MatLatLongField implements OnInit, OnDestroy, ControlValueA
|
|
|
12
12
|
private _onChangeCallback;
|
|
13
13
|
private _onTouchedCallback;
|
|
14
14
|
private _subscription;
|
|
15
|
+
private _formatOptions;
|
|
15
16
|
protected disabling: boolean;
|
|
16
17
|
protected writing: boolean;
|
|
17
18
|
_readonly: boolean;
|
|
18
|
-
|
|
19
|
-
formatFnOptions: LatLongFormatOptions;
|
|
19
|
+
_formatFn: LatLongFormatFn;
|
|
20
20
|
textMaskConfig: TextMaskConfig;
|
|
21
21
|
textFormControl: FormControl;
|
|
22
22
|
signFormControl: FormControl;
|
|
@@ -24,21 +24,20 @@ export declare class MatLatLongField implements OnInit, OnDestroy, ControlValueA
|
|
|
24
24
|
value: number;
|
|
25
25
|
inputPlaceholder: string;
|
|
26
26
|
showSignControl: boolean;
|
|
27
|
-
mobile: boolean;
|
|
28
27
|
get disabled(): any;
|
|
29
28
|
formControl: FormControl;
|
|
30
29
|
formControlName: string;
|
|
31
|
-
placeholder: string;
|
|
32
30
|
type: 'latitude' | 'longitude';
|
|
33
31
|
pattern: LatLongPattern;
|
|
32
|
+
required: boolean;
|
|
33
|
+
floatLabel: FloatLabelType;
|
|
34
|
+
placeholder: string;
|
|
35
|
+
tabindex: number;
|
|
34
36
|
defaultSign: '-' | '+';
|
|
35
37
|
maxDecimals: number;
|
|
36
38
|
placeholderChar: string;
|
|
37
|
-
floatLabel: FloatLabelType;
|
|
38
39
|
set readonly(value: boolean);
|
|
39
40
|
get readonly(): boolean;
|
|
40
|
-
required: boolean;
|
|
41
|
-
tabindex: number;
|
|
42
41
|
onBlur: EventEmitter<FocusEvent>;
|
|
43
42
|
onFocus: EventEmitter<FocusEvent>;
|
|
44
43
|
inputElement: ElementRef;
|
|
@@ -49,11 +48,17 @@ export declare class MatLatLongField implements OnInit, OnDestroy, ControlValueA
|
|
|
49
48
|
registerOnChange(fn: any): void;
|
|
50
49
|
registerOnTouched(fn: any): void;
|
|
51
50
|
setDisabledState(isDisabled: boolean): void;
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Format value to display as string (no placeholder char, and show sign)
|
|
53
|
+
* @param value
|
|
54
|
+
* @param opts
|
|
55
|
+
*/
|
|
56
|
+
_format(value: number, opts?: Partial<LatLongFormatOptions>): string;
|
|
54
57
|
_onFocus(event: FocusEvent): boolean;
|
|
55
58
|
_onBlur(event: FocusEvent): void;
|
|
56
59
|
moveCaretToSeparator(event: any, forward: boolean): boolean;
|
|
57
60
|
onKeypress(event: KeyboardEvent): void;
|
|
58
|
-
|
|
61
|
+
private onFormChange;
|
|
62
|
+
private checkIfTouched;
|
|
63
|
+
private markForCheck;
|
|
59
64
|
}
|
|
@@ -3,7 +3,7 @@ import { ControlValueAccessor, FormControl, FormGroupDirective } from '@angular/
|
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
import { InputElement, selectInputContent } from '../../inputs';
|
|
5
5
|
import { EqualsFn, DisplayFn } from '../../form/field.model';
|
|
6
|
-
import { FloatLabelType } from '@angular/material/form-field';
|
|
6
|
+
import { FloatLabelType, MatFormFieldAppearance } from '@angular/material/form-field';
|
|
7
7
|
import { IonSlides } from '@ionic/angular';
|
|
8
8
|
import { MatButton } from '@angular/material/button';
|
|
9
9
|
export declare class MatSwipeField implements OnInit, InputElement, OnDestroy, ControlValueAccessor {
|
|
@@ -28,6 +28,7 @@ export declare class MatSwipeField implements OnInit, InputElement, OnDestroy, C
|
|
|
28
28
|
formControl: FormControl;
|
|
29
29
|
formControlName: string;
|
|
30
30
|
floatLabel: FloatLabelType;
|
|
31
|
+
appearance: MatFormFieldAppearance;
|
|
31
32
|
placeholder: string;
|
|
32
33
|
debug: boolean;
|
|
33
34
|
required: boolean;
|
|
@@ -44,8 +45,8 @@ export declare class MatSwipeField implements OnInit, InputElement, OnDestroy, C
|
|
|
44
45
|
get items(): Observable<any[]> | any[];
|
|
45
46
|
get itemCount(): number;
|
|
46
47
|
onClick: EventEmitter<MouseEvent>;
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
blurred: EventEmitter<FocusEvent>;
|
|
49
|
+
focused: EventEmitter<FocusEvent>;
|
|
49
50
|
fakeInput: ElementRef;
|
|
50
51
|
slides: IonSlides;
|
|
51
52
|
prevButton: MatButton;
|
|
@@ -7,7 +7,7 @@ export declare class FormErrorTranslatePipe implements PipeTransform, OnDestroy
|
|
|
7
7
|
value: string;
|
|
8
8
|
private _lastForm;
|
|
9
9
|
private _lastOptions;
|
|
10
|
-
private
|
|
10
|
+
private _onFormStatusChanges;
|
|
11
11
|
constructor(adapter: FormErrorTranslator, _ref: ChangeDetectorRef);
|
|
12
12
|
transform(form: FormGroup, opts?: FormErrorTranslatorOptions): string;
|
|
13
13
|
ngOnDestroy(): void;
|
|
@@ -21,11 +21,27 @@ export declare class FormGetPipe implements PipeTransform {
|
|
|
21
21
|
transform(form: AbstractControl, path: Array<string | number> | string): AbstractControl;
|
|
22
22
|
}
|
|
23
23
|
export declare class FormGetControlPipe implements PipeTransform {
|
|
24
|
-
transform(form: AbstractControl, path
|
|
24
|
+
transform(form: AbstractControl, path?: Array<string | number> | string): FormControl;
|
|
25
25
|
}
|
|
26
26
|
export declare class FormGetArrayPipe implements PipeTransform {
|
|
27
|
-
transform(form: AbstractControl, path
|
|
27
|
+
transform(form: AbstractControl, path?: Array<string | number> | string): FormArray;
|
|
28
28
|
}
|
|
29
29
|
export declare class FormGetGroupPipe implements PipeTransform {
|
|
30
|
-
transform(form: AbstractControl, path
|
|
30
|
+
transform(form: AbstractControl, path?: Array<string | number> | string): FormGroup;
|
|
31
|
+
}
|
|
32
|
+
export declare class FormGetValuePipe implements PipeTransform {
|
|
33
|
+
private adapter;
|
|
34
|
+
private _ref;
|
|
35
|
+
value: any;
|
|
36
|
+
private _lastControl;
|
|
37
|
+
private _lastPath;
|
|
38
|
+
private _onControlValueChanges;
|
|
39
|
+
private _onControlStatusChanges;
|
|
40
|
+
constructor(adapter: FormErrorTranslator, _ref: ChangeDetectorRef);
|
|
41
|
+
transform(form: AbstractControl, path?: Array<string | number> | string, listenStatusChanges?: boolean): any;
|
|
42
|
+
ngOnDestroy(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Clean any existing subscription to change events
|
|
45
|
+
*/
|
|
46
|
+
private _dispose;
|
|
31
47
|
}
|