@sumaris-net/ngx-components 1.10.9 → 1.11.0-rc3

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 (72) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +5489 -4218
  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 +10 -0
  6. package/esm2015/public_api.js +36 -10
  7. package/esm2015/src/app/core/core.module.js +13 -5
  8. package/esm2015/src/app/core/core.testing.module.js +51 -0
  9. package/esm2015/src/app/core/form/entity-editor.class.js +1 -1
  10. package/esm2015/src/app/core/form/form.utils.js +58 -393
  11. package/esm2015/src/app/core/services/validator/base.validator.class.js +1 -1
  12. package/esm2015/src/app/core/table/table.class.js +2 -1
  13. package/esm2015/src/app/core/table/testing/table.testing.js +246 -0
  14. package/esm2015/src/app/core/table/testing/table.testing.module.js +26 -0
  15. package/esm2015/src/app/core/text-popover/testing/text-popover.testing.js +37 -0
  16. package/esm2015/src/app/core/text-popover/testing/text-popover.testing.module.js +33 -0
  17. package/esm2015/src/app/core/text-popover/text-form.component.js +72 -0
  18. package/esm2015/src/app/core/text-popover/text-popover.component.js +90 -0
  19. package/esm2015/src/app/shared/directives/directives.module.js +6 -3
  20. package/esm2015/src/app/shared/directives/drag-and-drop.directive.js +43 -0
  21. package/esm2015/src/app/shared/forms.js +339 -0
  22. package/esm2015/src/app/shared/material/chips/chips.module.js +3 -3
  23. package/esm2015/src/app/shared/material/material.module.js +3 -3
  24. package/esm2015/src/app/shared/material/material.testing.module.js +102 -0
  25. package/esm2015/src/app/shared/material/numpad/testing/numpad.test.js +44 -0
  26. package/esm2015/src/app/shared/shared.module.js +13 -3
  27. package/esm2015/src/app/shared/shared.testing.module.js +13 -5
  28. package/esm2015/src/app/shared/testing/tests.page.js +34 -0
  29. package/esm2015/src/app/shared/toast/toast.testing.js +1 -1
  30. package/esm2015/src/app/shared/upload-file/testing/upload-file.testing.js +69 -0
  31. package/esm2015/src/app/shared/upload-file/testing/upload-file.testing.module.js +33 -0
  32. package/esm2015/src/app/shared/upload-file/upload-file-popover.component.js +100 -0
  33. package/esm2015/src/app/shared/upload-file/upload-file.component.js +189 -0
  34. package/esm2015/src/app/shared/upload-file/upload-file.model.js +3 -0
  35. package/esm2015/src/app/shared/validator/form-error-adapter.class.js +1 -1
  36. package/esm2015/sumaris-net.ngx-components.js +12 -13
  37. package/fesm2015/sumaris-net.ngx-components.js +3755 -2696
  38. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  39. package/package.json +3 -3
  40. package/public_api.d.ts +26 -8
  41. package/src/app/core/core.testing.module.d.ts +4 -0
  42. package/src/app/core/form/entity-editor.class.d.ts +1 -1
  43. package/src/app/core/form/form.utils.d.ts +39 -114
  44. package/src/app/core/services/validator/base.validator.class.d.ts +1 -1
  45. package/src/app/core/table/testing/table.testing.d.ts +51 -0
  46. package/src/app/core/table/testing/table.testing.module.d.ts +2 -0
  47. package/src/app/core/text-popover/testing/text-popover.testing.d.ts +7 -0
  48. package/src/app/core/text-popover/testing/text-popover.testing.module.d.ts +2 -0
  49. package/src/app/core/text-popover/text-form.component.d.ts +28 -0
  50. package/src/app/core/text-popover/text-popover.component.d.ts +37 -0
  51. package/src/app/shared/directives/drag-and-drop.directive.d.ts +14 -0
  52. package/src/app/shared/forms.d.ts +78 -0
  53. package/src/app/shared/material/chips/chips.module.d.ts +1 -1
  54. package/src/app/shared/material/material.testing.module.d.ts +4 -0
  55. package/src/app/shared/material/numpad/testing/numpad.test.d.ts +10 -0
  56. package/src/app/shared/shared.testing.module.d.ts +1 -1
  57. package/src/app/shared/{material/testing/material.testing.page.d.ts → testing/tests.page.d.ts} +3 -2
  58. package/src/app/shared/upload-file/testing/upload-file.testing.d.ts +15 -0
  59. package/src/app/shared/upload-file/testing/upload-file.testing.module.d.ts +2 -0
  60. package/src/app/shared/upload-file/upload-file-popover.component.d.ts +36 -0
  61. package/src/app/shared/upload-file/upload-file.component.d.ts +45 -0
  62. package/src/app/shared/upload-file/upload-file.model.d.ts +10 -0
  63. package/src/app/shared/validator/form-error-adapter.class.d.ts +1 -1
  64. package/src/assets/i18n/en-US.json +11 -1
  65. package/src/assets/i18n/en.json +11 -1
  66. package/src/assets/i18n/fr.json +11 -1
  67. package/src/theme/_ngx-components.scss +8 -0
  68. package/sumaris-net.ngx-components.d.ts +11 -12
  69. package/sumaris-net.ngx-components.metadata.json +1 -1
  70. package/esm2015/src/app/shared/material/testing/material.testing.module.js +0 -92
  71. package/esm2015/src/app/shared/material/testing/material.testing.page.js +0 -34
  72. package/src/app/shared/material/testing/material.testing.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.10.9",
4
+ "version": "1.11.0-rc3",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -14,7 +14,7 @@
14
14
  "tslib": "^2.2.0"
15
15
  },
16
16
  "peerDependencies": {
17
- "@apollo/client": "^3.4.17"
17
+ "@apollo/client": "~3.5.10"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "url": "https://gitlab.ifremer.fr/sih-public/sumaris/ngx-sumaris-components/-/issues"
26
26
  },
27
27
  "engines": {
28
- "node": ">= 12.20.1",
28
+ "node": ">= 12.22.1",
29
29
  "npm": ">= 6.14.4"
30
30
  },
31
31
  "cordova": {
package/public_api.d.ts CHANGED
@@ -28,6 +28,8 @@ export * from './src/app/shared/material/numpad/numpad.content';
28
28
  export * from './src/app/shared/material/numpad/numpad.component';
29
29
  export * from './src/app/shared/material/swipe/swipe.module';
30
30
  export * from './src/app/shared/material/swipe/material.swipe';
31
+ export * from './src/app/shared/material/badge/badge-icon.module';
32
+ export * from './src/app/shared/material/badge/badge-icon.directive';
31
33
  export * from './src/app/shared/inputs';
32
34
  export { AppFormField } from './src/app/shared/form/field.component';
33
35
  export * from './src/app/shared/form/loading-spinner';
@@ -38,9 +40,15 @@ export * from './src/app/shared/interceptors/progess.interceptor';
38
40
  export * from './src/app/shared/toast/toasts';
39
41
  export * from './src/app/shared/help/help.modal';
40
42
  export * from './src/app/shared/guard/component-dirty.guard';
43
+ export * from './src/app/shared/upload-file/upload-file.model';
44
+ export * from './src/app/shared/upload-file/upload-file-popover.component';
45
+ export * from './src/app/shared/upload-file/upload-file.component';
46
+ export * from './src/app/core/text-popover/text-form.component';
47
+ export * from './src/app/core/text-popover/text-popover.component';
41
48
  export * from './src/app/shared/directives/directives.module';
42
49
  export * from './src/app/shared/directives/autofocus.directive';
43
50
  export * from './src/app/shared/directives/ng-var.directive';
51
+ export * from './src/app/shared/directives/drag-and-drop.directive';
44
52
  export * from './src/app/shared/pipes/pipes.module';
45
53
  export * from './src/app/shared/pipes/date-format.pipe';
46
54
  export * from './src/app/shared/pipes/date-from-now.pipe';
@@ -70,6 +78,7 @@ export * from './src/app/shared/validator/form-error-adapter.class';
70
78
  export * from './src/app/shared/types';
71
79
  export * from './src/app/shared/dates';
72
80
  export * from './src/app/shared/functions';
81
+ export * from './src/app/shared/forms';
73
82
  export * from './src/app/shared/observables';
74
83
  export * from './src/app/shared/events';
75
84
  export * from './src/app/shared/alerts';
@@ -84,14 +93,6 @@ export * from './src/app/shared/gesture/hammer.utils';
84
93
  export * from './src/app/shared/validator/validators';
85
94
  export * from './src/app/shared/validator/form-error-adapter.class';
86
95
  export * from './src/app/shared/material/latlong/latlong.utils';
87
- export * from './src/app/shared/shared.testing.module';
88
- export * from './src/app/shared/material/testing/material.testing.module';
89
- export * from './src/app/shared/material/testing/material.testing.page';
90
- export * from './src/app/shared/material/autocomplete/testing/autocomplete.test';
91
- export * from './src/app/shared/material/latlong/testing/latlong.test';
92
- export * from './src/app/shared/material/swipe/testing/swipe.test';
93
- export * from './src/app/shared/material/datetime/testing/mat-date-time.test';
94
- export * from './src/app/shared/material/chips/testing/chips.test';
95
96
  export * from './src/app/core/core.module';
96
97
  export * from './src/app/core/services/model/account.model';
97
98
  export * from './src/app/core/services/model/config.model';
@@ -164,3 +165,20 @@ export * from './src/app/admin/services/validator/person.validator';
164
165
  export * from './src/app/admin/services/errors';
165
166
  export * from './src/app/admin/services/person.service';
166
167
  export * from './src/app/admin/users/list/users';
168
+ export * from './src/app/shared/testing/tests.page';
169
+ export * from './src/app/shared/material/material.testing.module';
170
+ export * from './src/app/shared/material/autocomplete/testing/autocomplete.test';
171
+ export * from './src/app/shared/material/latlong/testing/latlong.test';
172
+ export * from './src/app/shared/material/swipe/testing/swipe.test';
173
+ export * from './src/app/shared/material/datetime/testing/mat-date-time.test';
174
+ export * from './src/app/shared/material/chips/testing/chips.test';
175
+ export * from './src/app/shared/shared.testing.module';
176
+ export * from './src/app/shared/upload-file/testing/upload-file.testing';
177
+ export * from './src/app/shared/upload-file/testing/upload-file.testing.module';
178
+ export * from './src/app/core/core.testing.module';
179
+ export * from './src/app/core/services/testing/referential-filter.model';
180
+ export * from './src/app/core/services/testing/referential.validator';
181
+ export * from './src/app/core/table/testing/table.testing.module';
182
+ export * from './src/app/core/table/testing/table.testing';
183
+ export * from './src/app/core/text-popover/testing/text-popover.testing.module';
184
+ export * from './src/app/core/text-popover/testing/text-popover.testing';
@@ -0,0 +1,4 @@
1
+ import { TestingPage } from '../shared/testing/tests.page';
2
+ export declare const CORE_TESTING_PAGES: TestingPage[];
3
+ export declare class CoreTestingModule {
4
+ }
@@ -5,13 +5,13 @@ import { Entity } from '../services/model/entity.model';
5
5
  import { UsageMode } from '../services/model/settings.model';
6
6
  import { FormGroup } from '@angular/forms';
7
7
  import { AppTabEditor, AppTabEditorOptions } from './editor.class';
8
- import { FormErrors } from './form.utils';
9
8
  import { EntityServiceLoadOptions, IEntityService } from '../../shared/services/entity-service.class';
10
9
  import { DateFormatPipe } from '../../shared/pipes/date-format.pipe';
11
10
  import { Environment } from '../../../environments/environment.class';
12
11
  import { HistoryPageReference } from '../services/model/history.model';
13
12
  import { WaitForOptions } from '../../shared/observables';
14
13
  import { FormErrorTranslator } from '../../shared/validator/form-error-adapter.class';
14
+ import { FormErrors } from '../../shared/forms';
15
15
  export declare class AppEditorOptions extends AppTabEditorOptions {
16
16
  autoLoad?: boolean;
17
17
  autoLoadDelay?: number;
@@ -1,7 +1,8 @@
1
- import { AbstractControl, FormArray, FormBuilder, FormGroup, ValidationErrors, ValidatorFn } from '@angular/forms';
1
+ import { AbstractControl, FormArray, FormBuilder, FormGroup, ValidatorFn } from '@angular/forms';
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
6
  export declare type IAppFormGetter = () => IAppForm;
6
7
  export declare interface OnReady {
7
8
  ngOnReady(): any;
@@ -170,6 +171,43 @@ export declare class AppFormProvider<F extends IAppForm = IAppForm> implements I
170
171
  emitEvent?: boolean;
171
172
  }): any;
172
173
  }
174
+ export interface FormArrayHelperOptions {
175
+ allowEmptyArray: boolean;
176
+ validators?: ValidatorFn[];
177
+ }
178
+ export declare class FormArrayHelper<T = Entity<any>, C extends AbstractControl = AbstractControl> {
179
+ private readonly _formArray;
180
+ private createControl;
181
+ private equals;
182
+ private isEmpty;
183
+ static getOrCreateArray(formBuilder: FormBuilder, form: FormGroup, arrayName: string): FormArray;
184
+ private _allowEmptyArray;
185
+ private readonly _validators;
186
+ get allowEmptyArray(): boolean;
187
+ set allowEmptyArray(value: boolean);
188
+ get formArray(): FormArray;
189
+ constructor(_formArray: FormArray, createControl: (value?: T) => C, equals: (v1: T, v2: T) => boolean, isEmpty: (value: T) => boolean, options?: FormArrayHelperOptions);
190
+ add(value?: T, options?: {
191
+ emitEvent: boolean;
192
+ }): boolean;
193
+ removeAt(index: number): boolean;
194
+ resize(length: number): boolean;
195
+ clearAt(index: number): boolean;
196
+ isLast(index: number): boolean;
197
+ removeAllEmpty(): void;
198
+ size(): number;
199
+ at(index: number): C;
200
+ disable(opts?: {
201
+ onlySelf?: boolean;
202
+ emitEvent?: boolean;
203
+ }): void;
204
+ enable(opts?: {
205
+ onlySelf?: boolean;
206
+ emitEvent?: boolean;
207
+ }): void;
208
+ forEach(ite: (control: C) => void): void;
209
+ protected setAllowEmptyArray(value: boolean): void;
210
+ }
173
211
  export declare class AppFormUtils {
174
212
  static copyEntity2Form: typeof copyEntity2Form;
175
213
  static getFormValueFromEntity: typeof getFormValueFromEntity;
@@ -203,82 +241,6 @@ export declare class AppFormUtils {
203
241
  static setCalculatedValue: typeof setCalculatedValue;
204
242
  static resetCalculatedValue: typeof resetCalculatedValue;
205
243
  }
206
- /**
207
- * Fill a form using a source entity
208
- *
209
- * @param target
210
- * @param entity
211
- * @param opts
212
- */
213
- export declare function copyEntity2Form(entity: any, target: FormGroup, opts?: {
214
- emitEvent?: boolean;
215
- onlySelf?: boolean;
216
- }): void;
217
- export declare function getFormValueFromEntity(entity: any | undefined, form: FormGroup): {
218
- [key: string]: any;
219
- };
220
- /**
221
- * Transform an entity into a simple object, compatible with the given form
222
- *
223
- * @param source an entity (or subentity)
224
- * @param control
225
- * @param path
226
- */
227
- export declare function adaptValueToControl(source: any | undefined, control: AbstractControl, path?: string): any;
228
- export declare function logFormErrors(control: AbstractControl, logPrefix?: string, path?: string): void;
229
- export interface FormErrors {
230
- [key: string]: ValidationErrors;
231
- }
232
- export declare function getFormErrors(control: AbstractControl, opts?: {
233
- controlName?: string;
234
- result?: FormErrors;
235
- recursive?: boolean;
236
- }): FormErrors;
237
- export declare function getControlFromPath(form: FormGroup, path: string): AbstractControl;
238
- export declare function disableControls(form: FormGroup, paths: string[], opts?: {
239
- onlySelf?: boolean;
240
- emitEvent?: boolean;
241
- }): void;
242
- export declare function addValueInArray(arrayControl: FormArray, createControl: (value?: any) => AbstractControl, equals: (v1: any, v2: any) => boolean, isEmpty: (value: any) => boolean, value: any, options?: {
243
- emitEvent: boolean;
244
- }): boolean;
245
- export declare function resizeArray(arrayControl: FormArray, createControl: () => AbstractControl, length: number): boolean;
246
- export declare function removeValueInArray(arrayControl: FormArray, isEmpty: (value: any) => boolean, index: number): boolean;
247
- export declare function clearValueInArray(arrayControl: FormArray, isEmpty: (value: any) => boolean, index: number): boolean;
248
- export declare function markAllAsTouched(control: AbstractControl, opts?: {
249
- onlySelf?: boolean;
250
- emitEvent?: boolean;
251
- }): void;
252
- export declare function markFormGroupAsTouched(form: FormGroup, opts?: {
253
- onlySelf?: boolean;
254
- emitEvent?: boolean;
255
- }): void;
256
- export declare function markControlAsTouched(control: AbstractControl, opts?: {
257
- onlySelf?: boolean;
258
- emitEvent?: boolean;
259
- }): void;
260
- export declare function updateValueAndValidity(form: FormGroup, opts?: {
261
- onlySelf?: boolean;
262
- emitEvent?: boolean;
263
- }): void;
264
- export declare function markAsUntouched(form: FormGroup, opts?: {
265
- onlySelf?: boolean;
266
- }): void;
267
- /**
268
- * Wait end of async validation (not pending)
269
- * return false
270
- */
271
- export declare function waitWhilePending<T extends IAppForm | {
272
- pending: boolean;
273
- }>(form: T, opts?: WaitForOptions): Promise<void>;
274
- /**
275
- * Wait form is idle (not loading). This need to implement IAppForm.loading
276
- * @param form
277
- * @param opts
278
- */
279
- export declare function waitIdle<T extends IAppForm | {
280
- loading: boolean;
281
- }>(form: T, opts?: WaitForOptions): Promise<void>;
282
244
  export declare function isControlHasInput(controls: {
283
245
  [key: string]: AbstractControl;
284
246
  }, controlName: string): boolean;
@@ -288,40 +250,3 @@ export declare function setCalculatedValue(controls: {
288
250
  export declare function resetCalculatedValue(controls: {
289
251
  [key: string]: AbstractControl;
290
252
  }, controlName: string): void;
291
- export interface FormArrayHelperOptions {
292
- allowEmptyArray: boolean;
293
- validators?: ValidatorFn[];
294
- }
295
- export declare class FormArrayHelper<T = Entity<any>, C extends AbstractControl = AbstractControl> {
296
- private readonly _formArray;
297
- private createControl;
298
- private equals;
299
- private isEmpty;
300
- static getOrCreateArray(formBuilder: FormBuilder, form: FormGroup, arrayName: string): FormArray;
301
- private _allowEmptyArray;
302
- private readonly _validators;
303
- get allowEmptyArray(): boolean;
304
- set allowEmptyArray(value: boolean);
305
- get formArray(): FormArray;
306
- constructor(_formArray: FormArray, createControl: (value?: T) => C, equals: (v1: T, v2: T) => boolean, isEmpty: (value: T) => boolean, options?: FormArrayHelperOptions);
307
- add(value?: T, options?: {
308
- emitEvent: boolean;
309
- }): boolean;
310
- removeAt(index: number): boolean;
311
- resize(length: number): boolean;
312
- clearAt(index: number): boolean;
313
- isLast(index: number): boolean;
314
- removeAllEmpty(): void;
315
- size(): number;
316
- at(index: number): C;
317
- disable(opts?: {
318
- onlySelf?: boolean;
319
- emitEvent?: boolean;
320
- }): void;
321
- enable(opts?: {
322
- onlySelf?: boolean;
323
- emitEvent?: boolean;
324
- }): void;
325
- forEach(ite: (control: C) => void): void;
326
- protected setAllowEmptyArray(value: boolean): void;
327
- }
@@ -1,8 +1,8 @@
1
1
  import { ValidatorService } from '@e-is/ngx-material-table';
2
2
  import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
3
3
  import { IValidatorService } from '../../../shared/services/validator-service.class';
4
- import { FormErrors } from '../../form/form.utils';
5
4
  import { TranslateService } from '@ngx-translate/core';
5
+ import { FormErrors } from '../../../shared/forms';
6
6
  export declare abstract class AppValidatorService<T = any> extends ValidatorService implements IValidatorService<T> {
7
7
  protected formBuilder: FormBuilder;
8
8
  protected translate?: TranslateService;
@@ -0,0 +1,51 @@
1
+ /// <reference types="node" />
2
+ import { ChangeDetectorRef, Injector, OnDestroy, OnInit } from '@angular/core';
3
+ import { AppTable } from '../table.class';
4
+ import { Referential } from '../../services/model/referential.model';
5
+ import { IonInfiniteScroll } from '@ionic/angular';
6
+ import { InMemoryEntitiesService } from '../../../shared/services/memory-entity-service.class';
7
+ import { AppValidatorService } from '../../services/validator/base.validator.class';
8
+ import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
9
+ import { ReferentialFilter } from '../../services/testing/referential-filter.model';
10
+ import { MatExpansionPanel } from '@angular/material/expansion';
11
+ import Timeout = NodeJS.Timeout;
12
+ export declare class TableTestPage extends AppTable<Referential, ReferentialFilter> implements OnInit, OnDestroy {
13
+ protected validatorService: AppValidatorService;
14
+ protected formBuilder: FormBuilder;
15
+ protected cd: ChangeDetectorRef;
16
+ static maxRowCount: number;
17
+ timer: Timeout;
18
+ canEdit: boolean;
19
+ data: Referential[];
20
+ filterForm: FormGroup;
21
+ filterCriteriaCount: number;
22
+ groupColumns: string[];
23
+ readonly statusList: readonly import("../../services/model/referential.model").IStatus[];
24
+ readonly statusById: Readonly<import("../../../shared/types").KeyValueType<import("../../services/model/referential.model").IStatus>>;
25
+ enableInfiniteScroll: boolean;
26
+ useSticky: boolean;
27
+ get hasMoreData(): boolean;
28
+ filterExpansionPanel: MatExpansionPanel;
29
+ infiniteScroll: IonInfiniteScroll;
30
+ get dataService(): InMemoryEntitiesService<Referential>;
31
+ constructor(injector: Injector, validatorService: AppValidatorService, formBuilder: FormBuilder, cd: ChangeDetectorRef);
32
+ ngOnInit(): void;
33
+ ngAfterViewInit(): void;
34
+ ngOnDestroy(): void;
35
+ protected restoreFilter(): void;
36
+ toggleTimer(): void;
37
+ load(): void;
38
+ loadMore(event?: CustomEvent & {
39
+ target?: EventTarget & {
40
+ complete?: () => void;
41
+ };
42
+ }): void;
43
+ save(): Promise<boolean>;
44
+ clearControlValue(event: UIEvent, formControl: AbstractControl): boolean;
45
+ applyFilterAndClosePanel(event?: UIEvent): void;
46
+ resetFilter(event?: UIEvent): void;
47
+ startTimer(): void;
48
+ stopTimer(): void;
49
+ protected generateData(offset?: number, size?: number): Referential[];
50
+ protected markForCheck(): void;
51
+ }
@@ -0,0 +1,2 @@
1
+ export declare class TableTestingModule {
2
+ }
@@ -0,0 +1,7 @@
1
+ import { PopoverController } from '@ionic/angular';
2
+ import { TextPopoverOptions } from '../text-popover.component';
3
+ export declare class TextPopoverTestingPage {
4
+ private popoverController;
5
+ constructor(popoverController: PopoverController);
6
+ showPopover(event: UIEvent, opts?: Partial<TextPopoverOptions>): Promise<void>;
7
+ }
@@ -0,0 +1,2 @@
1
+ export declare class TextPopoverTestingModule {
2
+ }
@@ -0,0 +1,28 @@
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, Injector, OnInit } from '@angular/core';
2
+ import { FormBuilder, FormControl } from '@angular/forms';
3
+ import { CdkTextareaAutosize } from '@angular/cdk/text-field';
4
+ import { AppForm } from '../form/form.class';
5
+ export declare class TextForm extends AppForm<{
6
+ text: string;
7
+ }> implements OnInit {
8
+ protected injector: Injector;
9
+ protected cd: ChangeDetectorRef;
10
+ protected formBuilder: FormBuilder;
11
+ showError: boolean;
12
+ placeholder: string;
13
+ multiline: boolean;
14
+ autoHeight: boolean;
15
+ maxLength: number;
16
+ autofocus: boolean;
17
+ textAreaChanges: EventEmitter<string>;
18
+ textArea: ElementRef;
19
+ textInput: ElementRef;
20
+ autosizeDirective: CdkTextareaAutosize;
21
+ control: FormControl;
22
+ constructor(injector: Injector, cd: ChangeDetectorRef, formBuilder: FormBuilder);
23
+ ngOnInit(): void;
24
+ textAreaChanged(event: KeyboardEvent): void;
25
+ containerResize(): void;
26
+ focusInput(): void;
27
+ protected markForCheck(): void;
28
+ }
@@ -0,0 +1,37 @@
1
+ import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
+ import { PopoverController } from '@ionic/angular';
3
+ import { Subscription } from 'rxjs';
4
+ import { TranslateService } from '@ngx-translate/core';
5
+ import { TextForm } from './text-form.component';
6
+ export interface TextPopoverOptions {
7
+ text?: string;
8
+ placeholder?: string;
9
+ editing?: boolean;
10
+ multiline?: boolean;
11
+ maxLength?: number;
12
+ autofocus?: boolean;
13
+ }
14
+ export declare class TextPopover implements OnInit, AfterViewInit, OnDestroy, TextPopoverOptions {
15
+ protected popoverController: PopoverController;
16
+ protected translate: TranslateService;
17
+ form: TextForm;
18
+ text: string;
19
+ placeholder: string;
20
+ editing: boolean;
21
+ multiline: boolean;
22
+ maxLength: number;
23
+ autofocus: boolean;
24
+ subscription: Subscription;
25
+ get disabled(): boolean;
26
+ get enabled(): boolean;
27
+ get valid(): boolean;
28
+ get value(): any;
29
+ constructor(popoverController: PopoverController, translate: TranslateService);
30
+ ngOnInit(): void;
31
+ ngAfterViewInit(): void;
32
+ onValidate(event: any): Promise<any>;
33
+ disable(): void;
34
+ enable(): void;
35
+ cancel(): void;
36
+ ngOnDestroy(): void;
37
+ }
@@ -0,0 +1,14 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ interface DropEvent extends Event {
3
+ dataTransfer?: {
4
+ files?: File[];
5
+ };
6
+ }
7
+ export declare class DragAndDropDirective {
8
+ fileOver: boolean;
9
+ fileDropped: EventEmitter<File[]>;
10
+ onDragOver(event: Event): void;
11
+ onDragLeave(event: Event): void;
12
+ ondrop(event: DropEvent): void;
13
+ }
14
+ export {};
@@ -0,0 +1,78 @@
1
+ import { AbstractControl, FormArray, FormGroup, ValidationErrors } from '@angular/forms';
2
+ import { WaitForOptions } from './observables';
3
+ export interface FormErrors {
4
+ [key: string]: ValidationErrors;
5
+ }
6
+ /**
7
+ * Fill a form using a source entity
8
+ *
9
+ * @param target
10
+ * @param entity
11
+ * @param opts
12
+ */
13
+ export declare function copyEntity2Form(entity: any, target: FormGroup, opts?: {
14
+ emitEvent?: boolean;
15
+ onlySelf?: boolean;
16
+ }): void;
17
+ export declare function getFormValueFromEntity(entity: any | undefined, form: FormGroup): {
18
+ [key: string]: any;
19
+ };
20
+ /**
21
+ * Transform an entity into a simple object, compatible with the given form
22
+ *
23
+ * @param source an entity (or subentity)
24
+ * @param control
25
+ * @param path
26
+ */
27
+ export declare function adaptValueToControl(source: any | undefined, control: AbstractControl, path?: string): any;
28
+ export declare function logFormErrors(control: AbstractControl, logPrefix?: string, path?: string): void;
29
+ export declare function getFormErrors(control: AbstractControl, opts?: {
30
+ controlName?: string;
31
+ result?: FormErrors;
32
+ recursive?: boolean;
33
+ }): FormErrors;
34
+ export declare function getControlFromPath(form: FormGroup, path: string): AbstractControl;
35
+ export declare function disableControls(form: FormGroup, paths: string[], opts?: {
36
+ onlySelf?: boolean;
37
+ emitEvent?: boolean;
38
+ }): void;
39
+ export declare function addValueInArray(arrayControl: FormArray, createControl: (value?: any) => AbstractControl, equals: (v1: any, v2: any) => boolean, isEmpty: (value: any) => boolean, value: any, options?: {
40
+ emitEvent: boolean;
41
+ }): boolean;
42
+ export declare function resizeArray(arrayControl: FormArray, createControl: () => AbstractControl, length: number): boolean;
43
+ export declare function removeValueInArray(arrayControl: FormArray, isEmpty: (value: any) => boolean, index: number): boolean;
44
+ export declare function clearValueInArray(arrayControl: FormArray, isEmpty: (value: any) => boolean, index: number): boolean;
45
+ export declare function markAllAsTouched(control: AbstractControl, opts?: {
46
+ onlySelf?: boolean;
47
+ emitEvent?: boolean;
48
+ }): void;
49
+ export declare function markFormGroupAsTouched(form: FormGroup, opts?: {
50
+ onlySelf?: boolean;
51
+ emitEvent?: boolean;
52
+ }): void;
53
+ export declare function markControlAsTouched(control: AbstractControl, opts?: {
54
+ onlySelf?: boolean;
55
+ emitEvent?: boolean;
56
+ }): void;
57
+ export declare function updateValueAndValidity(form: FormGroup, opts?: {
58
+ onlySelf?: boolean;
59
+ emitEvent?: boolean;
60
+ }): void;
61
+ export declare function markAsUntouched(form: FormGroup, opts?: {
62
+ onlySelf?: boolean;
63
+ }): void;
64
+ /**
65
+ * Wait end of async validation (not pending). This need to implement {pending: boolean}
66
+ * return false
67
+ */
68
+ export declare function waitWhilePending<T extends {
69
+ pending: boolean;
70
+ }>(form: T, opts?: WaitForOptions): Promise<void>;
71
+ /**
72
+ * Wait form is idle (not loading). This need to implement {loading: boolean}
73
+ * @param form
74
+ * @param opts
75
+ */
76
+ export declare function waitIdle<T extends {
77
+ loading: boolean;
78
+ }>(form: T, opts?: WaitForOptions): Promise<void>;
@@ -1,2 +1,2 @@
1
- export declare class MaterialChipsModule {
1
+ export declare class SharedMatChipsModule {
2
2
  }
@@ -0,0 +1,4 @@
1
+ import { TestingPage } from '../testing/tests.page';
2
+ export declare const SHARED_MATERIAL_TESTING_PAGES: TestingPage[];
3
+ export declare class MaterialTestingModule {
4
+ }
@@ -0,0 +1,10 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { FormBuilder, FormGroup } from '@angular/forms';
3
+ export declare class NumpadTestPage implements OnInit {
4
+ protected formBuilder: FormBuilder;
5
+ form: FormGroup;
6
+ constructor(formBuilder: FormBuilder);
7
+ ngOnInit(): void;
8
+ loadData(): Promise<void>;
9
+ doSubmit(event: any): void;
10
+ }
@@ -1,4 +1,4 @@
1
- import { TestingPage } from './material/testing/material.testing.page';
1
+ import { TestingPage } from './testing/tests.page';
2
2
  export declare const SHARED_TESTING_PAGES: TestingPage[];
3
3
  export declare class SharedTestingModule {
4
4
  }
@@ -3,10 +3,11 @@ import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { TranslateService } from '@ngx-translate/core';
4
4
  export declare interface TestingPage {
5
5
  label: string;
6
- page: string;
6
+ page?: string;
7
+ divider?: boolean;
7
8
  }
8
9
  export declare const APP_TESTING_PAGES: InjectionToken<TestingPage[]>;
9
- export declare class MaterialTestingPage {
10
+ export declare class SharedTestsPage {
10
11
  protected route: ActivatedRoute;
11
12
  protected router: Router;
12
13
  protected translate: TranslateService;
@@ -0,0 +1,15 @@
1
+ import { PopoverController } from '@ionic/angular';
2
+ import { UploadFilePopoverOptions } from '../upload-file-popover.component';
3
+ import { Observable } from 'rxjs';
4
+ import { HttpEvent } from '@angular/common/http';
5
+ export declare class UploadFileTestingPage {
6
+ private popoverController;
7
+ constructor(popoverController: PopoverController);
8
+ showPopover(event: UIEvent, opts?: Partial<UploadFilePopoverOptions>): Promise<void>;
9
+ /**
10
+ * Simulate a upload function, with progression
11
+ * @param file
12
+ */
13
+ uploadFile(file: File): Observable<HttpEvent<any>>;
14
+ deleteFile(file: File): Promise<boolean>;
15
+ }
@@ -0,0 +1,2 @@
1
+ export declare class UploadFileTestingModule {
2
+ }
@@ -0,0 +1,36 @@
1
+ import { ChangeDetectorRef } from '@angular/core';
2
+ import { PopoverController } from '@ionic/angular';
3
+ import { UploadFileComponent } from './upload-file.component';
4
+ import { FileDeleteFn, FileUploadFn, UploadFile } from './upload-file.model';
5
+ import { TranslateService } from '@ngx-translate/core';
6
+ export interface UploadFilePopoverOptions {
7
+ title?: string;
8
+ uploadFn: FileUploadFn;
9
+ deleteFn?: FileDeleteFn;
10
+ instantUpload?: boolean;
11
+ uniqueFile?: boolean;
12
+ fileExtension?: string;
13
+ maxParallelUpload?: number;
14
+ }
15
+ export declare class UploadFilePopover implements UploadFilePopoverOptions {
16
+ protected popoverController: PopoverController;
17
+ protected translate: TranslateService;
18
+ protected cd: ChangeDetectorRef;
19
+ uploader: UploadFileComponent;
20
+ fileExtension: string;
21
+ title: string;
22
+ uniqueFile: boolean;
23
+ instantUpload: boolean;
24
+ uploadFn: FileUploadFn;
25
+ deleteFn: FileDeleteFn;
26
+ maxParallelUpload: number;
27
+ importing: boolean;
28
+ error: string;
29
+ get files(): UploadFile[];
30
+ get disabled(): boolean;
31
+ get valid(): boolean;
32
+ constructor(popoverController: PopoverController, translate: TranslateService, cd: ChangeDetectorRef);
33
+ onValidate(event: any): Promise<any>;
34
+ cancel(): Promise<boolean>;
35
+ protected resetError(): void;
36
+ }