@sumaris-net/ngx-components 1.14.3 → 1.15.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.
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.14.3",
4
+ "version": "1.15.2",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -14,8 +14,9 @@ export declare class DateUtils {
14
14
  * Same implementation as the Java class Dates.resetTime() (see any SUMARiS like Pod)
15
15
  * @param value
16
16
  * @param timezone a timezone (see https://momentjs.com/timezone/)
17
+ * @param keepLocalTime if true, only the timezone (and offset) is updated, keeping the local time same. Consequently, it will now point to a different point in time if the offset has changed.
17
18
  */
18
- static resetTime(value: Moment | string, timezone?: string): Moment | undefined;
19
+ static resetTime(value: Moment | string, timezone?: string, keepLocalTime?: boolean): Moment | undefined;
19
20
  }
20
21
  export declare function toDateISOString(value: any): string | undefined;
21
22
  export declare function fromDateISOString(value: any): Moment | undefined;
@@ -9,6 +9,7 @@ import { FloatLabelType } from '@angular/material/form-field';
9
9
  import { MatDatepicker, MatDatepickerInputEvent } from '@angular/material/datepicker';
10
10
  import { DateAdapter } from '@angular/material/core';
11
11
  export declare class MatDate implements OnInit, OnDestroy, ControlValueAccessor, InputElement {
12
+ private platform;
12
13
  private dateAdapter;
13
14
  private translate;
14
15
  private formBuilder;
@@ -18,38 +19,39 @@ export declare class MatDate implements OnInit, OnDestroy, ControlValueAccessor,
18
19
  private _onChangeCallback;
19
20
  private _onTouchedCallback;
20
21
  private _subscription;
21
- protected writing: boolean;
22
- protected disabling: boolean;
23
- protected _tabindex: number;
24
- protected keyboardHideDelay: number;
25
- mobile: boolean;
22
+ private _writing;
23
+ private _disabling;
24
+ private _tabindex;
25
+ private _keyboardHideDelay;
26
+ _readonly: boolean;
26
27
  dayControl: AbstractControl;
27
28
  displayPattern: string;
28
29
  dayPattern: string;
29
- _value: Moment;
30
30
  locale: string;
31
- dayMask: (string | RegExp)[];
32
- disabled: boolean;
31
+ readonly dayMask: (string | RegExp)[];
33
32
  formControl: FormControl;
34
33
  formControlName: string;
35
34
  placeholder: string;
36
35
  floatLabel: FloatLabelType;
37
- readonly: boolean;
38
36
  required: boolean;
37
+ mobile: boolean;
39
38
  compact: boolean;
40
39
  placeholderChar: string;
41
40
  autofocus: boolean;
41
+ startDate: Moment | null;
42
+ clearable: boolean;
43
+ timezone: string;
44
+ set readonly(value: boolean);
45
+ get readonly(): boolean;
42
46
  set tabindex(value: number);
43
47
  get tabindex(): number;
44
- startDate: Date;
45
- clearable: boolean;
48
+ get value(): any;
46
49
  datePicker: MatDatepicker<Moment>;
47
50
  matInputs: QueryList<ElementRef>;
48
- get value(): any;
49
51
  constructor(platform: Platform, dateAdapter: DateAdapter<Moment>, translate: TranslateService, formBuilder: FormBuilder, cd: ChangeDetectorRef, keyboard: Keyboard, formGroupDir: FormGroupDirective);
50
52
  ngOnInit(): void;
51
53
  ngOnDestroy(): void;
52
- writeValue(obj: any): void;
54
+ writeValue(valueStr: any): void;
53
55
  registerOnChange(fn: any): void;
54
56
  registerOnTouched(fn: any): void;
55
57
  setDisabledState(isDisabled: boolean): void;
@@ -58,10 +60,14 @@ export declare class MatDate implements OnInit, OnDestroy, ControlValueAccessor,
58
60
  openDatePicker(event?: UIEvent, datePicker?: MatDatepicker<any>): void;
59
61
  preventEvent(event: UIEvent): void;
60
62
  focus(): void;
63
+ clear(): void;
61
64
  private updatePattern;
62
- private onFormChange;
63
65
  checkIfTouched(): void;
66
+ private onFormChange;
64
67
  private waitKeyboardHide;
68
+ private emitChange;
65
69
  private updateTabIndex;
70
+ private markAsTouched;
71
+ private markAsDirty;
66
72
  private markForCheck;
67
73
  }
@@ -29,10 +29,10 @@ export declare class MatDateTime implements OnInit, OnDestroy, ControlValueAcces
29
29
  private _onChangeCallback;
30
30
  private _onTouchedCallback;
31
31
  private _subscription;
32
- protected writing: boolean;
33
- protected disabling: boolean;
34
- protected _tabindex: number;
35
- protected keyboardHideDelay: number;
32
+ private _writing;
33
+ private _disabling;
34
+ private _tabindex;
35
+ private _keyboardHideDelay;
36
36
  _readonly: boolean;
37
37
  dateFormControl: FormControl;
38
38
  timeFormControl: FormControl;
@@ -64,7 +64,6 @@ export declare class MatDateTime implements OnInit, OnDestroy, ControlValueAcces
64
64
  ngOnInit(): void;
65
65
  ngOnDestroy(): void;
66
66
  writeValue(valueStr: any): void;
67
- private onFormChange;
68
67
  registerOnChange(fn: any): void;
69
68
  registerOnTouched(fn: any): void;
70
69
  setDisabledState(isDisabled: boolean): void;
@@ -79,6 +78,7 @@ export declare class MatDateTime implements OnInit, OnDestroy, ControlValueAcces
79
78
  clear(): void;
80
79
  private updatePattern;
81
80
  checkIfTouched(): void;
81
+ private onFormChange;
82
82
  private waitKeyboardHide;
83
83
  private emitChange;
84
84
  private updateTabIndex;
@@ -0,0 +1,29 @@
1
+ /// <reference types="node" />
2
+ import { ChangeDetectorRef, OnInit } from '@angular/core';
3
+ import { FormBuilder, FormGroup } from '@angular/forms';
4
+ import { Platform } from '@ionic/angular';
5
+ import Timer = NodeJS.Timer;
6
+ export declare class DateTestPage implements OnInit {
7
+ protected platform: Platform;
8
+ protected formBuilder: FormBuilder;
9
+ protected cd: ChangeDetectorRef;
10
+ showLogPanel: boolean;
11
+ logContent: string;
12
+ memoryHide: boolean;
13
+ memoryMobile: boolean;
14
+ memoryTimer: Timer;
15
+ timezone: string;
16
+ form: FormGroup;
17
+ constructor(platform: Platform, formBuilder: FormBuilder, cd: ChangeDetectorRef);
18
+ ngOnInit(): void;
19
+ loadData(): Promise<void>;
20
+ doSubmit(event: any): void;
21
+ log(message: string): void;
22
+ clearLogPanel(): void;
23
+ startMemoryTimer(): void;
24
+ stopMemoryTimer(): void;
25
+ stringify: {
26
+ (value: any, replacer?: (this: any, key: string, value: any) => any, space?: import("../../../types").KeyType): string;
27
+ (value: any, replacer?: import("../../../types").KeyType[], space?: import("../../../types").KeyType): string;
28
+ };
29
+ }
@@ -13,6 +13,7 @@ export declare class SharedValidators {
13
13
  pubkey: string;
14
14
  validDate: string;
15
15
  dateIsAfter: string;
16
+ dateIsBefore: string;
16
17
  dateRange: string;
17
18
  dateMinDuration: string;
18
19
  dateMaxDuration: string;
@@ -25,7 +26,6 @@ export declare class SharedValidators {
25
26
  unique: string;
26
27
  entity: string;
27
28
  };
28
- static validDate(control: FormControl): ValidationErrors | null;
29
29
  static latitude(control: FormControl): ValidationErrors | null;
30
30
  static longitude(control: FormControl): ValidationErrors | null;
31
31
  static object(control: FormControl): ValidationErrors | null;
@@ -36,7 +36,9 @@ export declare class SharedValidators {
36
36
  static double(opts?: {
37
37
  maxDecimals?: number;
38
38
  }): ValidatorFn;
39
+ static validDate(control: FormControl): ValidationErrors | null;
39
40
  static dateIsAfter(previousValue: Moment, errorParam: string, granularity?: unitOfTime.StartOf): ValidatorFn;
41
+ static dateIsBefore(maxValue: Moment, errorParam: string, granularity?: unitOfTime.StartOf): ValidatorFn;
40
42
  static dateRangeEnd(startDateFieldName: string, msg?: string): ValidatorFn;
41
43
  static dateRangeStart(endDateFieldName: string, msg?: string): ValidatorFn;
42
44
  static copyParentErrors(errorNames?: string[]): ValidatorFn;
@@ -430,6 +430,7 @@
430
430
  "FIELD_NOT_VALID_EMAIL": "Invalid email address",
431
431
  "FIELD_NOT_VALID_DATE": "Invalid date",
432
432
  "FIELD_NOT_VALID_DATE_AFTER": "Must be after {{minDate}}",
433
+ "FIELD_NOT_VALID_DATE_BEFORE": "Must be before {{maxDate}}",
433
434
  "FIELD_NOT_VALID_DATE_RANGE": "Inconsistent dates",
434
435
  "FIELD_NOT_VALID_DATE_MAX_DURATION": "Duration too long",
435
436
  "FIELD_NOT_VALID_DATE_MIN_DURATION": "Duration too short",
@@ -430,6 +430,7 @@
430
430
  "FIELD_NOT_VALID_EMAIL": "Invalid email address",
431
431
  "FIELD_NOT_VALID_DATE": "Invalid date",
432
432
  "FIELD_NOT_VALID_DATE_AFTER": "Must be after {{minDate}}",
433
+ "FIELD_NOT_VALID_DATE_BEFORE": "Must be before {{maxDate}}",
433
434
  "FIELD_NOT_VALID_DATE_RANGE": "Inconsistent dates",
434
435
  "FIELD_NOT_VALID_DATE_MAX_DURATION": "Duration too long",
435
436
  "FIELD_NOT_VALID_DATE_MIN_DURATION": "Duration too short",
@@ -430,6 +430,7 @@
430
430
  "FIELD_NOT_VALID_EMAIL": "Adresse email invalide",
431
431
  "FIELD_NOT_VALID_DATE": "Date invalide",
432
432
  "FIELD_NOT_VALID_DATE_AFTER": "Doit être postérieure à {{minDate}}",
433
+ "FIELD_NOT_VALID_DATE_BEFORE": "Doit être antérieure à {{maxDate}}",
433
434
  "FIELD_NOT_VALID_DATE_RANGE": "Dates incohérentes",
434
435
  "FIELD_NOT_VALID_DATE_MAX_DURATION": "Durée trop longue",
435
436
  "FIELD_NOT_VALID_DATE_MIN_DURATION": "Durée trop courte",
@@ -9,9 +9,10 @@ export { AccountValidatorService as ɵe } from './src/app/core/services/validato
9
9
  export { LocalSettingsValidatorService as ɵh } from './src/app/core/services/validator/local-settings.validator';
10
10
  export { UserSettingsValidatorService as ɵg } from './src/app/core/services/validator/user-settings.validator';
11
11
  export { isFocusableElement as ɵc } from './src/app/shared/focusable';
12
- export { MatBadgeIconTestPage as ɵk } from './src/app/shared/material/badge/badge-icon.test';
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
14
  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';
15
+ export { NumpadTestPage as ɵk } from './src/app/shared/material/numpad/testing/numpad.test';
15
16
  export { CustomReuseStrategy as ɵa } from './src/app/shared/shared-routing.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';
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';