@etsoo/shared 1.1.77 → 1.1.78
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/lib/cjs/DataTypes.d.ts +4 -4
- package/lib/cjs/types/DelayedExecutorType.d.ts +1 -1
- package/lib/cjs/types/EColor.js +13 -13
- package/lib/cjs/types/EHistory.d.ts +2 -2
- package/lib/cjs/types/EHistory.js +14 -14
- package/lib/cjs/types/EventClass.d.ts +1 -1
- package/lib/cjs/types/EventClass.js +11 -11
- package/lib/cjs/types/FormData.d.ts +1 -1
- package/lib/mjs/DataTypes.d.ts +4 -4
- package/lib/mjs/types/DelayedExecutorType.d.ts +1 -1
- package/lib/mjs/types/EColor.js +13 -13
- package/lib/mjs/types/EHistory.d.ts +2 -2
- package/lib/mjs/types/EHistory.js +14 -14
- package/lib/mjs/types/EventClass.d.ts +1 -1
- package/lib/mjs/types/EventClass.js +11 -11
- package/lib/mjs/types/FormData.d.ts +1 -1
- package/package.json +5 -5
package/lib/cjs/DataTypes.d.ts
CHANGED
|
@@ -371,20 +371,20 @@ export declare namespace DataTypes {
|
|
|
371
371
|
/**
|
|
372
372
|
* List item with number id type
|
|
373
373
|
*/
|
|
374
|
-
export
|
|
374
|
+
export type ListType = DataTypes.IdLabelItem<number>;
|
|
375
375
|
/**
|
|
376
376
|
* List item with string id type
|
|
377
377
|
*/
|
|
378
|
-
export
|
|
378
|
+
export type ListType1 = DataTypes.IdLabelItem<string>;
|
|
379
379
|
/**
|
|
380
380
|
* Id default type
|
|
381
381
|
*/
|
|
382
|
-
export
|
|
382
|
+
export type IdDefaultType<T extends object> = T extends {
|
|
383
383
|
id: number | string;
|
|
384
384
|
} ? DataTypes.Keys<T> & 'id' : DataTypes.Keys<T>;
|
|
385
385
|
/**
|
|
386
386
|
* Label default type
|
|
387
387
|
*/
|
|
388
|
-
export
|
|
388
|
+
export type LabelDefaultType<T extends object> = T extends {
|
|
389
389
|
label: string;
|
|
390
390
|
} ? DataTypes.Keys<T, string> & 'label' : DataTypes.Keys<T, string>;
|
package/lib/cjs/types/EColor.js
CHANGED
|
@@ -5,19 +5,6 @@ exports.EColor = void 0;
|
|
|
5
5
|
* Etsoo implmented Color
|
|
6
6
|
*/
|
|
7
7
|
class EColor {
|
|
8
|
-
/**
|
|
9
|
-
* Constructor
|
|
10
|
-
* @param r Reg
|
|
11
|
-
* @param g Green
|
|
12
|
-
* @param b Blue
|
|
13
|
-
* @param alpha Alpha
|
|
14
|
-
*/
|
|
15
|
-
constructor(r, g, b, alpha) {
|
|
16
|
-
this.r = r;
|
|
17
|
-
this.g = g;
|
|
18
|
-
this.b = b;
|
|
19
|
-
this.alpha = alpha;
|
|
20
|
-
}
|
|
21
8
|
/**
|
|
22
9
|
* Adjust value
|
|
23
10
|
* @param value Current value
|
|
@@ -100,6 +87,19 @@ class EColor {
|
|
|
100
87
|
}
|
|
101
88
|
return undefined;
|
|
102
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Constructor
|
|
92
|
+
* @param r Reg
|
|
93
|
+
* @param g Green
|
|
94
|
+
* @param b Blue
|
|
95
|
+
* @param alpha Alpha
|
|
96
|
+
*/
|
|
97
|
+
constructor(r, g, b, alpha) {
|
|
98
|
+
this.r = r;
|
|
99
|
+
this.g = g;
|
|
100
|
+
this.b = b;
|
|
101
|
+
this.alpha = alpha;
|
|
102
|
+
}
|
|
103
103
|
/**
|
|
104
104
|
* Clone color with adjustments
|
|
105
105
|
* @param adjustR Adjust R value
|
|
@@ -11,13 +11,13 @@ interface EHistoryNavigateEventData extends EHistoryEventData {
|
|
|
11
11
|
*/
|
|
12
12
|
delta: number;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type EHistoryEventDef = {
|
|
15
15
|
clear: EHistoryEventData;
|
|
16
16
|
navigate: EHistoryNavigateEventData;
|
|
17
17
|
push: EHistoryEventData;
|
|
18
18
|
replace: EHistoryEventData;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type EHistoryEventType = Exclude<keyof EHistoryEventDef, 'navigate'>;
|
|
21
21
|
/**
|
|
22
22
|
* ETSOO Extended history event
|
|
23
23
|
*/
|
|
@@ -21,20 +21,6 @@ exports.EHistoryNavigateEvent = EHistoryNavigateEvent;
|
|
|
21
21
|
* ETSOO Extended abstract history class
|
|
22
22
|
*/
|
|
23
23
|
class EHistory extends EventClass_1.EventClass {
|
|
24
|
-
/**
|
|
25
|
-
* Constructor
|
|
26
|
-
* @param maxDepth Max depth of the history
|
|
27
|
-
*/
|
|
28
|
-
constructor(maxDepth = 20) {
|
|
29
|
-
super();
|
|
30
|
-
this.maxDepth = maxDepth;
|
|
31
|
-
// Index
|
|
32
|
-
this._index = -1;
|
|
33
|
-
/**
|
|
34
|
-
* States
|
|
35
|
-
*/
|
|
36
|
-
this.states = [];
|
|
37
|
-
}
|
|
38
24
|
/**
|
|
39
25
|
* States length
|
|
40
26
|
*/
|
|
@@ -55,6 +41,20 @@ class EHistory extends EventClass_1.EventClass {
|
|
|
55
41
|
return undefined;
|
|
56
42
|
return this.states[this._index];
|
|
57
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Constructor
|
|
46
|
+
* @param maxDepth Max depth of the history
|
|
47
|
+
*/
|
|
48
|
+
constructor(maxDepth = 20) {
|
|
49
|
+
super();
|
|
50
|
+
this.maxDepth = maxDepth;
|
|
51
|
+
// Index
|
|
52
|
+
this._index = -1;
|
|
53
|
+
/**
|
|
54
|
+
* States
|
|
55
|
+
*/
|
|
56
|
+
this.states = [];
|
|
57
|
+
}
|
|
58
58
|
/**
|
|
59
59
|
* Back to the previous state
|
|
60
60
|
*/
|
|
@@ -7,17 +7,6 @@ exports.EventClass = exports.EventBase = void 0;
|
|
|
7
7
|
* D for data
|
|
8
8
|
*/
|
|
9
9
|
class EventBase {
|
|
10
|
-
/**
|
|
11
|
-
* Constructor
|
|
12
|
-
* @param type Type
|
|
13
|
-
*/
|
|
14
|
-
constructor(target, type, data) {
|
|
15
|
-
this.target = target;
|
|
16
|
-
this.type = type;
|
|
17
|
-
this.data = data;
|
|
18
|
-
this._propagationStopped = false;
|
|
19
|
-
this._timeStamp = Date.now();
|
|
20
|
-
}
|
|
21
10
|
/**
|
|
22
11
|
* stopImmediatePropagation called
|
|
23
12
|
*/
|
|
@@ -30,6 +19,17 @@ class EventBase {
|
|
|
30
19
|
get timeStamp() {
|
|
31
20
|
return this._timeStamp;
|
|
32
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Constructor
|
|
24
|
+
* @param type Type
|
|
25
|
+
*/
|
|
26
|
+
constructor(target, type, data) {
|
|
27
|
+
this.target = target;
|
|
28
|
+
this.type = type;
|
|
29
|
+
this.data = data;
|
|
30
|
+
this._propagationStopped = false;
|
|
31
|
+
this._timeStamp = Date.now();
|
|
32
|
+
}
|
|
33
33
|
/**
|
|
34
34
|
* Prevent all other listeners from being called
|
|
35
35
|
*/
|
|
@@ -22,7 +22,7 @@ export interface IFile {
|
|
|
22
22
|
/**
|
|
23
23
|
* FormDataFieldValue like type
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type FormDataFieldValue = string | IFile;
|
|
26
26
|
/**
|
|
27
27
|
* FormData like interface
|
|
28
28
|
* https://developer.mozilla.org/en-US/docs/Web/API/FormData
|
package/lib/mjs/DataTypes.d.ts
CHANGED
|
@@ -371,20 +371,20 @@ export declare namespace DataTypes {
|
|
|
371
371
|
/**
|
|
372
372
|
* List item with number id type
|
|
373
373
|
*/
|
|
374
|
-
export
|
|
374
|
+
export type ListType = DataTypes.IdLabelItem<number>;
|
|
375
375
|
/**
|
|
376
376
|
* List item with string id type
|
|
377
377
|
*/
|
|
378
|
-
export
|
|
378
|
+
export type ListType1 = DataTypes.IdLabelItem<string>;
|
|
379
379
|
/**
|
|
380
380
|
* Id default type
|
|
381
381
|
*/
|
|
382
|
-
export
|
|
382
|
+
export type IdDefaultType<T extends object> = T extends {
|
|
383
383
|
id: number | string;
|
|
384
384
|
} ? DataTypes.Keys<T> & 'id' : DataTypes.Keys<T>;
|
|
385
385
|
/**
|
|
386
386
|
* Label default type
|
|
387
387
|
*/
|
|
388
|
-
export
|
|
388
|
+
export type LabelDefaultType<T extends object> = T extends {
|
|
389
389
|
label: string;
|
|
390
390
|
} ? DataTypes.Keys<T, string> & 'label' : DataTypes.Keys<T, string>;
|
package/lib/mjs/types/EColor.js
CHANGED
|
@@ -2,19 +2,6 @@
|
|
|
2
2
|
* Etsoo implmented Color
|
|
3
3
|
*/
|
|
4
4
|
export class EColor {
|
|
5
|
-
/**
|
|
6
|
-
* Constructor
|
|
7
|
-
* @param r Reg
|
|
8
|
-
* @param g Green
|
|
9
|
-
* @param b Blue
|
|
10
|
-
* @param alpha Alpha
|
|
11
|
-
*/
|
|
12
|
-
constructor(r, g, b, alpha) {
|
|
13
|
-
this.r = r;
|
|
14
|
-
this.g = g;
|
|
15
|
-
this.b = b;
|
|
16
|
-
this.alpha = alpha;
|
|
17
|
-
}
|
|
18
5
|
/**
|
|
19
6
|
* Adjust value
|
|
20
7
|
* @param value Current value
|
|
@@ -97,6 +84,19 @@ export class EColor {
|
|
|
97
84
|
}
|
|
98
85
|
return undefined;
|
|
99
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Constructor
|
|
89
|
+
* @param r Reg
|
|
90
|
+
* @param g Green
|
|
91
|
+
* @param b Blue
|
|
92
|
+
* @param alpha Alpha
|
|
93
|
+
*/
|
|
94
|
+
constructor(r, g, b, alpha) {
|
|
95
|
+
this.r = r;
|
|
96
|
+
this.g = g;
|
|
97
|
+
this.b = b;
|
|
98
|
+
this.alpha = alpha;
|
|
99
|
+
}
|
|
100
100
|
/**
|
|
101
101
|
* Clone color with adjustments
|
|
102
102
|
* @param adjustR Adjust R value
|
|
@@ -11,13 +11,13 @@ interface EHistoryNavigateEventData extends EHistoryEventData {
|
|
|
11
11
|
*/
|
|
12
12
|
delta: number;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type EHistoryEventDef = {
|
|
15
15
|
clear: EHistoryEventData;
|
|
16
16
|
navigate: EHistoryNavigateEventData;
|
|
17
17
|
push: EHistoryEventData;
|
|
18
18
|
replace: EHistoryEventData;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type EHistoryEventType = Exclude<keyof EHistoryEventDef, 'navigate'>;
|
|
21
21
|
/**
|
|
22
22
|
* ETSOO Extended history event
|
|
23
23
|
*/
|
|
@@ -16,20 +16,6 @@ export class EHistoryNavigateEvent extends EventBase {
|
|
|
16
16
|
* ETSOO Extended abstract history class
|
|
17
17
|
*/
|
|
18
18
|
export class EHistory extends EventClass {
|
|
19
|
-
/**
|
|
20
|
-
* Constructor
|
|
21
|
-
* @param maxDepth Max depth of the history
|
|
22
|
-
*/
|
|
23
|
-
constructor(maxDepth = 20) {
|
|
24
|
-
super();
|
|
25
|
-
this.maxDepth = maxDepth;
|
|
26
|
-
// Index
|
|
27
|
-
this._index = -1;
|
|
28
|
-
/**
|
|
29
|
-
* States
|
|
30
|
-
*/
|
|
31
|
-
this.states = [];
|
|
32
|
-
}
|
|
33
19
|
/**
|
|
34
20
|
* States length
|
|
35
21
|
*/
|
|
@@ -50,6 +36,20 @@ export class EHistory extends EventClass {
|
|
|
50
36
|
return undefined;
|
|
51
37
|
return this.states[this._index];
|
|
52
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Constructor
|
|
41
|
+
* @param maxDepth Max depth of the history
|
|
42
|
+
*/
|
|
43
|
+
constructor(maxDepth = 20) {
|
|
44
|
+
super();
|
|
45
|
+
this.maxDepth = maxDepth;
|
|
46
|
+
// Index
|
|
47
|
+
this._index = -1;
|
|
48
|
+
/**
|
|
49
|
+
* States
|
|
50
|
+
*/
|
|
51
|
+
this.states = [];
|
|
52
|
+
}
|
|
53
53
|
/**
|
|
54
54
|
* Back to the previous state
|
|
55
55
|
*/
|
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
* D for data
|
|
5
5
|
*/
|
|
6
6
|
export class EventBase {
|
|
7
|
-
/**
|
|
8
|
-
* Constructor
|
|
9
|
-
* @param type Type
|
|
10
|
-
*/
|
|
11
|
-
constructor(target, type, data) {
|
|
12
|
-
this.target = target;
|
|
13
|
-
this.type = type;
|
|
14
|
-
this.data = data;
|
|
15
|
-
this._propagationStopped = false;
|
|
16
|
-
this._timeStamp = Date.now();
|
|
17
|
-
}
|
|
18
7
|
/**
|
|
19
8
|
* stopImmediatePropagation called
|
|
20
9
|
*/
|
|
@@ -27,6 +16,17 @@ export class EventBase {
|
|
|
27
16
|
get timeStamp() {
|
|
28
17
|
return this._timeStamp;
|
|
29
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Constructor
|
|
21
|
+
* @param type Type
|
|
22
|
+
*/
|
|
23
|
+
constructor(target, type, data) {
|
|
24
|
+
this.target = target;
|
|
25
|
+
this.type = type;
|
|
26
|
+
this.data = data;
|
|
27
|
+
this._propagationStopped = false;
|
|
28
|
+
this._timeStamp = Date.now();
|
|
29
|
+
}
|
|
30
30
|
/**
|
|
31
31
|
* Prevent all other listeners from being called
|
|
32
32
|
*/
|
|
@@ -22,7 +22,7 @@ export interface IFile {
|
|
|
22
22
|
/**
|
|
23
23
|
* FormDataFieldValue like type
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type FormDataFieldValue = string | IFile;
|
|
26
26
|
/**
|
|
27
27
|
* FormData like interface
|
|
28
28
|
* https://developer.mozilla.org/en-US/docs/Web/API/FormData
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/shared",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.78",
|
|
4
4
|
"description": "TypeScript shared utilities and functions",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/ETSOO/Shared#readme",
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/jest": "^29.2.
|
|
57
|
+
"@types/jest": "^29.2.3",
|
|
58
58
|
"@types/lodash.isequal": "^4.5.6",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
60
|
-
"@typescript-eslint/parser": "^5.
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
|
60
|
+
"@typescript-eslint/parser": "^5.43.0",
|
|
61
61
|
"eslint": "^8.27.0",
|
|
62
62
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
63
63
|
"eslint-plugin-import": "^2.26.0",
|
|
64
64
|
"jest": "^29.3.1",
|
|
65
65
|
"jest-environment-jsdom": "^29.3.1",
|
|
66
66
|
"ts-jest": "^29.0.3",
|
|
67
|
-
"typescript": "^4.
|
|
67
|
+
"typescript": "^4.9.3"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"lodash.isequal": "^4.5.0"
|