@sumaris-net/ngx-components 18.22.23 → 18.22.25

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": "18.22.23",
4
+ "version": "18.22.25",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -13,6 +13,8 @@ export declare class DateUtils {
13
13
  static moment: MomentFn;
14
14
  static toDateISOString: typeof toDateISOString;
15
15
  static fromDateISOString: typeof fromDateISOString;
16
+ static fromUnixTimestamp: typeof fromUnixTimestamp;
17
+ static fromUnixMsTimestamp: typeof fromUnixMsTimestamp;
16
18
  static toDuration: typeof toDuration;
17
19
  static min(date1: Moment, date2: Moment): Moment;
18
20
  static max(date1: Moment | string, date2: Moment | string): Moment;
@@ -37,7 +39,7 @@ export declare class DateUtils {
37
39
  * @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.
38
40
  */
39
41
  static resetTime(value: Moment | string, timezone?: string, keepLocalTime?: boolean): Moment | undefined;
40
- static markNoTime(value: Moment): Moment | undefined;
42
+ static markNoTime(value: Moment | undefined): Moment | undefined;
41
43
  static markTime(value: Moment): Moment | undefined;
42
44
  static isNoTime(value: Moment): boolean;
43
45
  /**
@@ -53,9 +55,31 @@ export declare class DateUtils {
53
55
  seconds?: boolean;
54
56
  } | any): string;
55
57
  }
58
+ /**
59
+ * Converts the given value to an ISO date string representation.
60
+ *
61
+ * @param {any} value - The value to be transformed into an ISO date string. This can be a date, a string, or other compatible formats.
62
+ * @return {string | undefined} Returns the ISO date string if the conversion is successful; otherwise, returns undefined.
63
+ */
56
64
  export declare function toDateISOString(value: any): string | undefined;
57
- export declare function fromDateISOString(value: any): Moment | undefined;
58
- export declare function fromUnixTimestamp(timeInSec: number): momentImported.Moment;
59
- export declare function fromUnixMsTimestamp(timeInMs: number): momentImported.Moment;
65
+ /**
66
+ * Converts a given value to a Moment object if possible.
67
+ * If the given value is already a Moment object, it will simply return it.
68
+ * The method handles strings in ISO date formats, UNIX timestamps, and performs validation based on provided options.
69
+ *
70
+ * @param {any} value - The value to be converted to a Moment object. This can be a string representing a date, a UNIX timestamp, or a Moment object.
71
+ * @param {Object} [opts] - Optional parameters for controlling the method's behavior.
72
+ * @param {boolean} [opts.undefinedIfInvalid=true] - Determines if the method should return undefined for invalid dates. If set to false, an invalid Moment object will be returned instead.
73
+ * @param {boolean} [opts.strict=false] - Controls whether strict validation is performed. Strict mode enforces stricter date parsing rules.
74
+ * @param {boolean} [opts.requiredTime=false] - Allow to parse a date without any time
75
+ * @return {Moment | undefined} A Moment object if the value is successfully converted, or undefined if the conversion is not possible and undefinedIfInvalid is true.
76
+ */
77
+ export declare function fromDateISOString(value: any, opts?: {
78
+ undefinedIfInvalid?: boolean;
79
+ strict?: boolean;
80
+ requiredTime?: boolean;
81
+ }): Moment | undefined;
82
+ export declare function fromUnixTimestamp(timeInSec: MomentInput): momentImported.Moment;
83
+ export declare function fromUnixMsTimestamp(timeInMs: MomentInput): momentImported.Moment;
60
84
  export declare function toDuration(value: number, unit?: unitOfTime.DurationConstructor): Duration | undefined;
61
85
  export {};
@@ -17,7 +17,7 @@ export interface InputElement extends FocusableElement {
17
17
  }
18
18
  export declare function isInputElement(object: any): object is InputElement;
19
19
  export declare function asInputElement<T = any>(object: ElementRef<T>): InputElement | undefined;
20
- export declare function tabindexComparator(a: InputElement, b: InputElement): 1 | 0 | -1;
20
+ export declare function tabindexComparator(a: InputElement, b: InputElement): 0 | 1 | -1;
21
21
  export interface CanGainFocusOptions {
22
22
  minTabindex?: number;
23
23
  maxTabindex?: number;
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-sumaris-components",
3
3
  "short_name": "ngx-sumaris-components",
4
4
  "manifest_version": 1,
5
- "version": "18.22.23",
5
+ "version": "18.22.25",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{