yxuse 1.0.7 → 1.0.9
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/README.md +103 -2
- package/lib/theme.cjs.js +1 -1
- package/lib/theme.es.js +108 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,112 @@
|
|
|
2
2
|
* @Author: WangXin
|
|
3
3
|
* @Date: 2023-08-16 14:24:55
|
|
4
4
|
* @LastEditors: WangXin
|
|
5
|
-
* @LastEditTime: 2023-08-
|
|
5
|
+
* @LastEditTime: 2023-08-18 11:28:26
|
|
6
6
|
* @FilePath: \yxUse\README.md
|
|
7
7
|
* @Description:
|
|
8
8
|
*
|
|
9
9
|
* Copyright (c) 2023 by YuXing, All Rights Reserved.
|
|
10
10
|
-->
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
```
|
|
13
|
+
green: {
|
|
14
|
+
common: {
|
|
15
|
+
//公用颜色
|
|
16
|
+
color: {
|
|
17
|
+
//主题色
|
|
18
|
+
"main-100": "rgba(80, 165, 122, 1)",
|
|
19
|
+
"main-50": "rgba(80, 165, 122, 0.5)",
|
|
20
|
+
"main-25": "rgba(80, 165, 122, 0.25)",
|
|
21
|
+
"main-15": "rgba(80, 165, 122, 0.15)",
|
|
22
|
+
"main-5": "rgba(80, 165, 122, 0.05)",
|
|
23
|
+
|
|
24
|
+
//故障色
|
|
25
|
+
"error-100": "rgba(255, 152, 146, 1)",
|
|
26
|
+
"error-50": "rgba(255, 152, 146, 0.5)",
|
|
27
|
+
"error-25": "rgba(255, 152, 146, 0.25)",
|
|
28
|
+
"error-15": "rgba(255, 152, 146, 0.15)",
|
|
29
|
+
"error-5": "rgba(255, 152, 146, 0.05)",
|
|
30
|
+
|
|
31
|
+
//预警色
|
|
32
|
+
"warning-100": "rgba(249, 162, 33, 1)",
|
|
33
|
+
"warning-50": "rgba(249, 162, 33, 0.5)",
|
|
34
|
+
"warning-25": "rgba(249, 162, 33, 0.25)",
|
|
35
|
+
"warning-15": "rgba(249, 162, 33, 0.15)",
|
|
36
|
+
"warning-5": "rgba(249, 162, 33, 0.05)",
|
|
37
|
+
|
|
38
|
+
//信息色
|
|
39
|
+
"info-100": "rgba(133, 233, 183, 1)",
|
|
40
|
+
"info-50": "rgba(133, 233, 183, 0.5)",
|
|
41
|
+
"info-25": "rgba(133, 233, 183, 0.25)",
|
|
42
|
+
"info-15": "rgba(133, 233, 183, 0.15)",
|
|
43
|
+
"info-5": "rgba(133, 233, 183, 0.05)",
|
|
44
|
+
|
|
45
|
+
//中性色
|
|
46
|
+
"neutral-100": "rgba(85, 221, 221, 1)",
|
|
47
|
+
"neutral-50": "rgba(85, 221, 221, 0.5)",
|
|
48
|
+
"neutral-25": "rgba(85, 221, 221, 0.25)",
|
|
49
|
+
"neutral-15": "rgba(85, 221, 221, 0.15)",
|
|
50
|
+
"neutral-5": "rgba(85, 221, 221, 0.05)"
|
|
51
|
+
},
|
|
52
|
+
//背景色类
|
|
53
|
+
background: {
|
|
54
|
+
"error-gradual": "linear-gradient(90deg, #FFCECB 0%, rgba(255,235,233,0.35) 100%)",
|
|
55
|
+
"warning-gradual": "linear-gradient(90deg, #FFE4BC 0%, rgba(255,250,233,0.35) 100%)",
|
|
56
|
+
"success-gradual": "linear-gradient(90deg, #D5ECBE 0%, rgba(234,255,233,0.35) 100%)"
|
|
57
|
+
},
|
|
58
|
+
//按钮类
|
|
59
|
+
button: {
|
|
60
|
+
background: "rgba(103, 186, 145, 0.10)",
|
|
61
|
+
"border-color": "rgba(80, 165, 122, 1)",
|
|
62
|
+
"text-color": "rgba(80, 165, 122, 1)",
|
|
63
|
+
"active-background-color": "rgba(80, 165, 122, 1)",
|
|
64
|
+
"active-border-color": "rgba(154, 209, 162, 1)",
|
|
65
|
+
"active-text-color": "#fff"
|
|
66
|
+
},
|
|
67
|
+
checkbox: {
|
|
68
|
+
background: "rgba(216, 233, 219, 1)",
|
|
69
|
+
"icon-color": "rgba(80, 165, 122, 0)",
|
|
70
|
+
"border-color": "rgba(154, 209, 162, 1)",
|
|
71
|
+
"checked-background": "rgba(216, 233, 219, 1)",
|
|
72
|
+
"checked-icon-color": "rgba(80, 165, 122, 1)",
|
|
73
|
+
"checked-border-color": "rgba(154, 209, 162, 1)"
|
|
74
|
+
},
|
|
75
|
+
//input
|
|
76
|
+
input: {
|
|
77
|
+
background: "rgba(237, 246, 239, 1)",
|
|
78
|
+
"border-color": "rgba(80, 165, 122, 1)",
|
|
79
|
+
color: "rgba(29, 75, 52, 1)",
|
|
80
|
+
"placeholder-color": "rgba(80, 165, 122, 1)",
|
|
81
|
+
"hover-background": "rgba(237, 246, 239, 0.30)",
|
|
82
|
+
"hover-border-color": "rgba(80, 165, 122, 1)",
|
|
83
|
+
"hover-color": "rgba(80, 165, 122, 1)",
|
|
84
|
+
"active-background": "rgba(237, 246, 239, 0.30)",
|
|
85
|
+
"active-border-color": "rgba(80, 165, 122, 1)",
|
|
86
|
+
"active-color": "rgba(80, 165, 122, 1)",
|
|
87
|
+
"disabled-background": "rgba(237, 246, 239, 1)",
|
|
88
|
+
"disabled-border-color": "rgba(237, 246, 239, 1)",
|
|
89
|
+
"disabled-color": "rgba(83, 83, 83, 1)"
|
|
90
|
+
},
|
|
91
|
+
// select
|
|
92
|
+
select: {
|
|
93
|
+
"dropdown-background": "rgba(237, 246, 239, 1)",
|
|
94
|
+
"dropdown-border-color": "rgba(80, 165, 122, 1)",
|
|
95
|
+
"dropdown-item-color": "rgba(80, 165, 122, 1)",
|
|
96
|
+
"dropdown-item-hover-background": "rgba(178, 220, 198, 1)",
|
|
97
|
+
"dropdown-item-hover-color": "rgba(29, 75, 52, 1)",
|
|
98
|
+
"dropdown-item-selected-background": "rgba(178, 220, 198, 1)",
|
|
99
|
+
"dropdown-item-selected-color": "rgba(29, 75, 52, 1)"
|
|
100
|
+
},
|
|
101
|
+
//布局类
|
|
102
|
+
layout: {},
|
|
103
|
+
//表格类
|
|
104
|
+
table: {},
|
|
105
|
+
//曲线类
|
|
106
|
+
chart: {},
|
|
107
|
+
//提示类
|
|
108
|
+
message: {}
|
|
109
|
+
},
|
|
110
|
+
cloud: {},
|
|
111
|
+
"station-control-center": {}
|
|
112
|
+
},
|
|
113
|
+
```
|
package/lib/theme.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={green:{common:{color:{"main-100":"rgba(80, 165, 122, 1)","main-50":"rgba(80, 165, 122, 0.5)","main-25":"rgba(80, 165, 122, 0.25)","main-15":"rgba(80, 165, 122, 0.15)","main-5":"rgba(80, 165, 122, 0.05)","error-100":"rgba(255, 152, 146, 1)","error-50":"rgba(255, 152, 146, 0.5)","error-25":"rgba(255, 152, 146, 0.25)","error-15":"rgba(255, 152, 146, 0.15)","error-5":"rgba(255, 152, 146, 0.05)","warning-100":"rgba(249, 162, 33, 1)","warning-50":"rgba(249, 162, 33, 0.5)","warning-25":"rgba(249, 162, 33, 0.25)","warning-15":"rgba(249, 162, 33, 0.15)","warning-5":"rgba(249, 162, 33, 0.05)","info-100":"rgba(133, 233, 183, 1)","info-50":"rgba(133, 233, 183, 0.5)","info-25":"rgba(133, 233, 183, 0.25)","info-15":"rgba(133, 233, 183, 0.15)","info-5":"rgba(133, 233, 183, 0.05)","neutral-100":"rgba(85, 221, 221, 1)","neutral-50":"rgba(85, 221, 221, 0.5)","neutral-25":"rgba(85, 221, 221, 0.25)","neutral-15":"rgba(85, 221, 221, 0.15)","neutral-5":"rgba(85, 221, 221, 0.05)"},background:{"error-gradual":"linear-gradient(90deg, #FFCECB 0%, rgba(255,235,233,0.35) 100%)","warning-gradual":"linear-gradient(90deg, #FFE4BC 0%, rgba(255,250,233,0.35) 100%)","success-gradual":"linear-gradient(90deg, #D5ECBE 0%, rgba(234,255,233,0.35) 100%)"},button:{background:"rgba(103, 186, 145, 0.10)","border-color":"rgba(80, 165, 122, 1)","text-color":"rgba(80, 165, 122, 1)","active-background-color":"rgba(80, 165, 122, 1)","active-border-color":"rgba(154, 209, 162, 1)","active-text-color":"#fff"},checkbox:{background:"rgba(216, 233, 219, 1)","icon-color":"rgba(80, 165, 122, 0)","border-color":"rgba(154, 209, 162, 1)","checked-background":"rgba(216, 233, 219, 1)","checked-icon-color":"rgba(80, 165, 122, 1)","checked-border-color":"rgba(154, 209, 162, 1)"},input:{background:"rgba(237, 246, 239, 1)","border-color":"rgba(80, 165, 122, 1)",color:"rgba(29, 75, 52, 1)","placeholder-color":"rgba(80, 165, 122, 1)","hover-background":"rgba(237, 246, 239, 0.30)","hover-border-color":"rgba(80, 165, 122, 1)","hover-color":"rgba(80, 165, 122, 1)","active-background":"rgba(237, 246, 239, 0.30)","active-border-color":"rgba(80, 165, 122, 1)","active-color":"rgba(80, 165, 122, 1)","disabled-background":"rgba(237, 246, 239, 1)","disabled-border-color":"rgba(237, 246, 239, 1)","disabled-color":"rgba(83, 83, 83, 1)"},select:{"dropdown-background":"rgba(237, 246, 239, 1)","dropdown-border-color":"rgba(80, 165, 122, 1)","dropdown-item-color":"rgba(80, 165, 122, 1)","dropdown-item-hover-background":"rgba(178, 220, 198, 1)","dropdown-item-hover-color":"rgba(29, 75, 52, 1)","dropdown-item-selected-background":"rgba(178, 220, 198, 1)","dropdown-item-selected-color":"rgba(29, 75, 52, 1)"},layout:{},table:{},chart:{},message:{}},cloud:{},"station-control-center":{}},blue:{common:{"--test1":"#fff","--test2":"#ccc"},cloud:{},"station-control-center":{}}},t=()=>{const r=g();localStorage.getItem("yxTheme")||localStorage.setItem("yxTheme",r);const o=document.documentElement,e=n[r].common;Object.keys(e).forEach(a=>{Object.keys(e[a]).forEach(c=>{const b=`--${a}-${c}`;o.style.setProperty(b,e[a][c])})})},l=r=>{localStorage.setItem("yxTheme",r),t()},g=()=>localStorage.getItem("yxTheme")||"green",d=r=>{const o=g();return n[o][r]||{}};exports.changeTheme=l;exports.getCurTheme=g;exports.getSystemThemeConfig=d;exports.install=t;
|
package/lib/theme.es.js
CHANGED
|
@@ -1,8 +1,96 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = {
|
|
2
2
|
green: {
|
|
3
3
|
common: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
//公用颜色
|
|
5
|
+
color: {
|
|
6
|
+
//主题色
|
|
7
|
+
"main-100": "rgba(80, 165, 122, 1)",
|
|
8
|
+
"main-50": "rgba(80, 165, 122, 0.5)",
|
|
9
|
+
"main-25": "rgba(80, 165, 122, 0.25)",
|
|
10
|
+
"main-15": "rgba(80, 165, 122, 0.15)",
|
|
11
|
+
"main-5": "rgba(80, 165, 122, 0.05)",
|
|
12
|
+
//故障色
|
|
13
|
+
"error-100": "rgba(255, 152, 146, 1)",
|
|
14
|
+
"error-50": "rgba(255, 152, 146, 0.5)",
|
|
15
|
+
"error-25": "rgba(255, 152, 146, 0.25)",
|
|
16
|
+
"error-15": "rgba(255, 152, 146, 0.15)",
|
|
17
|
+
"error-5": "rgba(255, 152, 146, 0.05)",
|
|
18
|
+
//预警色
|
|
19
|
+
"warning-100": "rgba(249, 162, 33, 1)",
|
|
20
|
+
"warning-50": "rgba(249, 162, 33, 0.5)",
|
|
21
|
+
"warning-25": "rgba(249, 162, 33, 0.25)",
|
|
22
|
+
"warning-15": "rgba(249, 162, 33, 0.15)",
|
|
23
|
+
"warning-5": "rgba(249, 162, 33, 0.05)",
|
|
24
|
+
//信息色
|
|
25
|
+
"info-100": "rgba(133, 233, 183, 1)",
|
|
26
|
+
"info-50": "rgba(133, 233, 183, 0.5)",
|
|
27
|
+
"info-25": "rgba(133, 233, 183, 0.25)",
|
|
28
|
+
"info-15": "rgba(133, 233, 183, 0.15)",
|
|
29
|
+
"info-5": "rgba(133, 233, 183, 0.05)",
|
|
30
|
+
//中性色
|
|
31
|
+
"neutral-100": "rgba(85, 221, 221, 1)",
|
|
32
|
+
"neutral-50": "rgba(85, 221, 221, 0.5)",
|
|
33
|
+
"neutral-25": "rgba(85, 221, 221, 0.25)",
|
|
34
|
+
"neutral-15": "rgba(85, 221, 221, 0.15)",
|
|
35
|
+
"neutral-5": "rgba(85, 221, 221, 0.05)"
|
|
36
|
+
},
|
|
37
|
+
//背景色类
|
|
38
|
+
background: {
|
|
39
|
+
"error-gradual": "linear-gradient(90deg, #FFCECB 0%, rgba(255,235,233,0.35) 100%)",
|
|
40
|
+
"warning-gradual": "linear-gradient(90deg, #FFE4BC 0%, rgba(255,250,233,0.35) 100%)",
|
|
41
|
+
"success-gradual": "linear-gradient(90deg, #D5ECBE 0%, rgba(234,255,233,0.35) 100%)"
|
|
42
|
+
},
|
|
43
|
+
//按钮类
|
|
44
|
+
button: {
|
|
45
|
+
background: "rgba(103, 186, 145, 0.10)",
|
|
46
|
+
"border-color": "rgba(80, 165, 122, 1)",
|
|
47
|
+
"text-color": "rgba(80, 165, 122, 1)",
|
|
48
|
+
"active-background-color": "rgba(80, 165, 122, 1)",
|
|
49
|
+
"active-border-color": "rgba(154, 209, 162, 1)",
|
|
50
|
+
"active-text-color": "#fff"
|
|
51
|
+
},
|
|
52
|
+
checkbox: {
|
|
53
|
+
background: "rgba(216, 233, 219, 1)",
|
|
54
|
+
"icon-color": "rgba(80, 165, 122, 0)",
|
|
55
|
+
"border-color": "rgba(154, 209, 162, 1)",
|
|
56
|
+
"checked-background": "rgba(216, 233, 219, 1)",
|
|
57
|
+
"checked-icon-color": "rgba(80, 165, 122, 1)",
|
|
58
|
+
"checked-border-color": "rgba(154, 209, 162, 1)"
|
|
59
|
+
},
|
|
60
|
+
//input
|
|
61
|
+
input: {
|
|
62
|
+
background: "rgba(237, 246, 239, 1)",
|
|
63
|
+
"border-color": "rgba(80, 165, 122, 1)",
|
|
64
|
+
color: "rgba(29, 75, 52, 1)",
|
|
65
|
+
"placeholder-color": "rgba(80, 165, 122, 1)",
|
|
66
|
+
"hover-background": "rgba(237, 246, 239, 0.30)",
|
|
67
|
+
"hover-border-color": "rgba(80, 165, 122, 1)",
|
|
68
|
+
"hover-color": "rgba(80, 165, 122, 1)",
|
|
69
|
+
"active-background": "rgba(237, 246, 239, 0.30)",
|
|
70
|
+
"active-border-color": "rgba(80, 165, 122, 1)",
|
|
71
|
+
"active-color": "rgba(80, 165, 122, 1)",
|
|
72
|
+
"disabled-background": "rgba(237, 246, 239, 1)",
|
|
73
|
+
"disabled-border-color": "rgba(237, 246, 239, 1)",
|
|
74
|
+
"disabled-color": "rgba(83, 83, 83, 1)"
|
|
75
|
+
},
|
|
76
|
+
// select
|
|
77
|
+
select: {
|
|
78
|
+
"dropdown-background": "rgba(237, 246, 239, 1)",
|
|
79
|
+
"dropdown-border-color": "rgba(80, 165, 122, 1)",
|
|
80
|
+
"dropdown-item-color": "rgba(80, 165, 122, 1)",
|
|
81
|
+
"dropdown-item-hover-background": "rgba(178, 220, 198, 1)",
|
|
82
|
+
"dropdown-item-hover-color": "rgba(29, 75, 52, 1)",
|
|
83
|
+
"dropdown-item-selected-background": "rgba(178, 220, 198, 1)",
|
|
84
|
+
"dropdown-item-selected-color": "rgba(29, 75, 52, 1)"
|
|
85
|
+
},
|
|
86
|
+
//布局类
|
|
87
|
+
layout: {},
|
|
88
|
+
//表格类
|
|
89
|
+
table: {},
|
|
90
|
+
//曲线类
|
|
91
|
+
chart: {},
|
|
92
|
+
//提示类
|
|
93
|
+
message: {}
|
|
6
94
|
},
|
|
7
95
|
cloud: {},
|
|
8
96
|
"station-control-center": {}
|
|
@@ -15,22 +103,25 @@ const n = {
|
|
|
15
103
|
cloud: {},
|
|
16
104
|
"station-control-center": {}
|
|
17
105
|
}
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
localStorage.getItem("yxTheme") || localStorage.setItem("yxTheme",
|
|
21
|
-
const
|
|
22
|
-
Object.keys(
|
|
23
|
-
|
|
106
|
+
}, t = () => {
|
|
107
|
+
const r = b();
|
|
108
|
+
localStorage.getItem("yxTheme") || localStorage.setItem("yxTheme", r);
|
|
109
|
+
const o = document.documentElement, e = c[r].common;
|
|
110
|
+
Object.keys(e).forEach((a) => {
|
|
111
|
+
Object.keys(e[a]).forEach((g) => {
|
|
112
|
+
const n = `--${a}-${g}`;
|
|
113
|
+
o.style.setProperty(n, e[a][g]);
|
|
114
|
+
});
|
|
24
115
|
});
|
|
25
|
-
},
|
|
26
|
-
localStorage.setItem("yxTheme",
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
return
|
|
116
|
+
}, d = (r) => {
|
|
117
|
+
localStorage.setItem("yxTheme", r), t();
|
|
118
|
+
}, b = () => localStorage.getItem("yxTheme") || "green", l = (r) => {
|
|
119
|
+
const o = b();
|
|
120
|
+
return c[o][r] || {};
|
|
30
121
|
};
|
|
31
122
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
123
|
+
d as changeTheme,
|
|
124
|
+
b as getCurTheme,
|
|
34
125
|
l as getSystemThemeConfig,
|
|
35
|
-
|
|
126
|
+
t as install
|
|
36
127
|
};
|