@tuya-miniapp/smart-ui 2.1.9-beta-1 → 2.1.10-beta-1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
|
|
1
1
|
import { SmartComponent } from '../../common/component';
|
2
|
-
import
|
2
|
+
import DialogInstance from '../../dialog/dialog';
|
3
3
|
const message = 'Body';
|
4
4
|
SmartComponent({
|
5
5
|
data: {
|
@@ -15,7 +15,7 @@ SmartComponent({
|
|
15
15
|
},
|
16
16
|
onClickThemeAlert() {
|
17
17
|
console.log('=== click theme alert');
|
18
|
-
|
18
|
+
DialogInstance.alert({
|
19
19
|
context: this,
|
20
20
|
title: 'Title',
|
21
21
|
theme: 'round-button',
|
@@ -27,7 +27,7 @@ SmartComponent({
|
|
27
27
|
},
|
28
28
|
onClickThemeAlert2() {
|
29
29
|
console.log('=== 222 click theme alert');
|
30
|
-
|
30
|
+
DialogInstance.alert({
|
31
31
|
context: this,
|
32
32
|
theme: 'round-button',
|
33
33
|
message,
|
@@ -36,7 +36,7 @@ SmartComponent({
|
|
36
36
|
});
|
37
37
|
},
|
38
38
|
onClickAlert() {
|
39
|
-
|
39
|
+
DialogInstance.alert({
|
40
40
|
context: this,
|
41
41
|
title: 'Title',
|
42
42
|
icon: false,
|
@@ -46,7 +46,7 @@ SmartComponent({
|
|
46
46
|
});
|
47
47
|
},
|
48
48
|
onClickAlert2() {
|
49
|
-
|
49
|
+
DialogInstance.alert({
|
50
50
|
context: this,
|
51
51
|
message: 'Title',
|
52
52
|
confirmButtonText: I18n.t('confirm'),
|
@@ -54,7 +54,7 @@ SmartComponent({
|
|
54
54
|
});
|
55
55
|
},
|
56
56
|
onClickConfirm() {
|
57
|
-
|
57
|
+
DialogInstance.confirm({
|
58
58
|
context: this,
|
59
59
|
title: 'Title',
|
60
60
|
icon: false,
|
@@ -64,7 +64,7 @@ SmartComponent({
|
|
64
64
|
});
|
65
65
|
},
|
66
66
|
onClickConfirmIcon() {
|
67
|
-
|
67
|
+
DialogInstance.confirm({
|
68
68
|
context: this,
|
69
69
|
title: 'Title',
|
70
70
|
icon: true,
|
@@ -85,7 +85,7 @@ SmartComponent({
|
|
85
85
|
}
|
86
86
|
}, 1000);
|
87
87
|
});
|
88
|
-
|
88
|
+
DialogInstance.input({
|
89
89
|
context: this,
|
90
90
|
title: 'Title',
|
91
91
|
value: this.data.inputValue,
|
@@ -115,7 +115,7 @@ SmartComponent({
|
|
115
115
|
}
|
116
116
|
}, 1000);
|
117
117
|
});
|
118
|
-
|
118
|
+
DialogInstance.confirm({
|
119
119
|
context: this,
|
120
120
|
title: 'Title',
|
121
121
|
icon: false,
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color
|
1
|
+
@import '../common/index.css';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color,#e7f3fe);color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--info{--icon-color:var(--notice-bar-info-color,#1989fa)}.smart-notice-bar--warning{--icon-color:var(--notice-bar-warning-color,#ffa000);background-color:var(--notice-bar-background-warning-color,#fff5e5)}.smart-notice-bar--error{--icon-color:var(--notice-bar-error-color,#f04c4c);background-color:var(--notice-bar-background-error-color,#fdeded)}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{--icon-color:var(--notice-bar-right-icon-color,rgba(0,0,0,.2));font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:var(--notice-bar-btn-color,var(--app-M4,#1989fa));display:inline-block}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color
|
1
|
+
@import '../common/index.wxss';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color,#e7f3fe);color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--info{--icon-color:var(--notice-bar-info-color,#1989fa)}.smart-notice-bar--warning{--icon-color:var(--notice-bar-warning-color,#ffa000);background-color:var(--notice-bar-background-warning-color,#fff5e5)}.smart-notice-bar--error{--icon-color:var(--notice-bar-error-color,#f04c4c);background-color:var(--notice-bar-background-error-color,#fdeded)}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{--icon-color:var(--notice-bar-right-icon-color,rgba(0,0,0,.2));font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:var(--notice-bar-btn-color,var(--app-M4,#1989fa));display:inline-block}
|
package/dist/toast/demo/index.js
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
import { SmartComponent } from '../../common/component';
|
2
|
-
import
|
2
|
+
import ToastInstance from '../../toast/toast';
|
3
3
|
SmartComponent({
|
4
4
|
methods: {
|
5
5
|
showToast() {
|
6
|
-
|
6
|
+
ToastInstance({ context: this, message: I18n.t('promptContent') });
|
7
7
|
},
|
8
8
|
showLongToast() {
|
9
|
-
|
9
|
+
ToastInstance({
|
10
10
|
context: this,
|
11
11
|
message: I18n.t('toastDemoTip1'),
|
12
12
|
});
|
13
13
|
},
|
14
14
|
showLoadingToast() {
|
15
|
-
|
15
|
+
ToastInstance.loading({
|
16
16
|
context: this,
|
17
17
|
message: I18n.t('loading') + '...',
|
18
18
|
forbidClick: true,
|
19
19
|
});
|
20
20
|
},
|
21
21
|
showCustomLoadingToast() {
|
22
|
-
|
22
|
+
ToastInstance.loading({
|
23
23
|
context: this,
|
24
24
|
message: I18n.t('loading') + '...',
|
25
25
|
forbidClick: true,
|
@@ -27,17 +27,17 @@ SmartComponent({
|
|
27
27
|
});
|
28
28
|
},
|
29
29
|
showSuccessToast() {
|
30
|
-
|
30
|
+
ToastInstance.success({ context: this, message: I18n.t('successMessage') });
|
31
31
|
},
|
32
32
|
showFailToast() {
|
33
|
-
|
33
|
+
ToastInstance.fail({ context: this, message: I18n.t('failurePrompt') });
|
34
34
|
},
|
35
35
|
showWarnToast() {
|
36
|
-
|
36
|
+
ToastInstance.warn({ context: this, message: I18n.t('warningPrompt') });
|
37
37
|
},
|
38
38
|
showCustomizedToast() {
|
39
39
|
const text = (second) => `${I18n.t('countdown')} ${second} ${I18n.t('second')}`;
|
40
|
-
const toast =
|
40
|
+
const toast = ToastInstance.loading({
|
41
41
|
context: this,
|
42
42
|
duration: 0,
|
43
43
|
forbidClick: true,
|
@@ -51,12 +51,12 @@ SmartComponent({
|
|
51
51
|
}
|
52
52
|
else {
|
53
53
|
clearInterval(timer);
|
54
|
-
|
54
|
+
ToastInstance.clear();
|
55
55
|
}
|
56
56
|
}, 1000);
|
57
57
|
},
|
58
58
|
showCustomizedWidthToast() {
|
59
|
-
|
59
|
+
ToastInstance.loading({
|
60
60
|
context: this,
|
61
61
|
message: I18n.t('loading') + '...',
|
62
62
|
forbidClick: true,
|
package/lib/notice-bar/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color
|
1
|
+
@import '../common/index.css';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color,#e7f3fe);color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--info{--icon-color:var(--notice-bar-info-color,#1989fa)}.smart-notice-bar--warning{--icon-color:var(--notice-bar-warning-color,#ffa000);background-color:var(--notice-bar-background-warning-color,#fff5e5)}.smart-notice-bar--error{--icon-color:var(--notice-bar-error-color,#f04c4c);background-color:var(--notice-bar-background-error-color,#fdeded)}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{--icon-color:var(--notice-bar-right-icon-color,rgba(0,0,0,.2));font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:var(--notice-bar-btn-color,var(--app-M4,#1989fa));display:inline-block}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color
|
1
|
+
@import '../common/index.wxss';.smart-notice-bar{align-items:center;background-color:var(--notice-bar-background-color,#e7f3fe);color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--info{--icon-color:var(--notice-bar-info-color,#1989fa)}.smart-notice-bar--warning{--icon-color:var(--notice-bar-warning-color,#ffa000);background-color:var(--notice-bar-background-warning-color,#fff5e5)}.smart-notice-bar--error{--icon-color:var(--notice-bar-error-color,#f04c4c);background-color:var(--notice-bar-background-error-color,#fdeded)}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{--icon-color:var(--notice-bar-right-icon-color,rgba(0,0,0,.2));font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:var(--notice-bar-btn-color,var(--app-M4,#1989fa));display:inline-block}
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tuya-miniapp/smart-ui",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.10-beta-1",
|
4
4
|
"author": "MiniApp Team",
|
5
5
|
"license": "MIT",
|
6
6
|
"miniprogram": "lib",
|
7
7
|
"description": "轻量、可靠的智能小程序 UI 组件库",
|
8
8
|
"scripts": {
|
9
|
-
"
|
9
|
+
"prepublishOnly": "node ./build/transCSSVar.js",
|
10
10
|
"dev": "NODE_OPTIONS=--no-experimental-fetch node build/dev.mjs",
|
11
11
|
"lint": "eslint ./packages --ext .js,.ts --fix",
|
12
12
|
"lint:style": "stylelint \"packages/**/*.less\" --fix",
|