@tuya-miniapp/smart-ui 1.3.1-beta-3 → 1.3.1-beta-4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. package/dist/action-sheet/demo/index.d.ts +1 -0
  2. package/dist/action-sheet/demo/index.js +101 -0
  3. package/dist/action-sheet/index.js +1 -1
  4. package/dist/area/demo/index.d.ts +1 -0
  5. package/dist/area/demo/index.js +41 -0
  6. package/dist/area/index.js +4 -5
  7. package/dist/battery/demo/index.d.ts +1 -0
  8. package/dist/battery/demo/index.js +2 -0
  9. package/dist/battery/index.js +1 -3
  10. package/dist/bottom-sheet/demo/index.d.ts +1 -0
  11. package/dist/bottom-sheet/demo/index.js +24 -0
  12. package/dist/bottom-sheet/index.css +1 -1
  13. package/dist/bottom-sheet/index.js +3 -2
  14. package/dist/bottom-sheet/index.wxml +3 -1
  15. package/dist/bottom-sheet/index.wxss +1 -1
  16. package/dist/button/demo/index.d.ts +1 -0
  17. package/dist/button/demo/index.js +9 -0
  18. package/dist/button/index.js +1 -1
  19. package/dist/calendar/components/header/index.css +1 -1
  20. package/dist/calendar/components/header/index.js +1 -1
  21. package/dist/calendar/components/header/index.wxml +3 -3
  22. package/dist/calendar/components/header/index.wxss +1 -1
  23. package/dist/calendar/components/month/index.css +1 -1
  24. package/dist/calendar/components/month/index.js +3 -5
  25. package/dist/calendar/components/month/index.wxs +1 -4
  26. package/dist/calendar/components/month/index.wxss +1 -1
  27. package/dist/calendar/components/month-list/index.css +1 -1
  28. package/dist/calendar/components/month-list/index.js +4 -17
  29. package/dist/calendar/components/month-list/index.wxml +15 -13
  30. package/dist/calendar/components/month-list/index.wxss +1 -1
  31. package/dist/calendar/components/year-list/index.css +1 -1
  32. package/dist/calendar/components/year-list/index.js +3 -3
  33. package/dist/calendar/components/year-list/index.wxml +1 -1
  34. package/dist/calendar/components/year-list/index.wxss +1 -1
  35. package/dist/calendar/demo/index.d.ts +1 -0
  36. package/dist/calendar/demo/index.js +103 -0
  37. package/dist/calendar/index.js +9 -14
  38. package/dist/calendar/index.wxs +4 -7
  39. package/dist/calendar/utils.js +2 -4
  40. package/dist/cascader/demo/index.d.ts +1 -0
  41. package/dist/cascader/demo/index.js +191 -0
  42. package/dist/cascader/index.js +3 -3
  43. package/dist/cell/demo/index.d.ts +1 -0
  44. package/dist/cell/demo/index.js +14 -0
  45. package/dist/cell/index.js +1 -7
  46. package/dist/checkbox/demo/index.d.ts +1 -0
  47. package/dist/checkbox/demo/index.js +34 -0
  48. package/dist/checkbox-group/index.js +1 -1
  49. package/dist/circle/demo/index.d.ts +1 -0
  50. package/dist/circle/demo/index.js +19 -0
  51. package/dist/col/demo/index.d.ts +1 -0
  52. package/dist/col/demo/index.js +4 -0
  53. package/dist/collapse/demo/index.d.ts +1 -0
  54. package/dist/collapse/demo/index.js +36 -0
  55. package/dist/collapse/index.js +1 -1
  56. package/dist/collapse-item/animate.js +1 -1
  57. package/dist/common/component.js +1 -1
  58. package/dist/common/utils.js +3 -3
  59. package/dist/config-provider/demo/index.d.ts +1 -0
  60. package/dist/config-provider/demo/index.js +22 -0
  61. package/dist/count-down/demo/index.d.ts +1 -0
  62. package/dist/count-down/demo/index.js +33 -0
  63. package/dist/custom-keyboard/demo/index.d.ts +1 -0
  64. package/dist/custom-keyboard/demo/index.js +17 -0
  65. package/dist/custom-keyboard/index.js +1 -3
  66. package/dist/datetime-picker/demo/index.d.ts +1 -0
  67. package/dist/datetime-picker/demo/index.js +63 -0
  68. package/dist/datetime-picker/index.js +4 -5
  69. package/dist/dialog/demo/index.d.ts +1 -0
  70. package/dist/dialog/demo/index.js +134 -0
  71. package/dist/dialog/dialog.js +3 -5
  72. package/dist/dialog/index.js +1 -1
  73. package/dist/divider/demo/index.d.ts +1 -0
  74. package/dist/divider/demo/index.js +4 -0
  75. package/dist/dropdown-item/index.js +3 -3
  76. package/dist/dropdown-item/index.wxml +1 -7
  77. package/dist/dropdown-menu/demo/index.d.ts +1 -0
  78. package/dist/dropdown-menu/demo/index.js +47 -0
  79. package/dist/dropdown-menu/index.js +8 -10
  80. package/dist/empty/demo/index.d.ts +1 -0
  81. package/dist/empty/demo/index.js +13 -0
  82. package/dist/empty/index.css +1 -1
  83. package/dist/empty/index.wxs +1 -1
  84. package/dist/empty/index.wxss +1 -1
  85. package/dist/field/demo/index.d.ts +1 -0
  86. package/dist/field/demo/index.js +21 -0
  87. package/dist/goods-action/demo/index.d.ts +1 -0
  88. package/dist/goods-action/demo/index.js +12 -0
  89. package/dist/goods-action/index.js +1 -1
  90. package/dist/grid/demo/index.d.ts +1 -0
  91. package/dist/grid/demo/index.js +9 -0
  92. package/dist/grid/index.js +1 -1
  93. package/dist/grid-item/index.js +1 -1
  94. package/dist/icon/demo/index.d.ts +1 -0
  95. package/dist/icon/demo/index.js +26 -0
  96. package/dist/image/demo/index.d.ts +1 -0
  97. package/dist/image/demo/index.js +15 -0
  98. package/dist/index-anchor/index.js +1 -1
  99. package/dist/index-bar/demo/index.d.ts +1 -0
  100. package/dist/index-bar/demo/index.js +21 -0
  101. package/dist/index-bar/index.js +9 -16
  102. package/dist/loading/demo/index.d.ts +1 -0
  103. package/dist/loading/demo/index.js +4 -0
  104. package/dist/loading/index.js +25 -1
  105. package/dist/loading/index.wxml +2 -2
  106. package/dist/loading/index.wxs +6 -21
  107. package/dist/mixins/basic.js +2 -2
  108. package/dist/mixins/link.js +1 -2
  109. package/dist/mixins/page-scroll.js +1 -1
  110. package/dist/mixins/touch.js +1 -2
  111. package/dist/mixins/transition.js +1 -1
  112. package/dist/nav-bar/demo/index.d.ts +1 -0
  113. package/dist/nav-bar/demo/index.js +26 -0
  114. package/dist/nav-bar/index.css +1 -1
  115. package/dist/nav-bar/index.js +1 -1
  116. package/dist/nav-bar/index.wxml +1 -1
  117. package/dist/nav-bar/index.wxss +1 -1
  118. package/dist/normal-slider/demo/index.d.ts +1 -0
  119. package/dist/normal-slider/demo/index.js +19 -0
  120. package/dist/notice-bar/demo/index.d.ts +1 -0
  121. package/dist/notice-bar/demo/index.js +11 -0
  122. package/dist/notice-bar/index.js +3 -6
  123. package/dist/notice-bar/index.wxml +1 -5
  124. package/dist/notify/demo/index.d.ts +1 -0
  125. package/dist/notify/demo/index.js +45 -0
  126. package/dist/overlay/demo/index.d.ts +1 -0
  127. package/dist/overlay/demo/index.js +22 -0
  128. package/dist/picker/demo/index.d.ts +1 -0
  129. package/dist/picker/demo/index.js +76 -0
  130. package/dist/picker/index.css +1 -1
  131. package/dist/picker/index.js +2 -2
  132. package/dist/picker/index.wxml +1 -0
  133. package/dist/picker/index.wxss +1 -1
  134. package/dist/picker-column/index.js +3 -8
  135. package/dist/popup/demo/index.d.ts +1 -0
  136. package/dist/popup/demo/index.js +79 -0
  137. package/dist/progress/demo/index.d.ts +1 -0
  138. package/dist/progress/demo/index.js +4 -0
  139. package/dist/progress/index.js +1 -4
  140. package/dist/radio/demo/index.d.ts +1 -0
  141. package/dist/radio/demo/index.js +31 -0
  142. package/dist/radio-group/index.js +1 -1
  143. package/dist/rate/demo/index.d.ts +1 -0
  144. package/dist/rate/demo/index.js +25 -0
  145. package/dist/rate/index.js +2 -2
  146. package/dist/row/index.js +1 -1
  147. package/dist/search/demo/index.d.ts +1 -0
  148. package/dist/search/demo/index.js +43 -0
  149. package/dist/sidebar/demo/index.d.ts +1 -0
  150. package/dist/sidebar/demo/index.js +9 -0
  151. package/dist/skeleton/demo/index.d.ts +1 -0
  152. package/dist/skeleton/demo/index.js +11 -0
  153. package/dist/slider/demo/index.d.ts +1 -0
  154. package/dist/slider/demo/index.js +19 -0
  155. package/dist/slider/index.js +5 -7
  156. package/dist/stepper/demo/index.d.ts +1 -0
  157. package/dist/stepper/demo/index.js +19 -0
  158. package/dist/steps/demo/index.d.ts +1 -0
  159. package/dist/steps/demo/index.js +42 -0
  160. package/dist/sticky/demo/index.d.ts +1 -0
  161. package/dist/sticky/demo/index.js +26 -0
  162. package/dist/sticky/index.js +2 -2
  163. package/dist/swipe-cell/demo/index.d.ts +1 -0
  164. package/dist/swipe-cell/demo/index.js +45 -0
  165. package/dist/swipe-cell/index.js +3 -5
  166. package/dist/switch/demo/index.d.ts +1 -0
  167. package/dist/switch/demo/index.js +29 -0
  168. package/dist/switch/index.css +1 -1
  169. package/dist/switch/index.wxss +1 -1
  170. package/dist/tab/demo/index.d.ts +1 -0
  171. package/dist/tab/demo/index.js +55 -0
  172. package/dist/tabbar/demo/index.d.ts +1 -0
  173. package/dist/tabbar/demo/index.js +34 -0
  174. package/dist/tabbar/index.js +1 -1
  175. package/dist/tabs/index.js +7 -25
  176. package/dist/tag/demo/index.d.ts +1 -0
  177. package/dist/tag/demo/index.js +16 -0
  178. package/dist/tag/index.css +1 -1
  179. package/dist/tag/index.wxss +1 -1
  180. package/dist/toast/demo/index.d.ts +1 -0
  181. package/dist/toast/demo/index.js +67 -0
  182. package/dist/toast/toast.js +3 -5
  183. package/dist/transition/demo/index.d.ts +1 -0
  184. package/dist/transition/demo/index.js +67 -0
  185. package/dist/tree-select/demo/index.d.ts +1 -0
  186. package/dist/tree-select/demo/index.js +113 -0
  187. package/lib/action-sheet/demo/index.d.ts +1 -0
  188. package/lib/action-sheet/demo/index.js +115 -0
  189. package/lib/area/demo/index.d.ts +1 -0
  190. package/lib/area/demo/index.js +47 -0
  191. package/lib/area/index.js +1 -2
  192. package/lib/battery/demo/index.d.ts +1 -0
  193. package/lib/battery/demo/index.js +4 -0
  194. package/lib/battery/index.js +1 -3
  195. package/lib/bottom-sheet/demo/index.d.ts +1 -0
  196. package/lib/bottom-sheet/demo/index.js +27 -0
  197. package/lib/bottom-sheet/index.css +1 -1
  198. package/lib/bottom-sheet/index.js +3 -2
  199. package/lib/bottom-sheet/index.wxml +3 -1
  200. package/lib/bottom-sheet/index.wxss +1 -1
  201. package/lib/button/demo/index.d.ts +1 -0
  202. package/lib/button/demo/index.js +14 -0
  203. package/lib/calendar/components/header/index.css +1 -1
  204. package/lib/calendar/components/header/index.wxml +3 -3
  205. package/lib/calendar/components/header/index.wxss +1 -1
  206. package/lib/calendar/components/month/index.css +1 -1
  207. package/lib/calendar/components/month/index.js +2 -6
  208. package/lib/calendar/components/month/index.wxs +1 -4
  209. package/lib/calendar/components/month/index.wxss +1 -1
  210. package/lib/calendar/components/month-list/index.css +1 -1
  211. package/lib/calendar/components/month-list/index.js +3 -16
  212. package/lib/calendar/components/month-list/index.wxml +15 -13
  213. package/lib/calendar/components/month-list/index.wxss +1 -1
  214. package/lib/calendar/components/year-list/index.css +1 -1
  215. package/lib/calendar/components/year-list/index.js +1 -1
  216. package/lib/calendar/components/year-list/index.wxml +1 -1
  217. package/lib/calendar/components/year-list/index.wxss +1 -1
  218. package/lib/calendar/demo/index.d.ts +1 -0
  219. package/lib/calendar/demo/index.js +105 -0
  220. package/lib/calendar/index.js +7 -14
  221. package/lib/calendar/index.wxs +4 -7
  222. package/lib/calendar/utils.js +1 -3
  223. package/lib/cascader/demo/index.d.ts +1 -0
  224. package/lib/cascader/demo/index.js +197 -0
  225. package/lib/cell/demo/index.d.ts +1 -0
  226. package/lib/cell/demo/index.js +39 -0
  227. package/lib/cell/index.js +1 -7
  228. package/lib/checkbox/demo/index.d.ts +1 -0
  229. package/lib/checkbox/demo/index.js +38 -0
  230. package/lib/circle/demo/index.d.ts +1 -0
  231. package/lib/circle/demo/index.js +21 -0
  232. package/lib/col/demo/index.d.ts +1 -0
  233. package/lib/col/demo/index.js +6 -0
  234. package/lib/collapse/demo/index.d.ts +1 -0
  235. package/lib/collapse/demo/index.js +42 -0
  236. package/lib/config-provider/demo/index.d.ts +1 -0
  237. package/lib/config-provider/demo/index.js +24 -0
  238. package/lib/count-down/demo/index.d.ts +1 -0
  239. package/lib/count-down/demo/index.js +38 -0
  240. package/lib/custom-keyboard/demo/index.d.ts +1 -0
  241. package/lib/custom-keyboard/demo/index.js +19 -0
  242. package/lib/custom-keyboard/index.js +1 -3
  243. package/lib/datetime-picker/demo/index.d.ts +1 -0
  244. package/lib/datetime-picker/demo/index.js +68 -0
  245. package/lib/datetime-picker/index.js +4 -3
  246. package/lib/dialog/demo/index.d.ts +1 -0
  247. package/lib/dialog/demo/index.js +144 -0
  248. package/lib/dialog/dialog.js +1 -3
  249. package/lib/divider/demo/index.d.ts +1 -0
  250. package/lib/divider/demo/index.js +6 -0
  251. package/lib/dropdown-item/index.wxml +1 -7
  252. package/lib/dropdown-menu/demo/index.d.ts +1 -0
  253. package/lib/dropdown-menu/demo/index.js +52 -0
  254. package/lib/dropdown-menu/index.js +2 -4
  255. package/lib/empty/demo/index.d.ts +1 -0
  256. package/lib/empty/demo/index.js +15 -0
  257. package/lib/empty/index.css +1 -1
  258. package/lib/empty/index.wxs +1 -1
  259. package/lib/empty/index.wxss +1 -1
  260. package/lib/field/demo/index.d.ts +1 -0
  261. package/lib/field/demo/index.js +23 -0
  262. package/lib/goods-action/demo/index.d.ts +1 -0
  263. package/lib/goods-action/demo/index.js +17 -0
  264. package/lib/grid/demo/index.d.ts +1 -0
  265. package/lib/grid/demo/index.js +11 -0
  266. package/lib/icon/demo/index.d.ts +1 -0
  267. package/lib/icon/demo/index.js +54 -0
  268. package/lib/image/demo/index.d.ts +1 -0
  269. package/lib/image/demo/index.js +17 -0
  270. package/lib/index-bar/demo/index.d.ts +1 -0
  271. package/lib/index-bar/demo/index.js +23 -0
  272. package/lib/index-bar/index.js +3 -10
  273. package/lib/loading/demo/index.d.ts +1 -0
  274. package/lib/loading/demo/index.js +6 -0
  275. package/lib/loading/index.js +27 -1
  276. package/lib/loading/index.wxml +2 -2
  277. package/lib/loading/index.wxs +6 -21
  278. package/lib/mixins/link.js +1 -2
  279. package/lib/mixins/touch.js +1 -2
  280. package/lib/nav-bar/demo/index.d.ts +1 -0
  281. package/lib/nav-bar/demo/index.js +31 -0
  282. package/lib/nav-bar/index.css +1 -1
  283. package/lib/nav-bar/index.wxml +1 -1
  284. package/lib/nav-bar/index.wxss +1 -1
  285. package/lib/normal-slider/demo/index.d.ts +1 -0
  286. package/lib/normal-slider/demo/index.js +21 -0
  287. package/lib/notice-bar/demo/index.d.ts +1 -0
  288. package/lib/notice-bar/demo/index.js +16 -0
  289. package/lib/notice-bar/index.js +2 -5
  290. package/lib/notice-bar/index.wxml +1 -5
  291. package/lib/notify/demo/index.d.ts +1 -0
  292. package/lib/notify/demo/index.js +50 -0
  293. package/lib/overlay/demo/index.d.ts +1 -0
  294. package/lib/overlay/demo/index.js +24 -0
  295. package/lib/picker/demo/index.d.ts +1 -0
  296. package/lib/picker/demo/index.js +82 -0
  297. package/lib/picker/index.css +1 -1
  298. package/lib/picker/index.js +1 -3
  299. package/lib/picker/index.wxml +1 -0
  300. package/lib/picker/index.wxss +1 -1
  301. package/lib/picker-column/index.js +2 -7
  302. package/lib/popup/demo/index.d.ts +1 -0
  303. package/lib/popup/demo/index.js +85 -0
  304. package/lib/progress/demo/index.d.ts +1 -0
  305. package/lib/progress/demo/index.js +6 -0
  306. package/lib/progress/index.js +1 -4
  307. package/lib/radio/demo/index.d.ts +1 -0
  308. package/lib/radio/demo/index.js +34 -0
  309. package/lib/rate/demo/index.d.ts +1 -0
  310. package/lib/rate/demo/index.js +30 -0
  311. package/lib/search/demo/index.d.ts +1 -0
  312. package/lib/search/demo/index.js +48 -0
  313. package/lib/sidebar/demo/index.d.ts +1 -0
  314. package/lib/sidebar/demo/index.js +14 -0
  315. package/lib/skeleton/demo/index.d.ts +1 -0
  316. package/lib/skeleton/demo/index.js +14 -0
  317. package/lib/slider/demo/index.d.ts +1 -0
  318. package/lib/slider/demo/index.js +21 -0
  319. package/lib/slider/index.js +1 -3
  320. package/lib/stepper/demo/index.d.ts +1 -0
  321. package/lib/stepper/demo/index.js +25 -0
  322. package/lib/steps/demo/index.d.ts +1 -0
  323. package/lib/steps/demo/index.js +47 -0
  324. package/lib/sticky/demo/index.d.ts +1 -0
  325. package/lib/sticky/demo/index.js +30 -0
  326. package/lib/sticky/index.js +3 -1
  327. package/lib/swipe-cell/demo/index.d.ts +1 -0
  328. package/lib/swipe-cell/demo/index.js +50 -0
  329. package/lib/swipe-cell/index.js +1 -3
  330. package/lib/switch/demo/index.d.ts +1 -0
  331. package/lib/switch/demo/index.js +37 -0
  332. package/lib/switch/index.css +1 -1
  333. package/lib/switch/index.wxss +1 -1
  334. package/lib/tab/demo/index.d.ts +1 -0
  335. package/lib/tab/demo/index.js +57 -0
  336. package/lib/tabbar/demo/index.d.ts +1 -0
  337. package/lib/tabbar/demo/index.js +41 -0
  338. package/lib/tabs/index.js +6 -24
  339. package/lib/tag/demo/index.d.ts +1 -0
  340. package/lib/tag/demo/index.js +19 -0
  341. package/lib/tag/index.css +1 -1
  342. package/lib/tag/index.wxss +1 -1
  343. package/lib/toast/demo/index.d.ts +1 -0
  344. package/lib/toast/demo/index.js +74 -0
  345. package/lib/toast/toast.js +1 -3
  346. package/lib/transition/demo/index.d.ts +1 -0
  347. package/lib/transition/demo/index.js +71 -0
  348. package/lib/tree-select/demo/index.d.ts +1 -0
  349. package/lib/tree-select/demo/index.js +130 -0
  350. package/package.json +1 -1
@@ -0,0 +1,103 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ // day
5
+ curDayDate: new Date(2024, 0, 15).getTime(),
6
+ minDayDate: new Date(2024, 0, 4).getTime(),
7
+ maxDayDate: new Date(2024, 1, 20).getTime(),
8
+ // weekday
9
+ curWeekDayDate: [
10
+ new Date(2024, 0, 15).getTime(),
11
+ new Date(2024, 0, 21).getTime(),
12
+ ],
13
+ minWeekDayDate: new Date(2024, 0, 4).getTime(),
14
+ maxWeekDayDate: new Date(2024, 1, 20).getTime(),
15
+ // range
16
+ curRangeDayDate: [
17
+ new Date(2024, 0, 10).getTime(),
18
+ new Date(2024, 0, 20).getTime(),
19
+ ],
20
+ minRangeDayDate: new Date(2024, 0, 4).getTime(),
21
+ maxRangeDayDate: new Date(2024, 1, 20).getTime(),
22
+ // month
23
+ curMonthDate: new Date(2024, 6, 1).getTime(),
24
+ minMonthDate: new Date(2024, 2, 1).getTime(),
25
+ maxMonthDate: new Date(2025, 9, 31).getTime(),
26
+ // year
27
+ curYearDate: new Date(2017, 6, 1).getTime(),
28
+ minYearDate: new Date(2012, 0, 1).getTime(),
29
+ maxYearDate: new Date(2029, 10, 31).getTime(),
30
+ // locale
31
+ confirmText: I18n.t('confirm'),
32
+ confirmDisabledText: I18n.t('confirm'),
33
+ firstDayOfWeek: 0,
34
+ locale: {
35
+ shortWeekDays: [
36
+ I18n.t('week0'),
37
+ I18n.t('week1'),
38
+ I18n.t('week2'),
39
+ I18n.t('week3'),
40
+ I18n.t('week4'),
41
+ I18n.t('week5'),
42
+ I18n.t('week6'),
43
+ ],
44
+ subFormatter: 'YYYY' + I18n.t('year') + 'MM' + I18n.t('month'),
45
+ },
46
+ locale2: {
47
+ subFormatter: 'YYYY' + I18n.t('year'),
48
+ monthsFormatter: [
49
+ I18n.t('cal_Jan'),
50
+ I18n.t('cal_Feb'),
51
+ I18n.t('cal_Mar'),
52
+ I18n.t('cal_Apr'),
53
+ I18n.t('cal_May'),
54
+ I18n.t('cal_Jun'),
55
+ I18n.t('cal_Jul'),
56
+ I18n.t('cal_Aug'),
57
+ I18n.t('cal_Sept'),
58
+ I18n.t('cal_Oct'),
59
+ I18n.t('cal_Nov'),
60
+ I18n.t('cal_Dec')
61
+ ]
62
+ },
63
+ showDayPicker: false,
64
+ },
65
+ methods: {
66
+ setCurDay(event) {
67
+ const date = event.detail;
68
+ this.setData({
69
+ curDayDate: new Date(date).getTime(),
70
+ showDayPicker: false,
71
+ });
72
+ },
73
+ setWeekCurDay(event) {
74
+ const date = event.detail;
75
+ this.setData({
76
+ curWeekDayDate: [date[0], date[1]],
77
+ });
78
+ },
79
+ setRangeCurDay(event) {
80
+ const date = event.detail;
81
+ this.setData({
82
+ curRangeDayDate: [date[0], date[1]],
83
+ });
84
+ },
85
+ setCurMonth(event) {
86
+ const date = event.detail;
87
+ this.setData({
88
+ curMonthDate: date,
89
+ });
90
+ },
91
+ setCurYear(event) {
92
+ const date = event.detail;
93
+ this.setData({
94
+ curYearDate: date,
95
+ });
96
+ },
97
+ onShowDayPicker() {
98
+ this.setData({
99
+ showDayPicker: !this.data.showDayPicker,
100
+ });
101
+ },
102
+ },
103
+ });
@@ -2,7 +2,7 @@ import { SmartComponent } from '../common/component';
2
2
  import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, getInitEdgeDate, } from './utils';
3
3
  import Toast from '../toast/toast';
4
4
  const dateEdge = getInitEdgeDate('year');
5
- const getTime = (date) => date instanceof Date ? date.getTime() : date;
5
+ const getTime = (date) => (date instanceof Date ? date.getTime() : date);
6
6
  SmartComponent({
7
7
  props: {
8
8
  title: {
@@ -72,11 +72,11 @@ SmartComponent({
72
72
  },
73
73
  minDate: {
74
74
  type: Number,
75
- value: dateEdge.min
75
+ value: dateEdge.min,
76
76
  },
77
77
  maxDate: {
78
78
  type: Number,
79
- value: dateEdge.max
79
+ value: dateEdge.max,
80
80
  },
81
81
  position: {
82
82
  type: String,
@@ -104,7 +104,7 @@ SmartComponent({
104
104
  },
105
105
  showConfirm: {
106
106
  type: Boolean,
107
- value: true,
107
+ value: false,
108
108
  },
109
109
  showSubtitle: {
110
110
  type: Boolean,
@@ -268,7 +268,7 @@ SmartComponent({
268
268
  }
269
269
  if (type === 'multiple') {
270
270
  if (Array.isArray(defaultDate)) {
271
- return defaultDate.map((date) => this.limitDateRange(date));
271
+ return defaultDate.map(date => this.limitDateRange(date));
272
272
  }
273
273
  return [this.limitDateRange(now)];
274
274
  }
@@ -278,8 +278,7 @@ SmartComponent({
278
278
  return this.limitDateRange(defaultDate);
279
279
  },
280
280
  scrollIntoView() {
281
- if (!this.isMounted)
282
- return;
281
+ // if (!this.isMounted) return;
283
282
  },
284
283
  onOpen() {
285
284
  this.$emit('open');
@@ -364,7 +363,7 @@ SmartComponent({
364
363
  if (this.data.readonly) {
365
364
  return;
366
365
  }
367
- let date = event.detail;
366
+ const date = event.detail;
368
367
  this.select(date, true);
369
368
  },
370
369
  unselect(dateArray) {
@@ -379,10 +378,7 @@ SmartComponent({
379
378
  if (!valid) {
380
379
  // auto selected to max range if showConfirm
381
380
  if (this.data.showConfirm) {
382
- this.emit([
383
- date[0],
384
- getDayByOffset(date[0], this.data.maxRange - 1),
385
- ]);
381
+ this.emit([date[0], getDayByOffset(date[0], this.data.maxRange - 1)]);
386
382
  }
387
383
  else {
388
384
  this.emit(date);
@@ -416,8 +412,7 @@ SmartComponent({
416
412
  return true;
417
413
  },
418
414
  onConfirm() {
419
- if (this.data.type === 'range' &&
420
- !this.checkRange(this.data.currentDate)) {
415
+ if (this.data.type === 'range' && !this.checkRange(this.data.currentDate)) {
421
416
  return;
422
417
  }
423
418
  wx.nextTick(() => {
@@ -38,10 +38,7 @@ function getVisible(visibleIndex, curIndex) {
38
38
  function formatMonthTitle(date, formatter = 'YYYY-MM') {
39
39
  date = getDate(date);
40
40
  const year = date.getFullYear();
41
- const month =
42
- date.getMonth() + 1 < 10
43
- ? `0${date.getMonth() + 1}`
44
- : date.getMonth() + 1 + '';
41
+ const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
45
42
  return formatter.replace('YYYY', year + '').replace('MM', month);
46
43
  }
47
44
 
@@ -53,8 +50,8 @@ function formatYearTitle(date, offset, formatter = 'YYYY') {
53
50
 
54
51
  module.exports = {
55
52
  getMonths: getMonths,
56
- getVisible,
53
+ getVisible: getVisible,
57
54
  getButtonDisabled: getButtonDisabled,
58
- formatMonthTitle,
59
- formatYearTitle,
55
+ formatMonthTitle: formatMonthTitle,
56
+ formatYearTitle: formatYearTitle,
60
57
  };
@@ -4,9 +4,7 @@ export function formatMonthTitle(date, formatter = 'YYYY-MM') {
4
4
  date = new Date(date);
5
5
  }
6
6
  const year = date.getFullYear();
7
- const month = date.getMonth() + 1 < 10
8
- ? `0${date.getMonth() + 1}`
9
- : date.getMonth() + 1 + '';
7
+ const month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1 + '';
10
8
  return formatter.replace('YYYY', year + '').replace('MM', month);
11
9
  }
12
10
  export function compareMonth(date1, date2) {
@@ -63,7 +61,7 @@ export function calcDateNum(date) {
63
61
  }
64
62
  export function copyDates(dates) {
65
63
  if (Array.isArray(dates)) {
66
- return dates.map((date) => {
64
+ return dates.map(date => {
67
65
  if (date === null) {
68
66
  return date;
69
67
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -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
+ });
@@ -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((option) => {
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((item) => item.value === option.value);
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((tab) => tab.selected).filter(Boolean);
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
+ });
@@ -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((child) => this.updateChild(child));
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,4 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {},
4
+ });
@@ -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
+ });
@@ -18,7 +18,7 @@ SmartComponent({
18
18
  },
19
19
  methods: {
20
20
  updateExpanded() {
21
- this.children.forEach((child) => {
21
+ this.children.forEach(child => {
22
22
  child.updateExpanded();
23
23
  });
24
24
  },
@@ -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((rect) => rect.height)
35
+ .then(rect => rect.height)
36
36
  .then((height) => {
37
37
  useAnimation(context, expanded, mounted, height);
38
38
  });
@@ -1,6 +1,6 @@
1
1
  import { basic } from '../mixins/basic';
2
2
  function mapKeys(source, target, map) {
3
- Object.keys(map).forEach((key) => {
3
+ Object.keys(map).forEach(key => {
4
4
  if (source[key]) {
5
5
  target[map[key]] = source[key];
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { isDef, isNumber, isPlainObject, isPromise } from './validator';
2
- import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync, } from './version';
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((resolve) => {
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((resolve) => {
51
+ return new Promise(resolve => {
52
52
  wx.createSelectorQuery()
53
53
  .in(context)
54
54
  .selectAll(selector)
@@ -0,0 +1 @@
1
+ export {};