@tuya-miniapp/smart-ui 2.7.4-beta-1 → 2.7.4-beta-3
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/loading/index.js +9 -3
- package/dist/loading/index.wxml +2 -2
- package/dist/loading/index.wxs +2 -1
- package/dist/toast/index.js +5 -0
- package/dist/toast/index.wxml +5 -5
- package/dist/toast/toast.d.ts +2 -0
- package/lib/loading/index.js +9 -3
- package/lib/loading/index.wxml +2 -2
- package/lib/loading/index.wxs +2 -1
- package/lib/toast/index.js +5 -0
- package/lib/toast/index.wxml +5 -5
- package/lib/toast/toast.d.ts +2 -0
- package/package.json +1 -1
package/dist/loading/index.js
CHANGED
|
@@ -3,7 +3,6 @@ SmartComponent({
|
|
|
3
3
|
props: {
|
|
4
4
|
color: {
|
|
5
5
|
type: String,
|
|
6
|
-
value: 'var(--loading-text-color, #1989FA)',
|
|
7
6
|
},
|
|
8
7
|
vertical: Boolean,
|
|
9
8
|
type: {
|
|
@@ -15,6 +14,9 @@ SmartComponent({
|
|
|
15
14
|
value: '30',
|
|
16
15
|
},
|
|
17
16
|
textSize: String,
|
|
17
|
+
iconColor: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
18
20
|
},
|
|
19
21
|
data: {
|
|
20
22
|
spinner: '',
|
|
@@ -22,8 +24,12 @@ SmartComponent({
|
|
|
22
24
|
},
|
|
23
25
|
created() {
|
|
24
26
|
this.setData({
|
|
25
|
-
spinner: this.SpinnerLoading({
|
|
26
|
-
|
|
27
|
+
spinner: this.SpinnerLoading({
|
|
28
|
+
color: this.data.color || 'var(--loading-spinner-color, #1989FA)',
|
|
29
|
+
}),
|
|
30
|
+
circular: this.CircularLoading({
|
|
31
|
+
color: this.data.color || 'var(--loading-spinner-color, #1989FA)',
|
|
32
|
+
}),
|
|
27
33
|
});
|
|
28
34
|
},
|
|
29
35
|
methods: {
|
package/dist/loading/index.wxml
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<view class="custom-class {{ utils.bem('loading', { vertical }) }}">
|
|
5
5
|
<view
|
|
6
6
|
class="smart-loading__spinner smart-loading__spinner--{{ type }}"
|
|
7
|
-
style="{{ computed.loadingStyle({ size, type, color, spinner, circular }) }}"
|
|
7
|
+
style="{{ computed.loadingStyle({ iconColor, size, type, color, spinner, circular }) }}"
|
|
8
8
|
>
|
|
9
9
|
<view
|
|
10
10
|
class="smart-switch__loading"
|
|
11
|
-
style="{{ computed.loadingStyle({ size, type, color, spinner, circular }) }}"
|
|
11
|
+
style="{{ computed.loadingStyle({ iconColor, size, type, color, spinner, circular }) }}"
|
|
12
12
|
/>
|
|
13
13
|
</view>
|
|
14
14
|
<view class="smart-loading__text" style="{{ computed.textStyle({ textSize, color }) }}">
|
package/dist/loading/index.wxs
CHANGED
|
@@ -5,7 +5,7 @@ var addUnit = require('../wxs/add-unit.wxs');
|
|
|
5
5
|
function textStyle(data) {
|
|
6
6
|
var ret = style({
|
|
7
7
|
'font-size': addUnit(data.textSize),
|
|
8
|
-
color: data.color,
|
|
8
|
+
color: data.color || 'var(--loading-text-color, #1989FA)',
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
return ret;
|
|
@@ -28,6 +28,7 @@ function loadingStyle(data) {
|
|
|
28
28
|
'-webkit-mask-size': addUnit(data.size),
|
|
29
29
|
width: addUnit(data.size),
|
|
30
30
|
height: addUnit(data.size),
|
|
31
|
+
background: data.iconColor || data.color || 'var(--loading-spinner-color, #1989FA)',
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
return ret;
|
package/dist/toast/index.js
CHANGED
package/dist/toast/index.wxml
CHANGED
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
>
|
|
17
17
|
|
|
18
18
|
<!-- text only -->
|
|
19
|
-
<text class="smart-toast__text" wx:if="{{ type === 'text' }}">{{ message }}</text>
|
|
19
|
+
<text class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}" wx:if="{{ type === 'text' }}">{{ message }}</text>
|
|
20
20
|
|
|
21
21
|
<!-- html only -->
|
|
22
|
-
<rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
|
|
22
|
+
<rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}" style="{{ textColor ? ('color: ' + textColor) : '' }}"></rich-text>
|
|
23
23
|
|
|
24
24
|
<!-- with icon -->
|
|
25
25
|
<block wx:else>
|
|
26
|
-
<smart-loading wx:if="{{ type === 'loading' }}" color="
|
|
27
|
-
<smart-icon wx:else color="
|
|
28
|
-
<text wx:if="{{ message }}" class="smart-toast__text">{{ message }}</text>
|
|
26
|
+
<smart-loading wx:if="{{ type === 'loading' }}" color="{{iconColor}}" style="transform:scale(1.6);" type="{{loadingType}}" />
|
|
27
|
+
<smart-icon wx:else color="{{iconColor}}" class="smart-toast__icon" style="transform:scale({{ type === 'success' ? 1.4 : type === 'fail' ? 1.1 : 1 }})" name="{{ type === 'success' ? success : type === 'fail' ? error : type === 'warn' ? warn : success }}" />
|
|
28
|
+
<text wx:if="{{ message }}" class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}">{{ message }}</text>
|
|
29
29
|
</block>
|
|
30
30
|
|
|
31
31
|
<slot />
|
package/dist/toast/toast.d.ts
CHANGED
package/lib/loading/index.js
CHANGED
|
@@ -5,7 +5,6 @@ var component_1 = require("../common/component");
|
|
|
5
5
|
props: {
|
|
6
6
|
color: {
|
|
7
7
|
type: String,
|
|
8
|
-
value: 'var(--loading-text-color, #1989FA)',
|
|
9
8
|
},
|
|
10
9
|
vertical: Boolean,
|
|
11
10
|
type: {
|
|
@@ -17,6 +16,9 @@ var component_1 = require("../common/component");
|
|
|
17
16
|
value: '30',
|
|
18
17
|
},
|
|
19
18
|
textSize: String,
|
|
19
|
+
iconColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
data: {
|
|
22
24
|
spinner: '',
|
|
@@ -24,8 +26,12 @@ var component_1 = require("../common/component");
|
|
|
24
26
|
},
|
|
25
27
|
created: function () {
|
|
26
28
|
this.setData({
|
|
27
|
-
spinner: this.SpinnerLoading({
|
|
28
|
-
|
|
29
|
+
spinner: this.SpinnerLoading({
|
|
30
|
+
color: this.data.color || 'var(--loading-spinner-color, #1989FA)',
|
|
31
|
+
}),
|
|
32
|
+
circular: this.CircularLoading({
|
|
33
|
+
color: this.data.color || 'var(--loading-spinner-color, #1989FA)',
|
|
34
|
+
}),
|
|
29
35
|
});
|
|
30
36
|
},
|
|
31
37
|
methods: {
|
package/lib/loading/index.wxml
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<view class="custom-class {{ utils.bem('loading', { vertical }) }}">
|
|
5
5
|
<view
|
|
6
6
|
class="smart-loading__spinner smart-loading__spinner--{{ type }}"
|
|
7
|
-
style="{{ computed.loadingStyle({ size, type, color, spinner, circular }) }}"
|
|
7
|
+
style="{{ computed.loadingStyle({ iconColor, size, type, color, spinner, circular }) }}"
|
|
8
8
|
>
|
|
9
9
|
<view
|
|
10
10
|
class="smart-switch__loading"
|
|
11
|
-
style="{{ computed.loadingStyle({ size, type, color, spinner, circular }) }}"
|
|
11
|
+
style="{{ computed.loadingStyle({ iconColor, size, type, color, spinner, circular }) }}"
|
|
12
12
|
/>
|
|
13
13
|
</view>
|
|
14
14
|
<view class="smart-loading__text" style="{{ computed.textStyle({ textSize, color }) }}">
|
package/lib/loading/index.wxs
CHANGED
|
@@ -5,7 +5,7 @@ var addUnit = require('../wxs/add-unit.wxs');
|
|
|
5
5
|
function textStyle(data) {
|
|
6
6
|
var ret = style({
|
|
7
7
|
'font-size': addUnit(data.textSize),
|
|
8
|
-
color: data.color,
|
|
8
|
+
color: data.color || 'var(--loading-text-color, #1989FA)',
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
return ret;
|
|
@@ -28,6 +28,7 @@ function loadingStyle(data) {
|
|
|
28
28
|
'-webkit-mask-size': addUnit(data.size),
|
|
29
29
|
width: addUnit(data.size),
|
|
30
30
|
height: addUnit(data.size),
|
|
31
|
+
background: data.iconColor || data.color || 'var(--loading-spinner-color, #1989FA)',
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
return ret;
|
package/lib/toast/index.js
CHANGED
|
@@ -15,6 +15,11 @@ var appLog_1 = __importDefault(require("../common/appLog"));
|
|
|
15
15
|
message: String,
|
|
16
16
|
forbidClick: Boolean,
|
|
17
17
|
nativeDisabled: Boolean,
|
|
18
|
+
iconColor: {
|
|
19
|
+
type: String,
|
|
20
|
+
value: 'white',
|
|
21
|
+
},
|
|
22
|
+
textColor: String,
|
|
18
23
|
zIndex: {
|
|
19
24
|
type: Number,
|
|
20
25
|
value: 1000,
|
package/lib/toast/index.wxml
CHANGED
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
>
|
|
17
17
|
|
|
18
18
|
<!-- text only -->
|
|
19
|
-
<text class="smart-toast__text" wx:if="{{ type === 'text' }}">{{ message }}</text>
|
|
19
|
+
<text class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}" wx:if="{{ type === 'text' }}">{{ message }}</text>
|
|
20
20
|
|
|
21
21
|
<!-- html only -->
|
|
22
|
-
<rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
|
|
22
|
+
<rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}" style="{{ textColor ? ('color: ' + textColor) : '' }}"></rich-text>
|
|
23
23
|
|
|
24
24
|
<!-- with icon -->
|
|
25
25
|
<block wx:else>
|
|
26
|
-
<smart-loading wx:if="{{ type === 'loading' }}" color="
|
|
27
|
-
<smart-icon wx:else color="
|
|
28
|
-
<text wx:if="{{ message }}" class="smart-toast__text">{{ message }}</text>
|
|
26
|
+
<smart-loading wx:if="{{ type === 'loading' }}" color="{{iconColor}}" style="transform:scale(1.6);" type="{{loadingType}}" />
|
|
27
|
+
<smart-icon wx:else color="{{iconColor}}" class="smart-toast__icon" style="transform:scale({{ type === 'success' ? 1.4 : type === 'fail' ? 1.1 : 1 }})" name="{{ type === 'success' ? success : type === 'fail' ? error : type === 'warn' ? warn : success }}" />
|
|
28
|
+
<text wx:if="{{ message }}" class="smart-toast__text" style="{{ textColor ? ('color: ' + textColor) : '' }}">{{ message }}</text>
|
|
29
29
|
</block>
|
|
30
30
|
|
|
31
31
|
<slot />
|
package/lib/toast/toast.d.ts
CHANGED