@sumaris-net/ngx-components 2.9.7 → 2.9.8

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.
Files changed (37) hide show
  1. package/doc/changelog.md +3 -0
  2. package/esm2022/public_api.mjs +3 -3
  3. package/esm2022/src/app/admin/services/filter/person.filter.mjs +1 -1
  4. package/esm2022/src/app/core/form/entity/entity-editor-modal.class.mjs +1 -1
  5. package/esm2022/src/app/core/form/entity/entity-editor.class.mjs +1 -1
  6. package/esm2022/src/app/core/form/form.utils.mjs +21 -2
  7. package/esm2022/src/app/core/form/properties/properties.table.mjs +1 -1
  8. package/esm2022/src/app/core/services/errors.mjs +1 -1
  9. package/esm2022/src/app/core/services/model/entity.model.mjs +1 -1
  10. package/esm2022/src/app/core/services/model/filter.model.mjs +1 -1
  11. package/esm2022/src/app/core/services/model/tree-item-entity.model.mjs +1 -1
  12. package/esm2022/src/app/core/services/testing/referential-filter.model.mjs +1 -1
  13. package/esm2022/src/app/shared/services/entity-service.class.mjs +1 -1
  14. package/esm2022/src/app/shared/services/memory-entity-service.class.mjs +1 -1
  15. package/esm2022/src/app/shared/types.mjs +1 -1
  16. package/esm2022/src/app/social/message/message.model.mjs +1 -1
  17. package/esm2022/src/app/social/user-event/testing/user-event.testing.model.mjs +1 -1
  18. package/fesm2022/sumaris-net.ngx-components.mjs +21 -2
  19. package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
  20. package/package.json +1 -1
  21. package/public_api.d.ts +2 -2
  22. package/src/app/admin/services/filter/person.filter.d.ts +1 -1
  23. package/src/app/core/form/entity/entity-editor-modal.class.d.ts +1 -1
  24. package/src/app/core/form/entity/entity-editor.class.d.ts +1 -10
  25. package/src/app/core/form/form.utils.d.ts +10 -1
  26. package/src/app/core/form/properties/properties.table.d.ts +1 -2
  27. package/src/app/core/services/errors.d.ts +10 -0
  28. package/src/app/core/services/model/entity.model.d.ts +1 -2
  29. package/src/app/core/services/model/filter.model.d.ts +1 -1
  30. package/src/app/core/services/model/tree-item-entity.model.d.ts +1 -1
  31. package/src/app/core/services/testing/referential-filter.model.d.ts +1 -1
  32. package/src/app/shared/services/entity-service.class.d.ts +0 -2
  33. package/src/app/shared/services/memory-entity-service.class.d.ts +2 -1
  34. package/src/app/shared/types.d.ts +3 -0
  35. package/src/app/social/message/message.model.d.ts +1 -1
  36. package/src/app/social/user-event/testing/user-event.testing.model.d.ts +2 -3
  37. package/src/assets/manifest.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": "2.9.7",
4
+ "version": "2.9.8",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
package/public_api.d.ts CHANGED
@@ -155,6 +155,8 @@ export * from './src/app/core/services/pipes/person-to-string.pipe';
155
155
  export * from './src/app/core/services/pipes/usage-mode.pipes';
156
156
  export * from './src/app/core/services/pipes/referential-to-string.pipe';
157
157
  export * from './src/app/core/services/pipes/pipes.module';
158
+ export * from './src/app/core/services/base58';
159
+ export * from './src/app/core/services/errors';
158
160
  export * from './src/app/core/services/platform.service';
159
161
  export * from './src/app/core/services/network.service';
160
162
  export * from './src/app/core/services/network.types';
@@ -164,7 +166,6 @@ export * from './src/app/core/services/local-settings.service';
164
166
  export * from './src/app/core/services/account.service';
165
167
  export * from './src/app/core/services/crypto.service';
166
168
  export * from './src/app/core/services/auth-guard.service';
167
- export * from './src/app/core/services/base58';
168
169
  export * from './src/app/core/services/base-graphql-service.class';
169
170
  export * from './src/app/core/services/base-entity-service.class';
170
171
  export * from './src/app/core/services/storage/entities-storage.service';
@@ -288,7 +289,6 @@ export * from './src/app/shared/audio/audio.testing.module';
288
289
  export * from './src/app/core/core.testing.module';
289
290
  export * from './src/app/core/services/testing/referential-filter.model';
290
291
  export * from './src/app/core/services/testing/referential.validator';
291
- export * from './src/app/core/services/errors';
292
292
  export * from './src/app/core/table/testing/table.testing.module';
293
293
  export * from './src/app/core/table/testing/table.testing';
294
294
  export * from './src/app/core/table/testing/table2.testing';
@@ -1,8 +1,8 @@
1
1
  import { EntityFilter } from '../../../core/services/model/filter.model';
2
2
  import { Person } from '../../../core/services/model/person.model';
3
- import { FilterFn } from '../../../shared/services/entity-service.class';
4
3
  import { EntityAsObjectOptions } from '../../../core/services/model/entity.model';
5
4
  import { StoreObject } from '@apollo/client/core';
5
+ import { FilterFn } from '../../../shared/types';
6
6
  export declare class PersonFilter extends EntityFilter<PersonFilter, Person> {
7
7
  static fromObject: (source: any, opts?: any) => PersonFilter;
8
8
  static searchFilter(source: any): FilterFn<Person>;
@@ -6,10 +6,10 @@ import { Entity } from '../../services/model/entity.model';
6
6
  import { UsageMode } from '../../services/model/settings.model';
7
7
  import { FormGroup } from '@angular/forms';
8
8
  import { AppTabEditor, AppTabEditorOptions } from './tab-editor.class';
9
+ import { AppErrorWithDetails } from '../../services/errors';
9
10
  import { DateFormatService } from '../../../shared/pipes/date-format.pipe';
10
11
  import { WaitForOptions } from '../../../shared/observables';
11
12
  import { FormErrorTranslator } from '../../../shared/validator/form-error-adapter.class';
12
- import { AppErrorWithDetails } from './entity-editor.class';
13
13
  import * as i0 from "@angular/core";
14
14
  export interface IEntityEditorModalOptions<T extends Entity<T, ID> = Entity<any, any>, ID = number> {
15
15
  isNew: boolean;
@@ -6,13 +6,13 @@ import { Entity } from '../../services/model/entity.model';
6
6
  import { UsageMode } from '../../services/model/settings.model';
7
7
  import { FormGroup } from '@angular/forms';
8
8
  import { AppTabEditor, AppTabEditorOptions, IAppTabEditor } from './tab-editor.class';
9
+ import { AppErrorWithDetails } from '../../services/errors';
9
10
  import { EntityServiceLoadOptions, IEntityService } from '../../../shared/services/entity-service.class';
10
11
  import { DateFormatService } from '../../../shared/pipes/date-format.pipe';
11
12
  import { Environment } from '../../../../environments/environment.class';
12
13
  import { HistoryPageReference } from '../../services/model/history.model';
13
14
  import { WaitForOptions } from '../../../shared/observables';
14
15
  import { FormErrorTranslator } from '../../../shared/validator/form-error-adapter.class';
15
- import { FormErrors } from '../../../shared/forms';
16
16
  import * as i0 from "@angular/core";
17
17
  export interface IAppEntityEditor<T> extends IAppTabEditor<T> {
18
18
  usageMode: UsageMode;
@@ -34,15 +34,6 @@ export declare class AppEditorOptions extends AppTabEditorOptions {
34
34
  autoOpenNextTab?: boolean;
35
35
  i18nPrefix?: string;
36
36
  }
37
- export interface AppError {
38
- code?: number;
39
- message?: string;
40
- }
41
- export interface AppErrorWithDetails extends AppError {
42
- details: AppError & {
43
- errors?: FormErrors;
44
- };
45
- }
46
37
  export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends IEntityService<T, ID> = IEntityService<T, any>, ID = number, LO extends EntityServiceLoadOptions = EntityServiceLoadOptions> extends AppTabEditor<T, ID, LO> implements OnInit, OnDestroy, AfterViewInit, IAppEntityEditor<T> {
47
38
  protected dataType: new () => T;
48
39
  protected dataService?: S;
@@ -2,7 +2,8 @@ import { AbstractControl, AbstractControlOptions, UntypedFormArray, UntypedFormB
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 { addValueInArray, clearValueInArray, copyEntity2Form, disableControls, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, removeValueInArray, resizeArray, updateValueAndValidity, waitIdle, waitWhilePending } from '../../shared/forms';
5
+ import { addValueInArray, clearValueInArray, copyEntity2Form, disableControls, FormErrors, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, removeValueInArray, resizeArray, updateValueAndValidity, waitIdle, waitWhilePending } from '../../shared/forms';
6
+ import { Predicate } from '@angular/core';
6
7
  export declare type IAppFormGetter = () => IAppForm;
7
8
  export declare interface OnReady {
8
9
  ngOnReady(): any;
@@ -321,6 +322,9 @@ export declare class AppFormArray<T extends Entity<T>, C extends AbstractControl
321
322
  removeAllEmpty(): void;
322
323
  protected setAllowEmptyArray(value: boolean): void;
323
324
  }
325
+ /**
326
+ * Helper class, for angular forms
327
+ */
324
328
  export declare class AppFormUtils {
325
329
  static copyEntity2Form: typeof copyEntity2Form;
326
330
  static getFormValueFromEntity: typeof getFormValueFromEntity;
@@ -354,6 +358,8 @@ export declare class AppFormUtils {
354
358
  static isControlHasInput: typeof isControlHasInput;
355
359
  static setCalculatedValue: typeof setCalculatedValue;
356
360
  static resetCalculatedValue: typeof resetCalculatedValue;
361
+ static filterErrorsByPrefix: typeof filterErrorsByPrefix;
362
+ static filterErrorsByPath: typeof filterErrorsByPath;
357
363
  }
358
364
  export declare function isControlHasInput(controls: {
359
365
  [key: string]: AbstractControl;
@@ -364,3 +370,6 @@ export declare function setCalculatedValue(controls: {
364
370
  export declare function resetCalculatedValue(controls: {
365
371
  [key: string]: AbstractControl;
366
372
  }, controlName: string): void;
373
+ export declare function filterErrorsByPrefix(errors: FormErrors, ...prefixes: string[]): FormErrors;
374
+ export declare function filterErrorsByPath(errors: FormErrors, filter: Predicate<string>): FormErrors;
375
+ export declare function filterErrors(errors: FormErrors, filter: Predicate<[string, any]>): FormErrors;
@@ -4,11 +4,10 @@ import { Entity, EntityAsObjectOptions } from '../../services/model/entity.model
4
4
  import { AppValidatorService } from '../../services/validator/base.validator.class';
5
5
  import { AbstractControl, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
6
6
  import { FormFieldDefinition, FormFieldDefinitionMap } from '../../../shared/form/field.model';
7
- import { FilterFn } from '../../../shared/services/entity-service.class';
8
7
  import { Environment } from '../../../../environments/environment.class';
9
8
  import { TableElement } from '@e-is/ngx-material-table';
10
9
  import { EntityFilter } from '../../services/model/filter.model';
11
- import { ObjectMap } from '../../../shared/types';
10
+ import { FilterFn, ObjectMap } from '../../../shared/types';
12
11
  import { MatExpansionPanel } from '@angular/material/expansion';
13
12
  import * as i0 from "@angular/core";
14
13
  interface TranslatedFormFieldDefinition extends FormFieldDefinition {
@@ -1,3 +1,13 @@
1
+ import { FormErrors } from '../../shared/forms';
2
+ export interface AppError {
3
+ code?: number;
4
+ message?: string;
5
+ }
6
+ export interface AppErrorWithDetails extends AppError {
7
+ details: AppError & {
8
+ errors?: FormErrors;
9
+ };
10
+ }
1
11
  export declare interface ServiceError {
2
12
  code: number;
3
13
  message: string;
@@ -1,7 +1,6 @@
1
1
  import { Moment } from 'moment';
2
2
  import { getPropertyByPath } from '../../../shared/functions';
3
- import { FilterFn } from '../../../shared/services/entity-service.class';
4
- import { ObjectMap, ObjectMapEntry, PropertiesArray, PropertiesMap } from '../../../shared/types';
3
+ import { FilterFn, ObjectMap, ObjectMapEntry, PropertiesArray, PropertiesMap } from '../../../shared/types';
5
4
  import { StoreObject } from '@apollo/client/core';
6
5
  import { TreeItemEntityUtils } from './tree-item-entity.model';
7
6
  import { SortDirection } from '@angular/material/sort';
@@ -1,5 +1,5 @@
1
1
  import { Entity, EntityAsObjectOptions, IEntity } from './entity.model';
2
- import { FilterFn } from '../../../shared/services/entity-service.class';
2
+ import { FilterFn } from '../../../shared/types';
3
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>;
@@ -1,6 +1,6 @@
1
1
  import { IEntity } from './entity.model';
2
- import { FilterFn } from '../../../shared/services/entity-service.class';
3
2
  import { EntityFilter } from './filter.model';
3
+ import { FilterFn } from '../../../shared/types';
4
4
  export declare interface ITreeItemEntity<T extends IEntity<T, ID>, ID = number> {
5
5
  parentId: ID;
6
6
  parent: T;
@@ -1,6 +1,6 @@
1
1
  import { EntityFilter } from '../model/filter.model';
2
2
  import { Referential } from '../model/referential.model';
3
- import { FilterFn } from '../../../shared/services/entity-service.class';
3
+ import { FilterFn } from '../../../shared/types';
4
4
  export declare class ReferentialFilter extends EntityFilter<ReferentialFilter, Referential> {
5
5
  static fromObject: (source: any, opts?: any) => ReferentialFilter;
6
6
  searchText: string;
@@ -22,8 +22,6 @@ export declare type SuggestFn<T, F> = (value: any, filter?: F, sortBy?: string |
22
22
  export declare interface SuggestService<T, F> {
23
23
  suggest: SuggestFn<T, F>;
24
24
  }
25
- export declare type FilterFn<T> = (data: T) => boolean;
26
- export declare type FilterFnFactory<T, F> = (filter: F) => FilterFn<T>;
27
25
  export declare interface EntityServiceLoadOptions {
28
26
  fetchPolicy?: FetchPolicy;
29
27
  trash?: boolean;
@@ -1,10 +1,11 @@
1
1
  import { BehaviorSubject, Observable } from 'rxjs';
2
- import { EntitiesServiceLoadOptions, EntitiesServiceWatchOptions, FilterFn, FilterFnFactory, IEntitiesService, LoadResult } from './entity-service.class';
2
+ import { EntitiesServiceLoadOptions, EntitiesServiceWatchOptions, IEntitiesService, LoadResult } from './entity-service.class';
3
3
  import { SortDirection } from '@angular/material/sort';
4
4
  import { OnDestroy } from '@angular/core';
5
5
  import { IEntity } from '../../core/services/model/entity.model';
6
6
  import { WaitForOptions } from '../observables';
7
7
  import { StartableObservableService } from './startable-observable-service.class';
8
+ import { FilterFn, FilterFnFactory } from '../types';
8
9
  import * as i0 from "@angular/core";
9
10
  export interface InMemoryEntitiesServiceOptions<T, F> {
10
11
  onSort?: (data: T[], sortBy?: string, sortDirection?: SortDirection) => T[];
@@ -1,5 +1,6 @@
1
1
  import { ThemePalette } from '@angular/material/core';
2
2
  import { PredefinedColors } from '@ionic/core';
3
+ import { Predicate } from '@angular/core';
3
4
  export declare type KeyType = string | number;
4
5
  export declare type KeyValueType<T> = {
5
6
  [key in KeyType]: T;
@@ -24,3 +25,5 @@ export declare interface IconRef {
24
25
  matSvgIcon?: string;
25
26
  color?: AppColors;
26
27
  }
28
+ export declare type FilterFn<T> = Predicate<T>;
29
+ export declare type FilterFnFactory<T, F> = (filter: F) => FilterFn<T>;
@@ -1,9 +1,9 @@
1
1
  import { Entity, EntityAsObjectOptions } from '../../core/services/model/entity.model';
2
2
  import { StoreObject } from '@apollo/client/core';
3
3
  import { EntityFilter } from '../../core/services/model/filter.model';
4
- import { FilterFn } from '../../shared/services/entity-service.class';
5
4
  import { Person } from '../../core/services/model/person.model';
6
5
  import { PersonFilter } from '../../admin/services/filter/person.filter';
6
+ import { FilterFn } from '../../shared/types';
7
7
  export declare const MessageTypes: {
8
8
  INBOX_MESSAGE: string;
9
9
  EMAIL: string;
@@ -1,9 +1,8 @@
1
1
  import { Entity, EntityAsObjectOptions } from '../../../core/services/model/entity.model';
2
2
  import { Moment } from 'moment';
3
- import { IconRef } from '../../../shared/types';
4
- import { EventLevel, IUserEvent, IUserEventFilter, IUserEventAction } from '../user-event.model';
3
+ import { FilterFn, IconRef } from '../../../shared/types';
4
+ import { EventLevel, IUserEvent, IUserEventAction, IUserEventFilter } from '../user-event.model';
5
5
  import { EntityFilter } from '../../../core/services/model/filter.model';
6
- import { FilterFn } from '../../../shared/services/entity-service.class';
7
6
  import { StoreObject } from '@apollo/client/core';
8
7
  export declare class UserEventTest extends Entity<UserEventTest> implements IUserEvent<UserEventTest> {
9
8
  static fromObject: (source: any, opts?: any) => UserEventTest;
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-sumaris-components",
3
3
  "short_name": "ngx-sumaris-components",
4
4
  "manifest_version": 1,
5
- "version": "2.9.7",
5
+ "version": "2.9.8",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{