@sumaris-net/ngx-components 18.10.29 → 18.11.0
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/esm2022/src/app/core/services/model/entity.model.mjs +65 -1
- package/esm2022/src/app/shared/dates.mjs +2 -2
- package/esm2022/src/app/shared/inputs.mjs +14 -10
- package/fesm2022/sumaris-net.ngx-components.mjs +76 -9
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/model/entity.model.d.ts +23 -0
- package/src/app/shared/dates.d.ts +1 -1
- package/src/app/shared/inputs.d.ts +3 -2
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -107,4 +107,27 @@ export declare abstract class EntityUtils {
|
|
|
107
107
|
static arrayDistinctFilterFn<E extends IEntity<any, any>>(item: E, index: number, values: E[]): boolean;
|
|
108
108
|
static findById<E extends IEntity<any, ID> = IEntity<any, any>, ID = number>(items: E[], id: ID): E | undefined;
|
|
109
109
|
static fromObject<E extends IEntity<any, any>>(source: any, dataType: new () => E): E;
|
|
110
|
+
/**
|
|
111
|
+
* Recursively converts any object, entity, or array to a plain JavaScript object.
|
|
112
|
+
* This method handles entities by calling their asObject() method, processes arrays recursively,
|
|
113
|
+
* and provides protection against circular references.
|
|
114
|
+
*
|
|
115
|
+
* @param {any} source - The source object, entity, array, or primitive value to convert
|
|
116
|
+
* @param {any} [opts] - Optional configuration object passed to entity asObject() methods
|
|
117
|
+
* @param {WeakSet} [visited=new WeakSet()] - Internal parameter for circular reference detection
|
|
118
|
+
* @returns {any} A plain JavaScript object representation of the source
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* // Convert a simple entity
|
|
122
|
+
* const plainObject = EntityUtils.asObject(myEntity);
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* // Convert an array of entities
|
|
126
|
+
* const plainArray = EntityUtils.asObject([entity1, entity2]);
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* // Convert with options
|
|
130
|
+
* const result = EntityUtils.asObject(myEntity, { minify: true });
|
|
131
|
+
*/
|
|
132
|
+
static asObject(source: any, opts?: any, visited?: WeakSet<object>): any;
|
|
110
133
|
}
|
|
@@ -57,5 +57,5 @@ export declare function toDateISOString(value: any): string | undefined;
|
|
|
57
57
|
export declare function fromDateISOString(value: any): Moment | undefined;
|
|
58
58
|
export declare function fromUnixTimestamp(timeInSec: number): momentImported.Moment;
|
|
59
59
|
export declare function fromUnixMsTimestamp(timeInMs: number): momentImported.Moment;
|
|
60
|
-
export declare function toDuration(value: number, unit?: unitOfTime.DurationConstructor): Duration;
|
|
60
|
+
export declare function toDuration(value: number, unit?: unitOfTime.DurationConstructor): Duration | undefined;
|
|
61
61
|
export {};
|
|
@@ -17,11 +17,12 @@ 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):
|
|
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;
|
|
24
|
-
|
|
24
|
+
isEmpty?: boolean;
|
|
25
|
+
isNotEmpty?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export interface GetFocusableInputOptions extends CanGainFocusOptions {
|
|
27
28
|
sortByTabIndex?: boolean;
|
package/src/assets/manifest.json
CHANGED
|
@@ -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.
|
|
5
|
+
"version": "18.11.0",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|