@tuya-miniapp/smart-ui 2.1.11-beta-9 → 2.1.11-beta-11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/toast/toast.js +7 -5
- package/lib/datetime-picker/demo/index.js +12 -1
- package/lib/picker/demo/index.js +10 -0
- package/lib/toast/toast.js +7 -5
- package/package.json +3 -1
- package/dist/action-sheet/demo/index.d.ts +0 -1
- package/dist/action-sheet/demo/index.js +0 -110
- package/dist/area/demo/index.d.ts +0 -1
- package/dist/area/demo/index.js +0 -41
- package/dist/battery/demo/index.d.ts +0 -1
- package/dist/battery/demo/index.js +0 -2
- package/dist/bottom-sheet/demo/index.d.ts +0 -1
- package/dist/bottom-sheet/demo/index.js +0 -24
- package/dist/button/demo/index.d.ts +0 -1
- package/dist/button/demo/index.js +0 -9
- package/dist/calendar/demo/index.d.ts +0 -1
- package/dist/calendar/demo/index.js +0 -106
- package/dist/cascader/demo/index.d.ts +0 -1
- package/dist/cascader/demo/index.js +0 -191
- package/dist/cell/demo/index.d.ts +0 -1
- package/dist/cell/demo/index.js +0 -15
- package/dist/checkbox/demo/index.d.ts +0 -1
- package/dist/checkbox/demo/index.js +0 -34
- package/dist/circle/demo/index.d.ts +0 -1
- package/dist/circle/demo/index.js +0 -19
- package/dist/col/demo/index.d.ts +0 -1
- package/dist/col/demo/index.js +0 -4
- package/dist/collapse/demo/index.d.ts +0 -1
- package/dist/collapse/demo/index.js +0 -36
- package/dist/config-provider/demo/index.d.ts +0 -1
- package/dist/config-provider/demo/index.js +0 -22
- package/dist/count-down/demo/index.d.ts +0 -1
- package/dist/count-down/demo/index.js +0 -33
- package/dist/custom-keyboard/demo/index.d.ts +0 -1
- package/dist/custom-keyboard/demo/index.js +0 -17
- package/dist/datetime-picker/demo/index.d.ts +0 -1
- package/dist/datetime-picker/demo/index.js +0 -83
- package/dist/dialog/demo/index.d.ts +0 -1
- package/dist/dialog/demo/index.js +0 -134
- package/dist/divider/demo/index.d.ts +0 -1
- package/dist/divider/demo/index.js +0 -4
- package/dist/dropdown-menu/demo/index.d.ts +0 -1
- package/dist/dropdown-menu/demo/index.js +0 -47
- package/dist/empty/demo/index.d.ts +0 -1
- package/dist/empty/demo/index.js +0 -13
- package/dist/field/demo/index.d.ts +0 -1
- package/dist/field/demo/index.js +0 -20
- package/dist/goods-action/demo/index.d.ts +0 -1
- package/dist/goods-action/demo/index.js +0 -12
- package/dist/grid/demo/index.d.ts +0 -1
- package/dist/grid/demo/index.js +0 -9
- package/dist/icon/demo/index.d.ts +0 -1
- package/dist/icon/demo/index.js +0 -26
- package/dist/image/demo/index.d.ts +0 -1
- package/dist/image/demo/index.js +0 -15
- package/dist/index-bar/demo/index.d.ts +0 -1
- package/dist/index-bar/demo/index.js +0 -21
- package/dist/loading/demo/index.d.ts +0 -1
- package/dist/loading/demo/index.js +0 -4
- package/dist/nav-bar/demo/index.d.ts +0 -1
- package/dist/nav-bar/demo/index.js +0 -26
- package/dist/normal-slider/demo/index.d.ts +0 -1
- package/dist/normal-slider/demo/index.js +0 -19
- package/dist/notice-bar/demo/index.d.ts +0 -1
- package/dist/notice-bar/demo/index.js +0 -11
- package/dist/notify/demo/index.d.ts +0 -1
- package/dist/notify/demo/index.js +0 -45
- package/dist/overlay/demo/index.d.ts +0 -1
- package/dist/overlay/demo/index.js +0 -22
- package/dist/picker/demo/index.d.ts +0 -1
- package/dist/picker/demo/index.js +0 -77
- package/dist/popup/demo/index.d.ts +0 -1
- package/dist/popup/demo/index.js +0 -79
- package/dist/progress/demo/index.d.ts +0 -1
- package/dist/progress/demo/index.js +0 -4
- package/dist/radio/demo/index.d.ts +0 -1
- package/dist/radio/demo/index.js +0 -31
- package/dist/rate/demo/index.d.ts +0 -1
- package/dist/rate/demo/index.js +0 -25
- package/dist/search/demo/index.d.ts +0 -1
- package/dist/search/demo/index.js +0 -43
- package/dist/sidebar/demo/index.d.ts +0 -1
- package/dist/sidebar/demo/index.js +0 -9
- package/dist/skeleton/demo/index.d.ts +0 -1
- package/dist/skeleton/demo/index.js +0 -11
- package/dist/slider/demo/index.d.ts +0 -1
- package/dist/slider/demo/index.js +0 -19
- package/dist/stepper/demo/index.d.ts +0 -1
- package/dist/stepper/demo/index.js +0 -19
- package/dist/steps/demo/index.d.ts +0 -1
- package/dist/steps/demo/index.js +0 -43
- package/dist/sticky/demo/index.d.ts +0 -1
- package/dist/sticky/demo/index.js +0 -26
- package/dist/swipe-cell/demo/index.d.ts +0 -1
- package/dist/swipe-cell/demo/index.js +0 -45
- package/dist/switch/demo/index.d.ts +0 -1
- package/dist/switch/demo/index.js +0 -29
- package/dist/tab/demo/index.d.ts +0 -1
- package/dist/tab/demo/index.js +0 -55
- package/dist/tabbar/demo/index.d.ts +0 -1
- package/dist/tabbar/demo/index.js +0 -34
- package/dist/tag/demo/index.d.ts +0 -1
- package/dist/tag/demo/index.js +0 -16
- package/dist/toast/demo/index.d.ts +0 -1
- package/dist/toast/demo/index.js +0 -67
- package/dist/transition/demo/index.d.ts +0 -1
- package/dist/transition/demo/index.js +0 -67
- package/dist/tree-select/demo/index.d.ts +0 -1
- package/dist/tree-select/demo/index.js +0 -113
package/dist/tab/demo/index.js
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
tabs2: [1, 2],
|
5
|
-
tabs3: [1, 2, 3],
|
6
|
-
tabs4: [1, 2, 3, 4],
|
7
|
-
tabs6: [1, 2, 3, 4, 5, 6],
|
8
|
-
tabsWithName: [
|
9
|
-
{ name: 'a', index: 1 },
|
10
|
-
{ name: 'b', index: 2 },
|
11
|
-
{ name: 'c', index: 3 },
|
12
|
-
],
|
13
|
-
},
|
14
|
-
methods: {
|
15
|
-
onClickDisabled(event) {
|
16
|
-
wx.showToast({
|
17
|
-
title: `${I18n.t('label')} ${event.detail.index + 1} ${I18n.t('hasBeenDisabled')}`,
|
18
|
-
icon: 'none',
|
19
|
-
});
|
20
|
-
},
|
21
|
-
onChange(event) {
|
22
|
-
wx.showToast({
|
23
|
-
title: `${I18n.t('switchToTab')} ${event.detail.index + 1}`,
|
24
|
-
icon: 'none',
|
25
|
-
});
|
26
|
-
},
|
27
|
-
onClickNavRight() {
|
28
|
-
wx.showToast({
|
29
|
-
title: `${I18n.t('click')} right nav`,
|
30
|
-
icon: 'none',
|
31
|
-
});
|
32
|
-
},
|
33
|
-
onClick(event) {
|
34
|
-
wx.showToast({
|
35
|
-
title: `${I18n.t('clickTag')} ${event.detail.index + 1}`,
|
36
|
-
icon: 'none',
|
37
|
-
});
|
38
|
-
},
|
39
|
-
onBeforeChange(event) {
|
40
|
-
const { callback, title } = event.detail;
|
41
|
-
wx.showModal({
|
42
|
-
title: I18n.t('asynchronousSwitching'),
|
43
|
-
content: `${I18n.t('areYouSureYouWantToSwitchTo')} ${title}?`,
|
44
|
-
success: (res) => {
|
45
|
-
if (res.confirm) {
|
46
|
-
callback(true);
|
47
|
-
}
|
48
|
-
else if (res.cancel) {
|
49
|
-
callback(false);
|
50
|
-
}
|
51
|
-
},
|
52
|
-
});
|
53
|
-
},
|
54
|
-
},
|
55
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import Tornado from '@tuya-miniapp/icons/dist/svg/Tornado';
|
2
|
-
import Timer from '@tuya-miniapp/icons/dist/svg/Timer';
|
3
|
-
import TorSnownado from '@tuya-miniapp/icons/dist/svg/Snow';
|
4
|
-
import Connect from '@tuya-miniapp/icons/dist/svg/Connect';
|
5
|
-
import { SmartComponent } from '../../common/component';
|
6
|
-
SmartComponent({
|
7
|
-
data: {
|
8
|
-
active: 0,
|
9
|
-
active2: 'home',
|
10
|
-
active3: 0,
|
11
|
-
active4: 0,
|
12
|
-
active5: 0,
|
13
|
-
active6: 0,
|
14
|
-
icon: {
|
15
|
-
normal: '',
|
16
|
-
active: 'https://static1.tuyacn.com/static/tuya-miniapp-doc/_next/static/images/logo-small.png',
|
17
|
-
},
|
18
|
-
defaultIcon1: Tornado,
|
19
|
-
defaultIcon2: Timer,
|
20
|
-
defaultIcon3: TorSnownado,
|
21
|
-
defaultIcon4: Connect,
|
22
|
-
},
|
23
|
-
methods: {
|
24
|
-
onChange(event) {
|
25
|
-
const { key } = event.currentTarget.dataset;
|
26
|
-
this.setData({ [key]: event.detail });
|
27
|
-
},
|
28
|
-
handleChange(event) {
|
29
|
-
const { key } = event.currentTarget.dataset;
|
30
|
-
this.setData({ [key]: event.detail });
|
31
|
-
wx.showToast({ title: `${I18n.t('clickTheTab')} ${event.detail + 1}`, icon: 'none' });
|
32
|
-
},
|
33
|
-
},
|
34
|
-
});
|
package/dist/tag/demo/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/tag/demo/index.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
show: {
|
5
|
-
success: true,
|
6
|
-
primary: true,
|
7
|
-
},
|
8
|
-
},
|
9
|
-
methods: {
|
10
|
-
onClose(event) {
|
11
|
-
this.setData({
|
12
|
-
[`show.${event.target.id}`]: false,
|
13
|
-
});
|
14
|
-
},
|
15
|
-
},
|
16
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/toast/demo/index.js
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
import ToastInstance from '../../toast/toast';
|
3
|
-
SmartComponent({
|
4
|
-
methods: {
|
5
|
-
showToast() {
|
6
|
-
ToastInstance({ context: this, message: I18n.t('promptContent') });
|
7
|
-
},
|
8
|
-
showLongToast() {
|
9
|
-
ToastInstance({
|
10
|
-
context: this,
|
11
|
-
message: I18n.t('toastDemoTip1'),
|
12
|
-
});
|
13
|
-
},
|
14
|
-
showLoadingToast() {
|
15
|
-
ToastInstance.loading({
|
16
|
-
context: this,
|
17
|
-
message: I18n.t('loading') + '...',
|
18
|
-
forbidClick: true,
|
19
|
-
});
|
20
|
-
},
|
21
|
-
showCustomLoadingToast() {
|
22
|
-
ToastInstance.loading({
|
23
|
-
context: this,
|
24
|
-
message: I18n.t('loading') + '...',
|
25
|
-
forbidClick: true,
|
26
|
-
loadingType: 'spinner',
|
27
|
-
});
|
28
|
-
},
|
29
|
-
showSuccessToast() {
|
30
|
-
ToastInstance.success({ context: this, message: I18n.t('successMessage') });
|
31
|
-
},
|
32
|
-
showFailToast() {
|
33
|
-
ToastInstance.fail({ context: this, message: I18n.t('failurePrompt') });
|
34
|
-
},
|
35
|
-
showWarnToast() {
|
36
|
-
ToastInstance.warn({ context: this, message: I18n.t('warningPrompt') });
|
37
|
-
},
|
38
|
-
showCustomizedToast() {
|
39
|
-
const text = (second) => `${I18n.t('countdown')} ${second} ${I18n.t('second')}`;
|
40
|
-
const toast = ToastInstance.loading({
|
41
|
-
context: this,
|
42
|
-
duration: 0,
|
43
|
-
forbidClick: true,
|
44
|
-
message: text(3),
|
45
|
-
});
|
46
|
-
let second = 3;
|
47
|
-
const timer = setInterval(() => {
|
48
|
-
second--;
|
49
|
-
if (second) {
|
50
|
-
toast === null || toast === void 0 ? void 0 : toast.setData({ message: text(second) });
|
51
|
-
}
|
52
|
-
else {
|
53
|
-
clearInterval(timer);
|
54
|
-
ToastInstance.clear();
|
55
|
-
}
|
56
|
-
}, 1000);
|
57
|
-
},
|
58
|
-
showCustomizedWidthToast() {
|
59
|
-
ToastInstance.loading({
|
60
|
-
context: this,
|
61
|
-
message: I18n.t('loading') + '...',
|
62
|
-
forbidClick: true,
|
63
|
-
width: 200,
|
64
|
-
});
|
65
|
-
},
|
66
|
-
},
|
67
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,67 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
show: false,
|
5
|
-
name: 'fade',
|
6
|
-
showCustom: false,
|
7
|
-
},
|
8
|
-
methods: {
|
9
|
-
onClickFade() {
|
10
|
-
this.trigger('fade');
|
11
|
-
},
|
12
|
-
onClickFadeUp() {
|
13
|
-
this.trigger('fade-up');
|
14
|
-
},
|
15
|
-
onClickFadeDown() {
|
16
|
-
this.trigger('fade-down');
|
17
|
-
},
|
18
|
-
onClickFadeLeft() {
|
19
|
-
this.trigger('fade-left');
|
20
|
-
},
|
21
|
-
onClickFadeRight() {
|
22
|
-
this.trigger('fade-right');
|
23
|
-
},
|
24
|
-
onClickSlideUp() {
|
25
|
-
this.trigger('slide-up');
|
26
|
-
},
|
27
|
-
onClickSlideDown() {
|
28
|
-
this.trigger('slide-down');
|
29
|
-
},
|
30
|
-
onClickSlideLeft() {
|
31
|
-
this.trigger('slide-left');
|
32
|
-
},
|
33
|
-
onClickSlideRight() {
|
34
|
-
this.trigger('slide-right');
|
35
|
-
},
|
36
|
-
trigger(name) {
|
37
|
-
this.setData({ name, show: true });
|
38
|
-
setTimeout(() => {
|
39
|
-
this.setData({ show: false });
|
40
|
-
}, 500);
|
41
|
-
},
|
42
|
-
onClickCustom() {
|
43
|
-
this.setData({ showCustom: true });
|
44
|
-
setTimeout(() => {
|
45
|
-
this.setData({ showCustom: false });
|
46
|
-
}, 1000);
|
47
|
-
},
|
48
|
-
onBeforeEnter() {
|
49
|
-
console.log('before enter');
|
50
|
-
},
|
51
|
-
onEnter() {
|
52
|
-
console.log('enter');
|
53
|
-
},
|
54
|
-
onAfterEnter() {
|
55
|
-
console.log('after enter');
|
56
|
-
},
|
57
|
-
onBeforeLeave() {
|
58
|
-
console.log('before leave');
|
59
|
-
},
|
60
|
-
onLeave() {
|
61
|
-
console.log('leave');
|
62
|
-
},
|
63
|
-
onAfterLeave() {
|
64
|
-
console.log('after leave');
|
65
|
-
},
|
66
|
-
},
|
67
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,113 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
const config = {
|
3
|
-
pro1Name: I18n.t('zhejiang'),
|
4
|
-
pro1: [
|
5
|
-
{
|
6
|
-
text: I18n.t('hangzhou'),
|
7
|
-
id: 1,
|
8
|
-
},
|
9
|
-
{
|
10
|
-
text: I18n.t('wenzhou'),
|
11
|
-
id: 2,
|
12
|
-
},
|
13
|
-
{
|
14
|
-
text: I18n.t('ningbo'),
|
15
|
-
id: 3,
|
16
|
-
disabled: true,
|
17
|
-
},
|
18
|
-
{
|
19
|
-
text: I18n.t('yiwu'),
|
20
|
-
id: 4,
|
21
|
-
},
|
22
|
-
],
|
23
|
-
pro2Name: I18n.t('jiangsu'),
|
24
|
-
pro2: [
|
25
|
-
{
|
26
|
-
text: I18n.t('nanjing'),
|
27
|
-
id: 5,
|
28
|
-
},
|
29
|
-
{
|
30
|
-
text: I18n.t('wuxi'),
|
31
|
-
id: 6,
|
32
|
-
},
|
33
|
-
{
|
34
|
-
text: I18n.t('xuzhou'),
|
35
|
-
id: 7,
|
36
|
-
},
|
37
|
-
{
|
38
|
-
text: I18n.t('suzhou'),
|
39
|
-
id: 8,
|
40
|
-
},
|
41
|
-
],
|
42
|
-
pro3Name: I18n.t('fujian'),
|
43
|
-
pro3: [
|
44
|
-
{
|
45
|
-
text: I18n.t('quanzhou'),
|
46
|
-
id: 9,
|
47
|
-
},
|
48
|
-
{
|
49
|
-
text: I18n.t('xiamen'),
|
50
|
-
id: 10,
|
51
|
-
},
|
52
|
-
],
|
53
|
-
};
|
54
|
-
const items = [
|
55
|
-
{
|
56
|
-
text: config.pro1Name,
|
57
|
-
options: config.pro1,
|
58
|
-
},
|
59
|
-
{
|
60
|
-
text: config.pro2Name,
|
61
|
-
options: config.pro2,
|
62
|
-
},
|
63
|
-
{
|
64
|
-
text: config.pro3Name,
|
65
|
-
disabled: true,
|
66
|
-
options: config.pro3,
|
67
|
-
},
|
68
|
-
];
|
69
|
-
SmartComponent({
|
70
|
-
data: {
|
71
|
-
items,
|
72
|
-
badgeItems: items.slice(0, 2).map((item, index) => {
|
73
|
-
if (index === 0) {
|
74
|
-
return Object.assign(Object.assign({}, item), { dot: true });
|
75
|
-
}
|
76
|
-
if (index === 1) {
|
77
|
-
return Object.assign(Object.assign({}, item), { badge: 5 });
|
78
|
-
}
|
79
|
-
return item;
|
80
|
-
}),
|
81
|
-
mainActiveIndex: 0,
|
82
|
-
activeId: 0,
|
83
|
-
mainActiveIndexMulti: 0,
|
84
|
-
activeIdMulti: [],
|
85
|
-
},
|
86
|
-
methods: {
|
87
|
-
onClickNav({ detail }) {
|
88
|
-
this.setData({
|
89
|
-
mainActiveIndex: detail.index || 0,
|
90
|
-
});
|
91
|
-
},
|
92
|
-
onClickItem({ detail }) {
|
93
|
-
const activeId = this.data.activeId === detail.id ? null : detail.id;
|
94
|
-
this.setData({ activeId });
|
95
|
-
},
|
96
|
-
onClickNavMulti({ detail }) {
|
97
|
-
this.setData({
|
98
|
-
mainActiveIndexMulti: detail.index || 0,
|
99
|
-
});
|
100
|
-
},
|
101
|
-
onClickItemMulti({ detail }) {
|
102
|
-
const { activeIdMulti } = this.data;
|
103
|
-
const idx = activeIdMulti.indexOf(detail.id);
|
104
|
-
if (idx > -1) {
|
105
|
-
activeIdMulti.splice(idx, 1);
|
106
|
-
}
|
107
|
-
else {
|
108
|
-
activeIdMulti.push(detail.id);
|
109
|
-
}
|
110
|
-
this.setData({ activeIdMulti });
|
111
|
-
},
|
112
|
-
},
|
113
|
-
});
|