@tuya-miniapp/smart-ui 2.3.3 → 2.3.4-beta-2
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/popover/index.js +6 -2
- 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/popover/index.js +6 -2
- 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 = {
|
package/dist/popover/index.js
CHANGED
@@ -23,6 +23,10 @@ SmartComponent({
|
|
23
23
|
show: {
|
24
24
|
type: Boolean,
|
25
25
|
observer(value) {
|
26
|
+
if (this.data.cancel_timer) {
|
27
|
+
clearTimeout(this.data.cancel_timer);
|
28
|
+
this.data.cancel_timer = null;
|
29
|
+
}
|
26
30
|
if (value !== this.data.currentShow) {
|
27
31
|
if (value) {
|
28
32
|
this.onOpen();
|
@@ -46,7 +50,7 @@ SmartComponent({
|
|
46
50
|
value: 20000,
|
47
51
|
},
|
48
52
|
},
|
49
|
-
data: { currentShow: false, showStyle: '' },
|
53
|
+
data: { currentShow: false, showStyle: '', cancel_timer: null },
|
50
54
|
mounted() { },
|
51
55
|
created() { },
|
52
56
|
methods: {
|
@@ -172,7 +176,7 @@ SmartComponent({
|
|
172
176
|
}, 100);
|
173
177
|
this.$emit('show-change', true);
|
174
178
|
if (this.data.duration) {
|
175
|
-
setTimeout(() => {
|
179
|
+
this.data.cancel_timer = setTimeout(() => {
|
176
180
|
this.onClose();
|
177
181
|
}, this.data.duration);
|
178
182
|
}
|
@@ -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 = {
|
package/lib/popover/index.js
CHANGED
@@ -38,6 +38,10 @@ function createSvgIcon(svg) {
|
|
38
38
|
show: {
|
39
39
|
type: Boolean,
|
40
40
|
observer: function (value) {
|
41
|
+
if (this.data.cancel_timer) {
|
42
|
+
clearTimeout(this.data.cancel_timer);
|
43
|
+
this.data.cancel_timer = null;
|
44
|
+
}
|
41
45
|
if (value !== this.data.currentShow) {
|
42
46
|
if (value) {
|
43
47
|
this.onOpen();
|
@@ -61,7 +65,7 @@ function createSvgIcon(svg) {
|
|
61
65
|
value: 20000,
|
62
66
|
},
|
63
67
|
},
|
64
|
-
data: { currentShow: false, showStyle: '' },
|
68
|
+
data: { currentShow: false, showStyle: '', cancel_timer: null },
|
65
69
|
mounted: function () { },
|
66
70
|
created: function () { },
|
67
71
|
methods: {
|
@@ -188,7 +192,7 @@ function createSvgIcon(svg) {
|
|
188
192
|
}, 100);
|
189
193
|
this.$emit('show-change', true);
|
190
194
|
if (this.data.duration) {
|
191
|
-
setTimeout(function () {
|
195
|
+
this.data.cancel_timer = setTimeout(function () {
|
192
196
|
_this.onClose();
|
193
197
|
}, this.data.duration);
|
194
198
|
}
|
@@ -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}
|