@tuya-miniapp/smart-ui 2.3.3 → 2.3.4-beta-1
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/icon/index.wxs +3 -8
- package/dist/image/index.wxs +2 -1
- package/dist/tabbar-item/index.css +1 -1
- package/dist/tabbar-item/index.js +5 -0
- package/dist/tabbar-item/index.wxml +1 -1
- package/dist/tabbar-item/index.wxss +1 -1
- package/lib/icon/index.wxs +3 -8
- package/lib/image/index.wxs +2 -1
- package/lib/tabbar-item/index.css +1 -1
- package/lib/tabbar-item/index.js +5 -0
- package/lib/tabbar-item/index.wxml +1 -1
- package/lib/tabbar-item/index.wxss +1 -1
- package/package.json +1 -1
package/dist/icon/index.wxs
CHANGED
@@ -66,16 +66,11 @@ function svgStyle(data) {
|
|
66
66
|
]);
|
67
67
|
return ret;
|
68
68
|
}
|
69
|
+
|
69
70
|
function svgPathStyle(data) {
|
70
|
-
const { name, color } = data;
|
71
71
|
// 构建SVG字符串
|
72
|
-
|
73
|
-
|
74
|
-
<path d="${name}" fill="${color || 'currentColor'}" fill-rule="evenodd"></path>
|
75
|
-
</svg>
|
76
|
-
`;
|
77
|
-
|
78
|
-
const imageBase64Src = `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
72
|
+
var svg = '<svg class="icon" width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="' + data.name + " fill=" + (data.color || 'currentColor') + '" fill-rule="evenodd"></path></svg>'
|
73
|
+
var imageBase64Src = 'url("data:image/svg+xml,' + encodeURIComponent(svg) + '")';
|
79
74
|
var ret = style([
|
80
75
|
{
|
81
76
|
|
package/dist/image/index.wxs
CHANGED
@@ -30,7 +30,8 @@ function mode(fit) {
|
|
30
30
|
|
31
31
|
|
32
32
|
function maskStyle(url, color) {
|
33
|
-
|
33
|
+
const str = 'mask-image: url(' + url + ');-webkit-mask-image: url(' + url + ');background: ' + color + ';'
|
34
|
+
return str
|
34
35
|
}
|
35
36
|
|
36
37
|
module.exports = {
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item__info{margin-top:2px}
|
1
|
+
@import '../common/index.css';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item--disabled{opacity:var(--tabbar-item-disabled-opacity,.7)}.smart-tabbar-item__info{margin-top:2px}
|
@@ -6,6 +6,7 @@ SmartComponent({
|
|
6
6
|
name: null,
|
7
7
|
icon: String,
|
8
8
|
dot: Boolean,
|
9
|
+
disabled: Boolean,
|
9
10
|
url: {
|
10
11
|
type: String,
|
11
12
|
value: '',
|
@@ -28,6 +29,10 @@ SmartComponent({
|
|
28
29
|
methods: {
|
29
30
|
onClick() {
|
30
31
|
const { parent } = this;
|
32
|
+
if (this.data.disabled) {
|
33
|
+
this.$emit('click');
|
34
|
+
return;
|
35
|
+
}
|
31
36
|
if (parent) {
|
32
37
|
const index = parent.children.indexOf(this);
|
33
38
|
const active = this.data.name || index;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
2
2
|
|
3
3
|
<view
|
4
|
-
class="{{ utils.bem('tabbar-item', { active }) }} custom-class"
|
4
|
+
class="{{ utils.bem('tabbar-item', { active, disabled }) }} custom-class"
|
5
5
|
style="color: {{ active ? activeColor : inactiveColor }}"
|
6
6
|
bindtap="onClick"
|
7
7
|
>
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item__info{margin-top:2px}
|
1
|
+
@import '../common/index.wxss';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item--disabled{opacity:var(--tabbar-item-disabled-opacity,.7)}.smart-tabbar-item__info{margin-top:2px}
|
package/lib/icon/index.wxs
CHANGED
@@ -66,16 +66,11 @@ function svgStyle(data) {
|
|
66
66
|
]);
|
67
67
|
return ret;
|
68
68
|
}
|
69
|
+
|
69
70
|
function svgPathStyle(data) {
|
70
|
-
const { name, color } = data;
|
71
71
|
// 构建SVG字符串
|
72
|
-
|
73
|
-
|
74
|
-
<path d="${name}" fill="${color || 'currentColor'}" fill-rule="evenodd"></path>
|
75
|
-
</svg>
|
76
|
-
`;
|
77
|
-
|
78
|
-
const imageBase64Src = `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
72
|
+
var svg = '<svg class="icon" width="100%" height="100%" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="' + data.name + " fill=" + (data.color || 'currentColor') + '" fill-rule="evenodd"></path></svg>'
|
73
|
+
var imageBase64Src = 'url("data:image/svg+xml,' + encodeURIComponent(svg) + '")';
|
79
74
|
var ret = style([
|
80
75
|
{
|
81
76
|
|
package/lib/image/index.wxs
CHANGED
@@ -30,7 +30,8 @@ function mode(fit) {
|
|
30
30
|
|
31
31
|
|
32
32
|
function maskStyle(url, color) {
|
33
|
-
|
33
|
+
const str = 'mask-image: url(' + url + ');-webkit-mask-image: url(' + url + ');background: ' + color + ';'
|
34
|
+
return str
|
34
35
|
}
|
35
36
|
|
36
37
|
module.exports = {
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item__info{margin-top:2px}
|
1
|
+
@import '../common/index.css';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item--disabled{opacity:var(--tabbar-item-disabled-opacity,.7)}.smart-tabbar-item__info{margin-top:2px}
|
package/lib/tabbar-item/index.js
CHANGED
@@ -8,6 +8,7 @@ var relation_1 = require("../common/relation");
|
|
8
8
|
name: null,
|
9
9
|
icon: String,
|
10
10
|
dot: Boolean,
|
11
|
+
disabled: Boolean,
|
11
12
|
url: {
|
12
13
|
type: String,
|
13
14
|
value: '',
|
@@ -30,6 +31,10 @@ var relation_1 = require("../common/relation");
|
|
30
31
|
methods: {
|
31
32
|
onClick: function () {
|
32
33
|
var parent = this.parent;
|
34
|
+
if (this.data.disabled) {
|
35
|
+
this.$emit('click');
|
36
|
+
return;
|
37
|
+
}
|
33
38
|
if (parent) {
|
34
39
|
var index = parent.children.indexOf(this);
|
35
40
|
var active = this.data.name || index;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
2
2
|
|
3
3
|
<view
|
4
|
-
class="{{ utils.bem('tabbar-item', { active }) }} custom-class"
|
4
|
+
class="{{ utils.bem('tabbar-item', { active, disabled }) }} custom-class"
|
5
5
|
style="color: {{ active ? activeColor : inactiveColor }}"
|
6
6
|
bindtap="onClick"
|
7
7
|
>
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item__info{margin-top:2px}
|
1
|
+
@import '../common/index.wxss';:host{flex:1}.smart-tabbar-item{align-items:center;color:var(--tabbar-item-text-color,var(--app-B6-N5,rgba(0,0,0,.3)));display:flex;flex-direction:column;font-size:var(--tabbar-item-font-size,12px);height:100%;justify-content:center;line-height:var(--tabbar-item-line-height,1)}.smart-tabbar-item__icon{font-size:var(--tabbar-item-icon-size,22px);margin-bottom:var(--tabbar-item-margin-bottom,4px);position:relative}.smart-tabbar-item__icon__inner{display:block;min-height:1em;min-width:1em}.smart-tabbar-item--active{color:var(--tabbar-item-active-color,var(--app-M1,#3678e3))}.smart-tabbar-item--disabled{opacity:var(--tabbar-item-disabled-opacity,.7)}.smart-tabbar-item__info{margin-top:2px}
|