@sumaris-net/ngx-components 1.21.0-beta7 → 1.21.0

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 (86) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +475 -1171
  2. package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
  3. package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
  4. package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
  5. package/doc/changelog.md +9 -0
  6. package/esm2015/public_api.js +3 -8
  7. package/esm2015/src/app/core/account/account.js +2 -2
  8. package/esm2015/src/app/core/auth/form/form-auth.js +4 -2
  9. package/esm2015/src/app/core/form/editor.class.js +7 -1
  10. package/esm2015/src/app/core/form/entity-editor-modal.class.js +17 -6
  11. package/esm2015/src/app/core/form/entity-editor.class.js +1 -1
  12. package/esm2015/src/app/core/form/form.class.js +62 -33
  13. package/esm2015/src/app/core/graphql/graphql.service.js +5 -3
  14. package/esm2015/src/app/core/icon/icon.component.js +2 -5
  15. package/esm2015/src/app/core/menu/menu.component.js +2 -2
  16. package/esm2015/src/app/core/services/local-settings.service.js +2 -2
  17. package/esm2015/src/app/core/table/table.class.js +18 -23
  18. package/esm2015/src/app/shared/functions.js +1 -60
  19. package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +5 -4
  20. package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +10 -7
  21. package/esm2015/src/app/shared/material/chips/material.chips.js +3 -2
  22. package/esm2015/src/app/shared/material/chips/testing/chips.test.js +3 -2
  23. package/esm2015/src/app/shared/material/datetime/material.date.js +3 -2
  24. package/esm2015/src/app/shared/material/datetime/material.datetime.js +3 -2
  25. package/esm2015/src/app/shared/observables.js +13 -7
  26. package/esm2015/src/app/shared/pipes/arrays.pipe.js +1 -1
  27. package/esm2015/src/app/shared/pipes/form.pipes.js +4 -6
  28. package/esm2015/src/app/shared/pipes/highlight.pipe.js +4 -4
  29. package/esm2015/src/app/shared/pipes/string.pipes.js +7 -18
  30. package/esm2015/src/app/shared/services/memory-entity-service.class.js +13 -1
  31. package/esm2015/src/app/shared/services.js +61 -0
  32. package/esm2015/src/app/shared/types.js +1 -1
  33. package/esm2015/src/app/social/social.errors.js +2 -5
  34. package/esm2015/src/app/social/social.module.js +15 -10
  35. package/esm2015/src/app/social/user-event/user-event.model.js +2 -58
  36. package/esm2015/src/app/social/user-event/user-event.service.js +167 -293
  37. package/esm2015/src/app/social/user-event/user-events.table.js +12 -17
  38. package/esm2015/sumaris-net.ngx-components.js +6 -8
  39. package/fesm2015/sumaris-net.ngx-components.js +387 -970
  40. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  41. package/package.json +3 -2
  42. package/public_api.d.ts +2 -7
  43. package/src/app/core/auth/form/form-auth.d.ts +1 -1
  44. package/src/app/core/form/editor.class.d.ts +14 -1
  45. package/src/app/core/form/entity-editor-modal.class.d.ts +1 -0
  46. package/src/app/core/form/entity-editor.class.d.ts +6 -2
  47. package/src/app/core/form/form.class.d.ts +32 -19
  48. package/src/app/core/icon/icon.component.d.ts +4 -4
  49. package/src/app/core/table/table.class.d.ts +15 -14
  50. package/src/app/shared/functions.d.ts +0 -9
  51. package/src/app/shared/material/autocomplete/testing/autocomplete.test.d.ts +1 -2
  52. package/src/app/shared/material/badge/badge-icon.test.d.ts +1 -1
  53. package/src/app/shared/observables.d.ts +1 -0
  54. package/src/app/shared/pipes/form.pipes.d.ts +1 -2
  55. package/src/app/shared/services/memory-entity-service.class.d.ts +6 -0
  56. package/src/app/shared/services.d.ts +9 -0
  57. package/src/app/shared/types.d.ts +0 -4
  58. package/src/app/social/social.errors.d.ts +0 -3
  59. package/src/app/social/social.module.d.ts +0 -8
  60. package/src/app/social/user-event/user-event.model.d.ts +6 -51
  61. package/src/app/social/user-event/user-event.service.d.ts +51 -79
  62. package/src/app/social/user-event/user-events.table.d.ts +6 -6
  63. package/src/assets/i18n/en-US.json +2 -15
  64. package/src/assets/i18n/en.json +2 -15
  65. package/src/assets/i18n/fr.json +1 -14
  66. package/src/theme/_ngx-components.scss +0 -7
  67. package/sumaris-net.ngx-components.d.ts +5 -7
  68. package/sumaris-net.ngx-components.metadata.json +1 -1
  69. package/esm2015/src/app/social/job/job.model.js +0 -24
  70. package/esm2015/src/app/social/job/job.module.js +0 -25
  71. package/esm2015/src/app/social/job/job.service.js +0 -53
  72. package/esm2015/src/app/social/job/progression/job-progression.component.js +0 -192
  73. package/esm2015/src/app/social/job/progression/job-progression.list.js +0 -20
  74. package/esm2015/src/app/social/message/message.module.js +0 -25
  75. package/esm2015/src/app/social/user-event/notification/user-event-notification.component.js +0 -92
  76. package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +0 -39
  77. package/esm2015/src/app/social/user-event/user-event.module.js +0 -28
  78. package/src/app/social/job/job.model.d.ts +0 -32
  79. package/src/app/social/job/job.module.d.ts +0 -2
  80. package/src/app/social/job/job.service.d.ts +0 -23
  81. package/src/app/social/job/progression/job-progression.component.d.ts +0 -43
  82. package/src/app/social/job/progression/job-progression.list.d.ts +0 -12
  83. package/src/app/social/message/message.module.d.ts +0 -2
  84. package/src/app/social/user-event/notification/user-event-notification.component.d.ts +0 -25
  85. package/src/app/social/user-event/notification/user-event-notification.list.d.ts +0 -20
  86. package/src/app/social/user-event/user-event.module.d.ts +0 -2
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.21.0-beta7",
4
+ "version": "1.21.0",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -15,7 +15,8 @@
15
15
  "tslib": "^2.2.0"
16
16
  },
17
17
  "peerDependencies": {
18
- "@apollo/client": "~3.5.10"
18
+ "@apollo/client": "~3.5.10",
19
+ "localforage": "1.7.4"
19
20
  },
20
21
  "repository": {
21
22
  "type": "git",
package/public_api.d.ts CHANGED
@@ -82,6 +82,7 @@ export * from './src/app/shared/validator/form-error-adapter.class';
82
82
  export * from './src/app/shared/types';
83
83
  export * from './src/app/shared/dates';
84
84
  export * from './src/app/shared/functions';
85
+ export * from './src/app/shared/services';
85
86
  export * from './src/app/shared/forms';
86
87
  export * from './src/app/shared/observables';
87
88
  export * from './src/app/shared/events';
@@ -164,17 +165,10 @@ export * from './src/app/core/menu/menu.service';
164
165
  export { EntityClass, EntityClasses } from './src/app/core/services/model/entity.decorators';
165
166
  export * from './src/app/social/social.module';
166
167
  export * from './src/app/social/social.errors';
167
- export * from './src/app/social/user-event/user-event.module';
168
168
  export * from './src/app/social/user-event/user-event.model';
169
169
  export * from './src/app/social/user-event/user-event.fragments';
170
170
  export * from './src/app/social/user-event/user-event.service';
171
171
  export * from './src/app/social/user-event/user-events.table';
172
- export * from './src/app/social/user-event/notification/user-event-notification.component';
173
- export * from './src/app/social/job/job.module';
174
- export * from './src/app/social/job/job.model';
175
- export * from './src/app/social/job/job.service';
176
- export * from './src/app/social/job/progression/job-progression.component';
177
- export * from './src/app/social/message/message.module';
178
172
  export * from './src/app/social/message/message.model';
179
173
  export * from './src/app/social/message/message.service';
180
174
  export * from './src/app/social/message/message.form';
@@ -203,3 +197,4 @@ export * from './src/app/core/table/testing/table.testing.module';
203
197
  export * from './src/app/core/table/testing/table.testing';
204
198
  export * from './src/app/core/text-popover/testing/text-popover.testing.module';
205
199
  export * from './src/app/core/text-popover/testing/text-popover.testing';
200
+ export { suggestFromArray } from "./src/app/shared/services";
@@ -26,7 +26,7 @@ export declare class AuthForm extends AppForm<AuthData> implements OnInit {
26
26
  }): void;
27
27
  constructor(injector: Injector, platform: PlatformService, formBuilder: FormBuilder, settings: LocalSettingsService, configService: ConfigService, modalCtrl: ModalController, network: NetworkService, cd: ChangeDetectorRef, environment: any);
28
28
  ngOnInit(): void;
29
- cancel(): void;
29
+ cancel(): Promise<void>;
30
30
  doSubmit(event?: UIEvent): Promise<void>;
31
31
  register(): void;
32
32
  protected markForCheck(): void;
@@ -18,6 +18,17 @@ export interface IAppEditor extends CanLeave, IAppForm {
18
18
  save(event?: Event, options?: any): Promise<boolean>;
19
19
  cancel(event?: Event): Promise<void>;
20
20
  }
21
+ export interface IAppTabEditor extends IAppEditor {
22
+ selectedTabIndex: number;
23
+ setSelectedTabIndex(value: number, opts?: {
24
+ emitEvent?: boolean;
25
+ realignInkBar?: boolean;
26
+ }): void;
27
+ unload(opts?: {
28
+ emitEvent?: boolean;
29
+ }): Promise<void>;
30
+ realignInkBar(): any;
31
+ }
21
32
  export declare class AppTabEditorOptions {
22
33
  /**
23
34
  * Number of tab. 1 by default
@@ -154,7 +165,7 @@ export declare abstract class AppEditor<T = any, ID = number, O = any> implement
154
165
  protected logChildrenFormErrors(c: IAppForm | AbstractControl, prefix?: string, path?: string): void;
155
166
  protected markForCheck(): void;
156
167
  }
157
- export declare abstract class AppTabEditor<T = any, ID = number, O = any> extends AppEditor<T, ID, O> {
168
+ export declare abstract class AppTabEditor<T = any, ID = number, O = any> extends AppEditor<T, ID, O> implements IAppTabEditor {
158
169
  protected route: ActivatedRoute;
159
170
  protected router: Router;
160
171
  protected alertCtrl: AlertController;
@@ -176,6 +187,8 @@ export declare abstract class AppTabEditor<T = any, ID = number, O = any> extend
176
187
  emitEvent?: boolean;
177
188
  realignInkBar?: boolean;
178
189
  }): void;
190
+ realignInkBar(): void;
191
+ protected abstract getFirstInvalidTabIndex(): number;
179
192
  onTabChange(event: MatTabChangeEvent, queryTabIndexParamName?: string): boolean;
180
193
  /**
181
194
  * Action triggered when user swipes
@@ -100,6 +100,7 @@ export declare abstract class AppEntityEditorModal<T extends Entity<T, ID>, ID =
100
100
  protected abstract setValue(data: T): Promise<void> | void;
101
101
  protected abstract get form(): FormGroup;
102
102
  protected abstract getFirstInvalidTabIndex(): number;
103
+ protected saveDirtyTables(): Promise<boolean>;
103
104
  protected waitWhilePending(opts?: WaitForOptions): Promise<void>;
104
105
  protected getValue(): Promise<T>;
105
106
  protected getJsonValueToSave(): Promise<any>;
@@ -4,7 +4,7 @@ import { AddToPageHistoryOptions, LocalSettingsService } from '../services/local
4
4
  import { Entity } from '../services/model/entity.model';
5
5
  import { UsageMode } from '../services/model/settings.model';
6
6
  import { FormGroup } from '@angular/forms';
7
- import { AppTabEditor, AppTabEditorOptions } from './editor.class';
7
+ import { AppTabEditor, AppTabEditorOptions, IAppTabEditor } from './editor.class';
8
8
  import { EntityServiceLoadOptions, IEntityService } from '../../shared/services/entity-service.class';
9
9
  import { DateFormatPipe } from '../../shared/pipes/date-format.pipe';
10
10
  import { Environment } from '../../../environments/environment.class';
@@ -12,6 +12,10 @@ import { HistoryPageReference } from '../services/model/history.model';
12
12
  import { WaitForOptions } from '../../shared/observables';
13
13
  import { FormErrorTranslator } from '../../shared/validator/form-error-adapter.class';
14
14
  import { FormErrors } from '../../shared/forms';
15
+ export interface IAppEntityEditor extends IAppTabEditor {
16
+ usageMode: UsageMode;
17
+ isNewData: boolean;
18
+ }
15
19
  export declare class AppEditorOptions extends AppTabEditorOptions {
16
20
  autoLoad?: boolean;
17
21
  autoLoadDelay?: number;
@@ -37,7 +41,7 @@ export interface AppErrorWithDetails extends AppError {
37
41
  errors?: FormErrors;
38
42
  };
39
43
  }
40
- export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends IEntityService<T, ID> = IEntityService<T, any>, ID = number> extends AppTabEditor<T, ID, EntityServiceLoadOptions> implements OnInit, OnDestroy, AfterViewInit {
44
+ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends IEntityService<T, ID> = IEntityService<T, any>, ID = number> extends AppTabEditor<T, ID, EntityServiceLoadOptions> implements OnInit, OnDestroy, AfterViewInit, IAppEntityEditor {
41
45
  protected dataType: new () => T;
42
46
  protected dataService?: S;
43
47
  private _usageMode;
@@ -8,18 +8,20 @@ import { WaitForOptions } from '../../shared/observables';
8
8
  import { FormErrorTranslator, FormErrorTranslatorOptions, IFormControlPathTranslator } from '../../shared/validator/form-error-adapter.class';
9
9
  import { TranslateService } from '@ngx-translate/core';
10
10
  export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy, IFormControlPathTranslator {
11
- autocompleteHelper: MatAutocompleteConfigHolder;
12
- autocompleteFields: {
13
- [key: string]: MatAutocompleteFieldConfig;
14
- };
15
- error: string;
16
- protected translate: TranslateService;
17
- protected settings: LocalSettingsService;
18
- protected errorTranslator: FormErrorTranslator;
11
+ private _subscription;
12
+ private _form;
19
13
  protected _enable: boolean;
20
- protected _$ready: BehaviorSubject<boolean>;
21
- protected _$loading: BehaviorSubject<boolean>;
14
+ protected errorTranslator: FormErrorTranslator;
22
15
  protected i18nFieldPrefix: string;
16
+ protected readonly translate: TranslateService;
17
+ protected readonly settings: LocalSettingsService;
18
+ readonly autocompleteHelper: MatAutocompleteConfigHolder;
19
+ readonly autocompleteFields: {
20
+ [key: string]: MatAutocompleteFieldConfig;
21
+ };
22
+ readySubject: BehaviorSubject<boolean>;
23
+ loadingSubject: BehaviorSubject<boolean>;
24
+ errorSubject: BehaviorSubject<string>;
23
25
  /**
24
26
  * @deprecated
25
27
  */
@@ -28,12 +30,18 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
28
30
  * @deprecated
29
31
  */
30
32
  protected get _loading(): boolean;
31
- private _subscription;
32
- private _form;
33
- debug: boolean;
34
- tabindex: number;
35
- errorTranslatorOptions: FormErrorTranslatorOptions;
33
+ /**
34
+ * @deprecated
35
+ */
36
+ protected get _$ready(): BehaviorSubject<boolean>;
37
+ /**
38
+ * @deprecated
39
+ */
40
+ protected get _$loading(): BehaviorSubject<boolean>;
41
+ get error(): string;
42
+ set error(error: string);
36
43
  get loading(): boolean;
44
+ get loaded(): boolean;
37
45
  get value(): any;
38
46
  set value(data: any);
39
47
  get dirty(): boolean;
@@ -52,6 +60,9 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
52
60
  onlySelf?: boolean;
53
61
  emitEvent?: boolean;
54
62
  }): void;
63
+ debug: boolean;
64
+ tabindex: number;
65
+ errorTranslatorOptions: FormErrorTranslatorOptions;
55
66
  set form(value: FormGroup);
56
67
  get form(): FormGroup;
57
68
  onCancel: EventEmitter<any>;
@@ -59,7 +70,7 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
59
70
  protected constructor(injector: Injector, form?: FormGroup);
60
71
  ngOnInit(): void;
61
72
  ngOnDestroy(): void;
62
- cancel(): void;
73
+ cancel(): Promise<void>;
63
74
  /**
64
75
  *
65
76
  * @param event
@@ -101,11 +112,9 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
101
112
  emitEvent?: boolean;
102
113
  }): void;
103
114
  markAsLoading(opts?: {
104
- onlySelf?: boolean;
105
115
  emitEvent?: boolean;
106
116
  }): void;
107
117
  markAsLoaded(opts?: {
108
- onlySelf?: boolean;
109
118
  emitEvent?: boolean;
110
119
  }): void;
111
120
  markAsReady(opts?: {
@@ -118,7 +127,7 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
118
127
  */
119
128
  ready(opts?: WaitForOptions): Promise<void>;
120
129
  /**
121
- * Wait form is idle (not loading)
130
+ * Wait form is not busy (=loaded)
122
131
  * @param opts
123
132
  */
124
133
  waitIdle(opts?: WaitForOptions): Promise<void>;
@@ -132,5 +141,9 @@ export declare abstract class AppForm<T> implements IAppForm, OnInit, OnDestroy,
132
141
  protected registerSubscription(sub: Subscription): Subscription;
133
142
  protected unregisterSubscription(sub: Subscription): void;
134
143
  protected registerAutocompleteField<E = any, EF = any>(fieldName: string, opts?: MatAutocompleteFieldAddOptions<E, EF>): MatAutocompleteFieldConfig<E, EF>;
144
+ protected setError(value: string, opts?: {
145
+ emitEvent?: boolean;
146
+ }): void;
135
147
  protected markForCheck(): void;
148
+ private setLoading;
136
149
  }
@@ -1,10 +1,10 @@
1
- import { AppColors, IconRef } from '../../shared/types';
1
+ import { IconRef } from '../../shared/types';
2
+ import { PredefinedColors } from '@ionic/core';
3
+ import { ThemePalette } from '@angular/material/core';
2
4
  export declare class AppIconComponent {
3
5
  icon: string;
4
6
  matIcon: string;
5
7
  matSvgIcon: string;
6
- color: AppColors;
7
- height: number;
8
- width: number;
8
+ color: PredefinedColors | ThemePalette;
9
9
  set ref(value: IconRef);
10
10
  }
@@ -70,17 +70,16 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
70
70
  totalRowCount: number | null;
71
71
  visibleRowCount: number;
72
72
  errorTranslatorOptions: FormErrorTranslatorOptions;
73
- readySubject: BehaviorSubject<boolean>;
74
- loadingSubject: BehaviorSubject<boolean>;
75
- savingSubject: BehaviorSubject<boolean>;
76
- dirtySubject: BehaviorSubject<boolean>;
77
- errorSubject: BehaviorSubject<string>;
73
+ readonly readySubject: BehaviorSubject<boolean>;
74
+ readonly loadingSubject: BehaviorSubject<boolean>;
75
+ readonly savingSubject: BehaviorSubject<boolean>;
76
+ readonly dirtySubject: BehaviorSubject<boolean>;
77
+ readonly errorSubject: BehaviorSubject<string>;
78
78
  get error(): string;
79
- get error$(): Observable<string>;
80
79
  /**
81
80
  * @deprecated
82
- * @param error
83
81
  */
82
+ get error$(): Observable<string>;
84
83
  set error(error: string);
85
84
  get loading$(): Observable<boolean>;
86
85
  get saving$(): Observable<boolean>;
@@ -244,7 +243,9 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
244
243
  interactive?: boolean;
245
244
  keepEditing?: boolean;
246
245
  }): void;
247
- addRow(event?: Event, insertAt?: number): boolean;
246
+ addRow(event?: Event, insertAt?: number, opts?: {
247
+ focusColumn?: string;
248
+ }): boolean;
248
249
  save(opts?: {
249
250
  keepEditing?: boolean;
250
251
  }): Promise<boolean>;
@@ -264,22 +265,20 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
264
265
  * @param event
265
266
  * @param row
266
267
  * @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
267
- * Use skipIfLoading=false to force deletion even if table is busy
268
+ * And to force deletion even if table is busy
268
269
  */
269
270
  deleteRow(event: UIEvent | null, row: TableElement<T>, opts?: {
270
271
  interactive?: boolean;
271
- skipIfLoading?: boolean;
272
272
  }): Promise<boolean>;
273
273
  /**
274
274
  *
275
275
  * @param event
276
276
  * @param rows
277
277
  * @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
278
- * Use skipIfLoading=false to force deletion even if table is busy
278
+ * And to force deletion even if table is busy
279
279
  */
280
280
  deleteRows(event: UIEvent | null, rows: TableElement<T>[], opts?: {
281
281
  interactive?: boolean;
282
- skipIfLoading?: boolean;
283
282
  }): Promise<number>;
284
283
  selectRowById(id: number): Promise<boolean>;
285
284
  /**
@@ -289,7 +288,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
289
288
  selectRowByData(data: T): Promise<boolean>;
290
289
  clickRow(event: UIEvent | undefined, row: TableElement<T>): boolean;
291
290
  moveRow(id: number, direction: number): void;
292
- ready(): Promise<void>;
291
+ ready(opts?: WaitForOptions): Promise<void>;
293
292
  waitIdle(opts?: WaitForOptions): Promise<void>;
294
293
  openSelectColumnsModal(event?: Event): Promise<any>;
295
294
  trackByFn(index: number, row: TableElement<T>): number;
@@ -343,7 +342,9 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
343
342
  protected registerAutocompleteField<E = any, EF = any>(fieldName: string, options?: MatAutocompleteFieldAddOptions<E, EF>): MatAutocompleteFieldConfig<E, EF>;
344
343
  protected getI18nColumnName(columnName: string): string;
345
344
  protected generateTableId(): string;
346
- protected addRowToTable(insertAt?: number): Promise<TableElement<T>>;
345
+ protected addRowToTable(insertAt?: number, opts?: {
346
+ focusColumn?: string;
347
+ }): Promise<TableElement<T>>;
347
348
  protected registerCellValueChanges(name: string, formPath?: string, emitInitialValue?: boolean): Observable<any>;
348
349
  protected setShowColumn(columnName: string, show: boolean, opts?: {
349
350
  emitEvent?: boolean;
@@ -1,4 +1,3 @@
1
- import { LoadResult } from './services/entity-service.class';
2
1
  import { KeysEnum, KeyValueType } from './types';
3
2
  export declare function isNil<T>(obj: T | null | undefined): boolean;
4
3
  export declare function isNilOrBlank<T>(obj: T | null | undefined): boolean;
@@ -46,14 +45,6 @@ export declare function removeEnd(value: string, end: string): string;
46
45
  */
47
46
  export declare function changeCaseToUnderscore(value: string): string;
48
47
  export declare function removeDiacritics(text: string): string;
49
- export declare function suggestFromArray<T = any>(items: T[], value: any, opts?: {
50
- offset?: number;
51
- size?: number;
52
- searchAttribute?: string;
53
- searchAttributes?: string[];
54
- excludedIds?: number[];
55
- skipSort?: boolean;
56
- }): LoadResult<T>;
57
48
  export declare function suggestFromStringArray(values: string[], value: any, options?: {
58
49
  searchAttribute?: string;
59
50
  searchAttributes?: string[];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { AfterViewInit, OnInit } from '@angular/core';
3
- import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
3
+ import { FormBuilder, FormGroup } from '@angular/forms';
4
4
  import { MatAutocompleteConfigHolder, MatAutocompleteField } from '../material.autocomplete';
5
5
  import { LoadResult } from '../../../services/entity-service.class';
6
6
  import Timer = NodeJS.Timer;
@@ -20,7 +20,6 @@ export declare class AutocompleteTestPage implements OnInit, AfterViewInit {
20
20
  memoryAutocompleteFieldName: string;
21
21
  memoryTimer: Timer;
22
22
  mode: 'mobile' | 'desktop' | 'memory' | 'temp';
23
- entitiesArray: FormArray;
24
23
  farEntityField: MatAutocompleteField;
25
24
  constructor(formBuilder: FormBuilder);
26
25
  ngOnInit(): void;
@@ -5,5 +5,5 @@ export declare class MatBadgeIconTestPage {
5
5
  $icon: BehaviorSubject<string>;
6
6
  $size: BehaviorSubject<MatBadgeSize>;
7
7
  $fill: BehaviorSubject<MatBadgeFill>;
8
- $color: BehaviorSubject<"primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | "light" | "medium" | "dark" | "accent" | "warn">;
8
+ $color: BehaviorSubject<"primary" | "accent" | "warn" | "light" | "tertiary" | "secondary" | "success" | "warning" | "danger" | "medium" | "dark">;
9
9
  }
@@ -22,3 +22,4 @@ export declare function firstFalse(obs: Observable<boolean>): Observable<void>;
22
22
  */
23
23
  export declare function waitFor(predicate: Predicate<void>, opts?: WaitForOptions): Promise<void>;
24
24
  export declare function waitForTrue(observable: Observable<boolean>, opts?: WaitForOptions): Promise<void>;
25
+ export declare function waitForFalse(observable: Observable<boolean>, opts?: WaitForOptions): Promise<void>;
@@ -30,14 +30,13 @@ export declare class FormGetGroupPipe implements PipeTransform {
30
30
  transform(form: AbstractControl, path?: Array<string | number> | string): FormGroup;
31
31
  }
32
32
  export declare class FormGetValuePipe implements PipeTransform, OnDestroy {
33
- private adapter;
34
33
  private _ref;
35
34
  value: any;
36
35
  private _lastControl;
37
36
  private _lastPath;
38
37
  private _onControlValueChanges;
39
38
  private _onControlStatusChanges;
40
- constructor(adapter: FormErrorTranslator, _ref: ChangeDetectorRef);
39
+ constructor(_ref: ChangeDetectorRef);
41
40
  transform(form: AbstractControl, path?: Array<string | number> | string, listenStatusChanges?: boolean): any;
42
41
  ngOnDestroy(): void;
43
42
  /**
@@ -43,6 +43,12 @@ export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any,
43
43
  asFilter(source: Partial<F>): F;
44
44
  addSortByReplacement(source: string, target: string): void;
45
45
  equals(d1: T, d2: T): boolean;
46
+ /**
47
+ * Count data stored by the service (without hidden data).
48
+ * @param opts
49
+ */
50
+ get count(): number;
51
+ get hiddenCount(): number;
46
52
  protected filter(data: T[], _filter: F, hiddenData: T[]): T[];
47
53
  protected connect(): Observable<LoadResult<T>>;
48
54
  protected markAsSaving(): void;
@@ -0,0 +1,9 @@
1
+ import { LoadResult } from './services/entity-service.class';
2
+ export declare function suggestFromArray<T = any>(items: T[], value: any, opts?: {
3
+ offset?: number;
4
+ size?: number;
5
+ searchAttribute?: string;
6
+ searchAttributes?: string[];
7
+ excludedIds?: number[];
8
+ skipSort?: boolean;
9
+ }): LoadResult<T>;
@@ -1,5 +1,3 @@
1
- import { ThemePalette } from '@angular/material/core';
2
- import { PredefinedColors } from '@ionic/core';
3
1
  export declare type KeyType = string | number;
4
2
  export declare type KeyValueType<T> = {
5
3
  [key in KeyType]: T;
@@ -17,10 +15,8 @@ export declare interface ObjectMapEntry<O = any> {
17
15
  export declare type PropertiesMap = ObjectMap<string>;
18
16
  export declare type Property = ObjectMapEntry<string>;
19
17
  export declare type PropertiesArray = Property[];
20
- export declare type AppColors = PredefinedColors | ThemePalette | string;
21
18
  export declare interface IconRef {
22
19
  icon?: string;
23
20
  matIcon?: string;
24
21
  matSvgIcon?: string;
25
- color?: AppColors;
26
22
  }
@@ -1,8 +1,5 @@
1
1
  export declare const SocialErrorCodes: {
2
2
  LOAD_USER_EVENTS_ERROR: number;
3
3
  SAVE_USER_EVENT_ERROR: number;
4
- COUNT_USER_EVENT_ERROR: number;
5
4
  SEND_MESSAGE_ERROR: number;
6
- SUBSCRIBE_USER_EVENTS_ERROR: number;
7
- SUBSCRIBE_JOB_PROGRESSION_ERROR: number;
8
5
  };
@@ -1,10 +1,2 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { JobProgressionOptions } from './job/progression/job-progression.component';
3
- export interface SocialModuleOptions {
4
- showUserEventNotification: boolean;
5
- showJobProgression: boolean;
6
- jobProgressionOptions: JobProgressionOptions;
7
- }
8
- export declare const SocialModuleOptionsToken: InjectionToken<SocialModuleOptions>;
9
1
  export declare class SocialModule {
10
2
  }
@@ -1,74 +1,29 @@
1
1
  import { Moment } from 'moment';
2
2
  import { Entity, EntityAsObjectOptions, IEntity } from '../../core/services/model/entity.model';
3
- import { EntityFilter, IEntityFilter } from '../../core/services/model/filter.model';
4
- import { FilterFn } from '../../shared/services/entity-service.class';
5
- import { AppColors, IconRef } from '../../shared/types';
3
+ import { PredefinedColors } from '@ionic/core';
6
4
  export declare const UserEventTypes: {
7
5
  DEBUG_DATA: string;
8
6
  INBOX_MESSAGE: string;
9
7
  };
10
- export declare type EventLevel = 'ERROR' | 'WARNING' | 'INFO' | 'DEBUG';
11
- export interface IUserEvent<E extends Entity<E>, U = string, L = EventLevel> extends IEntity<E> {
12
- issuer: U;
13
- recipient: U;
14
- type: string;
15
- level: L;
16
- updateDate: Moment;
17
- creationDate: Moment;
18
- readDate?: Moment;
19
- message?: string;
20
- content?: string | any;
21
- avatar?: string;
22
- avatarIcon?: IconRef;
23
- icon?: IconRef;
24
- actions?: UserEventAction[];
25
- }
26
- export declare class UserEvent extends Entity<UserEvent> implements IUserEvent<UserEvent> {
8
+ export declare class UserEvent extends Entity<UserEvent> {
27
9
  static fromObject: (source: any, opts?: any) => UserEvent;
28
- type: string;
29
- level: EventLevel;
10
+ eventType: string;
30
11
  issuer: string;
31
12
  recipient: string;
32
13
  updateDate: Moment;
33
14
  creationDate: Moment;
34
- readDate: Moment;
35
- message: string | undefined;
36
15
  content: string | any;
37
- hash: string;
38
16
  signature: string;
39
17
  readSignature: string;
40
- avatar?: string;
41
- avatarIcon?: IconRef;
42
- icon?: IconRef;
43
- actions?: UserEventAction[];
44
18
  constructor();
45
19
  asObject(opts?: EntityAsObjectOptions): any;
46
20
  fromObject(source: any): void;
47
21
  }
48
- export interface IUserEventFilter<E extends IUserEvent<E, U, L>, U = string, L = EventLevel> extends IEntityFilter<any, E> {
49
- types: string[];
50
- levels: L[];
51
- issuers: U[];
52
- recipients: U[];
53
- startDate: Moment;
54
- excludeRead: boolean;
55
- }
56
- export declare class UserEventFilter extends EntityFilter<UserEventFilter, UserEvent> implements IUserEventFilter<UserEvent> {
57
- static fromObject: (source: any, opts?: any) => UserEventFilter;
58
- types: string[];
59
- levels: EventLevel[];
60
- issuers: string[];
61
- recipients: string[];
62
- startDate: Moment;
63
- excludeRead: boolean;
64
- fromObject(source: any, opts?: any): void;
65
- protected buildFilter(): FilterFn<UserEvent>[];
66
- }
67
- export interface UserEventAction {
22
+ export interface UserEventAction<T extends IEntity<T>> {
68
23
  name: string | any;
69
24
  title?: string;
70
25
  icon?: string;
71
26
  matIcon?: string;
72
- color?: AppColors;
73
- executeAction: (event: IUserEvent<any>) => any | Promise<any>;
27
+ color?: PredefinedColors;
28
+ executeAction: (event: UserEvent, context?: T) => any | Promise<any>;
74
29
  }