@tuya-miniapp/smart-ui 2.0.0-beta-2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/image/index.css +1 -1
- package/dist/image/index.js +2 -0
- package/dist/image/index.wxml +2 -2
- package/dist/image/index.wxs +3 -0
- package/dist/image/index.wxss +1 -1
- package/lib/image/index.css +1 -1
- package/lib/image/index.js +5 -0
- package/lib/image/index.wxml +2 -2
- package/lib/image/index.wxs +3 -0
- package/lib/image/index.wxss +1 -1
- package/package.json +1 -1
package/dist/image/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-
|
1
|
+
@import '../common/index.css';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{--icon-color:var(--image-loading-icon-color,#dcdee0);color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-img{height:var(--image-error-size,32px);width:var(--image-error-size,32px)}
|
package/dist/image/index.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { SmartComponent } from '../common/component';
|
2
2
|
import { button } from '../mixins/button';
|
3
|
+
import LoadingSvg from '@tuya-miniapp/icons/dist/svg/Loading';
|
3
4
|
SmartComponent({
|
4
5
|
mixins: [button],
|
5
6
|
classes: ['custom-class', 'loading-class', 'error-class', 'image-class'],
|
@@ -41,6 +42,7 @@ SmartComponent({
|
|
41
42
|
data: {
|
42
43
|
error: false,
|
43
44
|
loading: true,
|
45
|
+
loadingSvg: LoadingSvg,
|
44
46
|
viewStyle: '',
|
45
47
|
},
|
46
48
|
methods: {
|
package/dist/image/index.wxml
CHANGED
@@ -23,13 +23,13 @@
|
|
23
23
|
class="loading-class smart-image__loading"
|
24
24
|
>
|
25
25
|
<slot wx:if="{{ useLoadingSlot }}" name="loading" />
|
26
|
-
<smart-icon wx:else name="
|
26
|
+
<smart-icon wx:else name="{{ loadingSvg }}" custom-class="smart-image__loading-icon" />
|
27
27
|
</view>
|
28
28
|
<view
|
29
29
|
wx:if="{{ error && showError }}"
|
30
30
|
class="error-class smart-image__error"
|
31
31
|
>
|
32
32
|
<slot wx:if="{{ useErrorSlot }}" name="error" />
|
33
|
-
<
|
33
|
+
<image wx:else src="{{ computed.defaultErrorImg }}" class="smart-image__error-img" />
|
34
34
|
</view>
|
35
35
|
</view>
|
package/dist/image/index.wxs
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
var style = require('../wxs/style.wxs');
|
3
3
|
var addUnit = require('../wxs/add-unit.wxs');
|
4
|
+
/* eslint-disable */
|
5
|
+
var defaultErrorImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAACRQTFRFR3BM2Nzf3t/f2t/f29zf293g3N7g3d/g3N/g3N7g3N7g3N7gsU8N3gAAAAt0Uk5TABAgMEJihqHE3+9M4B8/AAABhUlEQVR42u2XwY7DIAwFbQewzfv//1012+ipClCVvfSwc6iihBkoB6LIP9+E2pjJU5UXSusYU+XBcX+cbpy8YUajf6ddfuz5gMuJA4iq8hFW85qgnhefow6giEgALhtcpgI4ZIsC9PM3ZZMOmFQgZJMEyjcGtHp41e1Aw0nWzYDjom4FKkjZCSRIbAQKQPpGoAIg9teAfh4wgOTOJgaI7wQK/bSbUKKVNwHuQh5yQxPIug6IBR6EyQvG49V1GCBWalEhv2blAkNvgRn0r0HOwi2w9vW64h9k4L2fRv9B2jKgC5+FSUBbAIg68C1B0saB4xrkOvFZGAW4SIQ+b/SD/muBAfog8bwx8YHsYIA+8fNGpT+AAfrE1z4D9G80+ovAps/Aps/AzHf668Cmz8DYD71OobeBoZ+/fuB9oA99o78MHBjSjcf8ChXps/SDhjXBMXtLqCKifR4XsY4FybfRgMaDHMtVSsnVNjhm8OVlvphAJ/neVIiV5neenys+oFX9/0z8Hn4AdL9D/Fg+REQAAAAASUVORK5CYII="
|
4
6
|
|
5
7
|
function rootStyle(data) {
|
6
8
|
return style([
|
@@ -29,4 +31,5 @@ function mode(fit) {
|
|
29
31
|
module.exports = {
|
30
32
|
rootStyle: rootStyle,
|
31
33
|
mode: mode,
|
34
|
+
defaultErrorImg: defaultErrorImg,
|
32
35
|
};
|
package/dist/image/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-
|
1
|
+
@import '../common/index.wxss';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{--icon-color:var(--image-loading-icon-color,#dcdee0);color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-img{height:var(--image-error-size,32px);width:var(--image-error-size,32px)}
|
package/lib/image/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-
|
1
|
+
@import '../common/index.css';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{--icon-color:var(--image-loading-icon-color,#dcdee0);color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-img{height:var(--image-error-size,32px);width:var(--image-error-size,32px)}
|
package/lib/image/index.js
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
var component_1 = require("../common/component");
|
4
7
|
var button_1 = require("../mixins/button");
|
8
|
+
var Loading_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Loading"));
|
5
9
|
(0, component_1.SmartComponent)({
|
6
10
|
mixins: [button_1.button],
|
7
11
|
classes: ['custom-class', 'loading-class', 'error-class', 'image-class'],
|
@@ -43,6 +47,7 @@ var button_1 = require("../mixins/button");
|
|
43
47
|
data: {
|
44
48
|
error: false,
|
45
49
|
loading: true,
|
50
|
+
loadingSvg: Loading_1.default,
|
46
51
|
viewStyle: '',
|
47
52
|
},
|
48
53
|
methods: {
|
package/lib/image/index.wxml
CHANGED
@@ -23,13 +23,13 @@
|
|
23
23
|
class="loading-class smart-image__loading"
|
24
24
|
>
|
25
25
|
<slot wx:if="{{ useLoadingSlot }}" name="loading" />
|
26
|
-
<smart-icon wx:else name="
|
26
|
+
<smart-icon wx:else name="{{ loadingSvg }}" custom-class="smart-image__loading-icon" />
|
27
27
|
</view>
|
28
28
|
<view
|
29
29
|
wx:if="{{ error && showError }}"
|
30
30
|
class="error-class smart-image__error"
|
31
31
|
>
|
32
32
|
<slot wx:if="{{ useErrorSlot }}" name="error" />
|
33
|
-
<
|
33
|
+
<image wx:else src="{{ computed.defaultErrorImg }}" class="smart-image__error-img" />
|
34
34
|
</view>
|
35
35
|
</view>
|
package/lib/image/index.wxs
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
var style = require('../wxs/style.wxs');
|
3
3
|
var addUnit = require('../wxs/add-unit.wxs');
|
4
|
+
/* eslint-disable */
|
5
|
+
var defaultErrorImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAACRQTFRFR3BM2Nzf3t/f2t/f29zf293g3N7g3d/g3N/g3N7g3N7g3N7gsU8N3gAAAAt0Uk5TABAgMEJihqHE3+9M4B8/AAABhUlEQVR42u2XwY7DIAwFbQewzfv//1012+ipClCVvfSwc6iihBkoB6LIP9+E2pjJU5UXSusYU+XBcX+cbpy8YUajf6ddfuz5gMuJA4iq8hFW85qgnhefow6giEgALhtcpgI4ZIsC9PM3ZZMOmFQgZJMEyjcGtHp41e1Aw0nWzYDjom4FKkjZCSRIbAQKQPpGoAIg9teAfh4wgOTOJgaI7wQK/bSbUKKVNwHuQh5yQxPIug6IBR6EyQvG49V1GCBWalEhv2blAkNvgRn0r0HOwi2w9vW64h9k4L2fRv9B2jKgC5+FSUBbAIg68C1B0saB4xrkOvFZGAW4SIQ+b/SD/muBAfog8bwx8YHsYIA+8fNGpT+AAfrE1z4D9G80+ovAps/Aps/AzHf668Cmz8DYD71OobeBoZ+/fuB9oA99o78MHBjSjcf8ChXps/SDhjXBMXtLqCKifR4XsY4FybfRgMaDHMtVSsnVNjhm8OVlvphAJ/neVIiV5neenys+oFX9/0z8Hn4AdL9D/Fg+REQAAAAASUVORK5CYII="
|
4
6
|
|
5
7
|
function rootStyle(data) {
|
6
8
|
return style([
|
@@ -29,4 +31,5 @@ function mode(fit) {
|
|
29
31
|
module.exports = {
|
30
32
|
rootStyle: rootStyle,
|
31
33
|
mode: mode,
|
34
|
+
defaultErrorImg: defaultErrorImg,
|
32
35
|
};
|
package/lib/image/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-
|
1
|
+
@import '../common/index.wxss';.smart-image{display:inline-block;position:relative}.smart-image--round{border-radius:50%;overflow:hidden}.smart-image--round .smart-image__img{border-radius:inherit}.smart-image__error,.smart-image__img,.smart-image__loading{display:block;height:100%;width:100%}.smart-image__error,.smart-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.smart-image__loading-icon{--icon-color:var(--image-loading-icon-color,#dcdee0);color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.smart-image__error-img{height:var(--image-error-size,32px);width:var(--image-error-size,32px)}
|