@sumaris-net/ngx-components 1.20.0-rc5 → 1.20.2

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 (94) hide show
  1. package/README.md +7 -7
  2. package/bundles/sumaris-net.ngx-components.umd.js +1502 -1316
  3. package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
  4. package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
  5. package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
  6. package/doc/changelog.md +50 -2
  7. package/esm2015/src/app/admin/services/person.service.js +3 -3
  8. package/esm2015/src/app/admin/users/list/users.js +1 -5
  9. package/esm2015/src/app/core/account/account.js +19 -6
  10. package/esm2015/src/app/core/core.module.js +4 -3
  11. package/esm2015/src/app/core/form/entity-editor.class.js +33 -11
  12. package/esm2015/src/app/core/form/form-buttons-bar.component.js +8 -5
  13. package/esm2015/src/app/core/form/list.form.js +1 -1
  14. package/esm2015/src/app/core/home/home.js +2 -2
  15. package/esm2015/src/app/core/install/install-upgrade-card.component.js +10 -40
  16. package/esm2015/src/app/core/menu/menu.component.js +77 -28
  17. package/esm2015/src/app/core/menu/menu.service.js +37 -12
  18. package/esm2015/src/app/core/offline/update-offline-mode-card.component.js +26 -0
  19. package/esm2015/src/app/core/services/account.service.js +2 -2
  20. package/esm2015/src/app/core/services/model/entity.model.js +3 -5
  21. package/esm2015/src/app/core/services/model/filter.model.js +1 -1
  22. package/esm2015/src/app/core/services/model/referential.model.js +1 -4
  23. package/esm2015/src/app/core/services/platform.service.js +44 -17
  24. package/esm2015/src/app/core/services/storage/entities-storage.service.js +36 -35
  25. package/esm2015/src/app/core/services/storage/entity-store.class.js +4 -5
  26. package/esm2015/src/app/core/table/entities-table-datasource.class.js +129 -193
  27. package/esm2015/src/app/core/table/memory-table.class.js +3 -3
  28. package/esm2015/src/app/core/table/table.class.js +96 -95
  29. package/esm2015/src/app/core/text-popover/text-form.component.js +1 -1
  30. package/esm2015/src/app/shared/dates.js +4 -8
  31. package/esm2015/src/app/shared/files.js +26 -1
  32. package/esm2015/src/app/shared/form/field.component.js +2 -2
  33. package/esm2015/src/app/shared/functions.js +5 -2
  34. package/esm2015/src/app/shared/guard/component-dirty.guard.js +3 -3
  35. package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +82 -58
  36. package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +24 -9
  37. package/esm2015/src/app/shared/material/chips/material.chips.js +3 -2
  38. package/esm2015/src/app/shared/material/datetime/material.date.js +2 -2
  39. package/esm2015/src/app/shared/material/datetime/material.dateshort.js +2 -2
  40. package/esm2015/src/app/shared/material/datetime/material.datetime.js +7 -8
  41. package/esm2015/src/app/shared/material/datetime/testing/mat-date-time.test.js +6 -4
  42. package/esm2015/src/app/shared/material/latlong/latlong.utils.js +1 -1
  43. package/esm2015/src/app/shared/material/latlong/material.latlong.js +57 -51
  44. package/esm2015/src/app/shared/material/latlong/testing/latlong.test.js +2 -2
  45. package/esm2015/src/app/shared/material/swipe/material.swipe.js +7 -6
  46. package/esm2015/src/app/shared/pipes/form.pipes.js +86 -23
  47. package/esm2015/src/app/shared/pipes/latlong-format.pipe.js +17 -24
  48. package/esm2015/src/app/shared/pipes/number-format.pipe.js +6 -3
  49. package/esm2015/src/app/shared/pipes/pipes.module.js +6 -4
  50. package/esm2015/src/app/shared/platforms.js +2 -1
  51. package/esm2015/src/app/shared/services/job.utils.js +4 -3
  52. package/esm2015/src/app/shared/toolbar/toolbar.js +25 -9
  53. package/esm2015/src/app/shared/validator/validators.js +9 -4
  54. package/esm2015/src/app/vendor.js +7 -1
  55. package/esm2015/sumaris-net.ngx-components.js +8 -7
  56. package/fesm2015/sumaris-net.ngx-components.js +1054 -833
  57. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  58. package/package.json +2 -2
  59. package/src/app/core/form/entity-editor.class.d.ts +2 -1
  60. package/src/app/core/form/form-buttons-bar.component.d.ts +3 -1
  61. package/src/app/core/install/install-upgrade-card.component.d.ts +1 -6
  62. package/src/app/core/menu/menu.component.d.ts +12 -7
  63. package/src/app/core/menu/menu.service.d.ts +15 -6
  64. package/src/app/core/offline/update-offline-mode-card.component.d.ts +8 -0
  65. package/src/app/core/services/model/entity.model.d.ts +0 -1
  66. package/src/app/core/services/model/filter.model.d.ts +1 -1
  67. package/src/app/core/services/model/referential.model.d.ts +3 -4
  68. package/src/app/core/services/platform.service.d.ts +1 -0
  69. package/src/app/core/services/storage/entities-storage.service.d.ts +10 -6
  70. package/src/app/core/services/storage/entity-store.class.d.ts +2 -2
  71. package/src/app/core/table/entities-table-datasource.class.d.ts +28 -26
  72. package/src/app/core/table/table.class.d.ts +2 -2
  73. package/src/app/shared/dates.d.ts +3 -3
  74. package/src/app/shared/files.d.ts +10 -0
  75. package/src/app/shared/functions.d.ts +1 -0
  76. package/src/app/shared/material/autocomplete/material.autocomplete.d.ts +2 -1
  77. package/src/app/shared/material/autocomplete/testing/autocomplete.test.d.ts +4 -2
  78. package/src/app/shared/material/chips/material.chips.d.ts +2 -1
  79. package/src/app/shared/material/latlong/latlong.utils.d.ts +2 -2
  80. package/src/app/shared/material/latlong/material.latlong.d.ts +15 -10
  81. package/src/app/shared/material/swipe/material.swipe.d.ts +4 -3
  82. package/src/app/shared/pipes/form.pipes.d.ts +20 -4
  83. package/src/app/shared/pipes/latlong-format.pipe.d.ts +6 -4
  84. package/src/app/shared/pipes/number-format.pipe.d.ts +3 -1
  85. package/src/app/shared/toolbar/toolbar.d.ts +5 -2
  86. package/src/app/shared/validator/validators.d.ts +6 -1
  87. package/src/app/vendor.d.ts +5 -0
  88. package/src/assets/i18n/en-US.json +2 -1
  89. package/src/assets/i18n/en.json +2 -1
  90. package/src/assets/i18n/fr.json +4 -1
  91. package/src/theme/_ngx-components.globals.scss +1 -0
  92. package/src/theme/_ngx-components.scss +32 -20
  93. package/sumaris-net.ngx-components.d.ts +7 -6
  94. package/sumaris-net.ngx-components.metadata.json +1 -1
@@ -1,11 +1,13 @@
1
1
  import { PipeTransform } from '@angular/core';
2
- import { formatLatitude, formatLongitude } from '../material/latlong/latlong.utils';
3
- export declare class LatLongFormatPipe implements PipeTransform {
4
- transform(value: number, args?: any): string | Promise<string>;
5
- }
2
+ import { formatLatitude, formatLongitude, LatLongFormatOptions } from '../material/latlong/latlong.utils';
6
3
  export declare class LatitudeFormatPipe implements PipeTransform {
7
4
  transform: typeof formatLatitude;
8
5
  }
9
6
  export declare class LongitudeFormatPipe implements PipeTransform {
10
7
  transform: typeof formatLongitude;
11
8
  }
9
+ export declare class LatLongFormatPipe implements PipeTransform {
10
+ transform(value: number, opts?: Partial<LatLongFormatOptions> & {
11
+ type: 'latitude' | 'longitude';
12
+ }): string | Promise<string>;
13
+ }
@@ -1,4 +1,6 @@
1
1
  import { PipeTransform } from '@angular/core';
2
2
  export declare class NumberFormatPipe implements PipeTransform {
3
- transform(val: number, numberFormatOptions?: Intl.NumberFormatOptions): string | Promise<string>;
3
+ transform(val: number, opts?: Intl.NumberFormatOptions & {
4
+ fixedDecimals?: number;
5
+ }): string | Promise<string>;
4
6
  }
@@ -1,10 +1,11 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ProgressBarService, ProgressMode } from '../services/progress-bar.service';
3
- import { Router } from '@angular/router';
3
+ import { ActivatedRoute, Router } from '@angular/router';
4
4
  import { IonRouterOutlet, IonSearchbar } from '@ionic/angular';
5
5
  import { Observable } from 'rxjs';
6
6
  import { HammerTapEvent } from '../gesture/hammer.utils';
7
7
  import { PredefinedColors } from '@ionic/core';
8
+ import { IonMenuToggle } from '@ionic/angular';
8
9
  export declare abstract class ToolbarToken {
9
10
  abstract onBackClick: Observable<Event>;
10
11
  abstract doBackClick(event: Event): any;
@@ -12,6 +13,7 @@ export declare abstract class ToolbarToken {
12
13
  abstract canGoBack: boolean;
13
14
  }
14
15
  export declare class ToolbarComponent implements ToolbarToken, OnInit, OnDestroy {
16
+ private route;
15
17
  private router;
16
18
  private routerOutlet;
17
19
  private cd;
@@ -39,7 +41,8 @@ export declare class ToolbarComponent implements ToolbarToken, OnInit, OnDestroy
39
41
  progressBarMode$: Observable<ProgressMode>;
40
42
  showSearchBar: boolean;
41
43
  searchbar: IonSearchbar;
42
- constructor(router: Router, routerOutlet: IonRouterOutlet, cd: ChangeDetectorRef, progressBarService: ProgressBarService);
44
+ menuToggle: IonMenuToggle;
45
+ constructor(route: ActivatedRoute, router: Router, routerOutlet: IonRouterOutlet, cd: ChangeDetectorRef, progressBarService: ProgressBarService);
43
46
  ngOnInit(): void;
44
47
  ngOnDestroy(): void;
45
48
  toggleSearchBar(): Promise<void>;
@@ -18,6 +18,7 @@ export declare class SharedValidators {
18
18
  dateMinDuration: string;
19
19
  dateMaxDuration: string;
20
20
  maxDecimals: string;
21
+ double: string;
21
22
  integer: string;
22
23
  email: string;
23
24
  latitude: string;
@@ -33,7 +34,11 @@ export declare class SharedValidators {
33
34
  static empty(control: FormControl): ValidationErrors | null;
34
35
  static pubkey(control: FormControl): ValidationErrors | null;
35
36
  static integer(control: FormControl): ValidationErrors | null;
36
- static double(opts?: {
37
+ /**
38
+ * @deprecated use decimal
39
+ */
40
+ static double: typeof SharedValidators.decimal;
41
+ static decimal(opts?: {
37
42
  maxDecimals?: number;
38
43
  }): ValidatorFn;
39
44
  static validDate(control: FormControl): ValidationErrors | null;
@@ -2,3 +2,8 @@ import 'tweetnacl';
2
2
  import 'tweetnacl-util';
3
3
  import 'scrypt-async';
4
4
  import 'hammerjs';
5
+ import * as momentImported from 'moment';
6
+ import { Moment } from 'moment';
7
+ declare const moment: typeof momentImported;
8
+ declare const tz: typeof momentImported;
9
+ export { moment, tz, Moment };
@@ -444,8 +444,9 @@
444
444
  "FIELD_MAX": "Maximum value: {{max}}",
445
445
  "FIELD_MAX_COMPACT": "Max value={{max}}",
446
446
  "FIELD_MAXIMUM_DECIMALS": "Too many decimals ({{maxDecimals}} max)",
447
- "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb decimals > {{max}}",
447
+ "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb decimals > {{maxDecimals}}",
448
448
  "FIELD_INVALID": "Invalid value",
449
+ "FIELD_NOT_VALID_DECIMAL": "Expected decimal value",
449
450
  "FIELD_NOT_VALID_INTEGER": "Expected integer value",
450
451
  "FIELD_NOT_VALID_EMAIL": "Invalid email address",
451
452
  "FIELD_NOT_VALID_DATE": "Invalid date",
@@ -444,8 +444,9 @@
444
444
  "FIELD_MAX": "Maximum value: {{max}}",
445
445
  "FIELD_MAX_COMPACT": "Max value={{max}}",
446
446
  "FIELD_MAXIMUM_DECIMALS": "Too many decimals ({{maxDecimals}} max)",
447
- "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb decimals > {{max}}",
447
+ "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb decimals > {{maxDecimals}}",
448
448
  "FIELD_INVALID": "Invalid value",
449
+ "FIELD_NOT_VALID_DECIMAL": "Expected decimal value",
449
450
  "FIELD_NOT_VALID_INTEGER": "Expected integer value",
450
451
  "FIELD_NOT_VALID_EMAIL": "Invalid email address",
451
452
  "FIELD_NOT_VALID_DATE": "Invalid date",
@@ -256,6 +256,8 @@
256
256
  }
257
257
  },
258
258
  "REFERENTIAL": {
259
+ "LABEL": "Code",
260
+ "NAME": "Libellé",
259
261
  "STATUS_ENUM": {
260
262
  "ENABLE": "Actif à la saisie",
261
263
  "DISABLE": "Inactif à la saisie",
@@ -441,12 +443,13 @@
441
443
  "FIELD_MAX_LENGTH": "Valeur trop longue {{maxLength && (' (' + maxLength + ' caract. max)') }}",
442
444
  "FIELD_MAX_LENGTH_COMPACT": "Valeur trop longue",
443
445
  "FIELD_MIN": "La valeur minimale autorisée est {{min}}",
444
- "FIELD_MIN_COMPACT": "Min autorisée={{min}}",
446
+ "FIELD_MIN_COMPACT": "Min {{min}}",
445
447
  "FIELD_MAX": "Valeur maximale autorisée: {{max}}",
446
448
  "FIELD_MAX_COMPACT": "Max {{max}}",
447
449
  "FIELD_MAXIMUM_DECIMALS": "Trop de décimales (max: {{maxDecimals}})",
448
450
  "FIELD_MAXIMUM_DECIMALS_COMPACT": "Nb décimale > {{maxDecimals}}",
449
451
  "FIELD_INVALID": "Valeur non valide",
452
+ "FIELD_NOT_VALID_DECIMAL": "Valeur décimale attendue",
450
453
  "FIELD_NOT_VALID_INTEGER": "Valeur entière attendue",
451
454
  "FIELD_NOT_VALID_EMAIL": "Adresse email invalide",
452
455
  "FIELD_NOT_VALID_DATE": "Date invalide",
@@ -7,6 +7,7 @@ $app-form-color-disabled: rgba(0, 0, 0, 0.55) !default;
7
7
 
8
8
  $app-table-header-height: 44px !default;
9
9
  $app-table-cell-vertical-padding: 8px !default;
10
+ $app-table-row-height: 48px !default;
10
11
  $app-table-row-max-height: 52px !default;
11
12
 
12
13
  $app-paginator-height: 34px !default;
@@ -344,17 +344,20 @@ mat-option:not(:last-of-type) {
344
344
  }
345
345
  }
346
346
 
347
- ion-searchbar.mat-select-header,
348
- ion-searchbar.mat-autocomplete-header
347
+ mat-option.mat-select-searchbar,
348
+ mat-option.mat-autocomplete-searchbar
349
349
  {
350
- visibility: hidden;
351
- display: none;
352
- opacity: 0;
353
-
354
- height: 58px;
350
+ padding: 0 !important;
351
+ height: 58px !important;
355
352
  background-color: var(--ion-color-secondary100) !important;
356
353
 
357
- &.ion-searchbar-sticky {
354
+ /* hide pseudo checkbox, in the searchbar*/
355
+ mat-pseudo-checkbox {
356
+ visibility: hidden;
357
+ display: none;
358
+ }
359
+
360
+ &.mat-select-searchbar-sticky {
358
361
  z-index: 1001;
359
362
  /* Set header as sticky*/
360
363
  position: -webkit-sticky;
@@ -387,7 +390,7 @@ mat-option:not(:last-of-type) {
387
390
  white-space: nowrap;
388
391
  text-overflow: ellipsis;
389
392
  }
390
- &.ion-searchbar-sticky {
393
+ &.mat-select-searchbar-sticky {
391
394
  /* offset because of the searchbar height */
392
395
  top: 58px;
393
396
  }
@@ -397,7 +400,8 @@ mat-option:not(:last-of-type) {
397
400
 
398
401
  ion-row.mat-select-footer,
399
402
  ion-row.mat-menu-footer,
400
- ion-row.mat-autocomplete-footer {
403
+ ion-row.mat-autocomplete-footer,
404
+ mat-option.mat-autocomplete-footer {
401
405
  /* Set footer as sticky*/
402
406
  position: -webkit-sticky;
403
407
  position: sticky;
@@ -587,7 +591,9 @@ ion-list {
587
591
  .mat-row,
588
592
  .mat-footer-row {
589
593
  --mat-cell-vertical-padding: #{$app-table-cell-vertical-padding};
594
+ --mat-row-height: #{$app-table-row-height};
590
595
  --mat-row-max-height: #{$app-table-row-max-height};
596
+ height: calc(min(var(--mat-row-height), var(--mat-row-max-height)));
591
597
  max-height: var(--mat-row-max-height);
592
598
 
593
599
  // Reserve space for row dirty border
@@ -807,15 +813,14 @@ ion-list {
807
813
  }
808
814
  }
809
815
 
810
-
811
-
812
816
  /* Special case to have small row */
813
- .mat-row-small {
817
+ &.compact .mat-row,
818
+ .mat-row.mat-row-small {
814
819
  min-height: inherit;
815
- max-height: 33px !important;
820
+ --mat-row-max-height: 33px;
816
821
  }
817
- .mat-row.mat-small .mat-cell,
818
- .mat-row .mat-cell.mat-small{
822
+ .mat-row.mat-row-small .mat-cell,
823
+ .mat-row .mat-cell.mat-row-small{
819
824
  line-height: 15px;
820
825
  @include font-size(12px);
821
826
  }
@@ -1060,16 +1065,23 @@ mat-button-toggle.mat-button-toggle-checked.mat-button-toggle-disabled {
1060
1065
  color: white;
1061
1066
  }
1062
1067
 
1063
- // --- mat-tab-group component
1068
+ // --------------------------------------------------
1069
+ // Material tab group
1070
+ // --------------------------------------------------
1071
+
1072
+ // --- Allow to hide headers
1064
1073
  mat-tab-group.mat-tab-group-header-hidden .mat-tab-header {
1065
- display: none !important;
1074
+ display: none;
1066
1075
  }
1076
+
1077
+ // --- Allow to hide header's pagination
1067
1078
  mat-tab-group.mat-tab-group-header-pagination-hidden .mat-tab-header-pagination {
1068
- display: none !important;
1079
+ display: none;
1069
1080
  }
1070
1081
 
1082
+ // --- Allow to hide disabled headers
1071
1083
  mat-tab-group.mat-tab-disabled-hidden .mat-tab-disabled {
1072
- display: none !important;
1084
+ display: none;
1073
1085
  }
1074
1086
 
1075
1087
  // --------------------------------------------------
@@ -2,17 +2,18 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './public_api';
5
- export { AppIconComponent as ɵi } from './src/app/core/icon/icon.component';
5
+ export { AppIconComponent as ɵj } from './src/app/core/icon/icon.component';
6
+ export { AppUpdateOfflineModeCard as ɵi } from './src/app/core/offline/update-offline-mode-card.component';
6
7
  export { RegisterForm as ɵd } from './src/app/core/register/form/form-register';
7
8
  export { RegisterModal as ɵf } from './src/app/core/register/modal/modal-register';
8
9
  export { AccountValidatorService as ɵe } from './src/app/core/services/validator/account.validator';
9
10
  export { LocalSettingsValidatorService as ɵh } from './src/app/core/services/validator/local-settings.validator';
10
11
  export { UserSettingsValidatorService as ɵg } from './src/app/core/services/validator/user-settings.validator';
11
12
  export { isFocusableElement as ɵc } from './src/app/shared/focusable';
12
- export { MatBadgeIconTestPage as ɵl } from './src/app/shared/material/badge/badge-icon.test';
13
- export { DateTestPage as ɵj } from './src/app/shared/material/datetime/testing/mat-date.test';
13
+ export { MatBadgeIconTestPage as ɵm } from './src/app/shared/material/badge/badge-icon.test';
14
+ export { DateTestPage as ɵk } from './src/app/shared/material/datetime/testing/mat-date.test';
14
15
  export { MatNumpadDomService as ɵb } from './src/app/shared/material/numpad/numpad.dom-service';
15
- export { NumpadTestPage as ɵk } from './src/app/shared/material/numpad/testing/numpad.test';
16
+ export { NumpadTestPage as ɵl } from './src/app/shared/material/numpad/testing/numpad.test';
16
17
  export { CustomReuseStrategy as ɵa } from './src/app/shared/shared-routing.module';
17
- export { ToastTestingPage as ɵn } from './src/app/shared/toast/toast.testing';
18
- export { ToastTestingModule as ɵm } from './src/app/shared/toast/toast.testing.module';
18
+ export { ToastTestingPage as ɵo } from './src/app/shared/toast/toast.testing';
19
+ export { ToastTestingModule as ɵn } from './src/app/shared/toast/toast.testing.module';