@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.
Files changed (373) 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/calendar.wxml +13 -8
  20. package/dist/calendar/components/header/index.css +1 -1
  21. package/dist/calendar/components/header/index.js +7 -3
  22. package/dist/calendar/components/header/index.wxml +3 -3
  23. package/dist/calendar/components/header/index.wxss +1 -1
  24. package/dist/calendar/components/month/index.css +1 -1
  25. package/dist/calendar/components/month/index.js +3 -5
  26. package/dist/calendar/components/month/index.wxs +1 -4
  27. package/dist/calendar/components/month/index.wxss +1 -1
  28. package/dist/calendar/components/month-list/index.css +1 -1
  29. package/dist/calendar/components/month-list/index.js +26 -41
  30. package/dist/calendar/components/month-list/index.wxml +8 -2
  31. package/dist/calendar/components/month-list/index.wxss +1 -1
  32. package/dist/calendar/components/year-list/index.css +1 -1
  33. package/dist/calendar/components/year-list/index.js +17 -4
  34. package/dist/calendar/components/year-list/index.wxml +8 -2
  35. package/dist/calendar/components/year-list/index.wxss +1 -1
  36. package/dist/calendar/demo/index.d.ts +1 -0
  37. package/dist/calendar/demo/index.js +103 -0
  38. package/dist/calendar/index.js +32 -39
  39. package/dist/calendar/index.wxs +5 -8
  40. package/dist/calendar/utils.d.ts +4 -0
  41. package/dist/calendar/utils.js +30 -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-group/index.js +1 -1
  51. package/dist/circle/demo/index.d.ts +1 -0
  52. package/dist/circle/demo/index.js +19 -0
  53. package/dist/col/demo/index.d.ts +1 -0
  54. package/dist/col/demo/index.js +4 -0
  55. package/dist/collapse/demo/index.d.ts +1 -0
  56. package/dist/collapse/demo/index.js +36 -0
  57. package/dist/collapse/index.js +1 -1
  58. package/dist/collapse-item/animate.js +1 -1
  59. package/dist/common/component.js +1 -1
  60. package/dist/common/utils.js +3 -3
  61. package/dist/config-provider/demo/index.d.ts +1 -0
  62. package/dist/config-provider/demo/index.js +22 -0
  63. package/dist/count-down/demo/index.d.ts +1 -0
  64. package/dist/count-down/demo/index.js +33 -0
  65. package/dist/custom-keyboard/demo/index.d.ts +1 -0
  66. package/dist/custom-keyboard/demo/index.js +17 -0
  67. package/dist/custom-keyboard/index.js +1 -3
  68. package/dist/datetime-picker/demo/index.d.ts +1 -0
  69. package/dist/datetime-picker/demo/index.js +63 -0
  70. package/dist/datetime-picker/index.js +4 -5
  71. package/dist/dialog/demo/index.d.ts +1 -0
  72. package/dist/dialog/demo/index.js +134 -0
  73. package/dist/dialog/dialog.js +3 -5
  74. package/dist/dialog/index.js +1 -1
  75. package/dist/divider/demo/index.d.ts +1 -0
  76. package/dist/divider/demo/index.js +4 -0
  77. package/dist/dropdown-item/index.js +3 -3
  78. package/dist/dropdown-item/index.wxml +1 -7
  79. package/dist/dropdown-menu/demo/index.d.ts +1 -0
  80. package/dist/dropdown-menu/demo/index.js +47 -0
  81. package/dist/dropdown-menu/index.js +8 -10
  82. package/dist/empty/demo/index.d.ts +1 -0
  83. package/dist/empty/demo/index.js +13 -0
  84. package/dist/empty/index.css +1 -1
  85. package/dist/empty/index.wxs +1 -1
  86. package/dist/empty/index.wxss +1 -1
  87. package/dist/field/demo/index.d.ts +1 -0
  88. package/dist/field/demo/index.js +21 -0
  89. package/dist/goods-action/demo/index.d.ts +1 -0
  90. package/dist/goods-action/demo/index.js +12 -0
  91. package/dist/goods-action/index.js +1 -1
  92. package/dist/grid/demo/index.d.ts +1 -0
  93. package/dist/grid/demo/index.js +9 -0
  94. package/dist/grid/index.js +1 -1
  95. package/dist/grid-item/index.js +1 -1
  96. package/dist/icon/demo/index.d.ts +1 -0
  97. package/dist/icon/demo/index.js +26 -0
  98. package/dist/image/demo/index.d.ts +1 -0
  99. package/dist/image/demo/index.js +15 -0
  100. package/dist/index-anchor/index.js +1 -1
  101. package/dist/index-bar/demo/index.d.ts +1 -0
  102. package/dist/index-bar/demo/index.js +21 -0
  103. package/dist/index-bar/index.js +9 -16
  104. package/dist/loading/demo/index.d.ts +1 -0
  105. package/dist/loading/demo/index.js +4 -0
  106. package/dist/loading/index.js +25 -1
  107. package/dist/loading/index.wxml +2 -2
  108. package/dist/loading/index.wxs +6 -21
  109. package/dist/mixins/basic.js +2 -2
  110. package/dist/mixins/link.js +1 -2
  111. package/dist/mixins/page-scroll.js +1 -1
  112. package/dist/mixins/touch.js +1 -2
  113. package/dist/mixins/transition.js +1 -1
  114. package/dist/nav-bar/demo/index.d.ts +1 -0
  115. package/dist/nav-bar/demo/index.js +26 -0
  116. package/dist/nav-bar/index.css +1 -1
  117. package/dist/nav-bar/index.js +1 -1
  118. package/dist/nav-bar/index.wxml +1 -1
  119. package/dist/nav-bar/index.wxss +1 -1
  120. package/dist/normal-slider/demo/index.d.ts +1 -0
  121. package/dist/normal-slider/demo/index.js +19 -0
  122. package/dist/notice-bar/demo/index.d.ts +1 -0
  123. package/dist/notice-bar/demo/index.js +11 -0
  124. package/dist/notice-bar/index.css +1 -1
  125. package/dist/notice-bar/index.js +3 -6
  126. package/dist/notice-bar/index.wxml +1 -5
  127. package/dist/notice-bar/index.wxss +1 -1
  128. package/dist/notify/demo/index.d.ts +1 -0
  129. package/dist/notify/demo/index.js +45 -0
  130. package/dist/overlay/demo/index.d.ts +1 -0
  131. package/dist/overlay/demo/index.js +22 -0
  132. package/dist/picker/demo/index.d.ts +1 -0
  133. package/dist/picker/demo/index.js +76 -0
  134. package/dist/picker/index.css +1 -1
  135. package/dist/picker/index.js +2 -2
  136. package/dist/picker/index.wxml +1 -0
  137. package/dist/picker/index.wxss +1 -1
  138. package/dist/picker-column/index.js +3 -8
  139. package/dist/popup/demo/index.d.ts +1 -0
  140. package/dist/popup/demo/index.js +79 -0
  141. package/dist/progress/demo/index.d.ts +1 -0
  142. package/dist/progress/demo/index.js +4 -0
  143. package/dist/progress/index.js +1 -4
  144. package/dist/radio/demo/index.d.ts +1 -0
  145. package/dist/radio/demo/index.js +31 -0
  146. package/dist/radio-group/index.js +1 -1
  147. package/dist/rate/demo/index.d.ts +1 -0
  148. package/dist/rate/demo/index.js +25 -0
  149. package/dist/rate/index.js +2 -2
  150. package/dist/row/index.js +1 -1
  151. package/dist/search/demo/index.d.ts +1 -0
  152. package/dist/search/demo/index.js +43 -0
  153. package/dist/search/index.css +1 -1
  154. package/dist/search/index.js +1 -5
  155. package/dist/search/index.wxml +1 -1
  156. package/dist/search/index.wxss +1 -1
  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.css +1 -1
  184. package/dist/tabs/index.js +7 -25
  185. package/dist/tabs/index.wxss +1 -1
  186. package/dist/tag/demo/index.d.ts +1 -0
  187. package/dist/tag/demo/index.js +16 -0
  188. package/dist/tag/index.css +1 -1
  189. package/dist/tag/index.wxss +1 -1
  190. package/dist/toast/demo/index.d.ts +1 -0
  191. package/dist/toast/demo/index.js +67 -0
  192. package/dist/toast/toast.js +5 -5
  193. package/dist/transition/demo/index.d.ts +1 -0
  194. package/dist/transition/demo/index.js +67 -0
  195. package/dist/tree-select/demo/index.d.ts +1 -0
  196. package/dist/tree-select/demo/index.js +113 -0
  197. package/dist/wxs/style.wxs +0 -7
  198. package/lib/action-sheet/demo/index.d.ts +1 -0
  199. package/lib/action-sheet/demo/index.js +115 -0
  200. package/lib/area/demo/index.d.ts +1 -0
  201. package/lib/area/demo/index.js +47 -0
  202. package/lib/area/index.js +1 -2
  203. package/lib/battery/demo/index.d.ts +1 -0
  204. package/lib/battery/demo/index.js +4 -0
  205. package/lib/battery/index.js +1 -3
  206. package/lib/bottom-sheet/demo/index.d.ts +1 -0
  207. package/lib/bottom-sheet/demo/index.js +27 -0
  208. package/lib/bottom-sheet/index.css +1 -1
  209. package/lib/bottom-sheet/index.js +3 -2
  210. package/lib/bottom-sheet/index.wxml +3 -1
  211. package/lib/bottom-sheet/index.wxss +1 -1
  212. package/lib/button/demo/index.d.ts +1 -0
  213. package/lib/button/demo/index.js +14 -0
  214. package/lib/calendar/calendar.wxml +13 -8
  215. package/lib/calendar/components/header/index.css +1 -1
  216. package/lib/calendar/components/header/index.js +6 -2
  217. package/lib/calendar/components/header/index.wxml +3 -3
  218. package/lib/calendar/components/header/index.wxss +1 -1
  219. package/lib/calendar/components/month/index.css +1 -1
  220. package/lib/calendar/components/month/index.js +2 -6
  221. package/lib/calendar/components/month/index.wxs +1 -4
  222. package/lib/calendar/components/month/index.wxss +1 -1
  223. package/lib/calendar/components/month-list/index.css +1 -1
  224. package/lib/calendar/components/month-list/index.js +25 -40
  225. package/lib/calendar/components/month-list/index.wxml +8 -2
  226. package/lib/calendar/components/month-list/index.wxss +1 -1
  227. package/lib/calendar/components/year-list/index.css +1 -1
  228. package/lib/calendar/components/year-list/index.js +15 -2
  229. package/lib/calendar/components/year-list/index.wxml +8 -2
  230. package/lib/calendar/components/year-list/index.wxss +1 -1
  231. package/lib/calendar/demo/index.d.ts +1 -0
  232. package/lib/calendar/demo/index.js +105 -0
  233. package/lib/calendar/index.js +29 -38
  234. package/lib/calendar/index.wxs +5 -8
  235. package/lib/calendar/utils.d.ts +4 -0
  236. package/lib/calendar/utils.js +31 -4
  237. package/lib/cascader/demo/index.d.ts +1 -0
  238. package/lib/cascader/demo/index.js +197 -0
  239. package/lib/cell/demo/index.d.ts +1 -0
  240. package/lib/cell/demo/index.js +39 -0
  241. package/lib/cell/index.js +1 -7
  242. package/lib/checkbox/demo/index.d.ts +1 -0
  243. package/lib/checkbox/demo/index.js +38 -0
  244. package/lib/circle/demo/index.d.ts +1 -0
  245. package/lib/circle/demo/index.js +21 -0
  246. package/lib/col/demo/index.d.ts +1 -0
  247. package/lib/col/demo/index.js +6 -0
  248. package/lib/collapse/demo/index.d.ts +1 -0
  249. package/lib/collapse/demo/index.js +42 -0
  250. package/lib/config-provider/demo/index.d.ts +1 -0
  251. package/lib/config-provider/demo/index.js +24 -0
  252. package/lib/count-down/demo/index.d.ts +1 -0
  253. package/lib/count-down/demo/index.js +38 -0
  254. package/lib/custom-keyboard/demo/index.d.ts +1 -0
  255. package/lib/custom-keyboard/demo/index.js +19 -0
  256. package/lib/custom-keyboard/index.js +1 -3
  257. package/lib/datetime-picker/demo/index.d.ts +1 -0
  258. package/lib/datetime-picker/demo/index.js +68 -0
  259. package/lib/datetime-picker/index.js +4 -3
  260. package/lib/dialog/demo/index.d.ts +1 -0
  261. package/lib/dialog/demo/index.js +144 -0
  262. package/lib/dialog/dialog.js +1 -3
  263. package/lib/divider/demo/index.d.ts +1 -0
  264. package/lib/divider/demo/index.js +6 -0
  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/grid/demo/index.d.ts +1 -0
  279. package/lib/grid/demo/index.js +11 -0
  280. package/lib/icon/demo/index.d.ts +1 -0
  281. package/lib/icon/demo/index.js +54 -0
  282. package/lib/image/demo/index.d.ts +1 -0
  283. package/lib/image/demo/index.js +17 -0
  284. package/lib/index-bar/demo/index.d.ts +1 -0
  285. package/lib/index-bar/demo/index.js +23 -0
  286. package/lib/index-bar/index.js +3 -10
  287. package/lib/loading/demo/index.d.ts +1 -0
  288. package/lib/loading/demo/index.js +6 -0
  289. package/lib/loading/index.js +27 -1
  290. package/lib/loading/index.wxml +2 -2
  291. package/lib/loading/index.wxs +6 -21
  292. package/lib/mixins/link.js +1 -2
  293. package/lib/mixins/touch.js +1 -2
  294. package/lib/nav-bar/demo/index.d.ts +1 -0
  295. package/lib/nav-bar/demo/index.js +31 -0
  296. package/lib/nav-bar/index.css +1 -1
  297. package/lib/nav-bar/index.wxml +1 -1
  298. package/lib/nav-bar/index.wxss +1 -1
  299. package/lib/normal-slider/demo/index.d.ts +1 -0
  300. package/lib/normal-slider/demo/index.js +21 -0
  301. package/lib/notice-bar/demo/index.d.ts +1 -0
  302. package/lib/notice-bar/demo/index.js +16 -0
  303. package/lib/notice-bar/index.css +1 -1
  304. package/lib/notice-bar/index.js +2 -5
  305. package/lib/notice-bar/index.wxml +1 -5
  306. package/lib/notice-bar/index.wxss +1 -1
  307. package/lib/notify/demo/index.d.ts +1 -0
  308. package/lib/notify/demo/index.js +50 -0
  309. package/lib/overlay/demo/index.d.ts +1 -0
  310. package/lib/overlay/demo/index.js +24 -0
  311. package/lib/picker/demo/index.d.ts +1 -0
  312. package/lib/picker/demo/index.js +82 -0
  313. package/lib/picker/index.css +1 -1
  314. package/lib/picker/index.js +1 -3
  315. package/lib/picker/index.wxml +1 -0
  316. package/lib/picker/index.wxss +1 -1
  317. package/lib/picker-column/index.js +2 -7
  318. package/lib/popup/demo/index.d.ts +1 -0
  319. package/lib/popup/demo/index.js +85 -0
  320. package/lib/progress/demo/index.d.ts +1 -0
  321. package/lib/progress/demo/index.js +6 -0
  322. package/lib/progress/index.js +1 -4
  323. package/lib/radio/demo/index.d.ts +1 -0
  324. package/lib/radio/demo/index.js +34 -0
  325. package/lib/rate/demo/index.d.ts +1 -0
  326. package/lib/rate/demo/index.js +30 -0
  327. package/lib/search/demo/index.d.ts +1 -0
  328. package/lib/search/demo/index.js +48 -0
  329. package/lib/search/index.css +1 -1
  330. package/lib/search/index.js +1 -5
  331. package/lib/search/index.wxml +1 -1
  332. package/lib/search/index.wxss +1 -1
  333. package/lib/sidebar/demo/index.d.ts +1 -0
  334. package/lib/sidebar/demo/index.js +14 -0
  335. package/lib/skeleton/demo/index.d.ts +1 -0
  336. package/lib/skeleton/demo/index.js +14 -0
  337. package/lib/slider/demo/index.d.ts +1 -0
  338. package/lib/slider/demo/index.js +21 -0
  339. package/lib/slider/index.js +1 -3
  340. package/lib/stepper/demo/index.d.ts +1 -0
  341. package/lib/stepper/demo/index.js +25 -0
  342. package/lib/steps/demo/index.d.ts +1 -0
  343. package/lib/steps/demo/index.js +47 -0
  344. package/lib/sticky/demo/index.d.ts +1 -0
  345. package/lib/sticky/demo/index.js +30 -0
  346. package/lib/sticky/index.js +3 -1
  347. package/lib/swipe-cell/demo/index.d.ts +1 -0
  348. package/lib/swipe-cell/demo/index.js +50 -0
  349. package/lib/swipe-cell/index.js +1 -3
  350. package/lib/switch/demo/index.d.ts +1 -0
  351. package/lib/switch/demo/index.js +37 -0
  352. package/lib/switch/index.css +1 -1
  353. package/lib/switch/index.wxss +1 -1
  354. package/lib/tab/demo/index.d.ts +1 -0
  355. package/lib/tab/demo/index.js +57 -0
  356. package/lib/tabbar/demo/index.d.ts +1 -0
  357. package/lib/tabbar/demo/index.js +41 -0
  358. package/lib/tabs/index.css +1 -1
  359. package/lib/tabs/index.js +6 -24
  360. package/lib/tabs/index.wxss +1 -1
  361. package/lib/tag/demo/index.d.ts +1 -0
  362. package/lib/tag/demo/index.js +19 -0
  363. package/lib/tag/index.css +1 -1
  364. package/lib/tag/index.wxss +1 -1
  365. package/lib/toast/demo/index.d.ts +1 -0
  366. package/lib/toast/demo/index.js +74 -0
  367. package/lib/toast/toast.js +3 -3
  368. package/lib/transition/demo/index.d.ts +1 -0
  369. package/lib/transition/demo/index.js +71 -0
  370. package/lib/tree-select/demo/index.d.ts +1 -0
  371. package/lib/tree-select/demo/index.js +130 -0
  372. package/lib/wxs/style.wxs +0 -7
  373. package/package.json +15 -3
@@ -0,0 +1,134 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ import Dialog from '../../dialog/dialog';
3
+ const message = 'Body';
4
+ SmartComponent({
5
+ data: {
6
+ show: false,
7
+ inputValue: '',
8
+ },
9
+ methods: {
10
+ showCustomDialog() {
11
+ this.setData({ show: true });
12
+ },
13
+ getUserInfo(event) {
14
+ console.log(event.detail);
15
+ },
16
+ onClickThemeAlert() {
17
+ console.log('=== click theme alert');
18
+ Dialog.alert({
19
+ context: this,
20
+ title: 'Title',
21
+ theme: 'round-button',
22
+ icon: false,
23
+ message,
24
+ confirmButtonText: I18n.t('confirm'),
25
+ cancelButtonText: I18n.t('cancel'),
26
+ });
27
+ },
28
+ onClickThemeAlert2() {
29
+ console.log('=== 222 click theme alert');
30
+ Dialog.alert({
31
+ context: this,
32
+ theme: 'round-button',
33
+ message,
34
+ confirmButtonText: I18n.t('confirm'),
35
+ cancelButtonText: I18n.t('cancel'),
36
+ });
37
+ },
38
+ onClickAlert() {
39
+ Dialog.alert({
40
+ context: this,
41
+ title: 'Title',
42
+ icon: false,
43
+ message,
44
+ confirmButtonText: I18n.t('confirm'),
45
+ cancelButtonText: I18n.t('cancel'),
46
+ });
47
+ },
48
+ onClickAlert2() {
49
+ Dialog.alert({
50
+ context: this,
51
+ message: 'Title',
52
+ confirmButtonText: I18n.t('confirm'),
53
+ cancelButtonText: I18n.t('cancel'),
54
+ });
55
+ },
56
+ onClickConfirm() {
57
+ Dialog.confirm({
58
+ context: this,
59
+ title: 'Title',
60
+ icon: false,
61
+ message,
62
+ cancelButtonText: 'Sub Action',
63
+ confirmButtonText: I18n.t('confirm'),
64
+ });
65
+ },
66
+ onClickConfirmIcon() {
67
+ Dialog.confirm({
68
+ context: this,
69
+ title: 'Title',
70
+ icon: true,
71
+ message,
72
+ cancelButtonText: 'Sub Action',
73
+ confirmButtonText: I18n.t('confirm'),
74
+ });
75
+ },
76
+ onClickInput() {
77
+ const beforeClose = (action, value) => new Promise((resolve) => {
78
+ setTimeout(() => {
79
+ if (action === 'confirm') {
80
+ // 不存在输入值则拦截确认操作
81
+ resolve(!!value);
82
+ }
83
+ else {
84
+ resolve(true);
85
+ }
86
+ }, 1000);
87
+ });
88
+ Dialog.input({
89
+ context: this,
90
+ title: 'Title',
91
+ value: this.data.inputValue,
92
+ cancelButtonText: 'Sub Action',
93
+ beforeClose,
94
+ confirmButtonText: I18n.t('confirm'),
95
+ })
96
+ .then((res) => {
97
+ var _a;
98
+ console.log('=== onConfirm', res);
99
+ const inputValue = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.inputValue;
100
+ this.setData({ inputValue });
101
+ })
102
+ .catch((res) => {
103
+ console.log('=== onCancel', res);
104
+ });
105
+ },
106
+ onClickAsyncClose() {
107
+ const beforeClose = (action) => new Promise((resolve) => {
108
+ setTimeout(() => {
109
+ if (action === 'confirm') {
110
+ resolve(true);
111
+ }
112
+ else {
113
+ // 拦截取消操作
114
+ resolve(false);
115
+ }
116
+ }, 1000);
117
+ });
118
+ Dialog.confirm({
119
+ context: this,
120
+ title: 'Title',
121
+ icon: false,
122
+ message,
123
+ beforeClose,
124
+ confirmButtonText: I18n.t('confirm'),
125
+ cancelButtonText: I18n.t('cancel'),
126
+ });
127
+ },
128
+ onClose() {
129
+ this.setData({
130
+ show: false,
131
+ });
132
+ },
133
+ },
134
+ });
@@ -35,9 +35,7 @@ function getContext() {
35
35
  const Dialog = (options) => {
36
36
  options = Object.assign(Object.assign({}, currentOptions), options);
37
37
  return new Promise((resolve, reject) => {
38
- const context = (typeof options.context === 'function'
39
- ? options.context()
40
- : options.context) || getContext();
38
+ const context = (typeof options.context === 'function' ? options.context() : options.context) || getContext();
41
39
  const dialog = context.selectComponent(options.selector);
42
40
  delete options.context;
43
41
  delete options.selector;
@@ -63,13 +61,13 @@ Dialog.alert = (options) => Dialog(options);
63
61
  Dialog.confirm = (options) => Dialog(Object.assign({ showCancelButton: true }, options));
64
62
  Dialog.input = ((options) => Dialog(Object.assign({ showCancelButton: true }, options)));
65
63
  Dialog.close = () => {
66
- queue.forEach((dialog) => {
64
+ queue.forEach(dialog => {
67
65
  dialog.close();
68
66
  });
69
67
  queue = [];
70
68
  };
71
69
  Dialog.stopLoading = () => {
72
- queue.forEach((dialog) => {
70
+ queue.forEach(dialog => {
73
71
  dialog.stopLoading();
74
72
  });
75
73
  };
@@ -137,7 +137,7 @@ SmartComponent({
137
137
  [`loading.${action}`]: true,
138
138
  });
139
139
  if (beforeClose) {
140
- toPromise(beforeClose(action, this.data.inputValue)).then((value) => {
140
+ toPromise(beforeClose(action, this.data.inputValue)).then(value => {
141
141
  if (value) {
142
142
  this.close(action);
143
143
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {},
4
+ });
@@ -61,7 +61,7 @@ SmartComponent({
61
61
  },
62
62
  updateDataFromParent() {
63
63
  if (this.parent) {
64
- const { overlay, duration, activeColor, closeOnClickOverlay, direction, safeAreaTabBar, } = this.parent.data;
64
+ const { overlay, duration, activeColor, closeOnClickOverlay, direction, safeAreaTabBar } = this.parent.data;
65
65
  this.setData({
66
66
  overlay,
67
67
  duration,
@@ -104,7 +104,7 @@ SmartComponent({
104
104
  if (show === showPopup) {
105
105
  return;
106
106
  }
107
- this.onBeforeToggle(show).then((status) => {
107
+ this.onBeforeToggle(show).then(status => {
108
108
  var _a;
109
109
  if (!status) {
110
110
  return;
@@ -129,7 +129,7 @@ SmartComponent({
129
129
  if (!useBeforeToggle) {
130
130
  return Promise.resolve(true);
131
131
  }
132
- return new Promise((resolve) => {
132
+ return new Promise(resolve => {
133
133
  this.$emit('before-toggle', {
134
134
  status,
135
135
  callback: (value) => resolve(value),
@@ -25,13 +25,7 @@
25
25
  wx:for="{{ options }}"
26
26
  wx:key="value"
27
27
  data-option="{{ item }}"
28
- class="{{ utils.bem(
29
- 'dropdown-item__option',
30
- {
31
- active: item.value === value,
32
- first: direction === 'up' ? index === options.length-1 : !index,
33
- up: direction === 'up'
34
- } ) }}"
28
+ class="{{ utils.bem('dropdown-item__option', { active: item.value === value, first: direction === 'up' ? index === options.length-1 : !index, up: direction === 'up' }) }}"
35
29
  clickable
36
30
  icon="{{ item.icon }}"
37
31
  bind:tap="onOptionTap"
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ switchTitle1: I18n.t('freeShipping'),
5
+ switchTitle2: I18n.t('groupBuy'),
6
+ itemTitle: I18n.t('filter'),
7
+ option1: [
8
+ { text: I18n.t('allProducts'), value: 0 },
9
+ { text: I18n.t('newProduct'), value: 1 },
10
+ { text: I18n.t('promotionalItems'), value: 2 },
11
+ ],
12
+ option2: [
13
+ { text: I18n.t('defaultSorting'), value: 'a' },
14
+ { text: I18n.t('sortByPositiveReviews'), value: 'b' },
15
+ { text: I18n.t('sortBySales'), value: 'c' },
16
+ ],
17
+ switch1: true,
18
+ switch2: false,
19
+ value1: 0,
20
+ value2: 'a',
21
+ },
22
+ methods: {
23
+ onConfirm() {
24
+ this.selectComponent('#item').toggle();
25
+ },
26
+ onSwitch1Change({ detail }) {
27
+ this.setData({ switch1: detail });
28
+ },
29
+ onSwitch2Change({ detail }) {
30
+ this.setData({ switch2: detail });
31
+ },
32
+ onBeforeChange({ detail: { status, callback } }) {
33
+ wx.showModal({
34
+ title: I18n.t('asynchronousOnOff'),
35
+ content: `${I18n.t('areYouSureYouWantTo')}${status ? I18n.t('open') : I18n.t('close')}${I18n.t('dropdownMenu')}`,
36
+ success: (res) => {
37
+ if (res.confirm) {
38
+ callback(true);
39
+ }
40
+ else if (res.cancel) {
41
+ callback(false);
42
+ }
43
+ },
44
+ });
45
+ },
46
+ },
47
+ });
@@ -50,7 +50,7 @@ SmartComponent({
50
50
  type: String,
51
51
  value: '#CCCCCC',
52
52
  observer: 'updateChildrenData',
53
- }
53
+ },
54
54
  },
55
55
  data: {
56
56
  triangleDown,
@@ -70,16 +70,16 @@ SmartComponent({
70
70
  ARRAY.push(this);
71
71
  },
72
72
  destroyed() {
73
- ARRAY = ARRAY.filter((item) => item !== this);
73
+ ARRAY = ARRAY.filter(item => item !== this);
74
74
  },
75
75
  methods: {
76
76
  updateItemListData() {
77
77
  this.setData({
78
- itemListData: this.children.map((child) => child.data),
78
+ itemListData: this.children.map(child => child.data),
79
79
  });
80
80
  },
81
81
  updateChildrenData() {
82
- this.children.forEach((child) => {
82
+ this.children.forEach(child => {
83
83
  child.updateDataFromParent();
84
84
  });
85
85
  },
@@ -95,13 +95,13 @@ SmartComponent({
95
95
  });
96
96
  },
97
97
  close() {
98
- this.children.forEach((child) => {
98
+ this.children.forEach(child => {
99
99
  child.toggle(false, { immediate: true });
100
100
  });
101
101
  },
102
102
  getChildWrapperStyle() {
103
103
  const { zIndex, direction } = this.data;
104
- return getRect(this, '.smart-dropdown-menu').then((rect) => {
104
+ return getRect(this, '.smart-dropdown-menu').then(rect => {
105
105
  const { top = 0, bottom = 0 } = rect;
106
106
  const offset = direction === 'down' ? bottom : this.windowHeight - top;
107
107
  let wrapperStyle = `z-index: ${zIndex};`;
@@ -118,10 +118,8 @@ SmartComponent({
118
118
  const { index } = event.currentTarget.dataset;
119
119
  const child = this.children[index];
120
120
  if (!child.data.disabled) {
121
- ARRAY.forEach((menuItem) => {
122
- if (menuItem &&
123
- menuItem.data.closeOnClickOutside &&
124
- menuItem !== this) {
121
+ ARRAY.forEach(menuItem => {
122
+ if (menuItem && menuItem.data.closeOnClickOutside && menuItem !== this) {
125
123
  menuItem.close();
126
124
  }
127
125
  });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ activeTab: 0,
5
+ },
6
+ methods: {
7
+ onChange(event) {
8
+ this.setData({
9
+ activeTab: event.detail.name,
10
+ });
11
+ },
12
+ },
13
+ });
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center}.smart-empty__image{height:var(--empty-image-height,180px);width:var(--empty-image-width,180px)}.smart-empty__image:empty{display:none}.smart-empty__image__img{height:100%;width:100%}.smart-empty__image:not(:empty)+.smart-empty__image{display:none}.smart-empty__title{color:var(--empty-title-color,var(--app-B6-N1,#000));font-size:var(--empty-title-font-size,16px);line-height:var(--empty-title-line-height,24px);margin-top:var(--empty-title-margin-top,7px);text-align:center}.smart-empty__title:empty{display:none}.smart-empty__description{color:var(--empty-description-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--empty-description-font-size,14px);line-height:var(--empty-description-line-height,20px);margin-top:var(--empty-description-margin-top,4px)}.smart-empty__description:empty{display:none}.smart-empty__bottom{margin-top:24px}.smart-empty__bottom:empty{display:none}
1
+ @import '../common/index.css';.smart-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center}.smart-empty__image{height:var(--empty-image-height,180px);width:var(--empty-image-width,180px)}.smart-empty__image:empty{display:none}.smart-empty__image__img{height:100%;width:100%}.smart-empty__image:not(:empty)+.smart-empty__image{display:none}.smart-empty__title{color:var(--empty-title-color,var(--app-B6-N1,#000));font-size:var(--empty-title-font-size,16px);font-weight:var(--empty-title-font-weight,normal);line-height:var(--empty-title-line-height,24px);margin-top:var(--empty-title-margin-top,7px);text-align:center}.smart-empty__title:empty{display:none}.smart-empty__description{color:var(--empty-description-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--empty-description-font-size,14px);font-weight:var(--empty-description-font-weight,normal);line-height:var(--empty-description-line-height,20px);margin-top:var(--empty-description-margin-top,4px)}.smart-empty__description:empty{display:none}.smart-empty__bottom{margin-top:24px}.smart-empty__bottom:empty{display:none}
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- const defaultIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFoCAMAAABNO5HnAAAAAXNSR0IArs4c6QAAADlQTFRF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/KrSMPPTftyNeKkcSykgluow8BbzXO3eSU/tLM69MsdjVd1Q6IlVNScwI5lWLH3tLPK53L2Qb1bWvcdnqgFNT0ELUzjnBrJVHoe5ccTVs/jDEs5qsNxjesOf0fLO4VRsaQRK7lgQL1etPe0IP0EPz++hP7fwgM5416sZt3lWaTLZlVLh6NFr9X+fkf7a0XBuZhWE+o7+U4cGEL6IZ9AusLz31Oouop/lSNqMC2uq2dHxRw3KC/wdCWtFy73J3gCBk9FVqyh6vrmVgypcd7wYNLFtynC3ez1CT4CU0DHgTUs1zdjDqi5bN9QPZbzUwQfotMzar3KVOXoQ1VEwDkkhDTsAHkkBzQ+ivPYJD2FdCL7Q+WjNtBnUxlw+VBVD9rYlSerS8NFDdTloytIR86ZANKBE+4A+JHffzzpsTyrmqVSQUcNzh+n4mDQePCzFWpA+efko79+PJbzydVghBbDR6o6NKDLd1CzP9W8B+mCnvW0FWro0Gwf99VHhkeZ5NRhwZFQPiU8ivJdVHHhYbhesMcbq6RfdURMJ4oeOsDSRaLooyIFx5OUDP0kFcnQb2HpIslbdxk64fPXmAz9JI3J0KcHnfQ3Jc6n5AyN6fjjkZSUlJSUlJSUlJSUlJSU9GL9B+ab4VEvVpgKAAAAAElFTkSuQmCC";
3
3
 
4
4
  function imageUrl(image) {
5
5
  if (image === 'default') {
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center}.smart-empty__image{height:var(--empty-image-height,180px);width:var(--empty-image-width,180px)}.smart-empty__image:empty{display:none}.smart-empty__image__img{height:100%;width:100%}.smart-empty__image:not(:empty)+.smart-empty__image{display:none}.smart-empty__title{color:var(--empty-title-color,var(--app-B6-N1,#000));font-size:var(--empty-title-font-size,16px);line-height:var(--empty-title-line-height,24px);margin-top:var(--empty-title-margin-top,7px);text-align:center}.smart-empty__title:empty{display:none}.smart-empty__description{color:var(--empty-description-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--empty-description-font-size,14px);line-height:var(--empty-description-line-height,20px);margin-top:var(--empty-description-margin-top,4px)}.smart-empty__description:empty{display:none}.smart-empty__bottom{margin-top:24px}.smart-empty__bottom:empty{display:none}
1
+ @import '../common/index.wxss';.smart-empty{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center}.smart-empty__image{height:var(--empty-image-height,180px);width:var(--empty-image-width,180px)}.smart-empty__image:empty{display:none}.smart-empty__image__img{height:100%;width:100%}.smart-empty__image:not(:empty)+.smart-empty__image{display:none}.smart-empty__title{color:var(--empty-title-color,var(--app-B6-N1,#000));font-size:var(--empty-title-font-size,16px);font-weight:var(--empty-title-font-weight,normal);line-height:var(--empty-title-line-height,24px);margin-top:var(--empty-title-margin-top,7px);text-align:center}.smart-empty__title:empty{display:none}.smart-empty__description{color:var(--empty-description-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--empty-description-font-size,14px);font-weight:var(--empty-description-font-weight,normal);line-height:var(--empty-description-line-height,20px);margin-top:var(--empty-description-margin-top,4px)}.smart-empty__description:empty{display:none}.smart-empty__bottom{margin-top:24px}.smart-empty__bottom:empty{display:none}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ sms: '',
5
+ value: '',
6
+ password: '',
7
+ username: '',
8
+ username2: '',
9
+ username3: '',
10
+ message: '',
11
+ phone: '1365577',
12
+ },
13
+ methods: {
14
+ onClickIcon() {
15
+ wx.showToast({
16
+ icon: 'none',
17
+ title: I18n.t('clickTheIcon'),
18
+ });
19
+ },
20
+ },
21
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ import Toast from '../../toast/toast';
3
+ SmartComponent({
4
+ methods: {
5
+ onClickIcon() {
6
+ Toast({ context: this, message: I18n.t('clickTheIcon') });
7
+ },
8
+ onClickButton() {
9
+ Toast({ context: this, message: I18n.t('clickTheButton') });
10
+ },
11
+ },
12
+ });
@@ -2,7 +2,7 @@ import { SmartComponent } from '../common/component';
2
2
  import { useChildren } from '../common/relation';
3
3
  SmartComponent({
4
4
  relation: useChildren('goods-action-button', function () {
5
- this.children.forEach((item) => {
5
+ this.children.forEach(item => {
6
6
  item.updateStyle();
7
7
  });
8
8
  }),
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ array3: [0, 1, 2],
5
+ array4: [0, 1, 2, 3],
6
+ array6: [0, 1, 2, 3, 4, 5],
7
+ array8: [0, 1, 2, 3, 4, 5, 6, 7],
8
+ },
9
+ });
@@ -47,7 +47,7 @@ SmartComponent({
47
47
  },
48
48
  methods: {
49
49
  updateChildren() {
50
- this.children.forEach((child) => {
50
+ this.children.forEach(child => {
51
51
  child.updateStyle();
52
52
  });
53
53
  },
@@ -30,7 +30,7 @@ SmartComponent({
30
30
  return;
31
31
  }
32
32
  const { data, children } = this.parent;
33
- const { columnNum, border, square, gutter, clickable, center, direction, reverse, iconSize, } = data;
33
+ const { columnNum, border, square, gutter, clickable, center, direction, reverse, iconSize } = data;
34
34
  this.setData({
35
35
  center,
36
36
  border,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ import * as icons from '@tuya-miniapp/icons';
2
+ import iconsConfig from '@tuya-miniapp/icons/dist/config';
3
+ import { SmartComponent } from '../../common/component';
4
+ function kebabCase(name) {
5
+ const currName = name.replace(/[A-Z]/g, (word) => '-' + word.toLocaleLowerCase());
6
+ return currName.slice(1);
7
+ }
8
+ const iconsArr = iconsConfig.map((name) => ({
9
+ name: kebabCase(name),
10
+ value: icons[name],
11
+ }));
12
+ SmartComponent({
13
+ data: {
14
+ active: 0,
15
+ icons: iconsArr,
16
+ iconWarning: icons.Warning,
17
+ iconAlarm: icons.Alarm,
18
+ },
19
+ methods: {
20
+ onSwitch(event) {
21
+ this.setData({
22
+ active: event.detail.index,
23
+ });
24
+ },
25
+ },
26
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ SmartComponent({
3
+ data: {
4
+ fits: [
5
+ 'contain',
6
+ 'cover',
7
+ 'fill',
8
+ 'none',
9
+ 'scale-down',
10
+ 'widthFix',
11
+ 'heightFix',
12
+ ],
13
+ src: 'https://images.tuyacn.com/rms-static/f350c8a0-0eb2-11ef-8f06-49ae7b2fadcf-1715334722090.jpeg?tyName=cat.jpeg',
14
+ },
15
+ });
@@ -14,7 +14,7 @@ SmartComponent({
14
14
  },
15
15
  methods: {
16
16
  scrollIntoView(scrollTop) {
17
- getRect(this, '.smart-index-anchor-wrapper').then((rect) => {
17
+ getRect(this, '.smart-index-anchor-wrapper').then(rect => {
18
18
  wx.pageScrollTo({
19
19
  duration: 0,
20
20
  scrollTop: scrollTop + rect.top - this.parent.data.stickyOffsetTop,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { SmartComponent } from '../../common/component';
2
+ const indexList = [];
3
+ const charCodeOfA = 'A'.charCodeAt(0);
4
+ for (let i = 0; i < 26; i++) {
5
+ indexList.push(String.fromCharCode(charCodeOfA + i));
6
+ }
7
+ SmartComponent({
8
+ data: {
9
+ activeTab: 0,
10
+ indexList,
11
+ customIndexList: [1, 2, 3, 4, 5, 6, 8, 9, 10],
12
+ scrollTop: 0,
13
+ },
14
+ methods: {
15
+ onChange(event) {
16
+ this.setData({
17
+ activeTab: event.detail.name,
18
+ });
19
+ },
20
+ },
21
+ });
@@ -67,14 +67,10 @@ SmartComponent({
67
67
  });
68
68
  },
69
69
  setRect() {
70
- return Promise.all([
71
- this.setAnchorsRect(),
72
- this.setListRect(),
73
- this.setSiderbarRect(),
74
- ]);
70
+ return Promise.all([this.setAnchorsRect(), this.setListRect(), this.setSiderbarRect()]);
75
71
  },
76
72
  setAnchorsRect() {
77
- return Promise.all(this.children.map((anchor) => getRect(anchor, '.smart-index-anchor-wrapper').then((rect) => {
73
+ return Promise.all(this.children.map(anchor => getRect(anchor, '.smart-index-anchor-wrapper').then(rect => {
78
74
  Object.assign(anchor, {
79
75
  height: rect.height,
80
76
  top: rect.top + this.scrollTop,
@@ -82,7 +78,7 @@ SmartComponent({
82
78
  })));
83
79
  },
84
80
  setListRect() {
85
- return getRect(this, '.smart-index-bar').then((rect) => {
81
+ return getRect(this, '.smart-index-bar').then(rect => {
86
82
  if (!isDef(rect)) {
87
83
  return;
88
84
  }
@@ -93,7 +89,7 @@ SmartComponent({
93
89
  });
94
90
  },
95
91
  setSiderbarRect() {
96
- return getRect(this, '.smart-index-bar__sidebar').then((res) => {
92
+ return getRect(this, '.smart-index-bar__sidebar').then(res => {
97
93
  if (!isDef(res)) {
98
94
  return;
99
95
  }
@@ -105,7 +101,7 @@ SmartComponent({
105
101
  },
106
102
  setDiffData({ target, data }) {
107
103
  const diffData = {};
108
- Object.keys(data).forEach((key) => {
104
+ Object.keys(data).forEach(key => {
109
105
  if (target.data[key] !== data[key]) {
110
106
  diffData[key] = data[key];
111
107
  }
@@ -115,7 +111,7 @@ SmartComponent({
115
111
  }
116
112
  },
117
113
  getAnchorRect(anchor) {
118
- return getRect(anchor, '.smart-index-anchor-wrapper').then((rect) => ({
114
+ return getRect(anchor, '.smart-index-anchor-wrapper').then(rect => ({
119
115
  height: rect.height,
120
116
  top: rect.top,
121
117
  }));
@@ -148,8 +144,7 @@ SmartComponent({
148
144
  if (sticky) {
149
145
  let isActiveAnchorSticky = false;
150
146
  if (active !== -1) {
151
- isActiveAnchorSticky =
152
- children[active].top <= stickyOffsetTop + scrollTop;
147
+ isActiveAnchorSticky = children[active].top <= stickyOffsetTop + scrollTop;
153
148
  }
154
149
  children.forEach((item, index) => {
155
150
  if (index === active) {
@@ -180,9 +175,7 @@ SmartComponent({
180
175
  else if (index === active - 1) {
181
176
  const currentAnchor = children[index];
182
177
  const currentOffsetTop = currentAnchor.top;
183
- const targetOffsetTop = index === children.length - 1
184
- ? this.top
185
- : children[index + 1].top;
178
+ const targetOffsetTop = index === children.length - 1 ? this.top : children[index + 1].top;
186
179
  const parentOffsetHeight = targetOffsetTop - currentOffsetTop;
187
180
  const translateY = parentOffsetHeight - currentAnchor.height;
188
181
  const anchorStyle = `
@@ -236,7 +229,7 @@ SmartComponent({
236
229
  return;
237
230
  }
238
231
  this.scrollToAnchorIndex = index;
239
- const anchor = this.children.find((item) => item.data.index === this.data.indexList[index]);
232
+ const anchor = this.children.find(item => item.data.index === this.data.indexList[index]);
240
233
  if (anchor) {
241
234
  anchor.scrollIntoView(this.scrollTop);
242
235
  this.$emit('select', anchor.data.index);
@@ -0,0 +1 @@
1
+ export {};