@tuya-miniapp/smart-ui 1.2.2 → 1.3.0-beta-2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/action-sheet/index.js +7 -3
- package/dist/battery/index.js +5 -3
- package/dist/calendar/calendar.wxml +1 -0
- package/dist/calendar/components/month/index.d.ts +1 -0
- package/dist/calendar/components/month/index.js +11 -3
- package/dist/calendar/components/month/index.wxs +1 -1
- package/dist/calendar/index.js +13 -3
- package/dist/calendar/index.wxs +1 -1
- package/dist/calendar/utils.d.ts +1 -0
- package/dist/calendar/utils.js +11 -1
- package/dist/common/theme/dark.d.ts +344 -0
- package/dist/common/theme/dark.js +343 -0
- package/dist/common/theme/light.d.ts +344 -0
- package/dist/common/theme/light.js +343 -0
- package/dist/config-provider/index.wxs +7 -2
- package/dist/wxs/is-app-theme-var.wxs +8 -0
- package/dist/wxs/style.wxs +4 -0
- package/dist/wxs/utils.wxs +3 -1
- package/lib/action-sheet/index.js +7 -3
- package/lib/battery/index.js +5 -3
- package/lib/calendar/calendar.wxml +1 -0
- package/lib/calendar/components/month/index.d.ts +1 -0
- package/lib/calendar/components/month/index.js +10 -2
- package/lib/calendar/components/month/index.wxs +1 -1
- package/lib/calendar/index.js +13 -3
- package/lib/calendar/index.wxs +1 -1
- package/lib/calendar/utils.d.ts +1 -0
- package/lib/calendar/utils.js +13 -2
- package/lib/common/theme/dark.d.ts +344 -0
- package/lib/common/theme/dark.js +345 -0
- package/lib/common/theme/light.d.ts +344 -0
- package/lib/common/theme/light.js +345 -0
- package/lib/config-provider/index.wxs +7 -2
- package/lib/wxs/is-app-theme-var.wxs +8 -0
- package/lib/wxs/style.wxs +4 -0
- package/lib/wxs/utils.wxs +3 -1
- package/package.json +1 -1
@@ -1,6 +1,7 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
var object = require('../wxs/object.wxs');
|
3
3
|
var style = require('../wxs/style.wxs');
|
4
|
+
var utils = require('../wxs/utils.wxs');
|
4
5
|
|
5
6
|
function kebabCase(word) {
|
6
7
|
var newWord = word
|
@@ -16,8 +17,12 @@ function kebabCase(word) {
|
|
16
17
|
function mapThemeVarsToCSSVars(themeVars) {
|
17
18
|
var cssVars = {};
|
18
19
|
object.keys(themeVars).forEach(function (key) {
|
19
|
-
|
20
|
-
|
20
|
+
if (utils.isAppThemeVar(key)) {
|
21
|
+
cssVars[key] = themeVars[key];
|
22
|
+
} else {
|
23
|
+
var cssVarsKey = '--' + kebabCase(key);
|
24
|
+
cssVars[cssVarsKey] = themeVars[key];
|
25
|
+
}
|
21
26
|
});
|
22
27
|
|
23
28
|
return style(cssVars);
|
package/lib/wxs/style.wxs
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
/* eslint-disable */
|
2
|
+
var utils = require('./utils.wxs');
|
2
3
|
var object = require('./object.wxs');
|
3
4
|
var array = require('./array.wxs');
|
4
5
|
|
@@ -31,6 +32,9 @@ function style(styles) {
|
|
31
32
|
return styles[key] != null && styles[key] !== '';
|
32
33
|
})
|
33
34
|
.map(function (key) {
|
35
|
+
if (utils.isAppThemeVar(key)) {
|
36
|
+
return [key, styles[key]].join(':');
|
37
|
+
}
|
34
38
|
return [kebabCase(key), [styles[key]]].join(':');
|
35
39
|
})
|
36
40
|
.join(';');
|
package/lib/wxs/utils.wxs
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
var bem = require('./bem.wxs');
|
3
3
|
var memoize = require('./memoize.wxs');
|
4
4
|
var addUnit = require('./add-unit.wxs');
|
5
|
+
var isAppThemeVar = require('./is-app-theme-var.wxs');
|
5
6
|
|
6
7
|
module.exports = {
|
7
8
|
bem: memoize(bem),
|
8
9
|
memoize: memoize,
|
9
|
-
addUnit: addUnit
|
10
|
+
addUnit: addUnit,
|
11
|
+
isAppThemeVar: isAppThemeVar,
|
10
12
|
};
|