@tarojs/components 3.3.14 → 3.5.0-canary.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 (242) hide show
  1. package/dist/cjs/{index-cde74e58.js → index-b9715722.js} +0 -0
  2. package/dist/cjs/{index-7464647f.js → index-dd4b7ba3.js} +0 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/taro-audio-core.cjs.entry.js +1 -1
  5. package/dist/cjs/taro-block-core.cjs.entry.js +1 -1
  6. package/dist/cjs/taro-button-core.cjs.entry.js +2 -2
  7. package/dist/cjs/taro-camera-core.cjs.entry.js +1 -1
  8. package/dist/cjs/taro-canvas-core.cjs.entry.js +1 -1
  9. package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +1 -1
  10. package/dist/cjs/taro-components.cjs.js +2 -2
  11. package/dist/cjs/taro-cover-image-core.cjs.entry.js +18 -4
  12. package/dist/cjs/taro-cover-view-core.cjs.entry.js +50 -4
  13. package/dist/cjs/taro-custom-wrapper-core.cjs.entry.js +1 -1
  14. package/dist/cjs/taro-form-core.cjs.entry.js +1 -1
  15. package/dist/cjs/taro-icon-core.cjs.entry.js +2 -2
  16. package/dist/cjs/taro-image-core.cjs.entry.js +2 -2
  17. package/dist/cjs/taro-input-core.cjs.entry.js +5 -5
  18. package/dist/cjs/taro-label-core.cjs.entry.js +1 -1
  19. package/dist/cjs/taro-movable-area-core.cjs.entry.js +1 -1
  20. package/dist/cjs/taro-movable-view-core.cjs.entry.js +1 -1
  21. package/dist/cjs/taro-navigator-core.cjs.entry.js +2 -2
  22. package/dist/cjs/taro-open-data-core.cjs.entry.js +1 -1
  23. package/dist/cjs/taro-picker-core_2.cjs.entry.js +2 -2
  24. package/dist/cjs/taro-picker-view-column-core.cjs.entry.js +1 -1
  25. package/dist/cjs/taro-picker-view-core.cjs.entry.js +1 -1
  26. package/dist/cjs/taro-progress-core.cjs.entry.js +1 -1
  27. package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +2 -2
  28. package/dist/cjs/taro-radio-core_2.cjs.entry.js +1 -1
  29. package/dist/cjs/taro-rich-text-core.cjs.entry.js +1 -1
  30. package/dist/cjs/taro-scroll-view-core.cjs.entry.js +2 -2
  31. package/dist/cjs/taro-slider-core.cjs.entry.js +1 -1
  32. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +2 -2
  33. package/dist/cjs/taro-switch-core.cjs.entry.js +1 -1
  34. package/dist/cjs/taro-tabbar.cjs.entry.js +70 -22
  35. package/dist/cjs/taro-text-core.cjs.entry.js +2 -2
  36. package/dist/cjs/taro-textarea-core.cjs.entry.js +64 -4
  37. package/dist/cjs/taro-video-control_3.cjs.entry.js +183 -100
  38. package/dist/cjs/taro-view-core.cjs.entry.js +2 -2
  39. package/dist/cjs/taro-web-view-core.cjs.entry.js +1 -1
  40. package/dist/collection/collection-manifest.json +1 -1
  41. package/dist/collection/components/cover-image/cover-image.js +94 -0
  42. package/dist/collection/components/cover-image/style/index.css +5 -0
  43. package/dist/collection/components/cover-view/cover-view.js +166 -4
  44. package/dist/collection/components/cover-view/style/cover-view.css +3 -0
  45. package/dist/collection/components/input/input.js +4 -4
  46. package/dist/collection/components/tabbar/tabbar.js +72 -20
  47. package/dist/collection/components/textarea/style/index.css +6 -2
  48. package/dist/collection/components/textarea/textarea.js +98 -3
  49. package/dist/collection/components/video/video-control.js +39 -22
  50. package/dist/collection/components/video/video-danmu.js +52 -39
  51. package/dist/collection/components/video/video.js +60 -37
  52. package/dist/esm/{index-85e10859.js → index-3c78bcaf.js} +0 -0
  53. package/dist/esm/{index-165a6222.js → index-5bd7cbab.js} +0 -0
  54. package/dist/esm/loader.js +2 -2
  55. package/dist/esm/taro-audio-core.entry.js +1 -1
  56. package/dist/esm/taro-block-core.entry.js +1 -1
  57. package/dist/esm/taro-button-core.entry.js +2 -2
  58. package/dist/esm/taro-camera-core.entry.js +1 -1
  59. package/dist/esm/taro-canvas-core.entry.js +1 -1
  60. package/dist/esm/taro-checkbox-core_2.entry.js +1 -1
  61. package/dist/esm/taro-components.js +2 -2
  62. package/dist/esm/taro-cover-image-core.entry.js +18 -4
  63. package/dist/esm/taro-cover-view-core.entry.js +50 -4
  64. package/dist/esm/taro-custom-wrapper-core.entry.js +1 -1
  65. package/dist/esm/taro-form-core.entry.js +1 -1
  66. package/dist/esm/taro-icon-core.entry.js +2 -2
  67. package/dist/esm/taro-image-core.entry.js +2 -2
  68. package/dist/esm/taro-input-core.entry.js +5 -5
  69. package/dist/esm/taro-label-core.entry.js +1 -1
  70. package/dist/esm/taro-movable-area-core.entry.js +1 -1
  71. package/dist/esm/taro-movable-view-core.entry.js +1 -1
  72. package/dist/esm/taro-navigator-core.entry.js +2 -2
  73. package/dist/esm/taro-open-data-core.entry.js +1 -1
  74. package/dist/esm/taro-picker-core_2.entry.js +2 -2
  75. package/dist/esm/taro-picker-view-column-core.entry.js +1 -1
  76. package/dist/esm/taro-picker-view-core.entry.js +1 -1
  77. package/dist/esm/taro-progress-core.entry.js +1 -1
  78. package/dist/esm/taro-pull-to-refresh.entry.js +2 -2
  79. package/dist/esm/taro-radio-core_2.entry.js +1 -1
  80. package/dist/esm/taro-rich-text-core.entry.js +1 -1
  81. package/dist/esm/taro-scroll-view-core.entry.js +2 -2
  82. package/dist/esm/taro-slider-core.entry.js +1 -1
  83. package/dist/esm/taro-swiper-core_2.entry.js +2 -2
  84. package/dist/esm/taro-switch-core.entry.js +1 -1
  85. package/dist/esm/taro-tabbar.entry.js +70 -22
  86. package/dist/esm/taro-text-core.entry.js +2 -2
  87. package/dist/esm/taro-textarea-core.entry.js +64 -4
  88. package/dist/esm/taro-video-control_3.entry.js +183 -100
  89. package/dist/esm/taro-view-core.entry.js +2 -2
  90. package/dist/esm/taro-web-view-core.entry.js +1 -1
  91. package/dist/esm-es5/{index-85e10859.js → index-3c78bcaf.js} +0 -0
  92. package/dist/esm-es5/{index-165a6222.js → index-5bd7cbab.js} +0 -0
  93. package/dist/esm-es5/loader.js +1 -1
  94. package/dist/esm-es5/taro-audio-core.entry.js +1 -1
  95. package/dist/esm-es5/taro-block-core.entry.js +1 -1
  96. package/dist/esm-es5/taro-button-core.entry.js +1 -1
  97. package/dist/esm-es5/taro-camera-core.entry.js +1 -1
  98. package/dist/esm-es5/taro-canvas-core.entry.js +1 -1
  99. package/dist/esm-es5/taro-checkbox-core_2.entry.js +1 -1
  100. package/dist/esm-es5/taro-components.js +1 -1
  101. package/dist/esm-es5/taro-cover-image-core.entry.js +1 -1
  102. package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
  103. package/dist/esm-es5/taro-custom-wrapper-core.entry.js +1 -1
  104. package/dist/esm-es5/taro-form-core.entry.js +1 -1
  105. package/dist/esm-es5/taro-icon-core.entry.js +1 -1
  106. package/dist/esm-es5/taro-image-core.entry.js +1 -1
  107. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  108. package/dist/esm-es5/taro-label-core.entry.js +1 -1
  109. package/dist/esm-es5/taro-movable-area-core.entry.js +1 -1
  110. package/dist/esm-es5/taro-movable-view-core.entry.js +1 -1
  111. package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
  112. package/dist/esm-es5/taro-open-data-core.entry.js +1 -1
  113. package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
  114. package/dist/esm-es5/taro-picker-view-column-core.entry.js +1 -1
  115. package/dist/esm-es5/taro-picker-view-core.entry.js +1 -1
  116. package/dist/esm-es5/taro-progress-core.entry.js +1 -1
  117. package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
  118. package/dist/esm-es5/taro-radio-core_2.entry.js +1 -1
  119. package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
  120. package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
  121. package/dist/esm-es5/taro-slider-core.entry.js +1 -1
  122. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  123. package/dist/esm-es5/taro-switch-core.entry.js +1 -1
  124. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  125. package/dist/esm-es5/taro-text-core.entry.js +1 -1
  126. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  127. package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
  128. package/dist/esm-es5/taro-view-core.entry.js +1 -1
  129. package/dist/esm-es5/taro-web-view-core.entry.js +1 -1
  130. package/dist/taro-components/{p-3e2d4793.entry.js → p-06bffead.entry.js} +1 -1
  131. package/dist/taro-components/{p-b685a487.system.entry.js → p-10a6c489.system.entry.js} +1 -1
  132. package/dist/taro-components/p-11932905.entry.js +1 -0
  133. package/dist/taro-components/{p-2ef4681b.system.entry.js → p-12638ebc.system.entry.js} +1 -1
  134. package/dist/taro-components/p-12ae0a33.entry.js +1 -0
  135. package/dist/taro-components/{p-8d905ff5.system.entry.js → p-13c1404f.system.entry.js} +1 -1
  136. package/dist/taro-components/{p-d6269b5e.system.entry.js → p-17039974.system.entry.js} +1 -1
  137. package/dist/taro-components/{p-7a5be745.entry.js → p-17cf8b5b.entry.js} +1 -1
  138. package/dist/taro-components/{p-5a13bd63.system.entry.js → p-1b790eb0.system.entry.js} +1 -1
  139. package/dist/taro-components/{p-2eda9121.system.entry.js → p-1e4f1702.system.entry.js} +1 -1
  140. package/dist/taro-components/p-2438fcd4.system.entry.js +1 -0
  141. package/dist/taro-components/{p-00328ebf.system.entry.js → p-264b7229.system.entry.js} +1 -1
  142. package/dist/taro-components/p-33ee636a.system.js +1 -0
  143. package/dist/taro-components/{p-1507bcbf.entry.js → p-3633bb84.entry.js} +1 -1
  144. package/dist/taro-components/{p-2ce9bc65.system.entry.js → p-3643d8f7.system.entry.js} +1 -1
  145. package/dist/taro-components/{p-6967e577.js → p-37cfdd8f.js} +0 -0
  146. package/dist/taro-components/{p-098f4931.system.entry.js → p-3aac5746.system.entry.js} +1 -1
  147. package/dist/taro-components/{p-d52009d1.system.entry.js → p-3eebeb1c.system.entry.js} +1 -1
  148. package/dist/taro-components/p-431197bc.entry.js +1 -0
  149. package/dist/taro-components/{p-2de1a146.system.entry.js → p-43de2f12.system.entry.js} +1 -1
  150. package/dist/taro-components/{p-69be8189.system.entry.js → p-46cf6431.system.entry.js} +1 -1
  151. package/dist/taro-components/{p-f4158e42.entry.js → p-4dbed323.entry.js} +1 -1
  152. package/dist/taro-components/{p-bd922592.system.entry.js → p-50066d5e.system.entry.js} +1 -1
  153. package/dist/taro-components/p-554e1039.entry.js +1 -0
  154. package/dist/taro-components/{p-0da88b1b.entry.js → p-55b0a30b.entry.js} +1 -1
  155. package/dist/taro-components/p-5c420456.entry.js +1 -0
  156. package/dist/taro-components/{p-d12592f1.entry.js → p-5f8b5f62.entry.js} +1 -1
  157. package/dist/taro-components/p-627a5064.system.entry.js +1 -0
  158. package/dist/taro-components/{p-8cf16235.entry.js → p-64993f48.entry.js} +1 -1
  159. package/dist/taro-components/p-66237ac0.entry.js +1 -0
  160. package/dist/taro-components/{p-923c6e08.entry.js → p-6965567d.entry.js} +1 -1
  161. package/dist/taro-components/{p-a34988ff.system.entry.js → p-703dfad8.system.entry.js} +1 -1
  162. package/dist/taro-components/p-71de9bd6.entry.js +1 -0
  163. package/dist/taro-components/p-74540410.entry.js +1 -0
  164. package/dist/taro-components/{p-0fb7f599.entry.js → p-7a64a3d2.entry.js} +1 -1
  165. package/dist/taro-components/{p-1ed219a6.system.entry.js → p-7d848382.system.entry.js} +1 -1
  166. package/dist/taro-components/{p-ca67c759.entry.js → p-83dedaa2.entry.js} +1 -1
  167. package/dist/taro-components/{p-81588c19.entry.js → p-865c21b5.entry.js} +1 -1
  168. package/dist/taro-components/{p-26c08f44.entry.js → p-8a5e67cb.entry.js} +1 -1
  169. package/dist/taro-components/p-8bc82aaa.entry.js +1 -0
  170. package/dist/taro-components/p-8db237e0.entry.js +1 -0
  171. package/dist/taro-components/{p-5c8ba192.system.entry.js → p-8f90fca9.system.entry.js} +1 -1
  172. package/dist/taro-components/{p-696f0d1c.system.js → p-94c20f60.system.js} +0 -0
  173. package/dist/taro-components/p-95529dc0.entry.js +1 -0
  174. package/dist/taro-components/p-964692f7.system.entry.js +1 -0
  175. package/dist/taro-components/p-99ed3ed2.system.entry.js +1 -0
  176. package/dist/taro-components/{p-ce49e2f4.system.entry.js → p-9a618935.system.entry.js} +1 -1
  177. package/dist/taro-components/p-9d0ab7c4.entry.js +1 -0
  178. package/dist/taro-components/{p-9e807bd6.system.entry.js → p-9fc88fc1.system.entry.js} +1 -1
  179. package/dist/taro-components/p-a1423df9.entry.js +1 -0
  180. package/dist/taro-components/{p-93748645.system.js → p-b2d01686.system.js} +0 -0
  181. package/dist/taro-components/p-b75d8a65.entry.js +1 -0
  182. package/dist/taro-components/{p-5d84eaf0.entry.js → p-b8e0ad7d.entry.js} +1 -1
  183. package/dist/taro-components/p-b9280444.entry.js +1 -0
  184. package/dist/taro-components/{p-4462dca4.system.entry.js → p-bd3fa355.system.entry.js} +1 -1
  185. package/dist/taro-components/p-c218c298.entry.js +1 -0
  186. package/dist/taro-components/p-c362734b.entry.js +1 -0
  187. package/dist/taro-components/{p-d52bf5f5.system.entry.js → p-cea9a198.system.entry.js} +1 -1
  188. package/dist/taro-components/{p-321aeeec.system.entry.js → p-cfbdd4e3.system.entry.js} +1 -1
  189. package/dist/taro-components/p-d394a61f.system.entry.js +1 -0
  190. package/dist/taro-components/{p-7b021c48.entry.js → p-d567b95e.entry.js} +1 -1
  191. package/dist/taro-components/{p-de3a4828.entry.js → p-d5971476.entry.js} +1 -1
  192. package/dist/taro-components/{p-26d8c60a.system.entry.js → p-e0af1d0d.system.entry.js} +1 -1
  193. package/dist/taro-components/p-e27798a4.entry.js +1 -0
  194. package/dist/taro-components/{p-37cfef64.entry.js → p-e6298500.entry.js} +1 -1
  195. package/dist/taro-components/{p-49ae5efb.js → p-f05e1558.js} +0 -0
  196. package/dist/taro-components/p-f98e0224.entry.js +1 -0
  197. package/dist/taro-components/{p-5e6feca6.system.entry.js → p-fb0959c1.system.entry.js} +1 -1
  198. package/dist/taro-components/{p-4168e24d.system.entry.js → p-fb2252b7.system.entry.js} +1 -1
  199. package/dist/taro-components/{p-5412a1d2.system.entry.js → p-fc4939c6.system.entry.js} +1 -1
  200. package/dist/taro-components/{p-9d6a7a70.system.entry.js → p-fd8312e5.system.entry.js} +1 -1
  201. package/dist/taro-components/{p-7ffcfb05.system.entry.js → p-fdd73355.system.entry.js} +1 -1
  202. package/dist/taro-components/{p-016f56cc.system.entry.js → p-fde3a009.system.entry.js} +1 -1
  203. package/dist/taro-components/{p-9e912454.system.entry.js → p-fe156231.system.entry.js} +1 -1
  204. package/dist/taro-components/{p-2b6a2449.system.entry.js → p-ffe63ce9.system.entry.js} +1 -1
  205. package/dist/taro-components/taro-components.esm.js +1 -1
  206. package/dist/taro-components/taro-components.js +1 -1
  207. package/dist/types/components/cover-image/cover-image.d.ts +11 -0
  208. package/dist/types/components/cover-view/cover-view.d.ts +14 -2
  209. package/dist/types/components/tabbar/tabbar.d.ts +20 -1
  210. package/dist/types/components/textarea/textarea.d.ts +6 -0
  211. package/dist/types/components.d.ts +18 -0
  212. package/dist-h5/vue/createComponent.js +4 -0
  213. package/dist-h5/vue/createFormsComponent.js +8 -1
  214. package/dist-h5/vue/simpleComponents.js +1 -1
  215. package/package.json +4 -4
  216. package/dist/collection/components/cover-view/cover-image.js +0 -11
  217. package/dist/taro-components/p-17c0731f.entry.js +0 -1
  218. package/dist/taro-components/p-2c5d57af.entry.js +0 -1
  219. package/dist/taro-components/p-30bfacb9.system.js +0 -1
  220. package/dist/taro-components/p-3554df41.entry.js +0 -1
  221. package/dist/taro-components/p-382cabbc.system.entry.js +0 -1
  222. package/dist/taro-components/p-4a2ffc1c.entry.js +0 -1
  223. package/dist/taro-components/p-4ff67760.entry.js +0 -1
  224. package/dist/taro-components/p-6daacf48.entry.js +0 -1
  225. package/dist/taro-components/p-70f40e3a.entry.js +0 -1
  226. package/dist/taro-components/p-72f2b6f5.entry.js +0 -1
  227. package/dist/taro-components/p-76c00960.entry.js +0 -1
  228. package/dist/taro-components/p-7f3e5f09.entry.js +0 -1
  229. package/dist/taro-components/p-9767491b.entry.js +0 -1
  230. package/dist/taro-components/p-a895db87.entry.js +0 -1
  231. package/dist/taro-components/p-af9ec312.system.entry.js +0 -1
  232. package/dist/taro-components/p-b6e0dca6.entry.js +0 -1
  233. package/dist/taro-components/p-c221cebb.system.entry.js +0 -1
  234. package/dist/taro-components/p-c5722042.entry.js +0 -1
  235. package/dist/taro-components/p-ce093936.entry.js +0 -1
  236. package/dist/taro-components/p-d6a37b93.entry.js +0 -1
  237. package/dist/taro-components/p-f6c7f07c.system.entry.js +0 -1
  238. package/dist/taro-components/p-f7b6c1a6.entry.js +0 -1
  239. package/dist/taro-components/p-f8d0dabb.entry.js +0 -1
  240. package/dist/taro-components/p-f9013b36.system.entry.js +0 -1
  241. package/dist/taro-components/p-f991bc7b.entry.js +0 -1
  242. package/dist/types/components/cover-view/cover-image.d.ts +0 -4
@@ -1,11 +1,173 @@
1
1
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
- import { Component, h, Host } from '@stencil/core';
2
+ import { Component, Prop, h, Host, Listen, State, Event } from '@stencil/core';
3
+ import classNames from 'classnames';
3
4
  export class CoverView {
4
- componentDidLoad() {
5
- console.error('H5 暂不支持 CoverView 组件!');
5
+ constructor() {
6
+ this.hoverStartTime = 50;
7
+ this.hoverStayTime = 400;
8
+ this.hover = false;
9
+ this.touch = false;
10
+ this.startTime = 0;
11
+ }
12
+ onTouchStart() {
13
+ if (this.hoverClass) {
14
+ this.touch = true;
15
+ setTimeout(() => {
16
+ if (this.touch) {
17
+ this.hover = true;
18
+ }
19
+ }, this.hoverStartTime);
20
+ }
21
+ this.timeoutEvent = setTimeout(() => {
22
+ this.onLongPress.emit();
23
+ }, 350);
24
+ this.startTime = Date.now();
25
+ }
26
+ onTouchMove() {
27
+ clearTimeout(this.timeoutEvent);
28
+ }
29
+ onTouchEnd() {
30
+ const spanTime = Date.now() - this.startTime;
31
+ if (spanTime < 350) {
32
+ clearTimeout(this.timeoutEvent);
33
+ }
34
+ if (this.hoverClass) {
35
+ this.touch = false;
36
+ setTimeout(() => {
37
+ if (!this.touch) {
38
+ this.hover = false;
39
+ }
40
+ }, this.hoverStayTime);
41
+ }
6
42
  }
7
43
  render() {
8
- return (h(Host, null));
44
+ const cls = classNames({
45
+ [`${this.hoverClass}`]: this.hover
46
+ });
47
+ let attr = {};
48
+ if (!!this.animation) {
49
+ attr['animation'] = this.animation;
50
+ attr['data-animation'] = this.animation;
51
+ }
52
+ return (h(Host, Object.assign({ class: cls }, attr),
53
+ h("slot", null)));
9
54
  }
10
55
  static get is() { return "taro-cover-view-core"; }
56
+ static get originalStyleUrls() { return {
57
+ "$": ["./style/cover-view.scss"]
58
+ }; }
59
+ static get styleUrls() { return {
60
+ "$": ["./style/cover-view.css"]
61
+ }; }
62
+ static get properties() { return {
63
+ "animation": {
64
+ "type": "string",
65
+ "mutable": false,
66
+ "complexType": {
67
+ "original": "string",
68
+ "resolved": "string",
69
+ "references": {}
70
+ },
71
+ "required": false,
72
+ "optional": false,
73
+ "docs": {
74
+ "tags": [],
75
+ "text": ""
76
+ },
77
+ "attribute": "animation",
78
+ "reflect": false
79
+ },
80
+ "hoverClass": {
81
+ "type": "string",
82
+ "mutable": false,
83
+ "complexType": {
84
+ "original": "string",
85
+ "resolved": "string",
86
+ "references": {}
87
+ },
88
+ "required": false,
89
+ "optional": false,
90
+ "docs": {
91
+ "tags": [],
92
+ "text": ""
93
+ },
94
+ "attribute": "hover-class",
95
+ "reflect": false
96
+ },
97
+ "hoverStartTime": {
98
+ "type": "number",
99
+ "mutable": false,
100
+ "complexType": {
101
+ "original": "number",
102
+ "resolved": "number",
103
+ "references": {}
104
+ },
105
+ "required": false,
106
+ "optional": false,
107
+ "docs": {
108
+ "tags": [],
109
+ "text": ""
110
+ },
111
+ "attribute": "hover-start-time",
112
+ "reflect": false,
113
+ "defaultValue": "50"
114
+ },
115
+ "hoverStayTime": {
116
+ "type": "number",
117
+ "mutable": false,
118
+ "complexType": {
119
+ "original": "number",
120
+ "resolved": "number",
121
+ "references": {}
122
+ },
123
+ "required": false,
124
+ "optional": false,
125
+ "docs": {
126
+ "tags": [],
127
+ "text": ""
128
+ },
129
+ "attribute": "hover-stay-time",
130
+ "reflect": false,
131
+ "defaultValue": "400"
132
+ }
133
+ }; }
134
+ static get states() { return {
135
+ "hover": {},
136
+ "touch": {}
137
+ }; }
138
+ static get events() { return [{
139
+ "method": "onLongPress",
140
+ "name": "longpress",
141
+ "bubbles": true,
142
+ "cancelable": true,
143
+ "composed": true,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": ""
147
+ },
148
+ "complexType": {
149
+ "original": "any",
150
+ "resolved": "any",
151
+ "references": {}
152
+ }
153
+ }]; }
154
+ static get listeners() { return [{
155
+ "name": "touchstart",
156
+ "method": "onTouchStart",
157
+ "target": undefined,
158
+ "capture": false,
159
+ "passive": true
160
+ }, {
161
+ "name": "touchmove",
162
+ "method": "onTouchMove",
163
+ "target": undefined,
164
+ "capture": false,
165
+ "passive": true
166
+ }, {
167
+ "name": "touchend",
168
+ "method": "onTouchEnd",
169
+ "target": undefined,
170
+ "capture": false,
171
+ "passive": true
172
+ }]; }
11
173
  }
@@ -0,0 +1,3 @@
1
+ taro-cover-view-core {
2
+ display: block;
3
+ }
@@ -112,7 +112,7 @@ export class Input {
112
112
  this._value = this.value;
113
113
  }
114
114
  componentDidLoad() {
115
- var _a, _b, _c;
115
+ var _a, _b, _c, _d;
116
116
  if (this.type === 'file') {
117
117
  this.fileListener = () => {
118
118
  this.onInput.emit();
@@ -130,6 +130,7 @@ export class Input {
130
130
  },
131
131
  configurable: true
132
132
  });
133
+ this.autoFocus && ((_d = this.inputRef) === null || _d === void 0 ? void 0 : _d.focus());
133
134
  }
134
135
  disconnectedCallback() {
135
136
  var _a;
@@ -138,11 +139,10 @@ export class Input {
138
139
  }
139
140
  }
140
141
  render() {
141
- const { _value, type, password, placeholder, disabled, maxlength, autoFocus, confirmType, name, nativeProps } = this;
142
+ const { _value, type, password, placeholder, disabled, maxlength, confirmType, name, nativeProps } = this;
142
143
  return (h("input", Object.assign({ ref: input => {
143
144
  this.inputRef = input;
144
- autoFocus && (input === null || input === void 0 ? void 0 : input.focus());
145
- }, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, disabled: disabled, maxlength: maxlength, autofocus: autoFocus, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
145
+ }, class: 'weui-input', value: fixControlledValue(_value), type: getTrueType(type, confirmType, password), placeholder: placeholder, disabled: disabled, maxlength: maxlength, name: name, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onKeyDown: this.handleKeyDown }, nativeProps)));
146
146
  }
147
147
  static get is() { return "taro-input-core"; }
148
148
  static get originalStyleUrls() { return {
@@ -25,18 +25,18 @@ export class Tabbar {
25
25
  this.status = STATUS_SHOW;
26
26
  this.getOriginUrl = (url) => {
27
27
  const customRoute = this.customRoutes.filter(([, customUrl]) => {
28
- const patha = splitUrl(customUrl).path;
29
- const pathb = splitUrl(url).path;
30
- return patha === pathb;
28
+ const pathA = splitUrl(customUrl).path;
29
+ const pathB = splitUrl(url).path;
30
+ return pathA === pathB;
31
31
  });
32
32
  return customRoute.length ? customRoute[0][0] : url;
33
33
  };
34
34
  this.getSelectedIndex = (url) => {
35
35
  let foundIndex = -1;
36
36
  this.list.forEach(({ pagePath }, idx) => {
37
- const patha = splitUrl(url).path;
38
- const pathb = splitUrl(pagePath).path;
39
- if (patha === pathb) {
37
+ const pathA = splitUrl(url).path;
38
+ const pathB = splitUrl(pagePath).path;
39
+ if (pathA === pathB) {
40
40
  foundIndex = idx;
41
41
  }
42
42
  });
@@ -79,23 +79,27 @@ export class Tabbar {
79
79
  }
80
80
  this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage));
81
81
  };
82
- this.setTabBarBadgeHandler = ({ index, text, errorHandler }) => {
83
- const list = this.list;
82
+ this.setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }) => {
83
+ const list = [...this.list];
84
84
  if (index in list) {
85
- this.list[index].showRedDot = false;
86
- this.list[index].badgeText = text;
85
+ list[index].showRedDot = false;
86
+ list[index].badgeText = text;
87
+ successHandler({
88
+ errMsg: 'setTabBarBadge:ok'
89
+ });
87
90
  }
88
91
  else {
89
92
  errorHandler({
90
93
  errMsg: 'setTabBarBadge:fail tabbar item not found'
91
94
  });
92
95
  }
96
+ this.list = list;
93
97
  };
94
98
  this.removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }) => {
95
- const list = this.list;
99
+ const list = [...this.list];
96
100
  if (index in list) {
97
- this.list[index].badgeText = null;
98
- this.list[index].badgeText = null;
101
+ list[index].badgeText = null;
102
+ list[index].badgeText = null;
99
103
  successHandler({
100
104
  errMsg: 'removeTabBarBadge:ok'
101
105
  });
@@ -105,9 +109,10 @@ export class Tabbar {
105
109
  errMsg: 'removeTabBarBadge:fail tabbar item not found'
106
110
  });
107
111
  }
112
+ this.list = list;
108
113
  };
109
114
  this.showTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
110
- const list = this.list;
115
+ const list = [...this.list];
111
116
  if (index in list) {
112
117
  list[index].badgeText = null;
113
118
  list[index].showRedDot = true;
@@ -120,9 +125,10 @@ export class Tabbar {
120
125
  errMsg: 'showTabBarRedDot:fail tabbar item not found'
121
126
  });
122
127
  }
128
+ this.list = list;
123
129
  };
124
130
  this.hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }) => {
125
- const list = this.list;
131
+ const list = [...this.list];
126
132
  if (index in list) {
127
133
  list[index].showRedDot = false;
128
134
  successHandler({
@@ -134,6 +140,7 @@ export class Tabbar {
134
140
  errMsg: 'hideTabBarRedDot:fail tabbar item not found'
135
141
  });
136
142
  }
143
+ this.list = list;
137
144
  };
138
145
  this.showTabBarHandler = ({ successHandler }) => {
139
146
  this.status = STATUS_SHOW;
@@ -147,6 +154,39 @@ export class Tabbar {
147
154
  errMsg: 'hideTabBar:ok'
148
155
  });
149
156
  };
157
+ this.setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {
158
+ if (backgroundColor)
159
+ this.backgroundColor = backgroundColor;
160
+ if (borderStyle)
161
+ this.borderStyle = borderStyle;
162
+ if (color)
163
+ this.color = color;
164
+ if (selectedColor)
165
+ this.selectedColor = selectedColor;
166
+ successHandler({
167
+ errMsg: 'setTabBarStyle:ok'
168
+ });
169
+ };
170
+ this.setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {
171
+ const list = [...this.list];
172
+ if (index in list) {
173
+ if (iconPath)
174
+ list[index].iconPath = iconPath;
175
+ if (selectedIconPath)
176
+ list[index].selectedIconPath = selectedIconPath;
177
+ if (text)
178
+ list[index].text = text;
179
+ successHandler({
180
+ errMsg: 'setTabBarItem:ok'
181
+ });
182
+ }
183
+ else {
184
+ errorHandler({
185
+ errMsg: 'setTabBarItem:fail tabbar item not found'
186
+ });
187
+ }
188
+ this.list = list;
189
+ };
150
190
  const list = this.conf.list;
151
191
  const customRoutes = this.conf.customRoutes;
152
192
  if (Object.prototype.toString.call(list) !== '[object Array]' ||
@@ -164,6 +204,10 @@ export class Tabbar {
164
204
  }
165
205
  });
166
206
  this.list = list;
207
+ this.borderStyle = this.conf.borderStyle;
208
+ this.backgroundColor = this.conf.backgroundColor;
209
+ this.color = this.conf.color;
210
+ this.selectedColor = this.conf.selectedColor;
167
211
  }
168
212
  getCurrentUrl() {
169
213
  const routerMode = this.conf.mode;
@@ -191,6 +235,8 @@ export class Tabbar {
191
235
  Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
192
236
  Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler);
193
237
  Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler);
238
+ Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler);
239
+ Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler);
194
240
  }
195
241
  removeEvent() {
196
242
  Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler);
@@ -201,6 +247,8 @@ export class Tabbar {
201
247
  Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler);
202
248
  Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler);
203
249
  Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler);
250
+ Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler);
251
+ Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler);
204
252
  }
205
253
  componentDidLoad() {
206
254
  this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom';
@@ -211,10 +259,10 @@ export class Tabbar {
211
259
  this.removeEvent();
212
260
  }
213
261
  render() {
214
- const { conf, tabbarPos = 'bottom' } = this;
262
+ const { tabbarPos = 'bottom' } = this;
215
263
  const status = this.status;
216
264
  const containerCls = classNames('weui-tabbar', {
217
- [`taro-tabbar__border-${conf.borderStyle || 'black'}`]: true
265
+ [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true
218
266
  });
219
267
  const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE;
220
268
  const shouldSlideout = status === STATUS_SLIDEOUT;
@@ -223,17 +271,17 @@ export class Tabbar {
223
271
  [hideTabBarWithAnimationClassName]: shouldSlideout
224
272
  }) },
225
273
  h("div", { class: containerCls, style: {
226
- backgroundColor: conf.backgroundColor || ''
274
+ backgroundColor: this.backgroundColor || ''
227
275
  } }, this.list.map((item, index) => {
228
276
  const isSelected = this.selectedIndex === index;
229
277
  let textColor;
230
278
  let iconPath;
231
279
  if (isSelected) {
232
- textColor = conf.selectedColor;
280
+ textColor = this.selectedColor || '';
233
281
  iconPath = item.selectedIconPath;
234
282
  }
235
283
  else {
236
- textColor = conf.color || '';
284
+ textColor = this.color || '';
237
285
  iconPath = item.iconPath;
238
286
  }
239
287
  return (h(TabbarItem, { index: index, onSelect: this.switchTab.bind(this), isSelected: isSelected, textColor: textColor, iconPath: iconPath, text: item.text, badgeText: item.badgeText, showRedDot: item.showRedDot }));
@@ -269,6 +317,10 @@ export class Tabbar {
269
317
  }; }
270
318
  static get states() { return {
271
319
  "list": {},
320
+ "borderStyle": {},
321
+ "backgroundColor": {},
322
+ "color": {},
323
+ "selectedColor": {},
272
324
  "selectedIndex": {},
273
325
  "status": {}
274
326
  }; }
@@ -1,17 +1,21 @@
1
1
  taro-textarea-core {
2
2
  display: block;
3
3
  width: 300px;
4
- height: 150px;
4
+ }
5
+
6
+ taro-textarea-core .auto-height {
7
+ height: auto;
5
8
  }
6
9
 
7
10
  .taro-textarea {
8
11
  -webkit-appearance: none;
9
12
  cursor: auto;
10
13
  width: 100%;
11
- height: 100%;
14
+ height: 150px;
12
15
  border: 0;
13
16
  display: block;
14
17
  position: relative;
18
+ line-height: 1.5;
15
19
  }
16
20
  .taro-textarea:focus {
17
21
  outline: none;
@@ -1,5 +1,5 @@
1
1
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
- import { Component, h, Prop, Event, Element } from '@stencil/core';
2
+ import { Component, h, Prop, State, Event, Element } from '@stencil/core';
3
3
  function fixControlledValue(value) {
4
4
  return value !== null && value !== void 0 ? value : '';
5
5
  }
@@ -8,9 +8,12 @@ export class Textarea {
8
8
  this.disabled = false;
9
9
  this.maxlength = 140;
10
10
  this.autoFocus = false;
11
+ this.autoHeight = false;
11
12
  this.nativeProps = {};
13
+ this.line = 1;
12
14
  this.hanldeInput = (e) => {
13
15
  e.stopPropagation();
16
+ this.handleLineChange();
14
17
  this.onInput.emit({
15
18
  value: e.target.value,
16
19
  cursor: e.target.value.length
@@ -32,6 +35,58 @@ export class Textarea {
32
35
  value: e.target.value
33
36
  });
34
37
  };
38
+ this.handleLineChange = () => {
39
+ const line = this.getNumberOfLines();
40
+ if (line !== this.line) {
41
+ this.line = line;
42
+ this.onLineChange.emit({
43
+ height: this.textareaRef.clientHeight,
44
+ lineCount: this.line
45
+ });
46
+ }
47
+ };
48
+ this.calculateContentHeight = (ta, scanAmount) => {
49
+ let origHeight = ta.style.height, height = ta.offsetHeight, scrollHeight = ta.scrollHeight, overflow = ta.style.overflow;
50
+ /// only bother if the ta is bigger than content
51
+ if (height >= scrollHeight) {
52
+ /// check that our browser supports changing dimension
53
+ /// calculations mid-way through a function call...
54
+ ta.style.height = height + scanAmount + 'px';
55
+ /// because the scrollbar can cause calculation problems
56
+ ta.style.overflow = 'hidden';
57
+ /// by checking that scrollHeight has updated
58
+ if (scrollHeight < ta.scrollHeight) {
59
+ /// now try and scan the ta's height downwards
60
+ /// until scrollHeight becomes larger than height
61
+ while (ta.offsetHeight >= ta.scrollHeight) {
62
+ ta.style.height = (height -= scanAmount) + 'px';
63
+ }
64
+ /// be more specific to get the exact height
65
+ while (ta.offsetHeight < ta.scrollHeight) {
66
+ ta.style.height = height++ + 'px';
67
+ }
68
+ /// reset the ta back to it's original height
69
+ ta.style.height = origHeight;
70
+ /// put the overflow back
71
+ ta.style.overflow = overflow;
72
+ return height;
73
+ }
74
+ }
75
+ else {
76
+ return scrollHeight;
77
+ }
78
+ };
79
+ this.getNumberOfLines = () => {
80
+ const ta = this.textareaRef, style = window.getComputedStyle ? window.getComputedStyle(ta) : ta.style,
81
+ // This will get the line-height only if it is set in the css,
82
+ // otherwise it's "normal"
83
+ taLineHeight = parseInt(style.lineHeight, 10),
84
+ // Get the scroll height of the textarea
85
+ taHeight = this.calculateContentHeight(ta, taLineHeight),
86
+ // calculate the number of lines
87
+ numberOfLines = Math.floor(taHeight / taLineHeight);
88
+ return numberOfLines;
89
+ };
35
90
  }
36
91
  componentDidLoad() {
37
92
  Object.defineProperty(this.el, 'value', {
@@ -42,12 +97,16 @@ export class Textarea {
42
97
  this.autoFocus && this.textareaRef.focus();
43
98
  }
44
99
  render() {
45
- const { value, placeholder, disabled, maxlength, autoFocus, name, nativeProps, hanldeInput, handleFocus, handleBlur, handleChange } = this;
100
+ const { value, placeholder, disabled, maxlength, autoFocus, autoHeight, name, nativeProps, hanldeInput, handleFocus, handleBlur, handleChange } = this;
101
+ const otherProps = {};
102
+ if (autoHeight) {
103
+ otherProps.rows = this.line;
104
+ }
46
105
  return (h("textarea", Object.assign({ ref: input => {
47
106
  if (input) {
48
107
  this.textareaRef = input;
49
108
  }
50
- }, 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)));
109
+ }, 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)));
51
110
  }
52
111
  static get is() { return "taro-textarea-core"; }
53
112
  static get originalStyleUrls() { return {
@@ -145,6 +204,24 @@ export class Textarea {
145
204
  "reflect": false,
146
205
  "defaultValue": "false"
147
206
  },
207
+ "autoHeight": {
208
+ "type": "boolean",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "boolean",
212
+ "resolved": "boolean",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": false,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": ""
220
+ },
221
+ "attribute": "auto-height",
222
+ "reflect": false,
223
+ "defaultValue": "false"
224
+ },
148
225
  "name": {
149
226
  "type": "string",
150
227
  "mutable": false,
@@ -179,6 +256,9 @@ export class Textarea {
179
256
  "defaultValue": "{}"
180
257
  }
181
258
  }; }
259
+ static get states() { return {
260
+ "line": {}
261
+ }; }
182
262
  static get events() { return [{
183
263
  "method": "onInput",
184
264
  "name": "input",
@@ -239,6 +319,21 @@ export class Textarea {
239
319
  "resolved": "any",
240
320
  "references": {}
241
321
  }
322
+ }, {
323
+ "method": "onLineChange",
324
+ "name": "linechange",
325
+ "bubbles": true,
326
+ "cancelable": true,
327
+ "composed": true,
328
+ "docs": {
329
+ "tags": [],
330
+ "text": ""
331
+ },
332
+ "complexType": {
333
+ "original": "any",
334
+ "resolved": "any",
335
+ "references": {}
336
+ }
242
337
  }]; }
243
338
  static get elementRef() { return "el"; }
244
339
  }
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
11
  import { Component, h, Prop, Host, Element, Listen, Method } from '@stencil/core';
3
12
  import { formatTime } from './utils';
@@ -42,32 +51,40 @@ export class VideoControl {
42
51
  this.seekFunc(this.percentage * this.duration);
43
52
  this.toggleVisibility(true);
44
53
  }
45
- async setProgressBall(percentage) {
46
- if (this.progressBallRef) {
47
- this.progressBallRef.style.left = `${percentage * 100}%`;
48
- }
54
+ setProgressBall(percentage) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ if (this.progressBallRef) {
57
+ this.progressBallRef.style.left = `${percentage * 100}%`;
58
+ }
59
+ });
49
60
  }
50
- async toggleVisibility(nextVisible) {
51
- const visible = nextVisible === undefined ? !this.visible : nextVisible;
52
- if (visible) {
53
- this.hideControlsTimer && clearTimeout(this.hideControlsTimer);
54
- if (this.isPlaying) {
55
- this.hideControlsTimer = setTimeout(() => {
56
- this.toggleVisibility(false);
57
- }, 2000);
61
+ toggleVisibility(nextVisible) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const visible = nextVisible === undefined ? !this.visible : nextVisible;
64
+ if (visible) {
65
+ this.hideControlsTimer && clearTimeout(this.hideControlsTimer);
66
+ if (this.isPlaying) {
67
+ this.hideControlsTimer = setTimeout(() => {
68
+ this.toggleVisibility(false);
69
+ }, 2000);
70
+ }
71
+ this.controlsRef.style.visibility = 'visible';
58
72
  }
59
- this.controlsRef.style.visibility = 'visible';
60
- }
61
- else {
62
- this.controlsRef.style.visibility = 'hidden';
63
- }
64
- this.visible = !!visible;
73
+ else {
74
+ this.controlsRef.style.visibility = 'hidden';
75
+ }
76
+ this.visible = !!visible;
77
+ });
65
78
  }
66
- async getIsDraggingProgressBall() {
67
- return this.isDraggingProgressBall;
79
+ getIsDraggingProgressBall() {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ return this.isDraggingProgressBall;
82
+ });
68
83
  }
69
- async setCurrentTime(time) {
70
- this.currentTimeRef.innerHTML = formatTime(time);
84
+ setCurrentTime(time) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ this.currentTimeRef.innerHTML = formatTime(time);
87
+ });
71
88
  }
72
89
  render() {
73
90
  const { controls, currentTime, duration, isPlaying, pauseFunc, playFunc, showPlayBtn, showProgress } = this;