@fctc/interface-logic 4.1.9 → 4.1.10
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/dist/utils.js +32 -4
- package/dist/utils.mjs +32 -4
- package/package.json +90 -90
package/dist/utils.js
CHANGED
|
@@ -2638,10 +2638,38 @@ var stringToColor = (name, id) => {
|
|
|
2638
2638
|
const r = hash >> 16 & 255;
|
|
2639
2639
|
const g = hash >> 8 & 255;
|
|
2640
2640
|
const b = hash & 255;
|
|
2641
|
-
const
|
|
2642
|
-
const
|
|
2643
|
-
const
|
|
2644
|
-
|
|
2641
|
+
const rNorm = r / 255;
|
|
2642
|
+
const gNorm = g / 255;
|
|
2643
|
+
const bNorm = b / 255;
|
|
2644
|
+
const max = Math.max(rNorm, gNorm, bNorm);
|
|
2645
|
+
const min = Math.min(rNorm, gNorm, bNorm);
|
|
2646
|
+
const delta = max - min;
|
|
2647
|
+
let h = 0;
|
|
2648
|
+
if (delta !== 0) {
|
|
2649
|
+
if (max === rNorm) h = (gNorm - bNorm) / delta % 6;
|
|
2650
|
+
else if (max === gNorm) h = (bNorm - rNorm) / delta + 2;
|
|
2651
|
+
else h = (rNorm - gNorm) / delta + 4;
|
|
2652
|
+
}
|
|
2653
|
+
h = Math.round(h * 60);
|
|
2654
|
+
if (h < 0) h += 360;
|
|
2655
|
+
let l = (max + min) / 2;
|
|
2656
|
+
let s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
|
|
2657
|
+
s = Math.min(1, s * 1.8);
|
|
2658
|
+
l = Math.min(0.75, l * 1.05);
|
|
2659
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
2660
|
+
const x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
2661
|
+
const m = l - c / 2;
|
|
2662
|
+
let r2 = 0, g2 = 0, b2 = 0;
|
|
2663
|
+
if (0 <= h && h < 60) [r2, g2, b2] = [c, x, 0];
|
|
2664
|
+
else if (60 <= h && h < 120) [r2, g2, b2] = [x, c, 0];
|
|
2665
|
+
else if (120 <= h && h < 180) [r2, g2, b2] = [0, c, x];
|
|
2666
|
+
else if (180 <= h && h < 240) [r2, g2, b2] = [0, x, c];
|
|
2667
|
+
else if (240 <= h && h < 300) [r2, g2, b2] = [x, 0, c];
|
|
2668
|
+
else [r2, g2, b2] = [c, 0, x];
|
|
2669
|
+
const finalR = Math.round((r2 + m) * 255);
|
|
2670
|
+
const finalG = Math.round((g2 + m) * 255);
|
|
2671
|
+
const finalB = Math.round((b2 + m) * 255);
|
|
2672
|
+
return `#${finalR.toString(16).padStart(2, "0")}${finalG.toString(16).padStart(2, "0")}${finalB.toString(16).padStart(2, "0")}`;
|
|
2645
2673
|
};
|
|
2646
2674
|
var getFieldsOnChange = (fields) => {
|
|
2647
2675
|
const result = [];
|
package/dist/utils.mjs
CHANGED
|
@@ -2571,10 +2571,38 @@ var stringToColor = (name, id) => {
|
|
|
2571
2571
|
const r = hash >> 16 & 255;
|
|
2572
2572
|
const g = hash >> 8 & 255;
|
|
2573
2573
|
const b = hash & 255;
|
|
2574
|
-
const
|
|
2575
|
-
const
|
|
2576
|
-
const
|
|
2577
|
-
|
|
2574
|
+
const rNorm = r / 255;
|
|
2575
|
+
const gNorm = g / 255;
|
|
2576
|
+
const bNorm = b / 255;
|
|
2577
|
+
const max = Math.max(rNorm, gNorm, bNorm);
|
|
2578
|
+
const min = Math.min(rNorm, gNorm, bNorm);
|
|
2579
|
+
const delta = max - min;
|
|
2580
|
+
let h = 0;
|
|
2581
|
+
if (delta !== 0) {
|
|
2582
|
+
if (max === rNorm) h = (gNorm - bNorm) / delta % 6;
|
|
2583
|
+
else if (max === gNorm) h = (bNorm - rNorm) / delta + 2;
|
|
2584
|
+
else h = (rNorm - gNorm) / delta + 4;
|
|
2585
|
+
}
|
|
2586
|
+
h = Math.round(h * 60);
|
|
2587
|
+
if (h < 0) h += 360;
|
|
2588
|
+
let l = (max + min) / 2;
|
|
2589
|
+
let s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
|
|
2590
|
+
s = Math.min(1, s * 1.8);
|
|
2591
|
+
l = Math.min(0.75, l * 1.05);
|
|
2592
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
2593
|
+
const x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
2594
|
+
const m = l - c / 2;
|
|
2595
|
+
let r2 = 0, g2 = 0, b2 = 0;
|
|
2596
|
+
if (0 <= h && h < 60) [r2, g2, b2] = [c, x, 0];
|
|
2597
|
+
else if (60 <= h && h < 120) [r2, g2, b2] = [x, c, 0];
|
|
2598
|
+
else if (120 <= h && h < 180) [r2, g2, b2] = [0, c, x];
|
|
2599
|
+
else if (180 <= h && h < 240) [r2, g2, b2] = [0, x, c];
|
|
2600
|
+
else if (240 <= h && h < 300) [r2, g2, b2] = [x, 0, c];
|
|
2601
|
+
else [r2, g2, b2] = [c, 0, x];
|
|
2602
|
+
const finalR = Math.round((r2 + m) * 255);
|
|
2603
|
+
const finalG = Math.round((g2 + m) * 255);
|
|
2604
|
+
const finalB = Math.round((b2 + m) * 255);
|
|
2605
|
+
return `#${finalR.toString(16).padStart(2, "0")}${finalG.toString(16).padStart(2, "0")}${finalB.toString(16).padStart(2, "0")}`;
|
|
2578
2606
|
};
|
|
2579
2607
|
var getFieldsOnChange = (fields) => {
|
|
2580
2608
|
const result = [];
|
package/package.json
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@fctc/interface-logic",
|
|
3
|
-
"version": "4.1.
|
|
4
|
-
"types": "dist/index.d.ts",
|
|
5
|
-
"main": "dist/index.cjs",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/index.mjs",
|
|
11
|
-
"require": "./dist/index.cjs"
|
|
12
|
-
},
|
|
13
|
-
"./configs": {
|
|
14
|
-
"types": "./dist/configs.d.ts",
|
|
15
|
-
"import": "./dist/configs.mjs",
|
|
16
|
-
"require": "./dist/configs.cjs"
|
|
17
|
-
},
|
|
18
|
-
"./constants": {
|
|
19
|
-
"types": "./dist/constants.d.ts",
|
|
20
|
-
"import": "./dist/constants.mjs",
|
|
21
|
-
"require": "./dist/constants.cjs"
|
|
22
|
-
},
|
|
23
|
-
"./environment": {
|
|
24
|
-
"types": "./dist/environment.d.ts",
|
|
25
|
-
"import": "./dist/environment.mjs",
|
|
26
|
-
"require": "./dist/environment.cjs"
|
|
27
|
-
},
|
|
28
|
-
"./hooks": {
|
|
29
|
-
"types": "./dist/hooks.d.ts",
|
|
30
|
-
"import": "./dist/hooks.mjs",
|
|
31
|
-
"require": "./dist/hooks.cjs"
|
|
32
|
-
},
|
|
33
|
-
"./provider": {
|
|
34
|
-
"types": "./dist/provider.d.ts",
|
|
35
|
-
"import": "./dist/provider.mjs",
|
|
36
|
-
"require": "./dist/provider.cjs"
|
|
37
|
-
},
|
|
38
|
-
"./services": {
|
|
39
|
-
"types": "./dist/services.d.ts",
|
|
40
|
-
"import": "./dist/services.mjs",
|
|
41
|
-
"require": "./dist/services.cjs"
|
|
42
|
-
},
|
|
43
|
-
"./store": {
|
|
44
|
-
"types": "./dist/store.d.ts",
|
|
45
|
-
"import": "./dist/store.mjs",
|
|
46
|
-
"require": "./dist/store.cjs"
|
|
47
|
-
},
|
|
48
|
-
"./utils": {
|
|
49
|
-
"types": "./dist/utils.d.ts",
|
|
50
|
-
"import": "./dist/utils.mjs",
|
|
51
|
-
"require": "./dist/utils.cjs"
|
|
52
|
-
},
|
|
53
|
-
"./types": {
|
|
54
|
-
"types": "./dist/types.d.ts",
|
|
55
|
-
"import": "./dist/types.mjs",
|
|
56
|
-
"require": "./dist/types.cjs"
|
|
57
|
-
},
|
|
58
|
-
"./models": {
|
|
59
|
-
"types": "./dist/models.d.ts",
|
|
60
|
-
"import": "./dist/models.mjs",
|
|
61
|
-
"require": "./dist/models.cjs"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"files": [
|
|
65
|
-
"dist"
|
|
66
|
-
],
|
|
67
|
-
"scripts": {
|
|
68
|
-
"build": "tsup",
|
|
69
|
-
"test": "jest"
|
|
70
|
-
},
|
|
71
|
-
"peerDependencies": {
|
|
72
|
-
"react": "18.0.0",
|
|
73
|
-
"@tanstack/react-query": "^5.83.0"
|
|
74
|
-
},
|
|
75
|
-
"dependencies": {
|
|
76
|
-
"@reduxjs/toolkit": "^2.8.2",
|
|
77
|
-
"@tanstack/react-query": "^5.83.0",
|
|
78
|
-
"axios": "^1.11.0",
|
|
79
|
-
"moment": "^2.30.1",
|
|
80
|
-
"react-redux": "^9.2.0"
|
|
81
|
-
},
|
|
82
|
-
"devDependencies": {
|
|
83
|
-
"@types/react": "^18.3.1",
|
|
84
|
-
"react": "18.0.0",
|
|
85
|
-
"jest": "^29.7.0",
|
|
86
|
-
"tsup": "^8.0.0",
|
|
87
|
-
"typescript": "^5.8.2"
|
|
88
|
-
},
|
|
89
|
-
"packageManager": "yarn@1.22.0"
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@fctc/interface-logic",
|
|
3
|
+
"version": "4.1.10",
|
|
4
|
+
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./configs": {
|
|
14
|
+
"types": "./dist/configs.d.ts",
|
|
15
|
+
"import": "./dist/configs.mjs",
|
|
16
|
+
"require": "./dist/configs.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./constants": {
|
|
19
|
+
"types": "./dist/constants.d.ts",
|
|
20
|
+
"import": "./dist/constants.mjs",
|
|
21
|
+
"require": "./dist/constants.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./environment": {
|
|
24
|
+
"types": "./dist/environment.d.ts",
|
|
25
|
+
"import": "./dist/environment.mjs",
|
|
26
|
+
"require": "./dist/environment.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./hooks": {
|
|
29
|
+
"types": "./dist/hooks.d.ts",
|
|
30
|
+
"import": "./dist/hooks.mjs",
|
|
31
|
+
"require": "./dist/hooks.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./provider": {
|
|
34
|
+
"types": "./dist/provider.d.ts",
|
|
35
|
+
"import": "./dist/provider.mjs",
|
|
36
|
+
"require": "./dist/provider.cjs"
|
|
37
|
+
},
|
|
38
|
+
"./services": {
|
|
39
|
+
"types": "./dist/services.d.ts",
|
|
40
|
+
"import": "./dist/services.mjs",
|
|
41
|
+
"require": "./dist/services.cjs"
|
|
42
|
+
},
|
|
43
|
+
"./store": {
|
|
44
|
+
"types": "./dist/store.d.ts",
|
|
45
|
+
"import": "./dist/store.mjs",
|
|
46
|
+
"require": "./dist/store.cjs"
|
|
47
|
+
},
|
|
48
|
+
"./utils": {
|
|
49
|
+
"types": "./dist/utils.d.ts",
|
|
50
|
+
"import": "./dist/utils.mjs",
|
|
51
|
+
"require": "./dist/utils.cjs"
|
|
52
|
+
},
|
|
53
|
+
"./types": {
|
|
54
|
+
"types": "./dist/types.d.ts",
|
|
55
|
+
"import": "./dist/types.mjs",
|
|
56
|
+
"require": "./dist/types.cjs"
|
|
57
|
+
},
|
|
58
|
+
"./models": {
|
|
59
|
+
"types": "./dist/models.d.ts",
|
|
60
|
+
"import": "./dist/models.mjs",
|
|
61
|
+
"require": "./dist/models.cjs"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"files": [
|
|
65
|
+
"dist"
|
|
66
|
+
],
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsup",
|
|
69
|
+
"test": "jest"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"react": "18.0.0",
|
|
73
|
+
"@tanstack/react-query": "^5.83.0"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@reduxjs/toolkit": "^2.8.2",
|
|
77
|
+
"@tanstack/react-query": "^5.83.0",
|
|
78
|
+
"axios": "^1.11.0",
|
|
79
|
+
"moment": "^2.30.1",
|
|
80
|
+
"react-redux": "^9.2.0"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@types/react": "^18.3.1",
|
|
84
|
+
"react": "18.0.0",
|
|
85
|
+
"jest": "^29.7.0",
|
|
86
|
+
"tsup": "^8.0.0",
|
|
87
|
+
"typescript": "^5.8.2"
|
|
88
|
+
},
|
|
89
|
+
"packageManager": "yarn@1.22.0"
|
|
90
|
+
}
|