@tarojs/components 3.3.12 → 3.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/cjs/{index-cf56824f.js → index-b9715722.js} +1 -1
  2. package/dist/cjs/{index-eefce54e.js → index-dd4b7ba3.js} +156 -101
  3. package/dist/cjs/loader.cjs.js +3 -3
  4. package/dist/cjs/taro-audio-core.cjs.entry.js +2 -2
  5. package/dist/cjs/taro-block-core.cjs.entry.js +2 -2
  6. package/dist/cjs/taro-button-core.cjs.entry.js +3 -3
  7. package/dist/cjs/taro-camera-core.cjs.entry.js +2 -2
  8. package/dist/cjs/taro-canvas-core.cjs.entry.js +2 -2
  9. package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +6 -5
  10. package/dist/cjs/taro-components.cjs.js +5 -5
  11. package/dist/cjs/taro-cover-image-core.cjs.entry.js +19 -5
  12. package/dist/cjs/taro-cover-view-core.cjs.entry.js +51 -5
  13. package/dist/cjs/taro-custom-wrapper-core.cjs.entry.js +2 -2
  14. package/dist/cjs/taro-form-core.cjs.entry.js +2 -2
  15. package/dist/cjs/taro-icon-core.cjs.entry.js +3 -3
  16. package/dist/cjs/taro-image-core.cjs.entry.js +3 -3
  17. package/dist/cjs/taro-input-core.cjs.entry.js +21 -13
  18. package/dist/cjs/taro-label-core.cjs.entry.js +2 -2
  19. package/dist/cjs/taro-movable-area-core.cjs.entry.js +2 -2
  20. package/dist/cjs/taro-movable-view-core.cjs.entry.js +2 -2
  21. package/dist/cjs/taro-navigator-core.cjs.entry.js +3 -3
  22. package/dist/cjs/taro-open-data-core.cjs.entry.js +2 -2
  23. package/dist/cjs/taro-picker-core_2.cjs.entry.js +4 -4
  24. package/dist/cjs/taro-picker-view-column-core.cjs.entry.js +2 -2
  25. package/dist/cjs/taro-picker-view-core.cjs.entry.js +2 -2
  26. package/dist/cjs/taro-progress-core.cjs.entry.js +2 -2
  27. package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +3 -3
  28. package/dist/cjs/taro-radio-core_2.cjs.entry.js +3 -3
  29. package/dist/cjs/taro-rich-text-core.cjs.entry.js +2 -2
  30. package/dist/cjs/taro-scroll-view-core.cjs.entry.js +3 -3
  31. package/dist/cjs/taro-slider-core.cjs.entry.js +2 -2
  32. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +112 -106
  33. package/dist/cjs/taro-switch-core.cjs.entry.js +2 -2
  34. package/dist/cjs/taro-tabbar.cjs.entry.js +69 -23
  35. package/dist/cjs/taro-text-core.cjs.entry.js +3 -3
  36. package/dist/cjs/taro-textarea-core.cjs.entry.js +65 -5
  37. package/dist/cjs/taro-video-control_3.cjs.entry.js +186 -103
  38. package/dist/cjs/taro-view-core.cjs.entry.js +11 -3
  39. package/dist/cjs/taro-web-view-core.cjs.entry.js +2 -2
  40. package/dist/collection/collection-manifest.json +3 -3
  41. package/dist/collection/components/checkbox/checkbox.js +21 -2
  42. package/dist/collection/components/cover-image/cover-image.js +94 -0
  43. package/dist/collection/components/cover-image/style/index.css +5 -0
  44. package/dist/collection/components/cover-view/cover-view.js +166 -4
  45. package/dist/collection/components/cover-view/style/cover-view.css +3 -0
  46. package/dist/collection/components/input/input.js +19 -11
  47. package/dist/collection/components/swiper/swiper.js +7 -1
  48. package/dist/collection/components/tabbar/tabbar.js +70 -20
  49. package/dist/collection/components/textarea/style/index.css +6 -2
  50. package/dist/collection/components/textarea/textarea.js +98 -3
  51. package/dist/collection/components/video/video-control.js +39 -22
  52. package/dist/collection/components/video/video-danmu.js +52 -39
  53. package/dist/collection/components/video/video.js +60 -37
  54. package/dist/collection/components/view/view.js +9 -1
  55. package/dist/esm/{index-ff1b322a.js → index-3c78bcaf.js} +1 -1
  56. package/dist/esm/{index-310de3d5.js → index-5bd7cbab.js} +156 -101
  57. package/dist/esm/loader.js +3 -3
  58. package/dist/esm/taro-audio-core.entry.js +2 -2
  59. package/dist/esm/taro-block-core.entry.js +2 -2
  60. package/dist/esm/taro-button-core.entry.js +3 -3
  61. package/dist/esm/taro-camera-core.entry.js +2 -2
  62. package/dist/esm/taro-canvas-core.entry.js +2 -2
  63. package/dist/esm/taro-checkbox-core_2.entry.js +6 -5
  64. package/dist/esm/taro-components.js +5 -5
  65. package/dist/esm/taro-cover-image-core.entry.js +19 -5
  66. package/dist/esm/taro-cover-view-core.entry.js +51 -5
  67. package/dist/esm/taro-custom-wrapper-core.entry.js +2 -2
  68. package/dist/esm/taro-form-core.entry.js +2 -2
  69. package/dist/esm/taro-icon-core.entry.js +3 -3
  70. package/dist/esm/taro-image-core.entry.js +3 -3
  71. package/dist/esm/taro-input-core.entry.js +21 -13
  72. package/dist/esm/taro-label-core.entry.js +2 -2
  73. package/dist/esm/taro-movable-area-core.entry.js +2 -2
  74. package/dist/esm/taro-movable-view-core.entry.js +2 -2
  75. package/dist/esm/taro-navigator-core.entry.js +3 -3
  76. package/dist/esm/taro-open-data-core.entry.js +2 -2
  77. package/dist/esm/taro-picker-core_2.entry.js +4 -4
  78. package/dist/esm/taro-picker-view-column-core.entry.js +2 -2
  79. package/dist/esm/taro-picker-view-core.entry.js +2 -2
  80. package/dist/esm/taro-progress-core.entry.js +2 -2
  81. package/dist/esm/taro-pull-to-refresh.entry.js +3 -3
  82. package/dist/esm/taro-radio-core_2.entry.js +3 -3
  83. package/dist/esm/taro-rich-text-core.entry.js +2 -2
  84. package/dist/esm/taro-scroll-view-core.entry.js +3 -3
  85. package/dist/esm/taro-slider-core.entry.js +2 -2
  86. package/dist/esm/taro-swiper-core_2.entry.js +112 -106
  87. package/dist/esm/taro-switch-core.entry.js +2 -2
  88. package/dist/esm/taro-tabbar.entry.js +69 -23
  89. package/dist/esm/taro-text-core.entry.js +3 -3
  90. package/dist/esm/taro-textarea-core.entry.js +65 -5
  91. package/dist/esm/taro-video-control_3.entry.js +186 -103
  92. package/dist/esm/taro-view-core.entry.js +11 -3
  93. package/dist/esm/taro-web-view-core.entry.js +2 -2
  94. package/dist/esm-es5/{index-ff1b322a.js → index-3c78bcaf.js} +0 -0
  95. package/dist/esm-es5/index-5bd7cbab.js +1 -0
  96. package/dist/esm-es5/loader.js +1 -1
  97. package/dist/esm-es5/taro-audio-core.entry.js +1 -1
  98. package/dist/esm-es5/taro-block-core.entry.js +1 -1
  99. package/dist/esm-es5/taro-button-core.entry.js +1 -1
  100. package/dist/esm-es5/taro-camera-core.entry.js +1 -1
  101. package/dist/esm-es5/taro-canvas-core.entry.js +1 -1
  102. package/dist/esm-es5/taro-checkbox-core_2.entry.js +1 -1
  103. package/dist/esm-es5/taro-components.js +1 -1
  104. package/dist/esm-es5/taro-cover-image-core.entry.js +1 -1
  105. package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
  106. package/dist/esm-es5/taro-custom-wrapper-core.entry.js +1 -1
  107. package/dist/esm-es5/taro-form-core.entry.js +1 -1
  108. package/dist/esm-es5/taro-icon-core.entry.js +1 -1
  109. package/dist/esm-es5/taro-image-core.entry.js +1 -1
  110. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  111. package/dist/esm-es5/taro-label-core.entry.js +1 -1
  112. package/dist/esm-es5/taro-movable-area-core.entry.js +1 -1
  113. package/dist/esm-es5/taro-movable-view-core.entry.js +1 -1
  114. package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
  115. package/dist/esm-es5/taro-open-data-core.entry.js +1 -1
  116. package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
  117. package/dist/esm-es5/taro-picker-view-column-core.entry.js +1 -1
  118. package/dist/esm-es5/taro-picker-view-core.entry.js +1 -1
  119. package/dist/esm-es5/taro-progress-core.entry.js +1 -1
  120. package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
  121. package/dist/esm-es5/taro-radio-core_2.entry.js +1 -1
  122. package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
  123. package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
  124. package/dist/esm-es5/taro-slider-core.entry.js +1 -1
  125. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  126. package/dist/esm-es5/taro-switch-core.entry.js +1 -1
  127. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  128. package/dist/esm-es5/taro-text-core.entry.js +1 -1
  129. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  130. package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
  131. package/dist/esm-es5/taro-view-core.entry.js +1 -1
  132. package/dist/esm-es5/taro-web-view-core.entry.js +1 -1
  133. package/dist/taro-components/p-06bffead.entry.js +1 -0
  134. package/dist/taro-components/{p-0f393c6d.system.entry.js → p-10a6c489.system.entry.js} +1 -1
  135. package/dist/taro-components/p-11932905.entry.js +1 -0
  136. package/dist/taro-components/p-12638ebc.system.entry.js +1 -0
  137. package/dist/taro-components/p-12ae0a33.entry.js +1 -0
  138. package/dist/taro-components/{p-4f139925.system.entry.js → p-13c1404f.system.entry.js} +1 -1
  139. package/dist/taro-components/{p-81f5977d.system.entry.js → p-17039974.system.entry.js} +1 -1
  140. package/dist/taro-components/p-17cf8b5b.entry.js +1 -0
  141. package/dist/taro-components/{p-9242dcf7.system.entry.js → p-1b790eb0.system.entry.js} +1 -1
  142. package/dist/taro-components/{p-a079321f.system.entry.js → p-1e4f1702.system.entry.js} +1 -1
  143. package/dist/taro-components/{p-8eb84de2.system.entry.js → p-264b7229.system.entry.js} +1 -1
  144. package/dist/taro-components/p-33ee636a.system.js +1 -0
  145. package/dist/taro-components/p-3633bb84.entry.js +1 -0
  146. package/dist/taro-components/{p-239bf0ca.system.entry.js → p-3643d8f7.system.entry.js} +1 -1
  147. package/dist/taro-components/{p-625158f0.js → p-37cfdd8f.js} +0 -0
  148. package/dist/taro-components/{p-15121391.system.entry.js → p-3aac5746.system.entry.js} +1 -1
  149. package/dist/taro-components/{p-a74d5aa5.system.entry.js → p-3eebeb1c.system.entry.js} +1 -1
  150. package/dist/taro-components/p-431197bc.entry.js +1 -0
  151. package/dist/taro-components/{p-1f2dfaef.system.entry.js → p-43de2f12.system.entry.js} +1 -1
  152. package/dist/taro-components/{p-d402dc94.system.entry.js → p-46cf6431.system.entry.js} +1 -1
  153. package/dist/taro-components/p-4dbed323.entry.js +1 -0
  154. package/dist/taro-components/{p-129341f2.system.entry.js → p-50066d5e.system.entry.js} +1 -1
  155. package/dist/taro-components/p-554e1039.entry.js +1 -0
  156. package/dist/taro-components/p-55b0a30b.entry.js +1 -0
  157. package/dist/taro-components/p-5c420456.entry.js +1 -0
  158. package/dist/taro-components/p-5f8b5f62.entry.js +1 -0
  159. package/dist/taro-components/p-627a5064.system.entry.js +1 -0
  160. package/dist/taro-components/{p-89fc30f0.entry.js → p-64993f48.entry.js} +1 -1
  161. package/dist/taro-components/p-66237ac0.entry.js +1 -0
  162. package/dist/taro-components/p-6965567d.entry.js +1 -0
  163. package/dist/taro-components/{p-9c9178cd.system.entry.js → p-703dfad8.system.entry.js} +1 -1
  164. package/dist/taro-components/p-71de9bd6.entry.js +1 -0
  165. package/dist/taro-components/p-74540410.entry.js +1 -0
  166. package/dist/taro-components/p-7a64a3d2.entry.js +1 -0
  167. package/dist/taro-components/{p-9a4123eb.system.entry.js → p-7d848382.system.entry.js} +1 -1
  168. package/dist/taro-components/p-83dedaa2.entry.js +1 -0
  169. package/dist/taro-components/p-865c21b5.entry.js +1 -0
  170. package/dist/taro-components/p-8a5e67cb.entry.js +1 -0
  171. package/dist/taro-components/p-8bc82aaa.entry.js +1 -0
  172. package/dist/taro-components/p-8db237e0.entry.js +1 -0
  173. package/dist/taro-components/{p-aed3d0e9.system.entry.js → p-8f90fca9.system.entry.js} +1 -1
  174. package/dist/taro-components/{p-bd00f506.system.js → p-94c20f60.system.js} +0 -0
  175. package/dist/taro-components/p-95529dc0.entry.js +1 -0
  176. package/dist/taro-components/p-964692f7.system.entry.js +1 -0
  177. package/dist/taro-components/p-99ed3ed2.system.entry.js +1 -0
  178. package/dist/taro-components/{p-4d11f3ad.system.entry.js → p-9a618935.system.entry.js} +1 -1
  179. package/dist/taro-components/p-9d0ab7c4.entry.js +1 -0
  180. package/dist/taro-components/{p-e3e40b03.system.entry.js → p-9fc88fc1.system.entry.js} +1 -1
  181. package/dist/taro-components/p-a1423df9.entry.js +1 -0
  182. package/dist/taro-components/p-ad16d1f2.system.entry.js +1 -0
  183. package/dist/taro-components/p-b2d01686.system.js +1 -0
  184. package/dist/taro-components/p-b75d8a65.entry.js +1 -0
  185. package/dist/taro-components/p-b8e0ad7d.entry.js +1 -0
  186. package/dist/taro-components/p-b9280444.entry.js +1 -0
  187. package/dist/taro-components/{p-236774f0.system.entry.js → p-bd3fa355.system.entry.js} +1 -1
  188. package/dist/taro-components/p-c218c298.entry.js +1 -0
  189. package/dist/taro-components/p-c362734b.entry.js +1 -0
  190. package/dist/taro-components/p-cea9a198.system.entry.js +1 -0
  191. package/dist/taro-components/{p-921a765a.system.entry.js → p-cfbdd4e3.system.entry.js} +1 -1
  192. package/dist/taro-components/p-d394a61f.system.entry.js +1 -0
  193. package/dist/taro-components/p-d567b95e.entry.js +1 -0
  194. package/dist/taro-components/p-d5971476.entry.js +1 -0
  195. package/dist/taro-components/{p-502841e0.system.entry.js → p-e0af1d0d.system.entry.js} +1 -1
  196. package/dist/taro-components/p-e27798a4.entry.js +1 -0
  197. package/dist/taro-components/p-e6298500.entry.js +1 -0
  198. package/dist/taro-components/{p-30c0639e.js → p-f05e1558.js} +1 -1
  199. package/dist/taro-components/{p-318795b9.system.entry.js → p-fb0959c1.system.entry.js} +1 -1
  200. package/dist/taro-components/{p-e15654c4.system.entry.js → p-fb2252b7.system.entry.js} +1 -1
  201. package/dist/taro-components/p-fc4939c6.system.entry.js +1 -0
  202. package/dist/taro-components/{p-3eb31172.system.entry.js → p-fd8312e5.system.entry.js} +1 -1
  203. package/dist/taro-components/{p-c1d6c0ba.system.entry.js → p-fdd73355.system.entry.js} +1 -1
  204. package/dist/taro-components/p-fde3a009.system.entry.js +1 -0
  205. package/dist/taro-components/p-fe156231.system.entry.js +1 -0
  206. package/dist/taro-components/p-ff017f01.entry.js +1 -0
  207. package/dist/taro-components/{p-970ed6da.system.entry.js → p-ffe63ce9.system.entry.js} +1 -1
  208. package/dist/taro-components/taro-components.esm.js +1 -1
  209. package/dist/taro-components/taro-components.js +1 -1
  210. package/dist/types/components/checkbox/checkbox.d.ts +1 -0
  211. package/dist/types/components/cover-image/cover-image.d.ts +11 -0
  212. package/dist/types/components/cover-view/cover-view.d.ts +14 -2
  213. package/dist/types/components/tabbar/tabbar.d.ts +20 -1
  214. package/dist/types/components/textarea/textarea.d.ts +6 -0
  215. package/dist/types/components/view/view.d.ts +2 -0
  216. package/dist/types/components.d.ts +20 -0
  217. package/dist/types/stencil-public-runtime.d.ts +190 -182
  218. package/dist-h5/vue/createComponent.js +4 -0
  219. package/dist-h5/vue/createFormsComponent.js +8 -1
  220. package/loader/index.d.ts +0 -1
  221. package/package.json +5 -5
  222. package/dist/collection/components/cover-view/cover-image.js +0 -11
  223. package/dist/esm-es5/index-310de3d5.js +0 -1
  224. package/dist/taro-components/p-180fd001.entry.js +0 -1
  225. package/dist/taro-components/p-28348261.entry.js +0 -1
  226. package/dist/taro-components/p-2e9e9ca7.system.entry.js +0 -1
  227. package/dist/taro-components/p-31b89eb3.entry.js +0 -1
  228. package/dist/taro-components/p-31f0f881.entry.js +0 -1
  229. package/dist/taro-components/p-4591dff5.entry.js +0 -1
  230. package/dist/taro-components/p-4afe24d7.entry.js +0 -1
  231. package/dist/taro-components/p-4b632069.entry.js +0 -1
  232. package/dist/taro-components/p-4f1d45ff.entry.js +0 -1
  233. package/dist/taro-components/p-5032d822.entry.js +0 -1
  234. package/dist/taro-components/p-593ee811.entry.js +0 -1
  235. package/dist/taro-components/p-6287057a.entry.js +0 -1
  236. package/dist/taro-components/p-66120099.entry.js +0 -1
  237. package/dist/taro-components/p-6730fa44.entry.js +0 -1
  238. package/dist/taro-components/p-6f331ed3.entry.js +0 -1
  239. package/dist/taro-components/p-73c389e7.system.entry.js +0 -1
  240. package/dist/taro-components/p-7911ccd6.system.entry.js +0 -1
  241. package/dist/taro-components/p-8031d6b5.system.entry.js +0 -1
  242. package/dist/taro-components/p-80f50da7.entry.js +0 -1
  243. package/dist/taro-components/p-82185d54.system.entry.js +0 -1
  244. package/dist/taro-components/p-8676c058.entry.js +0 -1
  245. package/dist/taro-components/p-8c43da73.system.entry.js +0 -1
  246. package/dist/taro-components/p-8f7b75f6.system.entry.js +0 -1
  247. package/dist/taro-components/p-906c3a0a.entry.js +0 -1
  248. package/dist/taro-components/p-9205470e.entry.js +0 -1
  249. package/dist/taro-components/p-945fa1a0.entry.js +0 -1
  250. package/dist/taro-components/p-95f5261c.entry.js +0 -1
  251. package/dist/taro-components/p-96771939.entry.js +0 -1
  252. package/dist/taro-components/p-96f1e9e7.entry.js +0 -1
  253. package/dist/taro-components/p-9c47f99e.entry.js +0 -1
  254. package/dist/taro-components/p-9fe2309f.entry.js +0 -1
  255. package/dist/taro-components/p-9ffb69e5.system.entry.js +0 -1
  256. package/dist/taro-components/p-a208926a.entry.js +0 -1
  257. package/dist/taro-components/p-a3e783c3.entry.js +0 -1
  258. package/dist/taro-components/p-af393b0b.entry.js +0 -1
  259. package/dist/taro-components/p-b2ed71a7.entry.js +0 -1
  260. package/dist/taro-components/p-b5d2597b.system.js +0 -1
  261. package/dist/taro-components/p-b7c29d05.entry.js +0 -1
  262. package/dist/taro-components/p-c2810ece.entry.js +0 -1
  263. package/dist/taro-components/p-c37d9a5d.system.entry.js +0 -1
  264. package/dist/taro-components/p-c9380fa6.entry.js +0 -1
  265. package/dist/taro-components/p-ca74a018.entry.js +0 -1
  266. package/dist/taro-components/p-cf496b3b.system.js +0 -1
  267. package/dist/taro-components/p-e256974b.system.entry.js +0 -1
  268. package/dist/taro-components/p-e28625a2.entry.js +0 -1
  269. package/dist/taro-components/p-e302b8d7.entry.js +0 -1
  270. package/dist/types/components/cover-view/cover-image.d.ts +0 -4
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eefce54e.js');
5
+ const index = require('./index-dd4b7ba3.js');
6
6
 
7
7
  const indexCss = "taro-switch-core{display:inline-block;width:52px;height:32px}taro-switch-core .weui-switch{display:block;width:100%;height:100%}";
8
8
 
9
- const Switch = class {
9
+ let Switch = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.onChange = index.createEvent(this, "change", 7);
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index$1 = require('./index-eefce54e.js');
6
- const index = require('./index-cf56824f.js');
5
+ const index$1 = require('./index-dd4b7ba3.js');
6
+ const index = require('./index-b9715722.js');
7
7
 
8
8
  function isAbsolute(pathname) {
9
9
  return pathname.charAt(0) === '/';
@@ -145,7 +145,7 @@ const STATUS_SLIDEOUT = 2;
145
145
  const basicTabBarClassName = 'taro-tabbar__tabbar';
146
146
  const hideTabBarClassName = 'taro-tabbar__tabbar-hide';
147
147
  const hideTabBarWithAnimationClassName = 'taro-tabbar__tabbar-slideout';
148
- const Tabbar = class {
148
+ let Tabbar = class {
149
149
  constructor(hostRef) {
150
150
  index$1.registerInstance(this, hostRef);
151
151
  this.onLongPress = index$1.createEvent(this, "longpress", 7);
@@ -156,18 +156,18 @@ const Tabbar = class {
156
156
  this.status = STATUS_SHOW;
157
157
  this.getOriginUrl = (url) => {
158
158
  const customRoute = this.customRoutes.filter(([, customUrl]) => {
159
- const patha = splitUrl(customUrl).path;
160
- const pathb = splitUrl(url).path;
161
- return patha === pathb;
159
+ const pathA = splitUrl(customUrl).path;
160
+ const pathB = splitUrl(url).path;
161
+ return pathA === pathB;
162
162
  });
163
163
  return customRoute.length ? customRoute[0][0] : url;
164
164
  };
165
165
  this.getSelectedIndex = (url) => {
166
166
  let foundIndex = -1;
167
167
  this.list.forEach(({ pagePath }, idx) => {
168
- const patha = splitUrl(url).path;
169
- const pathb = splitUrl(pagePath).path;
170
- if (patha === pathb) {
168
+ const pathA = splitUrl(url).path;
169
+ const pathB = splitUrl(pagePath).path;
170
+ if (pathA === pathB) {
171
171
  foundIndex = idx;
172
172
  }
173
173
  });
@@ -210,23 +210,27 @@ const Tabbar = class {
210
210
  }
211
211
  this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage));
212
212
  };
213
- this.setTabBarBadgeHandler = ({ index, text, errorHandler }) => {
214
- const list = this.list;
213
+ this.setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }) => {
214
+ const list = [...this.list];
215
215
  if (index in list) {
216
- this.list[index].showRedDot = false;
217
- this.list[index].badgeText = text;
216
+ list[index].showRedDot = false;
217
+ list[index].badgeText = text;
218
+ successHandler({
219
+ errMsg: 'setTabBarBadge:ok'
220
+ });
218
221
  }
219
222
  else {
220
223
  errorHandler({
221
224
  errMsg: 'setTabBarBadge:fail tabbar item not found'
222
225
  });
223
226
  }
227
+ this.list = list;
224
228
  };
225
229
  this.removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }) => {
226
- const list = this.list;
230
+ const list = [...this.list];
227
231
  if (index in list) {
228
- this.list[index].badgeText = null;
229
- this.list[index].badgeText = null;
232
+ list[index].badgeText = null;
233
+ list[index].badgeText = null;
230
234
  successHandler({
231
235
  errMsg: 'removeTabBarBadge:ok'
232
236
  });
@@ -236,9 +240,10 @@ const Tabbar = class {
236
240
  errMsg: 'removeTabBarBadge:fail tabbar item not found'
237
241
  });
238
242
  }
243
+ this.list = list;
239
244
  };
240
245
  this.showTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
241
- const list = this.list;
246
+ const list = [...this.list];
242
247
  if (index in list) {
243
248
  list[index].badgeText = null;
244
249
  list[index].showRedDot = true;
@@ -251,9 +256,10 @@ const Tabbar = class {
251
256
  errMsg: 'showTabBarRedDot:fail tabbar item not found'
252
257
  });
253
258
  }
259
+ this.list = list;
254
260
  };
255
261
  this.hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
256
- const list = this.list;
262
+ const list = [...this.list];
257
263
  if (index in list) {
258
264
  list[index].showRedDot = false;
259
265
  successHandler({
@@ -265,6 +271,7 @@ const Tabbar = class {
265
271
  errMsg: 'hideTabBarRedDot:fail tabbar item not found'
266
272
  });
267
273
  }
274
+ this.list = list;
268
275
  };
269
276
  this.showTabBarHandler = ({ successHandler }) => {
270
277
  this.status = STATUS_SHOW;
@@ -278,6 +285,39 @@ const Tabbar = class {
278
285
  errMsg: 'hideTabBar:ok'
279
286
  });
280
287
  };
288
+ this.setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {
289
+ if (backgroundColor)
290
+ this.backgroundColor = backgroundColor;
291
+ if (borderStyle)
292
+ this.borderStyle = borderStyle;
293
+ if (color)
294
+ this.color = color;
295
+ if (selectedColor)
296
+ this.selectedColor = selectedColor;
297
+ successHandler({
298
+ errMsg: 'setTabBarStyle:ok'
299
+ });
300
+ };
301
+ this.setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {
302
+ const list = [...this.list];
303
+ if (index in list) {
304
+ if (iconPath)
305
+ list[index].iconPath = iconPath;
306
+ if (selectedIconPath)
307
+ list[index].selectedIconPath = selectedIconPath;
308
+ if (text)
309
+ list[index].text = text;
310
+ successHandler({
311
+ errMsg: 'setTabBarItem:ok'
312
+ });
313
+ }
314
+ else {
315
+ errorHandler({
316
+ errMsg: 'setTabBarItem:fail tabbar item not found'
317
+ });
318
+ }
319
+ this.list = list;
320
+ };
281
321
  const list = this.conf.list;
282
322
  const customRoutes = this.conf.customRoutes;
283
323
  if (Object.prototype.toString.call(list) !== '[object Array]' ||
@@ -295,6 +335,7 @@ const Tabbar = class {
295
335
  }
296
336
  });
297
337
  this.list = list;
338
+ this.borderStyle = this.conf.borderStyle;
298
339
  }
299
340
  getCurrentUrl() {
300
341
  const routerMode = this.conf.mode;
@@ -322,6 +363,8 @@ const Tabbar = class {
322
363
  Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
323
364
  Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler);
324
365
  Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler);
366
+ Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler);
367
+ Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler);
325
368
  }
326
369
  removeEvent() {
327
370
  Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler);
@@ -332,6 +375,8 @@ const Tabbar = class {
332
375
  Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
333
376
  Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler);
334
377
  Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler);
378
+ Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler);
379
+ Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler);
335
380
  }
336
381
  componentDidLoad() {
337
382
  this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom';
@@ -342,10 +387,10 @@ const Tabbar = class {
342
387
  this.removeEvent();
343
388
  }
344
389
  render() {
345
- const { conf, tabbarPos = 'bottom' } = this;
390
+ const { tabbarPos = 'bottom' } = this;
346
391
  const status = this.status;
347
392
  const containerCls = index.classnames('weui-tabbar', {
348
- [`taro-tabbar__border-${conf.borderStyle || 'black'}`]: true
393
+ [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true
349
394
  });
350
395
  const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE;
351
396
  const shouldSlideout = status === STATUS_SLIDEOUT;
@@ -353,19 +398,20 @@ const Tabbar = class {
353
398
  [hideTabBarClassName]: shouldHideTabBar,
354
399
  [hideTabBarWithAnimationClassName]: shouldSlideout
355
400
  }) }, index$1.h("div", { class: containerCls, style: {
356
- backgroundColor: conf.backgroundColor || ''
401
+ backgroundColor: this.backgroundColor || ''
357
402
  } }, this.list.map((item, index) => {
358
403
  const isSelected = this.selectedIndex === index;
359
404
  let textColor;
360
405
  let iconPath;
361
406
  if (isSelected) {
362
- textColor = conf.selectedColor;
407
+ textColor = this.selectedColor;
363
408
  iconPath = item.selectedIconPath;
364
409
  }
365
410
  else {
366
- textColor = conf.color || '';
411
+ textColor = this.color || '';
367
412
  iconPath = item.iconPath;
368
413
  }
414
+ console.log('TabbarItem', item);
369
415
  return (index$1.h(TabbarItem, { index: index, onSelect: this.switchTab.bind(this), isSelected: isSelected, textColor: textColor, iconPath: iconPath, text: item.text, badgeText: item.badgeText, showRedDot: item.showRedDot }));
370
416
  }))));
371
417
  }
@@ -2,12 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eefce54e.js');
6
- const index$1 = require('./index-cf56824f.js');
5
+ const index = require('./index-dd4b7ba3.js');
6
+ const index$1 = require('./index-b9715722.js');
7
7
 
8
8
  const indexCss = "taro-text-core{display:inline;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;white-space:pre-wrap}.taro-text__selectable{-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text}";
9
9
 
10
- const Text = class {
10
+ let Text = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
13
  this.selectable = false;
@@ -2,26 +2,30 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-eefce54e.js');
5
+ const index = require('./index-dd4b7ba3.js');
6
6
 
7
- const indexCss = "taro-textarea-core{display:block;width:300px;height:150px}.taro-textarea{-webkit-appearance:none;cursor:auto;width:100%;height:100%;border:0;display:block;position:relative}.taro-textarea:focus{outline:none}";
7
+ const indexCss = "taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{-webkit-appearance:none;cursor:auto;width:100%;height:150px;border:0;display:block;position:relative;line-height:1.5}.taro-textarea:focus{outline:none}";
8
8
 
9
9
  function fixControlledValue(value) {
10
10
  return value !== null && value !== void 0 ? value : '';
11
11
  }
12
- const Textarea = class {
12
+ let Textarea = class {
13
13
  constructor(hostRef) {
14
14
  index.registerInstance(this, hostRef);
15
15
  this.onInput = index.createEvent(this, "input", 7);
16
16
  this.onFocus = index.createEvent(this, "focus", 7);
17
17
  this.onBlur = index.createEvent(this, "blur", 7);
18
18
  this.onChange = index.createEvent(this, "change", 7);
19
+ this.onLineChange = index.createEvent(this, "linechange", 7);
19
20
  this.disabled = false;
20
21
  this.maxlength = 140;
21
22
  this.autoFocus = false;
23
+ this.autoHeight = false;
22
24
  this.nativeProps = {};
25
+ this.line = 1;
23
26
  this.hanldeInput = (e) => {
24
27
  e.stopPropagation();
28
+ this.handleLineChange();
25
29
  this.onInput.emit({
26
30
  value: e.target.value,
27
31
  cursor: e.target.value.length
@@ -43,6 +47,58 @@ const Textarea = class {
43
47
  value: e.target.value
44
48
  });
45
49
  };
50
+ this.handleLineChange = () => {
51
+ const line = this.getNumberOfLines();
52
+ if (line !== this.line) {
53
+ this.line = line;
54
+ this.onLineChange.emit({
55
+ height: this.textareaRef.clientHeight,
56
+ lineCount: this.line
57
+ });
58
+ }
59
+ };
60
+ this.calculateContentHeight = (ta, scanAmount) => {
61
+ let origHeight = ta.style.height, height = ta.offsetHeight, scrollHeight = ta.scrollHeight, overflow = ta.style.overflow;
62
+ /// only bother if the ta is bigger than content
63
+ if (height >= scrollHeight) {
64
+ /// check that our browser supports changing dimension
65
+ /// calculations mid-way through a function call...
66
+ ta.style.height = height + scanAmount + 'px';
67
+ /// because the scrollbar can cause calculation problems
68
+ ta.style.overflow = 'hidden';
69
+ /// by checking that scrollHeight has updated
70
+ if (scrollHeight < ta.scrollHeight) {
71
+ /// now try and scan the ta's height downwards
72
+ /// until scrollHeight becomes larger than height
73
+ while (ta.offsetHeight >= ta.scrollHeight) {
74
+ ta.style.height = (height -= scanAmount) + 'px';
75
+ }
76
+ /// be more specific to get the exact height
77
+ while (ta.offsetHeight < ta.scrollHeight) {
78
+ ta.style.height = height++ + 'px';
79
+ }
80
+ /// reset the ta back to it's original height
81
+ ta.style.height = origHeight;
82
+ /// put the overflow back
83
+ ta.style.overflow = overflow;
84
+ return height;
85
+ }
86
+ }
87
+ else {
88
+ return scrollHeight;
89
+ }
90
+ };
91
+ this.getNumberOfLines = () => {
92
+ const ta = this.textareaRef, style = window.getComputedStyle ? window.getComputedStyle(ta) : ta.style,
93
+ // This will get the line-height only if it is set in the css,
94
+ // otherwise it's "normal"
95
+ taLineHeight = parseInt(style.lineHeight, 10),
96
+ // Get the scroll height of the textarea
97
+ taHeight = this.calculateContentHeight(ta, taLineHeight),
98
+ // calculate the number of lines
99
+ numberOfLines = Math.floor(taHeight / taLineHeight);
100
+ return numberOfLines;
101
+ };
46
102
  }
47
103
  componentDidLoad() {
48
104
  Object.defineProperty(this.el, 'value', {
@@ -53,12 +109,16 @@ const Textarea = class {
53
109
  this.autoFocus && this.textareaRef.focus();
54
110
  }
55
111
  render() {
56
- const { value, placeholder, disabled, maxlength, autoFocus, name, nativeProps, hanldeInput, handleFocus, handleBlur, handleChange } = this;
112
+ const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, hanldeInput, handleFocus, handleBlur, handleChange } = this;
113
+ const otherProps = {};
114
+ if (autoHeight) {
115
+ otherProps.rows = this.line;
116
+ }
57
117
  return (index.h("textarea", Object.assign({ ref: input => {
58
118
  if (input) {
59
119
  this.textareaRef = input;
60
120
  }
61
- }, class: 'taro-textarea', value: fixControlledValue(value), placeholder: placeholder, name: name, disabled: disabled, maxlength: maxlength, autofocus: autoFocus, onInput: hanldeInput, onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange }, nativeProps)));
121
+ }, class: `taro-textarea ${autoHeight ? 'auto-height' : ''}`, value: fixControlledValue(value), placeholder: placeholder, name: name, disabled: disabled, maxlength: maxlength, autofocus: autoFocus, onInput: hanldeInput, onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange }, nativeProps, otherProps)));
62
122
  }
63
123
  get el() { return index.getElement(this); }
64
124
  };