inl-ui 0.1.121 → 0.1.122
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 +49 -49
- package/dist/components/index.cjs +4 -6
- package/dist/components/index.js +4 -6
- package/dist/index.cjs +4 -6
- package/dist/index.js +4 -6
- package/dist/theme/index.js +70 -70
- package/dist/theme/scripts/dark-vars.js +21 -21
- package/dist/theme/scripts/default-vars.js +25 -25
- package/dist/theme/scripts/light-vars.js +22 -22
- package/dist/theme/style/color/bezierEasing.less +110 -110
- package/dist/theme/style/color/colorPalette.less +81 -81
- package/dist/theme/style/color/colors.less +162 -162
- package/dist/theme/style/color/tinyColor.less +1184 -1184
- package/dist/theme/style/compact.less +4 -4
- package/dist/theme/style/dark.less +4 -4
- package/dist/theme/style/default.less +4 -4
- package/dist/theme/style/index.less +2 -2
- package/dist/theme/style/index.tsx +2 -2
- package/dist/theme/style/themes/compact.less +295 -295
- package/dist/theme/style/themes/dark.less +790 -790
- package/dist/theme/style/themes/default.less +1067 -1067
- package/dist/theme/style/themes/index.less +7 -7
- package/dist/theme/style/themes/var-dark.less +343 -343
- package/dist/theme/style/themes/var-default.less +184 -184
- package/dist/theme/style/themes/variable.less +1122 -1122
- package/dist/theme/style/variable.less +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# 工业PC ui库
|
|
2
|
-
|
|
3
|
-
前端通用库,包括组件、hooks、utils等。
|
|
4
|
-
|
|
5
|
-
### 运行
|
|
6
|
-
|
|
7
|
-
+ 开发模式 yarn dev
|
|
8
|
-
+ 生产打包 yarn build
|
|
9
|
-
+ 生成文档 yarn build:docs
|
|
10
|
-
+ 打包图扑工具 yarn buildtp
|
|
11
|
-
|
|
12
|
-
### 使用方法
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
import inl from 'inl-ui';
|
|
16
|
-
import 'inl-ui/dist/style.css';
|
|
17
|
-
|
|
18
|
-
vue.use(inl)
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### 激活主题
|
|
24
|
-
|
|
25
|
-
**vite.config.ts**
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
const additionalData = require("inl-ui/dist/theme").default;
|
|
29
|
-
|
|
30
|
-
...
|
|
31
|
-
|
|
32
|
-
css: {
|
|
33
|
-
preprocessorOptions: {
|
|
34
|
-
less: {
|
|
35
|
-
javascriptEnabled: true,
|
|
36
|
-
additionalData,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 文档链接
|
|
43
|
-
|
|
44
|
-
##### [组件文档](./src/components/README.md)
|
|
45
|
-
|
|
46
|
-
##### [hooks文档](./src/hooks/README.md)
|
|
47
|
-
|
|
48
|
-
##### [Utils文档](./src/utils/README.md)
|
|
49
|
-
|
|
1
|
+
# 工业PC ui库
|
|
2
|
+
|
|
3
|
+
前端通用库,包括组件、hooks、utils等。
|
|
4
|
+
|
|
5
|
+
### 运行
|
|
6
|
+
|
|
7
|
+
+ 开发模式 yarn dev
|
|
8
|
+
+ 生产打包 yarn build
|
|
9
|
+
+ 生成文档 yarn build:docs
|
|
10
|
+
+ 打包图扑工具 yarn buildtp
|
|
11
|
+
|
|
12
|
+
### 使用方法
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
import inl from 'inl-ui';
|
|
16
|
+
import 'inl-ui/dist/style.css';
|
|
17
|
+
|
|
18
|
+
vue.use(inl)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### 激活主题
|
|
24
|
+
|
|
25
|
+
**vite.config.ts**
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
const additionalData = require("inl-ui/dist/theme").default;
|
|
29
|
+
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
css: {
|
|
33
|
+
preprocessorOptions: {
|
|
34
|
+
less: {
|
|
35
|
+
javascriptEnabled: true,
|
|
36
|
+
additionalData,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 文档链接
|
|
43
|
+
|
|
44
|
+
##### [组件文档](./src/components/README.md)
|
|
45
|
+
|
|
46
|
+
##### [hooks文档](./src/hooks/README.md)
|
|
47
|
+
|
|
48
|
+
##### [Utils文档](./src/utils/README.md)
|
|
49
|
+
|
|
@@ -8737,7 +8737,6 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
8737
8737
|
if (newTab) {
|
|
8738
8738
|
dataId.value = newTab;
|
|
8739
8739
|
}
|
|
8740
|
-
dataId.value = props.name + dataId.value;
|
|
8741
8740
|
const tab = {
|
|
8742
8741
|
name,
|
|
8743
8742
|
url: route.fullPath,
|
|
@@ -8745,10 +8744,9 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
8745
8744
|
uniqueKey: dataId.value,
|
|
8746
8745
|
icon: props.icon,
|
|
8747
8746
|
isExtraTab: true,
|
|
8748
|
-
params: ___default["default"].omit(route.query, "name")
|
|
8749
|
-
ogiginId: newRoute.params.id || newRoute.query.id
|
|
8747
|
+
params: ___default["default"].omit(route.query, "name")
|
|
8750
8748
|
};
|
|
8751
|
-
const detail = detailList.value.find(item => item.uniqueKey === tab.uniqueKey);
|
|
8749
|
+
const detail = detailList.value.find(item => item.key + item.uniqueKey === tab.key + tab.uniqueKey);
|
|
8752
8750
|
if (detail) {
|
|
8753
8751
|
detail.url = newRoute.fullPath;
|
|
8754
8752
|
if (Array.isArray(qiankunState.value.extraTabs)) {
|
|
@@ -8777,7 +8775,7 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
8777
8775
|
}
|
|
8778
8776
|
});
|
|
8779
8777
|
}
|
|
8780
|
-
const activeTabKey = tab.uniqueKey;
|
|
8778
|
+
const activeTabKey = props.name + tab.uniqueKey;
|
|
8781
8779
|
qiankunState.value = {
|
|
8782
8780
|
...(qiankunState.value ?? {}),
|
|
8783
8781
|
activeTabKey
|
|
@@ -8840,7 +8838,7 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
8840
8838
|
}
|
|
8841
8839
|
}, [vue.createVNode(props.cpn, {
|
|
8842
8840
|
"key": item.id,
|
|
8843
|
-
"id": item.
|
|
8841
|
+
"id": item.id,
|
|
8844
8842
|
"isActive": isActive.value && isDetailActive,
|
|
8845
8843
|
"onClose": () => handleClose(item),
|
|
8846
8844
|
"onRefresh": () => handleRefresh(item)
|
package/dist/components/index.js
CHANGED
|
@@ -8709,7 +8709,6 @@ const getDetailContainer = () => defineComponent({
|
|
|
8709
8709
|
if (newTab) {
|
|
8710
8710
|
dataId.value = newTab;
|
|
8711
8711
|
}
|
|
8712
|
-
dataId.value = props.name + dataId.value;
|
|
8713
8712
|
const tab = {
|
|
8714
8713
|
name,
|
|
8715
8714
|
url: route.fullPath,
|
|
@@ -8717,10 +8716,9 @@ const getDetailContainer = () => defineComponent({
|
|
|
8717
8716
|
uniqueKey: dataId.value,
|
|
8718
8717
|
icon: props.icon,
|
|
8719
8718
|
isExtraTab: true,
|
|
8720
|
-
params: _.omit(route.query, "name")
|
|
8721
|
-
ogiginId: newRoute.params.id || newRoute.query.id
|
|
8719
|
+
params: _.omit(route.query, "name")
|
|
8722
8720
|
};
|
|
8723
|
-
const detail = detailList.value.find(item => item.uniqueKey === tab.uniqueKey);
|
|
8721
|
+
const detail = detailList.value.find(item => item.key + item.uniqueKey === tab.key + tab.uniqueKey);
|
|
8724
8722
|
if (detail) {
|
|
8725
8723
|
detail.url = newRoute.fullPath;
|
|
8726
8724
|
if (Array.isArray(qiankunState.value.extraTabs)) {
|
|
@@ -8749,7 +8747,7 @@ const getDetailContainer = () => defineComponent({
|
|
|
8749
8747
|
}
|
|
8750
8748
|
});
|
|
8751
8749
|
}
|
|
8752
|
-
const activeTabKey = tab.uniqueKey;
|
|
8750
|
+
const activeTabKey = props.name + tab.uniqueKey;
|
|
8753
8751
|
qiankunState.value = {
|
|
8754
8752
|
...(qiankunState.value ?? {}),
|
|
8755
8753
|
activeTabKey
|
|
@@ -8812,7 +8810,7 @@ const getDetailContainer = () => defineComponent({
|
|
|
8812
8810
|
}
|
|
8813
8811
|
}, [createVNode(props.cpn, {
|
|
8814
8812
|
"key": item.id,
|
|
8815
|
-
"id": item.
|
|
8813
|
+
"id": item.id,
|
|
8816
8814
|
"isActive": isActive.value && isDetailActive,
|
|
8817
8815
|
"onClose": () => handleClose(item),
|
|
8818
8816
|
"onRefresh": () => handleRefresh(item)
|
package/dist/index.cjs
CHANGED
|
@@ -9723,7 +9723,6 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
9723
9723
|
if (newTab) {
|
|
9724
9724
|
dataId.value = newTab;
|
|
9725
9725
|
}
|
|
9726
|
-
dataId.value = props.name + dataId.value;
|
|
9727
9726
|
const tab = {
|
|
9728
9727
|
name,
|
|
9729
9728
|
url: route.fullPath,
|
|
@@ -9731,10 +9730,9 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
9731
9730
|
uniqueKey: dataId.value,
|
|
9732
9731
|
icon: props.icon,
|
|
9733
9732
|
isExtraTab: true,
|
|
9734
|
-
params: ___default["default"].omit(route.query, "name")
|
|
9735
|
-
ogiginId: newRoute.params.id || newRoute.query.id
|
|
9733
|
+
params: ___default["default"].omit(route.query, "name")
|
|
9736
9734
|
};
|
|
9737
|
-
const detail = detailList.value.find(item => item.uniqueKey === tab.uniqueKey);
|
|
9735
|
+
const detail = detailList.value.find(item => item.key + item.uniqueKey === tab.key + tab.uniqueKey);
|
|
9738
9736
|
if (detail) {
|
|
9739
9737
|
detail.url = newRoute.fullPath;
|
|
9740
9738
|
if (Array.isArray(qiankunState.value.extraTabs)) {
|
|
@@ -9763,7 +9761,7 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
9763
9761
|
}
|
|
9764
9762
|
});
|
|
9765
9763
|
}
|
|
9766
|
-
const activeTabKey = tab.uniqueKey;
|
|
9764
|
+
const activeTabKey = props.name + tab.uniqueKey;
|
|
9767
9765
|
qiankunState.value = {
|
|
9768
9766
|
...(qiankunState.value ?? {}),
|
|
9769
9767
|
activeTabKey
|
|
@@ -9826,7 +9824,7 @@ const getDetailContainer = () => vue.defineComponent({
|
|
|
9826
9824
|
}
|
|
9827
9825
|
}, [vue.createVNode(props.cpn, {
|
|
9828
9826
|
"key": item.id,
|
|
9829
|
-
"id": item.
|
|
9827
|
+
"id": item.id,
|
|
9830
9828
|
"isActive": isActive.value && isDetailActive,
|
|
9831
9829
|
"onClose": () => handleClose(item),
|
|
9832
9830
|
"onRefresh": () => handleRefresh(item)
|
package/dist/index.js
CHANGED
|
@@ -9693,7 +9693,6 @@ const getDetailContainer = () => defineComponent({
|
|
|
9693
9693
|
if (newTab) {
|
|
9694
9694
|
dataId.value = newTab;
|
|
9695
9695
|
}
|
|
9696
|
-
dataId.value = props.name + dataId.value;
|
|
9697
9696
|
const tab = {
|
|
9698
9697
|
name,
|
|
9699
9698
|
url: route.fullPath,
|
|
@@ -9701,10 +9700,9 @@ const getDetailContainer = () => defineComponent({
|
|
|
9701
9700
|
uniqueKey: dataId.value,
|
|
9702
9701
|
icon: props.icon,
|
|
9703
9702
|
isExtraTab: true,
|
|
9704
|
-
params: _.omit(route.query, "name")
|
|
9705
|
-
ogiginId: newRoute.params.id || newRoute.query.id
|
|
9703
|
+
params: _.omit(route.query, "name")
|
|
9706
9704
|
};
|
|
9707
|
-
const detail = detailList.value.find(item => item.uniqueKey === tab.uniqueKey);
|
|
9705
|
+
const detail = detailList.value.find(item => item.key + item.uniqueKey === tab.key + tab.uniqueKey);
|
|
9708
9706
|
if (detail) {
|
|
9709
9707
|
detail.url = newRoute.fullPath;
|
|
9710
9708
|
if (Array.isArray(qiankunState.value.extraTabs)) {
|
|
@@ -9733,7 +9731,7 @@ const getDetailContainer = () => defineComponent({
|
|
|
9733
9731
|
}
|
|
9734
9732
|
});
|
|
9735
9733
|
}
|
|
9736
|
-
const activeTabKey = tab.uniqueKey;
|
|
9734
|
+
const activeTabKey = props.name + tab.uniqueKey;
|
|
9737
9735
|
qiankunState.value = {
|
|
9738
9736
|
...(qiankunState.value ?? {}),
|
|
9739
9737
|
activeTabKey
|
|
@@ -9796,7 +9794,7 @@ const getDetailContainer = () => defineComponent({
|
|
|
9796
9794
|
}
|
|
9797
9795
|
}, [createVNode(props.cpn, {
|
|
9798
9796
|
"key": item.id,
|
|
9799
|
-
"id": item.
|
|
9797
|
+
"id": item.id,
|
|
9800
9798
|
"isActive": isActive.value && isDetailActive,
|
|
9801
9799
|
"onClose": () => handleClose(item),
|
|
9802
9800
|
"onRefresh": () => handleRefresh(item)
|
package/dist/theme/index.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
const less = require("less");
|
|
2
|
-
const defaultVars = require("./scripts/default-vars");
|
|
3
|
-
|
|
4
|
-
const dark = require("./scripts/dark-vars");
|
|
5
|
-
const light = require("./scripts/light-vars");
|
|
6
|
-
|
|
7
|
-
const path = require("path");
|
|
8
|
-
const varDark = path.join(__dirname, ".", "style");
|
|
9
|
-
const themeConfig = [
|
|
10
|
-
{
|
|
11
|
-
theme: "dark",
|
|
12
|
-
htmlThemeAttr: "dark",
|
|
13
|
-
modifyVars: {
|
|
14
|
-
hack: `true;@import "${require.resolve(
|
|
15
|
-
varDark + "/color/colorPalette.less"
|
|
16
|
-
)}";@import "${require.resolve(varDark + "/themes/var-dark.less")}";`,
|
|
17
|
-
...defaultVars,
|
|
18
|
-
...dark,
|
|
19
|
-
"root-entry-name": "dark",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
theme: "light",
|
|
24
|
-
htmlThemeAttr: "light",
|
|
25
|
-
modifyVars: {
|
|
26
|
-
// 引入除了变量外的其他内容
|
|
27
|
-
hack: `true;@import "${require.resolve(
|
|
28
|
-
varDark + "/color/colorPalette.less"
|
|
29
|
-
)}";@import "${require.resolve(varDark + "/themes/var-default.less")}";`,
|
|
30
|
-
...defaultVars,
|
|
31
|
-
...light,
|
|
32
|
-
"root-entry-name": "default",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
const additionalData = async (content, filename) => {
|
|
37
|
-
const themePromises = themeConfig.map(async (t) => {
|
|
38
|
-
const { htmlThemeAttr, modifyVars = {} } = t;
|
|
39
|
-
const options = {
|
|
40
|
-
javascriptEnabled: true,
|
|
41
|
-
modifyVars,
|
|
42
|
-
relativeUrls: true,
|
|
43
|
-
filename,
|
|
44
|
-
};
|
|
45
|
-
try {
|
|
46
|
-
const { css } = await less.render(content, options);
|
|
47
|
-
let res = "";
|
|
48
|
-
if (htmlThemeAttr && css) {
|
|
49
|
-
res = `
|
|
50
|
-
[data-doc-theme=${htmlThemeAttr}] {
|
|
51
|
-
${css}
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
return Promise.resolve(res);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
// eslint-disable-next-line no-console
|
|
58
|
-
console.log(error);
|
|
59
|
-
return Promise.reject(content);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
let res = content;
|
|
63
|
-
for (const themePromise of themePromises) {
|
|
64
|
-
const theme = await themePromise;
|
|
65
|
-
res += theme;
|
|
66
|
-
}
|
|
67
|
-
return res;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
exports.default = additionalData;
|
|
1
|
+
const less = require("less");
|
|
2
|
+
const defaultVars = require("./scripts/default-vars");
|
|
3
|
+
|
|
4
|
+
const dark = require("./scripts/dark-vars");
|
|
5
|
+
const light = require("./scripts/light-vars");
|
|
6
|
+
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const varDark = path.join(__dirname, ".", "style");
|
|
9
|
+
const themeConfig = [
|
|
10
|
+
{
|
|
11
|
+
theme: "dark",
|
|
12
|
+
htmlThemeAttr: "dark",
|
|
13
|
+
modifyVars: {
|
|
14
|
+
hack: `true;@import "${require.resolve(
|
|
15
|
+
varDark + "/color/colorPalette.less"
|
|
16
|
+
)}";@import "${require.resolve(varDark + "/themes/var-dark.less")}";`,
|
|
17
|
+
...defaultVars,
|
|
18
|
+
...dark,
|
|
19
|
+
"root-entry-name": "dark",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
theme: "light",
|
|
24
|
+
htmlThemeAttr: "light",
|
|
25
|
+
modifyVars: {
|
|
26
|
+
// 引入除了变量外的其他内容
|
|
27
|
+
hack: `true;@import "${require.resolve(
|
|
28
|
+
varDark + "/color/colorPalette.less"
|
|
29
|
+
)}";@import "${require.resolve(varDark + "/themes/var-default.less")}";`,
|
|
30
|
+
...defaultVars,
|
|
31
|
+
...light,
|
|
32
|
+
"root-entry-name": "default",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
const additionalData = async (content, filename) => {
|
|
37
|
+
const themePromises = themeConfig.map(async (t) => {
|
|
38
|
+
const { htmlThemeAttr, modifyVars = {} } = t;
|
|
39
|
+
const options = {
|
|
40
|
+
javascriptEnabled: true,
|
|
41
|
+
modifyVars,
|
|
42
|
+
relativeUrls: true,
|
|
43
|
+
filename,
|
|
44
|
+
};
|
|
45
|
+
try {
|
|
46
|
+
const { css } = await less.render(content, options);
|
|
47
|
+
let res = "";
|
|
48
|
+
if (htmlThemeAttr && css) {
|
|
49
|
+
res = `
|
|
50
|
+
[data-doc-theme=${htmlThemeAttr}] {
|
|
51
|
+
${css}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
return Promise.resolve(res);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.log(error);
|
|
59
|
+
return Promise.reject(content);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
let res = content;
|
|
63
|
+
for (const themePromise of themePromises) {
|
|
64
|
+
const theme = await themePromise;
|
|
65
|
+
res += theme;
|
|
66
|
+
}
|
|
67
|
+
return res;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
exports.default = additionalData;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* convert dark.less into js vars
|
|
3
|
-
*
|
|
4
|
-
* const darkVars = require('./dark-vars');
|
|
5
|
-
*/
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const path = require("path");
|
|
8
|
-
const lessToJs = require("less-vars-to-js");
|
|
9
|
-
|
|
10
|
-
const stylePath = path.join(__dirname, "..", "style");
|
|
11
|
-
const darkLess = fs.readFileSync(
|
|
12
|
-
path.join(stylePath, "themes", "var-dark.less"),
|
|
13
|
-
"utf8"
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
const darkPaletteLess = lessToJs(darkLess, {
|
|
17
|
-
stripPrefix: true,
|
|
18
|
-
resolveVariables: false,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
module.exports = darkPaletteLess;
|
|
1
|
+
/**
|
|
2
|
+
* convert dark.less into js vars
|
|
3
|
+
*
|
|
4
|
+
* const darkVars = require('./dark-vars');
|
|
5
|
+
*/
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const lessToJs = require("less-vars-to-js");
|
|
9
|
+
|
|
10
|
+
const stylePath = path.join(__dirname, "..", "style");
|
|
11
|
+
const darkLess = fs.readFileSync(
|
|
12
|
+
path.join(stylePath, "themes", "var-dark.less"),
|
|
13
|
+
"utf8"
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const darkPaletteLess = lessToJs(darkLess, {
|
|
17
|
+
stripPrefix: true,
|
|
18
|
+
resolveVariables: false,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
module.exports = darkPaletteLess;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* convert default.less into js vars
|
|
3
|
-
*
|
|
4
|
-
* const darkVars = require('./default-vars');
|
|
5
|
-
*/
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const path = require("path");
|
|
8
|
-
const lessToJs = require("less-vars-to-js");
|
|
9
|
-
|
|
10
|
-
const stylePath = path.join(__dirname, "..", "style");
|
|
11
|
-
const colorLess = fs.readFileSync(
|
|
12
|
-
path.join(stylePath, "color", "colors.less"),
|
|
13
|
-
"utf8"
|
|
14
|
-
);
|
|
15
|
-
const defaultLess = fs.readFileSync(
|
|
16
|
-
path.join(stylePath, "themes", "default.less"),
|
|
17
|
-
"utf8"
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const defaultPaletteLess = lessToJs(`${colorLess}${defaultLess}`, {
|
|
21
|
-
stripPrefix: true,
|
|
22
|
-
resolveVariables: false,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
module.exports = defaultPaletteLess;
|
|
1
|
+
/**
|
|
2
|
+
* convert default.less into js vars
|
|
3
|
+
*
|
|
4
|
+
* const darkVars = require('./default-vars');
|
|
5
|
+
*/
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const lessToJs = require("less-vars-to-js");
|
|
9
|
+
|
|
10
|
+
const stylePath = path.join(__dirname, "..", "style");
|
|
11
|
+
const colorLess = fs.readFileSync(
|
|
12
|
+
path.join(stylePath, "color", "colors.less"),
|
|
13
|
+
"utf8"
|
|
14
|
+
);
|
|
15
|
+
const defaultLess = fs.readFileSync(
|
|
16
|
+
path.join(stylePath, "themes", "default.less"),
|
|
17
|
+
"utf8"
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const defaultPaletteLess = lessToJs(`${colorLess}${defaultLess}`, {
|
|
21
|
+
stripPrefix: true,
|
|
22
|
+
resolveVariables: false,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
module.exports = defaultPaletteLess;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* convert dark.less into js vars
|
|
3
|
-
*
|
|
4
|
-
* const darkVars = require('./dark-vars');
|
|
5
|
-
*/
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const path = require("path");
|
|
8
|
-
const lessToJs = require("less-vars-to-js");
|
|
9
|
-
|
|
10
|
-
const stylePath = path.join(__dirname, "..", "style");
|
|
11
|
-
const lightLess = fs.readFileSync(
|
|
12
|
-
path.join(stylePath, "themes", "var-default.less"),
|
|
13
|
-
"utf8"
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
// 注册变量,过滤其他内容
|
|
17
|
-
const lightPaletteLess = lessToJs(lightLess, {
|
|
18
|
-
stripPrefix: true,
|
|
19
|
-
resolveVariables: false,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
module.exports = lightPaletteLess;
|
|
1
|
+
/**
|
|
2
|
+
* convert dark.less into js vars
|
|
3
|
+
*
|
|
4
|
+
* const darkVars = require('./dark-vars');
|
|
5
|
+
*/
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const lessToJs = require("less-vars-to-js");
|
|
9
|
+
|
|
10
|
+
const stylePath = path.join(__dirname, "..", "style");
|
|
11
|
+
const lightLess = fs.readFileSync(
|
|
12
|
+
path.join(stylePath, "themes", "var-default.less"),
|
|
13
|
+
"utf8"
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
// 注册变量,过滤其他内容
|
|
17
|
+
const lightPaletteLess = lessToJs(lightLess, {
|
|
18
|
+
stripPrefix: true,
|
|
19
|
+
resolveVariables: false,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
module.exports = lightPaletteLess;
|