@sumaris-net/ngx-components 18.6.8 → 18.6.10-beta1
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 +3 -0
- package/esm2022/public_api.mjs +3 -1
- package/esm2022/src/app/admin/services/validator/person.validator.mjs +1 -1
- package/esm2022/src/app/core/account/account.page.mjs +32 -20
- package/esm2022/src/app/core/form/properties/properties.table.mjs +28 -32
- package/esm2022/src/app/core/form/properties/properties.utils.mjs +14 -1
- package/esm2022/src/app/core/services/account.service.mjs +22 -7
- package/esm2022/src/app/core/services/local-settings.service.mjs +9 -2
- package/esm2022/src/app/core/services/model/account.model.mjs +32 -13
- package/esm2022/src/app/core/services/model/entity.model.mjs +1 -1
- package/esm2022/src/app/core/services/platform.service.mjs +4 -3
- package/esm2022/src/app/core/services/validator/base.validator.class.mjs +3 -3
- package/esm2022/src/app/core/table/entities-async-table-datasource.class.mjs +1 -1
- package/esm2022/src/app/core/table/entities-table-datasource.class.mjs +1 -1
- package/esm2022/src/app/shared/named-filter/named-filter-selector.component.mjs +1 -1
- package/esm2022/src/app/shared/named-filter/named-filter.model.mjs +1 -1
- package/esm2022/src/app/social/user-event/user-event.model.mjs +1 -1
- package/fesm2022/sumaris-net.ngx-components.mjs +131 -71
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +2 -0
- package/src/app/admin/services/validator/person.validator.d.ts +1 -1
- package/src/app/core/account/account.page.d.ts +2 -0
- package/src/app/core/form/properties/properties.table.d.ts +4 -10
- package/src/app/core/form/properties/properties.utils.d.ts +4 -0
- package/src/app/core/install/install-upgrade-card.component.d.ts +1 -1
- package/src/app/core/services/account.service.d.ts +2 -0
- package/src/app/core/services/local-settings.service.d.ts +1 -0
- package/src/app/core/services/model/account.model.d.ts +17 -2
- package/src/app/core/services/model/entity.model.d.ts +2 -2
- package/src/app/core/services/validator/base.validator.class.d.ts +5 -5
- package/src/app/core/table/entities-async-table-datasource.class.d.ts +2 -2
- package/src/app/core/table/entities-table-datasource.class.d.ts +2 -2
- package/src/app/shared/named-filter/named-filter-selector.component.d.ts +3 -1
- package/src/app/shared/named-filter/named-filter.model.d.ts +2 -2
- package/src/app/social/user-event/user-event.model.d.ts +2 -2
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ export * from './src/app/shared/events';
|
|
|
118
118
|
export * from './src/app/shared/alerts';
|
|
119
119
|
export * from './src/app/shared/platforms';
|
|
120
120
|
export * from './src/app/shared/geolocation/geolocation.utils';
|
|
121
|
+
export * from './src/app/shared/version/versions';
|
|
121
122
|
export * from './src/app/shared/file/file.utils';
|
|
122
123
|
export * from './src/app/shared/file/csv.utils';
|
|
123
124
|
export * from './src/app/shared/file/images.utils';
|
|
@@ -173,6 +174,7 @@ export * from './src/app/core/services/errors';
|
|
|
173
174
|
export * from './src/app/core/services/platform.service';
|
|
174
175
|
export * from './src/app/core/services/network.service';
|
|
175
176
|
export * from './src/app/core/services/network.types';
|
|
177
|
+
export * from './src/app/core/services/network.utils';
|
|
176
178
|
export * from './src/app/core/services/config.service';
|
|
177
179
|
export { CORE_CONFIG_OPTIONS } from './src/app/core/services/config/core.config';
|
|
178
180
|
export * from './src/app/core/services/local-settings.service';
|
|
@@ -10,7 +10,7 @@ export interface PersonValidatorOptions {
|
|
|
10
10
|
withUsername?: boolean;
|
|
11
11
|
withUsernameExtranet?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare class PersonValidatorService<T extends Person = Person, O extends PersonValidatorOptions = PersonValidatorOptions> extends AppValidatorService<T> {
|
|
13
|
+
export declare class PersonValidatorService<T extends Person = Person, O extends PersonValidatorOptions = PersonValidatorOptions> extends AppValidatorService<T, O> {
|
|
14
14
|
protected accountService: AccountService;
|
|
15
15
|
constructor(formBuilder: UntypedFormBuilder, translate: TranslateService, accountService: AccountService);
|
|
16
16
|
getFormGroupConfig(data?: T, opts?: O): {
|
|
@@ -47,6 +47,8 @@ export declare class AccountPage extends AppForm<Account> implements OnInit, OnD
|
|
|
47
47
|
protected accountReadOnly: boolean;
|
|
48
48
|
protected readonly mobile: boolean;
|
|
49
49
|
get valid(): boolean;
|
|
50
|
+
get invalid(): boolean;
|
|
51
|
+
get dirty(): boolean;
|
|
50
52
|
protected showLatLonFormat: boolean;
|
|
51
53
|
protected canChangePassword: boolean;
|
|
52
54
|
protected showSecurityDetails: boolean;
|
|
@@ -7,16 +7,14 @@ import { FormFieldDefinition, FormFieldDefinitionMap } from '../../../shared/for
|
|
|
7
7
|
import { Environment } from '../../../../environments/environment.class';
|
|
8
8
|
import { TableElement } from '@e-is/ngx-material-table';
|
|
9
9
|
import { EntityFilter } from '../../services/model/filter.model';
|
|
10
|
-
import { FilterFn,
|
|
10
|
+
import { FilterFn, Property } from '../../../shared/types';
|
|
11
11
|
import { MatExpansionPanel } from '@angular/material/expansion';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
|
-
|
|
14
|
-
translatedName?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class PropertyEntity extends Entity<PropertyEntity, string> {
|
|
13
|
+
export declare class PropertyEntity extends Entity<PropertyEntity, string> implements Property {
|
|
17
14
|
static fromObject: (source: any, opts?: any) => PropertyEntity;
|
|
18
|
-
definition:
|
|
15
|
+
definition: FormFieldDefinition;
|
|
19
16
|
value: any;
|
|
17
|
+
get key(): string;
|
|
20
18
|
fromObject(source: any): void;
|
|
21
19
|
asObject(opts?: EntityAsObjectOptions): any;
|
|
22
20
|
}
|
|
@@ -46,7 +44,6 @@ export declare class AppPropertiesTable extends AppInMemoryTable<PropertyEntity,
|
|
|
46
44
|
showToolbar: boolean;
|
|
47
45
|
filterExpansionPanel: MatExpansionPanel;
|
|
48
46
|
definitionsMapByKey: FormFieldDefinitionMap;
|
|
49
|
-
translationsByKey: ObjectMap<string>;
|
|
50
47
|
filterForm: UntypedFormGroup;
|
|
51
48
|
filterCriteriaCount: number;
|
|
52
49
|
filterPanelFloating: boolean;
|
|
@@ -69,10 +66,7 @@ export declare class AppPropertiesTable extends AppInMemoryTable<PropertyEntity,
|
|
|
69
66
|
toggleFilterPanelFloating(): void;
|
|
70
67
|
closeFilterPanel(): void;
|
|
71
68
|
applyFilterAndClosePanel(event?: Event): void;
|
|
72
|
-
toTranslatedFormFieldDefinition: (definition: FormFieldDefinition) => TranslatedFormFieldDefinition;
|
|
73
69
|
resetProperty(event: UIEvent, row: TableElement<PropertyEntity>): void;
|
|
74
|
-
protected toValue(values: PropertyEntity[], definition: FormFieldDefinition): any;
|
|
75
70
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppPropertiesTable, never>;
|
|
76
71
|
static ɵcmp: i0.ɵɵComponentDeclaration<AppPropertiesTable, "app-properties-table", never, { "definitions": { "alias": "definitions"; "required": false; }; "showToolbar": { "alias": "showToolbar"; "required": false; }; }, {}, never, never, false, never>;
|
|
77
72
|
}
|
|
78
|
-
export {};
|
|
@@ -25,6 +25,10 @@ export declare class AppPropertiesUtils {
|
|
|
25
25
|
static arrayFromObject<T>(sources?: PropertyMap | Property<T>[], definitions?: FormFieldDefinition[], opts?: {
|
|
26
26
|
keepOrphan?: boolean;
|
|
27
27
|
}): Property<T>[] | Promise<Property<T>[]>;
|
|
28
|
+
static sanitize(source: PropertyMap | Property[], opts?: {
|
|
29
|
+
definitions?: FormFieldDefinition[];
|
|
30
|
+
includedKeys?: string[];
|
|
31
|
+
}): PropertyMap | Property[];
|
|
28
32
|
}
|
|
29
33
|
export declare class AppPropertyUtils {
|
|
30
34
|
static key(key: any): string;
|
|
@@ -46,7 +46,7 @@ export declare class AppInstallUpgradeCard implements OnInit, OnDestroy {
|
|
|
46
46
|
download(event: Event, link: InstallAppLink): Promise<void>;
|
|
47
47
|
openFile(event: Event, link: InstallAppLink): Promise<void>;
|
|
48
48
|
tryOnline(): Promise<void>;
|
|
49
|
-
getPlatformName(platform: 'android' | 'ios' | 'electron'): "" | "
|
|
49
|
+
getPlatformName(platform: 'android' | 'ios' | 'electron'): "" | "Android" | "iOS" | "desktop";
|
|
50
50
|
asLink(value: any): InstallAppLink;
|
|
51
51
|
private checkNeedInstallOrUpdate;
|
|
52
52
|
private getCompatibleInstallLinks;
|
|
@@ -47,6 +47,7 @@ export interface ChangePasswordData {
|
|
|
47
47
|
}
|
|
48
48
|
export interface UserSettingsOptions {
|
|
49
49
|
options: FormFieldDefinitionMap;
|
|
50
|
+
remoteLocalSettingsKeys?: (keyof LocalSettings | string)[];
|
|
50
51
|
}
|
|
51
52
|
export declare const APP_USER_SETTINGS_OPTIONS: InjectionToken<UserSettingsOptions>;
|
|
52
53
|
export declare const APP_USER_TOKEN_SCOPES: InjectionToken<TokenScope[]>;
|
|
@@ -82,6 +83,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
82
83
|
private readonly _listenIntervalInSeconds;
|
|
83
84
|
private _cache;
|
|
84
85
|
private readonly _optionDefs;
|
|
86
|
+
private readonly _remoteLocalSettingsKeys;
|
|
85
87
|
private _$additionalFields;
|
|
86
88
|
private _tokenType$;
|
|
87
89
|
private _apiTokenEnabled;
|
|
@@ -61,6 +61,7 @@ export declare class LocalSettingsService extends StartableService<LocalSettings
|
|
|
61
61
|
apply(settings: Partial<LocalSettings>, opts?: {
|
|
62
62
|
emitEvent?: boolean;
|
|
63
63
|
persistImmediate?: boolean;
|
|
64
|
+
sanitize?: boolean;
|
|
64
65
|
}): Promise<void>;
|
|
65
66
|
applyProperty(key: keyof LocalSettings, value: any, opts?: {
|
|
66
67
|
emitEvent?: boolean;
|
|
@@ -3,6 +3,7 @@ import { Person, UserProfileLabel } from './person.model';
|
|
|
3
3
|
import { Entity, EntityAsObjectOptions } from './entity.model';
|
|
4
4
|
import { LatLongPattern } from '../../../shared/material/latlong/latlong.utils';
|
|
5
5
|
import { UserToken } from './token.model';
|
|
6
|
+
import { FormFieldDefinition } from '../../../shared/form/field.model';
|
|
6
7
|
/**
|
|
7
8
|
* A user account
|
|
8
9
|
*/
|
|
@@ -35,7 +36,21 @@ export declare class UserSettings extends Entity<UserSettings> {
|
|
|
35
36
|
constructor();
|
|
36
37
|
asObject(opts?: EntityAsObjectOptions): any;
|
|
37
38
|
fromObject(source: any, opts?: any): void;
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Merges the given source object into the current instance.
|
|
41
|
+
*
|
|
42
|
+
* @param {S} source - The source object containing properties to merge.
|
|
43
|
+
* @param {Array<keyof S | string | number>} [includedProperties] - Optional array of property keys to be merged into the content map.
|
|
44
|
+
* @param {boolean} [resetContent] - Optional flag to reset existing content. False by default
|
|
45
|
+
* @return {boolean} - Returns true if any changes were made; otherwise, false.
|
|
46
|
+
*/
|
|
47
|
+
merge<S = LocalSettings>(source: S, includedProperties: (keyof S | string | number)[], resetContent?: boolean): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Transform user settings into local settings
|
|
50
|
+
* @param opts
|
|
51
|
+
*/
|
|
52
|
+
asLocalSettings(opts?: {
|
|
53
|
+
definitions?: FormFieldDefinition[];
|
|
54
|
+
}): Partial<LocalSettings>;
|
|
40
55
|
}
|
|
41
56
|
export declare function accountToString(data: Account): string;
|
|
@@ -20,9 +20,9 @@ export interface IEntity<T, ID = number, AO extends EntityAsObjectOptions = Enti
|
|
|
20
20
|
__typename: string;
|
|
21
21
|
equals(other: T): boolean;
|
|
22
22
|
clone(opts?: AO & FO): T;
|
|
23
|
-
copy(target: T, opts?: AO & FO):
|
|
23
|
+
copy(target: T, opts?: AO & FO): void;
|
|
24
24
|
asObject(opts?: AO): any;
|
|
25
|
-
fromObject(source: any, opts?: FO):
|
|
25
|
+
fromObject(source: any, opts?: FO): void;
|
|
26
26
|
}
|
|
27
27
|
export declare abstract class Entity<T extends Entity<T, ID, AO, FO>, ID = number, AO extends EntityAsObjectOptions = EntityAsObjectOptions, FO = any> implements IEntity<T, ID, AO, FO> {
|
|
28
28
|
static TYPENAME: string;
|
|
@@ -4,18 +4,18 @@ import { IValidatorService } from '../../../shared/services/validator-service.cl
|
|
|
4
4
|
import { TranslateService } from '@ngx-translate/core';
|
|
5
5
|
import { FormErrors } from '../../../shared/forms';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare abstract class AppValidatorService<T = any> extends ValidatorService implements IValidatorService<T> {
|
|
7
|
+
export declare abstract class AppValidatorService<T = any, O = any> extends ValidatorService implements IValidatorService<T> {
|
|
8
8
|
protected formBuilder: UntypedFormBuilder;
|
|
9
9
|
protected translate?: TranslateService;
|
|
10
10
|
protected constructor(formBuilder: UntypedFormBuilder, translate?: TranslateService);
|
|
11
11
|
getRowValidator(): UntypedFormGroup;
|
|
12
|
-
getFormGroup(data?: T): UntypedFormGroup;
|
|
13
|
-
getFormGroupConfig(data?: T): {
|
|
12
|
+
getFormGroup(data?: T, opts?: O): UntypedFormGroup;
|
|
13
|
+
getFormGroupConfig(data?: T, opts?: O): {
|
|
14
14
|
[key: string]: any[];
|
|
15
15
|
};
|
|
16
16
|
getI18nFormErrors(control: AbstractControl): string[];
|
|
17
17
|
getI18nErrors(errors: FormErrors): string[];
|
|
18
18
|
protected getI18nError(errorKey: string, errorContent?: any): string;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AppValidatorService<any>, never>;
|
|
20
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AppValidatorService<any>, never, never, {}, {}, never, never, false, never>;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppValidatorService<any, any>, never>;
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AppValidatorService<any, any>, never, never, {}, {}, never, never, false, never>;
|
|
21
21
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AsyncTableDataSource, AsyncTableElement, TableDataSourceConfig, ValidatorService } from '@e-is/ngx-material-table';
|
|
2
2
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IEntity } from '../services/model/entity.model';
|
|
4
4
|
import { OnDestroy } from '@angular/core';
|
|
5
5
|
import { SortDirection } from '@angular/material/sort';
|
|
6
6
|
import { CollectionViewer } from '@angular/cdk/collections';
|
|
7
7
|
import { EntitiesServiceWatchOptions, FetchMoreFn, IEntitiesService, LoadResult } from '../../shared/services/entity-service.class';
|
|
8
8
|
import { IEntitiesTableDataSource } from './table.model';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
-
export interface EntitiesAsyncTableDataSourceConfig<T extends
|
|
10
|
+
export interface EntitiesAsyncTableDataSourceConfig<T extends IEntity<T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, SO = any> extends TableDataSourceConfig {
|
|
11
11
|
onRowCreated?: (row: AsyncTableElement<T>) => Promise<void> | void;
|
|
12
12
|
saveOnlyDirtyRows?: boolean;
|
|
13
13
|
readOnly?: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableDataSource, TableDataSourceConfig, TableElement, ValidatorService } from '@e-is/ngx-material-table';
|
|
2
2
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { IEntity } from '../services/model/entity.model';
|
|
4
4
|
import { OnDestroy } from '@angular/core';
|
|
5
5
|
import { SortDirection } from '@angular/material/sort';
|
|
6
6
|
import { CollectionViewer } from '@angular/cdk/collections';
|
|
7
7
|
import { EntitiesServiceWatchOptions, FetchMoreFn, IEntitiesService, LoadResult } from '../../shared/services/entity-service.class';
|
|
8
8
|
import { IEntitiesTableDataSource } from './table.model';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
-
export interface EntitiesTableDataSourceConfig<T extends
|
|
10
|
+
export interface EntitiesTableDataSourceConfig<T extends IEntity<T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, SO = any> extends TableDataSourceConfig {
|
|
11
11
|
onRowCreated?: (row: TableElement<T>) => Promise<void> | void;
|
|
12
12
|
saveOnlyDirtyRows?: boolean;
|
|
13
13
|
saveBeforeDelete?: boolean;
|
|
@@ -9,7 +9,9 @@ import { INamedFilterService, NamedFilterLoadOptions, NamedFilterWatchOptions }
|
|
|
9
9
|
import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
export type NamedFilterSelectorButtonsPosition = 'matSuffix' | 'after';
|
|
12
|
-
export declare class NamedFilterSelector extends AppForm<
|
|
12
|
+
export declare class NamedFilterSelector extends AppForm<{
|
|
13
|
+
namedFilter: any;
|
|
14
|
+
}> implements OnInit {
|
|
13
15
|
protected injector: Injector;
|
|
14
16
|
protected formBuilder: UntypedFormBuilder;
|
|
15
17
|
protected cd: ChangeDetectorRef;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Entity, IEntity } from '../../core/services/model/entity.model';
|
|
2
2
|
import { EntityFilter, IEntityFilter } from '../../core/services/model/filter.model';
|
|
3
|
-
export interface INamedFilter<T extends INamedFilter<T>> extends IEntity<T
|
|
3
|
+
export interface INamedFilter<T extends INamedFilter<T>> extends IEntity<T> {
|
|
4
4
|
name: string;
|
|
5
5
|
entityName: string;
|
|
6
6
|
content: any;
|
|
7
7
|
recorderPersonId: number;
|
|
8
8
|
recorderDepartmentId: number;
|
|
9
9
|
}
|
|
10
|
-
export declare class NamedFilter<T extends NamedFilter<any> = NamedFilter<any>> extends Entity<T
|
|
10
|
+
export declare class NamedFilter<T extends NamedFilter<any> = NamedFilter<any>> extends Entity<T> implements INamedFilter<T> {
|
|
11
11
|
static fromObject: (source: any, opts?: any) => NamedFilter;
|
|
12
12
|
name: string;
|
|
13
13
|
entityName: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
|
-
import {
|
|
2
|
+
import { IEntity } from '../../core/services/model/entity.model';
|
|
3
3
|
import { IEntityFilter } from '../../core/services/model/filter.model';
|
|
4
4
|
import { AppColors, IconRef } from '../../shared/types';
|
|
5
5
|
export type EventLevel = 'ERROR' | 'WARNING' | 'INFO' | 'DEBUG';
|
|
6
|
-
export interface IUserEvent<E extends
|
|
6
|
+
export interface IUserEvent<E extends IEntity<E, ID>, ID = number, U = string, L = EventLevel> extends IEntity<E, ID> {
|
|
7
7
|
issuer: U;
|
|
8
8
|
recipient: U;
|
|
9
9
|
type: string;
|
package/src/assets/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ngx-sumaris-components",
|
|
3
3
|
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "18.6.
|
|
5
|
+
"version": "18.6.9",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|