@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
@@ -1,34 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
checkbox1: true,
|
5
|
-
checkbox2: true,
|
6
|
-
checkbox3: true,
|
7
|
-
checkboxLabel: true,
|
8
|
-
checkboxSize: true,
|
9
|
-
checkboxShape: true,
|
10
|
-
list: ['a', 'b', 'c'],
|
11
|
-
result: ['a', 'b'],
|
12
|
-
result2: [],
|
13
|
-
result3: [],
|
14
|
-
result4: [],
|
15
|
-
activeIcon: 'https://images.tuyacn.com/content-platform/hestia/1730877912e76cbdb7563.png',
|
16
|
-
inactiveIcon: '',
|
17
|
-
},
|
18
|
-
methods: {
|
19
|
-
onChange(event) {
|
20
|
-
const { key } = event.currentTarget.dataset;
|
21
|
-
this.setData({ [key]: event.detail });
|
22
|
-
},
|
23
|
-
onChange2(event) {
|
24
|
-
const { key } = event.currentTarget.dataset;
|
25
|
-
this.setData({ [key]: !event.detail });
|
26
|
-
},
|
27
|
-
toggle(event) {
|
28
|
-
const { index } = event.currentTarget.dataset;
|
29
|
-
const checkbox = this.selectComponent(`.checkboxes-${index}`);
|
30
|
-
checkbox.toggle();
|
31
|
-
},
|
32
|
-
noop() { },
|
33
|
-
},
|
34
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
const format = (rate) => Math.min(Math.max(rate, 0), 100);
|
3
|
-
SmartComponent({
|
4
|
-
data: {
|
5
|
-
value: 25,
|
6
|
-
gradientColor: {
|
7
|
-
'0%': '#ffd01e',
|
8
|
-
'100%': '#ee0a24',
|
9
|
-
},
|
10
|
-
},
|
11
|
-
methods: {
|
12
|
-
run(e) {
|
13
|
-
const step = parseFloat(e.currentTarget.dataset.step);
|
14
|
-
this.setData({
|
15
|
-
value: format((this.data.value += step)),
|
16
|
-
});
|
17
|
-
},
|
18
|
-
},
|
19
|
-
});
|
package/dist/col/demo/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/col/demo/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
import Toast from '../../toast/toast';
|
3
|
-
SmartComponent({
|
4
|
-
data: {
|
5
|
-
active1: [0],
|
6
|
-
active2: 0,
|
7
|
-
active3: [],
|
8
|
-
active4: [],
|
9
|
-
title1: I18n.t('title') + '1',
|
10
|
-
title2: I18n.t('title') + '2',
|
11
|
-
title3: I18n.t('title') + '3',
|
12
|
-
content1: I18n.t('codeIsWrittenForHumansToReadAndIncidentallyToRunOnMachines'),
|
13
|
-
content2: I18n.t('codeIsWrittenForHumansToReadAndIncidentallyToRunOnMachines'),
|
14
|
-
content3: I18n.t('codeIsWrittenForHumansToReadAndIncidentallyToRunOnMachines'),
|
15
|
-
},
|
16
|
-
methods: {
|
17
|
-
onChange(event) {
|
18
|
-
const { key } = event.currentTarget.dataset;
|
19
|
-
this.setData({
|
20
|
-
[key]: event.detail,
|
21
|
-
});
|
22
|
-
},
|
23
|
-
onOpen(event) {
|
24
|
-
Toast({
|
25
|
-
context: this,
|
26
|
-
message: `${I18n.t('expand')}: ${event.detail}`,
|
27
|
-
});
|
28
|
-
},
|
29
|
-
onClose(event) {
|
30
|
-
Toast({
|
31
|
-
context: this,
|
32
|
-
message: `${I18n.t('close')}: ${event.detail}`,
|
33
|
-
});
|
34
|
-
},
|
35
|
-
},
|
36
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
rate: 4,
|
5
|
-
slider: 50,
|
6
|
-
themeVars: {
|
7
|
-
buttonPrimaryBorderColor: 'red',
|
8
|
-
buttonPrimaryBackgroundColor: 'red',
|
9
|
-
},
|
10
|
-
},
|
11
|
-
methods: {
|
12
|
-
onChange(event) {
|
13
|
-
const { color } = event.currentTarget.dataset;
|
14
|
-
this.setData({
|
15
|
-
themeVars: {
|
16
|
-
buttonPrimaryBorderColor: color,
|
17
|
-
buttonPrimaryBackgroundColor: color,
|
18
|
-
},
|
19
|
-
});
|
20
|
-
},
|
21
|
-
},
|
22
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
import Toast from '../../toast/toast';
|
3
|
-
SmartComponent({
|
4
|
-
data: {
|
5
|
-
time: 30 * 60 * 60 * 1000,
|
6
|
-
timeData: {},
|
7
|
-
},
|
8
|
-
methods: {
|
9
|
-
onChange(e) {
|
10
|
-
this.setData({
|
11
|
-
timeData: e.detail,
|
12
|
-
});
|
13
|
-
},
|
14
|
-
start() {
|
15
|
-
const countDown = this.selectComponent('.control-count-down');
|
16
|
-
countDown.start();
|
17
|
-
},
|
18
|
-
pause() {
|
19
|
-
const countDown = this.selectComponent('.control-count-down');
|
20
|
-
countDown.pause();
|
21
|
-
},
|
22
|
-
reset() {
|
23
|
-
const countDown = this.selectComponent('.control-count-down');
|
24
|
-
countDown.reset();
|
25
|
-
},
|
26
|
-
finished() {
|
27
|
-
Toast({
|
28
|
-
context: this,
|
29
|
-
message: I18n.t('countdownEnded'),
|
30
|
-
});
|
31
|
-
},
|
32
|
-
},
|
33
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
value: '222',
|
5
|
-
},
|
6
|
-
methods: {
|
7
|
-
onChange(v) {
|
8
|
-
console.log('onChange value =====>', v.detail);
|
9
|
-
},
|
10
|
-
onConfirm(v) {
|
11
|
-
console.log('onConfirm value ====>', v.detail);
|
12
|
-
},
|
13
|
-
handleBtn() {
|
14
|
-
this.setData({ value: '1234' });
|
15
|
-
},
|
16
|
-
},
|
17
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
import Toast from '../../toast/toast';
|
3
|
-
SmartComponent({
|
4
|
-
data: {
|
5
|
-
minHour: 10,
|
6
|
-
maxHour: 20,
|
7
|
-
columnsOrder: [2, 1, 1],
|
8
|
-
minDate: new Date(2018, 0, 1).getTime(),
|
9
|
-
maxDate: new Date(2019, 10, 1).getTime(),
|
10
|
-
currentDate1: new Date(2018, 2, 31).getTime(),
|
11
|
-
currentDate2: null,
|
12
|
-
currentDate3: new Date(2018, 0, 1),
|
13
|
-
currentDate4: '12:00',
|
14
|
-
currentDate5: '11:00',
|
15
|
-
loading: false,
|
16
|
-
formatterMap: {
|
17
|
-
year: '{{year}}年',
|
18
|
-
month: {
|
19
|
-
'01': 'January',
|
20
|
-
'02': 'February',
|
21
|
-
'03': 'March',
|
22
|
-
'04': 'April',
|
23
|
-
'05': 'May',
|
24
|
-
'06': 'June',
|
25
|
-
'07': 'July',
|
26
|
-
'08': 'August',
|
27
|
-
'09': 'September',
|
28
|
-
'10': 'October',
|
29
|
-
'11': 'November',
|
30
|
-
'12': 'December',
|
31
|
-
},
|
32
|
-
day: '{{day}}日'
|
33
|
-
},
|
34
|
-
formatter(type, value) {
|
35
|
-
if (type === 'year') {
|
36
|
-
return `${value}${I18n.t('year')}`;
|
37
|
-
}
|
38
|
-
if (type === 'month') {
|
39
|
-
return `${value}${I18n.t('month')}`;
|
40
|
-
}
|
41
|
-
return value;
|
42
|
-
},
|
43
|
-
filter(type, options) {
|
44
|
-
if (type === 'minute') {
|
45
|
-
return options.filter((option) => option % 5 === 0);
|
46
|
-
}
|
47
|
-
return options;
|
48
|
-
},
|
49
|
-
locale: {
|
50
|
-
year: I18n.t('year'),
|
51
|
-
month: I18n.t('month'),
|
52
|
-
day: I18n.t('sun'),
|
53
|
-
hour: I18n.t('time'),
|
54
|
-
minute: I18n.t('minute'),
|
55
|
-
second: I18n.t('second'),
|
56
|
-
},
|
57
|
-
},
|
58
|
-
methods: {
|
59
|
-
onInput(event) {
|
60
|
-
const { detail, currentTarget } = event;
|
61
|
-
const result = this.getResult(detail, currentTarget.dataset.type);
|
62
|
-
Toast({
|
63
|
-
context: this,
|
64
|
-
message: result,
|
65
|
-
});
|
66
|
-
},
|
67
|
-
getResult(time, type) {
|
68
|
-
const date = new Date(time);
|
69
|
-
switch (type) {
|
70
|
-
case 'datetime':
|
71
|
-
return date.toLocaleString();
|
72
|
-
case 'date':
|
73
|
-
return date.toLocaleDateString();
|
74
|
-
case 'year-month':
|
75
|
-
return `${date.getFullYear()}/${date.getMonth() + 1}`;
|
76
|
-
case 'time':
|
77
|
-
return time;
|
78
|
-
default:
|
79
|
-
return '';
|
80
|
-
}
|
81
|
-
},
|
82
|
-
},
|
83
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,134 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
import DialogInstance from '../../dialog/dialog';
|
3
|
-
const message = 'Body';
|
4
|
-
SmartComponent({
|
5
|
-
data: {
|
6
|
-
show: false,
|
7
|
-
inputValue: '',
|
8
|
-
},
|
9
|
-
methods: {
|
10
|
-
showCustomDialog() {
|
11
|
-
this.setData({ show: true });
|
12
|
-
},
|
13
|
-
getUserInfo(event) {
|
14
|
-
console.log(event.detail);
|
15
|
-
},
|
16
|
-
onClickThemeAlert() {
|
17
|
-
console.log('=== click theme alert');
|
18
|
-
DialogInstance.alert({
|
19
|
-
context: this,
|
20
|
-
title: 'Title',
|
21
|
-
theme: 'round-button',
|
22
|
-
icon: false,
|
23
|
-
message,
|
24
|
-
confirmButtonText: I18n.t('confirm'),
|
25
|
-
cancelButtonText: I18n.t('cancel'),
|
26
|
-
});
|
27
|
-
},
|
28
|
-
onClickThemeAlert2() {
|
29
|
-
console.log('=== 222 click theme alert');
|
30
|
-
DialogInstance.alert({
|
31
|
-
context: this,
|
32
|
-
theme: 'round-button',
|
33
|
-
message,
|
34
|
-
confirmButtonText: I18n.t('confirm'),
|
35
|
-
cancelButtonText: I18n.t('cancel'),
|
36
|
-
});
|
37
|
-
},
|
38
|
-
onClickAlert() {
|
39
|
-
DialogInstance.alert({
|
40
|
-
context: this,
|
41
|
-
title: 'Title',
|
42
|
-
icon: false,
|
43
|
-
message,
|
44
|
-
confirmButtonText: I18n.t('confirm'),
|
45
|
-
cancelButtonText: I18n.t('cancel'),
|
46
|
-
});
|
47
|
-
},
|
48
|
-
onClickAlert2() {
|
49
|
-
DialogInstance.alert({
|
50
|
-
context: this,
|
51
|
-
message: 'Title',
|
52
|
-
confirmButtonText: I18n.t('confirm'),
|
53
|
-
cancelButtonText: I18n.t('cancel'),
|
54
|
-
});
|
55
|
-
},
|
56
|
-
onClickConfirm() {
|
57
|
-
DialogInstance.confirm({
|
58
|
-
context: this,
|
59
|
-
title: 'Title',
|
60
|
-
icon: false,
|
61
|
-
message,
|
62
|
-
cancelButtonText: 'Sub Action',
|
63
|
-
confirmButtonText: I18n.t('confirm'),
|
64
|
-
});
|
65
|
-
},
|
66
|
-
onClickConfirmIcon() {
|
67
|
-
DialogInstance.confirm({
|
68
|
-
context: this,
|
69
|
-
title: 'Title',
|
70
|
-
icon: true,
|
71
|
-
message,
|
72
|
-
cancelButtonText: 'Sub Action',
|
73
|
-
confirmButtonText: I18n.t('confirm'),
|
74
|
-
});
|
75
|
-
},
|
76
|
-
onClickInput() {
|
77
|
-
const beforeClose = (action, value) => new Promise((resolve) => {
|
78
|
-
setTimeout(() => {
|
79
|
-
if (action === 'confirm') {
|
80
|
-
// 不存在输入值则拦截确认操作
|
81
|
-
resolve(!!value);
|
82
|
-
}
|
83
|
-
else {
|
84
|
-
resolve(true);
|
85
|
-
}
|
86
|
-
}, 1000);
|
87
|
-
});
|
88
|
-
DialogInstance.input({
|
89
|
-
context: this,
|
90
|
-
title: 'Title',
|
91
|
-
value: this.data.inputValue,
|
92
|
-
cancelButtonText: 'Sub Action',
|
93
|
-
beforeClose,
|
94
|
-
confirmButtonText: I18n.t('confirm'),
|
95
|
-
})
|
96
|
-
.then((res) => {
|
97
|
-
var _a;
|
98
|
-
console.log('=== onConfirm', res);
|
99
|
-
const inputValue = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.inputValue;
|
100
|
-
this.setData({ inputValue });
|
101
|
-
})
|
102
|
-
.catch((res) => {
|
103
|
-
console.log('=== onCancel', res);
|
104
|
-
});
|
105
|
-
},
|
106
|
-
onClickAsyncClose() {
|
107
|
-
const beforeClose = (action) => new Promise((resolve) => {
|
108
|
-
setTimeout(() => {
|
109
|
-
if (action === 'confirm') {
|
110
|
-
resolve(true);
|
111
|
-
}
|
112
|
-
else {
|
113
|
-
// 拦截取消操作
|
114
|
-
resolve(false);
|
115
|
-
}
|
116
|
-
}, 1000);
|
117
|
-
});
|
118
|
-
DialogInstance.confirm({
|
119
|
-
context: this,
|
120
|
-
title: 'Title',
|
121
|
-
icon: false,
|
122
|
-
message,
|
123
|
-
beforeClose,
|
124
|
-
confirmButtonText: I18n.t('confirm'),
|
125
|
-
cancelButtonText: I18n.t('cancel'),
|
126
|
-
});
|
127
|
-
},
|
128
|
-
onClose() {
|
129
|
-
this.setData({
|
130
|
-
show: false,
|
131
|
-
});
|
132
|
-
},
|
133
|
-
},
|
134
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
switchTitle1: I18n.t('freeShipping'),
|
5
|
-
switchTitle2: I18n.t('groupBuy'),
|
6
|
-
itemTitle: I18n.t('filter'),
|
7
|
-
option1: [
|
8
|
-
{ text: I18n.t('allProducts'), value: 0 },
|
9
|
-
{ text: I18n.t('newProduct'), value: 1 },
|
10
|
-
{ text: I18n.t('promotionalItems'), value: 2 },
|
11
|
-
],
|
12
|
-
option2: [
|
13
|
-
{ text: I18n.t('defaultSorting'), value: 'a' },
|
14
|
-
{ text: I18n.t('sortByPositiveReviews'), value: 'b' },
|
15
|
-
{ text: I18n.t('sortBySales'), value: 'c' },
|
16
|
-
],
|
17
|
-
switch1: true,
|
18
|
-
switch2: false,
|
19
|
-
value1: 0,
|
20
|
-
value2: 'a',
|
21
|
-
},
|
22
|
-
methods: {
|
23
|
-
onConfirm() {
|
24
|
-
this.selectComponent('#item').toggle();
|
25
|
-
},
|
26
|
-
onSwitch1Change({ detail }) {
|
27
|
-
this.setData({ switch1: detail });
|
28
|
-
},
|
29
|
-
onSwitch2Change({ detail }) {
|
30
|
-
this.setData({ switch2: detail });
|
31
|
-
},
|
32
|
-
onBeforeChange({ detail: { status, callback } }) {
|
33
|
-
wx.showModal({
|
34
|
-
title: I18n.t('asynchronousOnOff'),
|
35
|
-
content: `${I18n.t('areYouSureYouWantTo')}${status ? I18n.t('open') : I18n.t('close')}${I18n.t('dropdownMenu')}`,
|
36
|
-
success: (res) => {
|
37
|
-
if (res.confirm) {
|
38
|
-
callback(true);
|
39
|
-
}
|
40
|
-
else if (res.cancel) {
|
41
|
-
callback(false);
|
42
|
-
}
|
43
|
-
},
|
44
|
-
});
|
45
|
-
},
|
46
|
-
},
|
47
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/empty/demo/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/field/demo/index.js
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
import Sun from '@tuya-miniapp/icons/dist/svg/Sun';
|
3
|
-
SmartComponent({
|
4
|
-
data: {
|
5
|
-
value: '',
|
6
|
-
password: '',
|
7
|
-
num: 2000,
|
8
|
-
value2: '12345',
|
9
|
-
message: '',
|
10
|
-
sunIcon: Sun
|
11
|
-
},
|
12
|
-
methods: {
|
13
|
-
onClickIcon() {
|
14
|
-
wx.showToast({
|
15
|
-
icon: 'none',
|
16
|
-
title: I18n.t('clickTheIcon'),
|
17
|
-
});
|
18
|
-
},
|
19
|
-
},
|
20
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
import Toast from '../../toast/toast';
|
3
|
-
SmartComponent({
|
4
|
-
methods: {
|
5
|
-
onClickIcon() {
|
6
|
-
Toast({ context: this, message: I18n.t('clickTheIcon') });
|
7
|
-
},
|
8
|
-
onClickButton() {
|
9
|
-
Toast({ context: this, message: I18n.t('clickTheButton') });
|
10
|
-
},
|
11
|
-
},
|
12
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/grid/demo/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/icon/demo/index.js
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
import * as icons from '@tuya-miniapp/icons';
|
2
|
-
import iconsConfig from '@tuya-miniapp/icons/dist/config';
|
3
|
-
import { SmartComponent } from '../../common/component';
|
4
|
-
function kebabCase(name) {
|
5
|
-
const currName = name.replace(/[A-Z]/g, (word) => '-' + word.toLocaleLowerCase());
|
6
|
-
return currName.slice(1);
|
7
|
-
}
|
8
|
-
const iconsArr = iconsConfig.map((name) => ({
|
9
|
-
name: kebabCase(name),
|
10
|
-
value: icons[name],
|
11
|
-
}));
|
12
|
-
SmartComponent({
|
13
|
-
data: {
|
14
|
-
active: 0,
|
15
|
-
icons: iconsArr,
|
16
|
-
iconWarning: icons.Warning,
|
17
|
-
iconAlarm: icons.Alarm,
|
18
|
-
},
|
19
|
-
methods: {
|
20
|
-
onSwitch(event) {
|
21
|
-
this.setData({
|
22
|
-
active: event.detail.index,
|
23
|
-
});
|
24
|
-
},
|
25
|
-
},
|
26
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/image/demo/index.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
SmartComponent({
|
3
|
-
data: {
|
4
|
-
fits: [
|
5
|
-
'contain',
|
6
|
-
'cover',
|
7
|
-
'fill',
|
8
|
-
'none',
|
9
|
-
'scale-down',
|
10
|
-
'widthFix',
|
11
|
-
'heightFix',
|
12
|
-
],
|
13
|
-
src: 'https://images.tuyacn.com/rms-static/f350c8a0-0eb2-11ef-8f06-49ae7b2fadcf-1715334722090.jpeg?tyName=cat.jpeg',
|
14
|
-
},
|
15
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { SmartComponent } from '../../common/component';
|
2
|
-
const indexList = [];
|
3
|
-
const charCodeOfA = 'A'.charCodeAt(0);
|
4
|
-
for (let i = 0; i < 26; i++) {
|
5
|
-
indexList.push(String.fromCharCode(charCodeOfA + i));
|
6
|
-
}
|
7
|
-
SmartComponent({
|
8
|
-
data: {
|
9
|
-
activeTab: 0,
|
10
|
-
indexList,
|
11
|
-
customIndexList: [1, 2, 3, 4, 5, 6, 8, 9, 10],
|
12
|
-
scrollTop: 0,
|
13
|
-
},
|
14
|
-
methods: {
|
15
|
-
onChange(event) {
|
16
|
-
this.setData({
|
17
|
-
activeTab: event.detail.name,
|
18
|
-
});
|
19
|
-
},
|
20
|
-
},
|
21
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import iconPlus from '@tuya-miniapp/icons/dist/svg/Plus';
|
2
|
-
import iconHouse from '@tuya-miniapp/icons/dist/svg/House';
|
3
|
-
import { SmartComponent } from '../../common/component';
|
4
|
-
SmartComponent({
|
5
|
-
data: {
|
6
|
-
iconPlus,
|
7
|
-
iconHouse,
|
8
|
-
},
|
9
|
-
methods: {
|
10
|
-
onClickLeft() {
|
11
|
-
wx.showToast({ title: I18n.t('clickToReturn'), icon: 'none' });
|
12
|
-
},
|
13
|
-
onClickLeftIcon() {
|
14
|
-
wx.showToast({ title: I18n.t('clickToLeftIcon'), icon: 'none' });
|
15
|
-
},
|
16
|
-
onClickLeftText() {
|
17
|
-
wx.showToast({ title: I18n.t('clickToLeftText'), icon: 'none' });
|
18
|
-
},
|
19
|
-
onClickTitle() {
|
20
|
-
wx.showToast({ title: I18n.t('clickToTitle'), icon: 'none' });
|
21
|
-
},
|
22
|
-
onClickRight() {
|
23
|
-
wx.showToast({ title: I18n.t('clickToRight'), icon: 'none' });
|
24
|
-
},
|
25
|
-
},
|
26
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|