@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
@@ -0,0 +1,45 @@
1
+ import { ChangeDetectorRef, ElementRef } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import { UploadFile, FileUploadFn, FileDeleteFn } from './upload-file.model';
4
+ import { WaitForOptions } from '../observables';
5
+ export declare class UploadFileComponent {
6
+ protected cd: ChangeDetectorRef;
7
+ protected translate: TranslateService;
8
+ fileDropEl: ElementRef;
9
+ fileExtension: string;
10
+ uniqueFile: boolean;
11
+ instantUpload: boolean;
12
+ uploadFn: FileUploadFn;
13
+ deleteFn: FileDeleteFn;
14
+ maxParallelUpload: number;
15
+ files: UploadFile[];
16
+ get processingFiles(): UploadFile[];
17
+ get processedFiles(): UploadFile[];
18
+ get processingFilesCount(): number;
19
+ constructor(cd: ChangeDetectorRef, translate: TranslateService);
20
+ /**
21
+ * on file drop handler
22
+ */
23
+ onFileDropped(event: any): void;
24
+ /**
25
+ * handle file from browsing
26
+ */
27
+ fileBrowseHandler(files: any): void;
28
+ /**
29
+ * Delete file from files list
30
+ *
31
+ * @param index (File index)
32
+ */
33
+ deleteFile(index: number): Promise<void>;
34
+ /**
35
+ * Convert Files list to normal array list
36
+ *
37
+ * @param files (Files List)
38
+ */
39
+ prepareFilesList(files: FileList | File[]): void;
40
+ /**
41
+ * Execute upload
42
+ */
43
+ uploadFiles(files?: File[]): Promise<UploadFile[]>;
44
+ waitIdle(opts?: WaitForOptions): Promise<void>;
45
+ }
@@ -0,0 +1,10 @@
1
+ import { Observable } from 'rxjs';
2
+ import { HttpEvent } from '@angular/common/http';
3
+ export declare class UploadFile extends File {
4
+ progress?: number;
5
+ deleting?: boolean;
6
+ finalName?: string;
7
+ error?: string;
8
+ }
9
+ export declare type FileUploadFn = (file: File) => Observable<HttpEvent<any>>;
10
+ export declare type FileDeleteFn = (file: UploadFile) => Promise<boolean>;
@@ -1,8 +1,8 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { TranslateService } from '@ngx-translate/core';
3
3
  import { AbstractControl } from '@angular/forms';
4
- import { FormErrors } from '../../core/form/form.utils';
5
4
  import { ObjectMap } from '../types';
5
+ import { FormErrors } from '../forms';
6
6
  export declare const APP_FORM_ERROR_I18N_KEYS: InjectionToken<ObjectMap<string>>;
7
7
  export interface IFormControlPathTranslator {
8
8
  translateControlPath: (controlPath: string) => string;
@@ -14,6 +14,7 @@
14
14
  "BTN_CLOSE": "Close",
15
15
  "BTN_DONE": "Done",
16
16
  "BTN_DOWNLOAD": "Download",
17
+ "BTN_IMPORT": "Import",
17
18
  "BTN_DUPLICATE": "Duplicate",
18
19
  "BTN_DELETE": "Delete",
19
20
  "BTN_DELETE_FOREVER": "Delete forever",
@@ -405,6 +406,14 @@
405
406
  "SAVE_USER_EVENT_ERROR": "Error while saving user message"
406
407
  }
407
408
  },
409
+ "FILE": {
410
+ "UPLOAD": {
411
+ "DRAG_AND_DROP": "Drag and drop a file{{ extension }} here<br/>or",
412
+ "BROWSE": "Browse",
413
+ "IMPORTING": "Import in progress",
414
+ "ERROR": "Error while uploading file"
415
+ }
416
+ },
408
417
  "ERROR": {
409
418
  "ALERT_HEADER": "Error",
410
419
  "FIELD_REQUIRED": "Value required",
@@ -515,7 +524,8 @@
515
524
  "UPDATE_APP_TO_VERSION": "<b>Please upgrade {{name}}</b> in version {{version}} (or more)",
516
525
  "UPDATE_APP_HELP": "If you do not do this upgrade, communication with the network node may not work.",
517
526
  "UPDATE_APP_DOWNLOADED": "The update download is complete.<br/><b>Please install</b> from the downloaded files.",
518
- "PLEASE_TYPE_MORE_CHARACTERS": "Please type at least {{minLength}} characters"
527
+ "PLEASE_TYPE_MORE_CHARACTERS": "Please type at least {{minLength}} characters",
528
+ "TEXT_PROGRESS": "{{current}} of {{max}}"
519
529
  },
520
530
  "TABLE": {
521
531
  "TESTING": {
@@ -14,6 +14,7 @@
14
14
  "BTN_CLOSE": "Close",
15
15
  "BTN_DONE": "Done",
16
16
  "BTN_DOWNLOAD": "Download",
17
+ "BTN_IMPORT": "Import",
17
18
  "BTN_DUPLICATE": "Duplicate",
18
19
  "BTN_DELETE": "Delete",
19
20
  "BTN_DELETE_FOREVER": "Delete forever",
@@ -405,6 +406,14 @@
405
406
  "SAVE_USER_EVENT_ERROR": "Error while saving user message"
406
407
  }
407
408
  },
409
+ "FILE": {
410
+ "UPLOAD": {
411
+ "DRAG_AND_DROP": "Drag and drop a file{{ extension }} here<br/>or",
412
+ "BROWSE": "Browse",
413
+ "IMPORTING": "Import in progress",
414
+ "ERROR": "Error while uploading file"
415
+ }
416
+ },
408
417
  "ERROR": {
409
418
  "ALERT_HEADER": "Error",
410
419
  "FIELD_REQUIRED": "Value required",
@@ -515,7 +524,8 @@
515
524
  "UPDATE_APP_TO_VERSION": "<b>Please upgrade {{name}}</b> in version {{version}} (or more)",
516
525
  "UPDATE_APP_HELP": "If you do not do this upgrade, communication with the network node may not work.",
517
526
  "UPDATE_APP_DOWNLOADED": "The update download is complete.<br/><b>Please install</b> from the downloaded files.",
518
- "PLEASE_TYPE_MORE_CHARACTERS": "Please type at least {{minLength}} characters"
527
+ "PLEASE_TYPE_MORE_CHARACTERS": "Please type at least {{minLength}} characters",
528
+ "TEXT_PROGRESS": "{{current}} of {{max}}"
519
529
  },
520
530
  "TABLE": {
521
531
  "TESTING": {
@@ -14,6 +14,7 @@
14
14
  "BTN_CLOSE": "Fermer",
15
15
  "BTN_DONE": "Terminer",
16
16
  "BTN_DOWNLOAD": "Télécharger",
17
+ "BTN_IMPORT": "Importer",
17
18
  "BTN_DUPLICATE": "Dupliquer",
18
19
  "BTN_DELETE": "Supprimer",
19
20
  "BTN_DELETE_FOREVER": "Supprimer définitivement",
@@ -402,6 +403,14 @@
402
403
  "SAVE_USER_EVENT_ERROR": "Erreur de sauvegarde du message utilisateur"
403
404
  }
404
405
  },
406
+ "FILE": {
407
+ "UPLOAD": {
408
+ "DRAG_AND_DROP": "Glisser et déposer un fichier{{ extension }} ici<br/>ou",
409
+ "BROWSE": "Parcourir",
410
+ "IMPORTING": "Importation en cours",
411
+ "ERROR": "Erreur durant l'envoi de fichier"
412
+ }
413
+ },
405
414
  "ERROR": {
406
415
  "ALERT_HEADER": "Erreur",
407
416
  "FIELD_REQUIRED": "Champ obligatoire",
@@ -512,7 +521,8 @@
512
521
  "UPDATE_APP_TO_VERSION": "<b>Veuillez mettre à jour {{name}}</b> (en v{{version}} ou +)",
513
522
  "UPDATE_APP_HELP": "Cette mise à jour est <b>nécessaire pour se connecter correctement</b> au nœud réseau. En cas de problème pour l'installation, veuillez <b>contacter votre administrateur</b>.",
514
523
  "UPDATE_APP_DOWNLOADED": "Le téléchargement de la mise à jour est terminée.<br/><b>Veuillez l'installer</b> à partir des fichiers de l'appareil.",
515
- "PLEASE_TYPE_MORE_CHARACTERS": "Veuillez taper au moins {{minLength}} caractères"
524
+ "PLEASE_TYPE_MORE_CHARACTERS": "Veuillez taper au moins {{minLength}} caractères",
525
+ "TEXT_PROGRESS": "{{current}} sur {{max}}"
516
526
  },
517
527
  "TABLE": {
518
528
  "TESTING": {
@@ -1150,6 +1150,14 @@ ion-modal.stack-modal {
1150
1150
  min-height: calc(100% - 50px);
1151
1151
  }
1152
1152
 
1153
+ // --------------------------------------------------
1154
+ // Popover
1155
+ // --------------------------------------------------
1156
+
1157
+ .popover-large {
1158
+ --min-width: calc(min(500px, 80%));
1159
+ }
1160
+
1153
1161
  // --------------------------------------------------
1154
1162
  // Large button with icon floating on right
1155
1163
  // --------------------------------------------------
@@ -2,17 +2,16 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './public_api';
5
- export { AppIconComponent as ɵn } from './src/app/core/icon/icon.component';
6
- export { RegisterForm as ɵi } from './src/app/core/register/form/form-register';
7
- export { RegisterModal as ɵk } from './src/app/core/register/modal/modal-register';
8
- export { AccountValidatorService as ɵj } from './src/app/core/services/validator/account.validator';
9
- export { LocalSettingsValidatorService as ɵm } from './src/app/core/services/validator/local-settings.validator';
10
- export { UserSettingsValidatorService as ɵl } from './src/app/core/services/validator/user-settings.validator';
11
- export { isFocusableElement as ɵe } from './src/app/shared/focusable';
12
- export { MatBadgeIconDirective as ɵd } from './src/app/shared/material/badge/badge-icon.directive';
13
- export { SharedMatBadgeIconModule as ɵc } from './src/app/shared/material/badge/badge-icon.module';
14
- export { MatBadgeIconTestPage as ɵf } from './src/app/shared/material/badge/badge-icon.test';
5
+ export { AppIconComponent as ɵi } from './src/app/core/icon/icon.component';
6
+ export { RegisterForm as ɵd } from './src/app/core/register/form/form-register';
7
+ export { RegisterModal as ɵf } from './src/app/core/register/modal/modal-register';
8
+ export { AccountValidatorService as ɵe } from './src/app/core/services/validator/account.validator';
9
+ export { LocalSettingsValidatorService as ɵh } from './src/app/core/services/validator/local-settings.validator';
10
+ export { UserSettingsValidatorService as ɵg } from './src/app/core/services/validator/user-settings.validator';
11
+ export { isFocusableElement as ɵc } from './src/app/shared/focusable';
12
+ export { MatBadgeIconTestPage as ɵk } from './src/app/shared/material/badge/badge-icon.test';
15
13
  export { MatNumpadDomService as ɵb } from './src/app/shared/material/numpad/numpad.dom-service';
14
+ export { NumpadTestPage as ɵj } from './src/app/shared/material/numpad/testing/numpad.test';
16
15
  export { CustomReuseStrategy as ɵa } from './src/app/shared/shared-routing.module';
17
- export { ToastTestingPage as ɵh } from './src/app/shared/toast/toast.testing';
18
- export { ToastTestingModule as ɵg } from './src/app/shared/toast/toast.testing.module';
16
+ export { ToastTestingPage as ɵm } from './src/app/shared/toast/toast.testing';
17
+ export { ToastTestingModule as ɵl } from './src/app/shared/toast/toast.testing.module';