@tuya-miniapp/smart-ui 1.3.1-beta-2 → 1.3.1-beta-4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/action-sheet/demo/index.d.ts +1 -0
- package/dist/action-sheet/demo/index.js +101 -0
- package/dist/action-sheet/index.js +1 -1
- package/dist/area/demo/index.d.ts +1 -0
- package/dist/area/demo/index.js +41 -0
- package/dist/area/index.js +4 -5
- package/dist/battery/demo/index.d.ts +1 -0
- package/dist/battery/demo/index.js +2 -0
- package/dist/battery/index.js +1 -3
- package/dist/bottom-sheet/demo/index.d.ts +1 -0
- package/dist/bottom-sheet/demo/index.js +24 -0
- package/dist/bottom-sheet/index.css +1 -1
- package/dist/bottom-sheet/index.js +3 -2
- package/dist/bottom-sheet/index.wxml +3 -1
- package/dist/bottom-sheet/index.wxss +1 -1
- package/dist/button/demo/index.d.ts +1 -0
- package/dist/button/demo/index.js +9 -0
- package/dist/button/index.js +1 -1
- package/dist/calendar/calendar.wxml +13 -8
- package/dist/calendar/components/header/index.css +1 -1
- package/dist/calendar/components/header/index.js +7 -3
- package/dist/calendar/components/header/index.wxml +3 -3
- package/dist/calendar/components/header/index.wxss +1 -1
- package/dist/calendar/components/month/index.css +1 -1
- package/dist/calendar/components/month/index.js +3 -5
- package/dist/calendar/components/month/index.wxs +1 -4
- package/dist/calendar/components/month/index.wxss +1 -1
- package/dist/calendar/components/month-list/index.css +1 -1
- package/dist/calendar/components/month-list/index.js +26 -41
- package/dist/calendar/components/month-list/index.wxml +8 -2
- package/dist/calendar/components/month-list/index.wxss +1 -1
- package/dist/calendar/components/year-list/index.css +1 -1
- package/dist/calendar/components/year-list/index.js +17 -4
- package/dist/calendar/components/year-list/index.wxml +8 -2
- package/dist/calendar/components/year-list/index.wxss +1 -1
- package/dist/calendar/demo/index.d.ts +1 -0
- package/dist/calendar/demo/index.js +103 -0
- package/dist/calendar/index.js +32 -39
- package/dist/calendar/index.wxs +5 -8
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.js +30 -4
- package/dist/cascader/demo/index.d.ts +1 -0
- package/dist/cascader/demo/index.js +191 -0
- package/dist/cascader/index.js +3 -3
- package/dist/cell/demo/index.d.ts +1 -0
- package/dist/cell/demo/index.js +14 -0
- package/dist/cell/index.js +1 -7
- package/dist/checkbox/demo/index.d.ts +1 -0
- package/dist/checkbox/demo/index.js +34 -0
- package/dist/checkbox-group/index.js +1 -1
- package/dist/circle/demo/index.d.ts +1 -0
- package/dist/circle/demo/index.js +19 -0
- package/dist/col/demo/index.d.ts +1 -0
- package/dist/col/demo/index.js +4 -0
- package/dist/collapse/demo/index.d.ts +1 -0
- package/dist/collapse/demo/index.js +36 -0
- package/dist/collapse/index.js +1 -1
- package/dist/collapse-item/animate.js +1 -1
- package/dist/common/component.js +1 -1
- package/dist/common/utils.js +3 -3
- package/dist/config-provider/demo/index.d.ts +1 -0
- package/dist/config-provider/demo/index.js +22 -0
- package/dist/count-down/demo/index.d.ts +1 -0
- package/dist/count-down/demo/index.js +33 -0
- package/dist/custom-keyboard/demo/index.d.ts +1 -0
- package/dist/custom-keyboard/demo/index.js +17 -0
- package/dist/custom-keyboard/index.js +1 -3
- package/dist/datetime-picker/demo/index.d.ts +1 -0
- package/dist/datetime-picker/demo/index.js +63 -0
- package/dist/datetime-picker/index.js +4 -5
- package/dist/dialog/demo/index.d.ts +1 -0
- package/dist/dialog/demo/index.js +134 -0
- package/dist/dialog/dialog.js +3 -5
- package/dist/dialog/index.js +1 -1
- package/dist/divider/demo/index.d.ts +1 -0
- package/dist/divider/demo/index.js +4 -0
- package/dist/dropdown-item/index.js +3 -3
- package/dist/dropdown-item/index.wxml +1 -7
- package/dist/dropdown-menu/demo/index.d.ts +1 -0
- package/dist/dropdown-menu/demo/index.js +47 -0
- package/dist/dropdown-menu/index.js +8 -10
- package/dist/empty/demo/index.d.ts +1 -0
- package/dist/empty/demo/index.js +13 -0
- package/dist/empty/index.css +1 -1
- package/dist/empty/index.wxs +1 -1
- package/dist/empty/index.wxss +1 -1
- package/dist/field/demo/index.d.ts +1 -0
- package/dist/field/demo/index.js +21 -0
- package/dist/goods-action/demo/index.d.ts +1 -0
- package/dist/goods-action/demo/index.js +12 -0
- package/dist/goods-action/index.js +1 -1
- package/dist/grid/demo/index.d.ts +1 -0
- package/dist/grid/demo/index.js +9 -0
- package/dist/grid/index.js +1 -1
- package/dist/grid-item/index.js +1 -1
- package/dist/icon/demo/index.d.ts +1 -0
- package/dist/icon/demo/index.js +26 -0
- package/dist/image/demo/index.d.ts +1 -0
- package/dist/image/demo/index.js +15 -0
- package/dist/index-anchor/index.js +1 -1
- package/dist/index-bar/demo/index.d.ts +1 -0
- package/dist/index-bar/demo/index.js +21 -0
- package/dist/index-bar/index.js +9 -16
- package/dist/loading/demo/index.d.ts +1 -0
- package/dist/loading/demo/index.js +4 -0
- package/dist/loading/index.js +25 -1
- package/dist/loading/index.wxml +2 -2
- package/dist/loading/index.wxs +6 -21
- package/dist/mixins/basic.js +2 -2
- package/dist/mixins/link.js +1 -2
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/mixins/touch.js +1 -2
- package/dist/mixins/transition.js +1 -1
- package/dist/nav-bar/demo/index.d.ts +1 -0
- package/dist/nav-bar/demo/index.js +26 -0
- package/dist/nav-bar/index.css +1 -1
- package/dist/nav-bar/index.js +1 -1
- package/dist/nav-bar/index.wxml +1 -1
- package/dist/nav-bar/index.wxss +1 -1
- package/dist/normal-slider/demo/index.d.ts +1 -0
- package/dist/normal-slider/demo/index.js +19 -0
- package/dist/notice-bar/demo/index.d.ts +1 -0
- package/dist/notice-bar/demo/index.js +11 -0
- package/dist/notice-bar/index.css +1 -1
- package/dist/notice-bar/index.js +3 -6
- package/dist/notice-bar/index.wxml +1 -5
- package/dist/notice-bar/index.wxss +1 -1
- package/dist/notify/demo/index.d.ts +1 -0
- package/dist/notify/demo/index.js +45 -0
- package/dist/overlay/demo/index.d.ts +1 -0
- package/dist/overlay/demo/index.js +22 -0
- package/dist/picker/demo/index.d.ts +1 -0
- package/dist/picker/demo/index.js +76 -0
- package/dist/picker/index.css +1 -1
- package/dist/picker/index.js +2 -2
- package/dist/picker/index.wxml +1 -0
- package/dist/picker/index.wxss +1 -1
- package/dist/picker-column/index.js +3 -8
- package/dist/popup/demo/index.d.ts +1 -0
- package/dist/popup/demo/index.js +79 -0
- package/dist/progress/demo/index.d.ts +1 -0
- package/dist/progress/demo/index.js +4 -0
- package/dist/progress/index.js +1 -4
- package/dist/radio/demo/index.d.ts +1 -0
- package/dist/radio/demo/index.js +31 -0
- package/dist/radio-group/index.js +1 -1
- package/dist/rate/demo/index.d.ts +1 -0
- package/dist/rate/demo/index.js +25 -0
- package/dist/rate/index.js +2 -2
- package/dist/row/index.js +1 -1
- package/dist/search/demo/index.d.ts +1 -0
- package/dist/search/demo/index.js +43 -0
- package/dist/search/index.css +1 -1
- package/dist/search/index.js +1 -5
- package/dist/search/index.wxml +1 -1
- package/dist/search/index.wxss +1 -1
- package/dist/sidebar/demo/index.d.ts +1 -0
- package/dist/sidebar/demo/index.js +9 -0
- package/dist/skeleton/demo/index.d.ts +1 -0
- package/dist/skeleton/demo/index.js +11 -0
- package/dist/slider/demo/index.d.ts +1 -0
- package/dist/slider/demo/index.js +19 -0
- package/dist/slider/index.js +5 -7
- package/dist/stepper/demo/index.d.ts +1 -0
- package/dist/stepper/demo/index.js +19 -0
- package/dist/steps/demo/index.d.ts +1 -0
- package/dist/steps/demo/index.js +42 -0
- package/dist/sticky/demo/index.d.ts +1 -0
- package/dist/sticky/demo/index.js +26 -0
- package/dist/sticky/index.js +2 -2
- package/dist/swipe-cell/demo/index.d.ts +1 -0
- package/dist/swipe-cell/demo/index.js +45 -0
- package/dist/swipe-cell/index.js +3 -5
- package/dist/switch/demo/index.d.ts +1 -0
- package/dist/switch/demo/index.js +29 -0
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.wxss +1 -1
- package/dist/tab/demo/index.d.ts +1 -0
- package/dist/tab/demo/index.js +55 -0
- package/dist/tabbar/demo/index.d.ts +1 -0
- package/dist/tabbar/demo/index.js +34 -0
- package/dist/tabbar/index.js +1 -1
- package/dist/tabs/index.css +1 -1
- package/dist/tabs/index.js +7 -25
- package/dist/tabs/index.wxss +1 -1
- package/dist/tag/demo/index.d.ts +1 -0
- package/dist/tag/demo/index.js +16 -0
- package/dist/tag/index.css +1 -1
- package/dist/tag/index.wxss +1 -1
- package/dist/toast/demo/index.d.ts +1 -0
- package/dist/toast/demo/index.js +67 -0
- package/dist/toast/toast.js +5 -5
- package/dist/transition/demo/index.d.ts +1 -0
- package/dist/transition/demo/index.js +67 -0
- package/dist/tree-select/demo/index.d.ts +1 -0
- package/dist/tree-select/demo/index.js +113 -0
- package/dist/wxs/style.wxs +0 -7
- package/lib/action-sheet/demo/index.d.ts +1 -0
- package/lib/action-sheet/demo/index.js +115 -0
- package/lib/area/demo/index.d.ts +1 -0
- package/lib/area/demo/index.js +47 -0
- package/lib/area/index.js +1 -2
- package/lib/battery/demo/index.d.ts +1 -0
- package/lib/battery/demo/index.js +4 -0
- package/lib/battery/index.js +1 -3
- package/lib/bottom-sheet/demo/index.d.ts +1 -0
- package/lib/bottom-sheet/demo/index.js +27 -0
- package/lib/bottom-sheet/index.css +1 -1
- package/lib/bottom-sheet/index.js +3 -2
- package/lib/bottom-sheet/index.wxml +3 -1
- package/lib/bottom-sheet/index.wxss +1 -1
- package/lib/button/demo/index.d.ts +1 -0
- package/lib/button/demo/index.js +14 -0
- package/lib/calendar/calendar.wxml +13 -8
- package/lib/calendar/components/header/index.css +1 -1
- package/lib/calendar/components/header/index.js +6 -2
- package/lib/calendar/components/header/index.wxml +3 -3
- package/lib/calendar/components/header/index.wxss +1 -1
- package/lib/calendar/components/month/index.css +1 -1
- package/lib/calendar/components/month/index.js +2 -6
- package/lib/calendar/components/month/index.wxs +1 -4
- package/lib/calendar/components/month/index.wxss +1 -1
- package/lib/calendar/components/month-list/index.css +1 -1
- package/lib/calendar/components/month-list/index.js +25 -40
- package/lib/calendar/components/month-list/index.wxml +8 -2
- package/lib/calendar/components/month-list/index.wxss +1 -1
- package/lib/calendar/components/year-list/index.css +1 -1
- package/lib/calendar/components/year-list/index.js +15 -2
- package/lib/calendar/components/year-list/index.wxml +8 -2
- package/lib/calendar/components/year-list/index.wxss +1 -1
- package/lib/calendar/demo/index.d.ts +1 -0
- package/lib/calendar/demo/index.js +105 -0
- package/lib/calendar/index.js +29 -38
- package/lib/calendar/index.wxs +5 -8
- package/lib/calendar/utils.d.ts +4 -0
- package/lib/calendar/utils.js +31 -4
- package/lib/cascader/demo/index.d.ts +1 -0
- package/lib/cascader/demo/index.js +197 -0
- package/lib/cell/demo/index.d.ts +1 -0
- package/lib/cell/demo/index.js +39 -0
- package/lib/cell/index.js +1 -7
- package/lib/checkbox/demo/index.d.ts +1 -0
- package/lib/checkbox/demo/index.js +38 -0
- package/lib/circle/demo/index.d.ts +1 -0
- package/lib/circle/demo/index.js +21 -0
- package/lib/col/demo/index.d.ts +1 -0
- package/lib/col/demo/index.js +6 -0
- package/lib/collapse/demo/index.d.ts +1 -0
- package/lib/collapse/demo/index.js +42 -0
- package/lib/config-provider/demo/index.d.ts +1 -0
- package/lib/config-provider/demo/index.js +24 -0
- package/lib/count-down/demo/index.d.ts +1 -0
- package/lib/count-down/demo/index.js +38 -0
- package/lib/custom-keyboard/demo/index.d.ts +1 -0
- package/lib/custom-keyboard/demo/index.js +19 -0
- package/lib/custom-keyboard/index.js +1 -3
- package/lib/datetime-picker/demo/index.d.ts +1 -0
- package/lib/datetime-picker/demo/index.js +68 -0
- package/lib/datetime-picker/index.js +4 -3
- package/lib/dialog/demo/index.d.ts +1 -0
- package/lib/dialog/demo/index.js +144 -0
- package/lib/dialog/dialog.js +1 -3
- package/lib/divider/demo/index.d.ts +1 -0
- package/lib/divider/demo/index.js +6 -0
- package/lib/dropdown-item/index.wxml +1 -7
- package/lib/dropdown-menu/demo/index.d.ts +1 -0
- package/lib/dropdown-menu/demo/index.js +52 -0
- package/lib/dropdown-menu/index.js +2 -4
- package/lib/empty/demo/index.d.ts +1 -0
- package/lib/empty/demo/index.js +15 -0
- package/lib/empty/index.css +1 -1
- package/lib/empty/index.wxs +1 -1
- package/lib/empty/index.wxss +1 -1
- package/lib/field/demo/index.d.ts +1 -0
- package/lib/field/demo/index.js +23 -0
- package/lib/goods-action/demo/index.d.ts +1 -0
- package/lib/goods-action/demo/index.js +17 -0
- package/lib/grid/demo/index.d.ts +1 -0
- package/lib/grid/demo/index.js +11 -0
- package/lib/icon/demo/index.d.ts +1 -0
- package/lib/icon/demo/index.js +54 -0
- package/lib/image/demo/index.d.ts +1 -0
- package/lib/image/demo/index.js +17 -0
- package/lib/index-bar/demo/index.d.ts +1 -0
- package/lib/index-bar/demo/index.js +23 -0
- package/lib/index-bar/index.js +3 -10
- package/lib/loading/demo/index.d.ts +1 -0
- package/lib/loading/demo/index.js +6 -0
- package/lib/loading/index.js +27 -1
- package/lib/loading/index.wxml +2 -2
- package/lib/loading/index.wxs +6 -21
- package/lib/mixins/link.js +1 -2
- package/lib/mixins/touch.js +1 -2
- package/lib/nav-bar/demo/index.d.ts +1 -0
- package/lib/nav-bar/demo/index.js +31 -0
- package/lib/nav-bar/index.css +1 -1
- package/lib/nav-bar/index.wxml +1 -1
- package/lib/nav-bar/index.wxss +1 -1
- package/lib/normal-slider/demo/index.d.ts +1 -0
- package/lib/normal-slider/demo/index.js +21 -0
- package/lib/notice-bar/demo/index.d.ts +1 -0
- package/lib/notice-bar/demo/index.js +16 -0
- package/lib/notice-bar/index.css +1 -1
- package/lib/notice-bar/index.js +2 -5
- package/lib/notice-bar/index.wxml +1 -5
- package/lib/notice-bar/index.wxss +1 -1
- package/lib/notify/demo/index.d.ts +1 -0
- package/lib/notify/demo/index.js +50 -0
- package/lib/overlay/demo/index.d.ts +1 -0
- package/lib/overlay/demo/index.js +24 -0
- package/lib/picker/demo/index.d.ts +1 -0
- package/lib/picker/demo/index.js +82 -0
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.js +1 -3
- package/lib/picker/index.wxml +1 -0
- package/lib/picker/index.wxss +1 -1
- package/lib/picker-column/index.js +2 -7
- package/lib/popup/demo/index.d.ts +1 -0
- package/lib/popup/demo/index.js +85 -0
- package/lib/progress/demo/index.d.ts +1 -0
- package/lib/progress/demo/index.js +6 -0
- package/lib/progress/index.js +1 -4
- package/lib/radio/demo/index.d.ts +1 -0
- package/lib/radio/demo/index.js +34 -0
- package/lib/rate/demo/index.d.ts +1 -0
- package/lib/rate/demo/index.js +30 -0
- package/lib/search/demo/index.d.ts +1 -0
- package/lib/search/demo/index.js +48 -0
- package/lib/search/index.css +1 -1
- package/lib/search/index.js +1 -5
- package/lib/search/index.wxml +1 -1
- package/lib/search/index.wxss +1 -1
- package/lib/sidebar/demo/index.d.ts +1 -0
- package/lib/sidebar/demo/index.js +14 -0
- package/lib/skeleton/demo/index.d.ts +1 -0
- package/lib/skeleton/demo/index.js +14 -0
- package/lib/slider/demo/index.d.ts +1 -0
- package/lib/slider/demo/index.js +21 -0
- package/lib/slider/index.js +1 -3
- package/lib/stepper/demo/index.d.ts +1 -0
- package/lib/stepper/demo/index.js +25 -0
- package/lib/steps/demo/index.d.ts +1 -0
- package/lib/steps/demo/index.js +47 -0
- package/lib/sticky/demo/index.d.ts +1 -0
- package/lib/sticky/demo/index.js +30 -0
- package/lib/sticky/index.js +3 -1
- package/lib/swipe-cell/demo/index.d.ts +1 -0
- package/lib/swipe-cell/demo/index.js +50 -0
- package/lib/swipe-cell/index.js +1 -3
- package/lib/switch/demo/index.d.ts +1 -0
- package/lib/switch/demo/index.js +37 -0
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.wxss +1 -1
- package/lib/tab/demo/index.d.ts +1 -0
- package/lib/tab/demo/index.js +57 -0
- package/lib/tabbar/demo/index.d.ts +1 -0
- package/lib/tabbar/demo/index.js +41 -0
- package/lib/tabs/index.css +1 -1
- package/lib/tabs/index.js +6 -24
- package/lib/tabs/index.wxss +1 -1
- package/lib/tag/demo/index.d.ts +1 -0
- package/lib/tag/demo/index.js +19 -0
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.wxss +1 -1
- package/lib/toast/demo/index.d.ts +1 -0
- package/lib/toast/demo/index.js +74 -0
- package/lib/toast/toast.js +3 -3
- package/lib/transition/demo/index.d.ts +1 -0
- package/lib/transition/demo/index.js +71 -0
- package/lib/tree-select/demo/index.d.ts +1 -0
- package/lib/tree-select/demo/index.js +130 -0
- package/lib/wxs/style.wxs +0 -7
- package/package.json +15 -3
@@ -0,0 +1,191 @@
|
|
1
|
+
import { SmartComponent } from '../../common/component';
|
2
|
+
const zhCNOptions = [
|
3
|
+
{
|
4
|
+
text: I18n.t('zhejiangProvince'),
|
5
|
+
value: '330000',
|
6
|
+
options: [
|
7
|
+
{
|
8
|
+
text: I18n.t('hangzhou'),
|
9
|
+
value: '330100',
|
10
|
+
options: [
|
11
|
+
{
|
12
|
+
text: I18n.t('upperCityDistrict'),
|
13
|
+
value: '330102',
|
14
|
+
},
|
15
|
+
{
|
16
|
+
text: I18n.t('downtownDistrict'),
|
17
|
+
value: '330103',
|
18
|
+
},
|
19
|
+
{
|
20
|
+
text: I18n.t('jiangganDistrict'),
|
21
|
+
value: '330104',
|
22
|
+
},
|
23
|
+
],
|
24
|
+
},
|
25
|
+
{
|
26
|
+
text: I18n.t('ningboCity'),
|
27
|
+
value: '330200',
|
28
|
+
options: [
|
29
|
+
{
|
30
|
+
text: I18n.t('haishuDistrict'),
|
31
|
+
value: '330203',
|
32
|
+
},
|
33
|
+
{
|
34
|
+
text: I18n.t('jiangbeiDistrict'),
|
35
|
+
value: '330205',
|
36
|
+
},
|
37
|
+
{
|
38
|
+
text: I18n.t('beilunDistrict'),
|
39
|
+
value: '330206',
|
40
|
+
},
|
41
|
+
],
|
42
|
+
},
|
43
|
+
{
|
44
|
+
text: I18n.t('wenzhou'),
|
45
|
+
value: '330300',
|
46
|
+
options: [
|
47
|
+
{
|
48
|
+
text: I18n.t('luchengDistrict'),
|
49
|
+
value: '330302',
|
50
|
+
},
|
51
|
+
{
|
52
|
+
text: I18n.t('longwanDistrict'),
|
53
|
+
value: '330303',
|
54
|
+
},
|
55
|
+
{
|
56
|
+
text: I18n.t('ouhaiDistrict'),
|
57
|
+
value: '330304',
|
58
|
+
},
|
59
|
+
],
|
60
|
+
},
|
61
|
+
],
|
62
|
+
},
|
63
|
+
{
|
64
|
+
text: I18n.t('jiangsuProvince'),
|
65
|
+
value: '320000',
|
66
|
+
options: [
|
67
|
+
{
|
68
|
+
text: I18n.t('nanjing'),
|
69
|
+
value: '320100',
|
70
|
+
options: [
|
71
|
+
{
|
72
|
+
text: I18n.t('xuanwuDistrict'),
|
73
|
+
value: '320102',
|
74
|
+
},
|
75
|
+
{
|
76
|
+
text: I18n.t('qinhuaiDistrict'),
|
77
|
+
value: '320104',
|
78
|
+
},
|
79
|
+
{
|
80
|
+
text: I18n.t('jianyeDistrict'),
|
81
|
+
value: '320105',
|
82
|
+
},
|
83
|
+
],
|
84
|
+
},
|
85
|
+
{
|
86
|
+
text: I18n.t('wuxi'),
|
87
|
+
value: '320200',
|
88
|
+
options: [
|
89
|
+
{
|
90
|
+
text: I18n.t('xishanDistrict'),
|
91
|
+
value: '320205',
|
92
|
+
},
|
93
|
+
{
|
94
|
+
text: I18n.t('huishanDistrict'),
|
95
|
+
value: '320206',
|
96
|
+
},
|
97
|
+
{
|
98
|
+
text: I18n.t('binhuDistrict'),
|
99
|
+
value: '320211',
|
100
|
+
},
|
101
|
+
],
|
102
|
+
},
|
103
|
+
{
|
104
|
+
text: I18n.t('xuzhou'),
|
105
|
+
value: '320300',
|
106
|
+
options: [
|
107
|
+
{
|
108
|
+
text: I18n.t('gulouDistrict'),
|
109
|
+
value: '320302',
|
110
|
+
},
|
111
|
+
{
|
112
|
+
text: I18n.t('yunlongDistrict'),
|
113
|
+
value: '320303',
|
114
|
+
},
|
115
|
+
{
|
116
|
+
text: I18n.t('jiawangDistrict'),
|
117
|
+
value: '320305',
|
118
|
+
},
|
119
|
+
],
|
120
|
+
},
|
121
|
+
],
|
122
|
+
},
|
123
|
+
];
|
124
|
+
const asyncOptions1 = [
|
125
|
+
{
|
126
|
+
text: I18n.t('zhejiangProvince'),
|
127
|
+
value: '330000',
|
128
|
+
options: [],
|
129
|
+
},
|
130
|
+
];
|
131
|
+
const asyncOptions2 = [
|
132
|
+
{ text: I18n.t('hangzhou'), value: '330100' },
|
133
|
+
{ text: I18n.t('ningboCity'), value: '330200' },
|
134
|
+
];
|
135
|
+
SmartComponent({
|
136
|
+
data: {
|
137
|
+
area: I18n.t('region'),
|
138
|
+
options: zhCNOptions,
|
139
|
+
selectArea: I18n.t('pleaseSelectARegion'),
|
140
|
+
baseState: {
|
141
|
+
show: false,
|
142
|
+
value: '',
|
143
|
+
result: '',
|
144
|
+
},
|
145
|
+
asyncState: {
|
146
|
+
show: false,
|
147
|
+
value: undefined,
|
148
|
+
result: '',
|
149
|
+
options: asyncOptions1,
|
150
|
+
},
|
151
|
+
customFieldState: {
|
152
|
+
show: false,
|
153
|
+
value: '',
|
154
|
+
result: '',
|
155
|
+
},
|
156
|
+
},
|
157
|
+
methods: {
|
158
|
+
onClick(e) {
|
159
|
+
const { stateKey } = e.currentTarget.dataset;
|
160
|
+
this.setData({
|
161
|
+
[`${stateKey}.show`]: true,
|
162
|
+
});
|
163
|
+
},
|
164
|
+
onClose(e) {
|
165
|
+
const { stateKey } = e.currentTarget.dataset;
|
166
|
+
this.setData({
|
167
|
+
[`${stateKey}.show`]: false,
|
168
|
+
});
|
169
|
+
},
|
170
|
+
onFinish(e) {
|
171
|
+
const { stateKey } = e.currentTarget.dataset;
|
172
|
+
const { selectedOptions, value } = e.detail;
|
173
|
+
const result = selectedOptions.map((option) => option.text).join('/');
|
174
|
+
this.setData({
|
175
|
+
[`${stateKey}.value`]: value,
|
176
|
+
[`${stateKey}.result`]: result,
|
177
|
+
});
|
178
|
+
this.onClose(e);
|
179
|
+
},
|
180
|
+
loadDynamicOptions(e) {
|
181
|
+
const { value } = e.detail;
|
182
|
+
if (value === '330000') {
|
183
|
+
setTimeout(() => {
|
184
|
+
this.setData({
|
185
|
+
'asyncState.options[0].options': asyncOptions2,
|
186
|
+
});
|
187
|
+
}, 500);
|
188
|
+
}
|
189
|
+
},
|
190
|
+
},
|
191
|
+
});
|
package/dist/cascader/index.js
CHANGED
@@ -95,12 +95,12 @@ SmartComponent({
|
|
95
95
|
const selectedOptions = this.getSelectedOptionsByValue(options, innerValue);
|
96
96
|
if (selectedOptions) {
|
97
97
|
let optionsCursor = options;
|
98
|
-
const tabs = selectedOptions.map(
|
98
|
+
const tabs = selectedOptions.map(option => {
|
99
99
|
const tab = {
|
100
100
|
options: optionsCursor,
|
101
101
|
selected: option,
|
102
102
|
};
|
103
|
-
const next = optionsCursor.find(
|
103
|
+
const next = optionsCursor.find(item => item.value === option.value);
|
104
104
|
if (next) {
|
105
105
|
optionsCursor = next.options;
|
106
106
|
}
|
@@ -174,7 +174,7 @@ SmartComponent({
|
|
174
174
|
this.setData({
|
175
175
|
tabs,
|
176
176
|
});
|
177
|
-
const selectedOptions = tabs.map(
|
177
|
+
const selectedOptions = tabs.map(tab => tab.selected).filter(Boolean);
|
178
178
|
const { value } = option;
|
179
179
|
const params = {
|
180
180
|
value,
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import * as icons from '@tuya-miniapp/icons';
|
2
|
+
import { SmartComponent } from '../../common/component';
|
3
|
+
SmartComponent({
|
4
|
+
data: {
|
5
|
+
sunMaxFill: icons.Sun,
|
6
|
+
checkMark: icons.Checkmark,
|
7
|
+
},
|
8
|
+
methods: {
|
9
|
+
onNavTo() {
|
10
|
+
// @ts-ignore
|
11
|
+
ty.openInnerH5({ url: 'https://www.tuya.com', title: 'Tuya' });
|
12
|
+
},
|
13
|
+
},
|
14
|
+
});
|
package/dist/cell/index.js
CHANGED
@@ -5,13 +5,7 @@ import rightIcon from '@tuya-miniapp/icons/dist/svg/Right';
|
|
5
5
|
import { link } from '../mixins/link';
|
6
6
|
import { SmartComponent } from '../common/component';
|
7
7
|
SmartComponent({
|
8
|
-
classes: [
|
9
|
-
'title-class',
|
10
|
-
'label-class',
|
11
|
-
'value-class',
|
12
|
-
'right-icon-class',
|
13
|
-
'hover-class',
|
14
|
-
],
|
8
|
+
classes: ['title-class', 'label-class', 'value-class', 'right-icon-class', 'hover-class'],
|
15
9
|
mixins: [link],
|
16
10
|
props: {
|
17
11
|
title: null,
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,34 @@
|
|
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
|
+
});
|
@@ -22,7 +22,7 @@ SmartComponent({
|
|
22
22
|
},
|
23
23
|
methods: {
|
24
24
|
updateChildren() {
|
25
|
-
this.children.forEach(
|
25
|
+
this.children.forEach(child => this.updateChild(child));
|
26
26
|
},
|
27
27
|
updateChild(child) {
|
28
28
|
const { value, disabled, direction } = this.data;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
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
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,36 @@
|
|
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
|
+
});
|
package/dist/collapse/index.js
CHANGED
@@ -32,7 +32,7 @@ function useAnimation(context, expanded, mounted, height) {
|
|
32
32
|
}
|
33
33
|
export function setContentAnimate(context, expanded, mounted) {
|
34
34
|
getRect(context, '.smart-collapse-item__content')
|
35
|
-
.then(
|
35
|
+
.then(rect => rect.height)
|
36
36
|
.then((height) => {
|
37
37
|
useAnimation(context, expanded, mounted, height);
|
38
38
|
});
|
package/dist/common/component.js
CHANGED
package/dist/common/utils.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
2
|
-
import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync
|
2
|
+
import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync } from './version';
|
3
3
|
export { isDef } from './validator';
|
4
4
|
export { getSystemInfoSync } from './version';
|
5
5
|
export function range(num, min, max) {
|
@@ -39,7 +39,7 @@ export function pickExclude(obj, keys) {
|
|
39
39
|
}, {});
|
40
40
|
}
|
41
41
|
export function getRect(context, selector) {
|
42
|
-
return new Promise(
|
42
|
+
return new Promise(resolve => {
|
43
43
|
wx.createSelectorQuery()
|
44
44
|
.in(context)
|
45
45
|
.select(selector)
|
@@ -48,7 +48,7 @@ export function getRect(context, selector) {
|
|
48
48
|
});
|
49
49
|
}
|
50
50
|
export function getAllRect(context, selector) {
|
51
|
-
return new Promise(
|
51
|
+
return new Promise(resolve => {
|
52
52
|
wx.createSelectorQuery()
|
53
53
|
.in(context)
|
54
54
|
.selectAll(selector)
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,22 @@
|
|
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
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,33 @@
|
|
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
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,17 @@
|
|
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
|
+
});
|
@@ -136,9 +136,7 @@ SmartComponent({
|
|
136
136
|
toSvgCssBackground(svgString) {
|
137
137
|
let res = svgString;
|
138
138
|
res = svgString
|
139
|
-
.replace('<svg', ~svgString.indexOf('xmlns')
|
140
|
-
? '<svg'
|
141
|
-
: '<svg xmlns="http://www.w3.org/2000/svg"')
|
139
|
+
.replace('<svg', ~svgString.indexOf('xmlns') ? '<svg' : '<svg xmlns="http://www.w3.org/2000/svg"')
|
142
140
|
.replace(/"/g, "'")
|
143
141
|
.replace(/%/g, '%25')
|
144
142
|
.replace(/#/g, '%23')
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { SmartComponent } from '../../common/component';
|
2
|
+
import Toast from '../../toast/toast';
|
3
|
+
SmartComponent({
|
4
|
+
data: {
|
5
|
+
minHour: 10,
|
6
|
+
maxHour: 20,
|
7
|
+
minDate: new Date(2018, 0, 1).getTime(),
|
8
|
+
maxDate: new Date(2019, 10, 1).getTime(),
|
9
|
+
currentDate1: new Date(2018, 2, 31).getTime(),
|
10
|
+
currentDate2: null,
|
11
|
+
currentDate3: new Date(2018, 0, 1),
|
12
|
+
currentDate4: '12:00',
|
13
|
+
loading: false,
|
14
|
+
formatter(type, value) {
|
15
|
+
if (type === 'year') {
|
16
|
+
return `${value}${I18n.t('year')}`;
|
17
|
+
}
|
18
|
+
if (type === 'month') {
|
19
|
+
return `${value}${I18n.t('month')}`;
|
20
|
+
}
|
21
|
+
return value;
|
22
|
+
},
|
23
|
+
filter(type, options) {
|
24
|
+
if (type === 'minute') {
|
25
|
+
return options.filter((option) => option % 5 === 0);
|
26
|
+
}
|
27
|
+
return options;
|
28
|
+
},
|
29
|
+
locale: {
|
30
|
+
year: I18n.t('year'),
|
31
|
+
month: I18n.t('month'),
|
32
|
+
day: I18n.t('sun'),
|
33
|
+
hour: I18n.t('time'),
|
34
|
+
minute: I18n.t('minute'),
|
35
|
+
second: I18n.t('second'),
|
36
|
+
},
|
37
|
+
},
|
38
|
+
methods: {
|
39
|
+
onInput(event) {
|
40
|
+
const { detail, currentTarget } = event;
|
41
|
+
const result = this.getResult(detail, currentTarget.dataset.type);
|
42
|
+
Toast({
|
43
|
+
context: this,
|
44
|
+
message: result,
|
45
|
+
});
|
46
|
+
},
|
47
|
+
getResult(time, type) {
|
48
|
+
const date = new Date(time);
|
49
|
+
switch (type) {
|
50
|
+
case 'datetime':
|
51
|
+
return date.toLocaleString();
|
52
|
+
case 'date':
|
53
|
+
return date.toLocaleDateString();
|
54
|
+
case 'year-month':
|
55
|
+
return `${date.getFullYear()}/${date.getMonth() + 1}`;
|
56
|
+
case 'time':
|
57
|
+
return time;
|
58
|
+
default:
|
59
|
+
return '';
|
60
|
+
}
|
61
|
+
},
|
62
|
+
},
|
63
|
+
});
|
@@ -100,8 +100,8 @@ SmartComponent({
|
|
100
100
|
},
|
101
101
|
updateColumns() {
|
102
102
|
const { formatter = defaultFormatter, locale } = this.data;
|
103
|
-
const results = this.getOriginColumns().map(
|
104
|
-
values: column.values.map(
|
103
|
+
const results = this.getOriginColumns().map(column => ({
|
104
|
+
values: column.values.map(value => formatter(column.type, value)),
|
105
105
|
unit: locale === null || locale === void 0 ? void 0 : locale[column.type],
|
106
106
|
}));
|
107
107
|
return this.set({ columns: results });
|
@@ -109,7 +109,7 @@ SmartComponent({
|
|
109
109
|
getOriginColumns() {
|
110
110
|
const { filter } = this.data;
|
111
111
|
const results = this.getRanges().map(({ type, range }) => {
|
112
|
-
let values = times(range[1] - range[0] + 1,
|
112
|
+
let values = times(range[1] - range[0] + 1, index => {
|
113
113
|
const value = range[0] + index;
|
114
114
|
return type === 'year' ? `${value}` : padZero(value);
|
115
115
|
});
|
@@ -234,8 +234,7 @@ SmartComponent({
|
|
234
234
|
const originColumns = this.getOriginColumns();
|
235
235
|
if (data.type === 'time') {
|
236
236
|
const indexes = picker.getIndexes();
|
237
|
-
value = `${+originColumns[0].values[indexes[0]]}:${+originColumns[1]
|
238
|
-
.values[indexes[1]]}`;
|
237
|
+
value = `${+originColumns[0].values[indexes[0]]}:${+originColumns[1].values[indexes[1]]}`;
|
239
238
|
}
|
240
239
|
else {
|
241
240
|
const indexes = picker.getIndexes();
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|