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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (370) hide show
  1. package/dist/action-sheet/demo/index.d.ts +1 -0
  2. package/dist/action-sheet/demo/index.js +105 -0
  3. package/dist/action-sheet/index.js +2 -2
  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.css +1 -1
  19. package/dist/button/index.js +1 -1
  20. package/dist/button/index.wxss +1 -1
  21. package/dist/calendar/components/header/index.css +1 -1
  22. package/dist/calendar/components/header/index.js +1 -1
  23. package/dist/calendar/components/header/index.wxml +3 -3
  24. package/dist/calendar/components/header/index.wxss +1 -1
  25. package/dist/calendar/components/month/index.css +1 -1
  26. package/dist/calendar/components/month/index.js +3 -5
  27. package/dist/calendar/components/month/index.wxs +1 -4
  28. package/dist/calendar/components/month/index.wxss +1 -1
  29. package/dist/calendar/components/month-list/index.css +1 -1
  30. package/dist/calendar/components/month-list/index.js +4 -17
  31. package/dist/calendar/components/month-list/index.wxml +15 -13
  32. package/dist/calendar/components/month-list/index.wxss +1 -1
  33. package/dist/calendar/components/year-list/index.css +1 -1
  34. package/dist/calendar/components/year-list/index.js +3 -3
  35. package/dist/calendar/components/year-list/index.wxml +1 -1
  36. package/dist/calendar/components/year-list/index.wxss +1 -1
  37. package/dist/calendar/demo/index.d.ts +1 -0
  38. package/dist/calendar/demo/index.js +103 -0
  39. package/dist/calendar/index.js +9 -14
  40. package/dist/calendar/index.wxs +4 -7
  41. package/dist/calendar/utils.js +2 -4
  42. package/dist/cascader/demo/index.d.ts +1 -0
  43. package/dist/cascader/demo/index.js +191 -0
  44. package/dist/cascader/index.js +3 -3
  45. package/dist/cell/demo/index.d.ts +1 -0
  46. package/dist/cell/demo/index.js +14 -0
  47. package/dist/cell/index.js +1 -7
  48. package/dist/checkbox/demo/index.d.ts +1 -0
  49. package/dist/checkbox/demo/index.js +34 -0
  50. package/dist/checkbox/index.js +2 -2
  51. package/dist/checkbox-group/index.js +1 -1
  52. package/dist/circle/demo/index.d.ts +1 -0
  53. package/dist/circle/demo/index.js +19 -0
  54. package/dist/col/demo/index.d.ts +1 -0
  55. package/dist/col/demo/index.js +4 -0
  56. package/dist/collapse/demo/index.d.ts +1 -0
  57. package/dist/collapse/demo/index.js +36 -0
  58. package/dist/collapse/index.js +1 -1
  59. package/dist/collapse-item/animate.js +1 -1
  60. package/dist/common/component.js +1 -1
  61. package/dist/common/utils.js +3 -3
  62. package/dist/config-provider/demo/index.d.ts +1 -0
  63. package/dist/config-provider/demo/index.js +22 -0
  64. package/dist/count-down/demo/index.d.ts +1 -0
  65. package/dist/count-down/demo/index.js +33 -0
  66. package/dist/custom-keyboard/demo/index.d.ts +1 -0
  67. package/dist/custom-keyboard/demo/index.js +17 -0
  68. package/dist/custom-keyboard/index.js +1 -3
  69. package/dist/datetime-picker/demo/index.d.ts +1 -0
  70. package/dist/datetime-picker/demo/index.js +63 -0
  71. package/dist/datetime-picker/index.js +4 -5
  72. package/dist/dialog/demo/index.d.ts +1 -0
  73. package/dist/dialog/demo/index.js +134 -0
  74. package/dist/dialog/dialog.js +3 -5
  75. package/dist/dialog/index.js +1 -1
  76. package/dist/divider/demo/index.d.ts +1 -0
  77. package/dist/divider/demo/index.js +4 -0
  78. package/dist/dropdown-item/index.js +4 -4
  79. package/dist/dropdown-item/index.wxml +1 -7
  80. package/dist/dropdown-menu/demo/index.d.ts +1 -0
  81. package/dist/dropdown-menu/demo/index.js +47 -0
  82. package/dist/dropdown-menu/index.js +8 -10
  83. package/dist/empty/demo/index.d.ts +1 -0
  84. package/dist/empty/demo/index.js +13 -0
  85. package/dist/empty/index.css +1 -1
  86. package/dist/empty/index.wxs +1 -1
  87. package/dist/empty/index.wxss +1 -1
  88. package/dist/field/demo/index.d.ts +1 -0
  89. package/dist/field/demo/index.js +21 -0
  90. package/dist/goods-action/demo/index.d.ts +1 -0
  91. package/dist/goods-action/demo/index.js +12 -0
  92. package/dist/goods-action/index.css +1 -1
  93. package/dist/goods-action/index.js +1 -1
  94. package/dist/goods-action/index.wxss +1 -1
  95. package/dist/goods-action-button/index.css +1 -1
  96. package/dist/goods-action-button/index.wxss +1 -1
  97. package/dist/grid/demo/index.d.ts +1 -0
  98. package/dist/grid/demo/index.js +9 -0
  99. package/dist/grid/index.js +1 -1
  100. package/dist/grid-item/index.js +1 -1
  101. package/dist/icon/demo/index.d.ts +1 -0
  102. package/dist/icon/demo/index.js +26 -0
  103. package/dist/image/demo/index.d.ts +1 -0
  104. package/dist/image/demo/index.js +15 -0
  105. package/dist/index-anchor/index.js +1 -1
  106. package/dist/index-bar/demo/index.d.ts +1 -0
  107. package/dist/index-bar/demo/index.js +21 -0
  108. package/dist/index-bar/index.js +9 -16
  109. package/dist/loading/demo/index.d.ts +1 -0
  110. package/dist/loading/demo/index.js +4 -0
  111. package/dist/loading/index.js +25 -1
  112. package/dist/loading/index.wxml +2 -2
  113. package/dist/loading/index.wxs +6 -21
  114. package/dist/mixins/basic.js +2 -2
  115. package/dist/mixins/link.js +1 -2
  116. package/dist/mixins/page-scroll.js +1 -1
  117. package/dist/mixins/touch.js +1 -2
  118. package/dist/mixins/transition.js +1 -1
  119. package/dist/nav-bar/demo/index.d.ts +1 -0
  120. package/dist/nav-bar/demo/index.js +26 -0
  121. package/dist/nav-bar/index.css +1 -1
  122. package/dist/nav-bar/index.js +1 -1
  123. package/dist/nav-bar/index.wxml +1 -1
  124. package/dist/nav-bar/index.wxss +1 -1
  125. package/dist/normal-slider/demo/index.d.ts +1 -0
  126. package/dist/normal-slider/demo/index.js +19 -0
  127. package/dist/notice-bar/demo/index.d.ts +1 -0
  128. package/dist/notice-bar/demo/index.js +11 -0
  129. package/dist/notice-bar/index.js +3 -6
  130. package/dist/notice-bar/index.wxml +1 -5
  131. package/dist/notify/demo/index.d.ts +1 -0
  132. package/dist/notify/demo/index.js +45 -0
  133. package/dist/overlay/demo/index.d.ts +1 -0
  134. package/dist/overlay/demo/index.js +22 -0
  135. package/dist/picker/demo/index.d.ts +1 -0
  136. package/dist/picker/demo/index.js +76 -0
  137. package/dist/picker/index.css +1 -1
  138. package/dist/picker/index.js +2 -2
  139. package/dist/picker/index.wxml +1 -0
  140. package/dist/picker/index.wxss +1 -1
  141. package/dist/picker-column/index.js +3 -8
  142. package/dist/popup/demo/index.d.ts +1 -0
  143. package/dist/popup/demo/index.js +79 -0
  144. package/dist/progress/demo/index.d.ts +1 -0
  145. package/dist/progress/demo/index.js +4 -0
  146. package/dist/progress/index.js +1 -4
  147. package/dist/radio/demo/index.d.ts +1 -0
  148. package/dist/radio/demo/index.js +31 -0
  149. package/dist/radio/index.js +2 -2
  150. package/dist/radio-group/index.js +1 -1
  151. package/dist/rate/demo/index.d.ts +1 -0
  152. package/dist/rate/demo/index.js +25 -0
  153. package/dist/rate/index.js +2 -2
  154. package/dist/row/index.js +1 -1
  155. package/dist/search/demo/index.d.ts +1 -0
  156. package/dist/search/demo/index.js +43 -0
  157. package/dist/sidebar/demo/index.d.ts +1 -0
  158. package/dist/sidebar/demo/index.js +9 -0
  159. package/dist/skeleton/demo/index.d.ts +1 -0
  160. package/dist/skeleton/demo/index.js +11 -0
  161. package/dist/slider/demo/index.d.ts +1 -0
  162. package/dist/slider/demo/index.js +19 -0
  163. package/dist/slider/index.js +5 -7
  164. package/dist/stepper/demo/index.d.ts +1 -0
  165. package/dist/stepper/demo/index.js +19 -0
  166. package/dist/steps/demo/index.d.ts +1 -0
  167. package/dist/steps/demo/index.js +42 -0
  168. package/dist/sticky/demo/index.d.ts +1 -0
  169. package/dist/sticky/demo/index.js +26 -0
  170. package/dist/sticky/index.js +2 -2
  171. package/dist/swipe-cell/demo/index.d.ts +1 -0
  172. package/dist/swipe-cell/demo/index.js +45 -0
  173. package/dist/swipe-cell/index.js +3 -5
  174. package/dist/switch/demo/index.d.ts +1 -0
  175. package/dist/switch/demo/index.js +29 -0
  176. package/dist/switch/index.css +1 -1
  177. package/dist/switch/index.wxss +1 -1
  178. package/dist/tab/demo/index.d.ts +1 -0
  179. package/dist/tab/demo/index.js +55 -0
  180. package/dist/tabbar/demo/index.d.ts +1 -0
  181. package/dist/tabbar/demo/index.js +34 -0
  182. package/dist/tabbar/index.js +1 -1
  183. package/dist/tabs/index.js +7 -25
  184. package/dist/tag/demo/index.d.ts +1 -0
  185. package/dist/tag/demo/index.js +16 -0
  186. package/dist/tag/index.css +1 -1
  187. package/dist/tag/index.wxss +1 -1
  188. package/dist/toast/demo/index.d.ts +1 -0
  189. package/dist/toast/demo/index.js +67 -0
  190. package/dist/toast/toast.js +3 -5
  191. package/dist/transition/demo/index.d.ts +1 -0
  192. package/dist/transition/demo/index.js +67 -0
  193. package/dist/tree-select/demo/index.d.ts +1 -0
  194. package/dist/tree-select/demo/index.js +113 -0
  195. package/dist/tree-select/index.js +1 -1
  196. package/lib/action-sheet/demo/index.d.ts +1 -0
  197. package/lib/action-sheet/demo/index.js +119 -0
  198. package/lib/action-sheet/index.js +2 -2
  199. package/lib/area/demo/index.d.ts +1 -0
  200. package/lib/area/demo/index.js +47 -0
  201. package/lib/area/index.js +1 -2
  202. package/lib/battery/demo/index.d.ts +1 -0
  203. package/lib/battery/demo/index.js +4 -0
  204. package/lib/battery/index.js +1 -3
  205. package/lib/bottom-sheet/demo/index.d.ts +1 -0
  206. package/lib/bottom-sheet/demo/index.js +27 -0
  207. package/lib/bottom-sheet/index.css +1 -1
  208. package/lib/bottom-sheet/index.js +3 -2
  209. package/lib/bottom-sheet/index.wxml +3 -1
  210. package/lib/bottom-sheet/index.wxss +1 -1
  211. package/lib/button/demo/index.d.ts +1 -0
  212. package/lib/button/demo/index.js +14 -0
  213. package/lib/button/index.css +1 -1
  214. package/lib/button/index.wxss +1 -1
  215. package/lib/calendar/components/header/index.css +1 -1
  216. package/lib/calendar/components/header/index.wxml +3 -3
  217. package/lib/calendar/components/header/index.wxss +1 -1
  218. package/lib/calendar/components/month/index.css +1 -1
  219. package/lib/calendar/components/month/index.js +2 -6
  220. package/lib/calendar/components/month/index.wxs +1 -4
  221. package/lib/calendar/components/month/index.wxss +1 -1
  222. package/lib/calendar/components/month-list/index.css +1 -1
  223. package/lib/calendar/components/month-list/index.js +3 -16
  224. package/lib/calendar/components/month-list/index.wxml +15 -13
  225. package/lib/calendar/components/month-list/index.wxss +1 -1
  226. package/lib/calendar/components/year-list/index.css +1 -1
  227. package/lib/calendar/components/year-list/index.js +1 -1
  228. package/lib/calendar/components/year-list/index.wxml +1 -1
  229. package/lib/calendar/components/year-list/index.wxss +1 -1
  230. package/lib/calendar/demo/index.d.ts +1 -0
  231. package/lib/calendar/demo/index.js +105 -0
  232. package/lib/calendar/index.js +7 -14
  233. package/lib/calendar/index.wxs +4 -7
  234. package/lib/calendar/utils.js +1 -3
  235. package/lib/cascader/demo/index.d.ts +1 -0
  236. package/lib/cascader/demo/index.js +197 -0
  237. package/lib/cell/demo/index.d.ts +1 -0
  238. package/lib/cell/demo/index.js +39 -0
  239. package/lib/cell/index.js +1 -7
  240. package/lib/checkbox/demo/index.d.ts +1 -0
  241. package/lib/checkbox/demo/index.js +38 -0
  242. package/lib/checkbox/index.js +2 -2
  243. package/lib/circle/demo/index.d.ts +1 -0
  244. package/lib/circle/demo/index.js +21 -0
  245. package/lib/col/demo/index.d.ts +1 -0
  246. package/lib/col/demo/index.js +6 -0
  247. package/lib/collapse/demo/index.d.ts +1 -0
  248. package/lib/collapse/demo/index.js +42 -0
  249. package/lib/config-provider/demo/index.d.ts +1 -0
  250. package/lib/config-provider/demo/index.js +24 -0
  251. package/lib/count-down/demo/index.d.ts +1 -0
  252. package/lib/count-down/demo/index.js +38 -0
  253. package/lib/custom-keyboard/demo/index.d.ts +1 -0
  254. package/lib/custom-keyboard/demo/index.js +19 -0
  255. package/lib/custom-keyboard/index.js +1 -3
  256. package/lib/datetime-picker/demo/index.d.ts +1 -0
  257. package/lib/datetime-picker/demo/index.js +68 -0
  258. package/lib/datetime-picker/index.js +4 -3
  259. package/lib/dialog/demo/index.d.ts +1 -0
  260. package/lib/dialog/demo/index.js +144 -0
  261. package/lib/dialog/dialog.js +1 -3
  262. package/lib/divider/demo/index.d.ts +1 -0
  263. package/lib/divider/demo/index.js +6 -0
  264. package/lib/dropdown-item/index.js +2 -2
  265. package/lib/dropdown-item/index.wxml +1 -7
  266. package/lib/dropdown-menu/demo/index.d.ts +1 -0
  267. package/lib/dropdown-menu/demo/index.js +52 -0
  268. package/lib/dropdown-menu/index.js +2 -4
  269. package/lib/empty/demo/index.d.ts +1 -0
  270. package/lib/empty/demo/index.js +15 -0
  271. package/lib/empty/index.css +1 -1
  272. package/lib/empty/index.wxs +1 -1
  273. package/lib/empty/index.wxss +1 -1
  274. package/lib/field/demo/index.d.ts +1 -0
  275. package/lib/field/demo/index.js +23 -0
  276. package/lib/goods-action/demo/index.d.ts +1 -0
  277. package/lib/goods-action/demo/index.js +17 -0
  278. package/lib/goods-action/index.css +1 -1
  279. package/lib/goods-action/index.wxss +1 -1
  280. package/lib/goods-action-button/index.css +1 -1
  281. package/lib/goods-action-button/index.wxss +1 -1
  282. package/lib/grid/demo/index.d.ts +1 -0
  283. package/lib/grid/demo/index.js +11 -0
  284. package/lib/icon/demo/index.d.ts +1 -0
  285. package/lib/icon/demo/index.js +54 -0
  286. package/lib/image/demo/index.d.ts +1 -0
  287. package/lib/image/demo/index.js +17 -0
  288. package/lib/index-bar/demo/index.d.ts +1 -0
  289. package/lib/index-bar/demo/index.js +23 -0
  290. package/lib/index-bar/index.js +3 -10
  291. package/lib/loading/demo/index.d.ts +1 -0
  292. package/lib/loading/demo/index.js +6 -0
  293. package/lib/loading/index.js +27 -1
  294. package/lib/loading/index.wxml +2 -2
  295. package/lib/loading/index.wxs +6 -21
  296. package/lib/mixins/link.js +1 -2
  297. package/lib/mixins/touch.js +1 -2
  298. package/lib/nav-bar/demo/index.d.ts +1 -0
  299. package/lib/nav-bar/demo/index.js +31 -0
  300. package/lib/nav-bar/index.css +1 -1
  301. package/lib/nav-bar/index.wxml +1 -1
  302. package/lib/nav-bar/index.wxss +1 -1
  303. package/lib/normal-slider/demo/index.d.ts +1 -0
  304. package/lib/normal-slider/demo/index.js +21 -0
  305. package/lib/notice-bar/demo/index.d.ts +1 -0
  306. package/lib/notice-bar/demo/index.js +16 -0
  307. package/lib/notice-bar/index.js +2 -5
  308. package/lib/notice-bar/index.wxml +1 -5
  309. package/lib/notify/demo/index.d.ts +1 -0
  310. package/lib/notify/demo/index.js +50 -0
  311. package/lib/overlay/demo/index.d.ts +1 -0
  312. package/lib/overlay/demo/index.js +24 -0
  313. package/lib/picker/demo/index.d.ts +1 -0
  314. package/lib/picker/demo/index.js +82 -0
  315. package/lib/picker/index.css +1 -1
  316. package/lib/picker/index.js +1 -3
  317. package/lib/picker/index.wxml +1 -0
  318. package/lib/picker/index.wxss +1 -1
  319. package/lib/picker-column/index.js +2 -7
  320. package/lib/popup/demo/index.d.ts +1 -0
  321. package/lib/popup/demo/index.js +85 -0
  322. package/lib/progress/demo/index.d.ts +1 -0
  323. package/lib/progress/demo/index.js +6 -0
  324. package/lib/progress/index.js +1 -4
  325. package/lib/radio/demo/index.d.ts +1 -0
  326. package/lib/radio/demo/index.js +34 -0
  327. package/lib/radio/index.js +2 -2
  328. package/lib/rate/demo/index.d.ts +1 -0
  329. package/lib/rate/demo/index.js +30 -0
  330. package/lib/search/demo/index.d.ts +1 -0
  331. package/lib/search/demo/index.js +48 -0
  332. package/lib/sidebar/demo/index.d.ts +1 -0
  333. package/lib/sidebar/demo/index.js +14 -0
  334. package/lib/skeleton/demo/index.d.ts +1 -0
  335. package/lib/skeleton/demo/index.js +14 -0
  336. package/lib/slider/demo/index.d.ts +1 -0
  337. package/lib/slider/demo/index.js +21 -0
  338. package/lib/slider/index.js +1 -3
  339. package/lib/stepper/demo/index.d.ts +1 -0
  340. package/lib/stepper/demo/index.js +25 -0
  341. package/lib/steps/demo/index.d.ts +1 -0
  342. package/lib/steps/demo/index.js +47 -0
  343. package/lib/sticky/demo/index.d.ts +1 -0
  344. package/lib/sticky/demo/index.js +30 -0
  345. package/lib/sticky/index.js +3 -1
  346. package/lib/swipe-cell/demo/index.d.ts +1 -0
  347. package/lib/swipe-cell/demo/index.js +50 -0
  348. package/lib/swipe-cell/index.js +1 -3
  349. package/lib/switch/demo/index.d.ts +1 -0
  350. package/lib/switch/demo/index.js +37 -0
  351. package/lib/switch/index.css +1 -1
  352. package/lib/switch/index.wxss +1 -1
  353. package/lib/tab/demo/index.d.ts +1 -0
  354. package/lib/tab/demo/index.js +57 -0
  355. package/lib/tabbar/demo/index.d.ts +1 -0
  356. package/lib/tabbar/demo/index.js +41 -0
  357. package/lib/tabs/index.js +6 -24
  358. package/lib/tag/demo/index.d.ts +1 -0
  359. package/lib/tag/demo/index.js +19 -0
  360. package/lib/tag/index.css +1 -1
  361. package/lib/tag/index.wxss +1 -1
  362. package/lib/toast/demo/index.d.ts +1 -0
  363. package/lib/toast/demo/index.js +74 -0
  364. package/lib/toast/toast.js +1 -3
  365. package/lib/transition/demo/index.d.ts +1 -0
  366. package/lib/transition/demo/index.js +71 -0
  367. package/lib/tree-select/demo/index.d.ts +1 -0
  368. package/lib/tree-select/demo/index.js +130 -0
  369. package/lib/tree-select/index.js +2 -2
  370. package/package.json +2 -2
@@ -21,7 +21,7 @@ var maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
21
21
  },
22
22
  color: {
23
23
  type: String,
24
- value: '#3678e3'
24
+ value: '#3678e3',
25
25
  },
26
26
  minDate: {
27
27
  type: null,
@@ -33,24 +33,11 @@ var maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
33
33
  },
34
34
  readonly: {
35
35
  type: Boolean,
36
- value: false
36
+ value: false,
37
37
  },
38
38
  monthsFormatter: {
39
39
  type: null,
40
- value: [
41
- 'Jan',
42
- 'Feb',
43
- 'Mar',
44
- 'Apr',
45
- 'May',
46
- 'Jun',
47
- 'Jul',
48
- 'Aug',
49
- 'Sept',
50
- 'Oct',
51
- 'Nov',
52
- 'Dec',
53
- ],
40
+ value: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'],
54
41
  },
55
42
  },
56
43
  /**
@@ -1,13 +1,15 @@
1
- <smart-row>
2
- <smart-col wx:for="{{months}}" span="6">
3
- <view wx:if="{{item.type === 'disabled'}}" class="item item_disabled" data-index="{{index}}">
4
- {{item.text}}
5
- </view>
6
- <view wx:elif="{{currentMonth === item.value}}" class="item item_active" data-index="{{index}}" bindtap="onClick" style="background: {{ color }};">
7
- {{item.text}}
8
- </view>
9
- <view wx:else class="item" data-index="{{index}}" bindtap="onClick">
10
- {{item.text}}
11
- </view>
12
- </smart-col>
13
- </smart-row>
1
+ <view class="contain">
2
+ <smart-row>
3
+ <smart-col wx:for="{{months}}" span="6" custom-class="col_item">
4
+ <view wx:if="{{item.type === 'disabled'}}" class="item item_disabled" data-index="{{index}}">
5
+ {{item.text}}
6
+ </view>
7
+ <view wx:elif="{{currentMonth === item.value}}" class="item item_active" data-index="{{index}}" bindtap="onClick" style="background: {{ color }};">
8
+ {{item.text}}
9
+ </view>
10
+ <view wx:else class="item" data-index="{{index}}" bindtap="onClick">
11
+ {{item.text}}
12
+ </view>
13
+ </smart-col>
14
+ </smart-row>
15
+ </view>
@@ -1 +1 @@
1
- @import '../../../common/index.wxss';.item{border-radius:50%;color:rgba(0,0,0,.9);font-size:15px;font-weight:500;height:104rpx;line-height:104rpx;text-align:center;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
1
+ @import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1 +1 @@
1
- @import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:50%;color:rgba(0,0,0,.9);font-size:15px;font-weight:500;height:104rpx;line-height:104rpx;text-align:center;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
1
+ @import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -18,7 +18,7 @@ var component_1 = require("../../../common/component");
18
18
  },
19
19
  readonly: {
20
20
  type: Boolean,
21
- value: false
21
+ value: false,
22
22
  },
23
23
  minDate: {
24
24
  type: null,
@@ -1,6 +1,6 @@
1
1
  <view class="contain">
2
2
  <smart-row>
3
- <smart-col wx:for="{{years}}" span="6">
3
+ <smart-col wx:for="{{years}}" span="6" custom-class="col_item">
4
4
  <view wx:if="{{item.type === 'disabled'}}" class="item item_disabled" data-index="{{index}}">
5
5
  {{item.text}}
6
6
  </view>
@@ -1 +1 @@
1
- @import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:50%;color:rgba(0,0,0,.9);font-size:15px;font-weight:500;height:104rpx;line-height:104rpx;text-align:center;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
1
+ @import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var component_1 = require("../../common/component");
4
+ (0, component_1.SmartComponent)({
5
+ data: {
6
+ // day
7
+ curDayDate: new Date(2024, 0, 15).getTime(),
8
+ minDayDate: new Date(2024, 0, 4).getTime(),
9
+ maxDayDate: new Date(2024, 1, 20).getTime(),
10
+ // weekday
11
+ curWeekDayDate: [
12
+ new Date(2024, 0, 15).getTime(),
13
+ new Date(2024, 0, 21).getTime(),
14
+ ],
15
+ minWeekDayDate: new Date(2024, 0, 4).getTime(),
16
+ maxWeekDayDate: new Date(2024, 1, 20).getTime(),
17
+ // range
18
+ curRangeDayDate: [
19
+ new Date(2024, 0, 10).getTime(),
20
+ new Date(2024, 0, 20).getTime(),
21
+ ],
22
+ minRangeDayDate: new Date(2024, 0, 4).getTime(),
23
+ maxRangeDayDate: new Date(2024, 1, 20).getTime(),
24
+ // month
25
+ curMonthDate: new Date(2024, 6, 1).getTime(),
26
+ minMonthDate: new Date(2024, 2, 1).getTime(),
27
+ maxMonthDate: new Date(2025, 9, 31).getTime(),
28
+ // year
29
+ curYearDate: new Date(2017, 6, 1).getTime(),
30
+ minYearDate: new Date(2012, 0, 1).getTime(),
31
+ maxYearDate: new Date(2029, 10, 31).getTime(),
32
+ // locale
33
+ confirmText: I18n.t('confirm'),
34
+ confirmDisabledText: I18n.t('confirm'),
35
+ firstDayOfWeek: 0,
36
+ locale: {
37
+ shortWeekDays: [
38
+ I18n.t('week0'),
39
+ I18n.t('week1'),
40
+ I18n.t('week2'),
41
+ I18n.t('week3'),
42
+ I18n.t('week4'),
43
+ I18n.t('week5'),
44
+ I18n.t('week6'),
45
+ ],
46
+ subFormatter: 'YYYY' + I18n.t('year') + 'MM' + I18n.t('month'),
47
+ },
48
+ locale2: {
49
+ subFormatter: 'YYYY' + I18n.t('year'),
50
+ monthsFormatter: [
51
+ I18n.t('cal_Jan'),
52
+ I18n.t('cal_Feb'),
53
+ I18n.t('cal_Mar'),
54
+ I18n.t('cal_Apr'),
55
+ I18n.t('cal_May'),
56
+ I18n.t('cal_Jun'),
57
+ I18n.t('cal_Jul'),
58
+ I18n.t('cal_Aug'),
59
+ I18n.t('cal_Sept'),
60
+ I18n.t('cal_Oct'),
61
+ I18n.t('cal_Nov'),
62
+ I18n.t('cal_Dec')
63
+ ]
64
+ },
65
+ showDayPicker: false,
66
+ },
67
+ methods: {
68
+ setCurDay: function (event) {
69
+ var date = event.detail;
70
+ this.setData({
71
+ curDayDate: new Date(date).getTime(),
72
+ showDayPicker: false,
73
+ });
74
+ },
75
+ setWeekCurDay: function (event) {
76
+ var date = event.detail;
77
+ this.setData({
78
+ curWeekDayDate: [date[0], date[1]],
79
+ });
80
+ },
81
+ setRangeCurDay: function (event) {
82
+ var date = event.detail;
83
+ this.setData({
84
+ curRangeDayDate: [date[0], date[1]],
85
+ });
86
+ },
87
+ setCurMonth: function (event) {
88
+ var date = event.detail;
89
+ this.setData({
90
+ curMonthDate: date,
91
+ });
92
+ },
93
+ setCurYear: function (event) {
94
+ var date = event.detail;
95
+ this.setData({
96
+ curYearDate: date,
97
+ });
98
+ },
99
+ onShowDayPicker: function () {
100
+ this.setData({
101
+ showDayPicker: !this.data.showDayPicker,
102
+ });
103
+ },
104
+ },
105
+ });
@@ -16,9 +16,7 @@ var component_1 = require("../common/component");
16
16
  var utils_1 = require("./utils");
17
17
  var toast_1 = __importDefault(require("../toast/toast"));
18
18
  var dateEdge = (0, utils_1.getInitEdgeDate)('year');
19
- var getTime = function (date) {
20
- return date instanceof Date ? date.getTime() : date;
21
- };
19
+ var getTime = function (date) { return (date instanceof Date ? date.getTime() : date); };
22
20
  (0, component_1.SmartComponent)({
23
21
  props: {
24
22
  title: {
@@ -88,11 +86,11 @@ var getTime = function (date) {
88
86
  },
89
87
  minDate: {
90
88
  type: Number,
91
- value: dateEdge.min
89
+ value: dateEdge.min,
92
90
  },
93
91
  maxDate: {
94
92
  type: Number,
95
- value: dateEdge.max
93
+ value: dateEdge.max,
96
94
  },
97
95
  position: {
98
96
  type: String,
@@ -120,7 +118,7 @@ var getTime = function (date) {
120
118
  },
121
119
  showConfirm: {
122
120
  type: Boolean,
123
- value: true,
121
+ value: false,
124
122
  },
125
123
  showSubtitle: {
126
124
  type: Boolean,
@@ -298,8 +296,7 @@ var getTime = function (date) {
298
296
  return this.limitDateRange(defaultDate);
299
297
  },
300
298
  scrollIntoView: function () {
301
- if (!this.isMounted)
302
- return;
299
+ // if (!this.isMounted) return;
303
300
  },
304
301
  onOpen: function () {
305
302
  this.$emit('open');
@@ -399,10 +396,7 @@ var getTime = function (date) {
399
396
  if (!valid) {
400
397
  // auto selected to max range if showConfirm
401
398
  if (this.data.showConfirm) {
402
- this.emit([
403
- date[0],
404
- (0, utils_1.getDayByOffset)(date[0], this.data.maxRange - 1),
405
- ]);
399
+ this.emit([date[0], (0, utils_1.getDayByOffset)(date[0], this.data.maxRange - 1)]);
406
400
  }
407
401
  else {
408
402
  this.emit(date);
@@ -437,8 +431,7 @@ var getTime = function (date) {
437
431
  },
438
432
  onConfirm: function () {
439
433
  var _this = this;
440
- if (this.data.type === 'range' &&
441
- !this.checkRange(this.data.currentDate)) {
434
+ if (this.data.type === 'range' && !this.checkRange(this.data.currentDate)) {
442
435
  return;
443
436
  }
444
437
  wx.nextTick(function () {
@@ -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
  };
@@ -8,9 +8,7 @@ function formatMonthTitle(date, formatter) {
8
8
  date = new Date(date);
9
9
  }
10
10
  var year = date.getFullYear();
11
- var month = date.getMonth() + 1 < 10
12
- ? "0".concat(date.getMonth() + 1)
13
- : date.getMonth() + 1 + '';
11
+ var month = date.getMonth() + 1 < 10 ? "0".concat(date.getMonth() + 1) : date.getMonth() + 1 + '';
14
12
  return formatter.replace('YYYY', year + '').replace('MM', month);
15
13
  }
16
14
  exports.formatMonthTitle = formatMonthTitle;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var component_1 = require("../../common/component");
4
+ var zhCNOptions = [
5
+ {
6
+ text: I18n.t('zhejiangProvince'),
7
+ value: '330000',
8
+ options: [
9
+ {
10
+ text: I18n.t('hangzhou'),
11
+ value: '330100',
12
+ options: [
13
+ {
14
+ text: I18n.t('upperCityDistrict'),
15
+ value: '330102',
16
+ },
17
+ {
18
+ text: I18n.t('downtownDistrict'),
19
+ value: '330103',
20
+ },
21
+ {
22
+ text: I18n.t('jiangganDistrict'),
23
+ value: '330104',
24
+ },
25
+ ],
26
+ },
27
+ {
28
+ text: I18n.t('ningboCity'),
29
+ value: '330200',
30
+ options: [
31
+ {
32
+ text: I18n.t('haishuDistrict'),
33
+ value: '330203',
34
+ },
35
+ {
36
+ text: I18n.t('jiangbeiDistrict'),
37
+ value: '330205',
38
+ },
39
+ {
40
+ text: I18n.t('beilunDistrict'),
41
+ value: '330206',
42
+ },
43
+ ],
44
+ },
45
+ {
46
+ text: I18n.t('wenzhou'),
47
+ value: '330300',
48
+ options: [
49
+ {
50
+ text: I18n.t('luchengDistrict'),
51
+ value: '330302',
52
+ },
53
+ {
54
+ text: I18n.t('longwanDistrict'),
55
+ value: '330303',
56
+ },
57
+ {
58
+ text: I18n.t('ouhaiDistrict'),
59
+ value: '330304',
60
+ },
61
+ ],
62
+ },
63
+ ],
64
+ },
65
+ {
66
+ text: I18n.t('jiangsuProvince'),
67
+ value: '320000',
68
+ options: [
69
+ {
70
+ text: I18n.t('nanjing'),
71
+ value: '320100',
72
+ options: [
73
+ {
74
+ text: I18n.t('xuanwuDistrict'),
75
+ value: '320102',
76
+ },
77
+ {
78
+ text: I18n.t('qinhuaiDistrict'),
79
+ value: '320104',
80
+ },
81
+ {
82
+ text: I18n.t('jianyeDistrict'),
83
+ value: '320105',
84
+ },
85
+ ],
86
+ },
87
+ {
88
+ text: I18n.t('wuxi'),
89
+ value: '320200',
90
+ options: [
91
+ {
92
+ text: I18n.t('xishanDistrict'),
93
+ value: '320205',
94
+ },
95
+ {
96
+ text: I18n.t('huishanDistrict'),
97
+ value: '320206',
98
+ },
99
+ {
100
+ text: I18n.t('binhuDistrict'),
101
+ value: '320211',
102
+ },
103
+ ],
104
+ },
105
+ {
106
+ text: I18n.t('xuzhou'),
107
+ value: '320300',
108
+ options: [
109
+ {
110
+ text: I18n.t('gulouDistrict'),
111
+ value: '320302',
112
+ },
113
+ {
114
+ text: I18n.t('yunlongDistrict'),
115
+ value: '320303',
116
+ },
117
+ {
118
+ text: I18n.t('jiawangDistrict'),
119
+ value: '320305',
120
+ },
121
+ ],
122
+ },
123
+ ],
124
+ },
125
+ ];
126
+ var asyncOptions1 = [
127
+ {
128
+ text: I18n.t('zhejiangProvince'),
129
+ value: '330000',
130
+ options: [],
131
+ },
132
+ ];
133
+ var asyncOptions2 = [
134
+ { text: I18n.t('hangzhou'), value: '330100' },
135
+ { text: I18n.t('ningboCity'), value: '330200' },
136
+ ];
137
+ (0, component_1.SmartComponent)({
138
+ data: {
139
+ area: I18n.t('region'),
140
+ options: zhCNOptions,
141
+ selectArea: I18n.t('pleaseSelectARegion'),
142
+ baseState: {
143
+ show: false,
144
+ value: '',
145
+ result: '',
146
+ },
147
+ asyncState: {
148
+ show: false,
149
+ value: undefined,
150
+ result: '',
151
+ options: asyncOptions1,
152
+ },
153
+ customFieldState: {
154
+ show: false,
155
+ value: '',
156
+ result: '',
157
+ },
158
+ },
159
+ methods: {
160
+ onClick: function (e) {
161
+ var _a;
162
+ var stateKey = e.currentTarget.dataset.stateKey;
163
+ this.setData((_a = {},
164
+ _a["".concat(stateKey, ".show")] = true,
165
+ _a));
166
+ },
167
+ onClose: function (e) {
168
+ var _a;
169
+ var stateKey = e.currentTarget.dataset.stateKey;
170
+ this.setData((_a = {},
171
+ _a["".concat(stateKey, ".show")] = false,
172
+ _a));
173
+ },
174
+ onFinish: function (e) {
175
+ var _a;
176
+ var stateKey = e.currentTarget.dataset.stateKey;
177
+ var _b = e.detail, selectedOptions = _b.selectedOptions, value = _b.value;
178
+ var result = selectedOptions.map(function (option) { return option.text; }).join('/');
179
+ this.setData((_a = {},
180
+ _a["".concat(stateKey, ".value")] = value,
181
+ _a["".concat(stateKey, ".result")] = result,
182
+ _a));
183
+ this.onClose(e);
184
+ },
185
+ loadDynamicOptions: function (e) {
186
+ var _this = this;
187
+ var value = e.detail.value;
188
+ if (value === '330000') {
189
+ setTimeout(function () {
190
+ _this.setData({
191
+ 'asyncState.options[0].options': asyncOptions2,
192
+ });
193
+ }, 500);
194
+ }
195
+ },
196
+ },
197
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ var icons = __importStar(require("@tuya-miniapp/icons"));
27
+ var component_1 = require("../../common/component");
28
+ (0, component_1.SmartComponent)({
29
+ data: {
30
+ sunMaxFill: icons.Sun,
31
+ checkMark: icons.Checkmark,
32
+ },
33
+ methods: {
34
+ onNavTo: function () {
35
+ // @ts-ignore
36
+ ty.openInnerH5({ url: 'https://www.tuya.com', title: 'Tuya' });
37
+ },
38
+ },
39
+ });
package/lib/cell/index.js CHANGED
@@ -10,13 +10,7 @@ var Right_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Right"));
10
10
  var link_1 = require("../mixins/link");
11
11
  var component_1 = require("../common/component");
12
12
  (0, component_1.SmartComponent)({
13
- classes: [
14
- 'title-class',
15
- 'label-class',
16
- 'value-class',
17
- 'right-icon-class',
18
- 'hover-class',
19
- ],
13
+ classes: ['title-class', 'label-class', 'value-class', 'right-icon-class', 'hover-class'],
20
14
  mixins: [link_1.link],
21
15
  props: {
22
16
  title: null,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var component_1 = require("../../common/component");
4
+ (0, component_1.SmartComponent)({
5
+ data: {
6
+ checkbox1: true,
7
+ checkbox2: true,
8
+ checkbox3: true,
9
+ checkboxLabel: true,
10
+ checkboxSize: true,
11
+ checkboxShape: true,
12
+ list: ['a', 'b', 'c'],
13
+ result: ['a', 'b'],
14
+ result2: [],
15
+ result3: [],
16
+ result4: [],
17
+ activeIcon: 'https://images.tuyacn.com/content-platform/hestia/1730877912e76cbdb7563.png',
18
+ inactiveIcon: '',
19
+ },
20
+ methods: {
21
+ onChange: function (event) {
22
+ var _a;
23
+ var key = event.currentTarget.dataset.key;
24
+ this.setData((_a = {}, _a[key] = event.detail, _a));
25
+ },
26
+ onChange2: function (event) {
27
+ var _a;
28
+ var key = event.currentTarget.dataset.key;
29
+ this.setData((_a = {}, _a[key] = !event.detail, _a));
30
+ },
31
+ toggle: function (event) {
32
+ var index = event.currentTarget.dataset.index;
33
+ var checkbox = this.selectComponent(".checkboxes-".concat(index));
34
+ checkbox.toggle();
35
+ },
36
+ noop: function () { },
37
+ },
38
+ });
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var Checkmark_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Checkmark"));
6
+ var Check_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Check"));
7
7
  var relation_1 = require("../common/relation");
8
8
  var component_1 = require("../common/component");
9
9
  function emit(target, value) {
@@ -36,7 +36,7 @@ function emit(target, value) {
36
36
  data: {
37
37
  parentDisabled: false,
38
38
  direction: 'vertical',
39
- icon: Checkmark_1.default,
39
+ icon: Check_1.default,
40
40
  },
41
41
  methods: {
42
42
  emitChange: function (value) {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var component_1 = require("../../common/component");
4
+ var format = function (rate) { return Math.min(Math.max(rate, 0), 100); };
5
+ (0, component_1.SmartComponent)({
6
+ data: {
7
+ value: 25,
8
+ gradientColor: {
9
+ '0%': '#ffd01e',
10
+ '100%': '#ee0a24',
11
+ },
12
+ },
13
+ methods: {
14
+ run: function (e) {
15
+ var step = parseFloat(e.currentTarget.dataset.step);
16
+ this.setData({
17
+ value: format((this.data.value += step)),
18
+ });
19
+ },
20
+ },
21
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var component_1 = require("../../common/component");
4
+ (0, component_1.SmartComponent)({
5
+ data: {},
6
+ });
@@ -0,0 +1 @@
1
+ export {};